libewf-20140807/0000775000175000017500000000000013443455447015346 5ustar00lordyestalordyesta00000000000000libewf-20140807/ewf.net/0000775000175000017500000000000013443455447016714 5ustar00lordyestalordyesta00000000000000libewf-20140807/ewf.net/ewf.net.rc.in0000644000175000017500000000205212266743103021201 0ustar00lordyestalordyesta00000000000000#include #ifdef GCC_WINDRES VS_VERSION_INFO VERSIONINFO #else VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE #endif FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "Managed .Net wrapper library for libewf\0" VALUE "FileVersion", "@VERSION@" "\0" VALUE "InternalName", "ewf.net.dll\0" VALUE "LegalCopyright", "(c) 2006-2014, Joachim Metz \0" VALUE "OriginalFilename", "ewf.net.dll\0" VALUE "ProductName", "ewf.net\0" VALUE "ProductVersion", "@VERSION@" "\0" VALUE "Comments", "For more information visit http://code.google.com/p/libewf/\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0409, 1200 END END libewf-20140807/ewf.net/Makefile.am0000644000175000017500000000056112654056261020742 0ustar00lordyestalordyesta00000000000000EXTRA_DIST = \ ewf.net_datetime.cpp ewf.net_datetime.h \ ewf.net_definitions.h \ ewf.net_file_entry.cpp ewf.net_file_entry.h \ ewf.net_handle.cpp ewf.net_handle.h \ ewf.net_sector_range.cpp ewf.net_sector_range.h \ ewf.net_support.cpp ewf.net_support.h \ ewf.net.rc \ ewf.net.rc.in MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/ewf.net/ewf.net_sector_range.cpp0000644000175000017500000000245612266743062023521 0ustar00lordyestalordyesta00000000000000/* * SectorRange class of libewf .net managed wrapper * * 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 . */ #pragma managed( push, off ) #include #include #pragma managed( pop ) #include #include "ewf.net_sector_range.h" #using using namespace System; namespace EWF { SectorRange::SectorRange( System::UInt64 start_sector, System::UInt64 number_of_sectors ) { this->start_sector = start_sector; this->number_of_sectors = number_of_sectors; } } // namespace EWF libewf-20140807/ewf.net/ewf.net_handle.h0000644000175000017500000001163712320217053021732 0ustar00lordyestalordyesta00000000000000/* * Handle class of libewf .net managed wrapper * * 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( _EWF_NET_HANDLE_H ) #define _EWF_NET_HANDLE_H #include "ewf.net_file_entry.h" #include "ewf.net_sector_range.h" #using using namespace System; using namespace System::IO; namespace EWF { public ref class Handle sealed { private: System::IntPtr ewf_handle; private: Handle( System::IntPtr ewf_handle ); public: Handle( void ); ~Handle( void ); static int GetAccessFlagsRead( void ); static int GetAccessFlagsReadWrite( void ); static int GetAccessFlagsWrite( void ); static int GetAccessFlagsWriteResume( void ); static bool CheckFileSignature( System::String^ filename ); static array^ Glob( System::String^ filename ); Handle^ Clone( void ); void Open( array^ filenames, int access_flags ); void Close( void ); /* TODO add read write chunk functions ? */ int ReadBuffer( array^ buffer, int size ); int ReadRandom( array^ buffer, int size, System::Int64 offset ); int WriteBuffer( array^ buffer, int size ); int WriteRandom( array^ buffer, int size, System::Int64 offset ); System::Int64 SeekOffset( System::Int64 offset, System::IO::SeekOrigin origin ); System::Int64 GetOffset( void ); /* TODO add segment file functions ? */ System::UInt32 GetSectorsPerChunk( void ); void SetSectorsPerChunk( System::UInt32 sectors_per_chunk ); System::UInt32 GetBytesPerSector( void ); void SetBytesPerSector( System::UInt32 bytes_per_sector ); System::UInt64 GetNumberOfSectors( void ); System::UInt32 GetChunkSize( void ); System::UInt32 GetErrorGranularity( void ); void SetErrorGranularity( System::UInt32 error_granularity ); /* TODO add compression values functions ? */ System::UInt64 GetMediaSize( void ); void SetMediaSize( System::UInt64 media_size ); System::Byte GetMediaType( void ); void SetMediaType( System::Byte media_type ); System::Byte GetMediaFlags( void ); void SetMediaFlags( System::Byte media_flags ); System::Byte GetFormat( void ); void SetFormat( System::Byte format ); /* TODO add GUID functions ? */ /* TODO add MD5 hash functions ? why bother when Get/SetHashValue are available ? */ /* TODO add SHA1 hash functions ? why bother when Get/SetHashValue are available ? */ /* TODO add other functions ? */ int GetNumberOfAcquiryErrors( void ); SectorRange^ GetAcquiryError( int index ); void AppendAcquiryError( SectorRange^ sector_range ); int GetNumberOfChecksumErrors( void ); SectorRange^ GetChecksumError( int index ); void AppendChecksumError( SectorRange^ sector_range ); int GetNumberOfSessions( void ); SectorRange^ GetSession( int index ); void AppendSession( SectorRange^ sector_range ); int GetNumberOfTracks( void ); SectorRange^ GetTrack( int index ); void AppendTrack( SectorRange^ sector_range ); /* TODO add header codepage functions ? int GetHeaderCodepage( void ); void SetHeaderCodepage( int codepage ); */ /* TODO add header date format functions ? int GetHeaderValuesDateFormat( void ); void SetHeaderValuesDateFormat( int date_format ); */ #if _MSC_VER >= 1600 int GetNumberOfHeaderValues( void ); System::String^ GetHeaderValueIdentifier( int index ); System::String^ GetHeaderValue( System::String^ identifier ); void SetHeaderValue( System::String^ identifier, System::String^ header_value ); int GetNumberOfHashValues( void ); System::String^ GetHashValueIdentifier( int index ); System::String^ GetHashValue( System::String^ identifier ); void SetHashValue( System::String^ identifier, System::String^ hash_value ); #endif /* _MSC_VER >= 1600 */ FileEntry^ GetRootFileEntry( void ); }; } // namespace EWF #endif libewf-20140807/ewf.net/ewf.net_file_entry.h0000644000175000017500000000441212320217053022630 0ustar00lordyestalordyesta00000000000000/* * FileEntry class of libewf .net managed wrapper * * 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( _EWF_NET_FILE_ENTRY_H ) #define _EWF_NET_FILE_ENTRY_H #using using namespace System; using namespace System::IO; namespace EWF { public ref class FileEntry sealed { private: System::IntPtr ewf_file_entry; public: FileEntry( System::IntPtr ewf_file_entry ); ~FileEntry( void ); System::UInt32 GetFlags( void ); System::Int64 GetMediaDataOffset( void ); System::UInt64 GetMediaDataSize( void ); System::Int64 GetDuplicateMediaDataOffset( void ); #if _MSC_VER >= 1600 System::String^ GetName( void ); #endif /* _MSC_VER >= 1600 */ System::UInt64 GetSize( void ); System::DateTime^ GetCreationTime( void ); System::DateTime^ GetModificationTime( void ); System::DateTime^ GetAccessTime( void ); System::DateTime^ GetEntryModificationTime( void ); #if _MSC_VER >= 1600 System::String^ GetHashValueMD5( void ); #endif /* _MSC_VER >= 1600 */ int GetNumberOfSubFileEntries( void ); FileEntry^ GetSubFileEntry( int sub_file_entry_index ); int ReadBuffer( array^ buffer, int size ); int ReadRandom( array^ buffer, int size, System::Int64 offset ); System::Int64 SeekOffset( System::Int64 offset, System::IO::SeekOrigin origin ); System::Int64 GetOffset( void ); }; } // namespace EWF #endif libewf-20140807/ewf.net/ewf.net_handle.cpp0000644000175000017500000023733612266743062022310 0ustar00lordyestalordyesta00000000000000/* * Handle class of libewf .net managed wrapper * * 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 . */ #pragma managed( push, off ) #include #include #include #include #include #pragma managed( pop ) #include #if _MSC_VER >= 1600 #include #endif #include "ewf.net_definitions.h" #include "ewf.net_file_entry.h" #include "ewf.net_handle.h" #include "ewf.net_sector_range.h" #using using namespace System; using namespace System::Runtime::InteropServices; #if _MSC_VER >= 1600 using namespace msclr::interop; #endif namespace EWF { Handle::Handle( System::IntPtr ewf_handle ) { this->ewf_handle = ewf_handle; } Handle::Handle( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::Handle"; if( libewf_handle_initialize( &handle, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to create ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } this->ewf_handle = Marshal::ReadIntPtr( (IntPtr) &handle ); } Handle::~Handle( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::~Handle"; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_free( &handle, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to free ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } int Handle::GetAccessFlagsRead( void ) { return( libewf_get_access_flags_read() ); } int Handle::GetAccessFlagsReadWrite( void ) { return( libewf_get_access_flags_read_write() ); } int Handle::GetAccessFlagsWrite( void ) { return( libewf_get_access_flags_write() ); } int Handle::GetAccessFlagsWriteResume( void ) { return( libewf_get_access_flags_write_resume() ); } bool Handle::CheckFileSignature( System::String^ filename ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; pin_ptr ewf_filename = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::CheckFileSignature"; int result = 0; ewf_filename = PtrToStringChars( filename ); result = libewf_check_file_signature_wide( ewf_filename, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to check file signature." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } else if( result == 0 ) { return( false ); } return( true ); } array^ Handle::Glob( System::String^ filename ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; array^ filenames = nullptr; libewf_error_t *error = NULL; wchar_t **ewf_filenames = NULL; pin_ptr ewf_filename = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::Glob"; size_t ewf_filename_length = 0; int ewf_filename_index = 0; int ewf_number_of_filenames = 0; ewf_filename = PtrToStringChars( filename ); ewf_filename_length = wcslen( ewf_filename ); if( libewf_glob_wide( ewf_filename, ewf_filename_length, LIBEWF_FORMAT_UNKNOWN, &ewf_filenames, &ewf_number_of_filenames, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to glob filenames." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } filenames = gcnew array( ewf_number_of_filenames ); for( ewf_filename_index = 0; ewf_filename_index < ewf_number_of_filenames; ewf_filename_index++ ) { try { filenames[ ewf_filename_index ] = gcnew System::String( ewf_filenames[ ewf_filename_index ] ); } catch( System::Exception^ exception ) { libewf_glob_wide_free( ewf_filenames, ewf_number_of_filenames, NULL ); throw exception; } } if( libewf_glob_wide_free( ewf_filenames, ewf_number_of_filenames, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to free globbed filenames." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( filenames ); } Handle^ Handle::Clone( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *destination_handle = NULL; libewf_handle_t *source_handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::Clone"; Marshal::WriteIntPtr( (IntPtr) &source_handle, this->ewf_handle ); if( libewf_handle_clone( &destination_handle, source_handle, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to clone ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( gcnew Handle( Marshal::ReadIntPtr( (IntPtr) &destination_handle ) ) ); } void Handle::Open( array^ filenames, int access_flags ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_handle_t *handle = NULL; libewf_error_t *error = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::Open"; wchar_t **ewf_filenames = NULL; pin_ptr filename = nullptr; int ewf_filename_index = 0; int ewf_number_of_filenames = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); ewf_number_of_filenames = filenames->Length; if( ewf_number_of_filenames <= 0 ) { throw gcnew System::Exception( "ewf.net " + function + ": missing filenames." ); } ewf_filenames = (wchar_t **) memory_allocate( sizeof( wchar_t* ) * ewf_number_of_filenames ); if( ewf_filenames == NULL ) { throw gcnew System::Exception( "ewf.net " + function + ": unable to create filenames." ); } for( ewf_filename_index = 0; ewf_filename_index < ewf_number_of_filenames; ewf_filename_index++ ) { filename = PtrToStringChars( filenames[ ewf_filename_index ] ); ewf_filenames[ ewf_filename_index ] = (wchar_t *) filename; } if( libewf_handle_open_wide( handle, (wchar_t * const *) ewf_filenames, ewf_number_of_filenames, access_flags, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to open ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_filenames ); throw gcnew System::Exception( error_string ); } memory_free( ewf_filenames ); } void Handle::Close( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::Close"; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_close( handle, &error ) != 0 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to close ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } int Handle::ReadBuffer( array^ buffer, int size ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::ReadBuffer"; pin_ptr ewf_buffer = nullptr; size_t read_count = 0; if( size < 0 ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": invalid size" ); } if( size == 0 ) { return( 0 ); } if( size > buffer->Length ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": buffer too small" ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); ewf_buffer = &( buffer[ 0 ] ); read_count = libewf_handle_read_buffer( handle, ewf_buffer, (size_t) size, &error ); if( read_count == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to read buffer from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( (int) read_count ); } int Handle::ReadRandom( array^ buffer, int size, System::Int64 offset ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::ReadRandom"; pin_ptr ewf_buffer = nullptr; off64_t ewf_offset = 0; size_t read_count = 0; if( size < 0 ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": invalid size" ); } if( size == 0 ) { return( 0 ); } if( size > buffer->Length ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": buffer too small" ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_offset, offset ); ewf_buffer = &( buffer[ 0 ] ); read_count = libewf_handle_read_random( handle, ewf_buffer, (size_t) size, ewf_offset, &error ); if( read_count == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to read random from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( (int) read_count ); } int Handle::WriteBuffer( array^ buffer, int size ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::WriteBuffer"; pin_ptr ewf_buffer = nullptr; size_t write_count = 0; if( size < 0 ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": invalid size" ); } if( size == 0 ) { return( 0 ); } if( size > buffer->Length ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": buffer too small" ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); ewf_buffer = &( buffer[ 0 ] ); write_count = libewf_handle_write_buffer( handle, ewf_buffer, (size_t) size, &error ); if( write_count == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to write buffer to ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( (int) write_count ); } int Handle::WriteRandom( array^ buffer, int size, System::Int64 offset ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::WriteRandom"; pin_ptr ewf_buffer = nullptr; off64_t ewf_offset = 0; size_t write_count = 0; if( size < 0 ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": invalid size" ); } if( size == 0 ) { return( 0 ); } if( size > buffer->Length ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": buffer too small" ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_offset, offset ); ewf_buffer = &( buffer[ 0 ] ); write_count = libewf_handle_write_random( handle, ewf_buffer, (size_t) size, ewf_offset, &error ); if( write_count == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to write random to ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( (int) write_count ); } System::Int64 Handle::SeekOffset( System::Int64 offset, System::IO::SeekOrigin origin ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SeekOffset"; off64_t ewf_offset = 0; int ewf_whence = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_offset, offset ); if( origin == System::IO::SeekOrigin::Begin ) { ewf_whence = SEEK_SET; } else if( origin == System::IO::SeekOrigin::Current ) { ewf_whence = SEEK_CUR; } else if( origin == System::IO::SeekOrigin::End ) { ewf_whence = SEEK_END; } else { throw gcnew System::ArgumentException( "ewf.net " + function + ": unsupported origin" ); } ewf_offset = libewf_handle_seek_offset( handle, ewf_offset, ewf_whence, &error ); if( ewf_offset == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to seek offset in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } offset = Marshal::ReadInt64( (IntPtr) &ewf_offset ); return( offset ); } System::Int64 Handle::GetOffset( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetOffset"; off64_t ewf_offset = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_offset( handle, &ewf_offset, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve offset from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_offset ) ); } System::UInt32 Handle::GetSectorsPerChunk( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetSectorsPerChunk"; uint32_t ewf_sectors_per_chunk = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_sectors_per_chunk( handle, &ewf_sectors_per_chunk, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve sectors per chunk from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt32( (IntPtr) &ewf_sectors_per_chunk ) ); } void Handle::SetSectorsPerChunk( System::UInt32 sectors_per_chunk ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetSectorsPerChunk"; uint32_t ewf_sectors_per_chunk = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt32( (IntPtr) &ewf_sectors_per_chunk, sectors_per_chunk ); if( libewf_handle_set_sectors_per_chunk( handle, ewf_sectors_per_chunk, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set sectors per chunk in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::UInt32 Handle::GetBytesPerSector( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetBytesPerSector"; uint32_t ewf_bytes_per_sector = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_bytes_per_sector( handle, &ewf_bytes_per_sector, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve bytes per sector from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt32( (IntPtr) &ewf_bytes_per_sector ) ); } void Handle::SetBytesPerSector( System::UInt32 bytes_per_sector ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetBytesPerSector"; uint32_t ewf_bytes_per_sector = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt32( (IntPtr) &ewf_bytes_per_sector, bytes_per_sector ); if( libewf_handle_set_bytes_per_sector( handle, ewf_bytes_per_sector, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set bytes per sectors in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::UInt64 Handle::GetNumberOfSectors( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfSectors"; uint64_t ewf_number_of_sectors = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_number_of_sectors( handle, &ewf_number_of_sectors, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of sectors from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_number_of_sectors ) ); } System::UInt32 Handle::GetChunkSize( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetChunkSize"; size32_t ewf_chunk_size = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_chunk_size( handle, &ewf_chunk_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve chunk size from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt32( (IntPtr) &ewf_chunk_size ) ); } System::UInt32 Handle::GetErrorGranularity( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetErrorGranularity"; uint32_t ewf_error_granularity = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_error_granularity( handle, &ewf_error_granularity, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve error granularity from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt32( (IntPtr) &ewf_error_granularity ) ); } void Handle::SetErrorGranularity( System::UInt32 error_granularity ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetErrorGranularity"; uint32_t ewf_error_granularity = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt32( (IntPtr) &ewf_error_granularity, error_granularity ); if( libewf_handle_set_error_granularity( handle, ewf_error_granularity, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set error granularity in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::UInt64 Handle::GetMediaSize( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetMediaSize"; size64_t ewf_media_size = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_media_size( handle, &ewf_media_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve media size from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_media_size ) ); } void Handle::SetMediaSize( System::UInt64 media_size ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetMediaSize"; size64_t ewf_media_size = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_media_size, media_size ); if( libewf_handle_set_media_size( handle, ewf_media_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set media size in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::Byte Handle::GetMediaType( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetMediaType"; uint8_t ewf_media_type = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_media_type( handle, &ewf_media_type, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve media type from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadByte( (IntPtr) &ewf_media_type ) ); } void Handle::SetMediaType( System::Byte media_type ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetMediaType"; uint8_t ewf_media_type = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteByte( (IntPtr) &ewf_media_type, media_type ); if( libewf_handle_set_media_type( handle, ewf_media_type, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set media type in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::Byte Handle::GetMediaFlags( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetMediaFlags"; uint8_t ewf_media_flags = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_media_flags( handle, &ewf_media_flags, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve media flags from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadByte( (IntPtr) &ewf_media_flags ) ); } void Handle::SetMediaFlags( System::Byte media_flags ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetMediaFlags"; uint8_t ewf_media_flags = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteByte( (IntPtr) &ewf_media_flags, media_flags ); if( libewf_handle_set_media_flags( handle, ewf_media_flags, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set media flags in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::Byte Handle::GetFormat( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetFormat"; uint8_t ewf_format = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_format( handle, &ewf_format, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve format from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadByte( (IntPtr) &ewf_format ) ); } void Handle::SetFormat( System::Byte format ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::SetFormat"; uint8_t ewf_format = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteByte( (IntPtr) &ewf_format, format ); if( libewf_handle_set_format( handle, ewf_format, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set format in ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } int Handle::GetNumberOfAcquiryErrors( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfAcquiryErrors"; uint32_t ewf_number_of_acquiry_errors = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_number_of_acquiry_errors( handle, &ewf_number_of_acquiry_errors, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of acquiry errors from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } if( ewf_number_of_acquiry_errors > (uint32_t) INT_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": number of acquiry errors exceeds maximum." ); } return( (int) ewf_number_of_acquiry_errors ); } SectorRange^ Handle::GetAcquiryError( int index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; SectorRange ^sector_range = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetAcquiryError"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( index > (int) UINT32_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": index exceeds maximum." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_acquiry_error( handle, (uint32_t) index, &ewf_start_sector, &ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of acquiry error: " + index + " from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } sector_range = gcnew SectorRange( Marshal::ReadInt64( (IntPtr) &ewf_start_sector ), Marshal::ReadInt64( (IntPtr) &ewf_number_of_sectors ) ); return( sector_range ); } void Handle::AppendAcquiryError( SectorRange^ sector_range ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::AppendAcquiryError"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( sector_range == nullptr ) { throw gcnew System::Exception( "ewf.net " + function + ": invalid sector range." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_start_sector, sector_range->start_sector ); Marshal::WriteInt64( (IntPtr) &ewf_number_of_sectors, sector_range->number_of_sectors ); result = libewf_handle_append_checksum_error( handle, ewf_start_sector, ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to append acquiry error to ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } int Handle::GetNumberOfChecksumErrors( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfChecksumErrors"; uint32_t ewf_number_of_checksum_errors = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_number_of_checksum_errors( handle, &ewf_number_of_checksum_errors, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of checksum errors from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } if( ewf_number_of_checksum_errors > (uint32_t) INT_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": number of checksum errors exceeds maximum." ); } return( (int) ewf_number_of_checksum_errors ); } SectorRange^ Handle::GetChecksumError( int index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; SectorRange ^sector_range = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetChecksumError"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( index > (int) UINT32_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": index exceeds maximum." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_checksum_error( handle, (uint32_t) index, &ewf_start_sector, &ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of checksum error: " + index + " from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } sector_range = gcnew SectorRange( Marshal::ReadInt64( (IntPtr) &ewf_start_sector ), Marshal::ReadInt64( (IntPtr) &ewf_number_of_sectors ) ); return( sector_range ); } void Handle::AppendChecksumError( SectorRange^ sector_range ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::AppendChecksumError"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( sector_range == nullptr ) { throw gcnew System::Exception( "ewf.net " + function + ": invalid sector range." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_start_sector, sector_range->start_sector ); Marshal::WriteInt64( (IntPtr) &ewf_number_of_sectors, sector_range->number_of_sectors ); result = libewf_handle_append_checksum_error( handle, ewf_start_sector, ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to append checksum error to ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } int Handle::GetNumberOfSessions( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfSessions"; uint32_t number_of_sessions = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_number_of_sessions( handle, &number_of_sessions, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of sessions from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } if( number_of_sessions > (uint32_t) INT_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": number of sessions exceeds maximum." ); } return( (int) number_of_sessions ); } SectorRange^ Handle::GetSession( int index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; SectorRange ^sector_range = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetSession"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( index > (int) UINT32_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": index exceeds maximum." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_session( handle, (uint32_t) index, &ewf_start_sector, &ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of session: " + index + " from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } sector_range = gcnew SectorRange( Marshal::ReadInt64( (IntPtr) &ewf_start_sector ), Marshal::ReadInt64( (IntPtr) &ewf_number_of_sectors ) ); return( sector_range ); } void Handle::AppendSession( SectorRange^ sector_range ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::AppendSession"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( sector_range == nullptr ) { throw gcnew System::Exception( "ewf.net " + function + ": invalid sector range." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_start_sector, sector_range->start_sector ); Marshal::WriteInt64( (IntPtr) &ewf_number_of_sectors, sector_range->number_of_sectors ); result = libewf_handle_append_session( handle, ewf_start_sector, ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to append session to ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } int Handle::GetNumberOfTracks( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfTracks"; uint32_t number_of_tracks = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_number_of_tracks( handle, &number_of_tracks, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of tracks from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } if( number_of_tracks > (uint32_t) INT_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": number of tracks exceeds maximum." ); } return( (int) number_of_tracks ); } SectorRange^ Handle::GetTrack( int index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; SectorRange ^sector_range = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetTrack"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( index > (int) UINT32_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": index exceeds maximum." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_track( handle, (uint32_t) index, &ewf_start_sector, &ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of track: " + index + " from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } sector_range = gcnew SectorRange( Marshal::ReadInt64( (IntPtr) &ewf_start_sector ), Marshal::ReadInt64( (IntPtr) &ewf_number_of_sectors ) ); return( sector_range ); } void Handle::AppendTrack( SectorRange^ sector_range ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::AppendTrack"; uint64_t ewf_start_sector = 0; uint64_t ewf_number_of_sectors = 0; int result = 0; if( sector_range == nullptr ) { throw gcnew System::Exception( "ewf.net " + function + ": invalid sector range." ); } Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); Marshal::WriteInt64( (IntPtr) &ewf_start_sector, sector_range->start_sector ); Marshal::WriteInt64( (IntPtr) &ewf_number_of_sectors, sector_range->number_of_sectors ); result = libewf_handle_append_track( handle, ewf_start_sector, ewf_number_of_sectors, &error ); if( result != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to append track to ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } #if _MSC_VER >= 1600 int Handle::GetNumberOfHeaderValues( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfHeaderValues"; uint32_t number_of_header_values = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_number_of_header_values( handle, &number_of_header_values, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of header values from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } if( number_of_header_values > (uint32_t) INT_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": number of header values exceeds maximum." ); } return( (int) number_of_header_values ); } System::String^ Handle::GetHeaderValueIdentifier( int index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::Text::UTF8Encoding^ encoding = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetHeaderValueIdentifier"; System::String^ header_value_identifier = nullptr; uint8_t *ewf_header_value_identifier = NULL; size_t ewf_header_value_identifier_size = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_header_value_identifier_size( handle, index, &ewf_header_value_identifier_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve header value identifier size." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } ewf_header_value_identifier = (uint8_t *) memory_allocate( sizeof( uint8_t ) * ewf_header_value_identifier_size ); if( ewf_header_value_identifier == NULL ) { throw gcnew System::Exception( "ewf.net " + function + ": unable to create header value identifier." ); } if( libewf_handle_get_header_value_identifier( handle, index, ewf_header_value_identifier, ewf_header_value_identifier_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve header value identifier." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_header_value_identifier ); throw gcnew System::Exception( error_string ); } try { encoding = gcnew System::Text::UTF8Encoding( false, true ); header_value_identifier = gcnew System::String( (char *) ewf_header_value_identifier, 0, ewf_header_value_identifier_size - 1, encoding ); } catch( System::Exception^ exception ) { memory_free( ewf_header_value_identifier ); throw exception; } memory_free( ewf_header_value_identifier ); return( header_value_identifier ); } System::String^ Handle::GetHeaderValue( System::String^ identifier ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; marshal_context ^context = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetHeaderValue"; System::String^ header_value = nullptr; uint16_t *ewf_header_value = NULL; const char *ewf_header_value_identifier = NULL; size_t ewf_header_value_identifier_length = 0; size_t ewf_header_value_size = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); context = gcnew marshal_context(); ewf_header_value_identifier = context->marshal_as( identifier ); ewf_header_value_identifier_length = strlen( ewf_header_value_identifier ); result = libewf_handle_get_utf16_header_value_size( handle, (uint8_t *) ewf_header_value_identifier, ewf_header_value_identifier_length, &ewf_header_value_size, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve header value size." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); delete context; throw gcnew System::Exception( error_string ); } else if( result == 0 ) { delete context; return( nullptr ); } ewf_header_value = (uint16_t *) memory_allocate( sizeof( uint16_t ) * ewf_header_value_size ); if( ewf_header_value == NULL ) { delete context; throw gcnew System::Exception( "ewf.net " + function + ": unable to create header value." ); } if( libewf_handle_get_utf16_header_value( handle, (uint8_t *) ewf_header_value_identifier, ewf_header_value_identifier_length, ewf_header_value, ewf_header_value_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve header value." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_header_value ); delete context; throw gcnew System::Exception( error_string ); } try { header_value = gcnew System::String( (wchar_t *) ewf_header_value ); } catch( System::Exception^ exception ) { memory_free( ewf_header_value ); delete context; throw exception; } memory_free( ewf_header_value ); delete context; return( header_value ); } void Handle::SetHeaderValue( System::String^ identifier, System::String^ header_value ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; marshal_context ^context = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::SetHeaderValue"; pin_ptr ewf_header_value = nullptr; const char *ewf_header_value_identifier = NULL; size_t ewf_header_value_identifier_length = 0; size_t ewf_header_value_length = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); context = gcnew marshal_context(); ewf_header_value_identifier = context->marshal_as( identifier ); ewf_header_value_identifier_length = strlen( ewf_header_value_identifier ); ewf_header_value = PtrToStringChars( header_value ); ewf_header_value_length = wcslen( ewf_header_value ); if( libewf_handle_set_utf16_header_value( handle, (uint8_t *) ewf_header_value_identifier, ewf_header_value_identifier_length, (uint16_t *) ewf_header_value, ewf_header_value_length, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set header value." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); delete context; throw gcnew System::Exception( error_string ); } delete context; } int Handle::GetNumberOfHashValues( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::String^ error_string = nullptr; System::String^ function = "Handle::GetNumberOfHashValues"; uint32_t number_of_hash_values = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_number_of_hash_values( handle, &number_of_hash_values, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of hash values from ewf handle." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } if( number_of_hash_values > (uint32_t) INT_MAX ) { throw gcnew System::Exception( "ewf.net " + function + ": number of hash values exceeds maximum." ); } return( (int) number_of_hash_values ); } System::String^ Handle::GetHashValueIdentifier( int index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; System::Text::UTF8Encoding^ encoding = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetHashValueIdentifier"; System::String^ hash_value_identifier = nullptr; uint8_t *ewf_hash_value_identifier = NULL; size_t ewf_hash_value_identifier_size = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); if( libewf_handle_get_hash_value_identifier_size( handle, index, &ewf_hash_value_identifier_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve hash value identifier size." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } ewf_hash_value_identifier = (uint8_t *) memory_allocate( sizeof( uint8_t ) * ewf_hash_value_identifier_size ); if( ewf_hash_value_identifier == NULL ) { throw gcnew System::Exception( "ewf.net " + function + ": unable to create hash value identifier." ); } if( libewf_handle_get_hash_value_identifier( handle, index, ewf_hash_value_identifier, ewf_hash_value_identifier_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve hash value identifier." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_hash_value_identifier ); throw gcnew System::Exception( error_string ); } try { encoding = gcnew System::Text::UTF8Encoding( false, true ); hash_value_identifier = gcnew System::String( (char *) ewf_hash_value_identifier, 0, ewf_hash_value_identifier_size - 1, encoding ); } catch( System::Exception^ exception ) { memory_free( ewf_hash_value_identifier ); throw exception; } memory_free( ewf_hash_value_identifier ); return( hash_value_identifier ); } System::String^ Handle::GetHashValue( System::String^ identifier ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; marshal_context ^context = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetHashValue"; System::String^ hash_value = nullptr; uint16_t *ewf_hash_value = NULL; const char *ewf_hash_value_identifier = NULL; size_t ewf_hash_value_identifier_length = 0; size_t ewf_hash_value_size = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); context = gcnew marshal_context(); ewf_hash_value_identifier = context->marshal_as( identifier ); ewf_hash_value_identifier_length = strlen( ewf_hash_value_identifier ); result = libewf_handle_get_utf16_hash_value_size( handle, (uint8_t *) ewf_hash_value_identifier, ewf_hash_value_identifier_length, &ewf_hash_value_size, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve hash value size." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); delete context; throw gcnew System::Exception( error_string ); } else if( result == 0 ) { delete context; return( nullptr ); } ewf_hash_value = (uint16_t *) memory_allocate( sizeof( uint16_t ) * ewf_hash_value_size ); if( ewf_hash_value == NULL ) { delete context; throw gcnew System::Exception( "ewf.net " + function + ": unable to create hash value." ); } if( libewf_handle_get_utf16_hash_value( handle, (uint8_t *) ewf_hash_value_identifier, ewf_hash_value_identifier_length, ewf_hash_value, ewf_hash_value_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve hash value." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_hash_value ); delete context; throw gcnew System::Exception( error_string ); } try { hash_value = gcnew System::String( (wchar_t *) ewf_hash_value ); } catch( System::Exception^ exception ) { memory_free( ewf_hash_value ); delete context; throw exception; } memory_free( ewf_hash_value ); delete context; return( hash_value ); } void Handle::SetHashValue( System::String^ identifier, System::String^ hash_value ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; marshal_context ^context = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::SetHashValue"; pin_ptr ewf_hash_value = nullptr; const char *ewf_hash_value_identifier = NULL; size_t ewf_hash_value_identifier_length = 0; size_t ewf_hash_value_length = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); context = gcnew marshal_context(); ewf_hash_value_identifier = context->marshal_as( identifier ); ewf_hash_value_identifier_length = strlen( ewf_hash_value_identifier ); ewf_hash_value = PtrToStringChars( hash_value ); ewf_hash_value_length = wcslen( ewf_hash_value ); if( libewf_handle_set_utf16_hash_value( handle, (uint8_t *) ewf_hash_value_identifier, ewf_hash_value_identifier_length, (uint16_t *) ewf_hash_value, ewf_hash_value_length, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to set hash value." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); delete context; throw gcnew System::Exception( error_string ); } delete context; } #endif /* _MSC_VER >= 1600 */ FileEntry^ Handle::GetRootFileEntry( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *ewf_file_entry = NULL; libewf_handle_t *handle = NULL; FileEntry^ file_entry = nullptr; System::String^ error_string = nullptr; System::String^ function = "Handle::GetRootFileEntry"; int result = 0; Marshal::WriteIntPtr( (IntPtr) &handle, this->ewf_handle ); result = libewf_handle_get_root_file_entry( handle, &ewf_file_entry, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve root file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } else if( result == 0 ) { return( nullptr ); } file_entry = gcnew FileEntry( Marshal::ReadIntPtr( (IntPtr) &ewf_file_entry ) ); return( file_entry ); } } // namespace EWF libewf-20140807/ewf.net/ewf.net_support.h0000644000175000017500000000222112320217053022200 0ustar00lordyestalordyesta00000000000000/* * Support functions of libewf .net managed wrapper * * 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( _EWF_NET_SUPPORT_H ) #define _EWF_NET_SUPPORT_H #using using namespace System; namespace EWF { public ref class Support sealed { public: static System::String^ GetVersion( void ); /* TODO add codepage functions ? */ }; } // namespace EWF #endif libewf-20140807/ewf.net/ewf.net_definitions.h0000644000175000017500000000172412320217053023006 0ustar00lordyestalordyesta00000000000000/* * Definitions of libewf .net managed wrapper * * 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( _EWF_NET_DEFINITIONS_H ) #define _EWF_NET_DEFINITIONS_H #define EWF_NET_ERROR_STRING_SIZE 512 #endif libewf-20140807/ewf.net/ewf.net_file_entry.cpp0000644000175000017500000006616412266743062023214 0ustar00lordyestalordyesta00000000000000/* * FileEntry class of libewf .net managed wrapper * * 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 . */ #pragma managed( push, off ) #include #include #include #include #pragma managed( pop ) #include #include "ewf.net_definitions.h" #include "ewf.net_datetime.h" #include "ewf.net_file_entry.h" #using using namespace System; using namespace System::Runtime::InteropServices; namespace EWF { FileEntry::FileEntry( System::IntPtr ewf_file_entry ) { this->ewf_file_entry = ewf_file_entry; } FileEntry::~FileEntry( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::~FileEntry"; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_free( &file_entry, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to free ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } } System::UInt32 FileEntry::GetFlags( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetFlags"; uint32_t ewf_flags = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_flags( file_entry, &ewf_flags, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve flags from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt32( (IntPtr) &ewf_flags ) ); } System::Int64 FileEntry::GetMediaDataOffset( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::MediaDataGetOffset"; off64_t ewf_offset = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_media_data_offset( file_entry, &ewf_offset, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve media data offset from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_offset ) ); } System::UInt64 FileEntry::GetMediaDataSize( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::MediaDataGetSize"; size64_t ewf_size = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_media_data_size( file_entry, &ewf_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve media data size from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_size ) ); } System::Int64 FileEntry::GetDuplicateMediaDataOffset( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::DuplicateMediaDataGetOffset"; off64_t ewf_offset = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_duplicate_media_data_offset( file_entry, &ewf_offset, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve duplicate media data offset from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_offset ) ); } #if _MSC_VER >= 1600 System::String^ FileEntry::GetName( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetName"; System::String^ name = nullptr; uint16_t *ewf_name = NULL; size_t ewf_name_size = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); result = libewf_file_entry_get_utf16_name_size( file_entry, &ewf_name_size, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve name size." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } else if( result == 0 ) { return( nullptr ); } ewf_name = (uint16_t *) memory_allocate( sizeof( uint16_t ) * ewf_name_size ); if( ewf_name == NULL ) { throw gcnew System::Exception( "ewf.net " + function + ": unable to create name." ); } if( libewf_file_entry_get_utf16_name( file_entry, ewf_name, ewf_name_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve name." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_name ); throw gcnew System::Exception( error_string ); } try { name = gcnew System::String( (wchar_t *) ewf_name ); } catch( System::Exception^ exception ) { memory_free( ewf_name ); throw exception; } memory_free( ewf_name ); return( name ); } #endif /* _MSC_VER >= 1600 */ System::UInt64 FileEntry::GetSize( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetSize"; size64_t ewf_size = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_size( file_entry, &ewf_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve size from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_size ) ); } System::DateTime^ FileEntry::GetCreationTime( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::DateTime^ creation_time = nullptr; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetCreationTime"; uint32_t ewf_creation_time = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_creation_time( file_entry, &ewf_creation_time, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve creation time from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } creation_time = DateTime::FromPOSIXTime( ewf_creation_time ); return( creation_time ); } System::DateTime^ FileEntry::GetModificationTime( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::DateTime^ modification_time = nullptr; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetModificationTime"; uint32_t ewf_modification_time = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_modification_time( file_entry, &ewf_modification_time, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve modification time from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } modification_time = DateTime::FromPOSIXTime( ewf_modification_time ); return( modification_time ); } System::DateTime^ FileEntry::GetAccessTime( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::DateTime^ access_time = nullptr; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetAccessTime"; uint32_t ewf_access_time = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_access_time( file_entry, &ewf_access_time, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve access time from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } access_time = DateTime::FromPOSIXTime( ewf_access_time ); return( access_time ); } System::DateTime^ FileEntry::GetEntryModificationTime( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::DateTime^ entry_modification_time = nullptr; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetEntryModificationTime"; uint32_t ewf_entry_modification_time = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_entry_modification_time( file_entry, &ewf_entry_modification_time, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve entry modification time from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } entry_modification_time = DateTime::FromPOSIXTime( ewf_entry_modification_time ); return( entry_modification_time ); } #if _MSC_VER >= 1600 System::String^ FileEntry::GetHashValueMD5( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetHashValueMD5"; System::String^ hash_value_md5 = nullptr; uint16_t *ewf_hash_value_md5 = NULL; size_t ewf_hash_value_md5_size = 33; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); ewf_hash_value_md5 = (uint16_t *) memory_allocate( sizeof( uint16_t ) * ewf_hash_value_md5_size ); if( ewf_hash_value_md5 == NULL ) { throw gcnew System::Exception( "ewf.net " + function + ": unable to create hash value MD5." ); } if( libewf_file_entry_get_utf16_hash_value_md5( file_entry, ewf_hash_value_md5, ewf_hash_value_md5_size, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve hash value MD5." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); memory_free( ewf_hash_value_md5 ); throw gcnew System::Exception( error_string ); } try { hash_value_md5 = gcnew System::String( (wchar_t *) ewf_hash_value_md5 ); } catch( System::Exception^ exception ) { memory_free( ewf_hash_value_md5 ); throw exception; } memory_free( ewf_hash_value_md5 ); return( hash_value_md5 ); } #endif /* _MSC_VER >= 1600 */ int FileEntry::GetNumberOfSubFileEntries( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetNumberOfSubFileEntries"; int number_of_sub_file_entries = 0; int result = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); result = libewf_file_entry_get_number_of_sub_file_entries( file_entry, &number_of_sub_file_entries, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve number of sub file entries from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( number_of_sub_file_entries ); } FileEntry^ FileEntry::GetSubFileEntry( int sub_file_entry_index ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; libewf_file_entry_t *ewf_sub_file_entry = NULL; FileEntry^ sub_file_entry = nullptr; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetSubFileEntry"; int result = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); result = libewf_file_entry_get_sub_file_entry( file_entry, sub_file_entry_index, &ewf_sub_file_entry, &error ); if( result == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve sub file entry: " + sub_file_entry_index + " from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } else if( result == 0 ) { return( nullptr ); } sub_file_entry = gcnew FileEntry( Marshal::ReadIntPtr( (IntPtr) &ewf_sub_file_entry ) ); return( sub_file_entry ); } int FileEntry::ReadBuffer( array^ buffer, int size ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::ReadBuffer"; pin_ptr ewf_buffer = nullptr; size_t read_count = 0; if( size < 0 ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": invalid size" ); } if( size == 0 ) { return( 0 ); } if( size > buffer->Length ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": buffer too small" ); } Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); ewf_buffer = &( buffer[ 0 ] ); read_count = libewf_file_entry_read_buffer( file_entry, ewf_buffer, (size_t) size, &error ); if( read_count == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to read buffer from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( (int) read_count ); } int FileEntry::ReadRandom( array^ buffer, int size, System::Int64 offset ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::ReadRandom"; pin_ptr ewf_buffer = nullptr; off64_t ewf_offset = 0; size_t read_count = 0; if( size < 0 ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": invalid size" ); } if( size == 0 ) { return( 0 ); } if( size > buffer->Length ) { throw gcnew System::ArgumentException( "ewf.net " + function + ": buffer too small" ); } Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); Marshal::WriteInt64( (IntPtr) &ewf_offset, offset ); ewf_buffer = &( buffer[ 0 ] ); read_count = libewf_file_entry_read_random( file_entry, ewf_buffer, (size_t) size, ewf_offset, &error ); if( read_count == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to read random from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( (int) read_count ); } System::Int64 FileEntry::SeekOffset( System::Int64 offset, System::IO::SeekOrigin origin ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::SeekOffset"; off64_t ewf_offset = 0; int ewf_whence = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); Marshal::WriteInt64( (IntPtr) &ewf_offset, offset ); if( origin == System::IO::SeekOrigin::Begin ) { ewf_whence = SEEK_SET; } else if( origin == System::IO::SeekOrigin::Current ) { ewf_whence = SEEK_CUR; } else if( origin == System::IO::SeekOrigin::End ) { ewf_whence = SEEK_END; } else { throw gcnew System::ArgumentException( "ewf.net " + function + ": unsupported origin" ); } ewf_offset = libewf_file_entry_seek_offset( file_entry, ewf_offset, ewf_whence, &error ); if( ewf_offset == -1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to seek offset in ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } offset = Marshal::ReadInt64( (IntPtr) &ewf_offset ); return( offset ); } System::Int64 FileEntry::GetOffset( void ) { char ewf_error_string[ EWF_NET_ERROR_STRING_SIZE ]; libewf_error_t *error = NULL; libewf_file_entry_t *file_entry = NULL; System::String^ error_string = nullptr; System::String^ function = "FileEntry::GetOffset"; off64_t ewf_offset = 0; Marshal::WriteIntPtr( (IntPtr) &file_entry, this->ewf_file_entry ); if( libewf_file_entry_get_offset( file_entry, &ewf_offset, &error ) != 1 ) { error_string = gcnew System::String( "ewf.net " + function + ": unable to retrieve offset from ewf file entry." ); if( libewf_error_backtrace_sprint( error, &( ewf_error_string[ 1 ] ), EWF_NET_ERROR_STRING_SIZE - 1 ) > 0 ) { ewf_error_string[ 0 ] = '\n'; error_string = System::String::Concat( error_string, gcnew System::String( ewf_error_string ) ); } libewf_error_free( &error ); throw gcnew System::Exception( error_string ); } return( Marshal::ReadInt64( (IntPtr) &ewf_offset ) ); } } // namespace EWF libewf-20140807/ewf.net/Makefile.in0000664000175000017500000006263713443455347020776 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = ewf.net ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = ewf.net.rc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ewf.net.rc.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ EXTRA_DIST = \ ewf.net_datetime.cpp ewf.net_datetime.h \ ewf.net_definitions.h \ ewf.net_file_entry.cpp ewf.net_file_entry.h \ ewf.net_handle.cpp ewf.net_handle.h \ ewf.net_sector_range.cpp ewf.net_sector_range.h \ ewf.net_support.cpp ewf.net_support.h \ ewf.net.rc \ ewf.net.rc.in MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ewf.net/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu ewf.net/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): ewf.net.rc: $(top_builddir)/config.status $(srcdir)/ewf.net.rc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/ewf.net/ewf.net_support.cpp0000644000175000017500000000406012266743115022552 0ustar00lordyestalordyesta00000000000000/* * Support function of libewf .net managed wrapper * * 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 . */ #pragma managed( push, off ) #include #include #pragma managed( pop ) #include #include "ewf.net_definitions.h" #include "ewf.net_support.h" #using using namespace System; using namespace System::Reflection; using namespace System::Runtime::CompilerServices; using namespace System::Runtime::InteropServices; using namespace System::Security::Permissions; [assembly:AssemblyTitleAttribute("ewf.net")]; [assembly:AssemblyDescriptionAttribute("")]; [assembly:AssemblyConfigurationAttribute("")]; [assembly:AssemblyCompanyAttribute("")]; [assembly:AssemblyProductAttribute("ewf.net")]; [assembly:AssemblyCopyrightAttribute("Copyright (c) 2006-2014, Joachim Metz ")]; [assembly:AssemblyTrademarkAttribute("")]; [assembly:AssemblyCultureAttribute("")]; [assembly:AssemblyVersionAttribute("1.0.*")]; [assembly:ComVisible(false)]; [assembly:CLSCompliantAttribute(true)]; [assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; namespace EWF { System::String^ Support::GetVersion( void ) { return( gcnew System::String( libewf_get_version() ) ); } } // namespace EWF libewf-20140807/ewf.net/ewf.net_datetime.h0000644000175000017500000000245412320217053022270 0ustar00lordyestalordyesta00000000000000/* * Date and time functions of libewf .net managed wrapper * * 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( _EWF_NET_DATETIME_H ) #define _EWF_NET_DATETIME_H #include #include #using using namespace System; #if defined( __cplusplus ) extern "C" { #endif namespace EWF { public ref class DateTime sealed { public: static System::DateTime^ FromFiletime( System::UInt64 filetime ); static System::DateTime^ FromPOSIXTime( System::UInt32 posix_time ); }; } // namespace EWF #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewf.net/ewf.net_datetime.cpp0000644000175000017500000002006712266743062022640 0ustar00lordyestalordyesta00000000000000/* * Date and time functions of libewf .net managed wrapper * * 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 . */ #pragma managed( push, off ) #include #include #pragma managed( pop ) #include "ewf.net_datetime.h" #using using namespace System; namespace EWF { /* Creates a new datetime object from a filetime * Returns a DateTime object if successful or nullptr on error */ System::DateTime^ DateTime::FromFiletime( System::UInt64 filetime ) { System::DateTime^ date_time_object = nullptr; System::String^ error_string = nullptr; System::String^ function = "DateTime::FromFiletime"; System::Int32 days_in_century = 0; System::Int32 days_in_year = 0; System::Int32 year = 0; System::Int32 day = 0; System::Int32 days_in_month = 0; System::Int32 hours = 0; System::Int32 micro_seconds = 0; System::Int32 minutes = 0; System::Int32 month = 0; System::Int32 seconds = 0; /* The timestamp is in units of 100 nano seconds correct the value to seconds */ micro_seconds = ( filetime % 10000000 ) / 10; filetime /= 10000000; /* There are 60 seconds in a minute correct the value to minutes */ seconds = filetime % 60; filetime /= 60; /* There are 60 minutes in an hour correct the value to hours */ minutes = filetime % 60; filetime /= 60; /* There are 24 hours in a day correct the value to days */ hours = filetime % 24; filetime /= 24; /* Add 1 day to compensate that Jan 1 1601 is represented as 0 */ filetime += 1; /* Determine the number of years starting at '1 Jan 1601 00:00:00' * correct the value to days within the year */ year = 1601; if( filetime >= 36159 ) { year = 1700; filetime -= 36159; } while( filetime > 0 ) { if( ( year % 400 ) == 0 ) { days_in_century = 36525; } else { days_in_century = 36524; } if( filetime <= days_in_century ) { break; } filetime -= days_in_century; year += 100; } while( filetime > 0 ) { /* Check for a leap year * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) */ if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_year = 366; } else { days_in_year = 365; } if( filetime <= (System::UInt64) days_in_year ) { break; } filetime -= days_in_year; year += 1; } /* Determine the month correct the value to days within the month */ month = 1; while( filetime > 0 ) { /* February (2) */ if( month == 2 ) { if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_month = 29; } else { days_in_month = 28; } } /* April (4), June (6), September (9), November (11) */ else if( ( month == 4 ) || ( month == 6 ) || ( month == 9 ) || ( month == 11 ) ) { days_in_month = 30; } /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) || ( month == 5 ) || ( month == 7 ) || ( month == 8 ) || ( month == 10 ) || ( month == 12 ) ) { days_in_month = 31; } /* This should never happen, but just in case */ else { error_string = gcnew System::String( "ewf.net " + function + ": unsupported month: " + month + "." ); throw gcnew System::Exception( error_string ); } if( filetime <= (System::UInt64) days_in_month ) { break; } filetime -= days_in_month; month += 1; } /* Determine the day */ day = (System::Int32) filetime; date_time_object = gcnew System::DateTime( year, month, day, hours, minutes, seconds, micro_seconds ); return( date_time_object ); } /* Creates a new datetime object from a POSIX time * Returns a DateTime object if successful or nullptr on error */ System::DateTime^ DateTime::FromPOSIXTime( System::UInt32 posix_time ) { System::DateTime^ date_time_object = nullptr; System::String^ error_string = nullptr; System::String^ function = "DateTime::FromPOSIXTime"; System::Int32 days_in_year = 0; System::Int32 year = 0; System::Int32 day = 0; System::Int32 days_in_month = 0; System::Int32 hours = 0; System::Int32 minutes = 0; System::Int32 month = 0; System::Int32 seconds = 0; /* There are 60 seconds in a minute correct the value to minutes */ seconds = posix_time % 60; posix_time /= 60; /* There are 60 minutes in an hour correct the value to hours */ minutes = posix_time % 60; posix_time /= 60; /* There are 24 hours in a day correct the value to days */ hours = posix_time % 24; posix_time /= 24; /* Add 1 day to compensate that Jan 1 1601 is represented as 0 */ posix_time += 1; /* Determine the number of years starting at '1 Jan 1970 00:00:00' * correct the value to days within the year */ year = 1970; if( posix_time >= 10957 ) { year = 2000; posix_time -= 10957; } while( posix_time > 0 ) { /* Check for a leap year * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) */ if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_year = 366; } else { days_in_year = 365; } if( posix_time <= (System::UInt64) days_in_year ) { break; } posix_time -= days_in_year; year += 1; } /* Determine the month correct the value to days within the month */ month = 1; while( posix_time > 0 ) { /* February (2) */ if( month == 2 ) { if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_month = 29; } else { days_in_month = 28; } } /* April (4), June (6), September (9), November (11) */ else if( ( month == 4 ) || ( month == 6 ) || ( month == 9 ) || ( month == 11 ) ) { days_in_month = 30; } /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) || ( month == 5 ) || ( month == 7 ) || ( month == 8 ) || ( month == 10 ) || ( month == 12 ) ) { days_in_month = 31; } /* This should never happen, but just in case */ else { error_string = gcnew System::String( "ewf.net " + function + ": unsupported month: " + month + "." ); throw gcnew System::Exception( error_string ); } if( posix_time <= (System::UInt64) days_in_month ) { break; } posix_time -= days_in_month; month += 1; } /* Determine the day */ day = (System::Int32) posix_time; date_time_object = gcnew System::DateTime( year, month, day, hours, minutes, seconds, 0 ); return( date_time_object ); } } // namespace EWF libewf-20140807/ewf.net/ewf.net_sector_range.h0000644000175000017500000000246712320217053023153 0ustar00lordyestalordyesta00000000000000/* * SectorRange class of libewf .net managed wrapper * * 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( _EWF_NET_SECTOR_RANGE_H ) #define _EWF_NET_SECTOR_RANGE_H #using using namespace System; namespace EWF { public ref class SectorRange sealed { public: System::UInt64 start_sector; System::UInt64 number_of_sectors; public: SectorRange( System::UInt64 start_sector, System::UInt64 number_of_sectors ); /* Implicit defined: * ~SectorRange( void ); */ }; } // namespace EWF #endif libewf-20140807/ewf.net/ewf.net.rc0000664000175000017500000000205013443455443020601 0ustar00lordyestalordyesta00000000000000#include #ifdef GCC_WINDRES VS_VERSION_INFO VERSIONINFO #else VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE #endif FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "Managed .Net wrapper library for libewf\0" VALUE "FileVersion", "20140807" "\0" VALUE "InternalName", "ewf.net.dll\0" VALUE "LegalCopyright", "(c) 2006-2014, Joachim Metz \0" VALUE "OriginalFilename", "ewf.net.dll\0" VALUE "ProductName", "ewf.net\0" VALUE "ProductVersion", "20140807" "\0" VALUE "Comments", "For more information visit http://code.google.com/p/libewf/\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0409, 1200 END END libewf-20140807/libfcache/0000775000175000017500000000000013443455445017244 5ustar00lordyestalordyesta00000000000000libewf-20140807/libfcache/libfcache_extern.h0000664000175000017500000000242213443450046022672 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2018, 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( _LIBFCACHE_INTERNAL_EXTERN_H ) #define _LIBFCACHE_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache */ #if !defined( HAVE_LOCAL_LIBFCACHE ) #include #define LIBFCACHE_EXTERN_VARIABLE LIBFCACHE_EXTERN #else #define LIBFCACHE_EXTERN /* extern */ #define LIBFCACHE_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBFCACHE ) */ #endif /* !defined( _LIBFCACHE_INTERNAL_EXTERN_H ) */ libewf-20140807/libfcache/libfcache_types.h0000664000175000017500000000312513443450046022532 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_INTERNAL_TYPES_H ) #define _LIBFCACHE_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache * The definitions in are copied here * for local use of libfcache */ #if defined( HAVE_LOCAL_LIBFCACHE ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libfcache_cache {} libfcache_cache_t; typedef struct libfcache_cache_value {} libfcache_cache_value_t; #else typedef intptr_t libfcache_cache_t; typedef intptr_t libfcache_cache_value_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBFCACHE ) */ #endif /* !defined( _LIBFCACHE_INTERNAL_TYPES_H ) */ libewf-20140807/libfcache/libfcache_cache.h0000664000175000017500000000710513443450046022433 0ustar00lordyestalordyesta00000000000000/* * The cache functions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_CACHE_H ) #define _LIBFCACHE_CACHE_H #include #include #include "libfcache_cache_value.h" #include "libfcache_extern.h" #include "libfcache_libcdata.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfcache_internal_cache libfcache_internal_cache_t; struct libfcache_internal_cache { /* The cache entries array */ libcdata_array_t *entries_array; /* The cache entries list */ libcdata_list_t *entries_list; /* The number of cache values */ int number_of_cache_values; }; LIBFCACHE_EXTERN \ int libfcache_cache_initialize( libfcache_cache_t **cache, int maximum_cache_entries, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_free( libfcache_cache_t **cache, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_empty( libfcache_cache_t *cache, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_clone( libfcache_cache_t **destination_cache, libfcache_cache_t *source_cache, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_resize( libfcache_cache_t *cache, int maximum_cache_entries, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_get_number_of_entries( libfcache_cache_t *cache, int *number_of_entries, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_get_number_of_cache_values( libfcache_cache_t *cache, int *number_of_values, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_get_value_by_identifier( libfcache_cache_t *cache, int file_index, off64_t offset, int64_t timestamp, libfcache_cache_value_t **cache_value, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_get_value_by_index( libfcache_cache_t *cache, int cache_entry_index, libfcache_cache_value_t **cache_value, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_set_value_by_identifier( libfcache_cache_t *cache, int file_index, off64_t offset, int64_t timestamp, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_set_value_by_index( libfcache_cache_t *cache, int cache_entry_index, int file_index, off64_t offset, int64_t timestamp, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFCACHE_CACHE_H ) */ libewf-20140807/libfcache/libfcache_support.h0000664000175000017500000000233013443450046023077 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_SUPPORT_H ) #define _LIBFCACHE_SUPPORT_H #include #include #include "libfcache_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFCACHE ) LIBFCACHE_EXTERN \ const char *libfcache_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBFCACHE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFCACHE_SUPPORT_H ) */ libewf-20140807/libfcache/libfcache_support.c0000664000175000017500000000223413443450046023075 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfcache_definitions.h" #include "libfcache_support.h" #if !defined( HAVE_LOCAL_LIBFCACHE ) /* Returns the library version as a string */ const char *libfcache_get_version( void ) { return( (const char *) LIBFCACHE_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBFCACHE ) */ libewf-20140807/libfcache/Makefile.am0000664000175000017500000000151513443450046021272 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBFCACHE AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libfcache.la libfcache_la_SOURCES = \ libfcache_cache.c libfcache_cache.h \ libfcache_cache_value.c libfcache_cache_value.h \ libfcache_date_time.c libfcache_date_time.h \ libfcache_definitions.h \ libfcache_error.c libfcache_error.h \ libfcache_extern.h \ libfcache_libcdata.h \ libfcache_libcerror.h \ libfcache_support.c libfcache_support.h \ libfcache_types.h \ libfcache_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libfcache ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfcache_la_SOURCES) libewf-20140807/libfcache/libfcache_libcdata.h0000664000175000017500000000302113443450046023124 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2010-2018, 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( _LIBFCACHE_LIBCDATA_H ) #define _LIBFCACHE_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBFCACHE_LIBCDATA_H ) */ libewf-20140807/libfcache/libfcache_unused.h0000664000175000017500000000255613443450046022700 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2010-2018, 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( _LIBFCACHE_INTERNAL_UNUSED_H ) #define _LIBFCACHE_INTERNAL_UNUSED_H #include #if !defined( LIBFCACHE_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBFCACHE_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBFCACHE_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBFCACHE_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBFCACHE_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBFCACHE_INTERNAL_UNUSED_H ) */ libewf-20140807/libfcache/libfcache_libcerror.h0000664000175000017500000000264313443450046023355 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2010-2018, 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( _LIBFCACHE_LIBCERROR_H ) #define _LIBFCACHE_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBFCACHE_LIBCERROR_H ) */ libewf-20140807/libfcache/libfcache_definitions.h0000664000175000017500000000306713443450046023706 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_INTERNAL_DEFINITIONS_H ) #define _LIBFCACHE_INTERNAL_DEFINITIONS_H #include /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache */ #if !defined( HAVE_LOCAL_LIBFCACHE ) #include /* The definitions in are copied here * for local use of libfcache */ #else #define LIBFCACHE_VERSION 20181011 /* The libfcache version string */ #define LIBFCACHE_VERSION_STRING "20181011" /* The cache value flags definitions */ enum LIBFCACHE_CACHE_VALUE_FLAGS { /* The cache value is not managed by the library */ LIBFCACHE_CACHE_VALUE_FLAG_NON_MANAGED = 0x00, /* The cache value is managed by the library */ LIBFCACHE_CACHE_VALUE_FLAG_MANAGED = 0x01 }; #endif #endif libewf-20140807/libfcache/libfcache_cache_value.h0000664000175000017500000000613313443450046023627 0ustar00lordyestalordyesta00000000000000/* * Cache value functions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_CACHE_VALUE_H ) #define _LIBFCACHE_CACHE_VALUE_H #include #include #include "libfcache_extern.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfcache_internal_cache_value libfcache_internal_cache_value_t; struct libfcache_internal_cache_value { /* The cache index */ int cache_index; /* The file index */ int file_index; /* The offset */ off64_t offset; /* The timestamp */ int64_t timestamp; /* The value */ intptr_t *value; /* The value free function */ int (*value_free_function)( intptr_t **value, libcerror_error_t **error ); /* The flags */ uint8_t flags; }; int libfcache_cache_value_initialize( libfcache_cache_value_t **cache_value, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_value_free( libfcache_cache_value_t **cache_value, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_value_clear( libfcache_cache_value_t *cache_value, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_value_get_identifier( libfcache_cache_value_t *cache_value, int *file_index, off64_t *offset, int64_t *timestamp, libcerror_error_t **error ); int libfcache_cache_value_get_cache_index( libfcache_cache_value_t *cache_value, int *cache_index, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_value_set_identifier( libfcache_cache_value_t *cache_value, int file_index, off64_t offset, int64_t timestamp, libcerror_error_t **error ); int libfcache_cache_value_set_cache_index( libfcache_cache_value_t *cache_value, int cache_index, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_value_get_value( libfcache_cache_value_t *cache_value, intptr_t **value, libcerror_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_cache_value_set_value( libfcache_cache_value_t *cache_value, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFCACHE_CACHE_VALUE_H ) */ libewf-20140807/libfcache/libfcache_cache_value.c0000664000175000017500000003014413443450046023621 0ustar00lordyestalordyesta00000000000000/* * Cache value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfcache_cache_value.h" #include "libfcache_definitions.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" /* Creates a cache value * Make sure the value cache_value is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfcache_cache_value_initialize( libfcache_cache_value_t **cache_value, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_initialize"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } if( *cache_value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid cache value value already set.", function ); return( -1 ); } internal_cache_value = memory_allocate_structure( libfcache_internal_cache_value_t ); if( internal_cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create cache value.", function ); goto on_error; } if( memory_set( internal_cache_value, 0, sizeof( libfcache_internal_cache_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear cache value.", function ); goto on_error; } internal_cache_value->file_index = -1; internal_cache_value->offset = (off64_t) -1; *cache_value = (libfcache_cache_value_t *) internal_cache_value; return( 1 ); on_error: if( internal_cache_value != NULL ) { memory_free( internal_cache_value ); } return( -1 ); } /* Frees a cache value * Returns 1 if successful or -1 on error */ int libfcache_cache_value_free( libfcache_cache_value_t **cache_value, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_free"; int result = 1; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } if( *cache_value != NULL ) { internal_cache_value = (libfcache_internal_cache_value_t *) *cache_value; *cache_value = NULL; if( internal_cache_value->value != NULL ) { if( ( internal_cache_value->flags & LIBFCACHE_CACHE_VALUE_FLAG_MANAGED ) != 0 ) { if( internal_cache_value->value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid cache value - missing value free function.", function ); result = -1; } else if( internal_cache_value->value_free_function( &( internal_cache_value->value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value.", function ); result = -1; } } } memory_free( internal_cache_value ); } return( result ); } /* Clears the cache value * This function does not free the value * Returns 1 if successful or -1 on error */ int libfcache_cache_value_clear( libfcache_cache_value_t *cache_value, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_free"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; if( memory_set( internal_cache_value, 0, sizeof( libfcache_internal_cache_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear cache value.", function ); return( -1 ); } internal_cache_value->file_index = -1; internal_cache_value->offset = (off64_t) -1; return( 1 ); } /* Retrieves the cache value identifier * Returns 1 if successful or -1 on error */ int libfcache_cache_value_get_identifier( libfcache_cache_value_t *cache_value, int *file_index, off64_t *offset, int64_t *timestamp, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_get_identifier"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; if( file_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file index.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } *file_index = internal_cache_value->file_index; *offset = internal_cache_value->offset; *timestamp = internal_cache_value->timestamp; return( 1 ); } /* Retrieves the cache value cache index * Returns 1 if successful or -1 on error */ int libfcache_cache_value_get_cache_index( libfcache_cache_value_t *cache_value, int *cache_index, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_get_cache_index"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; if( cache_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache index.", function ); return( -1 ); } *cache_index = internal_cache_value->cache_index; return( 1 ); } /* Sets the cache value identifier * Returns 1 if successful or -1 on error */ int libfcache_cache_value_set_identifier( libfcache_cache_value_t *cache_value, int file_index, off64_t offset, int64_t timestamp, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_set_identifier"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; internal_cache_value->file_index = file_index; internal_cache_value->offset = offset; internal_cache_value->timestamp = timestamp; return( 1 ); } /* Sets the cache value cache index * Returns 1 if successful or -1 on error */ int libfcache_cache_value_set_cache_index( libfcache_cache_value_t *cache_value, int cache_index, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_set_cache_index"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; internal_cache_value->cache_index = cache_index; return( 1 ); } /* Retrieves the cache value * Returns 1 if successful or -1 on error */ int libfcache_cache_value_get_value( libfcache_cache_value_t *cache_value, intptr_t **value, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_get_value"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } *value = internal_cache_value->value; return( 1 ); } /* Sets the cache value * Returns 1 if successful or -1 on error */ int libfcache_cache_value_set_value( libfcache_cache_value_t *cache_value, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfcache_internal_cache_value_t *internal_cache_value = NULL; static char *function = "libfcache_cache_value_set_value"; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; if( value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value free function.", function ); return( -1 ); } if( ( internal_cache_value->flags & LIBFCACHE_CACHE_VALUE_FLAG_MANAGED ) != 0 ) { if( internal_cache_value->value != NULL ) { if( internal_cache_value->value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid cache value - missing free value function.", function ); return( -1 ); } if( internal_cache_value->value_free_function( &( internal_cache_value->value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value.", function ); return( -1 ); } } internal_cache_value->flags &= ~( LIBFCACHE_CACHE_VALUE_FLAG_MANAGED ); } internal_cache_value->value = value; internal_cache_value->value_free_function = value_free_function; internal_cache_value->flags |= flags; return( 1 ); } libewf-20140807/libfcache/Makefile.in0000664000175000017500000010230113443455350021301 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libfcache ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfcache_la_LIBADD = am__libfcache_la_SOURCES_DIST = libfcache_cache.c libfcache_cache.h \ libfcache_cache_value.c libfcache_cache_value.h \ libfcache_date_time.c libfcache_date_time.h \ libfcache_definitions.h libfcache_error.c libfcache_error.h \ libfcache_extern.h libfcache_libcdata.h libfcache_libcerror.h \ libfcache_support.c libfcache_support.h libfcache_types.h \ libfcache_unused.h @HAVE_LOCAL_LIBFCACHE_TRUE@am_libfcache_la_OBJECTS = \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_cache.lo \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_cache_value.lo \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_date_time.lo \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_error.lo \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_support.lo libfcache_la_OBJECTS = $(am_libfcache_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBFCACHE_TRUE@am_libfcache_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libfcache_cache.Plo \ ./$(DEPDIR)/libfcache_cache_value.Plo \ ./$(DEPDIR)/libfcache_date_time.Plo \ ./$(DEPDIR)/libfcache_error.Plo \ ./$(DEPDIR)/libfcache_support.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libfcache_la_SOURCES) DIST_SOURCES = $(am__libfcache_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBFCACHE_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBFCACHE_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBFCACHE_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBFCACHE_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBFCACHE_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBFCACHE_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBFCACHE_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBFCACHE_TRUE@noinst_LTLIBRARIES = libfcache.la @HAVE_LOCAL_LIBFCACHE_TRUE@libfcache_la_SOURCES = \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_cache.c libfcache_cache.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_cache_value.c libfcache_cache_value.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_date_time.c libfcache_date_time.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_definitions.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_error.c libfcache_error.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_extern.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_libcdata.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_libcerror.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_support.c libfcache_support.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_types.h \ @HAVE_LOCAL_LIBFCACHE_TRUE@ libfcache_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libfcache/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libfcache/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfcache.la: $(libfcache_la_OBJECTS) $(libfcache_la_DEPENDENCIES) $(EXTRA_libfcache_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libfcache_la_rpath) $(libfcache_la_OBJECTS) $(libfcache_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfcache_cache.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfcache_cache_value.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfcache_date_time.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfcache_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfcache_support.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libfcache_cache.Plo -rm -f ./$(DEPDIR)/libfcache_cache_value.Plo -rm -f ./$(DEPDIR)/libfcache_date_time.Plo -rm -f ./$(DEPDIR)/libfcache_error.Plo -rm -f ./$(DEPDIR)/libfcache_support.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libfcache ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfcache_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libfcache/libfcache_error.c0000664000175000017500000000555613443450046022524 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfcache_error.h" #include "libfcache_libcerror.h" #if !defined( HAVE_LOCAL_LIBFCACHE ) /* Free an error and its elements */ void libfcache_error_free( libfcache_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libfcache_error_fprint( libfcache_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libfcache_error_sprint( libfcache_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libfcache_error_backtrace_fprint( libfcache_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libfcache_error_backtrace_sprint( libfcache_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBFCACHE ) */ libewf-20140807/libfcache/libfcache_date_time.c0000664000175000017500000000444613443450046023323 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * Copyright (C) 2010-2018, 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 . */ #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libfcache_date_time.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" /* Retrieves the cache value timestamp * Returns 1 if successful or -1 on error */ int libfcache_date_time_get_timestamp( int64_t *timestamp, libcerror_error_t **error ) { #if defined( HAVE_CLOCK_GETTIME ) struct timespec time_structure; #endif static char *function = "libfcache_date_time_get_timestamp"; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } #if defined( HAVE_CLOCK_GETTIME ) if( clock_gettime( CLOCK_REALTIME, &time_structure ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current time structure.", function ); return( -1 ); } *timestamp = ( (int64_t) time_structure.tv_sec * 1000000000 ) + time_structure.tv_nsec; #else *timestamp = (int64_t) time( NULL ); if( *timestamp == (time_t) -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current time.", function ); return( -1 ); } #endif /* defined( HAVE_CLOCK_GETTIME ) */ return( 1 ); } libewf-20140807/libfcache/libfcache_cache.c0000664000175000017500000006042013443450046022425 0ustar00lordyestalordyesta00000000000000/* * The cache functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfcache_cache.h" #include "libfcache_cache_value.h" #include "libfcache_definitions.h" #include "libfcache_libcdata.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" /* Creates a cache * Make sure the value cache is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfcache_cache_initialize( libfcache_cache_t **cache, int maximum_cache_entries, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_initialize"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } if( *cache != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid cache value already set.", function ); return( -1 ); } if( maximum_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid maximum cache entries value zero or less.", function ); return( -1 ); } internal_cache = memory_allocate_structure( libfcache_internal_cache_t ); if( internal_cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create cache.", function ); goto on_error; } if( memory_set( internal_cache, 0, sizeof( libfcache_internal_cache_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear cache.", function ); memory_free( internal_cache ); return( -1 ); } if( libcdata_array_initialize( &( internal_cache->entries_array ), maximum_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create entries array.", function ); goto on_error; } if( libcdata_list_initialize( &( internal_cache->entries_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create entries list.", function ); goto on_error; } *cache = (libfcache_cache_t *) internal_cache; return( 1 ); on_error: if( internal_cache != NULL ) { if( internal_cache->entries_array != NULL ) { libcdata_array_free( &( internal_cache->entries_array ), NULL, NULL ); } memory_free( internal_cache ); } return( -1 ); } /* Frees a cache * Returns 1 if successful or -1 on error */ int libfcache_cache_free( libfcache_cache_t **cache, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_free"; int result = 1; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } if( *cache != NULL ) { internal_cache = (libfcache_internal_cache_t *) *cache; *cache = NULL; if( libcdata_list_free( &( internal_cache->entries_list ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the entries list.", function ); result = -1; } if( libcdata_array_free( &( internal_cache->entries_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfcache_cache_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the entries array.", function ); result = -1; } memory_free( internal_cache ); } return( result ); } /* Empties the cache * Returns 1 if successful or -1 on error */ int libfcache_cache_empty( libfcache_cache_t *cache, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_empty"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_list_empty( internal_cache->entries_list, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty entries list.", function ); return( -1 ); } if( libcdata_array_clear( internal_cache->entries_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfcache_cache_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear entries array.", function ); return( -1 ); } internal_cache->number_of_cache_values = 0; return( 1 ); } /* Clones (duplicates) the cache, not the cache values * Returns 1 if successful or -1 on error */ int libfcache_cache_clone( libfcache_cache_t **destination_cache, libfcache_cache_t *source_cache, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_source_cache = NULL; static char *function = "libfcache_cache_clone"; int number_of_cache_entries = 0; if( destination_cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination cache.", function ); return( -1 ); } if( *destination_cache != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination cache already set.", function ); return( -1 ); } if( source_cache == NULL ) { *destination_cache = NULL; return( 1 ); } internal_source_cache = (libfcache_internal_cache_t *) source_cache; if( libcdata_array_get_number_of_entries( internal_source_cache->entries_array, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries from source entries array.", function ); return( -1 ); } if( libfcache_cache_initialize( destination_cache, number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination cache.", function ); return( -1 ); } return( 1 ); } /* Resizes the cache * Returns 1 if successful or -1 on error */ int libfcache_cache_resize( libfcache_cache_t *cache, int maximum_cache_entries, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_resize"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_array_resize( internal_cache->entries_array, maximum_cache_entries, (int (*)(intptr_t **, libcerror_error_t **)) &libfcache_cache_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize entries array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of entries of the cache * Returns 1 if successful or -1 on error */ int libfcache_cache_get_number_of_entries( libfcache_cache_t *cache, int *number_of_entries, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_get_number_of_entries"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_array_get_number_of_entries( internal_cache->entries_array, number_of_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from entries array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of cache values * Returns 1 if successful or -1 on error */ int libfcache_cache_get_number_of_cache_values( libfcache_cache_t *cache, int *number_of_cache_values, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_get_number_of_cache_values"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_list_get_number_of_elements( internal_cache->entries_list, number_of_cache_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from entries list.", function ); return( -1 ); } return( 1 ); } /* Retrieves the cache value that matches the file index, offset and timestamp * Returns 1 if successful, 0 if no such value or -1 on error */ int libfcache_cache_get_value_by_identifier( libfcache_cache_t *cache, int file_index, off64_t offset, int64_t timestamp, libfcache_cache_value_t **cache_value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; libfcache_cache_value_t *safe_cache_value = NULL; libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_get_value_by_identifier"; off64_t cache_value_offset = 0; int64_t cache_value_timestamp = 0; int cache_value_file_index = 0; int number_of_cache_values = 0; int result = 0; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( cache_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache value.", function ); return( -1 ); } *cache_value = NULL; if( libcdata_list_get_number_of_elements( internal_cache->entries_list, &number_of_cache_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from entries list.", function ); return( -1 ); } if( libcdata_list_get_first_element( internal_cache->entries_list, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first list element.", function ); return( -1 ); } while( list_element != NULL ) { if( libcdata_list_element_get_value( list_element, (intptr_t **) &safe_cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value from list element.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( safe_cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } if( ( cache_value_file_index == file_index ) && ( cache_value_offset == offset ) && ( cache_value_timestamp == timestamp ) ) { result = 1; break; } if( libcdata_list_element_get_next_element( list_element, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next list element.", function ); return( -1 ); } } if( ( result != 0 ) && ( number_of_cache_values > 0 ) ) { if( libcdata_list_remove_element( internal_cache->entries_list, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove list element.", function ); return( -1 ); } if( libcdata_list_prepend_element( internal_cache->entries_list, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend list element.", function ); return( -1 ); } *cache_value = safe_cache_value; } return( result ); } /* Retrieves the cache value for the specific index * Returns 1 if successful or -1 on error */ int libfcache_cache_get_value_by_index( libfcache_cache_t *cache, int cache_entry_index, libfcache_cache_value_t **cache_value, libcerror_error_t **error ) { libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_get_value_by_index"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_array_get_entry_by_index( internal_cache->entries_array, cache_entry_index, (intptr_t **) cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value: %d from entries array.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Sets the cache value for the file index, offset and timestamp * Returns 1 if successful or -1 on error */ int libfcache_cache_set_value_by_identifier( libfcache_cache_t *cache, int file_index, off64_t offset, int64_t timestamp, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; libfcache_cache_value_t *cache_value = NULL; libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_set_value_by_identifier"; int cache_entry_index = 0; int number_of_cache_entries = 0; int number_of_cache_values = 0; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_array_get_number_of_entries( internal_cache->entries_array, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries from entries array.", function ); return( -1 ); } if( libcdata_list_get_number_of_elements( internal_cache->entries_list, &number_of_cache_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from entries list.", function ); return( -1 ); } if( number_of_cache_values < number_of_cache_entries ) { cache_entry_index = number_of_cache_values; if( libfcache_cache_value_initialize( &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create cache value.", function ); return( -1 ); } if( libfcache_cache_value_set_cache_index( cache_value, cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set cache index in cache value.", function ); libfcache_cache_value_free( &cache_value, NULL ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_cache->entries_array, cache_entry_index, (intptr_t *) cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set cache value: %d in entries array.", function, cache_entry_index ); libfcache_cache_value_free( &cache_value, NULL ); return( -1 ); } if( libcdata_list_prepend_value( internal_cache->entries_list, (intptr_t *) cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend cache value: %d to entries list.", function ); return( -1 ); } } else { if( libcdata_list_get_last_element( internal_cache->entries_list, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( list_element, (intptr_t **) &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value from list element.", function ); return( -1 ); } if( libfcache_cache_value_get_cache_index( cache_value, &cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache index from cache value.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_cache->entries_array, cache_entry_index, (intptr_t **) &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value: %d from entries array.", function, cache_entry_index ); return( -1 ); } } if( libfcache_cache_value_set_identifier( cache_value, file_index, offset, timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set identifier in cache value.", function ); return( -1 ); } if( libfcache_cache_value_set_value( cache_value, value, value_free_function, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache value.", function ); return( -1 ); } return( 1 ); } /* Sets the cache value for the specific index * Returns 1 if successful or -1 on error */ int libfcache_cache_set_value_by_index( libfcache_cache_t *cache, int cache_entry_index, int file_index, off64_t offset, int64_t timestamp, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libfcache_internal_cache_t *internal_cache = NULL; static char *function = "libfcache_cache_set_value_by_index"; if( cache == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache.", function ); return( -1 ); } internal_cache = (libfcache_internal_cache_t *) cache; if( libcdata_array_get_entry_by_index( internal_cache->entries_array, cache_entry_index, (intptr_t **) &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value: %d from entries array.", function, cache_entry_index ); return( -1 ); } if( cache_value == NULL ) { if( libfcache_cache_value_initialize( &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create cache value.", function ); return( -1 ); } if( libfcache_cache_value_set_cache_index( cache_value, cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set cache index in cache value.", function ); libfcache_cache_value_free( &cache_value, NULL ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_cache->entries_array, cache_entry_index, (intptr_t *) cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set cache value: %d in entries array.", function, cache_entry_index ); libfcache_cache_value_free( &cache_value, NULL ); return( -1 ); } if( libcdata_list_prepend_value( internal_cache->entries_list, (intptr_t *) cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend cache value: %d to entries list.", function ); return( -1 ); } } if( libfcache_cache_value_set_value( cache_value, value, value_free_function, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache value.", function ); return( -1 ); } if( libfcache_cache_value_set_identifier( cache_value, file_index, offset, timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set identifier in cache value.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libfcache/libfcache_error.h0000664000175000017500000000343413443450046022522 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_INTERNAL_ERROR_H ) #define _LIBFCACHE_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBFCACHE ) #include #endif #include "libfcache_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFCACHE ) LIBFCACHE_EXTERN \ void libfcache_error_free( libfcache_error_t **error ); LIBFCACHE_EXTERN \ int libfcache_error_fprint( libfcache_error_t *error, FILE *stream ); LIBFCACHE_EXTERN \ int libfcache_error_sprint( libfcache_error_t *error, char *string, size_t size ); LIBFCACHE_EXTERN \ int libfcache_error_backtrace_fprint( libfcache_error_t *error, FILE *stream ); LIBFCACHE_EXTERN \ int libfcache_error_backtrace_sprint( libfcache_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBFCACHE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFCACHE_INTERNAL_ERROR_H ) */ libewf-20140807/libfcache/libfcache_date_time.h0000664000175000017500000000234413443450046023323 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * Copyright (C) 2010-2018, 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( _LIBFCACHE_DATE_TIME_H ) #define _LIBFCACHE_DATE_TIME_H #include #include "libfcache_extern.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBFCACHE_EXTERN \ int libfcache_date_time_get_timestamp( int64_t *timestamp, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFCACHE_DATE_TIME_H ) */ libewf-20140807/pyewf/0000775000175000017500000000000013443455447016500 5ustar00lordyestalordyesta00000000000000libewf-20140807/pyewf/pyewf_libewf.h0000664000175000017500000000212113440663047021321 0ustar00lordyestalordyesta00000000000000/* * The internal libewf 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_LIBEWF_H ) #define _PYEWF_LIBEWF_H #include /* If Cygwin libtool DLL support is enabled set LIBEWF_DLL_IMPORT * before including libewf.h */ #if defined( _WIN32 ) && defined( DLL_EXPORT ) #define LIBEWF_DLL_IMPORT #endif #include #endif libewf-20140807/pyewf/pyewf_integer.h0000664000175000017500000000277013440663047021520 0ustar00lordyestalordyesta00000000000000/* * Integer functions * * 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_INTEGER_H ) #define _PYEWF_INTEGER_H #include #include #include "pyewf_libcerror.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif PyObject *pyewf_integer_signed_new_from_64bit( int64_t value_64bit ); PyObject *pyewf_integer_unsigned_new_from_64bit( uint64_t value_64bit ); int pyewf_integer_signed_copy_to_64bit( PyObject *integer_object, int64_t *value_64bit, libcerror_error_t **error ); int pyewf_integer_unsigned_copy_to_64bit( PyObject *integer_object, uint64_t *value_64bit, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _PYEWF_INTEGER_H ) */ libewf-20140807/pyewf/pyewf_metadata.c0000664000175000017500000006466513421024433021636 0ustar00lordyestalordyesta00000000000000/* * Metadata functions for the Python object definition of the libewf handle * * Copyright (c) 2008, David Collett * 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 . */ #include #include #include #include "pyewf_codepage.h" #include "pyewf_error.h" #include "pyewf_handle.h" #include "pyewf_integer.h" #include "pyewf_libcerror.h" #include "pyewf_libclocale.h" #include "pyewf_libewf.h" #include "pyewf_metadata.h" #include "pyewf_python.h" #include "pyewf_unused.h" /* Retrieves the size of the media data * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_handle_get_media_size( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_handle_get_media_size"; size64_t media_size = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_media_size( pyewf_handle->handle, &media_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve media size.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_unsigned_new_from_64bit( (uint64_t) media_size ); return( integer_object ); } /* Retrieves the codepage used for ASCII strings in the header * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_get_header_codepage( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; const char *codepage_string = NULL; static char *function = "pyewf_handle_get_header_codepage"; int header_codepage = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid handle.", function ); return( NULL ); } if( libewf_handle_get_header_codepage( pyewf_handle->handle, &header_codepage, &error ) != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve header codepage.", function ); libcerror_error_free( &error ); return( NULL ); } codepage_string = pyewf_codepage_to_string( header_codepage ); if( codepage_string == NULL ) { PyErr_Format( PyExc_ValueError, "%s: unsupported header codepage: %d.", function, header_codepage ); return( NULL ); } string_object = PyUnicode_FromString( codepage_string ); if( string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert codepage string into string object.", function ); return( NULL ); } return( string_object ); } /* Sets the codepage used for ASCII strings in the header * Returns 1 if successful or -1 on error */ int pyewf_handle_set_header_codepage_from_string( pyewf_handle_t *pyewf_handle, const char *codepage_string ) { libcerror_error_t *error = NULL; static char *function = "pyewf_handle_set_header_codepage_from_string"; size_t codepage_string_length = 0; uint32_t feature_flags = 0; int header_codepage = 0; int result = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file.", function ); return( -1 ); } if( codepage_string == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid codepage string.", function ); return( -1 ); } codepage_string_length = narrow_string_length( codepage_string ); feature_flags = LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 | LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_WINDOWS; if( libclocale_codepage_copy_from_string( &header_codepage, codepage_string, codepage_string_length, feature_flags, &error ) != 1 ) { pyewf_error_raise( error, PyExc_RuntimeError, "%s: unable to determine header codepage.", function ); libcerror_error_free( &error ); return( -1 ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_set_header_codepage( pyewf_handle->handle, header_codepage, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to set header codepage.", function ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the codepage used for ASCII strings in the header * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_set_header_codepage( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { static char *keyword_list[] = { "codepage", NULL }; char *codepage_string = NULL; int result = 0; if( PyArg_ParseTupleAndKeywords( arguments, keywords, "s", keyword_list, &codepage_string ) == 0 ) { return( NULL ); } result = pyewf_handle_set_header_codepage_from_string( pyewf_handle, codepage_string ); if( result != 1 ) { return( NULL ); } Py_IncRef( Py_None ); return( Py_None ); } /* Sets the codepage used for ASCII strings in the header * Returns a Python object if successful or NULL on error */ int pyewf_handle_set_header_codepage_setter( pyewf_handle_t *pyewf_handle, PyObject *string_object, void *closure PYEWF_ATTRIBUTE_UNUSED ) { PyObject *utf8_string_object = NULL; static char *function = "pyewf_handle_set_ascii_codepage_setter"; char *codepage_string = NULL; int result = 0; PYEWF_UNREFERENCED_PARAMETER( closure ) PyErr_Clear(); result = PyObject_IsInstance( string_object, (PyObject *) &PyUnicode_Type ); if( result == -1 ) { pyewf_error_fetch_and_raise( PyExc_RuntimeError, "%s: unable to determine if string object is of type unicode.", function ); return( -1 ); } else if( result != 0 ) { /* The codepage string should only contain ASCII characters. */ utf8_string_object = PyUnicode_AsUTF8String( string_object ); if( utf8_string_object == NULL ) { pyewf_error_fetch_and_raise( PyExc_RuntimeError, "%s: unable to convert unicode string to UTF-8.", function ); return( -1 ); } #if PY_MAJOR_VERSION >= 3 codepage_string = PyBytes_AsString( utf8_string_object ); #else codepage_string = PyString_AsString( utf8_string_object ); #endif if( codepage_string == NULL ) { return( -1 ); } result = pyewf_handle_set_header_codepage_from_string( pyewf_handle, codepage_string ); if( result != 1 ) { return( -1 ); } return( 0 ); } PyErr_Clear(); #if PY_MAJOR_VERSION >= 3 result = PyObject_IsInstance( string_object, (PyObject *) &PyBytes_Type ); #else result = PyObject_IsInstance( string_object, (PyObject *) &PyString_Type ); #endif if( result == -1 ) { pyewf_error_fetch_and_raise( PyExc_RuntimeError, "%s: unable to determine if string object is of type string.", function ); return( -1 ); } else if( result != 0 ) { #if PY_MAJOR_VERSION >= 3 codepage_string = PyBytes_AsString( string_object ); #else codepage_string = PyString_AsString( string_object ); #endif if( codepage_string == NULL ) { return( -1 ); } result = pyewf_handle_set_header_codepage_from_string( pyewf_handle, codepage_string ); if( result != 1 ) { return( -1 ); } return( 0 ); } PyErr_Format( PyExc_TypeError, "%s: unsupported string object type.", function ); return( -1 ); } /* Retrieves a header value * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_handle_get_header_value( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; static char *function = "pyewf_handle_get_header_value"; static char *keyword_list[] = { "identifier", NULL }; const char *errors = NULL; char *header_value_identifier = NULL; char *header_value = NULL; size_t header_value_identifier_length = 0; size_t header_value_size = 0; int result = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "s", keyword_list, &header_value_identifier ) == 0 ) { return( NULL ); } header_value_identifier_length = narrow_string_length( header_value_identifier ); Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_header_value_size( pyewf_handle->handle, (uint8_t *) header_value_identifier, header_value_identifier_length, &header_value_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 header value: %s size.", function, header_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Check if header value is present */ else if( result == 0 ) { Py_IncRef( Py_None ); return( Py_None ); } header_value = (char *) PyMem_Malloc( sizeof( char ) * header_value_size ); if( header_value == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create header value.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_header_value( pyewf_handle->handle, (uint8_t *) header_value_identifier, header_value_identifier_length, (uint8_t *) header_value, header_value_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 header value: %s.", function, header_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Check if the header value is present */ else if( result == 0 ) { PyMem_Free( header_value ); Py_IncRef( Py_None ); return( Py_None ); } /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( header_value, (Py_ssize_t) header_value_size - 1, errors ); if( string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert UTF-8 header value: %s into Unicode.", function, header_value_identifier ); goto on_error; } PyMem_Free( header_value ); return( string_object ); on_error: if( header_value != NULL ) { PyMem_Free( header_value ); } return( NULL ); } /* Retrieves the header values * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_handle_get_header_values( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *dictionary_object = NULL; PyObject *string_object = NULL; static char *function = "pyewf_handle_get_header_values"; const char *errors = NULL; char *header_value = NULL; char *header_value_identifier = NULL; size_t header_value_identifier_length = 0; size_t header_value_identifier_size = 0; size_t header_value_size = 0; uint32_t number_of_header_values = 0; uint32_t header_value_index = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_number_of_header_values( pyewf_handle->handle, &number_of_header_values, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: failed to retrieve number of header values.", function ); libcerror_error_free( &error ); goto on_error; } dictionary_object = PyDict_New(); for( header_value_index = 0; header_value_index < number_of_header_values; header_value_index++ ) { Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_header_value_identifier_size( pyewf_handle->handle, header_value_index, &header_value_identifier_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve header value: %d identifier size.", function, header_value_index ); libcerror_error_free( &error ); goto on_error; } header_value_identifier = (char *) PyMem_Malloc( sizeof( char ) * header_value_identifier_size ); if( header_value_identifier == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create header value identifier.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_header_value_identifier( pyewf_handle->handle, header_value_index, (uint8_t *) header_value_identifier, header_value_identifier_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve header value: %d identifier.", function, header_value_index ); libcerror_error_free( &error ); goto on_error; } header_value_identifier_length = narrow_string_length( header_value_identifier ); Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_header_value_size( pyewf_handle->handle, (uint8_t *) header_value_identifier, header_value_identifier_length, &header_value_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 header value: %s size.", function, header_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Ignore empty header values */ if( ( result != 0 ) && ( header_value_size > 0 ) ) { header_value = (char *) PyMem_Malloc( sizeof( char ) * header_value_size ); if( header_value == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create header value.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_header_value( pyewf_handle->handle, (uint8_t *) header_value_identifier, header_value_identifier_length, (uint8_t *) header_value, header_value_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 header value: %s.", function, header_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( header_value, header_value_size - 1, errors ); if( string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert UTF-8 header value: %s into Unicode.", function, header_value_identifier ); goto on_error; } if( PyDict_SetItemString( dictionary_object, header_value_identifier, string_object ) != 0 ) { PyErr_Format( PyExc_MemoryError, "%s: unable to set header value: %s in dictionary.", function, header_value_identifier ); goto on_error; } string_object = NULL; PyMem_Free( header_value ); header_value = NULL; } PyMem_Free( header_value_identifier ); header_value_identifier = NULL; } return( dictionary_object ); on_error: if( string_object != NULL ) { Py_DecRef( string_object ); } if( header_value != NULL ) { PyMem_Free( header_value ); } if( header_value_identifier != NULL ) { PyMem_Free( header_value_identifier ); } if( dictionary_object != NULL ) { Py_DecRef( dictionary_object ); } return( NULL ); } /* Retrieves a hash value * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_handle_get_hash_value( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; static char *function = "pyewf_handle_get_hash_value"; static char *keyword_list[] = { "identifier", NULL }; const char *errors = NULL; char *hash_value_identifier = NULL; char *hash_value = NULL; size_t hash_value_identifier_length = 0; size_t hash_value_size = 0; int result = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "s", keyword_list, &hash_value_identifier ) == 0 ) { return( NULL ); } hash_value_identifier_length = narrow_string_length( hash_value_identifier ); Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_hash_value_size( pyewf_handle->handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, &hash_value_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 hash value: %s size.", function, hash_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Check if hash value is present */ else if( result == 0 ) { Py_IncRef( Py_None ); return( Py_None ); } hash_value = (char *) PyMem_Malloc( sizeof( char ) * hash_value_size ); if( hash_value == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create hash value.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_hash_value( pyewf_handle->handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, (uint8_t *) hash_value, hash_value_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 hash value: %s.", function, hash_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Check if the hash value is present */ else if( result == 0 ) { PyMem_Free( hash_value ); Py_IncRef( Py_None ); return( Py_None ); } /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( hash_value, (Py_ssize_t) hash_value_size - 1, errors ); if( string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert UTF-8 hash value: %s into Unicode.", function, hash_value_identifier ); goto on_error; } PyMem_Free( hash_value ); return( string_object ); on_error: if( hash_value != NULL ) { PyMem_Free( hash_value ); } return( NULL ); } /* Retrieves the hash values * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_handle_get_hash_values( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *dictionary_object = NULL; PyObject *string_object = NULL; static char *function = "pyewf_handle_get_hash_values"; const char *errors = NULL; char *hash_value = NULL; char *hash_value_identifier = NULL; size_t hash_value_identifier_length = 0; size_t hash_value_identifier_size = 0; size_t hash_value_size = 0; uint32_t number_of_hash_values = 0; uint32_t hash_value_index = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_number_of_hash_values( pyewf_handle->handle, &number_of_hash_values, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: failed to retrieve number of hash values.", function ); libcerror_error_free( &error ); goto on_error; } dictionary_object = PyDict_New(); for( hash_value_index = 0; hash_value_index < number_of_hash_values; hash_value_index++ ) { Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_hash_value_identifier_size( pyewf_handle->handle, hash_value_index, &hash_value_identifier_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve hash value: %d identifier size.", function, hash_value_index ); libcerror_error_free( &error ); goto on_error; } hash_value_identifier = (char *) PyMem_Malloc( sizeof( char ) * hash_value_identifier_size ); if( hash_value_identifier == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create hash value identifier.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_hash_value_identifier( pyewf_handle->handle, hash_value_index, (uint8_t *) hash_value_identifier, hash_value_identifier_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve hash value: %d identifier.", function, hash_value_index ); libcerror_error_free( &error ); goto on_error; } hash_value_identifier_length = narrow_string_length( hash_value_identifier ); Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_hash_value_size( pyewf_handle->handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, &hash_value_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 hash value: %s size.", function, hash_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Ignore empty hash values */ if( ( result != 0 ) && ( hash_value_size > 0 ) ) { hash_value = (char *) PyMem_Malloc( sizeof( char ) * hash_value_size ); if( hash_value == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create hash value.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_utf8_hash_value( pyewf_handle->handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, (uint8_t *) hash_value, hash_value_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve UTF-8 hash value: %s.", function, hash_value_identifier ); libcerror_error_free( &error ); goto on_error; } /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( hash_value, hash_value_size - 1, errors ); if( string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert UTF-8 hash value: %s into Unicode.", function, hash_value_identifier ); goto on_error; } if( PyDict_SetItemString( dictionary_object, hash_value_identifier, string_object ) != 0 ) { PyErr_Format( PyExc_MemoryError, "%s: unable to set hash value: %s in dictionary.", function, hash_value_identifier ); goto on_error; } string_object = NULL; PyMem_Free( hash_value ); hash_value = NULL; } PyMem_Free( hash_value_identifier ); hash_value_identifier = NULL; } return( dictionary_object ); on_error: if( string_object != NULL ) { Py_DecRef( string_object ); } if( hash_value != NULL ) { PyMem_Free( hash_value ); } if( hash_value_identifier != NULL ) { PyMem_Free( hash_value_identifier ); } if( dictionary_object != NULL ) { Py_DecRef( dictionary_object ); } return( NULL ); } libewf-20140807/pyewf/pyewf_libcerror.h0000664000175000017500000000251513440663047022043 0ustar00lordyestalordyesta00000000000000/* * The internal libcerror 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_LIBCERROR_H ) #define _PYEWF_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif #endif libewf-20140807/pyewf/pyewf_file_entry.h0000664000175000017500000001052313440663047022216 0ustar00lordyestalordyesta00000000000000/* * Python object definition of the libewf file entry * * 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_FILE_ENTRY_H ) #define _PYEWF_FILE_ENTRY_H #include #include #include "pyewf_handle.h" #include "pyewf_libcerror.h" #include "pyewf_libewf.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct pyewf_file_entry pyewf_file_entry_t; struct pyewf_file_entry { /* Python object initialization */ PyObject_HEAD /* The libewf file entry */ libewf_file_entry_t *file_entry; /* The handle object */ pyewf_handle_t *handle_object; }; extern PyMethodDef pyewf_file_entry_object_methods[]; extern PyTypeObject pyewf_file_entry_type_object; PyObject *pyewf_file_entry_new( libewf_file_entry_t *file_entry, pyewf_handle_t *handle_object ); int pyewf_file_entry_init( pyewf_file_entry_t *pyewf_file_entry ); void pyewf_file_entry_free( pyewf_file_entry_t *pyewf_file_entry ); PyObject *pyewf_file_entry_read_buffer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_file_entry_read_random( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_file_entry_seek_offset( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_file_entry_get_offset( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_size( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_creation_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_creation_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_modification_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_modification_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_access_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_access_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_entry_modification_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_entry_modification_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_name( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_hash_value_md5( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_number_of_sub_file_entries( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); PyObject *pyewf_file_entry_get_sub_file_entry_by_index( pyewf_file_entry_t *pyewf_file_entry, int sub_file_entry_index ); PyObject *pyewf_file_entry_get_sub_file_entry( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_file_entry_get_sub_file_entries( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/pyewf_libbfio.h0000664000175000017500000000265213440663047021470 0ustar00lordyestalordyesta00000000000000/* * The libbfio header wrapper * * 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_LIBBFIO_H ) #define _PYEWF_LIBBFIO_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT * before including libbfio.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBBFIO_DLL_IMPORT #endif #include #endif #endif libewf-20140807/pyewf/pyewf.h0000664000175000017500000000312713440663047020000 0ustar00lordyestalordyesta00000000000000/* * Python bindings for libewf (pyewf) * * Copyright (c) 2008, David Collett * 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_H ) #define _PYEWF_H #include #include #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif PyObject *pyewf_get_version( PyObject *self, PyObject *arguments ); PyObject *pyewf_check_file_signature( PyObject *self, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_check_file_signature_file_object( PyObject *self, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_glob( PyObject *self, PyObject *arguments, PyObject *keywords ); PyMODINIT_FUNC initpyewf( void ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/Makefile.am0000664000175000017500000000236313421024433020517 0ustar00lordyestalordyesta00000000000000if HAVE_PYTHON AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ pyexec_LTLIBRARIES = pyewf.la pyewf_la_SOURCES = \ pyewf.c pyewf.h \ pyewf_codepage.c pyewf_codepage.h \ pyewf_datetime.c pyewf_datetime.h \ pyewf_error.c pyewf_error.h \ pyewf_file_entries.c pyewf_file_entries.h \ pyewf_file_entry.c pyewf_file_entry.h \ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ pyewf_handle.c pyewf_handle.h \ pyewf_integer.c pyewf_integer.h \ pyewf_libbfio.h \ pyewf_libcerror.h \ pyewf_libclocale.h \ pyewf_libewf.h \ pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h \ pyewf_unused.h pyewf_la_LIBADD = \ @LIBCERROR_LIBADD@ \ ../libewf/libewf.la @LIBCDATA_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ pyewf_la_CPPFLAGS = $(PYTHON_CPPFLAGS) pyewf_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/pyewf/pyewf_handle.c0000664000175000017500000011142113440663047021303 0ustar00lordyestalordyesta00000000000000/* * Python object definition of the libewf handle * * Copyright (c) 2008, David Collett * 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 . */ #include #include #include #include #include #if defined( HAVE_STDLIB_H ) #include #endif #include "pyewf_error.h" #include "pyewf_file_entry.h" #include "pyewf_file_objects_io_pool.h" #include "pyewf_handle.h" #include "pyewf_integer.h" #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" #include "pyewf_libewf.h" #include "pyewf_metadata.h" #include "pyewf_python.h" #include "pyewf_unused.h" #if !defined( LIBEWF_HAVE_BFIO ) LIBEWF_EXTERN \ int libewf_handle_open_file_io_pool( libewf_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libewf_error_t **error ); #endif PyMethodDef pyewf_handle_object_methods[] = { { "signal_abort", (PyCFunction) pyewf_handle_signal_abort, METH_NOARGS, "signal_abort() -> None\n" "\n" "Signals the handle to abort the current activity." }, /* Functions to access the media data */ { "open", (PyCFunction) pyewf_handle_open, METH_VARARGS | METH_KEYWORDS, "open(filenames, mode='r') -> None\n" "\n" "Opens file(s) from a sequence (list) of all the segment filenames.\n" "Use pyewf.glob() to determine the segment filenames from first (e.g. E01)." }, { "open_file_objects", (PyCFunction) pyewf_handle_open_file_objects, METH_VARARGS | METH_KEYWORDS, "open_file_objects(file_objects, mode='r') -> None\n" "\n" "Opens a handle using a list of file-like objects." }, { "close", (PyCFunction) pyewf_handle_close, METH_NOARGS, "close() -> None\n" "\n" "Closes file(s)." }, { "read_buffer", (PyCFunction) pyewf_handle_read_buffer, METH_VARARGS | METH_KEYWORDS, "read_buffer(size) -> String\n" "\n" "Reads a buffer of media data." }, { "read_random", (PyCFunction) pyewf_handle_read_random, METH_VARARGS | METH_KEYWORDS, "read_random(size, offset) -> String\n" "\n" "Reads a buffer of media data at a specific offset." }, { "write_buffer", (PyCFunction) pyewf_handle_write_buffer, METH_VARARGS | METH_KEYWORDS, "write_buffer(buffer) -> None\n" "\n" "Writes a buffer of media data." }, { "write_random", (PyCFunction) pyewf_handle_write_random, METH_VARARGS | METH_KEYWORDS, "write_random(buffer, offset) -> None\n" "\n" "Writes a buffer of media data at a specific offset." }, { "seek_offset", (PyCFunction) pyewf_handle_seek_offset, METH_VARARGS | METH_KEYWORDS, "seek_offset(offset, whence) -> None\n" "\n" "Seeks an offset within the media data." }, { "get_offset", (PyCFunction) pyewf_handle_get_offset, METH_NOARGS, "get_offset() -> Integer\n" "\n" "Retrieves the current offset within the media data." }, /* Some Pythonesque aliases */ { "read", (PyCFunction) pyewf_handle_read_buffer, METH_VARARGS | METH_KEYWORDS, "read(size) -> String\n" "\n" "Reads a buffer of media data." }, { "write", (PyCFunction) pyewf_handle_write_buffer, METH_VARARGS | METH_KEYWORDS, "write(buffer, size) -> None\n" "\n" "Writes a buffer of media data." }, { "seek", (PyCFunction) pyewf_handle_seek_offset, METH_VARARGS | METH_KEYWORDS, "seek(offset, whence) -> None\n" "\n" "Seeks an offset within the media data." }, { "tell", (PyCFunction) pyewf_handle_get_offset, METH_NOARGS, "tell() -> Integer\n" "\n" "Retrieves the current offset within the media data." }, /* Functions to access the metadata */ { "get_media_size", (PyCFunction) pyewf_handle_get_media_size, METH_NOARGS, "get_media_size() -> Integer\n" "\n" "Retrieves the size of the media data." }, { "get_header_codepage", (PyCFunction) pyewf_handle_get_header_codepage, METH_NOARGS, "get_header_codepage() -> String\n" "\n" "Returns the codepage used for header strings." }, { "set_header_codepage", (PyCFunction) pyewf_handle_set_header_codepage, METH_VARARGS | METH_KEYWORDS, "set_header_codepage(codepage) -> None\n" "\n" "Set the codepage used for header strings.\n" "Expects the codepage to be a String containing a Python codec definition." }, { "get_header_value", (PyCFunction) pyewf_handle_get_header_value, METH_VARARGS | METH_KEYWORDS, "get_header_value(identifier) -> Unicode string or None\n" "\n" "Retrieves a header value by its identifier (name)." }, { "get_header_values", (PyCFunction) pyewf_handle_get_header_values, METH_NOARGS, "get_header_values() -> Dictionary\n" "\n" "Retrieves all header values." }, { "get_hash_value", (PyCFunction) pyewf_handle_get_hash_value, METH_VARARGS | METH_KEYWORDS, "get_hash_value(identifier) -> Unicode string or None\n" "\n" "Retrieves a hash value by its identifier (name)." }, { "get_hash_values", (PyCFunction) pyewf_handle_get_hash_values, METH_NOARGS, "get_hash_values() -> Dictionary\n" "\n" "Retrieves all hash values." }, /* Functions to access the (single) file entries */ { "get_root_file_entry", (PyCFunction) pyewf_handle_get_root_file_entry, METH_NOARGS, "get_root_file_entry() -> Object\n" "\n" "Retrieves the root file entry." }, /* Sentinel */ { NULL, NULL, 0, NULL } }; PyGetSetDef pyewf_handle_object_get_set_definitions[] = { { "header_codepage", (getter) pyewf_handle_get_header_codepage, (setter) pyewf_handle_set_header_codepage_setter, "The codepage used for header strings.", NULL }, { "media_size", (getter) pyewf_handle_get_media_size, (setter) 0, "The media size.", NULL }, /* Sentinel */ { NULL, NULL, NULL, NULL, NULL } }; PyTypeObject pyewf_handle_type_object = { PyVarObject_HEAD_INIT( NULL, 0 ) /* tp_name */ "pyewf.handle", /* tp_basicsize */ sizeof( pyewf_handle_t ), /* tp_itemsize */ 0, /* tp_dealloc */ (destructor) pyewf_handle_free, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ Py_TPFLAGS_DEFAULT, /* tp_doc */ "pyewf handle object (wraps libewf_handle_t)", /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ pyewf_handle_object_methods, /* tp_members */ 0, /* tp_getset */ pyewf_handle_object_get_set_definitions, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ (initproc) pyewf_handle_init, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ NULL, /* tp_mro */ NULL, /* tp_cache */ NULL, /* tp_subclasses */ NULL, /* tp_weaklist */ NULL, /* tp_del */ 0 }; /* Creates a new pyewf handle object * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_new( void ) { static char *function = "pyewf_handle_new"; pyewf_handle_t *pyewf_handle = NULL; pyewf_handle = PyObject_New( struct pyewf_handle, &pyewf_handle_type_object ); if( pyewf_handle == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to initialize handle.", function ); goto on_error; } if( pyewf_handle_init( pyewf_handle ) != 0 ) { PyErr_Format( PyExc_MemoryError, "%s: unable to initialize handle.", function ); goto on_error; } return( (PyObject *) pyewf_handle ); on_error: if( pyewf_handle != NULL ) { Py_DecRef( (PyObject *) pyewf_handle ); } return( NULL ); } /* Creates a new handle object and opens it * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_new_open( PyObject *self PYEWF_ATTRIBUTE_UNUSED, PyObject *arguments, PyObject *keywords ) { PyObject *pyewf_handle = NULL; PYEWF_UNREFERENCED_PARAMETER( self ) pyewf_handle = pyewf_handle_new(); pyewf_handle_open( (pyewf_handle_t *) pyewf_handle, arguments, keywords ); return( pyewf_handle ); } /* Creates a new handle object and opens it * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_new_open_file_objects( PyObject *self PYEWF_ATTRIBUTE_UNUSED, PyObject *arguments, PyObject *keywords ) { PyObject *pyewf_handle = NULL; PYEWF_UNREFERENCED_PARAMETER( self ) pyewf_handle = pyewf_handle_new(); pyewf_handle_open_file_objects( (pyewf_handle_t *) pyewf_handle, arguments, keywords ); return( pyewf_handle ); } /* Intializes a handle object * Returns 0 if successful or -1 on error */ int pyewf_handle_init( pyewf_handle_t *pyewf_handle ) { static char *function = "pyewf_handle_init"; libcerror_error_t *error = NULL; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid handle.", function ); return( -1 ); } pyewf_handle->handle = NULL; pyewf_handle->file_io_pool = NULL; if( libewf_handle_initialize( &( pyewf_handle->handle ), &error ) != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to initialize handle.", function ); libcerror_error_free( &error ); return( -1 ); } return( 0 ); } /* Frees a handle object */ void pyewf_handle_free( pyewf_handle_t *pyewf_handle ) { struct _typeobject *ob_type = NULL; libcerror_error_t *error = NULL; static char *function = "pyewf_handle_free"; int result = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid handle.", function ); return; } ob_type = Py_TYPE( pyewf_handle ); if( ob_type == NULL ) { PyErr_Format( PyExc_TypeError, "%s: missing ob_type.", function ); return; } if( ob_type->tp_free == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid ob_type - missing tp_free.", function ); return; } if( pyewf_handle->handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid handle - missing libewf handle.", function ); return; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_free( &( pyewf_handle->handle ), &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to free handle.", function ); libcerror_error_free( &error ); } ob_type->tp_free( (PyObject*) pyewf_handle ); } /* Signals the handle to abort the current activity * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_signal_abort( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "pyewf_handle_signal_abort"; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_signal_abort( pyewf_handle->handle, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to signal abort.", function ); libcerror_error_free( &error ); return( NULL ); } Py_IncRef( Py_None ); return( Py_None ); } /* Open a handle * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_open( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wchar_t *filename = NULL; wchar_t **filenames = NULL; const char *errors = NULL; char *narrow_string = NULL; size_t narrow_string_size = 0; int is_unicode_string = 0; #else char *filename = NULL; char **filenames = NULL; #endif PyObject *filename_string_object = NULL; PyObject *sequence_object = NULL; PyObject *string_object = NULL; PyObject *utf8_string_object = NULL; libcerror_error_t *error = NULL; static char *function = "pyewf_handle_open"; static char *keyword_list[] = { "filenames", "mode", NULL }; char *mode = NULL; Py_ssize_t sequence_size = 0; size_t filename_length = 0; int access_flags = 0; int filename_index = 0; int number_of_filenames = 0; int result = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "O|s", keyword_list, &sequence_object, &mode ) == 0 ) { return( NULL ); } if( PySequence_Check( sequence_object ) == 0 ) { PyErr_Format( PyExc_TypeError, "%s: argument: files must be a sequence object.", function ); return( NULL ); } if( mode == NULL ) { access_flags = LIBEWF_OPEN_READ; } else if( mode[ 0 ] == 'r' ) { if( ( mode[ 1 ] == 0 ) || ( ( mode[ 1 ] == 'b' ) && ( mode[ 2 ] == 0 ) ) ) { access_flags = LIBEWF_OPEN_READ; } } else if( mode[ 0 ] == 'w' ) { if( ( mode[ 1 ] == 0 ) || ( ( mode[ 1 ] == 'b' ) && ( mode[ 2 ] == 0 ) ) ) { access_flags = LIBEWF_OPEN_WRITE; } } else if( mode[ 0 ] == 'a' ) { if( ( mode[ 1 ] == 0 ) || ( ( mode[ 1 ] == 'b' ) && ( mode[ 2 ] == 0 ) ) ) { access_flags = LIBEWF_OPEN_WRITE_RESUME; } } if( access_flags == 0 ) { PyErr_Format( PyExc_ValueError, "%s: unsupported mode: %s.", function, mode ); return( NULL ); } sequence_size = PySequence_Size( sequence_object ); if( sequence_size > (Py_ssize_t) INT_MAX ) { PyErr_Format( PyExc_ValueError, "%s: invalid sequence size value exceeds maximum.", function ); goto on_error; } number_of_filenames = (int) sequence_size; if( ( number_of_filenames <= 0 ) || ( number_of_filenames > (int) UINT16_MAX ) ) { PyErr_Format( PyExc_ValueError, "%s: invalid number of files.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) filenames = (wchar_t **) PyMem_Malloc( sizeof( wchar_t * ) * number_of_filenames ); #else filenames = (char **) PyMem_Malloc( sizeof( char * ) * number_of_filenames ); #endif if( filenames == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create filenames.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( memory_set( filenames, 0, sizeof( wchar_t * ) * number_of_filenames ) == NULL ) #else if( memory_set( filenames, 0, sizeof( char * ) * number_of_filenames ) == NULL ) #endif { PyErr_Format( PyExc_MemoryError, "%s: unable to clear filenames.", function ); PyMem_Free( filenames ); return( NULL ); } for( filename_index = 0; filename_index < number_of_filenames; filename_index++ ) { string_object = PySequence_GetItem( sequence_object, filename_index ); PyErr_Clear(); result = PyObject_IsInstance( string_object, (PyObject *) &PyUnicode_Type ); if( result == -1 ) { pyewf_error_fetch_and_raise( PyExc_ValueError, "%s: unable to determine if the sequence object: %d is of type unicode.", function, filename_index ); goto on_error; } else if( result == 0 ) { PyErr_Clear(); #if PY_MAJOR_VERSION >= 3 result = PyObject_IsInstance( string_object, (PyObject *) &PyBytes_Type ); #else result = PyObject_IsInstance( string_object, (PyObject *) &PyString_Type ); #endif if( result == -1 ) { pyewf_error_fetch_and_raise( PyExc_RuntimeError, "%s: unable to determine if string object is of type string.", function ); goto on_error; } else if( result == 0 ) { PyErr_Format( PyExc_TypeError, "%s: unsupported string object type", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) else { is_unicode_string = 0; } #endif } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) else { is_unicode_string = 1; } #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( is_unicode_string != 0 ) { filename = (wchar_t *) PyUnicode_AsUnicode( string_object ); } else { #if PY_MAJOR_VERSION >= 3 narrow_string = PyBytes_AsString( string_object ); narrow_string_size = PyBytes_Size( string_object ); #else narrow_string = PyString_AsString( string_object ); narrow_string_size = PyString_Size( string_object ); #endif filename_string_object = PyUnicode_Decode( narrow_string, narrow_string_size, PyUnicode_GetDefaultEncoding(), errors ); if( filename_string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert filename: %d into Unicode.", function, filename_index ); goto on_error; } filename = (wchar_t *) PyUnicode_AsUnicode( filename_string_object ); } filename_length = wide_string_length( filename ); #else /* A Unicode string object can be converted into UFT-8 formatted narrow string */ utf8_string_object = PyUnicode_AsUTF8String( string_object ); if( utf8_string_object == NULL ) { pyewf_error_fetch_and_raise( PyExc_RuntimeError, "%s: unable to convert unicode string to UTF-8.", function ); goto on_error; } #if PY_MAJOR_VERSION >= 3 filename = PyBytes_AsString( utf8_string_object ); #else filename = PyString_AsString( utf8_string_object ); #endif filename_length = narrow_string_length( filename ); #endif /* #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) filenames[ filename_index ] = (wchar_t *) PyMem_Malloc( sizeof( wchar_t ) * ( filename_length + 1 ) ); #else filenames[ filename_index ] = (char *) PyMem_Malloc( sizeof( char ) * ( filename_length + 1 ) ); #endif if( filenames[ filename_index ] == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create filename: %d.", function, filename_index ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( wide_string_copy( filenames[ filename_index ], filename, filename_length ) == NULL ) #else if( narrow_string_copy( filenames[ filename_index ], filename, filename_length ) == NULL ) #endif { PyErr_Format( PyExc_MemoryError, "%s: unable to set filename: %d.", function, filename_index ); goto on_error; } ( filenames[ filename_index ] )[ filename_length ] = 0; if( utf8_string_object != NULL ) { Py_DecRef( utf8_string_object ); utf8_string_object = NULL; } if( filename_string_object != NULL ) { Py_DecRef( filename_string_object ); filename_string_object = NULL; } /* The string object was reference by PySequence_GetItem */ Py_DecRef( string_object ); string_object = NULL; } Py_BEGIN_ALLOW_THREADS #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_open_wide( pyewf_handle->handle, filenames, number_of_filenames, access_flags, &error ); #else result = libewf_handle_open( pyewf_handle->handle, filenames, number_of_filenames, access_flags, &error ); #endif Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to open handle.", function ); libcerror_error_free( &error ); goto on_error; } for( filename_index = 0; filename_index < number_of_filenames; filename_index++ ) { PyMem_Free( filenames[ filename_index ] ); } PyMem_Free( filenames ); Py_IncRef( Py_None ); return( Py_None ); on_error: if( filename_string_object != NULL ) { Py_DecRef( filename_string_object ); } if( string_object != NULL ) { Py_DecRef( string_object ); } if( filenames != NULL ) { for( ; filename_index > 0; filename_index-- ) { PyMem_Free( filenames[ filename_index - 1 ] ); } PyMem_Free( filenames ); } return( NULL ); } /* Opens a handle using a list of file-like objects * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_open_file_objects( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { PyObject *file_objects = NULL; libcerror_error_t *error = NULL; char *mode = NULL; static char *keyword_list[] = { "file_object", "mode", NULL }; static char *function = "pyewf_handle_open_file_objects"; int result = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "O|s", keyword_list, &file_objects, &mode ) == 0 ) { return( NULL ); } if( ( mode != NULL ) && ( mode[ 0 ] != 'r' ) ) { PyErr_Format( PyExc_ValueError, "%s: unsupported mode: %s.", function, mode ); return( NULL ); } if( pyewf_file_objects_pool_initialize( &( pyewf_handle->file_io_pool ), file_objects, LIBBFIO_OPEN_READ, &error ) != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to initialize file IO pool.", function ); libcerror_error_free( &error ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_handle_open_file_io_pool( pyewf_handle->handle, pyewf_handle->file_io_pool, LIBEWF_OPEN_READ, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to open file.", function ); libcerror_error_free( &error ); goto on_error; } Py_IncRef( Py_None ); return( Py_None ); on_error: if( pyewf_handle->file_io_pool != NULL ) { libbfio_pool_free( &( pyewf_handle->file_io_pool ), NULL ); } return( NULL ); } /* Closes a handle * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_close( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "pyewf_handle_close"; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_close( pyewf_handle->handle, &error ); Py_END_ALLOW_THREADS if( result != 0 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to close handle.", function ); libcerror_error_free( &error ); return( NULL ); } if( pyewf_handle->file_io_pool != NULL ) { Py_BEGIN_ALLOW_THREADS result = libbfio_pool_free( &( pyewf_handle->file_io_pool ), &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to free libbfio file IO pool.", function ); libcerror_error_free( &error ); return( NULL ); } } Py_IncRef( Py_None ); return( Py_None ); } /* Reads a buffer of media data * Returns a Python object holding the data if successful or NULL on error */ PyObject *pyewf_handle_read_buffer( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; char *buffer = NULL; static char *function = "pyewf_handle_read_buffer"; static char *keyword_list[] = { "size", NULL }; ssize_t read_count = 0; int read_size = -1; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "|i", keyword_list, &read_size ) == 0 ) { return( NULL ); } if( read_size < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value less than zero.", function ); return( NULL ); } /* Make sure the data fits into a memory buffer */ if( read_size > INT_MAX ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value exceeds maximum.", function ); return( NULL ); } #if PY_MAJOR_VERSION >= 3 string_object = PyBytes_FromStringAndSize( NULL, read_size ); buffer = PyBytes_AsString( string_object ); #else string_object = PyString_FromStringAndSize( NULL, read_size ); buffer = PyString_AsString( string_object ); #endif Py_BEGIN_ALLOW_THREADS read_count = libewf_handle_read_buffer( pyewf_handle->handle, buffer, (size_t) read_size, &error ); Py_END_ALLOW_THREADS if( read_count <= -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to read data.", function ); libcerror_error_free( &error ); Py_DecRef( (PyObject *) string_object ); return( NULL ); } /* Need to resize the string here in case read_size was not fully read. */ #if PY_MAJOR_VERSION >= 3 if( _PyBytes_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #else if( _PyString_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #endif { Py_DecRef( (PyObject *) string_object ); return( NULL ); } return( string_object ); } /* Reads a buffer of media data at a specific offset * Returns a Python object holding the data if successful or NULL on error */ PyObject *pyewf_handle_read_random( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; static char *function = "pyewf_handle_read_random"; static char *keyword_list[] = { "size", "offset", NULL }; char *buffer = NULL; off64_t read_offset = 0; ssize_t read_count = 0; int read_size = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "i|L", keyword_list, &read_size, &read_offset ) == 0 ) { return( NULL ); } if( read_size < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value less than zero.", function ); return( NULL ); } /* Make sure the data fits into a memory buffer */ if( read_size > INT_MAX ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value exceeds maximum.", function ); return( NULL ); } if( read_offset < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read offset value less than zero.", function ); return( NULL ); } #if PY_MAJOR_VERSION >= 3 string_object = PyBytes_FromStringAndSize( NULL, read_size ); buffer = PyBytes_AsString( string_object ); #else string_object = PyString_FromStringAndSize( NULL, read_size ); buffer = PyString_AsString( string_object ); #endif Py_BEGIN_ALLOW_THREADS read_count = libewf_handle_read_random( pyewf_handle->handle, buffer, (size_t) read_size, (off64_t) read_offset, &error ); Py_END_ALLOW_THREADS if( read_count <= -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to read data.", function ); libcerror_error_free( &error ); Py_DecRef( (PyObject *) string_object ); return( NULL ); } /* Need to resize the string here in case read_size was not fully read. */ #if PY_MAJOR_VERSION >= 3 if( _PyBytes_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #else if( _PyString_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #endif { Py_DecRef( (PyObject *) string_object ); return( NULL ); } return( string_object ); } /* Writes a buffer of media data * Returns a Python object holding the data if successful or NULL on error */ PyObject *pyewf_handle_write_buffer( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; static char *function = "pyewf_handle_write_buffer"; static char *keyword_list[] = { "buffer", NULL }; char *buffer = NULL; Py_ssize_t buffer_size = 0; ssize_t write_count = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "O", keyword_list, &string_object ) == 0 ) { return( NULL ); } #if PY_MAJOR_VERSION >= 3 buffer = PyBytes_AsString( string_object ); buffer_size = PyBytes_Size( string_object ); #else buffer = PyString_AsString( string_object ); buffer_size = PyString_Size( string_object ); #endif if( ( buffer_size < 0 ) || ( buffer_size > (Py_ssize_t) SSIZE_MAX ) ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument buffer size value out of bounds.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS write_count = libewf_handle_write_buffer( pyewf_handle->handle, buffer, (size_t) buffer_size, &error ); Py_END_ALLOW_THREADS if( write_count != (ssize_t) buffer_size ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to write data.", function ); libcerror_error_free( &error ); return( NULL ); } Py_IncRef( Py_None ); return( Py_None ); } /* Writes a buffer of media data at a specific offset * Returns a Python object holding the data if successful or NULL on error */ PyObject *pyewf_handle_write_random( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; char *buffer = NULL; static char *function = "pyewf_handle_write_random"; static char *keyword_list[] = { "size", "offset", NULL }; off64_t write_offset = 0; Py_ssize_t buffer_size = 0; ssize_t write_count = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "O|L", keyword_list, &string_object, &write_offset ) == 0 ) { return( NULL ); } #if PY_MAJOR_VERSION >= 3 buffer = PyBytes_AsString( string_object ); buffer_size = PyBytes_Size( string_object ); #else buffer = PyString_AsString( string_object ); buffer_size = PyString_Size( string_object ); #endif if( ( buffer_size < 0 ) || ( buffer_size > (Py_ssize_t) SSIZE_MAX ) ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument buffer size value out of bounds.", function ); return( NULL ); } if( write_offset < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument write offset value less than zero.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS write_count = libewf_handle_write_random( pyewf_handle->handle, buffer, (size_t) buffer_size, write_offset, &error ); Py_END_ALLOW_THREADS if( write_count != (ssize_t) buffer_size ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to write data.", function ); libcerror_error_free( &error ); return( NULL ); } Py_IncRef( Py_None ); return( Py_None ); } /* Seeks a certain offset in the media data * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_handle_seek_offset( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; static char *function = "pyewf_handle_seek_offset"; static char *keyword_list[] = { "offset", "whence", NULL }; off64_t offset = 0; int whence = 0; if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf handle.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "L|i", keyword_list, &offset, &whence ) == 0 ) { return( NULL ); } Py_BEGIN_ALLOW_THREADS offset = libewf_handle_seek_offset( pyewf_handle->handle, offset, whence, &error ); Py_END_ALLOW_THREADS if( offset == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to seek offset.", function ); libcerror_error_free( &error ); return( NULL ); } Py_IncRef( Py_None ); return( Py_None ); } /* Retrieves the offset * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_get_offset( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_handle_get_offset"; off64_t current_offset = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_offset( pyewf_handle->handle, ¤t_offset, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve offset.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_signed_new_from_64bit( (int64_t) current_offset ); return( integer_object ); } /* Retrieves the root file entry * Returns a Python object if successful or NULL on error */ PyObject *pyewf_handle_get_root_file_entry( pyewf_handle_t *pyewf_handle, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; libewf_file_entry_t *root_file_entry = NULL; PyObject *file_entry_object = NULL; static char *function = "pyewf_handle_get_root_file_entry"; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_handle == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid handle.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_handle_get_root_file_entry( pyewf_handle->handle, &root_file_entry, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve root file entry.", function ); libcerror_error_free( &error ); goto on_error; } file_entry_object = pyewf_file_entry_new( root_file_entry, pyewf_handle ); if( file_entry_object == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create file entry object.", function ); goto on_error; } return( file_entry_object ); on_error: if( root_file_entry != NULL ) { libewf_file_entry_free( &root_file_entry, NULL ); } return( NULL ); } libewf-20140807/pyewf/pyewf_codepage.h0000664000175000017500000000211613440663047021624 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * 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_CODEPAGE_H ) #define _PYEWF_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif const char *pyewf_codepage_to_string( int codepage ); /* TODO add list function */ #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/pyewf_error.c0000664000175000017500000002235113440663047021204 0ustar00lordyestalordyesta00000000000000/* * Error functions * * 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 . */ #include #include #include #include #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #include #elif defined( HAVE_VARARGS_H ) #include #else #error Missing headers stdarg.h and varargs.h #endif #include "pyewf_error.h" #include "pyewf_libcerror.h" #include "pyewf_python.h" #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, error, error_domain, error_code, type, argument ) \ function( error, error_domain, error_code, type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, error, error_domain, error_code, type, argument ) \ function( error, error_domain, error_code, va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* Fetches an error */ void VARARGS( pyewf_error_fetch, libcerror_error_t **error, int error_domain, int error_code, const char *, format_string ) { va_list argument_list; char error_string[ PYEWF_ERROR_STRING_SIZE ]; PyObject *exception_traceback = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyObject *string_object = NULL; static char *function = "pyewf_error_fetch"; char *exception_string = NULL; size_t error_string_length = 0; int print_count = 0; #if PY_MAJOR_VERSION >= 3 PyObject *utf8_string_object = NULL; #endif if( format_string == NULL ) { PyErr_Format( PyExc_ValueError, "%s: missing format string.", function ); return; } VASTART( argument_list, const char *, format_string ); print_count = PyOS_vsnprintf( error_string, PYEWF_ERROR_STRING_SIZE, format_string, argument_list ); VAEND( argument_list ); if( print_count < 0 ) { PyErr_Format( PyExc_ValueError, "%s: unable to format error string.", function ); return; } error_string_length = narrow_string_length( error_string ); if( ( error_string_length >= 1 ) && ( error_string[ error_string_length - 1 ] == '.' ) ) { error_string[ error_string_length - 1 ] = 0; } PyErr_Fetch( &exception_type, &exception_value, &exception_traceback ); string_object = PyObject_Repr( exception_value ); #if PY_MAJOR_VERSION >= 3 utf8_string_object = PyUnicode_AsUTF8String( string_object ); if( utf8_string_object != NULL ) { exception_string = PyBytes_AsString( utf8_string_object ); } #else exception_string = PyString_AsString( string_object ); #endif if( exception_string != NULL ) { libcerror_error_set( error, error_domain, error_code, "%s with error: %s.", error_string, exception_string ); } else { libcerror_error_set( error, error_domain, error_code, "%s.", error_string ); } #if PY_MAJOR_VERSION >= 3 if( utf8_string_object != NULL ) { Py_DecRef( utf8_string_object ); } #endif Py_DecRef( string_object ); return; } #undef VARARGS #undef VASTART #undef VAEND #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, exception_object, type, argument ) \ function( exception_object, type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, exception_object, type, argument ) \ function( exception_object, va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* Fetches and raises an error */ void VARARGS( pyewf_error_fetch_and_raise, PyObject *exception_object, const char *, format_string ) { va_list argument_list; char error_string[ PYEWF_ERROR_STRING_SIZE ]; PyObject *exception_traceback = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyObject *string_object = NULL; static char *function = "pyewf_error_fetch_and_raise"; char *exception_string = NULL; size_t error_string_length = 0; int print_count = 0; #if PY_MAJOR_VERSION >= 3 PyObject *utf8_string_object = NULL; #endif if( format_string == NULL ) { PyErr_Format( PyExc_ValueError, "%s: missing format string.", function ); return; } VASTART( argument_list, const char *, format_string ); print_count = PyOS_vsnprintf( error_string, PYEWF_ERROR_STRING_SIZE, format_string, argument_list ); VAEND( argument_list ); if( print_count < 0 ) { PyErr_Format( PyExc_ValueError, "%s: unable to format exception string.", function ); return; } error_string_length = narrow_string_length( error_string ); if( ( error_string_length >= 1 ) && ( error_string[ error_string_length - 1 ] == '.' ) ) { error_string[ error_string_length - 1 ] = 0; } PyErr_Fetch( &exception_type, &exception_value, &exception_traceback ); string_object = PyObject_Repr( exception_value ); #if PY_MAJOR_VERSION >= 3 utf8_string_object = PyUnicode_AsUTF8String( string_object ); if( utf8_string_object != NULL ) { exception_string = PyBytes_AsString( utf8_string_object ); } #else exception_string = PyString_AsString( string_object ); #endif if( exception_string != NULL ) { PyErr_Format( exception_object, "%s with error: %s.", error_string, exception_string ); } else { PyErr_Format( exception_object, "%s.", error_string ); } Py_DecRef( string_object ); return; } #undef VARARGS #undef VASTART #undef VAEND #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, error, exception_object, type, argument ) \ function( error, exception_object, type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, error, exception_object, type, argument ) \ function( error, exception_object, va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* Raises an error */ void VARARGS( pyewf_error_raise, libcerror_error_t *error, PyObject *exception_object, const char *, format_string ) { va_list argument_list; char error_string[ PYEWF_ERROR_STRING_SIZE ]; char exception_string[ PYEWF_ERROR_STRING_SIZE ]; static char *function = "pyewf_error_raise"; size_t error_string_index = 0; int print_count = 0; if( format_string == NULL ) { PyErr_Format( PyExc_ValueError, "%s: missing format string.", function ); return; } VASTART( argument_list, const char *, format_string ); print_count = PyOS_vsnprintf( exception_string, PYEWF_ERROR_STRING_SIZE, format_string, argument_list ); VAEND( argument_list ); if( print_count < 0 ) { PyErr_Format( PyExc_ValueError, "%s: unable to format exception string.", function ); return; } if( error != NULL ) { if( libcerror_error_backtrace_sprint( error, error_string, PYEWF_ERROR_STRING_SIZE ) != -1 ) { while( error_string_index < PYEWF_ERROR_STRING_SIZE ) { if( error_string[ error_string_index ] == 0 ) { break; } if( error_string[ error_string_index ] == '\n' ) { error_string[ error_string_index ] = ' '; } error_string_index++; } if( error_string_index >= PYEWF_ERROR_STRING_SIZE ) { error_string[ PYEWF_ERROR_STRING_SIZE - 1 ] = 0; } PyErr_Format( exception_object, "%s %s", exception_string, error_string ); return; } } PyErr_Format( exception_object, "%s", exception_string ); return; } #undef VARARGS #undef VASTART #undef VAEND libewf-20140807/pyewf/pyewf_unused.h0000664000175000017500000000244313440663047021363 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * 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_INTERNAL_UNUSED_H ) #define _PYEWF_INTERNAL_UNUSED_H #include #if !defined( PYEWF_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define PYEWF_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define PYEWF_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define PYEWF_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define PYEWF_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif libewf-20140807/pyewf/pyewf_file_object_io_handle.c0000664000175000017500000010164313440663047024324 0ustar00lordyestalordyesta00000000000000/* * Python file object IO handle functions * * 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 . */ #include #include #include #include "pyewf_error.h" #include "pyewf_file_object_io_handle.h" #include "pyewf_integer.h" #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" #include "pyewf_python.h" /* Creates a file object IO handle * Make sure the value file_object_io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int pyewf_file_object_io_handle_initialize( pyewf_file_object_io_handle_t **file_object_io_handle, PyObject *file_object, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_initialize"; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( *file_object_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file object IO handle value already set.", function ); return( -1 ); } if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object.", function ); return( -1 ); } *file_object_io_handle = (pyewf_file_object_io_handle_t *) PyMem_Malloc( sizeof( pyewf_file_object_io_handle_t ) ); if( *file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file object IO handle.", function ); goto on_error; } if( memory_set( *file_object_io_handle, 0, sizeof( pyewf_file_object_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file object IO handle.", function ); goto on_error; } ( *file_object_io_handle )->file_object = file_object; Py_IncRef( ( *file_object_io_handle )->file_object ); return( 1 ); on_error: if( *file_object_io_handle != NULL ) { PyMem_Free( *file_object_io_handle ); *file_object_io_handle = NULL; } return( -1 ); } /* Initializes the file object IO handle * Returns 1 if successful or -1 on error */ int pyewf_file_object_initialize( libbfio_handle_t **handle, PyObject *file_object, libcerror_error_t **error ) { pyewf_file_object_io_handle_t *file_object_io_handle = NULL; static char *function = "pyewf_file_object_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } if( pyewf_file_object_io_handle_initialize( &file_object_io_handle, file_object, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file object IO handle.", function ); goto on_error; } if( libbfio_handle_initialize( handle, (intptr_t *) file_object_io_handle, (int (*)(intptr_t **, libcerror_error_t **)) pyewf_file_object_io_handle_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) pyewf_file_object_io_handle_clone, (int (*)(intptr_t *, int, libcerror_error_t **)) pyewf_file_object_io_handle_open, (int (*)(intptr_t *, libcerror_error_t **)) pyewf_file_object_io_handle_close, (ssize_t (*)(intptr_t *, uint8_t *, size_t, libcerror_error_t **)) pyewf_file_object_io_handle_read, (ssize_t (*)(intptr_t *, const uint8_t *, size_t, libcerror_error_t **)) pyewf_file_object_io_handle_write, (off64_t (*)(intptr_t *, off64_t, int, libcerror_error_t **)) pyewf_file_object_io_handle_seek_offset, (int (*)(intptr_t *, libcerror_error_t **)) pyewf_file_object_io_handle_exists, (int (*)(intptr_t *, libcerror_error_t **)) pyewf_file_object_io_handle_is_open, (int (*)(intptr_t *, size64_t *, libcerror_error_t **)) pyewf_file_object_io_handle_get_size, LIBBFIO_FLAG_IO_HANDLE_MANAGED | LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } return( 1 ); on_error: if( file_object_io_handle != NULL ) { pyewf_file_object_io_handle_free( &file_object_io_handle, NULL ); } return( -1 ); } /* Frees a file object IO handle * Returns 1 if succesful or -1 on error */ int pyewf_file_object_io_handle_free( pyewf_file_object_io_handle_t **file_object_io_handle, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_free"; PyGILState_STATE gil_state = 0; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( *file_object_io_handle != NULL ) { gil_state = PyGILState_Ensure(); Py_DecRef( ( *file_object_io_handle )->file_object ); PyGILState_Release( gil_state ); PyMem_Free( *file_object_io_handle ); *file_object_io_handle = NULL; } return( 1 ); } /* Clones (duplicates) the file object IO handle and its attributes * Returns 1 if succesful or -1 on error */ int pyewf_file_object_io_handle_clone( pyewf_file_object_io_handle_t **destination_file_object_io_handle, pyewf_file_object_io_handle_t *source_file_object_io_handle, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_clone"; if( destination_file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination file object IO handle.", function ); return( -1 ); } if( *destination_file_object_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination file object IO handle already set.", function ); return( -1 ); } if( source_file_object_io_handle == NULL ) { *destination_file_object_io_handle = NULL; return( 1 ); } if( pyewf_file_object_io_handle_initialize( destination_file_object_io_handle, source_file_object_io_handle->file_object, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file object IO handle.", function ); return( -1 ); } if( *destination_file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination file object IO handle.", function ); return( -1 ); } return( 1 ); } /* Opens the file object IO handle * Returns 1 if successful or -1 on error */ int pyewf_file_object_io_handle_open( pyewf_file_object_io_handle_t *file_object_io_handle, int access_flags, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_open"; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( file_object_io_handle->file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file object IO handle - missing file object.", function ); return( -1 ); } if( ( ( access_flags & LIBBFIO_ACCESS_FLAG_READ ) != 0 ) && ( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); return( -1 ); } /* No need to do anything here, because the file object is already open */ file_object_io_handle->access_flags = access_flags; return( 1 ); } /* Closes the file object IO handle * Returns 0 if successful or -1 on error */ int pyewf_file_object_io_handle_close( pyewf_file_object_io_handle_t *file_object_io_handle, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_close"; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( file_object_io_handle->file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file object IO handle - missing file object.", function ); return( -1 ); } /* Do not close the file object, have Python deal with it */ file_object_io_handle->access_flags = 0; return( 0 ); } /* Reads a buffer from the file object * Make sure to hold the GIL state before calling this function * Returns the number of bytes read if successful, or -1 on error */ ssize_t pyewf_file_object_read_buffer( PyObject *file_object, uint8_t *buffer, size_t size, libcerror_error_t **error ) { PyObject *argument_size = NULL; PyObject *method_name = NULL; PyObject *method_result = NULL; static char *function = "pyewf_file_object_read_buffer"; char *safe_buffer = NULL; Py_ssize_t safe_read_count = 0; ssize_t read_count = 0; int result = 0; if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size > 0 ) { #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "read" ); #else method_name = PyString_FromString( "read" ); #endif argument_size = PyLong_FromSize_t( size ); PyErr_Clear(); method_result = PyObject_CallMethodObjArgs( file_object, method_name, argument_size, NULL ); if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file object.", function ); goto on_error; } if( method_result == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing method result.", function ); goto on_error; } #if PY_MAJOR_VERSION >= 3 result = PyObject_IsInstance( method_result, (PyObject *) &PyBytes_Type ); #else result = PyObject_IsInstance( method_result, (PyObject *) &PyString_Type ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if method result is a binary string object.", function ); goto on_error; } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid method result value is not a binary string object.", function ); goto on_error; } #if PY_MAJOR_VERSION >= 3 result = PyBytes_AsStringAndSize( method_result, &safe_buffer, &safe_read_count ); #else result = PyString_AsStringAndSize( method_result, &safe_buffer, &safe_read_count ); #endif if( result == -1 ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file object.", function ); goto on_error; } if( safe_read_count > (Py_ssize_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid read count value exceeds maximum.", function ); goto on_error; } read_count = (ssize_t) safe_read_count; if( memory_copy( buffer, safe_buffer, read_count ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to data to buffer.", function ); goto on_error; } Py_DecRef( method_result ); Py_DecRef( argument_size ); Py_DecRef( method_name ); } return( read_count ); on_error: if( method_result != NULL ) { Py_DecRef( method_result ); } if( argument_size != NULL ) { Py_DecRef( argument_size ); } if( method_name != NULL ) { Py_DecRef( method_name ); } return( -1 ); } /* Reads a buffer from the file object IO handle * Returns the number of bytes read if successful, or -1 on error */ ssize_t pyewf_file_object_io_handle_read( pyewf_file_object_io_handle_t *file_object_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_read"; PyGILState_STATE gil_state = 0; ssize_t read_count = 0; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } gil_state = PyGILState_Ensure(); read_count = pyewf_file_object_read_buffer( file_object_io_handle->file_object, buffer, size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file object.", function ); goto on_error; } PyGILState_Release( gil_state ); return( read_count ); on_error: PyGILState_Release( gil_state ); return( -1 ); } /* Writes a buffer to the file object * Make sure to hold the GIL state before calling this function * Returns the number of bytes written if successful, or -1 on error */ ssize_t pyewf_file_object_write_buffer( PyObject *file_object, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { PyObject *argument_string = NULL; PyObject *method_name = NULL; PyObject *method_result = NULL; static char *function = "pyewf_file_object_write_buffer"; if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if SIZEOF_SIZE_T > SIZEOF_INT if( size > (size_t) INT_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size > 0 ) { #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "write" ); #else method_name = PyString_FromString( "write" ); #endif #if PY_MAJOR_VERSION >= 3 argument_string = PyBytes_FromStringAndSize( (char *) buffer, size ); #else argument_string = PyString_FromStringAndSize( (char *) buffer, size ); #endif PyErr_Clear(); method_result = PyObject_CallMethodObjArgs( file_object, method_name, argument_string, NULL ); if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file object.", function ); goto on_error; } if( method_result == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing method result.", function ); goto on_error; } Py_DecRef( method_result ); Py_DecRef( argument_string ); Py_DecRef( method_name ); } return( (ssize_t) size ); on_error: if( method_result != NULL ) { Py_DecRef( method_result ); } if( argument_string != NULL ) { Py_DecRef( argument_string ); } if( method_name != NULL ) { Py_DecRef( method_name ); } return( -1 ); } /* Writes a buffer to the file object IO handle * Returns the number of bytes written if successful, or -1 on error */ ssize_t pyewf_file_object_io_handle_write( pyewf_file_object_io_handle_t *file_object_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_write"; PyGILState_STATE gil_state = 0; ssize_t write_count = 0; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } gil_state = PyGILState_Ensure(); write_count = pyewf_file_object_write_buffer( file_object_io_handle->file_object, buffer, size, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write from file object.", function ); goto on_error; } PyGILState_Release( gil_state ); return( write_count ); on_error: PyGILState_Release( gil_state ); return( -1 ); } /* Seeks a certain offset within the file object * Make sure to hold the GIL state before calling this function * Returns 1 if successful or -1 on error */ int pyewf_file_object_seek_offset( PyObject *file_object, off64_t offset, int whence, libcerror_error_t **error ) { PyObject *argument_offset = NULL; PyObject *argument_whence = NULL; PyObject *method_name = NULL; PyObject *method_result = NULL; static char *function = "pyewf_file_object_seek_offset"; if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object.", function ); return( -1 ); } #if defined( HAVE_LONG_LONG ) if( offset > (off64_t) INT64_MAX ) #else if( offset > (off64_t) LONG_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid offset value exceeds maximum.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "seek" ); #else method_name = PyString_FromString( "seek" ); #endif #if defined( HAVE_LONG_LONG ) argument_offset = PyLong_FromLongLong( (PY_LONG_LONG) offset ); #else argument_offset = PyLong_FromLongLong( (long) offset ); #endif #if PY_MAJOR_VERSION >= 3 argument_whence = PyLong_FromLong( (long) whence ); #else argument_whence = PyInt_FromLong( (long) whence ); #endif PyErr_Clear(); method_result = PyObject_CallMethodObjArgs( file_object, method_name, argument_offset, argument_whence, NULL ); if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek in file object.", function ); goto on_error; } if( method_result == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing method result.", function ); goto on_error; } Py_DecRef( method_result ); Py_DecRef( argument_whence ); Py_DecRef( argument_offset ); Py_DecRef( method_name ); return( 1 ); on_error: if( method_result != NULL ) { Py_DecRef( method_result ); } if( argument_whence != NULL ) { Py_DecRef( argument_whence ); } if( argument_offset != NULL ) { Py_DecRef( argument_offset ); } if( method_name != NULL ) { Py_DecRef( method_name ); } return( -1 ); } /* Retrieves the current offset within the file object * Make sure to hold the GIL state before calling this function * Returns 1 if successful or -1 on error */ int pyewf_file_object_get_offset( PyObject *file_object, off64_t *offset, libcerror_error_t **error ) { PyObject *method_name = NULL; PyObject *method_result = NULL; static char *function = "pyewf_file_object_get_offset"; int result = 0; if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "get_offset" ); #else method_name = PyString_FromString( "get_offset" ); #endif PyErr_Clear(); /* Determine if the file object has the get_offset method */ result = PyObject_HasAttr( file_object, method_name ); if( result == 0 ) { Py_DecRef( method_name ); /* Fall back to the tell method */ #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "tell" ); #else method_name = PyString_FromString( "tell" ); #endif } PyErr_Clear(); method_result = PyObject_CallMethodObjArgs( file_object, method_name, NULL ); if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in file object.", function ); goto on_error; } if( method_result == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing method result.", function ); goto on_error; } if( pyewf_integer_signed_copy_to_64bit( method_result, offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to convert method result into current offset of file object.", function ); goto on_error; } Py_DecRef( method_result ); Py_DecRef( method_name ); return( 1 ); on_error: if( method_result != NULL ) { Py_DecRef( method_result ); } if( method_name != NULL ) { Py_DecRef( method_name ); } return( -1 ); } /* Seeks a certain offset within the file object IO handle * Returns the offset if the seek is successful or -1 on error */ off64_t pyewf_file_object_io_handle_seek_offset( pyewf_file_object_io_handle_t *file_object_io_handle, off64_t offset, int whence, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_seek_offset"; PyGILState_STATE gil_state = 0; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } gil_state = PyGILState_Ensure(); if( pyewf_file_object_seek_offset( file_object_io_handle->file_object, offset, whence, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek in file object.", function ); goto on_error; } if( pyewf_file_object_get_offset( file_object_io_handle->file_object, &offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to retrieve current offset in file object.", function ); goto on_error; } PyGILState_Release( gil_state ); return( offset ); on_error: PyGILState_Release( gil_state ); return( -1 ); } /* Function to determine if a file exists * Returns 1 if file exists, 0 if not or -1 on error */ int pyewf_file_object_io_handle_exists( pyewf_file_object_io_handle_t *file_object_io_handle, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_exists"; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( file_object_io_handle->file_object == NULL ) { return( 0 ); } return( 1 ); } /* Check if the file is open * Returns 1 if open, 0 if not or -1 on error */ int pyewf_file_object_io_handle_is_open( pyewf_file_object_io_handle_t *file_object_io_handle, libcerror_error_t **error ) { static char *function = "pyewf_file_object_io_handle_is_open"; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( file_object_io_handle->file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file object IO handle - missing file object.", function ); return( -1 ); } /* As far as BFIO is concerned the file object is always open */ return( 1 ); } /* Retrieves the size of the file object * Make sure to hold the GIL state before calling this function * Returns 1 if successful or -1 on error */ int pyewf_file_object_get_size( PyObject *file_object, size64_t *size, libcerror_error_t **error ) { PyObject *method_name = NULL; PyObject *method_result = NULL; static char *function = "pyewf_file_object_get_size"; if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "get_size" ); #else method_name = PyString_FromString( "get_size" ); #endif PyErr_Clear(); method_result = PyObject_CallMethodObjArgs( file_object, method_name, NULL ); if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of file object.", function ); goto on_error; } if( method_result == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing method result.", function ); goto on_error; } if( pyewf_integer_unsigned_copy_to_64bit( method_result, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to convert method result into size of file object.", function ); goto on_error; } Py_DecRef( method_result ); Py_DecRef( method_name ); return( 1 ); on_error: if( method_result != NULL ) { Py_DecRef( method_result ); } if( method_name != NULL ) { Py_DecRef( method_name ); } return( -1 ); } /* Retrieves the file size * Returns 1 if successful or -1 on error */ int pyewf_file_object_io_handle_get_size( pyewf_file_object_io_handle_t *file_object_io_handle, size64_t *size, libcerror_error_t **error ) { PyObject *method_name = NULL; static char *function = "pyewf_file_object_io_handle_get_size"; PyGILState_STATE gil_state = 0; off64_t current_offset = 0; int result = 0; if( file_object_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file object IO handle.", function ); return( -1 ); } if( file_object_io_handle->file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file object IO handle - missing file object.", function ); return( -1 ); } gil_state = PyGILState_Ensure(); #if PY_MAJOR_VERSION >= 3 method_name = PyUnicode_FromString( "get_size" ); #else method_name = PyString_FromString( "get_size" ); #endif PyErr_Clear(); /* Determine if the file object has the get_size method */ result = PyObject_HasAttr( file_object_io_handle->file_object, method_name ); if( result != 0 ) { if( pyewf_file_object_get_size( file_object_io_handle->file_object, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of file object.", function ); goto on_error; } } else { if( pyewf_file_object_get_offset( file_object_io_handle->file_object, ¤t_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in file object.", function ); goto on_error; } if( pyewf_file_object_seek_offset( file_object_io_handle->file_object, 0, SEEK_END, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek end of file object.", function ); goto on_error; } if( pyewf_file_object_get_offset( file_object_io_handle->file_object, (off64_t *) size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve end offset in file object.", function ); pyewf_file_object_seek_offset( file_object_io_handle->file_object, current_offset, SEEK_SET, NULL ); goto on_error; } if( pyewf_file_object_seek_offset( file_object_io_handle->file_object, current_offset, SEEK_SET, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek current offset in file object.", function ); goto on_error; } } Py_DecRef( method_name ); PyGILState_Release( gil_state ); return( 1 ); on_error: if( method_name != NULL ) { Py_DecRef( method_name ); } PyGILState_Release( gil_state ); return( 1 ); } libewf-20140807/pyewf/pyewf_python.h0000664000175000017500000000345313440663047021403 0ustar00lordyestalordyesta00000000000000/* * The python header wrapper * * 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_PYTHON_H ) #define _PYEWF_PYTHON_H #include #if PY_MAJOR_VERSION < 3 /* Fix defines in pyconfig.h */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE /* Fix defines in pyport.h */ #undef HAVE_FSTAT #undef HAVE_STAT #undef HAVE_SSIZE_T #undef HAVE_INT32_T #undef HAVE_UINT32_T #undef HAVE_INT64_T #undef HAVE_UINT64_T #endif /* PY_MAJOR_VERSION < 3 */ #include /* Python compatibility macros */ #if !defined( PyMODINIT_FUNC ) #if PY_MAJOR_VERSION >= 3 #define PyMODINIT_FUNC PyObject * #else #define PyMODINIT_FUNC void #endif #endif /* !defined( PyMODINIT_FUNC ) */ #if !defined( PyVarObject_HEAD_INIT ) #define PyVarObject_HEAD_INIT( type, size ) \ PyObject_HEAD_INIT( type ) \ size, #endif /* !defined( PyVarObject_HEAD_INIT ) */ #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_HAVE_ITER 0 #endif #if !defined( Py_TYPE ) #define Py_TYPE( object ) \ ( ( (PyObject *) object )->ob_type ) #endif /* !defined( Py_TYPE ) */ #endif /* !defined( _PYEWF_PYTHON_H ) */ libewf-20140807/pyewf/pyewf_file_entries.c0000664000175000017500000002315413440663047022525 0ustar00lordyestalordyesta00000000000000/* * Python object definition of the file entries sequence and iterator * * 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 . */ #include #include #if defined( HAVE_STDLIB_H ) || defined( HAVE_WINAPI ) #include #endif #include "pyewf_file_entries.h" #include "pyewf_file_entry.h" #include "pyewf_libcerror.h" #include "pyewf_libewf.h" #include "pyewf_python.h" PySequenceMethods pyewf_file_entries_sequence_methods = { /* sq_length */ (lenfunc) pyewf_file_entries_len, /* sq_concat */ 0, /* sq_repeat */ 0, /* sq_item */ (ssizeargfunc) pyewf_file_entries_getitem, /* sq_slice */ 0, /* sq_ass_item */ 0, /* sq_ass_slice */ 0, /* sq_contains */ 0, /* sq_inplace_concat */ 0, /* sq_inplace_repeat */ 0 }; PyTypeObject pyewf_file_entries_type_object = { PyVarObject_HEAD_INIT( NULL, 0 ) /* tp_name */ "pyewf._file_entries", /* tp_basicsize */ sizeof( pyewf_file_entries_t ), /* tp_itemsize */ 0, /* tp_dealloc */ (destructor) pyewf_file_entries_free, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ &pyewf_file_entries_sequence_methods, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER, /* tp_doc */ "internal pyewf file entries sequence and iterator object", /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ (getiterfunc) pyewf_file_entries_iter, /* tp_iternext */ (iternextfunc) pyewf_file_entries_iternext, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ (initproc) pyewf_file_entries_init, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ NULL, /* tp_mro */ NULL, /* tp_cache */ NULL, /* tp_subclasses */ NULL, /* tp_weaklist */ NULL, /* tp_del */ 0 }; /* Creates a new file entries object * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entries_new( pyewf_file_entry_t *file_entry_object, PyObject* (*get_sub_file_entry_by_index)( pyewf_file_entry_t *file_entry_object, int sub_file_entry_index ), int number_of_sub_file_entries ) { pyewf_file_entries_t *pyewf_file_entries = NULL; static char *function = "pyewf_file_entries_new"; if( file_entry_object == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file enry object.", function ); return( NULL ); } if( get_sub_file_entry_by_index == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid get sub file entry by index function.", function ); return( NULL ); } /* Make sure the file entries values are initialized */ pyewf_file_entries = PyObject_New( struct pyewf_file_entries, &pyewf_file_entries_type_object ); if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to initialize file entries.", function ); goto on_error; } if( pyewf_file_entries_init( pyewf_file_entries ) != 0 ) { PyErr_Format( PyExc_MemoryError, "%s: unable to initialize file entries.", function ); goto on_error; } pyewf_file_entries->file_entry_object = file_entry_object; pyewf_file_entries->get_sub_file_entry_by_index = get_sub_file_entry_by_index; pyewf_file_entries->number_of_sub_file_entries = number_of_sub_file_entries; Py_IncRef( (PyObject *) pyewf_file_entries->file_entry_object ); return( (PyObject *) pyewf_file_entries ); on_error: if( pyewf_file_entries != NULL ) { Py_DecRef( (PyObject *) pyewf_file_entries ); } return( NULL ); } /* Intializes a file entries object * Returns 0 if successful or -1 on error */ int pyewf_file_entries_init( pyewf_file_entries_t *pyewf_file_entries ) { static char *function = "pyewf_file_entries_init"; if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries.", function ); return( -1 ); } /* Make sure the file entries values are initialized */ pyewf_file_entries->file_entry_object = NULL; pyewf_file_entries->get_sub_file_entry_by_index = NULL; pyewf_file_entries->sub_file_entry_index = 0; pyewf_file_entries->number_of_sub_file_entries = 0; return( 0 ); } /* Frees a file entries object */ void pyewf_file_entries_free( pyewf_file_entries_t *pyewf_file_entries ) { struct _typeobject *ob_type = NULL; static char *function = "pyewf_file_entries_free"; if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries.", function ); return; } ob_type = Py_TYPE( pyewf_file_entries ); if( ob_type == NULL ) { PyErr_Format( PyExc_ValueError, "%s: missing ob_type.", function ); return; } if( ob_type->tp_free == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid ob_type - missing tp_free.", function ); return; } if( pyewf_file_entries->file_entry_object != NULL ) { Py_DecRef( (PyObject *) pyewf_file_entries->file_entry_object ); } ob_type->tp_free( (PyObject*) pyewf_file_entries ); } /* The file entries len() function */ Py_ssize_t pyewf_file_entries_len( pyewf_file_entries_t *pyewf_file_entries ) { static char *function = "pyewf_file_entries_len"; if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries.", function ); return( -1 ); } return( (Py_ssize_t) pyewf_file_entries->number_of_sub_file_entries ); } /* The file entries getitem() function */ PyObject *pyewf_file_entries_getitem( pyewf_file_entries_t *pyewf_file_entries, Py_ssize_t item_index ) { PyObject *file_entry_object = NULL; static char *function = "pyewf_file_entries_getitem"; if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries.", function ); return( NULL ); } if( pyewf_file_entries->get_sub_file_entry_by_index == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries - missing get sub file entry by index function.", function ); return( NULL ); } if( pyewf_file_entries->number_of_sub_file_entries < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries - invalid number of sub file entries.", function ); return( NULL ); } if( ( item_index < 0 ) || ( item_index >= (Py_ssize_t) pyewf_file_entries->number_of_sub_file_entries ) ) { PyErr_Format( PyExc_ValueError, "%s: invalid invalid item index value out of bounds.", function ); return( NULL ); } file_entry_object = pyewf_file_entries->get_sub_file_entry_by_index( pyewf_file_entries->file_entry_object, (int) item_index ); return( file_entry_object ); } /* The file entries iter() function */ PyObject *pyewf_file_entries_iter( pyewf_file_entries_t *pyewf_file_entries ) { static char *function = "pyewf_file_entries_iter"; if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries.", function ); return( NULL ); } Py_IncRef( (PyObject *) pyewf_file_entries ); return( (PyObject *) pyewf_file_entries ); } /* The file entries iternext() function */ PyObject *pyewf_file_entries_iternext( pyewf_file_entries_t *pyewf_file_entries ) { PyObject *file_entry_object = NULL; static char *function = "pyewf_file_entries_iternext"; if( pyewf_file_entries == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries.", function ); return( NULL ); } if( pyewf_file_entries->get_sub_file_entry_by_index == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries - missing get sub file entry by index function.", function ); return( NULL ); } if( pyewf_file_entries->sub_file_entry_index < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries - invalid sub file entry index.", function ); return( NULL ); } if( pyewf_file_entries->number_of_sub_file_entries < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entries - invalid number of sub file entries.", function ); return( NULL ); } if( pyewf_file_entries->sub_file_entry_index >= pyewf_file_entries->number_of_sub_file_entries ) { PyErr_SetNone( PyExc_StopIteration ); return( NULL ); } file_entry_object = pyewf_file_entries->get_sub_file_entry_by_index( pyewf_file_entries->file_entry_object, pyewf_file_entries->sub_file_entry_index ); if( file_entry_object != NULL ) { pyewf_file_entries->sub_file_entry_index++; } return( file_entry_object ); } libewf-20140807/pyewf/pyewf_datetime.h0000664000175000017500000000240113440663047021646 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * 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_DATETIME_H ) #define _PYEWF_DATETIME_H #include #include #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif PyObject *pyewf_datetime_new_from_fat_date_time( uint32_t fat_date_time ); PyObject *pyewf_datetime_new_from_filetime( uint64_t filetime ); PyObject *pyewf_datetime_new_from_posix_time( uint32_t posix_time ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/pyewf_file_objects_io_pool.c0000664000175000017500000000770313421024433024214 0ustar00lordyestalordyesta00000000000000/* * Python file objects IO pool functions * * 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 . */ #include #include #include "pyewf_file_object_io_handle.h" #include "pyewf_file_objects_io_pool.h" #include "pyewf_integer.h" #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" #include "pyewf_python.h" /* Initializes the file objects IO pool * Returns 1 if successful or -1 on error */ int pyewf_file_objects_pool_initialize( libbfio_pool_t **pool, PyObject *sequence_object, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; PyObject *file_object = NULL; static char *function = "pyewf_file_objects_pool_initialize"; Py_ssize_t sequence_size = 0; int element_index = 0; int file_io_pool_entry = 0; int number_of_elements = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( *pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid pool value already set.", function ); return( -1 ); } sequence_size = PySequence_Size( sequence_object ); if( sequence_size > (Py_ssize_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sequence size value exceeds maximum.", function ); goto on_error; } number_of_elements = (int) sequence_size; if( libbfio_pool_initialize( pool, 0, LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create pool.", function ); goto on_error; } for( element_index = 0; element_index < number_of_elements; element_index++ ) { file_object = PySequence_GetItem( sequence_object, element_index ); if( file_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing file object IO handle.", function ); goto on_error; } if( pyewf_file_object_initialize( &file_io_handle, file_object, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } if( libbfio_pool_append_handle( *pool, &file_io_pool_entry, file_io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle to pool.", function ); goto on_error; } file_io_handle = NULL; } return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( *pool != NULL ) { libbfio_pool_free( pool, NULL ); } return( -1 ); } libewf-20140807/pyewf/pyewf_file_object_io_handle.h0000664000175000017500000000771413440663047024335 0ustar00lordyestalordyesta00000000000000/* * Python file object IO handle functions * * 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_FILE_OBJECT_IO_HANDLE_H ) #define _PYEWF_FILE_OBJECT_IO_HANDLE_H #include #include #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct pyewf_file_object_io_handle pyewf_file_object_io_handle_t; struct pyewf_file_object_io_handle { /* The python file (like) object */ PyObject *file_object; /* The access flags */ int access_flags; }; int pyewf_file_object_io_handle_initialize( pyewf_file_object_io_handle_t **file_object_io_handle, PyObject *file_object, libcerror_error_t **error ); int pyewf_file_object_initialize( libbfio_handle_t **handle, PyObject *file_object, libcerror_error_t **error ); int pyewf_file_object_io_handle_free( pyewf_file_object_io_handle_t **file_object_io_handle, libcerror_error_t **error ); int pyewf_file_object_io_handle_clone( pyewf_file_object_io_handle_t **destination_file_object_io_handle, pyewf_file_object_io_handle_t *source_file_object_io_handle, libcerror_error_t **error ); int pyewf_file_object_io_handle_open( pyewf_file_object_io_handle_t *file_object_io_handle, int access_flags, libcerror_error_t **error ); int pyewf_file_object_io_handle_close( pyewf_file_object_io_handle_t *file_object_io_handle, libcerror_error_t **error ); ssize_t pyewf_file_object_read_buffer( PyObject *file_object, uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t pyewf_file_object_io_handle_read( pyewf_file_object_io_handle_t *file_object_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t pyewf_file_object_write_buffer( PyObject *file_object, const uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t pyewf_file_object_io_handle_write( pyewf_file_object_io_handle_t *file_object_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); int pyewf_file_object_seek_offset( PyObject *file_object, off64_t offset, int whence, libcerror_error_t **error ); int pyewf_file_object_get_offset( PyObject *file_object, off64_t *offset, libcerror_error_t **error ); off64_t pyewf_file_object_io_handle_seek_offset( pyewf_file_object_io_handle_t *file_object_io_handle, off64_t offset, int whence, libcerror_error_t **error ); int pyewf_file_object_io_handle_exists( pyewf_file_object_io_handle_t *file_object_io_handle, libcerror_error_t **error ); int pyewf_file_object_io_handle_is_open( pyewf_file_object_io_handle_t *file_object_io_handle, libcerror_error_t **error ); int pyewf_file_object_get_size( PyObject *file_object, size64_t *size, libcerror_error_t **error ); int pyewf_file_object_io_handle_get_size( pyewf_file_object_io_handle_t *file_object_io_handle, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _PYEWF_FILE_OBJECT_IO_HANDLE_H ) */ libewf-20140807/pyewf/Makefile.in0000664000175000017500000014441713443455350020551 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pyewf ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pyexecdir)" LTLIBRARIES = $(pyexec_LTLIBRARIES) @HAVE_PYTHON_TRUE@pyewf_la_DEPENDENCIES = ../libewf/libewf.la am__pyewf_la_SOURCES_DIST = pyewf.c pyewf.h pyewf_codepage.c \ pyewf_codepage.h pyewf_datetime.c pyewf_datetime.h \ pyewf_error.c pyewf_error.h pyewf_file_entries.c \ pyewf_file_entries.h pyewf_file_entry.c pyewf_file_entry.h \ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ pyewf_handle.c pyewf_handle.h pyewf_integer.c pyewf_integer.h \ pyewf_libbfio.h pyewf_libcerror.h pyewf_libclocale.h \ pyewf_libewf.h pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h pyewf_unused.h @HAVE_PYTHON_TRUE@am_pyewf_la_OBJECTS = pyewf_la-pyewf.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_codepage.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_datetime.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_error.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_file_entries.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_file_entry.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_file_object_io_handle.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_file_objects_io_pool.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_handle.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_integer.lo \ @HAVE_PYTHON_TRUE@ pyewf_la-pyewf_metadata.lo pyewf_la_OBJECTS = $(am_pyewf_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = pyewf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(pyewf_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_PYTHON_TRUE@am_pyewf_la_rpath = -rpath $(pyexecdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pyewf_la-pyewf.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_error.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_handle.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_integer.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(pyewf_la_SOURCES) DIST_SOURCES = $(am__pyewf_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_PYTHON_TRUE@AM_CFLAGS = \ @HAVE_PYTHON_TRUE@ -I$(top_srcdir)/include \ @HAVE_PYTHON_TRUE@ -I$(top_srcdir)/common \ @HAVE_PYTHON_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_PYTHON_TRUE@ @LIBBFIO_CPPFLAGS@ @HAVE_PYTHON_TRUE@pyexec_LTLIBRARIES = pyewf.la @HAVE_PYTHON_TRUE@pyewf_la_SOURCES = \ @HAVE_PYTHON_TRUE@ pyewf.c pyewf.h \ @HAVE_PYTHON_TRUE@ pyewf_codepage.c pyewf_codepage.h \ @HAVE_PYTHON_TRUE@ pyewf_datetime.c pyewf_datetime.h \ @HAVE_PYTHON_TRUE@ pyewf_error.c pyewf_error.h \ @HAVE_PYTHON_TRUE@ pyewf_file_entries.c pyewf_file_entries.h \ @HAVE_PYTHON_TRUE@ pyewf_file_entry.c pyewf_file_entry.h \ @HAVE_PYTHON_TRUE@ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ @HAVE_PYTHON_TRUE@ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ @HAVE_PYTHON_TRUE@ pyewf_handle.c pyewf_handle.h \ @HAVE_PYTHON_TRUE@ pyewf_integer.c pyewf_integer.h \ @HAVE_PYTHON_TRUE@ pyewf_libbfio.h \ @HAVE_PYTHON_TRUE@ pyewf_libcerror.h \ @HAVE_PYTHON_TRUE@ pyewf_libclocale.h \ @HAVE_PYTHON_TRUE@ pyewf_libewf.h \ @HAVE_PYTHON_TRUE@ pyewf_metadata.c pyewf_metadata.h \ @HAVE_PYTHON_TRUE@ pyewf_python.h \ @HAVE_PYTHON_TRUE@ pyewf_unused.h @HAVE_PYTHON_TRUE@pyewf_la_LIBADD = \ @HAVE_PYTHON_TRUE@ @LIBCERROR_LIBADD@ \ @HAVE_PYTHON_TRUE@ ../libewf/libewf.la @HAVE_PYTHON_TRUE@pyewf_la_CPPFLAGS = $(PYTHON_CPPFLAGS) @HAVE_PYTHON_TRUE@pyewf_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pyewf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pyewf/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ } uninstall-pyexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ done clean-pyexecLTLIBRARIES: -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) @list='$(pyexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } pyewf.la: $(pyewf_la_OBJECTS) $(pyewf_la_DEPENDENCIES) $(EXTRA_pyewf_la_DEPENDENCIES) $(AM_V_CCLD)$(pyewf_la_LINK) $(am_pyewf_la_rpath) $(pyewf_la_OBJECTS) $(pyewf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_integer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< pyewf_la-pyewf.lo: pyewf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf.Tpo -c -o pyewf_la-pyewf.lo `test -f 'pyewf.c' || echo '$(srcdir)/'`pyewf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf.Tpo $(DEPDIR)/pyewf_la-pyewf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf.c' object='pyewf_la-pyewf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf.lo `test -f 'pyewf.c' || echo '$(srcdir)/'`pyewf.c pyewf_la-pyewf_codepage.lo: pyewf_codepage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_codepage.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_codepage.Tpo -c -o pyewf_la-pyewf_codepage.lo `test -f 'pyewf_codepage.c' || echo '$(srcdir)/'`pyewf_codepage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_codepage.Tpo $(DEPDIR)/pyewf_la-pyewf_codepage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_codepage.c' object='pyewf_la-pyewf_codepage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_codepage.lo `test -f 'pyewf_codepage.c' || echo '$(srcdir)/'`pyewf_codepage.c pyewf_la-pyewf_datetime.lo: pyewf_datetime.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_datetime.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_datetime.Tpo -c -o pyewf_la-pyewf_datetime.lo `test -f 'pyewf_datetime.c' || echo '$(srcdir)/'`pyewf_datetime.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_datetime.Tpo $(DEPDIR)/pyewf_la-pyewf_datetime.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_datetime.c' object='pyewf_la-pyewf_datetime.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_datetime.lo `test -f 'pyewf_datetime.c' || echo '$(srcdir)/'`pyewf_datetime.c pyewf_la-pyewf_error.lo: pyewf_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_error.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_error.Tpo -c -o pyewf_la-pyewf_error.lo `test -f 'pyewf_error.c' || echo '$(srcdir)/'`pyewf_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_error.Tpo $(DEPDIR)/pyewf_la-pyewf_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_error.c' object='pyewf_la-pyewf_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_error.lo `test -f 'pyewf_error.c' || echo '$(srcdir)/'`pyewf_error.c pyewf_la-pyewf_file_entries.lo: pyewf_file_entries.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_entries.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_entries.Tpo -c -o pyewf_la-pyewf_file_entries.lo `test -f 'pyewf_file_entries.c' || echo '$(srcdir)/'`pyewf_file_entries.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_entries.Tpo $(DEPDIR)/pyewf_la-pyewf_file_entries.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_entries.c' object='pyewf_la-pyewf_file_entries.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_entries.lo `test -f 'pyewf_file_entries.c' || echo '$(srcdir)/'`pyewf_file_entries.c pyewf_la-pyewf_file_entry.lo: pyewf_file_entry.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_entry.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_entry.Tpo -c -o pyewf_la-pyewf_file_entry.lo `test -f 'pyewf_file_entry.c' || echo '$(srcdir)/'`pyewf_file_entry.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_entry.Tpo $(DEPDIR)/pyewf_la-pyewf_file_entry.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_entry.c' object='pyewf_la-pyewf_file_entry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_entry.lo `test -f 'pyewf_file_entry.c' || echo '$(srcdir)/'`pyewf_file_entry.c pyewf_la-pyewf_file_object_io_handle.lo: pyewf_file_object_io_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_object_io_handle.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Tpo -c -o pyewf_la-pyewf_file_object_io_handle.lo `test -f 'pyewf_file_object_io_handle.c' || echo '$(srcdir)/'`pyewf_file_object_io_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Tpo $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_object_io_handle.c' object='pyewf_la-pyewf_file_object_io_handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_object_io_handle.lo `test -f 'pyewf_file_object_io_handle.c' || echo '$(srcdir)/'`pyewf_file_object_io_handle.c pyewf_la-pyewf_file_objects_io_pool.lo: pyewf_file_objects_io_pool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_objects_io_pool.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Tpo -c -o pyewf_la-pyewf_file_objects_io_pool.lo `test -f 'pyewf_file_objects_io_pool.c' || echo '$(srcdir)/'`pyewf_file_objects_io_pool.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Tpo $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_objects_io_pool.c' object='pyewf_la-pyewf_file_objects_io_pool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_objects_io_pool.lo `test -f 'pyewf_file_objects_io_pool.c' || echo '$(srcdir)/'`pyewf_file_objects_io_pool.c pyewf_la-pyewf_handle.lo: pyewf_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_handle.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_handle.Tpo -c -o pyewf_la-pyewf_handle.lo `test -f 'pyewf_handle.c' || echo '$(srcdir)/'`pyewf_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_handle.Tpo $(DEPDIR)/pyewf_la-pyewf_handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_handle.c' object='pyewf_la-pyewf_handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_handle.lo `test -f 'pyewf_handle.c' || echo '$(srcdir)/'`pyewf_handle.c pyewf_la-pyewf_integer.lo: pyewf_integer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_integer.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_integer.Tpo -c -o pyewf_la-pyewf_integer.lo `test -f 'pyewf_integer.c' || echo '$(srcdir)/'`pyewf_integer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_integer.Tpo $(DEPDIR)/pyewf_la-pyewf_integer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_integer.c' object='pyewf_la-pyewf_integer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_integer.lo `test -f 'pyewf_integer.c' || echo '$(srcdir)/'`pyewf_integer.c pyewf_la-pyewf_metadata.lo: pyewf_metadata.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_metadata.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_metadata.Tpo -c -o pyewf_la-pyewf_metadata.lo `test -f 'pyewf_metadata.c' || echo '$(srcdir)/'`pyewf_metadata.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_metadata.Tpo $(DEPDIR)/pyewf_la-pyewf_metadata.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_metadata.c' object='pyewf_la-pyewf_metadata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_metadata.lo `test -f 'pyewf_metadata.c' || echo '$(srcdir)/'`pyewf_metadata.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pyexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-pyexecLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pyexecLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pyewf_la-pyewf.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_error.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_handle.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_integer.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pyexecLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pyexecLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am \ install-pyexecLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-pyexecLTLIBRARIES .PRECIOUS: Makefile @HAVE_PYTHON_TRUE@ @LIBCDATA_LIBADD@ \ @HAVE_PYTHON_TRUE@ @LIBCLOCALE_LIBADD@ \ @HAVE_PYTHON_TRUE@ @LIBCSPLIT_LIBADD@ \ @HAVE_PYTHON_TRUE@ @LIBUNA_LIBADD@ \ @HAVE_PYTHON_TRUE@ @LIBCFILE_LIBADD@ \ @HAVE_PYTHON_TRUE@ @LIBCPATH_LIBADD@ \ @HAVE_PYTHON_TRUE@ @LIBBFIO_LIBADD@ distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/pyewf/pyewf_codepage.c0000664000175000017500000000622413440663047021623 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * 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 . */ #include #include #include "pyewf_codepage.h" #include "pyewf_libewf.h" /* Returns a string representation of the codepage * Codecs and aliases are defined: http://docs.python.org/library/codecs.html#standard-encodings * Returns 1 if successful or NULL if codepage is not supported */ const char *pyewf_codepage_to_string( int codepage ) { switch( codepage ) { case LIBEWF_CODEPAGE_ASCII: return( "ascii" ); case LIBEWF_CODEPAGE_ISO_8859_1: return( "iso-8859-1" ); case LIBEWF_CODEPAGE_ISO_8859_2: return( "iso-8859-2" ); case LIBEWF_CODEPAGE_ISO_8859_3: return( "iso-8859-3" ); case LIBEWF_CODEPAGE_ISO_8859_4: return( "iso-8859-4" ); case LIBEWF_CODEPAGE_ISO_8859_5: return( "iso-8859-5" ); case LIBEWF_CODEPAGE_ISO_8859_6: return( "iso-8859-6" ); case LIBEWF_CODEPAGE_ISO_8859_7: return( "iso-8859-7" ); case LIBEWF_CODEPAGE_ISO_8859_8: return( "iso-8859-8" ); case LIBEWF_CODEPAGE_ISO_8859_9: return( "iso-8859-9" ); case LIBEWF_CODEPAGE_ISO_8859_10: return( "iso-8859-10" ); case LIBEWF_CODEPAGE_ISO_8859_11: return( "iso-8859-11" ); case LIBEWF_CODEPAGE_ISO_8859_13: return( "iso-8859-13" ); case LIBEWF_CODEPAGE_ISO_8859_14: return( "iso-8859-14" ); case LIBEWF_CODEPAGE_ISO_8859_15: return( "iso-8859-15" ); case LIBEWF_CODEPAGE_ISO_8859_16: return( "iso-8859-16" ); case LIBEWF_CODEPAGE_KOI8_R: return( "koi8_r" ); case LIBEWF_CODEPAGE_KOI8_U: return( "koi8_u" ); case LIBEWF_CODEPAGE_WINDOWS_874: return( "cp874" ); case LIBEWF_CODEPAGE_WINDOWS_932: return( "cp932" ); case LIBEWF_CODEPAGE_WINDOWS_936: return( "cp936" ); case LIBEWF_CODEPAGE_WINDOWS_949: return( "cp949" ); case LIBEWF_CODEPAGE_WINDOWS_950: return( "cp950" ); case LIBEWF_CODEPAGE_WINDOWS_1250: return( "cp1250" ); case LIBEWF_CODEPAGE_WINDOWS_1251: return( "cp1251" ); case LIBEWF_CODEPAGE_WINDOWS_1252: return( "cp1252" ); case LIBEWF_CODEPAGE_WINDOWS_1253: return( "cp1253" ); case LIBEWF_CODEPAGE_WINDOWS_1254: return( "cp1254" ); case LIBEWF_CODEPAGE_WINDOWS_1255: return( "cp1255" ); case LIBEWF_CODEPAGE_WINDOWS_1256: return( "cp1256" ); case LIBEWF_CODEPAGE_WINDOWS_1257: return( "cp1257" ); case LIBEWF_CODEPAGE_WINDOWS_1258: return( "cp1258" ); default: break; } return( NULL ); } libewf-20140807/pyewf/pyewf_file_entries.h0000664000175000017500000000507213440663047022531 0ustar00lordyestalordyesta00000000000000/* * Python object definition of the file entries sequence and iterator * * 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_FILE_ENTRIES_H ) #define _PYEWF_FILE_ENTRIES_H #include #include #include "pyewf_file_entry.h" #include "pyewf_libewf.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct pyewf_file_entries pyewf_file_entries_t; struct pyewf_file_entries { /* Python object initialization */ PyObject_HEAD /* The file entry object */ pyewf_file_entry_t *file_entry_object; /* The get sub file entry by index callback function */ PyObject* (*get_sub_file_entry_by_index)( pyewf_file_entry_t *file_entry_object, int sub_file_entry_index ); /* The (current) sub file entry index */ int sub_file_entry_index; /* The number of sub file entries */ int number_of_sub_file_entries; }; extern PyTypeObject pyewf_file_entries_type_object; PyObject *pyewf_file_entries_new( pyewf_file_entry_t *file_entry_object, PyObject* (*get_sub_file_entry_by_index)( pyewf_file_entry_t *file_entry_object, int sub_file_entry_index ), int number_of_sub_file_entries ); int pyewf_file_entries_init( pyewf_file_entries_t *pyewf_file_entries ); void pyewf_file_entries_free( pyewf_file_entries_t *pyewf_file_entries ); Py_ssize_t pyewf_file_entries_len( pyewf_file_entries_t *pyewf_file_entries ); PyObject *pyewf_file_entries_getitem( pyewf_file_entries_t *pyewf_file_entries, Py_ssize_t item_index ); PyObject *pyewf_file_entries_iter( pyewf_file_entries_t *pyewf_file_entries ); PyObject *pyewf_file_entries_iternext( pyewf_file_entries_t *pyewf_file_entries ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/pyewf_metadata.h0000644000175000017500000000444613421023552021631 0ustar00lordyestalordyesta00000000000000/* * Metadata functions for the Python object definition of the libewf handle * * Copyright (c) 2008, David Collett * 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_METADATA_H ) #define _PYEWF_METADATA_H #include #include #include "pyewf_handle.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif PyObject *pyewf_handle_get_media_size( pyewf_handle_t *pyewf_handle, PyObject *arguments ); PyObject *pyewf_handle_get_header_codepage( pyewf_handle_t *pyewf_handle, PyObject *arguments ); int pyewf_handle_set_header_codepage_from_string( pyewf_handle_t *pyewf_handle, const char *codepage_string ); PyObject *pyewf_handle_set_header_codepage( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); int pyewf_handle_set_header_codepage_setter( pyewf_handle_t *pyewf_handle, PyObject *value_object, void *closure ); PyObject *pyewf_handle_get_header_value( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_get_header_values( pyewf_handle_t *pyewf_handle, PyObject *arguments ); PyObject *pyewf_handle_get_hash_value( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_get_hash_values( pyewf_handle_t *pyewf_handle, PyObject *arguments ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/pyewf.c0000664000175000017500000003041713440663047017775 0ustar00lordyestalordyesta00000000000000/* * Python bindings module for libewf (pyewf) * * Copyright (c) 2008, David Collett * 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) #include #endif #include "pyewf.h" #include "pyewf_error.h" #include "pyewf_file_entries.h" #include "pyewf_file_entry.h" #include "pyewf_file_object_io_handle.h" #include "pyewf_handle.h" #include "pyewf_libcerror.h" #include "pyewf_libewf.h" #include "pyewf_python.h" #include "pyewf_unused.h" #if !defined( LIBEWF_HAVE_BFIO ) LIBEWF_EXTERN \ int libewf_check_file_signature_file_io_handle( libbfio_handle_t *file_io_handle, libewf_error_t **error ); #endif /* The pyewf module methods */ PyMethodDef pyewf_module_methods[] = { { "get_version", (PyCFunction) pyewf_get_version, METH_NOARGS, "get_version() -> String\n" "\n" "Retrieves the version." }, { "check_file_signature", (PyCFunction) pyewf_check_file_signature, METH_VARARGS | METH_KEYWORDS, "check_file_signature(filename) -> Boolean\n" "\n" "Checks if a file has an Expert Witness Compression Format (EWF) signature." }, { "check_file_signature_file_object", (PyCFunction) pyewf_check_file_signature_file_object, METH_VARARGS | METH_KEYWORDS, "check_file_signature_file_object(filename) -> Boolean\n" "\n" "Checks if a file has an Expert Witness Compression Format (EWF) signature using a file-like object." }, { "glob", (PyCFunction) pyewf_glob, METH_VARARGS | METH_KEYWORDS, "glob(filename) -> Object\n" "\n" "Globs filenames according to the Expert Witness Compression Format (EWF) segment file naming schema\n" "based on the extension (e.g. E01) and returns a sequence (list) of all the segment filenames." }, { "open", (PyCFunction) pyewf_handle_new_open, METH_VARARGS | METH_KEYWORDS, "open(filenames, mode='r') -> Object\n" "\n" "Opens file(s) from a sequence (list) of all the segment filenames.\n" "Use pyewf.glob() to determine the segment filenames from first (E01)." }, /* TODO: open file-like object using pool - list of file objects */ /* Sentinel */ { NULL, NULL, 0, NULL} }; /* Retrieves the pyewf/libewf version * Returns a Python object if successful or NULL on error */ PyObject *pyewf_get_version( PyObject *self PYEWF_ATTRIBUTE_UNUSED, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { const char *errors = NULL; const char *version_string = NULL; size_t version_string_length = 0; PYEWF_UNREFERENCED_PARAMETER( self ) PYEWF_UNREFERENCED_PARAMETER( arguments ) Py_BEGIN_ALLOW_THREADS version_string = libewf_get_version(); Py_END_ALLOW_THREADS version_string_length = narrow_string_length( version_string ); /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ return( PyUnicode_DecodeUTF8( version_string, (Py_ssize_t) version_string_length, errors ) ); } /* Checks if the file has an Expert Witness Compression Format (EWF) signature * Returns a Python object if successful or NULL on error */ PyObject *pyewf_check_file_signature( PyObject *self PYEWF_ATTRIBUTE_UNUSED, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; static char *function = "pyewf_check_file_signature"; static char *keyword_list[] = { "filename", NULL }; const char *filename = NULL; int result = 0; PYEWF_UNREFERENCED_PARAMETER( self ) if( PyArg_ParseTupleAndKeywords( arguments, keywords, "|s", keyword_list, &filename ) == 0 ) { return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_check_file_signature( filename, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to check file signature.", function ); libcerror_error_free( &error ); return( NULL ); } if( result != 0 ) { Py_IncRef( (PyObject *) Py_True ); return( Py_True ); } Py_IncRef( (PyObject *) Py_False ); return( Py_False ); } /* Checks if the file has a Windows Event Log (EWF) file signature using a file-like object * Returns a Python object if successful or NULL on error */ PyObject *pyewf_check_file_signature_file_object( PyObject *self PYEWF_ATTRIBUTE_UNUSED, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; libbfio_handle_t *file_io_handle = NULL; PyObject *file_object = NULL; static char *function = "pyewf_check_file_signature_file_object"; static char *keyword_list[] = { "file_object", NULL }; int result = 0; PYEWF_UNREFERENCED_PARAMETER( self ) if( PyArg_ParseTupleAndKeywords( arguments, keywords, "|O", keyword_list, &file_object ) == 0 ) { return( NULL ); } if( pyewf_file_object_initialize( &file_io_handle, file_object, &error ) != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to initialize file IO handle.", function ); libcerror_error_free( &error ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_check_file_signature_file_io_handle( file_io_handle, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to check file signature.", function ); libcerror_error_free( &error ); goto on_error; } if( libbfio_handle_free( &file_io_handle, &error ) != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to free file IO handle.", function ); libcerror_error_free( &error ); goto on_error; } if( result != 0 ) { Py_IncRef( (PyObject *) Py_True ); return( Py_True ); } Py_IncRef( (PyObject *) Py_False ); return( Py_False ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( NULL ); } /* Globs filenames according to the Expert Witness Compression Format (EWF) segment file naming schema * Returns a Python object if successful or NULL on error */ PyObject *pyewf_glob( PyObject *self PYEWF_ATTRIBUTE_UNUSED, PyObject *arguments, PyObject *keywords ) { char **filenames = NULL; libcerror_error_t *error = NULL; PyObject *list_object = NULL; PyObject *string_object = NULL; static char *function = "pyewf_glob"; static char *keyword_list[] = { "filename", NULL }; const char *errors = NULL; const char *filename = NULL; size_t filename_length = 0; int filename_index = 0; int number_of_filenames = 0; PYEWF_UNREFERENCED_PARAMETER( self ) if( PyArg_ParseTupleAndKeywords( arguments, keywords, "|s", keyword_list, &filename ) == 0 ) { return( NULL ); } filename_length = narrow_string_length( filename ); if( libewf_glob( filename, filename_length, LIBEWF_FORMAT_UNKNOWN, &filenames, &number_of_filenames, &error ) != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to glob filenames.", function ); libcerror_error_free( &error ); goto on_error; } list_object = PyList_New( (Py_ssize_t) number_of_filenames ); for( filename_index = 0; filename_index < number_of_filenames; filename_index++ ) { filename_length = narrow_string_length( filenames[ filename_index ] ); /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( filenames[ filename_index ], filename_length, errors ); if( string_object == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to convert UTF-8 filename: %d into Unicode.", function, filename_index ); goto on_error; } if( PyList_SetItem( list_object, (Py_ssize_t) filename_index, string_object ) != 0 ) { PyErr_Format( PyExc_MemoryError, "%s: unable to set filename: %d in list.", function, filename_index ); goto on_error; } string_object = NULL; } if( libewf_glob_free( filenames, number_of_filenames, &error ) != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to free globbed filenames.", function ); libcerror_error_free( &error ); goto on_error; } return( list_object ); on_error: if( string_object != NULL ) { Py_DecRef( string_object ); } if( list_object != NULL ) { Py_DecRef( list_object ); } if( filenames != NULL ) { libewf_glob_free( filenames, number_of_filenames, NULL ); } return( NULL ); } #if PY_MAJOR_VERSION >= 3 /* The pyewf module definition */ PyModuleDef pyewf_module_definition = { PyModuleDef_HEAD_INIT, /* m_name */ "pyewf", /* m_doc */ "Python libewf module (pyewf).", /* m_size */ -1, /* m_methods */ pyewf_module_methods, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL, /* m_free */ NULL, }; #endif /* PY_MAJOR_VERSION >= 3 */ /* Initializes the pyewf module */ #if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit_pyewf( void ) #else PyMODINIT_FUNC initpyewf( void ) #endif { PyObject *module = NULL; PyTypeObject *file_entries_type_object = NULL; PyTypeObject *file_entry_type_object = NULL; PyTypeObject *handle_type_object = NULL; PyGILState_STATE gil_state = 0; /* Create the module * This function must be called before grabbing the GIL * otherwise the module will segfault on a version mismatch */ #if PY_MAJOR_VERSION >= 3 module = PyModule_Create( &pyewf_module_definition ); #else module = Py_InitModule3( "pyewf", pyewf_module_methods, "Python libewf module (pyewf)." ); #endif if( module == NULL ) { #if PY_MAJOR_VERSION >= 3 return( NULL ); #else return; #endif } PyEval_InitThreads(); gil_state = PyGILState_Ensure(); /* Setup the handle type object */ pyewf_handle_type_object.tp_new = PyType_GenericNew; if( PyType_Ready( &pyewf_handle_type_object ) < 0 ) { goto on_error; } Py_IncRef( (PyObject *) &pyewf_handle_type_object ); handle_type_object = &pyewf_handle_type_object; PyModule_AddObject( module, "handle", (PyObject *) handle_type_object ); /* Setup the file entry type object */ pyewf_file_entry_type_object.tp_new = PyType_GenericNew; if( PyType_Ready( &pyewf_file_entry_type_object ) < 0 ) { goto on_error; } Py_IncRef( (PyObject *) &pyewf_file_entry_type_object ); file_entry_type_object = &pyewf_file_entry_type_object; PyModule_AddObject( module, "file_entry", (PyObject *) file_entry_type_object ); /* Setup the file entries type object */ pyewf_file_entries_type_object.tp_new = PyType_GenericNew; if( PyType_Ready( &pyewf_file_entries_type_object ) < 0 ) { goto on_error; } Py_IncRef( (PyObject *) &pyewf_file_entries_type_object ); file_entries_type_object = &pyewf_file_entries_type_object; PyModule_AddObject( module, "_file_entries", (PyObject *) file_entries_type_object ); #if PY_MAJOR_VERSION >= 3 return( module ); #else return; #endif on_error: PyGILState_Release( gil_state ); #if PY_MAJOR_VERSION >= 3 return( NULL ); #else return; #endif } libewf-20140807/pyewf/pyewf_error.h0000664000175000017500000000276413440663047021217 0ustar00lordyestalordyesta00000000000000/* * Error functions * * 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_ERROR_H ) #define _PYEWF_ERROR_H #include #include #include "pyewf_libcerror.h" #include "pyewf_python.h" #define PYEWF_ERROR_STRING_SIZE 2048 #if defined( __cplusplus ) extern "C" { #endif void pyewf_error_fetch( libcerror_error_t **error, int error_domain, int error_code, const char *format_string, ... ); void pyewf_error_fetch_and_raise( PyObject *exception_object, const char *format_string, ... ); void pyewf_error_raise( libcerror_error_t *error, PyObject *exception_object, const char *format_string, ... ); #if defined( __cplusplus ) } #endif #endif /* !defined( _PYEWF_ERROR_H ) */ libewf-20140807/pyewf/pyewf_file_objects_io_pool.h0000644000175000017500000000241013421023552024206 0ustar00lordyestalordyesta00000000000000/* * Python file objects IO pool functions * * 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_FILE_OBJECTS_IO_POOL_H ) #define _PYEWF_FILE_OBJECTS_IO_POOL_H #include #include #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif int pyewf_file_objects_pool_initialize( libbfio_pool_t **pool, PyObject *sequence_object, int access_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/pyewf/pyewf_libclocale.h0000664000175000017500000000254013440663047022147 0ustar00lordyestalordyesta00000000000000/* * The internal libclocale 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_LIBCLOCALE_H ) #define _PYEWF_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif #endif libewf-20140807/pyewf/pyewf_integer.c0000664000175000017500000002121013440663047021501 0ustar00lordyestalordyesta00000000000000/* * Integer functions * * 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 . */ #include #include #include "pyewf_error.h" #include "pyewf_libcerror.h" #include "pyewf_integer.h" #include "pyewf_python.h" /* Creates a new signed integer object from a 64-bit value * Returns a Python object if successful or NULL on error */ PyObject *pyewf_integer_signed_new_from_64bit( int64_t value_64bit ) { PyObject *integer_object = NULL; static char *function = "pyewf_integer_signed_new_from_64bit"; #if defined( HAVE_LONG_LONG ) if( ( value_64bit < (int64_t) LLONG_MIN ) || ( value_64bit > (int64_t) LLONG_MAX ) ) { PyErr_Format( PyExc_OverflowError, "%s: 64-bit value out of bounds.", function ); return( NULL ); } integer_object = PyLong_FromLongLong( (long long) value_64bit ); #else if( current_offset > (off64_t) LONG_MAX ) { PyErr_Format( PyExc_OverflowError, "%s: 64-bit value out of bounds.", function ); return( NULL ); } integer_object = PyLong_FromLong( (long) value_64bit ); #endif return( integer_object ); } /* Creates a new unsigned integer object from a 64-bit value * Returns a Python object if successful or NULL on error */ PyObject *pyewf_integer_unsigned_new_from_64bit( uint64_t value_64bit ) { PyObject *integer_object = NULL; static char *function = "pyewf_integer_unsigned_new_from_64bit"; #if defined( HAVE_LONG_LONG ) if( value_64bit > (uint64_t) ULLONG_MAX ) { PyErr_Format( PyExc_OverflowError, "%s: 64-bit value exceeds maximum.", function ); return( NULL ); } integer_object = PyLong_FromUnsignedLongLong( (long long) value_64bit ); #else if( value_64bit > (uint64_t) ULONG_MAX ) { PyErr_Format( PyExc_OverflowError, "%s: 64-bit value exceeds maximum.", function ); return( NULL ); } integer_object = PyLong_FromUnsignedLong( (long) value_64bit ); #endif return( integer_object ); } /* Copies a Python int or long object to a signed 64-bit value * Returns 1 if successful or -1 on error */ int pyewf_integer_signed_copy_to_64bit( PyObject *integer_object, int64_t *value_64bit, libcerror_error_t **error ) { static char *function = "pyewf_integer_signed_copy_to_64bit"; int result = 0; #if defined( HAVE_LONG_LONG ) PY_LONG_LONG long_value = 0; #else long long_value = 0; #endif if( integer_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer object.", function ); return( -1 ); } PyErr_Clear(); result = PyObject_IsInstance( integer_object, (PyObject *) &PyLong_Type ); if( result == -1 ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if integer object is of type long.", function ); return( -1 ); } else if( result != 0 ) { PyErr_Clear(); #if defined( HAVE_LONG_LONG ) long_value = PyLong_AsLongLong( integer_object ); #else long_value = PyLong_AsLong( integer_object ); #endif } #if PY_MAJOR_VERSION < 3 if( result == 0 ) { PyErr_Clear(); result = PyObject_IsInstance( integer_object, (PyObject *) &PyInt_Type ); if( result == -1 ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if integer object is of type int.", function ); return( -1 ); } else if( result != 0 ) { PyErr_Clear(); long_value = PyInt_AsLong( integer_object ); } } #endif /* PY_MAJOR_VERSION < 3 */ if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unsupported integer object type.", function ); return( -1 ); } if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to convert integer object to long.", function ); return( -1 ); } #if defined( HAVE_LONG_LONG ) && ( SIZEOF_LONG_LONG > 8 ) if( ( long_value < (PY_LONG_LONG) INT64_MIN ) || ( long_value > (PY_LONG_LONG) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid long value out of bounds.", function ); return( -1 ); } #elif ( SIZEOF_LONG > 8 ) if( ( long_value > (long) INT64_MIN ) || ( long_value > (long) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid long value out of bounds.", function ); return( -1 ); } #endif *value_64bit = (int64_t) long_value; return( 1 ); } /* Copies a Python int or long object to an unsigned 64-bit value * Returns 1 if successful or -1 on error */ int pyewf_integer_unsigned_copy_to_64bit( PyObject *integer_object, uint64_t *value_64bit, libcerror_error_t **error ) { static char *function = "pyewf_integer_unsigned_copy_to_64bit"; int result = 0; #if defined( HAVE_LONG_LONG ) PY_LONG_LONG long_value = 0; #else long long_value = 0; #endif if( integer_object == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer object.", function ); return( -1 ); } PyErr_Clear(); result = PyObject_IsInstance( integer_object, (PyObject *) &PyLong_Type ); if( result == -1 ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if integer object is of type long.", function ); return( -1 ); } else if( result != 0 ) { PyErr_Clear(); #if defined( HAVE_LONG_LONG ) long_value = PyLong_AsUnsignedLongLong( integer_object ); #else long_value = PyLong_AsUnsignedLong( integer_object ); #endif } #if PY_MAJOR_VERSION < 3 if( result == 0 ) { PyErr_Clear(); result = PyObject_IsInstance( integer_object, (PyObject *) &PyInt_Type ); if( result == -1 ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if integer object is of type int.", function ); return( -1 ); } else if( result != 0 ) { PyErr_Clear(); #if defined( HAVE_LONG_LONG ) long_value = PyInt_AsUnsignedLongLongMask( integer_object ); #else long_value = PyInt_AsUnsignedLongMask( integer_object ); #endif } } #endif /* PY_MAJOR_VERSION < 3 */ if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unsupported integer object type.", function ); return( -1 ); } if( PyErr_Occurred() ) { pyewf_error_fetch( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to convert integer object to long.", function ); return( -1 ); } #if defined( HAVE_LONG_LONG ) #if ( SIZEOF_LONG_LONG > 8 ) if( ( long_value < (PY_LONG_LONG) 0 ) || ( long_value > (PY_LONG_LONG) UINT64_MAX ) ) #else if( long_value < (PY_LONG_LONG) 0 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid long value out of bounds.", function ); return( -1 ); } #else #if ( SIZEOF_LONG > 8 ) if( ( long_value < (long) 0 ) || ( long_value > (long) UINT64_MAX ) ) #else if( long_value < (PY_LONG_LONG) 0 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid long value out of bounds.", function ); return( -1 ); } #endif *value_64bit = (uint64_t) long_value; return( 1 ); } libewf-20140807/pyewf/pyewf_datetime.c0000664000175000017500000002503413440663047021650 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * 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 . */ #include #include #include "pyewf_datetime.h" #include "pyewf_python.h" #include /* Creates a new datetime object from a FAT date time * Returns a Python object if successful or NULL on error */ PyObject *pyewf_datetime_new_from_fat_date_time( uint32_t fat_date_time ) { static char *function = "pyewf_datetime_new_from_fat_date_time"; PyObject *date_time_object = NULL; uint16_t year = 0; uint8_t days_in_month = 0; uint8_t day_of_month = 0; uint8_t hours = 0; uint8_t minutes = 0; uint8_t month = 0; uint8_t seconds = 0; /* The day of month is stored in the next 5 bits */ day_of_month = fat_date_time & 0x1f; fat_date_time >>= 5; /* The month is stored in the next 4 bits */ month = fat_date_time & 0x0f; fat_date_time >>= 4; /* The year is stored in the next 7 bits starting at 1980 */ year = 1980 + ( fat_date_time & 0x7f ); fat_date_time >>= 7; /* The number of seconds are stored in the lower 5 bits * in intervals of 2 seconds */ seconds = ( fat_date_time & 0x1f ) * 2; fat_date_time >>= 5; /* The number of minutes are stored in the next 6 bits */ minutes = fat_date_time & 0x3f; fat_date_time >>= 6; /* The number of hours are stored in the next 5 bits */ hours = fat_date_time & 0x1f; /* February (2) */ if( month == 2 ) { if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_month = 29; } else { days_in_month = 28; } } /* April (4), June (6), September (9), November (11) */ else if( ( month == 4 ) || ( month == 6 ) || ( month == 9 ) || ( month == 11 ) ) { days_in_month = 30; } /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) || ( month == 5 ) || ( month == 7 ) || ( month == 8 ) || ( month == 10 ) || ( month == 12 ) ) { days_in_month = 31; } else { PyErr_Format( PyExc_IOError, "%s: unsupported month: %" PRIu8 ".", function, month ); return( NULL ); } if( ( day_of_month == 0 ) || ( day_of_month > days_in_month ) ) { PyErr_Format( PyExc_IOError, "%s: unsupported day of month: %" PRIu8 ".", function, day_of_month ); return( NULL ); } PyDateTime_IMPORT; date_time_object = (PyObject *) PyDateTime_FromDateAndTime( (int) year, (int) month, (int) day_of_month, (int) hours, (int) minutes, (int) seconds, 0 ); return( date_time_object ); } /* Creates a new datetime object from a FILETIME * Returns a Python object if successful or NULL on error */ PyObject *pyewf_datetime_new_from_filetime( uint64_t filetime ) { static char *function = "pyewf_datetime_new_from_filetime"; PyObject *date_time_object = NULL; uint32_t micro_seconds = 0; uint32_t days_in_century = 0; uint16_t days_in_year = 0; uint16_t year = 0; uint8_t day_of_month = 0; uint8_t days_in_month = 0; uint8_t hours = 0; uint8_t minutes = 0; uint8_t month = 0; uint8_t seconds = 0; /* The timestamp is in units of 100 nano seconds correct the value to seconds */ micro_seconds = (uint32_t) ( filetime % 10000000 ) / 10; filetime /= 10000000; /* There are 60 seconds in a minute correct the value to minutes */ seconds = (uint8_t) ( filetime % 60 ); filetime /= 60; /* There are 60 minutes in an hour correct the value to hours */ minutes = (uint8_t) ( filetime % 60 ); filetime /= 60; /* There are 24 hours in a day correct the value to days */ hours = (uint8_t) ( filetime % 24 ); filetime /= 24; /* Add 1 day to compensate that Jan 1 1601 is represented as 0 */ filetime += 1; /* Determine the number of years starting at '1 Jan 1601 00:00:00' * correct the value to days within the year */ year = 1601; if( filetime >= 36159 ) { year = 1700; filetime -= 36159; } while( filetime > 0 ) { if( ( year % 400 ) == 0 ) { days_in_century = 36525; } else { days_in_century = 36524; } if( filetime <= days_in_century ) { break; } filetime -= days_in_century; year += 100; } while( filetime > 0 ) { /* Check for a leap year * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) */ if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_year = 366; } else { days_in_year = 365; } if( filetime <= days_in_year ) { break; } filetime -= days_in_year; year += 1; } /* Determine the month correct the value to days within the month */ month = 1; while( filetime > 0 ) { /* February (2) */ if( month == 2 ) { if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_month = 29; } else { days_in_month = 28; } } /* April (4), June (6), September (9), November (11) */ else if( ( month == 4 ) || ( month == 6 ) || ( month == 9 ) || ( month == 11 ) ) { days_in_month = 30; } /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) || ( month == 5 ) || ( month == 7 ) || ( month == 8 ) || ( month == 10 ) || ( month == 12 ) ) { days_in_month = 31; } /* This should never happen, but just in case */ else { PyErr_Format( PyExc_IOError, "%s: unsupported month: %" PRIu8 ".", function, month ); return( NULL ); } if( filetime <= days_in_month ) { break; } filetime -= days_in_month; month += 1; } /* Determine the day */ day_of_month = (uint8_t) filetime; PyDateTime_IMPORT; date_time_object = (PyObject *) PyDateTime_FromDateAndTime( (int) year, (int) month, (int) day_of_month, (int) hours, (int) minutes, (int) seconds, (int) micro_seconds ); return( date_time_object ); } /* Creates a new datetime object from a POSIX time * Returns a Python object if successful or NULL on error */ PyObject *pyewf_datetime_new_from_posix_time( uint32_t posix_time ) { static char *function = "pyewf_datetime_new_from_posix_time"; PyObject *date_time_object = NULL; uint16_t days_in_year = 0; uint16_t year = 0; uint8_t day_of_month = 0; uint8_t days_in_month = 0; uint8_t hours = 0; uint8_t minutes = 0; uint8_t month = 0; uint8_t seconds = 0; /* There are 60 seconds in a minute correct the value to minutes */ seconds = posix_time % 60; posix_time /= 60; /* There are 60 minutes in an hour correct the value to hours */ minutes = posix_time % 60; posix_time /= 60; /* There are 24 hours in a day correct the value to days */ hours = posix_time % 24; posix_time /= 24; /* Add 1 day to compensate that Jan 1 1601 is represented as 0 */ posix_time += 1; /* Determine the number of years starting at '1 Jan 1970 00:00:00' * correct the value to days within the year */ year = 1970; if( posix_time >= 10957 ) { year = 2000; posix_time -= 10957; } while( posix_time > 0 ) { /* Check for a leap year * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) */ if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_year = 366; } else { days_in_year = 365; } if( posix_time <= days_in_year ) { break; } posix_time -= days_in_year; year += 1; } /* Determine the month correct the value to days within the month */ month = 1; while( posix_time > 0 ) { /* February (2) */ if( month == 2 ) { if( ( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) || ( ( year % 400 ) == 0 ) ) { days_in_month = 29; } else { days_in_month = 28; } } /* April (4), June (6), September (9), November (11) */ else if( ( month == 4 ) || ( month == 6 ) || ( month == 9 ) || ( month == 11 ) ) { days_in_month = 30; } /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) || ( month == 5 ) || ( month == 7 ) || ( month == 8 ) || ( month == 10 ) || ( month == 12 ) ) { days_in_month = 31; } /* This should never happen, but just in case */ else { PyErr_Format( PyExc_IOError, "%s: unsupported month: %" PRIu8 ".", function, month ); return( NULL ); } if( posix_time <= days_in_month ) { break; } posix_time -= days_in_month; month += 1; } /* Determine the day */ day_of_month = (uint8_t) posix_time; PyDateTime_IMPORT; date_time_object = (PyObject *) PyDateTime_FromDateAndTime( (int) year, (int) month, (int) day_of_month, (int) hours, (int) minutes, (int) seconds, 0 ); return( date_time_object ); } libewf-20140807/pyewf/pyewf_file_entry.c0000664000175000017500000011427313440663047022220 0ustar00lordyestalordyesta00000000000000/* * Python object definition of the libewf file entry * * 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 . */ #include #include #include #include #if defined( HAVE_STDLIB_H ) #include #endif #include "pyewf_datetime.h" #include "pyewf_error.h" #include "pyewf_file_entries.h" #include "pyewf_file_entry.h" #include "pyewf_integer.h" #include "pyewf_libcerror.h" #include "pyewf_libewf.h" #include "pyewf_metadata.h" #include "pyewf_python.h" #include "pyewf_unused.h" PyMethodDef pyewf_file_entry_object_methods[] = { /* Functions to access the file entry data */ { "read_buffer", (PyCFunction) pyewf_file_entry_read_buffer, METH_VARARGS | METH_KEYWORDS, "read_buffer(size) -> String\n" "\n" "Reads a buffer of file entry data." }, { "read_random", (PyCFunction) pyewf_file_entry_read_random, METH_VARARGS | METH_KEYWORDS, "read_random(size, offset) -> String\n" "\n" "Reads a buffer of file entry data at a specific offset." }, { "seek_offset", (PyCFunction) pyewf_file_entry_seek_offset, METH_VARARGS | METH_KEYWORDS, "seek_offset(offset, whence) -> None\n" "\n" "Seeks an offset within the file entry data." }, { "get_offset", (PyCFunction) pyewf_file_entry_get_offset, METH_NOARGS, "get_offset() -> Integer\n" "\n" "Returns the current offset within the file entry data." }, /* Some Pythonesque aliases */ { "read", (PyCFunction) pyewf_file_entry_read_buffer, METH_VARARGS | METH_KEYWORDS, "read(size) -> String\n" "\n" "Reads a buffer of file entry data." }, { "seek", (PyCFunction) pyewf_file_entry_seek_offset, METH_VARARGS | METH_KEYWORDS, "seek(offset, whence) -> None\n" "\n" "Seeks an offset within the file entry data." }, { "tell", (PyCFunction) pyewf_file_entry_get_offset, METH_NOARGS, "tell() -> Integer\n" "\n" "Returns the current offset within the file entry data." }, /* Functions to access the metadata */ { "get_size", (PyCFunction) pyewf_file_entry_get_size, METH_NOARGS, "get_size() -> Integer\n" "\n" "Returns the size of the file entry data." }, { "get_creation_time", (PyCFunction) pyewf_file_entry_get_creation_time, METH_NOARGS, "get_creation_time() -> Datetime\n" "\n" "Returns the creation date and time of the file entry." }, { "get_creation_time_as_integer", (PyCFunction) pyewf_file_entry_get_creation_time_as_integer, METH_NOARGS, "get_creation_time_as_integer() -> Integer\n" "\n" "Returns the creation date and time as a 32-bit integer containing a POSIX timestamp value." }, { "get_modification_time", (PyCFunction) pyewf_file_entry_get_modification_time, METH_NOARGS, "get_modification_time() -> Datetime\n" "\n" "Returns the modification date and time of the file entry." }, { "get_modification_time_as_integer", (PyCFunction) pyewf_file_entry_get_modification_time_as_integer, METH_NOARGS, "get_modification_time_as_integer() -> Integer\n" "\n" "Returns the modification date and time as a 32-bit integer containing a POSIX timestamp value." }, { "get_access_time", (PyCFunction) pyewf_file_entry_get_access_time, METH_NOARGS, "get_access_time() -> Datetime\n" "\n" "Returns the access date and time of the file entry." }, { "get_access_time_as_integer", (PyCFunction) pyewf_file_entry_get_access_time_as_integer, METH_NOARGS, "get_access_time_as_integer() -> Integer\n" "\n" "Returns the access date and time as a 32-bit integer containing a POSIX timestamp value." }, { "get_entry_modification_time", (PyCFunction) pyewf_file_entry_get_entry_modification_time, METH_NOARGS, "get_entry_modification_time() -> Datetime\n" "\n" "Returns the entry modification date and time of the file entry." }, { "get_entry_modification_time_as_integer", (PyCFunction) pyewf_file_entry_get_entry_modification_time_as_integer, METH_NOARGS, "get_entry_modification_time_as_integer() -> Integer\n" "\n" "Returns the entry modification date and time as a 32-bit integer containing a POSIX timestamp value." }, { "get_name", (PyCFunction) pyewf_file_entry_get_name, METH_NOARGS, "get_name() -> Unicode string or None\n" "\n" "Returns the name of the file entry." }, { "get_hash_value_md5", (PyCFunction) pyewf_file_entry_get_hash_value_md5, METH_NOARGS, "get_hash_value_md5() -> Unicode string or None\n" "\n" "Retrieves the MD5 hash of the file entry data." }, /* Functions to access the sub file entries */ { "get_number_of_sub_file_entries", (PyCFunction) pyewf_file_entry_get_number_of_sub_file_entries, METH_NOARGS, "get_number_of_sub_file_entries() -> Integer\n" "\n" "Retrieves the number of sub file entries." }, { "get_sub_file_entry", (PyCFunction) pyewf_file_entry_get_sub_file_entry, METH_VARARGS | METH_KEYWORDS, "get_sub_file_entry() -> Object\n" "\n" "Retrieves a specific sub file entry." }, /* Sentinel */ { NULL, NULL, 0, NULL } }; PyGetSetDef pyewf_file_entry_object_get_set_definitions[] = { { "size", (getter) pyewf_file_entry_get_size, (setter) 0, "The size of the file entry data.", NULL }, { "creation_time", (getter) pyewf_file_entry_get_creation_time, (setter) 0, "The creation date and time of the file entry.", NULL }, { "modification_time", (getter) pyewf_file_entry_get_modification_time, (setter) 0, "The modification date and time of the file entry.", NULL }, { "access_time", (getter) pyewf_file_entry_get_access_time, (setter) 0, "The access date and time of the file entry.", NULL }, { "entry_modification_time", (getter) pyewf_file_entry_get_entry_modification_time, (setter) 0, "The entry modification date and time of the file entry.", NULL }, { "name", (getter) pyewf_file_entry_get_name, (setter) 0, "The name of the file entry.", NULL }, { "md5_hash_value", (getter) pyewf_file_entry_get_hash_value_md5, (setter) 0, "The MD5 hash of the file entry data.", NULL }, { "number_of_sub_file_entries", (getter) pyewf_file_entry_get_number_of_sub_file_entries, (setter) 0, "The number of sub file entries.", NULL }, /* Sentinel */ { NULL, NULL, NULL, NULL, NULL } }; PyTypeObject pyewf_file_entry_type_object = { PyVarObject_HEAD_INIT( NULL, 0 ) /* tp_name */ "pyewf.file_entry", /* tp_basicsize */ sizeof( pyewf_file_entry_t ), /* tp_itemsize */ 0, /* tp_dealloc */ (destructor) pyewf_file_entry_free, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ Py_TPFLAGS_DEFAULT, /* tp_doc */ "pyewf file entry object (wraps libewf_file_entry_t)", /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ pyewf_file_entry_object_methods, /* tp_members */ 0, /* tp_getset */ pyewf_file_entry_object_get_set_definitions, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ (initproc) pyewf_file_entry_init, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ NULL, /* tp_mro */ NULL, /* tp_cache */ NULL, /* tp_subclasses */ NULL, /* tp_weaklist */ NULL, /* tp_del */ 0 }; /* Creates a new pyewf file_entry object * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_new( libewf_file_entry_t *file_entry, pyewf_handle_t *handle_object ) { pyewf_file_entry_t *pyewf_file_entry = NULL; static char *function = "pyewf_file_entry_new"; if( file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } pyewf_file_entry = PyObject_New( struct pyewf_file_entry, &pyewf_file_entry_type_object ); if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to initialize file_entry.", function ); goto on_error; } if( pyewf_file_entry_init( pyewf_file_entry ) != 0 ) { PyErr_Format( PyExc_MemoryError, "%s: unable to initialize file_entry.", function ); goto on_error; } pyewf_file_entry->file_entry = file_entry; pyewf_file_entry->handle_object = handle_object; Py_IncRef( (PyObject *) pyewf_file_entry->handle_object ); return( (PyObject *) pyewf_file_entry ); on_error: if( pyewf_file_entry != NULL ) { Py_DecRef( (PyObject *) pyewf_file_entry ); } return( NULL ); } /* Intializes a file_entry object * Returns 0 if successful or -1 on error */ int pyewf_file_entry_init( pyewf_file_entry_t *pyewf_file_entry ) { static char *function = "pyewf_file_entry_init"; if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file_entry.", function ); return( -1 ); } /* Make sure libewf file_entry is set to NULL */ pyewf_file_entry->file_entry = NULL; return( 0 ); } /* Frees a file_entry object */ void pyewf_file_entry_free( pyewf_file_entry_t *pyewf_file_entry ) { struct _typeobject *ob_type = NULL; libcerror_error_t *error = NULL; static char *function = "pyewf_file_entry_free"; int result = 0; if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file_entry.", function ); return; } ob_type = Py_TYPE( pyewf_file_entry ); if( ob_type == NULL ) { PyErr_Format( PyExc_TypeError, "%s: missing ob_type.", function ); return; } if( ob_type->tp_free == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid ob_type - missing tp_free.", function ); return; } if( pyewf_file_entry->file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file_entry - missing libewf file_entry.", function ); return; } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_free( &( pyewf_file_entry->file_entry ), &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_MemoryError, "%s: unable to free file_entry.", function ); libcerror_error_free( &error ); } if( pyewf_file_entry->handle_object != NULL ) { Py_DecRef( (PyObject *) pyewf_file_entry->handle_object ); } ob_type->tp_free( (PyObject*) pyewf_file_entry ); } /* Reads a buffer of file entry data from EWF file(s) * Returns a Python object holding the data if successful or NULL on error */ PyObject *pyewf_file_entry_read_buffer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; static char *function = "pyewf_file_entry_read_buffer"; static char *keyword_list[] = { "size", NULL }; char *buffer = NULL; ssize_t read_count = 0; int read_size = -1; if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf file_entry.", function ); return( NULL ); } if( pyewf_file_entry->file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf file_entry - missing libewf file_entry.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "|i", keyword_list, &read_size ) == 0 ) { return( NULL ); } if( read_size < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value less than zero.", function ); return( NULL ); } /* Make sure the data fits into a memory buffer */ if( read_size > INT_MAX ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value exceeds maximum.", function ); return( NULL ); } #if PY_MAJOR_VERSION >= 3 string_object = PyBytes_FromStringAndSize( NULL, read_size ); buffer = PyBytes_AsString( string_object ); #else string_object = PyString_FromStringAndSize( NULL, read_size ); buffer = PyString_AsString( string_object ); #endif Py_BEGIN_ALLOW_THREADS read_count = libewf_file_entry_read_buffer( pyewf_file_entry->file_entry, buffer, (size_t) read_size, &error ); Py_END_ALLOW_THREADS if( read_count <= -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to read data.", function ); libcerror_error_free( &error ); Py_DecRef( (PyObject *) string_object ); return( NULL ); } /* Need to resize the string here in case read_size was not fully read. */ #if PY_MAJOR_VERSION >= 3 if( _PyBytes_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #else if( _PyString_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #endif { Py_DecRef( (PyObject *) string_object ); return( NULL ); } return( string_object ); } /* Reads a buffer of file entry data at a specific offset from EWF file(s) * Returns a Python object holding the data if successful or NULL on error */ PyObject *pyewf_file_entry_read_random( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; static char *function = "pyewf_file_entry_read_random"; static char *keyword_list[] = { "size", "offset", NULL }; char *buffer = NULL; off64_t read_offset = 0; ssize_t read_count = 0; int read_size = 0; if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf file_entry.", function ); return( NULL ); } if( pyewf_file_entry->file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf file_entry - missing libewf file_entry.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "i|L", keyword_list, &read_size, &read_offset ) == 0 ) { return( NULL ); } if( read_size < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value less than zero.", function ); return( NULL ); } /* Make sure the data fits into a memory buffer */ if( read_size > INT_MAX ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read size value exceeds maximum.", function ); return( NULL ); } if( read_offset < 0 ) { PyErr_Format( PyExc_ValueError, "%s: invalid argument read offset value less than zero.", function ); return( NULL ); } /* Make sure the data fits into a memory buffer */ #if PY_MAJOR_VERSION >= 3 string_object = PyBytes_FromStringAndSize( NULL, read_size ); buffer = PyBytes_AsString( string_object ); #else string_object = PyString_FromStringAndSize( NULL, read_size ); buffer = PyString_AsString( string_object ); #endif Py_BEGIN_ALLOW_THREADS read_count = libewf_file_entry_read_random( pyewf_file_entry->file_entry, buffer, (size_t) read_size, (off64_t) read_offset, &error ); Py_END_ALLOW_THREADS if( read_count <= -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to read data.", function ); libcerror_error_free( &error ); Py_DecRef( (PyObject *) string_object ); return( NULL ); } /* Need to resize the string here in case read_size was not fully read. */ #if PY_MAJOR_VERSION >= 3 if( _PyBytes_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #else if( _PyString_Resize( &string_object, (Py_ssize_t) read_count ) != 0 ) #endif { Py_DecRef( (PyObject *) string_object ); return( NULL ); } return( string_object ); } /* Seeks a certain offset in the file entry data * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_file_entry_seek_offset( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ) { libcerror_error_t *error = NULL; static char *function = "pyewf_file_entry_seek_offset"; static char *keyword_list[] = { "offset", "whence", NULL }; off64_t offset = 0; int whence = 0; if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf file_entry.", function ); return( NULL ); } if( pyewf_file_entry->file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid pyewf file_entry - missing libewf file_entry.", function ); return( NULL ); } if( PyArg_ParseTupleAndKeywords( arguments, keywords, "L|i", keyword_list, &offset, &whence ) == 0 ) { return( NULL ); } Py_BEGIN_ALLOW_THREADS offset = libewf_file_entry_seek_offset( pyewf_file_entry->file_entry, offset, whence, &error ); Py_END_ALLOW_THREADS if( offset == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to seek offset.", function ); libcerror_error_free( &error ); return( NULL ); } Py_IncRef( Py_None ); return( Py_None ); } /* Retrieves the offset * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_offset( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_offset"; off64_t offset = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_offset( pyewf_file_entry->file_entry, &offset, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve offset.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_signed_new_from_64bit( (int64_t) offset ); return( integer_object ); } /* Retrieves the size * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_size( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_size"; size64_t size = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_size( pyewf_file_entry->file_entry, &size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve size.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_unsigned_new_from_64bit( (uint64_t) size ); return( integer_object ); } /* Retrieves the creation date and time * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_creation_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *date_time_object = NULL; static char *function = "pyewf_file_entry_get_creation_time"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_creation_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve creation time.", function ); libcerror_error_free( &error ); return( NULL ); } date_time_object = pyewf_datetime_new_from_posix_time( posix_time ); return( date_time_object ); } /* Retrieves the creation date and time as an integer * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_creation_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_creation_time_as_integer"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_creation_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve creation time.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_signed_new_from_64bit( (int64_t) posix_time ); return( integer_object ); } /* Retrieves the modification date and time * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_modification_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *date_time_object = NULL; static char *function = "pyewf_file_entry_get_modification_time"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_modification_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve modification time.", function ); libcerror_error_free( &error ); return( NULL ); } date_time_object = pyewf_datetime_new_from_posix_time( posix_time ); return( date_time_object ); } /* Retrieves the modification date and time as an integer * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_modification_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_modification_time_as_integer"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_modification_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve modification time.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_signed_new_from_64bit( (int64_t) posix_time ); return( integer_object ); } /* Retrieves the access date and time * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_access_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *date_time_object = NULL; static char *function = "pyewf_file_entry_get_access_time"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_access_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve access time.", function ); libcerror_error_free( &error ); return( NULL ); } date_time_object = pyewf_datetime_new_from_posix_time( posix_time ); return( date_time_object ); } /* Retrieves the access date and time as an integer * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_access_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_access_time_as_integer"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_access_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve access time.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_signed_new_from_64bit( (int64_t) posix_time ); return( integer_object ); } /* Retrieves the entry modification date and time * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_entry_modification_time( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *date_time_object = NULL; static char *function = "pyewf_file_entry_get_entry_modification_time"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_entry_modification_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve entry modification time.", function ); libcerror_error_free( &error ); return( NULL ); } date_time_object = pyewf_datetime_new_from_posix_time( posix_time ); return( date_time_object ); } /* Retrieves the entry modification date and time as an integer * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_entry_modification_time_as_integer( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_entry_modification_time_as_integer"; uint32_t posix_time = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_ValueError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_entry_modification_time( pyewf_file_entry->file_entry, &posix_time, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve entry modification time.", function ); libcerror_error_free( &error ); return( NULL ); } integer_object = pyewf_integer_signed_new_from_64bit( (int64_t) posix_time ); return( integer_object ); } /* Retrieves the name * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_name( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; const char *errors = NULL; uint8_t *name = NULL; static char *function = "pyewf_file_entry_get_name"; size_t name_size = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_utf8_name_size( pyewf_file_entry->file_entry, &name_size, &error ); Py_END_ALLOW_THREADS if( result == -1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve name size.", function ); libcerror_error_free( &error ); goto on_error; } else if( ( result == 0 ) || ( name_size == 0 ) ) { Py_IncRef( Py_None ); return( Py_None ); } name = (uint8_t *) PyMem_Malloc( sizeof( uint8_t ) * name_size ); if( name == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to create name.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_utf8_name( pyewf_file_entry->file_entry, name, name_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve name.", function ); libcerror_error_free( &error ); goto on_error; } /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( (char *) name, (Py_ssize_t) name_size - 1, errors ); PyMem_Free( name ); return( string_object ); on_error: if( name != NULL ) { PyMem_Free( name ); } return( NULL ); } /* Retrieves the MD5 hash * Returns a Python object holding the offset if successful or NULL on error */ PyObject *pyewf_file_entry_get_hash_value_md5( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *string_object = NULL; const char *errors = NULL; uint8_t *hash_value = NULL; static char *function = "pyewf_file_entry_get_hash_value_md5"; size_t hash_value_size = 33; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } hash_value = (uint8_t *) PyMem_Malloc( sizeof( uint8_t ) * hash_value_size ); if( hash_value == NULL ) { PyErr_Format( PyExc_IOError, "%s: unable to create hash value.", function ); goto on_error; } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_utf8_hash_value_md5( pyewf_file_entry->file_entry, hash_value, hash_value_size, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve hash value MD5.", function ); libcerror_error_free( &error ); goto on_error; } /* Pass the string length to PyUnicode_DecodeUTF8 * otherwise it makes the end of string character is part * of the string */ string_object = PyUnicode_DecodeUTF8( (char *) hash_value, (Py_ssize_t) hash_value_size - 1, errors ); PyMem_Free( hash_value ); return( string_object ); on_error: if( hash_value != NULL ) { PyMem_Free( hash_value ); } return( NULL ); } /* Retrieves the number of sub file entries * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_number_of_sub_file_entries( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *integer_object = NULL; static char *function = "pyewf_file_entry_get_number_of_sub_file_entries"; int number_of_sub_file_entries = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_number_of_sub_file_entries( pyewf_file_entry->file_entry, &number_of_sub_file_entries, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve number of sub file entries.", function ); libcerror_error_free( &error ); return( NULL ); } #if PY_MAJOR_VERSION >= 3 integer_object = PyLong_FromLong( (long) number_of_sub_file_entries ); #else integer_object = PyInt_FromLong( (long) number_of_sub_file_entries ); #endif return( integer_object ); } /* Retrieves a specific sub file entry by index * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_sub_file_entry_by_index( pyewf_file_entry_t *pyewf_file_entry, int sub_file_entry_index ) { libcerror_error_t *error = NULL; libewf_file_entry_t *sub_file_entry = NULL; PyObject *file_entry_object = NULL; static char *function = "pyewf_file_entry_get_sub_file_entry_by_index"; int result = 0; if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_sub_file_entry( pyewf_file_entry->file_entry, sub_file_entry_index, &sub_file_entry, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve sub file entry: %d.", function, sub_file_entry_index ); libcerror_error_free( &error ); goto on_error; } file_entry_object = pyewf_file_entry_new( sub_file_entry, pyewf_file_entry->handle_object ); if( file_entry_object == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create file entry object.", function ); goto on_error; } return( file_entry_object ); on_error: if( sub_file_entry != NULL ) { libewf_file_entry_free( &sub_file_entry, NULL ); } return( NULL ); } /* Retrieves a specific sub file entry * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_sub_file_entry( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments, PyObject *keywords ) { PyObject *file_entry_object = NULL; static char *keyword_list[] = { "sub_file_entry_index", NULL }; int sub_file_entry_index = 0; if( PyArg_ParseTupleAndKeywords( arguments, keywords, "i", keyword_list, &sub_file_entry_index ) == 0 ) { return( NULL ); } file_entry_object = pyewf_file_entry_get_sub_file_entry_by_index( pyewf_file_entry, sub_file_entry_index ); return( file_entry_object ); } /* Retrieves a file entries sequence and iterator object for the sub file entries * Returns a Python object if successful or NULL on error */ PyObject *pyewf_file_entry_get_sub_file_entries( pyewf_file_entry_t *pyewf_file_entry, PyObject *arguments PYEWF_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; PyObject *file_entries_object = NULL; static char *function = "pyewf_file_entry_get_sub_file_entries"; int number_of_sub_file_entries = 0; int result = 0; PYEWF_UNREFERENCED_PARAMETER( arguments ) if( pyewf_file_entry == NULL ) { PyErr_Format( PyExc_TypeError, "%s: invalid file entry.", function ); return( NULL ); } Py_BEGIN_ALLOW_THREADS result = libewf_file_entry_get_number_of_sub_file_entries( pyewf_file_entry->file_entry, &number_of_sub_file_entries, &error ); Py_END_ALLOW_THREADS if( result != 1 ) { pyewf_error_raise( error, PyExc_IOError, "%s: unable to retrieve number of sub file entries.", function ); libcerror_error_free( &error ); return( NULL ); } file_entries_object = pyewf_file_entries_new( pyewf_file_entry, &pyewf_file_entry_get_sub_file_entry_by_index, number_of_sub_file_entries ); if( file_entries_object == NULL ) { PyErr_Format( PyExc_MemoryError, "%s: unable to create file entries object.", function ); return( NULL ); } return( file_entries_object ); } libewf-20140807/pyewf/pyewf_handle.h0000664000175000017500000000653513440663047021321 0ustar00lordyestalordyesta00000000000000/* * Python object definition of the libewf handle * * Copyright (c) 2008, David Collett * 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_HANDLE_H ) #define _PYEWF_HANDLE_H #include #include #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" #include "pyewf_libewf.h" #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct pyewf_handle pyewf_handle_t; struct pyewf_handle { /* Python object initialization */ PyObject_HEAD /* The libewf handle */ libewf_handle_t *handle; /* The file IO pool */ libbfio_pool_t *file_io_pool; }; extern PyMethodDef pyewf_handle_object_methods[]; extern PyTypeObject pyewf_handle_type_object; PyObject *pyewf_handle_new( void ); PyObject *pyewf_handle_new_open( PyObject *self, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_new_open_file_objects( PyObject *self, PyObject *arguments, PyObject *keywords ); int pyewf_handle_init( pyewf_handle_t *pyewf_handle ); void pyewf_handle_free( pyewf_handle_t *pyewf_handle ); PyObject *pyewf_handle_signal_abort( pyewf_handle_t *pyewf_handle, PyObject *arguments ); PyObject *pyewf_handle_open( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_open_file_objects( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_close( pyewf_handle_t *pyewf_handle, PyObject *arguments ); PyObject *pyewf_handle_read_buffer( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_read_random( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_write_buffer( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_write_random( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_seek_offset( pyewf_handle_t *pyewf_handle, PyObject *arguments, PyObject *keywords ); PyObject *pyewf_handle_get_offset( pyewf_handle_t *pyewf_handle, PyObject *arguments ); PyObject *pyewf_handle_get_root_file_entry( pyewf_handle_t *pyewf_handle, PyObject *arguments ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/common/0000775000175000017500000000000013443455444016633 5ustar00lordyestalordyesta00000000000000libewf-20140807/common/config_msc.h0000664000175000017500000000220713440662656021116 0ustar00lordyestalordyesta00000000000000/* * Configuration for the Microsoft Visual Studio C++ compiler * * Copyright (C) 2006-2019, 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( _CONFIG_MSC_H ) #define _CONFIG_MSC_H /* Disable warning C4127: conditional expression is constant */ #pragma warning( disable : 4127 ) /* Disable warning C4201: nonstandard extension used : nameless struct/union */ #pragma warning( disable : 4201 ) #endif /* !defined( _CONFIG_MSC_H ) */ libewf-20140807/common/byte_stream.h0000664000175000017500000002430713440662655021331 0ustar00lordyestalordyesta00000000000000/* * Byte stream functions * * Copyright (C) 2006-2019, 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( _BYTE_STREAM_H ) #define _BYTE_STREAM_H #include "common.h" #include "types.h" #if defined( __cplusplus ) extern "C" { #endif #define _BYTE_STREAM_HOST_IS_ENDIAN_BIG ( *((uint32_t *) "\x01\x02\x03\x04" ) == 0x01020304 ) #define _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ( *((uint32_t *) "\x01\x02\x03\x04" ) == 0x04030201 ) #define _BYTE_STREAM_HOST_IS_ENDIAN_MIDDLE ( *((uint32_t *) "\x01\x02\x03\x04" ) == 0x02010403 ) #define _BYTE_STREAM_ENDIAN_BIG (uint8_t) 'b' #define _BYTE_STREAM_ENDIAN_LITTLE (uint8_t) 'l' #define _BYTE_STREAM_ENDIAN_MIDDLE (uint8_t) 'm' typedef union byte_stream_float32 { float floating_point; uint32_t integer; } byte_stream_float32_t; typedef union byte_stream_float64 { double floating_point; uint64_t integer; } byte_stream_float64_t; #define byte_stream_copy_to_uint16_big_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 0 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; #define byte_stream_copy_to_uint16_little_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 0 ]; #define byte_stream_copy_to_uint24_big_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 0 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; #define byte_stream_copy_to_uint24_little_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 0 ]; #define byte_stream_copy_to_uint32_big_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 0 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 3 ]; #define byte_stream_copy_to_uint32_little_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 3 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 0 ]; #define byte_stream_copy_to_uint48_big_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 0 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 3 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 4 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 5 ]; #define byte_stream_copy_to_uint48_little_endian( byte_stream, value ) \ ( value ) |= ( byte_stream )[ 5 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 4 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 3 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 0 ]; #define byte_stream_copy_to_uint64_big_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 0 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 3 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 4 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 5 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 6 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 7 ]; #define byte_stream_copy_to_uint64_little_endian( byte_stream, value ) \ ( value ) = ( byte_stream )[ 7 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 6 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 5 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 4 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 3 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 2 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 1 ]; \ ( value ) <<= 8; \ ( value ) |= ( byte_stream )[ 0 ]; #define byte_stream_copy_from_uint16_big_endian( byte_stream, value ) \ ( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint16_little_endian( byte_stream, value ) \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint24_big_endian( byte_stream, value ) \ ( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint24_little_endian( byte_stream, value ) \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint32_big_endian( byte_stream, value ) \ ( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 3 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint32_little_endian( byte_stream, value ) \ ( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint48_big_endian( byte_stream, value ) \ ( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \ ( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 5 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint48_little_endian( byte_stream, value ) \ ( byte_stream )[ 5 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \ ( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \ ( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint64_big_endian( byte_stream, value ) \ ( byte_stream )[ 0 ] = (uint8_t) ( ( ( value ) >> 56 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 48 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \ ( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \ ( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \ ( byte_stream )[ 5 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 6 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 7 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_copy_from_uint64_little_endian( byte_stream, value ) \ ( byte_stream )[ 7 ] = (uint8_t) ( ( ( value ) >> 56 ) & 0x0ff ); \ ( byte_stream )[ 6 ] = (uint8_t) ( ( ( value ) >> 48 ) & 0x0ff ); \ ( byte_stream )[ 5 ] = (uint8_t) ( ( ( value ) >> 40 ) & 0x0ff ); \ ( byte_stream )[ 4 ] = (uint8_t) ( ( ( value ) >> 32 ) & 0x0ff ); \ ( byte_stream )[ 3 ] = (uint8_t) ( ( ( value ) >> 24 ) & 0x0ff ); \ ( byte_stream )[ 2 ] = (uint8_t) ( ( ( value ) >> 16 ) & 0x0ff ); \ ( byte_stream )[ 1 ] = (uint8_t) ( ( ( value ) >> 8 ) & 0x0ff ); \ ( byte_stream )[ 0 ] = (uint8_t) ( ( value ) & 0x0ff ) #define byte_stream_bit_rotate_left_8bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 8 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_right_8bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 8 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_left_16bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 16 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_right_16bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 16 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_left_32bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 32 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_right_32bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 32 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_left_64bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) << ( number_of_bits ) ) | ( ( byte_stream ) >> ( 64 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_right_64bit( byte_stream, number_of_bits ) \ ( ( ( byte_stream ) >> ( number_of_bits ) ) | ( ( byte_stream ) << ( 64 - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_left( value, number_of_bits ) \ ( ( ( value ) << ( number_of_bits ) ) | ( ( value ) >> ( ( sizeof( value ) << 3 ) - ( number_of_bits ) ) ) ) #define byte_stream_bit_rotate_right( value, number_of_bits ) \ ( ( ( value ) >> ( number_of_bits ) ) | ( ( value ) << ( ( sizeof( value ) << 3 ) - ( number_of_bits ) ) ) ) #if defined( __cplusplus ) } #endif #endif /* !defined( _BYTE_STREAM_H ) */ libewf-20140807/common/common.h0000664000175000017500000000234413440662655020300 0ustar00lordyestalordyesta00000000000000/* * Common include file * * Copyright (C) 2006-2019, 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( _COMMON_H ) #define _COMMON_H #if defined( HAVE_CONFIG_H ) #include "config.h" #endif /* Include the Borland/CodeGear C++ Builder compiler specific configuration */ #if defined( __BORLANDC__ ) #include "config_borlandc.h" /* Include the Microsoft Visual Studio C++ compiler specific configuration */ #elif defined( _MSC_VER ) #include "config_msc.h" #endif #include "config_winapi.h" #endif /* !defined( _COMMON_H ) */ libewf-20140807/common/system_string.h0000664000175000017500000001100513440662656021715 0ustar00lordyestalordyesta00000000000000/* * System character string functions * * Copyright (C) 2006-2019, 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( _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_vsnprintf \ wide_string_vsnwprintf #else #define system_string_vsnprintf( 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_vsnprintf \ narrow_string_vsnprintf #else #define system_string_vsnprintf( string, size, format, ... ) \ narrow_string_vsnprintf( string, size, format, __VA_ARGS__ ) #endif #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ /* For backwards compatibility */ #define system_string_vsprintf system_string_vsnprintf #if defined( _cplusplus ) } #endif #endif /* !defined( _SYSTEM_STRING_H ) */ libewf-20140807/common/Makefile.am0000664000175000017500000000057213440662652020671 0ustar00lordyestalordyesta00000000000000AM_CPPFLAGS = -I$(top_srcdir)/include EXTRA_DIST = \ byte_stream.h \ common.h \ config.h \ config_borlandc.h \ config_msc.h \ config_winapi.h \ file_stream.h \ memory.h \ narrow_string.h \ system_string.h \ types.h \ types.h.in \ wide_string.h MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f config.h /bin/rm -f types.h /bin/rm -f Makefile libewf-20140807/common/types.h0000664000175000017500000001542413443455443020155 0ustar00lordyestalordyesta00000000000000/* * Type and type-support defintions * * Copyright (C) 2006-2019, 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( _TYPES_H ) #define _TYPES_H #include "common.h" #if defined( HAVE_LIMITS_H ) || defined( WINAPI ) #include #endif /* Make sure to include inttypes.h or stdint.h before * PRI definitions are defined */ #include #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 ) ) */ /* Fallback for systems without PRI definitions */ #if !defined( PRId8 ) #define PRId8 "d" #endif #if !defined( PRId16 ) #define PRId16 "d" #endif #if !defined( PRId32 ) #if defined( WINAPI ) #define PRId32 "I32d" #else #define PRId32 "d" #endif #endif /* !defined( PRId32 ) */ #if !defined( PRId64 ) #if defined( WINAPI ) #define PRId64 "I64d" #elif __WORDSIZE == 64 #define PRId64 "ld" #else #define PRId64 "lld" #endif #endif /* !defined( PRId64 ) */ #if !defined( PRIi8 ) #define PRIi8 "i" #endif #if !defined( PRIi16 ) #define PRIi16 "i" #endif #if !defined( PRIi32 ) #if defined( WINAPI ) #define PRIi32 "I32i" #else #define PRIi32 "i" #endif #endif /* !defined( PRIi32 ) */ #if !defined( PRIi64 ) #if defined( WINAPI ) #define PRIi64 "I64i" #elif __WORDSIZE == 64 #define PRIi64 "li" #else #define PRIi64 "lli" #endif #endif /* !defined( PRIi64 ) */ #if !defined( PRIu8 ) #define PRIu8 "u" #endif #if !defined( PRIu16 ) #define PRIu16 "u" #endif #if !defined( PRIu32 ) #if defined( WINAPI ) #define PRIu32 "I32u" #else #define PRIu32 "u" #endif #endif /* !defined( PRIu32 ) */ #if !defined( PRIu64 ) #if defined( WINAPI ) #define PRIu64 "I64u" #elif __WORDSIZE == 64 #define PRIu64 "lu" #else #define PRIu64 "llu" #endif #endif /* !defined( PRIu64 ) */ #if !defined( PRIo8 ) #define PRIo8 "o" #endif #if !defined( PRIo16 ) #define PRIo16 "o" #endif #if !defined( PRIo32 ) #if defined( WINAPI ) #define PRIo32 "I32o" #else #define PRIo32 "o" #endif #endif /* !defined( PRIo32 ) */ #if !defined( PRIo64 ) #if defined( WINAPI ) #define PRIo64 "I64o" #elif __WORDSIZE == 64 #define PRIo64 "lo" #else #define PRIo64 "llo" #endif #endif /* !defined( PRIo64 ) */ #if !defined( PRIx8 ) #define PRIx8 "x" #endif #if !defined( PRIx16 ) #define PRIx16 "x" #endif #if !defined( PRIx32 ) #if defined( WINAPI ) #define PRIx32 "I32x" #else #define PRIx32 "x" #endif #endif /* !defined( PRIx32 ) */ #if !defined( PRIx64 ) #if defined( WINAPI ) #define PRIx64 "I64x" #elif __WORDSIZE == 64 #define PRIx64 "lx" #else #define PRIx64 "llx" #endif #endif /*!defined( PRIx64 ) */ /* Fallback for systems without printf %jd definition */ #if defined( HAVE_PRINTF_JD ) #define PRIjd "jd" #define PRIji "ji" #define PRIju "ju" #define PRIjx "jx" #elif SIZEOF_OFF_T == 8 #define PRIjd PRId64 #define PRIji PRIi64 #define PRIju PRIu64 #define PRIjx PRIx64 #else #define PRIjd PRId32 #define PRIji PRIi32 #define PRIju PRIu32 #define PRIjx PRIx32 #endif /* defined( HAVE_PRINTF_JD ) */ /* Fallback for systems without printf %zd definition */ #if defined( HAVE_PRINTF_ZD ) #define PRIzd "zd" #define PRIzi "zi" #define PRIzu "zu" #define PRIzx "zx" #elif defined( _MSC_VER ) #define PRIzd "Id" #define PRIzi "Ii" #define PRIzu "Iu" #define PRIzx "Ix" #elif SIZEOF_SIZE_T == 8 #define PRIzd PRId64 #define PRIzi PRIi64 #define PRIzu PRIu64 #define PRIzx PRIx64 #else #define PRIzd PRId32 #define PRIzi PRIi32 #define PRIzu PRIu32 #define PRIzx PRIx32 #endif /* defined( HAVE_PRINTF_ZD ) */ /* Fallback for systems without (U)INTx_MAX definitions */ /* The maximum signed 8-bit integer is 127 (0x7f) */ #if !defined( INT8_MAX ) #define INT8_MAX (0x7f) #endif /* The maximum unsigned 8-bit integer is 256 (0xff) */ #if !defined( UINT8_MAX ) #define UINT8_MAX (0xff) #endif /* The maximum signed 16-bit integer is 32767 (0x7ffff) */ #if !defined( INT16_MAX ) #define INT16_MAX (0x7fff) #endif /* The maximum unsigned 16-bit integer is 65535 (0xffff) */ #if !defined( UINT16_MAX ) #define UINT16_MAX (0xffff) #endif /* The maximum signed 32-bit integer is 2147483647 (0x7fffffff) */ #if !defined( INT32_MAX ) #define INT32_MAX (0x7fffffffL) #endif /* The maximum unsigned 32-bit integer is 4294967295 (0xffffffff) */ #if !defined( UINT32_MAX ) #define UINT32_MAX (0xffffffffUL) #endif /* The maximum signed 64-bit integer is 9223372036854775807 (0x7fffffffffffffff) */ #if !defined( INT64_MAX ) #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define INT64_MAX (0x7fffffffffffffffUL) #else #define INT64_MAX (0x7fffffffffffffffULL) #endif #endif /* !defined( INT64_MAX ) */ /* The maximum unsigned 64-bit integer is 18446744073709551615 (0xffffffffffffffff) */ #if !defined( UINT64_MAX ) #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define UINT64_MAX (0xffffffffffffffffUL) #else #define UINT64_MAX (0xffffffffffffffffULL) #endif #endif /* !defined( UINT64_MAX ) */ /* The maximum signed integer */ #if !defined( INT_MAX ) #define INT_MAX INT32_MAX #endif /* The maximum unsigned integer */ #if !defined( UINT_MAX ) #define UINT_MAX UINT32_MAX #endif /* The maximum signed long integer */ #if !defined( LONG_MAX ) #define LONG_MAX INT32_MAX #endif /* The maximum unsigned long integer */ #if !defined( ULONG_MAX ) #define ULONG_MAX UINT32_MAX #endif /* The maximum signed size type is platform dependent */ #if !defined( SSIZE_MAX ) #if defined( WINAPI ) #if defined( _WIN64 ) #define SSIZE_MAX INT64_MAX #else #define SSIZE_MAX INT32_MAX #endif #else #if __WORDSIZE == 64 #define SSIZE_MAX INT64_MAX #else #define SSIZE_MAX INT32_MAX #endif #endif /* WINAPI */ #endif /* SSIZE_MAX */ #endif /* !defined( _TYPES_H ) */ libewf-20140807/common/types.h.in0000664000175000017500000001542713440662656020570 0ustar00lordyestalordyesta00000000000000/* * Type and type-support defintions * * Copyright (C) 2006-2019, 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( _TYPES_H ) #define _TYPES_H #include "common.h" #if defined( HAVE_LIMITS_H ) || defined( WINAPI ) #include #endif /* Make sure to include inttypes.h or stdint.h before * PRI definitions are defined */ #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 ) ) */ /* Fallback for systems without PRI definitions */ #if !defined( PRId8 ) #define PRId8 "d" #endif #if !defined( PRId16 ) #define PRId16 "d" #endif #if !defined( PRId32 ) #if defined( WINAPI ) #define PRId32 "I32d" #else #define PRId32 "d" #endif #endif /* !defined( PRId32 ) */ #if !defined( PRId64 ) #if defined( WINAPI ) #define PRId64 "I64d" #elif __WORDSIZE == 64 #define PRId64 "ld" #else #define PRId64 "lld" #endif #endif /* !defined( PRId64 ) */ #if !defined( PRIi8 ) #define PRIi8 "i" #endif #if !defined( PRIi16 ) #define PRIi16 "i" #endif #if !defined( PRIi32 ) #if defined( WINAPI ) #define PRIi32 "I32i" #else #define PRIi32 "i" #endif #endif /* !defined( PRIi32 ) */ #if !defined( PRIi64 ) #if defined( WINAPI ) #define PRIi64 "I64i" #elif __WORDSIZE == 64 #define PRIi64 "li" #else #define PRIi64 "lli" #endif #endif /* !defined( PRIi64 ) */ #if !defined( PRIu8 ) #define PRIu8 "u" #endif #if !defined( PRIu16 ) #define PRIu16 "u" #endif #if !defined( PRIu32 ) #if defined( WINAPI ) #define PRIu32 "I32u" #else #define PRIu32 "u" #endif #endif /* !defined( PRIu32 ) */ #if !defined( PRIu64 ) #if defined( WINAPI ) #define PRIu64 "I64u" #elif __WORDSIZE == 64 #define PRIu64 "lu" #else #define PRIu64 "llu" #endif #endif /* !defined( PRIu64 ) */ #if !defined( PRIo8 ) #define PRIo8 "o" #endif #if !defined( PRIo16 ) #define PRIo16 "o" #endif #if !defined( PRIo32 ) #if defined( WINAPI ) #define PRIo32 "I32o" #else #define PRIo32 "o" #endif #endif /* !defined( PRIo32 ) */ #if !defined( PRIo64 ) #if defined( WINAPI ) #define PRIo64 "I64o" #elif __WORDSIZE == 64 #define PRIo64 "lo" #else #define PRIo64 "llo" #endif #endif /* !defined( PRIo64 ) */ #if !defined( PRIx8 ) #define PRIx8 "x" #endif #if !defined( PRIx16 ) #define PRIx16 "x" #endif #if !defined( PRIx32 ) #if defined( WINAPI ) #define PRIx32 "I32x" #else #define PRIx32 "x" #endif #endif /* !defined( PRIx32 ) */ #if !defined( PRIx64 ) #if defined( WINAPI ) #define PRIx64 "I64x" #elif __WORDSIZE == 64 #define PRIx64 "lx" #else #define PRIx64 "llx" #endif #endif /*!defined( PRIx64 ) */ /* Fallback for systems without printf %jd definition */ #if defined( HAVE_PRINTF_JD ) #define PRIjd "jd" #define PRIji "ji" #define PRIju "ju" #define PRIjx "jx" #elif SIZEOF_OFF_T == 8 #define PRIjd PRId64 #define PRIji PRIi64 #define PRIju PRIu64 #define PRIjx PRIx64 #else #define PRIjd PRId32 #define PRIji PRIi32 #define PRIju PRIu32 #define PRIjx PRIx32 #endif /* defined( HAVE_PRINTF_JD ) */ /* Fallback for systems without printf %zd definition */ #if defined( HAVE_PRINTF_ZD ) #define PRIzd "zd" #define PRIzi "zi" #define PRIzu "zu" #define PRIzx "zx" #elif defined( _MSC_VER ) #define PRIzd "Id" #define PRIzi "Ii" #define PRIzu "Iu" #define PRIzx "Ix" #elif SIZEOF_SIZE_T == 8 #define PRIzd PRId64 #define PRIzi PRIi64 #define PRIzu PRIu64 #define PRIzx PRIx64 #else #define PRIzd PRId32 #define PRIzi PRIi32 #define PRIzu PRIu32 #define PRIzx PRIx32 #endif /* defined( HAVE_PRINTF_ZD ) */ /* Fallback for systems without (U)INTx_MAX definitions */ /* The maximum signed 8-bit integer is 127 (0x7f) */ #if !defined( INT8_MAX ) #define INT8_MAX (0x7f) #endif /* The maximum unsigned 8-bit integer is 256 (0xff) */ #if !defined( UINT8_MAX ) #define UINT8_MAX (0xff) #endif /* The maximum signed 16-bit integer is 32767 (0x7ffff) */ #if !defined( INT16_MAX ) #define INT16_MAX (0x7fff) #endif /* The maximum unsigned 16-bit integer is 65535 (0xffff) */ #if !defined( UINT16_MAX ) #define UINT16_MAX (0xffff) #endif /* The maximum signed 32-bit integer is 2147483647 (0x7fffffff) */ #if !defined( INT32_MAX ) #define INT32_MAX (0x7fffffffL) #endif /* The maximum unsigned 32-bit integer is 4294967295 (0xffffffff) */ #if !defined( UINT32_MAX ) #define UINT32_MAX (0xffffffffUL) #endif /* The maximum signed 64-bit integer is 9223372036854775807 (0x7fffffffffffffff) */ #if !defined( INT64_MAX ) #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define INT64_MAX (0x7fffffffffffffffUL) #else #define INT64_MAX (0x7fffffffffffffffULL) #endif #endif /* !defined( INT64_MAX ) */ /* The maximum unsigned 64-bit integer is 18446744073709551615 (0xffffffffffffffff) */ #if !defined( UINT64_MAX ) #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define UINT64_MAX (0xffffffffffffffffUL) #else #define UINT64_MAX (0xffffffffffffffffULL) #endif #endif /* !defined( UINT64_MAX ) */ /* The maximum signed integer */ #if !defined( INT_MAX ) #define INT_MAX INT32_MAX #endif /* The maximum unsigned integer */ #if !defined( UINT_MAX ) #define UINT_MAX UINT32_MAX #endif /* The maximum signed long integer */ #if !defined( LONG_MAX ) #define LONG_MAX INT32_MAX #endif /* The maximum unsigned long integer */ #if !defined( ULONG_MAX ) #define ULONG_MAX UINT32_MAX #endif /* The maximum signed size type is platform dependent */ #if !defined( SSIZE_MAX ) #if defined( WINAPI ) #if defined( _WIN64 ) #define SSIZE_MAX INT64_MAX #else #define SSIZE_MAX INT32_MAX #endif #else #if __WORDSIZE == 64 #define SSIZE_MAX INT64_MAX #else #define SSIZE_MAX INT32_MAX #endif #endif /* WINAPI */ #endif /* SSIZE_MAX */ #endif /* !defined( _TYPES_H ) */ libewf-20140807/common/config_winapi.h0000664000175000017500000000366213440662656021631 0ustar00lordyestalordyesta00000000000000/* * Configuration file for WINAPI * * Copyright (C) 2006-2019, 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( _CONFIG_WINAPI_H ) #define _CONFIG_WINAPI_H /* Define the earliest supported WINAPI version #define WINVER 0x0501 */ /* If necessary make sure WINAPI is defined */ #if defined( HAVE_WINDOWS_H ) || defined( __BORLANDC__ ) || defined( _MSC_VER ) #include #endif #if defined( WINAPI ) /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "joachim.metz@gmail.com" /* Define the size of the wide character for WINAPI */ #if !defined( SIZEOF_WCHAR_T ) #define SIZEOF_WCHAR_T 2 #endif /* Enable the DllMain function */ #define HAVE_DLLMAIN 1 /* Enable verbose output #define HAVE_VERBOSE_OUTPUT 1 */ /* Enable debug output #define HAVE_DEBUG_OUTPUT 1 */ /* Enable both the narrow and wide character functions */ #if !defined( HAVE_WIDE_CHARACTER_TYPE ) #define HAVE_WIDE_CHARACTER_TYPE 1 #endif /* If not controlled by config.h enable multi-thread support */ #if !defined( HAVE_CONFIG_H ) && !defined( HAVE_MULTI_THREAD_SUPPORT ) #define HAVE_MULTI_THREAD_SUPPORT 1 #endif #endif /* defined( WINAPI ) */ #endif /* !defined( _CONFIG_WINAPI_H ) */ libewf-20140807/common/memory.h0000664000175000017500000000607113440662656020322 0ustar00lordyestalordyesta00000000000000/* * Memory functions * * Copyright (C) 2006-2019, 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( _MEMORY_H ) #define _MEMORY_H #include "common.h" #if defined( HAVE_GLIB_H ) #include #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STRING_H ) || defined( WINAPI ) #include #endif #if defined( __cplusplus ) extern "C" { #endif /* Memory allocation */ #if defined( HAVE_GLIB_H ) #define memory_allocate( size ) \ g_malloc( (gsize) size ) #elif defined( WINAPI ) #define memory_allocate( size ) \ HeapAlloc( GetProcessHeap(), 0, (SIZE_T) size ) #elif defined( HAVE_MALLOC ) #define memory_allocate( size ) \ malloc( size ) #endif #define memory_allocate_structure( type ) \ (type *) memory_allocate( sizeof( type ) ) #define memory_allocate_structure_as_value( type ) \ (intptr_t *) memory_allocate( sizeof( type ) ) /* Memory reallocation */ #if defined( HAVE_GLIB_H ) #define memory_reallocate( buffer, size ) \ g_realloc( (gpointer) buffer, (gsize) size ) #elif defined( WINAPI ) /* HeapReAlloc does not allocate empty (NULL) buffers as realloc does */ #define memory_reallocate( buffer, size ) \ ( buffer == NULL ) ? \ HeapAlloc( GetProcessHeap(), 0, (SIZE_T) size ) : \ HeapReAlloc( GetProcessHeap(), 0, (LPVOID) buffer, (SIZE_T) size ) #elif defined( HAVE_REALLOC ) #define memory_reallocate( buffer, size ) \ realloc( (void *) buffer, size ) #endif /* Memory free */ #if defined( HAVE_GLIB_H ) #define memory_free( buffer ) \ g_free( (gpointer) buffer ) #elif defined( WINAPI ) #define memory_free( buffer ) \ ( buffer == NULL ) ? TRUE : HeapFree( GetProcessHeap(), 0, (LPVOID) buffer ) #elif defined( HAVE_FREE ) #define memory_free( buffer ) \ free( (void *) buffer ) #endif /* Memory compare */ #if defined( HAVE_MEMCMP ) || defined( WINAPI ) #define memory_compare( buffer1, buffer2, size ) \ memcmp( (const void *) buffer1, (const void *) buffer2, size ) #endif /* Memory copy */ #if defined( HAVE_MEMCPY ) || defined( WINAPI ) #define memory_copy( destination, source, count ) \ memcpy( (void *) destination, (void *) source, count ) #endif /* Memory set */ #if defined( HAVE_MEMSET ) || defined( WINAPI ) #define memory_set( buffer, value, count ) \ memset( (void *) buffer, (int) value, count ) #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _MEMORY_H ) */ libewf-20140807/common/config.h0000664000175000017500000005371713443450135020256 0ustar00lordyestalordyesta00000000000000/* common/config.h. Generated from config.h.in by configure. */ /* common/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 /* Define to 1 if you have the `bindtextdomain' function. */ #define HAVE_BINDTEXTDOMAIN 1 /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ /* #undef HAVE_CFLOCALECOPYCURRENT */ /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ /* Define to 1 if you have the `chdir' function. */ #define HAVE_CHDIR 1 /* Define to 1 if you have the `clock_gettime' function. */ #define HAVE_CLOCK_GETTIME 1 /* Define to 1 if you have the `close' function. */ #define HAVE_CLOSE 1 /* Define to 1 if you have the `ctime' function. */ /* #undef HAVE_CTIME */ /* Define to 1 if you have the ctime_r function. */ #define HAVE_CTIME_R 1 /* Define to 1 if you have the ctime_r function with a third size argument. */ /* #undef HAVE_CTIME_R_SIZE */ /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_CYGWIN_FS_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_CYGWIN_HDREG_H */ /* Define if the GNU dcgettext() function is already present or preinstalled. */ #define HAVE_DCGETTEXT 1 /* Define to 1 if debug output should be used. */ /* #undef HAVE_DEBUG_OUTPUT */ /* Define to 1 if you have the declaration of `memrchr', and to 0 if you don't. */ #define HAVE_DECL_MEMRCHR 0 /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #define HAVE_DECL_STRERROR_R 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 to enable the DllMain function. */ /* #undef HAVE_DLLMAIN */ /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the `EVP_md5' function". */ #define HAVE_EVP_MD5 1 /* Define to 1 if you have the `EVP_MD_CTX_cleanup' function". */ /* #undef HAVE_EVP_MD_CTX_CLEANUP */ /* Define to 1 if you have the `EVP_MD_CTX_init' function". */ /* #undef HAVE_EVP_MD_CTX_INIT */ /* Define to 1 if you have the `EVP_sha1' function". */ #define HAVE_EVP_SHA1 1 /* Define to 1 if you have the `EVP_sha224' function". */ #define HAVE_EVP_SHA224 1 /* Define to 1 if you have the `EVP_sha256' function". */ #define HAVE_EVP_SHA256 1 /* Define to 1 if you have the `EVP_sha512' function". */ #define HAVE_EVP_SHA512 1 /* Define to 1 if you have the `fclose' function. */ #define HAVE_FCLOSE 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `feof' function. */ #define HAVE_FEOF 1 /* Define to 1 if you have the `fgets' function. */ #define HAVE_FGETS 1 /* Define to 1 if you have the `fgetws' function. */ /* #undef HAVE_FGETWS */ /* Define to 1 if you have the `fopen' function. */ #define HAVE_FOPEN 1 /* Define to 1 if you have the `fread' function. */ #define HAVE_FREAD 1 /* Define to 1 if you have the `free' function. */ #define HAVE_FREE 1 /* Define to 1 if you have the `fseeko' function. */ #define HAVE_FSEEKO 1 /* Define to 1 if you have the `fseeko64' function. */ #define HAVE_FSEEKO64 1 /* Define to 1 if you have the `fstat' function. */ #define HAVE_FSTAT 1 /* Define to 1 if you have the `ftruncate' function. */ #define HAVE_FTRUNCATE 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_FUSE_H */ /* Define to 1 if you have the `fwrite' function. */ #define HAVE_FWRITE 1 /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 /* Define to 1 if you have the `getenv' function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the `getopt' function. */ #define HAVE_GETOPT 1 /* Define if the GNU gettext() function is already present or preinstalled. */ #define HAVE_GETTEXT 1 /* Define to 1 if you have the header file. */ #define HAVE_GLOB_H 1 /* Define to 1 if you have the `gmtime' function. */ #define HAVE_GMTIME 1 /* Define to 1 if you have the `gmtime_r' function. */ #define HAVE_GMTIME_R 1 /* Define to 1 if GUID/UUID support is available. */ /* #undef HAVE_GUID_SUPPORT */ /* Define if you have the iconv() function and it works. */ /* #undef HAVE_ICONV */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `ioctl' function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_IO_H */ /* Define if nl_langinfo has CODESET support. */ #define HAVE_LANGINFO_CODESET 1 /* Define to 1 if you have the header file. */ #define HAVE_LANGINFO_H 1 /* Define to 1 if you have the `bfio' library (-lbfio). */ /* #undef HAVE_LIBBFIO */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBBFIO_H */ /* Define to 1 if you have the `cdata' library (-lcdata). */ /* #undef HAVE_LIBCDATA */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCDATA_H */ /* Define to 1 if you have the `cdatetime' library (-lcdatetime). */ /* #undef HAVE_LIBCDATETIME */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCDATETIME_H */ /* Define to 1 if you have the `cerror' library (-lcerror). */ /* #undef HAVE_LIBCERROR */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCERROR_H */ /* Define to 1 if you have the `cfile' library (-lcfile). */ /* #undef HAVE_LIBCFILE */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCFILE_H */ /* Define to 1 if you have the `clocale' library (-lclocale). */ /* #undef HAVE_LIBCLOCALE */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCLOCALE_H */ /* Define to 1 if you have the `cnotify' library (-lcnotify). */ /* #undef HAVE_LIBCNOTIFY */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCNOTIFY_H */ /* Define to 1 if you have the `cpath' library (-lcpath). */ /* #undef HAVE_LIBCPATH */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCPATH_H */ /* Define to 1 if you have the 'crypto' library (-lcrypto). */ #define HAVE_LIBCRYPTO 1 /* Define to 1 if you have the `csplit' library (-lcsplit). */ /* #undef HAVE_LIBCSPLIT */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCSPLIT_H */ /* Define to 1 if you have the `cthreads' library (-lcthreads). */ /* #undef HAVE_LIBCTHREADS */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBCTHREADS_H */ /* Define to 1 if you have the `fcache' library (-lfcache). */ /* #undef HAVE_LIBFCACHE */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBFCACHE_H */ /* Define to 1 if you have the `fdata' library (-lfdata). */ /* #undef HAVE_LIBFDATA */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBFDATA_H */ /* Define to 1 if you have the 'fuse' library (-lfuse). */ #define HAVE_LIBFUSE 1 /* Define to 1 if you have the `fvalue' library (-lfvalue). */ /* #undef HAVE_LIBFVALUE */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBFVALUE_H */ /* Define to 1 if you have the `hmac' library (-lhmac). */ /* #undef HAVE_LIBHMAC */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBHMAC_H */ /* Define to 1 if you have the header file. */ #define HAVE_LIBINTL_H 1 /* Define to 1 if you have the `mfdata' library (-lmfdata). */ /* #undef HAVE_LIBMFDATA */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBMFDATA_H */ /* Define to 1 if you have the `odraw' library (-lodraw). */ /* #undef HAVE_LIBODRAW */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBODRAW_H */ /* Define to 1 if you have the 'osxfuse' library (-losxfuse). */ /* #undef HAVE_LIBOSXFUSE */ /* Define to 1 if you have the `smdev' library (-lsmdev). */ /* #undef HAVE_LIBSMDEV */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBSMDEV_H */ /* Define to 1 if you have the `smraw' library (-lsmraw). */ /* #undef HAVE_LIBSMRAW */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBSMRAW_H */ /* Define to 1 if you have the `una' library (-luna). */ /* #undef HAVE_LIBUNA */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBUNA_H */ /* Define to 1 if you have the 'libuuid' library (-luuid). */ #define HAVE_LIBUUID 1 /* Define to 1 if you have the `z' library (-lz). */ /* #undef HAVE_LIBZ */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LINUX_CDROM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LINUX_FS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LINUX_HDREG_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LINUX_USBDEVICE_FS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LINUX_USB_CH9_H 1 /* Define to 1 if you have the `localeconv' function. */ #define HAVE_LOCALECONV 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 /* Define to 1 if you have the `localtime' function. */ #define HAVE_LOCALTIME 1 /* Define to 1 if you have the `localtime_r' function. */ #define HAVE_LOCALTIME_R 1 /* Define to 1 if the local version of libbfio is used. */ #define HAVE_LOCAL_LIBBFIO 1 /* Define to 1 if the local version of libcdata is used. */ #define HAVE_LOCAL_LIBCDATA 1 /* Define to 1 if the local version of libcdatetime is used. */ #define HAVE_LOCAL_LIBCDATETIME 1 /* Define to 1 if the local version of libcerror is used. */ #define HAVE_LOCAL_LIBCERROR 1 /* Define to 1 if the local version of libcfile is used. */ #define HAVE_LOCAL_LIBCFILE 1 /* Define to 1 if the local version of libclocale is used. */ #define HAVE_LOCAL_LIBCLOCALE 1 /* Define to 1 if the local version of libcnotify is used. */ #define HAVE_LOCAL_LIBCNOTIFY 1 /* Define to 1 if the local version of libcpath is used. */ #define HAVE_LOCAL_LIBCPATH 1 /* Define to 1 if the local version of libcsplit is used. */ #define HAVE_LOCAL_LIBCSPLIT 1 /* Define to 1 if the local version of libcthreads is used. */ #define HAVE_LOCAL_LIBCTHREADS 1 /* Define to 1 if the local version of libfcache is used. */ #define HAVE_LOCAL_LIBFCACHE 1 /* Define to 1 if the local version of libfdata is used. */ #define HAVE_LOCAL_LIBFDATA 1 /* Define to 1 if the local version of libfvalue is used. */ #define HAVE_LOCAL_LIBFVALUE 1 /* Define to 1 if the local version of libhmac is used. */ #define HAVE_LOCAL_LIBHMAC 1 /* Define to 1 if the local version of libmfdata is used. */ #define HAVE_LOCAL_LIBMFDATA 1 /* Define to 1 if the local version of libodraw is used. */ #define HAVE_LOCAL_LIBODRAW 1 /* Define to 1 if the local version of libsmdev is used. */ #define HAVE_LOCAL_LIBSMDEV 1 /* Define to 1 if the local version of libsmraw is used. */ #define HAVE_LOCAL_LIBSMRAW 1 /* Define to 1 if the local version of libuna is used. */ #define HAVE_LOCAL_LIBUNA 1 /* Define to 1 if you have the `lseek' function. */ #define HAVE_LSEEK 1 /* Define to 1 if you have the `malloc' function. */ #define HAVE_MALLOC 1 /* Define to 1 if you have the `memchr' function. */ #define HAVE_MEMCHR 1 /* Define to 1 if you have the `memcmp' function. */ #define HAVE_MEMCMP 1 /* Define to 1 if you have the `memcpy' function. */ #define HAVE_MEMCPY 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memrchr' function. */ #define HAVE_MEMRCHR 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if you have the mkdir function. */ #define HAVE_MKDIR 1 /* Define to 1 if you have the mkdir function with a second mode argument. */ #define HAVE_MKDIR_MODE 1 /* Define to 1 if you have the `mktime' function. */ #define HAVE_MKTIME 1 /* Define to 1 if multi thread support should be used. */ #define HAVE_MULTI_THREAD_SUPPORT 1 /* Define to 1 if you have the `nl_langinfo' function. */ #define HAVE_NL_LANGINFO 1 /* Define to 1 if you have the `open' function. */ #define HAVE_OPEN 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_EVP_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENSSL_MD5_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENSSL_OPENSSLV_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENSSL_SHA_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_OSXFUSE_FUSE_H */ /* Define to 1 if you have the posix_fadvise function. */ #define HAVE_POSIX_FADVISE 1 /* Define to 1 whether printf supports the conversion specifier "%jd". */ #define HAVE_PRINTF_JD 1 /* Define to 1 whether printf supports the conversion specifier "%zd". */ #define HAVE_PRINTF_ZD 1 /* Define to 1 if you have the 'pthread' library (-lpthread). */ #define HAVE_PTHREAD 1 /* Define to 1 if you have the header file. */ #define HAVE_PTHREAD_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_PYTHON_H */ /* Define to 1 if you have the `read' function. */ #define HAVE_READ 1 /* Define to 1 if you have the `realloc' function. */ #define HAVE_REALLOC 1 /* Define to 1 if you have the header file. */ #define HAVE_SCSI_SCSI_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SCSI_SCSI_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SCSI_SG_H 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 /* Define to 1 if you have the `setvbuf' function. */ #define HAVE_SETVBUF 1 /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the `sscanf' function. */ #define HAVE_SSCANF 1 /* Define to 1 if you have the `stat' function. */ #define HAVE_STAT 1 /* Define to 1 if you have the header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1 /* Define to 1 if you have the `strerror' function. */ /* #undef HAVE_STRERROR */ /* Define to 1 if you have the `strerror_r' function. */ #define HAVE_STRERROR_R 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strlen' function. */ #define HAVE_STRLEN 1 /* Define to 1 if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strncmp' function. */ #define HAVE_STRNCMP 1 /* Define to 1 if you have the `strncpy' function. */ #define HAVE_STRNCPY 1 /* Define to 1 if you have the `strnicmp' function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 /* Define to 1 if you have the `strstr' function. */ #define HAVE_STRSTR 1 /* Define to 1 if you have the `swprintf' function. */ /* #undef HAVE_SWPRINTF */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_DISKLABEL_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_DISK_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SIGNAL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SYSLIMITS_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the `time' function. */ #define HAVE_TIME 1 /* Define to 1 if you have the `towlower' function. */ /* #undef HAVE_TOWLOWER */ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 /* Define to 1 if uuid_generate_random funtion is available in libuuid. */ /* #undef HAVE_UUID_GENERATE_RANDOM */ /* Define to 1 if uuid_generate_time funtion is available in libuuid. */ /* #undef HAVE_UUID_GENERATE_TIME */ /* Define to 1 if you have the header file. */ /* #undef HAVE_UUID_UUID_H */ /* Define to 1 if the version 1 API should be available. */ /* #undef HAVE_V1_API */ /* Define to 1 if you have the header file. */ /* #undef HAVE_VARARGS_H */ /* Define to 1 if verbose output should be used. */ /* #undef HAVE_VERBOSE_OUTPUT */ /* Define to 1 if you have the `vfprintf' function. */ #define HAVE_VFPRINTF 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 /* Define to 1 if you have the `wcscasecmp' function. */ /* #undef HAVE_WCSCASECMP */ /* Define to 1 if you have the `wcschr' function. */ /* #undef HAVE_WCSCHR */ /* Define to 1 if you have the `wcslen' function. */ /* #undef HAVE_WCSLEN */ /* Define to 1 if you have the `wcsncasecmp' function. */ /* #undef HAVE_WCSNCASECMP */ /* Define to 1 if you have the `wcsncmp' function. */ /* #undef HAVE_WCSNCMP */ /* Define to 1 if you have the `wcsncpy' function. */ /* #undef HAVE_WCSNCPY */ /* Define to 1 if you have the `wcsnicmp' function. */ /* #undef HAVE_WCSNICMP */ /* Define to 1 if you have the `wcsrchr' function. */ /* #undef HAVE_WCSRCHR */ /* Define to 1 if you have the `wcsstr' function. */ /* #undef HAVE_WCSSTR */ /* Define to 1 if you have the `wcstombs' function. */ /* #undef HAVE_WCSTOMBS */ /* Define to 1 if you have the header file. */ #define HAVE_WCTYPE_H 1 /* Define to 1 if wide character type should be used. */ /* #undef HAVE_WIDE_CHARACTER_TYPE */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if STORAGE_BUS_TYPE is defined. */ /* #undef HAVE_WINIOCTL_H_STORAGE_BUS_TYPE */ /* Define to 1 if you have the `wmemchr' function. */ /* #undef HAVE_WMEMCHR */ /* Define to 1 if you have the `wmemcmp' function. */ /* #undef HAVE_WMEMCMP */ /* Define to 1 if you have the `wmemcpy' function. */ /* #undef HAVE_WMEMCPY */ /* Define to 1 if you have the `wmemrchr' function. */ /* #undef HAVE_WMEMRCHR */ /* Define to 1 if you have the `write' function. */ #define HAVE_WRITE 1 /* Define to 1 if you have the 'zlib' library (-lz). */ #define HAVE_ZLIB 1 /* Define to 1 if adler32 funtion is available in zlib. */ #define HAVE_ZLIB_ADLER32 1 /* Define to 1 if compress2 funtion is available in zlib. */ #define HAVE_ZLIB_COMPRESS2 1 /* Define to 1 if compressBound funtion is available in zlib. */ #define HAVE_ZLIB_COMPRESSBOUND 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_ZLIB_H */ /* Define to 1 if you have the `uncompress' function. */ #define HAVE_ZLIB_UNCOMPRESS 1 /* Defines the fallback operating system string. */ #define LIBEWF_OPERATING_SYSTEM "Linux" /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Name of package */ #define PACKAGE "libewf" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "joachim.metz@gmail.com" /* Define to the full name of this package. */ #define PACKAGE_NAME "libewf" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "libewf 20140807" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libewf" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "20140807" /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 /* The size of `off_t', as computed by sizeof. */ #define SIZEOF_OFF_T 8 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T 4 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if strerror_r returns char *. */ /* #undef STRERROR_R_CHAR_P */ /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to 1 if your declares `struct tm'. */ /* #undef TM_IN_SYS_TIME */ /* Version number of package */ #define VERSION "20140807" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ /* #undef YYTEXT_POINTER */ /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `int' if does not define. */ /* #undef mode_t */ /* Define to `long int' if does not define. */ /* #undef off_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ /* #undef volatile */ libewf-20140807/common/narrow_string.h0000664000175000017500000001233713440662656021712 0ustar00lordyestalordyesta00000000000000/* * Narrow character string functions * * Copyright (C) 2006-2019, 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( _NARROW_STRING_H ) #define _NARROW_STRING_H #include "common.h" #include "memory.h" #include "types.h" #if defined( HAVE_GLIB_H ) #include #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STRING_H ) || defined( WINAPI ) #include #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( __CYGWIN__ ) ) || 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 ) */ libewf-20140807/common/Makefile.in0000664000175000017500000006761313443455347020717 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = types.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/types.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = -I$(top_srcdir)/include EXTRA_DIST = \ byte_stream.h \ common.h \ config.h \ config_borlandc.h \ config_msc.h \ config_winapi.h \ file_stream.h \ memory.h \ narrow_string.h \ system_string.h \ types.h \ types.h.in \ wide_string.h MAINTAINERCLEANFILES = \ Makefile.in all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu common/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status common/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 types.h: $(top_builddir)/config.status $(srcdir)/types.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile config.h installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f config.h /bin/rm -f types.h /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/common/file_stream.h0000664000175000017500000000745013440662656021306 0ustar00lordyestalordyesta00000000000000/* * FILE stream functions * * Copyright (C) 2006-2019, 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( _FILE_STREAM_H ) #define _FILE_STREAM_H #include "common.h" #if defined( HAVE_GLIB_H ) #include #include #endif #include #if defined( __cplusplus ) extern "C" { #endif #define FILE_STREAM_OPEN_APPEND "a" #define FILE_STREAM_OPEN_READ "r" #define FILE_STREAM_OPEN_WRITE "w" #if defined( WINAPI ) #define FILE_STREAM_BINARY_OPEN_APPEND "ab" #define FILE_STREAM_BINARY_OPEN_READ "rb" #define FILE_STREAM_BINARY_OPEN_WRITE "wb" #else #define FILE_STREAM_BINARY_OPEN_APPEND "a" #define FILE_STREAM_BINARY_OPEN_READ "r" #define FILE_STREAM_BINARY_OPEN_WRITE "w" #endif /* narrow character FILE stream open */ #if defined( HAVE_GLIB_H ) #define file_stream_open( filename, mode ) \ g_fopen( filename, mode ) #elif defined( HAVE_FOPEN ) || defined( WINAPI ) #define file_stream_open( filename, mode ) \ fopen( filename, mode ) #endif /* wide character FILE stream open */ #if defined( WINAPI ) #define file_stream_open_wide( filename, mode ) \ _wfopen( filename, mode ) #endif /* FILE stream close */ #if defined( HAVE_FCLOSE ) || defined( WINAPI ) #define file_stream_close( stream ) \ fclose( stream ) #endif /* FILE stream read */ #if defined( HAVE_FREAD ) || defined( WINAPI ) #define file_stream_read( stream, data, size ) \ fread( data, 1, size, stream ) #endif /* FILE stream write */ #if defined( HAVE_FWRITE ) || defined( WINAPI ) #define file_stream_write( stream, data, size ) \ fwrite( data, 1, size, stream ) #endif /* FILE stream seek */ #if defined( WINAPI ) #define file_stream_seek_offset( stream, offset, whence ) \ fseek( stream, offset, whence ) #elif defined( HAVE_FSEEKO ) #define file_stream_seek_offset( stream, offset, whence ) \ fseeko( stream, offset, whence ) #elif defined( HAVE_FSEEKO64 ) #define file_stream_seek_offset( stream, offset, whence ) \ fseeko64( stream, offset, whence ) #endif /* End of FILE stream */ #if defined( HAVE_FEOF ) || defined( WINAPI ) #define file_stream_at_end( stream ) \ feof( stream ) #endif /* Get narrow character string from FILE stream */ #if defined( HAVE_FGETS ) || defined( WINAPI ) #define file_stream_get_string( stream, string, size ) \ fgets( string, size, stream ) #endif /* Get wide characters string from FILE stream */ #if defined( HAVE_FGETWS ) || defined( WINAPI ) #define file_stream_get_string_wide( stream, string, size ) \ fgetws( string, size, stream ) #endif /* Variable arguments formatted print to stream function */ #if defined( HAVE_GLIB_H ) #define file_stream_vfprintf( stream, format, ... ) \ g_vfprintf( stream, format, __VA_ARGS__ ) /* Borland BCC previous to version 5.6.0 cannot handle the macro form: MACRO( ... ) */ #elif defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define file_stream_vfprintf \ vfprintf #elif defined( HAVE_VFPRINTF ) || defined( WINAPI ) #define file_stream_vfprintf( stream, format, ... ) \ vfprintf( stream, format, __VA_ARGS__ ) #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _FILE_STREAM_H ) */ libewf-20140807/common/config_borlandc.h0000664000175000017500000000167713440662655022131 0ustar00lordyestalordyesta00000000000000/* * Configuration for the Borland/CodeGear C++ Builder compiler * * Copyright (C) 2006-2019, 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( _CONFIG_BORLANDC_H ) #define _CONFIG_BORLANDC_H #endif /* !defined( _CONFIG_BORLANDC_H ) */ libewf-20140807/common/config.h.in0000664000175000017500000005141013443455346020660 0ustar00lordyestalordyesta00000000000000/* common/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the `bindtextdomain' function. */ #undef HAVE_BINDTEXTDOMAIN /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if you have the `chdir' function. */ #undef HAVE_CHDIR /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the `close' function. */ #undef HAVE_CLOSE /* Define to 1 if you have the `ctime' function. */ #undef HAVE_CTIME /* Define to 1 if you have the ctime_r function. */ #undef HAVE_CTIME_R /* Define to 1 if you have the ctime_r function with a third size argument. */ #undef HAVE_CTIME_R_SIZE /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the header file. */ #undef HAVE_CYGWIN_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_CYGWIN_HDREG_H /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if debug output should be used. */ #undef HAVE_DEBUG_OUTPUT /* Define to 1 if you have the declaration of `memrchr', and to 0 if you don't. */ #undef HAVE_DECL_MEMRCHR /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 to enable the DllMain function. */ #undef HAVE_DLLMAIN /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `EVP_md5' function". */ #undef HAVE_EVP_MD5 /* Define to 1 if you have the `EVP_MD_CTX_cleanup' function". */ #undef HAVE_EVP_MD_CTX_CLEANUP /* Define to 1 if you have the `EVP_MD_CTX_init' function". */ #undef HAVE_EVP_MD_CTX_INIT /* Define to 1 if you have the `EVP_sha1' function". */ #undef HAVE_EVP_SHA1 /* Define to 1 if you have the `EVP_sha224' function". */ #undef HAVE_EVP_SHA224 /* Define to 1 if you have the `EVP_sha256' function". */ #undef HAVE_EVP_SHA256 /* Define to 1 if you have the `EVP_sha512' function". */ #undef HAVE_EVP_SHA512 /* Define to 1 if you have the `fclose' function. */ #undef HAVE_FCLOSE /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `feof' function. */ #undef HAVE_FEOF /* Define to 1 if you have the `fgets' function. */ #undef HAVE_FGETS /* Define to 1 if you have the `fgetws' function. */ #undef HAVE_FGETWS /* Define to 1 if you have the `fopen' function. */ #undef HAVE_FOPEN /* Define to 1 if you have the `fread' function. */ #undef HAVE_FREAD /* Define to 1 if you have the `free' function. */ #undef HAVE_FREE /* Define to 1 if you have the `fseeko' function. */ #undef HAVE_FSEEKO /* Define to 1 if you have the `fseeko64' function. */ #undef HAVE_FSEEKO64 /* Define to 1 if you have the `fstat' function. */ #undef HAVE_FSTAT /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the header file. */ #undef HAVE_FUSE_H /* Define to 1 if you have the `fwrite' function. */ #undef HAVE_FWRITE /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getenv' function. */ #undef HAVE_GETENV /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_GLOB_H /* Define to 1 if you have the `gmtime' function. */ #undef HAVE_GMTIME /* Define to 1 if you have the `gmtime_r' function. */ #undef HAVE_GMTIME_R /* Define to 1 if GUID/UUID support is available. */ #undef HAVE_GUID_SUPPORT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `ioctl' function. */ #undef HAVE_IOCTL /* Define to 1 if you have the header file. */ #undef HAVE_IO_H /* Define if nl_langinfo has CODESET support. */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the `bfio' library (-lbfio). */ #undef HAVE_LIBBFIO /* Define to 1 if you have the header file. */ #undef HAVE_LIBBFIO_H /* Define to 1 if you have the `cdata' library (-lcdata). */ #undef HAVE_LIBCDATA /* Define to 1 if you have the header file. */ #undef HAVE_LIBCDATA_H /* Define to 1 if you have the `cdatetime' library (-lcdatetime). */ #undef HAVE_LIBCDATETIME /* Define to 1 if you have the header file. */ #undef HAVE_LIBCDATETIME_H /* Define to 1 if you have the `cerror' library (-lcerror). */ #undef HAVE_LIBCERROR /* Define to 1 if you have the header file. */ #undef HAVE_LIBCERROR_H /* Define to 1 if you have the `cfile' library (-lcfile). */ #undef HAVE_LIBCFILE /* Define to 1 if you have the header file. */ #undef HAVE_LIBCFILE_H /* Define to 1 if you have the `clocale' library (-lclocale). */ #undef HAVE_LIBCLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_LIBCLOCALE_H /* Define to 1 if you have the `cnotify' library (-lcnotify). */ #undef HAVE_LIBCNOTIFY /* Define to 1 if you have the header file. */ #undef HAVE_LIBCNOTIFY_H /* Define to 1 if you have the `cpath' library (-lcpath). */ #undef HAVE_LIBCPATH /* Define to 1 if you have the header file. */ #undef HAVE_LIBCPATH_H /* Define to 1 if you have the 'crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `csplit' library (-lcsplit). */ #undef HAVE_LIBCSPLIT /* Define to 1 if you have the header file. */ #undef HAVE_LIBCSPLIT_H /* Define to 1 if you have the `cthreads' library (-lcthreads). */ #undef HAVE_LIBCTHREADS /* Define to 1 if you have the header file. */ #undef HAVE_LIBCTHREADS_H /* Define to 1 if you have the `fcache' library (-lfcache). */ #undef HAVE_LIBFCACHE /* Define to 1 if you have the header file. */ #undef HAVE_LIBFCACHE_H /* Define to 1 if you have the `fdata' library (-lfdata). */ #undef HAVE_LIBFDATA /* Define to 1 if you have the header file. */ #undef HAVE_LIBFDATA_H /* Define to 1 if you have the 'fuse' library (-lfuse). */ #undef HAVE_LIBFUSE /* Define to 1 if you have the `fvalue' library (-lfvalue). */ #undef HAVE_LIBFVALUE /* Define to 1 if you have the header file. */ #undef HAVE_LIBFVALUE_H /* Define to 1 if you have the `hmac' library (-lhmac). */ #undef HAVE_LIBHMAC /* Define to 1 if you have the header file. */ #undef HAVE_LIBHMAC_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `mfdata' library (-lmfdata). */ #undef HAVE_LIBMFDATA /* Define to 1 if you have the header file. */ #undef HAVE_LIBMFDATA_H /* Define to 1 if you have the `odraw' library (-lodraw). */ #undef HAVE_LIBODRAW /* Define to 1 if you have the header file. */ #undef HAVE_LIBODRAW_H /* Define to 1 if you have the 'osxfuse' library (-losxfuse). */ #undef HAVE_LIBOSXFUSE /* Define to 1 if you have the `smdev' library (-lsmdev). */ #undef HAVE_LIBSMDEV /* Define to 1 if you have the header file. */ #undef HAVE_LIBSMDEV_H /* Define to 1 if you have the `smraw' library (-lsmraw). */ #undef HAVE_LIBSMRAW /* Define to 1 if you have the header file. */ #undef HAVE_LIBSMRAW_H /* Define to 1 if you have the `una' library (-luna). */ #undef HAVE_LIBUNA /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNA_H /* Define to 1 if you have the 'libuuid' library (-luuid). */ #undef HAVE_LIBUUID /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CDROM_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_HDREG_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_USBDEVICE_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_USB_CH9_H /* Define to 1 if you have the `localeconv' function. */ #undef HAVE_LOCALECONV /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `localtime' function. */ #undef HAVE_LOCALTIME /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if the local version of libbfio is used. */ #undef HAVE_LOCAL_LIBBFIO /* Define to 1 if the local version of libcdata is used. */ #undef HAVE_LOCAL_LIBCDATA /* Define to 1 if the local version of libcdatetime is used. */ #undef HAVE_LOCAL_LIBCDATETIME /* Define to 1 if the local version of libcerror is used. */ #undef HAVE_LOCAL_LIBCERROR /* Define to 1 if the local version of libcfile is used. */ #undef HAVE_LOCAL_LIBCFILE /* Define to 1 if the local version of libclocale is used. */ #undef HAVE_LOCAL_LIBCLOCALE /* Define to 1 if the local version of libcnotify is used. */ #undef HAVE_LOCAL_LIBCNOTIFY /* Define to 1 if the local version of libcpath is used. */ #undef HAVE_LOCAL_LIBCPATH /* Define to 1 if the local version of libcsplit is used. */ #undef HAVE_LOCAL_LIBCSPLIT /* Define to 1 if the local version of libcthreads is used. */ #undef HAVE_LOCAL_LIBCTHREADS /* Define to 1 if the local version of libfcache is used. */ #undef HAVE_LOCAL_LIBFCACHE /* Define to 1 if the local version of libfdata is used. */ #undef HAVE_LOCAL_LIBFDATA /* Define to 1 if the local version of libfvalue is used. */ #undef HAVE_LOCAL_LIBFVALUE /* Define to 1 if the local version of libhmac is used. */ #undef HAVE_LOCAL_LIBHMAC /* Define to 1 if the local version of libmfdata is used. */ #undef HAVE_LOCAL_LIBMFDATA /* Define to 1 if the local version of libodraw is used. */ #undef HAVE_LOCAL_LIBODRAW /* Define to 1 if the local version of libsmdev is used. */ #undef HAVE_LOCAL_LIBSMDEV /* Define to 1 if the local version of libsmraw is used. */ #undef HAVE_LOCAL_LIBSMRAW /* Define to 1 if the local version of libuna is used. */ #undef HAVE_LOCAL_LIBUNA /* Define to 1 if you have the `lseek' function. */ #undef HAVE_LSEEK /* Define to 1 if you have the `malloc' function. */ #undef HAVE_MALLOC /* Define to 1 if you have the `memchr' function. */ #undef HAVE_MEMCHR /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memrchr' function. */ #undef HAVE_MEMRCHR /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the mkdir function. */ #undef HAVE_MKDIR /* Define to 1 if you have the mkdir function with a second mode argument. */ #undef HAVE_MKDIR_MODE /* Define to 1 if you have the `mktime' function. */ #undef HAVE_MKTIME /* Define to 1 if multi thread support should be used. */ #undef HAVE_MULTI_THREAD_SUPPORT /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the `open' function. */ #undef HAVE_OPEN /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_EVP_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_MD5_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_OPENSSLV_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SHA_H /* Define to 1 if you have the header file. */ #undef HAVE_OSXFUSE_FUSE_H /* Define to 1 if you have the posix_fadvise function. */ #undef HAVE_POSIX_FADVISE /* Define to 1 whether printf supports the conversion specifier "%jd". */ #undef HAVE_PRINTF_JD /* Define to 1 whether printf supports the conversion specifier "%zd". */ #undef HAVE_PRINTF_ZD /* Define to 1 if you have the 'pthread' library (-lpthread). */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the header file. */ #undef HAVE_PYTHON_H /* Define to 1 if you have the `read' function. */ #undef HAVE_READ /* Define to 1 if you have the `realloc' function. */ #undef HAVE_REALLOC /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_SCSI_H /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_SCSI_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_SG_H /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setvbuf' function. */ #undef HAVE_SETVBUF /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `sscanf' function. */ #undef HAVE_SSCANF /* Define to 1 if you have the `stat' function. */ #undef HAVE_STAT /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlen' function. */ #undef HAVE_STRLEN /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strncmp' function. */ #undef HAVE_STRNCMP /* Define to 1 if you have the `strncpy' function. */ #undef HAVE_STRNCPY /* Define to 1 if you have the `strnicmp' function. */ #undef HAVE_STRNICMP /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `swprintf' function. */ #undef HAVE_SWPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DISKLABEL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DISK_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSLIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define to 1 if you have the `towlower' function. */ #undef HAVE_TOWLOWER /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unlink' function. */ #undef HAVE_UNLINK /* Define to 1 if uuid_generate_random funtion is available in libuuid. */ #undef HAVE_UUID_GENERATE_RANDOM /* Define to 1 if uuid_generate_time funtion is available in libuuid. */ #undef HAVE_UUID_GENERATE_TIME /* Define to 1 if you have the header file. */ #undef HAVE_UUID_UUID_H /* Define to 1 if the version 1 API should be available. */ #undef HAVE_V1_API /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if verbose output should be used. */ #undef HAVE_VERBOSE_OUTPUT /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the `wcscasecmp' function. */ #undef HAVE_WCSCASECMP /* Define to 1 if you have the `wcschr' function. */ #undef HAVE_WCSCHR /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define to 1 if you have the `wcsncasecmp' function. */ #undef HAVE_WCSNCASECMP /* Define to 1 if you have the `wcsncmp' function. */ #undef HAVE_WCSNCMP /* Define to 1 if you have the `wcsncpy' function. */ #undef HAVE_WCSNCPY /* Define to 1 if you have the `wcsnicmp' function. */ #undef HAVE_WCSNICMP /* Define to 1 if you have the `wcsrchr' function. */ #undef HAVE_WCSRCHR /* Define to 1 if you have the `wcsstr' function. */ #undef HAVE_WCSSTR /* Define to 1 if you have the `wcstombs' function. */ #undef HAVE_WCSTOMBS /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if wide character type should be used. */ #undef HAVE_WIDE_CHARACTER_TYPE /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H /* Define to 1 if STORAGE_BUS_TYPE is defined. */ #undef HAVE_WINIOCTL_H_STORAGE_BUS_TYPE /* Define to 1 if you have the `wmemchr' function. */ #undef HAVE_WMEMCHR /* Define to 1 if you have the `wmemcmp' function. */ #undef HAVE_WMEMCMP /* Define to 1 if you have the `wmemcpy' function. */ #undef HAVE_WMEMCPY /* Define to 1 if you have the `wmemrchr' function. */ #undef HAVE_WMEMRCHR /* Define to 1 if you have the `write' function. */ #undef HAVE_WRITE /* Define to 1 if you have the 'zlib' library (-lz). */ #undef HAVE_ZLIB /* Define to 1 if adler32 funtion is available in zlib. */ #undef HAVE_ZLIB_ADLER32 /* Define to 1 if compress2 funtion is available in zlib. */ #undef HAVE_ZLIB_COMPRESS2 /* Define to 1 if compressBound funtion is available in zlib. */ #undef HAVE_ZLIB_COMPRESSBOUND /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H /* Define to 1 if you have the `uncompress' function. */ #undef HAVE_ZLIB_UNCOMPRESS /* Defines the fallback operating system string. */ #undef LIBEWF_OPERATING_SYSTEM /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* The size of `wchar_t', as computed by sizeof. */ #undef SIZEOF_WCHAR_T /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile libewf-20140807/common/wide_string.h0000664000175000017500000001157413440662656021334 0ustar00lordyestalordyesta00000000000000/* * Wide character string functions * * Copyright (C) 2006-2019, 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( _WIDE_STRING_H ) #define _WIDE_STRING_H #include "common.h" #include "memory.h" #include "types.h" #if defined( HAVE_WCHAR_H ) || defined( WINAPI ) #include #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( __CYGWIN__ ) ) || 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 ) */ libewf-20140807/libmfdata/0000775000175000017500000000000013443455446017270 5ustar00lordyestalordyesta00000000000000libewf-20140807/libmfdata/libmfdata_file_list.h0000664000175000017500000001272313154442211023404 0ustar00lordyestalordyesta00000000000000/* * The file list functions * * 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_INTERNAL_FILE_LIST_H ) #define _LIBMFDATA_INTERNAL_FILE_LIST_H #include #include #include "libmfdata_extern.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcdata.h" #include "libmfdata_libcerror.h" #include "libmfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_internal_file_list libmfdata_internal_file_list_t; struct libmfdata_internal_file_list { /* The files (array) */ libcdata_array_t *files; /* The flags */ uint8_t flags; /* The io handle */ intptr_t *io_handle; /* The free IO handle function */ int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ); /* The clone (duplicate) IO handle function */ int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ); /* The read file data function */ int (*read_file_data)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_file_t *file, libfcache_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ); }; LIBMFDATA_EXTERN \ int libmfdata_file_list_initialize( libmfdata_file_list_t **file_list, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*read_file_data)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_file_t *file, libfcache_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_free( libmfdata_file_list_t **file_list, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_clone( libmfdata_file_list_t **destination_list, libmfdata_file_list_t *source_list, libcerror_error_t **error ); int libmfdata_file_list_clone_files( libmfdata_file_list_t *destination_file_list, libmfdata_file_list_t *source_file_list, libcerror_error_t **error ); /* File list element functions */ LIBMFDATA_EXTERN \ int libmfdata_file_list_resize( libmfdata_file_list_t *file_list, int number_of_files, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_get_number_of_files( libmfdata_file_list_t *file_list, int *number_of_files, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_get_file_item_by_index( libmfdata_file_list_t *file_list, int file_index, libmfdata_file_t **file, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_get_file_by_index( libmfdata_file_list_t *file_list, int file_index, int *file_io_pool_entry, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_set_file_by_index( libmfdata_file_list_t *file_list, int file_index, int file_io_pool_entry, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_append_file( libmfdata_file_list_t *file_list, int *file_index, int file_io_pool_entry, libcerror_error_t **error ); /* File value functions */ int libmfdata_file_list_get_file_value( libmfdata_file_list_t *file_list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, libmfdata_file_t *file, intptr_t **file_value, uint8_t read_flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_get_file_value_by_index( libmfdata_file_list_t *file_list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, int file_index, intptr_t **file_value, uint8_t read_flags, libcerror_error_t **error ); int libmfdata_file_list_set_file_value( libmfdata_file_list_t *file_list, libfcache_cache_t *cache, libmfdata_file_t *file, intptr_t *file_value, int (*free_file_value)( intptr_t **file_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_list_set_file_value_by_index( libmfdata_file_list_t *file_list, libfcache_cache_t *cache, int file_index, intptr_t *file_value, int (*free_file_value)( intptr_t **file_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_range.c0000664000175000017500000001554713154442211022530 0ustar00lordyestalordyesta00000000000000/* * The data range functions * * 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 . */ #include #include #include #include "libmfdata_libcerror.h" #include "libmfdata_range.h" /* Initializes the range * Returns 1 if successful or -1 on error */ int libmfdata_range_initialize( libmfdata_range_t **range, libcerror_error_t **error ) { static char *function = "libmfdata_range_initialize"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( *range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid range value already set.", function ); return( -1 ); } *range = memory_allocate_structure( libmfdata_range_t ); if( *range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create range.", function ); goto on_error; } if( memory_set( *range, 0, sizeof( libmfdata_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear range.", function ); goto on_error; } ( *range )->file_io_pool_entry = -1; return( 1 ); on_error: if( *range != NULL ) { memory_free( *range ); *range = NULL; } return( -1 ); } /* Frees the range * Returns 1 if successful or -1 on error */ int libmfdata_range_free( libmfdata_range_t **range, libcerror_error_t **error ) { static char *function = "libmfdata_range_free"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( *range != NULL ) { memory_free( *range ); *range = NULL; } return( 1 ); } /* Clones (duplicates) the range * Returns 1 if successful or -1 on error */ int libmfdata_range_clone( libmfdata_range_t **destination_range, libmfdata_range_t *source_range, libcerror_error_t **error ) { static char *function = "libmfdata_range_clone"; if( destination_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range.", function ); return( -1 ); } if( *destination_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination range already set.", function ); return( -1 ); } if( source_range == NULL ) { *destination_range = NULL; return( 1 ); } *destination_range = memory_allocate_structure( libmfdata_range_t ); if( *destination_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination range.", function ); goto on_error; } if( memory_copy( *destination_range, source_range, sizeof( libmfdata_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination range.", function ); goto on_error; } return( 1 ); on_error: if( *destination_range != NULL ) { memory_free( *destination_range ); *destination_range = NULL; } return( -1 ); } /* Retrieves the range values * Returns 1 if successful or -1 on error */ int libmfdata_range_get_values( libmfdata_range_t *range, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { static char *function = "libmfdata_range_get_values"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( file_io_pool_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool entry.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: nt data flags.", function ); return( -1 ); } *file_io_pool_entry = range->file_io_pool_entry; *offset = range->offset; *size = range->size; *flags = range->flags; return( 1 ); } /* Sets the range values * Returns 1 if successful or -1 on error */ int libmfdata_range_set_values( libmfdata_range_t *range, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { static char *function = "libmfdata_range_set_values"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid offset value less than zero.", function ); return( -1 ); } if( size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } range->file_io_pool_entry = file_io_pool_entry; range->offset = offset; range->size = size; range->flags = flags; return( 1 ); } libewf-20140807/libmfdata/libmfdata_notify.h0000664000175000017500000000277413154442211022747 0ustar00lordyestalordyesta00000000000000/* * Notification function * * 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_NOTIFY_H ) #define _LIBMFDATA_NOTIFY_H #include #include #include #include "libmfdata_extern.h" #include "libmfdata_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBMFDATA ) LIBMFDATA_EXTERN \ void libmfdata_notify_set_verbose( int verbose ); LIBMFDATA_EXTERN \ int libmfdata_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_notify_stream_close( libcerror_error_t **error ); #endif #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_libcerror.h0000664000175000017500000000252513154442211023414 0ustar00lordyestalordyesta00000000000000/* * The internal libcerror 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_LIBCERROR_H ) #define _LIBMFDATA_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libmfdata/libmfdata_support.c0000664000175000017500000000223413154442211023135 0ustar00lordyestalordyesta00000000000000/* * Support functions * * 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 . */ #include #include #include #include "libmfdata_definitions.h" #include "libmfdata_support.h" #if !defined( HAVE_LOCAL_LIBMFDATA ) /* Returns the library version as a string */ const char *libmfdata_get_version( void ) { return( (const char *) LIBMFDATA_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBMFDATA ) */ libewf-20140807/libmfdata/Makefile.am0000664000175000017500000000246613421024433021314 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBMFDATA AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ noinst_LTLIBRARIES = libmfdata.la libmfdata_la_SOURCES = \ libmfdata_date_time.h \ libmfdata_definitions.h \ libmfdata_error.c libmfdata_error.h \ libmfdata_extern.h \ libmfdata_file.c libmfdata_file.h \ libmfdata_file_list.c libmfdata_file_list.h \ libmfdata_group.c libmfdata_group.h \ libmfdata_inline.h \ libmfdata_libbfio.h \ libmfdata_libcdata.h \ libmfdata_libcerror.h \ libmfdata_libcnotify.h \ libmfdata_libfcache.h \ libmfdata_list.c libmfdata_list.h \ libmfdata_list_element.c libmfdata_list_element.h \ libmfdata_range.c libmfdata_range.h \ libmfdata_segment.c libmfdata_segment.h \ libmfdata_segment_table.c libmfdata_segment_table.h \ libmfdata_notify.c libmfdata_notify.h \ libmfdata_support.c libmfdata_support.h \ libmfdata_types.h \ libmfdata_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libmfdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libmfdata_la_SOURCES) libewf-20140807/libmfdata/libmfdata_definitions.h0000664000175000017500000001017713154442211023746 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * 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_INTERNAL_DEFINITIONS_H ) #define _LIBMFDATA_INTERNAL_DEFINITIONS_H #include /* Define HAVE_LOCAL_LIBMFDATA for local use of libmfdata */ #if !defined( HAVE_LOCAL_LIBMFDATA ) #include /* The definitions in are copied here * for local use of libmfdata */ #else #define LIBMFDATA_VERSION 20130330 /* The libmfdata version string */ #define LIBMFDATA_VERSION_STRING "20130330" /* The library flags definitions */ enum LIBMFDATA_FLAGS { /* The IO handle is not managed by the library */ LIBMFDATA_FLAG_IO_HANDLE_NON_MANAGED = 0x00, /* The IO handle is managed by the library */ LIBMFDATA_FLAG_IO_HANDLE_MANAGED = 0x01, /* The IO handle is cloned by the function */ LIBMFDATA_FLAG_IO_HANDLE_CLONE_BY_FUNCTION = 0x00, /* The IO handle is not cloned, but passed as a reference */ LIBMFDATA_FLAG_IO_HANDLE_CLONE_BY_REFERENCE = 0x02, }; /* The cache value flags definitions */ enum LIBMFDATA_CACHE_VALUE_FLAGS { LIBMFDATA_CACHE_VALUE_FLAG_NON_MANAGED = LIBMFDATA_FLAG_IO_HANDLE_NON_MANAGED, LIBMFDATA_CACHE_VALUE_FLAG_MANAGED = LIBMFDATA_FLAG_IO_HANDLE_MANAGED }; /* The file value flags definitions */ enum LIBMFDATA_FILE_VALUE_FLAGS { LIBMFDATA_FILE_VALUE_FLAG_NON_MANAGED = LIBMFDATA_FLAG_IO_HANDLE_NON_MANAGED, LIBMFDATA_FILE_VALUE_FLAG_MANAGED = LIBMFDATA_FLAG_IO_HANDLE_MANAGED }; /* The list flags definitions */ enum LIBMFDATA_LIST_FLAGS { /* The value offsets need to be calculated */ LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS = 0x10, }; /* The list element flags definitions */ enum LIBMFDATA_LIST_ELEMENT_FLAGS { /* The list element is a group (element) */ LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP = 0x01, }; /* The list element value flags definitions */ enum LIBMFDATA_LIST_ELEMENT_VALUE_FLAGS { LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBMFDATA_FLAG_IO_HANDLE_NON_MANAGED, LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED = LIBMFDATA_FLAG_IO_HANDLE_MANAGED }; /* The range flags definitions */ enum LIBMFDATA_RANGE_FLAGS { /* The range is sparse */ LIBMFDATA_RANGE_FLAG_IS_SPARSE = 0x00000001UL, /* The range is compressed */ LIBMFDATA_RANGE_FLAG_IS_COMPRESSED = 0x00000002UL, /* User defined flags */ LIBMFDATA_RANGE_FLAG_USER_DEFINED_1 = 0x00000100UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_2 = 0x00000200UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_3 = 0x00000400UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_4 = 0x00000800UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_5 = 0x00001000UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_6 = 0x00002000UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_7 = 0x00004000UL, LIBMFDATA_RANGE_FLAG_USER_DEFINED_8 = 0x00008000UL, }; #define LIBMFDATA_RANGE_FLAG_MAXIMUM \ LIBMFDATA_RANGE_FLAG_USER_DEFINED_8 /* The read flags definitions */ enum LIBMFDATA_READ_FLAGS { /* Ignore data cached by the library */ LIBMFDATA_READ_FLAG_IGNORE_CACHE = 0x01, /* Is backup data range */ LIBMFDATA_READ_FLAG_IS_BACKUP_RANGE = 0x02 }; /* The segment table flags definitions */ enum LIBMFDATA_SEGMENT_TABLE_FLAGS { /* The value offsets need to be calculated */ LIBMFDATA_SEGMENT_TABLE_FLAG_CALCULATE_VALUE_OFFSETS = 0x10, }; #endif #endif libewf-20140807/libmfdata/libmfdata_list_element.c0000664000175000017500000006665613154442211024127 0ustar00lordyestalordyesta00000000000000/* * The list element functions * * 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 . */ #include #include #include #include "libmfdata_date_time.h" #include "libmfdata_definitions.h" #include "libmfdata_group.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcerror.h" #include "libmfdata_libfcache.h" #include "libmfdata_list.h" #include "libmfdata_list_element.h" #include "libmfdata_range.h" #include "libmfdata_types.h" /* Initializes the element * Returns 1 if successful or -1 on error */ int libmfdata_list_element_initialize( libmfdata_list_element_t **element, libmfdata_list_t *list, int element_index, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_initialize"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } if( *element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid element value already set.", function ); return( -1 ); } if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } internal_element = memory_allocate_structure( libmfdata_internal_list_element_t ); if( internal_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create element.", function ); goto on_error; } if( memory_set( internal_element, 0, sizeof( libmfdata_internal_list_element_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear element.", function ); goto on_error; } if( libmfdata_range_initialize( &( internal_element->data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data range.", function ); goto on_error; } internal_element->list = list; internal_element->element_index = element_index; internal_element->timestamp = libmfdata_date_time_get_timestamp(); *element = (libmfdata_list_element_t *) internal_element; return( 1 ); on_error: if( internal_element != NULL ) { memory_free( internal_element ); } return( -1 ); } /* Frees the element * Returns 1 if successful or -1 on error */ int libmfdata_list_element_free( libmfdata_list_element_t **element, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_free"; int result = 1; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } if( *element != NULL ) { internal_element = (libmfdata_internal_list_element_t *) *element; *element = NULL; if( ( internal_element->flags & LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP ) != 0 ) { if( internal_element->group_values != NULL ) { if( internal_element->group_values->number_of_elements == 1 ) { if( libmfdata_group_free( &( internal_element->group_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free group values.", function ); result = -1; } internal_element->flags &= ~( LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP ); } else { internal_element->group_values->number_of_elements -= 1; } } } if( ( internal_element->flags & LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP ) == 0 ) { if( internal_element->data_range != NULL ) { if( libmfdata_range_free( &( internal_element->data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data range.", function ); result = -1; } } if( internal_element->backup_data_range != NULL ) { if( libmfdata_range_free( &( internal_element->backup_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free backup data range.", function ); result = -1; } } memory_free( internal_element ); } } return( result ); } /* Clones (duplicates) the element * Returns 1 if successful or -1 on error */ int libmfdata_list_element_clone( libmfdata_list_element_t **destination_element, libmfdata_list_element_t *source_element, libmfdata_list_t *list, int element_index, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_destination_element = NULL; libmfdata_internal_list_element_t *internal_source_element = NULL; static char *function = "libmfdata_list_element_clone"; if( destination_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination element.", function ); return( -1 ); } if( *destination_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination element already set.", function ); return( -1 ); } if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } if( source_element == NULL ) { *destination_element = NULL; return( 1 ); } internal_source_element = (libmfdata_internal_list_element_t *) source_element; internal_destination_element = memory_allocate_structure( libmfdata_internal_list_element_t ); if( internal_destination_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination element.", function ); goto on_error; } if( memory_set( internal_destination_element, 0, sizeof( libmfdata_internal_list_element_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination element.", function ); memory_free( internal_destination_element ); return( -1 ); } if( libmfdata_range_clone( &( internal_destination_element->data_range ), internal_source_element->data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data range.", function ); goto on_error; } if( libmfdata_range_clone( &( internal_destination_element->backup_data_range ), internal_source_element->backup_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination backup data range.", function ); goto on_error; } if( libmfdata_group_clone( &( internal_destination_element->group_values ), internal_source_element->group_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination group values.", function ); goto on_error; } internal_destination_element->list = list; internal_destination_element->element_index = element_index; internal_destination_element->value_offset = internal_source_element->value_offset; internal_destination_element->value_size = internal_source_element->value_size; internal_destination_element->timestamp = libmfdata_date_time_get_timestamp(); *destination_element = (libmfdata_list_element_t *) internal_destination_element; return( 1 ); on_error: if( internal_destination_element != NULL ) { if( internal_destination_element->group_values != NULL ) { libmfdata_group_free( &( internal_destination_element->group_values ), NULL ); } if( internal_destination_element->backup_data_range != NULL ) { libmfdata_range_free( &( internal_destination_element->backup_data_range ), NULL ); } if( internal_destination_element->data_range != NULL ) { libmfdata_range_free( &( internal_destination_element->data_range ), NULL ); } memory_free( internal_destination_element ); } return( -1 ); } /* Retrieves the element index * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_element_index( libmfdata_list_element_t *element, int *element_index, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_element_index"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } *element_index = internal_element->element_index; return( 1 ); } /* Sets the element index * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_element_index( libmfdata_list_element_t *element, int element_index, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_element_index"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } internal_element->element_index = element_index; return( 1 ); } /* Retrieves the time stamp * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_timestamp( libmfdata_list_element_t *element, time_t *timestamp, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_timestamp"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time stamp.", function ); return( -1 ); } *timestamp = internal_element->timestamp; return( 1 ); } /* Retrieves the value offset * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_value_offset( libmfdata_list_element_t *element, off64_t *value_offset, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_value_offset"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( value_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value offset.", function ); return( -1 ); } *value_offset = internal_element->value_offset; return( 1 ); } /* Sets the value offset * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_value_offset( libmfdata_list_element_t *element, off64_t value_offset, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_value_offset"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid value offset value less than zero.", function ); return( -1 ); } internal_element->value_offset = value_offset; return( 1 ); } /* Retrieves the value size * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_value_size( libmfdata_list_element_t *element, size64_t *value_size, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_value_size"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value size.", function ); return( -1 ); } *value_size = internal_element->value_size; return( 1 ); } /* Sets the value size * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_value_size( libmfdata_list_element_t *element, size64_t value_size, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_value_size"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( value_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value size value exceeds maximum.", function ); return( -1 ); } internal_element->value_size = value_size; return( 1 ); } /* Group functions */ /* Determines if the element is a group (element) * Returns 1 if element is set, 0 if not or -1 on error */ int libmfdata_list_element_is_group( libmfdata_list_element_t *element, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_is_group"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( ( internal_element->flags & LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP ) != 0 ) { return( 1 ); } return( 0 ); } /* Retrieves the group values * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_group_values( libmfdata_list_element_t *element, int *number_of_elements, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_group_values"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( ( internal_element->flags & LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: element is not a group.", function ); return( -1 ); } if( libmfdata_group_get_values( internal_element->group_values, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve group values.", function ); return( -1 ); } return( 1 ); } /* Sets the group values * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_group_values( libmfdata_list_element_t *element, int number_of_elements, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_group_values"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( ( internal_element->flags & LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP ) == 0 ) { if( internal_element->group_values == NULL ) { if( libmfdata_group_initialize( &( internal_element->group_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create group values.", function ); return( -1 ); } } internal_element->flags |= LIBMFDATA_LIST_ELEMENT_FLAG_IS_GROUP; } if( libmfdata_group_set_values( internal_element->group_values, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set group values.", function ); return( -1 ); } return( 1 ); } /* Data range functions */ /* Retrieves the data range * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_data_range( libmfdata_list_element_t *element, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_data_range"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( libmfdata_range_get_values( internal_element->data_range, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range.", function ); return( -1 ); } return( 1 ); } /* Sets the data range * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_data_range( libmfdata_list_element_t *element, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_data_range"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( libmfdata_range_set_values( internal_element->data_range, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range.", function ); return( -1 ); } internal_element->timestamp = libmfdata_date_time_get_timestamp(); return( 1 ); } /* Backup data range functions */ /* Retrieves the backup data range * Returns 1 if successful, 0 if not available or -1 on error */ int libmfdata_list_element_get_backup_data_range( libmfdata_list_element_t *element, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_backup_data_range"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( internal_element->backup_data_range == NULL ) { return( 0 ); } if( libmfdata_range_get_values( internal_element->backup_data_range, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve backup data range.", function ); return( -1 ); } return( 1 ); } /* Sets the backup data range * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_backup_data_range( libmfdata_list_element_t *element, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_backup_data_range"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( internal_element->backup_data_range == NULL ) { if( libmfdata_range_initialize( &( internal_element->backup_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create backup data range.", function ); return( -1 ); } } if( libmfdata_range_set_values( internal_element->backup_data_range, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set backup data range.", function ); return( -1 ); } internal_element->timestamp = libmfdata_date_time_get_timestamp(); return( 1 ); } /* Element value functions */ /* Retrieves the element value * Returns 1 if successful or -1 on error */ int libmfdata_list_element_get_element_value( libmfdata_list_element_t *element, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_get_element_value"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( libmfdata_list_get_element_value( internal_element->list, file_io_pool, cache, element, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } return( 1 ); } /* Sets the element value * * If the flag LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list element * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libmfdata_list_element_set_element_value( libmfdata_list_element_t *element, libfcache_cache_t *cache, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_list_element_t *internal_element = NULL; static char *function = "libmfdata_list_element_set_element_value"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libmfdata_internal_list_element_t *) element; if( libmfdata_list_set_element_value( internal_element->list, cache, element, element_value, free_element_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set element value.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libmfdata/libmfdata_list.h0000664000175000017500000002444513154442211022411 0ustar00lordyestalordyesta00000000000000/* * The list functions * * 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_INTERNAL_LIST_H ) #define _LIBMFDATA_INTERNAL_LIST_H #include #include #include "libmfdata_extern.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcdata.h" #include "libmfdata_libcerror.h" #include "libmfdata_libfcache.h" #include "libmfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_internal_list libmfdata_internal_list_t; struct libmfdata_internal_list { /* The value size */ size64_t value_size; /* The (list) elements (array) */ libcdata_array_t *elements; /* The flags */ uint8_t flags; /* The io handle */ intptr_t *io_handle; /* The free IO handle function */ int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ); /* The clone (duplicate) IO handle function */ int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ); /* The read element data function */ int (*read_element_data)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_element_t *list_element, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ); /* The read element group function */ int (*read_element_group)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_t *list, int element_index, int number_of_elements, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_group_offset, size64_t element_group_size, uint32_t element_group_flags, uint8_t read_flags, libcerror_error_t **error ); }; LIBMFDATA_EXTERN \ int libmfdata_list_initialize( libmfdata_list_t **list, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_element_t *list_element, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*read_element_group)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_t *list, int element_index, int number_of_elements, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_group_offset, size64_t element_group_size, uint32_t element_group_flags, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_free( libmfdata_list_t **list, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_clone( libmfdata_list_t **destination_list, libmfdata_list_t *source_list, libcerror_error_t **error ); int libmfdata_list_clone_elements( libmfdata_list_t *destination_list, libmfdata_list_t *source_list, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_resize( libmfdata_list_t *list, int number_of_elements, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_get_number_of_elements( libmfdata_list_t *list, int *number_of_elements, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_is_set( libmfdata_list_t *list, int element_index, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_is_group( libmfdata_list_t *list, int element_index, libcerror_error_t **error ); /* List element functions */ LIBMFDATA_EXTERN \ int libmfdata_list_get_element_by_index( libmfdata_list_t *list, int element_index, libmfdata_list_element_t **element, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_get_element_by_offset( libmfdata_list_t *list, off64_t value_offset, int *element_index, libmfdata_list_element_t **element, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_set_element_by_index( libmfdata_list_t *list, int element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_append_element( libmfdata_list_t *list, int *element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); /* Group functions */ LIBMFDATA_EXTERN \ int libmfdata_list_get_group_by_index( libmfdata_list_t *list, int element_index, int *number_of_elements, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_set_group_by_index( libmfdata_list_t *list, int element_index, int number_of_elements, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_append_group( libmfdata_list_t *list, int *element_index, int number_of_elements, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); int libmfdata_list_expand_group( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, libmfdata_list_element_t *group_list_element, int element_index, uint8_t read_flags, libcerror_error_t **error ); /* Data range functions */ LIBMFDATA_EXTERN \ int libmfdata_list_get_data_range_by_index( libmfdata_list_t *list, int element_index, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_get_data_range_by_offset( libmfdata_list_t *list, off64_t value_offset, int *element_index, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_set_data_range_by_index( libmfdata_list_t *list, int element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); /* Backup data range functions */ LIBMFDATA_EXTERN \ int libmfdata_list_get_backup_data_range_by_index( libmfdata_list_t *list, int element_index, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_set_backup_data_range_by_index( libmfdata_list_t *list, int element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); /* List element value functions */ int libmfdata_list_get_element_index_at_value_offset( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, off64_t value_offset, int *element_index, size_t *element_offset, libcerror_error_t **error ); int libmfdata_list_get_element_index_at_value_index( libmfdata_list_t *list, int value_index, size_t value_size, int *element_index, size_t *element_offset, libcerror_error_t **error ); int libmfdata_list_get_element_value( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, libmfdata_list_element_t *element, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_get_element_value_by_index( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, int element_index, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_get_element_value_at_offset( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, off64_t value_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); int libmfdata_list_set_element_value( libmfdata_list_t *list, libfcache_cache_t *cache, libmfdata_list_element_t *element, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_set_element_value_by_index( libmfdata_list_t *list, libfcache_cache_t *cache, int element_index, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_get_value_size( libmfdata_list_t *list, size64_t *value_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_group.c0000664000175000017500000001327213154442211022561 0ustar00lordyestalordyesta00000000000000/* * The group functions * * 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 . */ #include #include #include #include "libmfdata_group.h" #include "libmfdata_libcerror.h" /* Initializes the group * Returns 1 if successful or -1 on error */ int libmfdata_group_initialize( libmfdata_group_t **group, libcerror_error_t **error ) { static char *function = "libmfdata_group_initialize"; if( group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid group.", function ); return( -1 ); } if( *group != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid group value already set.", function ); return( -1 ); } *group = memory_allocate_structure( libmfdata_group_t ); if( *group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create group.", function ); goto on_error; } if( memory_set( *group, 0, sizeof( libmfdata_group_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear group.", function ); goto on_error; } return( 1 ); on_error: if( *group != NULL ) { memory_free( *group ); *group = NULL; } return( -1 ); } /* Frees the group * Returns 1 if successful or -1 on error */ int libmfdata_group_free( libmfdata_group_t **group, libcerror_error_t **error ) { static char *function = "libmfdata_group_free"; if( group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid group.", function ); return( -1 ); } if( *group != NULL ) { memory_free( *group ); *group = NULL; } return( 1 ); } /* Clones (duplicates) the group * Returns 1 if successful or -1 on error */ int libmfdata_group_clone( libmfdata_group_t **destination_group, libmfdata_group_t *source_group, libcerror_error_t **error ) { static char *function = "libmfdata_group_clone"; if( destination_group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination group.", function ); return( -1 ); } if( *destination_group != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination group already set.", function ); return( -1 ); } if( source_group == NULL ) { *destination_group = NULL; return( 1 ); } *destination_group = memory_allocate_structure( libmfdata_group_t ); if( *destination_group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination group.", function ); goto on_error; } if( memory_copy( *destination_group, source_group, sizeof( libmfdata_group_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination group.", function ); goto on_error; } return( 1 ); on_error: if( *destination_group != NULL ) { memory_free( *destination_group ); *destination_group = NULL; } return( -1 ); } /* Retrieves the group values * Returns 1 if successful or -1 on error */ int libmfdata_group_get_values( libmfdata_group_t *group, int *number_of_elements, libcerror_error_t **error ) { static char *function = "libmfdata_group_get_values"; if( group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid group.", function ); return( -1 ); } if( number_of_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of elements.", function ); return( -1 ); } *number_of_elements = group->number_of_elements; return( 1 ); } /* Sets the group values * Returns 1 if successful or -1 on error */ int libmfdata_group_set_values( libmfdata_group_t *group, int number_of_elements, libcerror_error_t **error ) { static char *function = "libmfdata_group_set_values"; if( group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid group.", function ); return( -1 ); } if( number_of_elements < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of elements value less than zero.", function ); return( -1 ); } group->number_of_elements = number_of_elements; return( 1 ); } libewf-20140807/libmfdata/libmfdata_date_time.h0000664000175000017500000000230613154442211023361 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * 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_DATE_TIME_H ) #define _LIBMFDATA_DATE_TIME_H #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #if defined( __cplusplus ) extern "C" { #endif #define libmfdata_date_time_get_timestamp() \ time( NULL ) #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_error.c0000664000175000017500000000473413154442211022561 0ustar00lordyestalordyesta00000000000000/* * Error functions * * 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 . */ #include #include #include #include "libmfdata_error.h" #include "libmfdata_libcerror.h" #if !defined( HAVE_LOCAL_LIBMFDATA ) /* Free an error and its elements */ void libmfdata_error_free( libmfdata_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libmfdata_error_fprint( libmfdata_error_t *error, FILE *stream ) { return( libcerror_error_fprint( (libcerror_error_t *) error, stream ) ); } /* Prints a descriptive string of the error to the string * Returns the number of printed characters if successful or -1 on error */ int libmfdata_error_sprint( libmfdata_error_t *error, char *string, size_t size ) { return( libcerror_error_sprint( (libcerror_error_t *) error, string, size ) ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libmfdata_error_backtrace_fprint( libmfdata_error_t *error, FILE *stream ) { return( libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ) ); } /* Prints a backtrace of the error to the string * Returns the number of printed characters if successful or -1 on error */ int libmfdata_error_backtrace_sprint( libmfdata_error_t *error, char *string, size_t size ) { return( libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ) ); } #endif /* !defined( HAVE_LOCAL_LIBMFDATA ) */ libewf-20140807/libmfdata/libmfdata_list.c0000664000175000017500000026250213420612346022406 0ustar00lordyestalordyesta00000000000000/* * The list functions * * 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 . */ #include #include #include #include "libmfdata_date_time.h" #include "libmfdata_definitions.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcdata.h" #include "libmfdata_libcerror.h" #include "libmfdata_libcnotify.h" #include "libmfdata_libfcache.h" #include "libmfdata_list.h" #include "libmfdata_list_element.h" #include "libmfdata_range.h" #include "libmfdata_types.h" #define libmfdata_list_calculate_cache_entry_index( element_index, number_of_cache_entries ) \ element_index % number_of_cache_entries /* Initializes the list * * If the flag LIBMFDATA_FLAG_IO_HANDLE_MANAGED is set the list * takes over management of the IO handle and the IO handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libmfdata_list_initialize( libmfdata_list_t **list, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_element_t *list_element, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*read_element_group)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_t *list, int element_index, int number_of_elements, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_group_offset, size64_t element_group_size, uint32_t element_group_flags, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_initialize"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid list value already set.", function ); return( -1 ); } if( read_element_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read element data function.", function ); return( -1 ); } internal_list = memory_allocate_structure( libmfdata_internal_list_t ); if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create list.", function ); goto on_error; } if( memory_set( internal_list, 0, sizeof( libmfdata_internal_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear list.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_list->elements ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create elements array.", function ); goto on_error; } internal_list->flags |= flags; internal_list->io_handle = io_handle; internal_list->free_io_handle = free_io_handle; internal_list->clone_io_handle = clone_io_handle; internal_list->read_element_data = read_element_data; internal_list->read_element_group = read_element_group; *list = (libmfdata_list_t *) internal_list; return( 1 ); on_error: if( internal_list != NULL ) { memory_free( internal_list ); } return( -1 ); } /* Frees the list * Returns 1 if successful or -1 on error */ int libmfdata_list_free( libmfdata_list_t **list, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_free"; int result = 1; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *list != NULL ) { internal_list = (libmfdata_internal_list_t *) *list; *list = NULL; if( libcdata_array_free( &( internal_list->elements ), (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the elements array.", function ); result = -1; } if( ( internal_list->flags & LIBMFDATA_FLAG_IO_HANDLE_MANAGED ) != 0 ) { if( internal_list->io_handle != NULL ) { if( internal_list->free_io_handle != NULL ) { if( internal_list->free_io_handle( &( internal_list->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } } } } memory_free( internal_list ); } return( result ); } /* Clones (duplicates) the list * Returns 1 if successful or -1 on error */ int libmfdata_list_clone( libmfdata_list_t **destination_list, libmfdata_list_t *source_list, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_source_list = NULL; intptr_t *destination_io_handle = NULL; static char *function = "libmfdata_list_clone"; if( destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination list.", function ); return( -1 ); } if( *destination_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination list already set.", function ); return( -1 ); } if( source_list == NULL ) { *destination_list = NULL; return( 1 ); } internal_source_list = (libmfdata_internal_list_t *) source_list; if( internal_source_list->io_handle != NULL ) { if( internal_source_list->free_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source list - missing free IO handle function.", function ); goto on_error; } if( internal_source_list->clone_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source list - missing clone IO handle function.", function ); goto on_error; } if( internal_source_list->clone_io_handle( &destination_io_handle, internal_source_list->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone IO handle.", function ); goto on_error; } } if( libmfdata_list_initialize( destination_list, destination_io_handle, internal_source_list->free_io_handle, internal_source_list->clone_io_handle, internal_source_list->read_element_data, internal_source_list->read_element_group, LIBMFDATA_FLAG_IO_HANDLE_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination list.", function ); goto on_error; } if( *destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination list.", function ); goto on_error; } destination_io_handle = NULL; if( libmfdata_list_clone_elements( *destination_list, source_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy list elements.", function ); goto on_error; } return( 1 ); on_error: if( *destination_list != NULL ) { libmfdata_list_free( destination_list, NULL ); } if( destination_io_handle != NULL ) { internal_source_list->free_io_handle( &destination_io_handle, NULL ); } return( -1 ); } /* Clones (duplicates) the elements of the list * Returns 1 if successful or -1 on error */ int libmfdata_list_clone_elements( libmfdata_list_t *destination_list, libmfdata_list_t *source_list, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_destination_list = NULL; libmfdata_internal_list_t *internal_source_list = NULL; libmfdata_list_element_t *destination_group_element = NULL; libmfdata_list_element_t *destination_list_element = NULL; libmfdata_list_element_t *source_list_element = NULL; static char *function = "libmfdata_list_clone_elements"; int element_index = 0; int is_group = 0; int number_of_elements = 0; int number_of_group_elements = 0; if( destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination list.", function ); return( -1 ); } internal_destination_list = (libmfdata_internal_list_t *) destination_list; if( source_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source list.", function ); return( -1 ); } internal_source_list = (libmfdata_internal_list_t *) source_list; if( libcdata_array_get_number_of_entries( internal_source_list->elements, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from source elements array.", function ); goto on_error; } if( libcdata_array_empty( internal_destination_list->elements, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty destination elements array.", function ); goto on_error; } if( libcdata_array_resize( internal_destination_list->elements, number_of_elements, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize destination elements array.", function ); goto on_error; } for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_array_get_entry_by_index( internal_source_list->elements, element_index, (intptr_t **) &source_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from source elements array.", function, element_index ); goto on_error; } if( source_list_element == NULL ) { continue; } is_group = libmfdata_list_element_is_group( source_list_element, error ); if( is_group == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if source list element: %d is a group.", function, element_index ); goto on_error; } else if( is_group != 0 ) { destination_list_element = destination_group_element; } if( destination_list_element == NULL ) { if( libmfdata_list_element_clone( &destination_list_element, source_list_element, destination_list, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination list element: %d.", function, element_index ); goto on_error; } if( is_group != 0 ) { if( libmfdata_list_element_get_group_values( source_list_element, &number_of_group_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve group values of source list element: %d.", function, element_index ); goto on_error; } destination_group_element = destination_list_element; } } if( libcdata_array_set_entry_by_index( internal_destination_list->elements, element_index, (intptr_t *) destination_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element: %d in destination elements array.", function, element_index ); goto on_error; } destination_list_element = NULL; if( is_group != 0 ) { number_of_group_elements -= 1; if( number_of_group_elements == 0 ) { destination_group_element = NULL; } } } internal_destination_list->value_size = internal_source_list->value_size; return( 1 ); on_error: if( ( destination_list_element != NULL ) && ( destination_list_element != destination_group_element ) ) { libmfdata_list_element_free( &destination_list_element, NULL ); } return( -1 ); } /* Resizes the elements * Returns 1 if successful or -1 on error */ int libmfdata_list_resize( libmfdata_list_t *list, int number_of_elements, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_resize"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_resize( internal_list->elements, number_of_elements, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize elements array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of elements of the list * Returns 1 if successful or -1 on error */ int libmfdata_list_get_number_of_elements( libmfdata_list_t *list, int *number_of_elements, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_get_number_of_elements"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_number_of_entries( internal_list->elements, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_get_element_by_index( libmfdata_list_t *list, int element_index, libmfdata_list_element_t **element, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_get_element_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } return( 1 ); } /* Retrieves an element for the specified offset * Returns 1 if successful, 0 if no matching element was found or -1 on error */ int libmfdata_list_get_element_by_offset( libmfdata_list_t *list, off64_t value_offset, int *element_index, libmfdata_list_element_t **element, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_get_element_by_offset"; off64_t range_offset = 0; size64_t range_size = 0; uint32_t range_flags = 0; int range_file_io_pool_entry = 0; int number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_list->elements, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); return( -1 ); } for( *element_index = 0; *element_index < number_of_elements; *element_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_list->elements, *element_index, (intptr_t **) element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, *element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( *element, &range_file_io_pool_entry, &range_offset, &range_size, &range_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, *element_index ); return( -1 ); } if( ( value_offset >= range_offset ) && ( value_offset < (off64_t) ( range_offset + range_size ) ) ) { return( 1 ); } } *element = NULL; return( 0 ); } /* Sets a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_set_element_by_index( libmfdata_list_t *list, int element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_set_element_by_index"; off64_t previous_offset = 0; size64_t previous_size = 0; uint32_t previous_flags = 0; int previous_file_io_pool_entry = 0; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( list_element != NULL ) { if( libmfdata_list_element_get_data_range( list_element, &previous_file_io_pool_entry, &previous_offset, &previous_size, &previous_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); return( -1 ); } internal_list->value_size -= previous_size; result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, element_index ); return( -1 ); } else if( result != 0 ) { if( libcdata_array_set_entry_by_index( internal_list->elements, element_index, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element: %d in elements array.", function, element_index ); libmfdata_list_element_free( &list_element, NULL ); return( -1 ); } if( libmfdata_list_element_free( &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free list element.", function ); return( -1 ); } } } if( list_element == NULL ) { if( libmfdata_list_element_initialize( &list_element, list, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element: %d.", function, element_index ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_list->elements, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element: %d in elements array.", function, element_index ); libmfdata_list_element_free( &list_element, NULL ); return( -1 ); } } if( libmfdata_list_element_set_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element: %d.", function, element_index ); return( -1 ); } internal_list->value_size += size; internal_list->flags |= LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS; return( 1 ); } /* Appends an element * Returns 1 if successful or -1 on error */ int libmfdata_list_append_element( libmfdata_list_t *list, int *element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_append_element"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libmfdata_list_element_initialize( &list_element, list, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libcdata_array_append_entry( internal_list->elements, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append list element to elements array.", function ); goto on_error; } if( libmfdata_list_element_set_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element: %d.", function, element_index ); goto on_error; } if( libmfdata_list_element_set_element_index( list_element, *element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element index.", function ); list_element = NULL; goto on_error; } internal_list->value_size += size; internal_list->flags |= LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS; return( 1 ); on_error: if( list_element != NULL ) { libmfdata_list_element_free( &list_element, NULL ); } return( -1 ); } /* Determines if a specific element is set * Returns 1 if element is set, 0 if not or -1 on error */ int libmfdata_list_is_set( libmfdata_list_t *list, int element_index, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *element = NULL; static char *function = "libmfdata_list_is_set"; int number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_number_of_entries( internal_list->elements, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); return( -1 ); } if( ( number_of_elements == 0 ) || ( element_index >= number_of_elements ) ) { return( 0 ); } if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( element != NULL ) { return( 1 ); } return( 0 ); } /* Determines if a specific element is a group * Returns 1 if element is set, 0 if not or -1 on error */ int libmfdata_list_is_group( libmfdata_list_t *list, int element_index, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *element = NULL; static char *function = "libmfdata_list_is_group"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } result = libmfdata_list_element_is_group( element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, element_index ); return( -1 ); } return( result ); } /* Group functions */ /* Retrieves a specific group * Returns 1 if successful or -1 on error */ int libmfdata_list_get_group_by_index( libmfdata_list_t *list, int element_index, int *number_of_elements, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_get_group_by_index"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, element_index ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value list element: %d is not a group.", function, element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element: %d.", function, element_index ); return( -1 ); } if( libmfdata_list_element_get_group_values( list_element, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve group values from list element: %d.", function, element_index ); return( -1 ); } return( 1 ); } /* Sets a specific group * Returns 1 if successful or -1 on error */ int libmfdata_list_set_group_by_index( libmfdata_list_t *list, int element_index, int number_of_elements, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *group_list_element = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_set_group_by_index"; off64_t previous_offset = 0; size64_t previous_size = 0; uint32_t previous_flags = 0; int group_element_set = 0; int previous_file_io_pool_entry = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( number_of_elements <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of elements value zero or less.", function ); return( -1 ); } if( libmfdata_list_element_initialize( &group_list_element, list, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create group list element: %d.", function, element_index ); goto on_error; } if( libmfdata_list_element_set_data_range( group_list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of group list element: %d.", function, element_index ); goto on_error; } if( libmfdata_list_element_set_group_values( group_list_element, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set group values.", function ); goto on_error; } while( number_of_elements > 0 ) { if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); goto on_error; } if( list_element != NULL ) { if( libmfdata_list_element_get_data_range( list_element, &previous_file_io_pool_entry, &previous_offset, &previous_size, &previous_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); goto on_error; } internal_list->value_size -= previous_size; } if( libcdata_array_set_entry_by_index( internal_list->elements, element_index, (intptr_t *) group_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set group list element: %d in elements array.", function, element_index ); goto on_error; } group_element_set = 1; if( list_element != NULL ) { if( libmfdata_list_element_free( &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free list element.", function ); goto on_error; } } element_index++; number_of_elements--; } internal_list->flags |= LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS; return( 1 ); on_error: if( group_element_set == 0 ) { if( group_list_element != NULL ) { libmfdata_list_element_free( &group_list_element, NULL ); } } return( -1 ); } /* Appends a group * Returns 1 if successful or -1 on error */ int libmfdata_list_append_group( libmfdata_list_t *list, int *element_index, int number_of_elements, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *group_list_element = NULL; static char *function = "libmfdata_list_append_group"; int first_element_index = -1; int group_element_set = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( number_of_elements <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of elements value zero or less.", function ); return( -1 ); } if( libmfdata_list_element_initialize( &group_list_element, list, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create group list element.", function ); goto on_error; } if( libmfdata_list_element_set_data_range( group_list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of group list element.", function ); goto on_error; } if( libmfdata_list_element_set_group_values( group_list_element, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set group values.", function ); goto on_error; } while( number_of_elements > 0 ) { if( libcdata_array_append_entry( internal_list->elements, element_index, (intptr_t *) group_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append group list element to elements array.", function ); goto on_error; } group_element_set = 1; if( first_element_index == -1 ) { first_element_index = *element_index; } number_of_elements--; } *element_index = first_element_index; if( libmfdata_list_element_set_element_index( group_list_element, *element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set group list element index.", function ); goto on_error; } internal_list->flags |= LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS; return( 1 ); on_error: if( group_element_set == 0 ) { if( group_list_element != NULL ) { libmfdata_list_element_free( &group_list_element, NULL ); } } return( -1 ); } /* Expands an element group * Returns 1 if successful or -1 on error */ int libmfdata_list_expand_group( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, libmfdata_list_element_t *group_list_element, int element_index, uint8_t read_flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_expand_group"; off64_t backup_element_group_offset = 0; off64_t element_group_offset = 0; size64_t backup_element_group_size = 0; size64_t element_group_size = 0; uint32_t backup_element_group_data_flags = 0; uint32_t element_group_data_flags = 0; int backup_element_group_file_io_pool_entry = 0; int element_group_file_io_pool_entry = 0; int group_element_index = 0; int number_of_elements = 0; int has_backup_data_range = 0; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( group_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid group list element.", function ); return( -1 ); } if( libmfdata_list_element_get_data_range( group_list_element, &element_group_file_io_pool_entry, &element_group_offset, &element_group_size, &element_group_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); return( -1 ); } /* Safe guard the backup data range in case the read element group function * overwrites these values */ result = libmfdata_list_element_get_backup_data_range( group_list_element, &backup_element_group_file_io_pool_entry, &backup_element_group_offset, &backup_element_group_size, &backup_element_group_data_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve backup data range of list element: %d.", function, element_index ); return( -1 ); } else if( result != 0 ) { has_backup_data_range = 1; } if( libmfdata_list_element_get_group_values( group_list_element, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve group values of list element: %d.", function, element_index ); return( -1 ); } if( libmfdata_list_element_get_element_index( group_list_element, &group_element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve group element index from list element: %d.", function, element_index ); return( -1 ); } if( internal_list->read_element_group == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - missing read element group function.", function ); return( -1 ); } result = internal_list->read_element_group( internal_list->io_handle, file_io_pool, list, group_element_index, number_of_elements, cache, element_group_file_io_pool_entry, element_group_offset, element_group_size, element_group_data_flags, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read element group: %d.", function, group_element_index ); return( -1 ); } else if( result == 0 ) { if( has_backup_data_range == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading element group: %d and no backup data range to compensate.", function, group_element_index ); return( -1 ); } if( internal_list->read_element_group( internal_list->io_handle, file_io_pool, list, group_element_index, number_of_elements, cache, backup_element_group_file_io_pool_entry, backup_element_group_offset, backup_element_group_size, backup_element_group_data_flags, read_flags | LIBMFDATA_READ_FLAG_IS_BACKUP_RANGE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read element group: %d using backup range.", function, group_element_index ); return( -1 ); } } return( 1 ); } /* Data range functions */ /* Retrieves the data range of a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_get_data_range_by_index( libmfdata_list_t *list, int element_index, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_get_data_range_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element: %d.", function, element_index ); return( -1 ); } return( 1 ); } /* Retrieves the data range of the element at the specified offset * Returns 1 if successful, 0 if no matching element was found or -1 on error */ int libmfdata_list_get_data_range_by_offset( libmfdata_list_t *list, off64_t value_offset, int *element_index, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libmfdata_list_element_t *list_element = NULL; libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_get_data_range_by_offset"; int number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid value offset value less than zero.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_list->elements, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); return( -1 ); } for( *element_index = 0; *element_index < number_of_elements; *element_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_list->elements, *element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, *element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, *element_index ); return( -1 ); } if( ( value_offset >= *offset ) && ( value_offset < (off64_t) ( *offset + *size ) ) ) { return( 1 ); } } return( 0 ); } /* Sets the data range of a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_set_data_range_by_index( libmfdata_list_t *list, int element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_set_data_range_by_index"; off64_t previous_offset = 0; size64_t previous_size = 0; uint32_t previous_flags = 0; int previous_file_io_pool_entry = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( list_element, &previous_file_io_pool_entry, &previous_offset, &previous_size, &previous_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); return( -1 ); } internal_list->value_size -= previous_size; if( libmfdata_list_element_set_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element: %d.", function, element_index ); return( -1 ); } internal_list->value_size += size; internal_list->flags |= LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS; return( 1 ); } /* Backup data range functions */ /* Retrieves the backup data range of a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_get_backup_data_range_by_index( libmfdata_list_t *list, int element_index, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_get_backup_data_range_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( libmfdata_list_element_get_backup_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve backup data range from list element: %d.", function, element_index ); return( -1 ); } return( 1 ); } /* Sets the backup data range of a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_set_backup_data_range_by_index( libmfdata_list_t *list, int element_index, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_set_backup_data_range_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( libmfdata_list_element_set_backup_data_range( list_element, file_io_pool_entry, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set backup data range of list element: %d.", function, element_index ); return( -1 ); } return( 1 ); } /* List element value functions */ /* Retrieves the element index for a specific value offset * Returns 1 if successful or -1 on error */ int libmfdata_list_get_element_index_at_value_offset( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, off64_t value_offset, int *element_index, size_t *element_offset, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_get_element_index_at_value_offset"; off64_t calculated_value_offset = 0; off64_t element_data_offset = 0; size64_t element_data_size = 0; uint32_t element_data_flags = 0; int calculated_element_index = 0; int element_file_io_pool_entry = 0; int initial_element_index = 0; int number_of_elements = 0; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( internal_list->value_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid list - value size value out of bounds.", function ); return( -1 ); } if( value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid value offset value less than zero.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element offset.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_list->elements, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); return( -1 ); } if( ( internal_list->flags & LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS ) != 0 ) { for( calculated_element_index = 0; calculated_element_index < number_of_elements; calculated_element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->elements, calculated_element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( list_element, &element_file_io_pool_entry, &element_data_offset, &element_data_size, &element_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_element_set_value_offset( list_element, calculated_value_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data offset of list element: %d.", function, calculated_element_index ); return( -1 ); } if( value_offset < calculated_value_offset ) { initial_element_index = calculated_element_index; } calculated_value_offset += (off64_t) element_data_size; } internal_list->flags &= ~( LIBMFDATA_LIST_FLAG_CALCULATE_VALUE_OFFSETS ); } else { /* This assumes a fairly even distribution of the sizes of the list elements */ initial_element_index = (int) ( ( number_of_elements * value_offset ) / internal_list->value_size ); } /* Look for the corresponding list element upwards in the list */ for( calculated_element_index = initial_element_index; calculated_element_index < number_of_elements; calculated_element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->elements, calculated_element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, calculated_element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, calculated_element_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_expand_group( list, file_io_pool, cache, list_element, calculated_element_index, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to expand element group: %d.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_get_element_by_index( list, calculated_element_index, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d.", function, calculated_element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, calculated_element_index ); return( -1 ); } else if( result != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value list element: %d is a group.", function, calculated_element_index ); return( -1 ); } } if( libmfdata_list_element_get_data_range( list_element, &element_file_io_pool_entry, &element_data_offset, &element_data_size, &element_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_element_get_value_offset( list_element, &calculated_value_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve data offset of list element: %d.", function, calculated_element_index ); return( -1 ); } /* Check if the data offset is in the list element */ if( ( value_offset >= calculated_value_offset ) && ( value_offset < ( calculated_value_offset + (off64_t) element_data_size ) ) ) { value_offset -= calculated_value_offset; break; } /* Check if the data offset is out of bounds */ if( value_offset < calculated_value_offset ) { calculated_element_index = number_of_elements; break; } } if( calculated_element_index >= number_of_elements ) { /* Look for the corresponding list element downwards in the list */ for( calculated_element_index = initial_element_index; calculated_element_index >= 0; calculated_element_index-- ) { if( libcdata_array_get_entry_by_index( internal_list->elements, calculated_element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, calculated_element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, calculated_element_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_expand_group( list, file_io_pool, cache, list_element, calculated_element_index, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to expand element group: %d.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_get_element_by_index( list, calculated_element_index, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d.", function, calculated_element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, calculated_element_index ); return( -1 ); } else if( result != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value list element: %d is a group.", function, calculated_element_index ); return( -1 ); } } if( libmfdata_list_element_get_data_range( list_element, &element_file_io_pool_entry, &element_data_offset, &element_data_size, &element_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_element_get_value_offset( list_element, &calculated_value_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve data offset of list element: %d.", function, calculated_element_index ); return( -1 ); } /* Check if the data offset is in the list element */ if( ( value_offset >= calculated_value_offset ) && ( value_offset < ( calculated_value_offset + (off64_t) element_data_size ) ) ) { value_offset -= calculated_value_offset; break; } /* Check if the data offset is out of bounds */ if( value_offset > calculated_value_offset ) { calculated_element_index = -1; break; } } } if( calculated_element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( ( value_offset < 0 ) || ( value_offset > (off64_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element offset value out of bounds.", function ); return( -1 ); } *element_index = calculated_element_index; *element_offset = (size_t) value_offset; return( 1 ); } /* Retrieves the element index for a specific value index * Returns 1 if successful or -1 on error */ int libmfdata_list_get_element_index_at_value_index( libmfdata_list_t *list, int value_index, size_t value_size, int *element_index, size_t *element_offset, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_get_element_index_at_value_index"; off64_t element_data_offset = 0; size64_t element_data_size = 0; uint64_t number_of_values = 0; uint32_t element_data_flags = 0; int calculated_element_index = 0; int element_file_io_pool_entry = 0; int number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( value_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid value index value less than zero.", function ); return( -1 ); } if( value_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value size value exceeds maximum.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element offset.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_list->elements, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); return( -1 ); } for( calculated_element_index = 0; calculated_element_index < number_of_elements; calculated_element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->elements, *element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element: %d from elements array.", function, calculated_element_index ); return( -1 ); } if( libmfdata_list_element_get_data_range( list_element, &element_file_io_pool_entry, &element_data_offset, &element_data_size, &element_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, calculated_element_index ); return( -1 ); } number_of_values = element_data_size / value_size; if( number_of_values > (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of values value exceeds maximum.", function ); return( -1 ); } if( value_index < (int) number_of_values ) { break; } value_index -= (int) number_of_values; } if( calculated_element_index >= number_of_elements ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( value_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value index value out of bounds.", function ); return( -1 ); } *element_index = calculated_element_index; *element_offset = value_size * value_index; return( 1 ); } /* Retrieves the value of the element * Returns 1 if successful or -1 on error */ int libmfdata_list_get_element_value( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, libmfdata_list_element_t *element, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_get_element_value"; time_t element_timestamp = 0; size64_t element_data_size = 0; off64_t cache_value_offset = (off64_t) -1; off64_t element_data_offset = 0; int64_t cache_value_timestamp = 0; uint32_t element_data_flags = 0; int cache_entry_index = -1; int cache_value_file_io_pool_entry = -1; int element_file_io_pool_entry = 0; int element_index = -1; int number_of_cache_entries = 0; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libmfdata_list_element_get_element_index( element, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from list element.", function ); return( -1 ); } if( libmfdata_list_element_get_data_range( element, &element_file_io_pool_entry, &element_data_offset, &element_data_size, &element_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } if( ( read_flags & LIBMFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { cache_entry_index = libmfdata_list_calculate_cache_entry_index( element_index, number_of_cache_entries ); if( libfcache_cache_get_value_by_index( cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libmfdata_list_element_get_timestamp( element, &element_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from list element.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_io_pool_entry, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( element_file_io_pool_entry == cache_value_file_io_pool_entry ) && ( element_data_offset == cache_value_offset ) && ( (int64_t) element_timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading element data from pool entry: %d at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, element_file_io_pool_entry, element_data_offset, element_data_offset, element_data_size ); } #endif /* Read the element data from the file IO handle */ if( internal_list->read_element_data( internal_list->io_handle, file_io_pool, element, cache, element_file_io_pool_entry, element_data_offset, element_data_size, element_data_flags, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read element data from pool entry: %d at offset: %" PRIi64 ".", function, element_file_io_pool_entry, element_data_offset ); return( -1 ); } cache_entry_index = libmfdata_list_calculate_cache_entry_index( element_index, number_of_cache_entries ); if( libfcache_cache_get_value_by_index( cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libmfdata_list_element_get_timestamp( element, &element_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from list element.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_io_pool_entry, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( element_file_io_pool_entry != cache_value_file_io_pool_entry ) || ( element_data_offset != cache_value_offset ) || ( (int64_t) element_timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing cache value.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, element_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value from cache value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value of a specific element * Returns 1 if successful or -1 on error */ int libmfdata_list_get_element_value_by_index( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, int element_index, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_get_element_value_by_index"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, element_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_expand_group( list, file_io_pool, cache, list_element, element_index, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to expand element group: %d.", function, element_index ); return( -1 ); } if( libmfdata_list_get_element_by_index( list, element_index, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d.", function, element_index ); return( -1 ); } result = libmfdata_list_element_is_group( list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if list element: %d is a group.", function, element_index ); return( -1 ); } else if( result != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value list element: %d is a group.", function, element_index ); return( -1 ); } } if( libmfdata_list_get_element_value( list, file_io_pool, cache, list_element, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value an element at a specific offset * Returns 1 if successful or -1 on error */ int libmfdata_list_get_element_value_at_offset( libmfdata_list_t *list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, off64_t value_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { static char *function = "libmfdata_list_get_element_value_at_offset"; size_t element_offset = 0; int element_index = 0; if( libmfdata_list_get_element_index_at_value_offset( list, file_io_pool, cache, value_offset, &element_index, &element_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index at offset: %" PRIi64 ".", function, value_offset ); return( -1 ); } if( libmfdata_list_get_element_value_by_index( list, file_io_pool, cache, element_index, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element: %d value.", function, element_index ); return( -1 ); } return( 1 ); } /* Sets the value of a specific element * * If the flag LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libmfdata_list_set_element_value( libmfdata_list_t *list, libfcache_cache_t *cache, libmfdata_list_element_t *element, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { static char *function = "libmfdata_list_set_element_value"; off64_t element_data_offset = 0; size64_t element_data_size = 0; time_t element_timestamp = 0; uint32_t element_data_flags = 0; int cache_entry_index = -1; int element_index = -1; int element_file_io_pool_entry = 0; int number_of_cache_entries = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( libmfdata_list_element_get_data_range( element, &element_file_io_pool_entry, &element_data_offset, &element_data_size, &element_data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element.", function ); return( -1 ); } if( libmfdata_list_element_get_timestamp( element, &element_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from list element.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( libmfdata_list_element_get_element_index( element, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from list element.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } cache_entry_index = libmfdata_list_calculate_cache_entry_index( element_index, number_of_cache_entries ); if( libfcache_cache_set_value_by_index( cache, cache_entry_index, element_file_io_pool_entry, element_data_offset, (int64_t) element_timestamp, element_value, free_element_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache entry: %d.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Sets the value of a specific element * * If the flag LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libmfdata_list_set_element_value_by_index( libmfdata_list_t *list, libfcache_cache_t *cache, int element_index, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; libmfdata_list_element_t *list_element = NULL; static char *function = "libmfdata_list_set_element_value_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from elements array.", function, element_index ); return( -1 ); } if( libmfdata_list_set_element_value( list, cache, list_element, element_value, free_element_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set element value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value size of the list * Returns 1 if successful or -1 on error */ int libmfdata_list_get_value_size( libmfdata_list_t *list, size64_t *value_size, libcerror_error_t **error ) { libmfdata_internal_list_t *internal_list = NULL; static char *function = "libmfdata_list_get_value_size"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libmfdata_internal_list_t *) list; if( value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value size.", function ); return( -1 ); } *value_size = internal_list->value_size; return( 1 ); } libewf-20140807/libmfdata/libmfdata_range.h0000664000175000017500000000373313154442211022527 0ustar00lordyestalordyesta00000000000000/* * The data range functions * * 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_RANGE_H ) #define _LIBMFDATA_RANGE_H #include #include #include "libmfdata_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_range libmfdata_range_t; struct libmfdata_range { /* The file IO pool entry */ int file_io_pool_entry; /* The offset */ off64_t offset; /* The size */ size64_t size; /* The flags */ uint32_t flags; }; int libmfdata_range_initialize( libmfdata_range_t **range, libcerror_error_t **error ); int libmfdata_range_free( libmfdata_range_t **range, libcerror_error_t **error ); int libmfdata_range_clone( libmfdata_range_t **destination_range, libmfdata_range_t *source_range, libcerror_error_t **error ); int libmfdata_range_get_values( libmfdata_range_t *range, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); int libmfdata_range_set_values( libmfdata_range_t *range, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_inline.h0000664000175000017500000000212413154442211022702 0ustar00lordyestalordyesta00000000000000/* * The internal inline definition * * 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_INTERNAL_INLINE_H ) #define _LIBMFDATA_INTERNAL_INLINE_H #include #if defined( _MSC_VER ) #define LIBMFDATA_INLINE _inline #elif defined( __BORLANDC__ ) #define LIBMFDATA_INLINE /* inline */ #else #define LIBMFDATA_INLINE inline #endif #endif libewf-20140807/libmfdata/libmfdata_file.c0000664000175000017500000002442313154442211022344 0ustar00lordyestalordyesta00000000000000/* * The file functions * * 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 . */ #include #include #include #include "libmfdata_date_time.h" #include "libmfdata_file.h" #include "libmfdata_file_list.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcerror.h" #include "libmfdata_libfcache.h" #include "libmfdata_types.h" /* Initializes the file * Returns 1 if successful or -1 on error */ int libmfdata_file_initialize( libmfdata_file_t **file, libmfdata_file_list_t *list, int element_index, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_initialize"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } if( *file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file value already set.", function ); return( -1 ); } if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } internal_file = memory_allocate_structure( libmfdata_internal_file_t ); if( internal_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file.", function ); goto on_error; } if( memory_set( internal_file, 0, sizeof( libmfdata_internal_file_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file.", function ); goto on_error; } internal_file->list = list; internal_file->element_index = element_index; internal_file->file_io_pool_entry = -1; internal_file->timestamp = libmfdata_date_time_get_timestamp(); *file = (libmfdata_file_t *) internal_file; return( 1 ); on_error: if( internal_file != NULL ) { memory_free( internal_file ); } return( -1 ); } /* Frees the file * Returns 1 if successful or -1 on error */ int libmfdata_file_free( libmfdata_file_t **file, libcerror_error_t **error ) { static char *function = "libmfdata_file_free"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } if( *file != NULL ) { memory_free( *file ); *file = NULL; } return( 1 ); } /* Retrieves the element index * Returns 1 if successful or -1 on error */ int libmfdata_file_get_element_index( libmfdata_file_t *file, int *element_index, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_get_element_index"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } *element_index = internal_file->element_index; return( 1 ); } /* Sets the element index * Returns 1 if successful or -1 on error */ int libmfdata_file_set_element_index( libmfdata_file_t *file, int element_index, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_set_element_index"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } internal_file->element_index = element_index; return( 1 ); } /* Retrieves the time stamp * Returns 1 if successful or -1 on error */ int libmfdata_file_get_timestamp( libmfdata_file_t *file, time_t *timestamp, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_get_timestamp"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time stamp.", function ); return( -1 ); } *timestamp = internal_file->timestamp; return( 1 ); } /* Data range functions */ /* Retrieves the file IO pool entry * Returns 1 if successful or -1 on error */ int libmfdata_file_get_data_range( libmfdata_file_t *file, int *file_io_pool_entry, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_get_data_range"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( file_io_pool_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool entry.", function ); return( -1 ); } *file_io_pool_entry = internal_file->file_io_pool_entry; return( 1 ); } /* Sets the file IO pool entry * Returns 1 if successful or -1 on error */ int libmfdata_file_set_data_range( libmfdata_file_t *file, int file_io_pool_entry, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_set_data_range"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( file_io_pool_entry < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid file IO pool entry value less than zero.", function ); return( -1 ); } internal_file->file_io_pool_entry = file_io_pool_entry; internal_file->timestamp = libmfdata_date_time_get_timestamp(); return( 1 ); } /* File value functions */ /* Retrieves the file value * Returns 1 if successful or -1 on error */ int libmfdata_file_get_file_value( libmfdata_file_t *file, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, intptr_t **file_value, uint8_t read_flags, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_get_file_value"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( libmfdata_file_list_get_file_value( internal_file->list, file_io_pool, cache, file, file_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file value.", function ); return( -1 ); } return( 1 ); } /* Sets the file value * * If the flag LIBMFDATA_FILE_VALUE_FLAG_MANAGED is set the file * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libmfdata_file_set_file_value( libmfdata_file_t *file, libfcache_cache_t *cache, intptr_t *file_value, int (*free_file_value)( intptr_t **file_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_file = NULL; static char *function = "libmfdata_file_set_file_value"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libmfdata_internal_file_t *) file; if( libmfdata_file_list_set_file_value( internal_file->list, cache, file, file_value, free_file_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file file value.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libmfdata/libmfdata_support.h0000664000175000017500000000226113154442211023142 0ustar00lordyestalordyesta00000000000000/* * Support functions * * 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_SUPPORT_H ) #define _LIBMFDATA_SUPPORT_H #include #include #include "libmfdata_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBMFDATA ) LIBMFDATA_EXTERN \ const char *libmfdata_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBMFDATA ) */ #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_extern.h0000664000175000017500000000242613154442211022736 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * 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_INTERNAL_EXTERN_H ) #define _LIBMFDATA_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBMFDATA for local use of libmfdata */ #if !defined( HAVE_LOCAL_LIBMFDATA ) /* If libtool DLL support is enabled set LIBMFDATA_DLL_EXPORT * before including libmfdata/extern.h */ #if defined( _WIN32 ) && defined( DLL_EXPORT ) #define LIBMFDATA_DLL_EXPORT #endif #include #else #define LIBMFDATA_EXTERN extern #endif #endif libewf-20140807/libmfdata/libmfdata_libfcache.h0000664000175000017500000000262513154442211023332 0ustar00lordyestalordyesta00000000000000/* * The internal libfcache 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_LIBFCACHE_H ) #define _LIBMFDATA_LIBFCACHE_H #include /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache */ #if defined( HAVE_LOCAL_LIBFCACHE ) #include #include #include #include #elif defined( HAVE_LIBFCACHE_H ) /* If libtool DLL support is enabled set LIBFCACHE_DLL_IMPORT * before including libfcache.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFCACHE_DLL_IMPORT #endif #include #else #error Missing libfcache.h #endif #endif libewf-20140807/libmfdata/libmfdata_file_list.c0000664000175000017500000010706313420602326023402 0ustar00lordyestalordyesta00000000000000/* * The file list functions * * 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 . */ #include #include #include #include "libmfdata_date_time.h" #include "libmfdata_definitions.h" #include "libmfdata_file.h" #include "libmfdata_file_list.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcdata.h" #include "libmfdata_libcerror.h" #include "libmfdata_libcnotify.h" #include "libmfdata_libfcache.h" #include "libmfdata_types.h" #define libmfdata_file_list_calculate_cache_entry_index( data_file_entry, number_of_cache_entries ) \ data_file_entry % number_of_cache_entries /* Initializes the list * * If the flag LIBMFDATA_FLAG_IO_HANDLE_MANAGED is set the list * takes over management of the IO handle and the IO handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libmfdata_file_list_initialize( libmfdata_file_list_t **file_list, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*read_file_data)( intptr_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_file_t *file, libfcache_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_initialize"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } if( *file_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file list value already set.", function ); return( -1 ); } if( read_file_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read file data function.", function ); return( -1 ); } internal_file_list = memory_allocate_structure( libmfdata_internal_file_list_t ); if( internal_file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file list.", function ); goto on_error; } if( memory_set( internal_file_list, 0, sizeof( libmfdata_internal_file_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file list.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_file_list->files ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create files array.", function ); goto on_error; } internal_file_list->flags |= flags; internal_file_list->io_handle = io_handle; internal_file_list->free_io_handle = free_io_handle; internal_file_list->clone_io_handle = clone_io_handle; internal_file_list->read_file_data = read_file_data; *file_list = (libmfdata_file_list_t *) internal_file_list; return( 1 ); on_error: if( internal_file_list != NULL ) { memory_free( internal_file_list ); } return( -1 ); } /* Frees the file list * Returns 1 if successful or -1 on error */ int libmfdata_file_list_free( libmfdata_file_list_t **file_list, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_free"; int result = 1; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } if( *file_list != NULL ) { internal_file_list = (libmfdata_internal_file_list_t *) *file_list; *file_list = NULL; if( libcdata_array_free( &( internal_file_list->files ), (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_file_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the files array.", function ); result = -1; } if( ( internal_file_list->flags & LIBMFDATA_FLAG_IO_HANDLE_MANAGED ) != 0 ) { if( internal_file_list->io_handle != NULL ) { if( internal_file_list->free_io_handle != NULL ) { if( internal_file_list->free_io_handle( &( internal_file_list->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } } } } memory_free( internal_file_list ); } return( result ); } /* Clones (duplicates) the file list * Returns 1 if successful or -1 on error */ int libmfdata_file_list_clone( libmfdata_file_list_t **destination_file_list, libmfdata_file_list_t *source_file_list, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_source_file_list = NULL; intptr_t *destination_io_handle = NULL; static char *function = "libmfdata_file_list_clone"; if( destination_file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination file list.", function ); return( -1 ); } if( *destination_file_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination file list already set.", function ); return( -1 ); } if( source_file_list == NULL ) { *destination_file_list = NULL; return( 1 ); } internal_source_file_list = (libmfdata_internal_file_list_t *) source_file_list; if( internal_source_file_list->io_handle != NULL ) { if( internal_source_file_list->free_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source file list - missing free IO handle function.", function ); goto on_error; } if( internal_source_file_list->clone_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source file list - missing clone IO handle function.", function ); goto on_error; } if( internal_source_file_list->clone_io_handle( &destination_io_handle, internal_source_file_list->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone IO handle.", function ); goto on_error; } } if( libmfdata_file_list_initialize( destination_file_list, destination_io_handle, internal_source_file_list->free_io_handle, internal_source_file_list->clone_io_handle, internal_source_file_list->read_file_data, LIBMFDATA_FLAG_IO_HANDLE_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination file list.", function ); goto on_error; } if( *destination_file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination file list.", function ); goto on_error; } destination_io_handle = NULL; if( libmfdata_file_list_clone_files( *destination_file_list, source_file_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy files.", function ); goto on_error; } return( 1 ); on_error: if( *destination_file_list != NULL ) { libmfdata_file_list_free( destination_file_list, NULL ); } if( destination_io_handle != NULL ) { internal_source_file_list->free_io_handle( &destination_io_handle, NULL ); } return( -1 ); } /* Clones (duplicates) the files of the file list * Returns 1 if successful or -1 on error */ int libmfdata_file_list_clone_files( libmfdata_file_list_t *destination_file_list, libmfdata_file_list_t *source_file_list, libcerror_error_t **error ) { libmfdata_internal_file_t *internal_destination_file = NULL; libmfdata_internal_file_t *internal_source_file = NULL; libmfdata_internal_file_list_t *internal_destination_file_list = NULL; libmfdata_internal_file_list_t *internal_source_file_list = NULL; static char *function = "libmfdata_file_list_clone_files"; int file_index = 0; int number_of_files = 0; if( destination_file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination file list.", function ); return( -1 ); } internal_destination_file_list = (libmfdata_internal_file_list_t *) destination_file_list; if( source_file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source file list.", function ); return( -1 ); } internal_source_file_list = (libmfdata_internal_file_list_t *) source_file_list; if( libcdata_array_get_number_of_entries( internal_source_file_list->files, &number_of_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of files from source files array.", function ); goto on_error; } if( libcdata_array_empty( internal_destination_file_list->files, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_file_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty destination files array.", function ); goto on_error; } if( libcdata_array_resize( internal_destination_file_list->files, number_of_files, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_file_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize destination files array.", function ); goto on_error; } for( file_index = 0; file_index < number_of_files; file_index++ ) { if( libcdata_array_get_entry_by_index( internal_source_file_list->files, file_index, (intptr_t **) &internal_source_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file: %d from source files array.", function, file_index ); goto on_error; } if( libmfdata_file_initialize( (libmfdata_file_t **) &internal_destination_file, destination_file_list, file_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination file.", function ); goto on_error; } internal_destination_file->file_io_pool_entry = internal_source_file->file_io_pool_entry; if( libcdata_array_set_entry_by_index( internal_destination_file_list->files, file_index, (intptr_t *) internal_destination_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file: %d in destination files array.", function, file_index ); goto on_error; } internal_destination_file = NULL; } return( 1 ); on_error: if( internal_destination_file != NULL ) { libmfdata_file_free( (libmfdata_file_t **) &internal_destination_file, NULL ); } return( -1 ); } /* Resizes the files * Returns 1 if successful or -1 on error */ int libmfdata_file_list_resize( libmfdata_file_list_t *file_list, int number_of_files, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_resize"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_resize( internal_file_list->files, number_of_files, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_file_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize files array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of files of the list * Returns 1 if successful or -1 on error */ int libmfdata_file_list_get_number_of_files( libmfdata_file_list_t *file_list, int *number_of_files, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_get_number_of_files"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_get_number_of_entries( internal_file_list->files, number_of_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from files array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific file * Returns 1 if successful or -1 on error */ int libmfdata_file_list_get_file_item_by_index( libmfdata_file_list_t *file_list, int file_index, libmfdata_file_t **file, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_get_file_item_by_index"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_get_entry_by_index( internal_file_list->files, file_index, (intptr_t **) file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file: %d from files array.", function, file_index ); return( -1 ); } return( 1 ); } /* Retrieves the file IO pool entry of a specific file * Returns 1 if successful or -1 on error */ int libmfdata_file_list_get_file_by_index( libmfdata_file_list_t *file_list, int file_index, int *file_io_pool_entry, libcerror_error_t **error ) { libmfdata_file_t *file = NULL; libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_get_file_by_index"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_get_entry_by_index( internal_file_list->files, file_index, (intptr_t **) &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file: %d from files array.", function, file_index ); return( -1 ); } if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing file.", function ); return( -1 ); } if( libmfdata_file_get_data_range( file, file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of file: %d.", function, file_index ); return( -1 ); } return( 1 ); } /* Sets the file IO pool entry of a specific file * Returns 1 if successful or -1 on error */ int libmfdata_file_list_set_file_by_index( libmfdata_file_list_t *file_list, int file_index, int file_io_pool_entry, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; libmfdata_file_t *file = NULL; static char *function = "libmfdata_file_list_set_file_by_index"; int previous_file_io_pool_entry = 0; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_get_entry_by_index( internal_file_list->files, file_index, (intptr_t **) &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file: %d from files array.", function, file_index ); return( -1 ); } if( file != NULL ) { if( libmfdata_file_get_data_range( file, &previous_file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of file: %d.", function, file_index ); return( -1 ); } } if( file == NULL ) { if( libmfdata_file_initialize( &file, file_list, file_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_file_list->files, file_index, (intptr_t *) file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file: %d in files array.", function, file_index ); libmfdata_file_free( &file, NULL ); return( -1 ); } } if( libmfdata_file_set_data_range( file, file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of file: %d.", function, file_index ); return( -1 ); } return( 1 ); } /* Appends a file IO pool entry * Returns 1 if successful or -1 on error */ int libmfdata_file_list_append_file( libmfdata_file_list_t *file_list, int *file_index, int file_io_pool_entry, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; libmfdata_file_t *file = NULL; static char *function = "libmfdata_file_list_append_file"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libmfdata_file_initialize( &file, file_list, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file.", function ); goto on_error; } if( libmfdata_file_set_data_range( file, file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of file.", function ); goto on_error; } if( libcdata_array_append_entry( internal_file_list->files, file_index, (intptr_t *) file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file to files array.", function ); goto on_error; } if( libmfdata_file_set_element_index( file, *file_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element index.", function ); file = NULL; goto on_error; } return( 1 ); on_error: if( file != NULL ) { libmfdata_file_free( &file, NULL ); } return( -1 ); } /* Retrieves the value of the file * Returns 1 if successful or -1 on error */ int libmfdata_file_list_get_file_value( libmfdata_file_list_t *file_list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, libmfdata_file_t *file, intptr_t **file_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libmfdata_internal_file_list_t *internal_file_list = NULL; static char *function = "libmfdata_file_list_get_file_value"; time_t file_timestamp = 0; off64_t cache_value_offset = (off64_t) -1; int64_t cache_value_timestamp = 0; int cache_entry_index = -1; int cache_value_file_io_pool_entry = -1; int element_index = -1; int file_io_pool_entry = 0; int number_of_cache_entries = 0; int result = 0; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libmfdata_file_get_data_range( file, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from file.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( libmfdata_file_get_element_index( file, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from file.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } if( ( read_flags & LIBMFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { cache_entry_index = libmfdata_file_list_calculate_cache_entry_index( element_index, number_of_cache_entries ); if( libfcache_cache_get_value_by_index( cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libmfdata_file_get_timestamp( file, &file_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from file.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_io_pool_entry, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( file_io_pool_entry == cache_value_file_io_pool_entry ) && ( (int64_t) file_timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading file data from pool entry: %d\n", function, file_io_pool_entry ); } #endif /* Read the file data from the file IO handle */ if( internal_file_list->read_file_data( internal_file_list->io_handle, file_io_pool, file_io_pool_entry, file, cache, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read file data from pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } cache_entry_index = libmfdata_file_list_calculate_cache_entry_index( element_index, number_of_cache_entries ); if( libfcache_cache_get_value_by_index( cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libmfdata_file_get_timestamp( file, &file_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from file.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_io_pool_entry, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( file_io_pool_entry != cache_value_file_io_pool_entry ) || ( (int64_t) file_timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing cache value.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, file_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value of a specific file * Returns 1 if successful or -1 on error */ int libmfdata_file_list_get_file_value_by_index( libmfdata_file_list_t *file_list, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, int file_index, intptr_t **file_value, uint8_t read_flags, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; libmfdata_file_t *file = NULL; static char *function = "libmfdata_file_list_get_file_value_by_index"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_get_entry_by_index( internal_file_list->files, file_index, (intptr_t **) &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file: %d from files array.", function, file_index ); return( -1 ); } if( libmfdata_file_list_get_file_value( file_list, file_io_pool, cache, file, file_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file value.", function ); return( -1 ); } return( 1 ); } /* Sets the value of a specific file * * If the flag LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libmfdata_file_list_set_file_value( libmfdata_file_list_t *file_list, libfcache_cache_t *cache, libmfdata_file_t *file, intptr_t *file_value, int (*free_file_value)( intptr_t **file_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { static char *function = "libmfdata_file_list_set_file_value"; time_t file_timestamp = 0; int cache_entry_index = -1; int element_index = 0; int file_io_pool_entry = 0; int number_of_cache_entries = 0; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } if( libmfdata_file_get_data_range( file, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from file", function ); return( -1 ); } if( libmfdata_file_get_timestamp( file, &file_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from file.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( libmfdata_file_get_element_index( file, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from file.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } cache_entry_index = libmfdata_file_list_calculate_cache_entry_index( element_index, number_of_cache_entries ); if( libfcache_cache_set_value_by_index( cache, cache_entry_index, file_io_pool_entry, 0, (int64_t) file_timestamp, file_value, free_file_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache entry: %d.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Sets the value of a specific file * * If the flag LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libmfdata_file_list_set_file_value_by_index( libmfdata_file_list_t *file_list, libfcache_cache_t *cache, int file_index, intptr_t *file_value, int (*free_file_value)( intptr_t **file_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_file_list_t *internal_file_list = NULL; libmfdata_file_t *file = NULL; static char *function = "libmfdata_file_list_set_file_value_by_index"; if( file_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file list.", function ); return( -1 ); } internal_file_list = (libmfdata_internal_file_list_t *) file_list; if( libcdata_array_get_entry_by_index( internal_file_list->files, file_index, (intptr_t **) &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file: %d from files array.", function, file_index ); return( -1 ); } if( libmfdata_file_list_set_file_value( file_list, cache, file, file_value, free_file_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file value.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libmfdata/libmfdata_group.h0000664000175000017500000000336613154442211022571 0ustar00lordyestalordyesta00000000000000/* * The group functions * * 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_GROUP_H ) #define _LIBMFDATA_GROUP_H #include #include #include "libmfdata_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_group libmfdata_group_t; struct libmfdata_group { /* The number of elements in the group */ int number_of_elements; }; int libmfdata_group_initialize( libmfdata_group_t **group, libcerror_error_t **error ); int libmfdata_group_free( libmfdata_group_t **group, libcerror_error_t **error ); int libmfdata_group_clone( libmfdata_group_t **destination_group, libmfdata_group_t *source_group, libcerror_error_t **error ); int libmfdata_group_get_values( libmfdata_group_t *group, int *number_of_elements, libcerror_error_t **error ); int libmfdata_group_set_values( libmfdata_group_t *group, int number_of_elements, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_libbfio.h0000664000175000017500000000261213154442211023034 0ustar00lordyestalordyesta00000000000000/* * The libbfio header wrapper * * 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_LIBBFIO_H ) #define _LIBMFDATA_LIBBFIO_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) #include #include #include #include #include #elif defined( HAVE_LIBBFIO_H ) /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT * before including libbfio.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBBFIO_DLL_IMPORT #endif #include #else #error Missing libbfio.h #endif #endif libewf-20140807/libmfdata/libmfdata_error.h0000664000175000017500000000335613154442211022565 0ustar00lordyestalordyesta00000000000000/* * Error functions * * 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_INTERNAL_ERROR_H ) #define _LIBMFDATA_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBMFDATA ) #include #endif #include "libmfdata_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBMFDATA ) LIBMFDATA_EXTERN \ void libmfdata_error_free( libmfdata_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_error_fprint( libmfdata_error_t *error, FILE *stream ); LIBMFDATA_EXTERN \ int libmfdata_error_sprint( libmfdata_error_t *error, char *string, size_t size ); LIBMFDATA_EXTERN \ int libmfdata_error_backtrace_fprint( libmfdata_error_t *error, FILE *stream ); LIBMFDATA_EXTERN \ int libmfdata_error_backtrace_sprint( libmfdata_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBMFDATA ) */ #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/Makefile.in0000664000175000017500000010745513443455350021343 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libmfdata ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmfdata_la_LIBADD = am__libmfdata_la_SOURCES_DIST = libmfdata_date_time.h \ libmfdata_definitions.h libmfdata_error.c libmfdata_error.h \ libmfdata_extern.h libmfdata_file.c libmfdata_file.h \ libmfdata_file_list.c libmfdata_file_list.h libmfdata_group.c \ libmfdata_group.h libmfdata_inline.h libmfdata_libbfio.h \ libmfdata_libcdata.h libmfdata_libcerror.h \ libmfdata_libcnotify.h libmfdata_libfcache.h libmfdata_list.c \ libmfdata_list.h libmfdata_list_element.c \ libmfdata_list_element.h libmfdata_range.c libmfdata_range.h \ libmfdata_segment.c libmfdata_segment.h \ libmfdata_segment_table.c libmfdata_segment_table.h \ libmfdata_notify.c libmfdata_notify.h libmfdata_support.c \ libmfdata_support.h libmfdata_types.h libmfdata_unused.h @HAVE_LOCAL_LIBMFDATA_TRUE@am_libmfdata_la_OBJECTS = \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_error.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_file.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_file_list.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_group.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_list.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_list_element.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_range.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_segment.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_segment_table.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_notify.lo \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_support.lo libmfdata_la_OBJECTS = $(am_libmfdata_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBMFDATA_TRUE@am_libmfdata_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmfdata_error.Plo \ ./$(DEPDIR)/libmfdata_file.Plo \ ./$(DEPDIR)/libmfdata_file_list.Plo \ ./$(DEPDIR)/libmfdata_group.Plo ./$(DEPDIR)/libmfdata_list.Plo \ ./$(DEPDIR)/libmfdata_list_element.Plo \ ./$(DEPDIR)/libmfdata_notify.Plo \ ./$(DEPDIR)/libmfdata_range.Plo \ ./$(DEPDIR)/libmfdata_segment.Plo \ ./$(DEPDIR)/libmfdata_segment_table.Plo \ ./$(DEPDIR)/libmfdata_support.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmfdata_la_SOURCES) DIST_SOURCES = $(am__libmfdata_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBMFDATA_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBMFDATA_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBMFDATA_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBBFIO_CPPFLAGS@ \ @HAVE_LOCAL_LIBMFDATA_TRUE@ @LIBFCACHE_CPPFLAGS@ @HAVE_LOCAL_LIBMFDATA_TRUE@noinst_LTLIBRARIES = libmfdata.la @HAVE_LOCAL_LIBMFDATA_TRUE@libmfdata_la_SOURCES = \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_date_time.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_definitions.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_error.c libmfdata_error.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_extern.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_file.c libmfdata_file.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_file_list.c libmfdata_file_list.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_group.c libmfdata_group.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_inline.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_libbfio.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_libcdata.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_libcerror.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_libcnotify.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_libfcache.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_list.c libmfdata_list.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_list_element.c libmfdata_list_element.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_range.c libmfdata_range.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_segment.c libmfdata_segment.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_segment_table.c libmfdata_segment_table.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_notify.c libmfdata_notify.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_support.c libmfdata_support.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_types.h \ @HAVE_LOCAL_LIBMFDATA_TRUE@ libmfdata_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libmfdata/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libmfdata/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmfdata.la: $(libmfdata_la_OBJECTS) $(libmfdata_la_DEPENDENCIES) $(EXTRA_libmfdata_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libmfdata_la_rpath) $(libmfdata_la_OBJECTS) $(libmfdata_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_file_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_group.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_list_element.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_segment.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_segment_table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmfdata_support.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libmfdata_error.Plo -rm -f ./$(DEPDIR)/libmfdata_file.Plo -rm -f ./$(DEPDIR)/libmfdata_file_list.Plo -rm -f ./$(DEPDIR)/libmfdata_group.Plo -rm -f ./$(DEPDIR)/libmfdata_list.Plo -rm -f ./$(DEPDIR)/libmfdata_list_element.Plo -rm -f ./$(DEPDIR)/libmfdata_notify.Plo -rm -f ./$(DEPDIR)/libmfdata_range.Plo -rm -f ./$(DEPDIR)/libmfdata_segment.Plo -rm -f ./$(DEPDIR)/libmfdata_segment_table.Plo -rm -f ./$(DEPDIR)/libmfdata_support.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libmfdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libmfdata_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libmfdata/libmfdata_list_element.h0000664000175000017500000001247413154442211024121 0ustar00lordyestalordyesta00000000000000/* * The list element functions * * 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_INTERNAL_LIST_ELEMENT_H ) #define _LIBMFDATA_INTERNAL_LIST_ELEMENT_H #include #include #include "libmfdata_date_time.h" #include "libmfdata_extern.h" #include "libmfdata_group.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcerror.h" #include "libmfdata_libfcache.h" #include "libmfdata_range.h" #include "libmfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_internal_list_element libmfdata_internal_list_element_t; struct libmfdata_internal_list_element { /* The list reference */ libmfdata_list_t *list; /* The (list) element index */ int element_index; /* The (element) data range */ libmfdata_range_t *data_range; /* The (element) backup data range */ libmfdata_range_t *backup_data_range; /* The time stamp */ time_t timestamp; /* The (element) value offset */ off64_t value_offset; /* The (element) value size */ size64_t value_size; /* The (element) group values */ libmfdata_group_t *group_values; /* The flags */ uint8_t flags; }; int libmfdata_list_element_initialize( libmfdata_list_element_t **element, libmfdata_list_t *list, int element_index, libcerror_error_t **error ); int libmfdata_list_element_free( libmfdata_list_element_t **element, libcerror_error_t **error ); int libmfdata_list_element_clone( libmfdata_list_element_t **destination_element, libmfdata_list_element_t *source_element, libmfdata_list_t *list, int element_index, libcerror_error_t **error ); int libmfdata_list_element_get_element_index( libmfdata_list_element_t *element, int *element_index, libcerror_error_t **error ); int libmfdata_list_element_set_element_index( libmfdata_list_element_t *element, int element_index, libcerror_error_t **error ); int libmfdata_list_element_get_timestamp( libmfdata_list_element_t *element, time_t *timestamp, libcerror_error_t **error ); int libmfdata_list_element_get_value_offset( libmfdata_list_element_t *element, off64_t *value_offset, libcerror_error_t **error ); int libmfdata_list_element_set_value_offset( libmfdata_list_element_t *element, off64_t value_offset, libcerror_error_t **error ); int libmfdata_list_element_get_value_size( libmfdata_list_element_t *element, size64_t *value_size, libcerror_error_t **error ); int libmfdata_list_element_set_value_size( libmfdata_list_element_t *element, size64_t value_size, libcerror_error_t **error ); /* Group functions */ int libmfdata_list_element_is_group( libmfdata_list_element_t *element, libcerror_error_t **error ); int libmfdata_list_element_get_group_values( libmfdata_list_element_t *element, int *number_of_elements, libcerror_error_t **error ); int libmfdata_list_element_set_group_values( libmfdata_list_element_t *element, int number_of_elements, libcerror_error_t **error ); /* Data range functions */ int libmfdata_list_element_get_data_range( libmfdata_list_element_t *element, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); int libmfdata_list_element_set_data_range( libmfdata_list_element_t *element, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); /* Backup range functions */ int libmfdata_list_element_get_backup_data_range( libmfdata_list_element_t *element, int *file_io_pool_entry, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); int libmfdata_list_element_set_backup_data_range( libmfdata_list_element_t *element, int file_io_pool_entry, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); /* Element value functions */ LIBMFDATA_EXTERN \ int libmfdata_list_element_get_element_value( libmfdata_list_element_t *element, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_list_element_set_element_value( libmfdata_list_element_t *element, libfcache_cache_t *cache, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_file.h0000664000175000017500000000566713154442211022362 0ustar00lordyestalordyesta00000000000000/* * The file functions * * 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_INTERNAL_FILE_H ) #define _LIBMFDATA_INTERNAL_FILE_H #include #include #include "libmfdata_extern.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcerror.h" #include "libmfdata_libfcache.h" #include "libmfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_internal_file libmfdata_internal_file_t; struct libmfdata_internal_file { /* The (file) list reference */ libmfdata_file_list_t *list; /* The (file list) element index */ int element_index; /* The file IO pool entry */ int file_io_pool_entry; /* The time stamp */ time_t timestamp; }; int libmfdata_file_initialize( libmfdata_file_t **file, libmfdata_file_list_t *list, int element_index, libcerror_error_t **error ); int libmfdata_file_free( libmfdata_file_t **file, libcerror_error_t **error ); int libmfdata_file_get_element_index( libmfdata_file_t *file, int *element_index, libcerror_error_t **error ); int libmfdata_file_set_element_index( libmfdata_file_t *file, int element_index, libcerror_error_t **error ); int libmfdata_file_get_timestamp( libmfdata_file_t *file, time_t *timestamp, libcerror_error_t **error ); /* Data range functions */ LIBMFDATA_EXTERN \ int libmfdata_file_get_data_range( libmfdata_file_t *file, int *file_io_pool_entry, libcerror_error_t **error ); int libmfdata_file_set_data_range( libmfdata_file_t *file, int file_io_pool_entry, libcerror_error_t **error ); /* File value functions */ LIBMFDATA_EXTERN \ int libmfdata_file_get_file_value( libmfdata_file_t *file, libbfio_pool_t *file_io_pool, libfcache_cache_t *cache, intptr_t **file_value, uint8_t read_flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_file_set_file_value( libmfdata_file_t *file, libfcache_cache_t *cache, intptr_t *file_value, int (*free_file_value)( intptr_t **file_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_segment.c0000664000175000017500000002341413154442211023066 0ustar00lordyestalordyesta00000000000000/* * The segment functions * * 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 . */ #include #include #include #include "libmfdata_definitions.h" #include "libmfdata_libcerror.h" #include "libmfdata_segment.h" #include "libmfdata_segment_table.h" #include "libmfdata_types.h" /* Initializes the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_initialize( libmfdata_segment_t **segment, libmfdata_segment_table_t *segment_table, int segment_index, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_initialize"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } if( *segment != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment value already set.", function ); return( -1 ); } if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( segment_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid segment index value less than zero.", function ); return( -1 ); } internal_segment = memory_allocate_structure( libmfdata_internal_segment_t ); if( internal_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment.", function ); goto on_error; } if( memory_set( internal_segment, 0, sizeof( libmfdata_internal_segment_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment.", function ); goto on_error; } internal_segment->segment_table = segment_table; internal_segment->segment_index = segment_index; internal_segment->file_io_pool_entry = -1; *segment = (libmfdata_segment_t *) internal_segment; return( 1 ); on_error: if( internal_segment != NULL ) { memory_free( internal_segment ); } return( -1 ); } /* Frees the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_free( libmfdata_segment_t **segment, libcerror_error_t **error ) { static char *function = "libmfdata_segment_free"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } if( *segment != NULL ) { memory_free( *segment ); *segment = NULL; } return( 1 ); } /* Retrieves the file IO pool entry, offset and size of the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_get_range( libmfdata_segment_t *segment, int *file_io_pool_entry, size64_t *segment_size, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_get_range"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } internal_segment = (libmfdata_internal_segment_t *) segment; if( file_io_pool_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool entry.", function ); return( -1 ); } if( segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment size.", function ); return( -1 ); } *file_io_pool_entry = internal_segment->file_io_pool_entry; *segment_size = internal_segment->size; return( 1 ); } /* Sets the file IO pool entry, offset and size of the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_set_range( libmfdata_segment_t *segment, int file_io_pool_entry, size64_t segment_size, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_set_offset"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } internal_segment = (libmfdata_internal_segment_t *) segment; if( file_io_pool_entry < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid file IO pool entry value less than zero.", function ); return( -1 ); } if( segment_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid segment size value exceeds maximum.", function ); return( -1 ); } internal_segment->file_io_pool_entry = file_io_pool_entry; internal_segment->size = segment_size; return( 1 ); } /* Retrieves the segment index of the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_get_segment_index( libmfdata_segment_t *segment, int *segment_index, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_get_segment_index"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } internal_segment = (libmfdata_internal_segment_t *) segment; if( segment_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment index.", function ); return( -1 ); } *segment_index = internal_segment->segment_index; return( 1 ); } /* Sets the segment index of the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_set_segment_index( libmfdata_segment_t *segment, int segment_index, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_set_segment_index"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } internal_segment = (libmfdata_internal_segment_t *) segment; if( segment_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid segment index value less than zero.", function ); return( -1 ); } internal_segment->segment_index = segment_index; return( 1 ); } /* Retrieves the value offset of the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_get_value_offset( libmfdata_segment_t *segment, off64_t *value_offset, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_get_value_offset"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } internal_segment = (libmfdata_internal_segment_t *) segment; if( value_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value offset.", function ); return( -1 ); } *value_offset = internal_segment->value_offset; return( 1 ); } /* Sets the value offset of the segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_set_value_offset( libmfdata_segment_t *segment, off64_t value_offset, libcerror_error_t **error ) { libmfdata_internal_segment_t *internal_segment = NULL; static char *function = "libmfdata_segment_set_value_offset"; if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } internal_segment = (libmfdata_internal_segment_t *) segment; if( value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid value offset value less than zero.", function ); return( -1 ); } internal_segment->value_offset = value_offset; return( 1 ); } libewf-20140807/libmfdata/libmfdata_types.h0000664000175000017500000000352713154442211022600 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * 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_INTERNAL_TYPES_H ) #define _LIBMFDATA_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBMFDATA for local use of libmfdata * The definitions in are copied here * for local use of libmfdata */ #if defined( HAVE_LOCAL_LIBMFDATA ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libmfdata_file {} libmfdata_file_t; typedef struct libmfdata_file_list {} libmfdata_file_list_t; typedef struct libmfdata_list {} libmfdata_list_t; typedef struct libmfdata_list_element {} libmfdata_list_element_t; typedef struct libmfdata_segment {} libmfdata_segment_t; typedef struct libmfdata_segment_table {} libmfdata_segment_table_t; #else typedef intptr_t libmfdata_file_t; typedef intptr_t libmfdata_file_list_t; typedef intptr_t libmfdata_list_t; typedef intptr_t libmfdata_list_element_t; typedef intptr_t libmfdata_segment_t; typedef intptr_t libmfdata_segment_table_t; #endif #endif #endif libewf-20140807/libmfdata/libmfdata_segment.h0000664000175000017500000000523313154442211023072 0ustar00lordyestalordyesta00000000000000/* * The segment functions * * 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_INTERNAL_SEGMENT_H ) #define _LIBMFDATA_INTERNAL_SEGMENT_H #include #include #include "libmfdata_extern.h" #include "libmfdata_libcerror.h" #include "libmfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_internal_segment libmfdata_internal_segment_t; struct libmfdata_internal_segment { /* The segment table reference */ libmfdata_segment_table_t *segment_table; /* The segment (table) index */ int segment_index; /* The file IO pool entry */ int file_io_pool_entry; /* The (segment) size */ size64_t size; /* The flags */ uint8_t flags; /* The (segment) value offset */ off64_t value_offset; }; int libmfdata_segment_initialize( libmfdata_segment_t **segment, libmfdata_segment_table_t *segment_table, int segment_index, libcerror_error_t **error ); int libmfdata_segment_free( libmfdata_segment_t **segment, libcerror_error_t **error ); int libmfdata_segment_get_range( libmfdata_segment_t *segment, int *file_io_pool_entry, size64_t *segment_size, libcerror_error_t **error ); int libmfdata_segment_set_range( libmfdata_segment_t *segment, int file_io_pool_entry, size64_t segment_size, libcerror_error_t **error ); int libmfdata_segment_get_segment_index( libmfdata_segment_t *segment, int *segment_index, libcerror_error_t **error ); int libmfdata_segment_set_segment_index( libmfdata_segment_t *segment, int segment_index, libcerror_error_t **error ); int libmfdata_segment_get_value_offset( libmfdata_segment_t *segment, off64_t *value_offset, libcerror_error_t **error ); int libmfdata_segment_set_value_offset( libmfdata_segment_t *segment, off64_t value_offset, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_libcnotify.h0000664000175000017500000000254513154442211023575 0ustar00lordyestalordyesta00000000000000/* * The internal libcnotify 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_LIBCNOTIFY_H ) #define _LIBMFDATA_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libmfdata/libmfdata_notify.c0000664000175000017500000000525113154442211022733 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libmfdata_libcerror.h" #include "libmfdata_libcnotify.h" #include "libmfdata_notify.h" #if !defined( HAVE_LOCAL_LIBMFDATA ) /* Sets the verbose notification */ void libmfdata_notify_set_verbose( int verbose ) { libcnotify_set_verbose( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libmfdata_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libmfdata_notify_set_stream"; if( libcnotify_set_stream( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libmfdata_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libmfdata_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libmfdata_notify_stream_close( libcerror_error_t **error ) { static char *function = "libmfdata_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif libewf-20140807/libmfdata/libmfdata_segment_table.h0000664000175000017500000002164613154442211024247 0ustar00lordyestalordyesta00000000000000/* * The segment table functions * * 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_INTERNAL_SEGMENT_TABLE_H ) #define _LIBMFDATA_INTERNAL_SEGMENT_TABLE_H #include #include #include "libmfdata_extern.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcdata.h" #include "libmfdata_libcerror.h" #include "libmfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmfdata_internal_segment_table libmfdata_internal_segment_table_t; struct libmfdata_internal_segment_table { /* The current segment index */ int segment_index; /* The current value offset */ off64_t value_offset; /* The value size */ size64_t value_size; /* The maximum segment size */ size64_t maximum_segment_size; /* The segments (array) */ libcdata_array_t *segments; /* The flags */ uint8_t flags; /* The io handle */ intptr_t *io_handle; /* The free IO handle function */ int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ); /* The clone (duplicate) IO handle function */ int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ); /* The set segment name function */ int (*set_segment_name)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, libcerror_error_t **error ); /* The read segment data function */ ssize_t (*read_segment_data)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ); /* The write segment data function */ ssize_t (*write_segment_data)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, const uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ); /* The seek segment offset function */ off64_t (*seek_segment_offset)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, off64_t segment_offset, int whence, libcerror_error_t **error ); }; LIBMFDATA_EXTERN \ int libmfdata_segment_table_initialize( libmfdata_segment_table_t **segment_table, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*set_segment_name)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, libcerror_error_t **error ), ssize_t (*read_segment_data)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ), ssize_t (*write_segment_data)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, const uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ), off64_t (*seek_segment_offset)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, off64_t segment_offset, int whence, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_free( libmfdata_segment_table_t **segment_table, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_clone( libmfdata_segment_table_t **destination_segment_table, libmfdata_segment_table_t *source_segment_table, libcerror_error_t **error ); int libmfdata_segment_table_clone_segments( libmfdata_segment_table_t *destination_segment_table, libmfdata_segment_table_t *source_segment_table, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_empty( libmfdata_segment_table_t *segment_table, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_value_offset( libmfdata_segment_table_t *segment_table, off64_t *value_offset, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_value_size( libmfdata_segment_table_t *segment_table, size64_t *value_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_maximum_segment_size( libmfdata_segment_table_t *segment_table, size64_t *maximum_segment_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_set_maximum_segment_size( libmfdata_segment_table_t *segment_table, size64_t maximum_segment_size, libcerror_error_t **error ); /* Segment functions */ LIBMFDATA_EXTERN \ int libmfdata_segment_table_resize( libmfdata_segment_table_t *segment_table, int number_of_segments, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_number_of_segments( libmfdata_segment_table_t *segment_table, int *number_of_segments, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_segment_by_index( libmfdata_segment_table_t *segment_table, int segment_index, libmfdata_segment_t **segment, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_segment_at_value_offset( libmfdata_segment_table_t *segment_table, off64_t value_offset, int *segment_index, libmfdata_segment_t **segment, off64_t *segment_offset, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_set_segment_by_index( libmfdata_segment_table_t *segment_table, int segment_index, int file_io_pool_entry, size64_t segment_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_append_segment( libmfdata_segment_table_t *segment_table, int *segment_index, int file_io_pool_entry, size64_t segment_size, libcerror_error_t **error ); /* Input/Output functions */ LIBMFDATA_EXTERN \ ssize_t libmfdata_segment_table_read_segment_data( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ ssize_t libmfdata_segment_table_write_segment_data( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, const uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ off64_t libmfdata_segment_table_seek_segment_offset( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, off64_t segment_offset, int whence, libcerror_error_t **error ); LIBMFDATA_EXTERN \ ssize_t libmfdata_segment_table_read_buffer( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ ssize_t libmfdata_segment_table_write_buffer( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); LIBMFDATA_EXTERN \ off64_t libmfdata_segment_table_seek_offset( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, off64_t offset, int whence, libcerror_error_t **error ); LIBMFDATA_EXTERN \ int libmfdata_segment_table_get_file_io_handle( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, libbfio_handle_t **file_io_handle, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libmfdata/libmfdata_libcdata.h0000664000175000017500000000300013154442211023161 0ustar00lordyestalordyesta00000000000000/* * The internal libcdata 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_LIBCDATA_H ) #define _LIBMFDATA_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #elif defined( HAVE_LIBCDATA_H ) /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #else #error Missing libcdata.h #endif #endif libewf-20140807/libmfdata/libmfdata_unused.h0000664000175000017500000000247713154442211022742 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * 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_INTERNAL_UNUSED_H ) #define _LIBMFDATA_INTERNAL_UNUSED_H #include #if !defined( LIBMFDATA_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBMFDATA_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBMFDATA_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBMFDATA_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBMFDATA_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif libewf-20140807/libmfdata/libmfdata_segment_table.c0000664000175000017500000017326313154442211024245 0ustar00lordyestalordyesta00000000000000/* * The segment table functions * * 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 . */ #include #include #include #include "libmfdata_definitions.h" #include "libmfdata_libbfio.h" #include "libmfdata_libcdata.h" #include "libmfdata_libcerror.h" #include "libmfdata_libcnotify.h" #include "libmfdata_segment.h" #include "libmfdata_segment_table.h" #include "libmfdata_types.h" #include "libmfdata_unused.h" /* Initializes the segment table * * If the flag LIBMFDATA_FLAG_IO_HANDLE_MANAGED is set the library * takes over management of the IO segment_table and the IO segment_table is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_initialize( libmfdata_segment_table_t **segment_table, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*set_segment_name)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, libcerror_error_t **error ), ssize_t (*read_segment_data)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ), ssize_t (*write_segment_data)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, const uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ), off64_t (*seek_segment_offset)( intptr_t *io_handle, libbfio_handle_t *file_io_handle, int segment_index, off64_t segment_offset, int whence, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_initialize"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( *segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment table value already set.", function ); return( -1 ); } internal_segment_table = memory_allocate_structure( libmfdata_internal_segment_table_t ); if( internal_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment table.", function ); goto on_error; } if( memory_set( internal_segment_table, 0, sizeof( libmfdata_internal_segment_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment table.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_segment_table->segments ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segments array.", function ); goto on_error; } internal_segment_table->flags |= flags; internal_segment_table->io_handle = io_handle; internal_segment_table->free_io_handle = free_io_handle; internal_segment_table->clone_io_handle = clone_io_handle; internal_segment_table->set_segment_name = set_segment_name; internal_segment_table->read_segment_data = read_segment_data; internal_segment_table->write_segment_data = write_segment_data; internal_segment_table->seek_segment_offset = seek_segment_offset; *segment_table = (libmfdata_segment_table_t *) internal_segment_table; return( 1 ); on_error: if( internal_segment_table != NULL ) { memory_free( internal_segment_table ); } return( -1 ); } /* Frees the segment table * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_free( libmfdata_segment_table_t **segment_table, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_free"; int result = 1; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( *segment_table != NULL ) { internal_segment_table = (libmfdata_internal_segment_table_t *) *segment_table; *segment_table = NULL; if( libcdata_array_free( &( internal_segment_table->segments ), (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_segment_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the segments array.", function ); result = -1; } if( ( internal_segment_table->flags & LIBMFDATA_FLAG_IO_HANDLE_MANAGED ) != 0 ) { if( internal_segment_table->io_handle != NULL ) { if( internal_segment_table->free_io_handle != NULL ) { if( internal_segment_table->free_io_handle( &( internal_segment_table->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } } } } memory_free( internal_segment_table ); } return( result ); } /* Clones (duplicates) the segment table * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_clone( libmfdata_segment_table_t **destination_segment_table, libmfdata_segment_table_t *source_segment_table, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_source_segment_table = NULL; intptr_t *destination_io_handle = NULL; static char *function = "libmfdata_segment_table_clone"; if( destination_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination segment table.", function ); return( -1 ); } if( *destination_segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination segment table already set.", function ); return( -1 ); } if( source_segment_table == NULL ) { *destination_segment_table = NULL; return( 1 ); } internal_source_segment_table = (libmfdata_internal_segment_table_t *) source_segment_table; if( internal_source_segment_table->io_handle != NULL ) { if( internal_source_segment_table->free_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source segment table - missing free IO handle function.", function ); goto on_error; } if( internal_source_segment_table->clone_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source segment table - missing clone IO handle function.", function ); goto on_error; } if( internal_source_segment_table->clone_io_handle( &destination_io_handle, internal_source_segment_table->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone IO handle.", function ); goto on_error; } } if( libmfdata_segment_table_initialize( destination_segment_table, destination_io_handle, internal_source_segment_table->free_io_handle, internal_source_segment_table->clone_io_handle, internal_source_segment_table->set_segment_name, internal_source_segment_table->read_segment_data, internal_source_segment_table->write_segment_data, internal_source_segment_table->seek_segment_offset, LIBMFDATA_FLAG_IO_HANDLE_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segment table.", function ); goto on_error; } if( *destination_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination segment table.", function ); goto on_error; } destination_io_handle = NULL; if( libmfdata_segment_table_clone_segments( *destination_segment_table, source_segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy segments.", function ); goto on_error; } return( 1 ); on_error: if( *destination_segment_table != NULL ) { libmfdata_segment_table_free( destination_segment_table, NULL ); } if( destination_io_handle != NULL ) { internal_source_segment_table->free_io_handle( &destination_io_handle, NULL ); } return( -1 ); } /* Clones (duplicates) the segments * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_clone_segments( libmfdata_segment_table_t *destination_segment_table, libmfdata_segment_table_t *source_segment_table, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_destination_segment_table = NULL; libmfdata_internal_segment_table_t *internal_source_segment_table = NULL; libmfdata_internal_segment_t *internal_destination_segment = NULL; libmfdata_internal_segment_t *internal_source_segment = NULL; static char *function = "libmfdata_segment_table_clone_segments"; int number_of_segments = 0; int segment_index = 0; if( destination_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination segment table.", function ); return( -1 ); } internal_destination_segment_table = (libmfdata_internal_segment_table_t *) destination_segment_table; if( source_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source segment table.", function ); return( -1 ); } internal_source_segment_table = (libmfdata_internal_segment_table_t *) source_segment_table; if( libcdata_array_get_number_of_entries( internal_source_segment_table->segments, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments from source segments array.", function ); return( -1 ); } if( libcdata_array_empty( internal_destination_segment_table->segments, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_segment_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty destination segments array.", function ); return( -1 ); } if( libcdata_array_resize( internal_destination_segment_table->segments, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_segment_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize destination segments array.", function ); return( -1 ); } for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { if( libcdata_array_get_entry_by_index( internal_source_segment_table->segments, segment_index, (intptr_t **) &internal_source_segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from source segments array.", function, segment_index ); return( -1 ); } if( libmfdata_segment_initialize( (libmfdata_segment_t **) &internal_destination_segment, destination_segment_table, segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segment.", function ); return( -1 ); } internal_destination_segment->file_io_pool_entry = internal_source_segment->file_io_pool_entry; internal_destination_segment->size = internal_source_segment->size; internal_destination_segment->value_offset = internal_source_segment->value_offset; if( libcdata_array_set_entry_by_index( internal_destination_segment_table->segments, segment_index, (intptr_t *) internal_destination_segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment: %d in destination segments array.", function, segment_index ); libmfdata_segment_free( (libmfdata_segment_t **) &internal_destination_segment, NULL ); return( -1 ); } internal_destination_segment = NULL; } internal_destination_segment_table->value_size = internal_source_segment_table->value_size; return( 1 ); } /* Empties the segment table * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_empty( libmfdata_segment_table_t *segment_table, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_empty"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libcdata_array_empty( internal_segment_table->segments, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_segment_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty segments array.", function ); return( -1 ); } return( 1 ); } /* Resizes the segment table * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_resize( libmfdata_segment_table_t *segment_table, int number_of_segments, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_resize"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libcdata_array_resize( internal_segment_table->segments, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libmfdata_segment_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize segments array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value offset * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_get_value_offset( libmfdata_segment_table_t *segment_table, off64_t *value_offset, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_value_offset"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( value_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value offset.", function ); return( -1 ); } *value_offset = internal_segment_table->value_offset; return( 1 ); } /* Retrieves the value size * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_get_value_size( libmfdata_segment_table_t *segment_table, size64_t *value_size, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_value_size"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value size.", function ); return( -1 ); } *value_size = internal_segment_table->value_size; return( 1 ); } /* Retrieves the maximum segment size * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_get_maximum_segment_size( libmfdata_segment_table_t *segment_table, size64_t *maximum_segment_size, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_maximum_segment_size"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( maximum_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum segment size.", function ); return( -1 ); } *maximum_segment_size = internal_segment_table->maximum_segment_size; return( 1 ); } /* Sets the maximum segment size * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_set_maximum_segment_size( libmfdata_segment_table_t *segment_table, size64_t maximum_segment_size, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_set_maximum_segment_size"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( maximum_segment_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum segment size value exceeds maximum.", function ); return( -1 ); } internal_segment_table->maximum_segment_size = maximum_segment_size; return( 1 ); } /* Retrieves the number of segments * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_get_number_of_segments( libmfdata_segment_table_t *segment_table, int *number_of_segments, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_number_of_segments"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libcdata_array_get_number_of_entries( internal_segment_table->segments, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments from segments array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_get_segment_by_index( libmfdata_segment_table_t *segment_table, int segment_index, libmfdata_segment_t **segment, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_segment_by_index"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libcdata_array_get_entry_by_index( internal_segment_table->segments, segment_index, (intptr_t **) segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, segment_index ); return( -1 ); } return( 1 ); } /* Retrieves a segment for the specified value offset * Returns 1 if successful, 0 if no matching segment was found or -1 on error */ int libmfdata_segment_table_get_segment_at_value_offset( libmfdata_segment_table_t *segment_table, off64_t value_offset, int *segment_index, libmfdata_segment_t **segment, off64_t *segment_offset, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_segment_index_at_value_offset"; off64_t calculated_value_offset = 0; size64_t segment_size = 0; int calculated_segment_index = 0; int file_io_pool_entry = 0; int initial_segment_index = 0; int number_of_segments = 0; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( internal_segment_table->value_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment table - value size value out of bounds.", function ); return( -1 ); } if( value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid value offset value less than zero.", function ); return( -1 ); } if( segment_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment index.", function ); return( -1 ); } if( segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment.", function ); return( -1 ); } if( segment_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment offset.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_segment_table->segments, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments from segments array.", function ); return( -1 ); } if( ( internal_segment_table->flags & LIBMFDATA_SEGMENT_TABLE_FLAG_CALCULATE_VALUE_OFFSETS ) != 0 ) { for( calculated_segment_index = 0; calculated_segment_index < number_of_segments; calculated_segment_index++ ) { if( libcdata_array_get_entry_by_index( internal_segment_table->segments, calculated_segment_index, (intptr_t **) segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, calculated_segment_index ); return( -1 ); } if( libmfdata_segment_get_range( *segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, calculated_segment_index ); return( -1 ); } if( libmfdata_segment_set_value_offset( *segment, calculated_value_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data offset of segment: %d.", function, calculated_segment_index ); return( -1 ); } if( value_offset < calculated_value_offset ) { initial_segment_index = calculated_segment_index; } calculated_value_offset += (off64_t) segment_size; } internal_segment_table->flags &= ~( LIBMFDATA_SEGMENT_TABLE_FLAG_CALCULATE_VALUE_OFFSETS ); } else { /* This assumes a fairly even distribution of the sizes of the segments */ initial_segment_index = (int) ( ( number_of_segments * value_offset ) / internal_segment_table->value_size ); } /* Look for the corresponding segment upwards in the segment table */ for( calculated_segment_index = initial_segment_index; calculated_segment_index < number_of_segments; calculated_segment_index++ ) { if( libcdata_array_get_entry_by_index( internal_segment_table->segments, calculated_segment_index, (intptr_t **) segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, calculated_segment_index ); return( -1 ); } if( libmfdata_segment_get_range( *segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, calculated_segment_index ); return( -1 ); } if( libmfdata_segment_get_value_offset( *segment, &calculated_value_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve data offset of segment: %d.", function, calculated_segment_index ); return( -1 ); } /* Check if the data offset is in the segment */ if( ( value_offset >= calculated_value_offset ) && ( value_offset < ( calculated_value_offset + (off64_t) segment_size ) ) ) { value_offset -= calculated_value_offset; break; } /* Check if the data offset is out of bounds */ if( value_offset < calculated_value_offset ) { calculated_segment_index = number_of_segments; break; } } if( calculated_segment_index >= number_of_segments ) { /* Look for the corresponding segment downwards in the segment table */ for( calculated_segment_index = initial_segment_index; calculated_segment_index >= 0; calculated_segment_index-- ) { if( libcdata_array_get_entry_by_index( internal_segment_table->segments, calculated_segment_index, (intptr_t **) segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, calculated_segment_index ); return( -1 ); } if( libmfdata_segment_get_range( *segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, calculated_segment_index ); return( -1 ); } if( libmfdata_segment_get_value_offset( *segment, &calculated_value_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve data offset of segment: %d.", function, calculated_segment_index ); return( -1 ); } /* Check if the data offset is in the segment */ if( ( value_offset >= calculated_value_offset ) && ( value_offset < ( calculated_value_offset + (off64_t) segment_size ) ) ) { value_offset -= calculated_value_offset; break; } /* Check if the data offset is out of bounds */ if( value_offset > calculated_value_offset ) { calculated_segment_index = -1; break; } } } if( calculated_segment_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment offset value out of bounds.", function ); return( -1 ); } *segment_index = calculated_segment_index; *segment_offset = value_offset; return( 1 ); } /* Sets the data offset and size of a specific segment * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_set_segment_by_index( libmfdata_segment_table_t *segment_table, int segment_index, int file_io_pool_entry, size64_t segment_size, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; libmfdata_segment_t *segment = NULL; static char *function = "libmfdata_segment_table_set_segment_by_index"; size64_t previous_segment_size = 0; int previous_file_io_pool_entry = 0; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libcdata_array_get_entry_by_index( internal_segment_table->segments, segment_index, (intptr_t **) &segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, segment_index ); return( -1 ); } if( segment == NULL ) { if( libmfdata_segment_initialize( &segment, segment_table, segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_segment_table->segments, segment_index, (intptr_t *) segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment: %d in segments array.", function, segment_index ); libmfdata_segment_free( &segment, NULL ); return( -1 ); } } else { if( libmfdata_segment_get_range( segment, &previous_file_io_pool_entry, &previous_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, segment_index ); return( -1 ); } internal_segment_table->value_size -= previous_segment_size; } if( libmfdata_segment_set_range( segment, file_io_pool_entry, segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment range: %d.", function, segment_index ); return( -1 ); } internal_segment_table->value_size += segment_size; internal_segment_table->flags |= LIBMFDATA_SEGMENT_TABLE_FLAG_CALCULATE_VALUE_OFFSETS; return( 1 ); } /* Appends a segment file IO pool entry and size * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_append_segment( libmfdata_segment_table_t *segment_table, int *segment_index, int file_io_pool_entry, size64_t segment_size, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; libmfdata_segment_t *segment = NULL; static char *function = "libmfdata_segment_table_append_segment"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libmfdata_segment_initialize( &segment, segment_table, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment.", function ); return( -1 ); } if( libmfdata_segment_set_range( segment, file_io_pool_entry, segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment range.", function ); libmfdata_segment_free( &segment, NULL ); return( -1 ); } if( libmfdata_segment_set_value_offset( segment, internal_segment_table->value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment data offset.", function ); libmfdata_segment_free( &segment, NULL ); return( -1 ); } if( libcdata_array_append_entry( internal_segment_table->segments, segment_index, (intptr_t *) segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment to segments array.", function ); libmfdata_segment_free( &segment, NULL ); return( -1 ); } if( libmfdata_segment_set_segment_index( segment, *segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment index.", function ); return( -1 ); } internal_segment_table->value_size += segment_size; return( 1 ); } /* Reads segment data into a buffer * Returns the number of bytes read or -1 on error */ ssize_t libmfdata_segment_table_read_segment_data( intptr_t *io_handle LIBMFDATA_ATTRIBUTE_UNUSED, libbfio_handle_t *file_io_handle, int segment_index LIBMFDATA_ATTRIBUTE_UNUSED, uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ) { static char *function = "libmfdata_segment_table_read_segment_data"; ssize_t read_count = 0; LIBMFDATA_UNREFERENCED_PARAMETER( io_handle ) LIBMFDATA_UNREFERENCED_PARAMETER( segment_index ) read_count = libbfio_handle_read_buffer( file_io_handle, segment_data, segment_data_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment data.", function ); return( -1 ); } return( read_count ); } /* Writes segment data from a buffer * Returns the number of bytes written or -1 on error */ ssize_t libmfdata_segment_table_write_segment_data( intptr_t *io_handle LIBMFDATA_ATTRIBUTE_UNUSED, libbfio_handle_t *file_io_handle, int segment_index LIBMFDATA_ATTRIBUTE_UNUSED, const uint8_t *segment_data, size_t segment_data_size, libcerror_error_t **error ) { static char *function = "libmfdata_segment_table_write_segment_data"; ssize_t write_count = 0; LIBMFDATA_UNREFERENCED_PARAMETER( io_handle ) LIBMFDATA_UNREFERENCED_PARAMETER( segment_index ) write_count = libbfio_handle_write_buffer( file_io_handle, segment_data, segment_data_size, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write segment data.", function ); return( -1 ); } return( write_count ); } /* Seeks a certain segment offset * Returns the offset or -1 on error */ off64_t libmfdata_segment_table_seek_segment_offset( intptr_t *io_handle LIBMFDATA_ATTRIBUTE_UNUSED, libbfio_handle_t *file_io_handle, int segment_index LIBMFDATA_ATTRIBUTE_UNUSED, off64_t segment_offset, int whence, libcerror_error_t **error ) { static char *function = "libmfdata_segment_table_seek_segment_offset"; LIBMFDATA_UNREFERENCED_PARAMETER( io_handle ) LIBMFDATA_UNREFERENCED_PARAMETER( segment_index ) segment_offset = libbfio_handle_seek_offset( file_io_handle, segment_offset, whence, error ); if( segment_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek segment offset.", function ); return( -1 ); } return( segment_offset ); } /* Reads a buffer * Returns the number of bytes read or -1 on error */ ssize_t libmfdata_segment_table_read_buffer( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libmfdata_internal_segment_table_t *internal_segment_table = NULL; libmfdata_segment_t *segment = NULL; static char *function = "libmfdata_segment_table_read_buffer"; off64_t segment_offset = 0; size64_t file_io_handle_size = 0; size64_t segment_size = 0; size_t buffer_offset = 0; size_t read_size = 0; ssize_t read_count = 0; int file_io_pool_entry = 0; int number_of_segments = 0; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( internal_segment_table->value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment table - value offset value out of bounds.", function ); return( -1 ); } if( internal_segment_table->read_segment_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid segment table - missing read segment data function.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( buffer_size == 0 ) { return( 0 ); } /* Do not read beyond the value size */ if( (size64_t) internal_segment_table->value_offset >= internal_segment_table->value_size ) { return( 0 ); } if( libcdata_array_get_number_of_entries( internal_segment_table->segments, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of entries from segments array.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_segment_table->segments, internal_segment_table->segment_index, (intptr_t **) &segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, internal_segment_table->segment_index ); return( -1 ); } if( libmfdata_segment_get_range( segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, internal_segment_table->segment_index ); return( -1 ); } while( buffer_size > 0 ) { if( libbfio_pool_get_handle( file_io_pool, file_io_pool_entry, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO pool entry: %d from pool.", function, file_io_pool_entry ); return( -1 ); } if( libbfio_handle_get_offset( file_io_handle, &segment_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset from file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } if( libbfio_handle_get_size( file_io_handle, &file_io_handle_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size from file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } if( segment_offset > (off64_t) file_io_handle_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: file IO pool entry offset exceeds file IO pool entry size.", function ); return( -1 ); } read_size = buffer_size; if( ( (size64_t) read_size + (size64_t) segment_offset ) > segment_size ) { read_size = (size_t) ( segment_size - segment_offset ); } if( read_size == 0 ) { break; } read_count = internal_segment_table->read_segment_data( internal_segment_table->io_handle, file_io_handle, internal_segment_table->segment_index, &( buffer[ buffer_offset ] ), read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read data from segment: %d.", function, internal_segment_table->segment_index ); return( -1 ); } internal_segment_table->value_offset += (off64_t) read_count; if( ( (size64_t) segment_offset + (size64_t) read_count ) == segment_size ) { internal_segment_table->segment_index += 1; if( internal_segment_table->segment_index < number_of_segments ) { if( libcdata_array_get_entry_by_index( internal_segment_table->segments, internal_segment_table->segment_index, (intptr_t **) &segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, internal_segment_table->segment_index ); return( -1 ); } if( libmfdata_segment_get_range( segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, internal_segment_table->segment_index ); return( -1 ); } if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, 0, SEEK_SET, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: 0 in file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } } } buffer_size -= (size_t) read_count; buffer_offset += (size_t) read_count; if( (size64_t) internal_segment_table->value_offset >= internal_segment_table->value_size ) { break; } } return( (ssize_t) buffer_offset ); } /* Writes a buffer * Returns the number of bytes written or -1 on error */ ssize_t libmfdata_segment_table_write_buffer( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libmfdata_internal_segment_table_t *internal_segment_table = NULL; libmfdata_segment_t *segment = NULL; static char *function = "libmfdata_segment_table_write_buffer"; off64_t segment_offset = 0; size64_t file_io_handle_size = 0; size64_t segment_size = 0; size64_t value_size = 0; size_t buffer_offset = 0; size_t write_size = 0; ssize_t write_count = 0; int file_io_pool_entry = 0; int number_of_segments = 0; int segment_index = 0; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( internal_segment_table->value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment table - value offset value out of bounds.", function ); return( -1 ); } if( internal_segment_table->write_segment_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid segment table - missing write segment data function.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( buffer_size == 0 ) { return( 0 ); } if( libcdata_array_get_number_of_entries( internal_segment_table->segments, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments from source segments array.", function ); return( -1 ); } while( buffer_size > 0 ) { if( internal_segment_table->segment_index >= number_of_segments ) { file_io_handle = NULL; if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); return( -1 ); } if( internal_segment_table->set_segment_name != NULL ) { if( internal_segment_table->set_segment_name( internal_segment_table->io_handle, file_io_handle, internal_segment_table->segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment name.", function ); libbfio_handle_free( &file_io_handle, NULL ); return( -1 ); } } if( libbfio_pool_append_handle( file_io_pool, &file_io_pool_entry, file_io_handle, LIBBFIO_OPEN_WRITE_TRUNCATE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle to pool.", function ); libbfio_handle_free( &file_io_handle, NULL ); return( -1 ); } if( libbfio_pool_open( file_io_pool, file_io_pool_entry, LIBBFIO_OPEN_WRITE_TRUNCATE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } file_io_handle = NULL; if( libmfdata_segment_table_append_segment( segment_table, &segment_index, file_io_pool_entry, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment: %d.", function, number_of_segments ); return( -1 ); } number_of_segments++; } if( libcdata_array_get_entry_by_index( internal_segment_table->segments, internal_segment_table->segment_index, (intptr_t **) &segment, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d from segments array.", function, internal_segment_table->segment_index ); return( -1 ); } if( libmfdata_segment_get_range( segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, internal_segment_table->segment_index ); return( -1 ); } if( libbfio_pool_get_handle( file_io_pool, file_io_pool_entry, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO pool entry: %d from pool.", function, file_io_pool_entry ); return( -1 ); } if( libbfio_handle_get_offset( file_io_handle, &segment_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset from file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } if( libbfio_handle_get_size( file_io_handle, &file_io_handle_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size from file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } write_size = buffer_size; value_size = (size64_t) write_size + (size64_t) segment_offset; if( ( internal_segment_table->maximum_segment_size != 0 ) && ( value_size >= internal_segment_table->maximum_segment_size ) ) { write_size = (size_t) ( internal_segment_table->maximum_segment_size - segment_offset ); } if( write_size == 0 ) { break; } write_count = internal_segment_table->write_segment_data( internal_segment_table->io_handle, file_io_handle, internal_segment_table->segment_index, &( buffer[ buffer_offset ] ), write_size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data to segment: %d.", function, internal_segment_table->segment_index ); return( -1 ); } internal_segment_table->value_offset += (off64_t) write_count; if( libmfdata_segment_set_range( segment, file_io_pool_entry, segment_size + write_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment range: %d.", function, segment_index ); return( -1 ); } value_size = (size64_t) write_count + (size64_t) segment_offset; if( ( internal_segment_table->maximum_segment_size != 0 ) && ( value_size >= internal_segment_table->maximum_segment_size ) ) { internal_segment_table->segment_index += 1; } if( value_size > internal_segment_table->value_size ) { internal_segment_table->value_size = value_size; } buffer_size -= write_count; buffer_offset += write_count; } return( (ssize_t) buffer_offset ); } /* Seeks a certain offset * Returns the offset or -1 on error */ off64_t libmfdata_segment_table_seek_offset( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, off64_t offset, int whence, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libmfdata_internal_segment_table_t *internal_segment_table = NULL; libmfdata_segment_t *segment = NULL; static char *function = "libmfdata_segment_table_seek_offset"; off64_t segment_offset = 0; size64_t segment_size = 0; int file_io_pool_entry = 0; int segment_index = 0; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( internal_segment_table->seek_segment_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid segment table - missing seek segment offset function.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( whence == SEEK_CUR ) { offset += internal_segment_table->value_offset; } else if( whence == SEEK_END ) { offset += (off64_t) internal_segment_table->value_size; } if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } if( offset < (off64_t) internal_segment_table->value_size ) { if( libmfdata_segment_table_get_segment_at_value_offset( segment_table, offset, &segment_index, &segment, &segment_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment for value offset: %" PRIi64 ".", function, offset ); return( -1 ); } if( libmfdata_segment_get_range( segment, &file_io_pool_entry, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment range: %d.", function, internal_segment_table->segment_index ); return( -1 ); } if( libbfio_pool_get_handle( file_io_pool, file_io_pool_entry, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO pool entry: %d from pool.", function, file_io_pool_entry ); return( -1 ); } if( internal_segment_table->seek_segment_offset( internal_segment_table->io_handle, file_io_handle, segment_index, segment_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek data offset: %" PRIi64 " in file IO pool entry: %d.", function, segment_offset, file_io_pool_entry ); return( -1 ); } } else { if( libcdata_array_get_number_of_entries( internal_segment_table->segments, &segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of entries from segments array.", function ); return( -1 ); } } internal_segment_table->segment_index = segment_index; internal_segment_table->value_offset = offset; return( offset ); } /* Retrieves the file IO handle of the segment file at the current offset * Returns 1 if successful or -1 on error */ int libmfdata_segment_table_get_file_io_handle( libmfdata_segment_table_t *segment_table, libbfio_pool_t *file_io_pool, libbfio_handle_t **file_io_handle, libcerror_error_t **error ) { libmfdata_internal_segment_table_t *internal_segment_table = NULL; static char *function = "libmfdata_segment_table_get_file_io_handle"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } internal_segment_table = (libmfdata_internal_segment_table_t *) segment_table; if( libbfio_pool_get_handle( file_io_pool, internal_segment_table->segment_index, file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for pool entry: %d (offset: %" PRIi64 ").", function, internal_segment_table->segment_index, internal_segment_table->value_offset ); return( -1 ); } return( 1 ); } libewf-20140807/libsmraw/0000775000175000017500000000000013443455446017165 5ustar00lordyestalordyesta00000000000000libewf-20140807/libsmraw/libsmraw_libbfio.h0000664000175000017500000000325113443450067022637 0ustar00lordyestalordyesta00000000000000/* * The libbfio header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBBFIO_H ) #define _LIBSMRAW_LIBBFIO_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT * before including libbfio.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBBFIO_DLL_IMPORT #endif #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) #error Multi-threading support requires libbfio with multi-threading support #endif #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ #endif /* !defined( _LIBSMRAW_LIBBFIO_H ) */ libewf-20140807/libsmraw/libsmraw_support.h0000664000175000017500000000704213443450067022747 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_SUPPORT_H ) #define _LIBSMRAW_SUPPORT_H #include #include #include "libsmraw_extern.h" #include "libsmraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMRAW ) LIBSMRAW_EXTERN \ const char *libsmraw_get_version( void ); LIBSMRAW_EXTERN \ int libsmraw_get_access_flags_read( void ); LIBSMRAW_EXTERN \ int libsmraw_get_access_flags_read_write( void ); LIBSMRAW_EXTERN \ int libsmraw_get_access_flags_write( void ); LIBSMRAW_EXTERN \ int libsmraw_get_codepage( int *codepage, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ int libsmraw_glob_append_segment_file( char **filenames[], int *number_of_filenames, const char *segment_filename, libcerror_error_t **error ); int libsmraw_glob_exists_segment_file( libbfio_handle_t *file_io_handle, const char *prefix, size_t prefix_length, const char *suffix, size_t suffix_length, char **segment_filename, size_t *segment_filename_size, libcerror_error_t **error ); int libsmraw_glob_determine_naming_schema( const char *suffix, size_t suffix_length, uint8_t *naming_schema, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_glob( const char *filename, size_t filename_length, char **filenames[], int *number_of_filenames, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_glob_free( char *filenames[], int number_of_filenames, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libsmraw_glob_wide_append_segment_file( wchar_t **filenames[], int *number_of_filenames, const wchar_t *segment_filename, libcerror_error_t **error ); int libsmraw_glob_wide_exists_segment_file( libbfio_handle_t *file_io_handle, const wchar_t *prefix, size_t prefix_length, const wchar_t *suffix, size_t suffix_length, wchar_t **segment_filename, size_t *segment_filename_size, libcerror_error_t **error ); int libsmraw_glob_wide_determine_naming_schema( const wchar_t *suffix, size_t suffix_length, uint8_t *naming_schema, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_glob_wide( const wchar_t *filename, size_t filename_length, wchar_t **filenames[], int *number_of_filenames, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_glob_wide_free( wchar_t *filenames[], int number_of_filenames, libcerror_error_t **error ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_SUPPORT_H ) */ libewf-20140807/libsmraw/libsmraw_error.h0000664000175000017500000000340513443450067022363 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_INTERNAL_ERROR_H ) #define _LIBSMRAW_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBSMRAW ) #include #endif #include "libsmraw_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMRAW ) LIBSMRAW_EXTERN \ void libsmraw_error_free( libsmraw_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_error_fprint( libsmraw_error_t *error, FILE *stream ); LIBSMRAW_EXTERN \ int libsmraw_error_sprint( libsmraw_error_t *error, char *string, size_t size ); LIBSMRAW_EXTERN \ int libsmraw_error_backtrace_fprint( libsmraw_error_t *error, FILE *stream ); LIBSMRAW_EXTERN \ int libsmraw_error_backtrace_sprint( libsmraw_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_INTERNAL_ERROR_H ) */ libewf-20140807/libsmraw/libsmraw_error.c0000664000175000017500000000554013443450067022360 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libsmraw_error.h" #include "libsmraw_libcerror.h" #if !defined( HAVE_LOCAL_LIBSMRAW ) /* Free an error and its elements */ void libsmraw_error_free( libsmraw_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libsmraw_error_fprint( libsmraw_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libsmraw_error_sprint( libsmraw_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libsmraw_error_backtrace_fprint( libsmraw_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libsmraw_error_backtrace_sprint( libsmraw_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ libewf-20140807/libsmraw/libsmraw_handle.c0000664000175000017500000043710113443450067022464 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include #include "libsmraw_definitions.h" #include "libsmraw_handle.h" #include "libsmraw_information_file.h" #include "libsmraw_io_handle.h" #include "libsmraw_libbfio.h" #include "libsmraw_libcerror.h" #include "libsmraw_libcnotify.h" #include "libsmraw_libcthreads.h" #include "libsmraw_libfdata.h" #include "libsmraw_libfvalue.h" #include "libsmraw_libuna.h" #include "libsmraw_types.h" /* Creates a handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmraw_handle_initialize( libsmraw_handle_t **handle, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } internal_handle = memory_allocate_structure( libsmraw_internal_handle_t ); if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create internal handle.", function ); goto on_error; } if( memory_set( internal_handle, 0, sizeof( libsmraw_internal_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear handle.", function ); memory_free( internal_handle ); return( -1 ); } if( libsmraw_io_handle_initialize( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create IO handle.", function ); goto on_error; } if( libfvalue_table_initialize( &( internal_handle->media_values ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create media values table.", function ); goto on_error; } if( libfvalue_table_initialize( &( internal_handle->information_values ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create information values table.", function ); goto on_error; } if( libfvalue_table_initialize( &( internal_handle->integrity_hash_values ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create integrity hash values table.", function ); goto on_error; } #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_initialize( &( internal_handle->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to intialize read/write lock.", function ); goto on_error; } #endif internal_handle->maximum_number_of_open_handles = LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES; *handle = (libsmraw_handle_t *) internal_handle; return( 1 ); on_error: if( internal_handle != NULL ) { if( internal_handle->integrity_hash_values != NULL ) { libfvalue_table_free( &( internal_handle->integrity_hash_values ), NULL ); } if( internal_handle->information_values != NULL ) { libfvalue_table_free( &( internal_handle->information_values ), NULL ); } if( internal_handle->media_values != NULL ) { libfvalue_table_free( &( internal_handle->media_values ), NULL ); } if( internal_handle->io_handle != NULL ) { libsmraw_io_handle_free( &( internal_handle->io_handle ), NULL ); } memory_free( internal_handle ); } return( -1 ); } /* Frees a handle * Returns 1 if succesful or -1 on error */ int libsmraw_handle_free( libsmraw_handle_t **handle, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_internal_handle_free"; int result = 1; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { internal_handle = (libsmraw_internal_handle_t *) *handle; if( internal_handle->file_io_pool != NULL ) { if( libsmraw_handle_close( *handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); result = -1; } } *handle = NULL; #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_free( &( internal_handle->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( libsmraw_io_handle_free( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } if( libfvalue_table_free( &( internal_handle->media_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free media values table.", function ); result = -1; } if( libfvalue_table_free( &( internal_handle->information_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free information values table.", function ); result = -1; } if( libfvalue_table_free( &( internal_handle->integrity_hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free integrity hash values table.", function ); result = -1; } memory_free( internal_handle ); } return( result ); } /* Signals the handle to abort its current activity * Returns 1 if successful or -1 on error */ int libsmraw_handle_signal_abort( libsmraw_handle_t *handle, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_signal_abort"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } internal_handle->io_handle->abort = 1; return( 1 ); } /* Initializes the write values * Returns 1 if successful or -1 on error */ int libsmraw_internal_handle_initialize_write_values( libsmraw_internal_handle_t *internal_handle, libcerror_error_t **error ) { static char *function = "libsmraw_internal_handle_initialize_write_values"; size64_t last_segment_size = 0; size64_t number_of_segments = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->write_values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: write values were initialized and cannot be initialized anymore.", function ); return( -1 ); } if( internal_handle->io_handle->maximum_segment_size == 0 ) { internal_handle->io_handle->number_of_segments = 1; } else if( internal_handle->io_handle->media_size == 0 ) { internal_handle->io_handle->number_of_segments = 0; } else { number_of_segments = internal_handle->io_handle->media_size / internal_handle->io_handle->maximum_segment_size; last_segment_size = internal_handle->io_handle->media_size % internal_handle->io_handle->maximum_segment_size; if( last_segment_size != 0 ) { number_of_segments += 1; } if( number_of_segments > (size64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segments value out of bounds.", function ); return( -1 ); } internal_handle->io_handle->number_of_segments = (int) number_of_segments; } internal_handle->write_values_initialized = 1; return( 1 ); } /* Opens a set of storage media RAW files * Returns 1 if successful or -1 on error */ int libsmraw_handle_open( libsmraw_handle_t *handle, char * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libbfio_pool_t *file_io_pool = NULL; libsmraw_internal_handle_t *internal_handle = NULL; system_character_t *information_filename = NULL; static char *function = "libsmraw_handle_open"; size_t filename_index = 0; size_t filename_length = 0; size_t information_filename_length = 0; int bfio_access_flags = 0; int filename_iterator = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - file IO pool value already set.", function ); return( -1 ); } if( internal_handle->information_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - information file value already set.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of filenames value out of bounds.", function ); return( -1 ); } if( ( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } /* Open for read only or read/write */ if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { bfio_access_flags |= LIBBFIO_ACCESS_FLAG_READ; } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { bfio_access_flags |= LIBBFIO_ACCESS_FLAG_WRITE; } /* Set the basename */ filename_length = narrow_string_length( filenames[ 0 ] ); if( filename_length <= 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing basename.", function ); goto on_error; } if( libsmraw_io_handle_set_basename( internal_handle->io_handle, filenames[ 0 ], filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set basename.", function ); goto on_error; } if( libbfio_pool_initialize( &file_io_pool, number_of_filenames, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO pool.", function ); goto on_error; } for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { filename_length = narrow_string_length( filenames[ filename_iterator ] ); if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing filename: %d.", function, filename_iterator ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle: %d.", function, filename_iterator ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle: %d.", function, filename_iterator ); goto on_error; } #endif if( libbfio_file_set_name( file_io_handle, filenames[ filename_iterator ], filename_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle: %d.", function, filename_iterator ); goto on_error; } if( libbfio_pool_set_handle( file_io_pool, filename_iterator, file_io_handle, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file IO handle: %d in pool.", function, filename_iterator ); goto on_error; } file_io_handle = NULL; } } /* Open for write only */ else if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { /* Set the basename */ filename_length = narrow_string_length( filenames[ 0 ] ); if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing basename.", function ); goto on_error; } if( libsmraw_io_handle_set_basename( internal_handle->io_handle, filenames[ 0 ], filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set basename.", function ); goto on_error; } /* Initialize the file IO pool */ if( libbfio_pool_initialize( &file_io_pool, 0, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO pool.", function ); goto on_error; } } if( libsmraw_handle_open_file_io_pool( handle, file_io_pool, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle using file IO pool.", function ); goto on_error; } file_io_pool = NULL; /* Open the information file */ if( internal_handle->io_handle->basename != NULL ) { information_filename_length = internal_handle->io_handle->basename_size + 9; information_filename = system_string_allocate( information_filename_length + 1 ); if( information_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create information filename.", function ); goto on_error; } if( system_string_copy( information_filename, internal_handle->io_handle->basename, internal_handle->io_handle->basename_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy basename to information filename.", function ); goto on_error; } filename_index = internal_handle->io_handle->basename_size - 1; if( system_string_copy( &( information_filename[ filename_index ] ), _SYSTEM_STRING( ".raw.info" ), 9 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy extension to information filename.", function ); goto on_error; } filename_index += 9; information_filename[ filename_index ] = 0; if( libsmraw_information_file_initialize( &( internal_handle->information_file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create information file.", function ); goto on_error; } information_filename_length = system_string_length( information_filename ); if( libsmraw_information_file_set_name( internal_handle->information_file, information_filename, information_filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to set information filename.", function ); goto on_error; } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { if( libsmraw_handle_read_information_file( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read information file.", function ); goto on_error; } } memory_free( information_filename ); information_filename = NULL; if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { internal_handle->write_information_on_close = 1; } } internal_handle->file_io_pool_created_in_library = 1; return( 1 ); on_error: if( information_filename != NULL ) { memory_free( information_filename ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( file_io_pool != NULL ) { libbfio_pool_free( &file_io_pool, NULL ); } if( internal_handle->information_file != NULL ) { libsmraw_information_file_initialize( &( internal_handle->information_file ), NULL ); } if( internal_handle->file_io_pool != NULL ) { libbfio_pool_free( &( internal_handle->file_io_pool ), NULL ); } libsmraw_io_handle_clear( internal_handle->io_handle, NULL ); return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of storage media RAW files * Returns 1 if successful or -1 on error */ int libsmraw_handle_open_wide( libsmraw_handle_t *handle, wchar_t * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libbfio_pool_t *file_io_pool = NULL; libsmraw_internal_handle_t *internal_handle = NULL; system_character_t *information_filename = NULL; static char *function = "libsmraw_handle_open_wide"; size_t filename_index = 0; size_t filename_length = 0; size_t information_filename_length = 0; int bfio_access_flags = 0; int filename_iterator = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - file IO pool value already set.", function ); return( -1 ); } if( internal_handle->information_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - information file value already set.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of filenames value out of bounds.", function ); return( -1 ); } if( ( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } /* Open for read only or read/write */ if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { bfio_access_flags |= LIBBFIO_ACCESS_FLAG_READ; } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { bfio_access_flags |= LIBBFIO_ACCESS_FLAG_WRITE; } /* Set the basename */ filename_length = wide_string_length( filenames[ 0 ] ); if( filename_length <= 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing basename.", function ); goto on_error; } if( libsmraw_io_handle_set_basename_wide( internal_handle->io_handle, filenames[ 0 ], filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set basename.", function ); goto on_error; } if( libbfio_pool_initialize( &file_io_pool, number_of_filenames, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO pool.", function ); goto on_error; } for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { filename_length = wide_string_length( filenames[ filename_iterator ] ); if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing filename: %d.", function, filename_iterator ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle: %d.", function, filename_iterator ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle: %d.", function, filename_iterator ); goto on_error; } #endif if( libbfio_file_set_name_wide( file_io_handle, filenames[ filename_iterator ], filename_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle: %d.", function, filename_iterator ); goto on_error; } if( libbfio_pool_set_handle( file_io_pool, filename_iterator, file_io_handle, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file IO handle: %d in pool.", function, filename_iterator ); goto on_error; } file_io_handle = NULL; } } /* Open for write only */ else if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { /* Set the basename */ filename_length = wide_string_length( filenames[ 0 ] ); if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing basename.", function ); goto on_error; } if( libsmraw_io_handle_set_basename_wide( internal_handle->io_handle, filenames[ 0 ], filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set basename.", function ); goto on_error; } /* Initialize the file IO pool */ if( libbfio_pool_initialize( &file_io_pool, 0, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO pool.", function ); goto on_error; } } if( libsmraw_handle_open_file_io_pool( handle, file_io_pool, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle using file IO pool.", function ); goto on_error; } file_io_pool = NULL; /* Open the information file */ if( internal_handle->io_handle->basename != NULL ) { information_filename_length = internal_handle->io_handle->basename_size + 9; information_filename = system_string_allocate( information_filename_length + 1 ); if( information_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create information filename.", function ); goto on_error; } if( system_string_copy( information_filename, internal_handle->io_handle->basename, internal_handle->io_handle->basename_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy basename to information filename.", function ); goto on_error; } filename_index = internal_handle->io_handle->basename_size - 1; if( system_string_copy( &( information_filename[ filename_index ] ), _SYSTEM_STRING( ".raw.info" ), 9 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy extension to information filename.", function ); goto on_error; } filename_index += 9; information_filename[ filename_index ] = 0; if( libsmraw_information_file_initialize( &( internal_handle->information_file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create information file.", function ); goto on_error; } information_filename_length = system_string_length( information_filename ); if( libsmraw_information_file_set_name( internal_handle->information_file, information_filename, information_filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to set information filename.", function ); goto on_error; } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { if( libsmraw_handle_read_information_file( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read information file.", function ); goto on_error; } } memory_free( information_filename ); information_filename = NULL; if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { internal_handle->write_information_on_close = 1; } } internal_handle->file_io_pool_created_in_library = 1; return( 1 ); on_error: if( information_filename != NULL ) { memory_free( information_filename ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( file_io_pool != NULL ) { libbfio_pool_free( &file_io_pool, NULL ); } if( internal_handle->information_file != NULL ) { libsmraw_information_file_initialize( &( internal_handle->information_file ), NULL ); } if( internal_handle->file_io_pool != NULL ) { libbfio_pool_free( &( internal_handle->file_io_pool ), NULL ); } libsmraw_io_handle_clear( internal_handle->io_handle, NULL ); return( -1 ); } #endif /* Opens a set of storage media RAW files using a Basic File IO (bfio) pool * Returns 1 if successful or -1 on error */ int libsmraw_handle_open_file_io_pool( libsmraw_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_open_file_io_pool"; size64_t file_io_handle_size = 0; int number_of_file_io_handles = 0; int bfio_access_flags = 0; int file_io_handle_index = 0; int file_io_handle_is_open = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - file IO pool value already set.", function ); return( -1 ); } if( file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool.", function ); return( -1 ); } if( ( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( libbfio_pool_get_number_of_handles( file_io_pool, &number_of_file_io_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of handles in the file IO pool.", function ); goto on_error; } if( libfdata_stream_initialize( &( internal_handle->segments_stream ), (intptr_t *) internal_handle->io_handle, NULL, NULL, (int (*)(intptr_t *, intptr_t *, int, int *, off64_t *, size64_t *, uint32_t *, libcerror_error_t **)) &libsmraw_io_handle_create_segment, (ssize_t (*)(intptr_t *, intptr_t *, int, int, uint8_t *, size_t, uint32_t, uint8_t, libcerror_error_t **)) &libsmraw_io_handle_read_segment_data, (ssize_t (*)(intptr_t *, intptr_t *, int, int, const uint8_t *, size_t, uint32_t, uint8_t, libcerror_error_t **)) &libsmraw_io_handle_write_segment_data, (off64_t (*)(intptr_t *, intptr_t *, int, int, off64_t, libcerror_error_t **)) &libsmraw_io_handle_seek_segment_offset, LIBFDATA_DATA_HANDLE_FLAG_NON_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segments stream.", function ); goto on_error; } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) != 0 ) { if( number_of_file_io_handles <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing file IO handles.", function ); goto on_error; } if( libfdata_stream_resize( internal_handle->segments_stream, number_of_file_io_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize segments stream.", function ); goto on_error; } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { bfio_access_flags = LIBBFIO_OPEN_READ_WRITE; } else { bfio_access_flags = LIBBFIO_OPEN_READ; } for( file_io_handle_index = 0; file_io_handle_index < number_of_file_io_handles; file_io_handle_index++ ) { if( libbfio_pool_get_handle( file_io_pool, file_io_handle_index, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to retrieve file IO handle from pool entry: %d.", function, file_io_handle_index ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: processing pool entry: %d.\n", function, file_io_handle_index ); } #endif file_io_handle_is_open = libbfio_handle_is_open( file_io_handle, error ); if( file_io_handle_is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to determine if file IO handle is open.", function ); goto on_error; } else if( file_io_handle_is_open == 0 ) { if( libbfio_pool_open( file_io_pool, file_io_handle_index, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open pool entry: %d.", function, file_io_handle_index ); goto on_error; } } if( libbfio_pool_get_size( file_io_pool, file_io_handle_index, &file_io_handle_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file size for pool entry: %d.", function, file_io_handle_index ); goto on_error; } if( libfdata_stream_set_segment_by_index( internal_handle->segments_stream, file_io_handle_index, file_io_handle_index, 0, file_io_handle_size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment: %d in segments stream.", function, file_io_handle_index ); goto on_error; } if( file_io_handle_index == 0 ) { internal_handle->io_handle->maximum_segment_size = file_io_handle_size; } else if( file_io_handle_size > internal_handle->io_handle->maximum_segment_size ) { internal_handle->io_handle->maximum_segment_size = file_io_handle_size; } } if( libfdata_stream_get_size( internal_handle->segments_stream, &( internal_handle->io_handle->media_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size from segments stream.", function ); goto on_error; } internal_handle->read_values_initialized = 1; } internal_handle->file_io_pool = file_io_pool; return( 1 ); on_error: if( internal_handle->segments_stream != NULL ) { libfdata_stream_free( &( internal_handle->segments_stream ), NULL ); } internal_handle->read_values_initialized = 0; return( -1 ); } /* Read an information file using a Basic File IO (bfio) handle * Returns 1 if successful or -1 on error */ int libsmraw_handle_read_information_file( libsmraw_internal_handle_t *internal_handle, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libsmraw_handle_read_information_file"; int result = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing information file.", function ); return( -1 ); } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbfio_file_set_name_wide( file_io_handle, internal_handle->information_file->name, internal_handle->information_file->name_size - 1, error ) != 1 ) #else if( libbfio_file_set_name( file_io_handle, internal_handle->information_file->name, internal_handle->information_file->name_size - 1, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } result = libbfio_handle_exists( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if information filename exists.", function ); goto on_error; } if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } /* Only read the information file if it exists */ if( result == 1 ) { if( libsmraw_information_file_open( internal_handle->information_file, internal_handle->information_file->name, LIBSMRAW_OPEN_READ, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open information file.", function ); goto on_error; } if( libsmraw_information_file_read_section( internal_handle->information_file, (uint8_t *) "media_values", 12, internal_handle->media_values, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read media values from information file.", function ); libsmraw_information_file_close( internal_handle->information_file, NULL ); goto on_error; } if( libsmraw_information_file_read_section( internal_handle->information_file, (uint8_t *) "information_values", 18, internal_handle->information_values, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read information values from information file.", function ); libsmraw_information_file_close( internal_handle->information_file, NULL ); goto on_error; } if( libsmraw_information_file_read_section( internal_handle->information_file, (uint8_t *) "integrity_hash_values", 21, internal_handle->integrity_hash_values, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read integrity hash values from information file.", function ); libsmraw_information_file_close( internal_handle->information_file, NULL ); goto on_error; } if( libsmraw_information_file_close( internal_handle->information_file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to close information file.", function ); goto on_error; } } return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Closes a RAW handle * Returns the 0 if succesful or -1 on error */ int libsmraw_handle_close( libsmraw_handle_t *handle, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_close"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->write_information_on_close != 0 ) { if( libsmraw_information_file_open( internal_handle->information_file, internal_handle->information_file->name, LIBSMRAW_OPEN_WRITE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open information file.", function ); return( -1 ); } if( libsmraw_information_file_write_section( internal_handle->information_file, (uint8_t *) "information_values", 18, internal_handle->information_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write information values to information file.", function ); return( -1 ); } if( libsmraw_information_file_write_section( internal_handle->information_file, (uint8_t *) "integrity_hash_values", 21, internal_handle->integrity_hash_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write integrity hash values to information file.", function ); return( -1 ); } if( libsmraw_information_file_close( internal_handle->information_file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close information file.", function ); result = -1; } } if( libfdata_stream_free( &( internal_handle->segments_stream ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free segments stream.", function ); result = -1; } if( internal_handle->file_io_pool_created_in_library != 0 ) { if( internal_handle->file_io_pool != NULL ) { if( libbfio_pool_close_all( internal_handle->file_io_pool, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable close file IO pool.", function ); result = -1; } if( libbfio_pool_free( &( internal_handle->file_io_pool ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file IO pool.", function ); result = -1; } } internal_handle->file_io_pool_created_in_library = 0; } internal_handle->file_io_pool = NULL; internal_handle->read_values_initialized = 0; internal_handle->write_values_initialized = 0; if( libsmraw_io_handle_clear( internal_handle->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear IO handle.", function ); result = -1; } if( internal_handle->information_file != NULL ) { if( libsmraw_information_file_free( &( internal_handle->information_file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free information file.", function ); result = -1; } } return( result ); } /* Reads a buffer * Returns the number of bytes read or -1 on error */ ssize_t libsmraw_handle_read_buffer( libsmraw_handle_t *handle, void *buffer, size_t buffer_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_read_buffer"; off64_t current_offset = 0; ssize_t read_count = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file IO pool.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( internal_handle->io_handle->media_size == 0 ) { return( 0 ); } #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libfdata_stream_get_offset( internal_handle->segments_stream, ¤t_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset from segments stream.", function ); goto on_error; } if( current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current offset value out of bounds.", function ); goto on_error; } /* Bail out early for requests to read beyond the media size */ if( (size64_t) current_offset >= internal_handle->io_handle->media_size ) { buffer_size = 0; } else if( ( (size64_t) current_offset + buffer_size ) >= internal_handle->io_handle->media_size ) { buffer_size = (size_t) ( internal_handle->io_handle->media_size - (size64_t) current_offset ); } if( buffer_size > 0 ) { read_count = libfdata_stream_read_buffer( internal_handle->segments_stream, (intptr_t *) internal_handle->file_io_pool, (uint8_t *) buffer, buffer_size, 0, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from segments stream.", function ); goto on_error; } } #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( read_count ); on_error: #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Reads (media) data at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t libsmraw_handle_read_buffer_at_offset( libsmraw_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libsmraw_handle_read_buffer_at_offset"; ssize_t read_count = 0; if( libsmraw_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } read_count = libsmraw_handle_read_buffer( handle, buffer, buffer_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } return( read_count ); } /* Writes a buffer * Returns the number of bytes written or -1 on error */ ssize_t libsmraw_handle_write_buffer( libsmraw_handle_t *handle, const void *buffer, size_t buffer_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_write_buffer"; off64_t current_offset = 0; ssize_t write_count = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file IO pool.", function ); return( -1 ); } if( internal_handle->write_values_initialized == 0 ) { if( libsmraw_internal_handle_initialize_write_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize write values.", function ); return( -1 ); } } /* Bail out early for requests to write empty buffers */ if( buffer_size == 0 ) { return( 0 ); } if( libfdata_stream_get_offset( internal_handle->segments_stream, ¤t_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset from segments stream.", function ); return( -1 ); } if( current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current offset value out of bounds.", function ); return( -1 ); } if( internal_handle->io_handle->media_size > 0 ) { /* Bail out early for requests to write beyond the media size */ if( (size64_t) current_offset >= internal_handle->io_handle->media_size ) { return( 0 ); } if( ( (size64_t) current_offset + buffer_size ) >= internal_handle->io_handle->media_size ) { buffer_size = (size_t) ( internal_handle->io_handle->media_size - (size64_t) current_offset ); } } write_count = libfdata_stream_write_buffer( internal_handle->segments_stream, (intptr_t *) internal_handle->file_io_pool, (uint8_t *) buffer, buffer_size, 0, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write buffer to segments stream.", function ); return( -1 ); } return( write_count ); } /* Writes (media) data at a specific offset, * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libsmraw_handle_write_buffer_at_offset( libsmraw_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libsmraw_handle_write_buffer_at_offset"; ssize_t write_count = 0; if( libsmraw_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } write_count = libsmraw_handle_write_buffer( handle, buffer, buffer_size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write buffer.", function ); return( -1 ); } return( write_count ); } /* Seeks a certain offset * Returns the offset or -1 on error */ off64_t libsmraw_handle_seek_offset( libsmraw_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_seek_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file IO pool.", function ); return( -1 ); } offset = libfdata_stream_seek_offset( internal_handle->segments_stream, offset, whence, error ); if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek offset in segments stream.", function ); return( -1 ); } return( offset ); } /* Retrieves the current offset of the (media) data * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_offset( libsmraw_handle_t *handle, off64_t *offset, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( libfdata_stream_get_offset( internal_handle->segments_stream, offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset from segments stream.", function ); return( -1 ); } return( 1 ); } /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int libsmraw_handle_set_maximum_number_of_open_handles( libsmraw_handle_t *handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_set_maximum_number_of_open_handles"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool != NULL ) { if( libbfio_pool_set_maximum_number_of_open_handles( internal_handle->file_io_pool, maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in file IO handle.", function ); return( -1 ); } } internal_handle->maximum_number_of_open_handles = maximum_number_of_open_handles; return( 1 ); } /* Retrieves the segment filename size * The segment filename size includes the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_handle_get_segment_filename_size( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_segment_filename_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( libsmraw_io_handle_get_basename_size( internal_handle->io_handle, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve basename size from IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the segment filename * The segment filename size should include the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_handle_get_segment_filename( libsmraw_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_segment_filename"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( libsmraw_io_handle_get_basename( internal_handle->io_handle, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve basename from IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the segment filename * Returns 1 if succesful or -1 on error */ int libsmraw_handle_set_segment_filename( libsmraw_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_set_segment_filename"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->basename != NULL ) { if( internal_handle->file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: basename value already set: %" PRIs_SYSTEM ".", function, internal_handle->io_handle->basename ); return( -1 ); } } if( libsmraw_io_handle_set_basename( internal_handle->io_handle, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in IO handle.", function ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename size * The segment filename size includes the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_handle_get_segment_filename_size_wide( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_segment_filename_size_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( libsmraw_io_handle_get_basename_size_wide( internal_handle->io_handle, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve basename size from IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the segment filename * The segment filename size should include the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_handle_get_segment_filename_wide( libsmraw_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_segment_filename_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( libsmraw_io_handle_get_basename_wide( internal_handle->io_handle, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve basename from IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the segment filename * Returns 1 if succesful or -1 on error */ int libsmraw_handle_set_segment_filename_wide( libsmraw_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_set_segment_filename_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->basename != NULL ) { if( internal_handle->file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: basename value already set: %" PRIs_SYSTEM ".", function, internal_handle->io_handle->basename ); return( -1 ); } } if( libsmraw_io_handle_set_basename_wide( internal_handle->io_handle, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in IO handle.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Retrieves the segment file size * 0 represents the maximum possible segment file size * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_maximum_segment_size( libsmraw_handle_t *handle, size64_t *maximum_segment_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_maximum_segment_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( libsmraw_io_handle_get_maximum_segment_size( internal_handle->io_handle, maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve maximum segment size from IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the segment file size * 0 represents the maximum possible segment file size * Returns 1 if successful or -1 on error */ int libsmraw_handle_set_maximum_segment_size( libsmraw_handle_t *handle, size64_t maximum_segment_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_set_maximum_segment_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->write_values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: maximum segment size cannot be changed.", function ); return( -1 ); } if( libsmraw_io_handle_set_maximum_segment_size( internal_handle->io_handle, maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size in IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the filename size of the segment file of the current offset * The filename size should include the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_filename_size( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libsmraw_handle_get_filename_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmraw_handle_get_file_io_handle( handle, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current offset.", function ); return( -1 ); } if( libbfio_file_get_name_size( file_io_handle, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the filename of the segment file of the current offset * The filename size should include the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_filename( libsmraw_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libsmraw_handle_get_filename"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmraw_handle_get_file_io_handle( handle, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current offset.", function ); return( -1 ); } if( libbfio_file_get_name( file_io_handle, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename.", function ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the filename size of the segment file of the current offset * The filename size includes the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_filename_size_wide( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libsmraw_handle_get_filename_size_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmraw_handle_get_file_io_handle( handle, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current offset.", function ); return( -1 ); } if( libbfio_file_get_name_size_wide( file_io_handle, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the filename of the segment file of the current offset * The filename size should include the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_filename_wide( libsmraw_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libsmraw_handle_get_filename_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmraw_handle_get_file_io_handle( handle, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current offset.", function ); return( -1 ); } if( libbfio_file_get_name_wide( file_io_handle, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename.", function ); return( -1 ); } return( 1 ); } #endif /* Retrieves the file IO handle of the segment file of the current offset * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_file_io_handle( libsmraw_handle_t *handle, libbfio_handle_t **file_io_handle, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_file_io_handle"; off64_t current_offset = 0; off64_t segment_data_offset = 0; int segment_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file IO pool.", function ); return( -1 ); } if( libfdata_stream_get_offset( internal_handle->segments_stream, ¤t_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset from segments stream.", function ); return( -1 ); } if( libfdata_stream_get_segment_index_at_offset( internal_handle->segments_stream, current_offset, &segment_index, &segment_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment index at offset: %" PRIi64 " (0x%08" PRIx64 ") from segments stream.", function, current_offset, current_offset ); return( -1 ); } if( libbfio_pool_get_handle( internal_handle->file_io_pool, segment_index, file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for pool entry: %d at offset: %" PRIi64 " (0x%08" PRIx64 ").", function, segment_index, current_offset, current_offset ); return( -1 ); } return( 1 ); } /* Retrieves the media size * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_get_media_size( libsmraw_handle_t *handle, size64_t *media_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_media_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file IO pool.", function ); return( -1 ); } if( media_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media size.", function ); return( -1 ); } #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *media_size = internal_handle->io_handle->media_size; #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the media size * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_media_size( libsmraw_handle_t *handle, size64_t media_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_set_media_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( internal_handle->read_values_initialized != 0 ) || ( internal_handle->write_values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media size cannot be changed.", function ); return( -1 ); } /* TODO add thread-safety support */ internal_handle->io_handle->media_size = media_size; return( 1 ); } /* Retrieves the bytes per sector * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_get_bytes_per_sector( libsmraw_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_bytes_per_sector"; const char *identifier = "bytes_per_sector"; size_t identifier_size = 16; uint64_t value_64bit = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( bytes_per_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *bytes_per_sector = 0; /* TODO refactor into media_values_get_64bit_value function ? */ result = libfvalue_table_get_value_by_identifier( internal_handle->media_values, (uint8_t *) identifier, identifier_size, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from media values table.", function, identifier ); goto on_error; } else if( result != 0 ) { if( libfvalue_value_copy_to_64bit( value, 0, &value_64bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value to a 64-bit value.", function ); goto on_error; } if( value_64bit > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: 64-bit bytes per sector value out of bounds.", function ); goto on_error; } *bytes_per_sector = (uint32_t) value_64bit; } #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Sets the bytes per sector * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_bytes_per_sector( libsmraw_handle_t *handle, uint32_t bytes_per_sector, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_bytes_per_sector"; const char *identifier = "bytes_per_sector"; size_t identifier_size = 16; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( ( internal_handle->read_values_initialized != 0 ) || ( internal_handle->write_values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media values cannot be changed.", function ); return( -1 ); } /* TODO add thread-safety support */ /* TODO refactor into media_values_set_64bit_value function ? */ result = libfvalue_table_get_value_by_identifier( internal_handle->media_values, (uint8_t *) identifier, identifier_size, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from media values table.", function, identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_64BIT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, (uint8_t *) identifier, identifier_size, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->media_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in media values table.", function, identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_64bit( value, 0, (uint64_t) bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value from a 64-bit value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the media type * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_get_media_type( libsmraw_handle_t *handle, uint8_t *media_type, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; uint8_t *value_data = NULL; static char *function = "libsmraw_handle_get_media_type"; const char *identifier = "media_type"; size_t identifier_size = 10; size_t value_data_size = 0; int encoding = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( media_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media type.", function ); return( -1 ); } /* TODO add thread-safety support */ *media_type = LIBSMRAW_MEDIA_TYPE_UNKNOWN; result = libfvalue_table_get_value_by_identifier( internal_handle->media_values, (uint8_t *) identifier, identifier_size, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from media values table.", function, identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_data( value, &value_data, &value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value data.", function ); return( -1 ); } if( value_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value data.", function ); return( -1 ); } if( value_data_size == 6 ) { if( narrow_string_compare( "fixed", value_data, 5 ) == 0 ) { *media_type = LIBSMRAW_MEDIA_TYPE_FIXED; } } else if( value_data_size == 7 ) { if( narrow_string_compare( "memory", value_data, 6 ) == 0 ) { *media_type = LIBSMRAW_MEDIA_TYPE_MEMORY; } } else if( value_data_size == 8 ) { if( narrow_string_compare( "optical", value_data, 7 ) == 0 ) { *media_type = LIBSMRAW_MEDIA_TYPE_OPTICAL; } } else if( value_data_size == 10 ) { if( narrow_string_compare( "removable", value_data, 9 ) == 0 ) { *media_type = LIBSMRAW_MEDIA_TYPE_REMOVABLE; } } } return( 1 ); } /* Sets the media type * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_media_type( libsmraw_handle_t *handle, uint8_t media_type, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_media_type"; const char *identifier = "media_type"; const char *value_string = NULL; size_t identifier_size = 10; size_t value_string_length = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( ( internal_handle->read_values_initialized != 0 ) || ( internal_handle->write_values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media values cannot be changed.", function ); return( -1 ); } /* TODO add thread-safety support */ switch( media_type ) { case LIBSMRAW_MEDIA_TYPE_FIXED: value_string = "fixed"; value_string_length = 5; break; case LIBSMRAW_MEDIA_TYPE_MEMORY: value_string = "memory"; value_string_length = 6; break; case LIBSMRAW_MEDIA_TYPE_OPTICAL: value_string = "optical"; value_string_length = 7; break; case LIBSMRAW_MEDIA_TYPE_REMOVABLE: value_string = "removable"; value_string_length = 9; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported media type: 0x%02x.", function, media_type ); return( -1 ); } result = libfvalue_table_get_value_by_identifier( internal_handle->media_values, (uint8_t *) identifier, identifier_size, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from media values table.", function, identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, (uint8_t *) identifier, identifier_size, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->media_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in media values table.", function, identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf8_string( value, 0, (uint8_t *) value_string, value_string_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value from an UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Retrieves the media flags * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_get_media_flags( libsmraw_handle_t *handle, uint8_t *media_flags, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; uint8_t *value_data = NULL; static char *function = "libsmraw_handle_get_media_flags"; const char *identifier = "media_flags"; size_t identifier_size = 11; size_t value_data_size = 0; int encoding = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( media_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media flags.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->media_values, (uint8_t *) identifier, identifier_size, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from media values table.", function, identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_data( value, &value_data, &value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value data.", function ); return( -1 ); } if( value_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value data.", function ); return( -1 ); } if( value_data_size == 8 ) { if( narrow_string_compare( "logical", value_data, 7 ) == 0 ) { *media_flags &= ~( LIBSMRAW_MEDIA_FLAG_PHYSICAL ); } } else if( value_data_size == 9 ) { if( narrow_string_compare( "physical", value_data, 8 ) == 0 ) { *media_flags |= LIBSMRAW_MEDIA_FLAG_PHYSICAL; } } } return( 1 ); } /* Sets the media flags * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_media_flags( libsmraw_handle_t *handle, uint8_t media_flags, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_media_flags"; const char *identifier = "media_flags"; const char *value_string = NULL; size_t identifier_size = 11; size_t value_string_length = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( ( internal_handle->read_values_initialized != 0 ) || ( internal_handle->write_values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media size cannot be changed.", function ); return( -1 ); } if( ( media_flags & ~( LIBSMRAW_MEDIA_FLAG_PHYSICAL ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported media flags: 0x%02x.", function, media_flags ); return( -1 ); } /* TODO add thread-safety support */ if( ( media_flags & LIBSMRAW_MEDIA_FLAG_PHYSICAL ) != 0 ) { value_string = "physical"; value_string_length = 8; } else { value_string = "logical"; value_string_length = 7; } result = libfvalue_table_get_value_by_identifier( internal_handle->media_values, (uint8_t *) identifier, identifier_size, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from media values table.", function, identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, (uint8_t *) identifier, identifier_size, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->media_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in media values table.", function, identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf8_string( value, 0, (uint8_t *) value_string, value_string_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value from an UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of information values * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_number_of_information_values( libsmraw_handle_t *handle, int *number_of_information_values, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_number_of_information_values"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } /* TODO add thread-safety support */ if( libfvalue_table_get_number_of_values( internal_handle->information_values, number_of_information_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of information values.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of a specific information value identifier * The identifier size includes the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_information_value_identifier_size( libsmraw_handle_t *handle, int information_value_index, size_t *identifier_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; uint8_t *value_identifier = NULL; static char *function = "libsmraw_handle_get_information_value_identifier_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } /* TODO add thread-safety support */ if( libfvalue_table_get_value_by_index( internal_handle->information_values, information_value_index, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from information values table.", function, information_value_index ); return( -1 ); } if( libfvalue_value_get_identifier( value, &value_identifier, identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value identifier: %d.", function, information_value_index ); return( -1 ); } if( value_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value identifier: %d.", function, information_value_index ); return( -1 ); } return( 1 ); } /* Retrieves a specific information value identifier * The identifier size should include the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_information_value_identifier( libsmraw_handle_t *handle, int information_value_index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; uint8_t *value_identifier = NULL; static char *function = "libsmraw_handle_get_information_value_identifier"; size_t value_identifier_size = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } /* TODO add thread-safety support */ if( libfvalue_table_get_value_by_index( internal_handle->information_values, information_value_index, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from information values table.", function, information_value_index ); return( -1 ); } if( libfvalue_value_get_identifier( value, &value_identifier, &value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value identifier: %d.", function, information_value_index ); return( -1 ); } if( value_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value identifier: %d.", function, information_value_index ); return( -1 ); } if( identifier_size < value_identifier_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: identifier too small.", function ); return( -1 ); } if( memory_copy( identifier, value_identifier, value_identifier_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy identifier.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of an UTF-8 encoded information value for the specific identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf8_information_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf8_information_value_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->information_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from information values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_utf8_string_size( value, 0, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s UTF-8 string size.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Retrieves an UTF-8 encoded information value for the specific identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf8_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf8_information_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->information_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from information values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_copy_to_utf8_string( value, 0, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s to an UTF-8 string.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Sets an UTF-8 encoded information value for the specific identifier * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_utf8_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_utf8_information_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->read_values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: information values cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->information_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from information values table.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->information_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in information values table.", function, (char *) identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf8_string( value, 0, utf8_string, utf8_string_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s from an UTF-8 string.", function, (char *) identifier ); return( -1 ); } return( 1 ); } /* Retrieves the size of an UTF-16 encoded information value for the specific identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf16_information_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf16_information_value_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->information_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from information values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_utf16_string_size( value, 0, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s UTF-16 string size.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Retrieves an UTF-16 encoded information value for the specific identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf16_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf16_information_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->information_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from information values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_copy_to_utf16_string( value, 0, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s to an UTF-16 string.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Sets an UTF-16 encoded information value for the specific identifier * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_utf16_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_utf16_information_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->read_values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: information values cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->information_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from information values table.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->information_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in information values table.", function, (char *) identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf16_string( value, 0, utf16_string, utf16_string_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s from an UTF-16 string.", function, (char *) identifier ); return( -1 ); } return( 1 ); } /* Retrieves the number of integrity hash values * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_number_of_integrity_hash_values( libsmraw_handle_t *handle, int *number_of_integrity_hash_values, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; static char *function = "libsmraw_handle_get_number_of_integrity_hash_values"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } /* TODO add thread-safety support */ if( libfvalue_table_get_number_of_values( internal_handle->integrity_hash_values, number_of_integrity_hash_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of integrity hash values.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of a specific integrity hash value identifier * The identifier size includes the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_integrity_hash_value_identifier_size( libsmraw_handle_t *handle, int integrity_hash_value_index, size_t *identifier_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; uint8_t *value_identifier = NULL; static char *function = "libsmraw_handle_get_integrity_hash_value_identifier_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } /* TODO add thread-safety support */ if( libfvalue_table_get_value_by_index( internal_handle->integrity_hash_values, integrity_hash_value_index, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from integrity hash values table.", function, integrity_hash_value_index ); return( -1 ); } if( libfvalue_value_get_identifier( value, &value_identifier, identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value identifier: %d.", function, integrity_hash_value_index ); return( -1 ); } if( value_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value identifier: %d.", function, integrity_hash_value_index ); return( -1 ); } return( 1 ); } /* Retrieves a specific integrity hash value identifier * The identifier size should include the end of string character * Returns 1 if successful or -1 on error */ int libsmraw_handle_get_integrity_hash_value_identifier( libsmraw_handle_t *handle, int integrity_hash_value_index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; uint8_t *value_identifier = NULL; static char *function = "libsmraw_handle_get_integrity_hash_value_identifier"; size_t value_identifier_size = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } /* TODO add thread-safety support */ if( libfvalue_table_get_value_by_index( internal_handle->integrity_hash_values, integrity_hash_value_index, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from integrity hash values table.", function, integrity_hash_value_index ); return( -1 ); } if( libfvalue_value_get_identifier( value, &value_identifier, &value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value identifier: %d.", function, integrity_hash_value_index ); return( -1 ); } if( value_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value identifier: %d.", function, integrity_hash_value_index ); return( -1 ); } if( identifier_size < value_identifier_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: identifier too small.", function ); return( -1 ); } if( memory_copy( identifier, value_identifier, value_identifier_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy identifier.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of an UTF-8 encoded integrity hash value for the specific identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf8_integrity_hash_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf8_integrity_hash_value_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->integrity_hash_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from integrity hash values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_utf8_string_size( value, 0, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s UTF-8 string size.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Retrieves an UTF-8 encoded integrity hash value for the specific identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf8_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf8_integrity_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->integrity_hash_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from integrity hash values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_copy_to_utf8_string( value, 0, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s to an UTF-8 string.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Sets an UTF-8 encoded integrity hash value for the specific identifier * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_utf8_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_utf8_integrity_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->read_values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: integrity hash values cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->integrity_hash_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from integrity hash values table.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->integrity_hash_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in integrity hash values table.", function, (char *) identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf8_string( value, 0, utf8_string, utf8_string_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s from an UTF-8 string.", function, (char *) identifier ); return( -1 ); } return( 1 ); } /* Retrieves the size of an UTF-16 encoded integrity hash value for the specific identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf16_integrity_hash_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf16_integrity_hash_value_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->integrity_hash_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from integrity hash values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_utf16_string_size( value, 0, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s UTF-16 string size.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Retrieves an UTF-16 encoded integrity hash value for the specific identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmraw_handle_get_utf16_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_get_utf16_integrity_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing file io pool.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->integrity_hash_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from integrity hash values table.", function, (char *) identifier ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_copy_to_utf16_string( value, 0, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s to an UTF-16 string.", function, (char *) identifier ); return( -1 ); } } return( result ); } /* Sets an UTF-16 encoded integrity hash value for the specific identifier * Returns the 1 if succesful or -1 on error */ int libsmraw_handle_set_utf16_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ) { libsmraw_internal_handle_t *internal_handle = NULL; libfvalue_value_t *value = NULL; static char *function = "libsmraw_handle_set_utf16_integrity_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmraw_internal_handle_t *) handle; if( internal_handle->read_values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: integrity hash values cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } /* TODO add thread-safety support */ result = libfvalue_table_get_value_by_identifier( internal_handle->integrity_hash_values, identifier, identifier_length + 1, &value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %s from integrity hash values table.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set identifier in value.", function ); libfvalue_value_free( &value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->integrity_hash_values, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in integrity hash values table.", function, (char *) identifier ); libfvalue_value_free( &value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf16_string( value, 0, utf16_string, utf16_string_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %s from an UTF-16 string.", function, (char *) identifier ); return( -1 ); } return( 1 ); } libewf-20140807/libsmraw/libsmraw_information_file.c0000664000175000017500000005175013443450067024557 0ustar00lordyestalordyesta00000000000000/* * Information file functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include #include #include "libsmraw_definitions.h" #include "libsmraw_information_file.h" #include "libsmraw_libcerror.h" #include "libsmraw_libfvalue.h" /* Creates an information file * Make sure the value information_file is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmraw_information_file_initialize( libsmraw_information_file_t **information_file, libcerror_error_t **error ) { static char *function = "libsmraw_information_file_initialize"; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( *information_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid information file value already set.", function ); return( -1 ); } *information_file = memory_allocate_structure( libsmraw_information_file_t ); if( *information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create information file.", function ); goto on_error; } if( memory_set( *information_file, 0, sizeof( libsmraw_information_file_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear information file.", function ); goto on_error; } return( 1 ); on_error: if( *information_file != NULL ) { memory_free( *information_file ); *information_file = NULL; } return( -1 ); } /* Frees an information file * Returns 1 if successful or -1 on error */ int libsmraw_information_file_free( libsmraw_information_file_t **information_file, libcerror_error_t **error ) { static char *function = "libsmraw_information_file_free"; int result = 1; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( *information_file != NULL ) { if( ( *information_file )->name != NULL ) { memory_free( ( *information_file )->name ); } memory_free( *information_file ); *information_file = NULL; } return( result ); } /* Sets the filename * Returns 1 if successful or -1 on error */ int libsmraw_information_file_set_name( libsmraw_information_file_t *information_file, const system_character_t *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libsmraw_information_file_set_name"; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( name_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid name length value exceeds maximum.", function ); return( -1 ); } information_file->name = system_string_allocate( name_length + 1 ); if( information_file->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to allocate name.", function ); return( -1 ); } if( system_string_copy( information_file->name, name, name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set name.", function ); return( -1 ); } information_file->name[ name_length ] = 0; information_file->name_size = name_length + 1; return( 1 ); } /* Opens a information file * Returns 1 if successful or -1 on error */ int libsmraw_information_file_open( libsmraw_information_file_t *information_file, const system_character_t *filename, int access_flags, libcerror_error_t **error ) { const system_character_t *mode = NULL; static char *function = "libsmraw_information_file_open"; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid filename.", function ); return( -1 ); } if( information_file->file_stream != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid information file - file stream already set.", function ); return( -1 ); } if( ( ( access_flags & LIBSMRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( ( access_flags & LIBSMRAW_ACCESS_FLAG_WRITE ) != 0 ) { mode = FILE_STREAM_OPEN_WRITE; } else { mode = FILE_STREAM_OPEN_READ; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) information_file->file_stream = file_stream_open_wide( filename, mode ); #else information_file->file_stream = file_stream_open( filename, mode ); #endif if( information_file->file_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open: %" PRIs_SYSTEM ".", function, filename ); return( -1 ); } return( 1 ); } /* Closes the information file * Returns the 0 if succesful or -1 on error */ int libsmraw_information_file_close( libsmraw_information_file_t *information_file, libcerror_error_t **error ) { static char *function = "libsmraw_information_file_close"; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( information_file->name != NULL ) { memory_free( information_file->name ); information_file->name = NULL; } if( information_file->file_stream != NULL ) { if( file_stream_close( information_file->file_stream ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file stream.", function ); return( -1 ); } information_file->file_stream = NULL; } return( 0 ); } /* Reas a section with its values from the information file * Returns the 1 if succesful, 0 if no such section or -1 on error */ int libsmraw_information_file_read_section( libsmraw_information_file_t *information_file, const uint8_t *section_identifier, size_t section_identifier_length, libfvalue_table_t *values_table, libcerror_error_t **error ) { char input_string[ 128 ]; libfvalue_value_t *value = NULL; char *value_data = NULL; char *value_identifier = NULL; char *result_string = NULL; static char *function = "libsmraw_information_file_read_section"; size_t input_string_index = 0; size_t value_identifier_length = 0; size_t value_data_length = 0; uint8_t in_section = 0; int result = 0; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( information_file->file_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid information file - missing file stream.", function ); return( -1 ); } if( section_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section identifier.", function ); return( -1 ); } if( section_identifier_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid section identifier length value exceeds maximum.", function ); return( -1 ); } /* Reset the offset to start of the file stream */ if( file_stream_seek_offset( information_file->file_stream, 0, SEEK_SET ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek stream offset: 0.", function ); return( -1 ); } while( file_stream_at_end( information_file->file_stream ) == 0 ) { result_string = file_stream_get_string( information_file->file_stream, input_string, 128 ); if( result_string == NULL ) { if( file_stream_at_end( information_file->file_stream ) != 0 ) { break; } libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading string from file stream.", function ); return( -1 ); } /* Skip leading white space */ for( input_string_index = 0; input_string_index < 128; input_string_index++ ) { if( ( input_string[ input_string_index ] != '\t' ) && ( input_string[ input_string_index ] != '\n' ) && ( input_string[ input_string_index ] != '\f' ) && ( input_string[ input_string_index ] != '\v' ) && ( input_string[ input_string_index ] != '\r' ) && ( input_string[ input_string_index ] != ' ' ) ) { break; } } /* Skip an empty line */ if( input_string[ input_string_index ] == 0 ) { continue; } if( in_section != 0 ) { /* Check for the end of the section */ if( ( ( input_string_index + section_identifier_length + 2 ) < 128 ) && ( input_string[ input_string_index ] == '<' ) && ( input_string[ input_string_index + 1 ] == '/' ) && ( narrow_string_compare( &( input_string[ input_string_index + 2 ] ), section_identifier, section_identifier_length ) == 0 ) && ( input_string[ input_string_index + section_identifier_length + 2 ] == '>' ) ) { in_section = 0; result = 1; break; } if( input_string[ input_string_index ] == '<' ) { /* Determine the value identifier */ input_string_index++; value_identifier = &( input_string[ input_string_index ] ); value_identifier_length = 0; while( input_string_index < 128 ) { if( ( ( input_string[ input_string_index ] >= 'A' ) && ( input_string[ input_string_index ] <= 'I' ) ) || ( ( input_string[ input_string_index ] >= 'J' ) && ( input_string[ input_string_index ] <= 'R' ) ) || ( ( input_string[ input_string_index ] >= 'S' ) && ( input_string[ input_string_index ] <= 'Z' ) ) || ( ( input_string[ input_string_index ] >= 'a' ) && ( input_string[ input_string_index ] <= 'i' ) ) || ( ( input_string[ input_string_index ] >= 'j' ) && ( input_string[ input_string_index ] <= 'r' ) ) || ( ( input_string[ input_string_index ] >= 's' ) && ( input_string[ input_string_index ] <= 'z' ) ) || ( ( input_string[ input_string_index ] >= '0' ) && ( input_string[ input_string_index ] <= '9' ) ) || ( input_string[ input_string_index ] == '_' ) ) { value_identifier_length++; } else { break; } input_string_index++; } /* Check if there is a supported value identifier */ if( input_string[ input_string_index ] != '>' ) { continue; } /* Make sure the value identifier is terminated by an end of string */ input_string[ input_string_index ] = 0; /* Determine the value */ input_string_index++; value_data = &( input_string[ input_string_index ] ); value_data_length = 0; while( input_string_index < 128 ) { if( ( input_string[ input_string_index ] == 0 ) || ( input_string[ input_string_index ] == '<' ) ) { break; } value_data_length++; input_string_index++; } /* Check if there is a supported value */ if( input_string[ input_string_index ] != '<' ) { continue; } /* Make sure the value data is terminated by an end of string */ input_string[ input_string_index ] = 0; /* Check the value identifier */ input_string_index++; if( ( ( input_string_index + value_identifier_length + 2 ) >= 128 ) || ( input_string[ input_string_index ] != '/' ) || ( narrow_string_compare( &( input_string[ input_string_index + 1 ] ), value_identifier, value_identifier_length ) != 0 ) || ( input_string[ input_string_index + value_identifier_length + 1 ] != '>' ) ) { continue; } if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value: %s.", function, value_identifier ); goto on_error; } if( libfvalue_value_set_identifier( value, (uint8_t *) value_identifier, value_identifier_length, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set identifier in value: %d.", function, value_identifier ); goto on_error; } if( libfvalue_value_set_data( value, (uint8_t *) value_data, value_data_length + 1, LIBFVALUE_ENDIAN_NATIVE, LIBFVALUE_VALUE_FLAG_DATA_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s data.", function, value_identifier ); goto on_error; } if( libfvalue_table_set_value( values_table, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value: %s in values table.", function, value_identifier ); goto on_error; } value = NULL; } } else { /* Check for the start of the section */ if( ( ( input_string_index + section_identifier_length + 1 ) < 128 ) && ( input_string[ input_string_index ] == '<' ) && ( narrow_string_compare( &( input_string[ input_string_index + 1 ] ), section_identifier, section_identifier_length ) == 0 ) && ( input_string[ input_string_index + section_identifier_length + 1 ] == '>' ) ) { in_section = 1; } } } return( result ); on_error: if( value != NULL ) { libfvalue_value_free( &value, NULL ); } return( -1 ); } /* Write a section with its values to the information file * Returns the 1 if succesful or -1 on error */ int libsmraw_information_file_write_section( libsmraw_information_file_t *information_file, const uint8_t *section_identifier, size_t section_identifier_length, libfvalue_table_t *values_table, libcerror_error_t **error ) { libfvalue_value_t *value = NULL; static char *function = "libsmraw_information_file_write_section"; ssize_t write_count = 0; int number_of_values = 0; int print_count = 0; int result = 1; int value_iterator = 0; if( information_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid information file.", function ); return( -1 ); } if( information_file->file_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid information file - missing file stream.", function ); return( -1 ); } if( section_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section identifier.", function ); return( -1 ); } if( section_identifier_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid section identifier length value exceeds maximum.", function ); return( -1 ); } if( values_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } /* Write section start */ print_count = fprintf( information_file->file_stream, "<%s>\n", section_identifier ); if( ( print_count < 0 ) || ( (size_t) print_count > ( section_identifier_length + 3 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start to file stream.", function ); return( -1 ); } /* Write section values */ if( libfvalue_table_get_number_of_values( values_table, &number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values.", function ); return( -1 ); } for( value_iterator = 0; value_iterator < number_of_values; value_iterator++ ) { print_count = fprintf( information_file->file_stream, "\t" ); if( ( print_count < 0 ) || ( (size_t) print_count > 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); return( -1 ); } if( libfvalue_table_get_value_by_index( values_table, value_iterator, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from values table.", function, value_iterator ); result = -1; continue; } write_count = libfvalue_value_write_to_file_stream( value, information_file->file_stream, error ); if( write_count <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write value: %d to file stream.", function, value_iterator ); result = -1; } print_count = fprintf( information_file->file_stream, "\n" ); if( ( print_count < 0 ) || ( (size_t) print_count > 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); return( -1 ); } } /* Write section end */ print_count = fprintf( information_file->file_stream, "\n\n", section_identifier ); if( ( print_count < 0 ) || ( (size_t) print_count > ( section_identifier_length + 5 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section end to file stream.", function ); return( -1 ); } return( result ); } libewf-20140807/libsmraw/libsmraw_libuna.h0000664000175000017500000000331213443450067022501 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBUNA_H ) #define _LIBSMRAW_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBSMRAW_LIBUNA_H ) */ libewf-20140807/libsmraw/libsmraw_libclocale.h0000664000175000017500000000266513443450067023332 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBCLOCALE_H ) #define _LIBSMRAW_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBSMRAW_LIBCLOCALE_H ) */ libewf-20140807/libsmraw/libsmraw_libfdata.h0000664000175000017500000000314213443450067022776 0ustar00lordyestalordyesta00000000000000/* * The libfdata header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBFDATA_H ) #define _LIBSMRAW_LIBFDATA_H #include /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata */ #if defined( HAVE_LOCAL_LIBFDATA ) #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBFDATA_DLL_IMPORT * before including libfdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFDATA ) */ #endif /* !defined( _LIBSMRAW_LIBFDATA_H ) */ libewf-20140807/libsmraw/Makefile.am0000664000175000017500000000244613443450067021221 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBSMRAW AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ @LIBFDATA_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libsmraw.la libsmraw_la_SOURCES = \ libsmraw_codepage.h \ libsmraw_definitions.h \ libsmraw_error.c libsmraw_error.h \ libsmraw_extern.h \ libsmraw_filename.c libsmraw_filename.h \ libsmraw_handle.c libsmraw_handle.h \ libsmraw_information_file.c libsmraw_information_file.h \ libsmraw_io_handle.c libsmraw_io_handle.h \ libsmraw_libbfio.h \ libsmraw_libcerror.h \ libsmraw_libclocale.h \ libsmraw_libcnotify.h \ libsmraw_libcthreads.h \ libsmraw_libfdata.h \ libsmraw_libfvalue.h \ libsmraw_libuna.h \ libsmraw_notify.c libsmraw_notify.h \ libsmraw_support.c libsmraw_support.h \ libsmraw_types.h \ libsmraw_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libsmraw ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libsmraw_la_SOURCES) libewf-20140807/libsmraw/libsmraw_types.h0000664000175000017500000000274113443450067022400 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_INTERNAL_TYPES_H ) #define _LIBSMRAW_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBSMRAW for local use of libsmraw * The definitions in are copied here * for local use of libsmraw */ #if defined( HAVE_LOCAL_LIBSMRAW ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libsmraw_handle {} libsmraw_handle_t; #else typedef intptr_t libsmraw_handle_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBSMRAW ) */ #endif /* !defined( _LIBSMRAW_INTERNAL_TYPES_H ) */ libewf-20140807/libsmraw/libsmraw_filename.h0000664000175000017500000000245613443450067023017 0ustar00lordyestalordyesta00000000000000/* * Filename functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_FILENAME_H ) #define _LIBSMRAW_FILENAME_H #include #include #include "libsmraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libsmraw_filename_create( system_character_t **filename, size_t *filename_size, system_character_t *basename, size_t basename_size, int number_of_segments, int segment_index, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_FILENAME_H ) */ libewf-20140807/libsmraw/libsmraw_libfvalue.h0000664000175000017500000000340113443450067023177 0ustar00lordyestalordyesta00000000000000/* * The libfvalue header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBFVALUE_H ) #define _LIBSMRAW_LIBFVALUE_H #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue */ #if defined( HAVE_LOCAL_LIBFVALUE ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBFVALUE_DLL_IMPORT * before including libfvalue.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFVALUE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFVALUE ) */ #endif /* !defined( _LIBSMRAW_LIBFVALUE_H ) */ libewf-20140807/libsmraw/libsmraw_io_handle.h0000664000175000017500000001103513443450067023152 0ustar00lordyestalordyesta00000000000000/* * Input/Output (IO) handle functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_IO_HANDLE_H ) #define _LIBSMRAW_IO_HANDLE_H #include #include #include "libsmraw_libbfio.h" #include "libsmraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif extern const uint8_t *smraw_file_signature; typedef struct libsmraw_io_handle libsmraw_io_handle_t; struct libsmraw_io_handle { /* The basename */ system_character_t *basename; /* The basename size */ size_t basename_size; /* The media size */ size64_t media_size; /* The maximum segment size */ size64_t maximum_segment_size; /* The number of segments, used for filename creation during write */ int number_of_segments; /* Value to indicate if abort was signalled */ int abort; }; int libsmraw_io_handle_initialize( libsmraw_io_handle_t **io_handle, libcerror_error_t **error ); int libsmraw_io_handle_free( libsmraw_io_handle_t **io_handle, libcerror_error_t **error ); int libsmraw_io_handle_clear( libsmraw_io_handle_t *io_handle, libcerror_error_t **error ); int libsmraw_io_handle_create_segment( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); ssize_t libsmraw_io_handle_read_segment_data( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index, int segment_file_index, uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t read_flags, libcerror_error_t **error ); ssize_t libsmraw_io_handle_write_segment_data( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index, int segment_file_index, const uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t write_flags, libcerror_error_t **error ); off64_t libsmraw_io_handle_seek_segment_offset( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index, int segment_file_index, off64_t segment_offset, libcerror_error_t **error ); int libsmraw_io_handle_get_basename_size( libsmraw_io_handle_t *io_handle, size_t *basename_size, libcerror_error_t **error ); int libsmraw_io_handle_get_basename( libsmraw_io_handle_t *io_handle, char *basename, size_t basename_size, libcerror_error_t **error ); int libsmraw_io_handle_set_basename( libsmraw_io_handle_t *io_handle, const char *basename, size_t basename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libsmraw_io_handle_get_basename_size_wide( libsmraw_io_handle_t *io_handle, size_t *basename_size, libcerror_error_t **error ); int libsmraw_io_handle_get_basename_wide( libsmraw_io_handle_t *io_handle, wchar_t *basename, size_t basename_size, libcerror_error_t **error ); int libsmraw_io_handle_set_basename_wide( libsmraw_io_handle_t *io_handle, const wchar_t *basename, size_t basename_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ int libsmraw_io_handle_get_maximum_segment_size( libsmraw_io_handle_t *io_handle, size64_t *maximum_segment_size, libcerror_error_t **error ); int libsmraw_io_handle_set_maximum_segment_size( libsmraw_io_handle_t *io_handle, size64_t maximum_segment_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_IO_HANDLE_H ) */ libewf-20140807/libsmraw/libsmraw_filename.c0000664000175000017500000001225213443450067023005 0ustar00lordyestalordyesta00000000000000/* * Filename functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include #include #include "libsmraw_definitions.h" #include "libsmraw_handle.h" #include "libsmraw_information_file.h" #include "libsmraw_libbfio.h" #include "libsmraw_libcerror.h" #include "libsmraw_libcnotify.h" #include "libsmraw_handle.h" #include "libsmraw_types.h" /* Creates a (split) RAW filename * Returns 1 if successful or -1 on error */ int libsmraw_filename_create( system_character_t **filename, size_t *filename_size, system_character_t *basename, size_t basename_size, int number_of_segments, int segment_index, libcerror_error_t **error ) { static char *function = "libsmraw_filename_create"; size_t additional_length = 0; size_t filename_index = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename.", function ); return( -1 ); } if( *filename != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment filename already set.", function ); return( -1 ); } if( filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename size.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid basename.", function ); return( -1 ); } if( basename_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid basename size value exceeds maximum.", function ); return( -1 ); } if( ( number_of_segments < 0 ) || ( number_of_segments >= 1000 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segments value out of bounds.", function ); return( -1 ); } if( number_of_segments > 0 ) { if( ( segment_index < 0 ) || ( segment_index > number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } } if( number_of_segments == 1 ) { additional_length = 4; } else { additional_length = 8; } *filename_size = basename_size + additional_length; *filename = system_string_allocate( *filename_size ); if( *filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename.", function ); goto on_error; } if( system_string_copy( *filename, basename, basename_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy basename to segment filename.", function ); goto on_error; } filename_index = basename_size - 1; if( system_string_copy( &( ( *filename )[ filename_index ] ), _SYSTEM_STRING( ".raw" ), 4 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy extension to segment filename.", function ); goto on_error; } filename_index += 4; if( number_of_segments != 1 ) { ( *filename )[ filename_index++ ] = (system_character_t) '.'; ( *filename )[ filename_index++ ] = (system_character_t) '0' + (system_character_t) ( segment_index / 100 ); segment_index %= 100; ( *filename )[ filename_index++ ] = (system_character_t) '0' + (system_character_t) ( segment_index / 10 ); segment_index %= 10; ( *filename )[ filename_index++ ] = (system_character_t) '0' + (system_character_t) segment_index; } ( *filename )[ filename_index ] = 0; return( 1 ); on_error: if( *filename != NULL ) { memory_free( *filename ); *filename = NULL; } *filename_size = 0; return( -1 ); } libewf-20140807/libsmraw/libsmraw_information_file.h0000664000175000017500000000517113443450067024560 0ustar00lordyestalordyesta00000000000000/* * Information file functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_INFORMATION_FILE_H ) #define _LIBSMRAW_INFORMATION_FILE_H #include #include #include #include "libsmraw_libcerror.h" #include "libsmraw_libfvalue.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libsmraw_information_file libsmraw_information_file_t; struct libsmraw_information_file { /* The filename */ system_character_t *name; /* The size of the filename */ size_t name_size; /* The file stream */ FILE *file_stream; }; int libsmraw_information_file_initialize( libsmraw_information_file_t **information_file, libcerror_error_t **error ); int libsmraw_information_file_free( libsmraw_information_file_t **information_file, libcerror_error_t **error ); int libsmraw_information_file_set_name( libsmraw_information_file_t *information_file, const system_character_t *name, size_t name_length, libcerror_error_t **error ); int libsmraw_information_file_open( libsmraw_information_file_t *information_file, const system_character_t *filename, int access_flags, libcerror_error_t **error ); int libsmraw_information_file_close( libsmraw_information_file_t *information_file, libcerror_error_t **error ); int libsmraw_information_file_read_section( libsmraw_information_file_t *information_file, const uint8_t *section_identifier, size_t section_identifier_length, libfvalue_table_t *values_table, libcerror_error_t **error ); int libsmraw_information_file_write_section( libsmraw_information_file_t *information_file, const uint8_t *section_identifier, size_t section_identifier_length, libfvalue_table_t *values_table, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_INFORMATION_FILE_H ) */ libewf-20140807/libsmraw/libsmraw_libcthreads.h0000664000175000017500000000360713443450067023522 0ustar00lordyestalordyesta00000000000000/* * The libcthreads header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBCTHREADS_H ) #define _LIBSMRAW_LIBCTHREADS_H #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBSMRAW ) #define HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT #endif #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads */ #if defined( HAVE_LOCAL_LIBCTHREADS ) #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCTHREADS_DLL_IMPORT * before including libcthreads.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCTHREADS_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCTHREADS ) */ #endif /* defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) */ #endif /* !defined( _LIBSMRAW_LIBCTHREADS_H ) */ libewf-20140807/libsmraw/libsmraw_libcnotify.h0000664000175000017500000000266213443450067023400 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBCNOTIFY_H ) #define _LIBSMRAW_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBSMRAW_LIBCNOTIFY_H ) */ libewf-20140807/libsmraw/libsmraw_io_handle.c0000664000175000017500000011470013443450067023150 0ustar00lordyestalordyesta00000000000000/* * Input/Output (IO) handle functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include #include "libsmraw_definitions.h" #include "libsmraw_filename.h" #include "libsmraw_io_handle.h" #include "libsmraw_libbfio.h" #include "libsmraw_libcerror.h" #include "libsmraw_libclocale.h" #include "libsmraw_libuna.h" #include "libsmraw_unused.h" /* Creates an IO handle * Make sure the value io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmraw_io_handle_initialize( libsmraw_io_handle_t **io_handle, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_initialize"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( *io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid IO handle value already set.", function ); return( -1 ); } *io_handle = memory_allocate_structure( libsmraw_io_handle_t ); if( *io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create IO handle.", function ); goto on_error; } if( memory_set( *io_handle, 0, sizeof( libsmraw_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear IO handle.", function ); goto on_error; } ( *io_handle )->maximum_segment_size = LIBSMRAW_DEFAULT_MAXIMUM_SEGMENT_SIZE; return( 1 ); on_error: if( *io_handle != NULL ) { memory_free( *io_handle ); *io_handle = NULL; } return( -1 ); } /* Frees an IO handle * Returns 1 if successful or -1 on error */ int libsmraw_io_handle_free( libsmraw_io_handle_t **io_handle, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_free"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( *io_handle != NULL ) { if( ( *io_handle )->basename != NULL ) { memory_free( ( *io_handle )->basename ); } memory_free( *io_handle ); *io_handle = NULL; } return( 1 ); } /* Clears the IO handle * Returns 1 if successful or -1 on error */ int libsmraw_io_handle_clear( libsmraw_io_handle_t *io_handle, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_clear"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( io_handle->basename != NULL ) { memory_free( io_handle->basename ); } if( memory_set( io_handle, 0, sizeof( libsmraw_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear IO handle.", function ); return( -1 ); } io_handle->maximum_segment_size = LIBSMRAW_DEFAULT_MAXIMUM_SEGMENT_SIZE; return( 1 ); } /* Creates a new segment file * Callback function for the segments stream * Returns the number of bytes read or -1 on error */ int libsmraw_io_handle_create_segment( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; system_character_t *filename = NULL; static char *function = "libsmraw_io_handle_create_segment"; size_t filename_size = 0; int file_io_pool_entry = 0; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( segment_file_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file index.", function ); return( -1 ); } if( segment_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment offset.", function ); return( -1 ); } if( segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment size.", function ); return( -1 ); } if( segment_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment flags.", function ); return( -1 ); } if( libsmraw_filename_create( &filename, &filename_size, io_handle->basename, io_handle->basename_size, io_handle->number_of_segments, segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment filename: %d.", function, segment_index ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbfio_file_set_name_wide( file_io_handle, filename, filename_size, error ) != 1 ) #else if( libbfio_file_set_name( file_io_handle, filename, filename_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } memory_free( filename ); filename = NULL; if( libbfio_pool_append_handle( file_io_pool, &file_io_pool_entry, file_io_handle, LIBBFIO_OPEN_WRITE_TRUNCATE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle to pool.", function ); goto on_error; } if( libbfio_pool_open( file_io_pool, file_io_pool_entry, LIBBFIO_OPEN_WRITE_TRUNCATE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file IO pool entry: %d.", function, file_io_pool_entry ); file_io_handle = NULL; goto on_error; } if( io_handle->maximum_segment_size == 0 ) { *segment_size = (size64_t) INT64_MAX; } else { *segment_size = io_handle->maximum_segment_size; } *segment_file_index = file_io_pool_entry; *segment_offset = 0; *segment_flags = 0; return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( filename != NULL ) { memory_free( filename ); } return( -1 ); } /* Reads segment data into a buffer * Callback function for the segments stream * Returns the number of bytes read or -1 on error */ ssize_t libsmraw_io_handle_read_segment_data( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index LIBSMRAW_ATTRIBUTE_UNUSED, int segment_file_index, uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags LIBSMRAW_ATTRIBUTE_UNUSED, uint8_t read_flags LIBSMRAW_ATTRIBUTE_UNUSED, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_read_segment_data"; ssize_t read_count = 0; LIBSMRAW_UNREFERENCED_PARAMETER( segment_index ) LIBSMRAW_UNREFERENCED_PARAMETER( segment_flags ) LIBSMRAW_UNREFERENCED_PARAMETER( read_flags ) if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, segment_file_index, segment_data, segment_data_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment data.", function ); return( -1 ); } return( read_count ); } /* Writes segment data from a buffer * Callback function for the segments stream * Returns the number of bytes written or -1 on error */ ssize_t libsmraw_io_handle_write_segment_data( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index LIBSMRAW_ATTRIBUTE_UNUSED, int segment_file_index, const uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags LIBSMRAW_ATTRIBUTE_UNUSED, uint8_t write_flags LIBSMRAW_ATTRIBUTE_UNUSED, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_write_segment_data"; ssize_t write_count = 0; LIBSMRAW_UNREFERENCED_PARAMETER( segment_index ) LIBSMRAW_UNREFERENCED_PARAMETER( segment_flags ) LIBSMRAW_UNREFERENCED_PARAMETER( write_flags ) if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } write_count = libbfio_pool_write_buffer( file_io_pool, segment_file_index, segment_data, segment_data_size, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write segment data.", function ); return( -1 ); } return( write_count ); } /* Seeks a certain segment offset * Callback function for the segments stream * Returns the offset or -1 on error */ off64_t libsmraw_io_handle_seek_segment_offset( libsmraw_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int segment_index LIBSMRAW_ATTRIBUTE_UNUSED, int segment_file_index, off64_t segment_offset, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_seek_segment_offset"; LIBSMRAW_UNREFERENCED_PARAMETER( segment_index ) if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } segment_offset = libbfio_pool_seek_offset( file_io_pool, segment_file_index, segment_offset, SEEK_SET, error ); if( segment_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek segment offset.", function ); return( -1 ); } return( segment_offset ); } /* Retrieves the segment basename size * The segment basename size includes the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_io_handle_get_basename_size( libsmraw_io_handle_t *io_handle, size_t *basename_size, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_get_basename_size"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( io_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid IO handle - missing basename.", function ); return( -1 ); } if( basename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #else *basename_size = io_handle->basename_size; #endif return( 1 ); } /* Retrieves the segment basename * The segment basename size should include the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_io_handle_get_basename( libsmraw_io_handle_t *io_handle, char *basename, size_t basename_size, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_get_basename"; size_t narrow_basename_size = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( io_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid IO handle - missing basename.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, &narrow_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, &narrow_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, &narrow_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, &narrow_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #else narrow_basename_size = io_handle->basename_size; #endif if( basename_size < narrow_basename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: basename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) basename, basename_size, (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) basename, basename_size, (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) basename, basename_size, libclocale_codepage, (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) basename, basename_size, libclocale_codepage, (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); return( -1 ); } #else if( system_string_copy( basename, io_handle->basename, io_handle->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); return( -1 ); } basename[ io_handle->basename_size - 1 ] = 0; #endif return( 1 ); } /* Sets the segment basename * Returns 1 if succesful or -1 on error */ int libsmraw_io_handle_set_basename( libsmraw_io_handle_t *io_handle, const char *basename, size_t basename_length, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_set_basename"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( basename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid basename length is zero.", function ); return( -1 ); } if( basename_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid basename length value exceeds maximum.", function ); return( -1 ); } if( io_handle->basename != NULL ) { memory_free( io_handle->basename ); io_handle->basename = NULL; io_handle->basename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) basename, basename_length + 1, &( io_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) basename, basename_length + 1, &( io_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) basename, basename_length + 1, libclocale_codepage, &( io_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) basename, basename_length + 1, libclocale_codepage, &( io_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #else io_handle->basename_size = basename_length + 1; #endif io_handle->basename = system_string_allocate( io_handle->basename_size ); if( io_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create basename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, (libuna_utf8_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, (libuna_utf8_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) io_handle->basename, io_handle->basename_size, (uint8_t *) basename, basename_length + 1, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) io_handle->basename, io_handle->basename_size, (uint8_t *) basename, basename_length + 1, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); memory_free( io_handle->basename ); io_handle->basename = NULL; io_handle->basename_size = 0; return( -1 ); } #else if( system_string_copy( io_handle->basename, basename, basename_length + 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( io_handle->basename ); io_handle->basename = NULL; io_handle->basename_size = 0; return( -1 ); } io_handle->basename[ basename_length ] = 0; #endif return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment basename size * The segment basename size includes the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_io_handle_get_basename_size_wide( libsmraw_io_handle_t *io_handle, size_t *basename_size, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_get_basename_size_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( io_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid IO handle - missing basename.", function ); return( -1 ); } if( basename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) *basename_size = io_handle->basename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the segment basename * The segment basename size should include the end of string character * Returns 1 if succesful or -1 on error */ int libsmraw_io_handle_get_basename_wide( libsmraw_io_handle_t *io_handle, wchar_t *basename, size_t basename_size, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_get_basename_wide"; size_t wide_basename_size = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( io_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid IO handle - missing basename.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wide_basename_size = io_handle->basename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, &wide_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, &wide_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, &wide_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, &wide_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif if( basename_size < wide_basename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: basename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( basename, io_handle->basename, io_handle->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); return( -1 ); } basename[ io_handle->basename_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) basename, basename_size, (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) basename, basename_size, (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) basename, basename_size, (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) basename, basename_size, (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the segment basename * Returns 1 if succesful or -1 on error */ int libsmraw_io_handle_set_basename_wide( libsmraw_io_handle_t *io_handle, const wchar_t *basename, size_t basename_length, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_set_basename_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( basename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid basename length is zero.", function ); return( -1 ); } if( basename_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid basename length value exceeds maximum.", function ); return( -1 ); } if( io_handle->basename != NULL ) { memory_free( io_handle->basename ); io_handle->basename = NULL; io_handle->basename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) io_handle->basename_size = basename_length + 1; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) basename, basename_length + 1, &( io_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) basename, basename_length + 1, &( io_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) basename, basename_length + 1, libclocale_codepage, &( io_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) basename, basename_length + 1, libclocale_codepage, &( io_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ io_handle->basename = system_string_allocate( io_handle->basename_size ); if( io_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create basename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( io_handle->basename, basename, basename_length + 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( io_handle->basename ); io_handle->basename = NULL; io_handle->basename_size = 0; return( -1 ); } io_handle->basename[ basename_length ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, (libuna_utf32_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) io_handle->basename, io_handle->basename_size, (libuna_utf16_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, (libuna_utf32_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) io_handle->basename, io_handle->basename_size, libclocale_codepage, (libuna_utf16_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); memory_free( io_handle->basename ); io_handle->basename = NULL; io_handle->basename_size = 0; return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Retrieves the segment file size * 0 represents the maximum possible segment file size * Returns 1 if successful or -1 on error */ int libsmraw_io_handle_get_maximum_segment_size( libsmraw_io_handle_t *io_handle, size64_t *maximum_segment_size, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_get_maximum_segment_size"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( maximum_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum segment size.", function ); return( -1 ); } *maximum_segment_size = io_handle->maximum_segment_size; return( 1 ); } /* Sets the segment file size * 0 represents the maximum possible segment file size * Returns 1 if successful or -1 on error */ int libsmraw_io_handle_set_maximum_segment_size( libsmraw_io_handle_t *io_handle, size64_t maximum_segment_size, libcerror_error_t **error ) { static char *function = "libsmraw_io_handle_set_maximum_segment_size"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } io_handle->maximum_segment_size = maximum_segment_size; return( 1 ); } libewf-20140807/libsmraw/libsmraw_libcerror.h0000664000175000017500000000264013443450067023215 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2010-2018, 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( _LIBSMRAW_LIBCERROR_H ) #define _LIBSMRAW_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBSMRAW_LIBCERROR_H ) */ libewf-20140807/libsmraw/libsmraw_notify.h0000664000175000017500000000307313443450067022543 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_NOTIFY_H ) #define _LIBSMRAW_NOTIFY_H #include #include #include #include "libsmraw_extern.h" #include "libsmraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMRAW ) LIBSMRAW_EXTERN \ void libsmraw_notify_set_verbose( int verbose ); LIBSMRAW_EXTERN \ int libsmraw_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_notify_stream_close( libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_NOTIFY_H ) */ libewf-20140807/libsmraw/libsmraw_notify.c0000664000175000017500000000530413443450067022535 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libsmraw_libcerror.h" #include "libsmraw_libcnotify.h" #include "libsmraw_notify.h" #if !defined( HAVE_LOCAL_LIBSMRAW ) /* Sets the verbose notification */ void libsmraw_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libsmraw_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libsmraw_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libsmraw_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libsmraw_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libsmraw_notify_stream_close( libcerror_error_t **error ) { static char *function = "libsmraw_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ libewf-20140807/libsmraw/Makefile.in0000664000175000017500000010535713443455350021237 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libsmraw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsmraw_la_LIBADD = am__libsmraw_la_SOURCES_DIST = libsmraw_codepage.h \ libsmraw_definitions.h libsmraw_error.c libsmraw_error.h \ libsmraw_extern.h libsmraw_filename.c libsmraw_filename.h \ libsmraw_handle.c libsmraw_handle.h \ libsmraw_information_file.c libsmraw_information_file.h \ libsmraw_io_handle.c libsmraw_io_handle.h libsmraw_libbfio.h \ libsmraw_libcerror.h libsmraw_libclocale.h \ libsmraw_libcnotify.h libsmraw_libcthreads.h \ libsmraw_libfdata.h libsmraw_libfvalue.h libsmraw_libuna.h \ libsmraw_notify.c libsmraw_notify.h libsmraw_support.c \ libsmraw_support.h libsmraw_types.h libsmraw_unused.h @HAVE_LOCAL_LIBSMRAW_TRUE@am_libsmraw_la_OBJECTS = libsmraw_error.lo \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_filename.lo \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_handle.lo \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_information_file.lo \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_io_handle.lo \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_notify.lo \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_support.lo libsmraw_la_OBJECTS = $(am_libsmraw_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBSMRAW_TRUE@am_libsmraw_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libsmraw_error.Plo \ ./$(DEPDIR)/libsmraw_filename.Plo \ ./$(DEPDIR)/libsmraw_handle.Plo \ ./$(DEPDIR)/libsmraw_information_file.Plo \ ./$(DEPDIR)/libsmraw_io_handle.Plo \ ./$(DEPDIR)/libsmraw_notify.Plo \ ./$(DEPDIR)/libsmraw_support.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libsmraw_la_SOURCES) DIST_SOURCES = $(am__libsmraw_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBSMRAW_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBSMRAW_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBSMRAW_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBBFIO_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBFCACHE_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBFDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @LIBFVALUE_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMRAW_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBSMRAW_TRUE@noinst_LTLIBRARIES = libsmraw.la @HAVE_LOCAL_LIBSMRAW_TRUE@libsmraw_la_SOURCES = \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_codepage.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_definitions.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_error.c libsmraw_error.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_extern.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_filename.c libsmraw_filename.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_handle.c libsmraw_handle.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_information_file.c libsmraw_information_file.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_io_handle.c libsmraw_io_handle.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libbfio.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libcerror.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libclocale.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libcnotify.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libcthreads.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libfdata.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libfvalue.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_libuna.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_notify.c libsmraw_notify.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_support.c libsmraw_support.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_types.h \ @HAVE_LOCAL_LIBSMRAW_TRUE@ libsmraw_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsmraw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libsmraw/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsmraw.la: $(libsmraw_la_OBJECTS) $(libsmraw_la_DEPENDENCIES) $(EXTRA_libsmraw_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libsmraw_la_rpath) $(libsmraw_la_OBJECTS) $(libsmraw_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_filename.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_information_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmraw_support.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libsmraw_error.Plo -rm -f ./$(DEPDIR)/libsmraw_filename.Plo -rm -f ./$(DEPDIR)/libsmraw_handle.Plo -rm -f ./$(DEPDIR)/libsmraw_information_file.Plo -rm -f ./$(DEPDIR)/libsmraw_io_handle.Plo -rm -f ./$(DEPDIR)/libsmraw_notify.Plo -rm -f ./$(DEPDIR)/libsmraw_support.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libsmraw ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libsmraw_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libsmraw/libsmraw_handle.h0000664000175000017500000003163013443450067022466 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_HANDLE_H ) #define _LIBSMRAW_HANDLE_H #include #include #include "libsmraw_extern.h" #include "libsmraw_information_file.h" #include "libsmraw_io_handle.h" #include "libsmraw_libbfio.h" #include "libsmraw_libcerror.h" #include "libsmraw_libcthreads.h" #include "libsmraw_libfdata.h" #include "libsmraw_libfvalue.h" #include "libsmraw_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libsmraw_internal_handle libsmraw_internal_handle_t; struct libsmraw_internal_handle { /* The IO handle */ libsmraw_io_handle_t *io_handle; /* The segments (file data) stream */ libfdata_stream_t *segments_stream; /* The pool of file IO handles */ libbfio_pool_t *file_io_pool; /* Value to indicate if the file IO pool was created inside the library */ uint8_t file_io_pool_created_in_library; /* The maximum number of open handles in the pool */ int maximum_number_of_open_handles; /* A value to indicate if the read values have been initialized */ uint8_t read_values_initialized; /* A value to indicate if the write values have been initialized */ uint8_t write_values_initialized; /* A value to indicate if the information file * needs to be written on close */ uint8_t write_information_on_close; /* The information file */ libsmraw_information_file_t *information_file; /* The media values table */ libfvalue_table_t *media_values; /* The information values table */ libfvalue_table_t *information_values; /* The integrity hash values table */ libfvalue_table_t *integrity_hash_values; #if defined( HAVE_LIBSMRAW_MULTI_THREAD_SUPPORT ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBSMRAW_EXTERN \ int libsmraw_handle_initialize( libsmraw_handle_t **handle, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_free( libsmraw_handle_t **handle, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_signal_abort( libsmraw_handle_t *handle, libcerror_error_t **error ); int libsmraw_internal_handle_initialize_write_values( libsmraw_internal_handle_t *raw_io_handle, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_open( libsmraw_handle_t *handle, char * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBSMRAW_EXTERN \ int libsmraw_handle_open_wide( libsmraw_handle_t *handle, wchar_t * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBSMRAW_EXTERN \ int libsmraw_handle_open_file_io_pool( libsmraw_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libcerror_error_t **error ); int libsmraw_handle_read_information_file( libsmraw_internal_handle_t *internal_handle, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_close( libsmraw_handle_t *handle, libcerror_error_t **error ); LIBSMRAW_EXTERN \ ssize_t libsmraw_handle_read_buffer( libsmraw_handle_t *handle, void *buffer, size_t buffer_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ ssize_t libsmraw_handle_read_buffer_at_offset( libsmraw_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBSMRAW_EXTERN \ ssize_t libsmraw_handle_write_buffer( libsmraw_handle_t *handle, const void *buffer, size_t buffer_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ ssize_t libsmraw_handle_write_buffer_at_offset( libsmraw_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBSMRAW_EXTERN \ off64_t libsmraw_handle_seek_offset( libsmraw_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_offset( libsmraw_handle_t *handle, off64_t *offset, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_maximum_number_of_open_handles( libsmraw_handle_t *handle, int maximum_number_of_open_handles, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_segment_filename_size( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_segment_filename( libsmraw_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_segment_filename( libsmraw_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBSMRAW_EXTERN \ int libsmraw_handle_get_segment_filename_size_wide( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_segment_filename_wide( libsmraw_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_segment_filename_wide( libsmraw_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBSMRAW_EXTERN \ int libsmraw_handle_get_maximum_segment_size( libsmraw_handle_t *handle, size64_t *maximum_segment_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_maximum_segment_size( libsmraw_handle_t *handle, size64_t maximum_segment_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_filename_size( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_filename( libsmraw_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBSMRAW_EXTERN \ int libsmraw_handle_get_filename_size_wide( libsmraw_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_filename_wide( libsmraw_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBSMRAW_EXTERN \ int libsmraw_handle_get_file_io_handle( libsmraw_handle_t *handle, libbfio_handle_t **file_io_handle, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_media_size( libsmraw_handle_t *handle, size64_t *media_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_media_size( libsmraw_handle_t *handle, size64_t media_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_bytes_per_sector( libsmraw_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_bytes_per_sector( libsmraw_handle_t *handle, uint32_t bytes_per_sector, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_media_type( libsmraw_handle_t *handle, uint8_t *media_type, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_media_type( libsmraw_handle_t *handle, uint8_t media_type, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_media_flags( libsmraw_handle_t *handle, uint8_t *media_flags, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_media_flags( libsmraw_handle_t *handle, uint8_t media_flags, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_number_of_information_values( libsmraw_handle_t *handle, int *number_of_information_values, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_information_value_identifier_size( libsmraw_handle_t *handle, int information_value_index, size_t *identifier_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_information_value_identifier( libsmraw_handle_t *handle, int information_value_index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf8_information_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf8_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_utf8_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf16_information_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf16_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_utf16_information_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_number_of_integrity_hash_values( libsmraw_handle_t *handle, int *number_of_integrity_hash_values, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_integrity_hash_value_identifier_size( libsmraw_handle_t *handle, int integrity_hash_value_index, size_t *identifier_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_integrity_hash_value_identifier( libsmraw_handle_t *handle, int integrity_hash_value_index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf8_integrity_hash_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf8_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_utf8_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf16_integrity_hash_value_size( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_get_utf16_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBSMRAW_EXTERN \ int libsmraw_handle_set_utf16_integrity_hash_value( libsmraw_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_HANDLE_H ) */ libewf-20140807/libsmraw/libsmraw_extern.h0000664000175000017500000000240613443450067022537 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2018, 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( _LIBSMRAW_INTERNAL_EXTERN_H ) #define _LIBSMRAW_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBSMRAW for local use of libsmraw */ #if !defined( HAVE_LOCAL_LIBSMRAW ) #include #define LIBSMRAW_EXTERN_VARIABLE LIBSMRAW_EXTERN #else #define LIBSMRAW_EXTERN /* extern */ #define LIBSMRAW_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ #endif /* !defined( _LIBSMRAW_INTERNAL_EXTERN_H ) */ libewf-20140807/libsmraw/libsmraw_support.c0000664000175000017500000015576613443450067022763 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include "libsmraw_definitions.h" #include "libsmraw_libbfio.h" #include "libsmraw_libcerror.h" #include "libsmraw_libclocale.h" #include "libsmraw_support.h" #if !defined( HAVE_LOCAL_LIBSMRAW ) /* Returns the library version */ const char *libsmraw_get_version( void ) { return( (const char *) LIBSMRAW_VERSION_STRING ); } /* Returns the access flags for reading */ int libsmraw_get_access_flags_read( void ) { return( (int) LIBSMRAW_ACCESS_FLAG_READ ); } /* Returns the access flags for reading and writing */ int libsmraw_get_access_flags_read_write( void ) { return( (int) ( LIBSMRAW_ACCESS_FLAG_READ | LIBSMRAW_ACCESS_FLAG_WRITE ) ); } /* Returns the access flags for writing */ int libsmraw_get_access_flags_write( void ) { return( (int) LIBSMRAW_ACCESS_FLAG_WRITE ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libsmraw_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libsmraw_get_codepage"; if( libclocale_codepage_get( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libsmraw_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libsmraw_set_codepage"; if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ /* Appends a globbed filename to the filenames * Returns 1 if successful or -1 on error */ int libsmraw_glob_append_segment_file( char **filenames[], int *number_of_filenames, const char *segment_filename, libcerror_error_t **error ) { static char *function = "libsmraw_glob_append_segment_file"; void *reallocation = NULL; if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of filenames.", function ); return( -1 ); } if( segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename.", function ); return( -1 ); } reallocation = memory_reallocate( *filenames, sizeof( char * ) * ( *number_of_filenames + 1 ) ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable reallocate filenames.", function ); return( -1 ); } *filenames = reallocation; ( *filenames )[ *number_of_filenames ] = (char *) segment_filename; *number_of_filenames += 1; return( 1 ); } /* Determines if a segment file exists * The segment filename is made up from the prefix and the suffix * Returns 1 if segment file exists, 0 if not or -1 on error */ int libsmraw_glob_exists_segment_file( libbfio_handle_t *file_io_handle, const char *prefix, size_t prefix_length, const char *suffix, size_t suffix_length, char **segment_filename, size_t *segment_filename_size, libcerror_error_t **error ) { static char *function = "libsmraw_glob_exists_segment_file"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( prefix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid prefix.", function ); return( -1 ); } if( prefix_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid prefix length value exceeds maximum.", function ); return( -1 ); } if( ( suffix != NULL ) && ( suffix_length > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid suffix length value exceeds maximum.", function ); return( -1 ); } if( segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename.", function ); return( -1 ); } if( segment_filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename size.", function ); return( -1 ); } /* The segment filename consists of the prefix, an end of string character * and (if provided) the suffix */ *segment_filename_size = prefix_length + 1; if( suffix != NULL ) { *segment_filename_size += suffix_length; } *segment_filename = (char *) memory_allocate( sizeof( char ) * *segment_filename_size ); if( *segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename.", function ); goto on_error; } if( narrow_string_copy( *segment_filename, prefix, prefix_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set prefix in segment filename.", function ); goto on_error; } ( *segment_filename )[ prefix_length ] = 0; if( suffix != NULL ) { if( narrow_string_copy( &( ( *segment_filename )[ prefix_length ] ), suffix, suffix_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set suffix in segment filename.", function ); goto on_error; } ( *segment_filename )[ prefix_length + suffix_length ] = 0; } if( libbfio_file_set_name( file_io_handle, *segment_filename, *segment_filename_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } result = libbfio_handle_exists( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file: %s exists.", function, *segment_filename ); goto on_error; } return( result ); on_error: if( *segment_filename != NULL ) { memory_free( *segment_filename ); *segment_filename = NULL; } *segment_filename_size = 0; return( -1 ); } /* Determines the naming schema * Returns 1 if successful, 0 if no naming schema could be determined or -1 on error */ int libsmraw_glob_determine_naming_schema( const char *suffix, size_t suffix_length, uint8_t *naming_schema, libcerror_error_t **error ) { static char *function = "libsmraw_glob_determine_naming_schema"; size_t suffix_index = 0; if( suffix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid suffix.", function ); return( -1 ); } if( suffix_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid suffix length value exceeds maximum.", function ); return( -1 ); } if( naming_schema == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid naming schema.", function ); return( -1 ); } *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; /* Determine naming schema */ if( suffix_length == 2 ) { if( ( ( suffix[ 0 ] == 'd' ) || ( suffix[ 0 ] == 'D' ) ) && ( ( suffix[ 1 ] == 'd' ) || ( suffix[ 1 ] == 'D' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE; } } else if( suffix_length == 3 ) { if( ( ( suffix[ 0 ] == 'd' ) || ( suffix[ 0 ] == 'D' ) || ( suffix[ 0 ] == 'i' ) || ( suffix[ 0 ] == 'I' ) ) && ( ( suffix[ 1 ] == 'm' ) || ( suffix[ 1 ] == 'M' ) ) && ( ( suffix[ 2 ] == 'g' ) || ( suffix[ 2 ] == 'G' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE; } else if( ( ( suffix[ 0 ] == 'r' ) || ( suffix[ 0 ] == 'R' ) ) && ( ( suffix[ 1 ] == 'a' ) || ( suffix[ 1 ] == 'A' ) ) && ( ( suffix[ 2 ] == 'w' ) || ( suffix[ 2 ] == 'W' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE; } } else if( suffix_length >= 4 ) { for( suffix_index = 0; suffix_index < suffix_length; suffix_index++ ) { if( ( suffix[ suffix_index ] >= '0' ) && ( suffix[ suffix_index ] <= '9' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; } else if( ( suffix_index > 0 ) && ( ( suffix[ suffix_index ] == 'o' ) || ( suffix[ suffix_index ] == 'O' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; break; } else { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; break; } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; if( suffix_index < suffix_length ) { if( ( suffix[ suffix_index ] == 'o' ) || ( suffix[ suffix_index ] == 'O' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; suffix_index++; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; if( suffix_index < suffix_length ) { if( ( suffix[ suffix_index ] == 'f' ) || ( suffix[ suffix_index ] == 'F' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; suffix_index++; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { while( suffix_index < suffix_length ) { if( ( suffix[ suffix_index ] >= '0' ) && ( suffix[ suffix_index ] <= '9' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; } else { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; break; } suffix_index++; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { for( suffix_index = 0; suffix_index < suffix_length; suffix_index++ ) { if( suffix[ suffix_index ] == 'a' ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT; } else if( ( suffix[ suffix_index ] == '0' ) && ( suffix_index < ( suffix_length - 1 ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC; } else if( ( ( suffix[ suffix_index ] == '0' ) || ( suffix[ suffix_index ] == '1' ) ) && ( suffix_index == ( suffix_length - 1 ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC; } else { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; break; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { return( 0 ); } return( 1 ); } /* Globs the files according to common (split) RAW naming schemas * Make sure the value filenames is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmraw_glob( const char *filename, size_t filename_length, char **filenames[], int *number_of_filenames, libcerror_error_t **error ) { char *suffixes[ ] = { ".raw", ".dmg", ".img", ".dd", ".000", ".001", ".00", ".01", ".0", ".1", "aa", "00", "aaa", "000", NULL }; libbfio_handle_t *file_io_handle = NULL; char *identifier = NULL; char *segment_filename = NULL; char *segment_filename_copy = NULL; char *suffix = NULL; static char *function = "libsmraw_glob"; size_t identifier_divider = 0; size_t identifier_expansion_length = 2; size_t identifier_index = 0; size_t identifier_length = 0; size_t segment_filename_copy_index = 0; size_t segment_filename_copy_length = 0; size_t segment_filename_copy_size = 0; size_t segment_filename_size = 0; size_t suffix_length = 0; uint8_t allow_identifier_expansion = 0; uint8_t expand_identifier = 0; uint8_t naming_schema = 0; int maximum_segment_file_identifier = 0; int result = 0; int segment_file_identifier = 0; int suffix_index = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( *filenames != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid filenames value already set.", function ); return( -1 ); } if( number_of_filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of filenames.", function ); return( -1 ); } *number_of_filenames = 0; if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } /* Test if the full filename was provided */ result = libsmraw_glob_exists_segment_file( file_io_handle, filename, filename_length, NULL, 0, &segment_filename, &segment_filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file: %s exists.", function, filename ); goto on_error; } /* Check if there is a segment file with a known suffix */ else if( result == 0 ) { suffix_index = 0; while( result == 0 ) { if( segment_filename != NULL ) { memory_free( segment_filename ); segment_filename = NULL; } suffix = suffixes[ suffix_index ]; if( suffix == NULL ) { break; } suffix_length = narrow_string_length( suffix ); result = libsmraw_glob_exists_segment_file( file_io_handle, filename, filename_length, suffix, suffix_length, &segment_filename, &segment_filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if segment file with suffix: %s exists.", function, suffix ); goto on_error; } suffix_index++; } } if( result == 0 ) { if( segment_filename != NULL ) { memory_free( segment_filename ); } return( 1 ); } if( libsmraw_glob_append_segment_file( filenames, number_of_filenames, segment_filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment filename.", function ); goto on_error; } /* Make a copy of the segment filename to tamper with */ segment_filename_copy = narrow_string_allocate( segment_filename_size + identifier_expansion_length ); if( segment_filename_copy == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename copy.", function ); goto on_error; } if( narrow_string_copy( segment_filename_copy, segment_filename, segment_filename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment filename copy.", function ); goto on_error; } segment_filename_copy[ segment_filename_size - 1 ] = 0; segment_filename_copy_size = segment_filename_size; /* Determine the naming schema */ if( suffix == NULL ) { /* Determine if the segment filename contains a suffix which contains a segment identifier */ segment_filename_copy_index = segment_filename_copy_size - 1; while( segment_filename_copy_index > 0 ) { if( segment_filename_copy[ segment_filename_copy_index ] == '.' ) { identifier = &( segment_filename_copy[ segment_filename_copy_index + 1 ] ); identifier_length = ( segment_filename_copy_size - 1 ) - ( segment_filename_copy_index + 1 ); break; } else if( ( segment_filename_copy[ segment_filename_copy_index ] == '/' ) || ( segment_filename_copy[ segment_filename_copy_index ] == '\\' ) ) { break; } segment_filename_copy_index--; } if( identifier != NULL ) { /* Check if the extension contains a known naming schema */ result = libsmraw_glob_determine_naming_schema( identifier, identifier_length, &naming_schema, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine naming schema.", function ); goto on_error; } } if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { if( identifier == NULL ) { segment_filename_copy_index = segment_filename_copy_size - 1; } /* Determine if the segment filename contains a segment identifier */ while( segment_filename_copy_index > 0 ) { if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) { if( segment_filename_copy[ segment_filename_copy_index ] != '0' ) { identifier = &( segment_filename_copy[ segment_filename_copy_index + 1 ] ); break; } identifier_length++; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT ) { if( segment_filename_copy[ segment_filename_copy_index ] != 'a' ) { identifier = &( segment_filename_copy[ segment_filename_copy_index + 1 ] ); break; } identifier_length++; } else { if( ( segment_filename_copy[ segment_filename_copy_index ] == '0' ) || ( segment_filename_copy[ segment_filename_copy_index ] == '1' ) ) { naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC; identifier_length = 1; } else if( segment_filename_copy[ segment_filename_copy_index ] == 'a' ) { naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT; identifier_length = 1; } else if( ( segment_filename_copy[ segment_filename_copy_index ] == '/' ) || ( segment_filename_copy[ segment_filename_copy_index ] == '\\' ) ) { break; } } segment_filename_copy_index--; } } } else { segment_filename_copy_index = ( segment_filename_copy_size - 1 ) - suffix_length; identifier = &( segment_filename_copy[ segment_filename_copy_index ] ); identifier_length = suffix_length; /* Ignore the extension dot */ if( identifier[ 0 ] == '.' ) { identifier += 1; identifier_length -= 1; } result = libsmraw_glob_determine_naming_schema( identifier, identifier_length, &naming_schema, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine naming schema.", function ); goto on_error; } } if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid naming schema missing value.", function ); goto on_error; } if( naming_schema != LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE ) { if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) { maximum_segment_file_identifier = 1; for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { maximum_segment_file_identifier *= 10; } maximum_segment_file_identifier -= 1; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT ) { maximum_segment_file_identifier = 1; for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { maximum_segment_file_identifier *= 26; } maximum_segment_file_identifier -= 1; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { for( identifier_index = identifier_length - 1; identifier_index > 0; identifier_index-- ) { if( ( identifier[ identifier_index ] < '0' ) || ( identifier[ identifier_index ] > '9' ) ) { break; } } identifier_index++; while( identifier_index < identifier_length ) { maximum_segment_file_identifier *= 10; maximum_segment_file_identifier += (int) ( identifier[ identifier_index ] - '0' ); identifier_index++; } for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { if( ( identifier[ identifier_index ] < '0' ) || ( identifier[ identifier_index ] > '9' ) ) { break; } } identifier_length = identifier_index; } if( ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) || ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) ) { segment_file_identifier = (int) ( identifier[ identifier_length - 1 ] - '0' ); if( identifier_length == 1 ) { allow_identifier_expansion = 1; } } segment_filename_copy_length = segment_filename_copy_size - 1; while( *number_of_filenames < INT_MAX ) { if( ( segment_file_identifier + 1 ) > maximum_segment_file_identifier ) { if( ( allow_identifier_expansion == 0 ) || ( identifier_expansion_length == 0 ) ) { break; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { break; } } segment_file_identifier++; if( expand_identifier != 0 ) { if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) { maximum_segment_file_identifier *= 10; } segment_filename_copy_index = segment_filename_copy_length; while( segment_filename_copy_index > 0 ) { if( &( segment_filename_copy[ segment_filename_copy_index ] ) == &( identifier[ identifier_length - 1 ] ) ) { break; } segment_filename_copy[ segment_filename_copy_index + 1 ] = segment_filename_copy[ segment_filename_copy_index ]; segment_filename_copy_index--; } identifier_expansion_length -= 1; identifier_length += 1; segment_filename_copy_length += 1; expand_identifier = 0; } identifier_divider = 1; if( ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) || ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) ) { if( allow_identifier_expansion != 0 ) { expand_identifier = 1; } for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { identifier[ identifier_length - identifier_index - 1 ] = '0' + (char) ( ( segment_file_identifier / identifier_divider ) % 10 ); if( identifier[ identifier_length - identifier_index - 1 ] != '9' ) { expand_identifier = 0; } identifier_divider *= 10; } } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT ) { for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { identifier[ identifier_length - identifier_index - 1 ] = 'a' + (char) ( ( segment_file_identifier / identifier_divider ) % 26 ); identifier_divider *= 26; } } segment_filename = NULL; segment_filename_size = 0; result = libsmraw_glob_exists_segment_file( file_io_handle, segment_filename_copy, segment_filename_copy_length, NULL, 0, &segment_filename, &segment_filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if segment file: %s exists.", function, segment_filename_copy ); goto on_error; } else if( result == 0 ) { memory_free( segment_filename ); segment_file_identifier--; break; } if( libsmraw_glob_append_segment_file( filenames, number_of_filenames, segment_filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment filename.", function ); memory_free( segment_filename ); goto on_error; } } } if( ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) && ( segment_file_identifier != maximum_segment_file_identifier ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment filename(s).", function ); goto on_error; } memory_free( segment_filename_copy ); segment_filename_copy = NULL; if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } return( 1 ); on_error: if( segment_filename_copy != NULL ) { memory_free( segment_filename_copy ); } if( *filenames != NULL ) { libsmraw_glob_free( *filenames, *number_of_filenames, NULL ); *filenames = NULL; } else if( segment_filename != NULL ) { memory_free( segment_filename ); } *number_of_filenames = 0; if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Frees globbed filenames * Returns 1 if successful or -1 on error */ int libsmraw_glob_free( char *filenames[], int number_of_filenames, libcerror_error_t **error ) { static char *function = "libsmraw_glob_free"; int filename_iterator = 0; if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of filenames value less than zero.", function ); return( -1 ); } for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { memory_free( filenames[ filename_iterator ] ); } memory_free( filenames ); return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Appends a globbed filename to the filenames * Returns 1 if successful or -1 on error */ int libsmraw_glob_wide_append_segment_file( wchar_t **filenames[], int *number_of_filenames, const wchar_t *segment_filename, libcerror_error_t **error ) { static char *function = "libsmraw_glob_wide_append_segment_file"; void *reallocation = NULL; if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of filenames.", function ); return( -1 ); } if( segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename.", function ); return( -1 ); } reallocation = memory_reallocate( *filenames, sizeof( wchar_t * ) * ( *number_of_filenames + 1 ) ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable reallocate filenames.", function ); return( -1 ); } *filenames = reallocation; ( *filenames )[ *number_of_filenames ] = (wchar_t *) segment_filename; *number_of_filenames += 1; return( 1 ); } /* Determines if a segment file exists * The segment filename is made up from the prefix and the suffix * Returns 1 if segment file exists, 0 if not or -1 on error */ int libsmraw_glob_wide_exists_segment_file( libbfio_handle_t *file_io_handle, const wchar_t *prefix, size_t prefix_length, const wchar_t *suffix, size_t suffix_length, wchar_t **segment_filename, size_t *segment_filename_size, libcerror_error_t **error ) { static char *function = "libsmraw_glob_wide_exists_segment_file"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( prefix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid prefix.", function ); return( -1 ); } if( prefix_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid prefix length value exceeds maximum.", function ); return( -1 ); } if( ( suffix != NULL ) && ( suffix_length > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid suffix length value exceeds maximum.", function ); return( -1 ); } if( segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename.", function ); return( -1 ); } if( segment_filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment filename size.", function ); return( -1 ); } /* The segment filename consists of the prefix, an end of string character * and (if provided) the suffix */ *segment_filename_size = prefix_length + 1; if( suffix != NULL ) { *segment_filename_size += suffix_length; } *segment_filename = (wchar_t *) memory_allocate( sizeof( wchar_t ) * *segment_filename_size ); if( *segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename.", function ); goto on_error; } if( wide_string_copy( *segment_filename, prefix, prefix_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set prefix in segment filename.", function ); goto on_error; } ( *segment_filename )[ prefix_length ] = 0; if( suffix != NULL ) { if( wide_string_copy( &( ( *segment_filename )[ prefix_length ] ), suffix, suffix_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set suffix in segment filename.", function ); goto on_error; } ( *segment_filename )[ prefix_length + suffix_length ] = 0; } if( libbfio_file_set_name_wide( file_io_handle, *segment_filename, *segment_filename_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } result = libbfio_handle_exists( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file: %ls exists.", function, *segment_filename ); goto on_error; } return( result ); on_error: if( *segment_filename != NULL ) { memory_free( *segment_filename ); *segment_filename = NULL; } *segment_filename_size = 0; return( -1 ); } /* Determines the naming schema * Returns 1 if successful, 0 if no naming schema could be determined or -1 on error */ int libsmraw_glob_wide_determine_naming_schema( const wchar_t *suffix, size_t suffix_length, uint8_t *naming_schema, libcerror_error_t **error ) { static char *function = "libsmraw_glob_wide_determine_naming_schema"; size_t suffix_index = 0; if( suffix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid suffix.", function ); return( -1 ); } if( suffix_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid suffix length value exceeds maximum.", function ); return( -1 ); } if( naming_schema == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid naming schema.", function ); return( -1 ); } *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; /* Determine naming schema */ if( suffix_length == 2 ) { if( ( ( suffix[ 0 ] == (wchar_t) 'd' ) || ( suffix[ 0 ] == (wchar_t) 'D' ) ) && ( ( suffix[ 1 ] == (wchar_t) 'd' ) || ( suffix[ 1 ] == (wchar_t) 'D' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE; } } else if( suffix_length == 3 ) { if( ( ( suffix[ 0 ] == (wchar_t) 'r' ) || ( suffix[ 0 ] == (wchar_t) 'R' ) ) && ( ( suffix[ 1 ] == (wchar_t) 'a' ) || ( suffix[ 1 ] == (wchar_t) 'A' ) ) && ( ( suffix[ 2 ] == (wchar_t) 'w' ) || ( suffix[ 2 ] == (wchar_t) 'W' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE; } } else if( suffix_length >= 4 ) { for( suffix_index = 0; suffix_index < suffix_length; suffix_index++ ) { if( ( suffix[ suffix_index ] >= (wchar_t) '0' ) && ( suffix[ suffix_index ] <= (wchar_t) '9' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; } else if( ( suffix_index > 0 ) && ( ( suffix[ suffix_index ] == (wchar_t) 'o' ) || ( suffix[ suffix_index ] == (wchar_t) 'O' ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; break; } else { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; break; } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; if( suffix_index < suffix_length ) { if( ( suffix[ suffix_index ] == (wchar_t) 'o' ) || ( suffix[ suffix_index ] == (wchar_t) 'O' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; suffix_index++; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; if( suffix_index < suffix_length ) { if( ( suffix[ suffix_index ] == (wchar_t) 'f' ) || ( suffix[ suffix_index ] == (wchar_t) 'F' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; suffix_index++; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { while( suffix_index < suffix_length ) { if( ( suffix[ suffix_index ] >= (wchar_t) '0' ) && ( suffix[ suffix_index ] <= (wchar_t) '9' ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N; } else { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; break; } suffix_index++; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { for( suffix_index = 0; suffix_index < suffix_length; suffix_index++ ) { if( suffix[ suffix_index ] == (wchar_t) 'a' ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT; } else if( ( suffix[ suffix_index ] == (wchar_t) '0' ) && ( suffix_index < ( suffix_length - 1 ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC; } else if( ( ( suffix[ suffix_index ] == (wchar_t) '0' ) || ( suffix[ suffix_index ] == (wchar_t) '1' ) ) && ( suffix_index == ( suffix_length - 1 ) ) ) { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC; } else { *naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN; break; } } } if( *naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { return( 0 ); } return( 1 ); } /* Globs the files according to common (split) RAW naming schemas * Make sure the value X is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmraw_glob_wide( const wchar_t *filename, size_t filename_length, wchar_t **filenames[], int *number_of_filenames, libcerror_error_t **error ) { wchar_t *suffixes[ ] = { L".raw", L".dmg", L".img", L".dd", L".000", L".001", L".00", L".01", L".0", L".1", L"aa", L"00", L"aaa", L"000", NULL }; libbfio_handle_t *file_io_handle = NULL; wchar_t *identifier = NULL; wchar_t *segment_filename = NULL; wchar_t *segment_filename_copy = NULL; wchar_t *suffix = NULL; static char *function = "libsmraw_glob_wide"; size_t identifier_divider = 0; size_t identifier_expansion_length = 2; size_t identifier_index = 0; size_t identifier_length = 0; size_t segment_filename_copy_index = 0; size_t segment_filename_copy_length = 0; size_t segment_filename_copy_size = 0; size_t segment_filename_size = 0; size_t suffix_length = 0; uint8_t allow_identifier_expansion = 0; uint8_t expand_identifier = 0; uint8_t naming_schema = 0; int maximum_segment_file_identifier = 0; int result = 0; int segment_file_identifier = 0; int suffix_index = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( *filenames != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid filenames value already set.", function ); return( -1 ); } if( number_of_filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of filenames.", function ); return( -1 ); } *number_of_filenames = 0; if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } /* Test if the full filename was provided */ result = libsmraw_glob_wide_exists_segment_file( file_io_handle, filename, filename_length, NULL, 0, &segment_filename, &segment_filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file: %ls exists.", function, filename ); goto on_error; } /* Check if there is a segment file with a known suffix */ else if( result == 0 ) { suffix_index = 0; while( result == 0 ) { if( segment_filename != NULL ) { memory_free( segment_filename ); segment_filename = NULL; } suffix = suffixes[ suffix_index ]; if( suffix == NULL ) { break; } suffix_length = wide_string_length( suffix ); result = libsmraw_glob_wide_exists_segment_file( file_io_handle, filename, filename_length, suffix, suffix_length, &segment_filename, &segment_filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if segment file with suffix: %ls exists.", function, suffix ); goto on_error; } suffix_index++; } } if( result == 0 ) { if( segment_filename != NULL ) { memory_free( segment_filename ); } return( 1 ); } if( libsmraw_glob_wide_append_segment_file( filenames, number_of_filenames, segment_filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment filename.", function ); goto on_error; } /* Make a copy of the segment filename to tamper with */ segment_filename_copy = wide_string_allocate( segment_filename_size + identifier_expansion_length ); if( segment_filename_copy == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename copy.", function ); goto on_error; } if( wide_string_copy( segment_filename_copy, segment_filename, segment_filename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment filename copy.", function ); goto on_error; } segment_filename_copy[ segment_filename_size - 1 ] = 0; segment_filename_copy_size = segment_filename_size; /* Determine the naming schema */ if( suffix == NULL ) { /* Determine if the segment filename contains a suffix which contains a segment identifier */ segment_filename_copy_index = segment_filename_copy_size - 1; while( segment_filename_copy_index > 0 ) { if( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '.' ) { identifier = &( segment_filename_copy[ segment_filename_copy_index + 1 ] ); identifier_length = ( segment_filename_copy_size - 1 ) - ( segment_filename_copy_index + 1 ); break; } else if( ( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '/' ) || ( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '\\' ) ) { break; } segment_filename_copy_index--; } if( identifier != NULL ) { /* Check if the extension contains a known naming schema */ result = libsmraw_glob_wide_determine_naming_schema( identifier, identifier_length, &naming_schema, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine naming schema.", function ); goto on_error; } } if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { if( identifier == NULL ) { segment_filename_copy_index = segment_filename_copy_size - 1; } /* Determine if the segment filename contains a segment identifier */ while( segment_filename_copy_index > 0 ) { if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) { if( segment_filename_copy[ segment_filename_copy_index ] != (wchar_t) '0' ) { identifier = &( segment_filename_copy[ segment_filename_copy_index + 1 ] ); break; } identifier_length++; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT ) { if( segment_filename_copy[ segment_filename_copy_index ] != (wchar_t) 'a' ) { identifier = &( segment_filename_copy[ segment_filename_copy_index + 1 ] ); break; } identifier_length++; } else { if( ( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '0' ) || ( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '1' ) ) { naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC; identifier_length = 1; } else if( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) 'a' ) { naming_schema = LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT; identifier_length = 1; } else if( ( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '/' ) || ( segment_filename_copy[ segment_filename_copy_index ] == (wchar_t) '\\' ) ) { break; } } segment_filename_copy_index--; } } } else { segment_filename_copy_index = ( segment_filename_copy_size - 1 ) - suffix_length; identifier = &( segment_filename_copy[ segment_filename_copy_index ] ); identifier_length = suffix_length; /* Ignore the extension dot */ if( identifier[ 0 ] == (wchar_t) '.' ) { identifier += 1; identifier_length -= 1; } result = libsmraw_glob_wide_determine_naming_schema( identifier, identifier_length, &naming_schema, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine naming schema.", function ); goto on_error; } } if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid naming schema missing value.", function ); goto on_error; } if( naming_schema != LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE ) { if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) { maximum_segment_file_identifier = 1; for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { maximum_segment_file_identifier *= 10; } maximum_segment_file_identifier -= 1; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT ) { maximum_segment_file_identifier = 1; for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { maximum_segment_file_identifier *= 26; } maximum_segment_file_identifier -= 1; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { for( identifier_index = identifier_length - 1; identifier_index > 0; identifier_index-- ) { if( ( identifier[ identifier_index ] < (wchar_t) '0' ) || ( identifier[ identifier_index ] > (wchar_t) '9' ) ) { break; } } identifier_index++; while( identifier_index < identifier_length ) { maximum_segment_file_identifier *= 10; maximum_segment_file_identifier += (int) ( identifier[ identifier_index ] - (wchar_t) '0' ); identifier_index++; } for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { if( ( identifier[ identifier_index ] < (wchar_t) '0' ) || ( identifier[ identifier_index ] > (wchar_t) '9' ) ) { break; } } identifier_length = identifier_index; } if( ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) || ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) ) { segment_file_identifier = (int) ( identifier[ identifier_length - 1 ] - (wchar_t) '0' ); if( identifier_length == 1 ) { allow_identifier_expansion = 1; } } segment_filename_copy_length = segment_filename_copy_size - 1; while( *number_of_filenames < INT_MAX ) { if( ( segment_file_identifier + 1 ) > maximum_segment_file_identifier ) { if( ( allow_identifier_expansion == 0 ) || ( identifier_expansion_length == 0 ) ) { break; } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) { break; } } segment_file_identifier++; if( expand_identifier != 0 ) { if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) { maximum_segment_file_identifier *= 10; } segment_filename_copy_index = segment_filename_copy_length; while( segment_filename_copy_index > 0 ) { if( &( segment_filename_copy[ segment_filename_copy_index ] ) == &( identifier[ identifier_length - 1 ] ) ) { break; } segment_filename_copy[ segment_filename_copy_index + 1 ] = segment_filename_copy[ segment_filename_copy_index ]; segment_filename_copy_index--; } identifier_expansion_length -= 1; identifier_length += 1; segment_filename_copy_length += 1; expand_identifier = 0; } identifier_divider = 1; if( ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC ) || ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) ) { if( allow_identifier_expansion != 0 ) { expand_identifier = 1; } for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { identifier[ identifier_length - identifier_index - 1 ] = (wchar_t) '0' + (wchar_t) ( ( segment_file_identifier / identifier_divider ) % 10 ); if( identifier[ identifier_length - identifier_index - 1 ] != (wchar_t) '9' ) { expand_identifier = 0; } identifier_divider *= 10; } } else if( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT ) { for( identifier_index = 0; identifier_index < identifier_length; identifier_index++ ) { identifier[ identifier_length - identifier_index - 1 ] = (wchar_t) 'a' + (wchar_t) ( ( segment_file_identifier / identifier_divider ) % 26 ); identifier_divider *= 26; } } segment_filename = NULL; segment_filename_size = 0; result = libsmraw_glob_wide_exists_segment_file( file_io_handle, segment_filename_copy, segment_filename_copy_length, NULL, 0, &segment_filename, &segment_filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if segment file: %ls exists.", function, segment_filename_copy ); goto on_error; } else if( result == 0 ) { memory_free( segment_filename ); segment_file_identifier--; break; } if( libsmraw_glob_wide_append_segment_file( filenames, number_of_filenames, segment_filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment filename.", function ); memory_free( segment_filename ); goto on_error; } } } if( ( naming_schema == LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N ) && ( segment_file_identifier != maximum_segment_file_identifier ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment filename(s).", function ); goto on_error; } memory_free( segment_filename_copy ); segment_filename_copy = NULL; if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } return( 1 ); on_error: if( segment_filename_copy != NULL ) { memory_free( segment_filename_copy ); } if( *filenames != NULL ) { libsmraw_glob_wide_free( *filenames, *number_of_filenames, NULL ); *filenames = NULL; } else if( segment_filename != NULL ) { memory_free( segment_filename ); } *number_of_filenames = 0; if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Frees globbed wide filenames * Returns 1 if successful or -1 on error */ int libsmraw_glob_wide_free( wchar_t *filenames[], int number_of_filenames, libcerror_error_t **error ) { static char *function = "libsmraw_glob_wide_free"; int filename_iterator = 0; if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of filenames value less than zero.", function ); return( -1 ); } for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { memory_free( filenames[ filename_iterator ] ); } memory_free( filenames ); return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libsmraw/libsmraw_codepage.h0000664000175000017500000000514113443450067023000 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_INTERNAL_CODEPAGE_H ) #define _LIBSMRAW_INTERNAL_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMRAW ) #include /* Define HAVE_LOCAL_LIBSMRAW for local use of libsmraw * The definitions in are copied here * for local use of libsmraw */ #else /* The codepage definitions */ enum LIBSMRAW_CODEPAGES { LIBSMRAW_CODEPAGE_ASCII = 20127, LIBSMRAW_CODEPAGE_ISO_8859_1 = 28591, LIBSMRAW_CODEPAGE_ISO_8859_2 = 28592, LIBSMRAW_CODEPAGE_ISO_8859_3 = 28593, LIBSMRAW_CODEPAGE_ISO_8859_4 = 28594, LIBSMRAW_CODEPAGE_ISO_8859_5 = 28595, LIBSMRAW_CODEPAGE_ISO_8859_6 = 28596, LIBSMRAW_CODEPAGE_ISO_8859_7 = 28597, LIBSMRAW_CODEPAGE_ISO_8859_8 = 28598, LIBSMRAW_CODEPAGE_ISO_8859_9 = 28599, LIBSMRAW_CODEPAGE_ISO_8859_10 = 28600, LIBSMRAW_CODEPAGE_ISO_8859_11 = 28601, LIBSMRAW_CODEPAGE_ISO_8859_13 = 28603, LIBSMRAW_CODEPAGE_ISO_8859_14 = 28604, LIBSMRAW_CODEPAGE_ISO_8859_15 = 28605, LIBSMRAW_CODEPAGE_ISO_8859_16 = 28606, LIBSMRAW_CODEPAGE_KOI8_R = 20866, LIBSMRAW_CODEPAGE_KOI8_U = 21866, LIBSMRAW_CODEPAGE_WINDOWS_874 = 874, LIBSMRAW_CODEPAGE_WINDOWS_932 = 932, LIBSMRAW_CODEPAGE_WINDOWS_936 = 936, LIBSMRAW_CODEPAGE_WINDOWS_949 = 949, LIBSMRAW_CODEPAGE_WINDOWS_950 = 950, LIBSMRAW_CODEPAGE_WINDOWS_1250 = 1250, LIBSMRAW_CODEPAGE_WINDOWS_1251 = 1251, LIBSMRAW_CODEPAGE_WINDOWS_1252 = 1252, LIBSMRAW_CODEPAGE_WINDOWS_1253 = 1253, LIBSMRAW_CODEPAGE_WINDOWS_1254 = 1254, LIBSMRAW_CODEPAGE_WINDOWS_1255 = 1255, LIBSMRAW_CODEPAGE_WINDOWS_1256 = 1256, LIBSMRAW_CODEPAGE_WINDOWS_1257 = 1257, LIBSMRAW_CODEPAGE_WINDOWS_1258 = 1258 }; #endif /* !defined( HAVE_LOCAL_LIBSMRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMRAW_INTERNAL_CODEPAGE_H ) */ libewf-20140807/libsmraw/libsmraw_unused.h0000664000175000017500000000254613443450067022542 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2010-2018, 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( _LIBSMRAW_INTERNAL_UNUSED_H ) #define _LIBSMRAW_INTERNAL_UNUSED_H #include #if !defined( LIBSMRAW_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBSMRAW_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBSMRAW_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBSMRAW_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBSMRAW_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBSMRAW_INTERNAL_UNUSED_H ) */ libewf-20140807/libsmraw/libsmraw_definitions.h0000664000175000017500000000630413443450067023546 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2010-2018, 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( _LIBSMRAW_DEFINITIONS_H ) #define _LIBSMRAW_DEFINITIONS_H #include #include #define LIBSMRAW_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBSMRAW_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE /* Define HAVE_LOCAL_LIBSMRAW for local use of libsmraw */ #if !defined( HAVE_LOCAL_LIBSMRAW ) #include #else #define LIBSMRAW_VERSION 20181227 /* The version string */ #define LIBSMRAW_VERSION_STRING "20181227" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3 set to 1 to truncate an existing file on write * bit 4-8 not used */ enum LIBSMRAW_ACCESS_FLAGS { LIBSMRAW_ACCESS_FLAG_READ = 0x01, LIBSMRAW_ACCESS_FLAG_WRITE = 0x02, LIBSMRAW_ACCESS_FLAG_TRUNCATE = 0x04 }; /* The file access macros */ #define LIBSMRAW_OPEN_READ ( LIBSMRAW_ACCESS_FLAG_READ ) #define LIBSMRAW_OPEN_READ_WRITE ( LIBSMRAW_ACCESS_FLAG_READ | LIBSMRAW_ACCESS_FLAG_WRITE ) #define LIBSMRAW_OPEN_WRITE ( LIBSMRAW_ACCESS_FLAG_WRITE ) #define LIBSMRAW_OPEN_WRITE_TRUNCATE ( LIBSMRAW_ACCESS_FLAG_WRITE | LIBSMRAW_ACCESS_FLAG_TRUNCATE ) #define LIBSMRAW_OPEN_READ_WRITE_TRUNCATE ( LIBSMRAW_ACCESS_FLAG_READ | LIBSMRAW_ACCESS_FLAG_WRITE | LIBSMRAW_ACCESS_FLAG_TRUNCATE ) /* The default maximum segment size */ #define LIBSMRAW_DEFAULT_MAXIMUM_SEGMENT_SIZE ( 1500 * 1024 * 1024 ) /* The media type definitions */ enum LIBSMRAW_MEDIA_TYPES { LIBSMRAW_MEDIA_TYPE_UNKNOWN = 0, LIBSMRAW_MEDIA_TYPE_FIXED, LIBSMRAW_MEDIA_TYPE_MEMORY, LIBSMRAW_MEDIA_TYPE_OPTICAL, LIBSMRAW_MEDIA_TYPE_REMOVABLE }; /* The media flags definitions */ enum LIBSMRAW_MEDIA_FLAGS { LIBSMRAW_MEDIA_FLAG_PHYSICAL = 0x01 }; #endif /* The segment file naming schema definitions */ enum LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMAS { LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_UNKNOWN = 0, /* Numeric naming schema e.g. * .1, .2, ... .10 ... * .000, .001, ... .010 ... * PREFIX000, PREFIX001, ... */ LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_NUMERIC = (uint8_t) 'n', /* Single naming schema e.g. * .dd * .raw */ LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SINGLE = (uint8_t) '1', /* Split naming schema e.g. * PREFIXaa, PREFIXab, ... */ LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_SPLIT = (uint8_t) 's', /* XofN naming schema e.g. * PREFIX.1of5, PREFIX.2of5, ... */ LIBSMRAW_SEGMENT_FILE_NAMING_SCHEMA_X_OF_N = (uint8_t) 'x' }; #endif libewf-20140807/pyewf-python3/0000775000175000017500000000000013443455447020102 5ustar00lordyestalordyesta00000000000000libewf-20140807/pyewf-python3/Makefile.am0000664000175000017500000000330713421024433022120 0ustar00lordyestalordyesta00000000000000# Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects # subdir-objects will compile the source files to a single version of Python. # Since subdir-objects is being deprecated we copy the source files instead. am__installdirs = "$(DESTDIR)$(pyexecdir3)" pyexecdir = $(pyexecdir3) if HAVE_PYTHON3 AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ am_pyewf_la_rpath = -rpath $(pyexecdir3) BUILT_SOURCES = \ pyewf.c pyewf.h \ pyewf_codepage.c pyewf_codepage.h \ pyewf_datetime.c pyewf_datetime.h \ pyewf_error.c pyewf_error.h \ pyewf_file_entries.c pyewf_file_entries.h \ pyewf_file_entry.c pyewf_file_entry.h \ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ pyewf_handle.c pyewf_handle.h \ pyewf_integer.c pyewf_integer.h \ pyewf_libbfio.h \ pyewf_libcerror.h \ pyewf_libclocale.h \ pyewf_libewf.h \ pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h \ pyewf_unused.h pyexec_LTLIBRARIES = pyewf.la nodist_pyewf_la_SOURCES = $(BUILT_SOURCES) pyewf_la_LIBADD = \ @LIBCERROR_LIBADD@ \ ../libewf/libewf.la @LIBCDATA_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ pyewf_la_CPPFLAGS = $(PYTHON3_CPPFLAGS) pyewf_la_LDFLAGS = -module -avoid-version $(PYTHON3_LDFLAGS) $(BUILT_SOURCES): /bin/cp -f $(top_srcdir)/pyewf/$@ $@ endif MAINTAINERCLEANFILES = \ Makefile.in clean-local: /bin/rm -f pyewf*.[ch] distclean: clean /bin/rm -f Makefile libewf-20140807/pyewf-python3/Makefile.in0000664000175000017500000014472413443455350022154 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pyewf-python3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } LTLIBRARIES = $(pyexec_LTLIBRARIES) @HAVE_PYTHON3_TRUE@pyewf_la_DEPENDENCIES = ../libewf/libewf.la @HAVE_PYTHON3_TRUE@am__objects_1 = pyewf_la-pyewf.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_codepage.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_datetime.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_error.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_file_entries.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_file_entry.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_file_object_io_handle.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_file_objects_io_pool.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_handle.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_integer.lo \ @HAVE_PYTHON3_TRUE@ pyewf_la-pyewf_metadata.lo @HAVE_PYTHON3_TRUE@nodist_pyewf_la_OBJECTS = $(am__objects_1) pyewf_la_OBJECTS = $(nodist_pyewf_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = pyewf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(pyewf_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pyewf_la-pyewf.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_error.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_handle.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_integer.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nodist_pyewf_la_SOURCES) DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = $(pyexecdir3) pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ # Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects # subdir-objects will compile the source files to a single version of Python. # Since subdir-objects is being deprecated we copy the source files instead. am__installdirs = "$(DESTDIR)$(pyexecdir3)" @HAVE_PYTHON3_TRUE@AM_CFLAGS = \ @HAVE_PYTHON3_TRUE@ -I$(top_srcdir)/include \ @HAVE_PYTHON3_TRUE@ -I$(top_srcdir)/common \ @HAVE_PYTHON3_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_PYTHON3_TRUE@ @LIBBFIO_CPPFLAGS@ @HAVE_PYTHON3_TRUE@am_pyewf_la_rpath = -rpath $(pyexecdir3) @HAVE_PYTHON3_TRUE@BUILT_SOURCES = \ @HAVE_PYTHON3_TRUE@ pyewf.c pyewf.h \ @HAVE_PYTHON3_TRUE@ pyewf_codepage.c pyewf_codepage.h \ @HAVE_PYTHON3_TRUE@ pyewf_datetime.c pyewf_datetime.h \ @HAVE_PYTHON3_TRUE@ pyewf_error.c pyewf_error.h \ @HAVE_PYTHON3_TRUE@ pyewf_file_entries.c pyewf_file_entries.h \ @HAVE_PYTHON3_TRUE@ pyewf_file_entry.c pyewf_file_entry.h \ @HAVE_PYTHON3_TRUE@ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ @HAVE_PYTHON3_TRUE@ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ @HAVE_PYTHON3_TRUE@ pyewf_handle.c pyewf_handle.h \ @HAVE_PYTHON3_TRUE@ pyewf_integer.c pyewf_integer.h \ @HAVE_PYTHON3_TRUE@ pyewf_libbfio.h \ @HAVE_PYTHON3_TRUE@ pyewf_libcerror.h \ @HAVE_PYTHON3_TRUE@ pyewf_libclocale.h \ @HAVE_PYTHON3_TRUE@ pyewf_libewf.h \ @HAVE_PYTHON3_TRUE@ pyewf_metadata.c pyewf_metadata.h \ @HAVE_PYTHON3_TRUE@ pyewf_python.h \ @HAVE_PYTHON3_TRUE@ pyewf_unused.h @HAVE_PYTHON3_TRUE@pyexec_LTLIBRARIES = pyewf.la @HAVE_PYTHON3_TRUE@nodist_pyewf_la_SOURCES = $(BUILT_SOURCES) @HAVE_PYTHON3_TRUE@pyewf_la_LIBADD = \ @HAVE_PYTHON3_TRUE@ @LIBCERROR_LIBADD@ \ @HAVE_PYTHON3_TRUE@ ../libewf/libewf.la @HAVE_PYTHON3_TRUE@pyewf_la_CPPFLAGS = $(PYTHON3_CPPFLAGS) @HAVE_PYTHON3_TRUE@pyewf_la_LDFLAGS = -module -avoid-version $(PYTHON3_LDFLAGS) MAINTAINERCLEANFILES = \ Makefile.in all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pyewf-python3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pyewf-python3/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ } uninstall-pyexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ done clean-pyexecLTLIBRARIES: -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) @list='$(pyexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } pyewf.la: $(pyewf_la_OBJECTS) $(pyewf_la_DEPENDENCIES) $(EXTRA_pyewf_la_DEPENDENCIES) $(AM_V_CCLD)$(pyewf_la_LINK) $(am_pyewf_la_rpath) $(pyewf_la_OBJECTS) $(pyewf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_integer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< pyewf_la-pyewf.lo: pyewf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf.Tpo -c -o pyewf_la-pyewf.lo `test -f 'pyewf.c' || echo '$(srcdir)/'`pyewf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf.Tpo $(DEPDIR)/pyewf_la-pyewf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf.c' object='pyewf_la-pyewf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf.lo `test -f 'pyewf.c' || echo '$(srcdir)/'`pyewf.c pyewf_la-pyewf_codepage.lo: pyewf_codepage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_codepage.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_codepage.Tpo -c -o pyewf_la-pyewf_codepage.lo `test -f 'pyewf_codepage.c' || echo '$(srcdir)/'`pyewf_codepage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_codepage.Tpo $(DEPDIR)/pyewf_la-pyewf_codepage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_codepage.c' object='pyewf_la-pyewf_codepage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_codepage.lo `test -f 'pyewf_codepage.c' || echo '$(srcdir)/'`pyewf_codepage.c pyewf_la-pyewf_datetime.lo: pyewf_datetime.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_datetime.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_datetime.Tpo -c -o pyewf_la-pyewf_datetime.lo `test -f 'pyewf_datetime.c' || echo '$(srcdir)/'`pyewf_datetime.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_datetime.Tpo $(DEPDIR)/pyewf_la-pyewf_datetime.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_datetime.c' object='pyewf_la-pyewf_datetime.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_datetime.lo `test -f 'pyewf_datetime.c' || echo '$(srcdir)/'`pyewf_datetime.c pyewf_la-pyewf_error.lo: pyewf_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_error.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_error.Tpo -c -o pyewf_la-pyewf_error.lo `test -f 'pyewf_error.c' || echo '$(srcdir)/'`pyewf_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_error.Tpo $(DEPDIR)/pyewf_la-pyewf_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_error.c' object='pyewf_la-pyewf_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_error.lo `test -f 'pyewf_error.c' || echo '$(srcdir)/'`pyewf_error.c pyewf_la-pyewf_file_entries.lo: pyewf_file_entries.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_entries.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_entries.Tpo -c -o pyewf_la-pyewf_file_entries.lo `test -f 'pyewf_file_entries.c' || echo '$(srcdir)/'`pyewf_file_entries.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_entries.Tpo $(DEPDIR)/pyewf_la-pyewf_file_entries.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_entries.c' object='pyewf_la-pyewf_file_entries.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_entries.lo `test -f 'pyewf_file_entries.c' || echo '$(srcdir)/'`pyewf_file_entries.c pyewf_la-pyewf_file_entry.lo: pyewf_file_entry.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_entry.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_entry.Tpo -c -o pyewf_la-pyewf_file_entry.lo `test -f 'pyewf_file_entry.c' || echo '$(srcdir)/'`pyewf_file_entry.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_entry.Tpo $(DEPDIR)/pyewf_la-pyewf_file_entry.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_entry.c' object='pyewf_la-pyewf_file_entry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_entry.lo `test -f 'pyewf_file_entry.c' || echo '$(srcdir)/'`pyewf_file_entry.c pyewf_la-pyewf_file_object_io_handle.lo: pyewf_file_object_io_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_object_io_handle.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Tpo -c -o pyewf_la-pyewf_file_object_io_handle.lo `test -f 'pyewf_file_object_io_handle.c' || echo '$(srcdir)/'`pyewf_file_object_io_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Tpo $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_object_io_handle.c' object='pyewf_la-pyewf_file_object_io_handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_object_io_handle.lo `test -f 'pyewf_file_object_io_handle.c' || echo '$(srcdir)/'`pyewf_file_object_io_handle.c pyewf_la-pyewf_file_objects_io_pool.lo: pyewf_file_objects_io_pool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_objects_io_pool.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Tpo -c -o pyewf_la-pyewf_file_objects_io_pool.lo `test -f 'pyewf_file_objects_io_pool.c' || echo '$(srcdir)/'`pyewf_file_objects_io_pool.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Tpo $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_objects_io_pool.c' object='pyewf_la-pyewf_file_objects_io_pool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_objects_io_pool.lo `test -f 'pyewf_file_objects_io_pool.c' || echo '$(srcdir)/'`pyewf_file_objects_io_pool.c pyewf_la-pyewf_handle.lo: pyewf_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_handle.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_handle.Tpo -c -o pyewf_la-pyewf_handle.lo `test -f 'pyewf_handle.c' || echo '$(srcdir)/'`pyewf_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_handle.Tpo $(DEPDIR)/pyewf_la-pyewf_handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_handle.c' object='pyewf_la-pyewf_handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_handle.lo `test -f 'pyewf_handle.c' || echo '$(srcdir)/'`pyewf_handle.c pyewf_la-pyewf_integer.lo: pyewf_integer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_integer.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_integer.Tpo -c -o pyewf_la-pyewf_integer.lo `test -f 'pyewf_integer.c' || echo '$(srcdir)/'`pyewf_integer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_integer.Tpo $(DEPDIR)/pyewf_la-pyewf_integer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_integer.c' object='pyewf_la-pyewf_integer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_integer.lo `test -f 'pyewf_integer.c' || echo '$(srcdir)/'`pyewf_integer.c pyewf_la-pyewf_metadata.lo: pyewf_metadata.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_metadata.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_metadata.Tpo -c -o pyewf_la-pyewf_metadata.lo `test -f 'pyewf_metadata.c' || echo '$(srcdir)/'`pyewf_metadata.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_metadata.Tpo $(DEPDIR)/pyewf_la-pyewf_metadata.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_metadata.c' object='pyewf_la-pyewf_metadata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_metadata.lo `test -f 'pyewf_metadata.c' || echo '$(srcdir)/'`pyewf_metadata.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pyexecdir3)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local \ clean-pyexecLTLIBRARIES mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pyexecLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pyewf_la-pyewf.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_error.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_handle.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_integer.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pyexecLTLIBRARIES .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-local \ clean-pyexecLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-pyexecLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-pyexecLTLIBRARIES .PRECIOUS: Makefile @HAVE_PYTHON3_TRUE@ @LIBCDATA_LIBADD@ \ @HAVE_PYTHON3_TRUE@ @LIBCLOCALE_LIBADD@ \ @HAVE_PYTHON3_TRUE@ @LIBCSPLIT_LIBADD@ \ @HAVE_PYTHON3_TRUE@ @LIBUNA_LIBADD@ \ @HAVE_PYTHON3_TRUE@ @LIBCFILE_LIBADD@ \ @HAVE_PYTHON3_TRUE@ @LIBCPATH_LIBADD@ \ @HAVE_PYTHON3_TRUE@ @LIBBFIO_LIBADD@ @HAVE_PYTHON3_TRUE@$(BUILT_SOURCES): @HAVE_PYTHON3_TRUE@ /bin/cp -f $(top_srcdir)/pyewf/$@ $@ clean-local: /bin/rm -f pyewf*.[ch] distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/tests/0000775000175000017500000000000013443455447016510 5ustar00lordyestalordyesta00000000000000libewf-20140807/tests/test_read.sh0000754000175000017500000000546113440662656021023 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # Expert Witness Compression Format (EWF) library read testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; INPUT_DELTA="input_delta"; LS="ls"; TR="tr"; SED="sed"; SORT="sort"; UNIQ="uniq"; WC="wc"; test_read() { echo "Testing read of input:" $*; ./${EWF_TEST_READ} $*; RESULT=$?; echo ""; return ${RESULT}; } EWF_TEST_READ="ewf_test_read"; if ! test -x ${EWF_TEST_READ}; then EWF_TEST_READ="ewf_test_read.exe"; fi if ! test -x ${EWF_TEST_READ}; then echo "Missing executable: ${EWF_TEST_READ}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test read create ${INPUT} directory and place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi RESULT=`${LS} ${INPUT} | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ} | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test read place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi # Run tests for: E01, e01, s01 BASENAMES=`${LS} ${INPUT}/*.??? | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ}`; for BASENAME in ${BASENAMES}; do FILENAMES=`${LS} ${BASENAME}.??? | ${TR} '\n' ' '`; if ! test_read ${FILENAMES}; then exit ${EXIT_FAILURE}; fi done if test -d ${INPUT_DELTA}; then RESULT=`${LS} ${INPUT_DELTA} | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ} | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT_DELTA} directory, to test read place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi BASENAMES=`${LS} ${INPUT_DELTA}/*.??? | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ}`; # Run tests for: d01 for BASENAME in ${BASENAMES}; do FILENAMES=`${LS} ${BASENAME}.??? | ${TR} '\n' ' '`; if ! test_read ${FILENAMES}; then exit ${EXIT_FAILURE}; fi done fi exit ${EXIT_SUCCESS}; libewf-20140807/tests/ewf_test_getopt.c0000664000175000017500000001066113440662656022061 0ustar00lordyestalordyesta00000000000000/* * GetOpt functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "ewf_test_getopt.h" #include "ewf_test_libcnotify.h" #if !defined( HAVE_GETOPT ) /* The option index * Start with argument 1 (argument 0 is the program name) */ int optind = 1; /* The current option argument */ system_character_t *optarg = NULL; /* Value to indicate the current option */ system_integer_t optopt = 0; /* The next option in a group */ system_character_t *next_option = NULL; /* Get the program options * Function for platforms that do not have the getopt function * Returns the option character processed, or -1 on error, * ? if the option was not in the options string, : if the option argument was missing */ system_integer_t ewf_test_getopt( int argument_count, system_character_t * const argument_values[], const system_character_t *options_string ) { system_character_t *argument_value = NULL; system_character_t *option_value = NULL; static char *function = "ewf_test_getopt"; size_t options_string_length = 0; if( next_option != NULL ) { argument_value = next_option; next_option = NULL; } else if( optind >= argument_count ) { return( (system_integer_t) -1 ); } else { argument_value = argument_values[ optind ]; /* Check if the argument value is not an empty string */ if( *argument_value == (system_character_t) '\0' ) { return( (system_integer_t) -1 ); } /* Check if the first character is a option marker '-' */ if( *argument_value != (system_character_t) '-' ) { return( (system_integer_t) -1 ); } argument_value++; /* Check if long options are provided '--' */ if( *argument_value == (system_character_t) '-' ) { optind++; return( (system_integer_t) -1 ); } } options_string_length = system_string_length( options_string ); optopt = *argument_value; option_value = system_string_search_character( options_string, optopt, options_string_length ); argument_value++; /* Check if an argument was specified or that the option was not found * in the option string */ if( ( optopt == (system_integer_t) ':' ) || ( option_value == NULL ) ) { if( *argument_value == (system_character_t) '\0' ) { optind++; } if( ( *options_string != (system_character_t) ':' ) && ( optopt != (system_integer_t) '?' ) ) { libcnotify_printf( "%s: no such option: %" PRIc_SYSTEM ".\n", function, optopt ); } return( (system_integer_t) '?' ); } option_value++; /* Check if no option argument is required */ if( *option_value != (system_character_t) ':' ) { optarg = NULL; if( *argument_value == (system_character_t) '\0' ) { optind++; } else { /* Multiple options are grouped */ next_option = argument_value; } } /* Check if the argument is right after the option flag with no space in between */ else if( *argument_value != (system_character_t) '\0' ) { optarg = argument_value; optind++; } else { optind++; /* Check if the argument was provided as the next argument value */ if( argument_count <= optind ) { if( *option_value == ':' ) { return( (system_integer_t) ':' ); } libcnotify_printf( "%s: option: %" PRIc_SYSTEM " requires an argument.\n", function, optopt ); return( (system_integer_t) '?' ); } optarg = argument_values[ optind ]; optind++; } return( optopt ); } #endif /* !defined( HAVE_GETOPT ) */ libewf-20140807/tests/test_ewfexport.sh0000775000175000017500000000705113440663047022126 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfexport testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; TMP="tmp"; LS="ls"; TR="tr"; WC="wc"; test_export_raw() { INPUT_FILE=$1; mkdir ${TMP}; ${EWFEXPORT} -q -d sha1 ${INPUT_FILE} < * * 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_GETOPT_H ) #define _EWF_TEST_GETOPT_H #include #include /* unistd.h is included here to export getopt, optarg, optind and optopt */ #if defined( HAVE_UNISTD_H ) #include #endif #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_GETOPT ) #define ewf_test_getopt( argument_count, argument_values, options_string ) \ getopt( argument_count, argument_values, options_string ) #else #if !defined( __CYGWIN__ ) extern int optind; extern system_character_t *optarg; extern system_integer_t optopt; #else int optind; system_character_t *optarg; system_integer_t optopt; #endif /* !defined( __CYGWIN__ ) */ system_integer_t ewf_test_getopt( int argument_count, system_character_t * const argument_values[], const system_character_t *options_string ); #endif /* defined( HAVE_GETOPT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _EWF_TEST_GETOPT_H ) */ libewf-20140807/tests/ewf_test_write.c0000664000175000017500000003253513440662656021715 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library write testing program * * 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 . */ #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_write generate verbose output #define EWF_TEST_WRITE_VERBOSE */ /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error */ int ewf_test_system_string_decimal_copy_to_64_bit( const system_character_t *string, size_t string_size, uint64_t *value_64bit, libcerror_error_t **error ) { static char *function = "ewf_test_system_string_decimal_copy_to_64_bit"; size_t string_index = 0; system_character_t character_value = 0; uint8_t maximum_string_index = 20; int8_t sign = 1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( value_64bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value 64-bit.", function ); return( -1 ); } *value_64bit = 0; if( string[ string_index ] == (system_character_t) '-' ) { string_index++; maximum_string_index++; sign = -1; } else if( string[ string_index ] == (system_character_t) '+' ) { string_index++; maximum_string_index++; } while( string_index < string_size ) { if( string[ string_index ] == 0 ) { break; } if( string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } *value_64bit *= 10; if( ( string[ string_index ] >= (system_character_t) '0' ) && ( string[ string_index ] <= (system_character_t) '9' ) ) { character_value = (system_character_t) ( string[ string_index ] - (system_character_t) '0' ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: %" PRIc_SYSTEM " at index: %d.", function, string[ string_index ], string_index ); return( -1 ); } *value_64bit += character_value; string_index++; } if( sign == -1 ) { *value_64bit *= (uint64_t) -1; } return( 1 ); } /* Tests writing data of media size to EWF file(s) with a maximum segment size * Return 1 if successful, 0 if not or -1 on error */ int ewf_test_write( const system_character_t *filename, size64_t media_size, size64_t maximum_segment_size, int8_t compression_level, uint8_t compression_flags, libcerror_error_t **error ) { libewf_handle_t *handle = NULL; uint8_t *buffer = NULL; static char *function = "ewf_test_write"; size_t write_size = 0; ssize_t write_count = 0; int sector_iterator = 0; if( libewf_handle_initialize( &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, (wchar_t * const *) &filename, 1, LIBEWF_OPEN_WRITE, error ) != 1 ) #else if( libewf_handle_open( handle, (char * const *) &filename, 1, LIBEWF_OPEN_WRITE, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle.", function ); goto on_error; } if( media_size > 0 ) { if( libewf_handle_set_media_size( handle, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set media size.", function ); goto on_error; } } if( maximum_segment_size > 0 ) { if( libewf_handle_set_maximum_segment_size( handle, maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set maximum segment size.", function ); goto on_error; } } if( libewf_handle_set_compression_values( handle, compression_level, compression_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set compression values.", function ); goto on_error; } buffer = (uint8_t *) memory_allocate( EWF_TEST_BUFFER_SIZE ); if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable created buffer.", function ); goto on_error; } write_size = 512; for( sector_iterator = 0; sector_iterator < 26; sector_iterator++ ) { if( memory_set( buffer, (int) 'A' + sector_iterator, write_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable set value in buffer.", function ); goto on_error; } write_count = libewf_handle_write_buffer( handle, buffer, write_size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, write_size ); goto on_error; } if( write_count != (ssize_t) write_size ) { if( (size64_t) write_count != media_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, write_size ); goto on_error; } } if( media_size > 0 ) { media_size -= write_count; } } write_size = 3751; for( sector_iterator = 0; sector_iterator < 26; sector_iterator++ ) { if( memory_set( buffer, (int) 'a' + sector_iterator, write_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable set value in buffer.", function ); goto on_error; } write_count = libewf_handle_write_buffer( handle, buffer, write_size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, write_size ); goto on_error; } if( write_count != (ssize_t) write_size ) { if( (size64_t) write_count != media_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, write_size ); goto on_error; } } if( media_size > 0 ) { media_size -= write_count; } } memory_free( buffer ); buffer = NULL; if( libewf_handle_close( handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } if( libewf_handle_free( &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free handle.", function ); goto on_error; } return( 1 ); on_error: if( buffer != NULL ) { memory_free( buffer ); } if( handle != NULL ) { libewf_handle_close( handle, NULL ); libewf_handle_free( &handle, NULL ); } return( -1 ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { 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, _SYSTEM_STRING( "b:B:c:S:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); case (system_integer_t) 'b': option_chunk_size = optarg; break; case (system_integer_t) 'B': option_media_size = optarg; break; case (system_integer_t) 'c': option_compression_level = optarg; break; case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; } } if( optind == argc ) { fprintf( stderr, "Missing EWF image filename.\n" ); return( EXIT_FAILURE ); } #if defined( HAVE_DEBUG_OUTPUT ) && defined( EWF_TEST_WRITE_VERBOSE ) libewf_notify_set_verbose( 1 ); libewf_notify_set_stream( stderr, NULL ); #endif if( option_chunk_size != NULL ) { string_length = system_string_length( option_chunk_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_chunk_size, string_length + 1, &chunk_size, &error ) != 1 ) { fprintf( stderr, "Unsupported chunk size.\n" ); goto on_error; } } if( option_compression_level != NULL ) { string_length = system_string_length( option_compression_level ); if( string_length != 1 ) { fprintf( stderr, "Unsupported compression level.\n" ); goto on_error; } if( option_compression_level[ 0 ] == (system_character_t) 'n' ) { compression_level = LIBEWF_COMPRESSION_NONE; compression_flags = 0; } 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 ] == (system_character_t) 'f' ) { compression_level = LIBEWF_COMPRESSION_FAST; compression_flags = 0; } else if( option_compression_level[ 0 ] == (system_character_t) 'b' ) { compression_level = LIBEWF_COMPRESSION_BEST; compression_flags = 0; } else { fprintf( stderr, "Unsupported compression level.\n" ); goto on_error; } } if( option_maximum_segment_size != NULL ) { string_length = system_string_length( option_maximum_segment_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_maximum_segment_size, string_length + 1, &maximum_segment_size, &error ) != 1 ) { fprintf( stderr, "Unsupported maximum segment size.\n" ); goto on_error; } } if( option_media_size != NULL ) { string_length = system_string_length( option_media_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_media_size, string_length + 1, &media_size, &error ) != 1 ) { fprintf( stderr, "Unsupported media size.\n" ); goto on_error; } } if( ewf_test_write( argv[ optind ], media_size, maximum_segment_size, compression_level, compression_flags, &error ) != 1 ) { fprintf( stderr, "Unable to test write.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } return( EXIT_FAILURE ); } libewf-20140807/tests/test_glob.sh0000754000175000017500000003232613440662656021033 0ustar00lordyestalordyesta00000000000000#!/bin/bash # Library glob testing script # # Version: 20180317 EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; chr() { local CHR_VALUE=`expr \( \( $1 / 64 \) \* 100 \) + \( \( \( $1 % 64 \) / 8 \) \* 10 \) + \( $1 % 8 \)`; printf \\${CHR_VALUE}; } seq() { local VALUE=$1; local SEQUENCE=""; while test ${VALUE} -le $2; do if test ${VALUE} -le 9; then SEQUENCE="${SEQUENCE} 0${VALUE}"; else SEQUENCE="${SEQUENCE} ${VALUE}"; fi VALUE=`expr ${VALUE} + 1`; done echo ${SEQUENCE}; } test_glob_sequence2() { local TEST_EXECUTABLE=$1; local BASENAME=$2; local SCHEMA=$3; local FILENAMES=$4; local TMPDIR="tmp$$"; rm -rf ${TMPDIR}; mkdir ${TMPDIR}; if test "${OSTYPE}" = "msys"; then TEST_PATH="${TMPDIR}\\${BASENAME}"; FILENAMES=`echo ${FILENAMES} | sed "s?^?${TMPDIR}\\\\\\\\?" | sed "s? ? ${TMPDIR}\\\\\\\\?g"`; else TEST_PATH="${TMPDIR}/${BASENAME}"; FILENAMES=`echo ${FILENAMES} | sed "s?^?${TMPDIR}/?" | sed "s? ? ${TMPDIR}/?g"`; fi echo ${FILENAMES} > ${TMPDIR}/input; touch ${FILENAMES}; TEST_DESCRIPTION=""; run_test_with_arguments "${TEST_DESCRIPTION}" "${TEST_EXECUTABLE}" "${TEST_PATH}" > ${TMPDIR}/output; RESULT=$?; if test ${RESULT} -eq ${EXIT_SUCCESS}; then sed 's/\r\n/\n/' -i ${TMPDIR}/output; if ! cmp -s ${TMPDIR}/input ${TMPDIR}/output; then RESULT=${EXIT_FAILURE}; fi fi rm -rf ${TMPDIR}; echo -n "Testing glob: for basename: ${BASENAME} and schema: ${SCHEMA} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } test_glob_sequence3() { local TEST_EXECUTABLE=$1; local BASENAME=$2; local SCHEMA=$3; local FILENAME=$4; local LAST=$5; local RESULT=`echo ${SCHEMA} | egrep "^[.][esEL]01$"`; local IS_VALID=$?; if test ${IS_VALID} -ne 0; then echo "Unsupported schema: ${SCHEMA}"; exit ${EXIT_FAILURE}; fi RESULT=`echo ${LAST} | egrep "^[e-zE-Z][0-9a-zA-Z][0-9a-zA-Z]$"`; IS_VALID=$?; if test ${IS_VALID} -ne 0; then echo "Unsupported last: ${LAST}"; exit ${EXIT_FAILURE}; fi FIRST_LETTER=`echo ${SCHEMA} | cut -c 2`; RESULT=`echo ${LAST} | egrep "^${FIRST_LETTER}[0-9][0-9]$"`; LAST_IS_NUMERIC=$?; if test ${LAST_IS_NUMERIC} -eq 0; then LAST=`echo ${LAST} | cut -c '2 3'`; SEQUENCE=`seq 1 ${LAST}`; else SEQUENCE=`seq 1 99`; fi FILENAMES=`for NUMBER in ${SEQUENCE}; do echo -n "${FILENAME}.${FIRST_LETTER}${NUMBER} "; echo $FILE; done`; if test ${LAST_IS_NUMERIC} -ne 0; then RESULT=`echo ${LAST} | egrep "^[A-Z][A-Z][A-Z]$"`; IS_UPPER_CASE=$?; SECOND_ITERATOR=0; THIRD_ITERATOR=0; if test ${IS_UPPER_CASE} -eq 0; then if test ${FIRST_LETTER} = "E"; then FIRST_ITERATOR=4; elif test ${FIRST_LETTER} = "L"; then FIRST_ITERATOR=11; fi FIRST_BYTE_VALUE=`expr 65 + ${FIRST_ITERATOR}`; SECOND_BYTE_VALUE=`expr 65 + ${SECOND_ITERATOR}`; THIRD_BYTE_VALUE=`expr 65 + ${THIRD_ITERATOR}`; else if test ${FIRST_LETTER} = "e"; then FIRST_ITERATOR=4; elif test ${FIRST_LETTER} = "s"; then FIRST_ITERATOR=18; fi FIRST_BYTE_VALUE=`expr 97 + ${FIRST_ITERATOR}`; SECOND_BYTE_VALUE=`expr 97 + ${SECOND_ITERATOR}`; THIRD_BYTE_VALUE=`expr 97 + ${THIRD_ITERATOR}`; fi FIRST_LETTER=`chr ${FIRST_BYTE_VALUE}`; SECOND_LETTER=`chr ${SECOND_BYTE_VALUE}`; THIRD_LETTER=`chr ${THIRD_BYTE_VALUE}`; EXTENSION="${FIRST_LETTER}${SECOND_LETTER}${THIRD_LETTER}"; until test ${EXTENSION} = ${LAST}; do FILENAMES="${FILENAMES} ${FILENAME}.${EXTENSION}"; THIRD_ITERATOR=`expr ${THIRD_ITERATOR} + 1`; if test ${THIRD_ITERATOR} -ge 26; then SECOND_ITERATOR=`expr ${SECOND_ITERATOR} + 1`; THIRD_ITERATOR=0; fi if test ${SECOND_ITERATOR} -ge 26; then FIRST_ITERATOR=`expr ${FIRST_ITERATOR} + 1`; SECOND_ITERATOR=0; fi if test ${FIRST_ITERATOR} -ge 26; then break; fi if test ${IS_UPPER_CASE} -eq 0; then FIRST_BYTE_VALUE=`expr 65 + ${FIRST_ITERATOR}`; SECOND_BYTE_VALUE=`expr 65 + ${SECOND_ITERATOR}`; THIRD_BYTE_VALUE=`expr 65 + ${THIRD_ITERATOR}`; else FIRST_BYTE_VALUE=`expr 97 + ${FIRST_ITERATOR}`; SECOND_BYTE_VALUE=`expr 97 + ${SECOND_ITERATOR}`; THIRD_BYTE_VALUE=`expr 97 + ${THIRD_ITERATOR}`; fi FIRST_LETTER=`chr ${FIRST_BYTE_VALUE}`; SECOND_LETTER=`chr ${SECOND_BYTE_VALUE}`; THIRD_LETTER=`chr ${THIRD_BYTE_VALUE}`; EXTENSION="${FIRST_LETTER}${SECOND_LETTER}${THIRD_LETTER}"; done FILENAMES="${FILENAMES} ${FILENAME}.${EXTENSION}"; fi TMPDIR="tmp$$"; rm -rf ${TMPDIR}; mkdir ${TMPDIR}; if test "${OSTYPE}" = "msys"; then TEST_PATH="${TMPDIR}\\${BASENAME}"; FILENAMES=`echo ${FILENAMES} | sed "s?^?${TMPDIR}\\\\\\\\?" | sed "s? ? ${TMPDIR}\\\\\\\\?g"`; else TEST_PATH="${TMPDIR}/${BASENAME}"; FILENAMES=`echo ${FILENAMES} | sed "s?^?${TMPDIR}/?" | sed "s? ? ${TMPDIR}/?g"`; fi echo ${FILENAMES} > ${TMPDIR}/input; touch ${FILENAMES}; TEST_DESCRIPTION=""; run_test_with_arguments "${TEST_DESCRIPTION}" "${TEST_EXECUTABLE}" "${TEST_PATH}" > ${TMPDIR}/output; RESULT=$?; if test ${RESULT} -eq ${EXIT_SUCCESS}; then sed 's/\r\n/\n/' -i ${TMPDIR}/output; if ! cmp -s ${TMPDIR}/input ${TMPDIR}/output; then RESULT=${EXIT_FAILURE}; fi fi rm -rf ${TMPDIR}; echo -n "Testing glob: for basename: ${BASENAME} and schema: ${SCHEMA} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } test_glob_sequence4() { local TEST_EXECUTABLE=$1; local BASENAME=$2; local SCHEMA=$3; local FILENAME=$4; local LAST=$5; local RESULT=`echo ${SCHEMA} | egrep "^[.][EL]x01$"`; local IS_VALID=$?; if test ${IS_VALID} -ne 0; then echo "Unsupported schema: ${SCHEMA}"; exit ${EXIT_FAILURE}; fi RESULT=`echo ${LAST} | egrep "^[EL][x-z][0-9A-Z][0-9A-Z]$"`; IS_VALID=$?; if test ${IS_VALID} -ne 0; then echo "Unsupported last: ${LAST}"; exit ${EXIT_FAILURE}; fi FIRST_LETTER=`echo ${SCHEMA} | cut -c 2`; SECOND_LETTER=`echo ${SCHEMA} | cut -c 3`; RESULT=`echo ${LAST} | egrep "^${FIRST_LETTER}${SECOND_LETTER}[0-9][0-9]$"`; LAST_IS_NUMERIC=$?; if test ${LAST_IS_NUMERIC} -eq 0; then LAST=`echo ${LAST} | cut -c '3 4'`; SEQUENCE=`seq 1 ${LAST}`; else SEQUENCE=`seq 1 99`; fi FILENAMES=`for NUMBER in ${SEQUENCE}; do echo -n "${FILENAME}.${FIRST_LETTER}${SECOND_LETTER}${NUMBER} "; echo $FILE; done`; if test ${LAST_IS_NUMERIC} -ne 0; then SECOND_ITERATOR=23; THIRD_ITERATOR=0; FOURTH_ITERATOR=0; SECOND_BYTE_VALUE=`expr 97 + ${SECOND_ITERATOR}`; THIRD_BYTE_VALUE=`expr 65 + ${THIRD_ITERATOR}`; FOURTH_BYTE_VALUE=`expr 65 + ${FOURTH_ITERATOR}`; SECOND_LETTER=`chr ${SECOND_BYTE_VALUE}`; THIRD_LETTER=`chr ${THIRD_BYTE_VALUE}`; FOURTH_LETTER=`chr ${FOURTH_BYTE_VALUE}`; EXTENSION="${FIRST_LETTER}${SECOND_LETTER}${THIRD_LETTER}${FOURTH_LETTER}"; until test ${EXTENSION} = ${LAST}; do FILENAMES="${FILENAMES} ${FILENAME}.${EXTENSION}"; FOURTH_ITERATOR=`expr ${FOURTH_ITERATOR} + 1`; if test ${FOURTH_ITERATOR} -ge 26; then THIRD_ITERATOR=`expr ${THIRD_ITERATOR} + 1`; FOURTH_ITERATOR=0; fi if test ${THIRD_ITERATOR} -ge 26; then SECOND_ITERATOR=`expr ${SECOND_ITERATOR} + 1`; THIRD_ITERATOR=0; fi if test ${SECOND_ITERATOR} -ge 26; then break; fi SECOND_BYTE_VALUE=`expr 97 + ${SECOND_ITERATOR}`; THIRD_BYTE_VALUE=`expr 65 + ${THIRD_ITERATOR}`; FOURTH_BYTE_VALUE=`expr 65 + ${FOURTH_ITERATOR}`; SECOND_LETTER=`chr ${SECOND_BYTE_VALUE}`; THIRD_LETTER=`chr ${THIRD_BYTE_VALUE}`; FOURTH_LETTER=`chr ${FOURTH_BYTE_VALUE}`; EXTENSION="${FIRST_LETTER}${SECOND_LETTER}${THIRD_LETTER}${FOURTH_LETTER}"; done FILENAMES="${FILENAMES} ${FILENAME}.${EXTENSION}"; fi TMPDIR="tmp$$"; rm -rf ${TMPDIR}; mkdir ${TMPDIR}; if test "${OSTYPE}" = "msys"; then TEST_PATH="${TMPDIR}\\${BASENAME}"; FILENAMES=`echo ${FILENAMES} | sed "s?^?${TMPDIR}\\\\\\\\?" | sed "s? ? ${TMPDIR}\\\\\\\\?g"`; else TEST_PATH="${TMPDIR}/${BASENAME}"; FILENAMES=`echo ${FILENAMES} | sed "s?^?${TMPDIR}/?" | sed "s? ? ${TMPDIR}/?g"`; fi echo ${FILENAMES} > ${TMPDIR}/input; touch ${FILENAMES}; TEST_DESCRIPTION=""; run_test_with_arguments "${TEST_DESCRIPTION}" "${TEST_EXECUTABLE}" "${TEST_PATH}" > ${TMPDIR}/output; RESULT=$?; if test ${RESULT} -eq ${EXIT_SUCCESS}; then sed 's/\r\n/\n/' -i ${TMPDIR}/output; if ! cmp -s ${TMPDIR}/input ${TMPDIR}/output; then RESULT=${EXIT_FAILURE}; fi fi rm -rf ${TMPDIR}; echo -n "Testing glob: for basename: ${BASENAME} and schema: ${SCHEMA} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } if ! test -z ${SKIP_LIBRARY_TESTS}; then exit ${EXIT_IGNORE}; fi OPERATING_SYSTEM=`uname -o 2> /dev/null`; if test "${OPERATING_SYSTEM}" = "Cygwin" || test "${OPERATING_SYSTEM}" = "Msys"; then # The glob tests run very slow on Cygwin and Msys. exit ${EXIT_IGNORE}; fi TEST_EXECUTABLE="./ewf_test_glob"; if ! test -x "${TEST_EXECUTABLE}"; then TEST_EXECUTABLE="ewf_test_glob.exe"; fi if ! test -x "${TEST_EXECUTABLE}"; then echo "Missing test executable: ${TEST_EXECUTABLE}"; exit ${EXIT_FAILURE}; fi TEST_RUNNER="tests/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then TEST_RUNNER="./test_runner.sh"; fi if ! test -f "${TEST_RUNNER}"; then echo "Missing test runner: ${TEST_RUNNER}"; exit ${EXIT_FAILURE}; fi source ${TEST_RUNNER}; # .e01 test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.e01" ".e01" "PREFIX.e01"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.e01" ".e01" "PREFIX.e01 PREFIX.e02 PREFIX.e03 PREFIX.e04 PREFIX.e05 PREFIX.e06 PREFIX.e07 PREFIX.e08 PREFIX.e09"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.e01" ".e01" "PREFIX.e01 PREFIX.e02 PREFIX.e03 PREFIX.e04 PREFIX.e05 PREFIX.e06 PREFIX.e07 PREFIX.e08 PREFIX.e09 PREFIX.e10 PREFIX.e11"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.e01" ".e01" "PREFIX" "eba"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.e01" ".e01" "PREFIX" "faa"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi # .s01 test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.s01" ".s01" "PREFIX.s01"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.s01" ".s01" "PREFIX.s01 PREFIX.s02 PREFIX.s03 PREFIX.s04 PREFIX.s05 PREFIX.s06 PREFIX.s07 PREFIX.s08 PREFIX.s09"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.s01" ".s01" "PREFIX.s01 PREFIX.s02 PREFIX.s03 PREFIX.s04 PREFIX.s05 PREFIX.s06 PREFIX.s07 PREFIX.s08 PREFIX.s09 PREFIX.s10 PREFIX.s11"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.s01" ".s01" "PREFIX" "sba"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.s01" ".s01" "PREFIX" "taa"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi # .E01 test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.E01" ".E01" "PREFIX.E01"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.E01" ".E01" "PREFIX.E01 PREFIX.E02 PREFIX.E03 PREFIX.E04 PREFIX.E05 PREFIX.E06 PREFIX.E07 PREFIX.E08 PREFIX.E09"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.E01" ".E01" "PREFIX.E01 PREFIX.E02 PREFIX.E03 PREFIX.E04 PREFIX.E05 PREFIX.E06 PREFIX.E07 PREFIX.E08 PREFIX.E09 PREFIX.E10 PREFIX.E11"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.E01" ".E01" "PREFIX" "EBA"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.E01" ".E01" "PREFIX" "FAA"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi # .L01 test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.L01" ".L01" "PREFIX.L01"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.L01" ".L01" "PREFIX.L01 PREFIX.L02 PREFIX.L03 PREFIX.L04 PREFIX.L05 PREFIX.L06 PREFIX.L07 PREFIX.L08 PREFIX.L09"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence2 "${TEST_EXECUTABLE}" "PREFIX.L01" ".L01" "PREFIX.L01 PREFIX.L02 PREFIX.L03 PREFIX.L04 PREFIX.L05 PREFIX.L06 PREFIX.L07 PREFIX.L08 PREFIX.L09 PREFIX.L10 PREFIX.L11"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.L01" ".L01" "PREFIX" "LBA"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi test_glob_sequence3 "${TEST_EXECUTABLE}" "PREFIX.L01" ".L01" "PREFIX" "MAA"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then exit ${EXIT_FAILURE}; fi exit ${EXIT_SUCCESS}; libewf-20140807/tests/ewf_test_read_write.c0000664000175000017500000005633413440662656022713 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library read/write testing program * * 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 . */ #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_read_write generate verbose output #define EWF_TEST_READ_WRITE_VERBOSE */ /* Tests libewf_handle_seek_offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_seek_offset( libewf_handle_t *handle, off64_t input_offset, int input_whence, off64_t expected_offset, libcerror_error_t **error ) { static char *function = "ewf_test_seek_offset"; off64_t result_offset = 0; result_offset = libewf_handle_seek_offset( handle, input_offset, input_whence, error ); if( result_offset != expected_offset ) { if( result_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, input_offset ); return( -1 ); } fprintf( stderr, "%s: unexpected result offset: %" PRIi64 "\n", function, result_offset ); return( 0 ); } if( result_offset == -1 ) { libcerror_error_free( error ); } return( 1 ); } /* Tests libewf_handle_read_buffer and libewf_handle_write_buffer * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_write_buffer( libewf_handle_t *handle, uint8_t *buffer, size_t buffer_size, size64_t input_size, size64_t expected_size, libcerror_error_t **error ) { static char *function = "ewf_test_read_write_buffer"; size64_t remaining_size = 0; size64_t result_size = 0; size_t read_size = 0; ssize_t read_count = 0; ssize_t write_count = 0; remaining_size = input_size; while( remaining_size > 0 ) { read_size = buffer_size; if( remaining_size < (size64_t) read_size ) { read_size = (size_t) remaining_size; } read_count = libewf_handle_read_buffer( handle, buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer of size: %" PRIzd ".", function, read_size ); return( -1 ); } else if( read_count == 0 ) { break; } if( libewf_handle_seek_offset( handle, -1 * (off64_t) read_count, SEEK_CUR, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek previous offset.", function ); return( -1 ); } if( memory_set( buffer, (int) 'B', (size_t) read_count ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable set value in buffer.", function ); return( -1 ); } write_count = libewf_handle_write_buffer( handle, buffer, (size_t) read_count, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, read_count ); return( -1 ); } if( write_count != read_count ) { break; } remaining_size -= (size64_t) write_count; result_size += (size64_t) write_count; } if( expected_size != result_size ) { fprintf( stderr, "%s: unexpected read/write count: %" PRIu64 "\n", function, result_size ); return( 0 ); } return( 1 ); } /* Tests libewf_handle_read_chunk, libewf_handle_write_chunk, libewf_handle_prepare_read_chunk and libewf_handle_prepare_write_chunk * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_write_chunk( libewf_handle_t *handle, uint8_t *data_buffer, size_t data_buffer_size, uint8_t *chunk_buffer, size_t chunk_buffer_size, size64_t input_size, size64_t expected_size, libcerror_error_t **error ) { uint8_t checksum_buffer[ 4 ]; static char *function = "ewf_test_read_write_chunk"; size64_t remaining_size = 0; size64_t result_size = 0; size_t chunk_data_size = 0; size_t data_size = 0; size_t write_size = 0; ssize_t process_count = 0; ssize_t read_count = 0; ssize_t write_count = 0; uint32_t chunk_checksum = 0; int8_t is_compressed = 0; int8_t process_checksum = 0; remaining_size = input_size; while( remaining_size > 0 ) { read_count = libewf_handle_read_chunk( handle, chunk_buffer, chunk_buffer_size, &is_compressed, (void *) checksum_buffer, &chunk_checksum, &process_checksum, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read chunk of size: %" PRIzd ".", function, chunk_buffer_size ); return( -1 ); } else if( read_count == 0 ) { break; } data_size = data_buffer_size; process_count = libewf_handle_prepare_read_chunk( handle, chunk_buffer, (size_t) read_count, data_buffer, &data_size, is_compressed, chunk_checksum, process_checksum, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare chunk of size: %" PRIzd " after read.", function, read_count ); return( -1 ); } if( libewf_handle_seek_offset( handle, -1 * (off64_t) process_count, SEEK_CUR, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek previous offset.", function ); return( -1 ); } if( memory_set( data_buffer, (int) 'C', data_buffer_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable set value in buffer.", function ); return( -1 ); } write_size = process_count; chunk_data_size = chunk_buffer_size; process_count = libewf_handle_prepare_write_chunk( handle, data_buffer, write_size, chunk_buffer, &chunk_data_size, &is_compressed, &chunk_checksum, &process_checksum, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to prepare chunk buffer before writing.", function ); return( -1 ); } if( is_compressed == 0 ) { write_count = libewf_handle_write_chunk( handle, data_buffer, process_count, write_size, is_compressed, checksum_buffer, chunk_checksum, process_checksum, error ); } else { write_count = libewf_handle_write_chunk( handle, chunk_buffer, chunk_data_size, write_size, is_compressed, checksum_buffer, chunk_checksum, process_checksum, error ); } if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write chunk of size: %" PRIzd ".", function, chunk_data_size ); return( -1 ); } remaining_size -= (size64_t) write_size; result_size += (size64_t) write_size; } if( expected_size != result_size ) { fprintf( stderr, "%s: unexpected read/write count: %" PRIu64 "\n", function, result_size ); return( 0 ); } return( 1 ); } /* Tests reading and writing a buffers at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_write_buffer_at_offset( libewf_handle_t *handle, off64_t input_offset, int input_whence, size64_t input_size, off64_t expected_offset, size64_t expected_size ) { libcerror_error_t *error = NULL; uint8_t *buffer = NULL; const char *whence_string = NULL; int result = 0; if( input_whence == SEEK_CUR ) { whence_string = "SEEK_CUR"; } else if( input_whence == SEEK_END ) { whence_string = "SEEK_END"; } else if( input_whence == SEEK_SET ) { whence_string = "SEEK_SET"; } else { whence_string = "UNKNOWN"; } fprintf( stdout, "Testing reading and writing range with offset: %" PRIi64 ", whence: %s and size: %" PRIu64 "\t", input_offset, whence_string, input_size ); buffer = (uint8_t *) memory_allocate( EWF_TEST_BUFFER_SIZE ); result = ewf_test_seek_offset( handle, input_offset, input_whence, expected_offset, &error ); if( result == 1 ) { if( input_offset >= 0 ) { result = ewf_test_read_write_buffer( handle, buffer, EWF_TEST_BUFFER_SIZE, input_size, expected_size, &error ); } } memory_free( buffer ); if( result != 0 ) { fprintf( stdout, "(PASS)" ); } else { fprintf( stdout, "(FAIL)" ); } fprintf( stdout, "\n" ); if( result == -1 ) { libcerror_error_backtrace_fprint( error, stderr ); libcerror_error_free( &error ); } return( result ); } /* Tests reading and writing chunks at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_write_chunk_at_offset( libewf_handle_t *handle, size32_t chunk_size, off64_t input_offset, int input_whence, size64_t input_size, off64_t expected_offset, size64_t expected_size ) { libcerror_error_t *error = NULL; uint8_t *chunk_buffer = NULL; uint8_t *data_buffer = NULL; const char *whence_string = NULL; size_t chunk_buffer_size = 0; size_t data_buffer_size = 0; int result = 0; if( chunk_size == 0 ) { return( -1 ); } #if SIZEOF_SIZE_T < 8 if( (size_t) chunk_size > (size_t) SSIZE_MAX ) { return( -1 ); } #endif if( input_whence == SEEK_CUR ) { whence_string = "SEEK_CUR"; } else if( input_whence == SEEK_END ) { whence_string = "SEEK_END"; } else if( input_whence == SEEK_SET ) { whence_string = "SEEK_SET"; } else { whence_string = "UNKNOWN"; } fprintf( stdout, "Testing reading range and writing with offset: %" PRIi64 ", whence: %s and size: %" PRIu64 "\t", input_offset, whence_string, input_size ); result = ewf_test_seek_offset( handle, input_offset, input_whence, expected_offset, &error ); data_buffer_size = chunk_size; data_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * data_buffer_size ); /* The compressed data can become larger than the uncompressed data */ chunk_buffer_size = chunk_size * 2; chunk_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * chunk_buffer_size ); if( result == 1 ) { if( input_offset >= 0 ) { result = ewf_test_read_write_chunk( handle, data_buffer, data_buffer_size, chunk_buffer, chunk_buffer_size, input_size, expected_size, &error ); } } memory_free( chunk_buffer ); memory_free( data_buffer ); if( result != 0 ) { fprintf( stdout, "(PASS)" ); } else { fprintf( stdout, "(FAIL)" ); } fprintf( stdout, "\n" ); if( result == -1 ) { libcerror_error_backtrace_fprint( error, stderr ); libcerror_error_free( &error ); } return( result ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { 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, _SYSTEM_STRING( "t:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); case (system_integer_t) 't': target_filename = optarg; break; } } if( optind == argc ) { fprintf( stderr, "Missing EWF image filename(s).\n" ); return( EXIT_FAILURE ); } /* Initialization */ if( libewf_handle_initialize( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to create handle.\n" ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) && defined( EWF_TEST_READ_WRITE_VERBOSE ) libewf_notify_set_verbose( 1 ); libewf_notify_set_stream( stderr, NULL ); #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, &( argv[ optind ] ), argc - optind, LIBEWF_OPEN_READ_WRITE, &error ) != 1 ) #else if( libewf_handle_open( handle, &( argv[ optind ] ), argc - optind, LIBEWF_OPEN_READ_WRITE, &error ) != 1 ) #endif { fprintf( stderr, "Unable to open file(s).\n" ); goto on_error; } if( target_filename != NULL ) { delta_segment_filename_length = system_string_length( target_filename ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_set_delta_segment_filename_wide( handle, target_filename, delta_segment_filename_length, &error ) != 1 ) #else if( libewf_handle_set_delta_segment_filename( handle, target_filename, delta_segment_filename_length, &error ) != 1 ) #endif { fprintf( stderr, "Unable to set delta segment filename.\n" ); goto on_error; } } if( libewf_handle_get_media_size( handle, &media_size, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve media size.\n" ); goto on_error; } if( media_size > (size64_t) INT64_MAX ) { fprintf( stderr, "Media size exceeds maximum.\n" ); goto on_error; } if( libewf_handle_get_chunk_size( handle, &chunk_size, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve chunk size.\n" ); goto on_error; } if( chunk_size == 0 ) { fprintf( stderr, "Invalid chunk size.\n" ); goto on_error; } fprintf( stdout, "Media size: %" PRIu64 " bytes\n", media_size ); /* Case 0: test full read */ /* Test: offset: 0 size: * Expected result: offset: 0 size: */ read_offset = 0; read_size = media_size; if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } /* Case 1: test random read */ /* Test: offset: size: * Expected result: offset: size: */ read_offset = (off64_t) ( media_size / 7 ); read_size = media_size / 2; if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } /* Case 2: test read buffer beyond media size */ if( media_size < 1024 ) { /* Test: offset: size: 4096 * Expected result: offset: -1 size: */ read_offset = (off64_t) ( media_size - 1024 ); read_size = 4096; if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } } else { /* Test: offset: size: 4096 * Expected result: offset: size: 1024 */ read_offset = (off64_t) ( media_size - 1024 ); read_size = 4096; if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, 1024 ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } if( ewf_test_read_write_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, 1024 ) != 1 ) { fprintf( stderr, "Unable to test read/write buffer.\n" ); goto on_error; } } fprintf( stdout, "\nChunk size: %" PRIu32 " bytes\n", chunk_size ); /* Case 0: test full read */ /* Test: offset: 0 size: * Expected result: offset: 0 size: */ read_offset = 0; read_size = media_size; if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } /* Case 1: test random read */ /* Test: offset: <( ( media_size / 7 ) / chunk_size ) * chunk_size> size: <( ( ( media_size / 2 ) / chunk_size ) + 1 ) * chunk_size> * Expected result: offset: <( ( media_size / 7 ) / chunk_size ) * chunk_size> size: <( ( ( media_size / 2 ) / chunk_size ) + 1 ) * chunk_size> */ read_offset = (off64_t) ( ( media_size / 7 ) / chunk_size ) * chunk_size; read_size = ( ( ( media_size / 2 ) / chunk_size ) + 1 ) * chunk_size; if( media_size == 0 ) { if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, 0 ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, 0 ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } } else { if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } } /* Case 2: test read chunk beyond media size */ if( media_size < 1024 ) { /* Test: offset: size: chunk_size * Expected result: offset: -1 size: */ read_offset = (off64_t) ( media_size - 1024 ); read_size = chunk_size; if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } } else { /* Test: offset: size: chunk_size * Expected result: offset: size: chunk size or media_size % chunk_size */ read_offset = (off64_t) ( media_size - 1024 ); read_size = chunk_size; if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, (off64_t) ( media_size - 1024 ), ( ( media_size % chunk_size ) == 0 ) ? chunk_size : media_size % chunk_size ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } if( ewf_test_read_write_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, (off64_t) ( media_size - 1024 ), ( ( media_size % chunk_size ) == 0 ) ? chunk_size : media_size % chunk_size ) != 1 ) { fprintf( stderr, "Unable to test read/write chunk.\n" ); goto on_error; } } /* Clean up */ if( libewf_handle_close( handle, &error ) != 0 ) { fprintf( stderr, "Unable to close file(s).\n" ); goto on_error; } if( libewf_handle_free( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to free handle.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } if( handle != NULL ) { libewf_handle_close( handle, NULL ); libewf_handle_free( &handle, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/tests/Makefile.am0000664000175000017500000000616313443455253020545 0ustar00lordyestalordyesta00000000000000AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ if HAVE_PYTHON TESTS_PYEWF = \ test_pyewf.sh endif TESTS = \ test_glob.sh \ test_seek.sh \ test_read.sh \ test_write.sh \ test_read_write.sh \ test_read_write_delta.sh \ test_ewfverify.sh \ test_ewfverify_logical.sh \ test_ewfacquire.sh \ test_ewfacquire_optical.sh \ test_ewfacquirestream.sh \ test_ewfacquire_resume.sh \ test_ewfinfo.sh \ test_ewfexport.sh \ test_ewfexport_logical.sh \ $(TESTS_PYEWF) check_SCRIPTS = \ test_ewfacquire.sh \ test_ewfacquire_optical.sh \ test_ewfacquire_resume.sh \ test_ewfacquirestream.sh \ test_ewfinfo.sh \ test_ewfexport.sh \ test_ewfexport_logical.sh \ test_ewfverify.sh \ test_ewfverify_logical.sh \ test_glob.sh \ test_manpage.sh \ test_pyewf.sh \ test_read.sh \ test_read_write.sh \ test_read_write_delta.sh \ test_runner.sh \ test_seek.sh \ test_write.sh EXTRA_DIST = \ $(check_SCRIPTS) check_PROGRAMS = \ ewf_test_glob \ ewf_test_read \ ewf_test_read_write \ ewf_test_read_write_delta \ ewf_test_seek \ ewf_test_truncate \ ewf_test_write \ ewf_test_write_chunk ewf_test_glob_SOURCES = \ ewf_test_glob.c \ ewf_test_libewf.h ewf_test_glob_LDADD = \ ../libewf/libewf.la ewf_test_read_SOURCES = \ ewf_test_definitions.h \ ewf_test_libcerror.h \ ewf_test_libewf.h \ ewf_test_read.c ewf_test_read_LDADD = \ ../libewf/libewf.la \ @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_libcnotify.h \ ewf_test_libewf.h \ ewf_test_read_write.c ewf_test_read_write_LDADD = \ @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ @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_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@ ewf_test_seek_SOURCES = \ ewf_test_libcerror.h \ ewf_test_libewf.h \ ewf_test_seek.c ewf_test_seek_LDADD = \ ../libewf/libewf.la \ @LIBCERROR_LIBADD@ ewf_test_truncate_SOURCES = \ ewf_test_libcerror.h \ ewf_test_libcfile.h \ ewf_test_libcnotify.h \ ewf_test_truncate.c ewf_test_truncate_LDADD = \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_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_libcnotify.h \ ewf_test_libewf.h \ ewf_test_write.c ewf_test_write_LDADD = \ @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ @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_libcnotify.h \ ewf_test_libewf.h \ ewf_test_write_chunk.c ewf_test_write_chunk_LDADD = \ @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ @LIBCERROR_LIBADD@ MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/tests/ewf_test_libcfile.h0000664000175000017500000000250713440663047022330 0ustar00lordyestalordyesta00000000000000/* * The internal libcfile 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_TOOLS_LIBCFILE_H ) #define _EWF_TOOLS_LIBCFILE_H #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile */ #if defined( HAVE_LOCAL_LIBCFILE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCFILE_DLL_IMPORT * before including libcfile.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCFILE_DLL_IMPORT #endif #include #endif #endif libewf-20140807/tests/ewf_test_definitions.h0000644000175000017500000000200113440662656023062 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library common testing definitions * * 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_DEFINITIONS_H ) #define _EWF_TEST_DEFINITIONS_H #define EWF_TEST_BUFFER_SIZE 4096 #endif /* !defined( _EWF_TEST_DEFINITIONS_H ) */ libewf-20140807/tests/test_ewfverify_logical.sh0000754000175000017500000000546513440662656023614 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfverify testing script for logical evidence files # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input_logical"; INPUT_ERROR="input_logical_error"; TMP="tmp"; LS="ls"; TR="tr"; WC="wc"; test_verify_logical() { INPUT_FILE=$1; ${EWFVERIFY} -q -f files ${INPUT_FILE}; RESULT=$?; echo ""; echo -n "Testing ewfverify of input: ${INPUT_FILE} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } EWFVERIFY="../ewftools/ewfverify"; if ! test -x ${EWFVERIFY}; then EWFVERIFY="../ewftools/ewfverify.exe"; fi if ! test -x ${EWFVERIFY}; then echo "Missing executable: ${EWFVERIFY}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test ewfverify create ${INPUT} directory and place EWF test files in directory."; exit ${EXIT_IGNORE}; fi EXIT_RESULT=${EXIT_IGNORE}; if test -d ${INPUT}; then RESULT=`${LS} ${INPUT}/*.L01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test ewfverify place EWF test files in directory."; else for FILENAME in `${LS} ${INPUT}/*.L01 | ${TR} ' ' '\n'`; do if [ "${FILENAME}" = "${INPUT}/encase6.19.3.L01" ]; then # experimental version only echo; elif [ "${FILENAME}" = "${INPUT}/encase7.04.01.L01" ]; then # experimental version only echo; elif [ "${FILENAME}" = "${INPUT}/Rader_Subset.L01" ]; then # experimental version only echo; elif ! test_verify_logical "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi if test -d ${INPUT_ERROR}; then RESULT=`${LS} ${INPUT_ERROR}/*.L01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in error directory, to test read place test files in directory."; else for FILENAME in `${LS} ${INPUT_ERROR}/*.L01 | ${TR} ' ' '\n'`; do if test_verify_logical "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi exit ${EXIT_RESULT}; libewf-20140807/tests/ewf_test_libcerror.h0000664000175000017500000000264113440663047022541 0ustar00lordyestalordyesta00000000000000/* * The internal libcerror header * * Copyright (C) 2006-2017, 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_LIBCERROR_H ) #define _EWF_TEST_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _EWF_TEST_LIBCERROR_H ) */ libewf-20140807/tests/ewf_test_read.c0000664000175000017500000004707113440662656021477 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library read testing program * * 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 . */ #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_definitions.h" #include "ewf_test_libcerror.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_read generate verbose output #define EWF_TEST_READ_VERBOSE */ /* Tests libewf_handle_get_offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_get_offset( libewf_handle_t *handle, off64_t expected_offset, libcerror_error_t **error ) { static char *function = "ewf_test_get_offset"; off64_t result_offset = 0; if( expected_offset != -1 ) { if( libewf_handle_get_offset( handle, &result_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset.", function ); return( -1 ); } if( result_offset != expected_offset ) { fprintf( stderr, "%s: unexpected result offset: %" PRIi64 "\n", function, result_offset ); return( 0 ); } } return( 1 ); } /* Tests libewf_handle_seek_offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_seek_offset( libewf_handle_t *handle, off64_t input_offset, int input_whence, off64_t expected_offset, libcerror_error_t **error ) { static char *function = "ewf_test_seek_offset"; off64_t result_offset = 0; result_offset = libewf_handle_seek_offset( handle, input_offset, input_whence, error ); if( result_offset != expected_offset ) { if( result_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, input_offset ); return( -1 ); } fprintf( stderr, "%s: unexpected result offset: %" PRIi64 "\n", function, result_offset ); return( 0 ); } if( result_offset == -1 ) { libcerror_error_free( error ); } return( 1 ); } /* Tests libewf_handle_read_buffer * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_buffer( libewf_handle_t *handle, uint8_t *buffer, size_t buffer_size, size64_t input_size, size64_t expected_size, libcerror_error_t **error ) { static char *function = "ewf_test_read_buffer"; size64_t remaining_size = 0; size64_t result_size = 0; size_t read_size = 0; ssize_t read_count = 0; remaining_size = input_size; while( remaining_size > 0 ) { read_size = buffer_size; if( remaining_size < (size64_t) read_size ) { read_size = (size_t) remaining_size; } read_count = libewf_handle_read_buffer( handle, buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer of size: %" PRIzd ".", function, read_size ); return( -1 ); } else if( read_count == 0 ) { break; } remaining_size -= (size64_t) read_count; result_size += (size64_t) read_count; if( read_count != (ssize_t) read_size ) { break; } } if( expected_size != result_size ) { fprintf( stderr, "%s: unexpected read count: %" PRIu64 "\n", function, result_size ); return( 0 ); } return( 1 ); } /* Tests libewf_handle_read_chunk and libewf_handle_prepare_read_chunk * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_chunk( libewf_handle_t *handle, uint8_t *data_buffer, size_t data_buffer_size, uint8_t *chunk_buffer, size_t chunk_buffer_size, size64_t input_size, size64_t expected_size, libcerror_error_t **error ) { uint8_t checksum_buffer[ 4 ]; static char *function = "ewf_test_read_chunk"; size64_t remaining_size = 0; size64_t result_size = 0; size_t data_size = 0; ssize_t process_count = 0; ssize_t read_count = 0; uint32_t chunk_checksum = 0; int8_t is_compressed = 0; int8_t process_checksum = 0; remaining_size = input_size; while( remaining_size > 0 ) { read_count = libewf_handle_read_chunk( handle, chunk_buffer, chunk_buffer_size, &is_compressed, (void *) checksum_buffer, &chunk_checksum, &process_checksum, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read chunk of size: %" PRIzd ".", function, chunk_buffer_size ); return( -1 ); } else if( read_count == 0 ) { break; } data_size = data_buffer_size; process_count = libewf_handle_prepare_read_chunk( handle, chunk_buffer, (size_t) read_count, data_buffer, &data_size, is_compressed, chunk_checksum, process_checksum, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare chunk of size: %" PRIzd " after read.", function, read_count ); return( -1 ); } remaining_size -= (size64_t) process_count; result_size += (size64_t) process_count; } if( expected_size != result_size ) { fprintf( stderr, "%s: unexpected read count: %" PRIu64 "\n", function, result_size ); return( 0 ); } return( 1 ); } /* Tests reading a buffers at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_buffer_at_offset( libewf_handle_t *handle, off64_t input_offset, int input_whence, size64_t input_size, off64_t expected_offset, size64_t expected_size ) { libcerror_error_t *error = NULL; uint8_t *buffer = NULL; const char *whence_string = NULL; int result = 0; if( input_whence == SEEK_CUR ) { whence_string = "SEEK_CUR"; } else if( input_whence == SEEK_END ) { whence_string = "SEEK_END"; } else if( input_whence == SEEK_SET ) { whence_string = "SEEK_SET"; } else { whence_string = "UNKNOWN"; } fprintf( stdout, "Testing reading range with offset: %" PRIi64 ", whence: %s and size: %" PRIu64 "\t", input_offset, whence_string, input_size ); buffer = (uint8_t *) memory_allocate( EWF_TEST_BUFFER_SIZE ); result = ewf_test_seek_offset( handle, input_offset, input_whence, expected_offset, &error ); if( result == 1 ) { if( input_offset >= 0 ) { result = ewf_test_read_buffer( handle, buffer, EWF_TEST_BUFFER_SIZE, input_size, expected_size, &error ); } } if( result == 1 ) { if( input_offset >= 0 ) { result = ewf_test_get_offset( handle, input_offset + expected_size, &error ); } } memory_free( buffer ); if( result != 0 ) { fprintf( stdout, "(PASS)" ); } else { fprintf( stdout, "(FAIL)" ); } fprintf( stdout, "\n" ); if( result == -1 ) { libcerror_error_backtrace_fprint( error, stderr ); libcerror_error_free( &error ); } return( result ); } /* Tests reading chunks at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_read_chunk_at_offset( libewf_handle_t *handle, size32_t chunk_size, off64_t input_offset, int input_whence, size64_t input_size, off64_t expected_offset, size64_t expected_size ) { libcerror_error_t *error = NULL; uint8_t *chunk_buffer = NULL; uint8_t *data_buffer = NULL; const char *whence_string = NULL; size_t chunk_buffer_size = 0; size_t data_buffer_size = 0; int result = 0; if( chunk_size == 0 ) { return( -1 ); } #if SIZEOF_SIZE_T < 8 if( (size_t) chunk_size > (size_t) SSIZE_MAX ) { return( -1 ); } #endif if( input_whence == SEEK_CUR ) { whence_string = "SEEK_CUR"; } else if( input_whence == SEEK_END ) { whence_string = "SEEK_END"; } else if( input_whence == SEEK_SET ) { whence_string = "SEEK_SET"; } else { whence_string = "UNKNOWN"; } fprintf( stdout, "Testing reading range with offset: %" PRIi64 ", whence: %s and size: %" PRIu64 "\t", input_offset, whence_string, input_size ); result = ewf_test_seek_offset( handle, input_offset, input_whence, expected_offset, &error ); data_buffer_size = chunk_size; data_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * data_buffer_size ); /* The chunk buffer should at least have a size of: chunk_size + 16 */ chunk_buffer_size = chunk_size * 2; chunk_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * chunk_buffer_size ); if( result == 1 ) { if( input_offset >= 0 ) { result = ewf_test_read_chunk( handle, data_buffer, data_buffer_size, chunk_buffer, chunk_buffer_size, input_size, expected_size, &error ); } } memory_free( chunk_buffer ); memory_free( data_buffer ); if( result == 1 ) { if( input_offset >= 0 ) { result = ewf_test_get_offset( handle, input_offset - ( input_offset % chunk_size ) + expected_size, &error ); } } if( result != 0 ) { fprintf( stdout, "(PASS)" ); } else { fprintf( stdout, "(FAIL)" ); } fprintf( stdout, "\n" ); if( result == -1 ) { libcerror_error_backtrace_fprint( error, stderr ); libcerror_error_free( &error ); } return( result ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { libcerror_error_t *error = NULL; libewf_handle_t *handle = NULL; off64_t read_offset = 0; size64_t media_size = 0; size64_t read_size = 0; size32_t chunk_size = 0; if( argc < 2 ) { fprintf( stderr, "Missing filename(s).\n" ); return( EXIT_FAILURE ); } #if defined( HAVE_DEBUG_OUTPUT ) && defined( EWF_TEST_READ_VERBOSE ) libewf_notify_set_verbose( 1 ); libewf_notify_set_stream( stderr, NULL ); #endif /* Initialization */ if( libewf_handle_initialize( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to create handle.\n" ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, &( argv[ 1 ] ), argc - 1, LIBEWF_OPEN_READ, &error ) != 1 ) #else if( libewf_handle_open( handle, &( argv[ 1 ] ), argc - 1, LIBEWF_OPEN_READ, &error ) != 1 ) #endif { fprintf( stderr, "Unable to open file(s).\n" ); goto on_error; } if( libewf_handle_get_media_size( handle, &media_size, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve media size.\n" ); goto on_error; } if( media_size > (size64_t) INT64_MAX ) { fprintf( stderr, "Media size exceeds maximum.\n" ); goto on_error; } if( libewf_handle_get_chunk_size( handle, &chunk_size, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve chunk size.\n" ); goto on_error; } if( chunk_size == 0 ) { fprintf( stderr, "Invalid chunk size.\n" ); goto on_error; } fprintf( stdout, "Media size: %" PRIu64 " bytes\n", media_size ); /* Case 0: test full read */ /* Test: offset: 0 size: * Expected result: offset: 0 size: */ read_offset = 0; read_size = media_size; if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } /* Case 1: test random read */ /* Test: offset: size: * Expected result: offset: size: */ read_offset = (off64_t) ( media_size / 7 ); read_size = media_size / 2; if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } /* Case 2: test read buffer beyond media size */ if( media_size < 1024 ) { /* Test: offset: size: 4096 * Expected result: offset: -1 size: */ read_offset = (off64_t) ( media_size - 1024 ); read_size = 4096; if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } } else { /* Test: offset: size: 4096 * Expected result: offset: size: 1024 */ read_offset = (off64_t) ( media_size - 1024 ); read_size = 4096; if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, 1024 ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } if( ewf_test_read_buffer_at_offset( handle, read_offset, SEEK_SET, read_size, read_offset, 1024 ) != 1 ) { fprintf( stderr, "Unable to test read buffer.\n" ); goto on_error; } } fprintf( stdout, "\nChunk size: %" PRIu32 " bytes\n", chunk_size ); /* Case 0: test full read */ /* Test: offset: 0 size: * Expected result: offset: 0 size: */ read_offset = 0; read_size = media_size; if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } /* Case 1: test random read */ /* Test: offset: <( ( media_size / 7 ) / chunk_size ) * chunk_size> size: <( ( ( media_size / 2 ) / chunk_size ) + 1 ) * chunk_size> * Expected result: offset: <( ( media_size / 7 ) / chunk_size ) * chunk_size> size: <( ( ( media_size / 2 ) / chunk_size ) + 1 ) * chunk_size> */ read_offset = (off64_t) ( ( media_size / 7 ) / chunk_size ) * chunk_size; read_size = ( ( ( media_size / 2 ) / chunk_size ) + 1 ) * chunk_size; if( media_size == 0 ) { if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, 0 ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, 0 ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } } else { if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, read_offset, read_size ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } } /* Case 2: test read chunk beyond media size */ if( media_size < 1024 ) { /* Test: offset: size: chunk_size * Expected result: offset: -1 size: */ read_offset = (off64_t) ( media_size - 1024 ); read_size = chunk_size; if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, -1, (size64_t) -1 ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } } else { /* Test: offset: size: chunk_size * Expected result: offset: size: chunk size or media_size % chunk_size */ read_offset = (off64_t) ( media_size - 1024 ); read_size = chunk_size; if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, (off64_t) ( media_size - 1024 ), ( ( media_size % chunk_size ) == 0 ) ? chunk_size : media_size % chunk_size ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } if( ewf_test_read_chunk_at_offset( handle, chunk_size, read_offset, SEEK_SET, read_size, (off64_t) ( media_size - 1024 ), ( ( media_size % chunk_size ) == 0 ) ? chunk_size : media_size % chunk_size ) != 1 ) { fprintf( stderr, "Unable to test read chunk.\n" ); goto on_error; } } /* Clean up */ if( libewf_handle_close( handle, &error ) != 0 ) { fprintf( stderr, "Unable to close file(s).\n" ); goto on_error; } if( libewf_handle_free( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to free handle.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } if( handle != NULL ) { libewf_handle_close( handle, NULL ); libewf_handle_free( &handle, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/tests/ewf_test_truncate.c0000664000175000017500000001274213440662656022406 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library truncate program * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_libcerror.h" #include "ewf_test_libcfile.h" #include "ewf_test_libcnotify.h" /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error */ int ewf_test_system_string_decimal_copy_to_64_bit( const system_character_t *string, size_t string_size, uint64_t *value_64bit, libcerror_error_t **error ) { static char *function = "ewf_test_system_string_decimal_copy_to_64_bit"; size_t string_index = 0; system_character_t character_value = 0; uint8_t maximum_string_index = 20; int8_t sign = 1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( value_64bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value 64-bit.", function ); return( -1 ); } *value_64bit = 0; if( string[ string_index ] == (system_character_t) '-' ) { string_index++; maximum_string_index++; sign = -1; } else if( string[ string_index ] == (system_character_t) '+' ) { string_index++; maximum_string_index++; } while( string_index < string_size ) { if( string[ string_index ] == 0 ) { break; } if( string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } *value_64bit *= 10; if( ( string[ string_index ] >= (system_character_t) '0' ) && ( string[ string_index ] <= (system_character_t) '9' ) ) { character_value = (system_character_t) ( string[ string_index ] - (system_character_t) '0' ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: %" PRIc_SYSTEM " at index: %d.", function, string[ string_index ], string_index ); return( -1 ); } *value_64bit += character_value; string_index++; } if( sign == -1 ) { *value_64bit *= (uint64_t) -1; } return( 1 ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { libcerror_error_t *error = NULL; libcfile_file_t *file = NULL; size64_t file_size = 0; size_t string_length = 0; if( argc < 2 ) { fprintf( stderr, "Missing file size.\n" ); return( EXIT_FAILURE ); } if( argc < 3 ) { fprintf( stderr, "Missing filename.\n" ); return( EXIT_FAILURE ); } string_length = system_string_length( argv[ 1 ] ); if( ewf_test_system_string_decimal_copy_to_64_bit( argv[ 1 ], string_length + 1, &file_size, &error ) != 1 ) { fprintf( stderr, "Unsupported file size.\n" ); goto on_error; } if( libcfile_file_initialize( &file, &error ) != 1 ) { fprintf( stderr, "Unable to create file." ); 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_SYSTEM ".\n", argv[ 2 ] ); goto on_error; } if( libcfile_file_resize( file, file_size, &error ) != 1 ) { fprintf( stderr, "Unable to resize file.\n" ); goto on_error; } if( libcfile_file_close( file, &error ) != 0 ) { fprintf( stderr, "Unable to close file.\n" ); goto on_error; } if( libcfile_file_free( &file, &error ) != 1 ) { fprintf( stderr, "Unable to free file.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( file != NULL ) { libcfile_file_free( &file, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/tests/test_ewfacquire_optical.sh0000754000175000017500000001125413440662656023753 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfacquire testing script for optical disc (split) RAW image input # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input_raw_optical"; TMP="tmp"; LS="ls"; SED="sed"; TR="tr"; WC="wc"; test_acquire_optical_file() { TOC_FILE=$1; OUTPUT_FORMAT=$2; COMPRESSION_METHOD=$3; COMPRESSION_LEVEL=$4; MAXIMUM_SEGMENT_SIZE=$5; CHUNK_SIZE=$6; INPUT_FILES=`echo ${TOC_FILE} | ${SED} 's/_*[0-9]*[.][cC][uU][eE]$//'`; mkdir ${TMP}; ${EWFACQUIRE} -q -d sha1 -T ${TOC_FILE} ${INPUT_FILES}*.[iI][sS][oO] < # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input_raw"; INPUT_MORE="input_raw_more"; TMP="tmp"; LS="ls"; TR="tr"; WC="wc"; test_acquire_file() { INPUT_FILE=$1; OUTPUT_FORMAT=$2; COMPRESSION_METHOD=$3; COMPRESSION_LEVEL=$4; MAXIMUM_SEGMENT_SIZE=$5; CHUNK_SIZE=$6; mkdir ${TMP}; ${EWFACQUIRE} -q -d sha1 ${INPUT_FILE} < * * 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 . */ #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_libewf.h" /* The main program */ #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( HAVE_WIDE_SYSTEM_CHARACTER ) wchar_t **filenames = NULL; #else char **filenames = NULL; #endif 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 ) { fprintf( stderr, "Missing filename(s).\n" ); return( EXIT_FAILURE ); } source = argv[ 1 ]; string_length = system_string_length( source ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( source, string_length, LIBEWF_FORMAT_UNKNOWN, &filenames, &number_of_filenames, &error ) != 1 ) #else if( libewf_glob( source, string_length, LIBEWF_FORMAT_UNKNOWN, &filenames, &number_of_filenames, &error ) != 1 ) #endif { fprintf( stderr, "Unable to glob filenames.\n" ); goto on_error; } if( number_of_filenames < 0 ) { fprintf( stderr, "Invalid number of filenames.\n" ); return( EXIT_FAILURE ); } else if( number_of_filenames == 0 ) { fprintf( stderr, "Glob missing filenames.\n" ); return( EXIT_FAILURE ); } for( filename_index = 0; filename_index < number_of_filenames; filename_index++ ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) fprintf( stdout, "%ls", filenames[ filename_index ] ); #else fprintf( stdout, "%s", filenames[ filename_index ] ); #endif if( filename_index == ( number_of_filenames - 1 ) ) { fprintf( stdout, "\n" ); } else { fprintf( stdout, " " ); } } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( filenames, number_of_filenames, &error ) != 1 ) #else if( libewf_glob_free( filenames, number_of_filenames, &error ) != 1 ) #endif { fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } return( EXIT_FAILURE ); } libewf-20140807/tests/test_manpage.sh0000775000175000017500000000315513440662656021521 0ustar00lordyestalordyesta00000000000000#!/bin/bash # Tests man pages. # # Version: 20190302 EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; run_test() { local INPUT_FILE=$1; local RESULT=0 TEST_NAME=`basename ${INPUT_FILE}`; echo -n "Testing man with input: ${TEST_NAME}"; LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z ${INPUT_FILE} > /dev/null 2> ${TMPDIR}/${TEST_NAME}.warnings; RESULT=$?; # For now line break warnings are ignored. if test -f ${TMPDIR}/${TEST_NAME}.warnings; then sed "/can't break line/ d" -i ${TMPDIR}/${TEST_NAME}.warnings; fi if test -s ${TMPDIR}/${TEST_NAME}.warnings; then RESULT=${EXIT_FAILURE}; fi if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi if test -s ${TMPDIR}/${TEST_NAME}.warnings; then cat ${TMPDIR}/${TEST_NAME}.warnings; fi return ${RESULT}; } if test "${OSTYPE}" = "msys"; then exit ${EXIT_IGNORE}; fi TEST_RUNNER="tests/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then TEST_RUNNER="./test_runner.sh"; fi if ! test -f "${TEST_RUNNER}"; then echo "Missing test runner: ${TEST_RUNNER}"; exit ${EXIT_FAILURE}; fi source ${TEST_RUNNER}; assert_availability_binary man; RESULT=${EXIT_IGNORE}; TMPDIR="tmp$$"; rm -rf ${TMPDIR}; mkdir ${TMPDIR}; MANUALS_PATH="../manuals"; if ! test -d ${MANUALS_PATH}; then MANUALS_PATH="manuals"; fi if ! test -d ${MANUALS_PATH}; then echo "Manuals directory not found."; exit ${EXIT_IGNORE}; fi for INPUT_FILE in ${MANUALS_PATH}/*.[13]; do run_test "${INPUT_FILE}"; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then break; fi done rm -rf ${TMPDIR}; exit ${RESULT}; libewf-20140807/tests/test_ewfinfo.sh0000775000175000017500000000557213440663047021546 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfinfo testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; INPUT_LOGICAL="input_logical"; INPUT_OPTICAL="input_optical"; LS="ls"; TR="tr"; WC="wc"; test_info() { INPUT_FILE=$1; ${EWFINFO} ${INPUT_FILE}; RESULT=$?; echo -n "Testing ewfinfo of input: ${INPUT_FILE} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } EWFINFO="../ewftools/ewfinfo"; if ! test -x ${EWFINFO}; then EWFINFO="../ewftools/ewfinfo.exe"; fi if ! test -x ${EWFINFO}; then echo "Missing executable: ${EWFINFO}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test ewfinfo create ${INPUT} directory and place EWF test files in directory."; exit ${EXIT_IGNORE}; fi EXIT_RESULT=${EXIT_IGNORE}; if test -d ${INPUT}; then RESULT=`${LS} ${INPUT}/*.[esE]01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test ewfinfo place EWF test files in directory."; else for FILENAME in `${LS} ${INPUT}/*.[esE]01 | ${TR} ' ' '\n'`; do if ! test_info "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi if test -d ${INPUT_LOGICAL}; then RESULT=`${LS} ${INPUT_LOGICAL}/*.[esE]01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT_LOGICAL} directory, to test ewfinfo place EWF test files in directory."; else for FILENAME in `${LS} ${INPUT_LOGICAL}/*.[esE]01 | ${TR} ' ' '\n'`; do if ! test_info "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi if test -d ${INPUT_OPTICAL}; then RESULT=`${LS} ${INPUT_OPTICAL}/*.[esE]01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT_OPTICAL} directory, to test ewfinfo place EWF test files in directory."; else for FILENAME in `${LS} ${INPUT_OPTICAL}/*.[esE]01 | ${TR} ' ' '\n'`; do if ! test_info "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi exit ${EXIT_RESULT}; libewf-20140807/tests/ewf_test_read_write_delta.c0000664000175000017500000002620013440662656024051 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library write testing program * * 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 . */ #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_read_write_delta generate verbose output #define EWF_TEST_READ_WRITE_DELTA_VERBOSE */ /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error */ int ewf_test_system_string_decimal_copy_to_64_bit( const system_character_t *string, size_t string_size, uint64_t *value_64bit, libcerror_error_t **error ) { static char *function = "ewf_test_system_string_decimal_copy_to_64_bit"; size_t string_index = 0; system_character_t character_value = 0; uint8_t maximum_string_index = 20; int8_t sign = 1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( value_64bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value 64-bit.", function ); return( -1 ); } *value_64bit = 0; if( string[ string_index ] == (system_character_t) '-' ) { string_index++; maximum_string_index++; sign = -1; } else if( string[ string_index ] == (system_character_t) '+' ) { string_index++; maximum_string_index++; } while( string_index < string_size ) { if( string[ string_index ] == 0 ) { break; } if( string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } *value_64bit *= 10; if( ( string[ string_index ] >= (system_character_t) '0' ) && ( string[ string_index ] <= (system_character_t) '9' ) ) { character_value = (system_character_t) ( string[ string_index ] - (system_character_t) '0' ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: %" PRIc_SYSTEM " at index: %d.", function, string[ string_index ], string_index ); return( -1 ); } *value_64bit += character_value; string_index++; } if( sign == -1 ) { *value_64bit *= (uint64_t) -1; } return( 1 ); } /* Tests reading/writing data of a specific size at a specific offset * Return 1 if successful, 0 if not or -1 on error */ int ewf_test_read_write_delta( char * const filenames[], int number_of_filenames, const system_character_t *delta_segment_filename, off64_t write_offset, size64_t write_size, libcerror_error_t **error ) { libewf_handle_t *handle = NULL; uint8_t *buffer = NULL; static char *function = "ewf_test_read_write_delta"; size_t delta_segment_filename_length = 0; size_t read_size = 0; ssize_t read_count = 0; ssize_t write_count = 0; if( libewf_handle_initialize( &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) && defined( EWF_TEST_READ_WRITE_DELTA_VERBOSE ) libewf_notify_set_verbose( 1 ); libewf_notify_set_stream( stderr, NULL ); #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, filenames, number_of_filenames, LIBEWF_OPEN_READ_WRITE, error ) != 1 ) #else if( libewf_handle_open( handle, filenames, number_of_filenames, LIBEWF_OPEN_READ_WRITE, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle.", function ); goto on_error; } if( delta_segment_filename != NULL ) { delta_segment_filename_length = system_string_length( delta_segment_filename ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_set_delta_segment_filename_wide( handle, delta_segment_filename, delta_segment_filename_length, error ) != 1 ) #else if( libewf_handle_set_delta_segment_filename( handle, delta_segment_filename, delta_segment_filename_length, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set delta segment filename.", function ); goto on_error; } } if( libewf_handle_seek_offset( handle, write_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, write_offset ); goto on_error; } buffer = (uint8_t *) memory_allocate( EWF_TEST_BUFFER_SIZE ); while( write_size > 0 ) { if( write_size > (size64_t) EWF_TEST_BUFFER_SIZE ) { read_size = EWF_TEST_BUFFER_SIZE; } else { read_size = (size_t) write_size; } read_count = libewf_handle_read_buffer( handle, buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable read buffer of size: %" PRIzd ".", function, read_size ); goto on_error; } if( memory_set( buffer, (int) 'X', (size_t) read_count ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable set value in buffer.", function ); goto on_error; } if( libewf_handle_seek_offset( handle, -1 * (off64_t) read_size, SEEK_CUR, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to seek previous offset.", function ); goto on_error; } write_count = libewf_handle_write_buffer( handle, buffer, (size_t) read_count, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, read_count ); goto on_error; } if( write_count != read_count ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write buffer of size: %" PRIzd ".", function, read_count ); goto on_error; } write_offset += write_count; write_size -= write_count; } memory_free( buffer ); buffer = NULL; if( libewf_handle_close( handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } if( libewf_handle_free( &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free handle.", function ); goto on_error; } return( 1 ); on_error: if( buffer != NULL ) { memory_free( buffer ); } if( handle != NULL ) { libewf_handle_close( handle, NULL ); libewf_handle_free( &handle, NULL ); } return( -1 ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { 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, _SYSTEM_STRING( "B:o:t:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); case (system_integer_t) 'B': option_size = optarg; break; case (system_integer_t) 'o': option_offset = optarg; break; case (system_integer_t) 't': target_filename = optarg; break; } } if( optind == argc ) { fprintf( stderr, "Missing EWF image filename(s).\n" ); return( EXIT_FAILURE ); } if( option_offset != NULL ) { string_length = system_string_length( option_offset ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_offset, string_length + 1, (uint64_t *) &write_offset, &error ) != 1 ) { fprintf( stderr, "Unsupported write offset.\n" ); goto on_error; } } if( option_size != NULL ) { string_length = system_string_length( option_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_size, string_length + 1, &write_size, &error ) != 1 ) { fprintf( stderr, "Unsupported write size.\n" ); goto on_error; } } if( ewf_test_read_write_delta( &( argv[ optind ] ), argc - optind, target_filename, write_offset, write_size, &error ) != 1 ) { fprintf( stderr, "Unable to test read/write.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } return( EXIT_FAILURE ); } libewf-20140807/tests/test_write.sh0000754000175000017500000000662213440662656021242 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # Expert Witness Compression Format (EWF) library write testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; TMP="tmp"; CUT="cut"; test_write() { MEDIA_SIZE=$1; MAXIMUM_SEGMENT_SIZE=$2; COMPRESSION_LEVEL=$3; mkdir ${TMP}; if test "${OSTYPE}" = "msys"; then OUTPUT_FILE="${TMP}\\write"; else OUTPUT_FILE="${TMP}/write"; fi ./${EWF_TEST_WRITE} -B ${MEDIA_SIZE} -c `echo ${COMPRESSION_LEVEL} | ${CUT} -c 1` -S ${MAXIMUM_SEGMENT_SIZE} "${OUTPUT_FILE}"; RESULT=$?; rm -rf ${TMP}; echo -n "Testing write with media size: ${MEDIA_SIZE}, maximum segment size: ${MAXIMUM_SEGMENT_SIZE} and compression level: ${COMPRESSION_LEVEL} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } test_write_chunk() { MEDIA_SIZE=$1; MAXIMUM_SEGMENT_SIZE=$2; COMPRESSION_LEVEL=$3; mkdir ${TMP}; if test "${OSTYPE}" = "msys"; then OUTPUT_FILE="${TMP}\\write"; else OUTPUT_FILE="${TMP}/write"; fi ./${EWF_TEST_WRITE_CHUNK} -B ${MEDIA_SIZE} -c `echo ${COMPRESSION_LEVEL} | ${CUT} -c 1` -S ${MAXIMUM_SEGMENT_SIZE} "${OUTPUT_FILE}"; RESULT=$?; rm -rf ${TMP}; echo -n "Testing write chunk with media size: ${MEDIA_SIZE}, maximum segment size: ${MAXIMUM_SEGMENT_SIZE} and compression level: ${COMPRESSION_LEVEL} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } EWF_TEST_WRITE="ewf_test_write"; if ! test -x ${EWF_TEST_WRITE}; then EWF_TEST_WRITE="ewf_test_write.exe"; fi if ! test -x ${EWF_TEST_WRITE}; then echo "Missing executable: ${EWF_TEST_WRITE}"; exit ${EXIT_FAILURE}; fi EWF_TEST_WRITE_CHUNK="ewf_test_write_chunk"; if ! test -x ${EWF_TEST_WRITE_CHUNK}; then EWF_TEST_WRITE_CHUNK="ewf_test_write_chunk.exe"; fi if ! test -x ${EWF_TEST_WRITE_CHUNK}; then echo "Missing executable: ${EWF_TEST_WRITE_CHUNK}"; exit ${EXIT_FAILURE}; fi for COMPRESSION_LEVEL in none empty-block fast best; do if ! test_write 0 0 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi if ! test_write 0 10000 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi if ! test_write 100000 0 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi if ! test_write 100000 10000 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi echo ""; if ! test_write_chunk 0 0 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi if ! test_write_chunk 0 10000 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi if ! test_write_chunk 100000 0 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi if ! test_write_chunk 100000 10000 ${COMPRESSION_LEVEL} then exit ${EXIT_FAILURE}; fi echo ""; done exit ${EXIT_SUCCESS}; libewf-20140807/tests/test_read_write_delta.sh0000754000175000017500000001175513440662656023411 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # Expert Witness Compression Format (EWF) library read/write testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; TMP="tmp"; AWK="awk"; CUT="cut"; LS="ls"; TR="tr"; test_read_write_delta() { MEDIA_SIZE=$1; CHUNK_SIZE=$2; COMPRESSION_LEVEL=$3; WRITE_OFFSET=$4; WRITE_SIZE=$5; shift 2; mkdir ${TMP}; if test "${OSTYPE}" = "msys"; then OUTPUT_FILE="${TMP}\\write"; else OUTPUT_FILE="${TMP}/write"; fi ./${EWF_TEST_WRITE} -b ${CHUNK_SIZE} -B ${MEDIA_SIZE} -c `echo ${COMPRESSION_LEVEL} | ${CUT} -c 1` "${OUTPUT_FILE}"; RESULT=$?; if [ ${RESULT} -eq ${EXIT_SUCCESS} ]; then FILENAMES=`${LS} ${OUTPUT_FILE}.* | ${TR} '\n' ' '`; if test "${OSTYPE}" = "msys"; then OUTPUT_FILE="${TMP}\\read_write"; else OUTPUT_FILE="${TMP}/read_write"; fi ./${EWF_TEST_READ_WRITE_DELTA} -B ${WRITE_SIZE} -o ${WRITE_OFFSET} -t "${OUTPUT_FILE}" ${FILENAMES}; RESULT=$?; fi if [ ${RESULT} -eq ${EXIT_SUCCESS} ]; then if [ ${WRITE_OFFSET} -lt ${MEDIA_SIZE} ]; then if [ -e ${OUTPUT_FILE}.d01 ]; then FILESIZE=`${LS} -l ${OUTPUT_FILE}.d01 | ${AWK} '{ print $5 }'`; CHUNK_SIZE=`expr ${CHUNK_SIZE} \* 512`; if [ `expr ${WRITE_OFFSET} + ${WRITE_SIZE}` -gt ${MEDIA_SIZE} ]; then WRITE_SIZE=`expr ${MEDIA_SIZE} - ${WRITE_OFFSET}`; fi NUMBER_OF_CHUNKS=`expr ${WRITE_SIZE} / ${CHUNK_SIZE}`; REMAINING_SIZE=`expr ${WRITE_SIZE} % ${CHUNK_SIZE}`; if [ ${REMAINING_SIZE} -gt 0 ]; then # Check if the remaining size is part of the last chunk if [ `expr ${WRITE_OFFSET} + \( \( ${NUMBER_OF_CHUNKS} + 1 \) \* ${CHUNK_SIZE} \)` -le ${MEDIA_SIZE} ]; then NUMBER_OF_CHUNKS=`expr ${NUMBER_OF_CHUNKS} + 1`; REMAINING_SIZE=0; fi fi CHUNK_OFFSET=`expr \( ${WRITE_OFFSET} / ${CHUNK_SIZE} \) \* ${CHUNK_SIZE}`; # Check if the written data passes a chunk boundary if [ ${WRITE_OFFSET} -gt ${CHUNK_OFFSET} ]; then if [ `expr ${WRITE_OFFSET} + ${WRITE_SIZE}` -gt `expr ${CHUNK_OFFSET} + ${CHUNK_SIZE}` ]; then NUMBER_OF_CHUNKS=`expr ${NUMBER_OF_CHUNKS} + 1`; fi fi if [ ${NUMBER_OF_CHUNKS} -gt 0 ]; then # Add the section start, the delta chunk header and chunk checksum CALCULATED=`expr 76 + 18 + ${CHUNK_SIZE} + 4`; # Multiply by the amount of chunks altered CALCULATED=`expr ${CALCULATED} \* ${NUMBER_OF_CHUNKS}`; fi if [ ${REMAINING_SIZE} -gt 0 ]; then # Add the section start, the delta chunk header and chunk checksum of the last chunk CALCULATED=`expr ${CALCULATED} + 76 + 18 + ${REMAINING_SIZE} + 4`; fi # Add the segment file header and the done or next section CALCULATED=`expr 13 + ${CALCULATED} + 76`; if [ ${FILESIZE} -eq ${CALCULATED} ]; then RESULT=${EXIT_SUCCESS}; else RESULT=${EXIT_FAILURE}; fi else RESULT=${EXIT_FAILURE}; fi else if [ -e ${OUTPUT_FILE}.d01 ]; then RESULT=${EXIT_FAILURE}; else RESULT=${EXIT_SUCCESS}; fi fi fi rm -rf ${TMP}; echo -n "Testing read/write with offset: ${WRITE_OFFSET} and size: ${WRITE_SIZE} and compression level: ${COMPRESSION_LEVEL} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } EWF_TEST_WRITE="ewf_test_write"; if ! test -x ${EWF_TEST_WRITE}; then EWF_TEST_WRITE="ewf_test_write.exe"; fi if ! test -x ${EWF_TEST_WRITE}; then echo "Missing executable: ${EWF_TEST_WRITE}"; exit ${EXIT_FAILURE}; fi EWF_TEST_READ_WRITE_DELTA="ewf_test_read_write_delta"; if ! test -x ${EWF_TEST_READ_WRITE_DELTA}; then EWF_TEST_READ_WRITE_DELTA="ewf_test_read_write_delta.exe"; fi if ! test -x ${EWF_TEST_READ_WRITE_DELTA}; then echo "Missing executable: ${EWF_TEST_READ_WRITE_DELTA}"; exit ${EXIT_FAILURE}; fi for COMPRESSION_LEVEL in none empty-block fast best; do if ! test_read_write_delta 100000 64 ${COMPRESSION_LEVEL} 0 100000 then exit ${EXIT_FAILURE}; fi if ! test_read_write_delta 100000 64 ${COMPRESSION_LEVEL} 512 512 then exit ${EXIT_FAILURE}; fi if ! test_read_write_delta 100000 64 ${COMPRESSION_LEVEL} 32512 512 then exit ${EXIT_FAILURE}; fi if ! test_read_write_delta 100000 64 ${COMPRESSION_LEVEL} 32512 40000 then exit ${EXIT_FAILURE}; fi done exit ${EXIT_SUCCESS}; libewf-20140807/tests/ewf_test_libewf.h0000664000175000017500000000232013440663047022020 0ustar00lordyestalordyesta00000000000000/* * The internal libewf header * * Copyright (C) 2006-2017, 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_LIBEWF_H ) #define _EWF_TEST_LIBEWF_H #include /* If Cygwin libtool DLL support is enabled and do not want to create static * executables set LIBEWF_DLL_IMPORT before including libewf.h */ #if defined( _WIN32 ) && defined( DLL_EXPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBEWF_DLL_IMPORT #endif #include #endif /* !defined( _EWF_TEST_LIBEWF_H ) */ libewf-20140807/tests/test_runner.sh0000775000175000017500000010300613440663047021411 0ustar00lordyestalordyesta00000000000000#!/bin/bash # Bash functions to run an executable for testing. # # Version: 20180929 # # When CHECK_WITH_ASAN is set to a non-empty value the test executable # is run with asan, otherwise it is run without. # # When CHECK_WITH_GDB is set to a non-empty value the test executable # is run with gdb, otherwise it is run without. # # When CHECK_WITH_STDERR is set to a non-empty value the test executable # is run with error output to stderr. # # When CHECK_WITH_VALGRIND is set to a non-empty value the test executable # is run with valgrind, otherwise it is run without. EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; # Checks the availability of a binary and exits if not available. # # Arguments: # a string containing the name of the binary # assert_availability_binary() { local BINARY=$1; which ${BINARY} > /dev/null 2>&1; if test $? -ne ${EXIT_SUCCESS}; then echo "Missing binary: ${BINARY}"; echo ""; exit ${EXIT_FAILURE}; fi } # Checks the availability of binaries and exits if not available. # # Globals: # CHECK_WITH_GDB # CHECK_WITH_VALGRIND # assert_availability_binaries() { assert_availability_binary cat; assert_availability_binary cut; assert_availability_binary diff; assert_availability_binary file; assert_availability_binary gzip; assert_availability_binary ls; assert_availability_binary readlink; assert_availability_binary sed; assert_availability_binary tr; assert_availability_binary uname; assert_availability_binary wc; assert_availability_binary zcat; if test -n "${CHECK_WITH_GDB}"; then assert_availability_binary gdb; elif test -n "${CHECK_WITH_VALGRIND}"; then assert_availability_binary valgrind; fi } # Checks if the input directory is in the ignore list. # # Arguments: # a string containing the path of the test input directory # a string containing space separated ignore list # # Returns: # an integer containing the exit status to indicate the input directory # was found in the ignore list. # check_for_directory_in_ignore_list() { local INPUT_DIRECTORY=$1; local IGNORE_LIST=$2; local INPUT_BASENAME=`basename ${INPUT_DIRECTORY}`; for LIST_ELEMENT in `echo "${IGNORE_LIST}" | tr ' ' '\n'`; do if test "${LIST_ELEMENT}" = "${INPUT_BASENAME}"; then return ${EXIT_SUCCESS}; fi done return ${EXIT_FAILURE}; } # Searches for the binary variant of the executable in case the test executable # refers to a libtool shell script. # # Arguments: # a string containing the path of the test executable # # Returns: # a string containing the path of the binary variant of the test executable # find_binary_executable() { local TEST_EXECUTABLE=$1; TEST_EXECUTABLE=$( readlink_f "${TEST_EXECUTABLE}" ); # Note that the behavior of `file -bi` is not helpful on Mac OS X. local EXECUTABLE_TYPE=`file -b ${TEST_EXECUTABLE}`; # Check if the test executable is a libtool shell script. # Linux: POSIX shell script, ASCII text executable, with very long lines # Mac OS X: POSIX shell script text executable echo "${EXECUTABLE_TYPE}" | grep "POSIX shell script" > /dev/null 2>&1; RESULT=$?; if test ${RESULT} -eq ${EXIT_SUCCESS}; then local TEST_EXECUTABLE_BASENAME=`basename ${TEST_EXECUTABLE}`; local TEST_EXECUTABLE_DIRNAME=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE="${TEST_EXECUTABLE_DIRNAME}/.libs/${TEST_EXECUTABLE_BASENAME}"; if test -x ${TEST_EXECUTABLE}; then # Note that the behavior of `file -bi` is not helpful on Mac OS X. EXECUTABLE_TYPE=`file -b ${TEST_EXECUTABLE}`; # Linux: ELF 64-bit LSB executable, x86-64, ... # Mac OS X: Mach-O 64-bit executable x86_64 echo "${EXECUTABLE_TYPE}" | grep "executable" > /dev/null 2>&1; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo "Invalid test executable: ${TEST_EXECUTABLE}"; exit ${EXIT_FAILURE}; fi fi fi echo ${TEST_EXECUTABLE}; } # Searches for the path to the binary variant of the library. # # Arguments: # a string containing the path of the test executable # # Returns: # a string containing the path of the binary variant of the library. # find_binary_library_path() { local TEST_EXECUTABLE=$1; local LIBRARY_NAME="${TEST_EXECUTABLE}"; echo ${LIBRARY_NAME} | grep 'tools' > /dev/null 2>&1; if test $? -eq ${EXIT_SUCCESS}; then LIBRARY_NAME=`dirname ${LIBRARY_NAME}`; LIBRARY_NAME=`dirname ${LIBRARY_NAME}`; LIBRARY_NAME=`basename ${LIBRARY_NAME} | sed 's/\(.*\)tools$/lib\1/'`; else LIBRARY_NAME=`basename ${LIBRARY_NAME} | sed 's/^py//' | sed 's/^\([^_]*\)_test_.*$/lib\1/'`; fi TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; local LIBRARY_PATH="${TEST_EXECUTABLE}/${LIBRARY_NAME}/.libs"; if ! test -d "${LIBRARY_PATH}"; then LIBRARY_PATH="../${LIBRARY_NAME}/.libs"; fi echo "${LIBRARY_PATH}"; } # Searches for the path to the binary variant of the Python module # # Globals: # PYTHON_VERSION # # Arguments: # a string containing the path of the test executable # # Returns: # a string containing the path of the binary variant of the Python module # find_binary_python_module_path() { local TEST_EXECUTABLE=$1; local PYTHON_MODULE_NAME=`basename ${TEST_EXECUTABLE} | sed 's/^py\(.*\)_test_.*$/py\1/'`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; PYTHON_VERSION=`echo ${PYTHON_VERSION} | cut -c1`; local PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}-python${PYTHON_VERSION}/.libs"; if ! test -d "${PYTHON_MODULE_PATH}"; then PYTHON_MODULE_PATH="../${PYTHON_MODULE_NAME}-python${PYTHON_VERSION}/.libs"; fi if ! test -d "${PYTHON_MODULE_PATH}"; then PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}/.libs"; fi if ! test -d "${PYTHON_MODULE_PATH}"; then PYTHON_MODULE_PATH="../${PYTHON_MODULE_NAME}/.libs"; fi echo "${PYTHON_MODULE_PATH}"; } # Determines the test option file. # # Arguments: # a string containing the path of the test set directory # a string containing the path of the test input file # a string containing the name of the option set # # Returns: # a string containing the test input files # get_testion_option_file() { local TEST_SET_DIRECTORY=$1; local INPUT_FILE=$2; local OPTION_SET=$3; local INPUT_NAME=`basename "${INPUT_FILE}"`; local OPTION_FILE="${TEST_SET_DIRECTORY}/${INPUT_NAME}.${OPTION_SET}"; echo "${OPTION_FILE}"; } # Determines the test profile directory. # The directory is created if it does not exist. # # Arguments: # a string containing the path of the test input directory # a string containing the name of the test profile # # Returns: # a string containing the path of the test profile directory # get_test_profile_directory() { local TEST_INPUT_DIRECTORY=$1; local TEST_PROFILE=$2; local TEST_PROFILE_DIRECTORY="${TEST_INPUT_DIRECTORY}/.${TEST_PROFILE}"; if ! test -d "${TEST_PROFILE_DIRECTORY}"; then mkdir "${TEST_PROFILE_DIRECTORY}"; fi echo "${TEST_PROFILE_DIRECTORY}"; } # Determines the test set directory. # The directory is created if it does not exist. # # Arguments: # a string containing the path of the test profile directory # a string containing the path of the test set input directory # # Returns: # a string containing the path of the test set directory # get_test_set_directory() { local TEST_PROFILE_DIRECTORY=$1; local TEST_SET_INPUT_DIRECTORY=$2; local TEST_SET=`basename ${TEST_SET_INPUT_DIRECTORY}`; local TEST_SET_DIRECTORY="${TEST_PROFILE_DIRECTORY}/${TEST_SET}"; if ! test -d "${TEST_SET_DIRECTORY}"; then mkdir "${TEST_SET_DIRECTORY}"; fi echo "${TEST_SET_DIRECTORY}"; } # Provides a cross-platform variant of "readlink -f" # # Arguments: # a string containing a path # # Returns: # a string containing the path with all symbolic links resolved # readlink_f() { local TARGET="$1" if test -f "${TARGET}"; then while test -L "${TARGET}"; do TARGET=`readlink "${TARGET}"`; done fi local BASENAME=`basename "${TARGET}"`; local DIRNAME=`dirname "${TARGET}"`; DIRNAME=`(cd "${DIRNAME}" && pwd -P)`; echo "${DIRNAME}/${BASENAME}"; } # Reads the test profile ignore file if it exists. # # Arguments: # a string containing the path of the test profile directory # # Returns: # a string containing a space separated ignore list # read_ignore_list() { local TEST_PROFILE_DIRECTORY=$1; local IGNORE_FILE="${TEST_PROFILE_DIRECTORY}/ignore"; local IGNORE_LIST=""; if test -f "${IGNORE_FILE}"; then IGNORE_LIST=`cat ${IGNORE_FILE} | sed '/^#/d'`; fi echo ${IGNORE_LIST}; } # Reads the test set option file. # # Arguments: # a string containing the path of the test set directory # a string containing the path of the test input file # a string containing the name of the option set # # Returns: # a string containing the ignore list # read_option_file() { local TEST_SET_DIRECTORY=$1; local INPUT_FILE=$2; local OPTION_SET=$3; local OPTION_FILE=$(get_testion_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); local OPTIONS=() local OPTIONS_STRING=`cat "${OPTION_FILE}" | head -n 1 | sed 's/[\r\n]*$//'`; echo "${OPTIONS_STRING}"; } # Runs the test with optional arguments. # # Globals: # CHECK_WITH_ASAN # CHECK_WITH_GDB # CHECK_WITH_STDERR # CHECK_WITH_VALGRIND # PYTHON_VERSION # # Arguments: # a string containing the test description # a string containing the path of the test executable # an array containing the arguments for the test executable # # Returns: # an integer containg the exit status of the test executable # run_test_with_arguments() { local TEST_DESCRIPTION=$1; local TEST_EXECUTABLE=$2; shift 2; local ARGUMENTS=("$@"); if ! test -f "${TEST_EXECUTABLE}"; then echo "Missing test executable: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi local PLATFORM=`uname -s | sed 's/-.*$//'`; # Note that the behavior of `file -bi` is not helpful on Mac OS X. local EXECUTABLE_TYPE=`file -b ${TEST_EXECUTABLE}`; # Check if the test executable is a Python script. # Linux: Python script, ASCII text executable # Mac OS X: a python script text executable echo "${EXECUTABLE_TYPE}" | grep -i "python script" > /dev/null 2>&1; local IS_PYTHON_SCRIPT=$?; if test ${IS_PYTHON_SCRIPT} -eq 0; then local PYTHON=`which python${PYTHON_VERSION} 2> /dev/null`; if ! test -x ${PYTHON}; then echo "Missing executable: ${PYTHON}"; exit ${EXIT_FAILURE}; fi fi local RESULT=0; if test -n "${CHECK_WITH_ASAN}"; then local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); local LSAN_SUPPRESSIONS="lsan.suppressions"; if ! test -f ${LSAN_SUPPRESSIONS}; then LSAN_SUPPRESSIONS="../lsan.suppressions"; fi if test "${PLATFORM}" = "Darwin"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" DYLD_LIBRARY_PATH="${LIBRARY_PATH}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi else local CONFIG_LOG="../config.log"; if ! test -f ${CONFIG_LOG}; then CONFIG_LOG="../../config.log"; fi local CC=`cat ${CONFIG_LOG} | grep -e "^CC=" | sed "s/CC='\\(.*\\)'/\1/"`; local LIBASAN=""; if test -z ${CC} || test ${CC} != "clang"; then local LDCONFIG=`which ldconfig 2> /dev/null`; if test -z ${LDCONFIG} || ! test -x ${LDCONFIG}; then LDCONFIG="/sbin/ldconfig"; fi if test -z ${LDCONFIG} || ! test -x ${LDCONFIG}; then echo "Missing binary: ldconfig"; echo ""; exit ${EXIT_FAILURE}; fi LIBASAN=`${LDCONFIG} -p | grep libasan | sed 's/^.* => //' | sort | tail -n 1`; if ! test -f ${LIBASAN}; then echo "Missing library: ${BINARY}"; echo ""; exit ${EXIT_FAILURE}; fi fi if test ${IS_PYTHON_SCRIPT} -eq 0; then LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" LD_PRELOAD="${LIBASAN}" LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" LD_PRELOAD="${LIBASAN}" LD_LIBRARY_PATH="${LIBRARY_PATH}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi fi elif test -n "${CHECK_WITH_GDB}"; then local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); if test "${PLATFORM}" = "Darwin"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else DYLD_LIBRARY_PATH="${LIBRARY_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi elif test "${PLATFORM}" = "CYGWIN_NT"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else PATH="${LIBRARY_PATH}:${PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi else if test ${IS_PYTHON_SCRIPT} -eq 0; then LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else LD_LIBRARY_PATH="${LIBRARY_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi fi elif test -n "${CHECK_WITH_VALGRIND}"; then local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); local VALGRIND_LOG="valgrind.log-$$"; local VALGRIND_OPTIONS=("--tool=memcheck" "--leak-check=full" "--show-leak-kinds=definite,indirect,possible" "--track-origins=yes" "--log-file=${VALGRIND_LOG}"); if test "${PLATFORM}" = "Darwin"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else DYLD_LIBRARY_PATH="${LIBRARY_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi elif test "${PLATFORM}" = "CYGWIN_NT"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else PATH="${LIBRARY_PATH}:${PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi else if test ${IS_PYTHON_SCRIPT} -eq 0; then LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else LD_LIBRARY_PATH="${LIBRARY_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; fi fi if test ${RESULT} -eq ${EXIT_SUCCESS}; then grep "All heap blocks were freed -- no leaks are possible" ${VALGRIND_LOG} > /dev/null 2>&1; if test $? -ne ${EXIT_SUCCESS}; then # Ignore "still reachable" # Also see: http://valgrind.org/docs/manual/faq.html#faq.deflost grep "definitely lost: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_DIRECTLY_LOST=$?; grep "indirectly lost: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_INDIRECTLY_LOST=$?; grep "possibly lost: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_POSSIBLY_LOST=$?; grep "suppressed: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_SUPPRESSED=$?; if test ${RESULT_DIRECTLY_LOST} -ne ${EXIT_SUCCESS} || test ${RESULT_INDIRECTLY_LOST} -ne ${EXIT_SUCCESS} || test ${RESULT_POSSIBLY_LOST} -ne ${EXIT_SUCCESS} || test ${RESULT_SUPPRESSED} -ne ${EXIT_SUCCESS}; then echo "Memory leakage detected."; cat ${VALGRIND_LOG}; RESULT=${EXIT_FAILURE}; fi fi # Detect valgrind warnings. local NUMBER_OF_LINES=`wc -l ${VALGRIND_LOG} | awk '{ print $1 }'`; if test ${NUMBER_OF_LINES} -ne 15 && test ${NUMBER_OF_LINES} -ne 22; then echo "Unsupported number of lines: ${NUMBER_OF_LINES}"; cat ${VALGRIND_LOG}; RESULT=${EXIT_FAILURE}; fi fi rm -f ${VALGRIND_LOG}; elif test ${IS_PYTHON_SCRIPT} -eq 0; then if ! test -f "${TEST_EXECUTABLE}"; then echo "Invalid test Python script: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); if test "${PLATFORM}" = "Darwin"; then if test -n "${CHECK_WITH_STDERR}"; then DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} 2> /dev/null; RESULT=$?; fi elif test "${PLATFORM}" = "CYGWIN_NT"; then if test -n "${CHECK_WITH_STDERR}"; then PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} 2> /dev/null; RESULT=$?; fi else if test -n "${CHECK_WITH_STDERR}"; then LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]}; RESULT=$?; else LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} 2> /dev/null; RESULT=$?; fi fi else if ! test -x "${TEST_EXECUTABLE}"; then echo "Invalid test executable: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi if test -n "${CHECK_WITH_STDERR}"; then ${TEST_EXECUTABLE} ${ARGUMENTS[@]}; RESULT=$?; else ${TEST_EXECUTABLE} ${ARGUMENTS[@]} 2> /dev/null; RESULT=$?; fi fi if test -n "${TEST_DESCRIPTION}"; then echo -n "${TEST_DESCRIPTION} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi fi return ${RESULT}; } # Runs the test with an input file and optional arguments. # # Globals: # CHECK_WITH_ASAN # CHECK_WITH_GDB # CHECK_WITH_STDERR # CHECK_WITH_VALGRIND # PYTHON_VERSION # # Arguments: # a string containing the path of the test executable # a string containing the path of the test input file # an array containing the arguments for the test executable # # Returns: # an integer containg the exit status of the test executable # run_test_with_input_and_arguments() { local TEST_EXECUTABLE=$1; local INPUT_FILE=$2; shift 2; local ARGUMENTS=("$@"); if ! test -f "${TEST_EXECUTABLE}"; then echo "Missing test executable: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi local PLATFORM=`uname -s | sed 's/-.*$//'`; # Note that the behavior of `file -bi` is not helpful on Mac OS X. local EXECUTABLE_TYPE=`file -b ${TEST_EXECUTABLE}`; # Check if the test executable is a Python script. # Linux: Python script, ASCII text executable # Mac OS X: a python script text executable echo "${EXECUTABLE_TYPE}" | grep -i "python script" > /dev/null 2>&1; local IS_PYTHON_SCRIPT=$?; if test ${IS_PYTHON_SCRIPT} -eq 0; then local PYTHON=`which python${PYTHON_VERSION} 2> /dev/null`; if ! test -x ${PYTHON}; then echo "Missing executable: ${PYTHON}"; exit ${EXIT_FAILURE}; fi fi local RESULT=0; if test -n "${CHECK_WITH_ASAN}"; then local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); local LSAN_SUPPRESSIONS="lsan.suppressions"; if ! test -f ${LSAN_SUPPRESSIONS}; then LSAN_SUPPRESSIONS="../lsan.suppressions"; fi if test "${PLATFORM}" = "Darwin"; then # TODO DYLD_INSERT_LIBRARIES=/Library/Developer/CommandLineTools/usr/lib/clang/8.1.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib if test ${IS_PYTHON_SCRIPT} -eq 0; then LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" DYLD_LIBRARY_PATH="${LIBRARY_PATH}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi else local CONFIG_LOG="../config.log"; if ! test -f ${CONFIG_LOG}; then CONFIG_LOG="../../config.log"; fi local CC=`cat ${CONFIG_LOG} | grep -e "^CC=" | sed "s/CC='\\(.*\\)'/\1/"`; local LIBASAN=""; if test -z ${CC} || test ${CC} != "clang"; then local LDCONFIG=`which ldconfig 2> /dev/null`; if test -z ${LDCONFIG} || ! test -x ${LDCONFIG}; then LDCONFIG="/sbin/ldconfig"; fi if test -z ${LDCONFIG} || ! test -x ${LDCONFIG}; then echo "Missing binary: ldconfig"; echo ""; exit ${EXIT_FAILURE}; fi LIBASAN=`${LDCONFIG} -p | grep libasan | sed 's/^.* => //' | sort | tail -n 1`; if ! test -f ${LIBASAN}; then echo "Missing library: ${BINARY}"; echo ""; exit ${EXIT_FAILURE}; fi fi if test ${IS_PYTHON_SCRIPT} -eq 0; then LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" LD_PRELOAD="${LIBASAN}" LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else LSAN_OPTIONS=suppressions="${LSAN_SUPPRESSIONS}" LD_PRELOAD="${LIBASAN}" LD_LIBRARY_PATH="${LIBRARY_PATH}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi fi elif test -n "${CHECK_WITH_GDB}"; then local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); if test "${PLATFORM}" = "Darwin"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else DYLD_LIBRARY_PATH="${LIBRARY_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi elif test "${PLATFORM}" = "CYGWIN_NT"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else PATH="${LIBRARY_PATH}:${PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi else if test ${IS_PYTHON_SCRIPT} -eq 0; then LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else LD_LIBRARY_PATH="${LIBRARY_PATH}" gdb -ex "set non-stop on" -ex "run" -ex "quit" --args "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi fi elif test -n "${CHECK_WITH_VALGRIND}"; then local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); local VALGRIND_LOG="valgrind.log-$$"; local VALGRIND_OPTIONS=("--tool=memcheck" "--leak-check=full" "--show-leak-kinds=definite,indirect,possible" "--track-origins=yes" "--log-file=${VALGRIND_LOG}"); if test "${PLATFORM}" = "Darwin"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else DYLD_LIBRARY_PATH="${LIBRARY_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi elif test "${PLATFORM}" = "CYGWIN_NT"; then if test ${IS_PYTHON_SCRIPT} -eq 0; then PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else PATH="${LIBRARY_PATH}:${PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi else if test ${IS_PYTHON_SCRIPT} -eq 0; then LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else LD_LIBRARY_PATH="${LIBRARY_PATH}" valgrind ${VALGRIND_OPTIONS[@]} "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; fi fi if test ${RESULT} -eq ${EXIT_SUCCESS}; then grep "All heap blocks were freed -- no leaks are possible" ${VALGRIND_LOG} > /dev/null 2>&1; if test $? -ne ${EXIT_SUCCESS}; then # Ignore "still reachable" # Also see: http://valgrind.org/docs/manual/faq.html#faq.deflost grep "definitely lost: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_DIRECTLY_LOST=$?; grep "indirectly lost: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_INDIRECTLY_LOST=$?; grep "possibly lost: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_POSSIBLY_LOST=$?; grep "suppressed: 0 bytes in 0 blocks" ${VALGRIND_LOG} > /dev/null 2>&1; RESULT_SUPPRESSED=$?; if test ${RESULT_DIRECTLY_LOST} -ne ${EXIT_SUCCESS} || test ${RESULT_INDIRECTLY_LOST} -ne ${EXIT_SUCCESS} || test ${RESULT_POSSIBLY_LOST} -ne ${EXIT_SUCCESS} || test ${RESULT_SUPPRESSED} -ne ${EXIT_SUCCESS}; then echo "Memory leakage detected."; cat ${VALGRIND_LOG}; RESULT=${EXIT_FAILURE}; fi fi # Detect valgrind warnings. local NUMBER_OF_LINES=`wc -l ${VALGRIND_LOG} | awk '{ print $1 }'`; if test ${NUMBER_OF_LINES} -ne 15 && test ${NUMBER_OF_LINES} -ne 22; then echo "Unsupported number of lines: ${NUMBER_OF_LINES}"; cat ${VALGRIND_LOG}; RESULT=${EXIT_FAILURE}; fi fi rm -f ${VALGRIND_LOG}; elif test ${IS_PYTHON_SCRIPT} -eq 0; then if ! test -f "${TEST_EXECUTABLE}"; then echo "Invalid test Python script: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); if test "${PLATFORM}" = "Darwin"; then if test -n "${CHECK_WITH_STDERR}"; then DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else DYLD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}" 2> /dev/null; RESULT=$?; fi elif test "${PLATFORM}" = "CYGWIN_NT"; then if test -n "${CHECK_WITH_STDERR}"; then PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else PATH="${LIBRARY_PATH}:${PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}" 2> /dev/null; RESULT=$?; fi else if test -n "${CHECK_WITH_STDERR}"; then LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else LD_LIBRARY_PATH="${LIBRARY_PATH}" PYTHONPATH="${PYTHON_MODULE_PATH}" "${PYTHON}" "${TEST_EXECUTABLE}" ${ARGUMENTS[@]} "${INPUT_FILE}" 2> /dev/null; RESULT=$?; fi fi else if ! test -x "${TEST_EXECUTABLE}"; then echo "Invalid test executable: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi if test -n "${CHECK_WITH_STDERR}"; then ${TEST_EXECUTABLE} ${ARGUMENTS[@]} "${INPUT_FILE}"; RESULT=$?; else ${TEST_EXECUTABLE} ${ARGUMENTS[@]} "${INPUT_FILE}" 2> /dev/null; RESULT=$?; fi fi return ${RESULT}; } # Runs the test on the input file. # # Note that this function is not intended to be directly invoked # from outside the test runner script. # # Arguments: # a string containing the path of the test set directory # a string containing the description of the test # a string containing the test mode # a string containing the name of the option set # a string containing the path of the test executable # a string containing the path of the test input file # an array containing the arguments for the test executable # # Returns: # an integer containg the exit status of the test executable # run_test_on_input_file() { local TEST_SET_DIRECTORY=$1; local TEST_DESCRIPTION=$2; local TEST_MODE=$3; local OPTION_SET=$4; local TEST_EXECUTABLE=$5; local INPUT_FILE=$6; shift 6; local ARGUMENTS=("$@"); local INPUT_NAME=`basename "${INPUT_FILE}"`; local OPTIONS=(); local TEST_OUTPUT="${INPUT_NAME}"; if test -n "${OPTION_SET}"; then OPTIONS_STRING=$(read_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); IFS=" " read -a OPTIONS <<< "${OPTIONS_STRING}"; TEST_OUTPUT="${INPUT_NAME}-${OPTION_SET}"; fi local TMPDIR="tmp$$"; local RESULT=0; rm -rf ${TMPDIR}; mkdir ${TMPDIR}; if test "${TEST_MODE}" = "with_callback"; then test_callback "${TMPDIR}" "${TEST_SET_DIRECTORY}" "${TEST_OUTPUT}" "${TEST_EXECUTABLE}" "${TEST_INPUT}" ${ARGUMENTS[@]} "${OPTIONS[@]}"; RESULT=$?; elif test "${TEST_MODE}" = "with_stdout_reference"; then TEST_EXECUTABLE=$( readlink_f "${TEST_EXECUTABLE}" ); if ! test -x ${TEST_EXECUTABLE}; then echo "Invalid test executable: ${TEST_EXECUTABLE}"; echo ""; return ${EXIT_FAILURE}; fi local INPUT_FILE_FULL_PATH=$( readlink_f "${INPUT_FILE}" ); local TEST_LOG="${TEST_OUTPUT}.log"; (cd ${TMPDIR} && run_test_with_input_and_arguments "${TEST_EXECUTABLE}" "${INPUT_FILE_FULL_PATH}" ${ARGUMENTS[@]} "${OPTIONS[@]}" | sed '1,2d' > "${TEST_LOG}"); RESULT=$?; local TEST_RESULTS="${TMPDIR}/${TEST_LOG}"; local STORED_TEST_RESULTS="${TEST_SET_DIRECTORY}/${TEST_LOG}.gz"; if test -f "${STORED_TEST_RESULTS}"; then # Using zcat here since zdiff has issues on Mac OS X. # Note that zcat on Mac OS X requires the input from stdin. zcat < "${STORED_TEST_RESULTS}" | diff "${TEST_RESULTS}" -; RESULT=$?; else gzip "${TEST_RESULTS}"; mv "${TEST_RESULTS}.gz" ${TEST_SET_DIRECTORY}; fi else run_test_with_input_and_arguments "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]} "${OPTIONS[@]}"; RESULT=$?; fi rm -rf ${TMPDIR}; if test -n "${TEST_DESCRIPTION}"; then OPTIONS=`echo "${OPTIONS[*]}" | tr '\n' ' ' | sed 's/[ ]\$//'`; if test -z "${OPTIONS}"; then echo -n "${TEST_DESCRIPTION} with input: ${INPUT_FILE}"; else echo -n "${TEST_DESCRIPTION} with options: '${OPTIONS}' and input: ${INPUT_FILE}"; fi if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi fi return ${RESULT}; } # Runs the test with options on the input file. # # Note that this function is not intended to be directly invoked # from outside the test runner script. # # Arguments: # a string containing the path of the test set directory # a string containing the description of the test # a string containing the test mode # a string containing the name of the option sets # a string containing the path of the test executable # a string containing the path of the test input file # an array containing the arguments for the test executable # # Returns: # an integer containg the exit status of the test executable # run_test_on_input_file_with_options() { local TEST_SET_DIRECTORY=$1; local TEST_DESCRIPTION=$2; local TEST_MODE=$3; local OPTION_SETS=$4; local TEST_EXECUTABLE=$5; local INPUT_FILE=$6; shift 6; local ARGUMENTS=("$@"); local RESULT=${EXIT_SUCCESS}; local TESTED_WITH_OPTIONS=0; for OPTION_SET in `echo ${OPTION_SETS} | tr ' ' '\n'`; do local OPTION_FILE=$(get_testion_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); if ! test -f ${OPTION_FILE}; then continue fi run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "${TEST_MODE}" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]}; RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then break; fi TESTED_WITH_OPTIONS=1; done if test ${RESULT} -eq ${EXIT_SUCCESS} && test ${TESTED_WITH_OPTIONS} -eq 0; then run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "${TEST_MODE}" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]}; RESULT=$?; fi return ${RESULT}; } libewf-20140807/tests/test_read_write.sh0000754000175000017500000000442713440662656022236 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # Expert Witness Compression Format (EWF) library read/write testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; TMP="tmp"; LS="ls"; TR="tr"; SED="sed"; SORT="sort"; UNIQ="uniq"; WC="wc"; test_read_write() { echo "Testing read/write of input:" $*; mkdir ${TMP}; ./${EWF_TEST_READ_WRITE} -t ${TMP}/read_write $*; RESULT=$?; rm -rf ${TMP}; echo ""; return ${RESULT}; } EWF_TEST_READ_WRITE="ewf_test_read_write"; if ! test -x ${EWF_TEST_READ_WRITE}; then EWF_TEST_READ_WRITE="ewf_test_read_write.exe"; fi if ! test -x ${EWF_TEST_READ_WRITE}; then echo "Missing executable: ${EWF_TEST_READ_WRITE}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test read/write create ${INPUT} directory and place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi RESULT=`${LS} ${INPUT} | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ} | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test read/write place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi # Run tests for: E01, e01, s01 BASENAMES=`${LS} ${INPUT}/*.??? | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ}`; for BASENAME in ${BASENAMES}; do FILENAMES=`${LS} ${BASENAME}.??? | ${TR} '\n' ' '`; if ! test_read_write ${FILENAMES}; then exit ${EXIT_FAILURE}; fi done exit ${EXIT_SUCCESS}; libewf-20140807/tests/ewf_test_seek.c0000664000175000017500000002225313440662656021506 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library seek offset testing program * * 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 . */ #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_libcerror.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_seek generate verbose output #define EWF_TEST_SEEK_VERBOSE */ /* Tests seeking an offset * Returns 1 if successful, 0 if not or -1 on error */ int ewf_test_seek_offset( libewf_handle_t *handle, off64_t input_offset, int input_whence, off64_t expected_offset ) { libcerror_error_t *error = NULL; const char *whence_string = NULL; static char *function = "ewf_test_seek_offset"; off64_t result_offset = 0; int result = 0; if( input_whence == SEEK_CUR ) { whence_string = "SEEK_CUR"; } else if( input_whence == SEEK_END ) { whence_string = "SEEK_END"; } else if( input_whence == SEEK_SET ) { whence_string = "SEEK_SET"; } else { whence_string = "UNKNOWN"; } fprintf( stdout, "Testing seek of offset: %" PRIi64 " and whence: %s\t", input_offset, whence_string ); result_offset = libewf_handle_seek_offset( handle, input_offset, input_whence, &error ); if( result_offset != expected_offset ) { if( result_offset == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, input_offset ); result = -1; } } else { if( result_offset == -1 ) { libcerror_error_free( &error ); } result = 1; } if( result != 0 ) { fprintf( stdout, "(PASS)" ); } else { fprintf( stdout, "(FAIL)" ); } fprintf( stdout, "\n" ); if( result == -1 ) { libcerror_error_backtrace_fprint( error, stdout ); libcerror_error_free( &error ); } else if( result == 0 ) { fprintf( stdout, "%s: unexpected result offset: %" PRIi64 "\n", function, result_offset ); } return( result ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { libcerror_error_t *error = NULL; libewf_handle_t *handle = NULL; size64_t media_size = 0; if( argc < 2 ) { fprintf( stderr, "Missing filename(s).\n" ); return( EXIT_FAILURE ); } #if defined( HAVE_DEBUG_OUTPUT ) && defined( EWF_TEST_SEEK_VERBOSE ) libewf_notify_set_verbose( 1 ); libewf_notify_set_stream( stderr, NULL ); #endif /* Initialization */ if( libewf_handle_initialize( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to create handle.\n" ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, &( argv[ 1 ] ), argc - 1, LIBEWF_OPEN_READ, &error ) != 1 ) #else if( libewf_handle_open( handle, &( argv[ 1 ] ), argc - 1, LIBEWF_OPEN_READ, &error ) != 1 ) #endif { fprintf( stderr, "Unable to open file(s).\n" ); goto on_error; } if( libewf_handle_get_media_size( handle, &media_size, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve media size.\n" ); goto on_error; } if( media_size > (size64_t) INT64_MAX ) { fprintf( stderr, "Media size exceeds maximum.\n" ); goto on_error; } /* Test: SEEK_SET offset: 0 * Expected result: 0 */ if( ewf_test_seek_offset( handle, 0, SEEK_SET, 0 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_SET offset: * Expected result: */ if( ewf_test_seek_offset( handle, (off64_t) media_size, SEEK_SET, (off64_t) media_size ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_SET offset: * Expected result: */ if( ewf_test_seek_offset( handle, (off64_t) ( media_size / 5 ), SEEK_SET, (off64_t) ( media_size / 5 ) ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_SET offset: * Expected result: */ if( ewf_test_seek_offset( handle, (off64_t) ( media_size + 987 ), SEEK_SET, (off64_t) ( media_size + 987 ) ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_SET offset: -987 * Expected result: -1 */ if( ewf_test_seek_offset( handle, -987, SEEK_SET, -1 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_CUR offset: 0 * Expected result: */ if( ewf_test_seek_offset( handle, 0, SEEK_CUR, (off64_t) ( media_size + 987 ) ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_CUR offset: <-1 * (media_size + 987)> * Expected result: 0 */ if( ewf_test_seek_offset( handle, -1 * (off64_t) ( media_size + 987 ), SEEK_CUR, 0 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_CUR offset: * Expected result: */ if( ewf_test_seek_offset( handle, (off64_t) ( media_size / 3 ), SEEK_CUR, (off64_t) ( media_size / 3 ) ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } if( media_size == 0 ) { /* Test: SEEK_CUR offset: <-2 * (media_size / 3)> * Expected result: 0 */ if( ewf_test_seek_offset( handle, -2 * (off64_t) ( media_size / 3 ), SEEK_CUR, 0 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } } else { /* Test: SEEK_CUR offset: <-2 * (media_size / 3)> * Expected result: -1 */ if( ewf_test_seek_offset( handle, -2 * (off64_t) ( media_size / 3 ), SEEK_CUR, -1 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } } /* Test: SEEK_END offset: 0 * Expected result: */ if( ewf_test_seek_offset( handle, 0, SEEK_END, (off64_t) media_size ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_END offset: <-1 * media_size> * Expected result: 0 */ if( ewf_test_seek_offset( handle, -1 * (off64_t) media_size, SEEK_END, 0 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_END offset: <-1 * (media_size / 4)> * Expected result: */ if( ewf_test_seek_offset( handle, -1 * (off64_t) ( media_size / 4 ), SEEK_END, (off64_t) media_size - (off64_t) ( media_size / 4 ) ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_END offset: 542 * Expected result: */ if( ewf_test_seek_offset( handle, 542, SEEK_END, (off64_t) ( media_size + 542 ) ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: SEEK_END offset: <-1 * (media_size + 542)> * Expected result: -1 */ if( ewf_test_seek_offset( handle, -1 * (off64_t) ( media_size + 542 ), SEEK_END, -1 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Test: UNKNOWN (88) offset: 0 * Expected result: -1 */ if( ewf_test_seek_offset( handle, 0, 88, -1 ) != 1 ) { fprintf( stderr, "Unable to test seek offset.\n" ); goto on_error; } /* Clean up */ if( libewf_handle_close( handle, &error ) != 0 ) { fprintf( stderr, "Unable to close file(s).\n" ); goto on_error; } if( libewf_handle_free( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to free handle.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } if( handle != NULL ) { libewf_handle_close( handle, NULL ); libewf_handle_free( &handle, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/tests/test_ewfverify.sh0000775000175000017500000000621013440663047022105 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfverify testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; INPUT_ERROR="input_error"; INPUT_MORE="input_more"; TMP="tmp"; LS="ls"; TR="tr"; WC="wc"; test_verify() { INPUT_FILE=$1; ${EWFVERIFY} -q -d sha1 ${INPUT_FILE}; RESULT=$?; echo ""; echo -n "Testing ewfverify of input: ${INPUT_FILE} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } EWFVERIFY="../ewftools/ewfverify"; if ! test -x ${EWFVERIFY}; then EWFVERIFY="../ewftools/ewfverify.exe"; fi if ! test -x ${EWFVERIFY}; then echo "Missing executable: ${EWFVERIFY}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test ewfverify create ${INPUT} directory and place EWF test files in directory."; exit ${EXIT_IGNORE}; fi EXIT_RESULT=${EXIT_IGNORE}; if test -d ${INPUT}; then RESULT=`${LS} ${INPUT}/*.[esE]01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test ewfverify place EWF test files in directory."; else for FILENAME in `${LS} ${INPUT}/*.[esE]01 | ${TR} ' ' '\n'`; do if [ "${FILENAME}" = "${INPUT}/floppy-ewf1.35-best-compression.E01" ]; then # experimental version only echo; elif [ "${FILENAME}" = "${INPUT}/floppy-ewf1.35-nocompression.E01" ]; then # experimental version only echo; elif ! test_verify "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi if test -d ${INPUT_ERROR}; then RESULT=`${LS} ${INPUT_ERROR}/*.[esE]01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT_ERROR} directory, to test read place test files in directory."; else for FILENAME in `${LS} ${INPUT_ERROR}/*.[esE]01 | ${TR} ' ' '\n'`; do if test_verify "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi if test -d ${INPUT_MORE}; then RESULT=`${LS} ${INPUT_MORE}/*.[esE]01 | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT_MORE} directory, to test read place test files in directory."; else for FILENAME in `${LS} ${INPUT_MORE}/*.[esE]01 | ${TR} ' ' '\n'`; do if ! test_verify "${FILENAME}"; then exit ${EXIT_FAILURE}; fi done EXIT_RESULT=${EXIT_SUCCESS}; fi fi exit ${EXIT_RESULT}; libewf-20140807/tests/test_ewfacquire_resume.sh0000754000175000017500000000736213440662656023625 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfacquire resume testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input_raw"; TMP="tmp"; AWK="awk"; LS="ls"; TR="tr"; WC="wc"; test_write_resume() { INPUT_FILE=$1; RESUME_OFFSET=$2; mkdir ${TMP}; ${EWFACQUIRE} -q -u \ -t ${TMP}/resume \ -C case_number \ -D description \ -E evidence_number \ -e examiner \ -N notes \ -m removable \ -M logical \ -c none \ -f encase5 \ -S 650MB \ -b 64 \ ${INPUT_FILE} RESULT=$?; if [ ${RESULT} -eq ${EXIT_SUCCESS} ]; then ${EWFVERIFY} -q ${TMP}/resume.E01 RESULT=$?; fi if [ ${RESULT} -eq ${EXIT_SUCCESS} ]; then ${EWFTRUNCATE} ${RESUME_OFFSET} ${TMP}/resume.E01 RESULT=$?; fi if [ ${RESULT} -eq ${EXIT_SUCCESS} ]; then ${EWFACQUIRE} -q -R ${INPUT_FILE} < # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; TMP="tmp"; #TODO call several python scripts exit ${EXIT_SUCCESS}; libewf-20140807/tests/Makefile.in0000664000175000017500000016122313443455351020554 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = ewf_test_glob$(EXEEXT) ewf_test_read$(EXEEXT) \ ewf_test_read_write$(EXEEXT) \ ewf_test_read_write_delta$(EXEEXT) ewf_test_seek$(EXEEXT) \ ewf_test_truncate$(EXEEXT) ewf_test_write$(EXEEXT) \ ewf_test_write_chunk$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_ewf_test_glob_OBJECTS = ewf_test_glob.$(OBJEXT) ewf_test_glob_OBJECTS = $(am_ewf_test_glob_OBJECTS) ewf_test_glob_DEPENDENCIES = ../libewf/libewf.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_ewf_test_read_OBJECTS = ewf_test_read.$(OBJEXT) ewf_test_read_OBJECTS = $(am_ewf_test_read_OBJECTS) ewf_test_read_DEPENDENCIES = ../libewf/libewf.la am_ewf_test_read_write_OBJECTS = ewf_test_getopt.$(OBJEXT) \ ewf_test_read_write.$(OBJEXT) ewf_test_read_write_OBJECTS = $(am_ewf_test_read_write_OBJECTS) ewf_test_read_write_DEPENDENCIES = ../libewf/libewf.la am_ewf_test_read_write_delta_OBJECTS = ewf_test_getopt.$(OBJEXT) \ ewf_test_read_write_delta.$(OBJEXT) ewf_test_read_write_delta_OBJECTS = \ $(am_ewf_test_read_write_delta_OBJECTS) ewf_test_read_write_delta_DEPENDENCIES = ../libewf/libewf.la am_ewf_test_seek_OBJECTS = ewf_test_seek.$(OBJEXT) ewf_test_seek_OBJECTS = $(am_ewf_test_seek_OBJECTS) ewf_test_seek_DEPENDENCIES = ../libewf/libewf.la am_ewf_test_truncate_OBJECTS = ewf_test_truncate.$(OBJEXT) ewf_test_truncate_OBJECTS = $(am_ewf_test_truncate_OBJECTS) ewf_test_truncate_DEPENDENCIES = am_ewf_test_write_OBJECTS = ewf_test_getopt.$(OBJEXT) \ ewf_test_write.$(OBJEXT) ewf_test_write_OBJECTS = $(am_ewf_test_write_OBJECTS) ewf_test_write_DEPENDENCIES = ../libewf/libewf.la am_ewf_test_write_chunk_OBJECTS = ewf_test_getopt.$(OBJEXT) \ ewf_test_write_chunk.$(OBJEXT) ewf_test_write_chunk_OBJECTS = $(am_ewf_test_write_chunk_OBJECTS) ewf_test_write_chunk_DEPENDENCIES = ../libewf/libewf.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/ewf_test_getopt.Po \ ./$(DEPDIR)/ewf_test_glob.Po ./$(DEPDIR)/ewf_test_read.Po \ ./$(DEPDIR)/ewf_test_read_write.Po \ ./$(DEPDIR)/ewf_test_read_write_delta.Po \ ./$(DEPDIR)/ewf_test_seek.Po ./$(DEPDIR)/ewf_test_truncate.Po \ ./$(DEPDIR)/ewf_test_write.Po \ ./$(DEPDIR)/ewf_test_write_chunk.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ewf_test_glob_SOURCES) $(ewf_test_read_SOURCES) \ $(ewf_test_read_write_SOURCES) \ $(ewf_test_read_write_delta_SOURCES) $(ewf_test_seek_SOURCES) \ $(ewf_test_truncate_SOURCES) $(ewf_test_write_SOURCES) \ $(ewf_test_write_chunk_SOURCES) DIST_SOURCES = $(ewf_test_glob_SOURCES) $(ewf_test_read_SOURCES) \ $(ewf_test_read_write_SOURCES) \ $(ewf_test_read_write_delta_SOURCES) $(ewf_test_seek_SOURCES) \ $(ewf_test_truncate_SOURCES) $(ewf_test_write_SOURCES) \ $(ewf_test_write_chunk_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ @HAVE_PYTHON_TRUE@TESTS_PYEWF = \ @HAVE_PYTHON_TRUE@ test_pyewf.sh TESTS = \ test_glob.sh \ test_seek.sh \ test_read.sh \ test_write.sh \ test_read_write.sh \ test_read_write_delta.sh \ test_ewfverify.sh \ test_ewfverify_logical.sh \ test_ewfacquire.sh \ test_ewfacquire_optical.sh \ test_ewfacquirestream.sh \ test_ewfacquire_resume.sh \ test_ewfinfo.sh \ test_ewfexport.sh \ test_ewfexport_logical.sh \ $(TESTS_PYEWF) check_SCRIPTS = \ test_ewfacquire.sh \ test_ewfacquire_optical.sh \ test_ewfacquire_resume.sh \ test_ewfacquirestream.sh \ test_ewfinfo.sh \ test_ewfexport.sh \ test_ewfexport_logical.sh \ test_ewfverify.sh \ test_ewfverify_logical.sh \ test_glob.sh \ test_manpage.sh \ test_pyewf.sh \ test_read.sh \ test_read_write.sh \ test_read_write_delta.sh \ test_runner.sh \ test_seek.sh \ test_write.sh EXTRA_DIST = \ $(check_SCRIPTS) ewf_test_glob_SOURCES = \ ewf_test_glob.c \ ewf_test_libewf.h ewf_test_glob_LDADD = \ ../libewf/libewf.la ewf_test_read_SOURCES = \ ewf_test_definitions.h \ ewf_test_libcerror.h \ ewf_test_libewf.h \ ewf_test_read.c ewf_test_read_LDADD = \ ../libewf/libewf.la \ @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_libcnotify.h \ ewf_test_libewf.h \ ewf_test_read_write.c ewf_test_read_write_LDADD = \ @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ @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_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@ ewf_test_seek_SOURCES = \ ewf_test_libcerror.h \ ewf_test_libewf.h \ ewf_test_seek.c ewf_test_seek_LDADD = \ ../libewf/libewf.la \ @LIBCERROR_LIBADD@ ewf_test_truncate_SOURCES = \ ewf_test_libcerror.h \ ewf_test_libcfile.h \ ewf_test_libcnotify.h \ ewf_test_truncate.c ewf_test_truncate_LDADD = \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_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_libcnotify.h \ ewf_test_libewf.h \ ewf_test_write.c ewf_test_write_LDADD = \ @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ @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_libcnotify.h \ ewf_test_libewf.h \ ewf_test_write_chunk.c ewf_test_write_chunk_LDADD = \ @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ @LIBCERROR_LIBADD@ MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ewf_test_glob$(EXEEXT): $(ewf_test_glob_OBJECTS) $(ewf_test_glob_DEPENDENCIES) $(EXTRA_ewf_test_glob_DEPENDENCIES) @rm -f ewf_test_glob$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_glob_OBJECTS) $(ewf_test_glob_LDADD) $(LIBS) ewf_test_read$(EXEEXT): $(ewf_test_read_OBJECTS) $(ewf_test_read_DEPENDENCIES) $(EXTRA_ewf_test_read_DEPENDENCIES) @rm -f ewf_test_read$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_read_OBJECTS) $(ewf_test_read_LDADD) $(LIBS) ewf_test_read_write$(EXEEXT): $(ewf_test_read_write_OBJECTS) $(ewf_test_read_write_DEPENDENCIES) $(EXTRA_ewf_test_read_write_DEPENDENCIES) @rm -f ewf_test_read_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_read_write_OBJECTS) $(ewf_test_read_write_LDADD) $(LIBS) ewf_test_read_write_delta$(EXEEXT): $(ewf_test_read_write_delta_OBJECTS) $(ewf_test_read_write_delta_DEPENDENCIES) $(EXTRA_ewf_test_read_write_delta_DEPENDENCIES) @rm -f ewf_test_read_write_delta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_read_write_delta_OBJECTS) $(ewf_test_read_write_delta_LDADD) $(LIBS) ewf_test_seek$(EXEEXT): $(ewf_test_seek_OBJECTS) $(ewf_test_seek_DEPENDENCIES) $(EXTRA_ewf_test_seek_DEPENDENCIES) @rm -f ewf_test_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_seek_OBJECTS) $(ewf_test_seek_LDADD) $(LIBS) ewf_test_truncate$(EXEEXT): $(ewf_test_truncate_OBJECTS) $(ewf_test_truncate_DEPENDENCIES) $(EXTRA_ewf_test_truncate_DEPENDENCIES) @rm -f ewf_test_truncate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_truncate_OBJECTS) $(ewf_test_truncate_LDADD) $(LIBS) ewf_test_write$(EXEEXT): $(ewf_test_write_OBJECTS) $(ewf_test_write_DEPENDENCIES) $(EXTRA_ewf_test_write_DEPENDENCIES) @rm -f ewf_test_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_write_OBJECTS) $(ewf_test_write_LDADD) $(LIBS) ewf_test_write_chunk$(EXEEXT): $(ewf_test_write_chunk_OBJECTS) $(ewf_test_write_chunk_DEPENDENCIES) $(EXTRA_ewf_test_write_chunk_DEPENDENCIES) @rm -f ewf_test_write_chunk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewf_test_write_chunk_OBJECTS) $(ewf_test_write_chunk_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_glob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_read.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_read_write.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_read_write_delta.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_seek.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_truncate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_write.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewf_test_write_chunk.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) $(check_SCRIPTS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) $(check_SCRIPTS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_glob.sh.log: test_glob.sh @p='test_glob.sh'; \ b='test_glob.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_seek.sh.log: test_seek.sh @p='test_seek.sh'; \ b='test_seek.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_read.sh.log: test_read.sh @p='test_read.sh'; \ b='test_read.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_write.sh.log: test_write.sh @p='test_write.sh'; \ b='test_write.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_read_write.sh.log: test_read_write.sh @p='test_read_write.sh'; \ b='test_read_write.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_read_write_delta.sh.log: test_read_write_delta.sh @p='test_read_write_delta.sh'; \ b='test_read_write_delta.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfverify.sh.log: test_ewfverify.sh @p='test_ewfverify.sh'; \ b='test_ewfverify.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfverify_logical.sh.log: test_ewfverify_logical.sh @p='test_ewfverify_logical.sh'; \ b='test_ewfverify_logical.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfacquire.sh.log: test_ewfacquire.sh @p='test_ewfacquire.sh'; \ b='test_ewfacquire.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfacquire_optical.sh.log: test_ewfacquire_optical.sh @p='test_ewfacquire_optical.sh'; \ b='test_ewfacquire_optical.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfacquirestream.sh.log: test_ewfacquirestream.sh @p='test_ewfacquirestream.sh'; \ b='test_ewfacquirestream.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfacquire_resume.sh.log: test_ewfacquire_resume.sh @p='test_ewfacquire_resume.sh'; \ b='test_ewfacquire_resume.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfinfo.sh.log: test_ewfinfo.sh @p='test_ewfinfo.sh'; \ b='test_ewfinfo.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfexport.sh.log: test_ewfexport.sh @p='test_ewfexport.sh'; \ b='test_ewfexport.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_ewfexport_logical.sh.log: test_ewfexport_logical.sh @p='test_ewfexport_logical.sh'; \ b='test_ewfexport_logical.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_pyewf.sh.log: test_pyewf.sh @p='test_pyewf.sh'; \ b='test_pyewf.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/ewf_test_getopt.Po -rm -f ./$(DEPDIR)/ewf_test_glob.Po -rm -f ./$(DEPDIR)/ewf_test_read.Po -rm -f ./$(DEPDIR)/ewf_test_read_write.Po -rm -f ./$(DEPDIR)/ewf_test_read_write_delta.Po -rm -f ./$(DEPDIR)/ewf_test_seek.Po -rm -f ./$(DEPDIR)/ewf_test_truncate.Po -rm -f ./$(DEPDIR)/ewf_test_write.Po -rm -f ./$(DEPDIR)/ewf_test_write_chunk.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/tests/test_seek.sh0000754000175000017500000000417313440662656021036 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # Expert Witness Compression Format (EWF) library seek offset testing script # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input"; TMP="tmp"; CMP="cmp"; LS="ls"; TR="tr"; SED="sed"; SORT="sort"; UNIQ="uniq"; WC="wc"; test_seek() { echo "Testing seek offset of input:" $*; ./${EWF_TEST_SEEK} $*; RESULT=$?; echo ""; return ${RESULT}; } EWF_TEST_SEEK="ewf_test_seek"; if ! test -x ${EWF_TEST_SEEK}; then EWF_TEST_SEEK="ewf_test_seek.exe"; fi if ! test -x ${EWF_TEST_SEEK}; then echo "Missing executable: ${EWF_TEST_SEEK}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test seek create ${INPUT} directory and place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi RESULT=`${LS} ${INPUT} | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ} | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test seek place EWF test files in directory."; echo "Use unique filename bases per set of EWF image file(s)." exit ${EXIT_IGNORE}; fi # Run tests for: E01, e01, s01 BASENAMES=`${LS} ${INPUT}/*.??? | ${TR} ' ' '\n' | ${SED} 's/[.][^.]*$//' | ${SORT} | ${UNIQ}`; for BASENAME in ${BASENAMES}; do if ! test_seek `${LS} ${BASENAME}.???`; then exit ${EXIT_FAILURE}; fi done exit ${EXIT_SUCCESS}; libewf-20140807/tests/ewf_test_write_chunk.c0000664000175000017500000003377113440662656023110 0ustar00lordyestalordyesta00000000000000/* * Expert Witness Compression Format (EWF) library write chunktesting program * * 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 . */ #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" #include "ewf_test_libewf.h" /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error */ int ewf_test_system_string_decimal_copy_to_64_bit( const system_character_t *string, size_t string_size, uint64_t *value_64bit, libcerror_error_t **error ) { static char *function = "ewf_test_system_string_decimal_copy_to_64_bit"; size_t string_index = 0; system_character_t character_value = 0; uint8_t maximum_string_index = 20; int8_t sign = 1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( value_64bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value 64-bit.", function ); return( -1 ); } *value_64bit = 0; if( string[ string_index ] == (system_character_t) '-' ) { string_index++; maximum_string_index++; sign = -1; } else if( string[ string_index ] == (system_character_t) '+' ) { string_index++; maximum_string_index++; } while( string_index < string_size ) { if( string[ string_index ] == 0 ) { break; } if( string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } *value_64bit *= 10; if( ( string[ string_index ] >= (system_character_t) '0' ) && ( string[ string_index ] <= (system_character_t) '9' ) ) { character_value = (system_character_t) ( string[ string_index ] - (system_character_t) '0' ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: %" PRIc_SYSTEM " at index: %d.", function, string[ string_index ], string_index ); return( -1 ); } *value_64bit += character_value; string_index++; } if( sign == -1 ) { *value_64bit *= (uint64_t) -1; } return( 1 ); } /* Tests writing data of media size to EWF file(s) with a maximum segment size * Return 1 if successful, 0 if not or -1 on error */ int ewf_test_write_chunk( const char *filename, size64_t media_size, size64_t maximum_segment_size, int8_t compression_level, uint8_t compression_flags, libcerror_error_t **error ) { libewf_handle_t *handle = NULL; uint8_t *checksum_buffer = NULL; uint8_t *chunk_buffer = NULL; uint8_t *compressed_chunk_buffer = NULL; static char *function = "ewf_test_write_chunk"; size_t chunk_buffer_size = 0; size_t compressed_chunk_buffer_size = 0; ssize_t process_count = 0; ssize_t write_count = 0; uint32_t chunk_checksum = 0; uint32_t sectors_per_chunk = 0; int8_t is_compressed = 0; int8_t process_checksum = 0; int sector_iterator = 0; if( libewf_handle_initialize( &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, (wchar_t * const *) &filename, 1, LIBEWF_OPEN_WRITE, error ) != 1 ) #else if( libewf_handle_open( handle, (char * const *) &filename, 1, LIBEWF_OPEN_WRITE, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle.", function ); goto on_error; } if( media_size > 0 ) { if( libewf_handle_set_media_size( handle, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set media size.", function ); goto on_error; } } if( maximum_segment_size > 0 ) { if( libewf_handle_set_maximum_segment_size( handle, maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set maximum segment size.", function ); goto on_error; } } if( libewf_handle_set_compression_values( handle, compression_level, compression_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set compression values.", function ); goto on_error; } sectors_per_chunk = 64; if( libewf_handle_set_sectors_per_chunk( handle, sectors_per_chunk, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable set sectors per chunk.", function ); goto on_error; } chunk_buffer_size = sectors_per_chunk * 512; /* Use the chunck buffer also as checksum buffer */ chunk_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * ( chunk_buffer_size + 4 ) ); /* The compressed data can become larger than the uncompressed data */ compressed_chunk_buffer_size = chunk_buffer_size * 2; compressed_chunk_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * compressed_chunk_buffer_size ); if( chunk_buffer != NULL ) { checksum_buffer = &( chunk_buffer[ chunk_buffer_size - 1 ] ); } for( sector_iterator = 0; sector_iterator < 26; sector_iterator++ ) { if( memory_set( chunk_buffer, (int) 'A' + sector_iterator, chunk_buffer_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable set value in chunk buffer.", function ); goto on_error; } process_count = libewf_handle_prepare_write_chunk( handle, chunk_buffer, chunk_buffer_size, compressed_chunk_buffer, &compressed_chunk_buffer_size, &is_compressed, &chunk_checksum, &process_checksum, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to prepare chunk buffer before writing.", function ); goto on_error; } if( is_compressed == 0 ) { write_count = libewf_handle_write_chunk( handle, chunk_buffer, chunk_buffer_size, chunk_buffer_size, is_compressed, checksum_buffer, chunk_checksum, process_checksum, error ); } else { write_count = libewf_handle_write_chunk( handle, compressed_chunk_buffer, compressed_chunk_buffer_size, chunk_buffer_size, is_compressed, checksum_buffer, chunk_checksum, process_checksum, error ); } if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable write chunk of size: %" PRIzd ".", function, chunk_buffer_size ); goto on_error; } if( media_size > (size64_t) chunk_buffer_size ) { media_size -= chunk_buffer_size; } else if( media_size > 0 ) { media_size = 0; } if( media_size == 0 ) { break; } } memory_free( compressed_chunk_buffer ); compressed_chunk_buffer = NULL; memory_free( chunk_buffer ); chunk_buffer = NULL; if( libewf_handle_close( handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } if( libewf_handle_free( &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free handle.", function ); goto on_error; } return( 1 ); on_error: if( compressed_chunk_buffer != NULL ) { memory_free( compressed_chunk_buffer ); } if( chunk_buffer != NULL ) { memory_free( chunk_buffer ); } if( handle != NULL ) { libewf_handle_close( handle, NULL ); libewf_handle_free( &handle, NULL ); } return( -1 ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { 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, _SYSTEM_STRING( "b:B:c:S:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); case (system_integer_t) 'b': option_chunk_size = optarg; break; case (system_integer_t) 'c': option_compression_level = optarg; break; case (system_integer_t) 'B': option_media_size = optarg; break; case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; } } if( optind == argc ) { fprintf( stderr, "Missing EWF image filename.\n" ); return( EXIT_FAILURE ); } if( option_chunk_size != NULL ) { string_length = system_string_length( option_chunk_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_chunk_size, string_length + 1, &chunk_size, &error ) != 1 ) { fprintf( stderr, "Unsupported chunk size.\n" ); goto on_error; } } if( option_compression_level != NULL ) { string_length = system_string_length( option_compression_level ); if( string_length != 1 ) { fprintf( stderr, "Unsupported compression level.\n" ); goto on_error; } if( option_compression_level[ 0 ] == (system_character_t) 'n' ) { compression_level = LIBEWF_COMPRESSION_NONE; compression_flags = 0; } 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 ] == (system_character_t) 'f' ) { compression_level = LIBEWF_COMPRESSION_FAST; compression_flags = 0; } else if( option_compression_level[ 0 ] == (system_character_t) 'b' ) { compression_level = LIBEWF_COMPRESSION_BEST; compression_flags = 0; } else { fprintf( stderr, "Unsupported compression level.\n" ); goto on_error; } } if( option_maximum_segment_size != NULL ) { string_length = system_string_length( option_maximum_segment_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_maximum_segment_size, string_length + 1, &maximum_segment_size, &error ) != 1 ) { fprintf( stderr, "Unsupported maximum segment size.\n" ); goto on_error; } } if( option_media_size != NULL ) { string_length = system_string_length( option_media_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( option_media_size, string_length + 1, &media_size, &error ) != 1 ) { fprintf( stderr, "Unsupported media size.\n" ); goto on_error; } } if( ewf_test_write_chunk( argv[ optind ], media_size, maximum_segment_size, compression_level, compression_flags, &error ) != 1 ) { fprintf( stderr, "Unable to test write.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } return( EXIT_FAILURE ); } libewf-20140807/tests/test_ewfexport_logical.sh0000754000175000017500000000617713440662656023632 0ustar00lordyestalordyesta00000000000000#!/bin/bash # # ewfexport testing script for logical evidence files # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input_logical"; TMP="tmp"; LS="ls"; TR="tr"; WC="wc"; test_export_logical() { INPUT_FILE=$1; mkdir ${TMP}; ${EWFEXPORT} -q ${INPUT_FILE} < # # 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 . # EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; INPUT="input_raw"; TMP="tmp"; LS="ls"; TR="tr"; WC="wc"; test_acquire_file() { INPUT_FILE=$1; OUTPUT_FORMAT=$2; COMPRESSION_METHOD=$3; COMPRESSION_LEVEL=$4; MAXIMUM_SEGMENT_SIZE=$5; CHUNK_SIZE=$6; mkdir ${TMP}; ${EWFACQUIRESTREAM} -q -d sha1 \ -t ${TMP}/acquirestream \ -C case_number \ -D description \ -E evidence_number \ -e examiner \ -N notes \ -m removable \ -M logical \ -c ${COMPRESSION_METHOD}:${COMPRESSION_LEVEL} \ -f ${OUTPUT_FORMAT} \ -S ${MAXIMUM_SEGMENT_SIZE} \ -b ${CHUNK_SIZE} \ < ${INPUT_FILE} RESULT=$?; if [ ${RESULT} -eq ${EXIT_SUCCESS} ]; then ${EWFVERIFY} -q -d sha1 ${TMP}/acquirestream.* RESULT=$?; fi echo ""; rm -rf ${TMP}; echo -n "Testing ewfacquirestream of raw input: ${INPUT_FILE} to ewf format: ${OUTPUT_FORMAT} with compression: ${COMPRESSION_METHOD}:${COMPRESSION_LEVEL} and chunk size: ${CHUNK_SIZE} "; if test ${RESULT} -ne ${EXIT_SUCCESS}; then echo " (FAIL)"; else echo " (PASS)"; fi return ${RESULT}; } EWFACQUIRESTREAM="../ewftools/ewfacquirestream"; if ! test -x ${EWFACQUIRESTREAM}; then EWFACQUIRESTREAM="../ewftools/ewfacquirestream.exe" fi if ! test -x ${EWFACQUIRESTREAM}; then echo "Missing executable: ${EWFACQUIRESTREAM}"; exit ${EXIT_FAILURE}; fi EWFVERIFY="../ewftools/ewfverify"; if ! test -x ${EWFVERIFY}; then EWFVERIFY="../ewftools/ewfverify.exe"; fi if ! test -x ${EWFVERIFY}; then echo "Missing executable: ${EWFVERIFY}"; exit ${EXIT_FAILURE}; fi if ! test -d ${INPUT}; then echo "No ${INPUT} directory found, to test ewfacquirestream create ${INPUT} directory and place RAW image test files in directory."; exit ${EXIT_IGNORE}; fi RESULT=`${LS} ${INPUT}/*.[rR][aA][wW] | ${TR} ' ' '\n' | ${WC} -l`; if test ${RESULT} -eq 0; then echo "No files found in ${INPUT} directory, to test ewfacquirestream place RAW image test files in directory."; exit ${EXIT_IGNORE}; fi for FILENAME in `${LS} ${INPUT}/*.[rR][aA][wW] | ${TR} ' ' '\n'`; do for SEGMENT_SIZE in 650MB 1MiB; do for FORMAT in encase2 encase3 encase4 encase5 encase6 linen5 linen6 ftk ewfx; do for COMPRESSION_LEVEL in none empty-block fast best; do if ! test_acquire_file "${FILENAME}" "${FORMAT}" deflate "${COMPRESSION_LEVEL}" "${SEGMENT_SIZE}" 64; then exit ${EXIT_FAILURE}; fi done done done for CHUNK_SIZE in 16 32 128 256 512 1024 2048 4096 8192 16384 32768; do for SEGMENT_SIZE in 650MB 1MiB; do for COMPRESSION_LEVEL in none empty-block fast best; do if ! test_acquire_file "${FILENAME}" encase6 deflate "${COMPRESSION_LEVEL}" "${SEGMENT_SIZE}" "${CHUNK_SIZE}"; then exit ${EXIT_FAILURE}; fi done done done done exit ${EXIT_SUCCESS}; libewf-20140807/tests/ewf_test_libcnotify.h0000664000175000017500000000266313440663047022724 0ustar00lordyestalordyesta00000000000000/* * The internal libcnotify header * * Copyright (C) 2006-2017, 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_LIBCNOTIFY_H ) #define _EWF_TEST_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _EWF_TEST_LIBCNOTIFY_H ) */ libewf-20140807/libclocale/0000775000175000017500000000000013443455445017435 5ustar00lordyestalordyesta00000000000000libewf-20140807/libclocale/libclocale_wide_string.h0000664000175000017500000000324213443450033024262 0ustar00lordyestalordyesta00000000000000/* * Wide character string functions * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_WIDE_STRING_H ) #define _LIBCLOCALE_WIDE_STRING_H #include #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( wide_string_compare_no_case ) #define wide_string_compare_no_case( string1, string2, size ) \ libclocale_wide_string_compare_no_case( string1, string2, size ) #endif /* !defined( wide_string_compare_no_case ) */ #if defined( TOWLOWER ) && !defined( HAVE_WCSNCASECMP ) && !defined( HAVE_WCSCASECMP ) && !defined( WINAPI ) int libclocale_wide_string_compare_no_case( const wchar_t *string1, const wchar_t *string2, size_t comparision_length ); #endif /* defined( TOWLOWER ) && !defined( HAVE_WCSNCASECMP ) && !defined( HAVE_WCSCASECMP ) && !defined( WINAPI ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCLOCALE_WIDE_STRING_H ) */ libewf-20140807/libclocale/libclocale_support.c0000664000175000017500000000577713443450033023472 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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 . */ #include #include #if defined( HAVE_LIBINTL_H ) #include #endif #include "libclocale_codepage.h" #include "libclocale_definitions.h" #include "libclocale_libcerror.h" #include "libclocale_locale.h" #include "libclocale_support.h" #if !defined( HAVE_LOCAL_LIBCLOCALE ) /* Returns the library version as a string */ const char *libclocale_get_version( void ) { return( (const char *) LIBCLOCALE_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCLOCALE ) */ /* Initializes the locale values * Returns 1 if successful or -1 on error */ int libclocale_initialize( const char *domain_name, libcerror_error_t **error ) { static char *function = "libclocale_initialize"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int codepage = 0; #endif if( domain_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid domain name.", function ); return( -1 ); } #if defined( HAVE_BINDTEXTDOMAIN ) && defined( HAVE_TEXTDOMAIN ) if( bindtextdomain( domain_name, LOCALEDIR ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to bind text domain.", function ); return( -1 ); } if( textdomain( domain_name ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set text domain.", function ); return( -1 ); } #endif /* defined( HAVE_BINDTEXTDOMAIN ) && defined( HAVE_TEXTDOMAIN ) */ #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_locale_get_codepage( &codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } #endif /* !defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } libewf-20140807/libclocale/libclocale_locale.h0000664000175000017500000000326713443450033023212 0ustar00lordyestalordyesta00000000000000/* * Locale functions * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_LOCALE_H ) #define _LIBCLOCALE_LOCALE_H #include #include #include "libclocale_extern.h" #include "libclocale_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( WINAPI ) && ( WINVER < 0x0500 ) int libclocale_GetLocaleInfo( LCID locale_identifier, LCTYPE locale_type, LPSTR buffer, int size ); #endif /* defined( WINAPI ) && ( WINVER < 0x0500 ) */ int libclocale_locale_get_codepage_from_charset( int *codepage, char *charset, size_t charset_length, libcerror_error_t **error ); LIBCLOCALE_EXTERN \ int libclocale_locale_get_codepage( int *codepage, libcerror_error_t **error ); LIBCLOCALE_EXTERN \ int libclocale_locale_get_decimal_point( int *decimal_point, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCLOCALE_LOCALE_H ) */ libewf-20140807/libclocale/Makefile.am0000664000175000017500000000134713443450034021463 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCLOCALE AM_CPPFLAGS = \ -DLOCALEDIR=\"$(datadir)/locale\" \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libclocale.la libclocale_la_SOURCES = \ libclocale_codepage.c libclocale_codepage.h \ libclocale_definitions.h \ libclocale_extern.h \ libclocale_libcerror.h \ libclocale_locale.c libclocale_locale.h \ libclocale_support.c libclocale_support.h \ libclocale_unused.h \ libclocale_wide_string.c libclocale_wide_string.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libclocale ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libclocale_la_SOURCES) libewf-20140807/libclocale/libclocale_locale.c0000664000175000017500000002466113443450033023206 0ustar00lordyestalordyesta00000000000000/* * Locale functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #include #elif defined( HAVE_LOCALE_H ) #include #endif #if defined( HAVE_LANGINFO_H ) #include #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libclocale_definitions.h" #include "libclocale_codepage.h" #include "libclocale_locale.h" #if defined( WINAPI ) && ( WINVER < 0x0500 ) /* Cross Windows safe version of GetLocaleInfoA * Returns the number of bytes read if successful or 0 on error */ int libclocale_GetLocaleInfoA( LCID locale_identifier, LCTYPE locale_type, LPSTR buffer, int size ) { FARPROC function = NULL; HMODULE library_handle = NULL; int result = 0; library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "GetLocaleInfoA" ); if( function != NULL ) { result = function( locale_identifier, locale_type, buffer, size ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = 0; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER < 0x0500 ) */ /* Retrieves the codepage from the locale character set * The codepage is set to 0 if the character set is UTF-8 * and will default to LIBCLOCALE_CODEPAGE_ASCII the codepage cannot be determined * Returns 1 if successful or -1 on error */ int libclocale_locale_get_codepage_from_charset( int *codepage, char *charset, size_t charset_length, libcerror_error_t **error ) { static char *function = "libclocale_locale_get_codepage_from_charset"; if( codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid codepage.", function ); return( -1 ); } if( charset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid charset.", function ); return( -1 ); } if( charset_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid charset length value exceeds maximum.", function ); return( -1 ); } /* Determine codepage */ *codepage = -1; if( *codepage == -1 ) { if( charset_length == 5 ) { if( narrow_string_compare_no_case( "UTF-8", charset, 5 ) == 0 ) { *codepage = 0; } } } if( *codepage == -1 ) { if( charset_length >= 3 ) { if( narrow_string_compare( "874", charset, 3 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_874; } else if( narrow_string_compare( "932", charset, 3 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_932; } else if( narrow_string_compare( "936", charset, 3 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_936; } else if( narrow_string_compare( "949", charset, 3 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_949; } else if( narrow_string_compare( "950", charset, 3 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_950; } } } if( *codepage == -1 ) { if( charset_length >= 4 ) { if( narrow_string_compare( "1250", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1250; } else if( narrow_string_compare( "1251", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1251; } else if( narrow_string_compare( "1252", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1252; } else if( narrow_string_compare( "1253", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1253; } else if( narrow_string_compare( "1254", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1254; } else if( narrow_string_compare( "1255", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1255; } else if( narrow_string_compare( "1256", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1256; } else if( narrow_string_compare( "1257", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1257; } else if( narrow_string_compare( "1258", charset, 4 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1258; } else if( narrow_string_compare_no_case( "utf8", charset, 4 ) == 0 ) { *codepage = 0; } } } if( *codepage == -1 ) { *codepage = LIBCLOCALE_CODEPAGE_ASCII; } return( 1 ); } /* Retrieves the codepage for the locale character set * The codepage is set to 0 if the character set is UTF-8 * and will default to LIBCLOCALE_CODEPAGE_ASCII the codepage cannot be determined * Returns 1 if successful or -1 on error */ int libclocale_locale_get_codepage( int *codepage, libcerror_error_t **error ) { char *locale = NULL; char *charset = NULL; static char *function = "libclocale_locale_get_codepage"; size_t charset_length = 0; size_t locale_length = 0; if( codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid codepage.", function ); return( -1 ); } #if defined( HAVE_LANGINFO_CODESET ) charset = nl_langinfo( CODESET ); #endif if( ( charset != NULL ) && ( charset[ 0 ] != 0 ) ) { charset_length = narrow_string_length( charset ); } else { #if defined( HAVE_SETLOCALE ) || ( defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 ) locale = setlocale( LC_CTYPE, "" ); /* Check if the locale returned is not "C" */ if( ( locale != NULL ) && ( locale[ 0 ] != 0 ) ) { if( ( locale[ 0 ] == 'C' ) && ( locale[ 1 ] != 0 ) ) { locale = NULL; } } #endif #if defined( HAVE_GETENV ) || defined( WINAPI ) /* Check if the locale can be determined from the environment variables */ if( ( locale == NULL ) || ( locale[ 0 ] == 0 ) ) { locale = getenv( "LC_ALL" ); } if( ( locale == NULL ) || ( locale[ 0 ] == 0 ) ) { locale = getenv( "LC_TYPE" ); } if( ( locale == NULL ) || ( locale[ 0 ] == 0 ) ) { locale = getenv( "LANG" ); } #endif if( ( locale == NULL ) || ( locale[ 0 ] == 0 ) ) { *codepage = LIBCLOCALE_CODEPAGE_ASCII; return( 1 ); } locale_length = narrow_string_length( locale ); charset = narrow_string_search_character( locale, '.', locale_length + 1 ); if( charset == NULL ) { *codepage = LIBCLOCALE_CODEPAGE_ASCII; return( 1 ); } charset++; charset_length = locale_length - (size_t) ( charset - locale ); } if( libclocale_locale_get_codepage_from_charset( codepage, charset, charset_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Retrieves the decimal point * Returns 1 if successful or -1 on error */ int libclocale_locale_get_decimal_point( int *decimal_point, libcerror_error_t **error ) { static char *function = "libclocale_locale_get_decimal_point"; #if defined( WINAPI ) DWORD error_code = 0; DWORD locale_data = 0; int read_count = 0; #else struct lconv *locale_data = NULL; #endif if( decimal_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid decimal point.", function ); return( -1 ); } *decimal_point = -1; #if defined( WINAPI ) #if ( WINVER >= 0x0600 ) read_count = GetLocaleInfoEx( LOCALE_NAME_USER_DEFAULT, LOCALE_SDECIMAL, (LPWSTR) &locale_data, sizeof( DWORD ) / sizeof( wchar_t ) ); #elif ( WINVER >= 0x0500 ) read_count = GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, (LPSTR) &locale_data, sizeof( DWORD ) / sizeof( char ) ); #else read_count = libclocale_GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, (LPSTR) &locale_data, sizeof( DWORD ) / sizeof( char ) ); #endif if( read_count == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve locale information.", function ); return( -1 ); } *decimal_point = (int) locale_data; #else locale_data = localeconv(); if( locale_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid locale data.", function ); return( -1 ); } if( locale_data->decimal_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid locale data - missing decimal point.", function ); return( -1 ); } *decimal_point = ( locale_data->decimal_point )[ 0 ]; #endif return( 1 ); } libewf-20140807/libclocale/libclocale_extern.h0000664000175000017500000000273613443450033023260 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_INTERNAL_EXTERN_H ) #define _LIBCLOCALE_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if !defined( HAVE_LOCAL_LIBCLOCALE ) /* If libtool DLL support is enabled set LIBCLOCALE_DLL_EXPORT * before including libclocale/extern.h */ #if defined( _WIN32 ) && defined( DLL_EXPORT ) #define LIBCLOCALE_DLL_EXPORT #endif #include #define LIBCLOCALE_EXTERN_VARIABLE LIBCLOCALE_EXTERN #else #define LIBCLOCALE_EXTERN /* extern */ #define LIBCLOCALE_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBCLOCALE_INTERNAL_EXTERN_H ) */ libewf-20140807/libclocale/libclocale_unused.h0000664000175000017500000000256613443450033023257 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_INTERNAL_UNUSED_H ) #define _LIBCLOCALE_INTERNAL_UNUSED_H #include #if !defined( LIBCLOCALE_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCLOCALE_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCLOCALE_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCLOCALE_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCLOCALE_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCLOCALE_INTERNAL_UNUSED_H ) */ libewf-20140807/libclocale/libclocale_support.h0000664000175000017500000000260613443450033023463 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_SUPPORT_H ) #define _LIBCLOCALE_SUPPORT_H #include #include #include #include "libclocale_extern.h" #include "libclocale_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCLOCALE ) LIBCLOCALE_EXTERN \ const char *libclocale_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCLOCALE ) */ LIBCLOCALE_EXTERN \ int libclocale_initialize( const char *domain_name, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCLOCALE_SUPPORT_H ) */ libewf-20140807/libclocale/libclocale_definitions.h0000664000175000017500000000652613443450034024270 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_INTERNAL_DEFINITIONS_H ) #define _LIBCLOCALE_INTERNAL_DEFINITIONS_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if !defined( HAVE_LOCAL_LIBCLOCALE ) #include /* The definitions in are copied here * for local use of libclocale */ #else #define LIBCLOCALE_VERSION 20180721 /* The libclocale version string */ #define LIBCLOCALE_VERSION_STRING "20180721" /* The codepage feature flag definitions */ enum LIBCLOCALE_CODEPAGES_FEATURE_FLAGS { LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_ISO_8859 = 0x00000001UL, LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 = 0x00000002UL, LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_WINDOWS = 0x00000004UL, }; /* The codepage set definitions */ enum LIBCLOCALE_CODEPAGES_SETS { LIBCLOCALE_CODEPAGE_SET_GENERIC = 1, LIBCLOCALE_CODEPAGE_SET_ISO_8859 = (int) 'i', LIBCLOCALE_CODEPAGE_SET_KOI8 = (int) 'k', LIBCLOCALE_CODEPAGE_SET_WINDOWS = (int) 'w' }; /* The codepage definitions */ enum LIBCLOCALE_CODEPAGES { LIBCLOCALE_CODEPAGE_ASCII = 20127, LIBCLOCALE_CODEPAGE_ISO_8859_1 = 28591, LIBCLOCALE_CODEPAGE_ISO_8859_2 = 28592, LIBCLOCALE_CODEPAGE_ISO_8859_3 = 28593, LIBCLOCALE_CODEPAGE_ISO_8859_4 = 28594, LIBCLOCALE_CODEPAGE_ISO_8859_5 = 28595, LIBCLOCALE_CODEPAGE_ISO_8859_6 = 28596, LIBCLOCALE_CODEPAGE_ISO_8859_7 = 28597, LIBCLOCALE_CODEPAGE_ISO_8859_8 = 28598, LIBCLOCALE_CODEPAGE_ISO_8859_9 = 28599, LIBCLOCALE_CODEPAGE_ISO_8859_10 = 28600, LIBCLOCALE_CODEPAGE_ISO_8859_11 = 28601, LIBCLOCALE_CODEPAGE_ISO_8859_13 = 28603, LIBCLOCALE_CODEPAGE_ISO_8859_14 = 28604, LIBCLOCALE_CODEPAGE_ISO_8859_15 = 28605, LIBCLOCALE_CODEPAGE_ISO_8859_16 = 28606, LIBCLOCALE_CODEPAGE_KOI8_R = 20866, LIBCLOCALE_CODEPAGE_KOI8_U = 21866, LIBCLOCALE_CODEPAGE_WINDOWS_874 = 874, LIBCLOCALE_CODEPAGE_WINDOWS_932 = 932, LIBCLOCALE_CODEPAGE_WINDOWS_936 = 936, LIBCLOCALE_CODEPAGE_WINDOWS_949 = 949, LIBCLOCALE_CODEPAGE_WINDOWS_950 = 950, LIBCLOCALE_CODEPAGE_WINDOWS_1250 = 1250, LIBCLOCALE_CODEPAGE_WINDOWS_1251 = 1251, LIBCLOCALE_CODEPAGE_WINDOWS_1252 = 1252, LIBCLOCALE_CODEPAGE_WINDOWS_1253 = 1253, LIBCLOCALE_CODEPAGE_WINDOWS_1254 = 1254, LIBCLOCALE_CODEPAGE_WINDOWS_1255 = 1255, LIBCLOCALE_CODEPAGE_WINDOWS_1256 = 1256, LIBCLOCALE_CODEPAGE_WINDOWS_1257 = 1257, LIBCLOCALE_CODEPAGE_WINDOWS_1258 = 1258 }; #endif /* !defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBCLOCALE_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libclocale/libclocale_codepage.h0000664000175000017500000000360113443450033023512 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_CODEPAGE_H ) #define _LIBCLOCALE_CODEPAGE_H #include #include #include "libclocale_extern.h" #include "libclocale_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( __CYGWIN__ ) extern int libclocale_codepage; #else int libclocale_codepage; #endif LIBCLOCALE_EXTERN \ int libclocale_codepage_get( int *codepage, libcerror_error_t **error ); LIBCLOCALE_EXTERN \ int libclocale_codepage_set( int codepage, libcerror_error_t **error ); LIBCLOCALE_EXTERN \ int libclocale_codepage_copy_from_string( int *codepage, const char *string, size_t string_length, uint32_t feature_flags, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBCLOCALE_EXTERN \ int libclocale_codepage_copy_from_string_wide( int *codepage, const wchar_t *string, size_t string_length, uint32_t feature_flags, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCLOCALE_CODEPAGE_H ) */ libewf-20140807/libclocale/libclocale_codepage.c0000664000175000017500000005105313443450033023511 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include "libclocale_codepage.h" #include "libclocale_definitions.h" #include "libclocale_libcerror.h" #include "libclocale_wide_string.h" /* If the codepage is not set strings are formatted using UTF-8 */ #if defined( WINAPI ) int libclocale_codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1252; #else int libclocale_codepage = 0; #endif /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libclocale_codepage_get( int *codepage, libcerror_error_t **error ) { static char *function = "libclocale_codepage_get"; if( codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid codepage.", function ); return( -1 ); } *codepage = libclocale_codepage; return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libclocale_codepage_set( int codepage, libcerror_error_t **error ) { static char *function = "libclocale_codepage_set"; if( ( codepage != LIBCLOCALE_CODEPAGE_ASCII ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_1 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_2 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_3 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_4 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_5 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_6 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_7 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_8 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_9 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_10 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_11 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_13 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_14 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_15 ) && ( codepage != LIBCLOCALE_CODEPAGE_ISO_8859_16 ) && ( codepage != LIBCLOCALE_CODEPAGE_KOI8_R ) && ( codepage != LIBCLOCALE_CODEPAGE_KOI8_U ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_874 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_932 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_936 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_949 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_950 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1250 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1251 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1252 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1253 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1254 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1256 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1257 ) && ( codepage != LIBCLOCALE_CODEPAGE_WINDOWS_1258 ) && ( codepage != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported codepage.", function ); return( -1 ); } libclocale_codepage = codepage; return( 1 ); } /* Copies the codepage from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int libclocale_codepage_copy_from_string( int *codepage, const char *string, size_t string_length, uint32_t feature_flags, libcerror_error_t **error ) { static char *function = "libclocale_codepage_copy_from_string"; size_t string_index = 0; uint32_t supported_flags = 0; int codepage_set = 0; if( codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid codepage.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string length value exceeds maximum.", function ); return( -1 ); } supported_flags = LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_ISO_8859 | LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 | LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_WINDOWS; if( ( feature_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported feature flags value: 0x%08" PRIx32 ".", function, feature_flags ); return( -1 ); } *codepage = -1; if( string_length == 5 ) { if( narrow_string_compare_no_case( string, "ascii", 5 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_ASCII; string_index = 5; } } if( ( feature_flags & LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_ISO_8859 ) != 0 ) { /* Supported string formats: * iso8859-1, iso8859_1, iso-8859-1, iso-8859_1, iso_8859-1, iso_8859_1 */ if( string_length >= 8 ) { if( narrow_string_compare_no_case( string, "iso", 3 ) == 0 ) { string_index = 3; if( ( string[ string_index ] == '-' ) || ( string[ string_index ] == '_' ) ) { string_index++; } if( ( string[ string_index ] == '8' ) && ( string[ string_index + 1 ] == '8' ) && ( string[ string_index + 2 ] == '5' ) && ( string[ string_index + 3 ] == '9' ) ) { string_index += 4; if( string_index < string_length ) { if( ( string[ string_index ] == '-' ) || ( string[ string_index ] == '_' ) ) { string_index++; codepage_set = LIBCLOCALE_CODEPAGE_SET_ISO_8859; } } } } } } if( ( feature_flags & LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 ) != 0 ) { /* Supported string formats: * koi8, koi8-r, koi8_r */ if( string_length >= 4 ) { if( narrow_string_compare_no_case( string, "koi8", 4 ) == 0 ) { string_index = 4; codepage_set = LIBCLOCALE_CODEPAGE_SET_KOI8; if( string_index < string_length ) { if( ( string[ string_index ] == '-' ) || ( string[ string_index ] == '_' ) ) { string_index++; } } } } } if( ( feature_flags & LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_WINDOWS ) != 0 ) { /* Supported string formats: * cp1252, ms1252, windows1252, windows-1252, windows_1252 */ if( string_length >= 7 ) { if( narrow_string_compare_no_case( string, "windows", 7 ) == 0 ) { string_index = 7; codepage_set = LIBCLOCALE_CODEPAGE_SET_WINDOWS; if( string_index < string_length ) { if( ( string[ string_index ] == '-' ) || ( string[ string_index ] == '_' ) ) { string_index++; } } } } else if( string_length >= 2 ) { if( narrow_string_compare_no_case( string, "cp", 2 ) == 0 ) { string_index = 2; codepage_set = LIBCLOCALE_CODEPAGE_SET_GENERIC; } else if( narrow_string_compare_no_case( string, "ms", 2 ) == 0 ) { string_index = 2; codepage_set = LIBCLOCALE_CODEPAGE_SET_WINDOWS; } } } if( codepage_set == LIBCLOCALE_CODEPAGE_SET_ISO_8859 ) { if( ( string_index + 1 ) == string_length ) { switch( string[ string_index ] ) { case '1': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_1; break; case '2': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_2; break; case '3': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_3; break; case '4': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_4; break; case '5': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_5; break; case '6': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_6; break; case '7': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_7; break; case '8': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_8; break; case '9': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_9; break; default: break; } } else if( ( string_index + 2 ) == string_length ) { if( string[ string_index ] == '1' ) { string_index++; switch( string[ string_index ] ) { case '0': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_10; break; case '1': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_11; break; case '3': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_13; break; case '4': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_14; break; case '5': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_15; break; case '6': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_16; break; default: break; } } } } if( codepage_set == LIBCLOCALE_CODEPAGE_SET_KOI8 ) { if( ( string_index + 1 ) == string_length ) { switch( string[ string_index ] ) { case 'r': case 'R': *codepage = LIBCLOCALE_CODEPAGE_KOI8_R; break; case 'u': case 'U': *codepage = LIBCLOCALE_CODEPAGE_KOI8_U; break; default: break; } } } if( ( codepage_set == LIBCLOCALE_CODEPAGE_SET_GENERIC ) || ( codepage_set == LIBCLOCALE_CODEPAGE_SET_WINDOWS ) ) { if( ( string_index + 3 ) == string_length ) { switch( string[ string_index ] ) { case '8': if( ( string[ string_index + 1 ] == '7' ) && ( string[ string_index + 2 ] == '4' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_874; } break; case '9': if( ( string[ string_index + 1 ] == '3' ) && ( string[ string_index + 2 ] == '2' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_932; } else if( ( string[ string_index + 1 ] == '3' ) && ( string[ string_index + 2 ] == '6' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_936; } else if( ( string[ string_index + 1 ] == '4' ) && ( string[ string_index + 2 ] == '9' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_949; } else if( ( string[ string_index + 1 ] == '5' ) && ( string[ string_index + 2 ] == '0' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_950; } break; default: break; } } else if( ( string_index + 4 ) == string_length ) { if( ( string[ string_index ] == '1' ) && ( string[ string_index + 1 ] == '2' ) && ( string[ string_index + 2 ] == '5' ) ) { switch( string[ string_index + 3 ] ) { case '0': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1250; break; case '1': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1251; break; case '2': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1252; break; case '3': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1253; break; case '4': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1254; break; case '5': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1255; break; case '6': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1256; break; case '7': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1257; break; case '8': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1258; break; default: break; } } } } if( *codepage != -1 ) { return( 1 ); } return( 0 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Copies the codepage from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int libclocale_codepage_copy_from_string_wide( int *codepage, const wchar_t *string, size_t string_length, uint32_t feature_flags, libcerror_error_t **error ) { static char *function = "libclocale_codepage_copy_from_string_wide"; size_t string_index = 0; uint32_t supported_flags = 0; int codepage_set = 0; if( codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid codepage.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string length value exceeds maximum.", function ); return( -1 ); } supported_flags = LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_ISO_8859 | LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 | LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_WINDOWS; if( ( feature_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported feature flags value: 0x%08" PRIx32 ".", function, feature_flags ); return( -1 ); } *codepage = -1; if( string_length == 5 ) { if( wide_string_compare_no_case( string, L"ascii", 5 ) == 0 ) { *codepage = LIBCLOCALE_CODEPAGE_ASCII; string_index = 5; } } if( ( feature_flags & LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_ISO_8859 ) != 0 ) { /* Supported string formats: * iso8859-1, iso8859_1, iso-8859-1, iso-8859_1, iso_8859-1, iso_8859_1 */ if( string_length >= 8 ) { if( wide_string_compare_no_case( string, L"iso", 3 ) == 0 ) { string_index = 3; if( ( string[ string_index ] == (wchar_t) '-' ) || ( string[ string_index ] == (wchar_t) '_' ) ) { string_index++; } if( ( string[ string_index ] == (wchar_t) '8' ) && ( string[ string_index + 1 ] == (wchar_t) '8' ) && ( string[ string_index + 2 ] == (wchar_t) '5' ) && ( string[ string_index + 3 ] == (wchar_t) '9' ) ) { string_index += 4; if( string_index < string_length ) { if( ( string[ string_index ] == (wchar_t) '-' ) || ( string[ string_index ] == (wchar_t) '_' ) ) { string_index++; codepage_set = LIBCLOCALE_CODEPAGE_SET_ISO_8859; } } } } } } if( ( feature_flags & LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 ) != 0 ) { /* Supported string formats: * koi8, koi8-r, koi8_r */ if( string_length >= 4 ) { if( wide_string_compare_no_case( string, L"koi8", 4 ) == 0 ) { string_index = 4; codepage_set = LIBCLOCALE_CODEPAGE_SET_KOI8; if( string_index < string_length ) { if( ( string[ string_index ] == (wchar_t) '-' ) || ( string[ string_index ] == (wchar_t) '_' ) ) { string_index++; } } } } } if( ( feature_flags & LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_WINDOWS ) != 0 ) { /* Supported string formats: * cp1252, ms1252, windows1252, windows-1252, windows_1252 */ if( string_length >= 7 ) { if( wide_string_compare_no_case( string, L"windows", 7 ) == 0 ) { string_index = 7; codepage_set = LIBCLOCALE_CODEPAGE_SET_WINDOWS; if( string_index < string_length ) { if( ( string[ string_index ] == (wchar_t) '-' ) || ( string[ string_index ] == (wchar_t) '_' ) ) { string_index++; } } } } else if( string_length >= 2 ) { if( wide_string_compare_no_case( string, L"cp", 2 ) == 0 ) { string_index = 2; codepage_set = LIBCLOCALE_CODEPAGE_SET_GENERIC; } else if( wide_string_compare_no_case( string, L"ms", 2 ) == 0 ) { string_index = 2; codepage_set = LIBCLOCALE_CODEPAGE_SET_WINDOWS; } } } if( codepage_set == LIBCLOCALE_CODEPAGE_SET_ISO_8859 ) { if( ( string_index + 1 ) == string_length ) { switch( string[ string_index ] ) { case '1': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_1; break; case '2': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_2; break; case '3': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_3; break; case '4': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_4; break; case '5': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_5; break; case '6': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_6; break; case '7': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_7; break; case '8': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_8; break; case '9': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_9; break; default: break; } } else if( ( string_index + 2 ) == string_length ) { if( string[ string_index ] == (wchar_t) '1' ) { string_index++; switch( string[ string_index ] ) { case '0': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_10; break; case '1': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_11; break; case '3': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_13; break; case '4': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_14; break; case '5': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_15; break; case '6': *codepage = LIBCLOCALE_CODEPAGE_ISO_8859_16; break; default: break; } } } } if( codepage_set == LIBCLOCALE_CODEPAGE_SET_KOI8 ) { if( ( string_index + 1 ) == string_length ) { switch( string[ string_index ] ) { case 'r': case 'R': *codepage = LIBCLOCALE_CODEPAGE_KOI8_R; break; case 'u': case 'U': *codepage = LIBCLOCALE_CODEPAGE_KOI8_U; break; default: break; } } } if( ( codepage_set == LIBCLOCALE_CODEPAGE_SET_GENERIC ) || ( codepage_set == LIBCLOCALE_CODEPAGE_SET_WINDOWS ) ) { if( ( string_index + 3 ) == string_length ) { switch( string[ string_index ] ) { case '8': if( ( string[ string_index + 1 ] == (wchar_t) '7' ) && ( string[ string_index + 2 ] == (wchar_t) '4' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_874; } break; case '9': if( ( string[ string_index + 1 ] == (wchar_t) '3' ) && ( string[ string_index + 2 ] == (wchar_t) '2' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_932; } else if( ( string[ string_index + 1 ] == (wchar_t) '3' ) && ( string[ string_index + 2 ] == (wchar_t) '6' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_936; } else if( ( string[ string_index + 1 ] == (wchar_t) '4' ) && ( string[ string_index + 2 ] == (wchar_t) '9' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_949; } else if( ( string[ string_index + 1 ] == (wchar_t) '5' ) && ( string[ string_index + 2 ] == (wchar_t) '0' ) ) { *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_950; } break; default: break; } } else if( ( string_index + 4 ) == string_length ) { if( ( string[ string_index ] == (wchar_t) '1' ) && ( string[ string_index + 1 ] == (wchar_t) '2' ) && ( string[ string_index + 2 ] == (wchar_t) '5' ) ) { switch( string[ string_index + 3 ] ) { case '0': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1250; break; case '1': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1251; break; case '2': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1252; break; case '3': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1253; break; case '4': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1254; break; case '5': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1255; break; case '6': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1256; break; case '7': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1257; break; case '8': *codepage = LIBCLOCALE_CODEPAGE_WINDOWS_1258; break; default: break; } } } } if( *codepage != -1 ) { return( 1 ); } return( 0 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libclocale/Makefile.in0000664000175000017500000010134713443455347021511 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libclocale ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libclocale_la_LIBADD = am__libclocale_la_SOURCES_DIST = libclocale_codepage.c \ libclocale_codepage.h libclocale_definitions.h \ libclocale_extern.h libclocale_libcerror.h libclocale_locale.c \ libclocale_locale.h libclocale_support.c libclocale_support.h \ libclocale_unused.h libclocale_wide_string.c \ libclocale_wide_string.h @HAVE_LOCAL_LIBCLOCALE_TRUE@am_libclocale_la_OBJECTS = \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_codepage.lo \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_locale.lo \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_support.lo \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_wide_string.lo libclocale_la_OBJECTS = $(am_libclocale_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCLOCALE_TRUE@am_libclocale_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libclocale_codepage.Plo \ ./$(DEPDIR)/libclocale_locale.Plo \ ./$(DEPDIR)/libclocale_support.Plo \ ./$(DEPDIR)/libclocale_wide_string.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libclocale_la_SOURCES) DIST_SOURCES = $(am__libclocale_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCLOCALE_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ -DLOCALEDIR=\"$(datadir)/locale\" \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCLOCALE_TRUE@noinst_LTLIBRARIES = libclocale.la @HAVE_LOCAL_LIBCLOCALE_TRUE@libclocale_la_SOURCES = \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_codepage.c libclocale_codepage.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_definitions.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_extern.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_libcerror.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_locale.c libclocale_locale.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_support.c libclocale_support.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_unused.h \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ libclocale_wide_string.c libclocale_wide_string.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libclocale/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libclocale/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libclocale.la: $(libclocale_la_OBJECTS) $(libclocale_la_DEPENDENCIES) $(EXTRA_libclocale_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libclocale_la_rpath) $(libclocale_la_OBJECTS) $(libclocale_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclocale_codepage.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclocale_locale.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclocale_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclocale_wide_string.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libclocale_codepage.Plo -rm -f ./$(DEPDIR)/libclocale_locale.Plo -rm -f ./$(DEPDIR)/libclocale_support.Plo -rm -f ./$(DEPDIR)/libclocale_wide_string.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libclocale ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libclocale_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libclocale/libclocale_wide_string.c0000664000175000017500000000366313443450033024264 0ustar00lordyestalordyesta00000000000000/* * Wide character string functions * * Copyright (C) 2010-2018, 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 . */ #include #include #if defined( HAVE_WCTYPE_H ) #include #endif #include "libclocale_wide_string.h" #if defined( TOWLOWER ) && !defined( HAVE_WCSNCASECMP ) && !defined( HAVE_WCSCASECMP ) && !defined( WINAPI ) /* Replacement for missing: wcsncasecmp * Compares no more than a specified number of wide characters of string1 and string2, * ignoring case, returning less than, equal to or greater than zero if string1 is * less than, equal to or greater than string. */ int libclocale_wide_string_compare_no_case( const wchar_t *string1, const wchar_t *string2, size_t comparision_length ) { wint_t character1 = 0; wint_t character2 = 0; if( string1 == string2 ) { return( 0 ); } while( comparision_length > 0 ) { character1 = towlower( *string1 ); character2 = towlower( *string2 ); if( ( character1 == 0 ) || ( character1 != character2 ) ) { return( character1 - character2 ); } string1++; string2++; comparision_length--; } return( 0 ); } #endif /* defined( TOWLOWER ) && !defined( HAVE_WCSNCASECMP ) && !defined( HAVE_WCSCASECMP ) && !defined( WINAPI ) */ libewf-20140807/libclocale/libclocale_libcerror.h0000664000175000017500000000252713443450033023734 0ustar00lordyestalordyesta00000000000000/* * The internal libcerror header * * Copyright (C) 2010-2018, 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( _LIBCLOCALE_LIBCERROR_H ) #define _LIBCLOCALE_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif #endif libewf-20140807/missing0000755000175000017500000001533613443455347016752 0ustar00lordyestalordyesta00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libewf-20140807/Makefile.am0000664000175000017500000000723713421024433017372 0ustar00lordyestalordyesta00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ include \ common \ libcerror \ libcthreads \ libcdata \ libcdatetime \ libclocale \ libcnotify \ libcsplit \ libuna \ libcfile \ libcpath \ libbfio \ libfcache \ libfdata \ libfvalue \ libmfdata \ libhmac \ libewf \ libodraw \ libsmdev \ libsmraw \ ewftools \ ewf.net \ pyewf \ pyewf-python2 \ pyewf-python3 \ po \ documents \ manuals \ tests \ examples \ msvscpp DPKG_FILES = \ dpkg/changelog \ dpkg/changelog.in \ dpkg/compat \ dpkg/control \ dpkg/copyright \ dpkg/rules \ dpkg/libewf.install \ dpkg/libewf-dev.install \ dpkg/libewf-python.install \ dpkg/libewf-python3.install \ dpkg/libewf-tools.install \ dpkg/source/format GETTEXT_FILES = \ config.rpath \ po/Makevars.in PKGCONFIG_FILES = \ libewf.pc.in SETUP_PY_FILES = \ setup.py SPEC_FILES = \ libewf.spec \ libewf.spec.in EXTRA_DIST = \ $(DPKG_FILES) \ $(GETTEXT_FILES) \ $(PKGCONFIG_FILES) \ $(SETUP_PY_FILES) \ $(SPEC_FILES) MAINTAINERCLEANFILES = \ Makefile.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = \ libewf.pc libtool: @LIBTOOL_DEPS@ cd $(srcdir) && $(SHELL) ./config.status --recheck lib: library library: (cd $(srcdir)/common && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcerror && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libclocale && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcnotify && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcsplit && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libuna && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcfile && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libbfio && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfcache && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfvalue && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libmfdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libhmac && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libewf && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) distclean: clean /bin/rm -f Makefile /bin/rm -f config.status /bin/rm -f config.cache /bin/rm -f config.log /bin/rm -f libewf.pc /bin/rm -f libewf.spec /bin/rm -f dpkg/changelog /bin/rm -f dpkg/shlibs.local.ex @for dir in ${subdirs}; do \ (cd $$dir && $(MAKE) distclean) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" splint: (cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdatetime && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcnotify && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcsplit && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libuna && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcfile && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcpath && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libbfio && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libfcache && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libfdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libfvalue && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libmfdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libhmac && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libewf && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libodraw && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libsmdev && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libsmraw && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/ewftools && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS)) libewf-20140807/libsmdev/0000775000175000017500000000000013443455446017152 5ustar00lordyestalordyesta00000000000000libewf-20140807/libsmdev/libsmdev_string.h0000664000175000017500000000243013443450064022504 0ustar00lordyestalordyesta00000000000000/* * Character type string functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_STRING_H ) #define _LIBSMDEV_STRING_H #include #include #include "libsmdev_libcerror.h" #if defined( _cplusplus ) extern "C" { #endif ssize_t libsmdev_string_trim_copy_from_byte_stream( uint8_t *string, size_t string_size, const uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ); #if defined( _cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_STRING_H ) */ libewf-20140807/libsmdev/libsmdev_definitions.h0000664000175000017500000000673413443450064023524 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_DEFINITIONS_H ) #define _LIBSMDEV_DEFINITIONS_H #include #include #define LIBSMDEV_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBSMDEV_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE /* Define HAVE_LOCAL_LIBSMDEV for local use of libsmdev */ #if !defined( HAVE_LOCAL_LIBSMDEV ) #include #else #define LIBSMDEV_VERSION 20190315 /* The version string */ #define LIBSMDEV_VERSION_STRING "20190315" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3 set to 1 to truncate an existing file on write * bit 4-8 not used */ enum LIBSMDEV_ACCESS_FLAGS { LIBSMDEV_ACCESS_FLAG_READ = 0x01, LIBSMDEV_ACCESS_FLAG_WRITE = 0x02, LIBSMDEV_ACCESS_FLAG_TRUNCATE = 0x04 }; /* The file access macros */ #define LIBSMDEV_OPEN_READ ( LIBSMDEV_ACCESS_FLAG_READ ) #define LIBSMDEV_OPEN_WRITE ( LIBSMDEV_ACCESS_FLAG_WRITE ) #define LIBSMDEV_OPEN_READ_WRITE ( LIBSMDEV_ACCESS_FLAG_READ | LIBSMDEV_ACCESS_FLAG_WRITE ) #define LIBSMDEV_OPEN_WRITE_TRUNCATE ( LIBSMDEV_ACCESS_FLAG_WRITE | LIBSMDEV_ACCESS_FLAG_TRUNCATE ) #define LIBSMDEV_OPEN_READ_WRITE_TRUNCATE ( LIBSMDEV_ACCESS_FLAG_READ | LIBSMDEV_ACCESS_FLAG_WRITE | LIBSMDEV_ACCESS_FLAG_TRUNCATE ) /* The error flags definitions */ enum LIBSMDEV_ERROR_FLAGS { LIBSMDEV_ERROR_FLAG_ZERO_ON_ERROR = 0x01 }; /* The media type definitions */ enum LIBSMDEV_MEDIA_TYPES { LIBSMDEV_MEDIA_TYPE_REMOVABLE = 0x00, LIBSMDEV_MEDIA_TYPE_FIXED = 0x01, LIBSMDEV_MEDIA_TYPE_OPTICAL = 0x03, LIBSMDEV_MEDIA_TYPE_MEMORY = 0x10 }; /* The bus type definitions */ enum LIBSMDEV_BUS_TYPES { LIBSMDEV_BUS_TYPE_UNKNOWN = 0, LIBSMDEV_BUS_TYPE_ATA = (uint8_t) 'a', LIBSMDEV_BUS_TYPE_FIREWIRE = (uint8_t) 'f', LIBSMDEV_BUS_TYPE_SCSI = (uint8_t) 's', LIBSMDEV_BUS_TYPE_USB = (uint8_t) 'u' }; /* The track types */ enum LIBSMDEV_TRACK_TYPES { LIBSMDEV_TRACK_TYPE_UNKNOWN, LIBSMDEV_TRACK_TYPE_AUDIO, LIBSMDEV_TRACK_TYPE_CDG, LIBSMDEV_TRACK_TYPE_MODE1_2048, LIBSMDEV_TRACK_TYPE_MODE1_2352, LIBSMDEV_TRACK_TYPE_MODE2_2048, LIBSMDEV_TRACK_TYPE_MODE2_2324, LIBSMDEV_TRACK_TYPE_MODE2_2336, LIBSMDEV_TRACK_TYPE_MODE2_2352, LIBSMDEV_TRACK_TYPE_CDI_2336, LIBSMDEV_TRACK_TYPE_CDI_2352, }; #endif /* Platform specific macros */ #if defined( _MSC_VER ) #define LIBSMDEV_LARGE_INTEGER_ZERO { 0, 0 } #elif defined( __BORLANDC__ ) #define LIBSMDEV_LARGE_INTEGER_ZERO { 0 } #elif defined( __CYGWIN__ ) #define LIBSMDEV_LARGE_INTEGER_ZERO { { 0, 0 } } #elif defined( __MINGW32_VERSION ) || defined( __MINGW64_VERSION_MAJOR ) #define LIBSMDEV_LARGE_INTEGER_ZERO { { 0, 0 } } #endif #endif libewf-20140807/libsmdev/libsmdev_sector_range.c0000664000175000017500000001555113443450064023654 0ustar00lordyestalordyesta00000000000000/* * Sector range functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libsmdev_libcerror.h" #include "libsmdev_sector_range.h" /* Creates a sector range * Make sure the value sector_range is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmdev_sector_range_initialize( libsmdev_sector_range_t **sector_range, libcerror_error_t **error ) { static char *function = "libsmdev_sector_range_initialize"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( *sector_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sector range value already set.", function ); return( -1 ); } *sector_range = memory_allocate_structure( libsmdev_sector_range_t ); if( *sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sector range.", function ); goto on_error; } if( memory_set( *sector_range, 0, sizeof( libsmdev_sector_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear sector range.", function ); goto on_error; } return( 1 ); on_error: if( *sector_range != NULL ) { memory_free( *sector_range ); *sector_range = NULL; } return( -1 ); } /* Frees a sector range * Returns 1 if successful or -1 on error */ int libsmdev_sector_range_free( libsmdev_sector_range_t **sector_range, libcerror_error_t **error ) { static char *function = "libsmdev_sector_range_free"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( *sector_range != NULL ) { memory_free( *sector_range ); *sector_range = NULL; } return( 1 ); } /* Clones the sector range * Returns 1 if successful or -1 on error */ int libsmdev_sector_range_clone( libsmdev_sector_range_t **destination_sector_range, libsmdev_sector_range_t *source_sector_range, libcerror_error_t **error ) { static char *function = "libsmdev_sector_range_clone"; if( destination_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination sector range.", function ); return( -1 ); } if( *destination_sector_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination sector range already set.", function ); return( -1 ); } if( source_sector_range == NULL ) { *destination_sector_range = NULL; return( 1 ); } *destination_sector_range = memory_allocate_structure( libsmdev_sector_range_t ); if( *destination_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination sector range.", function ); goto on_error; } if( memory_copy( *destination_sector_range, source_sector_range, sizeof( libsmdev_sector_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination sector range.", function ); goto on_error; } return( 1 ); on_error: if( *destination_sector_range != NULL ) { memory_free( *destination_sector_range ); *destination_sector_range = NULL; } return( -1 ); } /* Retrieves a sector range * Returns 1 if successful or -1 on error */ int libsmdev_sector_range_get( libsmdev_sector_range_t *sector_range, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { static char *function = "libsmdev_sector_range_get"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( start_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid start sector.", function ); return( -1 ); } if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sectors.", function ); return( -1 ); } *start_sector = sector_range->start_sector; *number_of_sectors = sector_range->number_of_sectors; return( 1 ); } /* Sets a sector range * Returns 1 if successful or -1 on error */ int libsmdev_sector_range_set( libsmdev_sector_range_t *sector_range, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { static char *function = "libsmdev_sector_range_set"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( start_sector > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid start sector value exceeds maximum.", function ); return( -1 ); } if( number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } sector_range->start_sector = start_sector; sector_range->end_sector = start_sector + number_of_sectors; sector_range->number_of_sectors = number_of_sectors; return( 1 ); } libewf-20140807/libsmdev/libsmdev_usb.h0000664000175000017500000000314213443450064021770 0ustar00lordyestalordyesta00000000000000/* * USB functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #if !defined( _LIBSMDEV_USB_H ) #define _LIBSMDEV_USB_H #include #include #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_LINUX_USB_CH9_H ) int libsmdev_usb_ioctl( libcfile_file_t *device_file, int interface_number, int request, void *request_data, libcerror_error_t **error ); int libsmdev_usb_control_command( libcfile_file_t *device_file, uint8_t request_type, uint8_t request, uint16_t value, uint16_t index, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); int libsmdev_usb_test( libcfile_file_t *device_file, libcerror_error_t **error ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_USB_H ) */ libewf-20140807/libsmdev/libsmdev_error.h0000664000175000017500000000340513443450064022332 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_INTERNAL_ERROR_H ) #define _LIBSMDEV_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBSMDEV ) #include #endif #include "libsmdev_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMDEV ) LIBSMDEV_EXTERN \ void libsmdev_error_free( libsmdev_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_error_fprint( libsmdev_error_t *error, FILE *stream ); LIBSMDEV_EXTERN \ int libsmdev_error_sprint( libsmdev_error_t *error, char *string, size_t size ); LIBSMDEV_EXTERN \ int libsmdev_error_backtrace_fprint( libsmdev_error_t *error, FILE *stream ); LIBSMDEV_EXTERN \ int libsmdev_error_backtrace_sprint( libsmdev_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_INTERNAL_ERROR_H ) */ libewf-20140807/libsmdev/libsmdev_libcnotify.h0000664000175000017500000000266213443450064023347 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2010-2019, 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( _LIBSMDEV_LIBCNOTIFY_H ) #define _LIBSMDEV_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBSMDEV_LIBCNOTIFY_H ) */ libewf-20140807/libsmdev/libsmdev_track_value.h0000664000175000017500000000422613443450064023503 0ustar00lordyestalordyesta00000000000000/* * Track value functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_TRACK_VALUE_H ) #define _LIBSMDEV_TRACK_VALUE_H #include #include #include "libsmdev_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libsmdev_track_value libsmdev_track_value_t; struct libsmdev_track_value { /* The start sector */ uint64_t start_sector; /* The end sector */ uint64_t end_sector; /* The number of sectors */ uint64_t number_of_sectors; /* The bytes per sector */ uint32_t bytes_per_sector; /* The type */ uint8_t type; }; int libsmdev_track_value_initialize( libsmdev_track_value_t **track_value, libcerror_error_t **error ); int libsmdev_track_value_free( libsmdev_track_value_t **track_value, libcerror_error_t **error ); int libsmdev_track_value_get( libsmdev_track_value_t *track_value, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, libcerror_error_t **error ); int libsmdev_track_value_set( libsmdev_track_value_t *track_value, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, libcerror_error_t **error ); int libsmdev_track_value_get_bytes_per_sector( libsmdev_track_value_t *track_value, uint32_t *bytes_per_sector, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_TRACK_VALUE_H ) */ libewf-20140807/libsmdev/libsmdev_notify.h0000664000175000017500000000307313443450064022512 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_NOTIFY_H ) #define _LIBSMDEV_NOTIFY_H #include #include #include #include "libsmdev_extern.h" #include "libsmdev_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMDEV ) LIBSMDEV_EXTERN \ void libsmdev_notify_set_verbose( int verbose ); LIBSMDEV_EXTERN \ int libsmdev_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_notify_stream_close( libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_NOTIFY_H ) */ libewf-20140807/libsmdev/Makefile.am0000664000175000017500000000243613443450064021202 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBSMDEV AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libsmdev.la libsmdev_la_SOURCES = \ libsmdev_ata.c libsmdev_ata.h \ libsmdev_codepage.h \ libsmdev_debug.c libsmdev_debug.h \ libsmdev_definitions.h \ libsmdev_error.c libsmdev_error.h \ libsmdev_extern.h \ libsmdev_handle.c libsmdev_handle.h \ libsmdev_libcdata.h \ libsmdev_libcerror.h \ libsmdev_libcfile.h \ libsmdev_libclocale.h \ libsmdev_libcnotify.h \ libsmdev_libuna.h \ libsmdev_notify.c libsmdev_notify.h \ libsmdev_optical_disc.c libsmdev_optical_disc.h \ libsmdev_scsi.c libsmdev_scsi.h \ libsmdev_sector_range.c libsmdev_sector_range.h \ libsmdev_string.c libsmdev_string.h \ libsmdev_support.c libsmdev_support.h \ libsmdev_track_value.c libsmdev_track_value.h \ libsmdev_types.h \ libsmdev_unused.h \ libsmdev_usb.c libsmdev_usb.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libsmdev ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libsmdev_la_SOURCES) libewf-20140807/libsmdev/libsmdev_string.c0000664000175000017500000000652613443450064022511 0ustar00lordyestalordyesta00000000000000/* * System character type string functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include "libsmdev_libcerror.h" #include "libsmdev_string.h" #if defined( _cplusplus ) extern "C" { #endif /* Copies and trims the string from the byte stream * Returns the number of bytes copied or -1 on error */ ssize_t libsmdev_string_trim_copy_from_byte_stream( uint8_t *string, size_t string_size, const uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ) { static char *function = "libsmdev_string_trim_copy_from_byte_stream"; size_t string_iterator = 0; ssize_t first_character = 0; ssize_t last_character = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } for( first_character = 0; first_character < (ssize_t) byte_stream_size; first_character++ ) { if( ( byte_stream[ first_character ] >= (uint8_t) 0x21 ) && ( byte_stream[ first_character ] <= (uint8_t) 0x7e ) ) { break; } } for( last_character = (ssize_t) byte_stream_size - 1; last_character >= 0; last_character-- ) { if( ( byte_stream[ last_character ] >= (uint8_t) 0x21 ) && ( byte_stream[ last_character ] <= (uint8_t) 0x7e ) ) { break; } } if( first_character < last_character ) { if( string_size < (size_t) ( last_character - first_character + 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string too small.", function ); return( -1 ); } while( first_character <= last_character ) { string[ string_iterator++ ] = byte_stream[ first_character++ ]; } } string[ string_iterator++ ] = 0; return( (ssize_t) string_iterator ); } libewf-20140807/libsmdev/libsmdev_ata.c0000664000175000017500000000747613443450064021755 0ustar00lordyestalordyesta00000000000000/* * ATA/ATAPI functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #include #include #include #if defined( HAVE_CYGWIN_HDREG_H ) #include #endif #if defined( HAVE_LINUX_HDREG_H ) #include #endif #include "libsmdev_ata.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #include "libsmdev_libcnotify.h" #if defined( HDIO_GET_IDENTITY ) /* Sends a ATA DEVICE CONFIGURATION IDENTIFY to the file descriptor * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_ata_get_device_configuration( libcfile_file_t *device_file, struct hd_driveid *device_configuration, libcerror_error_t **error ) { static char *function = "libsmdev_ata_get_device_configuration"; int read_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( device_configuration == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device configuration.", function ); return( -1 ); } read_count = libcfile_file_io_control_read( device_file, HDIO_GET_IDENTITY, NULL, 0, (uint8_t *) device_configuration, sizeof( struct hd_driveid ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device file for: HDIO_GET_IDENTITY.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); return( 0 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: HDIO_GET_IDENTITY:\n", function ); libcnotify_print_data( (uint8_t *) device_configuration, sizeof( struct hd_driveid ), 0 ); libcnotify_printf( "Feature sets:\n" ); libcnotify_printf( "SMART:\t\t\t%d\n", ( device_configuration->command_set_1 & 0x0001 ) ); libcnotify_printf( "Security Mode:\t\t%d (%d)\n", ( device_configuration->command_set_1 & 0x0002 ) >> 1, ( device_configuration->dlf & 0x0001 ) ); libcnotify_printf( "Security Mode enabled:\t%d\n", ( device_configuration->dlf & 0x0002 ) >> 1 ); libcnotify_printf( "Removable Media:\t%d\n", ( device_configuration->command_set_1 & 0x0004 ) >> 2 ); libcnotify_printf( "HPA:\t\t\t%d\n", ( device_configuration->command_set_1 & 0x0400 ) >> 10 ); libcnotify_printf( "DCO:\t\t\t%d\n", ( device_configuration->command_set_2 & 0x0800 ) >> 11 ); libcnotify_printf( "Media serial:\t\t%d\n", ( device_configuration->cfsse & 0x0004 ) >> 2 ); libcnotify_printf( "\n" ); } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ return( 1 ); } #endif /* defined( HDIO_GET_IDENTITY ) */ libewf-20140807/libsmdev/libsmdev_unused.h0000664000175000017500000000260213443450064022502 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2010-2019, 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( _LIBSMDEV_UNUSED_H ) #define _LIBSMDEV_UNUSED_H #include #if !defined( LIBSMDEV_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBSMDEV_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBSMDEV_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBSMDEV_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBSMDEV_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBSMDEV_UNUSED_H ) */ libewf-20140807/libsmdev/libsmdev_error.c0000664000175000017500000000554013443450064022327 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libsmdev_error.h" #include "libsmdev_libcerror.h" #if !defined( HAVE_LOCAL_LIBSMDEV ) /* Free an error and its elements */ void libsmdev_error_free( libsmdev_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libsmdev_error_fprint( libsmdev_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libsmdev_error_sprint( libsmdev_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libsmdev_error_backtrace_fprint( libsmdev_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libsmdev_error_backtrace_sprint( libsmdev_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ libewf-20140807/libsmdev/libsmdev_handle.c0000664000175000017500000035253513443450064022442 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_SYS_STAT_H ) #include #endif #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_UNISTD_H ) #include #endif #if defined( WINAPI ) #include #elif defined( HAVE_CYGWIN_FS_H ) #include #elif defined( HAVE_LINUX_FS_H ) /* Required for Linux platforms that use a sizeof( u64 ) * in linux/fs.h but have no typedef of it */ #if !defined( HAVE_U64 ) typedef size_t u64; #endif #include #else #if defined( HAVE_SYS_DISK_H ) #include #endif #if defined( HAVE_SYS_DISKLABEL_H ) #include #endif #endif /* defined( WINAPI ) */ #include "libsmdev_ata.h" #include "libsmdev_definitions.h" #include "libsmdev_handle.h" #include "libsmdev_libcdata.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #include "libsmdev_libclocale.h" #include "libsmdev_libcnotify.h" #include "libsmdev_libuna.h" #include "libsmdev_optical_disc.h" #include "libsmdev_scsi.h" #include "libsmdev_sector_range.h" #include "libsmdev_string.h" #include "libsmdev_track_value.h" #include "libsmdev_types.h" #if defined( WINAPI ) #if !defined( IOCTL_STORAGE_QUERY_PROPERTY ) #define IOCTL_STORAGE_QUERY_PROPERTY \ CTL_CODE( IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS ) typedef enum _STORAGE_PROPERTY_ID { StorageDeviceProperty = 0, StorageAdapterProperty, StorageDeviceIdProperty, StorageDeviceUniqueIdProperty, StorageDeviceWriteCacheProperty, StorageMiniportProperty, StorageAccessAlignmentProperty, StorageDeviceSeekPenaltyProperty, StorageDeviceTrimProperty, StorageDeviceWriteAggregationProperty } STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID; typedef enum _STORAGE_QUERY_TYPE { PropertyStandardQuery = 0, PropertyExistsQuery, PropertyMaskQuery, PropertyQueryMaxDefined } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE; #if defined( _MSC_VER ) || defined( __BORLANDC__ ) #define HAVE_WINIOCTL_H_STORAGE_BUS_TYPE #endif #if !defined( HAVE_WINIOCTL_H_STORAGE_BUS_TYPE ) typedef enum _STORAGE_BUS_TYPE { BusTypeUnknown = 0x00, BusTypeScsi = 0x01, BusTypeAtapi = 0x02, BusTypeAta = 0x03, BusType1394 = 0x04, BusTypeSsa = 0x05, BusTypeFibre = 0x06, BusTypeUsb = 0x07, BusTypeRAID = 0x08, BusTypeiSCSI = 0x09, BusTypeSas = 0x0a, BusTypeSata = 0x0b, BusTypeMaxReserved = 0x7f } STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE; #endif /* !defined( HAVE_WINIOCTL_H_STORAGE_BUS_TYPE ) */ typedef struct _STORAGE_PROPERTY_QUERY { STORAGE_PROPERTY_ID PropertyId; STORAGE_QUERY_TYPE QueryType; UCHAR AdditionalParameters[ 1 ]; } STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY; typedef struct _STORAGE_DEVICE_DESCRIPTOR { ULONG Version; ULONG Size; UCHAR DeviceType; UCHAR DeviceTypeModifier; BOOLEAN RemovableMedia; BOOLEAN CommandQueueing; ULONG VendorIdOffset; ULONG ProductIdOffset; ULONG ProductRevisionOffset; ULONG SerialNumberOffset; STORAGE_BUS_TYPE BusType; ULONG RawPropertiesLength; UCHAR RawDeviceProperties[ 1 ]; } STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR; typedef struct _STORAGE_DESCRIPTOR_HEADER { ULONG Version; ULONG Size; } STORAGE_DESCRIPTOR_HEADER, *PSTORAGE_DESCRIPTOR_HEADER; #endif /* !defined( IOCTL_STORAGE_QUERY_PROPERTY ) */ #if !defined( IOCTL_DISK_GET_LENGTH_INFO ) #define IOCTL_DISK_GET_LENGTH_INFO \ CTL_CODE( IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, FILE_READ_ACCESS ) typedef struct { LARGE_INTEGER Length; } GET_LENGTH_INFORMATION; #endif /* !defined( IOCTL_DISK_GET_LENGTH_INFO ) */ #if !defined( IOCTL_DISK_GET_DRIVE_GEOMETRY_EX ) #define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX \ CTL_CODE( IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS ) typedef struct _DISK_GEOMETRY_EX { DISK_GEOMETRY Geometry; LARGE_INTEGER DiskSize; UCHAR Data[ 1 ]; } DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX; #endif /* !defined( IOCTL_DISK_GET_DRIVE_GEOMETRY_EX ) */ #endif /* defined( WINAPI ) */ /* Creates a handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmdev_handle_initialize( libsmdev_handle_t **handle, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } internal_handle = memory_allocate_structure( libsmdev_internal_handle_t ); if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create internal handle.", function ); goto on_error; } if( memory_set( internal_handle, 0, sizeof( libsmdev_internal_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear handle.", function ); memory_free( internal_handle ); return( -1 ); } if( libcdata_array_initialize( &( internal_handle->tracks_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create tracks array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->sessions_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sessions array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->lead_outs_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create lead-outs array.", function ); goto on_error; } if( libcdata_range_list_initialize( &( internal_handle->errors_range_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create errors range list.", function ); goto on_error; } internal_handle->number_of_error_retries = 2; *handle = (libsmdev_handle_t *) internal_handle; return( 1 ); on_error: if( internal_handle != NULL ) { if( internal_handle->lead_outs_array != NULL ) { libcdata_array_free( &( internal_handle->lead_outs_array ), NULL, NULL ); } if( internal_handle->sessions_array != NULL ) { libcdata_array_free( &( internal_handle->sessions_array ), NULL, NULL ); } if( internal_handle->tracks_array != NULL ) { libcdata_array_free( &( internal_handle->tracks_array ), NULL, NULL ); } memory_free( internal_handle ); } return( -1 ); } /* Frees a handle * Returns 1 if succesful or -1 on error */ int libsmdev_handle_free( libsmdev_handle_t **handle, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_internal_handle_free"; int result = 1; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { internal_handle = (libsmdev_internal_handle_t *) *handle; if( internal_handle->device_file != NULL ) { if( libsmdev_handle_close( *handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); result = -1; } } *handle = NULL; if( libcdata_array_free( &( internal_handle->tracks_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free tracks array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->sessions_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sessions array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->lead_outs_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free lead-outs array.", function ); result = -1; } if( libcdata_range_list_free( &( internal_handle->errors_range_list ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free errors range list.", function ); result = -1; } memory_free( internal_handle ); } return( result ); } /* Signals the handle to abort its current activity * Returns 1 if successful or -1 on error */ int libsmdev_handle_signal_abort( libsmdev_handle_t *handle, libcerror_error_t **error ) { static char *function = "libsmdev_handle_signal_abort"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } ( (libsmdev_internal_handle_t *) handle )->abort = 1; return( 1 ); } /* Opens a storage media device * Returns 1 if successful or -1 on error */ int libsmdev_handle_open( libsmdev_handle_t *handle, const char *filename, int access_flags, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_open"; size64_t media_size = 0; size_t filename_length = 0; uint32_t bytes_per_sector = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - device file value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty lead-outs array.", function ); goto on_error; } if( libcdata_range_list_empty( internal_handle->errors_range_list, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty errors range list.", function ); goto on_error; } filename_length = narrow_string_length( filename ); if( libsmdev_handle_set_filename( handle, filename, filename_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in handle.", function ); goto on_error; } if( libcfile_file_initialize( &( internal_handle->device_file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create device file.", function ); goto on_error; } if( libcfile_file_open( internal_handle->device_file, filename, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open device file.", function ); goto on_error; } if( libsmdev_handle_get_media_size( handle, &media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); goto on_error; } /* /dev/rdisk# on Mac OS X and some Windows devices require * sector aligned read and seek operations */ result = libsmdev_handle_get_bytes_per_sector( handle, &bytes_per_sector, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); goto on_error; } else if( result != 0 ) { if( libcfile_file_set_block_size( internal_handle->device_file, (size_t) bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to set block size in device file.", function ); goto on_error; } } /* Use this function to double the read-ahead system buffer on POSIX system * This provides for some additional performance */ if( libcfile_file_set_access_behavior( internal_handle->device_file, LIBCFILE_ACCESS_BEHAVIOR_SEQUENTIAL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set access behavior.", function ); goto on_error; } return( 1 ); on_error: if( internal_handle->device_file != NULL ) { libcfile_file_free( &( internal_handle->device_file ), NULL ); } if( internal_handle->filename != NULL ) { memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a storage media device * Returns 1 if successful or -1 on error */ int libsmdev_handle_open_wide( libsmdev_handle_t *handle, const wchar_t *filename, int access_flags, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_open_wide"; size64_t media_size = 0; size_t filename_length = 0; uint32_t bytes_per_sector = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - device file value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty lead-outs array.", function ); goto on_error; } if( libcdata_range_list_empty( internal_handle->errors_range_list, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty errors range list.", function ); goto on_error; } filename_length = wide_string_length( filename ); if( libsmdev_handle_set_filename_wide( handle, filename, filename_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in handle.", function ); goto on_error; } if( libcfile_file_initialize( &( internal_handle->device_file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create device file.", function ); goto on_error; } if( libcfile_file_open_wide( internal_handle->device_file, filename, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open device file.", function ); goto on_error; } if( libsmdev_handle_get_media_size( handle, &media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); goto on_error; } /* /dev/rdisk# on Mac OS X and some Windows devices require * sector aligned read and seek operations */ result = libsmdev_handle_get_bytes_per_sector( handle, &bytes_per_sector, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); goto on_error; } else if( result != 0 ) { if( libcfile_file_set_block_size( internal_handle->device_file, (size_t) bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to set block size in device file.", function ); goto on_error; } } /* Use this function to double the read-ahead system buffer on POSIX system * This provides for some additional performance */ if( libcfile_file_set_access_behavior( internal_handle->device_file, LIBCFILE_ACCESS_BEHAVIOR_SEQUENTIAL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set access behavior.", function ); goto on_error; } return( 1 ); on_error: if( internal_handle->device_file != NULL ) { libcfile_file_free( &( internal_handle->device_file ), NULL ); } if( internal_handle->filename != NULL ) { memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; } return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Closes a device handle * Returns the 0 if succesful or -1 on error */ int libsmdev_handle_close( libsmdev_handle_t *handle, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_close"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file != NULL ) { if( libcfile_file_close( internal_handle->device_file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close device file.", function ); result = -1; } if( libcfile_file_free( &( internal_handle->device_file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free device file.", function ); result = -1; } } internal_handle->offset = 0; internal_handle->bytes_per_sector = 0; internal_handle->bytes_per_sector_set = 0; internal_handle->media_size = 0; internal_handle->media_size_set = 0; internal_handle->bus_type = 0; internal_handle->device_type = 0; internal_handle->removable = 0; internal_handle->media_information_set = 0; if( memory_set( internal_handle->vendor, 0, 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear vendor string.", function ); result = -1; } if( memory_set( internal_handle->model, 0, 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear model string.", function ); result = -1; } if( memory_set( internal_handle->serial_number, 0, 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear serial number string.", function ); result = -1; } if( internal_handle->filename != NULL ) { memory_free( internal_handle->filename ); internal_handle->filename = NULL; } if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty lead-outs array.", function ); result = -1; } if( libcdata_range_list_empty( internal_handle->errors_range_list, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty errors range list.", function ); result = -1; } return( result ); } /* Reads a buffer * Returns the number of bytes read or -1 on error */ ssize_t libsmdev_handle_read_buffer( libsmdev_handle_t *handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_read_buffer"; size_t buffer_offset = 0; size_t error_granularity_buffer_offset = 0; size_t error_granularity_size = 0; size_t error_granularity_skip_size = 0; size_t read_error_size = 0; size_t read_size = 0; ssize_t read_count = 0; off64_t calculated_current_offset = 0; off64_t current_offset = 0; uint32_t error_code = 0; int16_t number_of_read_errors = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing device file.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } read_size = buffer_size; if( internal_handle->media_size != 0 ) { if( internal_handle->offset >= (off64_t) internal_handle->media_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: offset exceeds media size.", function ); return( -1 ); } if( ( internal_handle->offset + (off64_t) read_size ) > (off64_t) internal_handle->media_size ) { read_size = (size_t) ( internal_handle->media_size - internal_handle->offset ); } } while( number_of_read_errors <= (int16_t) internal_handle->number_of_error_retries ) { if( internal_handle->abort != 0 ) { break; } if( read_size == 0 ) { break; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading buffer at offset: %" PRIi64 " of size: %" PRIzd ".\n", function, internal_handle->offset + (off64_t) buffer_offset, read_size ); } #endif read_count = libcfile_file_read_buffer_with_error_code( internal_handle->device_file, &( buffer[ buffer_offset ] ), read_size, &error_code, error ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: read buffer at offset: %" PRIi64 " of size: %" PRIzd ".\n", function, internal_handle->offset + (off64_t) buffer_offset, read_count ); } #endif if( read_count == -1 ) { switch( error_code ) { #if defined( WINAPI ) default: #else /* Reading should not be retried for some POSIX error conditions */ case ESPIPE: case EPERM: case ENXIO: case ENODEV: #endif libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to read from device file.", function ); return( -1 ); #if defined( WINAPI ) /* A WINAPI read error generates the error code ERROR_UNRECOGNIZED_MEDIA */ case ERROR_UNRECOGNIZED_MEDIA: #else default: #endif #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: error reading from device file.\n", function ); if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); current_offset = libcfile_file_seek_offset( internal_handle->device_file, 0, SEEK_CUR, error ); if( current_offset == -1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, errno, "%s: unable to seek current offset.", function ); return( -1 ); } calculated_current_offset = internal_handle->offset + (off64_t) buffer_offset; /* On MacOS-X the read count can be -1 on error and the file offset is set to the position of the error */ if( current_offset != calculated_current_offset ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting offset drift (actual: %" PRIi64 ", calculated: %" PRIi64 ").\n", function, current_offset, calculated_current_offset ); } #endif if( current_offset < calculated_current_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: unable to to correct negative offset drift.", function ); return( -1 ); } read_count = (ssize_t) ( current_offset - calculated_current_offset ); } break; } } if( read_count > (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid read count value exceeds read size.", function ); return( -1 ); } else if( read_count == 0 ) { return( 0 ); } else if( read_count > 0 ) { buffer_offset += read_count; read_size -= read_count; if( read_size == 0 ) { break; } } /* Not all requested data was read or there was an error */ number_of_read_errors++; #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: read error: %" PRIi16 " at offset %" PRIi64 ".\n", function, number_of_read_errors, internal_handle->offset + buffer_offset ); } #endif if( number_of_read_errors > (int16_t) internal_handle->number_of_error_retries ) { if( internal_handle->error_granularity > 0 ) { error_granularity_size = internal_handle->error_granularity; } else { error_granularity_size = buffer_size; } error_granularity_buffer_offset = ( buffer_offset / error_granularity_size ) * error_granularity_size; error_granularity_skip_size = ( error_granularity_buffer_offset + error_granularity_size ) - buffer_offset; /* Check if error granularity skip is still within range of the buffer */ if( error_granularity_skip_size > read_size ) { error_granularity_skip_size = read_size; } if( ( internal_handle->error_flags & LIBSMDEV_ERROR_FLAG_ZERO_ON_ERROR ) != 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: zero-ing buffer of size: %" PRIzd " bytes at offset %" PRIzd ".\n", function, error_granularity_size, error_granularity_buffer_offset ); } #endif if( memory_set( &( buffer[ error_granularity_buffer_offset ] ), 0, error_granularity_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero buffer on error.", function ); return( -1 ); } read_error_size = error_granularity_size; } else { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: zero-ing remainder of buffer of size: %" PRIzd " bytes at offset %" PRIzd ".\n", function, error_granularity_skip_size, buffer_offset ); } #endif if( memory_set( &( buffer[ buffer_offset ] ), 0, error_granularity_skip_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero remainder of buffer on error.", function ); return( -1 ); } read_error_size = error_granularity_skip_size; } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: adding read error at offset: %" PRIi64 ", number of bytes: %" PRIzd ".\n", function, current_offset, read_error_size ); } #endif result = libcdata_range_list_insert_range( internal_handle->errors_range_list, (uint64_t) current_offset, (uint64_t) read_error_size, NULL, NULL, NULL, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert read error to range list.", function ); return( -1 ); } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: skipping %" PRIu32 " bytes.\n", function, error_granularity_skip_size ); } #endif if( libcfile_file_seek_offset( internal_handle->device_file, error_granularity_skip_size, SEEK_CUR, error ) == -1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, errno, "%s: unable to skip %" PRIu32 " bytes after read error.", function, error_granularity_skip_size ); return( -1 ); } read_size -= error_granularity_skip_size; buffer_offset += error_granularity_skip_size; number_of_read_errors = 0; } } internal_handle->offset += buffer_offset; return( (ssize_t) buffer_offset ); } /* Reads a buffer at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t libsmdev_handle_read_buffer_at_offset( libsmdev_handle_t *handle, uint8_t *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libsmdev_handle_read_buffer_at_offset"; ssize_t read_count = 0; if( libsmdev_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } read_count = libsmdev_handle_read_buffer( handle, buffer, buffer_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } return( read_count ); } /* Writes a buffer * Returns the number of bytes written or -1 on error */ ssize_t libsmdev_handle_write_buffer( libsmdev_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_write_buffer"; ssize_t write_count = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing device file.", function ); return( -1 ); } write_count = libcfile_file_write_buffer( internal_handle->device_file, buffer, buffer_size, error ); if( write_count < 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, errno, "%s: unable to write to device file.", function ); return( -1 ); } internal_handle->offset += write_count; return( write_count ); } /* Writes a buffer at a specific offset * Returns the number of bytes written or -1 on error */ ssize_t libsmdev_handle_write_buffer_at_offset( libsmdev_handle_t *handle, const uint8_t *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libsmdev_handle_write_buffer_at_offset"; ssize_t write_count = 0; if( libsmdev_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } write_count = libsmdev_handle_write_buffer( handle, buffer, buffer_size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write buffer.", function ); return( -1 ); } return( write_count ); } /* Seeks a certain offset * Returns the offset if seek is successful or -1 on error */ off64_t libsmdev_handle_seek_offset( libsmdev_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_seek_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing device file.", function ); return( -1 ); } offset = libcfile_file_seek_offset( internal_handle->device_file, offset, whence, error ); if( offset == -1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, errno, "%s: unable to seek offset in device file.", function ); return( -1 ); } internal_handle->offset = offset; return( offset ); } /* Retrieves the current offset of the (media) data * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_offset( libsmdev_handle_t *handle, off64_t *offset, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } *offset = internal_handle->offset; return( 1 ); } /* Retrieves the filename size of the file handle * The filename size includes the end of string character * Returns 1 if succesful or -1 on error */ int libsmdev_handle_get_filename_size( libsmdev_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_filename_size"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing filename.", function ); return( -1 ); } if( filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine filename size.", function ); return( -1 ); } #else *filename_size = internal_handle->filename_size; #endif return( 1 ); } /* Retrieves the filename of the file handle * The filename size should include the end of string character * Returns 1 if succesful or -1 on error */ int libsmdev_handle_get_filename( libsmdev_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_filename"; size_t narrow_filename_size = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing filename.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, &narrow_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, &narrow_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, &narrow_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, &narrow_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine filename size.", function ); return( -1 ); } #else narrow_filename_size = internal_handle->filename_size; #endif if( filename_size < narrow_filename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: filename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) filename, filename_size, (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) filename, filename_size, (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) filename, filename_size, libclocale_codepage, (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) filename, filename_size, libclocale_codepage, (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set filename.", function ); return( -1 ); } #else if( system_string_copy( filename, internal_handle->filename, internal_handle->filename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set filename.", function ); return( -1 ); } filename[ internal_handle->filename_size - 1 ] = 0; #endif return( 1 ); } /* Sets the filename for the file handle * Returns 1 if succesful or -1 on error */ int libsmdev_handle_set_filename( libsmdev_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_set_filename"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - device file value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid filename length is zero.", function ); return( -1 ); } if( filename_length >= (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename length value exceeds maximum.", function ); return( -1 ); } if( internal_handle->filename != NULL ) { memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) filename, filename_length + 1, &( internal_handle->filename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) filename, filename_length + 1, &( internal_handle->filename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) filename, filename_length + 1, libclocale_codepage, &( internal_handle->filename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) filename, filename_length + 1, libclocale_codepage, &( internal_handle->filename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine filename size.", function ); return( -1 ); } #else internal_handle->filename_size = filename_length + 1; #endif internal_handle->filename = system_string_allocate( internal_handle->filename_size ); if( internal_handle->filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create filename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, (libuna_utf8_character_t *) filename, filename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, (libuna_utf8_character_t *) filename, filename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) internal_handle->filename, internal_handle->filename_size, (uint8_t *) filename, filename_length + 1, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) internal_handle->filename, internal_handle->filename_size, (uint8_t *) filename, filename_length + 1, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set filename.", function ); memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; return( -1 ); } #else if( system_string_copy( internal_handle->filename, filename, filename_length + 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set filename.", function ); memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; return( -1 ); } internal_handle->filename[ filename_length ] = 0; #endif return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the filename size of the file handle * The filename size includes the end of string character * Returns 1 if succesful or -1 on error */ int libsmdev_handle_get_filename_size_wide( libsmdev_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_filename_size_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing filename.", function ); return( -1 ); } if( filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) *filename_size = internal_handle->filename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine filename size.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the filename of the file handle * The filename size should include the end of string character * Returns 1 if succesful or -1 on error */ int libsmdev_handle_get_filename_wide( libsmdev_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_filename_wide"; size_t wide_filename_size = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing filename.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wide_filename_size = internal_handle->filename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, &wide_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, &wide_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, &wide_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, &wide_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine filename size.", function ); return( -1 ); } #endif if( filename_size < wide_filename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: filename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( filename, internal_handle->filename, internal_handle->filename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set filename.", function ); return( -1 ); } filename[ internal_handle->filename_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) filename, filename_size, (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) filename, filename_size, (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) filename, filename_size, (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) filename, filename_size, (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set filename.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the filename for the file handle * Returns 1 if succesful or -1 on error */ int libsmdev_handle_set_filename_wide( libsmdev_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_set_filename_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - device file value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid filename length is zero.", function ); return( -1 ); } if( filename_length >= (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename length value exceeds maximum.", function ); return( -1 ); } if( internal_handle->filename != NULL ) { memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) internal_handle->filename_size = filename_length + 1; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) filename, filename_length + 1, &( internal_handle->filename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) filename, filename_length + 1, &( internal_handle->filename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) filename, filename_length + 1, libclocale_codepage, &( internal_handle->filename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) filename, filename_length + 1, libclocale_codepage, &( internal_handle->filename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine filename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ internal_handle->filename = system_string_allocate( internal_handle->filename_size ); if( internal_handle->filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create filename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( internal_handle->filename, filename, filename_length + 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set filename.", function ); memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; return( -1 ); } internal_handle->filename[ filename_length ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, (libuna_utf32_character_t *) filename, filename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) internal_handle->filename, internal_handle->filename_size, (libuna_utf16_character_t *) filename, filename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, (libuna_utf32_character_t *) filename, filename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) internal_handle->filename, internal_handle->filename_size, libclocale_codepage, (libuna_utf16_character_t *) filename, filename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set filename.", function ); memory_free( internal_handle->filename ); internal_handle->filename = NULL; internal_handle->filename_size = 0; return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Determines the media information * Returns 1 if successful, 0 if no media information available or -1 on error */ int libsmdev_internal_handle_determine_media_information( libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ) { #if defined( WINAPI ) STORAGE_PROPERTY_QUERY query; #elif defined( HDIO_GET_IDENTITY ) struct hd_driveid device_configuration; #endif uint8_t *response = NULL; static char *function = "libsmdev_internal_handle_determine_media_information"; #if defined( WINAPI ) size_t response_size = 1024; size_t string_length = 0; ssize_t read_count = 0; #else size_t response_size = 255; #if defined( HAVE_SCSI_SG_H ) ssize_t response_count = 0; #endif #endif #if defined( HAVE_SCSI_SG_H ) || defined( HDIO_GET_IDENTITY ) || defined( HAVE_LINUX_CDROM_H ) || defined( WINAPI ) ssize_t result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( internal_handle->media_information_set != 0 ) { return( 1 ); } if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid device handle - missing device file.", function ); return( -1 ); } response = (uint8_t *) memory_allocate( sizeof( uint8_t ) * response_size ); if( response == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to response.", function ); goto on_error; } if( memory_set( response, 0, sizeof( uint8_t ) * response_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear response.", function ); goto on_error; } #if defined( WINAPI ) if( memset( &query, 0, sizeof( STORAGE_PROPERTY_QUERY ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear storage property query.", function ); goto on_error; } query.PropertyId = StorageDeviceProperty; query.QueryType = PropertyStandardQuery; read_count = libcfile_file_io_control_read( internal_handle->device_file, IOCTL_STORAGE_QUERY_PROPERTY, (uint8_t *) &query, sizeof( STORAGE_PROPERTY_QUERY ), response, response_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: IOCTL_STORAGE_QUERY_PROPERTY.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); return( 0 ); } if( (size_t) ( (STORAGE_DESCRIPTOR_HEADER *) response )->Size > response_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: response buffer too small.\n", function ); goto on_error; } if( (size_t) ( (STORAGE_DESCRIPTOR_HEADER *) response )->Size > sizeof( STORAGE_DEVICE_DESCRIPTOR ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_print_data( response, (size_t) ( (STORAGE_DESCRIPTOR_HEADER *) response )->Size, 0 ); } #endif if( ( (STORAGE_DEVICE_DESCRIPTOR *) response )->VendorIdOffset > 0 ) { string_length = narrow_string_length( (char *) &( response[ ( (STORAGE_DEVICE_DESCRIPTOR *) response )->VendorIdOffset ] ) ); result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->vendor, 64, &( response[ ( (STORAGE_DEVICE_DESCRIPTOR *) response )->VendorIdOffset ] ), string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set vendor.", function ); goto on_error; } } if( ( (STORAGE_DEVICE_DESCRIPTOR *) response )->ProductIdOffset > 0 ) { string_length = narrow_string_length( (char *) &( response[ ( (STORAGE_DEVICE_DESCRIPTOR *) response )->ProductIdOffset ] ) ); result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->model, 64, &( response[ ( (STORAGE_DEVICE_DESCRIPTOR *) response )->ProductIdOffset ] ), string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set model.", function ); goto on_error; } } if( ( (STORAGE_DEVICE_DESCRIPTOR *) response )->SerialNumberOffset > 0 ) { string_length = narrow_string_length( (char *) &( response[ ( (STORAGE_DEVICE_DESCRIPTOR *) response )->SerialNumberOffset ] ) ); result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->serial_number, 64, &( response[ ( (STORAGE_DEVICE_DESCRIPTOR *) response )->SerialNumberOffset ] ), string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set serial number.", function ); goto on_error; } } internal_handle->removable = ( (STORAGE_DEVICE_DESCRIPTOR *) response )->RemovableMedia; switch( ( ( STORAGE_DEVICE_DESCRIPTOR *) response )->BusType ) { case BusTypeScsi: internal_handle->bus_type = LIBSMDEV_BUS_TYPE_SCSI; break; case BusTypeAtapi: case BusTypeAta: internal_handle->bus_type = LIBSMDEV_BUS_TYPE_ATA; break; case BusType1394: internal_handle->bus_type = LIBSMDEV_BUS_TYPE_FIREWIRE; break; case BusTypeUsb: internal_handle->bus_type = LIBSMDEV_BUS_TYPE_USB; break; default: break; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "Bus type:\t\t" ); switch( ( ( STORAGE_DEVICE_DESCRIPTOR *) response )->BusType ) { case BusTypeScsi: libcnotify_printf( "SCSI" ); break; case BusTypeAtapi: libcnotify_printf( "ATAPI" ); break; case BusTypeAta: libcnotify_printf( "ATA" ); break; case BusType1394: libcnotify_printf( "FireWire (IEEE1394)" ); break; case BusTypeSsa: libcnotify_printf( "Serial Storage Architecture (SSA)" ); break; case BusTypeFibre: libcnotify_printf( "Fibre Channel" ); break; case BusTypeUsb: libcnotify_printf( "USB" ); break; case BusTypeRAID: libcnotify_printf( "RAID" ); break; case BusTypeiScsi: libcnotify_printf( "iSCSI" ); break; case BusTypeSas: libcnotify_printf( "SAS" ); break; case BusTypeSata: libcnotify_printf( "SATA" ); break; case BusTypeSd: libcnotify_printf( "Secure Digital (SD)" ); break; case BusTypeMmc: libcnotify_printf( "Multi Media Card (MMC)" ); break; default: libcnotify_printf( "Unknown: %d", ( ( STORAGE_DEVICE_DESCRIPTOR *) response )->BusType ); break; } libcnotify_printf( "\n" ); } #endif } #else #if defined( HAVE_SCSI_SG_H ) /* Use the Linux sg (generic SCSI) driver to determine device information */ result = libsmdev_scsi_get_bus_type( internal_handle->device_file, &( internal_handle->bus_type ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine bus type.", function ); goto on_error; } else if( result != 0 ) { response_count = libsmdev_scsi_inquiry( internal_handle->device_file, 0x00, 0x00, response, response_size, error ); if( response_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SCSI Inquiry.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } /* TODO handle garbarge return ? */ if( response_count >= 5 ) { internal_handle->removable = ( response[ 1 ] & 0x80 ) >> 7; internal_handle->device_type = ( response[ 0 ] & 0x1f ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: removable\t\t: %" PRIu8 "\n", function, internal_handle->removable ); libcnotify_printf( "%s: device type\t: 0x%" PRIx8 "\n", function, internal_handle->device_type ); libcnotify_printf( "\n" ); } #endif } if( response_count >= 16 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_print_data( response, response_count, 0 ); } #endif result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->vendor, 64, &( response[ 8 ] ), 15 - 8, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set vendor.", function ); goto on_error; } } if( response_count >= 32 ) { result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->model, 64, &( response[ 16 ] ), 31 - 16, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set model.", function ); goto on_error; } } response_count = libsmdev_scsi_inquiry( internal_handle->device_file, 0x01, 0x80, response, response_size, error ); if( response_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SCSI Inquiry.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } if( response_count > 4 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_print_data( response, response_count, 0 ); } #endif result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->serial_number, 64, &( response[ 4 ] ), response_count - 4, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set serial number.", function ); goto on_error; } } } #endif #if defined( HDIO_GET_IDENTITY ) if( internal_handle->bus_type == LIBSMDEV_BUS_TYPE_ATA ) { result = libsmdev_ata_get_device_configuration( internal_handle->device_file, &device_configuration, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve ATA device configuration.", function ); goto on_error; } else if( result != 0 ) { result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->serial_number, 64, device_configuration.serial_no, 20, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set serial number.", function ); goto on_error; } result = libsmdev_string_trim_copy_from_byte_stream( internal_handle->model, 64, device_configuration.model, 40, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set model.", function ); goto on_error; } internal_handle->removable = ( device_configuration.config & 0x0080 ) >> 7; internal_handle->device_type = ( device_configuration.config & 0x1f00 ) >> 8; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: removable\t\t: %" PRIu8 "\n", function, internal_handle->removable ); libcnotify_printf( "%s: device type\t: 0x%" PRIx8 "\n", function, internal_handle->device_type ); libcnotify_printf( "\n" ); } #endif } } #endif #if defined( HAVE_LINUX_CDROM_H ) if( internal_handle->device_type == 0x05 ) { result = libsmdev_optical_disc_get_table_of_contents( internal_handle->device_file, internal_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve optical disc table of contents.", function ); goto on_error; } } #endif /* Disabled for now if( libsmdev_scsi_get_identifier( internal_handle->device_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine SCSI identifier.", function ); goto on_error; } uint8_t pci_bus_address[ 64 ]; size_t pci_bus_address_size = 64; result = libsmdev_scsi_get_pci_bus_address( internal_handle->device_file, pci_bus_address, pci_bus_address_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine PCI bus address.", function ); goto on_error; } #if defined( HAVE_LINUX_USB_CH9_H ) if( internal_handle->bus_type == LIBSMDEV_BUS_TYPE_USB ) { if( io_usb_test( internal_handle->device_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to test USB.", function ); goto on_error; } } #endif */ #endif internal_handle->media_information_set = 1; memory_free( response ); response = NULL; return( 1 ); on_error: if( response != NULL ) { memory_free( response ); } return( -1 ); } /* Appends a session * Returns 1 if successful or -1 on error */ int libsmdev_handle_append_session( libsmdev_internal_handle_t *internal_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libsmdev_sector_range_t *sector_range = NULL; static char *function = "libsmdev_handle_append_session"; int entry_index = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmdev_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sector range.", function ); goto on_error; } if( libsmdev_sector_range_set( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sector range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->sessions_array, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session sector range to array.", function ); goto on_error; } return( 1 ); on_error: if( sector_range != NULL ) { libsmdev_sector_range_free( §or_range, NULL ); } return( -1 ); } /* Appends a lead-out * Returns 1 if successful or -1 on error */ int libsmdev_handle_append_lead_out( libsmdev_internal_handle_t *internal_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libsmdev_sector_range_t *sector_range = NULL; static char *function = "libsmdev_handle_append_lead_out"; int entry_index = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmdev_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sector range.", function ); goto on_error; } if( libsmdev_sector_range_set( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sector range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->lead_outs_array, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead-out sector range to array.", function ); goto on_error; } return( 1 ); on_error: if( sector_range != NULL ) { libsmdev_sector_range_free( §or_range, NULL ); } return( -1 ); } /* Appends a track * Returns 1 if successful or -1 on error */ int libsmdev_handle_append_track( libsmdev_internal_handle_t *internal_handle, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, libcerror_error_t **error ) { libsmdev_track_value_t *track_value = NULL; static char *function = "libsmdev_handle_append_track"; int entry_index = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libsmdev_track_value_initialize( &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create track value.", function ); goto on_error; } if( libsmdev_track_value_set( track_value, start_sector, number_of_sectors, type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track value.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->tracks_array, &entry_index, (intptr_t *) track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track to array.", function ); goto on_error; } return( 1 ); on_error: if( track_value != NULL ) { libsmdev_track_value_free( &track_value, NULL ); } return( -1 ); } /* Retrieves the media size * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_get_media_size( libsmdev_handle_t *handle, size64_t *media_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_media_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing device file.", function ); return( -1 ); } if( media_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media size.", function ); return( -1 ); } if( internal_handle->media_size_set == 0 ) { if( libcfile_file_get_size( internal_handle->device_file, &( internal_handle->media_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine device file size.", function ); return( -1 ); } internal_handle->media_size_set = 1; } *media_size = internal_handle->media_size; return( 1 ); } /* Retrieves the number of bytes per sector * Returns the 1 if succesful, 0 if not or -1 on error */ int libsmdev_handle_get_bytes_per_sector( libsmdev_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ) { #if defined( WINAPI ) DISK_GEOMETRY disk_geometry; DISK_GEOMETRY_EX disk_geometry_extended; #endif libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_bytes_per_sector"; ssize_t read_count = 0; #if defined( WINAPI ) uint32_t error_code = 0; #elif !defined( BLKSSZGET ) && defined( DIOCGSECTORSIZE ) u_int safe_bytes_per_sector = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid device handle - missing device file.", function ); return( -1 ); } if( bytes_per_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } if( internal_handle->bytes_per_sector_set == 0 ) { #if defined( WINAPI ) read_count = libcfile_file_io_control_read_with_error_code( internal_handle->device_file, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, (uint8_t *) &disk_geometry_extended, sizeof( DISK_GEOMETRY_EX ), &error_code, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); if( error_code == ERROR_NOT_SUPPORTED ) { /* A floppy device does not support IOCTL_DISK_GET_DRIVE_GEOMETRY_EX */ read_count = libcfile_file_io_control_read( internal_handle->device_file, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, (uint8_t *) &disk_geometry, sizeof( DISK_GEOMETRY ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: IOCTL_DISK_GET_DRIVE_GEOMETRY.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { internal_handle->bytes_per_sector = (uint32_t) disk_geometry.BytesPerSector; internal_handle->bytes_per_sector_set = 1; } } } else { internal_handle->bytes_per_sector = (uint32_t) disk_geometry_extended.Geometry.BytesPerSector; internal_handle->bytes_per_sector_set = 1; } #elif defined( BLKSSZGET ) read_count = libcfile_file_io_control_read( internal_handle->device_file, BLKSSZGET, NULL, 0, (uint8_t *) &( internal_handle->bytes_per_sector ), 4, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: BLKSSZGET.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { internal_handle->bytes_per_sector_set = 1; } #elif defined( DIOCGSECTORSIZE ) read_count = libcfile_file_io_control_read( internal_handle->device_file, DIOCGSECTORSIZE, NULL, 0, (uint8_t *) &safe_bytes_per_sector, sizeof( u_int ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: DIOCGSECTORSIZE.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else if( safe_bytes_per_sector > (u_int) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid bytes per sector value out of bounds.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { internal_handle->bytes_per_sector = (uint32_t) safe_bytes_per_sector; internal_handle->bytes_per_sector_set = 1; } #elif defined( DKIOCGETBLOCKSIZE ) read_count = libcfile_file_io_control_read( internal_handle->device_file, DKIOCGETBLOCKSIZE, NULL, 0, (uint8_t *) &( internal_handle->bytes_per_sector ), 4, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: DKIOCGETBLOCKSIZE.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { internal_handle->bytes_per_sector_set = 1; } #endif } if( internal_handle->bytes_per_sector_set == 0 ) { #if defined( BLKSSZGET ) || defined( DKIOCGETBLOCKSIZE ) || defined( DIOCGSECTORSIZE ) || defined( WINAPI ) return( 0 ); #else libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported platform.", function ); return( -1 ); #endif } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: bytes per sector: %" PRIu32 "\n", function, internal_handle->bytes_per_sector ); } #endif *bytes_per_sector = internal_handle->bytes_per_sector; return( 1 ); } /* Retrieves the media type * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_media_type( libsmdev_handle_t *handle, uint8_t *media_type, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_media_type"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid device handle - missing device file.", function ); return( -1 ); } if( media_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media type.", function ); return( -1 ); } if( internal_handle->media_information_set == 0 ) { if( libsmdev_internal_handle_determine_media_information( internal_handle, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media information.", function ); return( -1 ); } } if( internal_handle->device_type == 0x05 ) { *media_type = LIBSMDEV_MEDIA_TYPE_OPTICAL; } else if( internal_handle->removable != 0 ) { *media_type = LIBSMDEV_MEDIA_TYPE_REMOVABLE; } else { *media_type = LIBSMDEV_MEDIA_TYPE_FIXED; } return( 1 ); } /* Retrieves the bus type * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_bus_type( libsmdev_handle_t *handle, uint8_t *bus_type, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_bus_type"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( internal_handle->device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid device handle - missing device file.", function ); return( -1 ); } if( bus_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bus type.", function ); return( -1 ); } if( internal_handle->media_information_set == 0 ) { if( libsmdev_internal_handle_determine_media_information( internal_handle, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media information.", function ); return( -1 ); } } *bus_type = internal_handle->bus_type; return( 1 ); } /* Retrieves an UTF-8 encoded information value for the specific identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmdev_handle_get_utf8_information_value( libsmdev_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; uint8_t *information_value = NULL; static char *function = "libsmdev_handle_get_utf8_information_value"; size_t information_value_size = 0; size_t string_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( internal_handle->media_information_set == 0 ) { if( libsmdev_internal_handle_determine_media_information( internal_handle, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media information.", function ); return( -1 ); } } if( identifier_length == 5 ) { if( narrow_string_compare( "model", (char *) identifier, identifier_length ) == 0 ) { information_value = (uint8_t *) internal_handle->model; } } else if( identifier_length == 6 ) { if( narrow_string_compare( "vendor", (char *) identifier, identifier_length ) == 0 ) { information_value = (uint8_t *) internal_handle->vendor; } } else if( identifier_length == 13 ) { if( narrow_string_compare( "serial_number", (char *) identifier, identifier_length ) == 0 ) { information_value = (uint8_t *) internal_handle->serial_number; } } if( information_value == NULL ) { return( 0 ); } if( information_value[ 0 ] == 0 ) { return( 0 ); } /* Determine the header value size */ information_value_size = 1 + narrow_string_length( (char *) information_value ); if( utf8_string_size < information_value_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } for( string_index = 0; string_index < information_value_size - 1; string_index++ ) { utf8_string[ string_index ] = (uint8_t) information_value[ string_index ]; } utf8_string[ information_value_size - 1 ] = 0; return( 1 ); } /* Retrieves an UTF-16 encoded information value for the specific identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libsmdev_handle_get_utf16_information_value( libsmdev_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; uint8_t *information_value = NULL; static char *function = "libsmdev_handle_get_utf16_information_value"; size_t information_value_size = 0; size_t string_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( internal_handle->media_information_set == 0 ) { if( libsmdev_internal_handle_determine_media_information( internal_handle, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media information.", function ); return( -1 ); } } if( identifier_length == 5 ) { if( narrow_string_compare( "model", (char *) identifier, identifier_length ) == 0 ) { information_value = (uint8_t *) internal_handle->model; } } else if( identifier_length == 6 ) { if( narrow_string_compare( "vendor", (char *) identifier, identifier_length ) == 0 ) { information_value = (uint8_t *) internal_handle->vendor; } } else if( identifier_length == 13 ) { if( narrow_string_compare( "serial_number", (char *) identifier, identifier_length ) == 0 ) { information_value = (uint8_t *) internal_handle->serial_number; } } if( information_value == NULL ) { return( 0 ); } if( information_value[ 0 ] == 0 ) { return( 0 ); } /* Determine the header value size */ information_value_size = 1 + narrow_string_length( (char *) information_value ); if( utf16_string_size < information_value_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } for( string_index = 0; string_index < information_value_size - 1; string_index++ ) { utf16_string[ string_index ] = (uint16_t) information_value[ string_index ]; } utf16_string[ information_value_size - 1 ] = 0; return( 1 ); } /* Retrieves the number of sessions * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_number_of_sessions( libsmdev_handle_t *handle, int *number_of_sessions, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_number_of_sessions"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( libcdata_array_get_number_of_entries( internal_handle->sessions_array, number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries in sessions array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a session * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_session( libsmdev_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; libsmdev_sector_range_t *sector_range = NULL; static char *function = "libsmdev_handle_get_session"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->sessions_array, index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session sector range: %d from array.", function, index ); return( -1 ); } if( libsmdev_sector_range_get( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sector range.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of tracks * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_number_of_tracks( libsmdev_handle_t *handle, int *number_of_tracks, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_number_of_tracks"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( libcdata_array_get_number_of_entries( internal_handle->tracks_array, number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries in tracks array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a track * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_track( libsmdev_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; libsmdev_track_value_t *track_value = NULL; static char *function = "libsmdev_handle_get_track"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, index, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, index ); return( -1 ); } if( libsmdev_track_value_get( track_value, start_sector, number_of_sectors, type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of read/write error retries * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_get_number_of_error_retries( libsmdev_handle_t *handle, uint8_t *number_of_error_retries, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_number_of_error_retries"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( number_of_error_retries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of error retries.", function ); return( -1 ); } *number_of_error_retries = internal_handle->number_of_error_retries; return( 1 ); } /* Sets the number of read/write error retries * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_set_number_of_error_retries( libsmdev_handle_t *handle, uint8_t number_of_error_retries, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_set_number_of_error_retries"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; internal_handle->number_of_error_retries = number_of_error_retries; return( 1 ); } /* Retrieves the read/write error granularity * A value of 0 represents an error granularity of the entire buffer being read/written * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_get_error_granularity( libsmdev_handle_t *handle, size_t *error_granularity, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_error_granularity"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( error_granularity == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read granularity.", function ); return( -1 ); } *error_granularity = internal_handle->error_granularity; return( 1 ); } /* Sets the read/write error granularity * A value of 0 represents an error granularity of the entire buffer being read/written * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_set_error_granularity( libsmdev_handle_t *handle, size_t error_granularity, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_set_error_granularity"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( error_granularity > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid error granularity value exceeds maximum.", function ); return( -1 ); } internal_handle->error_granularity = error_granularity; return( 1 ); } /* Retrieves the read/write error flags * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_get_error_flags( libsmdev_handle_t *handle, uint8_t *error_flags, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_error_flags"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( error_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error flags.", function ); return( -1 ); } *error_flags = internal_handle->error_flags; return( 1 ); } /* Sets the the read/write error flags * Returns the 1 if succesful or -1 on error */ int libsmdev_handle_set_error_flags( libsmdev_handle_t *handle, uint8_t error_flags, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_set_error_flags"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( ( error_flags & ~( LIBSMDEV_ERROR_FLAG_ZERO_ON_ERROR ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported error flags.", function ); return( -1 ); } internal_handle->error_flags = error_flags; return( 1 ); } /* Retrieves the number of read/write errors * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_number_of_errors( libsmdev_handle_t *handle, int *number_of_errors, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_number_of_errors"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( libcdata_range_list_get_number_of_elements( internal_handle->errors_range_list, number_of_errors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in errors range list.", function ); return( -1 ); } return( 1 ); } /* Retrieves a read/write error * Returns 1 if successful or -1 on error */ int libsmdev_handle_get_error( libsmdev_handle_t *handle, int index, off64_t *offset, size64_t *size, libcerror_error_t **error ) { libsmdev_internal_handle_t *internal_handle = NULL; static char *function = "libsmdev_handle_get_error"; intptr_t *value = NULL; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libsmdev_internal_handle_t *) handle; if( libcdata_range_list_get_range_by_index( internal_handle->errors_range_list, index, (uint64_t *) offset, (uint64_t *) size, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve error: %d from errors range list.", function, index ); return( -1 ); } return( 1 ); } libewf-20140807/libsmdev/libsmdev_optical_disc.h0000664000175000017500000000333013443450064023633 0ustar00lordyestalordyesta00000000000000/* * Optical disk functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #if !defined( _LIBSMDEV_OPTICAL_DISK_H ) #define _LIBSMDEV_OPTICAL_DISK_H #include #include #include "libsmdev_handle.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_LINUX_CDROM_H ) int libsmdev_optical_disc_get_table_of_contents( libcfile_file_t *device_file, libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ); int libsmdev_optical_disc_get_table_of_contents_ioctl( libcfile_file_t *device_file, libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ); int libsmdev_optical_disc_get_table_of_contents_scsi( libcfile_file_t *device_file, libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ); #endif /* defined( HAVE_LINUX_CDROM_H ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_OPTICAL_DISK_H ) */ libewf-20140807/libsmdev/libsmdev_scsi.h0000664000175000017500000001667113443450064022153 0ustar00lordyestalordyesta00000000000000/* * SCSI functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #if !defined( _LIBSMDEV_SCSI_H ) #define _LIBSMDEV_SCSI_H #include #include #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_SCSI_SG_H ) enum LIBSMDEV_SCSI_OPERATION_CODES { LIBSMDEV_SCSI_OPERATION_CODE_INQUIRY = 0x12, LIBSMDEV_SCSI_OPERATION_CODE_READ_TOC = 0x43, LIBSMDEV_SCSI_OPERATION_CODE_READ_DISK_INFORMATION = 0x51, LIBSMDEV_SCSI_OPERATION_CODE_READ_TRACK_INFORMATION = 0x52, }; /* SCSI device types: * 0x00 - direct-access device (e.g., magnetic disk) * 0x01 - sequential-access device (e.g., magnetic tape) * 0x02 - printer device * 0x03 - processor device * 0x04 - write-once device * 0x05 - optical disk (CDROM) device * 0x06 - scanner device * 0x07 - optical memory device (e.g., some optical disks) * 0x08 - medium Changer (e.g. jukeboxes) * 0x09 - communications device * 0x0a-0x0b - defined by ASC IT8 (Graphic arts pre-press devices) * 0x0c - Storage array controller device (e.g., RAID) * 0x0d - Enclosure services device * 0x0e - Simplified direct-access device (e.g., magnetic disk) * 0x0f - Optical card reader/writer device * 0x10 - Reserved for bridging expanders * 0x11 - Object-based Storage Device * 0x12 - Automation/Drive Interface * 0x13-0x1d - reserved * 0x1e - Well known logical unit * 0x1f - unknown or no device type */ /* The SCSI inquiry command descriptor block (CDB) */ typedef struct libsmdev_scsi_inquiry_cdb libsmdev_scsi_inquiry_cdb_t; struct libsmdev_scsi_inquiry_cdb { /* The operation code */ uint8_t operation_code; /* The LUN and reserved bits * Bits: * 0 - 4 reserved * 5 - 7 LUN */ uint8_t lun; /* Reserved */ uint8_t reserved1; /* Reserved */ uint8_t reserved2; /* The size of the receive buffer (allocation length) */ uint8_t receive_size; /* The control byte */ uint8_t control; }; /* The SCSI table of contents (TOC) command descriptor block (CDB) * format definitions */ enum LIBSMDEV_SCSI_TOC_CDB_FORMATS { LIBSMDEV_SCSI_TOC_CDB_FORMAT_FORMATTED_TOC = 0x00, LIBSMDEV_SCSI_TOC_CDB_FORMAT_RAW_TOC = 0x02, }; /* The SCSI read table of contents (TOC) command descriptor block (CDB) */ typedef struct libsmdev_scsi_read_toc_cdb libsmdev_scsi_read_toc_cdb_t; struct libsmdev_scsi_read_toc_cdb { /* The operation code */ uint8_t operation_code; /* The MSF bit and reserved bits * Bits: * 0 reserved * 1 MSF * 2 - 7 reserved */ uint8_t msf; /* The format and reserved bits * Bits: * 0 - 3 format * 4 - 7 reserved */ uint8_t format; /* Reserved */ uint8_t reserved[ 3 ]; /* TOC entry index */ uint8_t entry_index; /* The size of the receive buffer (allocation length) * Contains a 16-bit big-endian value */ uint8_t receive_size[ 2 ]; /* The control byte */ uint8_t control; }; /* The SCSI read disc information command descriptor block (CDB) */ typedef struct libsmdev_scsi_read_disc_information_cdb libsmdev_scsi_read_disc_information_cdb_t; struct libsmdev_scsi_read_disc_information_cdb { /* The operation code */ uint8_t operation_code; /* The data type and reserved bits * Bits: * 0 - 3 data type * 4 - 7 reserved */ uint8_t data_type; /* Reserved */ uint8_t reserved[ 5 ]; /* The size of the receive buffer (allocation length) * Contains a 16-bit big-endian value */ uint8_t receive_size[ 2 ]; /* The control byte */ uint8_t control; }; /* The SCSI track information command descriptor block (CDB) * address type definitions */ enum LIBSMDEV_SCSI_TRACK_INFORMATION_ADDRESS_TYPES { LIBSMDEV_SCSI_TRACK_INFORMATION_ADDRESS_TYPE_LBA = 0x00, LIBSMDEV_SCSI_TRACK_INFORMATION_ADDRESS_TYPE_TRACK_NUMBER = 0x01, LIBSMDEV_SCSI_TRACK_INFORMATION_ADDRESS_TYPE_SESSION_NUMBER = 0x02, }; /* The SCSI read track information command descriptor block (CDB) */ typedef struct libsmdev_scsi_read_track_information_cdb libsmdev_scsi_read_track_information_cdb_t; struct libsmdev_scsi_read_track_information_cdb { /* The operation code */ uint8_t operation_code; /* The address type, flag and reserved bits * Bits: * 0 - 1 address type * 2 open flag * 3 - 7 reserved */ uint8_t address_type; /* The (track) offset * Contains a 32-bit big-endian value */ uint8_t offset[ 4 ]; /* Reserved */ uint8_t reserved; /* The size of the receive buffer (allocation length) * Contains a 16-bit big-endian value */ uint8_t receive_size[ 2 ]; /* The control byte */ uint8_t control; }; /* The SCSI ioctrl header */ typedef struct libsmdev_scsi_ioctrl_header libsmdev_scsi_ioctrl_header_t; struct libsmdev_scsi_ioctrl_header { /* The size of the request (input data) */ unsigned int request_size; /* The size out the response (output data) */ unsigned int response_size; /* The request/response data */ }; #define LIBSMDEV_SCSI_RESPONSE_SIZE_INQUIRY 96 #define LIBSMDEV_SCSI_SENSE_SIZE 32 int libsmdev_scsi_command( libcfile_file_t *device_file, uint8_t *command, size_t command_size, uint8_t *response, size_t response_size, uint8_t *sense, size_t sense_size, libcerror_error_t **error ); int libsmdev_scsi_ioctrl( libcfile_file_t *device_file, void *request_data, size_t request_data_size, libcerror_error_t **error ); ssize_t libsmdev_scsi_inquiry( libcfile_file_t *device_file, uint8_t inquiry_vital_product_data, uint8_t code_page, uint8_t *response, size_t response_size, libcerror_error_t **error ); ssize_t libsmdev_scsi_read_toc( libcfile_file_t *device_file, uint8_t format, uint8_t *response, size_t response_size, libcerror_error_t **error ); ssize_t libsmdev_scsi_read_disc_information( libcfile_file_t *device_file, uint8_t *response, size_t response_size, libcerror_error_t **error ); ssize_t libsmdev_scsi_read_track_information( libcfile_file_t *device_file, uint32_t offset, uint8_t *response, size_t response_size, libcerror_error_t **error ); int libsmdev_scsi_get_identifier( libcfile_file_t *device_file, libcerror_error_t **error ); int libsmdev_scsi_get_bus_type( libcfile_file_t *device_file, uint8_t *bus_type, libcerror_error_t **error ); int libsmdev_scsi_get_pci_bus_address( libcfile_file_t *device_file, uint8_t *pci_bus_address, size_t pci_bus_address_size, libcerror_error_t **error ); #endif /* defined( HAVE_SCSI_SG_H ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_SCSI_H ) */ libewf-20140807/libsmdev/libsmdev_handle.h0000664000175000017500000002272113443450064022436 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_INTERNAL_HANDLE_H ) #define _LIBSMDEV_INTERNAL_HANDLE_H #include #include #include "libsmdev_extern.h" #include "libsmdev_libcdata.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #include "libsmdev_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libsmdev_internal_handle libsmdev_internal_handle_t; struct libsmdev_internal_handle { /* The device filename */ system_character_t *filename; /* The device filename size */ size_t filename_size; /* The device file */ libcfile_file_t *device_file; /* The current offset */ off64_t offset; /* The number of bytes per sector */ uint32_t bytes_per_sector; /* Value to indicate the bytes per sector value was set */ uint8_t bytes_per_sector_set; /* The media size */ size64_t media_size; /* Value to indicate the media size value was set */ uint8_t media_size_set; /* The bus type */ uint8_t bus_type; /* The device type */ uint8_t device_type; /* Value to indicate if the device is removable */ uint8_t removable; /* The vendor string */ uint8_t vendor[ 64 ]; /* The model string */ uint8_t model[ 64 ]; /* The serial number string */ uint8_t serial_number[ 64 ]; /* The tracks array */ libcdata_array_t *tracks_array; /* The sessions array */ libcdata_array_t *sessions_array; /* The lead-outs array */ libcdata_array_t *lead_outs_array; /* Value to indicate the media information values were set */ uint8_t media_information_set; /* The number of read/write error retries */ uint8_t number_of_error_retries; /* The error granularity */ size_t error_granularity; /* The read/write error flags */ uint8_t error_flags; /* The read/write errors range list */ libcdata_range_list_t *errors_range_list; /* Value to indicate if abort was signalled */ int abort; }; LIBSMDEV_EXTERN \ int libsmdev_handle_initialize( libsmdev_handle_t **handle, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_free( libsmdev_handle_t **handle, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_signal_abort( libsmdev_handle_t *handle, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_open( libsmdev_handle_t *handle, const char *filename, int access_flags, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBSMDEV_EXTERN \ int libsmdev_handle_open_wide( libsmdev_handle_t *handle, const wchar_t *filename, int access_flags, libcerror_error_t **error ); #endif LIBSMDEV_EXTERN \ int libsmdev_handle_close( libsmdev_handle_t *handle, libcerror_error_t **error ); LIBSMDEV_EXTERN \ ssize_t libsmdev_handle_read_buffer( libsmdev_handle_t *handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ ssize_t libsmdev_handle_read_buffer_at_offset( libsmdev_handle_t *handle, uint8_t *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBSMDEV_EXTERN \ ssize_t libsmdev_handle_write_buffer( libsmdev_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ ssize_t libsmdev_handle_write_buffer_at_offset( libsmdev_handle_t *handle, const uint8_t *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBSMDEV_EXTERN \ off64_t libsmdev_handle_seek_offset( libsmdev_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_offset( libsmdev_handle_t *handle, off64_t *offset, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_filename_size( libsmdev_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_filename( libsmdev_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ); int libsmdev_handle_set_filename( libsmdev_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBSMDEV_EXTERN \ int libsmdev_handle_get_filename_size_wide( libsmdev_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_filename_wide( libsmdev_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); int libsmdev_handle_set_filename_wide( libsmdev_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ int libsmdev_internal_handle_determine_media_information( libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ); int libsmdev_handle_append_session( libsmdev_internal_handle_t *internal_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); int libsmdev_handle_append_lead_out( libsmdev_internal_handle_t *internal_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); int libsmdev_handle_append_track( libsmdev_internal_handle_t *internal_handle, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_media_size( libsmdev_handle_t *handle, size64_t *media_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_bytes_per_sector( libsmdev_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_media_type( libsmdev_handle_t *handle, uint8_t *media_type, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_bus_type( libsmdev_handle_t *handle, uint8_t *bus_type, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_utf8_information_value( libsmdev_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_utf16_information_value( libsmdev_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_number_of_sessions( libsmdev_handle_t *handle, int *number_of_sessions, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_session( libsmdev_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_number_of_tracks( libsmdev_handle_t *handle, int *number_of_tracks, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_track( libsmdev_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_number_of_error_retries( libsmdev_handle_t *handle, uint8_t *number_of_error_retries, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_set_number_of_error_retries( libsmdev_handle_t *handle, uint8_t number_of_error_retries, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_error_granularity( libsmdev_handle_t *handle, size_t *error_granularity, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_set_error_granularity( libsmdev_handle_t *handle, size_t error_granularity, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_error_flags( libsmdev_handle_t *handle, uint8_t *error_flags, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_set_error_flags( libsmdev_handle_t *handle, uint8_t error_flags, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_number_of_errors( libsmdev_handle_t *handle, int *number_of_errors, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_handle_get_error( libsmdev_handle_t *handle, int index, off64_t *offset, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_INTERNAL_HANDLE_H ) */ libewf-20140807/libsmdev/libsmdev_libcdata.h0000664000175000017500000000301613443450064022742 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2010-2019, 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( _LIBSMDEV_LIBCDATA_H ) #define _LIBSMDEV_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBSMDEV_LIBCDATA_H ) */ libewf-20140807/libsmdev/libsmdev_libcfile.h0000664000175000017500000000250513443450064022752 0ustar00lordyestalordyesta00000000000000/* * The internal libcfile header * * Copyright (C) 2010-2019, 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( _LIBSMDEV_LIBCFILE_H ) #define _LIBSMDEV_LIBCFILE_H #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile */ #if defined( HAVE_LOCAL_LIBCFILE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCFILE_DLL_IMPORT * before including libcfile.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCFILE_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libsmdev/libsmdev_usb.c0000664000175000017500000001423713443450064021772 0ustar00lordyestalordyesta00000000000000/* * USB functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #include #include #include /* Needed for _IOW amd _IOWR */ #if defined( HAVE_SYS_IOCTL_H ) #include #endif #if defined( HAVE_LINUX_USBDEVICE_FS_H ) #include #endif #if defined( HAVE_LINUX_USB_CH9_H ) #include #endif #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #include "libsmdev_libcnotify.h" #include "libsmdev_scsi.h" #include "libsmdev_usb.h" /* Timeout in milli seconds: 1 second */ #define LIBSMDEV_USB_CONTROL_COMMAND_TIMEOUT 1000 #if defined( HAVE_LINUX_USB_CH9_H ) #if defined( USBDEVFS_IOCTL ) /* Sends an USB ioctl to the file descriptor * Returns 1 if successful or -1 on error */ int libsmdev_usb_ioctl( libcfile_file_t *device_file, int interface_number, int request, void *request_data, libcerror_error_t **error ) { struct usbdevfs_ioctl ioctl_request; static char *function = "libsmdev_usb_ioctl"; ssize_t read_count = 0; ioctl_request.ifno = interface_number; ioctl_request.ioctl_code = request; ioctl_request.data = request_data; read_count = libcfile_file_io_control_read( device_file, USBDEVFS_IOCTL, NULL, 0, (uint8_t *) &ioctl_request, sizeof( struct usbdevfs_ioctl ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: USBDEVFS_IOCTL.", function ); return( -1 ); } return( 1 ); } #endif /* defined( USBDEVFS_IOCTL ) */ #if defined( USBDEVFS_CONTROL ) /* Sends a USB control command to the file descriptor * Returns 1 if successful or -1 on error */ int libsmdev_usb_control_command( libcfile_file_t *device_file, uint8_t request_type, uint8_t request, uint16_t value, uint16_t index, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { struct usbdevfs_ctrltransfer control_request; static char *function = "libsmdev_usb_control_command"; ssize_t read_count = 0; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } control_request.bRequestType = request_type; control_request.bRequest = request; control_request.wValue = value; control_request.wIndex = index; control_request.wLength = buffer_size; control_request.timeout = LIBSMDEV_USB_CONTROL_COMMAND_TIMEOUT; control_request.data = buffer; read_count = libcfile_file_io_control_read( device_file, USBDEVFS_CONTROL, NULL, 0, (uint8_t *) &control_request, sizeof( struct usbdevfs_ctrltransfer ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: USBDEVFS_CONTROL.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_print_data( buffer, buffer_size, 0 ); } #endif return( 1 ); } #endif /* defined( USBDEVFS_CONTROL ) */ #if defined( USBDEVFS_CONNECTINFO ) /* Sends a USB ioctl to the file descriptor * Returns 1 if successful or -1 on error */ int libsmdev_usb_test( libcfile_file_t *device_file, libcerror_error_t **error ) { struct usbdevfs_connectinfo connection_information; static char *function = "libsmdev_usb_test"; ssize_t read_count = 0; read_count = libcfile_file_io_control_read( device_file, USBDEVFS_CONNECTINFO, NULL, 0, (uint8_t *) &connection_information, sizeof( struct usbdevfs_connectinfo ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: USBDEVFS_CONNECTINFO.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_print_data( (uint8_t *) &connection_information, sizeof( struct usbdevfs_connectinfo ), 0 ); } #endif return( 1 ); } #endif /* #if defined( USBDEVFS_CONNECTINFO ) */ #ifdef TODO_TEST /* Sends a USB control command to the file descriptor * Returns 1 if successful or -1 on error */ int libsmdev_usb_test( libcfile_file_t *device_file, libcerror_error_t **error ) { uint8_t buffer[ 255 ]; struct usb_device_descriptor device_descriptor; static char *function = "libsmdev_usb_test"; if( libsmdev_usb_control_command( device_file, USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE, USB_REQ_GET_DESCRIPTOR, USB_DT_DEVICE << 8, 0, buffer, 255, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to send control command.", function ); return( -1 ); } return( 1 ); } #endif /* TODO_TEST */ #endif libewf-20140807/libsmdev/libsmdev_ata.h0000664000175000017500000000267413443450064021755 0ustar00lordyestalordyesta00000000000000/* * ATA/ATAPI functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #if !defined( _LIBSMDEV_ATA_H ) #define _LIBSMDEV_ATA_H #include #include #if defined( HAVE_CYGWIN_HDREG_H ) #include #endif #if defined( HAVE_LINUX_HDREG_H ) #include #endif #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HDIO_GET_IDENTITY ) int libsmdev_ata_get_device_configuration( libcfile_file_t *device_file, struct hd_driveid *device_configuration, libcerror_error_t **error ); #endif /* defined( HDIO_GET_IDENTITY ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_ATA_H ) */ libewf-20140807/libsmdev/Makefile.in0000664000175000017500000010747613443455350021230 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libsmdev ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsmdev_la_LIBADD = am__libsmdev_la_SOURCES_DIST = libsmdev_ata.c libsmdev_ata.h \ libsmdev_codepage.h libsmdev_debug.c libsmdev_debug.h \ libsmdev_definitions.h libsmdev_error.c libsmdev_error.h \ libsmdev_extern.h libsmdev_handle.c libsmdev_handle.h \ libsmdev_libcdata.h libsmdev_libcerror.h libsmdev_libcfile.h \ libsmdev_libclocale.h libsmdev_libcnotify.h libsmdev_libuna.h \ libsmdev_notify.c libsmdev_notify.h libsmdev_optical_disc.c \ libsmdev_optical_disc.h libsmdev_scsi.c libsmdev_scsi.h \ libsmdev_sector_range.c libsmdev_sector_range.h \ libsmdev_string.c libsmdev_string.h libsmdev_support.c \ libsmdev_support.h libsmdev_track_value.c \ libsmdev_track_value.h libsmdev_types.h libsmdev_unused.h \ libsmdev_usb.c libsmdev_usb.h @HAVE_LOCAL_LIBSMDEV_TRUE@am_libsmdev_la_OBJECTS = libsmdev_ata.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_debug.lo libsmdev_error.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_handle.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_notify.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_optical_disc.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_scsi.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_sector_range.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_string.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_support.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_track_value.lo \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_usb.lo libsmdev_la_OBJECTS = $(am_libsmdev_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBSMDEV_TRUE@am_libsmdev_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libsmdev_ata.Plo \ ./$(DEPDIR)/libsmdev_debug.Plo ./$(DEPDIR)/libsmdev_error.Plo \ ./$(DEPDIR)/libsmdev_handle.Plo \ ./$(DEPDIR)/libsmdev_notify.Plo \ ./$(DEPDIR)/libsmdev_optical_disc.Plo \ ./$(DEPDIR)/libsmdev_scsi.Plo \ ./$(DEPDIR)/libsmdev_sector_range.Plo \ ./$(DEPDIR)/libsmdev_string.Plo \ ./$(DEPDIR)/libsmdev_support.Plo \ ./$(DEPDIR)/libsmdev_track_value.Plo \ ./$(DEPDIR)/libsmdev_usb.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libsmdev_la_SOURCES) DIST_SOURCES = $(am__libsmdev_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBSMDEV_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBSMDEV_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBSMDEV_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_LOCAL_LIBSMDEV_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBSMDEV_TRUE@noinst_LTLIBRARIES = libsmdev.la @HAVE_LOCAL_LIBSMDEV_TRUE@libsmdev_la_SOURCES = \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_ata.c libsmdev_ata.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_codepage.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_debug.c libsmdev_debug.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_definitions.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_error.c libsmdev_error.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_extern.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_handle.c libsmdev_handle.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_libcdata.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_libcerror.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_libcfile.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_libclocale.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_libcnotify.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_libuna.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_notify.c libsmdev_notify.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_optical_disc.c libsmdev_optical_disc.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_scsi.c libsmdev_scsi.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_sector_range.c libsmdev_sector_range.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_string.c libsmdev_string.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_support.c libsmdev_support.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_track_value.c libsmdev_track_value.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_types.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_unused.h \ @HAVE_LOCAL_LIBSMDEV_TRUE@ libsmdev_usb.c libsmdev_usb.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsmdev/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libsmdev/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsmdev.la: $(libsmdev_la_OBJECTS) $(libsmdev_la_DEPENDENCIES) $(EXTRA_libsmdev_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libsmdev_la_rpath) $(libsmdev_la_OBJECTS) $(libsmdev_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_ata.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_optical_disc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_scsi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_sector_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_track_value.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsmdev_usb.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libsmdev_ata.Plo -rm -f ./$(DEPDIR)/libsmdev_debug.Plo -rm -f ./$(DEPDIR)/libsmdev_error.Plo -rm -f ./$(DEPDIR)/libsmdev_handle.Plo -rm -f ./$(DEPDIR)/libsmdev_notify.Plo -rm -f ./$(DEPDIR)/libsmdev_optical_disc.Plo -rm -f ./$(DEPDIR)/libsmdev_scsi.Plo -rm -f ./$(DEPDIR)/libsmdev_sector_range.Plo -rm -f ./$(DEPDIR)/libsmdev_string.Plo -rm -f ./$(DEPDIR)/libsmdev_support.Plo -rm -f ./$(DEPDIR)/libsmdev_track_value.Plo -rm -f ./$(DEPDIR)/libsmdev_usb.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libsmdev ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libsmdev_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libsmdev/libsmdev_libcerror.h0000664000175000017500000000264013443450064023164 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2010-2019, 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( _LIBSMDEV_LIBCERROR_H ) #define _LIBSMDEV_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBSMDEV_LIBCERROR_H ) */ libewf-20140807/libsmdev/libsmdev_sector_range.h0000664000175000017500000000407013443450064023653 0ustar00lordyestalordyesta00000000000000/* * Sector range functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_SECTOR_RANGE_H ) #define _LIBSMDEV_SECTOR_RANGE_H #include #include #include "libsmdev_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libsmdev_sector_range libsmdev_sector_range_t; struct libsmdev_sector_range { /* The start sector */ uint64_t start_sector; /* The end sector */ uint64_t end_sector; /* The number of sectors */ uint64_t number_of_sectors; }; int libsmdev_sector_range_initialize( libsmdev_sector_range_t **sector_range, libcerror_error_t **error ); int libsmdev_sector_range_free( libsmdev_sector_range_t **sector_range, libcerror_error_t **error ); int libsmdev_sector_range_clone( libsmdev_sector_range_t **destination_sector_range, libsmdev_sector_range_t *source_sector_range, libcerror_error_t **error ); int libsmdev_sector_range_get( libsmdev_sector_range_t *sector_range, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); int libsmdev_sector_range_set( libsmdev_sector_range_t *sector_range, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_SECTOR_RANGE_H ) */ libewf-20140807/libsmdev/libsmdev_codepage.h0000664000175000017500000000514113443450064022747 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_INTERNAL_CODEPAGE_H ) #define _LIBSMDEV_INTERNAL_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMDEV ) #include /* Define HAVE_LOCAL_LIBSMDEV for local use of libsmdev * The definitions in are copied here * for local use of libsmdev */ #else /* The codepage definitions */ enum LIBSMDEV_CODEPAGES { LIBSMDEV_CODEPAGE_ASCII = 20127, LIBSMDEV_CODEPAGE_ISO_8859_1 = 28591, LIBSMDEV_CODEPAGE_ISO_8859_2 = 28592, LIBSMDEV_CODEPAGE_ISO_8859_3 = 28593, LIBSMDEV_CODEPAGE_ISO_8859_4 = 28594, LIBSMDEV_CODEPAGE_ISO_8859_5 = 28595, LIBSMDEV_CODEPAGE_ISO_8859_6 = 28596, LIBSMDEV_CODEPAGE_ISO_8859_7 = 28597, LIBSMDEV_CODEPAGE_ISO_8859_8 = 28598, LIBSMDEV_CODEPAGE_ISO_8859_9 = 28599, LIBSMDEV_CODEPAGE_ISO_8859_10 = 28600, LIBSMDEV_CODEPAGE_ISO_8859_11 = 28601, LIBSMDEV_CODEPAGE_ISO_8859_13 = 28603, LIBSMDEV_CODEPAGE_ISO_8859_14 = 28604, LIBSMDEV_CODEPAGE_ISO_8859_15 = 28605, LIBSMDEV_CODEPAGE_ISO_8859_16 = 28606, LIBSMDEV_CODEPAGE_KOI8_R = 20866, LIBSMDEV_CODEPAGE_KOI8_U = 21866, LIBSMDEV_CODEPAGE_WINDOWS_874 = 874, LIBSMDEV_CODEPAGE_WINDOWS_932 = 932, LIBSMDEV_CODEPAGE_WINDOWS_936 = 936, LIBSMDEV_CODEPAGE_WINDOWS_949 = 949, LIBSMDEV_CODEPAGE_WINDOWS_950 = 950, LIBSMDEV_CODEPAGE_WINDOWS_1250 = 1250, LIBSMDEV_CODEPAGE_WINDOWS_1251 = 1251, LIBSMDEV_CODEPAGE_WINDOWS_1252 = 1252, LIBSMDEV_CODEPAGE_WINDOWS_1253 = 1253, LIBSMDEV_CODEPAGE_WINDOWS_1254 = 1254, LIBSMDEV_CODEPAGE_WINDOWS_1255 = 1255, LIBSMDEV_CODEPAGE_WINDOWS_1256 = 1256, LIBSMDEV_CODEPAGE_WINDOWS_1257 = 1257, LIBSMDEV_CODEPAGE_WINDOWS_1258 = 1258 }; #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_INTERNAL_CODEPAGE_H ) */ libewf-20140807/libsmdev/libsmdev_libuna.h0000664000175000017500000000331213443450064022450 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2010-2019, 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( _LIBSMDEV_LIBUNA_H ) #define _LIBSMDEV_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBSMDEV_LIBUNA_H ) */ libewf-20140807/libsmdev/libsmdev_scsi.c0000664000175000017500000006244413443450064022145 0ustar00lordyestalordyesta00000000000000/* * SCSI functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #include #include #include #include #include #if defined( HAVE_SCSI_SCSI_H ) #include #endif #if defined( HAVE_SCSI_SCSI_IOCTL_H ) #include #endif #if defined( HAVE_SCSI_SG_H ) #include #endif #include "libsmdev_definitions.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcnotify.h" #include "libsmdev_scsi.h" /* Timeout in milli seconds: 1 second */ #define LIBSMDEV_SCSI_CONTROL_COMMAND_TIMEOUT 1000 #if defined( HAVE_SCSI_SG_H ) /* Sends a SCSI command to the file descriptor * Returns 1 if successful or -1 on error */ int libsmdev_scsi_command( libcfile_file_t *device_file, uint8_t *command, size_t command_size, uint8_t *response, size_t response_size, uint8_t *sense, size_t sense_size, libcerror_error_t **error ) { struct sg_io_hdr sg_io_header; static char *function = "libsmdev_scsi_command"; ssize_t read_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( command == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid command.", function ); return( -1 ); } if( command_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid command size value exceeds maximum.", function ); return( -1 ); } if( response == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid response.", function ); return( -1 ); } if( response_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid response size value exceeds maximum.", function ); return( -1 ); } if( sense == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sense.", function ); return( -1 ); } if( sense_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sense size value exceeds maximum.", function ); return( -1 ); } if( memory_set( &sg_io_header, 0, sizeof( struct sg_io_hdr ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear SCSI SG IO header.", function ); return( -1 ); } sg_io_header.interface_id = 'S'; sg_io_header.cmdp = command; sg_io_header.cmd_len = command_size; sg_io_header.sbp = sense; sg_io_header.mx_sb_len = sense_size; sg_io_header.dxferp = response; sg_io_header.dxfer_len = response_size; sg_io_header.dxfer_direction = SG_DXFER_FROM_DEV; sg_io_header.timeout = LIBSMDEV_SCSI_CONTROL_COMMAND_TIMEOUT; read_count = libcfile_file_io_control_read( device_file, SG_IO, NULL, 0, (uint8_t *) &sg_io_header, sizeof( struct sg_io_hdr ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SG_IO.", function ); return( -1 ); } /* Check if command returned an error */ if( ( sg_io_header.info & SG_INFO_OK_MASK ) != SG_INFO_OK ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: error while querying device: scsi status: %X, host status: %X, driver status: %X.", function, sg_io_header.status, sg_io_header.host_status, sg_io_header.driver_status ); return( -1 ); } return( 1 ); } /* Sends a SCSI ioctl to the file descriptor * Returns 1 if successful or -1 on error */ int libsmdev_scsi_ioctrl( libcfile_file_t *device_file, void *request_data, size_t request_data_size, libcerror_error_t **error ) { uint8_t *ioctrl_request = 0; static char *function = "libsmdev_scsi_ioctrl"; size_t ioctrl_request_size = 0; ssize_t read_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } ioctrl_request_size = sizeof( libsmdev_scsi_ioctrl_header_t ) + request_data_size; ioctrl_request = (uint8_t *) memory_allocate( ioctrl_request_size ); if( ioctrl_request == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create SCSI ioctrl request.", function ); goto on_error; } if( memory_set( ioctrl_request, 0, ioctrl_request_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear SCSI ioctrl request.", function ); goto on_error; } ( (libsmdev_scsi_ioctrl_header_t *) ioctrl_request )->request_size = request_data_size; if( memory_copy( &( ioctrl_request[ sizeof( libsmdev_scsi_ioctrl_header_t ) ] ), request_data, request_data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set SCSI ioctrl request.", function ); goto on_error; } read_count = libcfile_file_io_control_read( device_file, SCSI_IOCTL_SEND_COMMAND, NULL, 0, ioctrl_request, ioctrl_request_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SCSI_IOCTL_SEND_COMMAND.", function ); goto on_error; } memory_free( ioctrl_request ); return( 1 ); on_error: if( ioctrl_request != NULL ) { memory_free( ioctrl_request ); } return( 1 ); } /* Sends a SCSI inquiry to the file descriptor * Returns the number of bytes read if successful or -1 on error */ ssize_t libsmdev_scsi_inquiry( libcfile_file_t *device_file, uint8_t inquiry_vital_product_data, uint8_t code_page, uint8_t *response, size_t response_size, libcerror_error_t **error ) { libsmdev_scsi_inquiry_cdb_t command; uint8_t sense[ LIBSMDEV_SCSI_SENSE_SIZE ]; static char *function = "libsmdev_scsi_inquiry"; ssize_t response_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( response == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid response.", function ); return( -1 ); } if( response_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid response size value exceeds maximum.", function ); return( -1 ); } if( memory_set( &command, 0, sizeof( libsmdev_scsi_inquiry_cdb_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear command.", function ); return( -1 ); } command.operation_code = LIBSMDEV_SCSI_OPERATION_CODE_INQUIRY; if( inquiry_vital_product_data != 0 ) { command.lun |= 0x01; command.reserved1 = code_page; } if( libsmdev_scsi_command( device_file, (uint8_t *) &command, sizeof( libsmdev_scsi_inquiry_cdb_t ), response, response_size, sense, LIBSMDEV_SCSI_SENSE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: SCSI INQUIRY command failed.", function ); return( -1 ); } /* In standard inquiry mode the additional size is in the 5th byte * in vital produce data inquiry mode it is in the 4th byte */ if( inquiry_vital_product_data == 0 ) { response_count = (ssize_t) ( response[ 4 ] + 5 ); } else { response_count = (ssize_t) ( response[ 3 ] + 4 ); } if( response_count > (ssize_t) response_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: response too small.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: response:\n", function ); libcnotify_print_data( response, response_count, 0 ); } #endif return( response_count ); } /* Sends a SCSI read table of contents (TOC) to the file descriptor * Returns the number of bytes read if successful or -1 on error */ ssize_t libsmdev_scsi_read_toc( libcfile_file_t *device_file, uint8_t format, uint8_t *response, size_t response_size, libcerror_error_t **error ) { libsmdev_scsi_read_toc_cdb_t command; uint8_t sense[ LIBSMDEV_SCSI_SENSE_SIZE ]; static char *function = "libsmdev_scsi_read_toc"; ssize_t response_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( response == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid response.", function ); return( -1 ); } if( response_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid response size value exceeds maximum.", function ); return( -1 ); } if( memory_set( &command, 0, sizeof( libsmdev_scsi_read_toc_cdb_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear command.", function ); return( -1 ); } command.operation_code = LIBSMDEV_SCSI_OPERATION_CODE_READ_TOC; command.format = format; byte_stream_copy_from_uint16_big_endian( command.receive_size, response_size ); if( libsmdev_scsi_command( device_file, (uint8_t *) &command, sizeof( libsmdev_scsi_read_toc_cdb_t ), response, response_size, sense, LIBSMDEV_SCSI_SENSE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: SCSI READ TOC command failed.", function ); return( -1 ); } byte_stream_copy_to_uint16_big_endian( response, response_count ); if( response_count > (ssize_t) response_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: response too small.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: response:\n", function ); libcnotify_print_data( response, response_count, 0 ); } #endif return( response_count ); } /* Sends a SCSI read disc information to the file descriptor * Returns the number of bytes read if successful or -1 on error */ ssize_t libsmdev_scsi_read_disc_information( libcfile_file_t *device_file, uint8_t *response, size_t response_size, libcerror_error_t **error ) { libsmdev_scsi_read_disc_information_cdb_t command; uint8_t sense[ LIBSMDEV_SCSI_SENSE_SIZE ]; static char *function = "libsmdev_scsi_read_disc_information"; ssize_t response_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( response == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid response.", function ); return( -1 ); } if( response_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid response size value exceeds maximum.", function ); return( -1 ); } if( memory_set( &command, 0, sizeof( libsmdev_scsi_read_disc_information_cdb_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear command.", function ); return( -1 ); } command.operation_code = LIBSMDEV_SCSI_OPERATION_CODE_READ_DISK_INFORMATION; byte_stream_copy_from_uint16_big_endian( command.receive_size, response_size ); if( libsmdev_scsi_command( device_file, (uint8_t *) &command, sizeof( libsmdev_scsi_read_disc_information_cdb_t ), response, response_size, sense, LIBSMDEV_SCSI_SENSE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: SCSI READ DISC INFORMATION command failed.", function ); return( -1 ); } byte_stream_copy_to_uint16_big_endian( response, response_count ); if( response_count > (ssize_t) response_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: response too small.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: response:\n", function ); libcnotify_print_data( response, response_count, 0 ); } #endif return( response_count ); } /* Sends a SCSI read track information to the file descriptor * Returns the number of bytes read if successful or -1 on error */ ssize_t libsmdev_scsi_read_track_information( libcfile_file_t *device_file, uint32_t offset, uint8_t *response, size_t response_size, libcerror_error_t **error ) { libsmdev_scsi_read_track_information_cdb_t command; uint8_t sense[ LIBSMDEV_SCSI_SENSE_SIZE ]; static char *function = "libsmdev_scsi_read_track_information"; ssize_t response_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( response == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid response.", function ); return( -1 ); } if( response_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid response size value exceeds maximum.", function ); return( -1 ); } if( memory_set( &command, 0, sizeof( libsmdev_scsi_read_track_information_cdb_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear command.", function ); return( -1 ); } command.operation_code = LIBSMDEV_SCSI_OPERATION_CODE_READ_TRACK_INFORMATION; command.address_type = LIBSMDEV_SCSI_TRACK_INFORMATION_ADDRESS_TYPE_LBA; byte_stream_copy_from_uint32_big_endian( command.offset, offset ); byte_stream_copy_from_uint16_big_endian( command.receive_size, response_size ); if( libsmdev_scsi_command( device_file, (uint8_t *) &command, sizeof( libsmdev_scsi_read_track_information_cdb_t ), response, response_size, sense, LIBSMDEV_SCSI_SENSE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: SCSI READ TRACK INFORMATION command failed.", function ); return( -1 ); } byte_stream_copy_to_uint16_big_endian( response, response_count ); if( response_count > (ssize_t) response_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: response too small.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: response:\n", function ); libcnotify_print_data( response, response_count, 0 ); } #endif return( response_count ); } /* Retrieves the SCSI identifier * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_scsi_get_identifier( libcfile_file_t *device_file, libcerror_error_t **error ) { #if defined( SG_GET_SCSI_ID ) struct libsmdev_scsi_identifier { int four_in_one; int host_unique_id; } identifier; #endif static char *function = "libsmdev_scsi_get_identifier"; ssize_t read_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } #if defined( SG_GET_SCSI_ID ) read_count = libcfile_file_io_control_read( device_file, SCSI_IOCTL_GET_IDLUN, NULL, 0, (uint8_t *) &identifier, sizeof( struct libsmdev_scsi_identifier ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SCSI_IOCTL_GET_IDLUN.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ libcerror_error_free( error ); return( 0 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: identifier:\n", function ); libcnotify_print_data( (uint8_t *) &identifier, sizeof( identifier ), 0 ); } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ return( 1 ); #else return( 0 ); #endif /* defined( SG_GET_SCSI_ID ) */ } /* Determines and retrieves the bus type * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_scsi_get_bus_type( libcfile_file_t *device_file, uint8_t *bus_type, libcerror_error_t **error ) { #if defined( SCSI_IOCTL_PROBE_HOST ) union { int length; char buffer[ 128 ]; } sg_probe_host; size_t sg_probe_host_length = 0; #endif static char *function = "libsmdev_scsi_get_bus_type"; ssize_t read_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( bus_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bus type.", function ); return( -1 ); } *bus_type = LIBSMDEV_BUS_TYPE_UNKNOWN; #if defined( SCSI_IOCTL_PROBE_HOST ) sg_probe_host.length = 127; read_count = libcfile_file_io_control_read( device_file, SCSI_IOCTL_PROBE_HOST, NULL, 0, (uint8_t *) &sg_probe_host, 128, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SCSI_IOCTL_PROBE_HOST.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ libcerror_error_free( error ); return( 0 ); } sg_probe_host.buffer[ 127 ] = 0; sg_probe_host_length = narrow_string_length( sg_probe_host.buffer ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: SCSI_IOCTL_PROBE_HOST (length: %d): %s\n", function, sg_probe_host_length, sg_probe_host.buffer ); libcnotify_printf( "\n" ); } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ *bus_type = 0; if( *bus_type == 0 ) { if( sg_probe_host_length >= 4 ) { if( narrow_string_compare( sg_probe_host.buffer, "ahci", 4 ) == 0 ) { *bus_type = LIBSMDEV_BUS_TYPE_ATA; } else if( narrow_string_compare( sg_probe_host.buffer, "pata", 4 ) == 0 ) { *bus_type = LIBSMDEV_BUS_TYPE_ATA; } else if( narrow_string_compare( sg_probe_host.buffer, "sata", 4 ) == 0 ) { *bus_type = LIBSMDEV_BUS_TYPE_ATA; } /* usb-storage */ else if( narrow_string_compare( sg_probe_host.buffer, "usb-", 4 ) == 0 ) { *bus_type = LIBSMDEV_BUS_TYPE_USB; } } } if( *bus_type == 0 ) { /* Serial Bus Protocol (SBP-2) */ if( sg_probe_host_length == 15 ) { if( narrow_string_compare( sg_probe_host.buffer, "SBP-2 IEEE-1394", 15 ) == 0 ) { *bus_type = LIBSMDEV_BUS_TYPE_FIREWIRE; } } else if( sg_probe_host_length == 43 ) { if( narrow_string_compare( sg_probe_host.buffer, "SCSI emulation for USB Mass Storage devices", 43 ) == 0 ) { *bus_type = LIBSMDEV_BUS_TYPE_USB; } } } return( 1 ); #else return( 0 ); #endif /* defined( SCSI_IOCTL_PROBE_HOST ) */ } #if !defined( SCSI_IOCTL_GET_PCI ) #define SCSI_IOCTL_GET_PCI 0x5387 #endif /* Determines and retrieves the PCI bus address * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_scsi_get_pci_bus_address( libcfile_file_t *device_file, uint8_t *pci_bus_address, size_t pci_bus_address_size, libcerror_error_t **error ) { static char *function = "libsmdev_scsi_get_pci_bus_address"; ssize_t read_count = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( pci_bus_address == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid PCI bus address.", function ); return( -1 ); } if( pci_bus_address_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid PCI bus address size value exceeds maximum.", function ); return( -1 ); } if( pci_bus_address_size <= 8 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid PCI bus address size value too small.", function ); return( -1 ); } if( memory_set( pci_bus_address, 0, pci_bus_address_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear PCI bus address.", function ); return( -1 ); } read_count = libcfile_file_io_control_read( device_file, SCSI_IOCTL_GET_PCI, NULL, 0, pci_bus_address, pci_bus_address_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: SCSI_IOCTL_GET_PCI.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ libcerror_error_free( error ); return( 0 ); } pci_bus_address[ pci_bus_address_size - 1 ] = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: SCSI_IOCTL_GET_PCI: %s\n", function, pci_bus_address ); libcnotify_printf( "\n" ); } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ return( 1 ); } #endif /* defined( HAVE_SCSI_SG_H ) */ libewf-20140807/libsmdev/libsmdev_track_value.c0000664000175000017500000001706613443450064023504 0ustar00lordyestalordyesta00000000000000/* * Track value functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libsmdev_definitions.h" #include "libsmdev_libcerror.h" #include "libsmdev_track_value.h" /* Creates a track value * Make sure the value track_value is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libsmdev_track_value_initialize( libsmdev_track_value_t **track_value, libcerror_error_t **error ) { static char *function = "libsmdev_track_value_initialize"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( *track_value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid track value value already set.", function ); return( -1 ); } *track_value = memory_allocate_structure( libsmdev_track_value_t ); if( *track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create track value.", function ); goto on_error; } if( memory_set( *track_value, 0, sizeof( libsmdev_track_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear track value.", function ); goto on_error; } return( 1 ); on_error: if( *track_value != NULL ) { memory_free( *track_value ); *track_value = NULL; } return( -1 ); } /* Frees a track value * Returns 1 if successful or -1 on error */ int libsmdev_track_value_free( libsmdev_track_value_t **track_value, libcerror_error_t **error ) { static char *function = "libsmdev_track_value_free"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( *track_value != NULL ) { memory_free( *track_value ); *track_value = NULL; } return( 1 ); } /* Retrieves a track value * Returns 1 if successful or -1 on error */ int libsmdev_track_value_get( libsmdev_track_value_t *track_value, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, libcerror_error_t **error ) { static char *function = "libsmdev_track_value_get"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( start_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid start sector.", function ); return( -1 ); } if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sectors.", function ); return( -1 ); } if( type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type.", function ); return( -1 ); } *start_sector = track_value->start_sector; *number_of_sectors = track_value->number_of_sectors; *type = track_value->type; return( 1 ); } /* Sets a track value * Returns 1 if successful or -1 on error */ int libsmdev_track_value_set( libsmdev_track_value_t *track_value, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, libcerror_error_t **error ) { static char *function = "libsmdev_track_value_set"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( start_sector > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid start sector value exceeds maximum.", function ); return( -1 ); } if( number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } if( ( type != LIBSMDEV_TRACK_TYPE_UNKNOWN ) && ( type != LIBSMDEV_TRACK_TYPE_AUDIO ) && ( type != LIBSMDEV_TRACK_TYPE_CDG ) && ( type != LIBSMDEV_TRACK_TYPE_MODE1_2048 ) && ( type != LIBSMDEV_TRACK_TYPE_MODE1_2352 ) && ( type != LIBSMDEV_TRACK_TYPE_MODE2_2048 ) && ( type != LIBSMDEV_TRACK_TYPE_MODE2_2324 ) && ( type != LIBSMDEV_TRACK_TYPE_MODE2_2336 ) && ( type != LIBSMDEV_TRACK_TYPE_MODE2_2352 ) && ( type != LIBSMDEV_TRACK_TYPE_CDI_2336 ) && ( type != LIBSMDEV_TRACK_TYPE_CDI_2352 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported type.", function ); return( -1 ); } switch( type ) { case LIBSMDEV_TRACK_TYPE_MODE1_2048: case LIBSMDEV_TRACK_TYPE_MODE2_2048: track_value->bytes_per_sector = 2048; break; case LIBSMDEV_TRACK_TYPE_MODE2_2324: track_value->bytes_per_sector = 2324; break; case LIBSMDEV_TRACK_TYPE_MODE2_2336: case LIBSMDEV_TRACK_TYPE_CDI_2336: track_value->bytes_per_sector = 2336; break; case LIBSMDEV_TRACK_TYPE_AUDIO: case LIBSMDEV_TRACK_TYPE_MODE1_2352: case LIBSMDEV_TRACK_TYPE_MODE2_2352: case LIBSMDEV_TRACK_TYPE_CDI_2352: track_value->bytes_per_sector = 2352; break; case LIBSMDEV_TRACK_TYPE_CDG: track_value->bytes_per_sector = 2448; break; } track_value->start_sector = start_sector; track_value->end_sector = start_sector + number_of_sectors; track_value->number_of_sectors = number_of_sectors; track_value->type = type; return( 1 ); } /* Retrieves the bytes per sector * Returns 1 if successful or -1 on error */ int libsmdev_track_value_get_bytes_per_sector( libsmdev_track_value_t *track_value, uint32_t *bytes_per_sector, libcerror_error_t **error ) { static char *function = "libsmdev_track_value_get_bytes_per_sector"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( bytes_per_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } *bytes_per_sector = track_value->bytes_per_sector; return( 1 ); } libewf-20140807/libsmdev/libsmdev_support.h0000664000175000017500000000362713443450064022723 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_SUPPORT_H ) #define _LIBSMDEV_SUPPORT_H #include #include #include "libsmdev_extern.h" #include "libsmdev_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBSMDEV ) LIBSMDEV_EXTERN \ const char *libsmdev_get_version( void ); LIBSMDEV_EXTERN \ int libsmdev_get_access_flags_read( void ); LIBSMDEV_EXTERN \ int libsmdev_get_access_flags_read_write( void ); LIBSMDEV_EXTERN \ int libsmdev_get_access_flags_write( void ); LIBSMDEV_EXTERN \ int libsmdev_get_codepage( int *codepage, libcerror_error_t **error ); LIBSMDEV_EXTERN \ int libsmdev_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ LIBSMDEV_EXTERN \ int libsmdev_check_device( const char *filename, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBSMDEV_EXTERN \ int libsmdev_check_device_wide( const wchar_t *filename, libcerror_error_t **error ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_SUPPORT_H ) */ libewf-20140807/libsmdev/libsmdev_types.h0000664000175000017500000000274113443450064022347 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_INTERNAL_TYPES_H ) #define _LIBSMDEV_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBSMDEV for local use of libsmdev * The definitions in are copied here * for local use of libsmdev */ #if defined( HAVE_LOCAL_LIBSMDEV ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libsmdev_handle {} libsmdev_handle_t; #else typedef intptr_t libsmdev_handle_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBSMDEV ) */ #endif /* !defined( _LIBSMDEV_INTERNAL_TYPES_H ) */ libewf-20140807/libsmdev/libsmdev_debug.c0000664000175000017500000000430713443450064022264 0ustar00lordyestalordyesta00000000000000/* * Debug functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include "libsmdev_debug.h" #if defined( HAVE_DEBUG_OUTPUT ) /* Prints a description of the device type */ const char *libsmdev_debug_print_device_type( uint8_t device_type ) { switch( device_type ) { case 0x00: return( "Direct access" ); case 0x01: return( "Sequential access" ); case 0x02: return( "Printer" ); case 0x03: return( "Processor" ); case 0x04: return( "Write-once" ); case 0x05: return( "Optical disk (CD/DVD/BD)" ); case 0x06: return( "Scanner" ); case 0x07: return( "Optical memory" ); case 0x08: return( "Medium changer" ); case 0x09: return( "Communications" ); case 0x0a: case 0x0b: return( "Graphic arts pre-press" ); case 0x0c: return( "Storage array controller" ); case 0x0d: return( "Enclosure services" ); case 0x0e: return( "Simplified direct-access" ); case 0x0f: return( "Optical card reader/writer" ); case 0x10: return( "Bridging expander" ); case 0x11: return( "Object-based Storage" ); case 0x12: return( "Automation/Drive Interface" ); case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x1a: case 0x1b: case 0x1c: case 0x1d: return( "Reserved" ); case 0x1e: return( "Well known logical unit" ); default: break; } return( "Unknown" ); } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ libewf-20140807/libsmdev/libsmdev_optical_disc.c0000664000175000017500000010131113443450064023624 0ustar00lordyestalordyesta00000000000000/* * Optical disk functions * * Copyright (C) 2010-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * * This program 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 program 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 program. If not, see . */ #include #include #include #include #if defined( HAVE_LINUX_CDROM_H ) #include #endif #include "libsmdev_definitions.h" #include "libsmdev_handle.h" #include "libsmdev_libcdata.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #include "libsmdev_libcnotify.h" #include "libsmdev_optical_disc.h" #include "libsmdev_sector_range.h" #include "libsmdev_scsi.h" #include "libsmdev_track_value.h" #if defined( HAVE_LINUX_CDROM_H ) #define libsmdev_optical_disc_copy_absolute_msf_to_lba( minutes, seconds, frames, lba ) \ lba = minutes; \ lba *= CD_SECS; \ lba += seconds; \ lba *= CD_FRAMES; \ lba += frames; #define libsmdev_optical_disc_copy_msf_to_lba( minutes, seconds, frames, lba ) \ lba = minutes; \ lba *= CD_SECS; \ lba += seconds; \ lba *= CD_FRAMES; \ lba += frames; \ lba -= CD_MSF_OFFSET; /* Retrieves the table of contents (toc) from the optical disk * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_optical_disc_get_table_of_contents( libcfile_file_t *device_file, libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ) { static char *function = "libsmdev_optical_disc_get_table_of_contents"; int result = 0; result = libsmdev_optical_disc_get_table_of_contents_scsi( device_file, internal_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve table of contents using SCSI commands.", function ); return( -1 ); } else if( result == 0 ) { result = libsmdev_optical_disc_get_table_of_contents_ioctl( device_file, internal_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve table of contents using IO control.", function ); return( -1 ); } } return( result ); } /* Retrieves the table of contents from the optical disk using IOCTL * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_optical_disc_get_table_of_contents_ioctl( libcfile_file_t *device_file, libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ) { struct cdrom_tochdr toc_header; struct cdrom_tocentry toc_entry; static char *function = "libsmdev_optical_disc_get_table_of_contents_ioctl"; ssize_t read_count = 0; uint32_t last_session_size = 0; uint32_t last_session_offset = 0; uint32_t last_track_size = 0; uint32_t last_track_offset = 0; uint32_t offset = 0; uint16_t entry_index = 0; uint8_t first_entry = 0; uint8_t last_entry = 0; uint8_t last_track_type = 0; uint8_t session_index = 0; uint8_t track_index = 0; uint8_t track_type = 0; int result = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } read_count = libcfile_file_io_control_read( device_file, CDROMREADTOCHDR, NULL, 0, (uint8_t *) &toc_header, sizeof( struct cdrom_tochdr ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: CDROMREADTOCHDR.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); return( 0 ); } first_entry = toc_header.cdth_trk0; last_entry = toc_header.cdth_trk1; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of entries\t: %" PRIu8 "\n", function, last_entry ); } #endif for( entry_index = (uint16_t) first_entry; entry_index <= (uint16_t) last_entry; entry_index++ ) { if( memory_set( &toc_entry, 0, sizeof( struct cdrom_tocentry ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear TOC entry.", function ); goto on_error; } toc_entry.cdte_track = (uint8_t) entry_index; toc_entry.cdte_format = CDROM_LBA; read_count = libcfile_file_io_control_read( device_file, CDROMREADTOCENTRY, NULL, 0, (uint8_t *) &toc_entry, sizeof( struct cdrom_tocentry ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: CDROMREADTOCENTRY.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); break; } if( toc_entry.cdte_format == CDROM_LBA ) { offset = (uint32_t) toc_entry.cdte_addr.lba; } else if( toc_entry.cdte_format == CDROM_MSF ) { libsmdev_optical_disc_copy_msf_to_lba( toc_entry.cdte_addr.msf.minute, toc_entry.cdte_addr.msf.second, toc_entry.cdte_addr.msf.frame, offset ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported CDTE format.", function ); goto on_error; } if( ( toc_entry.cdte_ctrl & CDROM_DATA_TRACK ) == 0 ) { track_type = LIBSMDEV_TRACK_TYPE_AUDIO; } else { track_type = LIBSMDEV_TRACK_TYPE_MODE1_2048; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: entry: %" PRIu16 "", function, entry_index ); if( ( toc_entry.cdte_ctrl & CDROM_DATA_TRACK ) == 0 ) { libcnotify_printf( " (audio)" ); } else { libcnotify_printf( " (data)" ); } if( toc_entry.cdte_format == CDROM_LBA ) { libcnotify_printf( " start\t: %" PRIu32 "", toc_entry.cdte_addr.lba ); } else if( toc_entry.cdte_format == CDROM_MSF ) { libcnotify_printf( " start\t: %02" PRIu8 ":%02" PRIu8 ".%02" PRIu8 "", toc_entry.cdte_addr.msf.minute, toc_entry.cdte_addr.msf.second, toc_entry.cdte_addr.msf.frame ); } libcnotify_printf( " (offset: %" PRIu32 ")\n", offset ); } #endif if( entry_index > first_entry ) { if( ( offset < last_track_offset ) || ( offset < last_session_offset ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); goto on_error; } last_track_size = offset - last_track_offset; if( ( last_track_type == LIBSMDEV_TRACK_TYPE_MODE1_2048 ) || ( last_track_type != track_type ) ) { if( session_index == 0 ) { if( last_track_size < 11400 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid last track size value out of bounds.", function ); goto on_error; } last_track_size -= 11400; } else { if( last_track_size < 6900 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid last track size value out of bounds.", function ); goto on_error; } last_track_size -= 6900; } } if( libsmdev_handle_append_track( internal_handle, last_track_offset, last_track_size, last_track_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track: %" PRIu8 ".", function, track_index ); goto on_error; } track_index++; if( ( last_track_type == LIBSMDEV_TRACK_TYPE_MODE1_2048 ) || ( last_track_type != track_type ) ) { last_session_size = offset - last_session_offset; if( libsmdev_handle_append_session( internal_handle, last_session_offset, last_session_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session: %" PRIu8 ".", function, session_index ); goto on_error; } session_index++; last_session_offset = offset; } } last_track_offset = offset; last_track_type = track_type; } if( read_count != -1 ) { if( memory_set( &toc_entry, 0, sizeof( struct cdrom_tocentry ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear TOC entry.", function ); goto on_error; } toc_entry.cdte_track = CDROM_LEADOUT; toc_entry.cdte_format = CDROM_LBA; read_count = libcfile_file_io_control_read( device_file, CDROMREADTOCENTRY, NULL, 0, (uint8_t *) &toc_entry, sizeof( struct cdrom_tocentry ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: CDROMREADTOCENTRY.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { if( toc_entry.cdte_format == CDROM_LBA ) { offset = (uint32_t) toc_entry.cdte_addr.lba; } else if( toc_entry.cdte_format == CDROM_MSF ) { libsmdev_optical_disc_copy_msf_to_lba( toc_entry.cdte_addr.msf.minute, toc_entry.cdte_addr.msf.second, toc_entry.cdte_addr.msf.frame, offset ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported CDTE format.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\tLead out" ); if( ( toc_entry.cdte_ctrl & CDROM_DATA_TRACK ) == 0 ) { libcnotify_printf( " (audio)" ); } else { libcnotify_printf( " (data)" ); } if( toc_entry.cdte_format == CDROM_LBA ) { libcnotify_printf( " start:\t%" PRIu32 "", toc_entry.cdte_addr.lba ); } else if( toc_entry.cdte_format == CDROM_MSF ) { libcnotify_printf( " start:\t%02" PRIu8 ":%02" PRIu8 ".02%" PRIu8 "", toc_entry.cdte_addr.msf.minute, toc_entry.cdte_addr.msf.second, toc_entry.cdte_addr.msf.frame ); } libcnotify_printf( " (offset: %" PRIu32 ")\n\n", offset ); } #endif if( ( offset < last_track_offset ) || ( offset < last_session_offset ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); goto on_error; } last_track_size = offset - last_track_offset; if( libsmdev_handle_append_track( internal_handle, last_track_offset, last_track_size, last_track_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append last track: %" PRIu8 ".", function, track_index ); goto on_error; } last_session_size = offset - last_session_offset; if( libsmdev_handle_append_session( internal_handle, last_session_offset, last_session_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session: %" PRIu8 ".", function, session_index ); goto on_error; } result = 1; } } if( result == 0 ) { if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } } return( result ); on_error: libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, NULL ); libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, NULL ); return( -1 ); } /* Retrieves the table of contents from the optical disk using the SCSI READ TOC command * Returns 1 if successful, 0 if not or -1 on error */ int libsmdev_optical_disc_get_table_of_contents_scsi( libcfile_file_t *device_file, libsmdev_internal_handle_t *internal_handle, libcerror_error_t **error ) { uint8_t track_info_data[ 64 ]; uint8_t *toc_data = NULL; uint8_t *toc_entries = NULL; static char *function = "libsmdev_optical_disc_get_table_of_contents_scsi"; void *reallocation = NULL; size_t toc_data_offset = 0; size_t toc_data_size = 0; ssize_t read_count = 0; uint32_t lead_out_size = 0; uint32_t lead_out_offset = 0; uint32_t last_track_offset = 0; uint32_t track_offset = 0; uint32_t session_size = 0; uint32_t session_offset = 0; uint32_t next_session_offset = 0; uint16_t entry_index = 0; uint8_t first_track_number = 0; uint8_t last_track_number = 0; uint8_t lead_out_index = 0; uint8_t number_of_sessions = 0; uint8_t session_index = 0; uint8_t track_index = 0; uint8_t track_number = 0; uint8_t track_type = 0; int result = 0; if( device_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device file.", function ); return( -1 ); } if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } toc_data_size = 1024; toc_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * toc_data_size ); if( toc_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create TOC data.", function ); goto on_error; } if( memory_set( toc_data, 0, sizeof( uint8_t ) * toc_data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear TOC data.", function ); goto on_error; } read_count = libsmdev_scsi_read_toc( device_file, LIBSMDEV_SCSI_TOC_CDB_FORMAT_RAW_TOC, toc_data, toc_data_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve TOC.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); byte_stream_copy_to_uint16_big_endian( toc_data, toc_data_size ); if( toc_data_size > 1024 ) { reallocation = memory_reallocate( toc_data, sizeof( uint8_t ) * toc_data_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize TOC data.", function ); goto on_error; } toc_data = (uint8_t *) reallocation; read_count = libsmdev_scsi_read_toc( device_file, LIBSMDEV_SCSI_TOC_CDB_FORMAT_RAW_TOC, toc_data, toc_data_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve TOC.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } } } toc_data_size = (size_t) read_count; if( toc_data_size > 4 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: header:\n", function ); libcnotify_print_data( toc_data, 4, 0 ); } #endif number_of_sessions = (uint16_t) toc_data[ 3 ]; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of sessions\t\t\t: %" PRIu8 "\n", function, number_of_sessions ); libcnotify_printf( "\n" ); } #endif toc_entries = &( toc_data[ 4 ] ); toc_data_offset = 4; while( toc_data_offset < (size_t) toc_data_size ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: entry: %02" PRIu16 ":\n", function, entry_index ); libcnotify_print_data( toc_entries, 11, 0 ); } #endif if( toc_entries[ 3 ] <= 0x63 ) { libsmdev_optical_disc_copy_msf_to_lba( toc_entries[ 8 ], toc_entries[ 9 ], toc_entries[ 10 ], track_offset ); } else if( toc_entries[ 3 ] == 0xa0 ) { first_track_number = toc_entries[ 8 ]; } else if( toc_entries[ 3 ] == 0xa1 ) { last_track_number = toc_entries[ 8 ]; } else if( toc_entries[ 3 ] == 0xa2 ) { libsmdev_optical_disc_copy_msf_to_lba( toc_entries[ 8 ], toc_entries[ 9 ], toc_entries[ 10 ], lead_out_offset ); } else if( toc_entries[ 3 ] == 0xb0 ) { libsmdev_optical_disc_copy_absolute_msf_to_lba( toc_entries[ 4 ], toc_entries[ 5 ], toc_entries[ 6 ], next_session_offset ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( toc_entries[ 3 ] <= 0x63 ) { libcnotify_printf( "%s: session: %02" PRIu16 " track: %02" PRIu8 "\t\t\t: %02" PRIu8 ":%02" PRIu8 ".%02" PRIu8 " (offset: %" PRIu32 ")\n", function, toc_entries[ 0 ], toc_entries[ 3 ], toc_entries[ 4 ], toc_entries[ 5 ], toc_entries[ 6 ], track_offset ); } else if( toc_entries[ 3 ] == 0xa0 ) { libcnotify_printf( "%s: session: %02" PRIu8 " first track number\t: %" PRIu8 "\n", function, toc_entries[ 0 ], first_track_number ); } else if( toc_entries[ 3 ] == 0xa1 ) { libcnotify_printf( "%s: session: %02" PRIu8 " last track number\t\t: %" PRIu8 "\n", function, toc_entries[ 0 ], last_track_number ); } else if( toc_entries[ 3 ] == 0xa2 ) { libcnotify_printf( "%s: session: %02" PRIu8 " lead out\t\t\t: %02" PRIu8 ":%02" PRIu8 ".%02" PRIu8 " (offset: %" PRIu32 ")\n", function, toc_entries[ 0 ], toc_entries[ 8 ], toc_entries[ 9 ], toc_entries[ 10 ], lead_out_offset ); } else if( toc_entries[ 3 ] == 0xb0 ) { libcnotify_printf( "%s: session: %02" PRIu16 " end\t\t\t: %02" PRIu8 ":%02" PRIu8 ".%02" PRIu8 " (offset: %" PRIu32 ")\n", function, toc_entries[ 0 ], toc_entries[ 4 ], toc_entries[ 5 ], toc_entries[ 6 ], next_session_offset ); } libcnotify_printf( "\n" ); } #endif if( ( toc_entries[ 3 ] <= 0x63 ) || ( toc_entries[ 3 ] == 0xb0 ) ) { if( track_number >= first_track_number ) { if( toc_entries[ 3 ] == 0xb0 ) { track_offset = lead_out_offset; } if( track_offset < last_track_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track offset value out of bounds.", function ); goto on_error; } if( ( track_index + 1 ) != track_number ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track number value out of bounds.", function ); goto on_error; } if( toc_entries[ 3 ] == 0xa2 ) { if( track_number != last_track_number ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track number value out of bounds.", function ); goto on_error; } } if( memory_set( track_info_data, 0, 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear track info data.", function ); goto on_error; } read_count = libsmdev_scsi_read_track_information( device_file, last_track_offset, track_info_data, 64, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track info data: %d.", function, track_index ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); break; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: track information data: %d:\n", function, track_index ); libcnotify_print_data( track_info_data, (size_t) read_count, 0 ); } #endif if( track_info_data[ 2 ] != toc_entries[ 0 ] ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track information data - session number value out of bounds.", function ); goto on_error; } if( track_info_data[ 3 ] != track_number ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track information data - track number value out of bounds.", function ); goto on_error; } track_type = LIBSMDEV_TRACK_TYPE_UNKNOWN; if( ( track_info_data[ 5 ] & 0x04 ) != 0 ) { if( ( track_info_data[ 5 ] & 0x08 ) == 0 ) { if( ( track_info_data[ 6 ] & 0x0f ) == 1 ) { track_type = LIBSMDEV_TRACK_TYPE_MODE1_2048; } else if( ( track_info_data[ 6 ] & 0x0f ) == 2 ) { track_type = LIBSMDEV_TRACK_TYPE_MODE2_2048; } } } else { track_type = LIBSMDEV_TRACK_TYPE_AUDIO; } if( libsmdev_handle_append_track( internal_handle, last_track_offset, track_offset - last_track_offset, track_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track: %d.", function, track_index ); goto on_error; } track_index++; } last_track_offset = track_offset; if( toc_entries[ 3 ] != 0xb0 ) { track_number = toc_entries[ 3 ]; } } if( toc_entries[ 3 ] == 0xb0 ) { if( session_offset >= next_session_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid session offset value out of bounds.", function ); goto on_error; } if( ( session_index + 1 ) != toc_entries[ 0 ] ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid session number value out of bounds.", function ); goto on_error; } lead_out_size = 0; if( ( lead_out_offset >= session_offset ) && ( lead_out_offset < next_session_offset ) ) { lead_out_size = next_session_offset - lead_out_offset; if( libsmdev_handle_append_lead_out( internal_handle, lead_out_offset, lead_out_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead_out: %d.", function, lead_out_index ); goto on_error; } lead_out_index++; } session_size = next_session_offset - session_offset; if( ( session_index + 1 ) == number_of_sessions ) { session_size -= lead_out_size; } if( libsmdev_handle_append_session( internal_handle, session_offset, session_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session: %d.", function, session_index ); goto on_error; } session_offset = next_session_offset; session_index++; } toc_entries += 11; toc_data_offset += 11; entry_index++; } if( ( track_index + 1 ) == track_number ) { if( track_offset < last_track_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track offset value out of bounds.", function ); goto on_error; } if( memory_set( track_info_data, 0, 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear track info data.", function ); goto on_error; } read_count = libsmdev_scsi_read_track_information( device_file, last_track_offset, track_info_data, 64, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track info data: %d.", function, track_index ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: track information data: %d:\n", function, track_index ); libcnotify_print_data( track_info_data, (size_t) read_count, 0 ); } #endif if( track_info_data[ 2 ] != toc_entries[ 0 ] ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track information data - session number value out of bounds.", function ); goto on_error; } if( track_info_data[ 3 ] != toc_entries[ 3 ] ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track information data - track number value out of bounds.", function ); goto on_error; } track_type = LIBSMDEV_TRACK_TYPE_UNKNOWN; if( ( track_info_data[ 5 ] & 0x04 ) != 0 ) { if( ( track_info_data[ 5 ] & 0x08 ) == 0 ) { if( ( track_info_data[ 6 ] & 0x0f ) == 1 ) { track_type = LIBSMDEV_TRACK_TYPE_MODE1_2048; } else if( ( track_info_data[ 6 ] & 0x0f ) == 2 ) { track_type = LIBSMDEV_TRACK_TYPE_MODE2_2048; } } } else { track_type = LIBSMDEV_TRACK_TYPE_AUDIO; } if( libsmdev_handle_append_track( internal_handle, last_track_offset, track_offset - last_track_offset, track_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append last track: %d.", function, track_index ); goto on_error; } } if( session_index != number_of_sessions ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid session index value out of bounds.", function ); goto on_error; } result = 1; } } if( result == 0 ) { if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty lead outs array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } } memory_free( toc_data ); toc_data = NULL; return( result ); on_error: if( toc_data != NULL ) { memory_free( toc_data ); } libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_track_value_free, NULL ); libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, NULL ); libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libsmdev_sector_range_free, NULL ); return( -1 ); } #endif /* defined( HAVE_LINUX_CDROM_H ) */ libewf-20140807/libsmdev/libsmdev_notify.c0000664000175000017500000000530413443450064022504 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libsmdev_libcerror.h" #include "libsmdev_libcnotify.h" #include "libsmdev_notify.h" #if !defined( HAVE_LOCAL_LIBSMDEV ) /* Sets the verbose notification */ void libsmdev_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libsmdev_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libsmdev_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libsmdev_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libsmdev_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libsmdev_notify_stream_close( libcerror_error_t **error ) { static char *function = "libsmdev_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ libewf-20140807/libsmdev/libsmdev_extern.h0000664000175000017500000000240613443450064022506 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2019, 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( _LIBSMDEV_INTERNAL_EXTERN_H ) #define _LIBSMDEV_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBSMDEV for local use of libsmdev */ #if !defined( HAVE_LOCAL_LIBSMDEV ) #include #define LIBSMDEV_EXTERN_VARIABLE LIBSMDEV_EXTERN #else #define LIBSMDEV_EXTERN /* extern */ #define LIBSMDEV_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ #endif /* !defined( _LIBSMDEV_INTERNAL_EXTERN_H ) */ libewf-20140807/libsmdev/libsmdev_support.c0000664000175000017500000001552113443450064022712 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #if defined( HAVE_SYS_STAT_H ) #include #endif #if defined( HAVE_FCNTL_H ) #include #endif #if defined( HAVE_UNISTD_H ) #include #endif #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif #include "libsmdev_definitions.h" #include "libsmdev_handle.h" #include "libsmdev_libcerror.h" #include "libsmdev_libcfile.h" #include "libsmdev_libclocale.h" #include "libsmdev_libuna.h" #include "libsmdev_support.h" #if !defined( HAVE_LOCAL_LIBSMDEV ) /* Returns the library version */ const char *libsmdev_get_version( void ) { return( (const char *) LIBSMDEV_VERSION_STRING ); } /* Returns the access flags for reading */ int libsmdev_get_access_flags_read( void ) { return( (int) LIBSMDEV_ACCESS_FLAG_READ ); } /* Returns the access flags for reading and writing */ int libsmdev_get_access_flags_read_write( void ) { return( (int) ( LIBSMDEV_ACCESS_FLAG_READ | LIBSMDEV_ACCESS_FLAG_WRITE ) ); } /* Returns the access flags for writing */ int libsmdev_get_access_flags_write( void ) { return( (int) LIBSMDEV_ACCESS_FLAG_WRITE ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libsmdev_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libsmdev_get_codepage"; if( libclocale_codepage_get( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libsmdev_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libsmdev_set_codepage"; if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBSMDEV ) */ /* Determines if a file is a device * Returns 1 if true, 0 if not or -1 on error */ int libsmdev_check_device( const char *filename, libcerror_error_t **error ) { libcfile_file_t *file = NULL; static char *function = "libsmdev_check_device"; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libcfile_file_initialize( &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file.", function ); goto on_error; } if( libcfile_file_open( file, filename, LIBCFILE_OPEN_READ, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); goto on_error; } result = libcfile_file_is_device( file, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if file is a device.", function ); return( -1 ); } if( libcfile_file_close( file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file.", function ); goto on_error; } if( libcfile_file_free( &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file.", function ); goto on_error; } return( result ); on_error: if( file != NULL ) { libcfile_file_free( &file, NULL ); } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Determines if a file is a device * Returns 1 if true, 0 if not or -1 on error */ int libsmdev_check_device_wide( const wchar_t *filename, libcerror_error_t **error ) { libcfile_file_t *file = NULL; static char *function = "libsmdev_check_device_wide"; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libcfile_file_initialize( &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file.", function ); goto on_error; } if( libcfile_file_open_wide( file, filename, LIBCFILE_OPEN_READ, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); goto on_error; } result = libcfile_file_is_device( file, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if file is a device.", function ); return( -1 ); } if( libcfile_file_close( file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file.", function ); goto on_error; } if( libcfile_file_free( &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file.", function ); goto on_error; } return( result ); on_error: if( file != NULL ) { libcfile_file_free( &file, NULL ); } return( -1 ); } #endif libewf-20140807/libsmdev/libsmdev_debug.h0000664000175000017500000000221213443450064022262 0ustar00lordyestalordyesta00000000000000/* * Debug functions * * Copyright (C) 2010-2019, 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( _LIBSMDEV_DEBUG_H ) #define _LIBSMDEV_DEBUG_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_DEBUG_OUTPUT ) const char *libsmdev_debug_print_device_type( uint8_t device_type ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBSMDEV_DEBUG_H ) */ libewf-20140807/libsmdev/libsmdev_libclocale.h0000664000175000017500000000266513443450064023301 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2010-2019, 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( _LIBSMDEV_LIBCLOCALE_H ) #define _LIBSMDEV_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBSMDEV_LIBCLOCALE_H ) */ libewf-20140807/aclocal.m40000664000175000017500000016044213443455343017210 0ustar00lordyestalordyesta00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for 'mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl FIXME we are no longer going to remove this! adjust warning dnl FIXME message accordingly. AC_DIAGNOSE([obsolete], [$0: this macro is deprecated, and will soon be removed. You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead, and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.]) dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/common.m4]) m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intlmacosx.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libbfio.m4]) m4_include([m4/libcdata.m4]) m4_include([m4/libcdatetime.m4]) m4_include([m4/libcerror.m4]) m4_include([m4/libcfile.m4]) m4_include([m4/libclocale.m4]) m4_include([m4/libcnotify.m4]) m4_include([m4/libcpath.m4]) m4_include([m4/libcrypto.m4]) m4_include([m4/libcsplit.m4]) m4_include([m4/libcthreads.m4]) m4_include([m4/libfcache.m4]) m4_include([m4/libfdata.m4]) m4_include([m4/libfuse.m4]) m4_include([m4/libfvalue.m4]) m4_include([m4/libhmac.m4]) m4_include([m4/libmfdata.m4]) m4_include([m4/libodraw.m4]) m4_include([m4/libsmdev.m4]) m4_include([m4/libsmraw.m4]) m4_include([m4/libtool.m4]) m4_include([m4/libuna.m4]) m4_include([m4/libuuid.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/nls.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) m4_include([m4/pthread.m4]) m4_include([m4/python.m4]) m4_include([m4/stdcxx11.m4]) m4_include([m4/types.m4]) m4_include([m4/zlib.m4]) m4_include([acinclude.m4]) libewf-20140807/libbfio/0000775000175000017500000000000013443455445016752 5ustar00lordyestalordyesta00000000000000libewf-20140807/libbfio/libbfio_handle.h0000664000175000017500000001733213443450015022036 0ustar00lordyestalordyesta00000000000000/* * The handle functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_INTERNAL_HANDLE_H ) #define _LIBBFIO_INTERNAL_HANDLE_H #include #include #include "libbfio_extern.h" #include "libbfio_libcdata.h" #include "libbfio_libcerror.h" #include "libbfio_libcthreads.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libbfio_internal_handle libbfio_internal_handle_t; struct libbfio_internal_handle { /* The IO handle */ intptr_t *io_handle; /* The flags */ uint8_t flags; /* The access flags */ int access_flags; /* The current offset */ off64_t current_offset; /* The size */ size64_t size; /* Value to indicate the size was set */ uint8_t size_set; /* Value to indicate to open and close * the systems file descriptor or handle on demand */ uint8_t open_on_demand; /* Reference to the pool last used list element */ libcdata_list_element_t *pool_last_used_list_element; /* Value to indicate to track offsets read */ uint8_t track_offsets_read; /* The offset ranges that were read */ libcdata_range_list_t *offsets_read; /* The narrow string codepage */ int narrow_string_codepage; /* The free IO handle function */ int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ); /* The clone (duplicate) IO handle function */ int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ); /* The open function */ int (*open)( intptr_t *io_handle, int access_flags, libcerror_error_t **error ); /* The close function */ int (*close)( intptr_t *io_handle, libcerror_error_t **error ); /* The read function */ ssize_t (*read)( intptr_t *io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); /* The write function */ ssize_t (*write)( intptr_t *io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); /* The seek offset function */ off64_t (*seek_offset)( intptr_t *io_handle, off64_t offset, int whence, libcerror_error_t **error ); /* The exists function */ int (*exists)( intptr_t *io_handle, libcerror_error_t **error ); /* The is open function */ int (*is_open)( intptr_t *io_handle, libcerror_error_t **error ); /* The get size function */ int (*get_size)( intptr_t *io_handle, size64_t *size, libcerror_error_t **error ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBBFIO_EXTERN \ int libbfio_handle_initialize( libbfio_handle_t **handle, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*open)( intptr_t *io_handle, int access_flags, libcerror_error_t **error ), int (*close)( intptr_t *io_handle, libcerror_error_t **error ), ssize_t (*read)( intptr_t *io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ), ssize_t (*write)( intptr_t *io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ), off64_t (*seek_offset)( intptr_t *io_handle, off64_t offset, int whence, libcerror_error_t **error ), int (*exists)( intptr_t *io_handle, libcerror_error_t **error ), int (*is_open)( intptr_t *io_handle, libcerror_error_t **error ), int (*get_size)( intptr_t *io_handle, size64_t *size, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_free( libbfio_handle_t **handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_clone( libbfio_handle_t **destination_handle, libbfio_handle_t *source_handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_open( libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_reopen( libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_close( libbfio_handle_t *handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ ssize_t libbfio_handle_read_buffer( libbfio_handle_t *handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBBFIO_EXTERN \ ssize_t libbfio_handle_write_buffer( libbfio_handle_t *handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBBFIO_EXTERN \ off64_t libbfio_handle_seek_offset( libbfio_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_exists( libbfio_handle_t *handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_is_open( libbfio_handle_t *handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_get_io_handle( libbfio_handle_t *handle, intptr_t **io_handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_get_access_flags( libbfio_handle_t *handle, int *access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_set_access_flags( libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_get_offset( libbfio_handle_t *handle, off64_t *offset, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_get_size( libbfio_handle_t *handle, size64_t *size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_set_open_on_demand( libbfio_handle_t *handle, uint8_t open_on_demand, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_set_track_offsets_read( libbfio_handle_t *handle, uint8_t track_offsets_read, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_get_number_of_offsets_read( libbfio_handle_t *handle, int *number_of_read_offsets, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_handle_get_offset_read( libbfio_handle_t *handle, int index, off64_t *offset, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_INTERNAL_HANDLE_H ) */ libewf-20140807/libbfio/libbfio_libcerror.h0000664000175000017500000000263513443450015022566 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBCERROR_H ) #define _LIBBFIO_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBBFIO_LIBCERROR_H ) */ libewf-20140807/libbfio/libbfio_handle.c0000664000175000017500000016023413443450015022031 0ustar00lordyestalordyesta00000000000000/* * The handle functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libbfio_definitions.h" #include "libbfio_handle.h" #include "libbfio_libcdata.h" #include "libbfio_libcerror.h" /* Creates a handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_handle_initialize( libbfio_handle_t **handle, intptr_t *io_handle, int (*free_io_handle)( intptr_t **io_handle, libcerror_error_t **error ), int (*clone_io_handle)( intptr_t **destination_io_handle, intptr_t *source_io_handle, libcerror_error_t **error ), int (*open)( intptr_t *io_handle, int access_flags, libcerror_error_t **error ), int (*close)( intptr_t *io_handle, libcerror_error_t **error ), ssize_t (*read)( intptr_t *io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ), ssize_t (*write)( intptr_t *io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ), off64_t (*seek_offset)( intptr_t *io_handle, off64_t offset, int whence, libcerror_error_t **error ), int (*exists)( intptr_t *io_handle, libcerror_error_t **error ), int (*is_open)( intptr_t *io_handle, libcerror_error_t **error ), int (*get_size)( intptr_t *io_handle, size64_t *size, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } internal_handle = memory_allocate_structure( libbfio_internal_handle_t ); if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create handle.", function ); goto on_error; } if( memory_set( internal_handle, 0, sizeof( libbfio_internal_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear handle.", function ); memory_free( internal_handle ); return( -1 ); } if( libcdata_range_list_initialize( &( internal_handle->offsets_read ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create read offsets list.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_initialize( &( internal_handle->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to intialize read/write lock.", function ); goto on_error; } #endif internal_handle->io_handle = io_handle; internal_handle->flags = flags; internal_handle->free_io_handle = free_io_handle; internal_handle->clone_io_handle = clone_io_handle; internal_handle->open = open; internal_handle->close = close; internal_handle->read = read; internal_handle->write = write; internal_handle->seek_offset = seek_offset; internal_handle->exists = exists; internal_handle->is_open = is_open; internal_handle->get_size = get_size; *handle = (libbfio_handle_t *) internal_handle; return( 1 ); on_error: if( internal_handle != NULL ) { if( internal_handle->offsets_read != NULL ) { libcdata_range_list_free( &( internal_handle->offsets_read ), NULL, NULL ); } memory_free( internal_handle ); } return( -1 ); } /* Frees a handle * Returns 1 if successful or -1 on error */ int libbfio_handle_free( libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_free"; int is_open = 0; int result = 1; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { internal_handle = (libbfio_internal_handle_t *) *handle; *handle = NULL; if( internal_handle->is_open != NULL ) { is_open = internal_handle->is_open( internal_handle->io_handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to determine if handle is open.", function ); result = -1; } } if( is_open != 0 ) { if( internal_handle->close != NULL ) { if( internal_handle->close( internal_handle->io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); result = -1; } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_free( &( internal_handle->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( ( internal_handle->flags & LIBBFIO_FLAG_IO_HANDLE_MANAGED ) != 0 ) { if( internal_handle->io_handle != NULL ) { if( internal_handle->free_io_handle == NULL ) { memory_free( internal_handle->io_handle ); } else if( internal_handle->free_io_handle( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } } } if( internal_handle->offsets_read != NULL ) { if( libcdata_range_list_free( &( internal_handle->offsets_read ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read offsets list.", function ); result = -1; } } memory_free( internal_handle ); } return( result ); } /* Clones (duplicates) the handle * The values in the offsets read list are not duplicated * Returns 1 if successful or -1 on error */ int libbfio_handle_clone( libbfio_handle_t **destination_handle, libbfio_handle_t *source_handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_source_handle = NULL; intptr_t *destination_io_handle = NULL; static char *function = "libbfio_handle_clone"; uint8_t destination_flags = 0; if( destination_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination handle.", function ); return( -1 ); } if( *destination_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination handle already set.", function ); return( -1 ); } if( source_handle == NULL ) { *destination_handle = NULL; return( 1 ); } internal_source_handle = (libbfio_internal_handle_t *) source_handle; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_source_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( internal_source_handle->io_handle != NULL ) { if( ( internal_source_handle->flags & LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_REFERENCE ) != 0 ) { destination_io_handle = internal_source_handle->io_handle; destination_flags = LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_REFERENCE; } else { if( internal_source_handle->clone_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing clone IO handle function.", function ); goto on_error; } if( internal_source_handle->clone_io_handle( &destination_io_handle, internal_source_handle->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone IO handle.", function ); goto on_error; } destination_flags = LIBBFIO_FLAG_IO_HANDLE_MANAGED; } } if( libbfio_handle_initialize( destination_handle, destination_io_handle, internal_source_handle->free_io_handle, internal_source_handle->clone_io_handle, internal_source_handle->open, internal_source_handle->close, internal_source_handle->read, internal_source_handle->write, internal_source_handle->seek_offset, internal_source_handle->exists, internal_source_handle->is_open, internal_source_handle->get_size, destination_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination handle.", function ); goto on_error; } destination_io_handle = NULL; if( internal_source_handle->access_flags != 0 ) { if( libbfio_handle_open( *destination_handle, internal_source_handle->access_flags, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open destination handle.", function ); goto on_error; } if( libbfio_handle_seek_offset( *destination_handle, internal_source_handle->current_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in destination handle.", function ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_source_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); goto on_error; } #endif return( 1 ); on_error: if( destination_io_handle != NULL ) { if( internal_source_handle->free_io_handle == NULL ) { memory_free( destination_io_handle ); } else { internal_source_handle->free_io_handle( &destination_io_handle, NULL ); } } if( destination_handle != NULL ) { libbfio_handle_free( destination_handle, NULL ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_read( internal_source_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Opens the handle * Returns 1 if successful or -1 on error */ int libbfio_handle_open( libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_open"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->open == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing open function.", function ); return( -1 ); } if( ( ( access_flags & LIBBFIO_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags: 0x%02x.", function, access_flags ); return( -1 ); } if( ( internal_handle->open_on_demand != 0 ) && ( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: open on demand cannot be used in combination with write access.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_handle->open_on_demand == 0 ) { if( internal_handle->open( internal_handle->io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle.", function ); goto on_error; } } internal_handle->access_flags = access_flags; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Reopens the handle * Returns 1 if successful or -1 on error */ int libbfio_handle_reopen( libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_reopen"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->close == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing close function.", function ); return( -1 ); } if( internal_handle->open == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing open function.", function ); return( -1 ); } if( internal_handle->seek_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing seek offset function.", function ); return( -1 ); } if( ( ( access_flags & LIBBFIO_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif /* Only reopen if the access flags have changed */ if( internal_handle->access_flags != access_flags ) { if( internal_handle->close( internal_handle->io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } if( internal_handle->open_on_demand == 0 ) { if( internal_handle->open( internal_handle->io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle.", function ); goto on_error; } } internal_handle->access_flags = access_flags; if( internal_handle->open_on_demand == 0 ) { /* Seek the previous file offset only when at least reading the file */ if( ( internal_handle->access_flags & LIBBFIO_ACCESS_FLAG_READ ) != 0 ) { if( internal_handle->seek_offset( internal_handle->io_handle, internal_handle->current_offset, SEEK_CUR, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in handle.", function ); goto on_error; } } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Closes the handle * Returns 0 if successful or -1 on error */ int libbfio_handle_close( libbfio_handle_t *handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_close"; int is_open = 1; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->close == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing close function.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_handle->open_on_demand != 0 ) { if( internal_handle->is_open == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing is open function.", function ); goto on_error; } is_open = internal_handle->is_open( internal_handle->io_handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to determine if handle is open.", function ); goto on_error; } } if( is_open != 0 ) { if( internal_handle->close( internal_handle->io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 0 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Reads a buffer from the handle * Returns the number of bytes read if successful, or -1 on error */ ssize_t libbfio_handle_read_buffer( libbfio_handle_t *handle, uint8_t *buffer, size_t size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_read_buffer"; ssize_t read_count = 0; int is_open = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->read == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing read function.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_handle->open_on_demand != 0 ) { if( internal_handle->is_open == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing is open function.", function ); goto on_error; } if( internal_handle->open == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing open function.", function ); goto on_error; } if( internal_handle->seek_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing seek offset function.", function ); goto on_error; } is_open = internal_handle->is_open( internal_handle->io_handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to determine if handle is open.", function ); goto on_error; } else if( is_open == 0 ) { if( internal_handle->open( internal_handle->io_handle, internal_handle->access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle on demand.", function ); goto on_error; } if( internal_handle->seek_offset( internal_handle->io_handle, internal_handle->current_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek current offset: %" PRIi64 " in handle.", function, internal_handle->current_offset ); goto on_error; } } } read_count = internal_handle->read( internal_handle->io_handle, buffer, size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from handle.", function ); goto on_error; } if( internal_handle->track_offsets_read != 0 ) { result = libcdata_range_list_insert_range( internal_handle->offsets_read, (uint64_t) internal_handle->current_offset, (uint64_t) read_count, NULL, NULL, NULL, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert offset range to offsets read table.", function ); goto on_error; } } internal_handle->current_offset += (off64_t) read_count; if( internal_handle->open_on_demand != 0 ) { if( internal_handle->close == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing close function.", function ); goto on_error; } if( internal_handle->close( internal_handle->io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to close handle on demand.", function ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( read_count ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Writes a buffer to the handle * Returns the number of bytes written if successful, or -1 on error */ ssize_t libbfio_handle_write_buffer( libbfio_handle_t *handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_write_buffer"; ssize_t write_count = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->write == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing write function.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif write_count = internal_handle->write( internal_handle->io_handle, buffer, size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to handle.", function ); goto on_error; } internal_handle->current_offset += (off64_t) write_count; if( (size64_t) internal_handle->current_offset > internal_handle->size ) { internal_handle->size = (size64_t) internal_handle->current_offset; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( write_count ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Seeks a certain offset within the handle * Returns the offset if the seek is successful or -1 on error */ off64_t libbfio_handle_seek_offset( libbfio_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_seek_offset"; off64_t seek_offset = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->seek_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing seek offset function.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif seek_offset = internal_handle->seek_offset( internal_handle->io_handle, offset, whence, error ); if( seek_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 " in handle.", function, offset ); goto on_error; } internal_handle->current_offset = seek_offset; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( seek_offset ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Function to determine if a file object exists * Returns 1 if file object exists, 0 if not or -1 on error */ int libbfio_handle_exists( libbfio_handle_t *handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_exists"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->exists == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing exists function.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif result = internal_handle->exists( internal_handle->io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if handle exists.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Check if the handle is open * Returns 1 if open, 0 if not or -1 on error */ int libbfio_handle_is_open( libbfio_handle_t *handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_is_open"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->is_open == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing is open function.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif result = internal_handle->is_open( internal_handle->io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if handle is open.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves the IO handle * Returns 1 if successful or -1 on error */ int libbfio_handle_get_io_handle( libbfio_handle_t *handle, intptr_t **io_handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_io_handle"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *io_handle = internal_handle->io_handle; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the access flags * Returns 1 if successful or -1 on error */ int libbfio_handle_get_access_flags( libbfio_handle_t *handle, int *access_flags, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_access_flags"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( access_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid access flags.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *access_flags = internal_handle->access_flags; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the access flags * Returns 1 if successful or -1 on error */ int libbfio_handle_set_access_flags( libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_set_access_flags"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( ( ( access_flags & LIBBFIO_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif internal_handle->access_flags = access_flags; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the current offset * Returns 1 if successful or -1 on error */ int libbfio_handle_get_offset( libbfio_handle_t *handle, off64_t *offset, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *offset = internal_handle->current_offset; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Returns the size of the data of the handle * Returns 1 if successful or -1 on error */ int libbfio_handle_get_size( libbfio_handle_t *handle, size64_t *size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_handle->size_set == 0 ) { if( internal_handle->get_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing get size function.", function ); goto on_error; } if( internal_handle->get_size( internal_handle->io_handle, &( internal_handle->size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size.", function ); goto on_error; } internal_handle->size_set = 1; } *size = internal_handle->size; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Sets the value to have the library open and close * the systems file descriptor or handle on demand * 0 disables open on demand any other value enables it * Returns 1 if successful or -1 on error */ int libbfio_handle_set_open_on_demand( libbfio_handle_t *handle, uint8_t open_on_demand, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_set_open_on_demand"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( ( ( internal_handle->access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) != 0 ) && ( open_on_demand != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: open on demand cannot be used in combination with write access.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif internal_handle->open_on_demand = open_on_demand; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the value to have the library track the offsets read * 0 disables tracking any other value enables it * Returns 1 if successful or -1 on error */ int libbfio_handle_set_track_offsets_read( libbfio_handle_t *handle, uint8_t track_offsets_read, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_set_track_offsets_read"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif internal_handle->track_offsets_read = track_offsets_read; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the number of offsets read * Returns 1 if successful or -1 on error */ int libbfio_handle_get_number_of_offsets_read( libbfio_handle_t *handle, int *number_of_read_offsets, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_number_of_offsets_read"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_range_list_get_number_of_elements( internal_handle->offsets_read, number_of_read_offsets, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of read offsets.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves the information of an offset read * Returns 1 if successful or -1 on error */ int libbfio_handle_get_offset_read( libbfio_handle_t *handle, int index, off64_t *offset, size64_t *size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_offset_read"; intptr_t *value = NULL; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_range_list_get_range_by_index( internal_handle->offsets_read, index, (uint64_t *) offset, (uint64_t *) size, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve read offset range: %d.", function, index ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_read( internal_handle->read_write_lock, NULL ); #endif return( -1 ); } libewf-20140807/libbfio/libbfio_libuna.h0000664000175000017500000000330713443450015022052 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBUNA_H ) #define _LIBBFIO_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBBFIO_LIBUNA_H ) */ libewf-20140807/libbfio/libbfio_definitions.h0000664000175000017500000000522613443450015023115 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2009-2019, 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( _LIBBFIO_INTERNAL_DEFINITIONS_H ) #define _LIBBFIO_INTERNAL_DEFINITIONS_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if !defined( HAVE_LOCAL_LIBBFIO ) #include /* The definitions in are copied here * for local use of libbfio */ #else #define LIBBFIO_VERSION 20190112 /* The libbfio version string */ #define LIBBFIO_VERSION_STRING "20190112" /* The library flags definitions */ enum LIBBFIO_FLAGS { /* The IO handle is not managed by the library */ LIBBFIO_FLAG_IO_HANDLE_NON_MANAGED = 0x00, /* The IO handle is managed by the library */ LIBBFIO_FLAG_IO_HANDLE_MANAGED = 0x01, /* The IO handle is cloned by the function */ LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION = 0x00, /* The IO handle is not cloned, but passed as a reference */ LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_REFERENCE = 0x02, }; /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3 set to 1 to truncate an existing file on write * bit 4-8 not used */ enum LIBBFIO_ACCESS_FLAGS { LIBBFIO_ACCESS_FLAG_READ = 0x01, LIBBFIO_ACCESS_FLAG_WRITE = 0x02, LIBBFIO_ACCESS_FLAG_TRUNCATE = 0x04 }; /* The file access macros */ #define LIBBFIO_OPEN_READ ( LIBBFIO_ACCESS_FLAG_READ ) #define LIBBFIO_OPEN_WRITE ( LIBBFIO_ACCESS_FLAG_WRITE ) #define LIBBFIO_OPEN_READ_WRITE ( LIBBFIO_ACCESS_FLAG_READ | LIBBFIO_ACCESS_FLAG_WRITE ) #define LIBBFIO_OPEN_WRITE_TRUNCATE ( LIBBFIO_ACCESS_FLAG_WRITE | LIBBFIO_ACCESS_FLAG_TRUNCATE ) #define LIBBFIO_OPEN_READ_WRITE_TRUNCATE ( LIBBFIO_ACCESS_FLAG_READ | LIBBFIO_ACCESS_FLAG_WRITE | LIBBFIO_ACCESS_FLAG_TRUNCATE ) #define LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES 0 #endif /* HAVE_LOCAL_LIBBFIO */ #endif /* !defined( _LIBBFIO_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libbfio/libbfio_libclocale.h0000664000175000017500000000266213443450015022674 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBCLOCALE_H ) #define _LIBBFIO_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBBFIO_LIBCLOCALE_H ) */ libewf-20140807/libbfio/libbfio_codepage.h0000664000175000017500000000507013443450015022346 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_INTERNAL_CODEPAGE_H ) #define _LIBBFIO_INTERNAL_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBBFIO ) #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio * The definitions in are copied here * for local use of libbfio */ #else /* The codepage definitions */ enum LIBBFIO_CODEPAGES { LIBBFIO_CODEPAGE_ASCII = 20127, LIBBFIO_CODEPAGE_ISO_8859_1 = 28591, LIBBFIO_CODEPAGE_ISO_8859_2 = 28592, LIBBFIO_CODEPAGE_ISO_8859_3 = 28593, LIBBFIO_CODEPAGE_ISO_8859_4 = 28594, LIBBFIO_CODEPAGE_ISO_8859_5 = 28595, LIBBFIO_CODEPAGE_ISO_8859_6 = 28596, LIBBFIO_CODEPAGE_ISO_8859_7 = 28597, LIBBFIO_CODEPAGE_ISO_8859_8 = 28598, LIBBFIO_CODEPAGE_ISO_8859_9 = 28599, LIBBFIO_CODEPAGE_ISO_8859_10 = 28600, LIBBFIO_CODEPAGE_ISO_8859_11 = 28601, LIBBFIO_CODEPAGE_ISO_8859_13 = 28603, LIBBFIO_CODEPAGE_ISO_8859_14 = 28604, LIBBFIO_CODEPAGE_ISO_8859_15 = 28605, LIBBFIO_CODEPAGE_ISO_8859_16 = 28606, LIBBFIO_CODEPAGE_KOI8_R = 20866, LIBBFIO_CODEPAGE_KOI8_U = 21866, LIBBFIO_CODEPAGE_WINDOWS_874 = 874, LIBBFIO_CODEPAGE_WINDOWS_932 = 932, LIBBFIO_CODEPAGE_WINDOWS_936 = 936, LIBBFIO_CODEPAGE_WINDOWS_949 = 949, LIBBFIO_CODEPAGE_WINDOWS_950 = 950, LIBBFIO_CODEPAGE_WINDOWS_1250 = 1250, LIBBFIO_CODEPAGE_WINDOWS_1251 = 1251, LIBBFIO_CODEPAGE_WINDOWS_1252 = 1252, LIBBFIO_CODEPAGE_WINDOWS_1253 = 1253, LIBBFIO_CODEPAGE_WINDOWS_1254 = 1254, LIBBFIO_CODEPAGE_WINDOWS_1255 = 1255, LIBBFIO_CODEPAGE_WINDOWS_1256 = 1256, LIBBFIO_CODEPAGE_WINDOWS_1257 = 1257, LIBBFIO_CODEPAGE_WINDOWS_1258 = 1258 }; #endif /* !defined( HAVE_LOCAL_LIBBFIO ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_INTERNAL_CODEPAGE_H ) */ libewf-20140807/libbfio/libbfio_libcdata.h0000664000175000017500000000301313443450015022335 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBCDATA_H ) #define _LIBBFIO_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBBFIO_LIBCDATA_H ) */ libewf-20140807/libbfio/libbfio_extern.h0000664000175000017500000000237213443450015022106 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2009-2019, 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( _LIBBFIO_INTERNAL_EXTERN_H ) #define _LIBBFIO_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if !defined( HAVE_LOCAL_LIBBFIO ) #include #define LIBBFIO_EXTERN_VARIABLE LIBBFIO_EXTERN #else #define LIBBFIO_EXTERN /* extern */ #define LIBBFIO_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBBFIO ) */ #endif /* !defined( _LIBBFIO_INTERNAL_EXTERN_H ) */ libewf-20140807/libbfio/libbfio_file_range.c0000664000175000017500000002763413443450015022677 0ustar00lordyestalordyesta00000000000000/* * File range functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libbfio_definitions.h" #include "libbfio_file_range.h" #include "libbfio_file_range_io_handle.h" #include "libbfio_handle.h" #include "libbfio_libcerror.h" #include "libbfio_types.h" /* Creates a file range handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_file_range_initialize( libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_file_range_io_handle_t *file_range_io_handle = NULL; static char *function = "libbfio_range_file_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } if( libbfio_file_range_io_handle_initialize( &file_range_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file range IO handle.", function ); goto on_error; } if( libbfio_handle_initialize( handle, (intptr_t *) file_range_io_handle, (int (*)(intptr_t **, libcerror_error_t **)) libbfio_file_range_io_handle_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) libbfio_file_range_io_handle_clone, (int (*)(intptr_t *, int, libcerror_error_t **)) libbfio_file_range_io_handle_open, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_file_range_io_handle_close, (ssize_t (*)(intptr_t *, uint8_t *, size_t, libcerror_error_t **)) libbfio_file_range_io_handle_read_buffer, (ssize_t (*)(intptr_t *, const uint8_t *, size_t, libcerror_error_t **)) libbfio_file_range_io_handle_write_buffer, (off64_t (*)(intptr_t *, off64_t, int, libcerror_error_t **)) libbfio_file_range_io_handle_seek_offset, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_file_range_io_handle_exists, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_file_range_io_handle_is_open, (int (*)(intptr_t *, size64_t *, libcerror_error_t **)) libbfio_file_range_io_handle_get_size, LIBBFIO_FLAG_IO_HANDLE_MANAGED | LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } return( 1 ); on_error: if( file_range_io_handle != NULL ) { libbfio_file_range_io_handle_free( &file_range_io_handle, NULL ); } return( -1 ); } /* Retrieves the name size of the file range handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_get_name_size( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_get_name_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_get_name_size( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name size from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file range handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_get_name( libbfio_handle_t *handle, char *name, size_t name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_get_name"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_get_name( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file range handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_set_name( libbfio_handle_t *handle, const char *name, size_t name_length, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_set_name"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_set_name( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, name, name_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the name size of the file range handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_get_name_size_wide( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_get_name_size_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_get_name_size_wide( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name size from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file range handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_get_name_wide( libbfio_handle_t *handle, wchar_t *name, size_t name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_get_name_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_get_name_wide( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file range handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_set_name_wide( libbfio_handle_t *handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_set_name_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_set_name_wide( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, name, name_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Retrieves the range of the file range handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_get( libbfio_handle_t *handle, off64_t *range_offset, size64_t *range_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_get"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_get( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, range_offset, range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the range of the file range handle * A range size of 0 represents that the range continues until the end of the file * Returns 1 if succesful or -1 on error */ int libbfio_file_range_set( libbfio_handle_t *handle, off64_t range_offset, size64_t range_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_range_set"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_range_io_handle_set( (libbfio_file_range_io_handle_t *) internal_handle->io_handle, range_offset, range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set range in file IO handle.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libbfio/libbfio_file_range_io_handle.c0000664000175000017500000006563113443450015024700 0ustar00lordyestalordyesta00000000000000/* * File range IO handle functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libbfio_definitions.h" #include "libbfio_file_io_handle.h" #include "libbfio_file_range_io_handle.h" #include "libbfio_libcerror.h" /* Creates a file range IO handle * Make sure the value file_range_io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_file_range_io_handle_initialize( libbfio_file_range_io_handle_t **file_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_initialize"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( *file_range_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file range IO handle value already set.", function ); return( -1 ); } *file_range_io_handle = memory_allocate_structure( libbfio_file_range_io_handle_t ); if( *file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file range IO handle.", function ); goto on_error; } if( memory_set( *file_range_io_handle, 0, sizeof( libbfio_file_range_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file range IO handle.", function ); goto on_error; } if( libbfio_file_io_handle_initialize( &( ( *file_range_io_handle )->file_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize file IO handle.", function ); goto on_error; } return( 1 ); on_error: if( *file_range_io_handle != NULL ) { memory_free( *file_range_io_handle ); *file_range_io_handle = NULL; } return( -1 ); } /* Frees a file range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_free( libbfio_file_range_io_handle_t **file_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_free"; int result = 1; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( *file_range_io_handle != NULL ) { if( libbfio_file_io_handle_free( &( ( *file_range_io_handle )->file_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file IO handle.", function ); result = -1; } memory_free( *file_range_io_handle ); *file_range_io_handle = NULL; } return( result ); } /* Clones (duplicates) the file range IO handle and its attributes * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_clone( libbfio_file_range_io_handle_t **destination_file_range_io_handle, libbfio_file_range_io_handle_t *source_file_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_clone"; if( destination_file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination file range IO handle.", function ); return( -1 ); } if( *destination_file_range_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination file range IO handle already set.", function ); return( -1 ); } if( source_file_range_io_handle == NULL ) { *destination_file_range_io_handle = NULL; return( 1 ); } *destination_file_range_io_handle = memory_allocate_structure( libbfio_file_range_io_handle_t ); if( *destination_file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination file range IO handle.", function ); goto on_error; } if( memory_set( *destination_file_range_io_handle, 0, sizeof( libbfio_file_range_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination file range IO handle.", function ); memory_free( *destination_file_range_io_handle ); *destination_file_range_io_handle = NULL; return( -1 ); } if( libbfio_file_io_handle_clone( &( ( *destination_file_range_io_handle )->file_io_handle ), source_file_range_io_handle->file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } ( *destination_file_range_io_handle )->range_offset = source_file_range_io_handle->range_offset; ( *destination_file_range_io_handle )->range_size = source_file_range_io_handle->range_size; return( 1 ); on_error: if( *destination_file_range_io_handle != NULL ) { libbfio_file_range_io_handle_free( destination_file_range_io_handle, NULL ); } return( -1 ); } /* Retrieves the name size of the file range IO handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_get_name_size( libbfio_file_range_io_handle_t *file_range_io_handle, size_t *name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_get_name_size"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_get_name_size( file_range_io_handle->file_io_handle, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name size from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file range IO handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_get_name( libbfio_file_range_io_handle_t *file_range_io_handle, char *name, size_t name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_get_name"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_get_name( file_range_io_handle->file_io_handle, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_set_name( libbfio_file_range_io_handle_t *file_range_io_handle, const char *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libbfio_file_range_set_name"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_set_name( file_range_io_handle->file_io_handle, name, name_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the name size of the file range IO handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_get_name_size_wide( libbfio_file_range_io_handle_t *file_range_io_handle, size_t *name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_get_name_size_wide"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_get_name_size_wide( file_range_io_handle->file_io_handle, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name size from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file range IO handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_get_name_wide( libbfio_file_range_io_handle_t *file_range_io_handle, wchar_t *name, size_t name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_get_name_wide"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_get_name_wide( file_range_io_handle->file_io_handle, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_set_name_wide( libbfio_file_range_io_handle_t *file_range_io_handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libbfio_file_range_set_name_wide"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_set_name_wide( file_range_io_handle->file_io_handle, name, name_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Retrieves the range of the file range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_get( libbfio_file_range_io_handle_t *file_range_io_handle, off64_t *range_offset, size64_t *range_size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_get"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( range_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range offset.", function ); return( -1 ); } if( range_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range size.", function ); return( -1 ); } *range_offset = file_range_io_handle->range_offset; *range_size = file_range_io_handle->range_size; return( 1 ); } /* Sets the range of the file range IO handle * A range size of 0 represents that the range continues until the end of the file * Returns 1 if succesful or -1 on error */ int libbfio_file_range_io_handle_set( libbfio_file_range_io_handle_t *file_range_io_handle, off64_t range_offset, size64_t range_size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_set"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( range_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid range offset value less than zero.", function ); return( -1 ); } if( range_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range size value exceeds maximum.", function ); return( -1 ); } file_range_io_handle->range_offset = range_offset; file_range_io_handle->range_size = range_size; return( 1 ); } /* Opens the file range IO handle * Returns 1 if successful or -1 on error */ int libbfio_file_range_io_handle_open( libbfio_file_range_io_handle_t *file_range_io_handle, int access_flags, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_open"; size64_t file_size = 0; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_open( file_range_io_handle->file_io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_get_size( file_range_io_handle->file_io_handle, &file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size from file IO handle.", function ); return( -1 ); } if( file_range_io_handle->range_offset >= (off64_t) file_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range offset value exceeds file size.", function ); return( -1 ); } file_size -= file_range_io_handle->range_offset; if( file_range_io_handle->range_size > file_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range size value exceeds file size.", function ); return( -1 ); } if( libbfio_file_io_handle_seek_offset( file_range_io_handle->file_io_handle, file_range_io_handle->range_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek range offset in file IO handle.", function ); return( -1 ); } return( 1 ); } /* Closes the file range IO handle * Returns 0 if successful or -1 on error */ int libbfio_file_range_io_handle_close( libbfio_file_range_io_handle_t *file_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_close"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( libbfio_file_io_handle_close( file_range_io_handle->file_io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file IO handle.", function ); return( -1 ); } return( 0 ); } /* Reads a buffer from the file range IO handle * Returns the number of bytes read if successful, or -1 on error */ ssize_t libbfio_file_range_io_handle_read_buffer( libbfio_file_range_io_handle_t *file_range_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_read_buffer"; off64_t file_offset = 0; ssize_t read_count = 0; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } file_offset = libbfio_file_io_handle_seek_offset( file_range_io_handle->file_io_handle, 0, SEEK_CUR, error ); if( file_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset from file IO handle.", function ); return( -1 ); } if( file_offset < file_range_io_handle->range_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file offset value out of bounds.", function ); return( -1 ); } if( file_range_io_handle->range_size != 0 ) { if( (size64_t) file_offset >= file_range_io_handle->range_size ) { return( 0 ); } if( (size64_t) ( file_offset + size ) >= file_range_io_handle->range_size ) { size = (size_t) ( file_range_io_handle->range_offset - file_offset ); } } read_count = libbfio_file_io_handle_read_buffer( file_range_io_handle->file_io_handle, buffer, size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file IO handle.", function ); return( -1 ); } return( read_count ); } /* Writes a buffer to the file range IO handle * Returns the number of bytes written if successful, or -1 on error */ ssize_t libbfio_file_range_io_handle_write_buffer( libbfio_file_range_io_handle_t *file_range_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_write_buffer"; off64_t file_offset = 0; ssize_t write_count = 0; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } file_offset = libbfio_file_io_handle_seek_offset( file_range_io_handle->file_io_handle, 0, SEEK_CUR, error ); if( file_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset from file IO handle.", function ); return( -1 ); } if( file_offset < file_range_io_handle->range_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file offset value out of bounds.", function ); return( -1 ); } if( file_range_io_handle->range_size != 0 ) { if( (size64_t) file_offset >= file_range_io_handle->range_size ) { return( 0 ); } if( (size64_t) ( file_offset + size ) >= file_range_io_handle->range_size ) { size = (size_t) ( file_range_io_handle->range_offset - file_offset ); } } write_count = libbfio_file_io_handle_write_buffer( file_range_io_handle->file_io_handle, buffer, size, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write to file IO handle.", function ); return( -1 ); } return( write_count ); } /* Seeks a certain offset within the file range IO handle * Returns the offset if the seek is successful or -1 on error */ off64_t libbfio_file_range_io_handle_seek_offset( libbfio_file_range_io_handle_t *file_range_io_handle, off64_t offset, int whence, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_seek_offset"; off64_t file_offset = 0; off64_t seek_offset = 0; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( whence == SEEK_CUR ) { file_offset = libbfio_file_io_handle_seek_offset( file_range_io_handle->file_io_handle, 0, SEEK_CUR, error ); if( file_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset from file IO handle.", function ); return( -1 ); } offset += file_offset; whence = SEEK_SET; } else if( whence == SEEK_END ) { if( file_range_io_handle->range_size != 0 ) { offset += file_range_io_handle->range_size; whence = SEEK_SET; } } else if( whence == SEEK_SET ) { offset += file_range_io_handle->range_offset; } if( whence == SEEK_SET ) { if( offset < file_range_io_handle->range_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } } seek_offset = libbfio_file_io_handle_seek_offset( file_range_io_handle->file_io_handle, offset, whence, error ); if( seek_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 " in file IO handle.", function, offset ); return( -1 ); } if( seek_offset < file_range_io_handle->range_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset: %" PRIi64 " value out of bounds.", function, seek_offset ); return( -1 ); } seek_offset -= file_range_io_handle->range_offset; return( seek_offset ); } /* Function to determine if a file range exists * Returns 1 if file exists, 0 if not or -1 on error */ int libbfio_file_range_io_handle_exists( libbfio_file_range_io_handle_t *file_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_exists"; int result = 0; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } result = libbfio_file_io_handle_exists( file_range_io_handle->file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file exists.", function ); return( -1 ); } return( result ); } /* Check if the file range IO handle is open * Returns 1 if open, 0 if not or -1 on error */ int libbfio_file_range_io_handle_is_open( libbfio_file_range_io_handle_t *file_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_is_open"; int result = 0; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } result = libbfio_file_io_handle_is_open( file_range_io_handle->file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file is open.", function ); return( -1 ); } return( result ); } /* Retrieves the file range size * Returns 1 if successful or -1 on error */ int libbfio_file_range_io_handle_get_size( libbfio_file_range_io_handle_t *file_range_io_handle, size64_t *size, libcerror_error_t **error ) { static char *function = "libbfio_file_range_io_handle_get_size"; if( file_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file range IO handle.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( file_range_io_handle->range_size == 0 ) { if( libbfio_file_io_handle_get_size( file_range_io_handle->file_io_handle, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size.", function ); return( -1 ); } *size -= file_range_io_handle->range_offset; } else { *size = file_range_io_handle->range_size; } return( 1 ); } libewf-20140807/libbfio/Makefile.am0000664000175000017500000000263013443450015020773 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBBFIO AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libbfio.la libbfio_la_SOURCES = \ libbfio_codepage.h \ libbfio_definitions.h \ libbfio_error.c libbfio_error.h \ libbfio_extern.h \ libbfio_file.c libbfio_file.h \ libbfio_file_io_handle.c libbfio_file_io_handle.h \ libbfio_file_pool.c libbfio_file_pool.h \ libbfio_file_range.c libbfio_file_range.h \ libbfio_file_range_io_handle.c libbfio_file_range_io_handle.h \ libbfio_handle.c libbfio_handle.h \ libbfio_libcdata.h \ libbfio_libcerror.h \ libbfio_libcfile.h \ libbfio_libclocale.h \ libbfio_libcpath.h \ libbfio_libcthreads.h \ libbfio_libuna.h \ libbfio_memory_range.c libbfio_memory_range.h \ libbfio_memory_range_io_handle.c libbfio_memory_range_io_handle.h \ libbfio_pool.c libbfio_pool.h \ libbfio_support.c libbfio_support.h \ libbfio_system_string.c libbfio_system_string.h \ libbfio_types.h \ libbfio_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libbfio ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libbfio_la_SOURCES) libewf-20140807/libbfio/libbfio_file_pool.c0000664000175000017500000001416113443450015022543 0ustar00lordyestalordyesta00000000000000/* * File pool functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #include #include "libbfio_definitions.h" #include "libbfio_file.h" #include "libbfio_file_pool.h" #include "libbfio_handle.h" #include "libbfio_libcerror.h" #include "libbfio_pool.h" #include "libbfio_types.h" /* Appends file handles to the pool for the corresponding filenames * Returns 1 if successful or -1 on error */ int libbfio_file_pool_append_handles_for_names( libbfio_pool_t *pool, char * const names[], int number_of_names, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libbfio_file_pool_append_handles_for_names"; size_t name_length = 0; int pool_entry = 0; int name_iterator = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( names == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid names.", function ); return( -1 ); } if( number_of_names <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of names zero or less.", function ); return( -1 ); } for( name_iterator = 0; name_iterator < number_of_names; name_iterator++ ) { name_length = narrow_string_length( names[ name_iterator ] ); if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle: %d.", function, name_iterator ); return( -1 ); } if( libbfio_file_set_name( file_io_handle, names[ name_iterator ], name_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle: %d.", function, name_iterator ); libbfio_handle_free( &file_io_handle, NULL ); return( -1 ); } if( libbfio_pool_append_handle( pool, &pool_entry, file_io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle: %d to pool.", function, name_iterator ); libbfio_handle_free( &file_io_handle, NULL ); return( -1 ); } file_io_handle = NULL; } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Appends file handles to the pool for the corresponding filenames * Returns 1 if successful or -1 on error */ int libbfio_file_pool_append_handles_for_names_wide( libbfio_pool_t *pool, wchar_t * const names[], int number_of_names, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libbfio_file_pool_append_handles_for_names_wide"; size_t name_length = 0; int pool_entry = 0; int name_iterator = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( names == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid names.", function ); return( -1 ); } if( number_of_names <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of names zero or less.", function ); return( -1 ); } for( name_iterator = 0; name_iterator < number_of_names; name_iterator++ ) { name_length = wide_string_length( names[ name_iterator ] ); if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle: %d.", function, name_iterator ); return( -1 ); } if( libbfio_file_set_name_wide( file_io_handle, names[ name_iterator ], name_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle: %d.", function, name_iterator ); libbfio_handle_free( &file_io_handle, NULL ); return( -1 ); } if( libbfio_pool_append_handle( pool, &pool_entry, file_io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle: %d to pool.", function, name_iterator ); libbfio_handle_free( &file_io_handle, NULL ); return( -1 ); } file_io_handle = NULL; } return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libbfio/libbfio_file.c0000664000175000017500000002522513443450015021515 0ustar00lordyestalordyesta00000000000000/* * File functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #include "libbfio_definitions.h" #include "libbfio_file.h" #include "libbfio_file_io_handle.h" #include "libbfio_handle.h" #include "libbfio_libcerror.h" #include "libbfio_libcpath.h" #include "libbfio_types.h" /* Creates a file handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_file_initialize( libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_file_io_handle_t *file_io_handle = NULL; static char *function = "libbfio_file_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } if( libbfio_file_io_handle_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } if( libbfio_handle_initialize( handle, (intptr_t *) file_io_handle, (int (*)(intptr_t **, libcerror_error_t **)) libbfio_file_io_handle_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) libbfio_file_io_handle_clone, (int (*)(intptr_t *, int, libcerror_error_t **)) libbfio_file_io_handle_open, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_file_io_handle_close, (ssize_t (*)(intptr_t *, uint8_t *, size_t, libcerror_error_t **)) libbfio_file_io_handle_read_buffer, (ssize_t (*)(intptr_t *, const uint8_t *, size_t, libcerror_error_t **)) libbfio_file_io_handle_write_buffer, (off64_t (*)(intptr_t *, off64_t, int, libcerror_error_t **)) libbfio_file_io_handle_seek_offset, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_file_io_handle_exists, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_file_io_handle_is_open, (int (*)(intptr_t *, size64_t *, libcerror_error_t **)) libbfio_file_io_handle_get_size, LIBBFIO_FLAG_IO_HANDLE_MANAGED | LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_file_io_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Retrieves the name size of the file handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_get_name_size( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_get_name_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_io_handle_get_name_size( (libbfio_file_io_handle_t *) internal_handle->io_handle, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_get_name( libbfio_handle_t *handle, char *name, size_t name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_get_name"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_io_handle_get_name( (libbfio_file_io_handle_t *) internal_handle->io_handle, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file handle * Returns 1 if succesful or -1 on error */ int libbfio_file_set_name( libbfio_handle_t *handle, const char *name, size_t name_length, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; char *full_name = NULL; static char *function = "libbfio_file_set_name"; size_t full_name_size = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libcpath_path_get_full_path( name, name_length, &full_name, &full_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to determine full path.", function ); goto on_error; } if( libbfio_file_io_handle_set_name( (libbfio_file_io_handle_t *) internal_handle->io_handle, full_name, full_name_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name.", function ); goto on_error; } if( ( full_name != NULL ) && ( full_name != name ) ) { memory_free( full_name ); } return( 1 ); on_error: if( ( full_name != NULL ) && ( full_name != name ) ) { memory_free( full_name ); } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the name size of the file handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_get_name_size_wide( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_get_name_size_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_io_handle_get_name_size_wide( (libbfio_file_io_handle_t *) internal_handle->io_handle, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_get_name_wide( libbfio_handle_t *handle, wchar_t *name, size_t name_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_file_get_name_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_file_io_handle_get_name_wide( (libbfio_file_io_handle_t *) internal_handle->io_handle, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve name.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file handle * Returns 1 if succesful or -1 on error */ int libbfio_file_set_name_wide( libbfio_handle_t *handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; wchar_t *full_name = NULL; static char *function = "libbfio_file_set_name_wide"; size_t full_name_size = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libcpath_path_get_full_path_wide( name, name_length, &full_name, &full_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to determine full path.", function ); goto on_error; } if( libbfio_file_io_handle_set_name_wide( (libbfio_file_io_handle_t *) internal_handle->io_handle, full_name, full_name_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name.", function ); goto on_error; } if( ( full_name != NULL ) && ( full_name != name ) ) { memory_free( full_name ); } return( 1 ); on_error: if( ( full_name != NULL ) && ( full_name != name ) ) { memory_free( full_name ); } return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libbfio/libbfio_pool.h0000664000175000017500000001347213443450015021555 0ustar00lordyestalordyesta00000000000000/* * The internal pool functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_POOL_H ) #define _LIBBFIO_POOL_H #include #include #include "libbfio_extern.h" #include "libbfio_libcdata.h" #include "libbfio_libcerror.h" #include "libbfio_libcthreads.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libbfio_internal_pool libbfio_internal_pool_t; struct libbfio_internal_pool { /* The number of used handles in the pool */ int number_of_used_handles; /* The number of open handles in the pool */ int number_of_open_handles; /* The maximum number of open handles in the pool */ int maximum_number_of_open_handles; /* The handles array */ libcdata_array_t *handles_array; /* A list containing the file IO handles in order of the last use * it starts with the last used at the beginning of the list * the value of the list element refers to the corresponding file IO handle */ libcdata_list_t *last_used_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBBFIO_EXTERN \ int libbfio_pool_initialize( libbfio_pool_t **pool, int number_of_handles, int maximum_number_of_open_handles, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_free( libbfio_pool_t **pool, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_clone( libbfio_pool_t **destination_pool, libbfio_pool_t *source_pool, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_resize( libbfio_pool_t *pool, int number_of_handles, libcerror_error_t **error ); int libbfio_internal_pool_open_handle( libbfio_internal_pool_t *internal_pool, libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ); int libbfio_internal_pool_append_handle_to_last_used_list( libbfio_internal_pool_t *internal_pool, const libbfio_handle_t *handle, libcerror_error_t **error ); int libbfio_internal_pool_move_handle_to_front_of_last_used_list( libbfio_internal_pool_t *internal_pool, libbfio_handle_t *handle, libcerror_error_t **error ); int libbfio_internal_pool_remove_handle_from_last_used_list( libbfio_internal_pool_t *internal_pool, const libbfio_handle_t *handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_get_number_of_handles( libbfio_pool_t *pool, int *number_of_handles, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_get_handle( libbfio_pool_t *pool, int entry, libbfio_handle_t **handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_append_handle( libbfio_pool_t *pool, int *entry, libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_set_handle( libbfio_pool_t *pool, int entry, libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_remove_handle( libbfio_pool_t *pool, int entry, libbfio_handle_t **handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_get_maximum_number_of_open_handles( libbfio_pool_t *pool, int *maximum_number_of_open_handles, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_set_maximum_number_of_open_handles( libbfio_pool_t *pool, int maximum_number_of_open_handles, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_open( libbfio_pool_t *pool, int entry, int access_flags, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_reopen( libbfio_pool_t *pool, int entry, int access_flags, libcerror_error_t **error ); int libbfio_internal_pool_close( libbfio_internal_pool_t *internal_pool, int entry, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_close( libbfio_pool_t *pool, int entry, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_close_all( libbfio_pool_t *pool, libcerror_error_t **error ); LIBBFIO_EXTERN \ ssize_t libbfio_pool_read_buffer( libbfio_pool_t *pool, int entry, uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBBFIO_EXTERN \ ssize_t libbfio_pool_write_buffer( libbfio_pool_t *pool, int entry, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBBFIO_EXTERN \ off64_t libbfio_pool_seek_offset( libbfio_pool_t *pool, int entry, off64_t offset, int whence, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_get_offset( libbfio_pool_t *pool, int entry, off64_t *offset, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_pool_get_size( libbfio_pool_t *pool, int entry, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_POOL_H ) */ libewf-20140807/libbfio/libbfio_file_range.h0000664000175000017500000000511013443450015022665 0ustar00lordyestalordyesta00000000000000/* * File range functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_FILE_RANGE_H ) #define _LIBBFIO_FILE_RANGE_H #include #include #include "libbfio_extern.h" #include "libbfio_libcerror.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBBFIO_EXTERN \ int libbfio_file_range_initialize( libbfio_handle_t **handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_range_get_name_size( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_range_get_name( libbfio_handle_t *handle, char *name, size_t name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_range_set_name( libbfio_handle_t *handle, const char *name, size_t name_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBBFIO_EXTERN \ int libbfio_file_range_get_name_size_wide( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_range_get_name_wide( libbfio_handle_t *handle, wchar_t *name, size_t name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_range_set_name_wide( libbfio_handle_t *handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBBFIO_EXTERN \ int libbfio_file_range_get( libbfio_handle_t *handle, off64_t *range_offset, size64_t *range_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_range_set( libbfio_handle_t *handle, off64_t range_offset, size64_t range_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_FILE_RANGE_H ) */ libewf-20140807/libbfio/libbfio_system_string.h0000664000175000017500000000540013443450015023506 0ustar00lordyestalordyesta00000000000000/* * System string functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_SYSTEM_STRING_H ) #define _LIBBFIO_SYSTEM_STRING_H #include #include #include "libbfio_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libbfio_system_string_size_to_narrow_string( const system_character_t *system_string, size_t system_string_size, size_t *narrow_string_size, libcerror_error_t **error ); int libbfio_system_string_copy_to_narrow_string( const system_character_t *system_string, size_t system_string_size, char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ); int libbfio_system_string_size_from_narrow_string( const char *narrow_string, size_t narrow_string_size, size_t *system_string_size, libcerror_error_t **error ); int libbfio_system_string_copy_from_narrow_string( system_character_t *system_string, size_t system_string_size, const char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libbfio_system_string_size_to_wide_string( const system_character_t *system_string, size_t system_string_size, size_t *wide_string_size, libcerror_error_t **error ); int libbfio_system_string_copy_to_wide_string( const system_character_t *system_string, size_t system_string_size, wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ); int libbfio_system_string_size_from_wide_string( const wchar_t *wide_string, size_t wide_string_size, size_t *system_string_size, libcerror_error_t **error ); int libbfio_system_string_copy_from_wide_string( system_character_t *system_string, size_t system_string_size, const wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_SYSTEM_STRING_H ) */ libewf-20140807/libbfio/libbfio_file_io_handle.h0000664000175000017500000000776713443450015023537 0ustar00lordyestalordyesta00000000000000/* * File IO handle functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_FILE_IO_HANDLE_H ) #define _LIBBFIO_FILE_IO_HANDLE_H #include #include #include "libbfio_libcerror.h" #include "libbfio_libcfile.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libbfio_file_io_handle libbfio_file_io_handle_t; struct libbfio_file_io_handle { /* The name */ system_character_t *name; /* The size of the name */ size_t name_size; /* The file (handle) */ libcfile_file_t *file; /* The access flags */ int access_flags; }; int libbfio_file_io_handle_initialize( libbfio_file_io_handle_t **file_io_handle, libcerror_error_t **error ); int libbfio_file_io_handle_free( libbfio_file_io_handle_t **file_io_handle, libcerror_error_t **error ); int libbfio_file_io_handle_clone( libbfio_file_io_handle_t **destination_file_io_handle, libbfio_file_io_handle_t *source_file_io_handle, libcerror_error_t **error ); int libbfio_file_io_handle_get_name_size( libbfio_file_io_handle_t *file_io_handle, size_t *name_size, libcerror_error_t **error ); int libbfio_file_io_handle_get_name( libbfio_file_io_handle_t *file_io_handle, char *name, size_t name_size, libcerror_error_t **error ); int libbfio_file_io_handle_set_name( libbfio_file_io_handle_t *file_io_handle, const char *name, size_t name_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libbfio_file_io_handle_get_name_size_wide( libbfio_file_io_handle_t *file_io_handle, size_t *name_size, libcerror_error_t **error ); int libbfio_file_io_handle_get_name_wide( libbfio_file_io_handle_t *file_io_handle, wchar_t *name, size_t name_size, libcerror_error_t **error ); int libbfio_file_io_handle_set_name_wide( libbfio_file_io_handle_t *file_io_handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ int libbfio_file_io_handle_open( libbfio_file_io_handle_t *file_io_handle, int access_flags, libcerror_error_t **error ); int libbfio_file_io_handle_close( libbfio_file_io_handle_t *file_io_handle, libcerror_error_t **error ); ssize_t libbfio_file_io_handle_read_buffer( libbfio_file_io_handle_t *file_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t libbfio_file_io_handle_write_buffer( libbfio_file_io_handle_t *file_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); off64_t libbfio_file_io_handle_seek_offset( libbfio_file_io_handle_t *file_io_handle, off64_t offset, int whence, libcerror_error_t **error ); int libbfio_file_io_handle_exists( libbfio_file_io_handle_t *file_io_handle, libcerror_error_t **error ); int libbfio_file_io_handle_is_open( libbfio_file_io_handle_t *file_io_handle, libcerror_error_t **error ); int libbfio_file_io_handle_get_size( libbfio_file_io_handle_t *file_io_handle, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_FILE_IO_HANDLE_H ) */ libewf-20140807/libbfio/libbfio_memory_range_io_handle.c0000664000175000017500000005065413443450015025270 0ustar00lordyestalordyesta00000000000000/* * Memory range IO handle functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libbfio_definitions.h" #include "libbfio_libcerror.h" #include "libbfio_memory_range_io_handle.h" /* Creates a memory range IO handle * Make sure the value memory_range_io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_memory_range_io_handle_initialize( libbfio_memory_range_io_handle_t **memory_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_initialize"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( *memory_range_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid memory range IO handle value already set.", function ); return( -1 ); } *memory_range_io_handle = memory_allocate_structure( libbfio_memory_range_io_handle_t ); if( *memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create memory range IO handle.", function ); goto on_error; } if( memory_set( *memory_range_io_handle, 0, sizeof( libbfio_memory_range_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear memory range IO handle.", function ); goto on_error; } return( 1 ); on_error: if( *memory_range_io_handle != NULL ) { memory_free( *memory_range_io_handle ); *memory_range_io_handle = NULL; } return( -1 ); } /* Frees a memory range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_memory_range_io_handle_free( libbfio_memory_range_io_handle_t **memory_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_free"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( *memory_range_io_handle != NULL ) { memory_free( *memory_range_io_handle ); *memory_range_io_handle = NULL; } return( 1 ); } /* Clones (duplicates) the memory range IO handle and its attributes * Returns 1 if succesful or -1 on error */ int libbfio_memory_range_io_handle_clone( libbfio_memory_range_io_handle_t **destination_memory_range_io_handle, libbfio_memory_range_io_handle_t *source_memory_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_clone"; if( destination_memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination memory range IO handle.", function ); return( -1 ); } if( *destination_memory_range_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination memory range IO handle already set.", function ); return( -1 ); } if( source_memory_range_io_handle == NULL ) { *destination_memory_range_io_handle = NULL; return( 1 ); } if( libbfio_memory_range_io_handle_initialize( destination_memory_range_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create memory range IO handle.", function ); return( -1 ); } if( *destination_memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination memory range IO handle.", function ); return( -1 ); } ( *destination_memory_range_io_handle )->range_start = source_memory_range_io_handle->range_start; ( *destination_memory_range_io_handle )->range_size = source_memory_range_io_handle->range_size; ( *destination_memory_range_io_handle )->range_offset = source_memory_range_io_handle->range_offset; ( *destination_memory_range_io_handle )->access_flags = source_memory_range_io_handle->access_flags; return( 1 ); } /* Retrieves the range of the memory range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_memory_range_io_handle_get( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t **range_start, size_t *range_size, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_get"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range start.", function ); return( -1 ); } if( range_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range size.", function ); return( -1 ); } *range_start = memory_range_io_handle->range_start; *range_size = memory_range_io_handle->range_size; return( 1 ); } /* Sets the range of the memory range IO handle * Returns 1 if succesful or -1 on error */ int libbfio_memory_range_io_handle_set( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t *range_start, size_t range_size, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_set"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range start.", function ); return( -1 ); } if( range_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range size value exceeds maximum.", function ); return( -1 ); } memory_range_io_handle->range_start = range_start; memory_range_io_handle->range_size = range_size; return( 1 ); } /* Opens the memory range IO handle * Returns 1 if successful or -1 on error */ int libbfio_memory_range_io_handle_open( libbfio_memory_range_io_handle_t *memory_range_io_handle, int access_flags, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_open"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - missing range start.", function ); return( -1 ); } if( memory_range_io_handle->is_open != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid memory range IO handle - already open.", function ); return( -1 ); } /* Either read or write flag should be set */ if( ( ( access_flags & LIBBFIO_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags: 0x%02x.", function ); return( -1 ); } memory_range_io_handle->range_offset = 0; memory_range_io_handle->access_flags = access_flags; memory_range_io_handle->is_open = 1; return( 1 ); } /* Closes the memory range IO handle * Returns 0 if successful or -1 on error */ int libbfio_memory_range_io_handle_close( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_close"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - missing range start.", function ); return( -1 ); } if( memory_range_io_handle->is_open == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - not open.", function ); return( -1 ); } memory_range_io_handle->is_open = 0; return( 0 ); } /* Reads a buffer from the memory range IO handle * Returns the number of bytes read if successful, or -1 on error */ ssize_t libbfio_memory_range_io_handle_read_buffer( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_read_buffer"; size_t read_size = 0; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - invalid range start.", function ); return( -1 ); } if( memory_range_io_handle->is_open == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - not open.", function ); return( -1 ); } if( ( memory_range_io_handle->access_flags & LIBBFIO_ACCESS_FLAG_READ ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - no read access.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( memory_range_io_handle->range_offset > memory_range_io_handle->range_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: range offset exceeds range size.", function ); return( -1 ); } /* Check if the end of the data was reached */ if( memory_range_io_handle->range_offset == memory_range_io_handle->range_size ) { return( 0 ); } /* Check the amount of data available */ read_size = memory_range_io_handle->range_size - memory_range_io_handle->range_offset; /* Cannot read more data than available */ if( read_size > size ) { read_size = size; } if( memory_copy( buffer, &( memory_range_io_handle->range_start[ memory_range_io_handle->range_offset ] ), read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to read buffer from memory range.", function ); return( -1 ); } memory_range_io_handle->range_offset += read_size; return( (ssize_t) read_size ); } /* Writes a buffer to the memory range IO handle * Returns the number of bytes written if successful, or -1 on error */ ssize_t libbfio_memory_range_io_handle_write_buffer( libbfio_memory_range_io_handle_t *memory_range_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_write_buffer"; size_t write_size = 0; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - invalid range start.", function ); return( -1 ); } if( memory_range_io_handle->is_open == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - not open.", function ); return( -1 ); } if( ( memory_range_io_handle->access_flags & LIBBFIO_ACCESS_FLAG_WRITE ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - no write access.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( memory_range_io_handle->range_offset >= memory_range_io_handle->range_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: range offset exceeds range size.", function ); return( -1 ); } /* Check the amount of data available */ write_size = memory_range_io_handle->range_size - memory_range_io_handle->range_offset; /* Cannot write more data than available */ if( write_size > size ) { write_size = size; } if( memory_copy( &( memory_range_io_handle->range_start[ memory_range_io_handle->range_offset ] ), buffer, size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to write buffer to memory range.", function ); return( -1 ); } memory_range_io_handle->range_offset += write_size; return( (ssize_t) write_size ); } /* Seeks a certain offset within the memory range IO handle * Returns the offset if the seek is successful or -1 on error */ off64_t libbfio_memory_range_io_handle_seek_offset( libbfio_memory_range_io_handle_t *memory_range_io_handle, off64_t offset, int whence, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_seek_offset"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - invalid range start.", function ); return( -1 ); } if( memory_range_io_handle->is_open == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - not open.", function ); return( -1 ); } if( offset > (off64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid offset value exceeds maximum.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( whence == SEEK_CUR ) { offset += memory_range_io_handle->range_offset; } else if( whence == SEEK_END ) { offset += memory_range_io_handle->range_size; } if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } if( offset > (off64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid offset value exceeds maximum.", function ); return( -1 ); } memory_range_io_handle->range_offset = (size_t) offset; return( offset ); } /* Function to determine if a memory range exists * Returns 1 if the memory range exists, 0 if not or -1 on error */ int libbfio_memory_range_io_handle_exists( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_exists"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { return( 0 ); } return( 1 ); } /* Check if the memory range is open * Returns 1 if open, 0 if not or -1 on error */ int libbfio_memory_range_io_handle_is_open( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_is_open"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( ( memory_range_io_handle->range_start == NULL ) || ( memory_range_io_handle->is_open == 0 ) ) { return( 0 ); } return( 1 ); } /* Retrieves the memory range size * Returns 1 if successful or -1 on error */ int libbfio_memory_range_io_handle_get_size( libbfio_memory_range_io_handle_t *memory_range_io_handle, size64_t *size, libcerror_error_t **error ) { static char *function = "libbfio_memory_range_io_handle_get_size"; if( memory_range_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid memory range IO handle.", function ); return( -1 ); } if( memory_range_io_handle->range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid memory range IO handle - invalid range start.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } *size = (size64_t) memory_range_io_handle->range_size; return( 1 ); } libewf-20140807/libbfio/libbfio_file.h0000664000175000017500000000427413443450015021523 0ustar00lordyestalordyesta00000000000000/* * File functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_FILE_H ) #define _LIBBFIO_FILE_H #include #include #include "libbfio_extern.h" #include "libbfio_libcerror.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBBFIO_EXTERN \ int libbfio_file_initialize( libbfio_handle_t **handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_get_name_size( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_get_name( libbfio_handle_t *handle, char *name, size_t name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_set_name( libbfio_handle_t *handle, const char *name, size_t name_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBBFIO_EXTERN \ int libbfio_file_get_name_size_wide( libbfio_handle_t *handle, size_t *name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_get_name_wide( libbfio_handle_t *handle, wchar_t *name, size_t name_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_file_set_name_wide( libbfio_handle_t *handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_FILE_H ) */ libewf-20140807/libbfio/libbfio_support.c0000664000175000017500000000442613443450015022312 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include "libbfio_definitions.h" #include "libbfio_libcerror.h" #include "libbfio_libclocale.h" #include "libbfio_support.h" #if !defined( HAVE_LOCAL_LIBBFIO ) /* Returns the library version as a string */ const char *libbfio_get_version( void ) { return( (const char *) LIBBFIO_VERSION_STRING ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libbfio_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libbfio_get_codepage"; if( libclocale_codepage_get( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libbfio_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libbfio_set_codepage"; if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBBFIO ) */ libewf-20140807/libbfio/libbfio_file_pool.h0000664000175000017500000000315213443450015022546 0ustar00lordyestalordyesta00000000000000/* * File pool functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_FILE_POOL_H ) #define _LIBBFIO_FILE_POOL_H #include #include #include "libbfio_extern.h" #include "libbfio_libcerror.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBBFIO_EXTERN \ int libbfio_file_pool_append_handles_for_names( libbfio_pool_t *pool, char * const names[], int number_of_names, int access_flags, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBBFIO_EXTERN \ int libbfio_file_pool_append_handles_for_names_wide( libbfio_pool_t *pool, wchar_t * const names[], int number_of_names, int access_flags, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_FILE_POOL_H ) */ libewf-20140807/libbfio/libbfio_memory_range_io_handle.h0000664000175000017500000000737513443450015025277 0ustar00lordyestalordyesta00000000000000/* * Memory range IO handle functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_MEMORY_RANGE_IO_HANDLE_H ) #define _LIBBFIO_MEMORY_RANGE_IO_HANDLE_H #include #include #include "libbfio_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libbfio_memory_range_io_handle libbfio_memory_range_io_handle_t; struct libbfio_memory_range_io_handle { /* The start of the memory range */ uint8_t *range_start; /* The size of the memory range */ size_t range_size; /* The current offset in the memory range */ size_t range_offset; /* Value to indicate the memory range is open */ uint8_t is_open; /* The current access flags */ int access_flags; }; int libbfio_memory_range_io_handle_initialize( libbfio_memory_range_io_handle_t **memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_free( libbfio_memory_range_io_handle_t **memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_clone( libbfio_memory_range_io_handle_t **destination_memory_range_io_handle, libbfio_memory_range_io_handle_t *source_memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_get( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t **range_start, size_t *range_size, libcerror_error_t **error ); int libbfio_memory_range_io_handle_set( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t *range_start, size_t range_size, libcerror_error_t **error ); int libbfio_memory_range_io_handle_open( libbfio_memory_range_io_handle_t *memory_range_io_handle, int access_flags, libcerror_error_t **error ); int libbfio_memory_range_io_handle_close( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ); ssize_t libbfio_memory_range_io_handle_read_buffer( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t libbfio_memory_range_io_handle_write_buffer( libbfio_memory_range_io_handle_t *memory_range_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); off64_t libbfio_memory_range_io_handle_seek_offset( libbfio_memory_range_io_handle_t *memory_range_io_handle, off64_t offset, int whence, libcerror_error_t **error ); int libbfio_memory_range_io_handle_exists( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_is_open( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_get_size( libbfio_memory_range_io_handle_t *memory_range_io_handle, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_MEMORY_RANGE_IO_HANDLE_H ) */ libewf-20140807/libbfio/libbfio_error.h0000664000175000017500000000335613443450015021735 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_INTERNAL_ERROR_H ) #define _LIBBFIO_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBBFIO ) #include #endif #include "libbfio_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBBFIO ) LIBBFIO_EXTERN \ void libbfio_error_free( libbfio_error_t **error ); LIBBFIO_EXTERN \ int libbfio_error_fprint( libbfio_error_t *error, FILE *stream ); LIBBFIO_EXTERN \ int libbfio_error_sprint( libbfio_error_t *error, char *string, size_t size ); LIBBFIO_EXTERN \ int libbfio_error_backtrace_fprint( libbfio_error_t *error, FILE *stream ); LIBBFIO_EXTERN \ int libbfio_error_backtrace_sprint( libbfio_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBBFIO ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_INTERNAL_ERROR_H ) */ libewf-20140807/libbfio/libbfio_libcthreads.h0000664000175000017500000000360013443450015023060 0ustar00lordyestalordyesta00000000000000/* * The libcthreads header wrapper * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBCTHREADS_H ) #define _LIBBFIO_LIBCTHREADS_H #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) #define HAVE_LIBBFIO_MULTI_THREAD_SUPPORT #endif #if defined( HAVE_LIBBFIO_MULTI_THREAD_SUPPORT ) /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads */ #if defined( HAVE_LOCAL_LIBCTHREADS ) #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCTHREADS_DLL_IMPORT * before including libcthreads.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCTHREADS_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCTHREADS ) */ #endif /* defined( HAVE_LIBBFIO_MULTI_THREAD_SUPPORT ) */ #endif /* !defined( _LIBBFIO_LIBCTHREADS_H ) */ libewf-20140807/libbfio/libbfio_system_string.c0000664000175000017500000006170613443450015023514 0ustar00lordyestalordyesta00000000000000/* * System string functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #include #include #include #include "libbfio_libcerror.h" #include "libbfio_libclocale.h" #include "libbfio_libuna.h" #include "libbfio_system_string.h" #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 #error Unsupported size of wchar_t #endif /* Determines the size of a narrow string from a system string * Returns 1 if successful or -1 on error */ int libbfio_system_string_size_to_narrow_string( const system_character_t *system_string, size_t system_string_size, size_t *narrow_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_size_to_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) system_string, system_string_size, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) system_string, system_string_size, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) system_string, system_string_size, libclocale_codepage, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) system_string, system_string_size, libclocale_codepage, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow string size.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string size.", function ); return( -1 ); } *narrow_string_size = system_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string to a narrow string * Returns 1 if successful or -1 on error */ int libbfio_system_string_copy_to_narrow_string( const system_character_t *system_string, size_t system_string_size, char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_copy_to_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) narrow_string, narrow_string_size, (libuna_utf32_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) narrow_string, narrow_string_size, (libuna_utf16_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, (libuna_utf32_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, (libuna_utf16_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set narrow string.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string_size < system_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid narrow string size value too small.", function ); return( -1 ); } if( system_string_copy( narrow_string, system_string, system_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set narrow string.", function ); return( -1 ); } narrow_string[ system_string_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Determines the size of a system string from a narrow string * Returns 1 if successful or -1 on error */ int libbfio_system_string_size_from_narrow_string( const char *narrow_string, size_t narrow_string_size, size_t *system_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_size_from_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) narrow_string, narrow_string_size, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) narrow_string, narrow_string_size, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine system string size.", function ); return( -1 ); } #else if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string size.", function ); return( -1 ); } *system_string_size = narrow_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string from a narrow string * Returns 1 if successful or -1 on error */ int libbfio_system_string_copy_from_narrow_string( system_character_t *system_string, size_t system_string_size, const char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_copy_from_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) system_string, system_string_size, (libuna_utf8_character_t *) narrow_string, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) system_string, system_string_size, (libuna_utf8_character_t *) narrow_string, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) system_string, system_string_size, (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) system_string, system_string_size, (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set system string.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size < narrow_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid system string size value too small.", function ); return( -1 ); } if( system_string_copy( system_string, narrow_string, narrow_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set narrow string.", function ); return( -1 ); } system_string[ narrow_string_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Determines the size of a wide string from a system string * Returns 1 if successful or -1 on error */ int libbfio_system_string_size_to_wide_string( const system_character_t *system_string, size_t system_string_size, size_t *wide_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_size_to_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string size.", function ); return( -1 ); } *wide_string_size = system_string_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) system_string, system_string_size, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) system_string, system_string_size, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) system_string, system_string_size, libclocale_codepage, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) system_string, system_string_size, libclocale_codepage, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide string size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string to a wide string * Returns 1 if successful or -1 on error */ int libbfio_system_string_copy_to_wide_string( const system_character_t *system_string, size_t system_string_size, wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_copy_to_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( wide_string_size < system_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid wide string size value too small.", function ); return( -1 ); } if( system_string_copy( wide_string, system_string, system_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set wide string.", function ); return( -1 ); } wide_string[ system_string_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) wide_string, wide_string_size, (libuna_utf8_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) wide_string, wide_string_size, (libuna_utf8_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) wide_string, wide_string_size, (uint8_t *) system_string, system_string_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) wide_string, wide_string_size, (uint8_t *) system_string, system_string_size, libclocale_codepage, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set wide string.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Determines the size of a system string from a wide string * Returns 1 if successful or -1 on error */ int libbfio_system_string_size_from_wide_string( const wchar_t *wide_string, size_t wide_string_size, size_t *system_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_size_from_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string size.", function ); return( -1 ); } *system_string_size = wide_string_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) wide_string, wide_string_size, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) wide_string, wide_string_size, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) wide_string, wide_string_size, libclocale_codepage, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) wide_string, wide_string_size, libclocale_codepage, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide string size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string from a wide string * Returns 1 if successful or -1 on error */ int libbfio_system_string_copy_from_wide_string( system_character_t *system_string, size_t system_string_size, const wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ) { static char *function = "libbfio_system_string_copy_from_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size < wide_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid system string size value too small.", function ); return( -1 ); } if( system_string_copy( system_string, wide_string, wide_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set wide string.", function ); return( -1 ); } system_string[ wide_string_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) system_string, system_string_size, (libuna_utf32_character_t *) wide_string, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) system_string, system_string_size, (libuna_utf16_character_t *) wide_string, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) system_string, system_string_size, libclocale_codepage, (libuna_utf32_character_t *) wide_string, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) system_string, system_string_size, libclocale_codepage, (libuna_utf16_character_t *) wide_string, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set wide string.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libbfio/libbfio_memory_range.h0000664000175000017500000000310013443450015023253 0ustar00lordyestalordyesta00000000000000/* * Memory range functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_MEMORY_RANGE_H ) #define _LIBBFIO_MEMORY_RANGE_H #include #include #include "libbfio_extern.h" #include "libbfio_libcerror.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBBFIO_EXTERN \ int libbfio_memory_range_initialize( libbfio_handle_t **handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_memory_range_get( libbfio_handle_t *handle, uint8_t **range_start, size_t *range_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_memory_range_set( libbfio_handle_t *handle, uint8_t *range_start, size_t range_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_MEMORY_RANGE_H ) */ libewf-20140807/libbfio/libbfio_file_range_io_handle.h0000664000175000017500000001131013443450015024666 0ustar00lordyestalordyesta00000000000000/* * File range IO handle functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_FILE_RANGE_IO_HANDLE_H ) #define _LIBBFIO_FILE_RANGE_IO_HANDLE_H #include #include #include "libbfio_file_io_handle.h" #include "libbfio_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libbfio_file_range_io_handle libbfio_file_range_io_handle_t; struct libbfio_file_range_io_handle { /* The file IO handle */ libbfio_file_io_handle_t *file_io_handle; /* The range (start) offset */ off64_t range_offset; /* The range size */ size64_t range_size; }; int libbfio_file_range_io_handle_initialize( libbfio_file_range_io_handle_t **file_range_io_handle, libcerror_error_t **error ); int libbfio_file_range_io_handle_free( libbfio_file_range_io_handle_t **file_range_io_handle, libcerror_error_t **error ); int libbfio_file_range_io_handle_clone( libbfio_file_range_io_handle_t **destination_file_range_io_handle, libbfio_file_range_io_handle_t *source_file_range_io_handle, libcerror_error_t **error ); int libbfio_file_range_io_handle_get_name_size( libbfio_file_range_io_handle_t *file_range_io_handle, size_t *name_size, libcerror_error_t **error ); int libbfio_file_range_io_handle_get_name( libbfio_file_range_io_handle_t *file_range_io_handle, char *name, size_t name_size, libcerror_error_t **error ); int libbfio_file_range_io_handle_set_name( libbfio_file_range_io_handle_t *file_range_io_handle, const char *name, size_t name_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libbfio_file_range_io_handle_get_name_size_wide( libbfio_file_range_io_handle_t *file_range_io_handle, size_t *name_size, libcerror_error_t **error ); int libbfio_file_range_io_handle_get_name_wide( libbfio_file_range_io_handle_t *file_range_io_handle, wchar_t *name, size_t name_size, libcerror_error_t **error ); int libbfio_file_range_io_handle_set_name_wide( libbfio_file_range_io_handle_t *file_range_io_handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ int libbfio_file_range_io_handle_get( libbfio_file_range_io_handle_t *file_range_io_handle, off64_t *range_offset, size64_t *range_size, libcerror_error_t **error ); int libbfio_file_range_io_handle_set( libbfio_file_range_io_handle_t *file_range_io_handle, off64_t range_offset, size64_t range_size, libcerror_error_t **error ); int libbfio_file_range_io_handle_open( libbfio_file_range_io_handle_t *file_range_io_handle, int access_flags, libcerror_error_t **error ); int libbfio_file_range_io_handle_close( libbfio_file_range_io_handle_t *file_range_io_handle, libcerror_error_t **error ); ssize_t libbfio_file_range_io_handle_read_buffer( libbfio_file_range_io_handle_t *file_range_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t libbfio_file_range_io_handle_write_buffer( libbfio_file_range_io_handle_t *file_range_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); off64_t libbfio_file_range_io_handle_seek_offset( libbfio_file_range_io_handle_t *file_range_io_handle, off64_t offset, int whence, libcerror_error_t **error ); int libbfio_file_range_io_handle_exists( libbfio_file_range_io_handle_t *file_range_io_handle, libcerror_error_t **error ); int libbfio_file_range_io_handle_is_open( libbfio_file_range_io_handle_t *file_range_io_handle, libcerror_error_t **error ); int libbfio_file_range_io_handle_get_size( libbfio_file_range_io_handle_t *file_range_io_handle, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_FILE_RANGE_IO_HANDLE_H ) */ libewf-20140807/libbfio/libbfio_memory_range.c0000664000175000017500000001327713443450015023266 0ustar00lordyestalordyesta00000000000000/* * Memory range functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libbfio_definitions.h" #include "libbfio_handle.h" #include "libbfio_libcerror.h" #include "libbfio_memory_range.h" #include "libbfio_memory_range_io_handle.h" #include "libbfio_types.h" /* Creates a memory range handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_memory_range_initialize( libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_memory_range_io_handle_t *memory_range_io_handle = NULL; static char *function = "libbfio_memory_range_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } if( libbfio_memory_range_io_handle_initialize( &memory_range_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create memory range IO handle.", function ); goto on_error; } if( libbfio_handle_initialize( handle, (intptr_t *) memory_range_io_handle, (int (*)(intptr_t **, libcerror_error_t **)) libbfio_memory_range_io_handle_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) libbfio_memory_range_io_handle_clone, (int (*)(intptr_t *, int, libcerror_error_t **)) libbfio_memory_range_io_handle_open, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_memory_range_io_handle_close, (ssize_t (*)(intptr_t *, uint8_t *, size_t, libcerror_error_t **)) libbfio_memory_range_io_handle_read_buffer, (ssize_t (*)(intptr_t *, const uint8_t *, size_t, libcerror_error_t **)) libbfio_memory_range_io_handle_write_buffer, (off64_t (*)(intptr_t *, off64_t, int, libcerror_error_t **)) libbfio_memory_range_io_handle_seek_offset, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_memory_range_io_handle_exists, (int (*)(intptr_t *, libcerror_error_t **)) libbfio_memory_range_io_handle_is_open, (int (*)(intptr_t *, size64_t *, libcerror_error_t **)) libbfio_memory_range_io_handle_get_size, LIBBFIO_FLAG_IO_HANDLE_MANAGED | LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); goto on_error; } return( 1 ); on_error: if( memory_range_io_handle != NULL ) { libbfio_memory_range_io_handle_free( &memory_range_io_handle, NULL ); } return( -1 ); } /* Retrieves the range of the memory range handle * Returns 1 if succesful or -1 on error */ int libbfio_memory_range_get( libbfio_handle_t *handle, uint8_t **range_start, size_t *range_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_memory_range_get"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_memory_range_io_handle_get( (libbfio_memory_range_io_handle_t *) internal_handle->io_handle, range_start, range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range from file IO handle.", function ); return( -1 ); } return( 1 ); } /* Sets the range of the memory range handle * Returns 1 if succesful or -1 on error */ int libbfio_memory_range_set( libbfio_handle_t *handle, uint8_t *range_start, size_t range_size, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_memory_range_set"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_memory_range_io_handle_set( (libbfio_memory_range_io_handle_t *) internal_handle->io_handle, range_start, range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set range in file IO handle.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libbfio/Makefile.in0000664000175000017500000011023213443455347021017 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libbfio ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbfio_la_LIBADD = am__libbfio_la_SOURCES_DIST = libbfio_codepage.h libbfio_definitions.h \ libbfio_error.c libbfio_error.h libbfio_extern.h \ libbfio_file.c libbfio_file.h libbfio_file_io_handle.c \ libbfio_file_io_handle.h libbfio_file_pool.c \ libbfio_file_pool.h libbfio_file_range.c libbfio_file_range.h \ libbfio_file_range_io_handle.c libbfio_file_range_io_handle.h \ libbfio_handle.c libbfio_handle.h libbfio_libcdata.h \ libbfio_libcerror.h libbfio_libcfile.h libbfio_libclocale.h \ libbfio_libcpath.h libbfio_libcthreads.h libbfio_libuna.h \ libbfio_memory_range.c libbfio_memory_range.h \ libbfio_memory_range_io_handle.c \ libbfio_memory_range_io_handle.h libbfio_pool.c libbfio_pool.h \ libbfio_support.c libbfio_support.h libbfio_system_string.c \ libbfio_system_string.h libbfio_types.h libbfio_unused.h @HAVE_LOCAL_LIBBFIO_TRUE@am_libbfio_la_OBJECTS = libbfio_error.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_io_handle.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_pool.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_range.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_range_io_handle.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_handle.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_memory_range.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_memory_range_io_handle.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_pool.lo libbfio_support.lo \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_system_string.lo libbfio_la_OBJECTS = $(am_libbfio_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBBFIO_TRUE@am_libbfio_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbfio_error.Plo \ ./$(DEPDIR)/libbfio_file.Plo \ ./$(DEPDIR)/libbfio_file_io_handle.Plo \ ./$(DEPDIR)/libbfio_file_pool.Plo \ ./$(DEPDIR)/libbfio_file_range.Plo \ ./$(DEPDIR)/libbfio_file_range_io_handle.Plo \ ./$(DEPDIR)/libbfio_handle.Plo \ ./$(DEPDIR)/libbfio_memory_range.Plo \ ./$(DEPDIR)/libbfio_memory_range_io_handle.Plo \ ./$(DEPDIR)/libbfio_pool.Plo ./$(DEPDIR)/libbfio_support.Plo \ ./$(DEPDIR)/libbfio_system_string.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbfio_la_SOURCES) DIST_SOURCES = $(am__libbfio_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBBFIO_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBBFIO_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBBFIO_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_LOCAL_LIBBFIO_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBBFIO_TRUE@noinst_LTLIBRARIES = libbfio.la @HAVE_LOCAL_LIBBFIO_TRUE@libbfio_la_SOURCES = \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_codepage.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_definitions.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_error.c libbfio_error.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_extern.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file.c libbfio_file.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_io_handle.c libbfio_file_io_handle.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_pool.c libbfio_file_pool.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_range.c libbfio_file_range.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_file_range_io_handle.c libbfio_file_range_io_handle.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_handle.c libbfio_handle.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libcdata.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libcerror.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libcfile.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libclocale.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libcpath.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libcthreads.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_libuna.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_memory_range.c libbfio_memory_range.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_memory_range_io_handle.c libbfio_memory_range_io_handle.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_pool.c libbfio_pool.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_support.c libbfio_support.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_system_string.c libbfio_system_string.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_types.h \ @HAVE_LOCAL_LIBBFIO_TRUE@ libbfio_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libbfio/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libbfio/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbfio.la: $(libbfio_la_OBJECTS) $(libbfio_la_DEPENDENCIES) $(EXTRA_libbfio_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libbfio_la_rpath) $(libbfio_la_OBJECTS) $(libbfio_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_file_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_file_pool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_file_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_file_range_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_memory_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_memory_range_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_pool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbfio_system_string.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbfio_error.Plo -rm -f ./$(DEPDIR)/libbfio_file.Plo -rm -f ./$(DEPDIR)/libbfio_file_io_handle.Plo -rm -f ./$(DEPDIR)/libbfio_file_pool.Plo -rm -f ./$(DEPDIR)/libbfio_file_range.Plo -rm -f ./$(DEPDIR)/libbfio_file_range_io_handle.Plo -rm -f ./$(DEPDIR)/libbfio_handle.Plo -rm -f ./$(DEPDIR)/libbfio_memory_range.Plo -rm -f ./$(DEPDIR)/libbfio_memory_range_io_handle.Plo -rm -f ./$(DEPDIR)/libbfio_pool.Plo -rm -f ./$(DEPDIR)/libbfio_support.Plo -rm -f ./$(DEPDIR)/libbfio_system_string.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libbfio ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libbfio_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libbfio/libbfio_pool.c0000664000175000017500000023330013443450015021542 0ustar00lordyestalordyesta00000000000000/* * The internal pool functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libbfio_definitions.h" #include "libbfio_handle.h" #include "libbfio_libcdata.h" #include "libbfio_libcerror.h" #include "libbfio_pool.h" #include "libbfio_types.h" /* Creates a pool * Make sure the value pool is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_pool_initialize( libbfio_pool_t **pool, int number_of_handles, int maximum_number_of_open_handles, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_initialize"; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( *pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid pool value already set.", function ); return( -1 ); } if( number_of_handles < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of handles value less than zero.", function ); return( -1 ); } if( maximum_number_of_open_handles < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid maximum number of open handles value less than zero.", function ); return( -1 ); } internal_pool = memory_allocate_structure( libbfio_internal_pool_t ); if( internal_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create pool.", function ); goto on_error; } if( memory_set( internal_pool, 0, sizeof( libbfio_internal_pool_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear pool.", function ); memory_free( internal_pool ); return( -1 ); } if( libcdata_array_initialize( &( internal_pool->handles_array ), number_of_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handles array.", function ); goto on_error; } if( libcdata_list_initialize( &( internal_pool->last_used_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create last used list.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_initialize( &( internal_pool->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif internal_pool->maximum_number_of_open_handles = maximum_number_of_open_handles; *pool = (libbfio_pool_t *) internal_pool; return( 1 ); on_error: if( internal_pool != NULL ) { if( internal_pool->last_used_list != NULL ) { libcdata_list_free( &( internal_pool->last_used_list ), NULL, NULL ); } if( internal_pool->handles_array != NULL ) { libcdata_array_free( &( internal_pool->handles_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libbfio_handle_free, NULL ); } memory_free( internal_pool ); } return( -1 ); } /* Frees a pool * Returns 1 if successful or -1 on error */ int libbfio_pool_free( libbfio_pool_t **pool, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_free"; int result = 1; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( *pool != NULL ) { internal_pool = (libbfio_internal_pool_t *) *pool; *pool = NULL; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_free( &( internal_pool->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( libcdata_array_free( &( internal_pool->handles_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libbfio_handle_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free handles array.", function ); result = -1; } if( libcdata_list_free( &( internal_pool->last_used_list ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free last used list.", function ); result = -1; } memory_free( internal_pool ); } return( result ); } /* Clones (duplicates) the pool * The values in the offsets read list are not duplicated * Returns 1 if successful or -1 on error */ int libbfio_pool_clone( libbfio_pool_t **destination_pool, libbfio_pool_t *source_pool, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_destination_pool = NULL; libbfio_internal_pool_t *internal_source_pool = NULL; static char *function = "libbfio_pool_clone"; if( destination_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination pool.", function ); return( -1 ); } if( *destination_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination pool already set.", function ); return( -1 ); } if( source_pool == NULL ) { *destination_pool = NULL; return( 1 ); } internal_source_pool = (libbfio_internal_pool_t *) source_pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_source_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif internal_destination_pool = memory_allocate_structure( libbfio_internal_pool_t ); if( internal_destination_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination pool.", function ); goto on_error; } if( memory_set( internal_destination_pool, 0, sizeof( libbfio_internal_pool_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination pool.", function ); memory_free( internal_destination_pool ); internal_destination_pool = NULL; goto on_error; } if( libcdata_array_clone( &( internal_destination_pool->handles_array ), internal_source_pool->handles_array, (int (*)(intptr_t **, libcerror_error_t **)) &libbfio_handle_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libbfio_handle_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handles array.", function ); goto on_error; } if( libcdata_list_initialize( &( internal_destination_pool->last_used_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create last used list.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_initialize( &( internal_destination_pool->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif internal_destination_pool->maximum_number_of_open_handles = internal_source_pool->maximum_number_of_open_handles; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_source_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); libbfio_pool_free( (libbfio_pool_t **) &internal_destination_pool, NULL ); return( -1 ); } #endif *destination_pool = (libbfio_pool_t *) internal_destination_pool; return( 1 ); on_error: if( internal_destination_pool != NULL ) { #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( internal_destination_pool->read_write_lock != NULL ) { libcthreads_read_write_lock_free( &( internal_destination_pool->read_write_lock ), NULL ); } #endif if( internal_destination_pool->last_used_list != NULL ) { libcdata_list_free( &( internal_destination_pool->last_used_list ), NULL, NULL ); } if( internal_destination_pool->handles_array != NULL ) { libcdata_array_free( &( internal_destination_pool->handles_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libbfio_handle_free, NULL ); } memory_free( internal_destination_pool ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_read( internal_source_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Resizes the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_resize( libbfio_pool_t *pool, int number_of_handles, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_resize"; int result = 1; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_resize( internal_pool->handles_array, number_of_handles, (int (*)(intptr_t **, libcerror_error_t **)) &libbfio_handle_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to resize handles array.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); } /* Opens the handle * Returns 1 if successful or -1 on error */ int libbfio_internal_pool_open_handle( libbfio_internal_pool_t *internal_pool, libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_internal_pool_open_handle"; int is_open = 0; if( internal_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( internal_pool->last_used_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid pool - missing last used list.", function ); return( -1 ); } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if handle is open.", function ); return( -1 ); } else if( is_open == 1 ) { return( 1 ); } if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { if( libbfio_internal_pool_append_handle_to_last_used_list( internal_pool, handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append handle to last used list.", function ); return( -1 ); } } if( libbfio_handle_open( handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libbfio_handle_seek_offset( handle, internal_handle->current_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } return( 1 ); } /* Appends the handle to the last used list * Closes the less frequently used handle if necessary * Returns 1 if successful or -1 on error */ int libbfio_internal_pool_append_handle_to_last_used_list( libbfio_internal_pool_t *internal_pool, const libbfio_handle_t *handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; libcdata_list_element_t *last_used_list_element = NULL; static char *function = "libbfio_internal_pool_append_handle_to_last_used_list"; if( internal_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( internal_pool->last_used_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid pool - missing last used list.", function ); return( -1 ); } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } /* Check if there is room in the pool for another open handle */ if( ( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) && ( ( internal_pool->number_of_open_handles + 1 ) >= internal_pool->maximum_number_of_open_handles ) ) { if( libcdata_list_get_last_element( internal_pool->last_used_list, &last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last list element from last used list.", function ); return( -1 ); } if( libcdata_list_element_get_value( last_used_list_element, (intptr_t **) &internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from last used list element.", function ); return( -1 ); } if( libcdata_list_remove_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove last list element from last used list.", function ); return( -1 ); } if( internal_handle != NULL ) { if( libbfio_handle_close( (libbfio_handle_t *) internal_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); libcdata_list_element_free( &last_used_list_element, NULL, NULL ); return( -1 ); } internal_handle->pool_last_used_list_element = NULL; /* Make sure the truncate flag is removed from the handle */ internal_handle->access_flags &= ~( LIBBFIO_ACCESS_FLAG_TRUNCATE ); } /* The last used list element is reused to contain the new last used entry */ } else { if( libcdata_list_element_initialize( &last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create last used list element.", function ); return( -1 ); } internal_pool->number_of_open_handles++; } internal_handle = (libbfio_internal_handle_t *) handle; if( libcdata_list_element_set_value( last_used_list_element, (intptr_t *) handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value int last used list element.", function ); return( -1 ); } internal_handle->pool_last_used_list_element = last_used_list_element; if( libcdata_list_prepend_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend last used list element to list.", function ); libcdata_list_element_free( &last_used_list_element, NULL, NULL ); return( -1 ); } return( 1 ); } /* Moves the handle to the front of the last used list * Returns 1 if successful or -1 on error */ int libbfio_internal_pool_move_handle_to_front_of_last_used_list( libbfio_internal_pool_t *internal_pool, libbfio_handle_t *handle, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; libcdata_list_element_t *first_list_element = NULL; libcdata_list_element_t *last_used_list_element = NULL; static char *function = "libbfio_internal_pool_move_handle_to_front_of_last_used_list"; if( internal_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( internal_pool->last_used_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid pool - missing last used list.", function ); return( -1 ); } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libbfio_internal_handle_t *) handle; if( libcdata_list_get_first_element( internal_pool->last_used_list, &first_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first list element from last used list.", function ); return( -1 ); } last_used_list_element = internal_handle->pool_last_used_list_element; if( last_used_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used list element.", function ); return( -1 ); } if( last_used_list_element != first_list_element ) { if( libcdata_list_remove_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove last used list element from list.", function ); return( -1 ); } if( libcdata_list_prepend_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend last used list element to list.", function ); internal_handle->pool_last_used_list_element = NULL; libcdata_list_element_free( &last_used_list_element, NULL, NULL ); return( -1 ); } } return( 1 ); } /* Removes a handle from the last used list * Returns 1 if successful or -1 on error */ int libbfio_internal_pool_remove_handle_from_last_used_list( libbfio_internal_pool_t *internal_pool, const libbfio_handle_t *handle, libcerror_error_t **error ) { libbfio_handle_t *last_used_handle = NULL; libcdata_list_element_t *last_used_list_element = NULL; static char *function = "libbfio_internal_pool_remove_handle_from_last_used_list"; if( internal_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( libcdata_list_get_first_element( internal_pool->last_used_list, &last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first list element from last used list.", function ); return( -1 ); } while( last_used_list_element != NULL ) { if( libcdata_list_element_get_value( last_used_list_element, (intptr_t **) &last_used_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used handle.", function ); return( -1 ); } if( last_used_handle == handle ) { break; } if( libcdata_list_element_get_next_element( last_used_list_element, &last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next last used list element.", function ); return( -1 ); } } if( last_used_list_element != NULL ) { if( libcdata_list_remove_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove last list element from last used list.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the number of handles in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_get_number_of_handles( libbfio_pool_t *pool, int *number_of_handles, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_number_of_handles"; int result = 1; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_array_get_number_of_entries( internal_pool->handles_array, number_of_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of handles.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); } /* Retrieves a specific handle from the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_get_handle( libbfio_pool_t *pool, int entry, libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_handle"; int result = 1; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); } /* Appends a handle to the pool * Sets the entry * Returns 1 if successful or -1 on error */ int libbfio_pool_append_handle( libbfio_pool_t *pool, int *entry, libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_append_handle"; int is_open = 0; int number_of_handles = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; if( internal_pool->last_used_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid pool - missing last used list.", function ); return( -1 ); } if( entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry.", function ); return( -1 ); } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif /* Check if the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if handle is open.", function ); goto on_error; } else if( is_open == 0 ) { /* Set the access flags is the handle is not open */ if( libbfio_handle_set_access_flags( handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set access flags.", function ); goto on_error; } } if( libcdata_array_get_number_of_entries( internal_pool->handles_array, &number_of_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of handles.", function ); goto on_error; } if( ( internal_pool->number_of_used_handles + 1 ) >= number_of_handles ) { if( libcdata_array_append_entry( internal_pool->handles_array, entry, (intptr_t *) handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append handle.", function ); goto on_error; } } else { *entry = internal_pool->number_of_used_handles; if( libcdata_array_set_entry_by_index( internal_pool->handles_array, *entry, (intptr_t *) handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set handle: %d.", function, *entry ); goto on_error; } } internal_pool->number_of_used_handles += 1; if( is_open != 0 ) { if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { if( libbfio_internal_pool_append_handle_to_last_used_list( internal_pool, handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append handle to last used list.", function ); goto on_error; } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Sets a specific handle in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_set_handle( libbfio_pool_t *pool, int entry, libbfio_handle_t *handle, int access_flags, libcerror_error_t **error ) { libbfio_internal_handle_t *backup_handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_set_handle"; int is_open = 0; int result = 1; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; /* Check if the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if handle is open.", function ); return( -1 ); } else if( is_open == 0 ) { /* Set the access flags is the handle is not open */ if( libbfio_handle_set_access_flags( handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set access flags.", function ); return( -1 ); } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &backup_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); result = -1; } /* TODO allow to re set handles, make sure all pool references are removed */ else if( backup_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle entry: %d value already set.", function, entry ); result = -1; } if( result == 1 ) { if( libcdata_array_set_entry_by_index( internal_pool->handles_array, entry, (intptr_t *) handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set handle: %d.", function, entry ); result = -1; } } if( result == 1 ) { if( is_open != 0 ) { if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { if( libbfio_internal_pool_append_handle_to_last_used_list( internal_pool, handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append handle to last used list.", function ); libcdata_array_set_entry_by_index( internal_pool->handles_array, entry, (intptr_t *) backup_handle, NULL ); result = -1; } } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) on_error: if( result == 1 ) { libcdata_array_set_entry_by_index( internal_pool->handles_array, entry, (intptr_t *) backup_handle, NULL ); } return( -1 ); #endif } /* Removes a specific handle from the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_remove_handle( libbfio_pool_t *pool, int entry, libbfio_handle_t **handle, libcerror_error_t **error ) { libbfio_handle_t *backup_handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_remove_handle"; int result = 1; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; if( internal_pool->last_used_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid pool - missing last used list.", function ); return( -1 ); } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } *handle = NULL; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &backup_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); result = -1; } if( result == 1 ) { if( libbfio_internal_pool_remove_handle_from_last_used_list( internal_pool, backup_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove handle: %d from last used list.", function, entry ); result = -1; } } if( result == 1 ) { if( libcdata_array_set_entry_by_index( internal_pool->handles_array, entry, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set handle: %d.", function, entry ); libbfio_internal_pool_append_handle_to_last_used_list( internal_pool, backup_handle, NULL ); result = -1; } } if( result == 1 ) { internal_pool->number_of_used_handles -= 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif if( result == 1 ) { *handle = backup_handle; } return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) on_error: if( result == 1 ) { libcdata_array_set_entry_by_index( internal_pool->handles_array, entry, (intptr_t *) backup_handle, NULL ); libbfio_internal_pool_append_handle_to_last_used_list( internal_pool, backup_handle, NULL ); internal_pool->number_of_used_handles += 1; } return( -1 ); #endif } /* Retrieves the maximum number of open handles in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_get_maximum_number_of_open_handles( libbfio_pool_t *pool, int *maximum_number_of_open_handles, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_maximum_number_of_open_handles"; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; if( maximum_number_of_open_handles == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum number of open handles.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_read( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *maximum_number_of_open_handles = internal_pool->maximum_number_of_open_handles; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the maximum number of open handles in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_set_maximum_number_of_open_handles( libbfio_pool_t *pool, int maximum_number_of_open_handles, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; libcdata_list_element_t *last_used_list_element = NULL; static char *function = "libbfio_pool_set_maximum_number_of_open_handles"; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; if( maximum_number_of_open_handles < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid maximum number of open handles value less than zero.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif internal_pool->maximum_number_of_open_handles = maximum_number_of_open_handles; while( ( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) && ( internal_pool->number_of_open_handles > internal_pool->maximum_number_of_open_handles ) ) { if( libcdata_list_get_last_element( internal_pool->last_used_list, &last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last list element from last used list.", function ); goto on_error; } if( libcdata_list_element_get_value( last_used_list_element, (intptr_t **) &internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from last used list element.", function ); goto on_error; } if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used list element value.", function ); goto on_error; } if( libcdata_list_remove_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove last used list element from list.", function ); goto on_error; } if( libbfio_handle_close( (libbfio_handle_t *) internal_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } internal_pool->number_of_open_handles--; internal_handle->pool_last_used_list_element = NULL; /* Make sure the truncate flag is removed from the handle */ internal_handle->access_flags &= ~( LIBBFIO_ACCESS_FLAG_TRUNCATE ); if( libcdata_list_element_free( &last_used_list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free last used list element.", function ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: if( last_used_list_element != NULL ) { libcdata_list_element_free( &last_used_list_element, NULL, NULL ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Opens a handle in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_open( libbfio_pool_t *pool, int entry, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_open"; int is_open = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } /* Make sure the handle is not open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if entry: %d is open.", function, entry ); goto on_error; } else if( is_open == 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: entry: %d is already open.", function, entry ); goto on_error; } if( libbfio_internal_pool_open_handle( internal_pool, handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open entry: %d.", function, entry ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Reopens a handle in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_reopen( libbfio_pool_t *pool, int entry, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_reopen"; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } if( libbfio_handle_reopen( handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to reopen handle for entry: %d.", function, entry ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Closes a handle in the pool * Returns 0 if successful or -1 on error */ int libbfio_internal_pool_close( libbfio_internal_pool_t *internal_pool, int entry, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_handle_t *internal_handle = NULL; libcdata_list_element_t *last_used_list_element = NULL; static char *function = "libbfio_internal_pool_close"; if( internal_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid pool - missing handle for entry: %d.", function, entry ); goto on_error; } if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { /* TODO move into get function */ internal_handle = (libbfio_internal_handle_t *) handle; last_used_list_element = internal_handle->pool_last_used_list_element; if( libcdata_list_element_get_value( last_used_list_element, (intptr_t **) &internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from last used list element.", function ); goto on_error; } if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used list element value.", function ); goto on_error; } if( libcdata_list_remove_element( internal_pool->last_used_list, last_used_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove last used list element from list.", function ); goto on_error; } internal_handle->pool_last_used_list_element = NULL; if( libcdata_list_element_free( &last_used_list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free last used list element.", function ); goto on_error; } } if( libbfio_handle_close( handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle for entry: %d.", function, entry ); goto on_error; } return( 0 ); on_error: if( last_used_list_element != NULL ) { libcdata_list_element_free( &last_used_list_element, NULL, NULL ); } return( -1 ); } /* Closes a handle in the pool * Returns 0 if successful or -1 on error */ int libbfio_pool_close( libbfio_pool_t *pool, int entry, libcerror_error_t **error ) { libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_close"; int result = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libbfio_internal_pool_close( internal_pool, entry, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle: %d.", function, entry ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); } /* Closes all the files in the pool * Returns 0 if successful or -1 on error */ int libbfio_pool_close_all( libbfio_pool_t *pool, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_close_all"; int entry = 0; int is_open = 0; int number_of_handles = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_number_of_entries( internal_pool->handles_array, &number_of_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of handles.", function ); goto on_error; } for( entry = 0; entry < number_of_handles; entry++ ) { if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } if( handle == NULL ) { continue; } /* Make sure the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if handle: %d is open.", function, entry ); goto on_error; } else if( is_open == 0 ) { continue; } if( libbfio_internal_pool_close( internal_pool, entry, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle: %d.", function, entry ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 0 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Reads a buffer from a handle in the pool * Returns the number of bytes read or -1 on error */ ssize_t libbfio_pool_read_buffer( libbfio_pool_t *pool, int entry, uint8_t *buffer, size_t size, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_read_buffer"; ssize_t read_count = 0; int access_flags = 0; int is_open = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } /* Make sure the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if entry: %d is open.", function, entry ); goto on_error; } else if( is_open == 0 ) { if( libbfio_handle_get_access_flags( handle, &access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access flags.", function ); goto on_error; } if( libbfio_internal_pool_open_handle( internal_pool, handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open entry: %d.", function, entry ); goto on_error; } } if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( internal_pool, handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to move handle to front of last used list.", function ); goto on_error; } } read_count = libbfio_handle_read_buffer( handle, buffer, size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from entry: %d.", function, entry ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( read_count ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Writes a buffer to a handle in the pool * Returns the number of bytes written or -1 on error */ ssize_t libbfio_pool_write_buffer( libbfio_pool_t *pool, int entry, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_write_buffer"; ssize_t write_count = 0; int access_flags = 0; int is_open = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } /* Make sure the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if entry: %d is open.", function, entry ); goto on_error; } else if( is_open == 0 ) { if( libbfio_handle_get_access_flags( handle, &access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access flags.", function ); goto on_error; } if( libbfio_internal_pool_open_handle( internal_pool, handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open entry: %d.", function, entry ); goto on_error; } } if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( internal_pool, handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to move handle to front of last used list.", function ); goto on_error; } } write_count = libbfio_handle_write_buffer( handle, buffer, size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to entry: %d.", function, entry ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( write_count ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Seeks an offset in a handle in the pool * Returns the offset if successful or -1 on error */ off64_t libbfio_pool_seek_offset( libbfio_pool_t *pool, int entry, off64_t offset, int whence, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_seek_offset"; off64_t seek_offset = 0; int access_flags = 0; int is_open = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } /* Make sure the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if entry: %d is open.", function, entry ); goto on_error; } else if( is_open == 0 ) { if( libbfio_handle_get_access_flags( handle, &access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access flags.", function ); goto on_error; } if( libbfio_internal_pool_open_handle( internal_pool, handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open entry: %d.", function, entry ); goto on_error; } } if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( internal_pool, handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to move handle to front of last used list.", function ); goto on_error; } } seek_offset = libbfio_handle_seek_offset( handle, offset, whence, error ); if( seek_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 " in entry: %d.", function, offset, entry ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( seek_offset ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves the current offset in a handle in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_get_offset( libbfio_pool_t *pool, int entry, off64_t *offset, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_offset"; int access_flags = 0; int is_open = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } /* Make sure the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if entry: %d is open.", function, entry ); goto on_error; } else if( is_open == 0 ) { if( libbfio_handle_get_access_flags( handle, &access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access flags.", function ); goto on_error; } if( libbfio_internal_pool_open_handle( internal_pool, handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open entry: %d.", function, entry ); goto on_error; } } if( libbfio_handle_get_offset( handle, offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset.", function ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves the size of a handle in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_get_size( libbfio_pool_t *pool, int entry, size64_t *size, libcerror_error_t **error ) { libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_size"; int access_flags = 0; int is_open = 0; if( pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid pool.", function ); return( -1 ); } internal_pool = (libbfio_internal_pool_t *) pool; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, (intptr_t **) &handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d.", function, entry ); goto on_error; } /* Make sure the handle is open */ is_open = libbfio_handle_is_open( handle, error ); if( is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if entry: %d is open.", function, entry ); goto on_error; } else if( is_open == 0 ) { if( libbfio_handle_get_access_flags( handle, &access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access flags.", function ); goto on_error; } if( libbfio_internal_pool_open_handle( internal_pool, handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open entry: %d.", function, entry ); goto on_error; } } if( libbfio_handle_get_size( handle, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of entry: %d.", function, entry ); goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, NULL ); #endif return( -1 ); } libewf-20140807/libbfio/libbfio_unused.h0000664000175000017500000000257213443450015022106 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2009-2019, 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( _LIBBFIO_UNUSED_H ) #define _LIBBFIO_UNUSED_H #include #if !defined( LIBBFIO_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBBFIO_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBBFIO_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBBFIO_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBBFIO_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBBFIO_UNUSED_H ) */ libewf-20140807/libbfio/libbfio_libcpath.h0000664000175000017500000000252413443450015022366 0ustar00lordyestalordyesta00000000000000/* * The internal libcpath header * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBCPATH_H ) #define _LIBBFIO_LIBCPATH_H #include /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath */ #if defined( HAVE_LOCAL_LIBCPATH ) #include #include #else /* If libtool DLL support is enabled set LIBCPATH_DLL_IMPORT * before including libcpath.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCPATH_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCPATH ) */ #endif /* !defined( _LIBBFIO_LIBCPATH_H ) */ libewf-20140807/libbfio/libbfio_libcfile.h0000664000175000017500000000261613443450015022353 0ustar00lordyestalordyesta00000000000000/* * The internal libcfile header * * Copyright (C) 2009-2019, 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( _LIBBFIO_LIBCFILE_H ) #define _LIBBFIO_LIBCFILE_H #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile */ #if defined( HAVE_LOCAL_LIBCFILE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCFILE_DLL_IMPORT * before including libcfile.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCFILE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCFILE ) */ #endif /* !defined( _LIBBFIO_LIBCFILE_H ) */ libewf-20140807/libbfio/libbfio_support.h0000664000175000017500000000265213443450015022316 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2009-2019, 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( _LIBBFIO_SUPPORT_H ) #define _LIBBFIO_SUPPORT_H #include #include #include "libbfio_extern.h" #include "libbfio_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBBFIO ) LIBBFIO_EXTERN \ const char *libbfio_get_version( void ); LIBBFIO_EXTERN \ int libbfio_get_codepage( int *codepage, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBBFIO ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBBFIO_SUPPORT_H ) */ libewf-20140807/libbfio/libbfio_file_io_handle.c0000664000175000017500000006350013443450015023515 0ustar00lordyestalordyesta00000000000000/* * File IO handle functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #include #include #include #include "libbfio_definitions.h" #include "libbfio_file_io_handle.h" #include "libbfio_libcerror.h" #include "libbfio_libcfile.h" #include "libbfio_system_string.h" /* Creates a file IO handle * Make sure the value file_io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libbfio_file_io_handle_initialize( libbfio_file_io_handle_t **file_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_initialize"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( *file_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file IO handle value already set.", function ); return( -1 ); } *file_io_handle = memory_allocate_structure( libbfio_file_io_handle_t ); if( *file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file IO handle.", function ); goto on_error; } if( memory_set( *file_io_handle, 0, sizeof( libbfio_file_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file IO handle.", function ); goto on_error; } if( libcfile_file_initialize( &( ( *file_io_handle )->file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file.", function ); goto on_error; } return( 1 ); on_error: if( *file_io_handle != NULL ) { memory_free( *file_io_handle ); *file_io_handle = NULL; } return( -1 ); } /* Frees a file IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_free( libbfio_file_io_handle_t **file_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_free"; int result = 1; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( *file_io_handle != NULL ) { if( ( *file_io_handle )->name != NULL ) { memory_free( ( *file_io_handle )->name ); } if( libcfile_file_free( &( ( *file_io_handle )->file ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file.", function ); result = -1; } memory_free( *file_io_handle ); *file_io_handle = NULL; } return( result ); } /* Clones (duplicates) the file IO handle and its attributes * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_clone( libbfio_file_io_handle_t **destination_file_io_handle, libbfio_file_io_handle_t *source_file_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_clone"; if( destination_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination file IO handle.", function ); return( -1 ); } if( *destination_file_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination file IO handle already set.", function ); return( -1 ); } if( source_file_io_handle == NULL ) { *destination_file_io_handle = NULL; return( 1 ); } if( libbfio_file_io_handle_initialize( destination_file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } if( *destination_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination file IO handle.", function ); goto on_error; } if( source_file_io_handle->name_size > 0 ) { if( source_file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source file IO handle - missing name.", function ); goto on_error; } if( source_file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid source file IO handle - name size value exceeds maximum.", function ); goto on_error; } ( *destination_file_io_handle )->name = system_string_allocate( source_file_io_handle->name_size ); if( ( *destination_file_io_handle )->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } if( source_file_io_handle->name_size > 1 ) { if( system_string_copy( ( *destination_file_io_handle )->name, source_file_io_handle->name, source_file_io_handle->name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy name.", function ); goto on_error; } } ( *destination_file_io_handle )->name[ source_file_io_handle->name_size - 1 ] = 0; ( *destination_file_io_handle )->name_size = source_file_io_handle->name_size; } return( 1 ); on_error: if( *destination_file_io_handle != NULL ) { libbfio_file_io_handle_free( destination_file_io_handle, NULL ); } return( -1 ); } /* Retrieves the name size of the file IO handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_get_name_size( libbfio_file_io_handle_t *file_io_handle, size_t *name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_get_name_size"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( libbfio_system_string_size_to_narrow_string( file_io_handle->name, file_io_handle->name_size, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file IO handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_get_name( libbfio_file_io_handle_t *file_io_handle, char *name, size_t name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_get_name"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( libbfio_system_string_copy_to_narrow_string( file_io_handle->name, file_io_handle->name_size, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_set_name( libbfio_file_io_handle_t *file_io_handle, const char *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_set_name"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( name_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid name length is zero.", function ); return( -1 ); } if( file_io_handle->name != NULL ) { result = libcfile_file_is_open( file_io_handle->file, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: unable to determine if file is open.", function ); return( -1 ); } if( result != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: unable to set name when file is open.", function ); return( -1 ); } memory_free( file_io_handle->name ); file_io_handle->name = NULL; file_io_handle->name_size = 0; } if( libbfio_system_string_size_from_narrow_string( name, name_length + 1, &( file_io_handle->name_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); goto on_error; } if( file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid file IO handle - name size value exceeds maximum.", function ); goto on_error; } file_io_handle->name = system_string_allocate( file_io_handle->name_size ); if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } if( libbfio_system_string_copy_from_narrow_string( file_io_handle->name, file_io_handle->name_size, name, name_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); goto on_error; } return( 1 ); on_error: if( file_io_handle->name != NULL ) { memory_free( file_io_handle->name ); file_io_handle->name = NULL; } file_io_handle->name_size = 0; return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the name size of the file IO handle * The name size includes the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_get_name_size_wide( libbfio_file_io_handle_t *file_io_handle, size_t *name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_get_name_size_wide"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( libbfio_system_string_size_to_wide_string( file_io_handle->name, file_io_handle->name_size, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the name of the file IO handle * The name size should include the end of string character * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_get_name_wide( libbfio_file_io_handle_t *file_io_handle, wchar_t *name, size_t name_size, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_get_name_wide"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( libbfio_system_string_copy_to_wide_string( file_io_handle->name, file_io_handle->name_size, name, name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); return( -1 ); } return( 1 ); } /* Sets the name for the file IO handle * Returns 1 if succesful or -1 on error */ int libbfio_file_io_handle_set_name_wide( libbfio_file_io_handle_t *file_io_handle, const wchar_t *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_set_name_wide"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( name_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid name length is zero.", function ); return( -1 ); } if( file_io_handle->name != NULL ) { result = libcfile_file_is_open( file_io_handle->file, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: unable to determine if file is open.", function ); return( -1 ); } if( result != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: unable to set name when file is open.", function ); return( -1 ); } memory_free( file_io_handle->name ); file_io_handle->name = NULL; file_io_handle->name_size = 0; } if( libbfio_system_string_size_from_wide_string( name, name_length + 1, &( file_io_handle->name_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); goto on_error; } if( file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid file IO handle - name size value exceeds maximum.", function ); goto on_error; } file_io_handle->name = system_string_allocate( file_io_handle->name_size ); if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } if( libbfio_system_string_copy_from_wide_string( file_io_handle->name, file_io_handle->name_size, name, name_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); goto on_error; } return( 1 ); on_error: if( file_io_handle->name != NULL ) { memory_free( file_io_handle->name ); file_io_handle->name = NULL; } file_io_handle->name_size = 0; return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Opens the file handle * Returns 1 if successful or -1 on error */ int libbfio_file_io_handle_open( libbfio_file_io_handle_t *file_io_handle, int access_flags, libcerror_error_t **error ) { static char *function = "libbfio_file_io_handle_open"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libcfile_file_open_wide( file_io_handle->file, file_io_handle->name, access_flags, error ); #else result = libcfile_file_open( file_io_handle->file, file_io_handle->name, access_flags, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %" PRIs_SYSTEM ".", function, file_io_handle->name ); return( -1 ); } file_io_handle->access_flags = access_flags; return( 1 ); } /* Closes the file handle * Returns 0 if successful or -1 on error */ int libbfio_file_io_handle_close( libbfio_file_io_handle_t *file_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_close"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } if( libcfile_file_close( file_io_handle->file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to close file: %" PRIs_SYSTEM ".", function, file_io_handle->name ); return( -1 ); } file_io_handle->access_flags = 0; return( 0 ); } /* Reads a buffer from the file handle * Returns the number of bytes read if successful, or -1 on error */ ssize_t libbfio_file_io_handle_read_buffer( libbfio_file_io_handle_t *file_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libbfio_file_read_buffer"; ssize_t read_count = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } read_count = libcfile_file_read_buffer( file_io_handle->file, buffer, size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file: %" PRIs_SYSTEM ".", function, file_io_handle->name ); return( -1 ); } return( read_count ); } /* Writes a buffer to the file handle * Returns the number of bytes written if successful, or -1 on error */ ssize_t libbfio_file_io_handle_write_buffer( libbfio_file_io_handle_t *file_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libbfio_file_write_buffer"; ssize_t write_count = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } write_count = libcfile_file_write_buffer( file_io_handle->file, buffer, size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file: %" PRIs_SYSTEM ".", function, file_io_handle->name ); return( -1 ); } return( write_count ); } /* Seeks a certain offset within the file handle * Returns the offset if the seek is successful or -1 on error */ off64_t libbfio_file_io_handle_seek_offset( libbfio_file_io_handle_t *file_io_handle, off64_t offset, int whence, libcerror_error_t **error ) { static char *function = "libbfio_file_seek_offset"; off64_t seek_offset = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } seek_offset = libcfile_file_seek_offset( file_io_handle->file, offset, whence, error ); if( seek_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 " in file: %" PRIs_SYSTEM ".", function, offset, file_io_handle->name ); return( -1 ); } return( seek_offset ); } /* Function to determine if a file exists * Returns 1 if file exists, 0 if not or -1 on error */ int libbfio_file_io_handle_exists( libbfio_file_io_handle_t *file_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_exists"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libcfile_file_exists_wide( file_io_handle->name, error ); #else result = libcfile_file_exists( file_io_handle->name, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if file: %" PRIs_SYSTEM " exists.", function, file_io_handle->name ); return( -1 ); } return( result ); } /* Check if the file is open * Returns 1 if open, 0 if not or -1 on error */ int libbfio_file_io_handle_is_open( libbfio_file_io_handle_t *file_io_handle, libcerror_error_t **error ) { static char *function = "libbfio_file_is_open"; int result = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } result = libcfile_file_is_open( file_io_handle->file, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if file is open.", function ); return( -1 ); } return( result ); } /* Retrieves the file size * Returns 1 if successful or -1 on error */ int libbfio_file_io_handle_get_size( libbfio_file_io_handle_t *file_io_handle, size64_t *size, libcerror_error_t **error ) { static char *function = "libbfio_file_get_size"; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( file_io_handle->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle - missing name.", function ); return( -1 ); } if( libcfile_file_get_size( file_io_handle->file, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of file: %" PRIs_SYSTEM ".", function, file_io_handle->name ); return( -1 ); } return( 1 ); } libewf-20140807/libbfio/libbfio_error.c0000664000175000017500000000552213443450015021725 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2009-2019, 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 . */ #include #include #include #include "libbfio_error.h" #include "libbfio_libcerror.h" #if !defined( HAVE_LOCAL_LIBBFIO ) /* Free an error and its elements */ void libbfio_error_free( libbfio_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libbfio_error_fprint( libbfio_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libbfio_error_sprint( libbfio_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libbfio_error_backtrace_fprint( libbfio_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libbfio_error_backtrace_sprint( libbfio_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBBFIO ) */ libewf-20140807/libbfio/libbfio_types.h0000664000175000017500000000304613443450015021744 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2009-2019, 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( _LIBBFIO_INTERNAL_TYPES_H ) #define _LIBBFIO_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio * The definitions in are copied here * for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libbfio_handle {} libbfio_handle_t; typedef struct libbfio_pool {} libbfio_pool_t; #else typedef intptr_t libbfio_handle_t; typedef intptr_t libbfio_pool_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ #endif /* !defined( _LIBBFIO_INTERNAL_TYPES_H ) */ libewf-20140807/COPYING0000664000175000017500000001672613440662652016410 0ustar00lordyestalordyesta00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. libewf-20140807/README0000664000175000017500000000326513440663046016225 0ustar00lordyestalordyesta00000000000000libewf is a library to access the Expert Witness Compression Format (EWF). This is the legacy version fo libewf. Project information: * Status: stable * Licence: LGPLv3+ Read or write supported EWF formats: * SMART .s01 (EWF-S01) * EnCase * .E01 (EWF-E01) Read-only supported EWF formats: * Logical Evidence File (LEF) * .L01 (EWF-L01) Not supported: * .Ex01 (EWF2-Ex01) * .Lx01 (EWF2-Lx01) Other features: * empty-block compression * read/write access using delta (or shadow) files * write resume Work in progress: * https://github.com/libyal/libewf Planned: * write EWF-L01 and EWF2-Lx01 (long-term) The libewf package contains the following tools: * ewfacquire; which writes storage media data from devices and files to EWF files. * ewfacquirestream; which writes data from stdin to EWF files. * ewfdebug; experimental tool does nothing at the moment. * ewfexport; which exports storage media data in EWF files to (split) RAW format or a specific version of EWF files. * ewfinfo; which shows the metadata in EWF files. * ewfmount; which FUSE mounts EWF files. * ewfrecover; special variant of ewfexport to create a new set of EWF files from a corrupt set. * ewfverify; which verifies the storage media data in EWF files. For the experimental / development release see: * https://github.com/libyal/libewf-legacy For previous project contributions see: * libewf on SourceForge: https://sourceforge.net/projects/libewf For previous stable releases see: * Downloads: https://github.com/libyal/legacy/tree/master/libewf For more information see: * Project documentation: https://github.com/libyal/libewf/wiki/Home * How to build from source: https://github.com/libyal/libewf/wiki/Building libewf-20140807/libewf.spec0000664000175000017500000000671213443455443017474 0ustar00lordyestalordyesta00000000000000Name: libewf Version: 20140807 Release: 1 Summary: Library to access the Expert Witness Compression Format (EWF) Group: System Environment/Libraries License: LGPL Source: %{name}-%{version}.tar.gz URL: https://github.com/libyal/libewf-legacy BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: openssl zlib BuildRequires: gcc gcc-c++ openssl-devel zlib-devel %description libewf is a library to access the Expert Witness Compression Format (EWF). libewf allows you to read media information of EWF files in the SMART (EWF-S01) format and the EnCase (EWF-E01, EWF-L01, EWF2-Ex01 and EWF2-Lx01) formats. 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 Requires: openssl zlib-static %description -n libewf-static Static library version of libewf %package -n libewf-devel Summary: Header files and libraries for developing applications for libewf Group: Development/Libraries Requires: libewf = %{version}-%{release} %description -n libewf-devel Header files and libraries for developing applications for libewf. %package -n libewf-python2 Obsoletes: libewf-python < %{version} Provides: libewf-python = %{version} Summary: Python 2 bindings for libewf Group: System Environment/Libraries Requires: libewf = %{version}-%{release} python2 BuildRequires: python2-devel %description -n libewf-python2 Python 2 bindings for libewf %package -n libewf-python3 Summary: Python 3 bindings for libewf Group: System Environment/Libraries Requires: libewf = %{version}-%{release} python3 BuildRequires: python3-devel %description -n libewf-python3 Python 3 bindings for libewf %package -n libewf-tools Summary: Several tools for reading and writing EWF files Group: Applications/System Requires: libewf = %{version}-%{release} openssl fuse-libs libuuid BuildRequires: byacc flex openssl-devel fuse-devel libuuid-devel %description -n libewf-tools Several tools for reading and writing EWF files %prep %setup -q %build %configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python2 --enable-python3 make %{?_smp_mflags} %install rm -rf %{buildroot} %make_install %clean rm -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -n libewf %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %attr(755,root,root) %{_libdir}/*.so.* %files -n libewf-static %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %attr(755,root,root) %{_libdir}/*.a %files -n libewf-devel %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %{_libdir}/*.la %{_libdir}/*.so %{_libdir}/pkgconfig/libewf.pc %{_includedir}/* %{_mandir}/man3/* %files -n libewf-python2 %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %{_libdir}/python2*/site-packages/*.a %{_libdir}/python2*/site-packages/*.la %{_libdir}/python2*/site-packages/*.so %files -n libewf-python3 %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %{_libdir}/python3*/site-packages/*.a %{_libdir}/python3*/site-packages/*.la %{_libdir}/python3*/site-packages/*.so %files -n libewf-tools %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %attr(755,root,root) %{_bindir}/* %{_mandir}/man1/* # Exclude ewfdebug tool %exclude %{_bindir}/ewfdebug %changelog * Sun Mar 17 2019 Joachim Metz 20140807-1 - Auto-generated libewf-20140807/include/0000775000175000017500000000000013443455444016766 5ustar00lordyestalordyesta00000000000000libewf-20140807/include/libewf.h.in0000644000175000017500000035760313440662656021032 0ustar00lordyestalordyesta00000000000000/* * Library to access the Expert Witness Compression Format (EWF) * * 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_H ) #define _LIBEWF_H #include #include #include #include #include #include #include #if defined( LIBEWF_HAVE_BFIO ) #include #endif #ifdef __cplusplus extern "C" { #endif /* ------------------------------------------------------------------------- * Support functions * ------------------------------------------------------------------------- */ /* Returns the library version */ LIBEWF_EXTERN \ const char *libewf_get_version( void ); /* Returns the access flags for reading */ LIBEWF_EXTERN \ int libewf_get_access_flags_read( void ); /* Returns the access flags for reading and writing */ LIBEWF_EXTERN \ int libewf_get_access_flags_read_write( void ); /* Returns the access flags for writing */ LIBEWF_EXTERN \ int libewf_get_access_flags_write( void ); /* Returns the access flags for resume writing */ LIBEWF_EXTERN \ int libewf_get_access_flags_write_resume( void ); /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_get_codepage( int *codepage, libewf_error_t **error ); /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_set_codepage( int codepage, libewf_error_t **error ); /* Determines if a file is an EWF file (check for the EWF file signature) * Returns 1 if true, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_check_file_signature( const char *filename, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Determines if a file is an EWF file (check for the EWF file signature) * Returns 1 if true, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_check_file_signature_wide( const wchar_t *filename, libewf_error_t **error ); #endif #if defined( LIBEWF_HAVE_BFIO ) /* Determines if a file is an EWF file (check for the EWF file signature) using a Basic File IO (bfio) handle * Returns 1 if true, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_check_file_signature_file_io_handle( libbfio_handle_t *file_io_handle, libewf_error_t **error ); #endif /* Globs the segment files according to the EWF naming schema * if the format is known the filename should contain the base of the filename * otherwise the function will try to determine the format based on the extension * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob( const char *filename, size_t filename_length, uint8_t format, char **filenames[], int *number_of_filenames, libewf_error_t **error ); /* Frees the globbed filenames * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob_free( char *filenames[], int number_of_filenames, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Globs the segment files according to the EWF naming schema * if the format is known the filename should contain the base of the filename * otherwise the function will try to determine the format based on the extension * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob_wide( const wchar_t *filename, size_t filename_length, uint8_t format, wchar_t **filenames[], int *number_of_filenames, libewf_error_t **error ); /* Frees the globbed wide filenames * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob_wide_free( wchar_t *filenames[], int number_of_filenames, libewf_error_t **error ); #endif /* ------------------------------------------------------------------------- * Support functions - deprecated * ------------------------------------------------------------------------- */ /* Returns the flags for reading * * This function deprecated use libewf_get_access_flags_read instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_read( void ); /* Returns the flags for reading and writing * * This function deprecated use libewf_get_access_flags_read_write instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_read_write( void ); /* Returns the flags for writing * * This function deprecated use libewf_get_access_flags_write instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_write( void ); /* Returns the flags for resume writing * * This function deprecated use libewf_get_access_flags_write_resume instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_write_resume( void ); /* ------------------------------------------------------------------------- * Notify functions * ------------------------------------------------------------------------- */ /* Sets the verbose notification */ LIBEWF_EXTERN \ void libewf_notify_set_verbose( int verbose ); /* Sets the notification stream * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_notify_set_stream( FILE *stream, libewf_error_t **error ); /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_notify_stream_open( const char *filename, libewf_error_t **error ); /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_notify_stream_close( libewf_error_t **error ); /* ------------------------------------------------------------------------- * Error functions * ------------------------------------------------------------------------- */ /* Frees the error including elements */ LIBEWF_EXTERN \ void libewf_error_free( libewf_error_t **error ); /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_fprint( libewf_error_t *error, FILE *stream ); /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_sprint( libewf_error_t *error, char *string, size_t size ); /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_backtrace_fprint( libewf_error_t *error, FILE *stream ); /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_backtrace_sprint( libewf_error_t *error, char *string, size_t size ); /* ------------------------------------------------------------------------- * File/Handle functions * ------------------------------------------------------------------------- */ /* Initialize the handle * The handle must point to a NULL pointer to be allocated * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_initialize( libewf_handle_t **handle, libewf_error_t **error ); /* Frees the handle including elements * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_free( libewf_handle_t **handle, libewf_error_t **error ); /* Clones the handle including elements * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_clone( libewf_handle_t **destination_handle, libewf_handle_t *source_handle, libewf_error_t **error ); /* Signals the handle to abort its current activity * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_signal_abort( libewf_handle_t *handle, libewf_error_t **error ); /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_open( libewf_handle_t *handle, char * const filenames[], int number_of_filenames, int access_flags, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_open_wide( libewf_handle_t *handle, wchar_t * const filenames[], int number_of_filenames, int access_flags, libewf_error_t **error ); #endif #if defined( LIBEWF_HAVE_BFIO ) /* Opens a set of EWF file(s) using a Basic File IO (bfio) pool * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_open_file_io_pool( libewf_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libewf_error_t **error ); #endif /* Closes the EWF handle * Returns 0 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_close( libewf_handle_t *handle, libewf_error_t **error ); /* Prepares chunk of (media) data after reading it according to the handle settings * It applies decompression if necessary and validates the chunk checksum * This function should be used after libewf_handle_read_chunk * The value chunk_buffer_size contains the size of the chunk * Returns the resulting chunk size or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_prepare_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, void *uncompressed_chunk_buffer, size_t *uncompressed_chunk_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum, libewf_error_t **error ); /* Reads a chunk of (media) data from the current offset into a buffer * Will read until the requested size is filled or the entire chunk is read * The values read_checksum and chunk_checksum are used for uncompressed chunks only * The value chunk_checksum is set to a runtime version of the value in the checksum_buffer * The value read_checksum is set if the checksum has been read into checksum_buffer * The value chunk_buffer_size contains the size of the chunk buffer * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, int8_t *is_compressed, void *checksum_buffer, uint32_t *chunk_checksum, int8_t *read_checksum, libewf_error_t **error ); /* Reads (media) data at the current offset into a buffer * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, libewf_error_t **error ); /* Reads (media) data at a specific offset * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libewf_error_t **error ); /* Prepares a chunk of (media) data before writing according to the handle settings * This function should be used before libewf_handle_write_chunk * The chunk_buffer_size should contain the actual chunk size * The function sets the chunk checksum, is compressed and write checksum values * Returns the resulting chunk size or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_prepare_write_chunk( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *compressed_chunk_buffer, size_t *compressed_chunk_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum, libewf_error_t **error ); /* Writes a chunk of (media) data in EWF format at the current offset * the necessary settings of the write values must have been made * chunk_buffer_size contains the size of the data within the buffer while * data_size contains the size of the actual input data * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_chunk( libewf_handle_t *handle, const void *chunk_buffer, size_t chunk_buffer_size, size_t data_size, int8_t is_compressed, void *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libewf_error_t **error ); /* Writes (media) data at the current offset * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_buffer( libewf_handle_t *handle, const void *buffer, size_t buffer_size, libewf_error_t **error ); /* Writes (media) data at a specific offset, * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_random( libewf_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libewf_error_t **error ); /* Finalizes the write by correcting the EWF the meta data in the segment files * This function is required after writing from stream * Returns the number of input bytes written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_finalize( libewf_handle_t *handle, libewf_error_t **error ); /* Seeks a certain offset of the (media) data * Returns the offset if seek is successful or -1 on error */ LIBEWF_EXTERN \ off64_t libewf_handle_seek_offset( libewf_handle_t *handle, off64_t offset, int whence, libewf_error_t **error ); /* Retrieves the current offset of the (media) data * Returns the offset if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_offset( libewf_handle_t *handle, off64_t *offset, libewf_error_t **error ); /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_maximum_number_of_open_handles( libewf_handle_t *handle, int maximum_number_of_open_handles, libewf_error_t **error ); /* Retrieves the segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libewf_error_t **error ); /* Sets the segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libewf_error_t **error ); /* Sets the segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libewf_error_t **error ); #endif /* Retrieves the maximum segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_maximum_segment_size( libewf_handle_t *handle, size64_t *maximum_segment_size, libewf_error_t **error ); /* Sets the maximum segment file size * A maximum segment file size of 0 represents the maximum possible size for the format * If the maximum segment file size is smaller than the size needed to store a single chunk * the size off the latter is enforced and not the maximum segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_maximum_segment_size( libewf_handle_t *handle, size64_t maximum_segment_size, libewf_error_t **error ); /* Retrieves the delta segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libewf_error_t **error ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the delta segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libewf_error_t **error ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libewf_error_t **error ); #endif /* Retrieves the maximum delta segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_maximum_delta_segment_size( libewf_handle_t *handle, size64_t *maximum_delta_segment_size, libewf_error_t **error ); /* Sets the maximum delta segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_maximum_delta_segment_size( libewf_handle_t *handle, size64_t maximum_delta_segment_size, libewf_error_t **error ); /* Determine if the segment files are corrupted * Returns 1 if corrupted, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_segment_files_corrupted( libewf_handle_t *handle, libewf_error_t **error ); /* Retrieves the filename size of the (delta) segment file of the current chunk * The filename size includes the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename_size( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the filename of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the filename size of the (delta) segment file of the current chunk * The filename size includes the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the filename of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libewf_error_t **error ); #endif #if defined( LIBEWF_HAVE_BFIO ) /* Retrieves the file IO handle of the (delta) segment file of the current chunk * Returns 1 if successful, 0 if no such file IO handle or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_file_io_handle( libewf_handle_t *handle, libbfio_handle_t **file_io_handle, libewf_error_t **error ); #endif /* ------------------------------------------------------------------------- * File/Handle functions - deprecated * ------------------------------------------------------------------------- */ /* Sets the maximum amount of (concurrent) open file handles * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_maximum_number_of_open_handles instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_maximum_amount_of_open_handles( libewf_handle_t *handle, int maximum_amount_of_open_handles, libewf_error_t **error ); /* Retrieves the amount of sectors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_sectors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_sectors( libewf_handle_t *handle, uint64_t *amount_of_sectors, libewf_error_t **error ); /* Retrieves the amount of chunks written * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_chunks_written instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks, libewf_error_t **error ); /* Retrieves the segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size, libewf_error_t **error ); /* Sets the segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size, libewf_error_t **error ); /* Retrieves the delta segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size, libewf_error_t **error ); /* Sets the delta segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size, libewf_error_t **error ); /* ------------------------------------------------------------------------- * Meta data functions * ------------------------------------------------------------------------- */ /* Retrieves the number of sectors per chunk * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk, libewf_error_t **error ); /* Sets the number of sectors per chunk * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk, libewf_error_t **error ); /* Retrieves the number of bytes per sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector, libewf_error_t **error ); /* Sets the number of bytes per sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector, libewf_error_t **error ); /* Retrieves the number of sectors * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_sectors( libewf_handle_t *handle, uint64_t *number_of_sectors, libewf_error_t **error ); /* Retrieves the chunk size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size, libewf_error_t **error ); /* Retrieves the error granularity * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity, libewf_error_t **error ); /* Sets the error granularity * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity, libewf_error_t **error ); /* Retrieves the compression values * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compression_flags, libewf_error_t **error ); /* Sets the compression values * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compression_flags, libewf_error_t **error ); /* Retrieves the size of the contained (media) data * This function will compensate for a media_size that is not a multitude of bytes_per_sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_media_size( libewf_handle_t *handle, size64_t *media_size, libewf_error_t **error ); /* Sets the media size * The media_size is stored as number_of_sectors x bytes_per_sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_media_size( libewf_handle_t *handle, size64_t media_size, libewf_error_t **error ); /* Retrieves the media type value * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_media_type( libewf_handle_t *handle, uint8_t *media_type, libewf_error_t **error ); /* Sets the media type * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_media_type( libewf_handle_t *handle, uint8_t media_type, libewf_error_t **error ); /* Retrieves the media flags * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags, libewf_error_t **error ); /* Sets the media flags * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_media_flags( libewf_handle_t *handle, uint8_t media_flags, libewf_error_t **error ); /* Retrieves the format type value * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_format( libewf_handle_t *handle, uint8_t *format, libewf_error_t **error ); /* Sets the output format * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_format( libewf_handle_t *handle, uint8_t format, libewf_error_t **error ); /* Retrieves the segment file set identifier * The identifier is a GUID and is 16 bytes of size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_file_set_identifier( libewf_handle_t *handle, uint8_t *set_identifier, size_t size, libewf_error_t **error ); /* Sets the segment file set identifier * The identifier is a GUID and is 16 bytes of size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_segment_file_set_identifier( libewf_handle_t *handle, const uint8_t *set_identifier, size_t size, libewf_error_t **error ); /* Retrieves the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libewf_error_t **error ); /* Sets the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libewf_error_t **error ); /* Retrieves the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libewf_error_t **error ); /* Sets the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libewf_error_t **error ); /* Retrieves the number of chunks written * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_chunks_written( libewf_handle_t *handle, uint32_t *number_of_chunks, libewf_error_t **error ); /* Sets the read zero chunk on error * The chunk is not zeroed if read raw is used * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_read_zero_chunk_on_error( libewf_handle_t *handle, uint8_t zero_on_error, libewf_error_t **error ); /* Copies the media values from the source to the destination handle * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libewf_error_t **error ); /* Retrieves the number of acquiry errors * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_acquiry_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libewf_error_t **error ); /* Retrieves an acquiry error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_acquiry_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends an acquiry error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of checksum errors * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_checksum_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libewf_error_t **error ); /* Retrieves a checksum error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_checksum_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends a checksum error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_checksum_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of sessions * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_sessions( libewf_handle_t *handle, uint32_t *number_of_sessions, libewf_error_t **error ); /* Retrieves a session * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_session( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends a session * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of tracks * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_tracks( libewf_handle_t *handle, uint32_t *number_of_tracks, libewf_error_t **error ); /* Retrieves a track * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_track( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends a track * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_track( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the header codepage * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_codepage( libewf_handle_t *handle, int *header_codepage, libewf_error_t **error ); /* Sets the header codepage * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_header_codepage( libewf_handle_t *handle, int header_codepage, libewf_error_t **error ); /* Retrieves the header values date format * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_values_date_format( libewf_handle_t *handle, int *date_format, libewf_error_t **error ); /* Sets the header values date format * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_header_values_date_format( libewf_handle_t *handle, int date_format, libewf_error_t **error ); /* Retrieves the number of header values * Returns 1 if successful, 0 if no header values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_header_values( libewf_handle_t *handle, uint32_t *number_of_values, libewf_error_t **error ); /* Retrieves the size of the header value identifier of a specific index * The identifier size includes the end of string character * Returns 1 if successful, 0 if no header values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libewf_error_t **error ); /* Retrieves the header value identifier of a specific index * The identifier size should include the end of string character * Returns 1 if successful, 0 if no header values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded header value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded header value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the header value case number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_case_number( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error ) /* Retrieves the header value description * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_description( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "description", 11, value, value_size, error ) /* Retrieves the header value examiner name * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_examiner_name( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error ) /* Retrieves the header value evidence number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_evidence_number( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error ) /* Retrieves the header value notes * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_notes( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error ) /* Retrieves the header value acquiry date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_acquiry_date( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error ) /* Retrieves the header value system date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_system_date( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error ) /* Retrieves the header value acquiry operating system * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_acquiry_operating_system( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error ) /* Retrieves the header value acquiry software version * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_acquiry_software_version( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error ) /* Retrieves the header value password * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_password( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "password", 8, value, value_size, error ) /* Retrieves the header value compression level * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_compression_level( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "compression_level", 17, value, value_size, error ) /* Retrieves the header value model * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_model( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "model", 5, value, value_size, error ) /* Retrieves the header value serial number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_serial_number( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error ) /* Sets the UTF-8 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libewf_error_t **error ); /* Sets the header value case number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_case_number( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error ) /* Sets the header value description * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_description( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "description", 11, value, value_length, error ) /* Sets the header value examiner name * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_examiner_name( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error ) /* Sets the header value evidence number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_evidence_number( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error ) /* Sets the header value notes * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_notes( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error ) /* Sets the header value acquiry date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_acquiry_date( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error ) /* Sets the header value system date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_system_date( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error ) /* Sets the header value acquiry operating system * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_acquiry_operating_system( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error ) /* Sets the header value acquiry software version * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_acquiry_software_version( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error ) /* Sets the header value password * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_password( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "password", 8, value, value_length, error ) /* Sets the header value compression level * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_compression_level( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "compression_level", 17, value, value_length, error ) /* Sets the header value model * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_model( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "model", 5, value, value_length, error ) /* Sets the header value serial number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_serial_number( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error ) /* Retrieves the size of the UTF-16 encoded header value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded header value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Sets the UTF-16 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libewf_error_t **error ); /* Copies the header values from the source to the destination handle * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libewf_error_t **error ); /* Retrieves the number of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_hash_values( libewf_handle_t *handle, uint32_t *number_of_values, libewf_error_t **error ); /* Retrieves the size of the hash value identifier of a specific index * The identifier size includes the end of string character * Returns 1 if successful, 0 if no hash values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libewf_error_t **error ); /* Retrieves the hash value identifier of a specific index * The identifier size should include the end of string character * Returns 1 if successful, 0 if no hash values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded hash value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded hash value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the hash value MD5 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_hash_value_md5( handle, value, value_size, error ) \ libewf_handle_get_utf8_hash_value( handle, (uint8_t *) "MD5", 3, value, value_size, error ) /* Retrieves the hash value SHA1 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_hash_value_sha1( handle, value, value_size, error ) \ libewf_handle_get_utf8_hash_value( handle, (uint8_t *) "SHA1", 4, value, value_size, error ) /* Sets the UTF-8 hash value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libewf_error_t **error ); /* Sets the hash value MD5 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_hash_value_md5( handle, value, value_length, error ) \ libewf_handle_set_utf8_hash_value( handle, (uint8_t *) "MD5", 3, value, value_length, error ) /* Sets the hash value SHA1 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_hash_value_sha1( handle, value, value_length, error ) \ libewf_handle_set_utf8_hash_value( handle, (uint8_t *) "SHA1", 4, value, value_length, error ) /* Retrieves the size of the UTF-16 encoded hash value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded hash value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Sets the UTF-16 hash value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libewf_error_t **error ); /* Retrieves the root (single) file entry * Returns 1 if successful, 0 if no file entries are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_root_file_entry( libewf_handle_t *handle, libewf_file_entry_t **root_file_entry, libewf_error_t **error ); /* Retrieves the (single) file entry for the specific UTF-8 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_get_file_entry_by_utf8_path( libewf_handle_t *handle, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **file_entry, libewf_error_t **error ); /* Retrieves the (single) file entry for the specific UTF-16 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_get_file_entry_by_utf16_path( libewf_handle_t *handle, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **file_entry, libewf_error_t **error ); /* ------------------------------------------------------------------------- * Meta data functions - deprecated * ------------------------------------------------------------------------- */ /* Sets the read wipe chunk on error * The chunk is not wiped if read raw is used * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_read_zero_chunk_on_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error, libewf_error_t **error ); /* Retrieves the amount of acquiry errors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_acquiry_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libewf_error_t **error ); /* Add an acquiry error * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_append_acquiry_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_add_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of checksum errors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_checksum_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_number_of_crc_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libewf_error_t **error ); /* Retrieves the amount of checksum errors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_checksum_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libewf_error_t **error ); /* Retrieves a checksum error * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_crc_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Add a checksum error * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_append_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_add_crc_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the amount of sessions * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_sessions instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions, libewf_error_t **error ); /* Add a session * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_append_session instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_add_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the amount of header values * Returns 1 if successful, 0 if no header values are present or -1 on error * * This function deprecated use libewf_handle_get_number_of_header_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded header value of an identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_header_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded header value of an identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libewf_error_t **error ); /* Retrieves the header value case number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_case_number( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error ) /* Retrieves the header value description * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_description( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "description", 11, value, value_size, error ) /* Retrieves the header value examiner name * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_examiner_name( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error ) /* Retrieves the header value evidence number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_evidence_number( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error ) /* Retrieves the header value notes * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_notes( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error ) /* Retrieves the header value acquiry date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_acquiry_date( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error ) /* Retrieves the header value system date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_system_date( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error ) /* Retrieves the header value acquiry operating system * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_acquiry_operating_system( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error ) /* Retrieves the header value acquiry software version * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_acquiry_software_version( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error ) /* Retrieves the header value password * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_password( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "password", 8, value, value_size, error ) /* Retrieves the header value compression type * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_compression_type( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error ) /* Retrieves the header value model * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_model( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "model", 5, value, value_size, error ) /* Retrieves the header value serial number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_serial_number( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error ) /* Retrieves the header value compression type * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_header_value_compression_level instead */ #define libewf_handle_get_utf8_header_value_compression_type( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error ) /* Sets the UTF-8 encoded header value specified by the identifier * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_utf8_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libewf_error_t **error ); /* Sets the header value case number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_case_number( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error ) /* Sets the header value description * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_description( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "description", 11, value, value_length, error ) /* Sets the header value examiner name * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_examiner_name( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error ) /* Sets the header value evidence number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_evidence_number( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error ) /* Sets the header value notes * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_notes( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error ) /* Sets the header value acquiry date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_acquiry_date( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error ) /* Sets the header value system date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_system_date( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error ) /* Sets the header value acquiry operating system * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_acquiry_operating_system( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error ) /* Sets the header value acquiry software version * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_acquiry_software_version( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error ) /* Sets the header value password * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_password( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "password", 8, value, value_length, error ) /* Sets the header value compression type * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_compression_type( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error ) /* Sets the header value model * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_model( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "model", 5, value, value_length, error ) /* Sets the header value serial number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_serial_number( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error ) /* Sets the header value compression type * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_utf8_header_value_compression_level instead */ #define libewf_handle_set_utf8_header_value_compression_type( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error ) /* Retrieves the amount of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error * * This function deprecated use libewf_handle_get_number_of_hash_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded hash value of an identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_hash_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded hash value of an identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libewf_error_t **error ); /* Retrieves the hash value MD5 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_hash_value_md5( handle, value, value_size, error ) \ libewf_handle_get_hash_value( handle, "MD5", 3, value, value_size, error ) /* Retrieves the hash value SHA1 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_hash_value_sha1( handle, value, value_size, error ) \ libewf_handle_get_hash_value( handle, "SHA1", 4, value, value_size, error ) /* Sets the UTF-8 hash value specified by the identifier * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_utf8_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libewf_error_t **error ); /* Sets the hash value MD5 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_hash_value_md5( handle, value, value_length, error ) \ libewf_handle_set_hash_value( handle, "MD5", 3, value, value_length, error ) /* Sets the hash value SHA1 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_hash_value_sha1( handle, value, value_length, error ) \ libewf_handle_set_hash_value( handle, "SHA1", 4, value, value_length, error ) /* ------------------------------------------------------------------------- * Single file entry functions * ------------------------------------------------------------------------- */ /* Frees a file entry * REturns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_free( libewf_file_entry_t **file_entry, libewf_error_t **error ); /* Retrieves the type * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_type( libewf_file_entry_t *file_entry, uint8_t *type, libewf_error_t **error ); /* Retrieves the flags * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_flags( libewf_file_entry_t *file_entry, uint32_t *flags, libewf_error_t **error ); /* Retrieves the media data offset * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_media_data_offset( libewf_file_entry_t *file_entry, off64_t *media_data_offset, libewf_error_t **error ); /* Retrieves the media data size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_media_data_size( libewf_file_entry_t *file_entry, size64_t *media_data_size, libewf_error_t **error ); /* Retrieves the duplicate media data offset * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_duplicate_media_data_offset( libewf_file_entry_t *file_entry, off64_t *duplicate_media_data_offset, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_name_size( libewf_file_entry_t *file_entry, size_t *utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_name( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the size of the UTF-16 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_name_size( libewf_file_entry_t *file_entry, size_t *utf16_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_name( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Retrieves the size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_size( libewf_file_entry_t *file_entry, size64_t *size, libewf_error_t **error ); /* Retrieves the creation date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_creation_time( libewf_file_entry_t *file_entry, uint32_t *creation_time, libewf_error_t **error ); /* Retrieves the modification date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_modification_time( libewf_file_entry_t *file_entry, uint32_t *modification_time, libewf_error_t **error ); /* Retrieves the access date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_access_time( libewf_file_entry_t *file_entry, uint32_t *access_time, libewf_error_t **error ); /* Retrieves the entry modification date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_entry_modification_time( libewf_file_entry_t *file_entry, uint32_t *entry_modification_time, libewf_error_t **error ); /* Retrieves the UTF-8 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_hash_value_md5( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_hash_value_md5( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Reads data at the current offset * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_file_entry_read_buffer( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, libewf_error_t **error ); /* Reads data at a specific offset * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_file_entry_read_random( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, off64_t offset, libewf_error_t **error ); /* Seeks a certain offset of the data * Returns the offset if seek is successful or -1 on error */ LIBEWF_EXTERN \ off64_t libewf_file_entry_seek_offset( libewf_file_entry_t *file_entry, off64_t offset, int whence, libewf_error_t **error ); /* Retrieves the current offset of the data * Returns the offset if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_offset( libewf_file_entry_t *file_entry, off64_t *offset, libewf_error_t **error ); /* Retrieves the number of sub file entries * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_number_of_sub_file_entries( libewf_file_entry_t *file_entry, int *number_of_sub_file_entries, libewf_error_t **error ); /* Retrieves the sub file entry for the specific index * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry( libewf_file_entry_t *file_entry, int sub_file_entry_index, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-8 encoded name * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf8_name( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-8 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf8_path( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-16 encoded name * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf16_name( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-16 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf16_path( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* ------------------------------------------------------------------------- * Single file entry functions - deprecated * ------------------------------------------------------------------------- */ /* Retrieves the size of the UTF-8 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error * * This function deprecated use libewf_file_entry_get_utf8_name_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_file_entry_get_name_size( libewf_file_entry_t *file_entry, size_t *name_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error * * This function deprecated use libewf_file_entry_get_utf8_name instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_file_entry_get_name( libewf_file_entry_t *file_entry, uint8_t *name, size_t name_size, libewf_error_t **error ); /* Retrieves the amount of sub file entries * Returns 1 if successful or -1 on error * * This function deprecated use libewf_file_entry_get_number_of_sub_file_entries instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_file_entry_get_amount_of_sub_file_entries( libewf_file_entry_t *file_entry, int *amount_of_sub_file_entries, libewf_error_t **error ); /* ------------------------------------------------------------------------- * APIv1 functions - deprecated * ------------------------------------------------------------------------- */ #if @HAVE_V1_API@ || defined( HAVE_V1_API ) /* ------------------------------------------------------------------------- * Notify functions * ------------------------------------------------------------------------- */ /* Sets the notify values * * This function is deprecated use libewf_notify_set_verbose and libewf_notify_set_stream instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN void libewf_set_notify_values( FILE *stream, uint8_t verbose ); /* ------------------------------------------------------------------------- * File/Handle functions * ------------------------------------------------------------------------- */ /* Signals the libewf handle to abort its current activity * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_signal_abort instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_signal_abort( libewf_handle_t *handle ); /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns a pointer to the new instance of handle, NULL on error * * This function deprecated use libewf_handle_open instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN libewf_handle_t *libewf_open( char * const filenames[], int amount_of_filenames, uint8_t flags ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns a pointer to the new instance of handle, NULL on error * * This function deprecated use libewf_handle_open_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN libewf_handle_t *libewf_open_wide( wchar_t * const filenames[], int amount_of_filenames, uint8_t flags ); #endif /* Closes the EWF handle and frees memory used within the handle * Returns 0 if successful or -1 on error * * This function deprecated use libewf_handle_close instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_close( libewf_handle_t *handle ); /* Seeks a certain offset of the (media) data * Returns the offset if seek is successful or -1 on error * * This function is deprecated use libewf_handle_seek_offset instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN off64_t libewf_seek_offset( libewf_handle_t *handle, off64_t offset ); /* Retrieves the current offset of the (media) data * Returns the offset if successful or -1 on error * * This function is deprecated use libewf_handle_get_offset instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN off64_t libewf_get_offset( libewf_handle_t *handle ); /* Prepares a buffer with chunk data after reading it according to the handle settings * intended for raw read * The buffer size cannot be larger than the chunk size * Returns the resulting chunk size or -1 on error * * This function is deprecated use libewf_handle_prepare_read_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_read_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *uncompressed_buffer, size_t *uncompressed_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum ); /* Reads 'raw' data from the current offset into a buffer * size contains the size of the buffer * The function sets the chunk checksum, is compressed and read checksum values * Returns the amount of bytes read or -1 on error * * This function is deprecated use libewf_handle_read_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *read_checksum ); /* Reads data from the current offset into a buffer * Returns the amount of bytes read or -1 on error * * This function is deprecated use libewf_handle_read_buffer instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ); /* Reads (media) data at a specific offset * Returns the amount of bytes read or -1 on error * * This function is deprecated use libewf_handle_read_random instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ); /* Prepares a buffer with chunk data before writing according to the handle settings * intended for raw write * The buffer size cannot be larger than the chunk size * The function sets the chunk checksum, is compressed and write checksum values * Returns the resulting chunk size or -1 on error * * This function is deprecated use libewf_handle_prepare_write_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_write_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *compressed_buffer, size_t *compressed_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum ); /* Writes 'raw' data in EWF format at the current offset * the necessary settings of the write values must have been made * size contains the size of the data within the buffer while * data size contains the size of the actual input data * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error * * This function is deprecated use libewf_handle_write_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, size_t data_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t write_checksum ); /* Writes data in EWF format at the current offset * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error * * This function is deprecated use libewf_handle_write_buffer instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ); /* Writes data in EWF format at a specific offset, * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error * * This function is deprecated use libewf_handle_write_random instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_write_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ); /* Finalizes the write by correcting the EWF the meta data in the segment files * This function is required after writing from stream * Returns the amount of input bytes written or -1 on error * * This function is deprecated use libewf_handle_write_finalize instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_write_finalize( libewf_handle_t *handle ); /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ); /* Sets the segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ); /* Sets the segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ); #endif /* Retrieves the segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size ); /* Sets the segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size ); /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_delta_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_delta_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_delta_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_delta_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ); #endif /* Retrieves the delta segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size ); /* Sets the delta segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size ); /* ------------------------------------------------------------------------- * Meta data functions * ------------------------------------------------------------------------- */ /* Retrieves the amount of sectors per chunk * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_sectors_per_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk ); /* Sets the amount of sectors per chunk * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_sectors_per_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk ); /* Retrieves the amount of bytes per sector * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_bytes_per_sector instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector ); /* Sets the amount of bytes per sector * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_bytes_per_sector instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector ); /* Retrieves the amount of sectors * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_sectors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_sectors( libewf_handle_t *handle, uint32_t *amount_of_sectors ); /* Retrieves the chunk size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_chunk_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size ); /* Retrieves the error granularity * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_error_granularity instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity ); /* Sets the error granularity * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_error_granularity instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity ); /* Retrieves the compression values * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_compression_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compress_empty_block ); /* Sets the compression values * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_compression_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compress_empty_block ); /* Retrieves the size of the contained (media) data * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_media_size( libewf_handle_t *handle, size64_t *media_size ); /* Sets the media size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_media_size( libewf_handle_t *handle, size64_t media_size ); /* Retrieves the media type value * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_type instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_media_type( libewf_handle_t *handle, uint8_t *media_type ); /* Sets the media type * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_type instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_media_type( libewf_handle_t *handle, uint8_t media_type ); /* Retrieves the media flags * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags ); /* Sets the media flags * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_media_flags( libewf_handle_t *handle, uint8_t media_flags ); /* Retrieves the volume type value * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_volume_type( libewf_handle_t *handle, uint8_t *volume_type ); /* Sets the volume type * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_volume_type( libewf_handle_t *handle, uint8_t volume_type ); /* Retrieves the format type value * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_format instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_format( libewf_handle_t *handle, uint8_t *format ); /* Sets the output format * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_format instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_format( libewf_handle_t *handle, uint8_t format ); /* Retrieves the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_guid instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ); /* Sets the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_guid instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ); /* Retrieves the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_segment_file_set_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libewf_error_t **error ); /* Sets the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_segment_file_set_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libewf_error_t **error ); /* Retrieves the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_md5_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ); /* Sets the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_set_md5_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ); /* Retrieves the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_sha1_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ); /* Sets the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_set_sha1_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ); /* Retrieves the amount of chunks written * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_write_amount_of_chunks instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks ); /* Sets the read wipe chunk on error * The chunk is not wiped if read raw is used * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_read_zero_chunk_on_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error ); /* Copies the media values from the source to the destination handle * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_copy_media_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ); /* Retrieves the amount of acquiry errors * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_acquiry_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ); /* Retrieves an acquiry error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_acquiry_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_acquiry_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); /* Add an acquiry error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_append_acquiry_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_add_acquiry_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); /* Retrieves the amount of checksum errors * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_checksum_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ); /* Retrieves a checksum error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_crc_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); /* Add a checksum error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_append_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_add_crc_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); /* Retrieves the amount of sessions * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_sessions instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions ); /* Retrieves a session * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_session instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_session( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); /* Add a session * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_append_session instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_add_session( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); /* Retrieves the header codepage * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_header_codepage instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_codepage( libewf_handle_t *handle, int *header_codepage ); /* Sets the header codepage * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_header_codepage instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_header_codepage( libewf_handle_t *handle, int header_codepage ); /* Retrieves the amount of header values * Returns 1 if successful, 0 if no header values are present or -1 on error * * This function is deprecated use libewf_handle_get_number_of_header_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values ); /* Retrieves the header value identifier size specified by its index * The identifier size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value_identifier_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ); /* Retrieves the header value identifier specified by its index * The strings are encoded in UTF-8 * The identifier size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ); /* Retrieves the header value size specified by the identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ); /* Retrieves the header value specified by the identifier * The strings are encoded in UTF-8 * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ); /* Retrieves the header value case number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_case_number( handle, value, value_size ) \ libewf_get_header_value( handle, "case_number", value, value_size ) /* Retrieves the header value description * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_description( handle, value, value_size ) \ libewf_get_header_value( handle, "description", value, value_size ) /* Retrieves the header value examiner name * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_examiner_name( handle, value, value_size ) \ libewf_get_header_value( handle, "examiner_name", value, value_size ) /* Retrieves the header value evidence number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_evidence_number( handle, value, value_size ) \ libewf_get_header_value( handle, "evidence_number", value, value_size ) /* Retrieves the header value notes * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_notes( handle, value, value_size ) \ libewf_get_header_value( handle, "notes", value, value_size ) /* Retrieves the header value acquiry date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_acquiry_date( handle, value, value_size ) \ libewf_get_header_value( handle, "acquiry_date", value, value_size ) /* Retrieves the header value system date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_system_date( handle, value, value_size ) \ libewf_get_header_value( handle, "system_date", value, value_size ) /* Retrieves the header value acquiry operating system * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_acquiry_operating_system( handle, value, value_size ) \ libewf_get_header_value( handle, "acquiry_operating_system", value, value_size ) /* Retrieves the header value acquiry software version * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_acquiry_software_version( handle, value, value_size ) \ libewf_get_header_value( handle, "acquiry_software_version", value, value_size ) /* Retrieves the header value password * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_password( handle, value, value_size ) \ libewf_get_header_value( handle, "password", value, value_size ) /* Retrieves the header value compression type * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_compression_type( handle, value, value_size ) \ libewf_get_header_value( handle, "compression_type", value, value_size ) /* Retrieves the header value model * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_model( handle, value, value_size ) \ libewf_get_header_value( handle, "model", value, value_size ) /* Retrieves the header value serial number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_serial_number( handle, value, value_size ) \ libewf_get_header_value( handle, "serial_number", value, value_size ) /* Sets the header value specified by the identifier * The strings are encoded in UTF-8 * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_header_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ); /* Sets the header value case number * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_case_number( handle, value, value_length ) \ libewf_set_header_value( handle, "case_number", value, value_length ) /* Sets the header value description * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_description( handle, value, value_length ) \ libewf_set_header_value( handle, "description", value, value_length ) /* Sets the header value examiner name * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_examiner_name( handle, value, value_length ) \ libewf_set_header_value( handle, "examiner_name", value, value_length ) /* Sets the header value evidence number * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_evidence_number( handle, value, value_length ) \ libewf_set_header_value( handle, "evidence_number", value, value_length ) /* Sets the header value notes * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_notes( handle, value, value_length ) \ libewf_set_header_value( handle, "notes", value, value_length ) /* Sets the header value acquiry date * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_acquiry_date( handle, value, value_length ) \ libewf_set_header_value( handle, "acquiry_date", value, value_length ) /* Sets the header value system date * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_system_date( handle, value, value_length ) \ libewf_set_header_value( handle, "system_date", value, value_length ) /* Sets the header value acquiry operating system * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_acquiry_operating_system( handle, value, value_length ) \ libewf_set_header_value( handle, "acquiry_operating_system", value, value_length ) /* Sets the header value acquiry software version * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_acquiry_software_version( handle, value, value_length ) \ libewf_set_header_value( handle, "acquiry_software_version", value, value_length ) /* Sets the header value password * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_password( handle, value, value_length ) \ libewf_set_header_value( handle, "password", value, value_length ) /* Sets the header value compression type * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_compression_type( handle, value, value_length ) \ libewf_set_header_value( handle, "compression_type", value, value_length ) /* Sets the header value model * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_model( handle, value, value_length ) \ libewf_set_header_value( handle, "model", value, value_length ) /* Sets the header value serial number * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_serial_number( handle, value, value_length ) \ libewf_set_header_value( handle, "serial_number", value, value_length ) /* Parses the header values from the xheader, header2 or header section * Will parse the first available header in order mentioned above * Returns 1 if successful, 0 if already parsed or -1 on error * * This function is deprecated and no longer required */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_parse_header_values( libewf_handle_t *handle, uint8_t date_format ); /* Copies the header values from the source to the destination handle * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_copy_header_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ); /* Retrieves the amount of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error * * This function is deprecated use libewf_handle_get_number_of_hash_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values ); /* Retrieves the hash value identifier size specified by its index * The identifier size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value_identifier_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ); /* Retrieves the hash value identifier specified by its index * The strings are encoded in UTF-8 * The identifier size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ); /* Retrieves the hash value size specified by the identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ); /* Retrieves the hash value specified by the identifier * The strings are encoded in UTF-8 * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ); /* Retrieves the hash value MD5 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_hash_value_md5( handle, value, value_size ) \ libewf_get_hash_value( handle, "MD5", value, value_size ) /* Retrieves the hash value SHA1 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_hash_value_sha1( handle, value, value_size ) \ libewf_get_hash_value( handle, "SHA1", value, value_size ) /* Sets the hash value specified by the identifier * The strings are encoded in UTF-8 * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_hash_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ); /* Sets the hash value MD5 * Returns 1 if successful or -1 on error */ #define libewf_set_hash_value_md5( handle, value, value_length ) \ libewf_set_hash_value( handle, "MD5", value, value_length ) /* Sets the hash value SHA1 * Returns 1 if successful or -1 on error */ #define libewf_set_hash_value_sha1( handle, value, value_length ) \ libewf_set_hash_value( handle, "SHA1", value, value_length ) /* Parses the hash values from the xhash section * Returns 1 if successful, 0 if already parsed or -1 on error * * This function is deprecated and no longer required */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_parse_hash_values( libewf_handle_t *handle ); #endif /* defined( HAVE_V1_API ) */ #ifdef __cplusplus } #endif #endif /* !defined( _LIBEWF_H ) */ libewf-20140807/include/Makefile.am0000644000175000017500000000072013440662652021015 0ustar00lordyestalordyesta00000000000000include_HEADERS = \ libewf.h pkginclude_HEADERS = \ libewf/codepage.h \ libewf/definitions.h \ libewf/error.h \ libewf/extern.h \ libewf/features.h \ libewf/types.h EXTRA_DIST = \ libewf.h.in \ libewf/definitions.h.in \ libewf/features.h.in \ libewf/types.h.in MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f libewf.h /bin/rm -f libewf/definitions.h /bin/rm -f libewf/features.h /bin/rm -f libewf/types.h /bin/rm -f Makefile libewf-20140807/include/libewf/0000775000175000017500000000000013443455444020236 5ustar00lordyestalordyesta00000000000000libewf-20140807/include/libewf/definitions.h.in0000664000175000017500000001362313440662655023335 0ustar00lordyestalordyesta00000000000000/* * Definitions for libewf * * 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_DEFINITIONS_H ) #define _LIBEWF_DEFINITIONS_H #include #define LIBEWF_VERSION @VERSION@ /* The version string */ #define LIBEWF_VERSION_STRING "@VERSION@" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3-4 not used * bit 5 set to 1 to resume write * bit 6-8 not used */ enum LIBEWF_ACCESS_FLAGS { LIBEWF_ACCESS_FLAG_READ = 0x01, LIBEWF_ACCESS_FLAG_WRITE = 0x02, LIBEWF_ACCESS_FLAG_RESUME = 0x10 }; /* The file access macros */ #define LIBEWF_OPEN_READ ( LIBEWF_ACCESS_FLAG_READ ) #define LIBEWF_OPEN_READ_WRITE ( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE ( LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE_RESUME ( LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ) /* TODO deprecated remove after a while */ #define LIBEWF_FLAG_READ LIBEWF_ACCESS_FLAG_READ #define LIBEWF_FLAG_WRITE LIBEWF_ACCESS_FLAG_WRITE #define LIBEWF_FLAG_RESUME LIBEWF_ACCESS_FLAG_RESUME /* The file formats */ enum LIBEWF_FORMAT { LIBEWF_FORMAT_UNKNOWN = 0x00, LIBEWF_FORMAT_ENCASE1 = 0x01, LIBEWF_FORMAT_ENCASE2 = 0x02, LIBEWF_FORMAT_ENCASE3 = 0x03, LIBEWF_FORMAT_ENCASE4 = 0x04, LIBEWF_FORMAT_ENCASE5 = 0x05, LIBEWF_FORMAT_ENCASE6 = 0x06, LIBEWF_FORMAT_ENCASE7 = 0x07, LIBEWF_FORMAT_SMART = 0x0e, LIBEWF_FORMAT_FTK_IMAGER = 0x0f, LIBEWF_FORMAT_LOGICAL_ENCASE5 = 0x10, LIBEWF_FORMAT_LOGICAL_ENCASE6 = 0x11, LIBEWF_FORMAT_LOGICAL_ENCASE7 = 0x12, LIBEWF_FORMAT_LINEN5 = 0x25, LIBEWF_FORMAT_LINEN6 = 0x26, LIBEWF_FORMAT_LINEN7 = 0x27, /* The format as specified by Andrew Rosen */ LIBEWF_FORMAT_EWF = 0x70, /* Libewf eXtended EWF format */ LIBEWF_FORMAT_EWFX = 0x71 }; /* TODO deprecated remove after a while */ #define LIBEWF_FORMAT_LVF LIBEWF_FORMAT_LOGICAL_ENCASE5 #define LIBEWF_FORMAT_FTK LIBEWF_FORMAT_FTK_IMAGER /* The default segment file size */ #define LIBEWF_DEFAULT_SEGMENT_FILE_SIZE ( 1500 * 1024 * 1024 ) /* The compression methods definitions */ enum LIBEWF_COMPRESSION_METHODS { LIBEWF_COMPRESSION_METHOD_NONE = 0, LIBEWF_COMPRESSION_METHOD_DEFLATE = 1, LIBEWF_COMPRESSION_METHOD_BZIP2 = 2, }; /* The compression level definitions */ enum LIBEWF_COMPRESSION_LEVELS { LIBEWF_COMPRESSION_DEFAULT = -1, LIBEWF_COMPRESSION_NONE = 0, LIBEWF_COMPRESSION_FAST = 1, LIBEWF_COMPRESSION_BEST = 2, }; /* The compression flags * bit 1 set to 1 for empty block compression * detects empty blocks and stored them compressed, the compression * is only done once * bit 2-8 not used */ enum LIBEWF_COMPRESSION_FLAGS { LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION = (uint8_t) 0x01, }; /* TODO deprecated remove after a while */ #define LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION /* The media type definitions */ enum LIBEWF_MEDIA_TYPES { LIBEWF_MEDIA_TYPE_REMOVABLE = 0x00, LIBEWF_MEDIA_TYPE_FIXED = 0x01, LIBEWF_MEDIA_TYPE_OPTICAL = 0x03, LIBEWF_MEDIA_TYPE_SINGLE_FILES = 0x0e, LIBEWF_MEDIA_TYPE_MEMORY = 0x10 }; /* The media flags definitions */ enum LIBEWF_MEDIA_FLAGS { LIBEWF_MEDIA_FLAG_PHYSICAL = 0x02, LIBEWF_MEDIA_FLAG_FASTBLOC = 0x04, LIBEWF_MEDIA_FLAG_TABLEAU = 0x08 }; #if @HAVE_V1_API@ /* The volume type definitions */ enum LIBEWF_VOLUME_TYPES { LIBEWF_VOLUME_TYPE_LOGICAL = 0x00, LIBEWF_VOLUME_TYPE_PHYSICAL = 0x01 }; #endif /* The date representation formats */ enum LIBEWF_DATE_FORMATS { LIBEWF_DATE_FORMAT_DAYMONTH = 0x01, LIBEWF_DATE_FORMAT_MONTHDAY = 0x02, LIBEWF_DATE_FORMAT_ISO8601 = 0x03, LIBEWF_DATE_FORMAT_CTIME = 0x04 }; /* The header value compression levels definitions */ #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST "b" /* TODO deprecated remove after a while */ #define LIBEWF_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_COMPRESSION_LEVEL_BEST "b" /* TODO deprecated remove after a while */ /* The compression types */ #define LIBEWF_COMPRESSION_TYPE_NONE "n" #define LIBEWF_COMPRESSION_TYPE_FAST "f" #define LIBEWF_COMPRESSION_TYPE_BEST "b" /* The segment file type definitions */ enum LIBEWF_SEGMENT_FILE_TYPES { LIBEWF_SEGMENT_FILE_TYPE_DWF = (int) 'd', LIBEWF_SEGMENT_FILE_TYPE_EWF = (int) 'E', LIBEWF_SEGMENT_FILE_TYPE_LWF = (int) 'L' }; /* The (single) file entry types */ enum LIBEWF_FILE_ENTRY_TYPES { LIBEWF_FILE_ENTRY_TYPE_DIRECTORY = (uint8_t) 'd', LIBEWF_FILE_ENTRY_TYPE_FILE = (uint8_t) 'f' }; #define LIBEWF_FILE_ENTRY_TYPE_FOLDER LIBEWF_FILE_ENTRY_TYPE_DIRECTORY /* The (single) file entry flags */ enum LIBEWF_FILE_ENTRY_FLAGS { LIBEWF_FILE_ENTRY_FLAG_ARCHIVE = 0x00000008UL, LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA = 0x04000000UL, }; /* The (single) file entry name separator */ #define LIBEWF_SEPARATOR '\\' #endif libewf-20140807/include/libewf/extern.h0000664000175000017500000000257213440663046021716 0ustar00lordyestalordyesta00000000000000/* * The extern definition * * This header should be included in header files that export or import * library functions * * Copyright (C) 2006-2018, 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_EXTERN_H ) #define _LIBEWF_EXTERN_H /* To export functions from the libewf DLL define LIBEWF_DLL_EXPORT * To import functions from the libewf DLL define LIBEWF_DLL_IMPORT * Otherwise use default extern statement */ #if defined( LIBEWF_DLL_EXPORT ) #define LIBEWF_EXTERN __declspec(dllexport) #elif defined( LIBEWF_DLL_IMPORT ) #define LIBEWF_EXTERN extern __declspec(dllimport) #else #define LIBEWF_EXTERN extern #endif #endif /* !defined( _LIBEWF_EXTERN_H ) */ libewf-20140807/include/libewf/types.h0000664000175000017500000001134213443455443021553 0ustar00lordyestalordyesta00000000000000/* * Type definitions for libewf * * Copyright (C) 2006-2018, 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_TYPES_H ) #define _LIBEWF_TYPES_H #include /* Integer type definitions */ #if ( defined( _MSC_VER ) && ( _MSC_VER < 1600 ) ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) ) #ifdef __cplusplus extern "C" { #endif /* Microsoft Visual Studio C++ before Visual Studio 2010 or earlier versions of the Borland C++ Builder * do not support the (u)int#_t type definitions but have __int# defintions instead */ #if !defined( HAVE_INT8_T ) #define HAVE_INT8_T typedef __int8 int8_t; #endif #if !defined( HAVE_UINT8_T ) #define HAVE_UINT8_T typedef unsigned __int8 uint8_t; #endif #if !defined( HAVE_INT16_T ) #define HAVE_INT16_T typedef __int16 int16_t; #endif #if !defined( HAVE_UINT16_T ) #define HAVE_UINT16_T typedef unsigned __int16 uint16_t; #endif #if !defined( HAVE_INT32_T ) #define HAVE_INT32_T typedef __int32 int32_t; #endif #if !defined( HAVE_UINT32_T ) #define HAVE_UINT32_T typedef unsigned __int32 uint32_t; #endif #if !defined( HAVE_INT64_T ) #define HAVE_INT64_T typedef __int64 int64_t; #endif #if !defined( HAVE_UINT64_T ) #define HAVE_UINT64_T typedef unsigned __int64 uint64_t; #endif #ifdef __cplusplus } #endif #elif defined( _MSC_VER ) || defined( __BORLANDC__ ) /* Later versions of Microsoft Visual Studio C++ and Borland C/C++ define the types in */ #include #else #if 1 || defined( HAVE_SYS_TYPES_H ) #include #else #error Missing system type definitions (sys/types.h) #endif /* Type definitions for compilers that have access to * or */ #if 1 || defined( HAVE_INTTYPES_H ) #include #elif 1 || defined( HAVE_STDINT_H ) #include #else #error Missing integer type definitions (inttypes.h, stdint.h) #endif #endif #ifdef __cplusplus extern "C" { #endif #if defined( _MSC_VER ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) ) /* Microsoft Visual Studio C++ or earlier versions of the Borland C++ Builder * do not support the ssize_t type definition */ #if !defined( HAVE_SSIZE_T ) #define HAVE_SSIZE_T #if defined( _WIN64 ) typedef __int64 ssize_t; #else typedef __int32 ssize_t; #endif #endif /* !defined( HAVE_SSIZE_T ) */ #endif /* defined( _MSC_VER ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) ) */ #if defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) /* Earlier versions of Borland C++ Builder do not support the intptr_t type definition */ #if !defined( HAVE_INTPTR_T ) #define HAVE_INTPTR_T #if defined( _WIN64 ) typedef __int64 intptr_t; #else typedef __int32 intptr_t; #endif #endif /* !defined( HAVE_INTPTR_T ) */ #endif /* defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) */ #if ( !defined( HAVE_SIZE32_T ) && ! 0 ) || HAVE_SIZE32_T == 0 #define HAVE_SIZE32_T 1 typedef uint32_t size32_t; #endif #if ( !defined( HAVE_SSIZE32_T ) && ! 0 ) || HAVE_SSIZE32_T == 0 #define HAVE_SSIZE32_T 1 typedef int32_t ssize32_t; #endif #if ( !defined( HAVE_SIZE64_T ) && ! 0 ) || HAVE_SIZE64_T == 0 #define HAVE_SIZE64_T 1 typedef uint64_t size64_t; #endif #if ( !defined( HAVE_SSIZE64_T ) && ! 0 ) || HAVE_SSIZE64_T == 0 #define HAVE_SSIZE64_T 1 typedef int64_t ssize64_t; #endif #if ( !defined( HAVE_OFF64_T ) && ! 0 ) || HAVE_OFF64_T == 0 #define HAVE_OFF64_T 1 typedef int64_t off64_t; #endif /* Wide character definition */ #if defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0520 ) #include #elif defined( WINAPI ) #include #elif 1 || defined( HAVE_WCHAR_H ) /* __USE_UNIX98 is required to add swprintf definition */ #if !defined( __USE_UNIX98 ) #define __USE_UNIX98 #define LIBEWF_DEFINITION_UNIX98 #endif #include #if defined( LIBEWF_DEFINITION_UNIX98 ) #undef __USE_UNIX98 #undef LIBEWF_DEFINITION_UNIX98 #endif #endif /* The following type definitions hide internal data structures */ typedef intptr_t libewf_file_entry_t; typedef intptr_t libewf_handle_t; #ifdef __cplusplus } #endif #endif /* !defined( _LIBEWF_TYPES_H ) */ libewf-20140807/include/libewf/features.h.in0000664000175000017500000000271013440663046022626 0ustar00lordyestalordyesta00000000000000/* * Features of libewf * * 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_FEATURES_H ) #define _LIBEWF_FEATURES_H #if defined( WINAPI ) || @HAVE_WIDE_CHARACTER_TYPE@ #define LIBEWF_HAVE_WIDE_CHARACTER_TYPE 1 /* Old definition kept for compatibility (for now) */ #define LIBEWF_WIDE_CHARACTER_TYPE 1 #endif #if defined( HAVE_LIBBFIO ) || ( !defined( WINAPI ) && @HAVE_LIBBFIO@ ) #define LIBEWF_HAVE_BFIO 1 #endif #if !defined( LIBEWF_DEPRECATED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBEWF_DEPRECATED __attribute__ ((__deprecated__)) #elif defined( _MSC_VER ) #define LIBEWF_DEPRECATED __declspec(deprecated) #else #define LIBEWF_DEPRECATED #endif #endif #endif /* !defined( _LIBEWF_FEATURES_H ) */ libewf-20140807/include/libewf/types.h.in0000664000175000017500000001154513440663046022162 0ustar00lordyestalordyesta00000000000000/* * Type definitions for libewf * * Copyright (C) 2006-2018, 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_TYPES_H ) #define _LIBEWF_TYPES_H #include /* Integer type definitions */ #if ( defined( _MSC_VER ) && ( _MSC_VER < 1600 ) ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) ) #ifdef __cplusplus extern "C" { #endif /* Microsoft Visual Studio C++ before Visual Studio 2010 or earlier versions of the Borland C++ Builder * do not support the (u)int#_t type definitions but have __int# defintions instead */ #if !defined( HAVE_INT8_T ) #define HAVE_INT8_T typedef __int8 int8_t; #endif #if !defined( HAVE_UINT8_T ) #define HAVE_UINT8_T typedef unsigned __int8 uint8_t; #endif #if !defined( HAVE_INT16_T ) #define HAVE_INT16_T typedef __int16 int16_t; #endif #if !defined( HAVE_UINT16_T ) #define HAVE_UINT16_T typedef unsigned __int16 uint16_t; #endif #if !defined( HAVE_INT32_T ) #define HAVE_INT32_T typedef __int32 int32_t; #endif #if !defined( HAVE_UINT32_T ) #define HAVE_UINT32_T typedef unsigned __int32 uint32_t; #endif #if !defined( HAVE_INT64_T ) #define HAVE_INT64_T typedef __int64 int64_t; #endif #if !defined( HAVE_UINT64_T ) #define HAVE_UINT64_T typedef unsigned __int64 uint64_t; #endif #ifdef __cplusplus } #endif #elif defined( _MSC_VER ) || defined( __BORLANDC__ ) /* Later versions of Microsoft Visual Studio C++ and Borland C/C++ define the types in */ #include #else #if @HAVE_SYS_TYPES_H@ || defined( HAVE_SYS_TYPES_H ) #include #else #error Missing system type definitions (sys/types.h) #endif /* Type definitions for compilers that have access to * or */ #if @HAVE_INTTYPES_H@ || defined( HAVE_INTTYPES_H ) #include #elif @HAVE_STDINT_H@ || defined( HAVE_STDINT_H ) #include #else #error Missing integer type definitions (inttypes.h, stdint.h) #endif #endif #ifdef __cplusplus extern "C" { #endif #if defined( _MSC_VER ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) ) /* Microsoft Visual Studio C++ or earlier versions of the Borland C++ Builder * do not support the ssize_t type definition */ #if !defined( HAVE_SSIZE_T ) #define HAVE_SSIZE_T #if defined( _WIN64 ) typedef __int64 ssize_t; #else typedef __int32 ssize_t; #endif #endif /* !defined( HAVE_SSIZE_T ) */ #endif /* defined( _MSC_VER ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) ) */ #if defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) /* Earlier versions of Borland C++ Builder do not support the intptr_t type definition */ #if !defined( HAVE_INTPTR_T ) #define HAVE_INTPTR_T #if defined( _WIN64 ) typedef __int64 intptr_t; #else typedef __int32 intptr_t; #endif #endif /* !defined( HAVE_INTPTR_T ) */ #endif /* defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0560 ) */ #if ( !defined( HAVE_SIZE32_T ) && ! @HAVE_SIZE32_T@ ) || HAVE_SIZE32_T == 0 #define HAVE_SIZE32_T 1 typedef uint32_t size32_t; #endif #if ( !defined( HAVE_SSIZE32_T ) && ! @HAVE_SSIZE32_T@ ) || HAVE_SSIZE32_T == 0 #define HAVE_SSIZE32_T 1 typedef int32_t ssize32_t; #endif #if ( !defined( HAVE_SIZE64_T ) && ! @HAVE_SIZE64_T@ ) || HAVE_SIZE64_T == 0 #define HAVE_SIZE64_T 1 typedef uint64_t size64_t; #endif #if ( !defined( HAVE_SSIZE64_T ) && ! @HAVE_SSIZE64_T@ ) || HAVE_SSIZE64_T == 0 #define HAVE_SSIZE64_T 1 typedef int64_t ssize64_t; #endif #if ( !defined( HAVE_OFF64_T ) && ! @HAVE_OFF64_T@ ) || HAVE_OFF64_T == 0 #define HAVE_OFF64_T 1 typedef int64_t off64_t; #endif /* Wide character definition */ #if defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x0520 ) #include #elif defined( WINAPI ) #include #elif @HAVE_WCHAR_H@ || defined( HAVE_WCHAR_H ) /* __USE_UNIX98 is required to add swprintf definition */ #if !defined( __USE_UNIX98 ) #define __USE_UNIX98 #define LIBEWF_DEFINITION_UNIX98 #endif #include #if defined( LIBEWF_DEFINITION_UNIX98 ) #undef __USE_UNIX98 #undef LIBEWF_DEFINITION_UNIX98 #endif #endif /* The following type definitions hide internal data structures */ typedef intptr_t libewf_file_entry_t; typedef intptr_t libewf_handle_t; #ifdef __cplusplus } #endif #endif /* !defined( _LIBEWF_TYPES_H ) */ libewf-20140807/include/libewf/features.h0000664000175000017500000000264213443455443022230 0ustar00lordyestalordyesta00000000000000/* * Features of libewf * * 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_FEATURES_H ) #define _LIBEWF_FEATURES_H #if defined( WINAPI ) || 0 #define LIBEWF_HAVE_WIDE_CHARACTER_TYPE 1 /* Old definition kept for compatibility (for now) */ #define LIBEWF_WIDE_CHARACTER_TYPE 1 #endif #if defined( HAVE_LIBBFIO ) || ( !defined( WINAPI ) && 0 ) #define LIBEWF_HAVE_BFIO 1 #endif #if !defined( LIBEWF_DEPRECATED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBEWF_DEPRECATED __attribute__ ((__deprecated__)) #elif defined( _MSC_VER ) #define LIBEWF_DEPRECATED __declspec(deprecated) #else #define LIBEWF_DEPRECATED #endif #endif #endif /* !defined( _LIBEWF_FEATURES_H ) */ libewf-20140807/include/libewf/definitions.h0000664000175000017500000001360513443455443022726 0ustar00lordyestalordyesta00000000000000/* * Definitions for libewf * * 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_DEFINITIONS_H ) #define _LIBEWF_DEFINITIONS_H #include #define LIBEWF_VERSION 20140807 /* The version string */ #define LIBEWF_VERSION_STRING "20140807" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3-4 not used * bit 5 set to 1 to resume write * bit 6-8 not used */ enum LIBEWF_ACCESS_FLAGS { LIBEWF_ACCESS_FLAG_READ = 0x01, LIBEWF_ACCESS_FLAG_WRITE = 0x02, LIBEWF_ACCESS_FLAG_RESUME = 0x10 }; /* The file access macros */ #define LIBEWF_OPEN_READ ( LIBEWF_ACCESS_FLAG_READ ) #define LIBEWF_OPEN_READ_WRITE ( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE ( LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE_RESUME ( LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ) /* TODO deprecated remove after a while */ #define LIBEWF_FLAG_READ LIBEWF_ACCESS_FLAG_READ #define LIBEWF_FLAG_WRITE LIBEWF_ACCESS_FLAG_WRITE #define LIBEWF_FLAG_RESUME LIBEWF_ACCESS_FLAG_RESUME /* The file formats */ enum LIBEWF_FORMAT { LIBEWF_FORMAT_UNKNOWN = 0x00, LIBEWF_FORMAT_ENCASE1 = 0x01, LIBEWF_FORMAT_ENCASE2 = 0x02, LIBEWF_FORMAT_ENCASE3 = 0x03, LIBEWF_FORMAT_ENCASE4 = 0x04, LIBEWF_FORMAT_ENCASE5 = 0x05, LIBEWF_FORMAT_ENCASE6 = 0x06, LIBEWF_FORMAT_ENCASE7 = 0x07, LIBEWF_FORMAT_SMART = 0x0e, LIBEWF_FORMAT_FTK_IMAGER = 0x0f, LIBEWF_FORMAT_LOGICAL_ENCASE5 = 0x10, LIBEWF_FORMAT_LOGICAL_ENCASE6 = 0x11, LIBEWF_FORMAT_LOGICAL_ENCASE7 = 0x12, LIBEWF_FORMAT_LINEN5 = 0x25, LIBEWF_FORMAT_LINEN6 = 0x26, LIBEWF_FORMAT_LINEN7 = 0x27, /* The format as specified by Andrew Rosen */ LIBEWF_FORMAT_EWF = 0x70, /* Libewf eXtended EWF format */ LIBEWF_FORMAT_EWFX = 0x71 }; /* TODO deprecated remove after a while */ #define LIBEWF_FORMAT_LVF LIBEWF_FORMAT_LOGICAL_ENCASE5 #define LIBEWF_FORMAT_FTK LIBEWF_FORMAT_FTK_IMAGER /* The default segment file size */ #define LIBEWF_DEFAULT_SEGMENT_FILE_SIZE ( 1500 * 1024 * 1024 ) /* The compression methods definitions */ enum LIBEWF_COMPRESSION_METHODS { LIBEWF_COMPRESSION_METHOD_NONE = 0, LIBEWF_COMPRESSION_METHOD_DEFLATE = 1, LIBEWF_COMPRESSION_METHOD_BZIP2 = 2, }; /* The compression level definitions */ enum LIBEWF_COMPRESSION_LEVELS { LIBEWF_COMPRESSION_DEFAULT = -1, LIBEWF_COMPRESSION_NONE = 0, LIBEWF_COMPRESSION_FAST = 1, LIBEWF_COMPRESSION_BEST = 2, }; /* The compression flags * bit 1 set to 1 for empty block compression * detects empty blocks and stored them compressed, the compression * is only done once * bit 2-8 not used */ enum LIBEWF_COMPRESSION_FLAGS { LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION = (uint8_t) 0x01, }; /* TODO deprecated remove after a while */ #define LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION /* The media type definitions */ enum LIBEWF_MEDIA_TYPES { LIBEWF_MEDIA_TYPE_REMOVABLE = 0x00, LIBEWF_MEDIA_TYPE_FIXED = 0x01, LIBEWF_MEDIA_TYPE_OPTICAL = 0x03, LIBEWF_MEDIA_TYPE_SINGLE_FILES = 0x0e, LIBEWF_MEDIA_TYPE_MEMORY = 0x10 }; /* The media flags definitions */ enum LIBEWF_MEDIA_FLAGS { LIBEWF_MEDIA_FLAG_PHYSICAL = 0x02, LIBEWF_MEDIA_FLAG_FASTBLOC = 0x04, LIBEWF_MEDIA_FLAG_TABLEAU = 0x08 }; #if 0 /* The volume type definitions */ enum LIBEWF_VOLUME_TYPES { LIBEWF_VOLUME_TYPE_LOGICAL = 0x00, LIBEWF_VOLUME_TYPE_PHYSICAL = 0x01 }; #endif /* The date representation formats */ enum LIBEWF_DATE_FORMATS { LIBEWF_DATE_FORMAT_DAYMONTH = 0x01, LIBEWF_DATE_FORMAT_MONTHDAY = 0x02, LIBEWF_DATE_FORMAT_ISO8601 = 0x03, LIBEWF_DATE_FORMAT_CTIME = 0x04 }; /* The header value compression levels definitions */ #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST "b" /* TODO deprecated remove after a while */ #define LIBEWF_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_COMPRESSION_LEVEL_BEST "b" /* TODO deprecated remove after a while */ /* The compression types */ #define LIBEWF_COMPRESSION_TYPE_NONE "n" #define LIBEWF_COMPRESSION_TYPE_FAST "f" #define LIBEWF_COMPRESSION_TYPE_BEST "b" /* The segment file type definitions */ enum LIBEWF_SEGMENT_FILE_TYPES { LIBEWF_SEGMENT_FILE_TYPE_DWF = (int) 'd', LIBEWF_SEGMENT_FILE_TYPE_EWF = (int) 'E', LIBEWF_SEGMENT_FILE_TYPE_LWF = (int) 'L' }; /* The (single) file entry types */ enum LIBEWF_FILE_ENTRY_TYPES { LIBEWF_FILE_ENTRY_TYPE_DIRECTORY = (uint8_t) 'd', LIBEWF_FILE_ENTRY_TYPE_FILE = (uint8_t) 'f' }; #define LIBEWF_FILE_ENTRY_TYPE_FOLDER LIBEWF_FILE_ENTRY_TYPE_DIRECTORY /* The (single) file entry flags */ enum LIBEWF_FILE_ENTRY_FLAGS { LIBEWF_FILE_ENTRY_FLAG_ARCHIVE = 0x00000008UL, LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA = 0x04000000UL, }; /* The (single) file entry name separator */ #define LIBEWF_SEPARATOR '\\' #endif libewf-20140807/include/libewf/codepage.h0000664000175000017500000001173013440663046022154 0ustar00lordyestalordyesta00000000000000/* * Codepage definitions for libewf * * Copyright (C) 2006-2018, 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_CODEPAGE_H ) #define _LIBEWF_CODEPAGE_H #include #if defined( __cplusplus ) extern "C" { #endif /* The codepage definitions */ enum LIBEWF_CODEPAGES { LIBEWF_CODEPAGE_ASCII = 20127, LIBEWF_CODEPAGE_ISO_8859_1 = 28591, LIBEWF_CODEPAGE_ISO_8859_2 = 28592, LIBEWF_CODEPAGE_ISO_8859_3 = 28593, LIBEWF_CODEPAGE_ISO_8859_4 = 28594, LIBEWF_CODEPAGE_ISO_8859_5 = 28595, LIBEWF_CODEPAGE_ISO_8859_6 = 28596, LIBEWF_CODEPAGE_ISO_8859_7 = 28597, LIBEWF_CODEPAGE_ISO_8859_8 = 28598, LIBEWF_CODEPAGE_ISO_8859_9 = 28599, LIBEWF_CODEPAGE_ISO_8859_10 = 28600, LIBEWF_CODEPAGE_ISO_8859_11 = 28601, LIBEWF_CODEPAGE_ISO_8859_13 = 28603, LIBEWF_CODEPAGE_ISO_8859_14 = 28604, LIBEWF_CODEPAGE_ISO_8859_15 = 28605, LIBEWF_CODEPAGE_ISO_8859_16 = 28606, LIBEWF_CODEPAGE_KOI8_R = 20866, LIBEWF_CODEPAGE_KOI8_U = 21866, LIBEWF_CODEPAGE_WINDOWS_874 = 874, LIBEWF_CODEPAGE_WINDOWS_932 = 932, LIBEWF_CODEPAGE_WINDOWS_936 = 936, LIBEWF_CODEPAGE_WINDOWS_949 = 949, LIBEWF_CODEPAGE_WINDOWS_950 = 950, LIBEWF_CODEPAGE_WINDOWS_1250 = 1250, LIBEWF_CODEPAGE_WINDOWS_1251 = 1251, LIBEWF_CODEPAGE_WINDOWS_1252 = 1252, LIBEWF_CODEPAGE_WINDOWS_1253 = 1253, LIBEWF_CODEPAGE_WINDOWS_1254 = 1254, LIBEWF_CODEPAGE_WINDOWS_1255 = 1255, LIBEWF_CODEPAGE_WINDOWS_1256 = 1256, LIBEWF_CODEPAGE_WINDOWS_1257 = 1257, LIBEWF_CODEPAGE_WINDOWS_1258 = 1258 }; #define LIBEWF_CODEPAGE_US_ASCII LIBEWF_CODEPAGE_ASCII #define LIBEWF_CODEPAGE_ISO_WESTERN_EUROPEAN LIBEWF_CODEPAGE_ISO_8859_1 #define LIBEWF_CODEPAGE_ISO_CENTRAL_EUROPEAN LIBEWF_CODEPAGE_ISO_8859_2 #define LIBEWF_CODEPAGE_ISO_SOUTH_EUROPEAN LIBEWF_CODEPAGE_ISO_8859_3 #define LIBEWF_CODEPAGE_ISO_NORTH_EUROPEAN LIBEWF_CODEPAGE_ISO_8859_4 #define LIBEWF_CODEPAGE_ISO_CYRILLIC LIBEWF_CODEPAGE_ISO_8859_5 #define LIBEWF_CODEPAGE_ISO_ARABIC LIBEWF_CODEPAGE_ISO_8859_6 #define LIBEWF_CODEPAGE_ISO_GREEK LIBEWF_CODEPAGE_ISO_8859_7 #define LIBEWF_CODEPAGE_ISO_HEBREW LIBEWF_CODEPAGE_ISO_8859_8 #define LIBEWF_CODEPAGE_ISO_TURKISH LIBEWF_CODEPAGE_ISO_8859_9 #define LIBEWF_CODEPAGE_ISO_NORDIC LIBEWF_CODEPAGE_ISO_8859_10 #define LIBEWF_CODEPAGE_ISO_THAI LIBEWF_CODEPAGE_ISO_8859_11 #define LIBEWF_CODEPAGE_ISO_BALTIC LIBEWF_CODEPAGE_ISO_8859_13 #define LIBEWF_CODEPAGE_ISO_CELTIC LIBEWF_CODEPAGE_ISO_8859_14 #define LIBEWF_CODEPAGE_ISO_LATIN_1 LIBEWF_CODEPAGE_ISO_8859_1 #define LIBEWF_CODEPAGE_ISO_LATIN_2 LIBEWF_CODEPAGE_ISO_8859_2 #define LIBEWF_CODEPAGE_ISO_LATIN_3 LIBEWF_CODEPAGE_ISO_8859_3 #define LIBEWF_CODEPAGE_ISO_LATIN_4 LIBEWF_CODEPAGE_ISO_8859_4 #define LIBEWF_CODEPAGE_ISO_LATIN_5 LIBEWF_CODEPAGE_ISO_8859_9 #define LIBEWF_CODEPAGE_ISO_LATIN_6 LIBEWF_CODEPAGE_ISO_8859_10 #define LIBEWF_CODEPAGE_ISO_LATIN_7 LIBEWF_CODEPAGE_ISO_8859_13 #define LIBEWF_CODEPAGE_ISO_LATIN_8 LIBEWF_CODEPAGE_ISO_8859_14 #define LIBEWF_CODEPAGE_ISO_LATIN_9 LIBEWF_CODEPAGE_ISO_8859_15 #define LIBEWF_CODEPAGE_ISO_LATIN_10 LIBEWF_CODEPAGE_ISO_8859_16 #define LIBEWF_CODEPAGE_KOI8_RUSSIAN LIBEWF_CODEPAGE_KOI8_R #define LIBEWF_CODEPAGE_KOI8_UKRAINIAN LIBEWF_CODEPAGE_KOI8_U #define LIBEWF_CODEPAGE_WINDOWS_THAI LIBEWF_CODEPAGE_WINDOWS_874 #define LIBEWF_CODEPAGE_WINDOWS_JAPANESE LIBEWF_CODEPAGE_WINDOWS_932 #define LIBEWF_CODEPAGE_WINDOWS_CHINESE_SIMPLIFIED LIBEWF_CODEPAGE_WINDOWS_936 #define LIBEWF_CODEPAGE_WINDOWS_KOREAN LIBEWF_CODEPAGE_WINDOWS_949 #define LIBEWF_CODEPAGE_WINDOWS_CHINESE_TRADITIONAL LIBEWF_CODEPAGE_WINDOWS_950 #define LIBEWF_CODEPAGE_WINDOWS_CENTRAL_EUROPEAN LIBEWF_CODEPAGE_WINDOWS_1250 #define LIBEWF_CODEPAGE_WINDOWS_CYRILLIC LIBEWF_CODEPAGE_WINDOWS_1251 #define LIBEWF_CODEPAGE_WINDOWS_WESTERN_EUROPEAN LIBEWF_CODEPAGE_WINDOWS_1252 #define LIBEWF_CODEPAGE_WINDOWS_GREEK LIBEWF_CODEPAGE_WINDOWS_1253 #define LIBEWF_CODEPAGE_WINDOWS_TURKISH LIBEWF_CODEPAGE_WINDOWS_1254 #define LIBEWF_CODEPAGE_WINDOWS_HEBREW LIBEWF_CODEPAGE_WINDOWS_1255 #define LIBEWF_CODEPAGE_WINDOWS_ARABIC LIBEWF_CODEPAGE_WINDOWS_1256 #define LIBEWF_CODEPAGE_WINDOWS_BALTIC LIBEWF_CODEPAGE_WINDOWS_1257 #define LIBEWF_CODEPAGE_WINDOWS_VIETNAMESE LIBEWF_CODEPAGE_WINDOWS_1258 #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_CODEPAGE_H ) */ libewf-20140807/include/libewf/error.h0000664000175000017500000001474013440663046021542 0ustar00lordyestalordyesta00000000000000/* * The error code definitions for libewf * * Copyright (C) 2006-2018, 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_ERROR_H ) #define _LIBEWF_ERROR_H #include /* External error type definition hides internal structure */ typedef intptr_t libewf_error_t; /* The error domains */ enum LIBEWF_ERROR_DOMAINS { LIBEWF_ERROR_DOMAIN_ARGUMENTS = (int) 'a', LIBEWF_ERROR_DOMAIN_CONVERSION = (int) 'c', LIBEWF_ERROR_DOMAIN_COMPRESSION = (int) 'C', LIBEWF_ERROR_DOMAIN_IO = (int) 'I', LIBEWF_ERROR_DOMAIN_INPUT = (int) 'i', LIBEWF_ERROR_DOMAIN_MEMORY = (int) 'm', LIBEWF_ERROR_DOMAIN_OUTPUT = (int) 'o', LIBEWF_ERROR_DOMAIN_RUNTIME = (int) 'r' }; /* The argument error codes * to signify errors regarding arguments passed to a function */ enum LIBEWF_ARGUMENT_ERROR { LIBEWF_ARGUMENT_ERROR_GENERIC = 0, /* The argument contains an invalid value */ LIBEWF_ARGUMENT_ERROR_INVALID_VALUE = 1, /* The argument contains a value less than zero */ LIBEWF_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO = 2, /* The argument contains a value zero or less */ LIBEWF_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS = 3, /* The argument contains a value that exceeds the maximum * for the specific type */ LIBEWF_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM = 4, /* The argument contains a value that is too small */ LIBEWF_ARGUMENT_ERROR_VALUE_TOO_SMALL = 5, /* The argument contains a value that is too large */ LIBEWF_ARGUMENT_ERROR_VALUE_TOO_LARGE = 6, /* The argument contains a value that is out of bounds */ LIBEWF_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS = 7, /* The argument contains a value that is not supported */ LIBEWF_ARGUMENT_ERROR_UNSUPPORTED_VALUE = 8, /* The argument contains a value that conficts with another argument */ LIBEWF_ARGUMENT_ERROR_CONFLICTING_VALUE = 9 }; /* The conversion error codes * to signify errors regarding conversions */ enum LIBEWF_CONVERSION_ERROR { LIBEWF_CONVERSION_ERROR_GENERIC = 0, /* The conversion failed on the input */ LIBEWF_CONVERSION_ERROR_INPUT_FAILED = 1, /* The conversion failed on the output */ LIBEWF_CONVERSION_ERROR_OUTPUT_FAILED = 2 }; /* The compression error codes * to signify errors regarding compression */ enum LIBEWF_COMPRESSION_ERROR { LIBEWF_COMPRESSION_ERROR_GENERIC = 0, /* The compression failed */ LIBEWF_COMPRESSION_ERROR_COMPRESS_FAILED = 1, /* The decompression failed */ LIBEWF_COMPRESSION_ERROR_DECOMPRESS_FAILED = 2 }; /* The input/output error codes * to signify errors regarding input/output */ enum LIBEWF_IO_ERROR { LIBEWF_IO_ERROR_GENERIC = 0, /* The open failed */ LIBEWF_IO_ERROR_OPEN_FAILED = 1, /* The close failed */ LIBEWF_IO_ERROR_CLOSE_FAILED = 2, /* The seek failed */ LIBEWF_IO_ERROR_SEEK_FAILED = 3, /* The read failed */ LIBEWF_IO_ERROR_READ_FAILED = 4, /* The write failed */ LIBEWF_IO_ERROR_WRITE_FAILED = 5, /* Access denied */ LIBEWF_IO_ERROR_ACCESS_DENIED = 6, /* The resource is invalid i.e. a missing file */ LIBEWF_IO_ERROR_INVALID_RESOURCE = 7, /* The ioctl failed */ LIBEWF_IO_ERROR_IOCTL_FAILED = 8, /* The unlink failed */ LIBEWF_IO_ERROR_UNLINK_FAILED = 9 }; /* The input error codes * to signify errors regarding handing input data */ enum LIBEWF_INPUT_ERROR { LIBEWF_INPUT_ERROR_GENERIC = 0, /* The input contains invalid data */ LIBEWF_INPUT_ERROR_INVALID_DATA = 1, /* The input contains an unsupported signature */ LIBEWF_INPUT_ERROR_SIGNATURE_MISMATCH = 2, /* A checksum in the input did not match */ LIBEWF_INPUT_ERROR_CHECKSUM_MISMATCH = 3, /* A value in the input did not match a previously * read value or calculated value */ LIBEWF_INPUT_ERROR_VALUE_MISMATCH = 4 }; /* The memory error codes * to signify errors regarding memory */ enum LIBEWF_MEMORY_ERROR { LIBEWF_MEMORY_ERROR_GENERIC = 0, /* There is insufficient memory available */ LIBEWF_MEMORY_ERROR_INSUFFICIENT = 1, /* The memory failed to be copied */ LIBEWF_MEMORY_ERROR_COPY_FAILED = 2, /* The memory failed to be set */ LIBEWF_MEMORY_ERROR_SET_FAILED = 3 }; /* The output error codes */ enum LIBEWF_OUTPUT_ERROR { LIBEWF_OUTPUT_ERROR_GENERIC = 0, /* There is insuficient space to write the output */ LIBEWF_OUTPUT_ERROR_INSUFFICIENT_SPACE = 1 }; /* The runtime error codes * to signify errors regarding runtime processing */ enum LIBEWF_RUNTIME_ERROR { LIBEWF_RUNTIME_ERROR_GENERIC = 0, /* The value is missing */ LIBEWF_RUNTIME_ERROR_VALUE_MISSING = 1, /* The value was already set */ LIBEWF_RUNTIME_ERROR_VALUE_ALREADY_SET = 2, /* The creation and/or initialization of an internal structure failed */ LIBEWF_RUNTIME_ERROR_INITIALIZE_FAILED = 3, /* The resize of an internal structure failed */ LIBEWF_RUNTIME_ERROR_RESIZE_FAILED = 4, /* The free and/or finalization of an internal structure failed */ LIBEWF_RUNTIME_ERROR_FINALIZE_FAILED = 5, /* The value could not be determined */ LIBEWF_RUNTIME_ERROR_GET_FAILED = 6, /* The value could not be set */ LIBEWF_RUNTIME_ERROR_SET_FAILED = 7, /* The value could not be appended/prepended */ LIBEWF_RUNTIME_ERROR_APPEND_FAILED = 8, /* The value could not be copied */ LIBEWF_RUNTIME_ERROR_COPY_FAILED = 9, /* The value could not be removed */ LIBEWF_RUNTIME_ERROR_REMOVE_FAILED = 10, /* The value could not be printed */ LIBEWF_RUNTIME_ERROR_PRINT_FAILED = 11, /* The value was out of bounds */ LIBEWF_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS = 12, /* The value exceeds the maximum for its specific type */ LIBEWF_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM = 13, /* The value is unsupported */ LIBEWF_RUNTIME_ERROR_UNSUPPORTED_VALUE = 14, /* An abort was requested */ LIBEWF_RUNTIME_ERROR_ABORT_REQUESTED = 15 }; #endif /* !defined( _LIBEWF_ERROR_H ) */ libewf-20140807/include/libewf.h0000664000175000017500000035756713443455443020435 0ustar00lordyestalordyesta00000000000000/* * Library to access the Expert Witness Compression Format (EWF) * * 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_H ) #define _LIBEWF_H #include #include #include #include #include #include #include #if defined( LIBEWF_HAVE_BFIO ) #include #endif #ifdef __cplusplus extern "C" { #endif /* ------------------------------------------------------------------------- * Support functions * ------------------------------------------------------------------------- */ /* Returns the library version */ LIBEWF_EXTERN \ const char *libewf_get_version( void ); /* Returns the access flags for reading */ LIBEWF_EXTERN \ int libewf_get_access_flags_read( void ); /* Returns the access flags for reading and writing */ LIBEWF_EXTERN \ int libewf_get_access_flags_read_write( void ); /* Returns the access flags for writing */ LIBEWF_EXTERN \ int libewf_get_access_flags_write( void ); /* Returns the access flags for resume writing */ LIBEWF_EXTERN \ int libewf_get_access_flags_write_resume( void ); /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_get_codepage( int *codepage, libewf_error_t **error ); /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_set_codepage( int codepage, libewf_error_t **error ); /* Determines if a file is an EWF file (check for the EWF file signature) * Returns 1 if true, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_check_file_signature( const char *filename, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Determines if a file is an EWF file (check for the EWF file signature) * Returns 1 if true, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_check_file_signature_wide( const wchar_t *filename, libewf_error_t **error ); #endif #if defined( LIBEWF_HAVE_BFIO ) /* Determines if a file is an EWF file (check for the EWF file signature) using a Basic File IO (bfio) handle * Returns 1 if true, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_check_file_signature_file_io_handle( libbfio_handle_t *file_io_handle, libewf_error_t **error ); #endif /* Globs the segment files according to the EWF naming schema * if the format is known the filename should contain the base of the filename * otherwise the function will try to determine the format based on the extension * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob( const char *filename, size_t filename_length, uint8_t format, char **filenames[], int *number_of_filenames, libewf_error_t **error ); /* Frees the globbed filenames * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob_free( char *filenames[], int number_of_filenames, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Globs the segment files according to the EWF naming schema * if the format is known the filename should contain the base of the filename * otherwise the function will try to determine the format based on the extension * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob_wide( const wchar_t *filename, size_t filename_length, uint8_t format, wchar_t **filenames[], int *number_of_filenames, libewf_error_t **error ); /* Frees the globbed wide filenames * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_glob_wide_free( wchar_t *filenames[], int number_of_filenames, libewf_error_t **error ); #endif /* ------------------------------------------------------------------------- * Support functions - deprecated * ------------------------------------------------------------------------- */ /* Returns the flags for reading * * This function deprecated use libewf_get_access_flags_read instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_read( void ); /* Returns the flags for reading and writing * * This function deprecated use libewf_get_access_flags_read_write instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_read_write( void ); /* Returns the flags for writing * * This function deprecated use libewf_get_access_flags_write instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_write( void ); /* Returns the flags for resume writing * * This function deprecated use libewf_get_access_flags_write_resume instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ uint8_t libewf_get_flags_write_resume( void ); /* ------------------------------------------------------------------------- * Notify functions * ------------------------------------------------------------------------- */ /* Sets the verbose notification */ LIBEWF_EXTERN \ void libewf_notify_set_verbose( int verbose ); /* Sets the notification stream * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_notify_set_stream( FILE *stream, libewf_error_t **error ); /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_notify_stream_open( const char *filename, libewf_error_t **error ); /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_notify_stream_close( libewf_error_t **error ); /* ------------------------------------------------------------------------- * Error functions * ------------------------------------------------------------------------- */ /* Frees the error including elements */ LIBEWF_EXTERN \ void libewf_error_free( libewf_error_t **error ); /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_fprint( libewf_error_t *error, FILE *stream ); /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_sprint( libewf_error_t *error, char *string, size_t size ); /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_backtrace_fprint( libewf_error_t *error, FILE *stream ); /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_error_backtrace_sprint( libewf_error_t *error, char *string, size_t size ); /* ------------------------------------------------------------------------- * File/Handle functions * ------------------------------------------------------------------------- */ /* Initialize the handle * The handle must point to a NULL pointer to be allocated * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_initialize( libewf_handle_t **handle, libewf_error_t **error ); /* Frees the handle including elements * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_free( libewf_handle_t **handle, libewf_error_t **error ); /* Clones the handle including elements * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_clone( libewf_handle_t **destination_handle, libewf_handle_t *source_handle, libewf_error_t **error ); /* Signals the handle to abort its current activity * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_signal_abort( libewf_handle_t *handle, libewf_error_t **error ); /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_open( libewf_handle_t *handle, char * const filenames[], int number_of_filenames, int access_flags, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_open_wide( libewf_handle_t *handle, wchar_t * const filenames[], int number_of_filenames, int access_flags, libewf_error_t **error ); #endif #if defined( LIBEWF_HAVE_BFIO ) /* Opens a set of EWF file(s) using a Basic File IO (bfio) pool * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_open_file_io_pool( libewf_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libewf_error_t **error ); #endif /* Closes the EWF handle * Returns 0 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_close( libewf_handle_t *handle, libewf_error_t **error ); /* Prepares chunk of (media) data after reading it according to the handle settings * It applies decompression if necessary and validates the chunk checksum * This function should be used after libewf_handle_read_chunk * The value chunk_buffer_size contains the size of the chunk * Returns the resulting chunk size or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_prepare_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, void *uncompressed_chunk_buffer, size_t *uncompressed_chunk_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum, libewf_error_t **error ); /* Reads a chunk of (media) data from the current offset into a buffer * Will read until the requested size is filled or the entire chunk is read * The values read_checksum and chunk_checksum are used for uncompressed chunks only * The value chunk_checksum is set to a runtime version of the value in the checksum_buffer * The value read_checksum is set if the checksum has been read into checksum_buffer * The value chunk_buffer_size contains the size of the chunk buffer * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, int8_t *is_compressed, void *checksum_buffer, uint32_t *chunk_checksum, int8_t *read_checksum, libewf_error_t **error ); /* Reads (media) data at the current offset into a buffer * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, libewf_error_t **error ); /* Reads (media) data at a specific offset * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libewf_error_t **error ); /* Prepares a chunk of (media) data before writing according to the handle settings * This function should be used before libewf_handle_write_chunk * The chunk_buffer_size should contain the actual chunk size * The function sets the chunk checksum, is compressed and write checksum values * Returns the resulting chunk size or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_prepare_write_chunk( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *compressed_chunk_buffer, size_t *compressed_chunk_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum, libewf_error_t **error ); /* Writes a chunk of (media) data in EWF format at the current offset * the necessary settings of the write values must have been made * chunk_buffer_size contains the size of the data within the buffer while * data_size contains the size of the actual input data * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_chunk( libewf_handle_t *handle, const void *chunk_buffer, size_t chunk_buffer_size, size_t data_size, int8_t is_compressed, void *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libewf_error_t **error ); /* Writes (media) data at the current offset * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_buffer( libewf_handle_t *handle, const void *buffer, size_t buffer_size, libewf_error_t **error ); /* Writes (media) data at a specific offset, * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_random( libewf_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libewf_error_t **error ); /* Finalizes the write by correcting the EWF the meta data in the segment files * This function is required after writing from stream * Returns the number of input bytes written or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_handle_write_finalize( libewf_handle_t *handle, libewf_error_t **error ); /* Seeks a certain offset of the (media) data * Returns the offset if seek is successful or -1 on error */ LIBEWF_EXTERN \ off64_t libewf_handle_seek_offset( libewf_handle_t *handle, off64_t offset, int whence, libewf_error_t **error ); /* Retrieves the current offset of the (media) data * Returns the offset if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_offset( libewf_handle_t *handle, off64_t *offset, libewf_error_t **error ); /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_maximum_number_of_open_handles( libewf_handle_t *handle, int maximum_number_of_open_handles, libewf_error_t **error ); /* Retrieves the segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libewf_error_t **error ); /* Sets the segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libewf_error_t **error ); /* Sets the segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libewf_error_t **error ); #endif /* Retrieves the maximum segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_maximum_segment_size( libewf_handle_t *handle, size64_t *maximum_segment_size, libewf_error_t **error ); /* Sets the maximum segment file size * A maximum segment file size of 0 represents the maximum possible size for the format * If the maximum segment file size is smaller than the size needed to store a single chunk * the size off the latter is enforced and not the maximum segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_maximum_segment_size( libewf_handle_t *handle, size64_t maximum_segment_size, libewf_error_t **error ); /* Retrieves the delta segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libewf_error_t **error ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the delta segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libewf_error_t **error ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libewf_error_t **error ); #endif /* Retrieves the maximum delta segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_maximum_delta_segment_size( libewf_handle_t *handle, size64_t *maximum_delta_segment_size, libewf_error_t **error ); /* Sets the maximum delta segment file size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_maximum_delta_segment_size( libewf_handle_t *handle, size64_t maximum_delta_segment_size, libewf_error_t **error ); /* Determine if the segment files are corrupted * Returns 1 if corrupted, 0 if not or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_segment_files_corrupted( libewf_handle_t *handle, libewf_error_t **error ); /* Retrieves the filename size of the (delta) segment file of the current chunk * The filename size includes the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename_size( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the filename of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libewf_error_t **error ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the filename size of the (delta) segment file of the current chunk * The filename size includes the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libewf_error_t **error ); /* Retrieves the filename of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libewf_error_t **error ); #endif #if defined( LIBEWF_HAVE_BFIO ) /* Retrieves the file IO handle of the (delta) segment file of the current chunk * Returns 1 if successful, 0 if no such file IO handle or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_file_io_handle( libewf_handle_t *handle, libbfio_handle_t **file_io_handle, libewf_error_t **error ); #endif /* ------------------------------------------------------------------------- * File/Handle functions - deprecated * ------------------------------------------------------------------------- */ /* Sets the maximum amount of (concurrent) open file handles * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_maximum_number_of_open_handles instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_maximum_amount_of_open_handles( libewf_handle_t *handle, int maximum_amount_of_open_handles, libewf_error_t **error ); /* Retrieves the amount of sectors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_sectors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_sectors( libewf_handle_t *handle, uint64_t *amount_of_sectors, libewf_error_t **error ); /* Retrieves the amount of chunks written * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_chunks_written instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks, libewf_error_t **error ); /* Retrieves the segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size, libewf_error_t **error ); /* Sets the segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size, libewf_error_t **error ); /* Retrieves the delta segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size, libewf_error_t **error ); /* Sets the delta segment file size * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size, libewf_error_t **error ); /* ------------------------------------------------------------------------- * Meta data functions * ------------------------------------------------------------------------- */ /* Retrieves the number of sectors per chunk * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk, libewf_error_t **error ); /* Sets the number of sectors per chunk * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk, libewf_error_t **error ); /* Retrieves the number of bytes per sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector, libewf_error_t **error ); /* Sets the number of bytes per sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector, libewf_error_t **error ); /* Retrieves the number of sectors * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_sectors( libewf_handle_t *handle, uint64_t *number_of_sectors, libewf_error_t **error ); /* Retrieves the chunk size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size, libewf_error_t **error ); /* Retrieves the error granularity * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity, libewf_error_t **error ); /* Sets the error granularity * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity, libewf_error_t **error ); /* Retrieves the compression values * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compression_flags, libewf_error_t **error ); /* Sets the compression values * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compression_flags, libewf_error_t **error ); /* Retrieves the size of the contained (media) data * This function will compensate for a media_size that is not a multitude of bytes_per_sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_media_size( libewf_handle_t *handle, size64_t *media_size, libewf_error_t **error ); /* Sets the media size * The media_size is stored as number_of_sectors x bytes_per_sector * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_media_size( libewf_handle_t *handle, size64_t media_size, libewf_error_t **error ); /* Retrieves the media type value * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_media_type( libewf_handle_t *handle, uint8_t *media_type, libewf_error_t **error ); /* Sets the media type * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_media_type( libewf_handle_t *handle, uint8_t media_type, libewf_error_t **error ); /* Retrieves the media flags * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags, libewf_error_t **error ); /* Sets the media flags * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_media_flags( libewf_handle_t *handle, uint8_t media_flags, libewf_error_t **error ); /* Retrieves the format type value * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_format( libewf_handle_t *handle, uint8_t *format, libewf_error_t **error ); /* Sets the output format * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_format( libewf_handle_t *handle, uint8_t format, libewf_error_t **error ); /* Retrieves the segment file set identifier * The identifier is a GUID and is 16 bytes of size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_segment_file_set_identifier( libewf_handle_t *handle, uint8_t *set_identifier, size_t size, libewf_error_t **error ); /* Sets the segment file set identifier * The identifier is a GUID and is 16 bytes of size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_segment_file_set_identifier( libewf_handle_t *handle, const uint8_t *set_identifier, size_t size, libewf_error_t **error ); /* Retrieves the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libewf_error_t **error ); /* Sets the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libewf_error_t **error ); /* Retrieves the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libewf_error_t **error ); /* Sets the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libewf_error_t **error ); /* Retrieves the number of chunks written * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_chunks_written( libewf_handle_t *handle, uint32_t *number_of_chunks, libewf_error_t **error ); /* Sets the read zero chunk on error * The chunk is not zeroed if read raw is used * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_read_zero_chunk_on_error( libewf_handle_t *handle, uint8_t zero_on_error, libewf_error_t **error ); /* Copies the media values from the source to the destination handle * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libewf_error_t **error ); /* Retrieves the number of acquiry errors * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_acquiry_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libewf_error_t **error ); /* Retrieves an acquiry error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_acquiry_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends an acquiry error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of checksum errors * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_checksum_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libewf_error_t **error ); /* Retrieves a checksum error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_checksum_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends a checksum error * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_checksum_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of sessions * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_sessions( libewf_handle_t *handle, uint32_t *number_of_sessions, libewf_error_t **error ); /* Retrieves a session * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_session( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends a session * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of tracks * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_tracks( libewf_handle_t *handle, uint32_t *number_of_tracks, libewf_error_t **error ); /* Retrieves a track * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_track( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Appends a track * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_append_track( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the header codepage * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_codepage( libewf_handle_t *handle, int *header_codepage, libewf_error_t **error ); /* Sets the header codepage * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_header_codepage( libewf_handle_t *handle, int header_codepage, libewf_error_t **error ); /* Retrieves the header values date format * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_values_date_format( libewf_handle_t *handle, int *date_format, libewf_error_t **error ); /* Sets the header values date format * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_header_values_date_format( libewf_handle_t *handle, int date_format, libewf_error_t **error ); /* Retrieves the number of header values * Returns 1 if successful, 0 if no header values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_header_values( libewf_handle_t *handle, uint32_t *number_of_values, libewf_error_t **error ); /* Retrieves the size of the header value identifier of a specific index * The identifier size includes the end of string character * Returns 1 if successful, 0 if no header values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libewf_error_t **error ); /* Retrieves the header value identifier of a specific index * The identifier size should include the end of string character * Returns 1 if successful, 0 if no header values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded header value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded header value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the header value case number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_case_number( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error ) /* Retrieves the header value description * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_description( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "description", 11, value, value_size, error ) /* Retrieves the header value examiner name * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_examiner_name( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error ) /* Retrieves the header value evidence number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_evidence_number( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error ) /* Retrieves the header value notes * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_notes( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error ) /* Retrieves the header value acquiry date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_acquiry_date( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error ) /* Retrieves the header value system date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_system_date( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error ) /* Retrieves the header value acquiry operating system * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_acquiry_operating_system( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error ) /* Retrieves the header value acquiry software version * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_acquiry_software_version( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error ) /* Retrieves the header value password * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_password( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "password", 8, value, value_size, error ) /* Retrieves the header value compression level * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_compression_level( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "compression_level", 17, value, value_size, error ) /* Retrieves the header value model * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_model( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "model", 5, value, value_size, error ) /* Retrieves the header value serial number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_header_value_serial_number( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error ) /* Sets the UTF-8 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libewf_error_t **error ); /* Sets the header value case number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_case_number( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error ) /* Sets the header value description * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_description( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "description", 11, value, value_length, error ) /* Sets the header value examiner name * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_examiner_name( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error ) /* Sets the header value evidence number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_evidence_number( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error ) /* Sets the header value notes * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_notes( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error ) /* Sets the header value acquiry date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_acquiry_date( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error ) /* Sets the header value system date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_system_date( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error ) /* Sets the header value acquiry operating system * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_acquiry_operating_system( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error ) /* Sets the header value acquiry software version * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_acquiry_software_version( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error ) /* Sets the header value password * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_password( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "password", 8, value, value_length, error ) /* Sets the header value compression level * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_compression_level( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "compression_level", 17, value, value_length, error ) /* Sets the header value model * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_model( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "model", 5, value, value_length, error ) /* Sets the header value serial number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_header_value_serial_number( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error ) /* Retrieves the size of the UTF-16 encoded header value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded header value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Sets the UTF-16 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libewf_error_t **error ); /* Copies the header values from the source to the destination handle * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libewf_error_t **error ); /* Retrieves the number of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_number_of_hash_values( libewf_handle_t *handle, uint32_t *number_of_values, libewf_error_t **error ); /* Retrieves the size of the hash value identifier of a specific index * The identifier size includes the end of string character * Returns 1 if successful, 0 if no hash values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libewf_error_t **error ); /* Retrieves the hash value identifier of a specific index * The identifier size should include the end of string character * Returns 1 if successful, 0 if no hash values are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded hash value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded hash value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the hash value MD5 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_hash_value_md5( handle, value, value_size, error ) \ libewf_handle_get_utf8_hash_value( handle, (uint8_t *) "MD5", 3, value, value_size, error ) /* Retrieves the hash value SHA1 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_utf8_hash_value_sha1( handle, value, value_size, error ) \ libewf_handle_get_utf8_hash_value( handle, (uint8_t *) "SHA1", 4, value, value_size, error ) /* Sets the UTF-8 hash value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libewf_error_t **error ); /* Sets the hash value MD5 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_hash_value_md5( handle, value, value_length, error ) \ libewf_handle_set_utf8_hash_value( handle, (uint8_t *) "MD5", 3, value, value_length, error ) /* Sets the hash value SHA1 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_utf8_hash_value_sha1( handle, value, value_length, error ) \ libewf_handle_set_utf8_hash_value( handle, (uint8_t *) "SHA1", 4, value, value_length, error ) /* Retrieves the size of the UTF-16 encoded hash value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded hash value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Sets the UTF-16 hash value specified by the identifier * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_set_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libewf_error_t **error ); /* Retrieves the root (single) file entry * Returns 1 if successful, 0 if no file entries are present or -1 on error */ LIBEWF_EXTERN \ int libewf_handle_get_root_file_entry( libewf_handle_t *handle, libewf_file_entry_t **root_file_entry, libewf_error_t **error ); /* Retrieves the (single) file entry for the specific UTF-8 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_get_file_entry_by_utf8_path( libewf_handle_t *handle, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **file_entry, libewf_error_t **error ); /* Retrieves the (single) file entry for the specific UTF-16 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_get_file_entry_by_utf16_path( libewf_handle_t *handle, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **file_entry, libewf_error_t **error ); /* ------------------------------------------------------------------------- * Meta data functions - deprecated * ------------------------------------------------------------------------- */ /* Sets the read wipe chunk on error * The chunk is not wiped if read raw is used * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_read_zero_chunk_on_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error, libewf_error_t **error ); /* Retrieves the amount of acquiry errors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_acquiry_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libewf_error_t **error ); /* Add an acquiry error * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_append_acquiry_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_add_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the number of checksum errors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_checksum_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_number_of_crc_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libewf_error_t **error ); /* Retrieves the amount of checksum errors * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_checksum_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libewf_error_t **error ); /* Retrieves a checksum error * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_crc_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libewf_error_t **error ); /* Add a checksum error * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_append_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_add_crc_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the amount of sessions * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_get_number_of_sessions instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions, libewf_error_t **error ); /* Add a session * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_append_session instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_add_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libewf_error_t **error ); /* Retrieves the amount of header values * Returns 1 if successful, 0 if no header values are present or -1 on error * * This function deprecated use libewf_handle_get_number_of_header_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded header value of an identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_header_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded header value of an identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libewf_error_t **error ); /* Retrieves the header value case number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_case_number( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error ) /* Retrieves the header value description * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_description( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "description", 11, value, value_size, error ) /* Retrieves the header value examiner name * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_examiner_name( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error ) /* Retrieves the header value evidence number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_evidence_number( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error ) /* Retrieves the header value notes * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_notes( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error ) /* Retrieves the header value acquiry date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_acquiry_date( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error ) /* Retrieves the header value system date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_system_date( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error ) /* Retrieves the header value acquiry operating system * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_acquiry_operating_system( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error ) /* Retrieves the header value acquiry software version * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_acquiry_software_version( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error ) /* Retrieves the header value password * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_password( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "password", 8, value, value_size, error ) /* Retrieves the header value compression type * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_compression_type( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error ) /* Retrieves the header value model * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_model( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "model", 5, value, value_size, error ) /* Retrieves the header value serial number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_header_value_serial_number( handle, value, value_size, error ) \ libewf_handle_get_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error ) /* Retrieves the header value compression type * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_header_value_compression_level instead */ #define libewf_handle_get_utf8_header_value_compression_type( handle, value, value_size, error ) \ libewf_handle_get_utf8_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error ) /* Sets the UTF-8 encoded header value specified by the identifier * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_utf8_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libewf_error_t **error ); /* Sets the header value case number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_case_number( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error ) /* Sets the header value description * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_description( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "description", 11, value, value_length, error ) /* Sets the header value examiner name * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_examiner_name( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error ) /* Sets the header value evidence number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_evidence_number( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error ) /* Sets the header value notes * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_notes( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error ) /* Sets the header value acquiry date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_acquiry_date( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error ) /* Sets the header value system date * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_system_date( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error ) /* Sets the header value acquiry operating system * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_acquiry_operating_system( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error ) /* Sets the header value acquiry software version * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_acquiry_software_version( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error ) /* Sets the header value password * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_password( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "password", 8, value, value_length, error ) /* Sets the header value compression type * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_compression_type( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error ) /* Sets the header value model * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_model( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "model", 5, value, value_length, error ) /* Sets the header value serial number * Returns 1 if successful or -1 on error */ #define libewf_handle_set_header_value_serial_number( handle, value, value_length, error ) \ libewf_handle_set_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error ) /* Sets the header value compression type * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_utf8_header_value_compression_level instead */ #define libewf_handle_set_utf8_header_value_compression_type( handle, value, value_length, error ) \ libewf_handle_set_utf8_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error ) /* Retrieves the amount of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error * * This function deprecated use libewf_handle_get_number_of_hash_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded hash value of an identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_hash_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded hash value of an identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function deprecated use libewf_handle_get_utf8_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libewf_error_t **error ); /* Retrieves the hash value MD5 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_hash_value_md5( handle, value, value_size, error ) \ libewf_handle_get_hash_value( handle, "MD5", 3, value, value_size, error ) /* Retrieves the hash value SHA1 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_handle_get_hash_value_sha1( handle, value, value_size, error ) \ libewf_handle_get_hash_value( handle, "SHA1", 4, value, value_size, error ) /* Sets the UTF-8 hash value specified by the identifier * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_set_utf8_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libewf_error_t **error ); /* Sets the hash value MD5 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_hash_value_md5( handle, value, value_length, error ) \ libewf_handle_set_hash_value( handle, "MD5", 3, value, value_length, error ) /* Sets the hash value SHA1 * Returns 1 if successful or -1 on error */ #define libewf_handle_set_hash_value_sha1( handle, value, value_length, error ) \ libewf_handle_set_hash_value( handle, "SHA1", 4, value, value_length, error ) /* ------------------------------------------------------------------------- * Single file entry functions * ------------------------------------------------------------------------- */ /* Frees a file entry * REturns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_free( libewf_file_entry_t **file_entry, libewf_error_t **error ); /* Retrieves the type * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_type( libewf_file_entry_t *file_entry, uint8_t *type, libewf_error_t **error ); /* Retrieves the flags * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_flags( libewf_file_entry_t *file_entry, uint32_t *flags, libewf_error_t **error ); /* Retrieves the media data offset * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_media_data_offset( libewf_file_entry_t *file_entry, off64_t *media_data_offset, libewf_error_t **error ); /* Retrieves the media data size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_media_data_size( libewf_file_entry_t *file_entry, size64_t *media_data_size, libewf_error_t **error ); /* Retrieves the duplicate media data offset * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_duplicate_media_data_offset( libewf_file_entry_t *file_entry, off64_t *duplicate_media_data_offset, libewf_error_t **error ); /* Retrieves the size of the UTF-8 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_name_size( libewf_file_entry_t *file_entry, size_t *utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_name( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the size of the UTF-16 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_name_size( libewf_file_entry_t *file_entry, size_t *utf16_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_name( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Retrieves the size * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_size( libewf_file_entry_t *file_entry, size64_t *size, libewf_error_t **error ); /* Retrieves the creation date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_creation_time( libewf_file_entry_t *file_entry, uint32_t *creation_time, libewf_error_t **error ); /* Retrieves the modification date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_modification_time( libewf_file_entry_t *file_entry, uint32_t *modification_time, libewf_error_t **error ); /* Retrieves the access date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_access_time( libewf_file_entry_t *file_entry, uint32_t *access_time, libewf_error_t **error ); /* Retrieves the entry modification date and time * The date and time is formatted as a POSIX timestamp * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_entry_modification_time( libewf_file_entry_t *file_entry, uint32_t *entry_modification_time, libewf_error_t **error ); /* Retrieves the UTF-8 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_hash_value_md5( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libewf_error_t **error ); /* Retrieves the UTF-16 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_hash_value_md5( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libewf_error_t **error ); /* Reads data at the current offset * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_file_entry_read_buffer( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, libewf_error_t **error ); /* Reads data at a specific offset * Returns the number of bytes read or -1 on error */ LIBEWF_EXTERN \ ssize_t libewf_file_entry_read_random( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, off64_t offset, libewf_error_t **error ); /* Seeks a certain offset of the data * Returns the offset if seek is successful or -1 on error */ LIBEWF_EXTERN \ off64_t libewf_file_entry_seek_offset( libewf_file_entry_t *file_entry, off64_t offset, int whence, libewf_error_t **error ); /* Retrieves the current offset of the data * Returns the offset if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_offset( libewf_file_entry_t *file_entry, off64_t *offset, libewf_error_t **error ); /* Retrieves the number of sub file entries * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_number_of_sub_file_entries( libewf_file_entry_t *file_entry, int *number_of_sub_file_entries, libewf_error_t **error ); /* Retrieves the sub file entry for the specific index * Returns 1 if successful or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry( libewf_file_entry_t *file_entry, int sub_file_entry_index, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-8 encoded name * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf8_name( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-8 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf8_path( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-16 encoded name * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf16_name( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* Retrieves the sub file entry for the specific UTF-16 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf16_path( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libewf_error_t **error ); /* ------------------------------------------------------------------------- * Single file entry functions - deprecated * ------------------------------------------------------------------------- */ /* Retrieves the size of the UTF-8 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error * * This function deprecated use libewf_file_entry_get_utf8_name_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_file_entry_get_name_size( libewf_file_entry_t *file_entry, size_t *name_size, libewf_error_t **error ); /* Retrieves the UTF-8 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error * * This function deprecated use libewf_file_entry_get_utf8_name instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_file_entry_get_name( libewf_file_entry_t *file_entry, uint8_t *name, size_t name_size, libewf_error_t **error ); /* Retrieves the amount of sub file entries * Returns 1 if successful or -1 on error * * This function deprecated use libewf_file_entry_get_number_of_sub_file_entries instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_file_entry_get_amount_of_sub_file_entries( libewf_file_entry_t *file_entry, int *amount_of_sub_file_entries, libewf_error_t **error ); /* ------------------------------------------------------------------------- * APIv1 functions - deprecated * ------------------------------------------------------------------------- */ #if 0 || defined( HAVE_V1_API ) /* ------------------------------------------------------------------------- * Notify functions * ------------------------------------------------------------------------- */ /* Sets the notify values * * This function is deprecated use libewf_notify_set_verbose and libewf_notify_set_stream instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN void libewf_set_notify_values( FILE *stream, uint8_t verbose ); /* ------------------------------------------------------------------------- * File/Handle functions * ------------------------------------------------------------------------- */ /* Signals the libewf handle to abort its current activity * Returns 1 if successful or -1 on error * * This function deprecated use libewf_handle_signal_abort instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_signal_abort( libewf_handle_t *handle ); /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns a pointer to the new instance of handle, NULL on error * * This function deprecated use libewf_handle_open instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN libewf_handle_t *libewf_open( char * const filenames[], int amount_of_filenames, uint8_t flags ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns a pointer to the new instance of handle, NULL on error * * This function deprecated use libewf_handle_open_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN libewf_handle_t *libewf_open_wide( wchar_t * const filenames[], int amount_of_filenames, uint8_t flags ); #endif /* Closes the EWF handle and frees memory used within the handle * Returns 0 if successful or -1 on error * * This function deprecated use libewf_handle_close instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_close( libewf_handle_t *handle ); /* Seeks a certain offset of the (media) data * Returns the offset if seek is successful or -1 on error * * This function is deprecated use libewf_handle_seek_offset instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN off64_t libewf_seek_offset( libewf_handle_t *handle, off64_t offset ); /* Retrieves the current offset of the (media) data * Returns the offset if successful or -1 on error * * This function is deprecated use libewf_handle_get_offset instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN off64_t libewf_get_offset( libewf_handle_t *handle ); /* Prepares a buffer with chunk data after reading it according to the handle settings * intended for raw read * The buffer size cannot be larger than the chunk size * Returns the resulting chunk size or -1 on error * * This function is deprecated use libewf_handle_prepare_read_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_read_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *uncompressed_buffer, size_t *uncompressed_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum ); /* Reads 'raw' data from the current offset into a buffer * size contains the size of the buffer * The function sets the chunk checksum, is compressed and read checksum values * Returns the amount of bytes read or -1 on error * * This function is deprecated use libewf_handle_read_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *read_checksum ); /* Reads data from the current offset into a buffer * Returns the amount of bytes read or -1 on error * * This function is deprecated use libewf_handle_read_buffer instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ); /* Reads (media) data at a specific offset * Returns the amount of bytes read or -1 on error * * This function is deprecated use libewf_handle_read_random instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ); /* Prepares a buffer with chunk data before writing according to the handle settings * intended for raw write * The buffer size cannot be larger than the chunk size * The function sets the chunk checksum, is compressed and write checksum values * Returns the resulting chunk size or -1 on error * * This function is deprecated use libewf_handle_prepare_write_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_write_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *compressed_buffer, size_t *compressed_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum ); /* Writes 'raw' data in EWF format at the current offset * the necessary settings of the write values must have been made * size contains the size of the data within the buffer while * data size contains the size of the actual input data * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error * * This function is deprecated use libewf_handle_write_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_raw_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, size_t data_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t write_checksum ); /* Writes data in EWF format at the current offset * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error * * This function is deprecated use libewf_handle_write_buffer instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ); /* Writes data in EWF format at a specific offset, * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error * * This function is deprecated use libewf_handle_write_random instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_write_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ); /* Finalizes the write by correcting the EWF the meta data in the segment files * This function is required after writing from stream * Returns the amount of input bytes written or -1 on error * * This function is deprecated use libewf_handle_write_finalize instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN ssize_t libewf_write_finalize( libewf_handle_t *handle ); /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ); /* Sets the segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ); /* Sets the segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ); #endif /* Retrieves the segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size ); /* Sets the segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_maximum_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size ); /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_delta_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_delta_segment_filename instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ); #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_delta_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ); /* Sets the delta segment filename * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_delta_segment_filename_wide instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ); #endif /* Retrieves the delta segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size ); /* Sets the delta segment file size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_maximum_delta_segment_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size ); /* ------------------------------------------------------------------------- * Meta data functions * ------------------------------------------------------------------------- */ /* Retrieves the amount of sectors per chunk * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_sectors_per_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk ); /* Sets the amount of sectors per chunk * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_sectors_per_chunk instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk ); /* Retrieves the amount of bytes per sector * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_bytes_per_sector instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector ); /* Sets the amount of bytes per sector * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_bytes_per_sector instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector ); /* Retrieves the amount of sectors * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_sectors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_sectors( libewf_handle_t *handle, uint32_t *amount_of_sectors ); /* Retrieves the chunk size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_chunk_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size ); /* Retrieves the error granularity * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_error_granularity instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity ); /* Sets the error granularity * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_error_granularity instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity ); /* Retrieves the compression values * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_compression_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compress_empty_block ); /* Sets the compression values * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_compression_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compress_empty_block ); /* Retrieves the size of the contained (media) data * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_media_size( libewf_handle_t *handle, size64_t *media_size ); /* Sets the media size * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_media_size( libewf_handle_t *handle, size64_t media_size ); /* Retrieves the media type value * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_type instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_media_type( libewf_handle_t *handle, uint8_t *media_type ); /* Sets the media type * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_type instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_media_type( libewf_handle_t *handle, uint8_t media_type ); /* Retrieves the media flags * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags ); /* Sets the media flags * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_media_flags( libewf_handle_t *handle, uint8_t media_flags ); /* Retrieves the volume type value * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_volume_type( libewf_handle_t *handle, uint8_t *volume_type ); /* Sets the volume type * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_media_flags instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_volume_type( libewf_handle_t *handle, uint8_t volume_type ); /* Retrieves the format type value * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_format instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_format( libewf_handle_t *handle, uint8_t *format ); /* Sets the output format * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_format instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_format( libewf_handle_t *handle, uint8_t format ); /* Retrieves the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_guid instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ); /* Sets the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_guid instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ); /* Retrieves the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_segment_file_set_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libewf_error_t **error ); /* Sets the GUID * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_segment_file_set_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN \ int libewf_handle_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libewf_error_t **error ); /* Retrieves the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_md5_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ); /* Sets the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_set_md5_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ); /* Retrieves the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_sha1_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ); /* Sets the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_set_sha1_hash instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ); /* Retrieves the amount of chunks written * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_write_amount_of_chunks instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks ); /* Sets the read wipe chunk on error * The chunk is not wiped if read raw is used * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_read_zero_chunk_on_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error ); /* Copies the media values from the source to the destination handle * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_copy_media_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ); /* Retrieves the amount of acquiry errors * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_acquiry_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ); /* Retrieves an acquiry error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_acquiry_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_acquiry_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); /* Add an acquiry error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_append_acquiry_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_add_acquiry_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); /* Retrieves the amount of checksum errors * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_checksum_errors instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ); /* Retrieves a checksum error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_crc_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); /* Add a checksum error * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_append_checksum_error instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_add_crc_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); /* Retrieves the amount of sessions * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_number_of_sessions instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions ); /* Retrieves a session * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_session instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_session( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); /* Add a session * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_append_session instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_add_session( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); /* Retrieves the header codepage * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_get_header_codepage instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_codepage( libewf_handle_t *handle, int *header_codepage ); /* Sets the header codepage * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_header_codepage instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_header_codepage( libewf_handle_t *handle, int header_codepage ); /* Retrieves the amount of header values * Returns 1 if successful, 0 if no header values are present or -1 on error * * This function is deprecated use libewf_handle_get_number_of_header_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values ); /* Retrieves the header value identifier size specified by its index * The identifier size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value_identifier_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ); /* Retrieves the header value identifier specified by its index * The strings are encoded in UTF-8 * The identifier size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ); /* Retrieves the header value size specified by the identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ); /* Retrieves the header value specified by the identifier * The strings are encoded in UTF-8 * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_header_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ); /* Retrieves the header value case number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_case_number( handle, value, value_size ) \ libewf_get_header_value( handle, "case_number", value, value_size ) /* Retrieves the header value description * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_description( handle, value, value_size ) \ libewf_get_header_value( handle, "description", value, value_size ) /* Retrieves the header value examiner name * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_examiner_name( handle, value, value_size ) \ libewf_get_header_value( handle, "examiner_name", value, value_size ) /* Retrieves the header value evidence number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_evidence_number( handle, value, value_size ) \ libewf_get_header_value( handle, "evidence_number", value, value_size ) /* Retrieves the header value notes * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_notes( handle, value, value_size ) \ libewf_get_header_value( handle, "notes", value, value_size ) /* Retrieves the header value acquiry date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_acquiry_date( handle, value, value_size ) \ libewf_get_header_value( handle, "acquiry_date", value, value_size ) /* Retrieves the header value system date * The string is encoded according to the date format * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_system_date( handle, value, value_size ) \ libewf_get_header_value( handle, "system_date", value, value_size ) /* Retrieves the header value acquiry operating system * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_acquiry_operating_system( handle, value, value_size ) \ libewf_get_header_value( handle, "acquiry_operating_system", value, value_size ) /* Retrieves the header value acquiry software version * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_acquiry_software_version( handle, value, value_size ) \ libewf_get_header_value( handle, "acquiry_software_version", value, value_size ) /* Retrieves the header value password * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_password( handle, value, value_size ) \ libewf_get_header_value( handle, "password", value, value_size ) /* Retrieves the header value compression type * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_compression_type( handle, value, value_size ) \ libewf_get_header_value( handle, "compression_type", value, value_size ) /* Retrieves the header value model * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_model( handle, value, value_size ) \ libewf_get_header_value( handle, "model", value, value_size ) /* Retrieves the header value serial number * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_header_value_serial_number( handle, value, value_size ) \ libewf_get_header_value( handle, "serial_number", value, value_size ) /* Sets the header value specified by the identifier * The strings are encoded in UTF-8 * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_header_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_header_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ); /* Sets the header value case number * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_case_number( handle, value, value_length ) \ libewf_set_header_value( handle, "case_number", value, value_length ) /* Sets the header value description * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_description( handle, value, value_length ) \ libewf_set_header_value( handle, "description", value, value_length ) /* Sets the header value examiner name * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_examiner_name( handle, value, value_length ) \ libewf_set_header_value( handle, "examiner_name", value, value_length ) /* Sets the header value evidence number * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_evidence_number( handle, value, value_length ) \ libewf_set_header_value( handle, "evidence_number", value, value_length ) /* Sets the header value notes * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_notes( handle, value, value_length ) \ libewf_set_header_value( handle, "notes", value, value_length ) /* Sets the header value acquiry date * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_acquiry_date( handle, value, value_length ) \ libewf_set_header_value( handle, "acquiry_date", value, value_length ) /* Sets the header value system date * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_system_date( handle, value, value_length ) \ libewf_set_header_value( handle, "system_date", value, value_length ) /* Sets the header value acquiry operating system * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_acquiry_operating_system( handle, value, value_length ) \ libewf_set_header_value( handle, "acquiry_operating_system", value, value_length ) /* Sets the header value acquiry software version * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_acquiry_software_version( handle, value, value_length ) \ libewf_set_header_value( handle, "acquiry_software_version", value, value_length ) /* Sets the header value password * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_password( handle, value, value_length ) \ libewf_set_header_value( handle, "password", value, value_length ) /* Sets the header value compression type * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_compression_type( handle, value, value_length ) \ libewf_set_header_value( handle, "compression_type", value, value_length ) /* Sets the header value model * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_model( handle, value, value_length ) \ libewf_set_header_value( handle, "model", value, value_length ) /* Sets the header value serial number * Returns 1 if successful or -1 on error */ #define libewf_set_header_value_serial_number( handle, value, value_length ) \ libewf_set_header_value( handle, "serial_number", value, value_length ) /* Parses the header values from the xheader, header2 or header section * Will parse the first available header in order mentioned above * Returns 1 if successful, 0 if already parsed or -1 on error * * This function is deprecated and no longer required */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_parse_header_values( libewf_handle_t *handle, uint8_t date_format ); /* Copies the header values from the source to the destination handle * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_copy_header_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ); /* Retrieves the amount of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error * * This function is deprecated use libewf_handle_get_number_of_hash_values instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values ); /* Retrieves the hash value identifier size specified by its index * The identifier size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value_identifier_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ); /* Retrieves the hash value identifier specified by its index * The strings are encoded in UTF-8 * The identifier size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value_identifier instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ); /* Retrieves the hash value size specified by the identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value_size instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ); /* Retrieves the hash value specified by the identifier * The strings are encoded in UTF-8 * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error * * This function is deprecated use libewf_handle_get_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_get_hash_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ); /* Retrieves the hash value MD5 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_hash_value_md5( handle, value, value_size ) \ libewf_get_hash_value( handle, "MD5", value, value_size ) /* Retrieves the hash value SHA1 * Returns 1 if successful, 0 if value not present or -1 on error */ #define libewf_get_hash_value_sha1( handle, value, value_size ) \ libewf_get_hash_value( handle, "SHA1", value, value_size ) /* Sets the hash value specified by the identifier * The strings are encoded in UTF-8 * Returns 1 if successful or -1 on error * * This function is deprecated use libewf_handle_set_hash_value instead */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_set_hash_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ); /* Sets the hash value MD5 * Returns 1 if successful or -1 on error */ #define libewf_set_hash_value_md5( handle, value, value_length ) \ libewf_set_hash_value( handle, "MD5", value, value_length ) /* Sets the hash value SHA1 * Returns 1 if successful or -1 on error */ #define libewf_set_hash_value_sha1( handle, value, value_length ) \ libewf_set_hash_value( handle, "SHA1", value, value_length ) /* Parses the hash values from the xhash section * Returns 1 if successful, 0 if already parsed or -1 on error * * This function is deprecated and no longer required */ LIBEWF_DEPRECATED \ LIBEWF_EXTERN int libewf_parse_hash_values( libewf_handle_t *handle ); #endif /* defined( HAVE_V1_API ) */ #ifdef __cplusplus } #endif #endif /* !defined( _LIBEWF_H ) */ libewf-20140807/include/Makefile.in0000664000175000017500000007543713443455347021055 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(pkginclude_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = libewf.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(pkgincludedir)" HEADERS = $(include_HEADERS) $(pkginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libewf.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ include_HEADERS = \ libewf.h pkginclude_HEADERS = \ libewf/codepage.h \ libewf/definitions.h \ libewf/error.h \ libewf/extern.h \ libewf/features.h \ libewf/types.h EXTRA_DIST = \ libewf.h.in \ libewf/definitions.h.in \ libewf/features.h.in \ libewf/types.h.in MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libewf.h: $(top_builddir)/config.status $(srcdir)/libewf.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-pkgincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am \ install-pkgincludeHEADERS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ uninstall-pkgincludeHEADERS .PRECIOUS: Makefile distclean: clean /bin/rm -f libewf.h /bin/rm -f libewf/definitions.h /bin/rm -f libewf/features.h /bin/rm -f libewf/types.h /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libewf/0000775000175000017500000000000013443455446016615 5ustar00lordyestalordyesta00000000000000libewf-20140807/libewf/libewf_single_files.h0000644000175000017500000000600213421013625022736 0ustar00lordyestalordyesta00000000000000/* * Single files functions * * 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_SINGLE_FILES_H ) #define _LIBEWF_SINGLE_FILES_H #include #include #include "libewf_extern.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #include "libewf_single_file_entry.h" #include "libewf_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_single_files libewf_single_files_t; struct libewf_single_files { /* The section data */ uint8_t *section_data; /* The section data size */ size_t section_data_size; /* The ltree data */ uint8_t *ltree_data; /* The ltree data size */ size_t ltree_data_size; /* The single file entry tree */ libcdata_tree_node_t *root_file_entry_node; }; int libewf_single_files_initialize( libewf_single_files_t **single_files, libcerror_error_t **error ); int libewf_single_files_free( libewf_single_files_t **single_files, libcerror_error_t **error ); int libewf_single_files_parse( libewf_single_files_t *single_files, size64_t *media_size, uint8_t *format, libcerror_error_t **error ); int libewf_single_files_parse_file_entries( libewf_single_files_t *single_files, size64_t *media_size, const uint8_t *file_entries_string, size_t file_entries_string_size, uint8_t *format, libcerror_error_t **error ); int libewf_single_files_parse_record_values( size64_t *media_size, libfvalue_split_utf8_string_t *lines, int *line_iterator, libcerror_error_t **error ); int libewf_single_files_parse_file_entry( libcdata_tree_node_t *parent_file_entry_node, libfvalue_split_utf8_string_t *lines, int *line_iterator, libfvalue_split_utf8_string_t *types, uint8_t *format, libcerror_error_t **error ); int libewf_single_files_parse_file_entry_number_of_sub_entries( libfvalue_split_utf8_string_t *lines, int *line_index, uint64_t *number_of_sub_entries, libcerror_error_t **error ); int libewf_single_files_parse_file_entry_offset_values( libewf_single_file_entry_t *single_file_entry, const uint8_t *offset_values_string, size_t offset_values_string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_segment_table.c0000664000175000017500000010001013421024433023072 0ustar00lordyestalordyesta00000000000000/* * Segment table functions * * 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 . */ #include #include #include #include #include #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" #include "libewf_segment_file_handle.h" #include "libewf_segment_table.h" /* Initialize the segment table * Returns 1 if successful or -1 on error */ int libewf_segment_table_initialize( libewf_segment_table_t **segment_table, size64_t maximum_segment_size, libcerror_error_t **error ) { static char *function = "libewf_segment_table_initialize"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( *segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment table value already set.", function ); return( -1 ); } *segment_table = memory_allocate_structure( libewf_segment_table_t ); if( *segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment table.", function ); goto on_error; } if( memory_set( *segment_table, 0, sizeof( libewf_segment_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment table.", function ); goto on_error; } if( libcdata_array_initialize( &( ( *segment_table )->segment_files_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment files array.", function ); goto on_error; } ( *segment_table )->maximum_segment_size = maximum_segment_size; return( 1 ); on_error: if( *segment_table != NULL ) { memory_free( *segment_table ); *segment_table = NULL; } return( -1 ); } /* Frees the segment table including elements * Returns 1 if successful or -1 on error */ int libewf_segment_table_free( libewf_segment_table_t **segment_table, libcerror_error_t **error ) { static char *function = "libewf_segment_table_free"; int result = 1; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( *segment_table != NULL ) { if( ( *segment_table )->basename != NULL ) { memory_free( ( *segment_table )->basename ); } if( libcdata_array_free( &( ( *segment_table )->segment_files_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_segment_file_handle_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the segment files array.", function ); result = -1; } memory_free( *segment_table ); *segment_table = NULL; } return( result ); } /* Clones the segment table * Returns 1 if successful or -1 on error */ int libewf_segment_table_clone( libewf_segment_table_t **destination_segment_table, libewf_segment_table_t *source_segment_table, libcerror_error_t **error ) { static char *function = "libewf_segment_table_clone"; if( destination_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination segment table.", function ); return( -1 ); } if( *destination_segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination segment table value already set.", function ); return( -1 ); } if( source_segment_table == NULL ) { *destination_segment_table = NULL; return( 1 ); } *destination_segment_table = memory_allocate_structure( libewf_segment_table_t ); if( *destination_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination segment table.", function ); goto on_error; } if( memory_set( *destination_segment_table, 0, sizeof( libewf_segment_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear source to destination segment table.", function ); goto on_error; } if( source_segment_table->basename != NULL ) { ( *destination_segment_table )->basename = system_string_allocate( source_segment_table->basename_size ); if( *destination_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination segment table.", function ); goto on_error; } if( memory_copy( ( *destination_segment_table )->basename, source_segment_table->basename, sizeof( system_character_t ) * source_segment_table->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination basename.", function ); goto on_error; } ( *destination_segment_table )->basename_size = source_segment_table->basename_size; } if( libcdata_array_clone( &( ( *destination_segment_table )->segment_files_array ), source_segment_table->segment_files_array, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_segment_file_handle_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libewf_segment_file_handle_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segments files.", function ); goto on_error; } ( *destination_segment_table )->maximum_segment_size = source_segment_table->maximum_segment_size; return( 1 ); on_error: if( *destination_segment_table != NULL ) { if( ( *destination_segment_table )->basename != NULL ) { memory_free( ( *destination_segment_table )->basename ); } memory_free( *destination_segment_table ); *destination_segment_table = NULL; } return( -1 ); } /* Retrieves the size of the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_segment_table_get_basename_size( libewf_segment_table_t *segment_table, size_t *basename_size, libcerror_error_t **error ) { static char *function = "libewf_segment_table_get_basename_size"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( basename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename size.", function ); return( -1 ); } if( segment_table->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #else *basename_size = segment_table->basename_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Retrieves the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_segment_table_get_basename( libewf_segment_table_t *segment_table, char *basename, size_t basename_size, libcerror_error_t **error ) { static char *function = "libewf_segment_table_get_basename"; size_t narrow_basename_size = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( segment_table->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, &narrow_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, &narrow_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, &narrow_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, &narrow_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow basename size.", function ); return( -1 ); } #else narrow_basename_size = segment_table->basename_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( basename_size < narrow_basename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: basename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) basename, basename_size, (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) basename, basename_size, (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) basename, basename_size, libclocale_codepage, (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) basename, basename_size, libclocale_codepage, (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); return( -1 ); } #else if( system_string_copy( basename, segment_table->basename, segment_table->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); return( -1 ); } basename[ segment_table->basename_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Sets the basename * Returns 1 if successful or -1 on error */ int libewf_segment_table_set_basename( libewf_segment_table_t *segment_table, const char *basename, size_t basename_length, libcerror_error_t **error ) { static char *function = "libewf_segment_table_set_basename"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( segment_table->basename != NULL ) { memory_free( segment_table->basename ); segment_table->basename = NULL; segment_table->basename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) basename, basename_length + 1, &( segment_table->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) basename, basename_length + 1, &( segment_table->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) basename, basename_length + 1, libclocale_codepage, &( segment_table->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) basename, basename_length + 1, libclocale_codepage, &( segment_table->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #else segment_table->basename_size = basename_length + 1; #endif segment_table->basename = system_string_allocate( segment_table->basename_size ); if( segment_table->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create basename.", function ); segment_table->basename_size = 0; return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, (libuna_utf8_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, (libuna_utf8_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) segment_table->basename, segment_table->basename_size, (uint8_t *) basename, basename_length + 1, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) segment_table->basename, segment_table->basename_size, (uint8_t *) basename, basename_length + 1, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); memory_free( segment_table->basename ); segment_table->basename = NULL; segment_table->basename_size = 0; return( -1 ); } #else if( system_string_copy( segment_table->basename, basename, basename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( segment_table->basename ); segment_table->basename = NULL; segment_table->basename_size = 0; return( -1 ); } segment_table->basename[ basename_length ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the size of the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_segment_table_get_basename_size_wide( libewf_segment_table_t *segment_table, size_t *basename_size, libcerror_error_t **error ) { static char *function = "libewf_segment_table_get_basename_size_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( basename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename size.", function ); return( -1 ); } if( segment_table->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) *basename_size = segment_table->basename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Retrieves the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_segment_table_get_basename_wide( libewf_segment_table_t *segment_table, wchar_t *basename, size_t basename_size, libcerror_error_t **error ) { static char *function = "libewf_segment_table_get_basename_wide"; size_t wide_basename_size = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( segment_table->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wide_basename_size = segment_table->basename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, &wide_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, &wide_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, &wide_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, &wide_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( basename_size < wide_basename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: basename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( basename, segment_table->basename, segment_table->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); return( -1 ); } basename[ segment_table->basename_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) basename, basename_size, (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) basename, basename_size, (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) basename, basename_size, (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) basename, basename_size, (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Sets the basename * Returns 1 if successful or -1 on error */ int libewf_segment_table_set_basename_wide( libewf_segment_table_t *segment_table, const wchar_t *basename, size_t basename_length, libcerror_error_t **error ) { static char *function = "libewf_segment_table_set_basename_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( segment_table->basename != NULL ) { memory_free( segment_table->basename ); segment_table->basename = NULL; segment_table->basename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) segment_table->basename_size = basename_length + 1; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) basename, basename_length + 1, &( segment_table->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) basename, basename_length + 1, &( segment_table->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) basename, basename_length + 1, libclocale_codepage, &( segment_table->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) basename, basename_length + 1, libclocale_codepage, &( segment_table->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ segment_table->basename = system_string_allocate( segment_table->basename_size ); if( segment_table->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create basename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( segment_table->basename, basename, basename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( segment_table->basename ); segment_table->basename = NULL; segment_table->basename_size = 0; return( -1 ); } segment_table->basename[ basename_length ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, (libuna_utf32_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) segment_table->basename, segment_table->basename_size, (libuna_utf16_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, (libuna_utf32_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) segment_table->basename, segment_table->basename_size, libclocale_codepage, (libuna_utf16_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); memory_free( segment_table->basename ); segment_table->basename = NULL; segment_table->basename_size = 0; return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Sets the maximum segment size * Returns 1 if successful or -1 on error */ int libewf_segment_table_set_maximum_segment_size( libewf_segment_table_t *segment_table, size64_t maximum_segment_size, libcerror_error_t **error ) { static char *function = "libewf_segment_table_set_maximum_segment_size"; if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } segment_table->maximum_segment_size = maximum_segment_size; return( 1 ); } libewf-20140807/libewf/libewf_empty_block.c0000644000175000017500000000646013421013624022605 0ustar00lordyestalordyesta00000000000000/* * Empty block test functions * * 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 . */ #include #include #include "libewf_libcerror.h" #include "libewf_empty_block.h" /* The largest primary (or scalar) available * supported by a single load and store instruction */ typedef unsigned long int libewf_aligned_t; /* Check for empty block * An empty block is a block that contains the same value for every byte * Returns 1 if block is empty, 0 if not or -1 on error */ int libewf_empty_block_test( const uint8_t *block_buffer, size_t block_size, libcerror_error_t **error ) { libewf_aligned_t *aligned_block_iterator = NULL; libewf_aligned_t *aligned_block_start = NULL; uint8_t *block_iterator = NULL; uint8_t *block_start = NULL; static char *function = "libewf_empty_block_test"; if( block_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid block buffer.", function ); return( -1 ); } if( block_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid block size value exceeds maximum.", function ); return( -1 ); } block_start = (uint8_t *) block_buffer; block_iterator = (uint8_t *) block_buffer + 1; block_size -= 1; /* Only optimize for blocks larger than the alignment */ if( block_size > ( 2 * sizeof( libewf_aligned_t ) ) ) { /* Align the block start */ while( ( (intptr_t) block_start % sizeof( libewf_aligned_t ) ) != 0 ) { if( *block_start != *block_iterator ) { return( 0 ); } block_start += 1; block_iterator += 1; block_size -= 1; } /* Align the block iterator */ while( ( (intptr_t) block_iterator % sizeof( libewf_aligned_t ) ) != 0 ) { if( *block_start != *block_iterator ) { return( 0 ); } block_iterator += 1; block_size -= 1; } aligned_block_start = (libewf_aligned_t *) block_start; aligned_block_iterator = (libewf_aligned_t *) block_iterator; while( block_size > sizeof( libewf_aligned_t ) ) { if( *aligned_block_start != *aligned_block_iterator ) { return( 0 ); } aligned_block_iterator += 1; block_size -= sizeof( libewf_aligned_t ); } block_iterator = (uint8_t *) aligned_block_iterator; } while( block_size != 0 ) { if( *block_start != *block_iterator ) { return( 0 ); } block_iterator += 1; block_size -= 1; } return( 1 ); } libewf-20140807/libewf/libewf_single_file_entry.c0000664000175000017500000007261613421024433024006 0ustar00lordyestalordyesta00000000000000/* * Single file entry functions * * 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 . */ #include #include #include #include #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" #include "libewf_single_file_entry.h" /* Initialize the single file entry * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_initialize( libewf_single_file_entry_t **single_file_entry, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_initialize"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( *single_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid single file entry value already set.", function ); return( -1 ); } *single_file_entry = memory_allocate_structure( libewf_single_file_entry_t ); if( *single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create single file entry.", function ); goto on_error; } if( memory_set( *single_file_entry, 0, sizeof( libewf_single_file_entry_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear single file entry.", function ); goto on_error; } ( *single_file_entry )->data_offset = -1; ( *single_file_entry )->duplicate_data_offset = -1; return( 1 ); on_error: if( *single_file_entry != NULL ) { memory_free( *single_file_entry ); *single_file_entry = NULL; } return( -1 ); } /* Frees the single file entry including elements * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_free( libewf_single_file_entry_t **single_file_entry, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_free"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( *single_file_entry != NULL ) { if( ( *single_file_entry )->name != NULL ) { memory_free( ( *single_file_entry )->name ); } if( ( *single_file_entry )->md5_hash != NULL ) { memory_free( ( *single_file_entry )->md5_hash ); } if( ( *single_file_entry )->sha1_hash != NULL ) { memory_free( ( *single_file_entry )->sha1_hash ); } memory_free( *single_file_entry ); *single_file_entry = NULL; } return( 1 ); } /* Clones the single file entry * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_clone( libewf_single_file_entry_t **destination_single_file_entry, libewf_single_file_entry_t *source_single_file_entry, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_clone"; if( destination_single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination single file entry.", function ); return( -1 ); } if( *destination_single_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination single file entry value already set.", function ); return( -1 ); } if( source_single_file_entry == NULL ) { *destination_single_file_entry = NULL; return( 1 ); } *destination_single_file_entry = memory_allocate_structure( libewf_single_file_entry_t ); if( *destination_single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination single file entry.", function ); goto on_error; } if( memory_copy( *destination_single_file_entry, source_single_file_entry, sizeof( libewf_single_file_entry_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination single file entry.", function ); memory_free( *destination_single_file_entry ); *destination_single_file_entry = NULL; return( -1 ); } ( *destination_single_file_entry )->name = NULL; ( *destination_single_file_entry )->md5_hash = NULL; ( *destination_single_file_entry )->sha1_hash = NULL; if( source_single_file_entry->name != NULL ) { ( *destination_single_file_entry )->name = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_single_file_entry->name_size ); if( ( *destination_single_file_entry )->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination name.", function ); goto on_error; } if( memory_copy( ( *destination_single_file_entry )->name, source_single_file_entry->name, source_single_file_entry->name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination name.", function ); goto on_error; } ( *destination_single_file_entry )->name_size = source_single_file_entry->name_size; } if( source_single_file_entry->md5_hash != NULL ) { ( *destination_single_file_entry )->md5_hash = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_single_file_entry->md5_hash_size ); if( ( *destination_single_file_entry )->md5_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination MD5 hash.", function ); goto on_error; } if( memory_copy( ( *destination_single_file_entry )->md5_hash, source_single_file_entry->md5_hash, source_single_file_entry->md5_hash_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination MD5 hash.", function ); goto on_error; } ( *destination_single_file_entry )->md5_hash_size = source_single_file_entry->md5_hash_size; } if( source_single_file_entry->sha1_hash != NULL ) { ( *destination_single_file_entry )->sha1_hash = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_single_file_entry->sha1_hash_size ); if( ( *destination_single_file_entry )->sha1_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination SHA1 hash.", function ); goto on_error; } if( memory_copy( ( *destination_single_file_entry )->sha1_hash, source_single_file_entry->sha1_hash, source_single_file_entry->sha1_hash_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination SHA1 hash.", function ); goto on_error; } ( *destination_single_file_entry )->sha1_hash_size = source_single_file_entry->sha1_hash_size; } return( 1 ); on_error: if( *destination_single_file_entry != NULL ) { if( ( *destination_single_file_entry )->sha1_hash != NULL ) { memory_free( ( *destination_single_file_entry )->sha1_hash ); } if( ( *destination_single_file_entry )->md5_hash != NULL ) { memory_free( ( *destination_single_file_entry )->md5_hash ); } if( ( *destination_single_file_entry )->name != NULL ) { memory_free( ( *destination_single_file_entry )->name ); } memory_free( *destination_single_file_entry ); *destination_single_file_entry = NULL; } return( -1 ); } /* Retrieves the type * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_type( libewf_single_file_entry_t *single_file_entry, uint8_t *type, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_type"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type.", function ); return( -1 ); } *type = single_file_entry->type; return( 1 ); } /* Retrieves the flags * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_flags( libewf_single_file_entry_t *single_file_entry, uint32_t *flags, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_flags"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid flags.", function ); return( -1 ); } *flags = single_file_entry->flags; return( 1 ); } /* Retrieves the data offset * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_data_offset( libewf_single_file_entry_t *single_file_entry, off64_t *data_offset, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_data_offset"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data offset.", function ); return( -1 ); } *data_offset = single_file_entry->data_offset; return( 1 ); } /* Retrieves the data size * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_data_size( libewf_single_file_entry_t *single_file_entry, size64_t *data_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_data_size"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } *data_size = single_file_entry->data_size; return( 1 ); } /* Retrieves the duplicate data offset * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_duplicate_data_offset( libewf_single_file_entry_t *single_file_entry, off64_t *duplicate_data_offset, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_duplicate_data_offset"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( duplicate_data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid duplicate data offset.", function ); return( -1 ); } *duplicate_data_offset = single_file_entry->duplicate_data_offset; return( 1 ); } /* Retrieves the size of the UTF-8 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_utf8_name_size( libewf_single_file_entry_t *single_file_entry, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf8_name_size"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = single_file_entry->name_size; return( 1 ); } /* Retrieves the UTF-8 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_utf8_name( libewf_single_file_entry_t *single_file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf8_name"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid UTF-8 string size value too small.", function ); return( -1 ); } if( ( single_file_entry->name == NULL ) || ( single_file_entry->name_size == 0 ) ) { utf8_string[ 0 ] = 0; } else { if( utf8_string_size < single_file_entry->name_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid UTF-8 string size value too small.", function ); return( -1 ); } if( narrow_string_copy( (char *) utf8_string, (char *) single_file_entry->name, single_file_entry->name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set UTF-8 string.", function ); return( -1 ); } utf8_string[ single_file_entry->name_size - 1 ] = 0; } return( 1 ); } /* Retrieves the size of the UTF-16 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_utf16_name_size( libewf_single_file_entry_t *single_file_entry, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf16_name_size"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( ( single_file_entry->name == NULL ) || ( single_file_entry->name_size == 0 ) ) { if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; } else { if( libuna_utf16_string_size_from_utf8( single_file_entry->name, single_file_entry->name_size, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-16 string size.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the UTF-16 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_utf16_name( libewf_single_file_entry_t *single_file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf16_name"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid UTF-16 string size value too small.", function ); return( -1 ); } if( ( single_file_entry->name == NULL ) || ( single_file_entry->name_size == 0 ) ) { utf16_string[ 0 ] = 0; } else { if( libuna_utf16_string_copy_from_utf8( utf16_string, utf16_string_size, single_file_entry->name, single_file_entry->name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy name to UTF-16 string.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_size( libewf_single_file_entry_t *single_file_entry, size64_t *size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_size"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } *size = single_file_entry->size; return( 1 ); } /* Retrieves the creation date and time * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_creation_time( libewf_single_file_entry_t *single_file_entry, uint32_t *creation_time, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_creation_time"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( creation_time == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid creation time.", function ); return( -1 ); } *creation_time = single_file_entry->creation_time; return( 1 ); } /* Retrieves the (file) modification (last written) date and time * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_modification_time( libewf_single_file_entry_t *single_file_entry, uint32_t *modification_time, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_modification_time"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( modification_time == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid modification time.", function ); return( -1 ); } *modification_time = single_file_entry->modification_time; return( 1 ); } /* Retrieves the access date and time * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_access_time( libewf_single_file_entry_t *single_file_entry, uint32_t *access_time, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_access_time"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( access_time == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid access time.", function ); return( -1 ); } *access_time = single_file_entry->access_time; return( 1 ); } /* Retrieves the (file system entry) modification date and time * Returns 1 if successful or -1 on error */ int libewf_single_file_entry_get_entry_modification_time( libewf_single_file_entry_t *single_file_entry, uint32_t *entry_modification_time, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_entry_modification_time"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( entry_modification_time == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry modification time.", function ); return( -1 ); } *entry_modification_time = single_file_entry->entry_modification_time; return( 1 ); } /* Retrieves the UTF-8 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_single_file_entry_get_utf8_hash_value_md5( libewf_single_file_entry_t *single_file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf8_hash_value_md5"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size < single_file_entry->md5_hash_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( single_file_entry->md5_hash_size == 0 ) { return( 0 ); } if( memory_copy( utf8_string, single_file_entry->md5_hash, single_file_entry->md5_hash_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy MD5 hash to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-16 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_single_file_entry_get_utf16_hash_value_md5( libewf_single_file_entry_t *single_file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf16_hash_value_md5"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size < single_file_entry->md5_hash_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( single_file_entry->md5_hash_size == 0 ) { return( 0 ); } if( libuna_utf16_string_copy_from_utf8( utf16_string, utf16_string_size, single_file_entry->md5_hash, single_file_entry->md5_hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy MD5 hash to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-8 encoded SHA1 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_single_file_entry_get_utf8_hash_value_sha1( libewf_single_file_entry_t *single_file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf8_hash_value_sha1"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size < single_file_entry->sha1_hash_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( single_file_entry->sha1_hash_size == 0 ) { return( 0 ); } if( memory_copy( utf8_string, single_file_entry->sha1_hash, single_file_entry->sha1_hash_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy SHA1 hash to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-16 encoded SHA1 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_single_file_entry_get_utf16_hash_value_sha1( libewf_single_file_entry_t *single_file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libewf_single_file_entry_get_utf16_hash_value_sha1"; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size < single_file_entry->sha1_hash_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( single_file_entry->sha1_hash_size == 0 ) { return( 0 ); } if( libuna_utf16_string_copy_from_utf8( utf16_string, utf16_string_size, single_file_entry->sha1_hash, single_file_entry->sha1_hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy SHA1 hash to UTF-16 string.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libewf/ewfx_delta_chunk.h0000644000175000017500000000311713421013623022257 0ustar00lordyestalordyesta00000000000000/* * libewf EWF eXtention delta chunk * * 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( _EWFX_DELTA_CHUNK_H ) #define _EWFX_DELTA_CHUNK_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewfx_delta_chunk_header ewfx_delta_chunk_header_t; struct ewfx_delta_chunk_header { /* The number of the chunk * consists of 4 bytes (32 bits) */ uint8_t chunk[ 4 ]; /* The size of the chunk * consists of 4 bytes (32 bits) */ uint8_t chunk_size[ 4 ]; /* Padding * some padding reserved for future use * consists of 6 bytes * "DELTA\x00" */ uint8_t padding[ 6 ]; /* The section checksum of all (previous) delta chunk section data * consists of 4 bytes * starts with offset 76 */ uint8_t checksum[ 4 ]; /* The chunk data with checksum */ }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_section.c0000664000175000017500000055520213421024433021746 0ustar00lordyestalordyesta00000000000000/* * Section reading/writing functions * * 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 . */ #include #include #include #include #include #include "libewf_checksum.h" #include "libewf_compression.h" #include "libewf_debug.h" #include "libewf_definitions.h" #include "libewf_hash_sections.h" #include "libewf_header_sections.h" #include "libewf_header_values.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #include "libewf_section.h" #include "libewf_sector_range.h" #include "libewf_single_files.h" #include "libewf_unused.h" #include "ewf_data.h" #include "ewf_definitions.h" #include "ewf_digest.h" #include "ewf_error2.h" #include "ewf_file_header.h" #include "ewf_hash.h" #include "ewf_ltree.h" #include "ewf_session.h" #include "ewf_table.h" #include "ewf_volume.h" #include "ewf_volume_smart.h" #include "ewfx_delta_chunk.h" /* Tests if a buffer entirely consists of zero values * Returns 1 if zero, 0 if not, or -1 on error */ int libewf_section_test_zero( uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { static char *function = "libewf_section_test_zero"; size_t buffer_offset = 0; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } for( buffer_offset = 0; buffer_offset < buffer_size; buffer_offset++ ) { if( buffer[ buffer_offset ] != 0 ) { return( 0 ); } } return( 1 ); } /* Creates a section * Returns 1 if successful or -1 on error */ int libewf_section_initialize( libewf_section_t **section, libcerror_error_t **error ) { static char *function = "libewf_section_initialize"; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( *section != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid csection value already set.", function ); return( -1 ); } *section = memory_allocate_structure( libewf_section_t ); if( *section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create section.", function ); goto on_error; } if( memory_set( *section, 0, sizeof( libewf_section_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear section.", function ); goto on_error; } return( 1 ); on_error: if( *section != NULL ) { memory_free( *section ); *section = NULL; } return( -1 ); } /* Frees the section * Returns 1 if successful or -1 on error */ int libewf_section_free( libewf_section_t **section, libcerror_error_t **error ) { static char *function = "libewf_section_free"; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( *section != NULL ) { memory_free( *section ); *section = NULL; } return( 1 ); } /* Clones the section * Returns 1 if successful or -1 on error */ int libewf_section_clone( libewf_section_t **destination_section, libewf_section_t *source_section, libcerror_error_t **error ) { static char *function = "libewf_section_clone"; if( destination_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination section.", function ); return( -1 ); } if( *destination_section != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination section value already set.", function ); return( -1 ); } if( source_section == NULL ) { *destination_section = NULL; return( 1 ); } *destination_section = memory_allocate_structure( libewf_section_t ); if( *destination_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination section.", function ); goto on_error; } if( memory_copy( *destination_section, source_section, sizeof( libewf_section_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination section.", function ); goto on_error; } return( 1 ); on_error: if( *destination_section != NULL ) { memory_free( *destination_section ); *destination_section = NULL; } return( -1 ); } /* Sets the section values * Returns 1 if successful or -1 on error */ int libewf_section_set_values( libewf_section_t *section, uint8_t *type, size_t type_length, off64_t offset, size64_t size, libcerror_error_t **error ) { static char *function = "libewf_section_set_values"; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type.", function ); return( -1 ); } if( ( type_length == 0 ) || ( type_length > 16 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid type length value out of bounds.", function ); return( -1 ); } if( ( offset < 0 ) || ( offset > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } if( size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( memory_copy( section->type, type, type_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set type string.", function ); return( -1 ); } section->type[ type_length ] = 0; section->type_length = type_length; section->start_offset = offset; section->end_offset = (off64_t) ( offset + size ); section->size = size; return( 1 ); } /* Reads a section start * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_start_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t file_offset, libcerror_error_t **error ) { ewf_section_start_t section_start; static char *function = "libewf_section_start_read"; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading section start from file IO pool entry: %d at offset: %" PRIi64 "\n", function, file_io_pool_entry, file_offset ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, file_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek section start offset: %" PRIi64 " in file IO pool entry: %d.", function, file_offset, file_io_pool_entry ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) §ion_start, sizeof( ewf_section_start_t ), error ); if( read_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section start from file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: section start:\n", function ); libcnotify_print_data( (uint8_t *) §ion_start, sizeof( ewf_section_start_t ), 0 ); } #endif if( memory_copy( section->type, section_start.type, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set type string.", function ); return( -1 ); } section->type[ 16 ] = 0; byte_stream_copy_to_uint64_little_endian( section_start.size, section->size ); byte_stream_copy_to_uint64_little_endian( section_start.next_offset, section->end_offset ); byte_stream_copy_to_uint32_little_endian( section_start.checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: type\t\t\t\t\t\t: %s\n", function, (char *) section->type ); libcnotify_printf( "%s: next offset\t\t\t\t\t: %" PRIu64 "\n", function, section->end_offset ); libcnotify_printf( "%s: size\t\t\t\t\t\t: %" PRIu64 "\n", function, section->size ); libcnotify_printf( "%s: padding:\n", function ); libcnotify_print_data( section_start.padding, 40, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) §ion_start, sizeof( ewf_section_start_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); return( -1 ); } section->type_length = narrow_string_length( (char *) section->type ); if( ( section->end_offset < file_offset ) || ( section->end_offset > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section next offset value out of bounds.", function ); return( -1 ); } section->start_offset = file_offset; if( section->size != 0 ) { /* Make sure to check if the section next value is sane * the end offset of the next and done sections point back at themselves */ if( section->end_offset == section->start_offset ) { if( ( section->type_length != 4 ) || ( ( memory_compare( section->type, "next", 4 ) != 0 ) && ( memory_compare( section->type, "done", 4 ) != 0 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: mismatch in next section offset (stored: %" PRIi64 ", calculated: %" PRIi64 ").", function, section->end_offset, section->start_offset ); return( -1 ); } if( section->size != (size64_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } } else { if( ( section->size < (size64_t) sizeof( ewf_section_start_t ) ) || ( section->size > (size64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } file_offset += (off64_t) section->size; if( section->end_offset != file_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: mismatch in next section offset (stored: %" PRIi64 ", calculated: %" PRIi64 ").", function, section->end_offset, file_offset ); return( -1 ); } } } else { /* Make sure to check if the section next value is sane * the end offset of the next and done sections point back at themselves */ if( section->end_offset == section->start_offset ) { if( ( section->type_length != 4 ) || ( ( memory_compare( section->type, "next", 4 ) != 0 ) && ( memory_compare( section->type, "done", 4 ) != 0 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: mismatch in next section offset (stored: %" PRIi64 ", calculated: %" PRIi64 ").", function, section->end_offset, section->start_offset ); return( -1 ); } section->size = (size64_t) sizeof( ewf_section_start_t ); } else { file_offset += (off64_t) sizeof( ewf_section_start_t ); if( section->end_offset < file_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section next offset value out of bounds.", function ); return( -1 ); } section->size = (size64_t) ( section->end_offset - section->start_offset ); } } return( read_count ); } /* Writes a section start * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_start_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ) { ewf_section_start_t section_start; static char *function = "libewf_section_start_write"; ssize_t write_count = 0; uint32_t calculated_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( memory_set( §ion_start, 0, sizeof( ewf_section_start_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear section start.", function ); return( -1 ); } if( memory_copy( section_start.type, section->type, section->type_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set type string.", function ); return( -1 ); } byte_stream_copy_from_uint64_little_endian( section_start.size, section->size ); byte_stream_copy_from_uint64_little_endian( section_start.next_offset, section->end_offset ); if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) §ion_start, sizeof( ewf_section_start_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( section_start.checksum, calculated_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: writing section start: %s of size: %" PRIu64 " and checksum: 0x%08" PRIx32 ".\n", function, (char *) section->type, section->size, calculated_checksum ); } #endif write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) §ion_start, sizeof( ewf_section_start_t ), error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); return( -1 ); } return( write_count ); } #if defined( HAVE_DEBUG_OUTPUT ) /* Reads a section for debugging purposes * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_debug_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ) { uint8_t *data = NULL; uint8_t *uncompressed_data = NULL; static char *function = "libewf_section_debug_read"; ssize_t read_count = 0; size_t uncompressed_size = 0; int result = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( section->size > (size64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid section size value exceeds maximum.", function ); return( -1 ); } uncompressed_size = (size_t) ( section->size * 2 ); if( uncompressed_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: uncompressed size value exceeds maximum.", function ); return( -1 ); } data = (uint8_t *) memory_allocate( (size_t) section->size ); if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, data, (size_t) section->size, error ); if( read_count != (ssize_t) section->size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section data.", function ); goto on_error; } uncompressed_data = (uint8_t *) memory_allocate( uncompressed_size ); if( uncompressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create uncompressed data.", function ); goto on_error; } result = libewf_decompress_data( data, (size_t) section->size, uncompressed_data, &uncompressed_size, error ); if( result == 0 ) { result = libewf_debug_dump_data( "UNCOMPRESSED data", data, (size_t) section->size, error ); } else if( result == 1 ) { result = libewf_debug_dump_data( "COMPRESSED data", uncompressed_data, uncompressed_size, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print data.", function ); goto on_error; } memory_free( uncompressed_data ); memory_free( data ); return( read_count ); on_error: if( uncompressed_data != NULL ) { memory_free( uncompressed_data ); } if( data != NULL ) { memory_free( data ); } return( -1 ); } #endif /* Writes the last section start * This is used for the next and done sections, * these sections point back towards themselves * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_last_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t *type_string, size_t type_string_length, off64_t section_offset, uint8_t ewf_format, libcerror_error_t **error ) { static char *function = "libewf_section_last_write"; size64_t section_size = 0; ssize_t write_count = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } /* The EnCase (EWF-E01) format leaves the size of this section empty */ if( ewf_format == EWF_FORMAT_S01 ) { section_size = (uint64_t) sizeof( ewf_section_start_t ); } if( libewf_section_set_values( section, type_string, type_string_length, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start: %s.", function, (char *) type_string ); return( -1 ); } return( write_count ); } /* Reads a compressed string section and decompresses it * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_compressed_string_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t **uncompressed_string, size_t *uncompressed_string_size, libcerror_error_t **error ) { uint8_t *compressed_string = NULL; static char *function = "libewf_section_compressed_string_read"; void *reallocation = NULL; size64_t section_data_size = 0; ssize_t read_count = 0; int result = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( uncompressed_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed string.", function ); return( -1 ); } if( *uncompressed_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid uncompressed string value already set.", function ); return( -1 ); } if( uncompressed_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed string size.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size > (size64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid section size value exceeds maximum.", function ); return( -1 ); } compressed_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * (size_t) section_data_size ); if( compressed_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create compressed string.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, compressed_string, (size_t) section_data_size, error ); if( read_count != (ssize_t) section_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read compressed string.", function ); goto on_error; } /* On average the uncompressed string will be twice as large as the compressed string */ *uncompressed_string_size = 4 * (size_t) section_data_size; *uncompressed_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *uncompressed_string_size ); if( *uncompressed_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create uncompressed string.", function ); goto on_error; } result = libewf_decompress_data( compressed_string, (size_t) section_data_size, *uncompressed_string, uncompressed_string_size, error ); while( ( result == 0 ) && ( *uncompressed_string_size > 0 ) ) { libcerror_error_free( error ); reallocation = memory_reallocate( *uncompressed_string, sizeof( uint8_t ) * *uncompressed_string_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize uncompressed string.", function ); goto on_error; } *uncompressed_string = (uint8_t *) reallocation; result = libewf_decompress_data( compressed_string, (size_t) section_data_size, *uncompressed_string, uncompressed_string_size, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_DECOMPRESS_FAILED, "%s: unable to decompress string.", function ); goto on_error; } memory_free( compressed_string ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: uncompressed string:\n", function ); libcnotify_print_data( *uncompressed_string, *uncompressed_string_size, 0 ); } #endif return( read_count ); on_error: if( *uncompressed_string != NULL ) { memory_free( *uncompressed_string ); *uncompressed_string = NULL; } if( compressed_string != NULL ) { memory_free( compressed_string ); } return( -1 ); } /* Writes a compressed string section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_write_compressed_string( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t *type_string, size_t type_string_length, off64_t section_offset, uint8_t *uncompressed_string, size_t uncompressed_string_size, int8_t compression_level, libcerror_error_t **error ) { uint8_t *compressed_string = NULL; static char *function = "libewf_section_write_compressed_string"; void *reallocation = NULL; size64_t section_size = 0; size_t compressed_string_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; int result = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( type_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type string.", function ); return( -1 ); } if( uncompressed_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed string.", function ); return( -1 ); } compressed_string_size = uncompressed_string_size; compressed_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * compressed_string_size ); if( compressed_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create compressed string.", function ); goto on_error; } result = libewf_compress_data( compressed_string, &compressed_string_size, compression_level, uncompressed_string, uncompressed_string_size, error ); if( ( result == 0 ) && ( compressed_string_size > 0 ) ) { libcerror_error_free( error ); reallocation = memory_reallocate( compressed_string, sizeof( uint8_t ) * compressed_string_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize compressed string.", function ); goto on_error; } compressed_string = (uint8_t *) reallocation; result = libewf_compress_data( compressed_string, &compressed_string_size, compression_level, uncompressed_string, uncompressed_string_size, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED, "%s: unable to compress string.", function ); goto on_error; } section_size = sizeof( ewf_section_start_t ) + compressed_string_size; if( libewf_section_set_values( section, type_string, type_string_length, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); goto on_error; } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start: %s.", function, (char *) type_string ); goto on_error; } total_write_count += write_count; write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, compressed_string, compressed_string_size, error ); if( write_count != (ssize_t) compressed_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write compressed string.", function ); goto on_error; } total_write_count += write_count; memory_free( compressed_string ); return( total_write_count ); on_error: if( compressed_string != NULL ) { memory_free( compressed_string ); } return( -1 ); } /* Reads a data section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_data_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ) { ewf_data_t *data = NULL; static char *function = "libewf_section_data_read"; ssize_t read_count = 0; size64_t section_data_size = 0; uint64_t number_of_sectors = 0; uint32_t bytes_per_sector = 0; uint32_t calculated_checksum = 0; uint32_t error_granularity = 0; uint32_t number_of_chunks = 0; uint32_t sectors_per_chunk = 0; uint32_t stored_checksum = 0; #if defined( HAVE_DEBUG_OUTPUT ) uint32_t value_32bit = 0; #endif if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size != (size64_t) sizeof( ewf_data_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } data = memory_allocate_structure( ewf_data_t ); if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) data, sizeof( ewf_data_t ), error ); if( read_count != (ssize_t) sizeof( ewf_data_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read data.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: data:\n", function ); libcnotify_print_data( (uint8_t *) data, sizeof( ewf_data_t ), LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA ); } #endif byte_stream_copy_to_uint32_little_endian( data->checksum, stored_checksum ); byte_stream_copy_to_uint32_little_endian( data->number_of_chunks, number_of_chunks ); byte_stream_copy_to_uint32_little_endian( data->sectors_per_chunk, sectors_per_chunk ); byte_stream_copy_to_uint32_little_endian( data->bytes_per_sector, bytes_per_sector ); byte_stream_copy_to_uint64_little_endian( data->number_of_sectors, number_of_sectors ); byte_stream_copy_to_uint32_little_endian( data->error_granularity, error_granularity ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: media type\t\t\t\t\t: 0x%02" PRIx8 "\n", function, data->media_type ); libcnotify_printf( "%s: unknown1:\n", function ); libcnotify_print_data( data->unknown1, 3, 0 ); libcnotify_printf( "%s: number of chunks\t\t\t\t: %" PRIu32 "\n", function, number_of_chunks ); libcnotify_printf( "%s: sectors per chunk\t\t\t\t: %" PRIu32 "\n", function, sectors_per_chunk ); libcnotify_printf( "%s: bytes per sector\t\t\t\t: %" PRIu32 "\n", function, bytes_per_sector ); libcnotify_printf( "%s: number of sectors\t\t\t\t: %" PRIu64 "\n", function, number_of_sectors ); byte_stream_copy_to_uint32_little_endian( data->chs_cylinders, value_32bit ); libcnotify_printf( "%s: CHS number of cylinders\t\t\t: %" PRIu32 "\n", function, value_32bit ); byte_stream_copy_to_uint32_little_endian( data->chs_heads, value_32bit ); libcnotify_printf( "%s: CHS number of heads\t\t\t\t: %" PRIu32 "\n", function, value_32bit ); byte_stream_copy_to_uint32_little_endian( data->chs_sectors, value_32bit ); libcnotify_printf( "%s: CHS number of sectors\t\t\t\t: %" PRIu32 "\n", function, value_32bit ); libcnotify_printf( "%s: media flags\t\t\t\t\t: 0x%02" PRIx8 "\n", function, data->media_flags ); libcnotify_printf( "%s: unknown2:\n", function ); libcnotify_print_data( data->unknown2, 3, 0 ); byte_stream_copy_to_uint32_little_endian( data->palm_volume_start_sector, value_32bit ); libcnotify_printf( "%s: PALM volume start sector\t\t\t: %" PRIu32 "\n", function, value_32bit ); libcnotify_printf( "%s: unknown3:\n", function ); libcnotify_print_data( data->unknown3, 4, 0 ); byte_stream_copy_to_uint32_little_endian( data->smart_logs_start_sector, value_32bit ); libcnotify_printf( "%s: SMART logs start sector\t\t\t: %" PRIu32 "\n", function, value_32bit ); libcnotify_printf( "%s: compression level\t\t\t\t: 0x%02" PRIx8 "\n", function, data->compression_level ); libcnotify_printf( "%s: unknown4:\n", function ); libcnotify_print_data( data->unknown4, 3, 0 ); libcnotify_printf( "%s: error granularity\t\t\t\t: %" PRIu32 "\n", function, error_granularity ); libcnotify_printf( "%s: unknown5:\n", function ); libcnotify_print_data( data->unknown5, 4, 0 ); libcnotify_printf( "%s: GUID:\n", function ); libcnotify_print_data( data->guid, 16, 0 ); libcnotify_printf( "%s: unknown6:\n", function ); libcnotify_print_data( data->unknown6, 963, LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA ); libcnotify_printf( "%s: signature:\n", function ); libcnotify_print_data( data->signature, 5, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( stored_checksum != 0 ) { if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) data, sizeof( ewf_data_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } } if( ( data->media_type != 0 ) && ( data->media_type != media_values->media_type ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: media type does not match.", function ); goto on_error; } if( ( number_of_chunks != 0 ) && ( number_of_chunks != media_values->number_of_chunks ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: number of chunks does not match.", function ); goto on_error; } if( ( sectors_per_chunk != 0 ) && ( sectors_per_chunk != media_values->sectors_per_chunk ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: sectors per chunk does not match.", function ); goto on_error; } if( ( bytes_per_sector != 0 ) && ( bytes_per_sector != media_values->bytes_per_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: bytes per sector does not match.", function ); goto on_error; } if( ( number_of_sectors != 0 ) && ( number_of_sectors != media_values->number_of_sectors ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: number of sectors does not match.", function ); goto on_error; } if( ( data->media_flags != 0 ) && ( data->media_flags != media_values->media_flags ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: media flags do not match.", function ); goto on_error; } if( ( data->compression_level != 0 ) && ( data->compression_level != io_handle->compression_level ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: compression level does not match.", function ); goto on_error; } if( ( error_granularity != 0 ) && ( error_granularity != media_values->error_granularity ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: error granularity does not match.", function ); goto on_error; } if( ( data->guid[ 0 ] != 0 ) || ( data->guid[ 1 ] != 0 ) || ( data->guid[ 2 ] != 0 ) || ( data->guid[ 3 ] != 0 ) || ( data->guid[ 4 ] != 0 ) || ( data->guid[ 5 ] != 0 ) || ( data->guid[ 6 ] != 0 ) || ( data->guid[ 7 ] != 0 ) || ( data->guid[ 8 ] != 0 ) || ( data->guid[ 9 ] != 0 ) || ( data->guid[ 10 ] != 0 ) || ( data->guid[ 11 ] != 0 ) || ( data->guid[ 12 ] != 0 ) || ( data->guid[ 13 ] != 0 ) || ( data->guid[ 14 ] != 0 ) || ( data->guid[ 15 ] != 0 ) ) { if( memory_compare( media_values->guid, data->guid, 16 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: GUID does not match.", function ); goto on_error; } } memory_free( data ); return( read_count ); on_error: if( data != NULL ) { memory_free( data ); } return( -1 ); } /* Writes a data section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_data_write( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_media_values_t *media_values, ewf_data_t **cached_data_section, libcerror_error_t **error ) { static char *function = "libewf_section_data_write"; size64_t section_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( cached_data_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid caches data section.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_data_t ); if( libewf_section_set_values( section, (uint8_t *) "data", 4, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); return( -1 ); } total_write_count += write_count; if( *cached_data_section == NULL ) { *cached_data_section = memory_allocate_structure( ewf_data_t ); if( *cached_data_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); return( -1 ); } if( memory_set( *cached_data_section, 0, sizeof( ewf_data_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear data.", function ); memory_free( *cached_data_section ); *cached_data_section = NULL; return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: media type\t\t\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_type ); libcnotify_printf( "%s: number of chunks\t\t\t\t: %" PRIu32 "\n", function, media_values->number_of_chunks ); libcnotify_printf( "%s: sectors per chunk\t\t\t\t: %" PRIu32 "\n", function, media_values->sectors_per_chunk ); libcnotify_printf( "%s: bytes per sector\t\t\t\t: %" PRIu32 "\n", function, media_values->bytes_per_sector ); libcnotify_printf( "%s: number of sectors\t\t\t\t: %" PRIu64 "\n", function, media_values->number_of_sectors ); libcnotify_printf( "%s: media flags\t\t\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_flags ); libcnotify_printf( "%s: compression level\t\t\t\t: 0x%02" PRIx8 "\n", function, io_handle->compression_level ); libcnotify_printf( "%s: error granularity\t\t\t\t: %" PRIu32 "\n", function, media_values->error_granularity ); libcnotify_printf( "%s: GUID:\n", function ); libcnotify_print_data( media_values->guid, 16, 0 ); libcnotify_printf( "\n" ); } #endif ( *cached_data_section )->media_type = media_values->media_type; ( *cached_data_section )->media_flags = media_values->media_flags; byte_stream_copy_from_uint32_little_endian( ( *cached_data_section )->number_of_chunks, media_values->number_of_chunks ); byte_stream_copy_from_uint32_little_endian( ( *cached_data_section )->sectors_per_chunk, media_values->sectors_per_chunk ); byte_stream_copy_from_uint32_little_endian( ( *cached_data_section )->bytes_per_sector, media_values->bytes_per_sector ); byte_stream_copy_from_uint64_little_endian( ( *cached_data_section )->number_of_sectors, media_values->number_of_sectors ); if( ( io_handle->format == LIBEWF_FORMAT_ENCASE5 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN5 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN6 ) || ( io_handle->format == LIBEWF_FORMAT_EWFX ) ) { byte_stream_copy_from_uint32_little_endian( ( *cached_data_section )->error_granularity, media_values->error_granularity ); ( *cached_data_section )->compression_level = (uint8_t) io_handle->compression_level; if( memory_copy( ( *cached_data_section )->guid, media_values->guid, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set GUID.", function ); memory_free( *cached_data_section ); *cached_data_section = NULL; return( -1 ); } } if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) *cached_data_section, sizeof( ewf_data_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); memory_free( *cached_data_section ); *cached_data_section = NULL; return( -1 ); } byte_stream_copy_from_uint32_little_endian( ( *cached_data_section )->checksum, calculated_checksum ); } write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) *cached_data_section, sizeof( ewf_data_t ), error ); if( write_count != (ssize_t) sizeof( ewf_data_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data.", function ); return( -1 ); } total_write_count += write_count; return( total_write_count ); } /* Reads a digest section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_digest_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ) { ewf_digest_t digest; static char *function = "libewf_section_digest_read"; size64_t section_data_size = 0; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; int result = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size != (size64_t) sizeof( ewf_digest_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &digest, sizeof( ewf_digest_t ), error ); if( read_count != (ssize_t) sizeof( ewf_digest_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read digest.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: digest data:\n", function ); libcnotify_print_data( (uint8_t *) &digest, sizeof( ewf_digest_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( digest.checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: MD5 hash:\n", function ); libcnotify_print_data( digest.md5_hash, 16, 0 ); libcnotify_printf( "%s: SHA1 hash:\n", function ); libcnotify_print_data( digest.sha1_hash, 20, 0 ); libcnotify_printf( "%s: padding:\n", function ); libcnotify_print_data( digest.padding1, 40, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &digest, sizeof( ewf_digest_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); return( -1 ); } result = libewf_section_test_zero( digest.md5_hash, 16, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if MD5 hash is empty.", function ); return( -1 ); } else if( result == 0 ) { if( memory_copy( hash_sections->md5_digest, digest.md5_hash, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 digest in hash sections.", function ); return( -1 ); } hash_sections->md5_digest_set = 1; } else { hash_sections->md5_digest_set = 0; } result = libewf_section_test_zero( digest.sha1_hash, 20, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if SHA1 hash is empty.", function ); return( -1 ); } else if( result == 0 ) { if( memory_copy( hash_sections->sha1_digest, digest.sha1_hash, 20 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set SHA1 digest in hash sections.", function ); return( -1 ); } hash_sections->sha1_digest_set = 1; } else { hash_sections->sha1_digest_set = 0; } return( read_count ); } /* Writes a digest section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_digest_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ) { ewf_digest_t digest; static char *function = "libewf_section_digest_write"; size64_t section_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_digest_t ); if( libewf_section_set_values( section, (uint8_t *) "digest", 6, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); return( -1 ); } total_write_count += write_count; if( memory_set( &digest, 0, sizeof( ewf_digest_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear digest.", function ); return( -1 ); } if( hash_sections->md5_digest_set != 0 ) { if( memory_copy( digest.md5_hash, hash_sections->md5_digest, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } } if( hash_sections->sha1_digest_set != 0 ) { if( memory_copy( digest.sha1_hash, hash_sections->sha1_digest, 20 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: MD5 hash:\n", function ); libcnotify_print_data( digest.md5_hash, 16, 0 ); libcnotify_printf( "%s: SHA1 hash:\n", function ); libcnotify_print_data( digest.sha1_hash, 20, 0 ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &digest, sizeof( ewf_digest_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( digest.checksum, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &digest, sizeof( ewf_digest_t ), error ); if( write_count != (ssize_t) sizeof( ewf_digest_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write digest.", function ); return( -1 ); } total_write_count += write_count; return( total_write_count ); } /* Reads an error2 section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_error2_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcdata_range_list_t *acquiry_errors, libcerror_error_t **error ) { ewf_error2_header_t error2_header; uint8_t stored_checksum_buffer[ 4 ]; ewf_error2_sector_t *error2_sectors = NULL; static char *function = "libewf_section_error2_read"; size64_t section_data_size = 0; size_t error2_sectors_size = 0; ssize_t read_count = 0; ssize_t total_read_count = 0; uint32_t calculated_checksum = 0; uint32_t error_index = 0; uint32_t start_sector = 0; uint32_t number_of_errors = 0; uint32_t number_of_sectors = 0; uint32_t stored_checksum = 0; int result = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( acquiry_errors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid acquiry errors.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size < (size64_t) sizeof( ewf_error2_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } section_data_size -= sizeof( ewf_error2_header_t ); read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &error2_header, sizeof( ewf_error2_header_t ), error ); if( read_count != (ssize_t) sizeof( ewf_error2_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read error2 header.", function ); goto on_error; } total_read_count += read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: error2 header data:\n", function ); libcnotify_print_data( (uint8_t *) &error2_header, sizeof( ewf_error2_header_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( error2_header.number_of_errors, number_of_errors ); byte_stream_copy_to_uint32_little_endian( error2_header.checksum, stored_checksum); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of errors\t\t\t\t: %" PRIu32 "\n", function, number_of_errors ); libcnotify_printf( "%s: unknown:\n", function ); libcnotify_print_data( error2_header.unknown, 200, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &error2_header, sizeof( ewf_error2_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum!= calculated_checksum) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } if( number_of_errors > 0 ) { error2_sectors_size = sizeof( ewf_error2_sector_t ) * number_of_errors; if( section_data_size < error2_sectors_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } error2_sectors = (ewf_error2_sector_t *) memory_allocate( error2_sectors_size ); if( error2_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create error2 sectors.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) error2_sectors, error2_sectors_size, error ); if( read_count != (ssize_t) error2_sectors_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read error2 sectors.", function ); goto on_error; } total_read_count += read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: error2 sectors data:\n", function ); libcnotify_print_data( (uint8_t *) error2_sectors, error2_sectors_size, 0 ); } #endif read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, stored_checksum_buffer, sizeof( uint32_t ), error ); if( read_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read checksum.", function ); goto on_error; } total_read_count += read_count; byte_stream_copy_to_uint32_little_endian( stored_checksum_buffer, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: error2 sectors checksum\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) error2_sectors, error2_sectors_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } if( libcdata_range_list_empty( acquiry_errors, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty acquiry errors range list.", function ); goto on_error; } for( error_index = 0; error_index < number_of_errors; error_index++ ) { byte_stream_copy_to_uint32_little_endian( error2_sectors[ error_index ].start_sector, start_sector ); byte_stream_copy_to_uint32_little_endian( error2_sectors[ error_index ].number_of_sectors, number_of_sectors ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: error2: %02" PRIu32 " start sector\t\t\t: %" PRIu32 "\n", function, error_index, start_sector ); libcnotify_printf( "%s: error2: %02" PRIu32 " number of sectors\t\t: %" PRIu32 "\n", function, error_index, number_of_sectors ); } #endif result = libcdata_range_list_insert_range( acquiry_errors, (uint64_t) start_sector, (uint64_t) number_of_sectors, NULL, NULL, NULL, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append acquiry error to range list.", function ); goto on_error; } } memory_free( error2_sectors ); error2_sectors = NULL; } #if defined( HAVE_VERBOSE_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: error2 section contains no error sectors.\n", function ); } #endif return( total_read_count ); on_error: if( error2_sectors != NULL ) { memory_free( error2_sectors ); } return( -1 ); } /* Writes an error2 section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_error2_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libcdata_range_list_t *acquiry_errors, libcerror_error_t **error ) { ewf_error2_header_t error2_header; uint8_t calculated_checksum_buffer[ 4 ]; ewf_error2_sector_t *error2_sectors = NULL; static char *function = "libewf_section_error2_write"; intptr_t *value = NULL; size64_t section_size = 0; size_t error2_sectors_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint64_t start_sector = 0; uint64_t number_of_sectors = 0; uint32_t calculated_checksum = 0; int error_index = 0; int number_of_errors = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( libcdata_range_list_get_number_of_elements( acquiry_errors, &number_of_errors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from acquiry error range list.", function ); goto on_error; } if( number_of_errors <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of errors value out of bounds.", function ); goto on_error; } error2_sectors_size = sizeof( ewf_error2_sector_t ) * number_of_errors; section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_error2_header_t ) + error2_sectors_size + sizeof( uint32_t ); if( libewf_section_set_values( section, (uint8_t *) "error2", 6, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); goto on_error; } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); goto on_error; } total_write_count += write_count; if( memory_set( &error2_header, 0, sizeof( ewf_error2_header_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear error2 header.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( error2_header.number_of_errors, number_of_errors ); if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &error2_header, sizeof( ewf_error2_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( error2_header.checksum, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &error2_header, sizeof( ewf_error2_header_t ), error ); if( write_count != (ssize_t) sizeof( ewf_error2_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write error2 header.", function ); goto on_error; } total_write_count += write_count; /* TODO EnCase compatible way to handle > 32-bit sector values */ error2_sectors = (ewf_error2_sector_t *) memory_allocate( error2_sectors_size ); if( error2_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create error2 sectors.", function ); goto on_error; } for( error_index = 0; error_index < number_of_errors; error_index++ ) { if( libcdata_range_list_get_range_by_index( acquiry_errors, error_index, &start_sector, &number_of_sectors, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve acquiry error: %d from range list.", function, error_index ); goto on_error; } byte_stream_copy_from_uint32_little_endian( error2_sectors[ error_index ].start_sector, (uint32_t) start_sector ); byte_stream_copy_from_uint32_little_endian( error2_sectors[ error_index ].number_of_sectors, (uint32_t) number_of_sectors ); } write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) error2_sectors, error2_sectors_size, error ); if( write_count != (ssize_t) error2_sectors_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write error2 sectors.", function ); goto on_error; } total_write_count += write_count; if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) error2_sectors, error2_sectors_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( calculated_checksum_buffer, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, calculated_checksum_buffer, sizeof( uint32_t ), error ); if( write_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write error2 sectors checksum.", function ); goto on_error; } total_write_count += write_count; memory_free( error2_sectors ); return( total_write_count ); on_error: if( error2_sectors != NULL ) { memory_free( error2_sectors ); } return( -1 ); } /* Reads a hash section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_hash_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ) { ewf_hash_t hash; static char *function = "libewf_section_hash_read"; size64_t section_data_size = 0; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; int result = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size != (size64_t) sizeof( ewf_hash_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &hash, sizeof( ewf_hash_t ), error ); if( read_count != (ssize_t) sizeof( ewf_hash_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read hash.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: hash data:\n", function ); libcnotify_print_data( (uint8_t *) &hash, sizeof( ewf_hash_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( hash.checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: MD5 hash:\n", function ); libcnotify_print_data( hash.md5_hash, 16, 0 ); libcnotify_printf( "%s: unknown1:\n", function ); libcnotify_print_data( hash.unknown1, 16, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &hash, sizeof( ewf_hash_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); return( -1 ); } result = libewf_section_test_zero( hash.md5_hash, 16, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if MD5 hash is empty.", function ); return( -1 ); } else if( result == 0 ) { if( memory_copy( hash_sections->md5_hash, hash.md5_hash, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash in hash sections.", function ); return( -1 ); } hash_sections->md5_hash_set = 1; } else { hash_sections->md5_hash_set = 0; } return( read_count ); } /* Writes a hash section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_hash_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ) { ewf_hash_t hash; static char *function = "libewf_section_hash_write"; size64_t section_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_hash_t ); if( libewf_section_set_values( section, (uint8_t *) "hash", 4, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); return( -1 ); } total_write_count += write_count; if( memory_set( &hash, 0, sizeof( ewf_hash_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash.", function ); return( -1 ); } if( hash_sections->md5_hash_set != 0 ) { if( memory_copy( hash.md5_hash, hash_sections->md5_hash, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: MD5 hash:\n", function ); libcnotify_print_data( hash.md5_hash, 16, 0 ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &hash, sizeof( ewf_hash_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( hash.checksum, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &hash, sizeof( ewf_hash_t ), error ); if( write_count != (ssize_t) sizeof( ewf_hash_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write hash.", function ); return( -1 ); } total_write_count += write_count; return( total_write_count ); } /* Reads a header section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_header_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_header_sections_t *header_sections, libcerror_error_t **error ) { uint8_t *header = NULL; static char *function = "libewf_section_header_read"; ssize_t read_count = 0; size_t header_size = 0; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } read_count = libewf_section_compressed_string_read( section, file_io_pool, file_io_pool_entry, &header, &header_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read header.", function ); goto on_error; } if( header == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing header.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_byte_stream_print( "Header", header, header_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header.", function ); goto on_error; } } #endif if( header_sections->header == NULL ) { header_sections->header = header; header_sections->header_size = header_size; } else { memory_free( header ); } header_sections->number_of_header_sections += 1; return( read_count ); on_error: if( header != NULL ) { memory_free( header ); } return( -1 ); } /* Writes a header section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_header_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, int8_t compression_level, libcerror_error_t **error ) { static char *function = "libewf_section_header_write"; ssize_t write_count = 0; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_byte_stream_print( "Header", header_sections->header, header_sections->header_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header.", function ); return( -1 ); } } #endif /* Do not include the end of string character in the compressed data */ write_count = libewf_section_write_compressed_string( section, file_io_pool, file_io_pool_entry, (uint8_t *) "header", 6, section_offset, header_sections->header, header_sections->header_size - 1, compression_level, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write compressed string.", function ); return( -1 ); } header_sections->number_of_header_sections += 1; return( write_count ); } /* Reads a header2 section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_header2_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_header_sections_t *header_sections, libcerror_error_t **error ) { uint8_t *header2 = NULL; static char *function = "libewf_section_header2_read"; ssize_t read_count = 0; size_t header2_size = 0; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } read_count = libewf_section_compressed_string_read( section, file_io_pool, file_io_pool_entry, &header2, &header2_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read header2.", function ); goto on_error; } if( header2 == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing header2.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf16_stream_print( "Header2", header2, header2_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header2.", function ); goto on_error; } } #endif if( header_sections->header2 == NULL ) { header_sections->header2 = header2; header_sections->header2_size = header2_size; } else { memory_free( header2 ); } header_sections->number_of_header_sections += 1; return( read_count ); on_error: if( header2 != NULL ) { memory_free( header2 ); } return( -1 ); } /* Writes a header2 section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_header2_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, int8_t compression_level, libcerror_error_t **error ) { static char *function = "libewf_section_header2_write"; ssize_t write_count = 0; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf16_stream_print( "Header2", header_sections->header2, header_sections->header2_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header2.", function ); return( -1 ); } } #endif /* Do not include the end of string character in the compressed data */ write_count = libewf_section_write_compressed_string( section, file_io_pool, file_io_pool_entry, (uint8_t *) "header2", 7, section_offset, header_sections->header2, header_sections->header2_size - 2, compression_level, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write compressed string.", function ); return( -1 ); } header_sections->number_of_header_sections += 1; return( write_count ); } /* Reads a ltree section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_ltree_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t **cached_ltree_data, size_t *cached_ltree_data_size, libcerror_error_t **error ) { ewf_ltree_header_t *ltree_header = NULL; uint8_t *ltree_data = NULL; static char *function = "libewf_section_ltree_read"; size64_t section_data_size = 0; size_t ltree_data_size = 0; ssize_t read_count = 0; ssize_t total_read_count = 0; uint32_t ltree_size = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( cached_ltree_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cached ltree.", function ); return( -1 ); } if( cached_ltree_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cached ltree data size.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size < (size64_t) sizeof( ewf_ltree_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } section_data_size -= sizeof( ewf_ltree_header_t ); ltree_header = memory_allocate_structure( ewf_ltree_header_t ); if( ltree_header == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create ltree header.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) ltree_header, sizeof( ewf_ltree_header_t ), error ); if( read_count != (ssize_t) sizeof( ewf_ltree_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read ltree header.", function ); goto on_error; } total_read_count += read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: ltree header data:\n", function ); libcnotify_print_data( (uint8_t *) ltree_header, sizeof( ewf_ltree_header_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( ltree_header->tree_size, ltree_size ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unknown1:\n", function ); libcnotify_print_data( ltree_header->unknown1, 16, 0 ); libcnotify_printf( "%s: tree size\t\t\t\t\t: %" PRIu32 "\n", function, ltree_size ); libcnotify_printf( "%s: unknown2:\n", function ); libcnotify_print_data( ltree_header->unknown2, 4, 0 ); libcnotify_printf( "%s: unknown3:\n", function ); libcnotify_print_data( ltree_header->unknown3, 4, 0 ); libcnotify_printf( "%s: unknown4:\n", function ); libcnotify_print_data( ltree_header->unknown4, 20, 0 ); } #endif memory_free( ltree_header ); ltree_header = NULL; if( section_data_size < (size64_t) ltree_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } ltree_data_size = (size_t) ltree_size; ltree_data = (uint8_t *) memory_allocate( ltree_data_size ); if( ltree_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create ltree data.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, ltree_data, ltree_data_size, error ); if( read_count != (ssize_t) ltree_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read ltree data.", function ); goto on_error; } total_read_count += read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf16_stream_print( "ltree data", ltree_data, ltree_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print ltree data.", function ); goto on_error; } } #endif if( *cached_ltree_data == NULL ) { *cached_ltree_data = ltree_data; *cached_ltree_data_size = ltree_data_size; } else { memory_free( ltree_data ); } return( total_read_count ); on_error: if( ltree_data != NULL ) { memory_free( ltree_data ); } if( ltree_header != NULL ) { memory_free( ltree_header ); } return( -1 ); } /* Writes a sectors section * Does not write the actual data in the sectors section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_sectors_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, size64_t chunks_data_size, libcerror_error_t **error ) { static char *function = "libewf_section_sectors_write"; size64_t section_size = 0; ssize_t write_count = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + chunks_data_size; if( libewf_section_set_values( section, (uint8_t *) "sectors", 7, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); return( -1 ); } return( write_count ); } /* Reads a session section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_session_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcdata_array_t *sessions, libcdata_array_t *tracks, libcerror_error_t **error ) { ewf_session_header_t session_header; uint8_t stored_checksum_buffer[ 4 ]; ewf_session_entry_t *session_entries = NULL; libewf_sector_range_t *sector_range = NULL; static char *function = "libewf_section_session_read"; size64_t section_data_size = 0; size_t session_entries_size = 0; ssize_t read_count = 0; ssize_t total_read_count = 0; uint32_t calculated_checksum = 0; uint32_t start_sector = 0; uint32_t previous_start_sector = 0; uint32_t previous_type = 0; uint32_t number_of_sectors = 0; uint32_t number_of_sessions_entries = 0; uint32_t session_start_sector = 0; uint32_t sessions_entry_index = 0; uint32_t stored_checksum = 0; uint32_t track_start_sector = 0; uint32_t type = 0; int entry_index = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( sessions == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sessions.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size < (size64_t) sizeof( ewf_session_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } section_data_size -= sizeof( ewf_session_header_t ); read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &session_header, sizeof( ewf_session_header_t ), error ); if( read_count != (ssize_t) sizeof( ewf_session_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read session.", function ); goto on_error; } total_read_count += read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: session header data:\n", function ); libcnotify_print_data( (uint8_t *) &session_header, sizeof( ewf_session_header_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( session_header.number_of_sessions, number_of_sessions_entries ); byte_stream_copy_to_uint32_little_endian( session_header.checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of sessions entries\t\t: %" PRIu32 "\n", function, number_of_sessions_entries ); libcnotify_printf( "%s: unknown1:\n", function ); libcnotify_print_data( session_header.unknown1, 28, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &session_header, sizeof( ewf_session_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } if( number_of_sessions_entries > 0 ) { session_entries_size = sizeof( ewf_session_entry_t ) * number_of_sessions_entries; if( section_data_size < (size64_t) session_entries_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } session_entries = (ewf_session_entry_t *) memory_allocate( session_entries_size ); if( session_entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create session entries.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) session_entries, session_entries_size, error ); if( read_count != (ssize_t) session_entries_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read session entries.", function ); goto on_error; } total_read_count += read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: session entries data:\n", function ); libcnotify_print_data( (uint8_t *) session_entries, session_entries_size, 0 ); } #endif read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, stored_checksum_buffer, sizeof( uint32_t ), error ); if( read_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read checksum.", function ); goto on_error; } total_read_count += read_count; byte_stream_copy_to_uint32_little_endian( stored_checksum_buffer, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: session entries checksum\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) session_entries, session_entries_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } if( libcdata_array_empty( sessions, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } byte_stream_copy_to_uint32_little_endian( ( session_entries[ sessions_entry_index ] ).type, previous_type ); byte_stream_copy_to_uint32_little_endian( ( session_entries[ sessions_entry_index ] ).start_sector, previous_start_sector ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: entry: %02" PRIu32 " type\t\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, previous_type ); libcnotify_printf( "%s: entry: %02" PRIu32 " start sector\t\t\t: 0 (%" PRIu32 ")\n", function, sessions_entry_index, previous_start_sector ); libcnotify_printf( "%s: entry: %02" PRIu32 " unknown2:\n", function, sessions_entry_index ); libcnotify_print_data( ( session_entries[ sessions_entry_index ] ).unknown2, 24, 0 ); } #endif /* Note that EnCase says the first session starts at session 16 * This is either some EnCase specific behavior or the value is used for * other purposes. */ session_start_sector = 0; track_start_sector = 0; for( sessions_entry_index = 1; sessions_entry_index < number_of_sessions_entries; sessions_entry_index++ ) { byte_stream_copy_to_uint32_little_endian( ( session_entries[ sessions_entry_index ] ).type, type ); byte_stream_copy_to_uint32_little_endian( session_entries[ sessions_entry_index ].start_sector, start_sector ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: entry: %02" PRIu32 " type\t\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, type ); libcnotify_printf( "%s: entry: %02" PRIu32 " start sector\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, start_sector ); libcnotify_printf( "%s: entry: %02" PRIu32 " unknown2:\n", function, sessions_entry_index ); libcnotify_print_data( ( session_entries[ sessions_entry_index ] ).unknown2, 24, 0 ); } #endif if( start_sector < previous_start_sector ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid start sector: %" PRIu32 " value out of bounds.", function, start_sector ); goto on_error; } if( type == 0 ) { number_of_sectors = start_sector - session_start_sector; if( libewf_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create session sector range.", function ); goto on_error; } if( libewf_sector_range_set( sector_range, session_start_sector, (uint64_t) number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set session sector range.", function ); goto on_error; } if( libcdata_array_append_entry( sessions, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session sector range to array.", function ); goto on_error; } sector_range = NULL; session_start_sector = start_sector; } if( previous_type == 1 ) { number_of_sectors = start_sector - track_start_sector; if( libewf_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create track sector range.", function ); goto on_error; } if( libewf_sector_range_set( sector_range, track_start_sector, (uint64_t) number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track sector range.", function ); goto on_error; } if( libcdata_array_append_entry( tracks, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track sector range to array.", function ); goto on_error; } sector_range = NULL; track_start_sector = start_sector; } previous_type = type; previous_start_sector = start_sector; } memory_free( session_entries ); session_entries = NULL; if( media_values->number_of_sectors > session_start_sector ) { number_of_sectors = (uint32_t) ( media_values->number_of_sectors - session_start_sector ); } else { number_of_sectors = 0; } if( libewf_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create session sector range.", function ); goto on_error; } if( libewf_sector_range_set( sector_range, session_start_sector, (uint64_t) number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set session sector range.", function ); goto on_error; } if( libcdata_array_append_entry( sessions, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session sector range to array.", function ); goto on_error; } sector_range = NULL; if( type == 1 ) { if( media_values->number_of_sectors > track_start_sector ) { number_of_sectors = (uint32_t) ( media_values->number_of_sectors - track_start_sector ); } else { number_of_sectors = 0; } if( libewf_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create track sector range.", function ); goto on_error; } if( libewf_sector_range_set( sector_range, track_start_sector, (uint64_t) number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track sector range.", function ); goto on_error; } if( libcdata_array_append_entry( tracks, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track sector range to array.", function ); goto on_error; } sector_range = NULL; } } #if defined( HAVE_VERBOSE_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: session section contains no entries.\n", function ); } #endif return( total_read_count ); on_error: if( sector_range != NULL ) { libewf_sector_range_free( §or_range, NULL ); } if( session_entries != NULL ) { memory_free( session_entries ); } return( -1 ); } /* Writes a session section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_session_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libcdata_array_t *sessions, libcdata_array_t *tracks, libcerror_error_t **error ) { ewf_session_header_t session_header; uint8_t calculated_checksum_buffer[ 4 ]; ewf_session_entry_t *session_entries = NULL; libewf_sector_range_t *sector_range = NULL; static char *function = "libewf_section_session_write"; size64_t section_size = 0; size_t session_entries_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint64_t current_sector = 0; uint64_t session_start_sector = 0; uint64_t session_last_sector = 0; uint64_t session_number_of_sectors = 0; uint64_t track_start_sector = 0; uint64_t track_last_sector = 0; uint64_t track_number_of_sectors = 0; uint32_t calculated_checksum = 0; int number_of_sessions = 0; int number_of_sessions_entries = 0; int number_of_tracks = 0; int session_index = 0; int sessions_entry_index = 0; int track_index = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( sessions, &number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from sessions array.", function ); goto on_error; } if( number_of_sessions < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of sessions value out of bounds.", function ); goto on_error; } if( libcdata_array_get_number_of_entries( tracks, &number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from tracks array.", function ); goto on_error; } if( number_of_tracks < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of tracks value out of bounds.", function ); goto on_error; } if( ( number_of_sessions != 0 ) && ( number_of_tracks == 0 ) ) { number_of_sessions_entries = number_of_sessions; } else if( ( number_of_sessions == 0 ) && ( number_of_tracks != 0 ) ) { number_of_sessions_entries = number_of_tracks; } else if( ( number_of_sessions != 0 ) && ( number_of_tracks != 0 ) ) { /* Encase does not store sessions containing tracks * therefore the number of sessions entries needs to be determined * from the run-time tracks and session information */ do { if( ( session_index < number_of_sessions ) && ( current_sector >= session_last_sector ) ) { if( libcdata_array_get_entry_by_index( sessions, session_index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session sector range: %d from array.", function, session_index ); goto on_error; } if( libewf_sector_range_get( sector_range, &session_start_sector, &session_number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %d sector range.", function, session_index ); goto on_error; } session_last_sector = session_start_sector + session_number_of_sectors; session_index++; } if( ( track_index < number_of_tracks ) && ( current_sector >= track_last_sector ) ) { if( libcdata_array_get_entry_by_index( tracks, track_index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track sector range: %d from array.", function, track_index ); goto on_error; } if( libewf_sector_range_get( sector_range, &track_start_sector, &track_number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %d sector range.", function, track_index ); goto on_error; } track_last_sector = track_start_sector + track_number_of_sectors; track_index++; } if( ( number_of_tracks > 0 ) && ( current_sector >= track_start_sector ) && ( current_sector < track_last_sector ) ) { number_of_sessions_entries++; current_sector = track_last_sector; } else if( ( number_of_sessions > 0 ) && ( current_sector >= session_start_sector ) && ( current_sector < session_last_sector ) ) { if( ( track_last_sector == 0 ) || ( track_last_sector < session_start_sector ) ) { number_of_sessions_entries++; } current_sector = session_last_sector; } } while( ( session_index < number_of_sessions ) || ( track_index < number_of_tracks ) ); } if( number_of_sessions_entries == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of sessions entries value out of bounds.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of sessions entries\t\t: %" PRIu32 "\n", function, number_of_sessions_entries ); libcnotify_printf( "\n" ); } #endif session_entries_size = sizeof( ewf_session_entry_t ) * number_of_sessions_entries; section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_session_header_t ) + session_entries_size + sizeof( uint32_t ); if( libewf_section_set_values( section, (uint8_t *) "session", 7, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); goto on_error; } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); goto on_error; } total_write_count += write_count; if( memory_set( &session_header, 0, sizeof( ewf_session_header_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear session header.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( session_header.number_of_sessions, (uint32_t) number_of_sessions_entries ); if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &session_header, sizeof( ewf_session_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( session_header.checksum, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &session_header, sizeof( ewf_session_header_t ), error ); if( write_count != (ssize_t) sizeof( ewf_session_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write session header.", function ); goto on_error; } total_write_count += write_count; session_entries = (ewf_session_entry_t *) memory_allocate( session_entries_size ); if( session_entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create session entries.", function ); goto on_error; } if( memory_set( session_entries, 0, session_entries_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear sessions entries.", function ); goto on_error; } current_sector = 0; session_start_sector = 0; session_index = 0; session_last_sector = 0; track_start_sector = 0; track_index = 0; track_last_sector = 0; do { if( ( session_index < number_of_sessions ) && ( current_sector >= session_last_sector ) ) { if( libcdata_array_get_entry_by_index( sessions, session_index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session sector range: %d from array.", function, session_index ); goto on_error; } if( libewf_sector_range_get( sector_range, &session_start_sector, &session_number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %d sector range.", function, session_index ); goto on_error; } session_last_sector = session_start_sector + session_number_of_sectors; session_index++; } if( ( track_index < number_of_tracks ) && ( current_sector >= track_last_sector ) ) { if( libcdata_array_get_entry_by_index( tracks, track_index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track sector range: %d from array.", function, track_index ); goto on_error; } if( libewf_sector_range_get( sector_range, &track_start_sector, &track_number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %d sector range.", function, track_index ); goto on_error; } track_last_sector = track_start_sector + track_number_of_sectors; track_index++; } if( ( number_of_tracks > 0 ) && ( current_sector >= track_start_sector ) && ( current_sector < track_last_sector ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: entry: %02" PRIu32 " type\t\t\t\t: 1\n", function, sessions_entry_index ); libcnotify_printf( "%s: entry: %02" PRIu32 " start sector\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, track_start_sector ); libcnotify_printf( "%s: entry: %02" PRIu32 " last sector\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, track_last_sector ); libcnotify_printf( "\n" ); } #endif /* Note that EnCase says the first track starts at sector 16 * This is either some EnCase specific behavior or the value is used for * other purposes. */ if( ( sessions_entry_index == 0 ) && ( track_start_sector == 0 ) ) { track_start_sector = 16; } byte_stream_copy_from_uint32_little_endian( ( session_entries[ sessions_entry_index ] ).type, 1 ); byte_stream_copy_from_uint32_little_endian( ( session_entries[ sessions_entry_index ] ).start_sector, (uint32_t) track_start_sector ); sessions_entry_index++; current_sector = track_last_sector; } else if( ( number_of_sessions > 0 ) && ( current_sector >= session_start_sector ) && ( current_sector < session_last_sector ) ) { if( ( track_last_sector == 0 ) || ( track_last_sector < session_start_sector ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: entry: %02" PRIu32 " type\t\t\t\t: 0\n", function, sessions_entry_index ); libcnotify_printf( "%s: entry: %02" PRIu32 " start sector\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, session_start_sector ); libcnotify_printf( "%s: entry: %02" PRIu32 " last sector\t\t\t: %" PRIu32 "\n", function, sessions_entry_index, session_last_sector ); libcnotify_printf( "\n" ); } #endif /* Note that EnCase says the first session starts at sector 16 * This is either some EnCase specific behavior or the value is used for * other purposes. */ if( ( sessions_entry_index == 0 ) && ( session_start_sector == 0 ) ) { session_start_sector = 16; } byte_stream_copy_from_uint32_little_endian( ( session_entries[ sessions_entry_index ] ).start_sector, (uint32_t) session_start_sector ); sessions_entry_index++; } current_sector = session_last_sector; } if( sessions_entry_index >= number_of_sessions_entries ) { break; } } while( ( session_index < number_of_sessions ) || ( track_index < number_of_tracks ) ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) session_entries, session_entries_size, error ); if( write_count != (ssize_t) session_entries_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write session entries.", function ); goto on_error; } total_write_count += write_count; if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) session_entries, session_entries_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( calculated_checksum_buffer, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, calculated_checksum_buffer, sizeof( uint32_t ), error ); if( write_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write session entries checksum.", function ); goto on_error; } total_write_count += write_count; memory_free( session_entries ); return( total_write_count ); on_error: if( session_entries != NULL ) { memory_free( session_entries ); } return( -1 ); } /* Reads a table section header * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_table_header_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t format LIBEWF_ATTRIBUTE_UNUSED, uint32_t *number_of_offsets, uint64_t *base_offset, libcerror_error_t **error ) { ewf_table_header_t table_header; static char *function = "libewf_section_table_header_read"; size64_t section_data_size = 0; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; LIBEWF_UNREFERENCED_PARAMETER( format ) if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( number_of_offsets == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of offsets.", function ); return( -1 ); } if( base_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base offset.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size < (size64_t) sizeof( ewf_table_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &table_header, sizeof( ewf_table_header_t ), error ); if( read_count != (ssize_t) sizeof( ewf_table_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read table header.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: table header:\n", function ); libcnotify_print_data( (uint8_t *) &table_header, sizeof( ewf_table_header_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( table_header.number_of_offsets, *number_of_offsets ); byte_stream_copy_to_uint64_little_endian( table_header.base_offset, *base_offset ); byte_stream_copy_to_uint32_little_endian( table_header.checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of offsets\t\t\t: %" PRIu32 "\n", function, *number_of_offsets ); libcnotify_printf( "%s: padding1:\n", function ); libcnotify_print_data( table_header.padding1, 4, 0 ); libcnotify_printf( "%s: base offset\t\t\t\t: 0x%08" PRIx64 "\n", function, *base_offset ); libcnotify_printf( "%s: padding2:\n", function ); libcnotify_print_data( table_header.padding2, 4, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &table_header, sizeof( ewf_table_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); return( -1 ); } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( *number_of_offsets == 0 ) { libcnotify_printf( "%s: table contains no offsets.\n", function ); } else if( ( ( format != LIBEWF_FORMAT_ENCASE6 ) && ( *number_of_offsets > EWF_MAXIMUM_OFFSETS_IN_TABLE ) ) || ( ( format == LIBEWF_FORMAT_ENCASE6 ) && ( *number_of_offsets > EWF_MAXIMUM_OFFSETS_IN_TABLE_ENCASE6 ) ) ) { libcnotify_printf( "%s: number of offsets: %" PRIu32 " exceeds maximum: %d.\n", function, *number_of_offsets, EWF_MAXIMUM_OFFSETS_IN_TABLE ); } } #endif return( read_count ); } /* Writes a table or table2 section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_table_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t *type_string, size_t type_string_length, off64_t section_offset, off64_t base_offset, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, size64_t chunks_data_size, uint8_t ewf_format, libcerror_error_t **error ) { ewf_table_header_t table_header; uint8_t calculated_checksum_buffer[ 4 ]; static char *function = "libewf_section_table_write"; size64_t section_size = 0; size_t table_offsets_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; uint8_t write_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( type_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type string.", function ); return( -1 ); } if( base_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid base offset value less than zero.", function ); return( -1 ); } if( table_offsets == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table offsets.", function ); return( -1 ); } table_offsets_size = sizeof( ewf_table_offset_t ) * number_of_offsets; section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_table_header_t ) + table_offsets_size + chunks_data_size; if( ewf_format != EWF_FORMAT_S01 ) { write_checksum = 1; section_size += sizeof( uint32_t ); } if( libewf_section_set_values( section, type_string, type_string_length, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start: %s.", function, (char *) type_string ); return( -1 ); } total_write_count += write_count; if( memory_set( &table_header, 0, sizeof( ewf_table_header_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear table header.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( table_header.number_of_offsets, number_of_offsets ); byte_stream_copy_from_uint64_little_endian( table_header.base_offset, base_offset ); if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &table_header, sizeof( ewf_table_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( table_header.checksum, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &table_header, sizeof( ewf_table_header_t ), error ); if( write_count != (ssize_t) sizeof( ewf_table_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write table header.", function ); return( -1 ); } total_write_count += write_count; write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) table_offsets, table_offsets_size, error ); if( write_count != (ssize_t) table_offsets_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write table offsets.", function ); return( -1 ); } total_write_count += write_count; if( write_checksum != 0 ) { if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) table_offsets, table_offsets_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( calculated_checksum_buffer, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, calculated_checksum_buffer, sizeof( uint32_t ), error ); if( write_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write table offsets checksum.", function ); return( -1 ); } total_write_count += write_count; } return( total_write_count ); } /* Reads a volume section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_volume_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ) { static char *function = "libewf_section_volume_read"; ssize_t read_count = 0; size64_t bytes_per_chunk = 0; size64_t section_data_size = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( ( section_data_size != (size64_t) sizeof( ewf_volume_t ) ) && ( section_data_size != (size64_t) sizeof( ewf_volume_smart_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } if( section_data_size == (size64_t) sizeof( ewf_volume_t ) ) { read_count = libewf_section_volume_e01_read( section, io_handle, file_io_pool, file_io_pool_entry, media_values, error ); if( read_count != (ssize_t) section_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read EWF-E01 volume section.", function ); return( -1 ); } } else if( section_data_size == (size64_t) sizeof( ewf_volume_smart_t ) ) { read_count = libewf_section_volume_s01_read( section, io_handle, file_io_pool, file_io_pool_entry, media_values, error ); if( read_count != (ssize_t) section_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read EWF-S01 volume section.", function ); return( -1 ); } } if( media_values->number_of_chunks > (uint32_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of chunks value exceeds maximum.", function ); return( -1 ); } if( media_values->sectors_per_chunk > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sectors per chunk value exceeds maximum.", function ); return( -1 ); } if( media_values->bytes_per_sector > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid bytes per sector value exceeds maximum.", function ); return( -1 ); } bytes_per_chunk = (size64_t) media_values->sectors_per_chunk * (size64_t) media_values->bytes_per_sector; if( bytes_per_chunk > (size64_t) INT32_MAX ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk size value exceeds maximum defaulting to: %d.\n", function, EWF_MINIMUM_CHUNK_SIZE ); } #endif bytes_per_chunk = (size64_t) EWF_MINIMUM_CHUNK_SIZE; } media_values->chunk_size = (uint32_t) bytes_per_chunk; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: volume has %" PRIu32 " chunks of %" PRIi32 " bytes (%" PRIi32 " sectors) each.\n", function, media_values->number_of_chunks, media_values->chunk_size, media_values->sectors_per_chunk ); libcnotify_printf( "%s: volume has %" PRIu64 " sectors of %" PRIi32 " bytes each.\n", function, media_values->number_of_sectors, media_values->bytes_per_sector ); } #endif return( read_count ); } /* Reads an EWF-E01 (EnCase) volume section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_volume_e01_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ) { ewf_volume_t *volume = NULL; static char *function = "libewf_io_handle_read_volume_e01_section"; size64_t section_data_size = 0; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; #if defined( HAVE_DEBUG_OUTPUT ) uint32_t value_32bit = 0; #endif if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size != (size64_t) sizeof( ewf_volume_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } volume = memory_allocate_structure( ewf_volume_t ); if( volume == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to read volume.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) volume, sizeof( ewf_volume_t ), error ); if( read_count != (ssize_t) sizeof( ewf_volume_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read volume.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: volume data:\n", function ); libcnotify_print_data( (uint8_t *) volume, sizeof( ewf_volume_t ), 0 ); } #endif media_values->media_type = volume->media_type; byte_stream_copy_to_uint32_little_endian( volume->number_of_chunks, media_values->number_of_chunks ); byte_stream_copy_to_uint32_little_endian( volume->sectors_per_chunk, media_values->sectors_per_chunk ); byte_stream_copy_to_uint32_little_endian( volume->bytes_per_sector, media_values->bytes_per_sector ); byte_stream_copy_to_uint64_little_endian( volume->number_of_sectors, media_values->number_of_sectors ); media_values->media_flags = volume->media_flags; io_handle->compression_level = (int8_t) volume->compression_level; byte_stream_copy_to_uint32_little_endian( volume->error_granularity, media_values->error_granularity ); if( memory_copy( media_values->guid, volume->guid, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set GUID.", function ); goto on_error; } byte_stream_copy_to_uint32_little_endian( volume->checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: media type\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_type ); libcnotify_printf( "%s: unknown1:\n", function ); libcnotify_print_data( volume->unknown1, 3, 0 ); libcnotify_printf( "%s: number of chunks\t\t: %" PRIu32 "\n", function, media_values->number_of_chunks ); libcnotify_printf( "%s: sectors per chunk\t\t: %" PRIu32 "\n", function, media_values->sectors_per_chunk ); libcnotify_printf( "%s: bytes per sector\t\t: %" PRIu32 "\n", function, media_values->bytes_per_sector ); libcnotify_printf( "%s: number of sectors\t\t: %" PRIu64 "\n", function, media_values->number_of_sectors ); byte_stream_copy_to_uint32_little_endian( volume->chs_cylinders, value_32bit ); libcnotify_printf( "%s: CHS number of cylinders\t: %" PRIu32 "\n", function, value_32bit ); byte_stream_copy_to_uint32_little_endian( volume->chs_heads, value_32bit ); libcnotify_printf( "%s: CHS number of heads\t\t: %" PRIu32 "\n", function, value_32bit ); byte_stream_copy_to_uint32_little_endian( volume->chs_sectors, value_32bit ); libcnotify_printf( "%s: CHS number of sectors\t\t: %" PRIu32 "\n", function, value_32bit ); libcnotify_printf( "%s: media flags\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_flags ); libcnotify_printf( "%s: unknown2:\n", function ); libcnotify_print_data( volume->unknown2, 3, 0 ); byte_stream_copy_to_uint32_little_endian( volume->palm_volume_start_sector, value_32bit ); libcnotify_printf( "%s: PALM volume start sector\t: %" PRIu32 "\n", function, value_32bit ); libcnotify_printf( "%s: unknown3:\n", function ); libcnotify_print_data( volume->unknown3, 4, 0 ); byte_stream_copy_to_uint32_little_endian( volume->smart_logs_start_sector, value_32bit ); libcnotify_printf( "%s: SMART logs start sector\t: %" PRIu32 "\n", function, value_32bit ); libcnotify_printf( "%s: compression level\t\t: 0x%02" PRIx8 "\n", function, io_handle->compression_level ); libcnotify_printf( "%s: unknown4:\n", function ); libcnotify_print_data( volume->unknown4, 3, 0 ); libcnotify_printf( "%s: error granularity\t\t: %" PRIu32 "\n", function, media_values->error_granularity ); libcnotify_printf( "%s: unknown5:\n", function ); libcnotify_print_data( volume->unknown5, 4, 0 ); libcnotify_printf( "%s: GUID:\n", function ); libcnotify_print_data( volume->guid, 16, 0 ); libcnotify_printf( "%s: unknown6:\n", function ); libcnotify_print_data( volume->unknown6, 963, 0 ); libcnotify_printf( "%s: signature:\n", function ); libcnotify_print_data( volume->signature, 5, 0 ); libcnotify_printf( "%s: checksum\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) volume, sizeof( ewf_volume_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } memory_free( volume ); if( media_values->media_type == LIBEWF_MEDIA_TYPE_SINGLE_FILES ) { io_handle->ewf_format = EWF_FORMAT_L01; } else { io_handle->ewf_format = EWF_FORMAT_E01; } return( read_count ); on_error: if( volume != NULL ) { memory_free( volume ); } return( -1 ); } /* Writes an EWF-E01 (EnCase) volume section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_volume_e01_write( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_media_values_t *media_values, libcerror_error_t **error ) { ewf_volume_t *volume = NULL; static char *function = "libewf_section_volume_e01_write"; size64_t section_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_volume_t ); if( libewf_section_set_values( section, (uint8_t *) "volume", 6, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); goto on_error; } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); goto on_error; } total_write_count += write_count; volume = memory_allocate_structure( ewf_volume_t ); if( volume == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create volume.", function ); goto on_error; } if( memory_set( volume, 0, sizeof( ewf_volume_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear volume.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: media type\t\t\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_type ); libcnotify_printf( "%s: number of chunks\t\t\t\t: %" PRIu32 "\n", function, media_values->number_of_chunks ); libcnotify_printf( "%s: sectors per chunk\t\t\t\t: %" PRIu32 "\n", function, media_values->sectors_per_chunk ); libcnotify_printf( "%s: bytes per sector\t\t\t\t: %" PRIu32 "\n", function, media_values->bytes_per_sector ); libcnotify_printf( "%s: number of sectors\t\t: %" PRIu64 "\n", function, media_values->number_of_sectors ); libcnotify_printf( "%s: media flags\t\t\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_flags ); libcnotify_printf( "%s: compression level\t\t\t\t: 0x%02" PRIx8 "\n", function, io_handle->compression_level ); libcnotify_printf( "%s: error granularity\t\t\t\t: %" PRIu32 "\n", function, media_values->error_granularity ); libcnotify_printf( "%s: GUID:\n", function ); libcnotify_print_data( media_values->guid, 16, 0 ); libcnotify_printf( "\n" ); } #endif volume->media_type = media_values->media_type; volume->media_flags = media_values->media_flags; byte_stream_copy_from_uint32_little_endian( volume->number_of_chunks, media_values->number_of_chunks ); byte_stream_copy_from_uint32_little_endian( volume->sectors_per_chunk, media_values->sectors_per_chunk ); byte_stream_copy_from_uint32_little_endian( volume->bytes_per_sector, media_values->bytes_per_sector ); byte_stream_copy_from_uint64_little_endian( volume->number_of_sectors, media_values->number_of_sectors ); if( ( io_handle->format == LIBEWF_FORMAT_ENCASE5 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN5 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN6 ) || ( io_handle->format == LIBEWF_FORMAT_EWFX ) ) { volume->compression_level = (uint8_t) io_handle->compression_level; if( memory_copy( volume->guid, media_values->guid, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set GUID.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( volume->error_granularity, media_values->error_granularity ); } if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) volume, sizeof( ewf_volume_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( volume->checksum, calculated_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: volume has %" PRIu32 " chunks of %" PRIi32 " bytes (%" PRIi32 " sectors) each.\n", function, media_values->number_of_chunks, media_values->chunk_size, media_values->sectors_per_chunk ); libcnotify_printf( "%s: volume has %" PRIu64 " sectors of %" PRIi32 " bytes each.\n", function, media_values->number_of_sectors, media_values->bytes_per_sector ); } #endif write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) volume, sizeof( ewf_volume_t ), error ); if( write_count != (ssize_t) sizeof( ewf_volume_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write volume.", function ); goto on_error; } total_write_count += write_count; memory_free( volume ); return( total_write_count ); on_error: if( volume != NULL ) { memory_free( volume ); } return( -1 ); } /* Reads an EWF-S01 (SMART) volume section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_volume_s01_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ) { ewf_volume_smart_t *volume = NULL; static char *function = "libewf_io_handle_read_volume_s01_section"; size64_t section_data_size = 0; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size != (size64_t) sizeof( ewf_volume_smart_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); goto on_error; } volume = memory_allocate_structure( ewf_volume_smart_t ); if( volume == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create volume.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) volume, sizeof( ewf_volume_smart_t ), error ); if( read_count != (ssize_t) sizeof( ewf_volume_smart_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read volume.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: volume data:\n", function ); libcnotify_print_data( (uint8_t *) volume, sizeof( ewf_volume_smart_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( volume->number_of_chunks, media_values->number_of_chunks ); byte_stream_copy_to_uint32_little_endian( volume->sectors_per_chunk, media_values->sectors_per_chunk ); byte_stream_copy_to_uint32_little_endian( volume->bytes_per_sector, media_values->bytes_per_sector ); byte_stream_copy_to_uint32_little_endian( volume->number_of_sectors, media_values->number_of_sectors ); byte_stream_copy_to_uint32_little_endian( volume->checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unknown1:\n", function ); libcnotify_print_data( volume->unknown1, 4, 0 ); libcnotify_printf( "%s: number of chunks\t\t: %" PRIu32 "\n", function, media_values->number_of_chunks ); libcnotify_printf( "%s: sectors per chunk\t\t: %" PRIu32 "\n", function, media_values->sectors_per_chunk ); libcnotify_printf( "%s: bytes per sector\t\t: %" PRIu32 "\n", function, media_values->bytes_per_sector ); libcnotify_printf( "%s: number of sectors\t\t: %" PRIu64 "\n", function, media_values->number_of_sectors ); libcnotify_printf( "%s: unknown2:\n", function ); libcnotify_print_data( volume->unknown2, 20, 0 ); libcnotify_printf( "%s: unknown3:\n", function ); libcnotify_print_data( volume->unknown3, 45, 0 ); libcnotify_printf( "%s: signature:\n", function ); libcnotify_print_data( volume->signature, 5, 0 ); libcnotify_printf( "%s: checksum\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( memory_compare( (void *) volume->signature, (void *) "SMART", 5 ) == 0 ) { io_handle->format = LIBEWF_FORMAT_SMART; } else { io_handle->format = LIBEWF_FORMAT_EWF; } if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) volume, sizeof( ewf_volume_smart_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); goto on_error; } memory_free( volume ); io_handle->ewf_format = EWF_FORMAT_S01; return( read_count ); on_error: if( volume != NULL ) { memory_free( volume ); } return( -1 ); } /* Writes an EWF-S01 (SMART) volume section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_volume_s01_write( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_media_values_t *media_values, libcerror_error_t **error ) { ewf_volume_smart_t *volume = NULL; static char *function = "libewf_section_volume_s01_write"; size64_t section_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + sizeof( ewf_volume_smart_t ); if( libewf_section_set_values( section, (uint8_t *) "volume", 6, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); goto on_error; } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); goto on_error; } total_write_count += write_count; volume = memory_allocate_structure( ewf_volume_smart_t ); if( volume == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create volume.", function ); goto on_error; } if( memory_set( volume, 0, sizeof( ewf_volume_smart_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear volume.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: media type\t\t\t\t\t: 0x%02" PRIx8 "\n", function, media_values->media_type ); libcnotify_printf( "%s: number of chunks\t\t\t\t: %" PRIu32 "\n", function, media_values->number_of_chunks ); libcnotify_printf( "%s: sectors per chunk\t\t\t\t: %" PRIu32 "\n", function, media_values->sectors_per_chunk ); libcnotify_printf( "%s: bytes per sector\t\t\t\t: %" PRIu32 "\n", function, media_values->bytes_per_sector ); libcnotify_printf( "%s: number of sectors\t\t\t\t: %" PRIu64 "\n", function, media_values->number_of_sectors ); libcnotify_printf( "\n" ); } #endif volume->unknown1[ 0 ] = 1; byte_stream_copy_from_uint32_little_endian( volume->number_of_chunks, media_values->number_of_chunks ); byte_stream_copy_from_uint32_little_endian( volume->sectors_per_chunk, media_values->sectors_per_chunk ); byte_stream_copy_from_uint32_little_endian( volume->bytes_per_sector, media_values->bytes_per_sector ); byte_stream_copy_from_uint32_little_endian( volume->number_of_sectors, media_values->number_of_sectors ); if( io_handle->format == LIBEWF_FORMAT_SMART ) { volume->signature[ 0 ] = (uint8_t) 'S'; volume->signature[ 1 ] = (uint8_t) 'M'; volume->signature[ 2 ] = (uint8_t) 'A'; volume->signature[ 3 ] = (uint8_t) 'R'; volume->signature[ 4 ] = (uint8_t) 'T'; } if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) volume, sizeof( ewf_volume_smart_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); goto on_error; } byte_stream_copy_from_uint32_little_endian( volume->checksum, calculated_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: volume has %" PRIu32 " chunks of %" PRIi32 " bytes (%" PRIi32 " sectors) each.\n", function, media_values->number_of_chunks, media_values->chunk_size, media_values->sectors_per_chunk ); libcnotify_printf( "%s: volume has %" PRIu64 " sectors of %" PRIi32 " bytes each.\n", function, media_values->number_of_sectors, media_values->bytes_per_sector ); } #endif write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) volume, sizeof( ewf_volume_smart_t ), error ); if( write_count != (ssize_t) sizeof( ewf_volume_smart_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write volume.", function ); goto on_error; } total_write_count += write_count; memory_free( volume ); return( total_write_count ); on_error: if( volume != NULL ) { memory_free( volume ); } return( -1 ); } /* Reads a xhash section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_xhash_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ) { uint8_t *xhash = NULL; static char *function = "libewf_section_xhash_read"; ssize_t read_count = 0; size_t xhash_size = 0; if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } read_count = libewf_section_compressed_string_read( section, file_io_pool, file_io_pool_entry, &xhash, &xhash_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read xhash.", function ); goto on_error; } if( xhash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing xhash.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf8_stream_print( "XHash", xhash, xhash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print xhash.", function ); goto on_error; } } #endif if( hash_sections->xhash == NULL ) { hash_sections->xhash = xhash; hash_sections->xhash_size = xhash_size; } else { memory_free( xhash ); } return( read_count ); on_error: if( xhash != NULL ) { memory_free( xhash ); } return( -1 ); } /* Writes a xhash section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_xhash_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_hash_sections_t *hash_sections, int8_t compression_level, libcerror_error_t **error ) { static char *function = "libewf_section_xhash_write"; ssize_t write_count = 0; if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf8_stream_print( "XHash", hash_sections->xhash, hash_sections->xhash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print xhash.", function ); return( -1 ); } } #endif /* Do not include the end of string character in the compressed data */ write_count = libewf_section_write_compressed_string( section, file_io_pool, file_io_pool_entry, (uint8_t *) "xhash", 5, section_offset, hash_sections->xhash, hash_sections->xhash_size - 1, compression_level, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write compressed string.", function ); return( -1 ); } return( write_count ); } /* Reads a xheader section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_xheader_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_header_sections_t *header_sections, libcerror_error_t **error ) { uint8_t *xheader = NULL; static char *function = "libewf_section_xheader_read"; ssize_t read_count = 0; size_t xheader_size = 0; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } read_count = libewf_section_compressed_string_read( section, file_io_pool, file_io_pool_entry, &xheader, &xheader_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read xheader.", function ); goto on_error; } if( xheader == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing xheader.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf8_stream_print( "XHeader", xheader, xheader_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print xheader.", function ); goto on_error; } } #endif if( header_sections->xheader == NULL ) { header_sections->xheader = xheader; header_sections->xheader_size = xheader_size; } else { memory_free( xheader ); } header_sections->number_of_header_sections += 1; return( read_count ); on_error: if( xheader != NULL ) { memory_free( xheader ); } return( -1 ); } /* Writes a xheader section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_xheader_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, int8_t compression_level, libcerror_error_t **error ) { static char *function = "libewf_section_xheader_write"; ssize_t write_count = 0; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libewf_debug_utf8_stream_print( "XHeader", header_sections->xheader, header_sections->xheader_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print xheader.", function ); return( -1 ); } } #endif /* Do not include the end of string character in the compressed data */ write_count = libewf_section_write_compressed_string( section, file_io_pool, file_io_pool_entry, (uint8_t *) "xheader", 7, section_offset, header_sections->xheader, header_sections->xheader_size - 1, compression_level, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write compressed string.", function ); return( -1 ); } header_sections->number_of_header_sections += 1; return( write_count ); } /* Reads a delta chunk section * Returns the number of bytes read or -1 on error */ ssize_t libewf_section_delta_chunk_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint32_t *chunk_index, uint32_t *chunk_size, libcerror_error_t **error ) { ewfx_delta_chunk_header_t delta_chunk_header; static char *function = "libewf_section_delta_chunk_read"; size64_t section_data_size = 0; ssize_t read_count = 0; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( chunk_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk index.", function ); return( -1 ); } if( chunk_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk size.", function ); return( -1 ); } section_data_size = section->size - sizeof( ewf_section_start_t ); if( section_data_size < (size64_t) sizeof( ewfx_delta_chunk_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } section_data_size -= sizeof( ewfx_delta_chunk_header_t ); if( section_data_size > (size64_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section size value out of bounds.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &delta_chunk_header, sizeof( ewfx_delta_chunk_header_t ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read delta chunk header.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: delta chunk header data:\n", function ); libcnotify_print_data( (uint8_t *) &delta_chunk_header, sizeof( ewfx_delta_chunk_header_t ), 0 ); } #endif byte_stream_copy_to_uint32_little_endian( delta_chunk_header.chunk, *chunk_index ); byte_stream_copy_to_uint32_little_endian( delta_chunk_header.chunk_size, *chunk_size ); byte_stream_copy_to_uint32_little_endian( delta_chunk_header.checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk\t\t\t\t\t: %" PRIu32 "\n", function, *chunk_index ); libcnotify_printf( "%s: chunk size\t\t\t\t: %" PRIu32 "\n", function, *chunk_size ); libcnotify_printf( "%s: padding:\n", function ); libcnotify_print_data( delta_chunk_header.padding, 6, 0 ); libcnotify_printf( "%s: checksum\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &delta_chunk_header, sizeof( ewfx_delta_chunk_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: %" PRIu32 " calculated: %" PRIu32 ").", function, stored_checksum, calculated_checksum ); return( -1 ); } if( *chunk_index == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_INVALID_DATA, "%s: invalid chunk.", function ); return( -1 ); } /* The chunk value is stored as + 1 in the file */ *chunk_index -= 1; if( (size64_t) *chunk_size != section_data_size ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk size: %" PRIu32 " does not match size of data in section correcting in: %" PRIu64 ".\n", function, *chunk_size, section_data_size ); } #endif *chunk_size = (uint32_t) section_data_size; } return( read_count ); } /* Writes a delta chunk section * Returns the number of bytes written or -1 on error */ ssize_t libewf_section_delta_chunk_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, uint32_t chunk_index, uint8_t *chunk_buffer, uint32_t chunk_size, uint8_t *checksum_buffer, uint32_t *chunk_checksum, uint8_t write_checksum, libcerror_error_t **error ) { ewfx_delta_chunk_header_t delta_chunk_header; static char *function = "libewf_section_delta_chunk_write"; size64_t section_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t calculated_checksum = 0; uint32_t write_size = 0; if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( ( chunk_index + 1 ) > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( chunk_size > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk size value exceeds maximum.", function ); return( -1 ); } write_size = chunk_size; if( write_checksum != 0 ) { write_size += sizeof( uint32_t ); } if( write_size > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid write size value out of bounds.", function ); return( -1 ); } section_size = sizeof( ewf_section_start_t ) + sizeof( ewfx_delta_chunk_header_t ) + write_size; if( libewf_section_set_values( section, (uint8_t *) "delta_chunk", 11, section_offset, section_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set section values.", function ); return( -1 ); } write_count = libewf_section_start_write( section, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_section_start_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write section start.", function ); return( -1 ); } total_write_count += write_count; if( memory_set( &delta_chunk_header, 0, sizeof( ewfx_delta_chunk_header_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear delta chunk header.", function ); return( -1 ); } /* The chunk number is stored as + 1 in the file */ chunk_index += 1; byte_stream_copy_from_uint32_little_endian( delta_chunk_header.chunk, chunk_index ); byte_stream_copy_from_uint32_little_endian( delta_chunk_header.chunk_size, write_size ); delta_chunk_header.padding[ 0 ] = (uint8_t) 'D'; delta_chunk_header.padding[ 1 ] = (uint8_t) 'E'; delta_chunk_header.padding[ 2 ] = (uint8_t) 'L'; delta_chunk_header.padding[ 3 ] = (uint8_t) 'T'; delta_chunk_header.padding[ 4 ] = (uint8_t) 'A'; if( libewf_checksum_calculate_adler32( &calculated_checksum, (uint8_t *) &delta_chunk_header, sizeof( ewfx_delta_chunk_header_t ) - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( delta_chunk_header.checksum, calculated_checksum ); write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &delta_chunk_header, sizeof( ewfx_delta_chunk_header_t ), error ); if( write_count != (ssize_t) sizeof( ewfx_delta_chunk_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write chunk value.", function ); return( -1 ); } total_write_count += write_count; write_size = chunk_size; if( write_checksum != 0 ) { if( checksum_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid checksum buffer.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( checksum_buffer, *chunk_checksum ); if( checksum_buffer == &( chunk_buffer[ chunk_size ] ) ) { write_size += sizeof( uint32_t ); write_checksum = 0; } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( write_checksum == 0 ) { byte_stream_copy_to_uint32_little_endian( &( chunk_buffer[ chunk_size - sizeof( uint32_t ) ] ), calculated_checksum ); } else { calculated_checksum = *chunk_checksum; } libcnotify_printf( "%s: writing uncompressed delta chunk: %" PRIu32 " at offset: %" PRIi64 " with size: %" PRIzu ", with checksum: 0x%08" PRIx32 ".\n", function, chunk_index - 1, section_offset + total_write_count, chunk_size, calculated_checksum ); } #endif write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, chunk_buffer, (size_t) write_size, error ); if( write_count != (ssize_t) write_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write chunk data.", function ); return( -1 ); } total_write_count += write_count; if( write_checksum != 0 ) { write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, checksum_buffer, sizeof( uint32_t ), error ); if( write_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write checksum.", function ); return( -1 ); } total_write_count += write_count; } return( total_write_count ); } libewf-20140807/libewf/libewf_header_values.c0000664000175000017500000051607113421024433023112 0ustar00lordyestalordyesta00000000000000/* * Header values functions * * 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 . */ #include #include #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_date_time.h" #include "libewf_date_time_values.h" #include "libewf_definitions.h" #include "libewf_header_values.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" /* Initializes the header values * Returns 1 if successful or -1 on error */ int libewf_header_values_initialize( libfvalue_table_t **header_values, libcerror_error_t **error ) { static char *function = "libewf_header_values_initialize"; if( header_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header values.", function ); return( -1 ); } if( libfvalue_table_initialize( header_values, LIBEWF_HEADER_VALUES_DEFAULT_AMOUNT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header values table.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_CASE_NUMBER, (uint8_t *) "case_number", 12, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: case_number.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_DESCRIPTION, (uint8_t *) "description", 12, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: description.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_EXAMINER_NAME, (uint8_t *) "examiner_name", 14, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: examiner_name.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_EVIDENCE_NUMBER, (uint8_t *) "evidence_number", 16, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: evidence_number.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_NOTES, (uint8_t *) "notes", 6, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: notes.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_ACQUIRY_DATE, (uint8_t *) "acquiry_date", 13, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry_date.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_SYSTEM_DATE, (uint8_t *) "system_date", 12, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: system_date.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_ACQUIRY_SOFTWARE_VERSION, (uint8_t *) "acquiry_software_version", 25, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry_software_version.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_ACQUIRY_OPERATING_SYSTEM, (uint8_t *) "acquiry_operating_system", 25, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry_operating_system.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_PASSWORD, (uint8_t *) "password", 9, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: password.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_COMPRESSION_TYPE, (uint8_t *) "compression_level", 18, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: compression_level.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_MODEL, (uint8_t *) "model", 6, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: model.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_SERIAL_NUMBER, (uint8_t *) "serial_number", 14, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: serial_number.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_DEVICE_LABEL, (uint8_t *) "device_label", 13, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: device_label.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_PROCESS_IDENTIFIER, (uint8_t *) "process_identifier", 19, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: process_identifier.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_UNKNOWN_DC, (uint8_t *) "unknown_dc", 11, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: unknown_dc.", function ); goto on_error; } if( libewf_header_values_set_value_by_index( *header_values, LIBEWF_HEADER_VALUES_INDEX_EXTENTS, (uint8_t *) "extents", 8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: extents.", function ); goto on_error; } return( 1 ); on_error: if( *header_values != NULL ) { libfvalue_table_free( header_values, NULL ); } return( -1 ); } /* Sets a header value * Returns 1 if successful or -1 on error */ int libewf_header_values_set_value_by_index( libfvalue_table_t *header_values, int value_index, const uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ) { libfvalue_value_t *header_value = NULL; static char *function = "libewf_header_values_set_value_by_index"; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( libfvalue_value_type_initialize( &header_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header value.", function ); goto on_error; } if( libfvalue_value_set_identifier( header_value, identifier, identifier_size, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s identifier.", function, (char *) identifier ); goto on_error; } if( libfvalue_table_set_value_by_index( header_values, value_index, header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %d in table.", function, value_index ); goto on_error; } header_value = NULL; return( 1 ); on_error: if( header_value != NULL ) { libfvalue_value_free( &header_value, NULL ); } return( -1 ); } /* Convert a header value into a date time values string * Sets date time values string and size * Returns 1 if successful or -1 on error */ int libewf_convert_date_header_value( const uint8_t *header_value, size_t header_value_size, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ) { struct tm time_elements; libfvalue_split_utf8_string_t *date_time_values = NULL; uint8_t *date_time_value_string = NULL; static char *function = "libewf_convert_date_header_value"; size_t date_time_value_string_size = 0; time_t timestamp = 0; int number_of_date_time_values = 0; if( header_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header value.", function ); return( -1 ); } if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( date_time_values_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string size.", function ); goto on_error; } if( libfvalue_utf8_string_split( header_value, header_value_size, (uint8_t) ' ', &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split header value.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( date_time_values, &number_of_date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of date time values.", function ); goto on_error; } if( number_of_date_time_values != 6 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported number date time values in header value.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 0, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 0.", function ); goto on_error; } if( libewf_utf8_string_year_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year value.", function ); goto on_error; } /* Set the month */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 1, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 1.", function ); goto on_error; } if( ( date_time_value_string_size != 2 ) && ( date_time_value_string_size != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 1.", function ); goto on_error; } if( libewf_utf8_string_month_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month value.", function ); goto on_error; } /* Set the day of the month */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 2, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 2.", function ); goto on_error; } if( ( date_time_value_string_size != 2 ) && ( date_time_value_string_size != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 2.", function ); goto on_error; } if( libewf_utf8_string_day_of_month_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month value.", function ); goto on_error; } /* Set the hours */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 3, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 3.", function ); goto on_error; } if( ( date_time_value_string_size != 2 ) && ( date_time_value_string_size != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 3.", function ); goto on_error; } if( libewf_utf8_string_hours_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours value.", function ); goto on_error; } /* Set the minutes */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 4, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 4.", function ); goto on_error; } if( ( date_time_value_string_size != 2 ) && ( date_time_value_string_size != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 4.", function ); goto on_error; } if( libewf_utf8_string_minutes_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes value.", function ); goto on_error; } /* Set the seconds */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 5, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 5.", function ); goto on_error; } if( ( date_time_value_string_size != 2 ) && ( date_time_value_string_size != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 5.", function ); goto on_error; } if( libewf_utf8_string_seconds_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds value.", function ); goto on_error; } /* Set to ignore the daylight saving time */ time_elements.tm_isdst = -1; if( libfvalue_split_utf8_string_free( &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split date time elements.", function ); goto on_error; } /* Create a timestamp */ timestamp = libewf_date_time_mktime( &time_elements ); if( timestamp == (time_t) -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create timestamp.", function ); goto on_error; } *date_time_values_string_size = 20; *date_time_values_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *date_time_values_string_size ); if( *date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create date time values string.", function ); goto on_error; } if( libewf_date_time_values_copy_from_timestamp( *date_time_values_string, *date_time_values_string_size, timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to convert timestamp into date time values string.", function ); goto on_error; } return( 1 ); on_error: if( date_time_values != NULL ) { libfvalue_split_utf8_string_free( &date_time_values, NULL ); } if( *date_time_values_string != NULL ) { memory_free( *date_time_values_string ); *date_time_values_string = NULL; } *date_time_values_string_size = 0; return( -1 ); } /* Generates a date time values string within a header value * Sets date time values string and size * Returns 1 if successful or -1 on error */ int libewf_generate_date_header_value( time_t timestamp, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ) { struct tm time_elements; static char *function = "libewf_generate_date_header_value"; size_t date_time_values_string_index = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( *date_time_values_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: date time values string already created.", function ); return( -1 ); } if( date_time_values_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string size.", function ); return( -1 ); } if( libewf_date_time_localtime( ×tamp, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create time elements.", function ); goto on_error; } if( ( time_elements.tm_year + 1900 ) > 10000 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported year value.", function ); goto on_error; } *date_time_values_string_size = 20; *date_time_values_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *date_time_values_string_size ); if( *date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create date time values string.", function ); goto on_error; } if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_hour, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_min, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_sec, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds to date time values string.", function ); goto on_error; } /* The end-of-string character is set by libfvalue_utf8_string_with_index_copy_from_integer */ return( 1 ); on_error: if( *date_time_values_string != NULL ) { memory_free( *date_time_values_string ); *date_time_values_string = NULL; } *date_time_values_string_size = 0; return( -1 ); } /* Convert a header2 value into a date time values string * Sets date time values string and size * Returns 1 if successful or -1 on error */ int libewf_convert_date_header2_value( const uint8_t *header_value, size_t header_value_size, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ) { static char *function = "libewf_convert_date_header2_value"; uint64_t value_64bit = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( date_time_values_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string size.", function ); return( -1 ); } if( libfvalue_utf8_string_copy_to_integer( header_value, header_value_size - 1, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set timestamp.", function ); goto on_error; } *date_time_values_string_size = 20; *date_time_values_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *date_time_values_string_size ); if( *date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create date time values string.", function ); goto on_error; } if( libewf_date_time_values_copy_from_timestamp( *date_time_values_string, *date_time_values_string_size, (time_t) value_64bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to convert timestamp into date time values string.", function ); goto on_error; } return( 1 ); on_error: if( *date_time_values_string != NULL ) { memory_free( *date_time_values_string ); *date_time_values_string = NULL; } *date_time_values_string_size = 0; return( -1 ); } /* Generates a date time values string within a header2 value * Sets date time values string and size * Returns 1 if successful or -1 on error */ int libewf_generate_date_header2_value( time_t timestamp, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ) { static char *function = "libewf_generate_date_header2_value"; size_t date_time_values_string_index = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( *date_time_values_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: date time values string already created.", function ); return( -1 ); } if( date_time_values_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string size.", function ); return( -1 ); } *date_time_values_string_size = 11; *date_time_values_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *date_time_values_string_size ); if( *date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create date time values string.", function ); goto on_error; } if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) timestamp, 32, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy timestamp to date time values string.", function ); goto on_error; } /* The end-of-string character is set by libfvalue_utf8_string_with_index_copy_from_integer */ return( 1 ); on_error: if( *date_time_values_string != NULL ) { memory_free( *date_time_values_string ); *date_time_values_string = NULL; } *date_time_values_string_size = 0; return( -1 ); } /* Copies the header values from the source to the destination * Returns 1 if successful -1 on error */ int libewf_header_values_copy( libfvalue_table_t *destination_header_values, libfvalue_table_t *source_header_values, libcerror_error_t **error ) { libfvalue_value_t *destination_header_value = NULL; libfvalue_value_t *source_header_value = NULL; uint8_t *identifier = NULL; static char *function = "libewf_header_values_copy"; size_t identifier_size = 0; int header_value_index = 0; int number_of_header_values = 0; int result = 0; if( destination_header_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination header values.", function ); return( -1 ); } if( libfvalue_table_get_number_of_values( source_header_values, &number_of_header_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of header values.", function ); return( -1 ); } for( header_value_index = 0; header_value_index < number_of_header_values; header_value_index++ ) { if( libfvalue_table_get_value_by_index( source_header_values, header_value_index, &source_header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %d.", function, header_value_index ); goto on_error; } if( libfvalue_value_get_identifier( source_header_value, &identifier, &identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve identifier of header value: %d.", function, header_value_index ); goto on_error; } /* Ignore header values without an identifier */ if( ( identifier == NULL ) || ( identifier_size == 0 ) ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: missing identifier for header value: %d.\n", function, header_value_index ); } #endif continue; } /* Ignore the acquiry and system date * They will be auto generated */ else if( ( identifier_size == 13 ) && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) { continue; } else if( ( identifier_size == 12 ) && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) { continue; } /* Ignore empty values */ result = libfvalue_value_has_data( source_header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data of header value: %s.", function, (char *) identifier ); goto on_error; } else if( result == 0 ) { continue; } if( libfvalue_value_clone( &destination_header_value, source_header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable create destination header value.", function ); goto on_error; } if( libfvalue_table_set_value_by_index( destination_header_values, header_value_index, destination_header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %d.", function, header_value_index ); goto on_error; } destination_header_value = NULL; } return( 1 ); on_error: if( destination_header_value != NULL ) { libfvalue_value_free( &destination_header_value, NULL ); } return( -1 ); } /* Parses an UTF-8 encoded header string for the values * Returns 1 if successful or -1 on error */ int libewf_header_values_parse_utf8_header_string( libfvalue_table_t *header_values, const uint8_t *header_string, size_t header_string_size, uint8_t header_section_number, uint8_t *format, libcerror_error_t **error ) { libfvalue_split_utf8_string_t *lines = NULL; libfvalue_split_utf8_string_t *types = NULL; libfvalue_split_utf8_string_t *values = NULL; libfvalue_value_t *header_value = NULL; uint8_t *date_time_values_string = NULL; uint8_t *identifier = NULL; uint8_t *line_string = NULL; uint8_t *type_string = NULL; uint8_t *value_string = NULL; static char *function = "libewf_header_values_parse_utf8_header_string"; size_t date_time_values_string_size = 0; size_t identifier_size = 0; size_t line_string_size = 0; size_t type_string_size = 0; size_t value_string_size = 0; uint8_t acquiry_software_version = 0; uint8_t has_carriage_return = 0; uint8_t number_of_sections = 0; int number_of_lines = 0; int number_of_types = 0; int number_of_values = 0; int result = 0; int value_index = 0; if( header_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header string.", function ); return( -1 ); } if( ( header_section_number != 1 ) && ( header_section_number != 2 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported header section number.", function ); goto on_error; } if( format == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid format.", function ); return( -1 ); } if( libfvalue_utf8_string_split( header_string, header_string_size, (uint8_t) '\n', &lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split header string into lines.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( lines, &number_of_lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of lines.", function ); goto on_error; } if( number_of_lines > 0 ) { if( libfvalue_split_utf8_string_get_segment_by_index( lines, 0, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: 0.", function ); goto on_error; } if( line_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: 0.", function ); goto on_error; } if( ( line_string == NULL ) || ( line_string_size < 2 ) || ( line_string[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: 0.", function ); goto on_error; } /* Remove trailing carriage return */ else if( line_string[ line_string_size - 2 ] == (uint8_t) '\r' ) { line_string[ line_string_size - 2 ] = 0; line_string_size -= 1; } if( line_string_size != 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported line string: 0.", function ); goto on_error; } if( ( line_string[ 0 ] != (uint8_t) '1' ) && ( line_string[ 0 ] != (uint8_t) '3' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported line string: 0.", function ); goto on_error; } number_of_sections = line_string[ 0 ]; if( libfvalue_split_utf8_string_get_segment_by_index( lines, 1, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: 1.", function ); goto on_error; } if( line_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: 1.", function ); goto on_error; } if( ( line_string == NULL ) || ( line_string_size < 5 ) || ( line_string[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: 1.", function ); goto on_error; } /* Remove trailing carriage return */ else if( line_string[ line_string_size - 2 ] == (uint8_t) '\r' ) { line_string[ line_string_size - 2 ] = 0; line_string_size -= 1; } if( line_string_size != 5 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported line string: 1.", function ); goto on_error; } if( ( line_string[ 0 ] != (uint8_t) 'm' ) || ( line_string[ 1 ] != (uint8_t) 'a' ) || ( line_string[ 2 ] != (uint8_t) 'i' ) || ( line_string[ 3 ] != (uint8_t) 'n' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported line string: 1.", function ); goto on_error; } if( header_section_number == 1 ) { /* If the header string contains 3 object the version is at least linen5 * otherwise the version is at least EnCase1 */ if( number_of_sections == (uint8_t) '3' ) { *format = LIBEWF_FORMAT_LINEN5; } else { *format = LIBEWF_FORMAT_ENCASE1; } } if( libfvalue_split_utf8_string_get_segment_by_index( lines, 2, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: 2.", function ); goto on_error; } if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split header values string into types.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( types, &number_of_types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of types.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_segment_by_index( lines, 3, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: 3.", function ); goto on_error; } if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split header values string into values.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( values, &number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values.", function ); goto on_error; } #if defined( HAVE_VERBOSE_OUTPUT ) if( number_of_types != number_of_values ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mismatch in number of types and values.\n", function ); } } #endif for( value_index = 0; value_index < number_of_types; value_index++ ) { if( libfvalue_split_utf8_string_get_segment_by_index( types, value_index, &type_string, &type_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve type string: %d.", function, value_index ); goto on_error; } if( ( type_string == NULL ) || ( type_string_size < 2 ) || ( type_string[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing type string: %d.", function, value_index ); goto on_error; } /* Remove trailing carriage return */ else if( type_string[ type_string_size - 2 ] == (uint8_t) '\r' ) { type_string[ type_string_size - 2 ] = 0; type_string_size -= 1; has_carriage_return = 1; } if( value_index < number_of_values ) { if( libfvalue_split_utf8_string_get_segment_by_index( values, value_index, &value_string, &value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value string: %d.", function, value_index ); goto on_error; } if( ( value_string == NULL ) || ( value_string_size < 2 ) || ( value_string[ 0 ] == 0 ) ) { value_string = NULL; value_string_size = 0; } /* Remove trailing carriage return */ else if( value_string[ value_string_size - 2 ] == (uint8_t) '\r' ) { value_string[ value_string_size - 2 ] = 0; value_string_size -= 1; } } else { value_string = NULL; value_string_size = 0; } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: type: %s with value: %s.\n", function, (char *) type_string, (char *) value_string ); } #endif identifier = NULL; identifier_size = 0; if( type_string_size == 4 ) { if( ( type_string[ 0 ] == (uint8_t) 'e' ) && ( type_string[ 1 ] == (uint8_t) 'x' ) && ( type_string[ 2 ] == (uint8_t) 't' ) ) { identifier = (uint8_t *) "extents"; identifier_size = 8; } else if( ( type_string[ 0 ] == (uint8_t) 'p' ) && ( type_string[ 1 ] == (uint8_t) 'i' ) && ( type_string[ 2 ] == (uint8_t) 'd' ) ) { identifier = (uint8_t *) "process_identifier"; identifier_size = 19; } } else if( type_string_size == 3 ) { if( ( type_string[ 0 ] == (uint8_t) 'a' ) && ( type_string[ 1 ] == (uint8_t) 'v' ) ) { identifier = (uint8_t *) "acquiry_software_version"; identifier_size = 25; if( value_index == 5 ) { /* The linen5 header contains av on the 6th position */ if( header_section_number == 1 ) { *format = LIBEWF_FORMAT_LINEN5; } else if( header_section_number == 2 ) { /* The EnCase4 header2 contains av on the 6th position * and the header2 consist of 1 sections */ if( number_of_sections == (uint8_t) '1' ) { *format = LIBEWF_FORMAT_ENCASE4; } /* The EnCase5 header2 contains av on the 6th position * and the header2 consist of 3 sections */ else if( number_of_sections == (uint8_t) '3' ) { *format = LIBEWF_FORMAT_ENCASE5; } } } if( ( value_string != NULL ) && ( value_string_size > 1 ) ) { acquiry_software_version = value_string[ 0 ]; } } else if( ( type_string[ 0 ] == (uint8_t) 'd' ) && ( type_string[ 1 ] == (uint8_t) 'c' ) ) { identifier = (uint8_t *) "unknown_dc"; identifier_size = 11; } else if( ( type_string[ 0 ] == (uint8_t) 'm' ) && ( type_string[ 1 ] == (uint8_t) 'd' ) ) { identifier = (uint8_t *) "model"; identifier_size = 6; if( value_index == 5 ) { /* The linen6 header contains md on the 6th position */ if( header_section_number == 1 ) { *format = LIBEWF_FORMAT_LINEN6; } /* The EnCase6 header2 contains md on the 6th position */ else if( header_section_number == 2 ) { *format = LIBEWF_FORMAT_ENCASE6; } } } else if( ( type_string[ 0 ] == (uint8_t) 'o' ) && ( type_string[ 1 ] == (uint8_t) 'v' ) ) { identifier = (uint8_t *) "acquiry_operating_system"; identifier_size = 25; } else if( ( type_string[ 0 ] == (uint8_t) 's' ) && ( type_string[ 1 ] == (uint8_t) 'n' ) ) { identifier = (uint8_t *) "serial_number"; identifier_size = 14; } } else if( type_string_size == 2 ) { if( type_string[ 0 ] == (uint8_t) 'a' ) { identifier = (uint8_t *) "description"; identifier_size = 12; } else if( type_string[ 0 ] == (uint8_t) 'c' ) { identifier = (uint8_t *) "case_number"; identifier_size = 12; } else if( type_string[ 0 ] == (uint8_t) 'e' ) { identifier = (uint8_t *) "examiner_name"; identifier_size = 14; } else if( type_string[ 0 ] == (uint8_t) 'l' ) { identifier = (uint8_t *) "device_label"; identifier_size = 13; /* The linen7 header contains l */ if( header_section_number == 1 ) { *format = LIBEWF_FORMAT_LINEN7; } /* The EnCase7 header2 contains l */ else if( header_section_number == 2 ) { *format = LIBEWF_FORMAT_ENCASE7; } } else if( ( type_string[ 0 ] == (uint8_t) 'm' ) || ( type_string[ 0 ] == (uint8_t) 'u' ) ) { if( ( value_string == NULL ) || ( value_string_size == 0 ) || ( value_string[ 0 ] == 0 ) ) { date_time_values_string = NULL; result = 0; } /* If the date time values string contains spaces it's in the old header * format otherwise is in new header2 format */ else if( narrow_string_search_character( (char *) value_string, ' ', value_string_size - 1 ) != NULL ) { result = libewf_convert_date_header_value( value_string, value_string_size, &date_time_values_string, &date_time_values_string_size, error ); } else { result = libewf_convert_date_header2_value( value_string, value_string_size, &date_time_values_string, &date_time_values_string_size, error ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to create date time values string.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } /* The effective size of the date time values string is needed */ if( date_time_values_string != NULL ) { value_string = date_time_values_string; value_string_size = 1 + narrow_string_length( (char *) date_time_values_string ); if( type_string[ 0 ] == (uint8_t) 'm' ) { identifier = (uint8_t *) "acquiry_date"; identifier_size = 13; } else if( type_string[ 0 ] == (uint8_t) 'u' ) { identifier = (uint8_t *) "system_date"; identifier_size = 12; } } } else if( type_string[ 0 ] == (uint8_t) 'n' ) { identifier = (uint8_t *) "evidence_number"; identifier_size = 16; } else if( type_string[ 0 ] == (uint8_t) 'p' ) { if( ( value_string == NULL ) || ( value_string_size == 0 ) || ( value_string[ 0 ] == 0 ) ) { /* Empty hash do nothing */ } else if( ( value_string_size == 2 ) && ( value_string[ 0 ] == (uint8_t) '0' ) ) { /* Empty hash do nothing */ } else { identifier = (uint8_t *) "password"; identifier_size = 9; } } else if( type_string[ 0 ] == (uint8_t) 'r' ) { identifier = (uint8_t *) "compression_level"; identifier_size = 18; if( header_section_number == 1 ) { /* The EnCase1 header contains r on the 9th position */ if( value_index == 8 ) { *format = LIBEWF_FORMAT_ENCASE1; } else if( value_index == 10 ) { /* The EnCase2 and EnCase3 header contains r on the 11th position * and uses \r\n as line ends. The only way to tell both version * apart is to look at the acquiry software version */ if( has_carriage_return != 0 ) { if( acquiry_software_version == (uint8_t) '2' ) { *format = LIBEWF_FORMAT_ENCASE2; } else if( acquiry_software_version == (uint8_t) '3' ) { *format = LIBEWF_FORMAT_ENCASE3; } } /* The FTK imager header contains r on the 11th position * and uses \n as line ends */ else { *format = LIBEWF_FORMAT_FTK_IMAGER; } } } } else if( type_string[ 0 ] == (uint8_t) 't' ) { identifier = (uint8_t *) "notes"; identifier_size = 6; } } /* Ignore empty values */ if( value_string == NULL ) { continue; } if( identifier != NULL ) { if( libfvalue_value_type_initialize( &header_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header value.", function ); goto on_error; } if( libfvalue_value_set_identifier( header_value, identifier, identifier_size, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s identifier.", function, (char *) identifier ); goto on_error; } if( libfvalue_value_set_data( header_value, value_string, value_string_size, LIBFVALUE_CODEPAGE_UTF8, LIBFVALUE_VALUE_DATA_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s data.", function, (char *) identifier ); goto on_error; } if( libfvalue_table_set_value( header_values, header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s in table.", function, (char *) identifier ); goto on_error; } header_value = NULL; } if( date_time_values_string != NULL ) { memory_free( date_time_values_string ); date_time_values_string = NULL; } } if( libfvalue_split_utf8_string_free( &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split values.", function ); goto on_error; } if( libfvalue_split_utf8_string_free( &types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split types.", function ); goto on_error; } } if( libfvalue_split_utf8_string_free( &lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split lines.", function ); goto on_error; } return( 1 ); on_error: if( header_value != NULL ) { libfvalue_value_free( &header_value, NULL ); } if( date_time_values_string != NULL ) { memory_free( date_time_values_string ); } if( values != NULL ) { libfvalue_split_utf8_string_free( &values, NULL ); } if( types != NULL ) { libfvalue_split_utf8_string_free( &types, NULL ); } if( lines != NULL ) { libfvalue_split_utf8_string_free( &lines, NULL ); } return( -1 ); } /* Parses EWF version 1 header for values * Returns 1 if successful or -1 on error */ int libewf_header_values_parse_header( libfvalue_table_t *header_values, uint8_t *header, size_t header_size, int codepage, uint8_t *format, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_parse_header"; size_t header_string_size = 0; if( header == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header.", function ); return( -1 ); } if( libuna_utf8_string_size_from_byte_stream( header, header_size, codepage, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine header string size.", function ); goto on_error; } header_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * header_string_size ); if( header_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create header string.", function ); goto on_error; } if( libuna_utf8_string_copy_from_byte_stream( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to set header string.", function ); goto on_error; } if( libewf_header_values_parse_utf8_header_string( header_values, header_string, header_string_size, 1, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse header string.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Parses EWF version 1 header2 for values * Returns 1 if successful or -1 on error */ int libewf_header_values_parse_header2( libfvalue_table_t *header_values, uint8_t *header2, size_t header2_size, uint8_t *format, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_parse_header2"; size_t header_string_size = 0; if( header2 == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header2.", function ); return( -1 ); } if( libuna_utf8_string_size_from_utf16_stream( header2, header2_size, LIBUNA_ENDIAN_LITTLE, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine header string size.", function ); goto on_error; } header_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * header_string_size ); if( header_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create header string.", function ); goto on_error; } if( libuna_utf8_string_copy_from_utf16_stream( header_string, header_string_size, header2, header2_size, LIBUNA_ENDIAN_LITTLE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to set header string.", function ); goto on_error; } if( libewf_header_values_parse_utf8_header_string( header_values, header_string, header_string_size, 2, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse header string.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Converts an UTF-8 encoded header string into a header * Sets the header and header size * Returns 1 if successful or -1 on error */ int libewf_header_values_convert_utf8_header_string_to_header( const uint8_t *header_string, size_t header_string_size, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { static char *function = "libewf_header_values_convert_utf8_header_string_to_header"; if( header_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header string.", function ); return( -1 ); } if( header == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header.", function ); return( -1 ); } if( *header != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: header already created.", function ); return( -1 ); } if( header_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header size.", function ); return( -1 ); } if( libuna_byte_stream_size_from_utf8( header_string, header_string_size, codepage, header_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine header size.", function ); goto on_error; } *header = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *header_size ); if( *header == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create header.", function ); goto on_error; } if( libuna_byte_stream_copy_from_utf8( *header, *header_size, codepage, header_string, header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set header.", function ); goto on_error; } return( 1 ); on_error: if( *header != NULL ) { memory_free( header ); *header = NULL; } *header_size = 0; return( -1 ); } /* Generate an UTF-8 encoded header string * Sets header string and header string size * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_utf8_header_string( libfvalue_table_t *header_values, uint8_t header_string_type, uint8_t *newline_string, size_t newline_string_length, time_t timestamp, int8_t compression_level, uint8_t **utf8_string, size_t *utf8_string_size, libcerror_error_t **error ) { libfvalue_value_t *acquiry_date_header_value = NULL; libfvalue_value_t *acquiry_operating_system_header_value = NULL; libfvalue_value_t *acquiry_software_version_header_value = NULL; libfvalue_value_t *case_number_header_value = NULL; libfvalue_value_t *compression_level_header_value = NULL; libfvalue_value_t *device_label_header_value = NULL; libfvalue_value_t *description_header_value = NULL; libfvalue_value_t *evidence_number_header_value = NULL; libfvalue_value_t *examiner_name_header_value = NULL; libfvalue_value_t *extents_header_value = NULL; libfvalue_value_t *model_header_value = NULL; libfvalue_value_t *notes_header_value = NULL; libfvalue_value_t *password_header_value = NULL; libfvalue_value_t *process_identifier_header_value = NULL; libfvalue_value_t *serial_number_header_value = NULL; libfvalue_value_t *system_date_header_value = NULL; libfvalue_value_t *unknown_dc_header_value = NULL; uint8_t *generated_acquiry_date = NULL; uint8_t *generated_system_date = NULL; char *generated_compression_level = NULL; char *generated_password = NULL; char *generated_srce_section = NULL; char *generated_sub_section = NULL; static char *function = "libewf_header_values_generate_utf8_header_string"; size_t acquiry_date_string_length = 0; size_t acquiry_operating_system_string_length = 0; size_t acquiry_software_version_string_length = 0; size_t case_number_string_length = 0; size_t compression_level_string_length = 0; size_t description_string_length = 0; size_t device_label_string_length = 0; size_t evidence_number_string_length = 0; size_t examiner_name_string_length = 0; size_t extents_string_length = 0; size_t generated_acquiry_date_size = 0; size_t generated_system_date_size = 0; size_t model_string_length = 0; size_t notes_string_length = 0; size_t password_string_length = 0; size_t process_identifier_string_length = 0; size_t srce_section_string_length = 0; size_t sub_section_string_length = 0; size_t serial_number_string_length = 0; size_t system_date_string_length = 0; size_t unknown_dc_string_length = 0; size_t utf8_string_index = 0; int number_of_characters = 0; int number_of_tabs = 0; int result = 0; if( ( header_string_type != LIBEWF_HEADER_STRING_TYPE_1 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_2 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_3 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_4 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_5 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_6 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_7 ) && ( header_string_type != LIBEWF_HEADER_STRING_TYPE_8 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported header string type.", function ); return( -1 ); } if( newline_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid newline string.", function ); return( -1 ); } if( ( newline_string_length != 1 ) && ( newline_string_length != 2 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported newline string length.", function ); return( -1 ); } if( ( compression_level != LIBEWF_COMPRESSION_NONE ) && ( compression_level != LIBEWF_COMPRESSION_FAST ) && ( compression_level != LIBEWF_COMPRESSION_BEST ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported compression level.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( *utf8_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: UTF-8 string already set.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "case_number", 12, &case_number_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: case_number.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "description", 12, &description_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: description.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "examiner_name", 14, &examiner_name_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: examiner_name.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "evidence_number", 16, &evidence_number_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: evidence_number.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "notes", 6, ¬es_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: notes.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "acquiry_date", 13, &acquiry_date_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: acquiry_date.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "system_date", 12, &system_date_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: system_date.", function ); goto on_error; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "acquiry_software_version", 25, &acquiry_software_version_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: acquiry_software_version.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "acquiry_operating_system", 25, &acquiry_operating_system_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: acquiry_operating_system.", function ); goto on_error; } } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "password", 9, &password_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: password.", function ); goto on_error; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "compression_level", 18, &compression_level_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: compression_level.", function ); goto on_error; } } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "model", 6, &model_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: model.", function ); goto on_error; } if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "serial_number", 14, &serial_number_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: serial_number.", function ); goto on_error; } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "device_label", 13, &device_label_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: device_label.", function ); goto on_error; } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "process_identifier", 19, &process_identifier_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: process_identifier.", function ); goto on_error; } } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "unknown_dc", 11, &unknown_dc_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: unknown_dc.", function ); goto on_error; } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { if( libfvalue_table_get_value_by_identifier( header_values, (uint8_t *) "extents", 8, &extents_header_value, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: extents.", function ); goto on_error; } } /* Determine the string size * Reserve space for: * # * main */ *utf8_string_size = 5 + ( 2 * newline_string_length ); switch( header_string_type ) { case LIBEWF_HEADER_STRING_TYPE_1: /* Reserve space for: * c n a e t m u p r */ number_of_characters = 9; number_of_tabs = 8; break; case LIBEWF_HEADER_STRING_TYPE_2: /* Reserve space for: * c n a e t av ov m u p r */ number_of_characters = 13; number_of_tabs = 10; break; case LIBEWF_HEADER_STRING_TYPE_3: /* Reserve space for: * c n a e t av ov m u p */ number_of_characters = 12; number_of_tabs = 9; break; case LIBEWF_HEADER_STRING_TYPE_4: case LIBEWF_HEADER_STRING_TYPE_7: /* Reserve space for: * a c n e t av ov m u p */ number_of_characters = 12; number_of_tabs = 9; break; case LIBEWF_HEADER_STRING_TYPE_5: /* Reserve space for: * a c n e t av ov m u p dc */ number_of_characters = 14; number_of_tabs = 10; break; case LIBEWF_HEADER_STRING_TYPE_6: /* Reserve space for: * a c n e t md sn av ov m u p dc */ number_of_characters = 18; number_of_tabs = 12; break; case LIBEWF_HEADER_STRING_TYPE_8: /* Reserve space for: * a c n e t md sn l av ov m u p pid dc ext */ number_of_characters = 25; number_of_tabs = 15; break; } *utf8_string_size += number_of_characters + number_of_tabs + newline_string_length; if( case_number_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( case_number_header_value, 0, &case_number_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: case_number.", function ); goto on_error; } if( case_number_string_length > 0 ) { case_number_string_length -= 1; *utf8_string_size += case_number_string_length; } } if( description_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( description_header_value, 0, &description_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: description.", function ); goto on_error; } if( description_string_length > 0 ) { description_string_length -= 1; *utf8_string_size += description_string_length; } } if( examiner_name_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( examiner_name_header_value, 0, &examiner_name_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: examiner_name.", function ); goto on_error; } if( examiner_name_string_length > 0 ) { examiner_name_string_length -= 1; *utf8_string_size += examiner_name_string_length; } } if( evidence_number_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( evidence_number_header_value, 0, &evidence_number_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: evidence_number.", function ); goto on_error; } if( evidence_number_string_length > 0 ) { evidence_number_string_length -= 1; *utf8_string_size += evidence_number_string_length; } } if( notes_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( notes_header_value, 0, ¬es_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: notes.", function ); goto on_error; } if( notes_string_length > 0 ) { notes_string_length -= 1; *utf8_string_size += notes_string_length; } } if( acquiry_date_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( acquiry_date_header_value, 0, &acquiry_date_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: acquiry_date.", function ); goto on_error; } if( acquiry_date_string_length > 0 ) { acquiry_date_string_length -= 1; } } if( ( acquiry_date_header_value == NULL ) || ( acquiry_date_string_length == 0 ) ) { if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) ) { result = libewf_generate_date_header_value( timestamp, &generated_acquiry_date, &generated_acquiry_date_size, error ); } else { result = libewf_generate_date_header2_value( timestamp, &generated_acquiry_date, &generated_acquiry_date_size, error ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to generate acquiry date header value.", function ); #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { /* Make sure to determine the actual length of the date time values string */ acquiry_date_string_length = narrow_string_length( (char *) generated_acquiry_date ); } } *utf8_string_size += acquiry_date_string_length; if( system_date_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( system_date_header_value, 0, &system_date_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: system_date.", function ); goto on_error; } if( system_date_string_length > 0 ) { system_date_string_length -= 1; } } if( ( system_date_header_value == NULL ) || ( system_date_string_length == 0 ) ) { if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) ) { result = libewf_generate_date_header_value( timestamp, &generated_system_date, &generated_system_date_size, error ); } else { result = libewf_generate_date_header2_value( timestamp, &generated_system_date, &generated_system_date_size, error ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to generate system date header value.", function ); #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { /* Make sure to determine the actual length of the date time values string */ system_date_string_length = narrow_string_length( (char *) generated_system_date ); } } *utf8_string_size += system_date_string_length; if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( acquiry_software_version_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( acquiry_software_version_header_value, 0, &acquiry_software_version_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: acquiry_software_version.", function ); goto on_error; } if( acquiry_software_version_string_length > 0 ) { acquiry_software_version_string_length -= 1; *utf8_string_size += acquiry_software_version_string_length; } } if( acquiry_operating_system_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( acquiry_operating_system_header_value, 0, &acquiry_operating_system_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: acquiry_operating_system.", function ); goto on_error; } if( acquiry_operating_system_string_length > 0 ) { acquiry_operating_system_string_length -= 1; *utf8_string_size += acquiry_operating_system_string_length; } } } if( password_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( password_header_value, 0, &password_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: password.", function ); goto on_error; } if( password_string_length > 0 ) { password_string_length -= 1; } } if( ( password_header_value == NULL ) || ( password_string_length == 0 ) ) { generated_password = "0"; password_string_length = 1; } *utf8_string_size += password_string_length; if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) ) { if( compression_level_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( compression_level_header_value, 0, &compression_level_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: compression_level.", function ); goto on_error; } if( compression_level_string_length > 0 ) { compression_level_string_length -= 1; } } if( ( compression_level_header_value == NULL ) || ( compression_level_string_length == 0 ) ) { if( compression_level == LIBEWF_COMPRESSION_NONE ) { generated_compression_level = LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE; } else if( compression_level == LIBEWF_COMPRESSION_FAST ) { generated_compression_level = LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST; } else if( compression_level == LIBEWF_COMPRESSION_BEST ) { generated_compression_level = LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST; } compression_level_string_length = narrow_string_length( generated_compression_level ); } *utf8_string_size += compression_level_string_length; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( model_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( model_header_value, 0, &model_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: model.", function ); goto on_error; } if( model_string_length > 0 ) { model_string_length -= 1; *utf8_string_size += model_string_length; } } if( serial_number_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( serial_number_header_value, 0, &serial_number_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: serial_number.", function ); goto on_error; } if( serial_number_string_length > 0 ) { serial_number_string_length -= 1; *utf8_string_size += serial_number_string_length; } } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { if( device_label_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( device_label_header_value, 0, &device_label_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: device_label.", function ); goto on_error; } if( device_label_string_length > 0 ) { device_label_string_length -= 1; *utf8_string_size += device_label_string_length; } } if( process_identifier_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( process_identifier_header_value, 0, &process_identifier_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: process_identifier.", function ); goto on_error; } if( process_identifier_string_length > 0 ) { process_identifier_string_length -= 1; *utf8_string_size += process_identifier_string_length; } } } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( unknown_dc_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( unknown_dc_header_value, 0, &unknown_dc_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: unknown_dc.", function ); goto on_error; } if( unknown_dc_string_length > 0 ) { unknown_dc_string_length -= 1; *utf8_string_size += unknown_dc_string_length; } } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { if( extents_header_value != NULL ) { result = libfvalue_value_get_utf8_string_size( extents_header_value, 0, &extents_string_length, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: extents.", function ); goto on_error; } if( extents_string_length > 0 ) { extents_string_length -= 1; *utf8_string_size += extents_string_length; } } } /* Reserve space for the tabs and 2 newlines */ *utf8_string_size += number_of_tabs + ( 2 * newline_string_length ); /* Reserve space for additional sections */ if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) ) { generated_srce_section = "srce\n" "0\t1\n" "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 = narrow_string_length( generated_srce_section ); *utf8_string_size += srce_section_string_length; } else if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { generated_srce_section = "srce\n" "0\t1\n" "p\tn\tid\tev\ttb\tlo\tpo\tah\tsh\tgu\taq\n0\t0\n" "0\t0\n" "\t\t\t\t\t-1\t-1\t00000000000000000000000000000000\t0000000000000000000000000000000000000000\t00000000000000000000000000000000\t\n" "\n"; srce_section_string_length = narrow_string_length( generated_srce_section ); *utf8_string_size += srce_section_string_length; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) ) { generated_sub_section = "sub\n" "0\t1\n" "p\tn\tid\tnu\tco\tgu\n" "0\t0\n" "\t\t\t\t1\t\n" "\n"; sub_section_string_length = narrow_string_length( generated_sub_section ); *utf8_string_size += sub_section_string_length; } else if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { generated_sub_section = "sub\n" "0\t1\n" "p\tn\tid\tnu\tco\tgu\n" "0\t0\n" "\t\t\t\t1\t00000000000000000000000000000000\n" "\n"; sub_section_string_length = narrow_string_length( generated_sub_section ); *utf8_string_size += sub_section_string_length; } /* Reserve space for the end-of-string character */ *utf8_string_size += 1; /* Determine the string */ *utf8_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *utf8_string_size ); if( *utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create UTF-8 string.", function ); goto on_error; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '1'; } else if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '3'; } ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 0 ]; if( newline_string_length == 2 ) { ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 1 ]; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'm'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'a'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'i'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'n'; ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 0 ]; if( newline_string_length == 2 ) { ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 1 ]; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'a'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'c'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'n'; if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'a'; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'e'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 't'; if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'm'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'd'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 's'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'n'; } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'l'; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'a'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'v'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'o'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'v'; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'm'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'u'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'p'; if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'r'; } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'p'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'i'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'd'; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'd'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'c'; } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'e'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 'x'; ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) 't'; } ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 0 ]; if( newline_string_length == 2 ) { ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 1 ]; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( ( description_header_value != NULL ) && ( description_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( description_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: description to string.", function ); goto on_error; } utf8_string_index--; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; } if( ( case_number_header_value != NULL ) && ( case_number_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( case_number_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: case_number to string.", function ); goto on_error; } utf8_string_index--; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( evidence_number_header_value != NULL ) && ( evidence_number_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( evidence_number_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: evidence_number to string.", function ); goto on_error; } utf8_string_index--; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( description_header_value != NULL ) && ( description_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( description_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: description to string.", function ); goto on_error; } utf8_string_index--; } } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( examiner_name_header_value != NULL ) && ( examiner_name_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( examiner_name_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: examiner_name to string.", function ); goto on_error; } utf8_string_index--; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( notes_header_value != NULL ) && ( notes_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( notes_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: notes to string.", function ); goto on_error; } utf8_string_index--; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( model_header_value != NULL ) && ( model_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( model_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: model to string.", function ); goto on_error; } utf8_string_index--; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( serial_number_header_value != NULL ) && ( serial_number_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( serial_number_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: serial_number to string.", function ); goto on_error; } utf8_string_index--; } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( device_label_header_value != NULL ) && ( device_label_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( device_label_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: device_label to string.", function ); goto on_error; } utf8_string_index--; } } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_3 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_4 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( acquiry_software_version_header_value != NULL ) && ( acquiry_software_version_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( acquiry_software_version_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: acquiry_software_version to string.", function ); goto on_error; } utf8_string_index--; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( acquiry_operating_system_header_value != NULL ) && ( acquiry_operating_system_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( acquiry_operating_system_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: acquiry_operating_system to string.", function ); goto on_error; } utf8_string_index--; } } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( generated_acquiry_date == NULL ) { result = libfvalue_value_copy_to_utf8_string_with_index( acquiry_date_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: acquiry_date to string.", function ); goto on_error; } utf8_string_index--; } else { if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), (char *) generated_acquiry_date, acquiry_date_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy acquiry date string.", function ); goto on_error; } if( generated_acquiry_date != NULL ) { memory_free( generated_acquiry_date ); generated_acquiry_date = NULL; } utf8_string_index += acquiry_date_string_length; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( generated_system_date == NULL ) { result = libfvalue_value_copy_to_utf8_string_with_index( system_date_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: system_date to string.", function ); goto on_error; } utf8_string_index--; } else { if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), (char *) generated_system_date, system_date_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy system date string.", function ); goto on_error; } if( generated_system_date != NULL ) { memory_free( generated_system_date ); generated_system_date = NULL; } utf8_string_index += system_date_string_length; } ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( generated_password == NULL ) { result = libfvalue_value_copy_to_utf8_string_with_index( password_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: password to string.", function ); goto on_error; } utf8_string_index--; } else { if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_password, password_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy password string.", function ); goto on_error; } utf8_string_index += password_string_length; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_1 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_2 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( generated_compression_level == NULL ) { result = libfvalue_value_copy_to_utf8_string_with_index( compression_level_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: compression_level to string.", function ); goto on_error; } utf8_string_index--; } else { if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_compression_level, compression_level_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy compression level string.", function ); goto on_error; } utf8_string_index += compression_level_string_length; } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( process_identifier_header_value != NULL ) && ( process_identifier_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( process_identifier_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: process_identifier to string.", function ); goto on_error; } utf8_string_index--; } } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( unknown_dc_header_value != NULL ) && ( unknown_dc_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( unknown_dc_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: unknown_dc to string.", function ); goto on_error; } utf8_string_index--; } } if( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) { ( *utf8_string )[ utf8_string_index++ ] = (uint8_t) '\t'; if( ( extents_header_value != NULL ) && ( extents_string_length > 0 ) ) { result = libfvalue_value_copy_to_utf8_string_with_index( extents_header_value, 0, *utf8_string, *utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: extents to string.", function ); goto on_error; } utf8_string_index--; } } ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 0 ]; if( newline_string_length == 2 ) { ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 1 ]; } ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 0 ]; if( newline_string_length == 2 ) { ( *utf8_string )[ utf8_string_index++ ] = newline_string[ 1 ]; } if( ( header_string_type == LIBEWF_HEADER_STRING_TYPE_5 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_6 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_7 ) || ( header_string_type == LIBEWF_HEADER_STRING_TYPE_8 ) ) { if( srce_section_string_length > 0 ) { if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_srce_section, srce_section_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy srce section string.", function ); goto on_error; } utf8_string_index += srce_section_string_length; } if( sub_section_string_length > 0 ) { if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_sub_section, sub_section_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy sub section string.", function ); goto on_error; } utf8_string_index += sub_section_string_length; } } ( *utf8_string )[ utf8_string_index++ ] = 0; return( 1 ); on_error: if( generated_acquiry_date != NULL ) { memory_free( generated_acquiry_date ); } if( generated_system_date != NULL ) { memory_free( generated_system_date ); } if( *utf8_string != NULL ) { memory_free( *utf8_string ); *utf8_string = NULL; } *utf8_string_size = 0; return( -1 ); } /* Generate an EWF header * Sets header and header length * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_ewf( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_ewf"; size_t header_string_size = 0; if( libewf_header_values_generate_utf8_header_string( header_values, LIBEWF_HEADER_STRING_TYPE_1, (uint8_t *) "\n", 1, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Generate an EnCase1 header * Sets header and header length * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_encase1( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_encase1"; size_t header_string_size = 0; if( libewf_header_values_generate_utf8_header_string( header_values, LIBEWF_HEADER_STRING_TYPE_1, (uint8_t *) "\r\n", 2, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Generate an FTK Imager header * Sets header and header length * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_ftk( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_ftk"; size_t header_string_size = 0; if( libewf_header_values_generate_utf8_header_string( header_values, LIBEWF_HEADER_STRING_TYPE_2, (uint8_t *) "\n", 1, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Generate an EnCase2 and EnCase3 header * Sets header and header length * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_encase2( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_encase2"; size_t header_string_size = 0; if( libewf_header_values_generate_utf8_header_string( header_values, LIBEWF_HEADER_STRING_TYPE_2, (uint8_t *) "\r\n", 2, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Generate an EnCase4 header * Sets header and header length * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_encase4( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_encase4"; size_t header_string_size = 0; if( libewf_header_values_generate_utf8_header_string( header_values, LIBEWF_HEADER_STRING_TYPE_3, (uint8_t *) "\r\n", 2, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Generate a linen header * Sets header and header length * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_linen( libfvalue_table_t *header_values, uint8_t format, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_linen"; size_t header_string_size = 0; uint8_t header_string_type = 0; switch( format ) { case LIBEWF_FORMAT_LINEN5: header_string_type = LIBEWF_HEADER_STRING_TYPE_7; break; case LIBEWF_FORMAT_LINEN6: header_string_type = LIBEWF_HEADER_STRING_TYPE_6; break; case LIBEWF_FORMAT_LINEN7: header_string_type = LIBEWF_HEADER_STRING_TYPE_8; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported format.", function ); break; } if( libewf_header_values_generate_utf8_header_string( header_values, header_string_type, (uint8_t *) "\n", 1, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } /* Generate a header2 * Sets header2 and header2 size * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header2( libfvalue_table_t *header_values, uint8_t format, time_t timestamp, int8_t compression_level, uint8_t **header2, size_t *header2_size, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header2"; size_t header_string_size = 0; uint8_t header_string_type = 0; if( header2 == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header2.", function ); return( -1 ); } if( *header2 != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: header2 already created.", function ); return( -1 ); } if( header2_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header2 size.", function ); return( -1 ); } switch( format ) { case LIBEWF_FORMAT_ENCASE4: case LIBEWF_FORMAT_EWFX: header_string_type = LIBEWF_HEADER_STRING_TYPE_4; break; case LIBEWF_FORMAT_ENCASE5: header_string_type = LIBEWF_HEADER_STRING_TYPE_5; break; case LIBEWF_FORMAT_ENCASE6: header_string_type = LIBEWF_HEADER_STRING_TYPE_6; break; case LIBEWF_FORMAT_ENCASE7: header_string_type = LIBEWF_HEADER_STRING_TYPE_8; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported format.", function ); break; } if( libewf_header_values_generate_utf8_header_string( header_values, header_string_type, (uint8_t *) "\n", 1, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libuna_utf16_stream_size_from_utf8( header_string, header_string_size, header2_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine header2 size.", function ); goto on_error; } *header2 = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *header2_size ); if( *header2 == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create header2.", function ); goto on_error; } if( libuna_utf16_stream_copy_from_utf8( *header2, *header2_size, LIBUNA_ENDIAN_LITTLE, header_string, header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set header2.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } if( *header2 != NULL ) { memory_free( header2 ); *header2 = NULL; } *header2_size = 0; return( -1 ); } /* Convert date time values string within an xheader value * Sets date time values string and length * Returns 1 if successful, 0 if not an xheader value or -1 on error */ int libewf_convert_date_xheader_value( const uint8_t *header_value, size_t header_value_length, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ) { struct tm time_elements; libfvalue_split_utf8_string_t *date_time_values = NULL; uint8_t *date_time_value_string = NULL; uint8_t *timezone_name = NULL; uint8_t *timezone_string = NULL; static char *function = "libewf_convert_date_xheader_value"; size_t date_time_value_string_size = 0; size_t date_time_values_string_index = 0; size_t timezone_name_size = 0; size_t timezone_string_size = 0; time_t timestamp = 0; int empty_date_element_correction = 0; int number_of_date_time_values = 0; if( header_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header value.", function ); return( -1 ); } if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( *date_time_values_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: date time values string already created.", function ); return( -1 ); } if( date_time_values_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string size.", function ); return( -1 ); } if( libfvalue_utf8_string_split( header_value, header_value_length, (uint8_t) ' ', &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split header value.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( date_time_values, &number_of_date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of date time values.", function ); goto on_error; } /* The ctime formatted string use an additional space * when the day is less than 10 */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 2, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 2.", function ); goto on_error; } if( ( date_time_value_string != NULL ) && ( date_time_value_string[ 0 ] == 0 ) ) { empty_date_element_correction = 1; } if( number_of_date_time_values < ( 5 + empty_date_element_correction ) ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unsupported number of date time element values: %d.\n", function, number_of_date_time_values ); } #endif if( libfvalue_split_utf8_string_free( &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split date time elements.", function ); goto on_error; } return( 0 ); } /* Check the day of the week */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 0, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 0.", function ); goto on_error; } if( libewf_utf8_string_day_of_week_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of week string.", function ); goto on_error; } /* Set the year */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 4 + empty_date_element_correction, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: %d.", function, 4 + empty_date_element_correction ); goto on_error; } if( libewf_utf8_string_year_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year value.", function ); goto on_error; } /* Set the month */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 1, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 1.", function ); goto on_error; } if( date_time_value_string_size != 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 1.", function ); goto on_error; } if( libewf_utf8_string_month_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month value.", function ); goto on_error; } /* Set the day of the month */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 2 + empty_date_element_correction, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: %d.", function, empty_date_element_correction ); goto on_error; } if( ( date_time_value_string_size != 2 ) && ( date_time_value_string_size != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: %d.", function, empty_date_element_correction ); goto on_error; } if( libewf_utf8_string_day_of_month_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month value.", function ); goto on_error; } /* Set the hours, minutes and seconds */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 3 + empty_date_element_correction, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: %d.", function, 3 + empty_date_element_correction ); goto on_error; } if( date_time_value_string_size != 9 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: %d.", function, 3 + empty_date_element_correction ); goto on_error; } if( libewf_utf8_string_hours_copy_to_time_elements( &( date_time_value_string[ 0 ] ), 2, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours value.", function ); goto on_error; } if( libewf_utf8_string_minutes_copy_to_time_elements( &( date_time_value_string[ 3 ] ), 2, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes value.", function ); goto on_error; } if( libewf_utf8_string_seconds_copy_to_time_elements( &( date_time_value_string[ 6 ] ), 2, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds value.", function ); goto on_error; } /* Set to ignore the daylight saving time */ time_elements.tm_isdst = -1; /* Create a timestamp */ timestamp = libewf_date_time_mktime( &time_elements ); if( timestamp == (time_t) -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create timestamp.", function ); goto on_error; } *date_time_values_string_size = 20; if( ( number_of_date_time_values - empty_date_element_correction ) > 5 ) { if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 5 + empty_date_element_correction, &timezone_string, &timezone_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: %d.", function, 5 + empty_date_element_correction ); goto on_error; } *date_time_values_string_size += timezone_string_size; } if( ( number_of_date_time_values - empty_date_element_correction ) > 6 ) { if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 6 + empty_date_element_correction, &timezone_name, &timezone_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: %d.", function, 6 + empty_date_element_correction ); goto on_error; } *date_time_values_string_size += timezone_name_size; } *date_time_values_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *date_time_values_string_size ); if( *date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create date time values string.", function ); goto on_error; } if( libewf_date_time_values_copy_from_timestamp( *date_time_values_string, *date_time_values_string_size, timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to convert timestamp into date time values string.", function ); goto on_error; } date_time_values_string_index = 19; if( number_of_date_time_values > ( 5 + empty_date_element_correction ) ) { ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; if( narrow_string_copy( (char *) &( ( *date_time_values_string )[ date_time_values_string_index ] ), (char *) timezone_string, timezone_string_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set timezone string in data time values string.", function ); goto on_error; } date_time_values_string_index += timezone_string_size - 1; } if( number_of_date_time_values > ( 6 + empty_date_element_correction ) ) { ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; if( narrow_string_copy( (char *) &( ( *date_time_values_string )[ date_time_values_string_index ] ), (char *) timezone_name, timezone_name_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set timezone name in data time values string.", function ); goto on_error; } date_time_values_string_index += timezone_name_size - 1; } ( *date_time_values_string )[ date_time_values_string_index ] = 0; if( libfvalue_split_utf8_string_free( &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split date time elements.", function ); goto on_error; } return( 1 ); on_error: if( date_time_values != NULL ) { libfvalue_split_utf8_string_free( &date_time_values, NULL ); } if( *date_time_values_string != NULL ) { memory_free( *date_time_values_string ); *date_time_values_string = NULL; } *date_time_values_string_size = 0; return( -1 ); } /* Generate date time values string within a xheader value * Sets date time values string and size * Returns 1 if successful or -1 on error */ int libewf_generate_date_xheader_value( time_t timestamp, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ) { struct tm time_elements; static char *function = "libewf_generate_date_xheader_value"; size_t date_time_values_string_index = 0; int print_count = 0; #if defined( WINAPI ) size_t tzname_length = 0; #endif if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( *date_time_values_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: date time values string already created.", function ); return( -1 ); } if( date_time_values_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string size.", function ); return( -1 ); } if( libewf_date_time_localtime( ×tamp, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create time elements.", function ); goto on_error; } if( ( time_elements.tm_year + 1900 ) > 10000 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported year value.", function ); goto on_error; } *date_time_values_string_size = 64; *date_time_values_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *date_time_values_string_size ); if( *date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create date time values string.", function ); goto on_error; } if( libewf_utf8_string_day_of_week_copy_from_time_elements( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of week to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; if( libewf_utf8_string_month_copy_from_time_elements( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; if( time_elements.tm_mday < 10 ) { ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; } if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; if( libewf_utf8_string_time_copy_from_time_elements( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy time to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( *date_time_values_string, *date_time_values_string_size, &date_time_values_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to date time values string.", function ); goto on_error; } ( *date_time_values_string )[ date_time_values_string_index - 1 ] = (uint8_t) ' '; #if defined( _BSD_SOURCE ) time_elements.tm_gmtoff /= 60; 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)", time_elements.tm_gmtoff / 60, time_elements.tm_gmtoff % 60, time_elements.tm_zone ); #elif defined( WINAPI ) /* WINAPI sometimes uses long timezone names */ tzname_length = narrow_string_length( _tzname[ time_elements.tm_isdst ] ); if( tzname_length <= 4 ) { 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", _tzname[ time_elements.tm_isdst ] ); } else { print_count = 0; } #else 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", tzname[ time_elements.tm_isdst ] ); #endif if( ( print_count <= -1 ) || ( (size_t) print_count > ( *date_time_values_string_size - date_time_values_string_index ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set date time values string.", function ); goto on_error; } date_time_values_string_index += print_count; ( *date_time_values_string )[ date_time_values_string_index ] = 0; return( 1 ); on_error: if( *date_time_values_string != NULL ) { memory_free( *date_time_values_string ); *date_time_values_string = NULL; } *date_time_values_string_size = 0; return( -1 ); } /* Parses a xheader for the values * Returns 1 if successful or -1 on error */ int libewf_header_values_parse_xheader( libfvalue_table_t *header_values, const uint8_t *xheader, size_t xheader_size, libcerror_error_t **error ) { static char *function = "libewf_header_values_parse_xheader"; if( libfvalue_table_copy_from_utf8_xml_string( header_values, xheader, xheader_size, (uint8_t *) "xheader", 7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 string to header values table.", function ); return( -1 ); } if( libewf_header_values_parse_xheader_date_value( header_values, (uint8_t *) "acquiry_date", 13, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse xheader date value: acquiry_date.", function ); return( -1 ); } return( 1 ); } /* Parses a xheader date value * Returns 1 if successful or -1 on error */ int libewf_header_values_parse_xheader_date_value( libfvalue_table_t *header_values, const uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ) { libfvalue_value_t *header_value = NULL; uint8_t *date_time_values_string = NULL; uint8_t *value_data = NULL; static char *function = "libewf_header_values_parse_xheader_date_value"; size_t date_time_values_string_size = 0; size_t value_data_size = 0; int encoding = 0; int result = 0; result = libfvalue_table_get_value_by_identifier( header_values, identifier, identifier_size, &header_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); goto on_error; } else if( result == 1 ) { if( libfvalue_value_get_data( header_value, &value_data, &value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s data.", function, (char *) identifier ); goto on_error; } result = libewf_convert_date_xheader_value( value_data, value_data_size, &date_time_values_string, &date_time_values_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to create date time values string.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else if( result != 0 ) { /* Make sure to determine the actual length of the date time values string */ date_time_values_string_size = 1 + narrow_string_length( (char *) date_time_values_string ); if( libfvalue_value_set_data( header_value, date_time_values_string, date_time_values_string_size, LIBFVALUE_CODEPAGE_UTF8, LIBFVALUE_VALUE_DATA_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s data.", function, (char *) identifier ); goto on_error; } memory_free( date_time_values_string ); date_time_values_string = NULL; } #if defined( HAVE_VERBOSE_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unsupported xheader date value: %s.\n", function, (char *) identifier ); } #endif } return( 1 ); on_error: if( date_time_values_string != NULL ) { memory_free( date_time_values_string ); } return( -1 ); } /* Generate an xheader * Sets xheader and the xheader size * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_xheader( libfvalue_table_t *header_values, time_t timestamp, uint8_t **xheader, size_t *xheader_size, libcerror_error_t **error ) { libfvalue_value_t *header_value = NULL; uint8_t *generated_acquiry_date = NULL; uint8_t *identifier = NULL; char *xml_head = NULL; char *xml_xheader_close_tag = NULL; char *xml_xheader_open_tag = NULL; static char *function = "libewf_header_values_generate_xheader"; size_t acquiry_date_string_length = 0; size_t generated_acquiry_date_size = 0; size_t identifier_size = 0; size_t value_string_size = 0; size_t xheader_index = 0; size_t xml_head_length = 0; size_t xml_xheader_close_tag_length = 0; size_t xml_xheader_open_tag_length = 0; int header_value_index = 0; int number_of_header_values = 0; int result = 0; if( xheader == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid xheader.", function ); return( -1 ); } if( *xheader != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: xheader already created.", function ); return( -1 ); } if( xheader_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( libfvalue_table_get_number_of_values( header_values, &number_of_header_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of header values.", function ); goto on_error; } xml_head = "\n"; xml_head_length = narrow_string_length( xml_head ); xml_xheader_open_tag = "\n"; xml_xheader_open_tag_length = narrow_string_length( xml_xheader_open_tag ); xml_xheader_close_tag = "\n\n"; 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 */ *xheader_size = 3 + xml_head_length + xml_xheader_open_tag_length + xml_xheader_close_tag_length; for( header_value_index = 0; header_value_index < number_of_header_values; header_value_index++ ) { if( libfvalue_table_get_value_by_index( header_values, header_value_index, &header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %d.", function, header_value_index ); goto on_error; } if( libfvalue_value_get_identifier( header_value, &identifier, &identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve identifier of header value: %d.", function, header_value_index ); goto on_error; } if( ( identifier == NULL ) || ( identifier_size == 0 ) ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: missing identifier for header value: %d.\n", function, header_value_index ); } #endif continue; } result = libfvalue_value_has_data( header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data of header value: %s.", function, (char *) identifier ); goto on_error; } else if( result == 0 ) { if( ( generated_acquiry_date == NULL ) && ( identifier_size == 13 ) && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) { if( libewf_generate_date_xheader_value( timestamp, &generated_acquiry_date, &generated_acquiry_date_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to generate acquiry date header value.", function ); #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { acquiry_date_string_length = narrow_string_length( (char *) generated_acquiry_date ); /* Reserve space for a leading tab, , header value, and a newline * Make sure to determine the effective length of the acquiry date time values string */ *xheader_size += 7 + ( 2 * ( identifier_size - 1 ) ) + acquiry_date_string_length; } } continue; } result = libfvalue_value_get_utf8_string_size( header_value, 0, &value_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: %s.", function, (char *) identifier ); goto on_error; } if( value_string_size > 1 ) { /* Reserve space for a leading tab, value and a newline */ *xheader_size += 7 + ( 2 * ( identifier_size - 1 ) ) + ( value_string_size - 1 ); } } /* Reserve space for the end-of-string character */ *xheader_size += 1; *xheader = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *xheader_size ); if( *xheader == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create xheader.", function ); goto on_error; } ( *xheader )[ xheader_index++ ] = 0xef; ( *xheader )[ xheader_index++ ] = 0xbb; ( *xheader )[ xheader_index++ ] = 0xbf; if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), xml_head, xml_head_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy XML head string.", function ); goto on_error; } xheader_index += xml_head_length; if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), xml_xheader_open_tag, xml_xheader_open_tag_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy xheader open tag string.", function ); goto on_error; } xheader_index += xml_xheader_open_tag_length; for( header_value_index = 0; header_value_index < number_of_header_values; header_value_index++ ) { if( libfvalue_table_get_value_by_index( header_values, header_value_index, &header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %d.", function, header_value_index ); goto on_error; } if( libfvalue_value_get_identifier( header_value, &identifier, &identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve identifier of header value: %d.", function, header_value_index ); goto on_error; } if( ( identifier == NULL ) || ( identifier_size == 0 ) ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: missing identifier for header value: %d.\n", function, header_value_index ); } #endif continue; } result = libfvalue_value_has_data( header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data of header value: %s.", function, (char *) identifier ); goto on_error; } else if( result == 0 ) { continue; } result = libfvalue_value_get_utf8_string_size( header_value, 0, &value_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of header value: %s.", function, (char *) identifier ); goto on_error; } if( value_string_size > 1 ) { ( *xheader )[ xheader_index++ ] = (uint8_t) '\t'; ( *xheader )[ xheader_index++ ] = (uint8_t) '<'; if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %s open tag string.", function, (char *) identifier ); goto on_error; } xheader_index += identifier_size - 1; ( *xheader )[ xheader_index++ ] = (uint8_t) '>'; result = libfvalue_value_copy_to_utf8_string_with_index( header_value, 0, *xheader, *xheader_size, &xheader_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value: %s to string.", function, (char *) identifier ); goto on_error; } ( *xheader )[ xheader_index - 1 ] = (uint8_t) '<'; ( *xheader )[ xheader_index++ ] = (uint8_t) '/'; if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %s close tag string.", function, (char *) identifier ); goto on_error; } xheader_index += identifier_size - 1; ( *xheader )[ xheader_index++ ] = (uint8_t) '>'; ( *xheader )[ xheader_index++ ] = (uint8_t) '\n'; } } if( generated_acquiry_date != NULL ) { if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), "\t", 15 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy acquiry_date open tag string.", function ); goto on_error; } xheader_index += 15; if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), (char *) generated_acquiry_date, acquiry_date_string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy generated acquiry date string.", function ); goto on_error; } xheader_index += acquiry_date_string_length; memory_free( generated_acquiry_date ); generated_acquiry_date = NULL; if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), "\n", 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy acquiry_date close tag string.", function ); goto on_error; } xheader_index += 16; } if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), xml_xheader_close_tag, xml_xheader_close_tag_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy xheader close tag string.", function ); goto on_error; } xheader_index += xml_xheader_close_tag_length; /* Make sure the string is terminated */ ( *xheader )[ xheader_index ] = 0; return( 1 ); on_error: if( generated_acquiry_date != NULL ) { memory_free( generated_acquiry_date ); } if( *xheader != NULL ) { memory_free( *xheader ); *xheader = NULL; } *xheader_size = 0; return( -1 ); } /* Generate an EWFX header * Sets header and the header size * Returns 1 if successful or -1 on error */ int libewf_header_values_generate_header_ewfx( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ) { uint8_t *header_string = NULL; static char *function = "libewf_header_values_generate_header_ewfx"; size_t header_string_size = 0; if( libewf_header_values_generate_utf8_header_string( header_values, LIBEWF_HEADER_STRING_TYPE_3, (uint8_t *) "\n", 1, timestamp, compression_level, &header_string, &header_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header string.", function ); goto on_error; } if( libewf_header_values_convert_utf8_header_string_to_header( header_string, header_string_size, header, header_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header.", function ); goto on_error; } memory_free( header_string ); return( 1 ); on_error: if( header_string != NULL ) { memory_free( header_string ); } return( -1 ); } libewf-20140807/libewf/ewf_digest.h0000644000175000017500000000271613421013623021071 0ustar00lordyestalordyesta00000000000000/* * EWF degest section * * 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( _EWF_DIGEST_H ) #define _EWF_DIGEST_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_digest ewf_digest_t; struct ewf_digest { /* The MD5 hash of the aquired data * consists of 16 bytes */ uint8_t md5_hash[ 16 ]; /* The SHA1 hash of the aquired data * consists of 20 bytes */ uint8_t sha1_hash[ 20 ]; /* Padding * consists of 40 bytes * value should be 0x00 */ uint8_t padding1[ 40 ]; /* The section checksum of all (previous) digest data * consists of 4 bytes (32 bits) * starts with offset 76 */ uint8_t checksum[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_header_sections.c0000644000175000017500000004250213421013624023431 0ustar00lordyestalordyesta00000000000000/* * Header sections functions * * 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 . */ #include #include #include #include "libewf_definitions.h" #include "libewf_io_handle.h" #include "libewf_header_sections.h" #include "libewf_header_values.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfvalue.h" #include "ewf_definitions.h" /* Initialize the header sections * Returns 1 if successful or -1 on error */ int libewf_header_sections_initialize( libewf_header_sections_t **header_sections, libcerror_error_t **error ) { static char *function = "libewf_header_sections_initialize"; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( *header_sections != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid header sections value already set.", function ); return( -1 ); } *header_sections = memory_allocate_structure( libewf_header_sections_t ); if( *header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create header sections.", function ); goto on_error; } if( memory_set( *header_sections, 0, sizeof( libewf_header_sections_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear header sections.", function ); goto on_error; } return( 1 ); on_error: if( *header_sections != NULL ) { memory_free( *header_sections ); *header_sections = NULL; } return( -1 ); } /* Frees the header sections including elements * Returns 1 if successful or -1 on error */ int libewf_header_sections_free( libewf_header_sections_t **header_sections, libcerror_error_t **error ) { static char *function = "libewf_header_sections_free"; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( *header_sections != NULL ) { if( ( *header_sections )->header != NULL ) { memory_free( ( *header_sections )->header ); } if( ( *header_sections )->header2 != NULL ) { memory_free( ( *header_sections )->header2 ); } if( ( *header_sections )->xheader != NULL ) { memory_free( ( *header_sections )->xheader ); } memory_free( *header_sections ); *header_sections = NULL; } return( 1 ); } /* Clones the header sections * Returns 1 if successful or -1 on error */ int libewf_header_sections_clone( libewf_header_sections_t **destination_header_sections, libewf_header_sections_t *source_header_sections, libcerror_error_t **error ) { static char *function = "libewf_header_sections_clone"; if( destination_header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination header sections.", function ); return( -1 ); } if( *destination_header_sections != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination header sections already set.", function ); return( -1 ); } if( source_header_sections == NULL ) { *destination_header_sections = NULL; return( 1 ); } if( libewf_header_sections_initialize( destination_header_sections, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination header sections.", function ); goto on_error; } if( *destination_header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination header sections.", function ); goto on_error; } if( source_header_sections->header != NULL ) { ( *destination_header_sections )->header = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_header_sections->header_size ); if( ( *destination_header_sections )->header == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination header.", function ); goto on_error; } if( memory_copy( ( *destination_header_sections )->header, source_header_sections->header, sizeof( uint8_t ) * source_header_sections->header_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination header.", function ); goto on_error; } ( *destination_header_sections )->header_size = source_header_sections->header_size; } if( source_header_sections->header2 != NULL ) { ( *destination_header_sections )->header2 = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_header_sections->header2_size ); if( ( *destination_header_sections )->header2 == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination header2.", function ); goto on_error; } if( memory_copy( ( *destination_header_sections )->header2, source_header_sections->header2, sizeof( uint8_t ) * source_header_sections->header2_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination header2.", function ); goto on_error; } ( *destination_header_sections )->header2_size = source_header_sections->header2_size; } if( source_header_sections->xheader != NULL ) { ( *destination_header_sections )->xheader = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_header_sections->xheader_size ); if( ( *destination_header_sections )->xheader == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination xheader.", function ); goto on_error; } if( memory_copy( ( *destination_header_sections )->xheader, source_header_sections->xheader, sizeof( uint8_t ) * source_header_sections->xheader_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination xheader.", function ); goto on_error; } ( *destination_header_sections )->xheader_size = source_header_sections->xheader_size; } ( *destination_header_sections )->number_of_header_sections = source_header_sections->number_of_header_sections; return( 1 ); on_error: if( *destination_header_sections != NULL ) { if( ( *destination_header_sections )->xheader != NULL ) { memory_free( ( *destination_header_sections )->xheader ); } if( ( *destination_header_sections )->header2 != NULL ) { memory_free( ( *destination_header_sections )->header2 ); } if( ( *destination_header_sections )->header != NULL ) { memory_free( ( *destination_header_sections )->header ); } memory_free( *destination_header_sections ); *destination_header_sections = NULL; } return( -1 ); } /* Create the header sections from the header values * Returns 1 on success or -1 on error */ int libewf_header_sections_generate( libewf_header_sections_t *header_sections, libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t format, int header_codepage, libcerror_error_t **error ) { static char *function = "libewf_header_sections_generate"; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( format == LIBEWF_FORMAT_EWF ) { if( libewf_header_values_generate_header_ewf( header_values, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } } else if( format == LIBEWF_FORMAT_ENCASE1 ) { if( libewf_header_values_generate_header_encase1( header_values, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } } else if( ( format == LIBEWF_FORMAT_ENCASE2 ) || ( format == LIBEWF_FORMAT_ENCASE3 ) ) { if( libewf_header_values_generate_header_encase2( header_values, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } } else if( ( format == LIBEWF_FORMAT_FTK_IMAGER ) || ( format == LIBEWF_FORMAT_SMART ) ) { if( libewf_header_values_generate_header_ftk( header_values, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } } else if( ( format == LIBEWF_FORMAT_ENCASE4 ) || ( format == LIBEWF_FORMAT_ENCASE5 ) || ( format == LIBEWF_FORMAT_ENCASE6 ) || ( format == LIBEWF_FORMAT_ENCASE7 ) ) { if( libewf_header_values_generate_header_encase4( header_values, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } if( libewf_header_values_generate_header2( header_values, format, timestamp, compression_level, &( header_sections->header2 ), &( header_sections->header2_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header2 section.", function ); goto on_error; } } else if( ( format == LIBEWF_FORMAT_LINEN5 ) || ( format == LIBEWF_FORMAT_LINEN6 ) || ( format == LIBEWF_FORMAT_LINEN7 ) ) { if( libewf_header_values_generate_header_linen( header_values, format, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } } else if( format == LIBEWF_FORMAT_EWFX ) { if( libewf_header_values_generate_header_ewfx( header_values, timestamp, compression_level, &( header_sections->header ), &( header_sections->header_size ), header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header section.", function ); goto on_error; } if( libewf_header_values_generate_header2( header_values, format, timestamp, compression_level, &( header_sections->header2 ), &( header_sections->header2_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header2 section.", function ); goto on_error; } if( libewf_header_values_generate_xheader( header_values, timestamp, &( header_sections->xheader ), &( header_sections->xheader_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create xheader section.", function ); goto on_error; } } return( 1 ); on_error: if( header_sections->header2 != NULL ) { memory_free( header_sections->header2 ); header_sections->header2 = NULL; header_sections->header2_size = 0; } if( header_sections->header != NULL ) { memory_free( header_sections->header ); header_sections->header = NULL; header_sections->header_size = 0; } return( -1 ); } /* Parses the header, header2 and/or xheader section for header values * Returns 1 if successful or -1 on error */ int libewf_header_sections_parse( libewf_header_sections_t *header_sections, libewf_io_handle_t *io_handle, libfvalue_table_t *header_values, uint8_t *format, libcerror_error_t **error ) { static char *function = "libewf_header_sections_parse"; int result_header = 1; int result_header2 = 1; int result_xheader = 1; if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( format == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid format.", function ); return( -1 ); } /* For EWF version 1 format read all the header sections * and overwrite values by the most specific data * This also applied to the format */ if( header_sections->header != NULL ) { if( libewf_header_values_parse_header( header_values, header_sections->header, header_sections->header_size, io_handle->header_codepage, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header.", function ); result_header = -1; } } if( header_sections->header2 != NULL ) { if( libewf_header_values_parse_header2( header_values, header_sections->header2, header_sections->header2_size, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header2.", function ); result_header2 = -1; } } if( header_sections->xheader != NULL ) { if( libewf_header_values_parse_xheader( header_values, header_sections->xheader, header_sections->xheader_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse xheader.", function ); result_xheader = -1; } *format = LIBEWF_FORMAT_EWFX; } if( ( result_header != 1 ) && ( result_header2 != 1 ) && ( result_xheader != 1 ) ) { return( -1 ); } if( ( result_header != 1 ) || ( result_header2 != 1 ) || ( result_xheader != 1 ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } return( 1 ); } libewf-20140807/libewf/libewf_file_entry.h0000644000175000017500000001570213421013624022441 0ustar00lordyestalordyesta00000000000000/* * File entry functions * * 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_INTERNAL_FILE_ENTRY_H ) #define _LIBEWF_INTERNAL_FILE_ENTRY_H #include #include #include "libewf_extern.h" #include "libewf_handle.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_single_file_entry.h" #include "libewf_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_internal_file_entry libewf_internal_file_entry_t; struct libewf_internal_file_entry { /* The internal EWF handle */ libewf_internal_handle_t *internal_handle; /* The file entry tree node */ libcdata_tree_node_t *file_entry_tree_node; /* The file entry flags */ uint8_t flags; /* The offset */ off64_t offset; }; int libewf_file_entry_initialize( libewf_file_entry_t **file_entry, libewf_internal_handle_t *internal_handle, libcdata_tree_node_t *file_entry_tree_node, uint8_t flags, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_free( libewf_file_entry_t **file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_type( libewf_file_entry_t *file_entry, uint8_t *type, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_flags( libewf_file_entry_t *file_entry, uint32_t *flags, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_media_data_offset( libewf_file_entry_t *file_entry, off64_t *media_data_offset, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_media_data_size( libewf_file_entry_t *file_entry, size64_t *media_data_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_duplicate_media_data_offset( libewf_file_entry_t *file_entry, off64_t *duplicate_media_data_offset, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_name_size( libewf_file_entry_t *file_entry, size_t *utf8_name_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_name( libewf_file_entry_t *file_entry, uint8_t *utf8_name, size_t utf8_name_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_name_size( libewf_file_entry_t *file_entry, size_t *utf16_name_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_name( libewf_file_entry_t *file_entry, uint16_t *utf16_name, size_t utf16_name_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_size( libewf_file_entry_t *file_entry, size64_t *size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_creation_time( libewf_file_entry_t *file_entry, uint32_t *creation_time, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_modification_time( libewf_file_entry_t *file_entry, uint32_t *modification_time, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_access_time( libewf_file_entry_t *file_entry, uint32_t *access_time, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_entry_modification_time( libewf_file_entry_t *file_entry, uint32_t *entry_modification_time, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_hash_value_md5( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_hash_value_md5( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf8_hash_value_sha1( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_utf16_hash_value_sha1( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_file_entry_read_buffer( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_file_entry_read_random( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBEWF_EXTERN \ off64_t libewf_file_entry_seek_offset( libewf_file_entry_t *file_entry, off64_t offset, int whence, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_offset( libewf_file_entry_t *file_entry, off64_t *offset, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_number_of_sub_file_entries( libewf_file_entry_t *file_entry, int *number_of_sub_entries, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry( libewf_file_entry_t *file_entry, int sub_file_entry_index, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf8_name( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf8_path( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf16_name( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_sub_file_entry_by_utf16_path( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_media_values.c0000644000175000017500000001141513421013625022730 0ustar00lordyestalordyesta00000000000000/* * Media values functions * * 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 . */ #include #include #include "libewf_libcerror.h" #include "libewf_media_values.h" #include "ewf_definitions.h" /* Initialize the media values * Returns 1 if successful or -1 on error */ int libewf_media_values_initialize( libewf_media_values_t **media_values, libcerror_error_t **error ) { static char *function = "libewf_media_values_initialize"; if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( *media_values != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid media values value already set.", function ); return( -1 ); } *media_values = memory_allocate_structure( libewf_media_values_t ); if( *media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create media values.", function ); goto on_error; } if( memory_set( *media_values, 0, sizeof( libewf_media_values_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear media values.", function ); goto on_error; } ( *media_values )->chunk_size = EWF_MINIMUM_CHUNK_SIZE; ( *media_values )->sectors_per_chunk = 64; ( *media_values )->bytes_per_sector = 512; ( *media_values )->media_flags = 0x01; return( 1 ); on_error: if( *media_values != NULL ) { memory_free( *media_values ); *media_values = NULL; } return( -1 ); } /* Frees the media values including elements * Returns 1 if successful or -1 on error */ int libewf_media_values_free( libewf_media_values_t **media_values, libcerror_error_t **error ) { static char *function = "libewf_media_values_free"; if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( *media_values != NULL ) { memory_free( *media_values ); *media_values = NULL; } return( 1 ); } /* Clones the media values * Returns 1 if successful or -1 on error */ int libewf_media_values_clone( libewf_media_values_t **destination_media_values, libewf_media_values_t *source_media_values, libcerror_error_t **error ) { static char *function = "libewf_media_values_clone"; if( destination_media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination media values.", function ); return( -1 ); } if( *destination_media_values != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination media values already set.", function ); return( -1 ); } if( source_media_values == NULL ) { *destination_media_values = NULL; return( 1 ); } *destination_media_values = memory_allocate_structure( libewf_media_values_t ); if( *destination_media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination media values.", function ); goto on_error; } if( memory_copy( *destination_media_values, source_media_values, sizeof( libewf_media_values_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination media values.", function ); goto on_error; } return( 1 ); on_error: if( *destination_media_values != NULL ) { memory_free( *destination_media_values ); *destination_media_values = NULL; } return( -1 ); } libewf-20140807/libewf/libewf_section.h0000664000175000017500000002773013421013625021754 0ustar00lordyestalordyesta00000000000000/* * Section reading/writing functions * * 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_SECTION_H ) #define _LIBEWF_SECTION_H #include #include #include "libewf_hash_sections.h" #include "libewf_header_sections.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #include "libewf_single_files.h" #include "ewf_data.h" #include "ewf_section.h" #include "ewf_table.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_section libewf_section_t; struct libewf_section { /* The section type string * consists of maximum 16 bytes */ uint8_t type[ 17 ]; /* The section type string length */ size_t type_length; /* The start offset of the section */ off64_t start_offset; /* The end offset of the section */ off64_t end_offset; /* The size the section */ size64_t size; }; int libewf_section_test_zero( uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); int libewf_section_initialize( libewf_section_t **section, libcerror_error_t **error ); int libewf_section_free( libewf_section_t **section, libcerror_error_t **error ); int libewf_section_clone( libewf_section_t **destination_section, libewf_section_t *source_section, libcerror_error_t **error ); int libewf_section_set( libewf_section_t *sections, uint8_t *type, size_t type_length, off64_t start_offset, off64_t end_offset, libcerror_error_t **error ); ssize_t libewf_section_start_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t file_offset, libcerror_error_t **error ); ssize_t libewf_section_start_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ); #if defined( HAVE_DEBUG_OUTPUT ) ssize_t libewf_section_debug_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ); #endif ssize_t libewf_section_last_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t *type_string, size_t type_string_length, off64_t section_offset, uint8_t ewf_format, libcerror_error_t **error ); ssize_t libewf_section_compressed_string_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t **uncompressed_string, size_t *uncompressed_string_size, libcerror_error_t **error ); ssize_t libewf_section_write_compressed_string( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t *type_string, size_t type_string_length, off64_t section_offset, uint8_t *uncompressed_string, size_t uncompressed_string_size, int8_t compression_level, libcerror_error_t **error ); ssize_t libewf_section_data_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ); ssize_t libewf_section_data_write( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_media_values_t *media_values, ewf_data_t **cached_data_section, libcerror_error_t **error ); ssize_t libewf_section_digest_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ); ssize_t libewf_section_digest_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ); ssize_t libewf_section_error2_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcdata_range_list_t *acquiry_errors, libcerror_error_t **error ); ssize_t libewf_section_error2_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libcdata_range_list_t *acquiry_errors, libcerror_error_t **error ); ssize_t libewf_section_hash_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ); ssize_t libewf_section_hash_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ); ssize_t libewf_section_header_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_header_sections_t *header_sections, libcerror_error_t **error ); ssize_t libewf_section_header_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, int8_t compression_level, libcerror_error_t **error ); ssize_t libewf_section_header2_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_header_sections_t *header_sections, libcerror_error_t **error ); ssize_t libewf_section_header2_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, int8_t compression_level, libcerror_error_t **error ); ssize_t libewf_section_ltree_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t **cached_ltree_data, size_t *cached_ltree_data_size, libcerror_error_t **error ); ssize_t libewf_section_sectors_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, size64_t chunks_data_size, libcerror_error_t **error ); ssize_t libewf_section_session_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcdata_array_t *sessions, libcdata_array_t *tracks, libcerror_error_t **error ); ssize_t libewf_section_session_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libcdata_array_t *sessions, libcdata_array_t *tracks, libcerror_error_t **error ); ssize_t libewf_section_table_header_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t format, uint32_t *number_of_offsets, uint64_t *base_offset, libcerror_error_t **error ); ssize_t libewf_section_table_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint8_t *type_string, size_t type_string_length, off64_t section_offset, off64_t base_offset, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, size64_t chunks_data_size, uint8_t ewf_format, libcerror_error_t **error ); ssize_t libewf_section_volume_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ); ssize_t libewf_section_volume_e01_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ); ssize_t libewf_section_volume_e01_write( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_media_values_t *media_values, libcerror_error_t **error ); ssize_t libewf_section_volume_s01_read( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libcerror_error_t **error ); ssize_t libewf_section_volume_s01_write( libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_media_values_t *media_values, libcerror_error_t **error ); ssize_t libewf_section_xhash_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_hash_sections_t *hash_sections, libcerror_error_t **error ); ssize_t libewf_section_xhash_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_hash_sections_t *hash_sections, int8_t compression_level, libcerror_error_t **error ); ssize_t libewf_section_xheader_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_header_sections_t *header_sections, libcerror_error_t **error ); ssize_t libewf_section_xheader_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, int8_t compression_level, libcerror_error_t **error ); ssize_t libewf_section_delta_chunk_read( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint32_t *chunk_index, uint32_t *chunk_size, libcerror_error_t **error ); ssize_t libewf_section_delta_chunk_write( libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, uint32_t chunk_index, uint8_t *chunk_buffer, uint32_t chunk_size, uint8_t *checksum_buffer, uint32_t *chunk_checksum, uint8_t write_checksum, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_hash_values.c0000664000175000017500000006677613421024433022621 0ustar00lordyestalordyesta00000000000000/* * Hash values functions * * 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 . */ #include #include #include #include #include "libewf_definitions.h" #include "libewf_hash_values.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" #include "ewf_definitions.h" /* Initializes the hash values * Returns 1 if successful or -1 on error */ int libewf_hash_values_initialize( libfvalue_table_t **hash_values, libcerror_error_t **error ) { static char *function = "libewf_hash_values_initialize"; if( libfvalue_table_initialize( hash_values, LIBEWF_HASH_VALUES_DEFAULT_NUMBER, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash values.", function ); return( -1 ); } return( 1 ); } /* Parses a MD5 hash for its value * Returns 1 if successful or -1 on error */ int libewf_hash_values_parse_md5_hash( libfvalue_table_t *hash_values, const uint8_t *md5_hash, size_t md5_hash_size, libcerror_error_t **error ) { uint8_t md5_hash_string[ 33 ]; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_hash_values_parse_md5_hash"; size_t md5_hash_index = 0; size_t md5_hash_string_index = 0; uint8_t md5_digit = 0; int result = 0; if( md5_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid MD5 hash.", function ); return( -1 ); } if( md5_hash_size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: MD5 hash too small.", function ); return( -1 ); } result = libfvalue_table_get_value_by_identifier( hash_values, (uint8_t *) "MD5", 4, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve if hash value: MD5.", function ); goto on_error; } else if( result == 0 ) { for( md5_hash_index = 0; md5_hash_index < md5_hash_size; md5_hash_index++ ) { md5_digit = md5_hash[ md5_hash_index ] / 16; if( md5_digit <= 9 ) { md5_hash_string[ md5_hash_string_index++ ] = (uint8_t) '0' + md5_digit; } else { md5_hash_string[ md5_hash_string_index++ ] = (uint8_t) 'a' + ( md5_digit - 10 ); } md5_digit = md5_hash[ md5_hash_index ] % 16; if( md5_digit <= 9 ) { md5_hash_string[ md5_hash_string_index++ ] = (uint8_t) '0' + md5_digit; } else { md5_hash_string[ md5_hash_string_index++ ] = (uint8_t) 'a' + ( md5_digit - 10 ); } } md5_hash_string[ md5_hash_string_index++ ] = 0; if( libfvalue_value_type_initialize( &hash_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash value.", function ); goto on_error; } if( libfvalue_value_set_identifier( hash_value, (uint8_t *) "MD5", 4, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: MD5 identifier.", function ); goto on_error; } if( libfvalue_value_set_data( hash_value, (uint8_t *) md5_hash_string, 33, LIBFVALUE_CODEPAGE_UTF8, LIBFVALUE_VALUE_DATA_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: MD5 data.", function ); goto on_error; } if( libfvalue_table_set_value( hash_values, hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: MD5 in table.", function ); goto on_error; } hash_value = NULL; } return( 1 ); on_error: if( hash_value != NULL ) { libfvalue_value_free( &hash_value, NULL ); } return( -1 ); } /* Parses an SHA1 hash for its value * Returns 1 if successful or -1 on error */ int libewf_hash_values_parse_sha1_hash( libfvalue_table_t *hash_values, const uint8_t *sha1_hash, size_t sha1_hash_size, libcerror_error_t **error ) { uint8_t sha1_hash_string[ 41 ]; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_hash_values_parse_sha1_hash"; size_t sha1_hash_index = 0; size_t sha1_hash_string_index = 0; int result = 0; uint8_t sha1_digit = 0; if( hash_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash values.", function ); return( -1 ); } if( sha1_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid SHA1 hash.", function ); return( -1 ); } if( sha1_hash_size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: SHA1 hash too small.", function ); return( -1 ); } result = libfvalue_table_get_value_by_identifier( hash_values, (uint8_t *) "SHA1", 5, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve if hash value: SHA1.", function ); goto on_error; } else if( result == 0 ) { for( sha1_hash_index = 0; sha1_hash_index < sha1_hash_size; sha1_hash_index++ ) { sha1_digit = sha1_hash[ sha1_hash_index ] / 16; if( sha1_digit <= 9 ) { sha1_hash_string[ sha1_hash_string_index++ ] = (uint8_t) '0' + sha1_digit; } else { sha1_hash_string[ sha1_hash_string_index++ ] = (uint8_t) 'a' + ( sha1_digit - 10 ); } sha1_digit = sha1_hash[ sha1_hash_index ] % 16; if( sha1_digit <= 9 ) { sha1_hash_string[ sha1_hash_string_index++ ] = (uint8_t) '0' + sha1_digit; } else { sha1_hash_string[ sha1_hash_string_index++ ] = (uint8_t) 'a' + ( sha1_digit - 10 ); } } sha1_hash_string[ sha1_hash_string_index++ ] = 0; if( libfvalue_value_type_initialize( &hash_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash value.", function ); goto on_error; } if( libfvalue_value_set_identifier( hash_value, (uint8_t *) "SHA1", 5, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA1 identifier.", function ); goto on_error; } if( libfvalue_value_set_data( hash_value, (uint8_t *) sha1_hash_string, 41, LIBFVALUE_CODEPAGE_UTF8, LIBFVALUE_VALUE_DATA_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA1 data.", function ); goto on_error; } if( libfvalue_table_set_value( hash_values, hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA1 in table.", function ); goto on_error; } hash_value = NULL; } return( 1 ); on_error: if( hash_value != NULL ) { libfvalue_value_free( &hash_value, NULL ); } return( -1 ); } /* Parse an xhash for the hash values * Returns 1 if successful or -1 on error */ int libewf_hash_values_parse_xhash( libfvalue_table_t *hash_values, const uint8_t *xhash, size_t xhash_size, libcerror_error_t **error ) { static char *function = "libewf_hash_values_parse_xhash"; if( libfvalue_table_copy_from_utf8_xml_string( hash_values, xhash, xhash_size, (uint8_t *) "xhash", 5, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 string to hash values table.", function ); return( -1 ); } return( 1 ); } /* Generate an xhash * Sets xhash and xhash size * Returns 1 if successful or -1 on error */ int libewf_hash_values_generate_xhash( libfvalue_table_t *hash_values, uint8_t **xhash, size_t *xhash_size, libcerror_error_t **error ) { libfvalue_value_t *hash_value = NULL; uint8_t *identifier = NULL; char *xml_head = NULL; char *xml_xhash_close_tag = NULL; char *xml_xhash_open_tag = NULL; static char *function = "libewf_hash_values_generate_xhash"; size_t xhash_index = 0; size_t identifier_size = 0; size_t value_string_size = 0; size_t xml_head_length = 0; size_t xml_xhash_close_tag_length = 0; size_t xml_xhash_open_tag_length = 0; int hash_value_index = 0; int number_of_hash_values = 0; int result = 0; if( xhash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid xhash.", function ); return( -1 ); } if( *xhash != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: xhash already created.", function ); return( -1 ); } if( xhash_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid xhash size.", function ); return( -1 ); } if( libfvalue_table_get_number_of_values( hash_values, &number_of_hash_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of hash values.", function ); goto on_error; } xml_head = "\n"; xml_head_length = narrow_string_length( xml_head ); xml_xhash_open_tag = "\n"; xml_xhash_open_tag_length = narrow_string_length( xml_xhash_open_tag ); xml_xhash_close_tag = "\n\n"; 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 */ *xhash_size = 3 + xml_head_length + xml_xhash_open_tag_length + xml_xhash_close_tag_length; for( hash_value_index = 0; hash_value_index < number_of_hash_values; hash_value_index++ ) { if( libfvalue_table_get_value_by_index( hash_values, hash_value_index, &hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %d.", function, hash_value_index ); goto on_error; } if( libfvalue_value_get_identifier( hash_value, &identifier, &identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve identifier of hash value: %d.", function, hash_value_index ); goto on_error; } if( ( identifier == NULL ) || ( identifier_size == 0 ) ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: missing identifier for hash value: %d.\n", function, hash_value_index ); } #endif continue; } result = libfvalue_value_get_utf8_string_size( hash_value, 0, &value_string_size, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of hash value: %s.", function, (char *) identifier ); goto on_error; } if( ( result != 0 ) && ( value_string_size > 1 ) ) { /* Reserve space for a leading tab, value and a newline */ *xhash_size += 7 + ( 2 * ( identifier_size - 1 ) ) + ( value_string_size - 1 ); } } /* Reserve space for the end-of-string character */ *xhash_size += 1; *xhash = (uint8_t *) memory_allocate( sizeof( uint8_t ) * *xhash_size ); if( *xhash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: unable to create xhash.", function ); goto on_error; } ( *xhash )[ xhash_index++ ] = 0xef; ( *xhash )[ xhash_index++ ] = 0xbb; ( *xhash )[ xhash_index++ ] = 0xbf; if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), xml_head, xml_head_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy XML head string.", function ); goto on_error; } xhash_index += xml_head_length; if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), xml_xhash_open_tag, xml_xhash_open_tag_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy xhash open tag string.", function ); goto on_error; } xhash_index += xml_xhash_open_tag_length; for( hash_value_index = 0; hash_value_index < number_of_hash_values; hash_value_index++ ) { if( libfvalue_table_get_value_by_index( hash_values, hash_value_index, &hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %d.", function, hash_value_index ); goto on_error; } if( libfvalue_value_get_identifier( hash_value, &identifier, &identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve identifier of hash value: %d.", function, hash_value_index ); goto on_error; } if( ( identifier == NULL ) || ( identifier_size == 0 ) ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: missing identifier for hash value: %d.\n", function, hash_value_index ); } #endif continue; } result = libfvalue_value_get_utf8_string_size( hash_value, 0, &value_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string size of hash value: %s.", function, (char *) identifier ); goto on_error; } if( ( result != 0 ) && ( value_string_size > 1 ) ) { ( *xhash )[ xhash_index++ ] = (uint8_t) '\t'; ( *xhash )[ xhash_index++ ] = (uint8_t) '<'; if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %s open tag string.", function, (char *) identifier ); goto on_error; } xhash_index += identifier_size - 1; ( *xhash )[ xhash_index++ ] = (uint8_t) '>'; if( libfvalue_value_copy_to_utf8_string_with_index( hash_value, 0, *xhash, *xhash_size, &xhash_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string of hash value: %s.", function, (char *) identifier ); goto on_error; } ( *xhash )[ xhash_index - 1 ] = (uint8_t) '<'; ( *xhash )[ xhash_index++ ] = (uint8_t) '/'; if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %s close tag string.", function, (char *) identifier ); goto on_error; } xhash_index += identifier_size - 1; ( *xhash )[ xhash_index++ ] = (uint8_t) '>'; ( *xhash )[ xhash_index++ ] = (uint8_t) '\n'; } } if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), xml_xhash_close_tag, xml_xhash_close_tag_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy xhash close tag string.", function ); goto on_error; } xhash_index += xml_xhash_close_tag_length; /* Make sure the string is terminated */ ( *xhash )[ xhash_index ] = 0; return( 1 ); on_error: if( *xhash != NULL ) { memory_free( *xhash ); *xhash = NULL; } *xhash_size = 0; return( -1 ); } /* Generate a MD5 hash * Returns 1 if successful or -1 on error */ int libewf_hash_values_generate_md5_hash( libfvalue_table_t *hash_values, uint8_t *md5_hash, size_t md5_hash_size, uint8_t *md5_hash_set, libcerror_error_t **error ) { uint8_t md5_hash_string[ 33 ]; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_hash_values_generate_md5_hash"; size_t md5_hash_index = 0; size_t md5_hash_string_index = 0; uint8_t md5_digit = 0; int result = 0; if( hash_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash values.", function ); return( -1 ); } if( md5_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid MD5 hash.", function ); return( -1 ); } if( md5_hash_size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: MD5 hash too small.", function ); return( -1 ); } if( md5_hash_set == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid MD5 hash set.", function ); return( -1 ); } result = libfvalue_table_get_value_by_identifier( hash_values, (uint8_t *) "MD5", 4, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve if hash value: MD5.", function ); return( -1 ); } /* No need to generate the MD5 hash */ else if( result == 0 ) { *md5_hash_set = 0; return( 1 ); } if( libfvalue_value_copy_to_utf8_string( hash_value, 0, md5_hash_string, 33, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hash value: MD5 to UTF-8 string.", function ); return( -1 ); } while( md5_hash_string_index < 32 ) { if( ( md5_hash_string[ md5_hash_string_index ] >= (uint8_t) '0' ) && ( md5_hash_string[ md5_hash_string_index ] <= (uint8_t) '9' ) ) { md5_digit = (uint8_t) ( md5_hash_string[ md5_hash_string_index ] - (uint8_t) '0' ); } else if( ( md5_hash_string[ md5_hash_string_index ] >= (uint8_t) 'A' ) && ( md5_hash_string[ md5_hash_string_index ] <= (uint8_t) 'F' ) ) { md5_digit = 10 + (uint8_t) ( md5_hash_string[ md5_hash_string_index ] - (uint8_t) 'A' ); } else if( ( md5_hash_string[ md5_hash_string_index ] >= (uint8_t) 'a' ) && ( md5_hash_string[ md5_hash_string_index ] <= (uint8_t) 'f' ) ) { md5_digit = 10 + (uint8_t) ( md5_hash_string[ md5_hash_string_index ] - (uint8_t) 'a' ); } else if( md5_hash_string[ md5_hash_string_index ] == 0 ) { md5_digit = 0; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid hexadecimal digit: 0x%02" PRIx8 " in MD5 string.", function, md5_hash_string[ md5_hash_string_index ] ); return( -1 ); } md5_hash_string_index++; md5_digit <<= 4; if( ( md5_hash_string[ md5_hash_string_index ] >= (uint8_t) '0' ) && ( md5_hash_string[ md5_hash_string_index ] <= (uint8_t) '9' ) ) { md5_digit += (uint8_t) ( md5_hash_string[ md5_hash_string_index ] - (uint8_t) '0' ); } else if( ( md5_hash_string[ md5_hash_string_index ] >= (uint8_t) 'A' ) && ( md5_hash_string[ md5_hash_string_index ] <= (uint8_t) 'F' ) ) { md5_digit += 10 + (uint8_t) ( md5_hash_string[ md5_hash_string_index ] - (uint8_t) 'A' ); } else if( ( md5_hash_string[ md5_hash_string_index ] >= (uint8_t) 'a' ) && ( md5_hash_string[ md5_hash_string_index ] <= (uint8_t) 'f' ) ) { md5_digit += 10 + (uint8_t) ( md5_hash_string[ md5_hash_string_index ] - (uint8_t) 'a' ); } else if( md5_hash_string[ md5_hash_string_index ] != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid hexadecimal digit: 0x%02" PRIx8 " in MD5 string.", function, md5_hash_string[ md5_hash_string_index ] ); return( -1 ); } md5_hash_string_index++; md5_hash[ md5_hash_index++ ] = md5_digit; } *md5_hash_set = 1; return( 1 ); } /* Generate an SHA1 hash * Returns 1 if successful or -1 on error */ int libewf_hash_values_generate_sha1_hash( libfvalue_table_t *hash_values, uint8_t *sha1_hash, size_t sha1_hash_size, uint8_t *sha1_hash_set, libcerror_error_t **error ) { uint8_t sha1_hash_string[ 41 ]; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_hash_values_generate_sha1_hash"; size_t sha1_hash_index = 0; size_t sha1_hash_string_index = 0; uint8_t sha1_digit = 0; int result = 0; if( hash_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash values.", function ); return( -1 ); } if( sha1_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid SHA1 hash.", function ); return( -1 ); } if( sha1_hash_size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: SHA1 hash too small.", function ); return( -1 ); } if( sha1_hash_set == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid SHA1 hash set.", function ); return( -1 ); } result = libfvalue_table_get_value_by_identifier( hash_values, (uint8_t *) "SHA1", 5, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve if hash value: SHA1.", function ); return( -1 ); } /* No need to generate the SHA1 hash */ else if( result == 0 ) { *sha1_hash_set = 0; return( 1 ); } if( libfvalue_value_copy_to_utf8_string( hash_value, 0, sha1_hash_string, 41, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hash value: SHA1 to UTF-8 string.", function ); return( -1 ); } while( sha1_hash_string_index < 40 ) { if( ( sha1_hash_string[ sha1_hash_string_index ] >= (uint8_t) '0' ) && ( sha1_hash_string[ sha1_hash_string_index ] <= (uint8_t) '9' ) ) { sha1_digit = (uint8_t) ( sha1_hash_string[ sha1_hash_string_index ] - (uint8_t) '0' ); } else if( ( sha1_hash_string[ sha1_hash_string_index ] >= (uint8_t) 'A' ) && ( sha1_hash_string[ sha1_hash_string_index ] <= (uint8_t) 'F' ) ) { sha1_digit = 10 + (uint8_t) ( sha1_hash_string[ sha1_hash_string_index ] - (uint8_t) 'A' ); } else if( ( sha1_hash_string[ sha1_hash_string_index ] >= (uint8_t) 'a' ) && ( sha1_hash_string[ sha1_hash_string_index ] <= (uint8_t) 'f' ) ) { sha1_digit = 10 + (uint8_t) ( sha1_hash_string[ sha1_hash_string_index ] - (uint8_t) 'a' ); } else if( sha1_hash_string[ sha1_hash_string_index ] == 0 ) { sha1_digit = 0; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid hexadecimal digit: 0x%02" PRIx8 " in SHA1 string.", function, sha1_hash_string[ sha1_hash_string_index ] ); return( -1 ); } sha1_hash_string_index++; sha1_digit <<= 4; if( ( sha1_hash_string[ sha1_hash_string_index ] >= (uint8_t) '0' ) && ( sha1_hash_string[ sha1_hash_string_index ] <= (uint8_t) '9' ) ) { sha1_digit += (uint8_t) ( sha1_hash_string[ sha1_hash_string_index ] - (uint8_t) '0' ); } else if( ( sha1_hash_string[ sha1_hash_string_index ] >= (uint8_t) 'A' ) && ( sha1_hash_string[ sha1_hash_string_index ] <= (uint8_t) 'F' ) ) { sha1_digit += 10 + (uint8_t) ( sha1_hash_string[ sha1_hash_string_index ] - (uint8_t) 'A' ); } else if( ( sha1_hash_string[ sha1_hash_string_index ] >= (uint8_t) 'a' ) && ( sha1_hash_string[ sha1_hash_string_index ] <= (uint8_t) 'f' ) ) { sha1_digit += 10 + (uint8_t) ( sha1_hash_string[ sha1_hash_string_index ] - (uint8_t) 'a' ); } else if( sha1_hash_string[ sha1_hash_string_index ] != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid hexadecimal digit: 0x%02" PRIx8 " in SHA1 string.", function, sha1_hash_string[ sha1_hash_string_index ] ); return( -1 ); } sha1_hash_string_index++; sha1_hash[ sha1_hash_index++ ] = sha1_digit; } *sha1_hash_set = 1; return( 1 ); } libewf-20140807/libewf/ewf_error2.h0000644000175000017500000000345113421013623021022 0ustar00lordyestalordyesta00000000000000/* * EWF error2 section * * 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( _EWF_ERROR2_H ) #define _EWF_ERROR2_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_error2_header ewf_error2_header_t; struct ewf_error2_header { /* The number of errors * consists of 4 bytes (32 bits) */ uint8_t number_of_errors[ 4 ]; /* Unknown * consists of 512 bytes * value should be 0x00 */ uint8_t unknown[ 512 ]; /* The section checksum of all (previous) error2 data * consists of 4 bytes * starts with sector 76 */ uint8_t checksum[ 4 ]; /* The sector array * consists of 8 bytes per sector * as long as necessary */ /* The last sector is followed by a 4 byte checksum */ }; typedef struct ewf_error2_sector ewf_error2_sector_t; struct ewf_error2_sector { /* The start error2 sector * consists of 4 bytes (32 bits) */ uint8_t start_sector[ 4 ]; /* The number of sectors * consists of 4 bytes (32 bits) */ uint8_t number_of_sectors[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/ewf_data.h0000644000175000017500000000645013421013623020522 0ustar00lordyestalordyesta00000000000000/* * EWF data section * * 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( _EWF_DATA_H ) #define _EWF_DATA_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_data ewf_data_t; struct ewf_data { /* The media type * consists of 1 byte * 0x00 => remobable disk * 0x01 => fixed disk * 0x03 => optical disk * 0x0e => LVF * 0x10 => memory (RAM/process) */ uint8_t media_type; /* Unknown * consists of 3 bytes * contains 0x00 */ uint8_t unknown1[ 3 ]; /* The number of chunks * consists of 4 bytes (32 bits) */ uint8_t number_of_chunks[ 4 ]; /* The number of sectors per chunks * consists of 4 bytes (32 bits) */ uint8_t sectors_per_chunk[ 4 ]; /* The number of bytes per chunks * consists of 4 bytes (32 bits) */ uint8_t bytes_per_sector[ 4 ]; /* The number of sectors * consists of 8 bytes (64 bits) */ uint8_t number_of_sectors[ 8 ]; /* C:H:S values * consists of 12 bytes, 4 bytes per value */ uint8_t chs_cylinders[ 4 ]; uint8_t chs_heads[ 4 ]; uint8_t chs_sectors[ 4 ]; /* Media flags * consists of 1 byte * 0x01 => image (1) or device (0) ? * 0x02 => physical (1) * 0x04 => Fastblock Tableau write blocker (1) * 0x08 => Tableau write blocker (1) */ uint8_t media_flags; /* Unknown * consists of 3 bytes * contains 0x00 */ uint8_t unknown2[ 3 ]; /* PALM volume start sector * consists of 4 bytes */ uint8_t palm_volume_start_sector[ 4 ]; /* Unknown * consists of 4 bytes * contains 0x00 */ uint8_t unknown3[ 4 ]; /* SMART logs start sector * consists of 4 bytes * contains 0x00 */ uint8_t smart_logs_start_sector[ 4 ]; /* Compression level (Encase 5 or later) * consists of 1 byte * 0x00 => no compression, * 0x01 => fast/good compression * 0x02 => best compression */ uint8_t compression_level; /* Unknown * consists of 3 bytes * contains 0x00 */ uint8_t unknown4[ 3 ]; /* The number of sectors to use for error granularity * consists of 4 bytes (32 bits) */ uint8_t error_granularity[ 4 ]; /* Unknown * consists of 4 bytes * contains 0x00 */ uint8_t unknown5[ 4 ]; /* The GUID (Encase 5 or later) * consists of 16 bytes */ uint8_t guid[ 16 ]; /* Unknown * consists of 963 bytes * contains 0x00 */ uint8_t unknown6[ 963 ]; /* Reserved (signature) * consists of 5 bytes */ uint8_t signature[ 5 ]; /* The section checksum of all (previous) volume data * consists of 4 bytes (32 bits) * starts with offset 76 */ uint8_t checksum[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_debug.h0000644000175000017500000000324713421013624021370 0ustar00lordyestalordyesta00000000000000/* * Debugging functions * * 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_DEBUG_H ) #define _LIBEWF_DEBUG_H #include #include #include "libewf_libcerror.h" #include "ewf_section.h" #if defined( __cplusplus ) extern "C" { #endif int libewf_debug_dump_data( const char *header_string, const uint8_t *data, size_t data_size, libcerror_error_t **error ); int libewf_debug_byte_stream_print( const char *header_string, const uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ); int libewf_debug_utf8_stream_print( const char *header_string, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); int libewf_debug_utf16_stream_print( const char *header_string, const uint8_t *utf16_stream, size_t utf16_stream_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_legacy.h0000644000175000017500000004254313421013624021550 0ustar00lordyestalordyesta00000000000000/* * Legacy functions * * 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_LEGACY_H ) #define _LIBEWF_LEGACY_H #include #include #include "libewf_libcerror.h" #include "libewf_extern.h" #include "libewf_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBEWF ) LIBEWF_EXTERN \ uint8_t libewf_get_flags_read( void ); LIBEWF_EXTERN \ uint8_t libewf_get_flags_read_write( void ); LIBEWF_EXTERN \ uint8_t libewf_get_flags_write( void ); LIBEWF_EXTERN \ uint8_t libewf_get_flags_write_resume( void ); LIBEWF_EXTERN \ int libewf_handle_set_maximum_amount_of_open_handles( libewf_handle_t *handle, int maximum_amount_of_open_handles, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_amount_of_sectors( libewf_handle_t *handle, uint64_t *amount_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_add_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_crc_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_crc_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_add_crc_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_add_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_amount_of_sub_file_entries( libewf_file_entry_t *file_entry, int *amount_of_sub_file_entries, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_name_size( libewf_file_entry_t *file_entry, size_t *name_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_entry_get_name( libewf_file_entry_t *file_entry, uint8_t *name, size_t name_size, libcerror_error_t **error ); #endif #if defined( HAVE_V1_API ) #if !defined( HAVE_LOCAL_LIBEWF ) LIBEWF_EXTERN \ void libewf_set_notify_values( FILE *stream, int verbose ); #endif LIBEWF_EXTERN \ int libewf_signal_abort( libewf_handle_t *handle ); /* Handle/File functions */ LIBEWF_EXTERN \ libewf_handle_t *libewf_open( char * const filenames[], int amount_of_files, uint8_t flags ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ libewf_handle_t *libewf_open_wide( wchar_t * const filenames[], int amount_of_files, uint8_t flags ); #endif LIBEWF_EXTERN \ int libewf_close( libewf_handle_t *handle ); LIBEWF_EXTERN \ off64_t libewf_seek_offset( libewf_handle_t *handle, off64_t offset ); LIBEWF_EXTERN \ off64_t libewf_get_offset( libewf_handle_t *handle ); LIBEWF_EXTERN \ ssize_t libewf_raw_read_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *uncompressed_buffer, size_t *uncompressed_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum ); LIBEWF_EXTERN \ ssize_t libewf_raw_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *read_checksum ); LIBEWF_EXTERN \ ssize_t libewf_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ); LIBEWF_EXTERN \ ssize_t libewf_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ); LIBEWF_EXTERN \ ssize_t libewf_raw_write_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *compressed_buffer, size_t *compressed_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum ); LIBEWF_EXTERN \ ssize_t libewf_raw_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, size_t data_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t write_checksum ); LIBEWF_EXTERN \ ssize_t libewf_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ); LIBEWF_EXTERN \ ssize_t libewf_write_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ); LIBEWF_EXTERN \ ssize_t libewf_write_finalize( libewf_handle_t *handle ); LIBEWF_EXTERN \ int libewf_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ); LIBEWF_EXTERN \ int libewf_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ); LIBEWF_EXTERN \ int libewf_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ); #endif LIBEWF_EXTERN \ int libewf_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size ); LIBEWF_EXTERN \ int libewf_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size ); LIBEWF_EXTERN \ int libewf_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ); LIBEWF_EXTERN \ int libewf_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ); LIBEWF_EXTERN \ int libewf_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ); #endif LIBEWF_EXTERN \ int libewf_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size ); LIBEWF_EXTERN \ int libewf_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size ); /* Meta data functions */ LIBEWF_EXTERN \ int libewf_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk ); LIBEWF_EXTERN \ int libewf_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk ); LIBEWF_EXTERN \ int libewf_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector ); LIBEWF_EXTERN \ int libewf_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector ); LIBEWF_EXTERN \ int libewf_get_amount_of_sectors( libewf_handle_t *handle, uint32_t *amount_of_sectors ); LIBEWF_EXTERN \ int libewf_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size ); LIBEWF_EXTERN \ int libewf_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity ); LIBEWF_EXTERN \ int libewf_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity ); LIBEWF_EXTERN \ int libewf_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compress_empty_block ); LIBEWF_EXTERN \ int libewf_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compress_empty_block ); LIBEWF_EXTERN \ int libewf_get_media_size( libewf_handle_t *handle, size64_t *media_size ); LIBEWF_EXTERN \ int libewf_set_media_size( libewf_handle_t *handle, size64_t media_size ); LIBEWF_EXTERN \ int libewf_get_media_type( libewf_handle_t *handle, uint8_t *media_type ); LIBEWF_EXTERN \ int libewf_set_media_type( libewf_handle_t *handle, uint8_t media_type ); LIBEWF_EXTERN \ int libewf_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags ); LIBEWF_EXTERN \ int libewf_set_media_flags( libewf_handle_t *handle, uint8_t media_flags ); LIBEWF_EXTERN \ int libewf_get_volume_type( libewf_handle_t *handle, uint8_t *volume_type ); LIBEWF_EXTERN \ int libewf_set_volume_type( libewf_handle_t *handle, uint8_t volume_type ); LIBEWF_EXTERN \ int libewf_get_format( libewf_handle_t *handle, uint8_t *format ); LIBEWF_EXTERN \ int libewf_set_format( libewf_handle_t *handle, uint8_t format ); LIBEWF_EXTERN \ int libewf_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ); LIBEWF_EXTERN \ int libewf_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ); LIBEWF_EXTERN \ int libewf_handle_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ); LIBEWF_EXTERN \ int libewf_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ); LIBEWF_EXTERN \ int libewf_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ); LIBEWF_EXTERN \ int libewf_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ); LIBEWF_EXTERN \ int libewf_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks ); LIBEWF_EXTERN \ int libewf_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error ); LIBEWF_EXTERN \ int libewf_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ); LIBEWF_EXTERN \ int libewf_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ); LIBEWF_EXTERN \ int libewf_get_acquiry_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); LIBEWF_EXTERN \ int libewf_add_acquiry_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); LIBEWF_EXTERN \ int libewf_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ); LIBEWF_EXTERN \ int libewf_get_crc_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); LIBEWF_EXTERN \ int libewf_add_crc_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); LIBEWF_EXTERN \ int libewf_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions ); LIBEWF_EXTERN \ int libewf_get_session( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ); LIBEWF_EXTERN \ int libewf_add_session( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ); LIBEWF_EXTERN \ int libewf_get_header_codepage( libewf_handle_t *handle, int *header_codepage ); LIBEWF_EXTERN \ int libewf_set_header_codepage( libewf_handle_t *handle, int header_codepage ); LIBEWF_EXTERN \ int libewf_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values ); LIBEWF_EXTERN \ int libewf_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ); LIBEWF_EXTERN \ int libewf_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ); LIBEWF_EXTERN \ int libewf_get_header_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ); LIBEWF_EXTERN \ int libewf_get_header_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ); LIBEWF_EXTERN \ int libewf_set_header_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ); LIBEWF_EXTERN \ int libewf_parse_header_values( libewf_handle_t *handle, uint8_t date_format ); LIBEWF_EXTERN \ int libewf_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ); LIBEWF_EXTERN \ int libewf_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values ); LIBEWF_EXTERN \ int libewf_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ); LIBEWF_EXTERN \ int libewf_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ); LIBEWF_EXTERN \ int libewf_get_hash_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ); LIBEWF_EXTERN \ int libewf_get_hash_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ); LIBEWF_EXTERN \ int libewf_set_hash_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ); LIBEWF_EXTERN \ int libewf_parse_hash_values( libewf_handle_t *handle ); #endif #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_date_time.h0000644000175000017500000000305713421013624022234 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * 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_DATE_TIME_H ) #define _LIBEWF_DATE_TIME_H #include #include #include "libewf_libcerror.h" #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #if defined( __cplusplus ) extern "C" { #endif #if defined( WINAPI ) #define libewf_date_time_mktime( time_elements ) \ mktime( time_elements ) #elif defined( HAVE_MKTIME ) #define libewf_date_time_mktime( time_elements ) \ mktime( time_elements ) #else #error Missing mktime function #endif int libewf_date_time_localtime( const time_t *timestamp, struct tm *time_elements, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_libfdata.h0000664000175000017500000000313413440663047022060 0ustar00lordyestalordyesta00000000000000/* * The libfdata header wrapper * * Copyright (C) 2006-2018, 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_LIBFDATA_H ) #define _LIBEWF_LIBFDATA_H #include /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata */ #if defined( HAVE_LOCAL_LIBFDATA ) #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBFDATA_DLL_IMPORT * before including libfdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFDATA ) */ #endif /* !defined( _LIBEWF_LIBFDATA_H ) */ libewf-20140807/libewf/Makefile.am0000664000175000017500000000644513421024433020642 0ustar00lordyestalordyesta00000000000000AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ @LIBFDATA_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @LIBMFDATA_CPPFLAGS@ \ @ZLIB_CPPFLAGS@ \ @LIBCRYPTO_CPPFLAGS@ \ @LIBHMAC_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ lib_LTLIBRARIES = libewf.la libewf_la_SOURCES = \ ewf_data.h \ ewf_definitions.h \ ewf_digest.h \ ewf_error2.h \ ewf_file_header.h \ ewf_hash.h \ ewf_ltree.h \ ewf_section.h \ ewf_session.h \ ewf_table.h \ ewf_volume.h \ ewf_volume_smart.h \ ewfx_delta_chunk.h \ libewf.c \ libewf_checksum.c libewf_checksum.h \ libewf_chunk_data.c libewf_chunk_data.h \ libewf_chunk_table.c libewf_chunk_table.h \ libewf_codepage.h \ libewf_compression.c libewf_compression.h \ libewf_date_time.c libewf_date_time.h \ libewf_date_time_values.c libewf_date_time_values.h \ libewf_debug.c libewf_debug.h \ libewf_definitions.h \ libewf_deflate.c libewf_deflate.h \ libewf_empty_block.c libewf_empty_block.h \ libewf_error.c libewf_error.h \ libewf_extern.h \ libewf_filename.c libewf_filename.h \ libewf_file_entry.c libewf_file_entry.h \ libewf_handle.c libewf_handle.h \ libewf_hash_sections.c libewf_hash_sections.h \ libewf_hash_values.c libewf_hash_values.h \ libewf_header_sections.c libewf_header_sections.h \ libewf_header_values.c libewf_header_values.h \ libewf_io_handle.c libewf_io_handle.h \ libewf_legacy.c libewf_legacy.h \ libewf_libcdata.h \ libewf_libcerror.h \ libewf_libclocale.h \ libewf_libcnotify.h \ libewf_libbfio.h \ libewf_libfcache.h \ libewf_libfdata.h \ libewf_libfvalue.h \ libewf_libmfdata.h \ libewf_libuna.h \ libewf_media_values.c libewf_media_values.h \ libewf_metadata.c libewf_metadata.h \ libewf_notify.c libewf_notify.h \ libewf_read_io_handle.c libewf_read_io_handle.h \ libewf_section.c libewf_section.h \ libewf_sector_range.c libewf_sector_range.h \ libewf_segment_file.c libewf_segment_file.h \ libewf_segment_file_handle.c libewf_segment_file_handle.h \ libewf_segment_table.c libewf_segment_table.h \ libewf_single_files.c libewf_single_files.h \ libewf_single_file_entry.c libewf_single_file_entry.h \ libewf_single_file_tree.c libewf_single_file_tree.h \ libewf_support.c libewf_support.h \ libewf_types.h \ libewf_unused.h \ libewf_write_io_handle.c libewf_write_io_handle.h libewf_la_LIBADD = \ @LIBCERROR_LIBADD@ \ @LIBCTHREADS_LIBADD@ \ @LIBCDATA_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBFCACHE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBMFDATA_LIBADD@ \ @ZLIB_LIBADD@ \ @LIBDL_LIBADD@ \ @PTHREAD_LIBADD@ libewf_la_LDFLAGS = -no-undefined -version-info 2:0:0 EXTRA_DIST = \ libewf_definitions.h.in \ libewf.rc \ libewf.rc.in MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f libewf_definitions.h /bin/rm -f libewf.rc /bin/rm -f Makefile splint: @echo "Running splint on libewf ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libewf_la_SOURCES) libewf-20140807/libewf/libewf_empty_block.h0000644000175000017500000000222513421013624022605 0ustar00lordyestalordyesta00000000000000/* * Empty block test functions * * 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_EMPTY_BLOCK_H ) #define _LIBEWF_EMPTY_BLOCK_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libewf_empty_block_test( const uint8_t *block_buffer, size_t block_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_date_time_values.h0000644000175000017500000001102713421013624023607 0ustar00lordyestalordyesta00000000000000/* * Date and time values functions * * 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_DATE_TIME_VALUES_H ) #define _LIBEWF_DATE_TIME_VALUES_H #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libewf_date_time_values_copy_from_timestamp( uint8_t *date_time_values_string, size_t date_time_values_string_size, time_t timestamp, libcerror_error_t **error ); int libewf_date_time_values_copy_to_timestamp( const uint8_t *date_time_values_string, size_t date_time_values_string_size, time_t *timestamp, libcerror_error_t **error ); int libewf_utf8_string_day_of_week_copy_from_time_elements( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_day_of_week_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_day_of_month_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_month_copy_from_time_elements( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_month_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_year_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_hours_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_minutes_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_seconds_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf8_string_time_copy_from_time_elements( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf16_string_day_of_week_copy_from_time_elements( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf16_string_month_copy_from_time_elements( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, struct tm *time_elements, libcerror_error_t **error ); int libewf_utf16_string_time_copy_from_time_elements( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, struct tm *time_elements, libcerror_error_t **error ); int libewf_date_time_values_copy_to_utf8_string( const uint8_t *date_time_values_string, size_t date_time_values_string_size, int date_format, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); int libewf_date_time_values_copy_to_utf16_string( const uint8_t *date_time_values_string, size_t date_time_values_string_size, int date_format, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_chunk_data.h0000644000175000017500000000435513421013623022403 0ustar00lordyestalordyesta00000000000000/* * Chunk data functions * * 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_CHUNK_DATA_H ) #define _LIBEWF_CHUNK_DATA_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_chunk_data libewf_chunk_data_t; struct libewf_chunk_data { /* The allocated data size */ size_t allocated_data_size; /* The data */ uint8_t *data; /* The data size */ size_t data_size; /* The compressed data */ uint8_t *compressed_data; /* The compressed data size */ size_t compressed_data_size; /* Value to indicate the chunk is compressed */ uint8_t is_compressed; /* Value to indicate the chunk is packed */ uint8_t is_packed; /* Value to indicate the chunk is corrupt */ uint8_t is_corrupt; }; int libewf_chunk_data_initialize( libewf_chunk_data_t **chunk_data, size_t data_size, libcerror_error_t **error ); int libewf_chunk_data_free( libewf_chunk_data_t **chunk_data, libcerror_error_t **error ); int libewf_chunk_data_pack( libewf_chunk_data_t *chunk_data, int8_t compression_level, uint8_t compression_flags, uint8_t ewf_format, size32_t chunk_size, const uint8_t *compressed_zero_byte_empty_block, size_t compressed_zero_byte_empty_block_size, libcerror_error_t **error ); int libewf_chunk_data_unpack( libewf_chunk_data_t *chunk_data, size_t chunk_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_notify.h0000664000175000017500000000303513440663047021622 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2006-2018, 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_NOTIFY_H ) #define _LIBEWF_NOTIFY_H #include #include #include #include "libewf_extern.h" #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBEWF ) LIBEWF_EXTERN \ void libewf_notify_set_verbose( int verbose ); LIBEWF_EXTERN \ int libewf_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_notify_stream_close( libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_NOTIFY_H ) */ libewf-20140807/libewf/libewf_write_io_handle.c0000664000175000017500000030717513421024433023442 0ustar00lordyestalordyesta00000000000000/* * Low level writing functions * * 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 . */ #include #include #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_checksum.h" #include "libewf_chunk_data.h" #include "libewf_chunk_table.h" #include "libewf_compression.h" #include "libewf_definitions.h" #include "libewf_empty_block.h" #include "libewf_filename.h" #include "libewf_header_values.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfvalue.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #include "libewf_read_io_handle.h" #include "libewf_section.h" #include "libewf_segment_file.h" #include "libewf_segment_table.h" #include "libewf_unused.h" #include "libewf_write_io_handle.h" #include "ewf_data.h" #include "ewf_definitions.h" #include "ewf_section.h" #include "ewf_table.h" #include "ewfx_delta_chunk.h" /* Initialize the write IO handle * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_initialize( libewf_write_io_handle_t **write_io_handle, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_initialize"; if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( *write_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid write IO handle value already set.", function ); return( -1 ); } *write_io_handle = memory_allocate_structure( libewf_write_io_handle_t ); if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create write IO handle.", function ); goto on_error; } if( memory_set( *write_io_handle, 0, sizeof( libewf_write_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear write IO handle.", function ); goto on_error; } ( *write_io_handle )->maximum_segment_file_size = INT32_MAX; ( *write_io_handle )->remaining_segment_file_size = LIBEWF_DEFAULT_SEGMENT_FILE_SIZE; ( *write_io_handle )->maximum_chunks_per_section = EWF_MAXIMUM_OFFSETS_IN_TABLE; /* 'Z' - 'E' + 1 = 22 * ( ( 22 * 26 * 26 ) + 99 ) = 14971 */ ( *write_io_handle )->maximum_number_of_segments = (uint16_t) 14971; return( 1 ); on_error: if( *write_io_handle != NULL ) { memory_free( *write_io_handle ); *write_io_handle = NULL; } return( -1 ); } /* Frees the write IO handle including elements * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_free( libewf_write_io_handle_t **write_io_handle, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_free"; if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( *write_io_handle != NULL ) { if( ( *write_io_handle )->data_section != NULL ) { memory_free( ( *write_io_handle )->data_section ); } if( ( *write_io_handle )->table_offsets != NULL ) { memory_free( ( *write_io_handle )->table_offsets ); } if( ( *write_io_handle )->compressed_zero_byte_empty_block != NULL ) { memory_free( ( *write_io_handle )->compressed_zero_byte_empty_block ); } memory_free( *write_io_handle ); *write_io_handle = NULL; } return( 1 ); } /* Clones the write IO handle * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_clone( libewf_write_io_handle_t **destination_write_io_handle, libewf_write_io_handle_t *source_write_io_handle, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_clone"; size_t offsets_size = 0; if( destination_write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination write IO handle.", function ); return( -1 ); } if( *destination_write_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination write IO handle value already set.", function ); return( -1 ); } if( source_write_io_handle == NULL ) { *destination_write_io_handle = NULL; return( 1 ); } *destination_write_io_handle = memory_allocate_structure( libewf_write_io_handle_t ); if( *destination_write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination write IO handle.", function ); goto on_error; } if( memory_copy( *destination_write_io_handle, source_write_io_handle, sizeof( libewf_write_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination write IO handle.", function ); goto on_error; } ( *destination_write_io_handle )->data_section = NULL; ( *destination_write_io_handle )->table_offsets = NULL; ( *destination_write_io_handle )->number_of_table_offsets = 0; if( source_write_io_handle->data_section != NULL ) { ( *destination_write_io_handle )->data_section = memory_allocate_structure( ewf_data_t ); if( ( *destination_write_io_handle )->data_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination data section.", function ); goto on_error; } if( memory_copy( ( *destination_write_io_handle )->data_section, source_write_io_handle->data_section, sizeof( ewf_data_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination data section.", function ); goto on_error; } } if( source_write_io_handle->table_offsets != NULL ) { offsets_size = sizeof( ewf_table_offset_t ) * source_write_io_handle->number_of_table_offsets; ( *destination_write_io_handle )->table_offsets = (ewf_table_offset_t *) memory_allocate( offsets_size ); if( ( *destination_write_io_handle )->table_offsets == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination table offsets.", function ); goto on_error; } if( memory_copy( ( *destination_write_io_handle )->table_offsets, source_write_io_handle->table_offsets, offsets_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination table offsets.", function ); goto on_error; } } return( 1 ); on_error: if( *destination_write_io_handle != NULL ) { if( ( *destination_write_io_handle )->table_offsets != NULL ) { memory_free( ( *destination_write_io_handle )->table_offsets ); } if( ( *destination_write_io_handle )->data_section != NULL ) { memory_free( ( *destination_write_io_handle )->data_section ); } memory_free( *destination_write_io_handle ); *destination_write_io_handle = NULL; } return( -1 ); } /* Initializes the write IO handle value to start writing * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_initialize_values( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libewf_media_values_t *media_values, libewf_segment_table_t *segment_table, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_initialize_values"; int64_t required_number_of_segments = 0; if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( write_io_handle->values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: write values were initialized and cannot be initialized anymore.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } /* Determine the EWF file format */ if( io_handle->format == LIBEWF_FORMAT_LVF ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: writing format LVF currently not supported.", function ); return( -1 ); } if( segment_table->maximum_segment_size == 0 ) { segment_table->maximum_segment_size = write_io_handle->maximum_segment_file_size; } /* If no input write size was provided check if EWF file format allows for streaming */ if( media_values->media_size == 0 ) { if( ( io_handle->format != LIBEWF_FORMAT_ENCASE2 ) && ( io_handle->format != LIBEWF_FORMAT_ENCASE3 ) && ( io_handle->format != LIBEWF_FORMAT_ENCASE4 ) && ( io_handle->format != LIBEWF_FORMAT_ENCASE5 ) && ( io_handle->format != LIBEWF_FORMAT_ENCASE6 ) && ( io_handle->format != LIBEWF_FORMAT_LINEN5 ) && ( io_handle->format != LIBEWF_FORMAT_LINEN6 ) && ( io_handle->format != LIBEWF_FORMAT_FTK ) && ( io_handle->format != LIBEWF_FORMAT_EWFX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: EWF file format does not allow for streaming write.", function ); return( -1 ); } } else { /* Determine the required number of segments allowed to write */ required_number_of_segments = (int64_t) media_values->media_size / (int64_t) segment_table->maximum_segment_size; if( required_number_of_segments > (int64_t) write_io_handle->maximum_number_of_segments ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: the maximum number of allowed segment files will be exceeded with the segment file size: %" PRIu64 ".", function, segment_table->maximum_segment_size ); return( -1 ); } } if( media_values->media_size > LIBEWF_2_TIB ) { if( ( io_handle->format != LIBEWF_FORMAT_ENCASE6 ) && ( io_handle->format != LIBEWF_FORMAT_EWFX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: EWF file format does not allow for a media size greater than 2 TiB.", function ); return( -1 ); } } /* Flag that the write values were initialized */ write_io_handle->values_initialized = 1; return( 1 ); } /* Initializes the write IO handle to resume writing * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_initialize_resume( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libmfdata_list_t *chunk_table_list, libewf_chunk_table_t *chunk_table, libewf_segment_table_t *segment_table, libcerror_error_t **error ) { libcdata_list_element_t *previous_section_list_element = NULL; libcdata_list_element_t *section_list_element = NULL; libewf_section_t *previous_section = NULL; libewf_section_t *section = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_write_io_handle_initialize_resume"; uint8_t backtrace_to_last_chunks_sections = 0; uint8_t reopen_segment_file = 0; int file_io_pool_entry = 0; int number_of_chunks = 0; int number_of_segment_files = 0; int number_of_unusable_chunks = 0; int segment_files_list_index = 0; int supported_section = 0; if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( libmfdata_file_list_get_number_of_files( segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segment files.", function ); return( -1 ); } if( ( number_of_segment_files <= 0 ) || ( number_of_segment_files > (int) UINT16_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segment files value out of bounds.", function ); return( -1 ); } segment_files_list_index = number_of_segment_files - 1; if( libmfdata_file_list_get_file_value_by_index( segment_files_list, file_io_pool, segment_files_cache, segment_files_list_index, (intptr_t **) &segment_file, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment file.", function ); return( -1 ); } if( segment_file->section_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid segment file - missing section list.", function ); return( -1 ); } if( libcdata_list_get_last_element( segment_file->section_list, §ion_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last element from section list.", function ); return( -1 ); } if( libcdata_list_element_get_value( section_list_element, (intptr_t **) §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from section list element.", function ); return( -1 ); } if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last section.", function ); return( -1 ); } if( section->type_length == 4 ) { if( memory_compare( (void *) section->type, (void *) "data", 4 ) == 0 ) { if( segment_files_list_index == 0 ) { backtrace_to_last_chunks_sections = 1; } } else if( memory_compare( (void *) section->type, (void *) "hash", 4 ) == 0 ) { backtrace_to_last_chunks_sections = 1; } } else if( section->type_length == 5 ) { if( memory_compare( (void *) section->type, (void *) "xhash", 6 ) == 0 ) { backtrace_to_last_chunks_sections = 1; } } else if( section->type_length == 5 ) { if( memory_compare( (void *) section->type, (void *) "digest", 7 ) == 0 ) { backtrace_to_last_chunks_sections = 1; } else if( memory_compare( (void *) section->type, (void *) "error2", 7 ) == 0 ) { backtrace_to_last_chunks_sections = 1; } } else if( section->type_length == 7 ) { if( memory_compare( (void *) section->type, (void *) "session", 8 ) == 0 ) { backtrace_to_last_chunks_sections = 1; } } if( backtrace_to_last_chunks_sections != 0 ) { if( libcdata_list_element_get_previous_element( section_list_element, §ion_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from section list element.", function ); return( -1 ); } while( section_list_element != NULL ) { if( libcdata_list_element_get_value( section_list_element, (intptr_t **) §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from section list element.", function ); return( -1 ); } if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing section.", function ); return( -1 ); } if( memory_compare( (void *) section->type, (void *) "table", 5 ) == 0 ) { break; } if( libcdata_list_element_get_previous_element( section_list_element, §ion_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from section list element.", function ); return( -1 ); } } if( section_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last chunks section.", function ); return( -1 ); } } if( section->type_length == 4 ) { if( memory_compare( (void *) section->type, (void *) "data", 4 ) == 0 ) { /* The sections containing the chunks and offsets were read entirely * in the previous segment file */ supported_section = 1; reopen_segment_file = 1; write_io_handle->resume_segment_file_offset = section->end_offset; write_io_handle->create_chunks_section = 1; } else if( memory_compare( (void *) section->type, (void *) "done", 4 ) == 0 ) { /* The segment file was read entirely */ supported_section = 1; } else if( memory_compare( (void *) section->type, (void *) "next", 4 ) == 0 ) { /* The segment file was read entirely */ supported_section = 1; } } else if( section->type_length == 5 ) { if( memory_compare( (void *) section->type, (void *) "table", 6 ) == 0 ) { /* Determine if the table section also contains chunks */ if( libcdata_list_element_get_previous_element( section_list_element, &previous_section_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from section list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( previous_section_list_element, (intptr_t **) &previous_section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from previous section list element.", function ); return( -1 ); } if( previous_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing previous section.", function ); return( -1 ); } if( memory_compare( (void *) previous_section->type, (void *) "sectors", 8 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported previous section: %s.", function, previous_section->type ); return( -1 ); } if( chunk_table->previous_last_chunk_filled > chunk_table->last_chunk_filled ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: previous last chunk offset filled cannot be greater than current.", function ); return( -1 ); } number_of_unusable_chunks = chunk_table->last_chunk_filled - chunk_table->previous_last_chunk_filled; if( libmfdata_list_get_number_of_elements( chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of chunks in the chunk table list.", function ); return( -1 ); } if( number_of_unusable_chunks > number_of_chunks ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of unusable chunk cannot be greater than number of chunk.", function ); return( -1 ); } /* The sections containing the chunks and offsets were read partially */ section_list_element = previous_section_list_element; section = previous_section; if( libmfdata_list_resize( chunk_table_list, number_of_chunks - number_of_unusable_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize chunk table list.", function ); return( -1 ); } chunk_table->last_chunk_filled = chunk_table->previous_last_chunk_filled; chunk_table->last_chunk_compared = chunk_table->previous_last_chunk_filled; supported_section = 1; reopen_segment_file = 1; write_io_handle->resume_segment_file_offset = section->start_offset; write_io_handle->create_chunks_section = 1; } } else if( section->type_length == 6 ) { if( memory_compare( (void *) section->type, (void *) "table2", 6 ) == 0 ) { /* Determine if the table section also contains chunks */ if( libcdata_list_element_get_previous_element( section_list_element, &previous_section_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from section list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( previous_section_list_element, (intptr_t **) &previous_section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from previous section list element.", function ); return( -1 ); } if( previous_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing previous section.", function ); return( -1 ); } if( memory_compare( (void *) previous_section->type, (void *) "table", 6 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported previous section: %s.", function, previous_section->type ); return( -1 ); } if( libcdata_list_element_get_previous_element( previous_section_list_element, &previous_section_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from previous section list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( previous_section_list_element, (intptr_t **) &previous_section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from second previous section list element.", function ); return( -1 ); } if( previous_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing second previous section.", function ); return( -1 ); } if( memory_compare( (void *) previous_section->type, (void *) "sectors", 8 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported second previous section: %s.", function, previous_section->type ); return( -1 ); } if( chunk_table->previous_last_chunk_filled > chunk_table->last_chunk_filled ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: previous last chunk offset filled cannot be greater than current.", function ); return( -1 ); } number_of_unusable_chunks = chunk_table->last_chunk_filled - chunk_table->previous_last_chunk_filled; if( libmfdata_list_get_number_of_elements( chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of chunks in the chunk table list.", function ); return( -1 ); } if( number_of_unusable_chunks > number_of_chunks ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of unusable chunks cannot be greater than number of chunks.", function ); return( -1 ); } /* The sections containing the chunks and offsets were read partially */ section_list_element = previous_section_list_element; section = previous_section; if( libmfdata_list_resize( chunk_table_list, number_of_chunks - number_of_unusable_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize chunk table list.", function ); return( -1 ); } chunk_table->last_chunk_filled = chunk_table->previous_last_chunk_filled; chunk_table->last_chunk_compared = chunk_table->previous_last_chunk_filled; supported_section = 1; reopen_segment_file = 1; write_io_handle->resume_segment_file_offset = section->start_offset; write_io_handle->create_chunks_section = 1; } } else if( section->type_length == 7 ) { if( memory_compare( (void *) section->type, (void *) "sectors", 7 ) == 0 ) { /* Uncertain if the sections containing the chunks was read entirely * the offsets to the chunks are missing so the chunks need to be rewritten anyway */ supported_section = 1; reopen_segment_file = 1; write_io_handle->resume_segment_file_offset = section->start_offset; write_io_handle->create_chunks_section = 1; } } if( supported_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: write resume from section: %s not supported.", function, (char *) section->type ); return( -1 ); } /* Set offset into media data */ io_handle->current_offset = (off64_t) chunk_table->last_chunk_compared * media_values->chunk_size; /* Set write IO handle values */ write_io_handle->input_write_count = (ssize64_t) io_handle->current_offset; write_io_handle->number_of_chunks_written = chunk_table->last_chunk_compared; write_io_handle->write_finalized = 0; if( reopen_segment_file != 0 ) { if( write_io_handle->resume_segment_file_offset > (off64_t) segment_table->maximum_segment_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: resume segment file offset cannot be greater than segment file size.", function ); return( -1 ); } write_io_handle->remaining_segment_file_size = segment_table->maximum_segment_size - write_io_handle->resume_segment_file_offset; write_io_handle->number_of_chunks_written_to_segment = segment_file->number_of_chunks - number_of_unusable_chunks; if( libmfdata_file_list_get_file_by_index( segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( libbfio_pool_reopen( file_io_pool, file_io_pool_entry, LIBBFIO_OPEN_READ_WRITE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to reopen segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } segment_file->flags |= LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN; } return( 1 ); } /* Sets the compressed zero byte empty block * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_set_compressed_zero_byte_empty_block( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libewf_media_values_t *media_values, libcerror_error_t **error ) { uint8_t *compressed_zero_byte_empty_block = NULL; uint8_t *zero_byte_empty_block = NULL; static char *function = "libewf_write_io_handle_set_compressed_zero_byte_empty_block"; void *reallocation = NULL; int result = 0; int compression_level = 0; if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( write_io_handle->values_initialized != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: write values were initialized and cannot be initialized anymore.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( write_io_handle->compressed_zero_byte_empty_block != NULL ) { memory_free( write_io_handle->compressed_zero_byte_empty_block ); write_io_handle->compressed_zero_byte_empty_block = NULL; } zero_byte_empty_block = (uint8_t *) memory_allocate( sizeof( uint8_t ) * (size_t) media_values->chunk_size ); if( zero_byte_empty_block == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create zero byte empty block.", function ); goto on_error; } if( memory_set( zero_byte_empty_block, 0, sizeof( uint8_t ) * (size_t) media_values->chunk_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear zero byte empty block.", function ); goto on_error; } write_io_handle->compressed_zero_byte_empty_block_size = 512; compressed_zero_byte_empty_block = (uint8_t *) memory_allocate( sizeof( uint8_t ) * write_io_handle->compressed_zero_byte_empty_block_size ); if( compressed_zero_byte_empty_block == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create compressed zero byte empty block.", function ); goto on_error; } compression_level = io_handle->compression_level; if( compression_level == EWF_COMPRESSION_NONE ) { compression_level = EWF_COMPRESSION_DEFAULT; } result = libewf_compress_data( compressed_zero_byte_empty_block, &( write_io_handle->compressed_zero_byte_empty_block_size ), compression_level, zero_byte_empty_block, (size_t) media_values->chunk_size, error ); /* Check if the compressed buffer was too small * and a new compressed data size buffer was passed back */ if( ( result == -1 ) && ( write_io_handle->compressed_zero_byte_empty_block_size > 0 ) ) { #if !defined( HAVE_COMPRESS_BOUND ) && !defined( WINAPI ) /* The some version of zlib require a fairly large buffer * if compressBound() was not used but 2 x 512 then assume * the chunk size + 16 is sufficient */ write_io_handle->compressed_zero_byte_empty_block_size = media_values->chunk_size + 16; #endif libcerror_error_free( error ); reallocation = memory_reallocate( compressed_zero_byte_empty_block, sizeof( uint8_t ) * write_io_handle->compressed_zero_byte_empty_block_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize compressed zero byte empty block.", function ); return( -1 ); } compressed_zero_byte_empty_block = (uint8_t *) reallocation; result = libewf_compress_data( compressed_zero_byte_empty_block, &( write_io_handle->compressed_zero_byte_empty_block_size ), io_handle->compression_level, zero_byte_empty_block, (size_t) media_values->chunk_size, error ); } if( result != 1 ) { libcerror_error_free( error ); memory_free( compressed_zero_byte_empty_block ); write_io_handle->compressed_zero_byte_empty_block_size = 0; } else { write_io_handle->compressed_zero_byte_empty_block = compressed_zero_byte_empty_block; } compressed_zero_byte_empty_block = NULL; memory_free( zero_byte_empty_block ); zero_byte_empty_block = NULL; return( 1 ); on_error: if( compressed_zero_byte_empty_block != NULL ) { memory_free( compressed_zero_byte_empty_block ); } if( zero_byte_empty_block != NULL ) { memory_free( zero_byte_empty_block ); } return( -1 ); } /* Calculates an estimate of the number of chunks that fit within a segment file * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_calculate_chunks_per_segment_file( uint32_t *chunks_per_segment_file, size64_t remaining_segment_file_size, uint32_t maximum_chunks_per_section, uint32_t number_of_chunks_written_to_segment, uint32_t number_of_chunks_written, libewf_media_values_t *media_values, uint8_t format, uint8_t ewf_format, uint8_t unrestrict_offset_table, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_calculate_chunks_per_segment_file"; int64_t calculated_chunks_per_segment_file = 0; int64_t maximum_chunks_per_segment_file = 0; int64_t remaining_number_of_chunks = 0; int64_t required_chunk_sections = 0; if( chunks_per_segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunks per segment file.", function ); return( -1 ); } if( maximum_chunks_per_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum chunks per section.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } /* Calculate the maximum number of chunks within this segment file */ maximum_chunks_per_segment_file = remaining_segment_file_size; if( ewf_format == EWF_FORMAT_S01 ) { /* The EWF-S01 format uses compression this will add 16 bytes on average */ maximum_chunks_per_segment_file /= media_values->chunk_size + 16; } else { maximum_chunks_per_segment_file /= media_values->chunk_size + sizeof( uint32_t ); } /* Determine the number of required chunk sections */ if( unrestrict_offset_table == 0 ) { required_chunk_sections = maximum_chunks_per_segment_file % maximum_chunks_per_section; } else { required_chunk_sections = 1; } calculated_chunks_per_segment_file = remaining_segment_file_size; if( ewf_format == EWF_FORMAT_S01 ) { /* Leave space for the chunk section starts */ calculated_chunks_per_segment_file -= required_chunk_sections * sizeof( ewf_section_start_t ); /* Leave space for the table offsets */ calculated_chunks_per_segment_file -= maximum_chunks_per_segment_file * sizeof( ewf_table_offset_t ); } else if( format == LIBEWF_FORMAT_ENCASE1 ) { /* Leave space for the chunk section starts and the offset table checksum */ calculated_chunks_per_segment_file -= required_chunk_sections * ( sizeof( ewf_section_start_t ) + sizeof( uint32_t ) ); /* Leave space for the table offsets */ calculated_chunks_per_segment_file -= maximum_chunks_per_segment_file * sizeof( ewf_table_offset_t ); } else { /* Leave space for the chunk, table and table2 section starts and the table and table2 offset table checksums */ calculated_chunks_per_segment_file -= required_chunk_sections * ( ( 3 * sizeof( ewf_section_start_t ) ) + ( 2 * sizeof( uint32_t ) ) ); /* Leave space for the table and table2 offsets */ calculated_chunks_per_segment_file -= 2 * maximum_chunks_per_segment_file * sizeof( ewf_table_offset_t ); } /* Calculate the number of chunks within this segment file */ if( ewf_format == EWF_FORMAT_S01 ) { /* The EWF-S01 format uses compression this will add 16 bytes on average */ calculated_chunks_per_segment_file /= media_values->chunk_size + 16; } else { calculated_chunks_per_segment_file /= media_values->chunk_size + sizeof( uint32_t ); } /* If the input size is known determine the remaining number of chunks */ if( media_values->media_size > 0 ) { remaining_number_of_chunks = (int64_t) media_values->number_of_chunks - (int64_t) number_of_chunks_written; /* Check if less chunks remain than the number of chunks calculated */ if( remaining_number_of_chunks < calculated_chunks_per_segment_file ) { calculated_chunks_per_segment_file = remaining_number_of_chunks; } } /* Make sure to return the total number of chunks per segment file */ if( number_of_chunks_written_to_segment > 0 ) { calculated_chunks_per_segment_file += number_of_chunks_written_to_segment; } /* Fail safe segment should contain at least 1 chunk */ if( calculated_chunks_per_segment_file <= 0 ) { calculated_chunks_per_segment_file = 1; } /* Fail safe no more than 2^32 values are allowed */ else if( calculated_chunks_per_segment_file > (int64_t) UINT32_MAX ) { calculated_chunks_per_segment_file = UINT32_MAX; } *chunks_per_segment_file = (uint32_t) calculated_chunks_per_segment_file; return( 1 ); } /* Calculates the number of chunks that fit within a (chunks) section * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_calculate_chunks_per_section( uint32_t *chunks_per_section, uint32_t maximum_chunks_per_section, uint32_t number_of_chunks_written_to_segment, uint32_t chunks_per_segment_file, uint8_t unrestrict_offset_table, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_calculate_chunks_per_section"; uint32_t remaining_number_of_chunks = 0; if( chunks_per_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunks per section.", function ); return( -1 ); } if( maximum_chunks_per_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum chunks per section.", function ); return( -1 ); } if( number_of_chunks_written_to_segment > chunks_per_segment_file ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of chunks written to segment exceeds number of chunks per segment file.", function ); return( -1 ); } remaining_number_of_chunks = chunks_per_segment_file - number_of_chunks_written_to_segment; if( ( unrestrict_offset_table == 0 ) && ( remaining_number_of_chunks > (int64_t) maximum_chunks_per_section ) ) { remaining_number_of_chunks = (int64_t) maximum_chunks_per_section; } /* Fail safe no more than 2^31 values are allowed */ if( remaining_number_of_chunks > (int64_t) INT32_MAX ) { remaining_number_of_chunks = INT32_MAX; } *chunks_per_section = (uint32_t) remaining_number_of_chunks; return( 1 ); } /* Tests if the current segment file is full * Returns 1 if full, 0 if not or -1 on error */ int libewf_write_io_handle_test_segment_file_full( ssize64_t remaining_segment_file_size, uint32_t number_of_chunks_written_to_segment, libewf_media_values_t *media_values, ssize64_t input_write_count, uint32_t chunks_per_segment_file, uint32_t number_of_chunks_written, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_test_segment_file_full"; if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } /* Check if the maximum number of chunks has been reached */ if( ( media_values->number_of_chunks != 0 ) && ( media_values->number_of_chunks == number_of_chunks_written ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: all required chunks have been written.\n", function ); } #endif return( 1 ); } /* Check if the end of the input has been reached */ if( ( media_values->media_size != 0 ) && ( input_write_count >= (ssize64_t) media_values->media_size ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: all required data has been written.\n", function ); } #endif return( 1 ); } /* The EWF-S01 and EnCase1 format should use the pre calculated size */ if( ( ewf_format == EWF_FORMAT_S01 ) || ( format == LIBEWF_FORMAT_ENCASE1 ) ) { if( number_of_chunks_written_to_segment >= chunks_per_segment_file ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk.\n", function ); } #endif return( 1 ); } } /* Determine if a chunk would fit in the segment file */ else if( remaining_segment_file_size < (ssize64_t) ( media_values->chunk_size + sizeof( uint32_t ) ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk - file size exceeded.\n", function ); } #endif return( 1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: space left for additional chunk.\n", function ); } #endif return( 0 ); } /* Tests if the current chunks section is full * Returns 1 if full, 0 if not or -1 on error */ int libewf_write_io_handle_test_chunks_section_full( off64_t chunks_section_offset, ssize64_t remaining_segment_file_size, libewf_media_values_t *media_values, ssize64_t input_write_count, off64_t segment_file_offset, uint32_t maximum_chunks_per_section, uint32_t number_of_chunks_written_to_section, uint32_t number_of_chunks_written, uint32_t chunks_per_section, uint8_t format, uint8_t ewf_format, uint8_t unrestrict_offset_table, libcerror_error_t **error ) { static char *function = "libewf_write_io_handle_test_chunks_section_full"; if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( segment_file_offset > (off64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid segment file offset value exceeds maximum.", function ); return( -1 ); } if( maximum_chunks_per_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum chunks per section.", function ); return( -1 ); } /* Check if a chunks section has been opened */ if( chunks_section_offset == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no chunks section has been created.\n", function ); } #endif return( 0 ); } /* Check if the maximum number of chunks has been reached */ if( ( media_values->number_of_chunks != 0 ) && ( media_values->number_of_chunks == number_of_chunks_written ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: all required chunks have been written.\n", function ); } #endif return( 1 ); } /* Check if the end of the input has been reached */ if( ( media_values->media_size != 0 ) && ( input_write_count >= (ssize64_t) media_values->media_size ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: all required data has been written.\n", function ); } #endif return( 1 ); } /* Check if the maximum number of chunks restriction should apply */ if( ( unrestrict_offset_table == 0 ) && ( number_of_chunks_written_to_section >= maximum_chunks_per_section ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk - maximum reached.\n", function ); } #endif return( 1 ); } /* Fail safe no more than 2^31 chunks are allowed */ if( number_of_chunks_written_to_section > (uint32_t) INT32_MAX ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk - preventing chunk overflow.\n", function ); } #endif return( 1 ); } /* Prevent offset overflow */ if( ( segment_file_offset - chunks_section_offset ) > (off64_t) INT32_MAX ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk - preventing offset overflow.\n", function ); } #endif return( 1 ); } /* The EWF-S01 and EnCase1 format do not allow for a growth of the offset table */ if( ( ewf_format == EWF_FORMAT_S01 ) || ( format == LIBEWF_FORMAT_ENCASE1 ) ) { if( number_of_chunks_written_to_section >= chunks_per_section ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk.\n", function ); } #endif return( 1 ); } } /* Determine if a chunk would fit in the segment file */ else if( remaining_segment_file_size < (ssize64_t) ( media_values->chunk_size + sizeof( uint32_t ) ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no space left for additional chunk - file size exceeded.\n", function ); } #endif return( 1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: space left for additional chunk.\n", function ); } #endif return( 0 ); } /* Creates a new segment file and opens it for writing * The necessary sections at the start of the segment file are written * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_create_segment_file( libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libewf_segment_table_t *segment_table, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, libewf_segment_file_t **segment_file, int *segment_files_list_index, int *file_io_pool_entry, libcerror_error_t **error ) { 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 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( *segment_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment file - value already set.", function ); return( -1 ); } if( segment_files_list_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment files list index.", function ); return( -1 ); } if( file_io_pool_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool entry.", function ); return( -1 ); } if( libewf_filename_create( &filename, &filename_size, segment_table->basename, segment_table->basename_size - 1, segment_number, maximum_number_of_segments, segment_file_type, io_handle->format, io_handle->ewf_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment file: %" PRIu16 " filename.", function, segment_number ); goto on_error; } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing filename.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: creating segment file: %" PRIu16 " with filename: %" PRIs_SYSTEM ".\n", function, segment_number, filename ); } #endif if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbfio_file_set_name_wide( file_io_handle, filename, filename_size, error ) != 1 ) #else if( libbfio_file_set_name( file_io_handle, filename, filename_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } memory_free( filename ); filename = NULL; if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_DWF ) { bfio_access_flags = LIBBFIO_OPEN_READ_WRITE_TRUNCATE; } else { bfio_access_flags = LIBBFIO_OPEN_WRITE_TRUNCATE; } if( libbfio_pool_append_handle( file_io_pool, file_io_pool_entry, file_io_handle, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle to pool.", function ); goto on_error; } file_io_handle = NULL; if( libbfio_pool_open( file_io_pool, *file_io_pool_entry, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file IO pool entry: %d.", function, *file_io_pool_entry ); goto on_error; } if( libewf_segment_file_initialize( segment_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment file.", function ); goto on_error; } ( *segment_file )->type = segment_file_type; ( *segment_file )->segment_number = segment_number; ( *segment_file )->flags |= LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN; if( libmfdata_file_list_append_file( segment_files_list, segment_files_list_index, *file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file: %" PRIu16 " in list.", function, segment_number ); goto on_error; } if( libmfdata_file_list_set_file_value_by_index( segment_files_list, segment_files_cache, *segment_files_list_index, (intptr_t *) *segment_file, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_segment_file_free, LIBMFDATA_FILE_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file: %" PRIu16 " value in list.", function, segment_number ); *segment_file = NULL; goto on_error; } return( 1 ); on_error: if( *segment_file != NULL ) { libewf_segment_file_free( segment_file, NULL ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( filename != NULL ) { memory_free( filename ); } return( -1 ); } /* Writes a new chunk of data in EWF format at the current offset * The necessary settings of the write values must have been made * Returns the number of bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_write_io_handle_write_new_chunk( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libewf_segment_table_t *segment_table, libmfdata_list_t *chunk_table_list, libfvalue_table_t *header_values, libfvalue_table_t *hash_values, libewf_header_sections_t *header_sections, libewf_hash_sections_t *hash_sections, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, int chunk_index, uint8_t *chunk_buffer, size_t chunk_buffer_size, size_t chunk_data_size, int8_t is_compressed, uint8_t *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libcerror_error_t **error ) { libewf_segment_file_t *segment_file = NULL; void *reallocation = NULL; static char *function = "libewf_write_io_handle_write_new_chunk"; off64_t segment_file_offset = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; int chunk_exists = 0; int file_io_pool_entry = -1; int insufficient_output_space = 0; int number_of_chunks = 0; int number_of_segment_files = 0; int result = 0; int segment_files_list_index = 0; if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment table.", function ); return( -1 ); } chunk_exists = libmfdata_list_is_set( chunk_table_list, chunk_index, error ); if( chunk_exists == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if the chunk: %d exists in the chunk table.", function, chunk_index ); return( -1 ); } else if( chunk_exists != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid chunk: %d already exists.", function, chunk_index ); return( -1 ); } /* Check if the write was already finalized */ if( write_io_handle->write_finalized != 0 ) { return( 0 ); } if( libmfdata_list_get_number_of_elements( chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of chunks in the chunk table.", function ); return( -1 ); } /* Allocate the necessary number of chunk offsets * this reduces the number of reallocations */ if( (uint32_t) number_of_chunks < media_values->number_of_chunks ) { if( libmfdata_list_resize( chunk_table_list, (int) media_values->number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize chunk table.", function ); return( -1 ); } } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( ( chunk_buffer_size == 0 ) || ( chunk_buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk size value out of bounds.", function ); return( -1 ); } /* Check if the number of bytes as specified have been written */ if( ( media_values->media_size != 0 ) && ( write_io_handle->input_write_count >= (ssize64_t) media_values->media_size ) ) { return( 0 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: writing chunk: %d with size: %" PRIzd " (data size: %" PRIzd ").\n", function, chunk_index, chunk_buffer_size, chunk_data_size ); } #endif if( libmfdata_file_list_get_number_of_files( segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segment files.", function ); return( -1 ); } if( ( number_of_segment_files < 0 ) || ( number_of_segment_files > (int) UINT16_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segment files value out of bounds.", function ); return( -1 ); } if( number_of_segment_files != 0 ) { segment_files_list_index = number_of_segment_files - 1; if( libmfdata_file_list_get_file_value_by_index( segment_files_list, file_io_pool, segment_files_cache, segment_files_list_index, (intptr_t **) &segment_file, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %" PRIu16 " from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment file: %" PRIu16 ".", function, segment_files_list_index + 1 ); return( -1 ); } if( ( segment_file->flags & LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN ) == 0 ) { segment_file = NULL; segment_files_list_index += 1; } } if( segment_file == NULL ) { if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( ( header_sections->header == NULL ) && ( header_sections->header2 == NULL ) && ( header_sections->xheader == NULL ) ) { if( libewf_header_sections_generate( header_sections, header_values, time( NULL ), io_handle->compression_level, io_handle->format, io_handle->header_codepage, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header(s).", function ); return( -1 ); } } write_io_handle->create_chunks_section = 1; write_io_handle->chunks_per_section = 0; write_io_handle->number_of_chunks_written_to_segment = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: creating segment file with segment number: %" PRIu16 ".\n", function, segment_files_list_index + 1 ); } #endif if( libewf_write_io_handle_create_segment_file( io_handle, file_io_pool, segment_files_list, segment_files_cache, segment_table, (uint16_t) ( segment_files_list_index + 1 ), write_io_handle->maximum_number_of_segments, LIBEWF_SEGMENT_FILE_TYPE_EWF, &segment_file, &segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to create segment file: %" PRIu16 ".", function, segment_files_list_index + 1 ); return( -1 ); } /* Reserve space for the done or next section */ write_io_handle->remaining_segment_file_size = segment_table->maximum_segment_size - sizeof( ewf_section_start_t ); /* Write the start of the segment file * like the file header, the header, volume and/or data section, etc. */ write_count = libewf_segment_file_write_start( segment_file, io_handle, file_io_pool, file_io_pool_entry, media_values, header_sections, &( write_io_handle->data_section ), error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write segment file start.", function ); return( -1 ); } total_write_count += write_count; write_io_handle->remaining_segment_file_size -= write_count; /* Determine the number of chunks per segment file */ if( segment_file->number_of_chunks == 0 ) { if( libewf_write_io_handle_calculate_chunks_per_segment_file( &( write_io_handle->chunks_per_segment_file ), write_io_handle->remaining_segment_file_size, write_io_handle->maximum_chunks_per_section, write_io_handle->number_of_chunks_written_to_segment, write_io_handle->number_of_chunks_written, media_values, io_handle->format, io_handle->ewf_format, write_io_handle->unrestrict_offset_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine the number of chunks per segment file.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: calculated number of chunks per segment file: %" PRIu32 ".\n", function, write_io_handle->chunks_per_segment_file ); } #endif } else { write_io_handle->chunks_per_segment_file = segment_file->number_of_chunks; } } else { if( libmfdata_file_list_get_file_by_index( segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } } /* Set segment file to the correct offset if write is resumed */ if( write_io_handle->resume_segment_file_offset > 0 ) { if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, write_io_handle->resume_segment_file_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to seek resume segment file offset: %" PRIi64 " in segment file: %d.", function, write_io_handle->resume_segment_file_offset, segment_files_list_index + 1 ); return( -1 ); } write_io_handle->resume_segment_file_offset = 0; } /* Check if a chunk section should be created */ if( write_io_handle->create_chunks_section == 1 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: creating chunks section.\n", function ); } #endif write_io_handle->create_chunks_section = 0; write_io_handle->number_of_chunks_written_to_section = 0; write_io_handle->chunks_section_write_count = 0; if( io_handle->ewf_format == EWF_FORMAT_S01 ) { /* Leave space for the chunk section start */ write_io_handle->remaining_segment_file_size -= sizeof( ewf_section_start_t ); } else if( io_handle->format == LIBEWF_FORMAT_ENCASE1 ) { /* Leave space for the chunk section start and the offset table checksum */ write_io_handle->remaining_segment_file_size -= sizeof( ewf_section_start_t ) + sizeof( uint32_t ); } else { /* Leave space for the chunk, table and table2 section starts and the table and table2 offset table checksums */ write_io_handle->remaining_segment_file_size -= ( 3 * sizeof( ewf_section_start_t ) ) + ( 2 * sizeof( uint32_t ) ); } if( libbfio_pool_get_offset( file_io_pool, file_io_pool_entry, &( write_io_handle->chunks_section_offset ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in segment file.", function ); return( -1 ); } /* Recalculate the number of chunks per segment file for a better segment file fill when compression is used */ if( segment_file->number_of_chunks == 0 ) { if( libewf_write_io_handle_calculate_chunks_per_segment_file( &( write_io_handle->chunks_per_segment_file ), write_io_handle->remaining_segment_file_size, write_io_handle->maximum_chunks_per_section, write_io_handle->number_of_chunks_written_to_segment, write_io_handle->number_of_chunks_written, media_values, io_handle->format, io_handle->ewf_format, write_io_handle->unrestrict_offset_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine the number of chunks per segment file.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: calculated number of chunks per segment file: %" PRIu32 ".\n", function, write_io_handle->chunks_per_segment_file ); } #endif } else { write_io_handle->chunks_per_segment_file = segment_file->number_of_chunks; } if( libewf_write_io_handle_calculate_chunks_per_section( &( write_io_handle->chunks_per_section ), write_io_handle->maximum_chunks_per_section, write_io_handle->number_of_chunks_written_to_segment, write_io_handle->chunks_per_segment_file, write_io_handle->unrestrict_offset_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine the number of chunks per chunks section.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: calculated number of chunks per section: %" PRIu32 ".\n", function, write_io_handle->chunks_per_section ); } #endif if( write_io_handle->number_of_table_offsets < write_io_handle->chunks_per_section ) { reallocation = memory_reallocate( write_io_handle->table_offsets, sizeof( ewf_table_offset_t ) * write_io_handle->chunks_per_section ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create table offsets.", function ); return( -1 ); } write_io_handle->table_offsets = (ewf_table_offset_t *) reallocation; write_io_handle->number_of_table_offsets = write_io_handle->chunks_per_section; } /* Write the section start of the chunks section */ write_count = libewf_segment_file_write_chunks_section_start( segment_file, io_handle, file_io_pool, file_io_pool_entry, write_io_handle->chunks_section_offset, chunk_table_list, write_io_handle->table_offsets, write_io_handle->number_of_table_offsets, write_io_handle->number_of_chunks_written, write_io_handle->chunks_per_section, error ); if( write_count == -1 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unable to write section start for chunks.\n", function ); } #endif return( -1 ); } total_write_count += write_count; write_io_handle->remaining_segment_file_size -= write_count; } if( libbfio_pool_get_offset( file_io_pool, file_io_pool_entry, &segment_file_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in segment file.", function ); return( -1 ); } /* Write the chunk data */ #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: writing %" PRIzd " bytes to segment file: %d.\n", function, chunk_buffer_size, segment_files_list_index + 1 ); } #endif write_count = libewf_segment_file_write_chunk( segment_file, io_handle, file_io_pool, file_io_pool_entry, chunk_table_list, chunk_index, chunk_buffer, chunk_buffer_size, chunk_data_size, is_compressed, checksum_buffer, &chunk_checksum, write_checksum, error ); if( write_count <= -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write chunk data.", function ); if( ( error != NULL ) && ( libcerror_error_matches( *error, LIBCERROR_ERROR_DOMAIN_OUTPUT, LIBCERROR_OUTPUT_ERROR_INSUFFICIENT_SPACE ) == 0 ) ) { return( -1 ); } insufficient_output_space = 1; } else { insufficient_output_space = 0; } if( insufficient_output_space == 0 ) { total_write_count += write_count; write_io_handle->input_write_count += chunk_data_size; write_io_handle->chunks_section_write_count += write_count; write_io_handle->remaining_segment_file_size -= write_count; write_io_handle->number_of_chunks_written_to_segment += 1; write_io_handle->number_of_chunks_written_to_section += 1; write_io_handle->number_of_chunks_written += 1; if( ( io_handle->ewf_format == EWF_FORMAT_S01 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE1 ) ) { /* Leave space for the chunk offset in the offset table */ write_io_handle->remaining_segment_file_size -= 2 * sizeof( ewf_table_offset_t ); } else { /* Leave space for the chunk offset in the table and table2 sections */ write_io_handle->remaining_segment_file_size -= 2 * sizeof( ewf_table_offset_t ); } if( libbfio_pool_get_offset( file_io_pool, file_io_pool_entry, &segment_file_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in segment file.", function ); return( -1 ); } /* Check if the current chunks section is full, if so close the current section */ result = libewf_write_io_handle_test_chunks_section_full( write_io_handle->chunks_section_offset, write_io_handle->remaining_segment_file_size, media_values, write_io_handle->input_write_count, segment_file_offset, write_io_handle->maximum_chunks_per_section, write_io_handle->number_of_chunks_written_to_section, write_io_handle->number_of_chunks_written, write_io_handle->chunks_per_section, io_handle->format, io_handle->ewf_format, write_io_handle->unrestrict_offset_table, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunks section is full.", function ); return( -1 ); } } else { if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, segment_file_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: cannot find offset: %" PRIi64 ".", function, segment_file_offset ); return( -1 ); } result = 0; } if( ( insufficient_output_space == 1 ) || ( result == 1 ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: closing chunks section number of bytes written: %" PRIi64 ".\n", function, write_io_handle->chunks_section_write_count ); } #endif if( write_io_handle->number_of_table_offsets < write_io_handle->number_of_chunks_written_to_section ) { reallocation = memory_reallocate( write_io_handle->table_offsets, sizeof( ewf_table_offset_t ) * write_io_handle->number_of_chunks_written_to_section ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create table offsets.", function ); return( -1 ); } write_io_handle->table_offsets = (ewf_table_offset_t *) reallocation; write_io_handle->number_of_table_offsets = write_io_handle->number_of_chunks_written_to_section; } /* Correct the offset, size in the chunks section */ write_count = libewf_segment_file_write_chunks_section_correction( segment_file, io_handle, file_io_pool, file_io_pool_entry, segment_file_offset, chunk_table_list, write_io_handle->table_offsets, write_io_handle->number_of_table_offsets, write_io_handle->chunks_section_offset, (size64_t) write_io_handle->chunks_section_write_count, write_io_handle->number_of_chunks_written, write_io_handle->number_of_chunks_written_to_section, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to correct chunks section.", function ); return( -1 ); } segment_file_offset += write_count; total_write_count += write_count; write_io_handle->create_chunks_section = 1; write_io_handle->chunks_section_offset = 0; if( insufficient_output_space == 0 ) { /* Check if the current segment file is full, if so close the current segment file */ result = libewf_write_io_handle_test_segment_file_full( write_io_handle->remaining_segment_file_size, write_io_handle->number_of_chunks_written_to_segment, media_values, write_io_handle->input_write_count, write_io_handle->chunks_per_segment_file, write_io_handle->number_of_chunks_written, io_handle->format, io_handle->ewf_format, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if segment file is full.", function ); return( -1 ); } } else { result = 0; } if( ( insufficient_output_space == 1 ) || ( result == 1 ) ) { /* Check if this is not the last segment file */ if( ( media_values->media_size == 0 ) || ( write_io_handle->input_write_count < (ssize64_t) media_values->media_size ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: closing segment file with segment number: %d.\n", function, segment_files_list_index + 1 ); } #endif /* Finish and close the segment file */ write_count = libewf_segment_file_write_close( segment_file, io_handle, file_io_pool, file_io_pool_entry, segment_file_offset, write_io_handle->number_of_chunks_written_to_segment, 0, hash_sections, hash_values, media_values, sessions, tracks, acquiry_errors, &( write_io_handle->data_section ), error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to close segment file.", function ); return( -1 ); } segment_file_offset += write_count; total_write_count += write_count; } } } if( insufficient_output_space == 1 ) { return( -1 ); } return( total_write_count ); } /* Writes an existing chunk of data in EWF format at the current offset * The necessary settings of the write values must have been made * Returns the number of data bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_write_io_handle_write_existing_chunk( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_file_list_t *delta_segment_files_list, libfcache_cache_t *segment_files_cache, libewf_segment_table_t *delta_segment_table, libmfdata_list_t *chunk_table_list, libewf_header_sections_t *header_sections, int chunk_index, uint8_t *chunk_buffer, size_t chunk_buffer_size, size_t chunk_data_size LIBEWF_ATTRIBUTE_UNUSED, int8_t is_compressed, uint8_t *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libcerror_error_t **error ) { libcdata_list_element_t *last_list_element = NULL; libewf_section_t *last_section = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_write_io_handle_write_existing_chunk"; off64_t existing_chunk_offset = 0; off64_t segment_file_offset = 0; size64_t existing_chunk_size = 0; size64_t required_segment_file_size = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; uint32_t existing_chunk_flags = 0; uint8_t no_section_append = 0; int file_io_pool_entry = -1; int number_of_segment_files = 0; int segment_files_list_index = 0; LIBEWF_UNREFERENCED_PARAMETER( chunk_data_size ) if( write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write IO handle.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid delta segment table.", function ); return( -1 ); } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( ( chunk_buffer_size == 0 ) || ( chunk_buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk size value out of bounds.", function ); return( -1 ); } if( is_compressed != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_CONFLICTING_VALUE, "%s: chunk compression cannot be used.", function ); return( -1 ); } if( libmfdata_list_get_data_range_by_index( chunk_table_list, chunk_index, &file_io_pool_entry, &existing_chunk_offset, &existing_chunk_size, &existing_chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %d.", function, chunk_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: writing delta chunk: %d with size: %" PRIzd ".\n", function, chunk_index, chunk_buffer_size ); } #endif if( ( existing_chunk_flags & LIBEWF_RANGE_FLAG_IS_DELTA ) == 0 ) { if( libmfdata_file_list_get_number_of_files( delta_segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of delta segment files.", function ); return( -1 ); } if( ( number_of_segment_files < 0 ) || ( number_of_segment_files > (int) UINT16_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segment files value out of bounds.", function ); return( -1 ); } if( number_of_segment_files != 0 ) { segment_files_list_index = number_of_segment_files - 1; /* Check if a new delta segment file should be created */ if( libmfdata_file_list_get_file_by_index( delta_segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve delta segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( libmfdata_file_list_get_file_value_by_index( delta_segment_files_list, file_io_pool, segment_files_cache, segment_files_list_index, (intptr_t **) &segment_file, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve delta segment file: %d value from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing delta segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file->section_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid segment file - missing section list.", function ); return( -1 ); } if( libcdata_list_get_last_element( segment_file->section_list, &last_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last element from section list.", function ); return( -1 ); } if( libcdata_list_element_get_value( last_list_element, (intptr_t **) &last_section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from last section list element.", function ); return( -1 ); } if( last_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last section.", function ); return( -1 ); } if( libbfio_pool_get_offset( file_io_pool, file_io_pool_entry, &segment_file_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in segment file.", function ); return( -1 ); } /* Make sure the current segment file offset points to the start of the last section */ if( segment_file_offset != last_section->start_offset ) { if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, last_section->start_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 " in delta segment file: %d.", function, last_section->start_offset, segment_files_list_index + 1 ); return( -1 ); } segment_file_offset = last_section->start_offset; } required_segment_file_size = (size64_t) last_section->start_offset + chunk_buffer_size + sizeof( uint32_t ) + sizeof( ewf_section_start_t ); /* Check if chunk fits in exisiting delta segment file */ if( required_segment_file_size > delta_segment_table->maximum_segment_size ) { /* Make sure to write a next section in the the previous delta segment file * The segment file offset is updated by the function */ write_count = libewf_segment_file_write_last_section( segment_file, io_handle, file_io_pool, file_io_pool_entry, segment_file_offset, 0, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write last section.", function ); return( -1 ); } segment_file_offset += write_count; total_write_count += write_count; segment_file = NULL; } else { if( libcdata_list_remove_element( segment_file->section_list, last_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove last section from list.", function ); return( -1 ); } if( libcdata_list_element_free( &last_list_element, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_section_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free last list element.", function ); return( -1 ); } } } if( segment_file == NULL ) { if( libewf_write_io_handle_create_segment_file( io_handle, file_io_pool, delta_segment_files_list, segment_files_cache, delta_segment_table, (uint16_t) ( segment_files_list_index + 1 ), write_io_handle->maximum_number_of_segments, LIBEWF_SEGMENT_FILE_TYPE_DWF, &segment_file, &segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to create delta segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } /* Write the start of the segment file * like the file header, the header, volume and/or data section, etc. */ write_count = libewf_segment_file_write_start( segment_file, io_handle, file_io_pool, file_io_pool_entry, media_values, header_sections, &( write_io_handle->data_section ), error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write segment file start.", function ); return( -1 ); } segment_file_offset = write_count; total_write_count += write_count; } } else { if( libmfdata_file_list_get_file_value_by_index( delta_segment_files_list, file_io_pool, segment_files_cache, segment_files_list_index, (intptr_t **) &segment_file, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve delta segment file: %d value from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } segment_file_offset = existing_chunk_offset - sizeof( ewf_section_start_t ) - sizeof( ewfx_delta_chunk_header_t ); if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, segment_file_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek chunk offset: %" PRIi64 ".", function, segment_file_offset ); return( -1 ); } no_section_append = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: writing delta chunk section at offset: %" PRIi64 ".\n", function, segment_file_offset ); } #endif write_count = libewf_segment_file_write_delta_chunk( segment_file, file_io_pool, file_io_pool_entry, segment_file_offset, chunk_table_list, chunk_index, chunk_buffer, chunk_buffer_size, checksum_buffer, &chunk_checksum, write_checksum, no_section_append, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write delta chunk section.", function ); return( -1 ); } segment_file_offset += write_count; total_write_count += write_count; if( no_section_append == 0 ) { write_count = libewf_segment_file_write_last_section( segment_file, io_handle, file_io_pool, file_io_pool_entry, segment_file_offset, 1, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write last section.", function ); return( -1 ); } segment_file_offset += write_count; total_write_count += write_count; } return( total_write_count ); } /* Corrects sections after streamed write * Returns 1 if successful or -1 on error */ int libewf_write_io_handle_finalize_write_sections_corrections( libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, uint32_t number_of_chunks_written_to_last_segment, libewf_media_values_t *media_values, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libfvalue_table_t *hash_values, libewf_hash_sections_t *hash_sections, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, ewf_data_t **cached_data_section, libcerror_error_t **error ) { libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_write_io_handle_finalize_write_sections_corrections"; int file_io_pool_entry = 0; int number_of_segment_files = 0; int last_segment_file = 0; int segment_files_list_index = 0; if( libmfdata_file_list_get_number_of_files( segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segment files.", function ); return( -1 ); } if( ( number_of_segment_files < 0 ) || ( number_of_segment_files > (int) UINT16_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segment files value out of bounds.", function ); return( -1 ); } for( segment_files_list_index = 0; segment_files_list_index < number_of_segment_files; segment_files_list_index++ ) { if( segment_files_list_index == ( number_of_segment_files - 1 ) ) { last_segment_file = 1; } segment_file = NULL; if( libmfdata_file_list_get_file_by_index( segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( libmfdata_file_list_get_file_value_by_index( segment_files_list, file_io_pool, segment_files_cache, segment_files_list_index, (intptr_t **) &segment_file, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } if( libewf_segment_file_write_sections_correction( segment_file, io_handle, file_io_pool, file_io_pool_entry, number_of_chunks_written_to_last_segment, last_segment_file, media_values, hash_values, hash_sections, sessions, tracks, acquiry_errors, cached_data_section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write sections correction to segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } } return( 1 ); } libewf-20140807/libewf/libewf_segment_file_handle.c0000644000175000017500000001242513421013625024250 0ustar00lordyestalordyesta00000000000000/* * Segment file handle functions * * 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 . */ #include #include #include #include "libewf_libcerror.h" #include "libewf_segment_file_handle.h" /* Initialize the segment file handle * Returns 1 if successful or -1 on error */ int libewf_segment_file_handle_initialize( libewf_segment_file_handle_t **segment_file_handle, int segment_file_index, libcerror_error_t **error ) { static char *function = "libewf_segment_file_handle_initialize"; if( segment_file_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file handle.", function ); return( -1 ); } if( *segment_file_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment file handle value already set.", function ); return( -1 ); } if( segment_file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid segment file index value less than zero.", function ); return( -1 ); } *segment_file_handle = memory_allocate_structure( libewf_segment_file_handle_t ); if( *segment_file_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment file handle.", function ); goto on_error; } if( memory_set( *segment_file_handle, 0, sizeof( libewf_segment_file_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment file handle.", function ); goto on_error; } ( *segment_file_handle )->segment_file_index = segment_file_index; return( 1 ); on_error: if( *segment_file_handle != NULL ) { memory_free( *segment_file_handle ); *segment_file_handle = NULL; } return( -1 ); } /* Frees the segment file handle * Returns 1 if successful or -1 on error */ int libewf_segment_file_handle_free( libewf_segment_file_handle_t **segment_file_handle, libcerror_error_t **error ) { static char *function = "libewf_segment_file_handle_free"; if( segment_file_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file handle.", function ); return( -1 ); } if( *segment_file_handle != NULL ) { memory_free( *segment_file_handle ); *segment_file_handle = NULL; } return( 1 ); } /* Clones the segment file handle * Returns 1 if successful or -1 on error */ int libewf_segment_file_handle_clone( libewf_segment_file_handle_t **destination_segment_file_handle, libewf_segment_file_handle_t *source_segment_file_handle, libcerror_error_t **error ) { static char *function = "libewf_segment_file_handle_clone"; if( destination_segment_file_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination segment file handle.", function ); return( -1 ); } if( *destination_segment_file_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination segment file handle value already set.", function ); return( -1 ); } if( source_segment_file_handle == NULL ) { *destination_segment_file_handle = NULL; return( 1 ); } *destination_segment_file_handle = memory_allocate_structure( libewf_segment_file_handle_t ); if( *destination_segment_file_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination segment file handle.", function ); goto on_error; } if( memory_copy( *destination_segment_file_handle, source_segment_file_handle, sizeof( libewf_segment_file_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination segment file handle.", function ); goto on_error; } return( 1 ); on_error: if( *destination_segment_file_handle != NULL ) { memory_free( *destination_segment_file_handle ); *destination_segment_file_handle = NULL; } return( -1 ); } libewf-20140807/libewf/libewf_single_file_entry.h0000644000175000017500000001323113421013625023776 0ustar00lordyestalordyesta00000000000000/* * Single file entry functions * * 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_SINGLE_FILE_ENTRY_H ) #define _LIBEWF_SINGLE_FILE_ENTRY_H #include #include #include "libewf_date_time.h" #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_single_file_entry libewf_single_file_entry_t; struct libewf_single_file_entry { /* The type */ uint8_t type; /* The flags */ uint32_t flags; /* The data offset */ off64_t data_offset; /* The data size */ size64_t data_size; /* The name */ uint8_t *name; /* The name size */ size_t name_size; /* The (file) size */ size64_t size; /* The duplicate data offset */ off64_t duplicate_data_offset; /* The creation date and time * stored as a Unix timestamp */ uint32_t creation_time; /* The last modification date and time * stored as a Unix timestamp */ uint32_t modification_time; /* The last access date and time * stored as a Unix timestamp */ uint32_t access_time; /* The last (file system) entry modification date and time * stored as a Unix timestamp */ uint32_t entry_modification_time; /* The MD5 digest hash */ uint8_t *md5_hash; /* The MD5 digest hash size */ size_t md5_hash_size; /* The SHA1 digest hash */ uint8_t *sha1_hash; /* The SHA1 digest hash size */ size_t sha1_hash_size; }; int libewf_single_file_entry_initialize( libewf_single_file_entry_t **single_file_entry, libcerror_error_t **error ); int libewf_single_file_entry_free( libewf_single_file_entry_t **single_file_entry, libcerror_error_t **error ); int libewf_single_file_entry_clone( libewf_single_file_entry_t **destination_single_file_entry, libewf_single_file_entry_t *source_single_file_entry, libcerror_error_t **error ); int libewf_single_file_entry_get_type( libewf_single_file_entry_t *single_file_entry, uint8_t *type, libcerror_error_t **error ); int libewf_single_file_entry_get_flags( libewf_single_file_entry_t *single_file_entry, uint32_t *flags, libcerror_error_t **error ); int libewf_single_file_entry_get_data_offset( libewf_single_file_entry_t *single_file_entry, off64_t *data_offset, libcerror_error_t **error ); int libewf_single_file_entry_get_data_size( libewf_single_file_entry_t *single_file_entry, size64_t *data_size, libcerror_error_t **error ); int libewf_single_file_entry_get_duplicate_data_offset( libewf_single_file_entry_t *single_file_entry, off64_t *duplicate_data_offset, libcerror_error_t **error ); int libewf_single_file_entry_get_utf8_name_size( libewf_single_file_entry_t *single_file_entry, size_t *utf8_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_utf8_name( libewf_single_file_entry_t *single_file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_utf16_name_size( libewf_single_file_entry_t *single_file_entry, size_t *utf16_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_utf16_name( libewf_single_file_entry_t *single_file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_size( libewf_single_file_entry_t *single_file_entry, size64_t *size, libcerror_error_t **error ); int libewf_single_file_entry_get_creation_time( libewf_single_file_entry_t *single_file_entry, uint32_t *creation_time, libcerror_error_t **error ); int libewf_single_file_entry_get_modification_time( libewf_single_file_entry_t *single_file_entry, uint32_t *modification_time, libcerror_error_t **error ); int libewf_single_file_entry_get_access_time( libewf_single_file_entry_t *single_file_entry, uint32_t *access_time, libcerror_error_t **error ); int libewf_single_file_entry_get_entry_modification_time( libewf_single_file_entry_t *single_file_entry, uint32_t *entry_modification_time, libcerror_error_t **error ); int libewf_single_file_entry_get_utf8_hash_value_md5( libewf_single_file_entry_t *single_file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_utf16_hash_value_md5( libewf_single_file_entry_t *single_file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_utf8_hash_value_sha1( libewf_single_file_entry_t *single_file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); int libewf_single_file_entry_get_utf16_hash_value_sha1( libewf_single_file_entry_t *single_file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/ewf_table.h0000644000175000017500000000346113421013623020677 0ustar00lordyestalordyesta00000000000000/* * EWF table section * * 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( _EWF_TABLE_H ) #define _EWF_TABLE_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_table_header ewf_table_header_t; struct ewf_table_header { /* The number of offsets * consists of 4 bytes (32 bits) */ uint8_t number_of_offsets[ 4 ]; /* Padding * consists of 4 bytes * value should be 0x00 */ uint8_t padding1[ 4 ]; /* The base offset * consists of 8 bytes */ uint8_t base_offset[ 8 ]; /* Padding * consists of 4 bytes * value should be 0x00 */ uint8_t padding2[ 4 ]; /* The section checksum of all (previous) table data * consists of 4 bytes * starts with offset 76 */ uint8_t checksum[ 4 ]; /* The offset array * consists of mulitple 4 byte offsets */ /* The last offset is followed by a 4 byte checksum */ }; typedef struct ewf_table_offset ewf_table_offset_t; struct ewf_table_offset { /* An offset * consists of 4 bytes */ uint8_t offset[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_types.h0000664000175000017500000000305113440663047021454 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2006-2018, 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_INTERNAL_TYPES_H ) #define _LIBEWF_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBEWF for local use of libewf * The definitions in are copied here * for local use of libewf */ #if defined( HAVE_LOCAL_LIBEWF ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libewf_file_entry {} libewf_file_entry_t; typedef struct libewf_handle {} libewf_handle_t; #else typedef intptr_t libewf_file_entry_t; typedef intptr_t libewf_handle_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBEWF ) */ #endif /* !defined( _LIBEWF_INTERNAL_TYPES_H ) */ libewf-20140807/libewf/libewf_support.c0000664000175000017500000006702613421024433022020 0ustar00lordyestalordyesta00000000000000/* * Support functions * * 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 . */ #include #include #include #include #include #include "libewf_codepage.h" #include "libewf_definitions.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" #include "ewf_definitions.h" #if !defined( HAVE_LOCAL_LIBEWF ) /* Returns the library version as a string */ const char *libewf_get_version( void ) { return( (const char *) LIBEWF_VERSION_STRING ); } /* Returns the access flags for reading */ int libewf_get_access_flags_read( void ) { return( (int) LIBEWF_ACCESS_FLAG_READ ); } /* Returns the access flags for reading and writing */ int libewf_get_access_flags_read_write( void ) { return( (int) ( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE ) ); } /* Returns the access flags for writing */ int libewf_get_access_flags_write( void ) { return( (int) LIBEWF_ACCESS_FLAG_WRITE ); } /* Returns the access flags for resume writing */ int libewf_get_access_flags_write_resume( void ) { return( (int) LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libewf_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libewf_get_codepage"; if( codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid codepage.", function ); return( -1 ); } *codepage = libclocale_codepage; return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libewf_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libewf_set_codepage"; if( ( codepage != LIBEWF_CODEPAGE_ASCII ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_1 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_2 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_3 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_4 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_5 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_6 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_7 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_8 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_9 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_10 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_11 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_13 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_14 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_15 ) && ( codepage != LIBEWF_CODEPAGE_ISO_8859_16 ) && ( codepage != LIBEWF_CODEPAGE_KOI8_R ) && ( codepage != LIBEWF_CODEPAGE_KOI8_U ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_874 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_932 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_936 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1250 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1251 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1252 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1253 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1254 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1256 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1257 ) && ( codepage != LIBEWF_CODEPAGE_WINDOWS_1258 ) && ( codepage != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported codepage.", function ); return( -1 ); } libclocale_codepage = codepage; return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ /* Determines if a file is an EWF file (check for the EWF file signature) * Returns 1 if true, 0 if not or -1 on error */ int libewf_check_file_signature( const char *filename, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libewf_check_file_signature"; size_t filename_length = 0; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } filename_length = narrow_string_length( filename ); if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } if( libbfio_file_set_name( file_io_handle, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } result = libewf_check_file_signature_file_io_handle( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to check file signature using a file handle.", function ); goto on_error; } if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } return( result ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Determines if a file is an EWF file (check for the EWF file signature) * Returns 1 if true, 0 if not or -1 on error */ #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libewf_check_file_signature_wide( const wchar_t *filename, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libewf_check_file_signature_wide"; size_t filename_length = 0; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } filename_length = wide_string_length( filename ); if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } if( libbfio_file_set_name_wide( file_io_handle, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } result = libewf_check_file_signature_file_io_handle( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to check file signature using a file handle.", function ); goto on_error; } if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } return( result ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } #endif /* Determines if a file is an EWF file (check for the EWF file signature) using a Basic File IO (bfio) handle * Returns 1 if true, 0 if not or -1 on error */ int libewf_check_file_signature_file_io_handle( libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { uint8_t signature[ 8 ]; static char *function = "libewf_check_file_signature_file_io_handle"; ssize_t read_count = 0; int file_io_handle_is_open = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } file_io_handle_is_open = libbfio_handle_is_open( file_io_handle, error ); if( file_io_handle_is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); return( -1 ); } else if( file_io_handle_is_open == 0 ) { if( libbfio_handle_open( file_io_handle, LIBBFIO_OPEN_READ, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); return( -1 ); } } if( libbfio_handle_seek_offset( file_io_handle, 0, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek file header offset: 0.", function ); if( file_io_handle_is_open == 0 ) { libbfio_handle_close( file_io_handle, error ); } return( -1 ); } read_count = libbfio_handle_read_buffer( file_io_handle, signature, 8, error ); if( read_count != 8 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read signature.", function ); libbfio_handle_close( file_io_handle, NULL ); return( -1 ); } if( file_io_handle_is_open == 0 ) { if( libbfio_handle_close( file_io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file.", function ); return( -1 ); } } /* The number of EWF segment files will be the largest */ if( memory_compare( evf_file_signature, signature, 8 ) == 0 ) { return( 1 ); } else if( memory_compare( lvf_file_signature, signature, 8 ) == 0 ) { return( 1 ); } else if( memory_compare( dvf_file_signature, signature, 8 ) == 0 ) { return( 1 ); } return( 0 ); } /* Globs the segment files according to the EWF naming schema * if format is known the filename should contain the base of the filename * otherwise the function will try to determine the format based on the extension * Returns 1 if successful or -1 on error */ int libewf_glob( const char *filename, size_t filename_length, uint8_t format, char **filenames[], int *number_of_filenames, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; char *segment_filename = NULL; void *reallocation = NULL; static char *function = "libewf_glob"; size_t additional_length = 4; size_t segment_filename_length = 0; int result = 0; uint8_t segment_file_type = 0; uint8_t ewf_format = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( filename_length == 0 ) || ( filename_length > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid filename length.", function ); return( -1 ); } if( ( format != LIBEWF_FORMAT_UNKNOWN ) && ( format != LIBEWF_FORMAT_ENCASE1 ) && ( format != LIBEWF_FORMAT_ENCASE2 ) && ( format != LIBEWF_FORMAT_ENCASE3 ) && ( format != LIBEWF_FORMAT_ENCASE4 ) && ( format != LIBEWF_FORMAT_ENCASE5 ) && ( format != LIBEWF_FORMAT_ENCASE6 ) && ( format != LIBEWF_FORMAT_LINEN5 ) && ( format != LIBEWF_FORMAT_LINEN6 ) && ( format != LIBEWF_FORMAT_SMART ) && ( format != LIBEWF_FORMAT_FTK ) && ( format != LIBEWF_FORMAT_LVF ) && ( format != LIBEWF_FORMAT_EWF ) && ( format != LIBEWF_FORMAT_EWFX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported format.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of filenames.", function ); return( -1 ); } if( format == LIBEWF_FORMAT_UNKNOWN ) { if( filename[ filename_length - 4 ] != (char) '.' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid filename - missing extension.", function ); return( -1 ); } additional_length = 0; if( filename[ filename_length - 3 ] == (char) 'E' ) { format = LIBEWF_FORMAT_ENCASE5; } else if( filename[ filename_length - 3 ] == (char) 'e' ) { format = LIBEWF_FORMAT_EWF; } else if( filename[ filename_length - 3 ] == (char) 'L' ) { format = LIBEWF_FORMAT_LVF; } else if( filename[ filename_length - 3 ] == (char) 's' ) { format = LIBEWF_FORMAT_SMART; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid filename - unsupported extension: %s.", function, &( filename[ filename_length - 4 ] ) ); return( -1 ); } } if( format == LIBEWF_FORMAT_LVF ) { segment_file_type = LIBEWF_SEGMENT_FILE_TYPE_LWF; ewf_format = EWF_FORMAT_L01; } else if( format == LIBEWF_FORMAT_SMART ) { segment_file_type = LIBEWF_SEGMENT_FILE_TYPE_EWF; ewf_format = EWF_FORMAT_S01; } else { segment_file_type = LIBEWF_SEGMENT_FILE_TYPE_EWF; ewf_format = EWF_FORMAT_E01; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } *number_of_filenames = 0; while( *number_of_filenames < (int) UINT16_MAX ) { segment_filename_length = filename_length + additional_length; segment_filename = (char * ) memory_allocate( sizeof( char ) * ( segment_filename_length + 1 ) ); if( segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename.", function ); goto on_error; } if( narrow_string_copy( segment_filename, filename, filename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy filename.", function ); goto on_error; } if( additional_length > 0 ) { segment_filename[ filename_length ] = (char) '.'; } if( libewf_filename_set_extension( &( segment_filename[ segment_filename_length - 3 ] ), (uint16_t) ( *number_of_filenames + 1 ), UINT16_MAX, segment_file_type, format, ewf_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set extension.", function ); goto on_error; } segment_filename[ segment_filename_length ] = 0; if( libbfio_file_set_name( file_io_handle, segment_filename, segment_filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } result = libbfio_handle_exists( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to test if file exists.", function ); goto on_error; } else if( result == 0 ) { memory_free( segment_filename ); break; } *number_of_filenames += 1; reallocation = memory_reallocate( *filenames, sizeof( char * ) * *number_of_filenames ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize filenames.", function ); goto on_error; } *filenames = (char **) reallocation; ( *filenames )[ *number_of_filenames - 1 ] = segment_filename; } if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } return( 1 ); on_error: if( segment_filename != NULL ) { memory_free( segment_filename ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Frees the globbed filenames * Returns 1 if successful or -1 on error */ int libewf_glob_free( char *filenames[], int number_of_filenames, libcerror_error_t **error ) { static char *function = "libewf_glob_free"; int filename_iterator = 0; if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of filenames value less than zero.", function ); return( -1 ); } for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { memory_free( filenames[ filename_iterator ] ); } memory_free( filenames ); return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Globs the segment files according to the EWF naming schema * if format is known the filename should contain the base of the filename * otherwise the function will try to determine the format based on the extension * Returns 1 if successful or -1 on error */ int libewf_glob_wide( const wchar_t *filename, size_t filename_length, uint8_t format, wchar_t **filenames[], int *number_of_filenames, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; wchar_t *segment_filename = NULL; void *reallocation = NULL; static char *function = "libewf_glob_wide"; size_t additional_length = 4; size_t segment_filename_length = 0; int result = 0; uint8_t segment_file_type = 0; uint8_t ewf_format = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( filename_length == 0 ) || ( filename_length > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid filename length.", function ); return( -1 ); } if( ( format != LIBEWF_FORMAT_UNKNOWN ) && ( format != LIBEWF_FORMAT_ENCASE1 ) && ( format != LIBEWF_FORMAT_ENCASE2 ) && ( format != LIBEWF_FORMAT_ENCASE3 ) && ( format != LIBEWF_FORMAT_ENCASE4 ) && ( format != LIBEWF_FORMAT_ENCASE5 ) && ( format != LIBEWF_FORMAT_ENCASE6 ) && ( format != LIBEWF_FORMAT_LINEN5 ) && ( format != LIBEWF_FORMAT_LINEN6 ) && ( format != LIBEWF_FORMAT_SMART ) && ( format != LIBEWF_FORMAT_FTK ) && ( format != LIBEWF_FORMAT_LVF ) && ( format != LIBEWF_FORMAT_EWF ) && ( format != LIBEWF_FORMAT_EWFX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported format.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of filenames.", function ); return( -1 ); } if( format == LIBEWF_FORMAT_UNKNOWN ) { if( filename[ filename_length - 4 ] != (wchar_t) '.' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid filename - missing extension.", function ); return( -1 ); } additional_length = 0; if( filename[ filename_length - 3 ] == (wchar_t) 'E' ) { format = LIBEWF_FORMAT_ENCASE5; } else if( filename[ filename_length - 3 ] == (wchar_t) 'e' ) { format = LIBEWF_FORMAT_EWF; } else if( filename[ filename_length - 3 ] == (wchar_t) 'L' ) { format = LIBEWF_FORMAT_LVF; } else if( filename[ filename_length - 3 ] == (wchar_t) 's' ) { format = LIBEWF_FORMAT_SMART; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid filename - unsupported extension: %s.", function, &( filename[ filename_length - 4 ] ) ); return( -1 ); } } if( format == LIBEWF_FORMAT_LVF ) { segment_file_type = LIBEWF_SEGMENT_FILE_TYPE_LWF; ewf_format = EWF_FORMAT_L01; } else if( format == LIBEWF_FORMAT_SMART ) { segment_file_type = LIBEWF_SEGMENT_FILE_TYPE_EWF; ewf_format = EWF_FORMAT_S01; } else { segment_file_type = LIBEWF_SEGMENT_FILE_TYPE_EWF; ewf_format = EWF_FORMAT_E01; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } *number_of_filenames = 0; while( *number_of_filenames < (int) UINT16_MAX ) { segment_filename_length = filename_length + additional_length; segment_filename = (wchar_t *) memory_allocate( sizeof( wchar_t ) * ( segment_filename_length + 1 ) ); if( segment_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment filename.", function ); goto on_error; } if( wide_string_copy( segment_filename, filename, filename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy filename.", function ); goto on_error; } if( additional_length > 0 ) { segment_filename[ filename_length ] = (wchar_t) '.'; } if( libewf_filename_set_extension_wide( &( segment_filename[ segment_filename_length - 3 ] ), (uint16_t) ( *number_of_filenames + 1 ), UINT16_MAX, segment_file_type, format, ewf_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set extension.", function ); goto on_error; } segment_filename[ segment_filename_length ] = 0; if( libbfio_file_set_name_wide( file_io_handle, segment_filename, segment_filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } result = libbfio_handle_exists( file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to test if file exists.", function ); goto on_error; } else if( result == 0 ) { memory_free( segment_filename ); break; } *number_of_filenames += 1; reallocation = memory_reallocate( *filenames, sizeof( wchar_t * ) * *number_of_filenames ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize filenames.", function ); goto on_error; } *filenames = (wchar_t **) reallocation; ( *filenames )[ *number_of_filenames - 1 ] = segment_filename; } if( libbfio_handle_free( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file IO handle.", function ); goto on_error; } return( 1 ); on_error: if( segment_filename != NULL ) { memory_free( segment_filename ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } /* Frees the globbed wide filenames * Returns 1 if successful or -1 on error */ int libewf_glob_wide_free( wchar_t *filenames[], int number_of_filenames, libcerror_error_t **error ) { static char *function = "libewf_glob_wide_free"; int filename_iterator = 0; if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of filenames value less than zero.", function ); return( -1 ); } for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { memory_free( filenames[ filename_iterator ] ); } memory_free( filenames ); return( 1 ); } #endif libewf-20140807/libewf/libewf.rc0000664000175000017500000000207313443455443020412 0ustar00lordyestalordyesta00000000000000#include #ifdef GCC_WINDRES VS_VERSION_INFO VERSIONINFO #else VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE #endif FILEVERSION 2,0,0,0 PRODUCTVERSION 2,0,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "Library to access the Expert Witness Compression Format (EWF)\0" VALUE "FileVersion", "20140807" "\0" VALUE "InternalName", "libewf.dll\0" VALUE "LegalCopyright", "(c) 2006-2014, Joachim Metz \0" VALUE "OriginalFilename", "libewf.dll\0" VALUE "ProductName", "libewf\0" VALUE "ProductVersion", "20140807" "\0" VALUE "Comments", "For more information visit http://code.google.com/p/libewf/\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0409, 1200 END END libewf-20140807/libewf/libewf_metadata.h0000644000175000017500000003014513421013625022060 0ustar00lordyestalordyesta00000000000000/* * Metadata functions * * 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_METADATA_H ) #define _LIBEWF_METADATA_H #include #include #include "libewf_libcerror.h" #include "libewf_extern.h" #include "libewf_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBEWF_EXTERN \ int libewf_handle_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_sectors( libewf_handle_t *handle, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compression_flags, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compression_flags, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_media_size( libewf_handle_t *handle, size64_t *media_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_media_size( libewf_handle_t *handle, size64_t media_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_media_type( libewf_handle_t *handle, uint8_t *media_type, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_media_type( libewf_handle_t *handle, uint8_t media_type, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_media_flags( libewf_handle_t *handle, uint8_t media_flags, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_format( libewf_handle_t *handle, uint8_t *format, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_format( libewf_handle_t *handle, uint8_t format, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_segment_file_set_identifier( libewf_handle_t *handle, uint8_t *set_identifier, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_segment_file_set_identifier( libewf_handle_t *handle, const uint8_t *set_identifier, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_chunks_written( libewf_handle_t *handle, uint32_t *number_of_chunks, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_read_zero_chunk_on_error( libewf_handle_t *handle, uint8_t zero_on_error, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_acquiry_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_acquiry_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_append_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_checksum_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_checksum_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_append_checksum_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_sessions( libewf_handle_t *handle, uint32_t *number_of_sessions, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_session( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_append_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_tracks( libewf_handle_t *handle, uint32_t *number_of_tracks, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_track( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_append_track( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_header_codepage( libewf_handle_t *handle, int *header_codepage, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_header_codepage( libewf_handle_t *handle, int header_codepage, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_header_values_date_format( libewf_handle_t *handle, int *date_format, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_header_values_date_format( libewf_handle_t *handle, int date_format, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_header_values( libewf_handle_t *handle, uint32_t *number_of_values, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf8_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf16_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ); int libewf_handle_parse_header_values( libewf_internal_handle_t *internal_handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_number_of_hash_values( libewf_handle_t *handle, uint32_t *number_of_values, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf8_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf16_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ); int libewf_handle_parse_hash_values( libewf_internal_handle_t *internal_handle, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_libfvalue.h0000664000175000017500000000337313440663047022270 0ustar00lordyestalordyesta00000000000000/* * The libfvalue header wrapper * * Copyright (C) 2006-2018, 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_LIBFVALUE_H ) #define _LIBEWF_LIBFVALUE_H #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue */ #if defined( HAVE_LOCAL_LIBFVALUE ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBFVALUE_DLL_IMPORT * before including libfvalue.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFVALUE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFVALUE ) */ #endif /* !defined( _LIBEWF_LIBFVALUE_H ) */ libewf-20140807/libewf/ewf_session.h0000644000175000017500000000356113421013623021274 0ustar00lordyestalordyesta00000000000000/* * EWF session section (EWF-E01) * * 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( _EWF_SESSION_H ) #define _EWF_SESSION_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_session_header ewf_session_header_t; struct ewf_session_header { /* Number of sessions * consists of 4 bytes */ uint8_t number_of_sessions[ 4 ]; /* Unknown * consists of 28 bytes * contains 0x00 */ uint8_t unknown1[ 28 ]; /* The section checksum of all (previous) session data * consists of 4 bytes (32 bits) * starts with offset 76 */ uint8_t checksum[ 4 ]; /* The session entry array * consists of 32 bytes per sector * as long as necessary */ /* The last session entry is followed by a 4 byte checksum */ }; typedef struct ewf_session_entry ewf_session_entry_t; struct ewf_session_entry { /* The type * consists of 4 bytes */ uint8_t type[ 4 ]; /* The start sector of the session * consists of 4 bytes */ uint8_t start_sector[ 4 ]; /* Unknown * consists of 24 bytes * contains 0x00 */ uint8_t unknown2[ 24 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_date_time.c0000644000175000017500000000620313421013624022223 0ustar00lordyestalordyesta00000000000000/* * Date and time functions * * 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 . */ #include #include #include #include "libewf_libcerror.h" #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_date_time.h" /* Returns a structured representation of a time using the local timezone, or NULL on error */ int libewf_date_time_localtime( const time_t *timestamp, struct tm *time_elements, libcerror_error_t **error ) { #if ( defined( HAVE_LOCALTIME ) && !defined( HAVE_LOCALTIME_R ) ) || ( defined( WINAPI ) && !defined( _MSC_VER ) ) struct tm *static_time_elements = NULL; #endif static char *function = "libewf_date_time_localtime"; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time stamp.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } #if defined( _MSC_VER ) if( localtime_s( time_elements, timestamp ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements.", function ); return( -1 ); } #elif defined( HAVE_LOCALTIME_R ) if( localtime_r( timestamp, time_elements ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements.", function ); return( -1 ); } #elif defined( HAVE_LOCALTIME ) || defined( WINAPI ) static_time_elements = localtime( timestamp ); if( static_time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create static time elements.", function ); return( -1 ); } if( memory_copy( time_elements, static_time_elements, sizeof( struct tm ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set time elements.", function ); return( -1 ); } #endif return( 1 ); } libewf-20140807/libewf/libewf.rc.in0000664000175000017500000000207513440663046021016 0ustar00lordyestalordyesta00000000000000#include #ifdef GCC_WINDRES VS_VERSION_INFO VERSIONINFO #else VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE #endif FILEVERSION 2,0,0,0 PRODUCTVERSION 2,0,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "Library to access the Expert Witness Compression Format (EWF)\0" VALUE "FileVersion", "@VERSION@" "\0" VALUE "InternalName", "libewf.dll\0" VALUE "LegalCopyright", "(c) 2006-2014, Joachim Metz \0" VALUE "OriginalFilename", "libewf.dll\0" VALUE "ProductName", "libewf\0" VALUE "ProductVersion", "@VERSION@" "\0" VALUE "Comments", "For more information visit http://code.google.com/p/libewf/\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0409, 1200 END END libewf-20140807/libewf/ewf_file_header.h0000644000175000017500000000302013421013623022026 0ustar00lordyestalordyesta00000000000000/* * EWF file 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( _EWF_FILE_HEADER_H ) #define _EWF_FILE_HEADER_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_file_header ewf_file_header_t; struct ewf_file_header { /* The EWF file signature (magic header) * consists of 8 bytes containing * EVF 0x09 0x0d 0x0a 0xff 0x00 */ uint8_t signature[ 8 ]; /* The fields start * consists of 1 byte (8 bit) containing * 0x01 */ uint8_t fields_start; /* The fields segment number * consists of 2 bytes (16 bits) containing */ uint8_t fields_segment[ 2 ]; /* The fields end * consists of 2 bytes (16 bits) containing * 0x00 0x00 */ uint8_t fields_end[ 2 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_media_values.h0000644000175000017500000000440613421013625022737 0ustar00lordyestalordyesta00000000000000/* * Media values functions * * 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_MEDIA_VALUES_H ) #define _LIBEWF_MEDIA_VALUES_H #include #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_media_values libewf_media_values_t; /* Additional subhandle for media specific parameters */ struct libewf_media_values { /* The media size */ size64_t media_size; /* The size of an individual chunk */ size32_t chunk_size; /* The number of sectors per chunk */ uint32_t sectors_per_chunk; /* The number of bytes per sector */ uint32_t bytes_per_sector; /* The number of chunks */ uint32_t number_of_chunks; /* The number of sectors */ uint64_t number_of_sectors; /* The number of sectors to use as error granularity */ uint32_t error_granularity; /* The media type */ uint8_t media_type; /* The media flags */ uint8_t media_flags; /* The GUID of the acquiry system */ uint8_t guid[ 16 ]; }; int libewf_media_values_initialize( libewf_media_values_t **media_values, libcerror_error_t **error ); int libewf_media_values_free( libewf_media_values_t **media_values, libcerror_error_t **error ); int libewf_media_values_clone( libewf_media_values_t **destination_media_values, libewf_media_values_t *source_media_values, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_segment_file.h0000664000175000017500000002127713421013625022751 0ustar00lordyestalordyesta00000000000000/* * Segment file reading/writing functions * * 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_SEGMENT_FILE_H ) #define _LIBEWF_SEGMENT_FILE_H #include #include #include "libewf_chunk_table.h" #include "libewf_hash_sections.h" #include "libewf_header_sections.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #include "libewf_section.h" #include "libewf_single_files.h" #include "ewf_data.h" #include "ewf_table.h" #if defined( __cplusplus ) extern "C" { #endif extern const uint8_t dvf_file_signature[ 8 ]; extern const uint8_t evf_file_signature[ 8 ]; extern const uint8_t lvf_file_signature[ 8 ]; typedef struct libewf_segment_file libewf_segment_file_t; struct libewf_segment_file { /* The segment file type */ uint8_t type; /* The segment number */ uint16_t segment_number; /* The last section offset */ off64_t last_section_offset; /* The list of all the sections */ libcdata_list_t *section_list; /* The number of chunks */ uint32_t number_of_chunks; /* Flags */ uint8_t flags; }; int libewf_segment_file_initialize( libewf_segment_file_t **segment_file, libcerror_error_t **error ); int libewf_segment_file_free( libewf_segment_file_t **segment_file, libcerror_error_t **error ); int libewf_segment_file_clone( libewf_segment_file_t **destination_segment_file, libewf_segment_file_t *source_segment_file, libcerror_error_t **error ); ssize_t libewf_segment_file_read_file_header( libewf_segment_file_t *segment_file, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ); ssize_t libewf_segment_file_write_file_header( libewf_segment_file_t *segment_file, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ); int libewf_segment_file_read( intptr_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_file_t *file, libfcache_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ); ssize_t libewf_segment_file_read_table_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ); ssize_t libewf_segment_file_read_table2_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ); ssize_t libewf_segment_file_read_volume_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ); ssize_t libewf_segment_file_read_delta_chunk_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ); ssize_t libewf_segment_file_write_headers( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, libcerror_error_t **error ); ssize_t libewf_segment_file_write_last_section( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, int last_segment_file, libcerror_error_t **error ); ssize_t libewf_segment_file_write_start( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libewf_header_sections_t *header_sections, ewf_data_t **cached_data_section, libcerror_error_t **error ); ssize_t libewf_segment_file_write_chunks_section_start( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libmfdata_list_t *chunk_table_list, ewf_table_offset_t *table_offsets, uint32_t number_of_table_offsets, uint32_t number_of_chunks_written, uint32_t chunks_per_section, libcerror_error_t **error ); ssize_t libewf_segment_file_write_chunks_section_correction( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libmfdata_list_t *chunk_table_list, ewf_table_offset_t *table_offsets, uint32_t number_of_table_offsets, off64_t chunks_section_offset, size64_t chunks_section_size, uint32_t number_of_chunks, uint32_t section_number_of_chunks, libcerror_error_t **error ); ssize_t libewf_segment_file_write_chunk( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_list_t *chunk_table_list, int chunk_index, uint8_t *chunk_buffer, size_t chunk_buffer_size, size_t chunk_data_size, int8_t is_compressed, uint8_t *checksum_buffer, uint32_t *chunk_checksum, int8_t write_checksum, libcerror_error_t **error ); ssize_t libewf_segment_file_write_delta_chunk( libewf_segment_file_t *segment_file, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libmfdata_list_t *chunk_table_list, int chunk_index, uint8_t *chunk_buffer, size_t chunk_size, uint8_t *checksum_buffer, uint32_t *chunk_checksum, uint8_t write_checksum, uint8_t no_section_append, libcerror_error_t **error ); ssize_t libewf_segment_file_write_close( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, uint32_t number_of_chunks_written_to_segment, int last_segment_file, libewf_hash_sections_t *hash_sections, libfvalue_table_t *hash_values, libewf_media_values_t *media_values, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, ewf_data_t **cached_data_section, libcerror_error_t **error ); int libewf_segment_file_write_sections_correction( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint32_t number_of_chunks_written_to_segment, int last_segment_file, libewf_media_values_t *media_values, libfvalue_table_t *hash_values, libewf_hash_sections_t *hash_sections, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, ewf_data_t **cached_data_section, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_chunk_table.h0000644000175000017500000000724313421013623022560 0ustar00lordyestalordyesta00000000000000/* * Chunk table functions * * 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_CHUNK_TABLE_H ) #define _LIBEWF_CHUNK_TABLE_H #include #include #include "libewf_libcerror.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_section.h" #include "ewf_table.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_chunk_table libewf_chunk_table_t; struct libewf_chunk_table { /* The IO handle */ libewf_io_handle_t *io_handle; /* The chunk size */ uint32_t chunk_size; /* The previous last chunk that was filled */ int previous_last_chunk_filled; /* The last chunk that was filled */ int last_chunk_filled; /* The last chunk that was compared */ int last_chunk_compared; }; int libewf_chunk_table_initialize( libewf_chunk_table_t **chunk_table, libewf_io_handle_t *io_handle, libcerror_error_t **error ); int libewf_chunk_table_free( libewf_chunk_table_t **chunk_table, libcerror_error_t **error ); int libewf_chunk_table_clone( intptr_t **destination_chunk_table, intptr_t *source_chunk_table, libcerror_error_t **error ); int libewf_chunk_table_read_chunk( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_element_t *list_element, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_range_flags, uint8_t read_flags, libcerror_error_t **error ); int libewf_chunk_table_read_offsets( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_t *chunk_table_list, int element_index, int number_of_elements, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_group_offset, size64_t element_group_size, uint32_t element_group_flags, uint8_t read_flags, libcerror_error_t **error ); int libewf_chunk_table_fill( libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, int chunk_index, int file_io_pool_entry, libewf_section_t *table_section, off64_t base_chunk, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, uint8_t tainted, libcerror_error_t **error ); int libewf_chunk_table_correct( libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, int chunk_index, int file_io_pool_entry, libewf_section_t *table_section, off64_t base_chunk, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, uint8_t tainted, libcerror_error_t **error ); int libewf_chunk_table_fill_offsets( libmfdata_list_t *chunk_table_list, int chunk_index, off64_t base_offset, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_header_values.h0000644000175000017500000001777213421013624023121 0ustar00lordyestalordyesta00000000000000/* * Header values functions * * 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_HEADER_VALUES_H ) #define _LIBEWF_HEADER_VALUES_H #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #if defined( __cplusplus ) extern "C" { #endif enum LIBEWF_HEADER_VALUES_INDEXES { LIBEWF_HEADER_VALUES_INDEX_CASE_NUMBER, LIBEWF_HEADER_VALUES_INDEX_DESCRIPTION, LIBEWF_HEADER_VALUES_INDEX_EXAMINER_NAME, LIBEWF_HEADER_VALUES_INDEX_EVIDENCE_NUMBER, LIBEWF_HEADER_VALUES_INDEX_NOTES, LIBEWF_HEADER_VALUES_INDEX_ACQUIRY_DATE, LIBEWF_HEADER_VALUES_INDEX_SYSTEM_DATE, LIBEWF_HEADER_VALUES_INDEX_ACQUIRY_OPERATING_SYSTEM, LIBEWF_HEADER_VALUES_INDEX_ACQUIRY_SOFTWARE_VERSION, LIBEWF_HEADER_VALUES_INDEX_PASSWORD, LIBEWF_HEADER_VALUES_INDEX_COMPRESSION_TYPE, LIBEWF_HEADER_VALUES_INDEX_MODEL, LIBEWF_HEADER_VALUES_INDEX_SERIAL_NUMBER, LIBEWF_HEADER_VALUES_INDEX_DEVICE_LABEL, LIBEWF_HEADER_VALUES_INDEX_PROCESS_IDENTIFIER, LIBEWF_HEADER_VALUES_INDEX_UNKNOWN_DC, LIBEWF_HEADER_VALUES_INDEX_EXTENTS, /* Value to indicate the default number of header values */ LIBEWF_HEADER_VALUES_DEFAULT_AMOUNT }; enum LIBEWF_HEADER_STRING_TYPE { /* header string: original EWF, EnCase1 */ LIBEWF_HEADER_STRING_TYPE_1 = 1, /* header string: EnCase2, EnCase3, FTK Imager 2 */ LIBEWF_HEADER_STRING_TYPE_2 = 2, /* header string: EnCase4, EnCase5 */ LIBEWF_HEADER_STRING_TYPE_3 = 3, /* header2 string: EnCase4 */ LIBEWF_HEADER_STRING_TYPE_4 = 4, /* header2 string: EnCase5 */ LIBEWF_HEADER_STRING_TYPE_5 = 5, /* header string: linen6 * header2 string: EnCase6 */ LIBEWF_HEADER_STRING_TYPE_6 = 6, /* header string: linen5 */ LIBEWF_HEADER_STRING_TYPE_7 = 7, /* header string: linen7 * header2 string: EnCase7 */ LIBEWF_HEADER_STRING_TYPE_8 = 8 }; int libewf_header_values_initialize( libfvalue_table_t **header_values, libcerror_error_t **error ); int libewf_header_values_set_value_by_index( libfvalue_table_t *header_values, int value_index, const uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ); int libewf_convert_date_header_value( const uint8_t *header_value, size_t header_value_size, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ); int libewf_generate_date_header_value( time_t timestamp, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ); int libewf_convert_date_header2_value( const uint8_t *header_value, size_t header_value_size, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ); int libewf_generate_date_header2_value( time_t timestamp, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ); int libewf_header_values_copy( libfvalue_table_t *destination_header_values, libfvalue_table_t *source_header_values, libcerror_error_t **error ); int libewf_header_values_parse_utf8_header_string( libfvalue_table_t *header_values, const uint8_t *header_string, size_t header_string_size, uint8_t header_section_number, uint8_t *format, libcerror_error_t **error ); int libewf_header_values_parse_header( libfvalue_table_t *header_values, uint8_t *header, size_t header_size, int codepage, uint8_t *format, libcerror_error_t **error ); int libewf_header_values_parse_header2( libfvalue_table_t *header_values, uint8_t *header2, size_t header2_size, uint8_t *format, libcerror_error_t **error ); int libewf_header_values_convert_utf8_header_string_to_header( const uint8_t *header_string, size_t header_string_size, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_utf8_header_string( libfvalue_table_t *header_values, uint8_t header_string_type, uint8_t *newline_string, size_t newline_string_length, time_t timestamp, int8_t compression_level, uint8_t **utf8_string, size_t *utf8_string_size, libcerror_error_t **error ); int libewf_header_values_generate_header_ewf( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_header_encase1( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_header_ftk( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_header_encase2( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_header_encase4( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_header_linen( libfvalue_table_t *header_values, uint8_t format, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); int libewf_header_values_generate_header2( libfvalue_table_t *header_values, uint8_t format, time_t timestamp, int8_t compression_level, uint8_t **header2, size_t *header2_size, libcerror_error_t **error ); int libewf_convert_date_xheader_value( const uint8_t *header_value, size_t header_value_length, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ); int libewf_generate_date_xheader_value( time_t timestamp, uint8_t **date_time_values_string, size_t *date_time_values_string_size, libcerror_error_t **error ); int libewf_header_values_parse_xheader( libfvalue_table_t *header_values, const uint8_t *xheader, size_t size, libcerror_error_t **error ); int libewf_header_values_parse_xheader_date_value( libfvalue_table_t *header_values, const uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ); int libewf_header_values_generate_xheader( libfvalue_table_t *header_values, time_t timestamp, uint8_t **xheader, size_t *xheader_size, libcerror_error_t **error ); int libewf_header_values_generate_header_ewfx( libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t **header, size_t *header_size, int codepage, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_io_handle.c0000644000175000017500000001363213421013624022216 0ustar00lordyestalordyesta00000000000000/* * IO handle functions * * 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 . */ #include #include #include #include "libewf_libcerror.h" #include "libewf_codepage.h" #include "libewf_definitions.h" #include "libewf_io_handle.h" #include "ewf_definitions.h" /* Initialize the IO handle * Returns 1 if successful or -1 on error */ int libewf_io_handle_initialize( libewf_io_handle_t **io_handle, libcerror_error_t **error ) { static char *function = "libewf_io_handle_initialize"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( *io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid IO handle value already set.", function ); return( -1 ); } *io_handle = memory_allocate_structure( libewf_io_handle_t ); if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create IO handle.", function ); goto on_error; } if( memory_set( *io_handle, 0, sizeof( libewf_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear IO handle.", function ); goto on_error; } ( *io_handle )->format = LIBEWF_FORMAT_ENCASE5; ( *io_handle )->ewf_format = EWF_FORMAT_E01; ( *io_handle )->compression_level = EWF_COMPRESSION_NONE; ( *io_handle )->header_codepage = LIBEWF_CODEPAGE_ASCII; return( 1 ); on_error: if( *io_handle != NULL ) { memory_free( *io_handle ); *io_handle = NULL; } return( -1 ); } /* Frees the IO handle including elements * Returns 1 if successful or -1 on error */ int libewf_io_handle_free( libewf_io_handle_t **io_handle, libcerror_error_t **error ) { static char *function = "libewf_io_handle_free"; int result = 1; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( *io_handle != NULL ) { if( libewf_io_handle_clear( *io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear IO handle.", function ); result = -1; } memory_free( *io_handle ); *io_handle = NULL; } return( result ); } /* Clears the IO handle * Returns 1 if successful or -1 on error */ int libewf_io_handle_clear( libewf_io_handle_t *io_handle, libcerror_error_t **error ) { static char *function = "libewf_io_handle_clear"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( memory_set( io_handle, 0, sizeof( libewf_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear IO handle.", function ); return( -1 ); } io_handle->format = LIBEWF_FORMAT_ENCASE5; io_handle->ewf_format = EWF_FORMAT_E01; io_handle->compression_level = EWF_COMPRESSION_NONE; io_handle->header_codepage = LIBEWF_CODEPAGE_ASCII; return( 1 ); } /* Clones the IO handle * Returns 1 if successful or -1 on error */ int libewf_io_handle_clone( libewf_io_handle_t **destination_io_handle, libewf_io_handle_t *source_io_handle, libcerror_error_t **error ) { static char *function = "libewf_io_handle_clone"; if( destination_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination IO handle.", function ); return( -1 ); } if( *destination_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination IO handle value already set.", function ); return( -1 ); } if( source_io_handle == NULL ) { *destination_io_handle = NULL; return( 1 ); } *destination_io_handle = memory_allocate_structure( libewf_io_handle_t ); if( *destination_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination IO handle.", function ); goto on_error; } if( memory_copy( *destination_io_handle, source_io_handle, sizeof( libewf_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination IO handle.", function ); goto on_error; } return( 1 ); on_error: if( *destination_io_handle != NULL ) { memory_free( *destination_io_handle ); *destination_io_handle = NULL; } return( -1 ); } libewf-20140807/libewf/libewf_legacy.c0000664000175000017500000026317113421024433021547 0ustar00lordyestalordyesta00000000000000/* * Legacy functions * * 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 . */ #include #include #include #include #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" #if !defined( HAVE_LOCAL_LIBEWF ) /* Returns the flags for reading */ uint8_t libewf_get_flags_read( void ) { return( (uint8_t) LIBEWF_ACCESS_FLAG_READ ); } /* Returns the flags for reading and writing */ uint8_t libewf_get_flags_read_write( void ) { return( (uint8_t) ( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE ) ); } /* Returns the flags for writing */ uint8_t libewf_get_flags_write( void ) { return( (uint8_t) LIBEWF_ACCESS_FLAG_WRITE ); } /* Returns the flags for resume writing */ uint8_t libewf_get_flags_write_resume( void ) { return( (uint8_t) LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ); } /* Sets the maximum amount of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int libewf_handle_set_maximum_amount_of_open_handles( libewf_handle_t *handle, int maximum_amount_of_open_handles, libcerror_error_t **error ) { return( libewf_handle_set_maximum_number_of_open_handles( handle, maximum_amount_of_open_handles, error ) ); } /* Retrieves the segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size, libcerror_error_t **error ) { return( libewf_handle_get_maximum_segment_size( handle, segment_file_size, error ) ); } /* Sets the segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size, libcerror_error_t **error ) { return( libewf_handle_set_maximum_segment_size( handle, segment_file_size, error ) ); } /* Retrieves the delta segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size, libcerror_error_t **error ) { return( libewf_handle_get_maximum_delta_segment_size( handle, delta_segment_file_size, error ) ); } /* Sets the delta segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size, libcerror_error_t **error ) { return( libewf_handle_set_maximum_delta_segment_size( handle, delta_segment_file_size, error ) ); } /* Retrieves the amount of sectors * Returns 1 if successful or -1 on error */ int libewf_handle_get_amount_of_sectors( libewf_handle_t *handle, uint64_t *amount_of_sectors, libcerror_error_t **error ) { return( libewf_handle_get_number_of_sectors( handle, amount_of_sectors, error ) ); } /* Retrieves the amount of chunks written * Returns 1 if successful or -1 on error */ int libewf_handle_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks, libcerror_error_t **error ) { return( libewf_handle_get_number_of_chunks_written( handle, amount_of_chunks, error ) ); } /* Sets the read wipe chunk on error * The chunk is not wiped if read raw is used * Returns 1 if successful or -1 on error */ int libewf_handle_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error, libcerror_error_t **error ) { return( libewf_handle_set_read_zero_chunk_on_error( handle, wipe_on_error, error ) ); } /* Retrieves the amount of acquiry errors * Returns 1 if successful or -1 on error */ int libewf_handle_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libcerror_error_t **error ) { return( libewf_handle_get_number_of_acquiry_errors( handle, amount_of_errors, error ) ); } /* Add an acquiry error * Returns 1 if successful or -1 on error */ int libewf_handle_add_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { return( libewf_handle_append_acquiry_error( handle, start_sector, number_of_sectors, error ) ); } /* Retrieves the number of CRC errors * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_crc_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libcerror_error_t **error ) { return( libewf_handle_get_number_of_checksum_errors( handle, number_of_errors, error ) ); } /* Retrieves the amount of CRC errors * Returns 1 if successful or -1 on error */ int libewf_handle_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors, libcerror_error_t **error ) { return( libewf_handle_get_number_of_checksum_errors( handle, amount_of_errors, error ) ); } /* Retrieves a CRC error * Returns 1 if successful or -1 on error */ int libewf_handle_get_crc_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { return( libewf_handle_get_checksum_error( handle, index, start_sector, number_of_sectors, error ) ); } /* Add a CRC error * Returns 1 if successful or -1 on error */ int libewf_handle_add_crc_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { return( libewf_handle_append_checksum_error( handle, start_sector, number_of_sectors, error ) ); } /* Retrieves the amount of sessions * Returns 1 if successful or -1 on error */ int libewf_handle_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions, libcerror_error_t **error ) { return( libewf_handle_get_number_of_sessions( handle, amount_of_sessions, error ) ); } /* Add a session * Returns 1 if successful or -1 on error */ int libewf_handle_add_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { return( libewf_handle_append_session( handle, start_sector, number_of_sectors, error ) ); } /* Retrieves the amount of header values * Returns 1 if successful, 0 if no header values are present or -1 on error */ int libewf_handle_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values, libcerror_error_t **error ) { return( libewf_handle_get_number_of_header_values( handle, amount_of_values, error ) ); } /* Retrieves the size of the UTF-8 encoded header value of an identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libcerror_error_t **error ) { return( libewf_handle_get_utf8_header_value_size( handle, identifier, identifier_length, value_size, error ) ); } /* Retrieves the UTF-8 encoded header value of an identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libcerror_error_t **error ) { return( libewf_handle_get_utf8_header_value( handle, identifier, identifier_length, value, value_size, error ) ); } /* Sets the UTF-8 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ int libewf_handle_set_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libcerror_error_t **error ) { return( libewf_handle_set_utf8_header_value( handle, identifier, identifier_length, value, value_length, error ) ); } /* Retrieves the amount of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error */ int libewf_handle_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values, libcerror_error_t **error ) { return( libewf_handle_get_number_of_hash_values( handle, amount_of_values, error ) ); } /* Retrieves the size of the UTF-8 encoded hash value of an identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *value_size, libcerror_error_t **error ) { return( libewf_handle_get_utf8_hash_value_size( handle, identifier, identifier_length, value_size, error ) ); } /* Retrieves the UTF-8 encoded hash value of an identifier * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *value, size_t value_size, libcerror_error_t **error ) { return( libewf_handle_get_utf8_hash_value( handle, identifier, identifier_length, value, value_size, error ) ); } /* Sets the UTF-8 encoded hash value specified by the identifier * Returns 1 if successful or -1 on error */ int libewf_handle_set_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *value, size_t value_length, libcerror_error_t **error ) { return( libewf_handle_set_utf8_hash_value( handle, identifier, identifier_length, value, value_length, error ) ); } /* Retrieves the amount of sub file entries * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_amount_of_sub_file_entries( libewf_file_entry_t *file_entry, int *amount_of_sub_file_entries, libcerror_error_t **error ) { return( libewf_file_entry_get_number_of_sub_file_entries( file_entry, amount_of_sub_file_entries, error ) ); } /* Retrieves the size of the UTF-8 encoded name from the referenced file entry * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_name_size( libewf_file_entry_t *file_entry, size_t *name_size, libcerror_error_t **error ) { return( libewf_file_entry_get_utf8_name_size( file_entry, name_size, error ) ); } /* Retrieves the UTF-8 encoded name value from the referenced file entry * The size should include the end of string character * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_name( libewf_file_entry_t *file_entry, uint8_t *name, size_t name_size, libcerror_error_t **error ) { return( libewf_file_entry_get_utf8_name( file_entry, name, name_size, error ) ); } #endif #if defined( HAVE_V1_API ) #if !defined( HAVE_LOCAL_LIBEWF ) /* Sets the notify values */ void libewf_set_notify_values( FILE *stream, int verbose ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_notify_values"; if( libewf_notify_set_stream( stream, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to set notify stream.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } libewf_notify_set_verbose( verbose ); } #endif /* Signals the libewf handle to abort its current activity * Returns 1 if successful or -1 on error */ int libewf_signal_abort( libewf_handle_t *handle ) { libcerror_error_t *error = NULL; static char *function = "libewf_signal_abort"; if( libewf_handle_signal_abort( handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to signal abort.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns a pointer to the new instance of handle, NULL on error */ libewf_handle_t *libewf_open( char * const filenames[], int amount_of_files, uint8_t flags ) { libcerror_error_t *error = NULL; libewf_handle_t *handle = NULL; static char *function = "libewf_open"; if( libewf_handle_initialize( &handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( NULL ); } if( libewf_handle_open( handle, filenames, amount_of_files, flags, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); libewf_handle_free( &handle, NULL ); return( NULL ); } return( handle ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns a pointer to the new instance of handle, NULL on error */ libewf_handle_t *libewf_open_wide( wchar_t * const filenames[], int amount_of_files, uint8_t flags ) { libcerror_error_t *error = NULL; libewf_handle_t *handle = NULL; static char *function = "libewf_open_wide"; if( libewf_handle_initialize( &handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( NULL ); } if( libewf_handle_open_wide( handle, filenames, amount_of_files, flags, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( NULL ); } return( handle ); } #endif /* Closes the EWF handle and frees memory used within the handle * Returns 0 if successful or -1 on error */ int libewf_close( libewf_handle_t *handle ) { libcerror_error_t *error = NULL; static char *function = "libewf_close"; if( libewf_handle_close( handle, &error ) != 0 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to close handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( libewf_handle_free( &handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 0 ); } /* Seeks a certain offset of the media data within the EWF file(s) * It will set the related file offset to the specific chunk offset * Returns the offset if seek is successful or -1 on error */ off64_t libewf_seek_offset( libewf_handle_t *handle, off64_t offset ) { libcerror_error_t *error = NULL; static char *function = "libewf_seek_offset"; offset = libewf_handle_seek_offset( handle, offset, SEEK_SET, &error ); if( offset == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( offset ); } /* Retrieves the current offset of the media data within the EWF file(s) * Returns the offset if successful or -1 on error */ off64_t libewf_get_offset( libewf_handle_t *handle ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_offset"; off64_t offset = 0; if( libewf_handle_get_offset( handle, &offset, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( offset ); } /* Prepares a buffer with chunk data after reading it according to the handle settings * intended for raw read * The buffer size cannot be larger than the chunk size * Returns the resulting chunk size or -1 on error */ ssize_t libewf_raw_read_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *uncompressed_buffer, size_t *uncompressed_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum ) { libcerror_error_t *error = NULL; static char *function = "libewf_raw_read_prepare_buffer"; ssize_t chunk_data_size = 0; chunk_data_size = libewf_handle_prepare_read_chunk( handle, buffer, buffer_size, uncompressed_buffer, uncompressed_buffer_size, is_compressed, chunk_checksum, read_checksum, &error ); if( chunk_data_size == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to raw read prepare buffer.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( chunk_data_size ); } /* Reads 'raw' data from the current offset into a buffer * size contains the size of the buffer * The function sets the chunk checksum, is compressed and read checksum values * Returns the amount of bytes read or -1 on error */ ssize_t libewf_raw_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *read_checksum ) { uint8_t checksum_buffer[ 4 ]; libcerror_error_t *error = NULL; static char *function = "libewf_raw_read_buffer"; ssize_t read_count = 0; read_count = libewf_handle_read_chunk( handle, buffer, buffer_size, is_compressed, checksum_buffer, chunk_checksum, read_checksum, &error ); if( read_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to raw read buffer.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( read_count ); } /* Reads media data from the last current into a buffer * Returns the amount of bytes read or -1 on error */ ssize_t libewf_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_read_buffer"; ssize_t read_count = 0; read_count = libewf_handle_read_buffer( handle, buffer, buffer_size, &error ); if( read_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( read_count ); } /* Reads media data at a specific offset * Returns the amount of bytes read or -1 on error */ ssize_t libewf_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ) { libcerror_error_t *error = NULL; static char *function = "libewf_read_random"; ssize_t read_count = 0; read_count = libewf_handle_read_random( handle, buffer, buffer_size, offset, &error ); if( read_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read random.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( read_count ); } /* Prepares a buffer with chunk data before writing according to the handle settings * intended for raw write * The buffer size cannot be larger than the chunk size * The function sets the chunk checksum, is compressed and write checksum values * Returns the resulting chunk size or -1 on error */ ssize_t libewf_raw_write_prepare_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, void *compressed_buffer, size_t *compressed_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum ) { libcerror_error_t *error = NULL; static char *function = "libewf_raw_write_prepare_buffer"; ssize_t chunk_data_size = 0; chunk_data_size = libewf_handle_prepare_write_chunk( handle, buffer, buffer_size, compressed_buffer, compressed_buffer_size, is_compressed, chunk_checksum, write_checksum, &error ); if( chunk_data_size == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to raw write prepare buffer.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( chunk_data_size ); } /* Writes 'raw' data in EWF format the current offset * the necessary settings of the write values must have been made * size contains the size of the data within the buffer while * data size contains the size of the actual input data * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_raw_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, size_t data_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t write_checksum ) { uint8_t checksum_buffer[ 4 ]; libcerror_error_t *error = NULL; static char *function = "libewf_raw_write_buffer"; ssize_t write_count = 0; write_count = libewf_handle_write_chunk( handle, buffer, buffer_size, data_size, is_compressed, checksum_buffer, chunk_checksum, write_checksum, &error ); if( write_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to raw write buffer.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( write_count ); } /* Writes data in EWF format at the current offset * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_write_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_write_buffer"; ssize_t write_count = 0; write_count = libewf_handle_write_buffer( handle, buffer, buffer_size, &error ); if( write_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write buffer.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( write_count ); } /* Writes data in EWF format at a specific offset, * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_write_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset ) { libcerror_error_t *error = NULL; static char *function = "libewf_write_random"; ssize_t write_count = 0; write_count = libewf_handle_write_random( handle, buffer, buffer_size, offset, &error ); if( write_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write random.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( write_count ); } /* Finalizes the write by correcting the EWF the meta data in the segment files * This function is required after write from stream * Returns the amount of bytes written or -1 on error */ ssize_t libewf_write_finalize( libewf_handle_t *handle ) { libcerror_error_t *error = NULL; static char *function = "libewf_write_finalize"; ssize_t write_count = 0; write_count = libewf_handle_write_finalize( handle, &error ); if( write_count == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize write.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( write_count ); } /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_segment_filename"; int result = 0; result = libewf_handle_get_segment_filename( handle, filename, filename_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( result ); } /* Sets the segment file * Returns 1 if successful or -1 on error */ int libewf_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_segment_filename"; if( libewf_handle_set_segment_filename( handle, filename, filename_length, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_segment_filename_wide"; int result = 0; result = libewf_handle_get_segment_filename_wide( handle, filename, filename_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve wide segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( result ); } /* Sets the segment file * Returns 1 if successful or -1 on error */ int libewf_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_segment_filename_wide"; if( libewf_handle_set_segment_filename_wide( handle, filename, filename_length, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set wide segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } #endif /* Retrieves the segment file size * Returns 1 if successful or -1 on error */ int libewf_get_segment_file_size( libewf_handle_t *handle, size64_t *segment_file_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_segment_file_size"; if( libewf_handle_get_segment_file_size( handle, segment_file_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the segment file size * Returns 1 if successful or -1 on error */ int libewf_set_segment_file_size( libewf_handle_t *handle, size64_t segment_file_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_segment_file_size"; if( libewf_handle_set_segment_file_size( handle, segment_file_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_delta_segment_filename"; int result = 0; result = libewf_handle_get_delta_segment_filename( handle, filename, filename_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve delta segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( result ); } /* Sets the delta segment file * Returns 1 if successful or -1 on error */ int libewf_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_delta_segment_filename"; if( libewf_handle_set_delta_segment_filename( handle, filename, filename_length, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set delta segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_delta_segment_filename_wide"; int result = 0; result = libewf_handle_get_delta_segment_filename_wide( handle, filename, filename_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve wide delta segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( result ); } /* Sets the delta segment file * Returns 1 if successful or -1 on error */ int libewf_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_delta_segment_filename_wide"; if( libewf_handle_set_delta_segment_filename_wide( handle, filename, filename_length, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set wide delta segment filename.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } #endif /* Retrieves the delta segment file size * Returns 1 if successful or -1 on error */ int libewf_get_delta_segment_file_size( libewf_handle_t *handle, size64_t *delta_segment_file_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_delta_segment_file_size"; if( libewf_handle_get_delta_segment_file_size( handle, delta_segment_file_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve delta segment file size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the delta segment file size * Returns 1 if successful or -1 on error */ int libewf_set_delta_segment_file_size( libewf_handle_t *handle, size64_t delta_segment_file_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_delta_segment_file_size"; if( libewf_handle_set_delta_segment_file_size( handle, delta_segment_file_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set delta segment file size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of sectors per chunk * Returns 1 if successful or -1 on error */ int libewf_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_sectors_per_chunk"; if( libewf_handle_get_sectors_per_chunk( handle, sectors_per_chunk, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of sectors per chunk.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the amount of sectors per chunk * Returns 1 if successful or -1 on error */ int libewf_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_sectors_per_chunk"; if( libewf_handle_set_sectors_per_chunk( handle, sectors_per_chunk, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the amount of sectors per chunk.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of bytes per sector * Returns 1 if successful or -1 on error */ int libewf_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_bytes_per_sector"; if( libewf_handle_get_bytes_per_sector( handle, bytes_per_sector, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of bytes per sector.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the amount of bytes per sector * Returns 1 if successful or -1 on error */ int libewf_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_bytes_per_sector"; if( libewf_handle_set_bytes_per_sector( handle, bytes_per_sector, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the amount of bytes per sector.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of sectors * Returns 1 if successful or -1 on error */ int libewf_get_amount_of_sectors( libewf_handle_t *handle, uint32_t *amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_amount_of_sectors"; uint64_t safe_amount_of_sectors = 0; if( amount_of_sectors == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid amount of sectors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( libewf_handle_get_amount_of_sectors( handle, &safe_amount_of_sectors, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of sectors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( safe_amount_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid amount of sectors value exceeds maximum.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } *amount_of_sectors = (uint32_t) safe_amount_of_sectors; return( 1 ); } /* Retrieves the chunk size * Returns 1 if successful or -1 on error */ int libewf_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_chunk_size"; if( libewf_handle_get_chunk_size( handle, chunk_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the chunk size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the error granularity * Returns 1 if successful or -1 on error */ int libewf_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_error_granularity"; if( libewf_handle_get_error_granularity( handle, error_granularity, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the error granularity.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the error granularity * Returns 1 if successful or -1 on error */ int libewf_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_error_granularity"; if( libewf_handle_set_error_granularity( handle, error_granularity, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the error granularity.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the compression values * Returns 1 if successful or -1 on error */ int libewf_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compress_empty_block ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_compression_values"; uint8_t compression_flags = 0; if( libewf_handle_get_compression_values( handle, compression_level, &compression_flags, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the compression values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( ( compression_flags & LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK ) == LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK ) { *compress_empty_block = 1; } else { *compress_empty_block = 0; } return( 1 ); } /* Sets the compression values * Returns 1 if successful or -1 on error */ int libewf_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compress_empty_block ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_compression_values"; uint8_t compression_flags = 0; if( compress_empty_block != 0 ) { compression_flags = LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK; } if( libewf_handle_set_compression_values( handle, compression_level, compression_flags, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the compression values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the size of the contained media data * Returns 1 if successful or -1 on error */ int libewf_get_media_size( libewf_handle_t *handle, size64_t *media_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_media_size"; if( libewf_handle_get_media_size( handle, media_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the media size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the media size * Returns 1 if successful or -1 on error */ int libewf_set_media_size( libewf_handle_t *handle, size64_t media_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_media_size"; if( libewf_handle_set_media_size( handle, media_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the media size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the media type value * Returns 1 if successful or -1 on error */ int libewf_get_media_type( libewf_handle_t *handle, uint8_t *media_type ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_media_type"; if( libewf_handle_get_media_type( handle, media_type, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the media type.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the media type * Returns 1 if successful or -1 on error */ int libewf_set_media_type( libewf_handle_t *handle, uint8_t media_type ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_media_type"; if( libewf_handle_set_media_type( handle, media_type, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the media type.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the media flags * Returns 1 if successful or -1 on error */ int libewf_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_media_flags"; if( libewf_handle_get_media_flags( handle, media_flags, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the media flags.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the media flags * Returns 1 if successful or -1 on error */ int libewf_set_media_flags( libewf_handle_t *handle, uint8_t media_flags ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_media_flags"; if( libewf_handle_set_media_flags( handle, media_flags, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the media flags.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the volume type value * Returns 1 if successful or -1 on error */ int libewf_get_volume_type( libewf_handle_t *handle, uint8_t *volume_type ) { libcerror_error_t *error = NULL; libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_get_volume_type"; if( handle == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( volume_type == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid volume type.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( ( internal_handle->media_values->media_flags & 0x02 ) == 0 ) { *volume_type = (int8_t) LIBEWF_VOLUME_TYPE_LOGICAL; } else { *volume_type = (int8_t) LIBEWF_VOLUME_TYPE_PHYSICAL; } return( 1 ); } /* Sets the volume type * Returns 1 if successful or -1 on error */ int libewf_set_volume_type( libewf_handle_t *handle, uint8_t volume_type ) { libcerror_error_t *error = NULL; libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_set_volume_type"; if( handle == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: volume type cannot be changed.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( volume_type == LIBEWF_VOLUME_TYPE_LOGICAL ) { /* Uses 1-complement of LIBEWF_MEDIA_FLAG_PHYSICAL */ internal_handle->media_values->media_flags &= ~LIBEWF_MEDIA_FLAG_PHYSICAL; } else if( volume_type == LIBEWF_VOLUME_TYPE_PHYSICAL ) { internal_handle->media_values->media_flags |= LIBEWF_MEDIA_FLAG_PHYSICAL; } else { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported volume type.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the format type value * Returns 1 if successful or -1 on error */ int libewf_get_format( libewf_handle_t *handle, uint8_t *format ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_format"; if( libewf_handle_get_format( handle, format, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the format.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the output format * Returns 1 if successful or -1 on error */ int libewf_set_format( libewf_handle_t *handle, uint8_t format ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_format"; if( libewf_handle_set_format( handle, format, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the format.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the GUID * Returns 1 if successful or -1 on error */ int libewf_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_guid"; if( libewf_handle_get_guid( handle, guid, size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the GUID.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the GUID * Returns 1 if successful or -1 on error */ int libewf_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_guid"; if( libewf_handle_set_guid( handle, guid, size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the GUID.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the GUID * Returns 1 if successful or -1 on error */ int libewf_handle_get_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_guid"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( guid == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid GUID.", function ); return( -1 ); } if( size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: GUID too small.", function ); return( -1 ); } if( memory_copy( guid, internal_handle->media_values->guid, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set GUID.", function ); return( -1 ); } return( 1 ); } /* Sets the GUID * Returns 1 if successful or -1 on error */ int libewf_handle_set_guid( libewf_handle_t *handle, uint8_t *guid, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_guid"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( guid == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid GUID.", function ); return( -1 ); } if( size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: GUID too small.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: GUID cannot be changed.", function ); return( -1 ); } if( memory_copy( internal_handle->media_values->guid, guid, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set GUID.", function ); return( -1 ); } return( 1 ); } /* Retrieves the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_md5_hash"; if( libewf_handle_get_md5_hash( handle, md5_hash, size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the MD5 hash.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the MD5 hash * Returns 1 if successful or -1 on error */ int libewf_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_md5_hash"; if( libewf_handle_set_md5_hash( handle, md5_hash, size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the MD5 hash.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_sha1_hash"; if( libewf_handle_get_sha1_hash( handle, sha1_hash, size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the SHA1 hash.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the SHA1 hash * Returns 1 if successful or -1 on error */ int libewf_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_sha1_hash"; if( libewf_handle_set_sha1_hash( handle, sha1_hash, size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set the SHA1 hash.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of chunks written * Returns 1 if successful or -1 on error */ int libewf_get_write_amount_of_chunks( libewf_handle_t *handle, uint32_t *amount_of_chunks ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_write_amount_of_chunks"; if( libewf_handle_get_write_amount_of_chunks( handle, amount_of_chunks, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve amount of chunks written.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the read wipe chunk on error * The chunk is not wiped if read raw is used * Returns 1 if successful or -1 on error */ int libewf_set_read_wipe_chunk_on_error( libewf_handle_t *handle, uint8_t wipe_on_error ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_read_wipe_chunk_on_error"; if( libewf_handle_set_read_wipe_chunk_on_error( handle, wipe_on_error, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set wipe chunk on error during read.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Copies the media values from the source to the destination handle * Returns 1 if successful or -1 on error */ int libewf_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ) { libcerror_error_t *error = NULL; static char *function = "libewf_copy_media_values"; if( libewf_handle_copy_media_values( destination_handle, source_handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy media values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of acquiry errors * Returns 1 if successful, 0 if no acquiry errors are present or -1 on error */ int libewf_get_amount_of_acquiry_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_amount_of_acquiry_errors"; if( libewf_handle_get_amount_of_acquiry_errors( handle, amount_of_errors, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of acquiry errors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves an acquiry error * Returns 1 if successful or -1 on error */ int libewf_get_acquiry_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_acquiry_error"; uint64_t safe_amount_of_sectors = 0; int result = 0; if( amount_of_sectors == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid amount of sectors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } result = libewf_handle_get_acquiry_error( handle, index, (uint64_t *) start_sector, &safe_amount_of_sectors, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve acquiry error.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } else if( result != 0 ) { if( safe_amount_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid amount of sectors value exceeds maximum.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } *amount_of_sectors = (uint32_t) safe_amount_of_sectors; } return( result ); } /* Add an acquiry error * Returns 1 if successful or -1 on error */ int libewf_add_acquiry_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_add_acquiry_error"; if( libewf_handle_add_acquiry_error( handle, (uint64_t) start_sector, (uint64_t) amount_of_sectors, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to add acquiry error.", function ); libcnotify_print_error_backtrace( error); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of checksum errors * Returns 1 if successful or -1 on error */ int libewf_get_amount_of_crc_errors( libewf_handle_t *handle, uint32_t *amount_of_errors ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_amount_of_crc_errors"; if( libewf_handle_get_number_of_checksum_errors( handle, amount_of_errors, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of checksum errors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves a checksum error * Returns 1 if successful or -1 on error */ int libewf_get_crc_error( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_crc_error"; uint64_t safe_amount_of_sectors = 0; int result = 0; if( amount_of_sectors == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid amount of sectors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } result = libewf_handle_get_checksum_error( handle, index, (uint64_t *) start_sector, &safe_amount_of_sectors, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve checksum error.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } else if( result != 0 ) { if( safe_amount_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid amount of sectors value exceeds maximum.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } *amount_of_sectors = (uint32_t) safe_amount_of_sectors; } return( result ); } /* Add a checksum error * Returns 1 if successful or -1 on error */ int libewf_add_crc_error( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_add_crc_error"; if( libewf_handle_append_checksum_error( handle, (uint64_t) start_sector, (uint64_t) amount_of_sectors, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to add checksum error.", function ); libcnotify_print_error_backtrace( error); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of sessions * Returns 1 if successful or -1 on error */ int libewf_get_amount_of_sessions( libewf_handle_t *handle, uint32_t *amount_of_sessions ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_amount_of_sessions"; if( libewf_handle_get_amount_of_sessions( handle, amount_of_sessions, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of sessions.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves a session * Returns 1 if successful or -1 on error */ int libewf_get_session( libewf_handle_t *handle, uint32_t index, off64_t *start_sector, uint32_t *amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_session"; uint64_t safe_amount_of_sectors = 0; int result = 0; if( amount_of_sectors == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid amount of sectors.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } result = libewf_handle_get_session( handle, index, (uint64_t *) start_sector, &safe_amount_of_sectors, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } else if( result != 0 ) { if( safe_amount_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid amount of sectors value exceeds maximum.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } *amount_of_sectors = (uint32_t) safe_amount_of_sectors; } return( result ); } /* Add a session * Returns 1 if successful or -1 on error */ int libewf_add_session( libewf_handle_t *handle, off64_t start_sector, uint32_t amount_of_sectors ) { libcerror_error_t *error = NULL; static char *function = "libewf_add_session"; if( libewf_handle_add_session( handle, (uint64_t) start_sector, (uint64_t) amount_of_sectors, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to add session.", function ); libcnotify_print_error_backtrace( error); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the header codepage * Returns 1 if successful or -1 on error */ int libewf_get_header_codepage( libewf_handle_t *handle, int *header_codepage ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_header_codepage"; if( libewf_handle_get_header_codepage( handle, header_codepage, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the header codepage.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Sets the header codepage * Returns 1 if successful or -1 on error */ int libewf_set_header_codepage( libewf_handle_t *handle, int header_codepage ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_header_codepage"; if( libewf_handle_set_header_codepage( handle, header_codepage, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set header codepage.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the amount of header values * Returns 1 if successful, 0 if no header values are present or -1 on error */ int libewf_get_amount_of_header_values( libewf_handle_t *handle, uint32_t *amount_of_values ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_amount_of_header_values"; int result = 0; result = libewf_handle_get_amount_of_header_values( handle, amount_of_values, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of header values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( result ); } /* Retrieves the header value identifier size specified by its index * The identifier size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_header_value_identifier_size"; int result = 0; result = libewf_handle_get_header_value_identifier_size( handle, index, identifier_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value identifier size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the header value identifier specified by its index * The strings are encoded in UTF-8 * The identifier size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_header_value_identifier"; int result = 0; result = libewf_handle_get_header_value_identifier( handle, index, (uint8_t *) identifier, identifier_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value identifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the header value size specified by the identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_header_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_header_value_size"; size_t identifier_length = 0; int result = 0; if( identifier == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_header_value_size( handle, (uint8_t *) identifier, identifier_length, value_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value size: %s.", function, identifier ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the header value specified by the identifier * The strings are encoded in UTF-8 * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_header_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_header_value"; size_t identifier_length = 0; int result = 0; if( identifier == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_header_value( handle, (uint8_t *) identifier, identifier_length, (uint8_t *) value, value_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, identifier ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( result ); } /* Sets the header value specified by the identifier * The strings are encoded in UTF-8 * Returns 1 if successful or -1 on error */ int libewf_set_header_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_header_value"; size_t identifier_length = 0; if( identifier == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } identifier_length = narrow_string_length( identifier ); if( libewf_handle_set_header_value( handle, (uint8_t *) identifier, identifier_length, (uint8_t *) value, value_length, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s.", function, identifier ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Copies the header values from the source to the destination handle * Returns 1 if successful or -1 on error */ int libewf_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle ) { libcerror_error_t *error = NULL; static char *function = "libewf_copy_header_values"; if( libewf_handle_copy_header_values( destination_handle, source_handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Parses the header values from the xheader, header2 or header section * Will parse the first available header in order mentioned above * Returns 1 if successful, 0 if already parsed or -1 on error */ int libewf_parse_header_values( libewf_handle_t *handle, uint8_t date_format ) { libewf_internal_handle_t *internal_handle = NULL; libcerror_error_t *error = NULL; static char *function = "libewf_parse_header_values"; if( handle == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( ( date_format != LIBEWF_DATE_FORMAT_CTIME ) && ( date_format != LIBEWF_DATE_FORMAT_DAYMONTH ) && ( date_format != LIBEWF_DATE_FORMAT_MONTHDAY ) && ( date_format != LIBEWF_DATE_FORMAT_ISO8601 ) ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date format.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } if( internal_handle->header_values_parsed != 0 ) { return( 0 ); } if( libewf_handle_parse_header_values( internal_handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } internal_handle->header_values_parsed = 1; internal_handle->date_format = date_format; return( 1 ); } /* Retrieves the amount of hash values * Returns 1 if successful or -1 on error */ int libewf_get_amount_of_hash_values( libewf_handle_t *handle, uint32_t *amount_of_values ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_amount_of_hash_values"; if( libewf_handle_get_amount_of_hash_values( handle, amount_of_values, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the amount of hash values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Retrieves the hash value identifier size specified by its index * The identifier size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_hash_value_identifier_size"; int result = 0; result = libewf_handle_get_hash_value_identifier_size( handle, index, identifier_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value identifier size.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the hash value identifier specified by its index * The strings are encoded in UTF-8 * The identifier size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, char *identifier, size_t identifier_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_hash_value_identifier"; int result = 0; result = libewf_handle_get_hash_value_identifier( handle, index, (uint8_t *) identifier, identifier_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value identifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the hash value specified by the identifier * The strings are encoded in UTF-8 * The value size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_hash_value( libewf_handle_t *handle, const char *identifier, char *value, size_t value_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_hash_value"; size_t identifier_length = 0; int result = 0; if( identifier == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_hash_value( handle, (uint8_t *) identifier, identifier_length, (uint8_t *) value, value_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, identifier ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the hash value size specified by the identifier * The value size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_get_hash_value_size( libewf_handle_t *handle, const char *identifier, size_t *value_size ) { libcerror_error_t *error = NULL; static char *function = "libewf_get_hash_value_size"; size_t identifier_length = 0; int result = 0; if( identifier == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_hash_value_size( handle, (uint8_t *) identifier, identifier_length, value_size, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value size: %s.", function, identifier ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Sets the hash value specified by the identifier * The strings are encoded in UTF-8 * Returns 1 if successful or -1 on error */ int libewf_set_hash_value( libewf_handle_t *handle, const char *identifier, const char *value, size_t value_length ) { libcerror_error_t *error = NULL; static char *function = "libewf_set_hash_value"; size_t identifier_length = 0; if( identifier == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } identifier_length = narrow_string_length( identifier ); if( libewf_handle_set_hash_value( handle, (uint8_t *) identifier, identifier_length, (uint8_t *) value, value_length, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s.", function, identifier ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } return( 1 ); } /* Parses the hash values from the xhash section * Returns 1 if successful, 0 if already parsed or -1 on error */ int libewf_parse_hash_values( libewf_handle_t *handle ) { libewf_internal_handle_t *internal_handle = NULL; libcerror_error_t *error = NULL; static char *function = "libewf_parse_hash_values"; if( handle == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_values_parsed != 0 ) { return( 0 ); } if( libewf_handle_parse_hash_values( internal_handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return( -1 ); } internal_handle->hash_values_parsed = 1; return( 1 ); } #endif libewf-20140807/libewf/libewf_sector_range.h0000644000175000017500000000375313421013625022760 0ustar00lordyestalordyesta00000000000000/* * Sector range functions * * 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_SECTOR_RANGE_H ) #define _LIBEWF_SECTOR_RANGE_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_sector_range libewf_sector_range_t; struct libewf_sector_range { /* The start sector */ uint64_t start_sector; /* The end sector */ uint64_t end_sector; /* The number of sectors */ uint64_t number_of_sectors; }; int libewf_sector_range_initialize( libewf_sector_range_t **sector_range, libcerror_error_t **error ); int libewf_sector_range_free( libewf_sector_range_t **sector_range, libcerror_error_t **error ); int libewf_sector_range_clone( libewf_sector_range_t **destination_sector_range, libewf_sector_range_t *source_sector_range, libcerror_error_t **error ); int libewf_sector_range_get( libewf_sector_range_t *sector_range, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); int libewf_sector_range_set( libewf_sector_range_t *sector_range, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_segment_file.c0000644000175000017500000027245513421013625022750 0ustar00lordyestalordyesta00000000000000/* * Segment file reading/writing functions * * 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 . */ #include #include #include #include #include "libewf_chunk_table.h" #include "libewf_definitions.h" #include "libewf_hash_values.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_section.h" #include "libewf_segment_file.h" #include "libewf_segment_table.h" #include "libewf_single_files.h" #include "libewf_unused.h" #include "ewf_definitions.h" #include "ewf_file_header.h" #include "ewf_section.h" #include "ewfx_delta_chunk.h" const uint8_t dvf_file_signature[ 8 ] = { 0x64, 0x76, 0x66, 0x09, 0x0d, 0x0a, 0xff, 0x00 }; const uint8_t evf_file_signature[ 8 ] = { 0x45, 0x56, 0x46, 0x09, 0x0d, 0x0a, 0xff, 0x00 }; const uint8_t lvf_file_signature[ 8 ] = { 0x4c, 0x56, 0x46, 0x09, 0x0d, 0x0a, 0xff, 0x00 }; /* Initialize the segment file * Returns 1 if successful or -1 on error */ int libewf_segment_file_initialize( libewf_segment_file_t **segment_file, libcerror_error_t **error ) { static char *function = "libewf_segment_file_initialize"; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( *segment_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid segment file value already set.", function ); return( -1 ); } *segment_file = memory_allocate_structure( libewf_segment_file_t ); if( *segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment file.", function ); goto on_error; } if( memory_set( *segment_file, 0, sizeof( libewf_segment_file_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment file.", function ); goto on_error; } if( libcdata_list_initialize( &( ( *segment_file )->section_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section list.", function ); goto on_error; } return( 1 ); on_error: if( *segment_file != NULL ) { memory_free( *segment_file ); *segment_file = NULL; } return( -1 ); } /* Frees the segment file including elements * Returns 1 if successful or -1 on error */ int libewf_segment_file_free( libewf_segment_file_t **segment_file, libcerror_error_t **error ) { static char *function = "libewf_segment_file_free"; int result = 1; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( *segment_file != NULL ) { if( ( *segment_file )->section_list != NULL ) { if( libcdata_list_free( &( ( *segment_file )->section_list ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_section_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free section list.", function ); result = -1; } } memory_free( *segment_file ); *segment_file = NULL; } return( result ); } /* Clones the segment file * Returns 1 if successful or -1 on error */ int libewf_segment_file_clone( libewf_segment_file_t **destination_segment_file, libewf_segment_file_t *source_segment_file, libcerror_error_t **error ) { static char *function = "libewf_segment_file_clone"; if( destination_segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination segment file.", function ); return( -1 ); } if( *destination_segment_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination segment file value already set.", function ); return( -1 ); } if( source_segment_file == NULL ) { *destination_segment_file = NULL; return( 1 ); } *destination_segment_file = memory_allocate_structure( libewf_segment_file_t ); if( *destination_segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination segment file.", function ); goto on_error; } if( memory_copy( *destination_segment_file, source_segment_file, sizeof( libewf_segment_file_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination segment file.", function ); goto on_error; } ( *destination_segment_file )->section_list = NULL; if( libcdata_list_clone( &( ( *destination_segment_file )->section_list ), source_segment_file->section_list, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_section_free, (int(*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libewf_section_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination section list.", function ); goto on_error; } return( 1 ); on_error: if( *destination_segment_file != NULL ) { memory_free( *destination_segment_file ); *destination_segment_file = NULL; } return( -1 ); } /* Reads the segment file header * Returns the number of bytes read if successful, or -1 on error */ ssize_t libewf_segment_file_read_file_header( libewf_segment_file_t *segment_file, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ) { ewf_file_header_t file_header; static char *function = "libewf_segment_file_read_file_header"; ssize_t read_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading file header at offset: 0 (0x00000000)\n", function ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, 0, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek file header offset: 0.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &file_header, sizeof( ewf_file_header_t ), error ); if( read_count != (ssize_t) sizeof( ewf_file_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read file header.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: file header:\n", function ); libcnotify_print_data( (uint8_t *) &file_header, sizeof( ewf_file_header_t ), 0 ); } #endif byte_stream_copy_to_uint16_little_endian( file_header.fields_segment, segment_file->segment_number ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: signature:\n", function ); libcnotify_print_data( file_header.signature, 8, 0 ); libcnotify_printf( "%s: segment number\t\t\t: %" PRIu16 "\n", function, segment_file->segment_number ); libcnotify_printf( "\n" ); } #endif /* Compare the most common signature first */ if( memory_compare( evf_file_signature, file_header.signature, 8 ) == 0 ) { segment_file->type = LIBEWF_SEGMENT_FILE_TYPE_EWF; } else if( memory_compare( lvf_file_signature, file_header.signature, 8 ) == 0 ) { segment_file->type = LIBEWF_SEGMENT_FILE_TYPE_LWF; } else if( memory_compare( dvf_file_signature, file_header.signature, 8 ) == 0 ) { segment_file->type = LIBEWF_SEGMENT_FILE_TYPE_DWF; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_SIGNATURE_MISMATCH, "%s: unsupported segment file signature.", function ); return( -1 ); } return( read_count ); } /* Writes the segment file header * Returns the number of bytes written if successful, or -1 on error */ ssize_t libewf_segment_file_write_file_header( libewf_segment_file_t *segment_file, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libcerror_error_t **error ) { ewf_file_header_t file_header; static char *function = "libewf_segment_file_write_file_header"; const uint8_t *file_signature = NULL; ssize_t write_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( segment_file->segment_number == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment file - segment number value out of bounds.", function ); return( -1 ); } if( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_EWF ) { file_signature = evf_file_signature; } else if( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_LWF ) { file_signature = lvf_file_signature; } else if( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_DWF ) { file_signature = dvf_file_signature; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported segment file type.", function ); return( -1 ); } if( memory_copy( file_header.signature, file_signature, 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set file signature.", function ); return( -1 ); } byte_stream_copy_from_uint16_little_endian( file_header.fields_segment, segment_file->segment_number ); file_header.fields_start = 1; file_header.fields_end[ 0 ] = 0; file_header.fields_end[ 1 ] = 0; write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, (uint8_t *) &file_header, sizeof( ewf_file_header_t ), error ); if( write_count != (ssize_t) sizeof( ewf_file_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write file header.", function ); return( -1 ); } return( write_count ); } /* Reads a segment file * Callback function for the segment files list * Returns 1 if successful or -1 on error */ int libewf_segment_file_read( intptr_t *io_handle LIBEWF_ATTRIBUTE_UNUSED, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_file_t *file, libfcache_cache_t *cache, uint8_t read_flags LIBEWF_ATTRIBUTE_UNUSED, libcerror_error_t **error ) { libewf_section_t *section = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_segment_file_read"; off64_t section_offset = 0; size64_t segment_file_size = 0; ssize_t read_count = 0; int last_section = 0; LIBEWF_UNREFERENCED_PARAMETER( io_handle ) LIBEWF_UNREFERENCED_PARAMETER( read_flags ) if( libewf_segment_file_initialize( &segment_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment file.", function ); goto on_error; } if( libbfio_pool_get_size( file_io_pool, file_io_pool_entry, &segment_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of file IO pool entry: %d.", function, file_io_pool_entry ); goto on_error; } read_count = libewf_segment_file_read_file_header( segment_file, file_io_pool, file_io_pool_entry, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment file header.", function ); goto on_error; } section_offset = (off64_t) read_count; while( (size64_t) section_offset < segment_file_size ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } read_count = libewf_section_start_read( section, file_io_pool, file_io_pool_entry, section_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section start.", function ); goto on_error; } if( section->type_length == 4 ) { if( memory_compare( (void *) section->type, (void *) "done", 4 ) == 0 ) { last_section = 1; } else if( memory_compare( (void *) section->type, (void *) "next", 4 ) == 0 ) { last_section = 1; } } section_offset += section->size; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; if( last_section != 0 ) { break; } } if( last_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing next or done section.", function ); goto on_error; } if( libmfdata_file_set_file_value( file, cache, (intptr_t *) segment_file, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_segment_file_free, LIBMFDATA_FILE_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file as file value.", function ); goto on_error; } return( 1 ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } if( segment_file != NULL ) { libewf_segment_file_free( &segment_file, NULL ); } return( -1 ); } /* Reads the table section * Returns the number of bytes read or -1 on error */ ssize_t libewf_segment_file_read_table_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ) { static char *function = "libewf_segment_file_read_table_section"; ssize_t read_count = 0; uint64_t base_offset = 0; uint32_t number_of_offsets = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table.", function ); return( -1 ); } chunk_table->previous_last_chunk_filled = chunk_table->last_chunk_filled; read_count = libewf_section_table_header_read( section, file_io_pool, file_io_pool_entry, io_handle->format, &number_of_offsets, &base_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read table section header.", function ); return( -1 ); } if( number_of_offsets > 0 ) { /* The EWF-L01 does not define the number of chunks in the volume */ if( media_values->number_of_chunks == 0 ) { if( libmfdata_list_append_group( chunk_table_list, &( chunk_table->last_chunk_filled ), (int) number_of_offsets, file_io_pool_entry, section->start_offset, section->size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append chunk group.", function ); return( -1 ); } } else { if( libmfdata_list_set_group_by_index( chunk_table_list, chunk_table->last_chunk_filled, (int) number_of_offsets, file_io_pool_entry, section->start_offset, section->size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk group: %d - %d.", function, chunk_table->last_chunk_filled, chunk_table->last_chunk_filled + number_of_offsets ); return( -1 ); } } chunk_table->last_chunk_filled += (int) number_of_offsets; segment_file->number_of_chunks += number_of_offsets; } return( 1 ); } /* Reads the table2 section * Returns the number of bytes read or -1 on error */ ssize_t libewf_segment_file_read_table2_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ) { static char *function = "libewf_segment_file_read_table2_section"; off64_t group_offset = 0; size64_t group_size = 0; ssize_t read_count = 0; uint64_t base_offset = 0; uint32_t group_flags = 0; uint32_t number_of_offsets = 0; int group_number_of_offsets = 0; int group_file_io_pool_entry = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table.", function ); return( -1 ); } read_count = libewf_section_table_header_read( section, file_io_pool, file_io_pool_entry, io_handle->format, &number_of_offsets, &base_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read table2 section header.", function ); return( -1 ); } if( number_of_offsets > 0 ) { if( libmfdata_list_get_group_by_index( chunk_table_list, chunk_table->last_chunk_compared, &group_number_of_offsets, &group_file_io_pool_entry, &group_offset, &group_size, &group_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk group: %d - %d.", function, chunk_table->last_chunk_compared, chunk_table->last_chunk_compared + number_of_offsets ); return( -1 ); } if( (int) number_of_offsets != group_number_of_offsets ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: mismatch between number of offsets in table and table2.", function ); return( -1 ); } if( libmfdata_list_set_backup_data_range_by_index( chunk_table_list, chunk_table->last_chunk_compared, file_io_pool_entry, section->start_offset, section->size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set backup data range of chunk group: %d - %d.", function, chunk_table->last_chunk_compared, chunk_table->last_chunk_compared + number_of_offsets ); return( -1 ); } chunk_table->last_chunk_compared += (int) number_of_offsets; } return( 1 ); } /* Reads a volume section * Returns the number of bytes read if successful or -1 on error */ ssize_t libewf_segment_file_read_volume_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ) { static char *function = "libewf_segment_file_read_volume_section"; ssize_t read_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } read_count = libewf_section_volume_read( section, io_handle, file_io_pool, file_io_pool_entry, media_values, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read volume section.", function ); return( -1 ); } if( media_values->number_of_chunks > 0 ) { if( libmfdata_list_resize( chunk_table_list, (int) media_values->number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize chunk table list.", function ); return( -1 ); } } return( read_count ); } /* Reads the delta chunk section * Returns the number of bytes read or -1 on error */ ssize_t libewf_segment_file_read_delta_chunk_section( libewf_segment_file_t *segment_file, libewf_section_t *section, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_list_t *chunk_table_list, libcerror_error_t **error ) { static char *function = "libewf_segment_file_read_delta_chunk_section"; off64_t chunk_offset = 0; ssize_t read_count = 0; uint32_t chunk_index = 0; uint32_t chunk_size = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid section.", function ); return( -1 ); } read_count = libewf_section_delta_chunk_read( section, file_io_pool, file_io_pool_entry, &chunk_index, &chunk_size, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read delta chunk section.", function ); return( -1 ); } chunk_offset = section->start_offset + sizeof( ewf_section_start_t ) + sizeof( ewfx_delta_chunk_header_t ); if( libmfdata_list_set_element_by_index( chunk_table_list, (int) chunk_index, file_io_pool_entry, chunk_offset, (size64_t) chunk_size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %" PRIu32 ".", function, chunk_index ); return( -1 ); } return( 1 ); } /* Write the headers to file * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_headers( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libewf_header_sections_t *header_sections, libcerror_error_t **error ) { libewf_section_t *section = NULL; static char *function = "libewf_segment_file_write_headers"; ssize_t write_count = 0; ssize_t total_write_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( ( header_sections->header == NULL ) || ( header_sections->header_size == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid header.", function ); return( -1 ); } if( ( io_handle->format == LIBEWF_FORMAT_EWF ) || ( io_handle->format == LIBEWF_FORMAT_SMART ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE1 ) ) { /* The header should be written only once * and using the compression used in the file */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, io_handle->compression_level, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write single header section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } else if( ( io_handle->format == LIBEWF_FORMAT_ENCASE2 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE3 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN5 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN6 ) || ( io_handle->format == LIBEWF_FORMAT_FTK ) ) { /* The header should be written twice * the default compression is used */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write first header section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write second header section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } else if( ( io_handle->format == LIBEWF_FORMAT_ENCASE4 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE5 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) ) { if( ( header_sections->header2 == NULL ) && ( header_sections->header2_size == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid header2.", function ); goto on_error; } /* The header2 should be written twice * the default compression is used */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header2_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write first header2 section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header2_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write second header2 section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; /* The header should be written once * the default compression is used */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write third header section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } /* EWFX uses the header and header2 for backwards compatibility */ else if( io_handle->format == LIBEWF_FORMAT_EWFX ) { if( ( header_sections->xheader == NULL ) && ( header_sections->xheader_size == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid xheader.", function ); goto on_error; } if( ( header_sections->header2 == NULL ) && ( header_sections->header2_size == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid header2.", function ); goto on_error; } /* The xheader should be written once * the default compression is used */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_xheader_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write xheader section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; /* The header2 should be written once * the default compression is used */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header2_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write second header2 section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; /* The header should be written once * the default compression is used */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_header_write( section, file_io_pool, file_io_pool_entry, section_offset, header_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write third header section.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } return( total_write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Write the last section at the end of the segment file * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_last_section( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, int last_segment_file, libcerror_error_t **error ) { libewf_section_t *section = NULL; uint8_t *last_section_type = NULL; static char *function = "libewf_segment_file_write_last_section"; ssize_t write_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( last_segment_file == 0 ) { last_section_type = (uint8_t *) "next"; } else { last_section_type = (uint8_t *) "done"; } /* Write next or done section */ if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_last_write( section, file_io_pool, file_io_pool_entry, last_section_type, 4, section_offset, io_handle->ewf_format, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write %s section.", function, (char *) last_section_type ); goto on_error; } if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; return( write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Write the necessary sections at the start of the segment file * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_start( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libewf_media_values_t *media_values, libewf_header_sections_t *header_sections, ewf_data_t **cached_data_section, libcerror_error_t **error ) { libewf_section_t *section = NULL; static char *function = "libewf_segment_file_write_start"; off64_t section_offset = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } write_count = libewf_segment_file_write_file_header( segment_file, file_io_pool, file_io_pool_entry, error ); if( write_count != (ssize_t) sizeof( ewf_file_header_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write file header.", function ); return( -1 ); } section_offset += write_count; total_write_count += write_count; if( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_EWF ) { if( segment_file->segment_number == 1 ) { write_count = libewf_segment_file_write_headers( segment_file, io_handle, file_io_pool, file_io_pool_entry, section_offset, header_sections, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write header sections.", function ); return( -1 ); } total_write_count += write_count; section_offset += write_count; } if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } if( segment_file->segment_number == 1 ) { write_count = -1; if( io_handle->ewf_format == EWF_FORMAT_E01 ) { write_count = libewf_section_volume_e01_write( section, io_handle, file_io_pool, file_io_pool_entry, section_offset, media_values, error ); } else if( io_handle->ewf_format == EWF_FORMAT_S01 ) { write_count = libewf_section_volume_s01_write( section, io_handle, file_io_pool, file_io_pool_entry, section_offset, media_values, error ); } if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write volume section.", function ); goto on_error; } } else if( io_handle->ewf_format == EWF_FORMAT_E01 ) { write_count = libewf_section_data_write( section, io_handle, file_io_pool, file_io_pool_entry, section_offset, media_values, cached_data_section, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data section.", function ); return( -1 ); } } total_write_count += write_count; section_offset += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } return( total_write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Write the necessary sections before the actual data chunks to file * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_chunks_section_start( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libmfdata_list_t *chunk_table_list, ewf_table_offset_t *table_offsets, uint32_t number_of_table_offsets, uint32_t number_of_chunks_written, uint32_t chunks_per_section, libcerror_error_t **error ) { libewf_section_t *section = NULL; static char *function = "libewf_segment_file_write_chunks_section_start"; ssize_t write_count = 0; int number_of_chunks = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( number_of_table_offsets < chunks_per_section ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: table offsets too small.", function ); return( -1 ); } if( libmfdata_list_get_number_of_elements( chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of chunks in the chunk table list.", function ); return( -1 ); } /* The chunks_per_section contains the estimated number of chunks for this section */ if( (uint32_t) number_of_chunks < ( number_of_chunks_written + chunks_per_section ) ) { if( libmfdata_list_resize( chunk_table_list, (int) ( number_of_chunks_written + chunks_per_section ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize chunk table list.", function ); return( -1 ); } } if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } if( ( io_handle->ewf_format == EWF_FORMAT_S01 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE1 ) ) { /* Write table section start */ write_count = libewf_section_table_write( section, file_io_pool, file_io_pool_entry, (uint8_t *) "table", 5, section_offset, 0, table_offsets, chunks_per_section, 0, io_handle->ewf_format, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write table section.", function ); return( -1 ); } } else if( io_handle->ewf_format == EWF_FORMAT_E01 ) { write_count = libewf_section_sectors_write( section, file_io_pool, file_io_pool_entry, section_offset, 0, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write sectors section.", function ); goto on_error; } } if( libewf_section_free( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free section.", function ); section = NULL; goto on_error; } return( write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Correct the sections before the actual data chunks * Also write the necessary sections after the actual data chunks to file (like table and table2 sections for EWF-E01 format) * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_chunks_section_correction( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libmfdata_list_t *chunk_table_list, ewf_table_offset_t *table_offsets, uint32_t number_of_table_offsets, off64_t chunks_section_offset, size64_t chunks_section_size, uint32_t number_of_chunks, uint32_t section_number_of_chunks, libcerror_error_t **error ) { libewf_section_t *backup_group_section = NULL; libewf_section_t *group_section = NULL; libewf_section_t *section = NULL; uint8_t *table_section_string = NULL; static char *function = "libewf_segment_file_write_chunks_section_correction"; off64_t base_offset = 0; ssize_t total_write_count = 0; ssize_t write_count = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) { if( chunks_section_size >= (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk section size value exceeds maximum.", function ); return( -1 ); } } else { if( chunks_section_size >= (size64_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk section size value exceeds maximum.", function ); return( -1 ); } } if( ( section_number_of_chunks > number_of_chunks ) || ( section_number_of_chunks > number_of_table_offsets ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: section number of chunks value out of bounds.", function ); return( -1 ); } if( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) { base_offset = chunks_section_offset; } if( libewf_chunk_table_fill_offsets( chunk_table_list, number_of_chunks - section_number_of_chunks, base_offset, table_offsets, section_number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to fill table offsets.", function ); return( -1 ); } /* Seek the start of the data chunks */ #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: setting file descriptor to start of chunks section offset: %" PRIu32 ".\n", function, chunks_section_offset ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, chunks_section_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to find offset to correct sectors size.", function ); return( -1 ); } if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } if( ( io_handle->ewf_format == EWF_FORMAT_S01 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE1 ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting table section offset: %" PRIi64 " size: %" PRIu64 ".\n", function, chunks_section_offset, chunks_section_size ); } #endif /* Rewrite table section start */ write_count = libewf_section_table_write( section, file_io_pool, file_io_pool_entry, (uint8_t *) "table", 5, chunks_section_offset, 0, table_offsets, section_number_of_chunks, chunks_section_size, io_handle->ewf_format, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to rewrite %s section.", function, (char *) table_section_string ); return( -1 ); } group_section = section; } else if( io_handle->ewf_format == EWF_FORMAT_E01 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting sectors section offset: %" PRIi64 " size: %" PRIu64 ".\n", function, chunks_section_offset, chunks_section_size ); } #endif write_count = libewf_section_sectors_write( section, file_io_pool, file_io_pool_entry, chunks_section_offset, chunks_section_size, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to rewrite sectors section.", function ); goto on_error; } } if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: setting file descriptor back to end of data at offset: %" PRIu32 ".\n", function, section_offset ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, section_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to find offset to continue.", function ); return( -1 ); } if( ( io_handle->ewf_format == EWF_FORMAT_E01 ) && ( io_handle->format != LIBEWF_FORMAT_ENCASE1 ) ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_table_write( section, file_io_pool, file_io_pool_entry, (uint8_t *) "table", 5, section_offset, base_offset, table_offsets, section_number_of_chunks, 0, io_handle->ewf_format, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to rewrite table section.", function ); return( -1 ); } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } group_section = section; section = NULL; if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_table_write( section, file_io_pool, file_io_pool_entry, (uint8_t *) "table2", 6, section_offset, base_offset, table_offsets, section_number_of_chunks, 0, io_handle->format, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to rewrite table2 section.", function ); return( -1 ); } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } backup_group_section = section; section = NULL; } /* Group the elements to reduce the memory usage */ if( libmfdata_list_set_group_by_index( chunk_table_list, number_of_chunks - section_number_of_chunks, (int) section_number_of_chunks, file_io_pool_entry, group_section->start_offset, group_section->size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk group: %d - %d.", function, number_of_chunks - section_number_of_chunks, number_of_chunks ); return( -1 ); } if( backup_group_section != NULL ) { if( libmfdata_list_set_backup_data_range_by_index( chunk_table_list, number_of_chunks - section_number_of_chunks, file_io_pool_entry, backup_group_section->start_offset, backup_group_section->size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set backup data range of chunk group: %d - %d.", function, number_of_chunks - section_number_of_chunks, number_of_chunks ); return( -1 ); } } return( total_write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Write a chunk of data to a segment file and update the chunk table * Set write_checksum to a non 0 value if the checksum is not provided within the chunk data * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_chunk( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, libmfdata_list_t *chunk_table_list, int chunk_index, uint8_t *chunk_buffer, size_t chunk_buffer_size, size_t chunk_data_size LIBEWF_ATTRIBUTE_UNUSED, int8_t is_compressed, uint8_t *checksum_buffer, uint32_t *chunk_checksum, int8_t write_checksum, libcerror_error_t **error ) { static char *function = "libewf_segment_file_write_chunk"; off64_t segment_file_offset = 0; size_t write_size = 0; ssize_t write_count = 0; ssize_t total_write_count = 0; uint8_t chunk_flags = 0; int number_of_chunks = 0; #if defined( HAVE_DEBUG_OUTPUT ) char *chunk_type = NULL; #endif LIBEWF_UNREFERENCED_PARAMETER( chunk_data_size ) if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( chunk_checksum == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk checksum.", function ); return( -1 ); } if( chunk_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk buffer size value exceeds maximum.", function ); return( -1 ); } if( libmfdata_list_get_number_of_elements( chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of chunks in the chunk table list.", function ); return( -1 ); } /* Make sure the chunk is available in the chunk table */ if( number_of_chunks < ( chunk_index + 1 ) ) { if( libmfdata_list_resize( chunk_table_list, chunk_index + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize chunk table list.", function ); return( -1 ); } } if( libbfio_pool_get_offset( file_io_pool, file_io_pool_entry, &segment_file_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in segment file.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { write_size = chunk_buffer_size; if( write_checksum != 0 ) { write_size += sizeof( uint32_t ); } if( is_compressed == 0 ) { chunk_type = "uncompressed"; } else { chunk_type = "compressed"; } libcnotify_printf( "%s: writing %s chunk: %d at offset: %" PRIi64 " with size: %" PRIzd ", with checksum: 0x%08" PRIx32 ".\n", function, chunk_type, chunk_index, segment_file_offset, write_size, *chunk_checksum ); } #endif write_size = chunk_buffer_size; /* Write the checksum if necessary */ if( write_checksum != 0 ) { if( checksum_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid checksum buffer.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( checksum_buffer, *chunk_checksum ); /* Check if the chunk and checksum buffers are aligned * if so write the chunk and checksum at the same time */ if( ( is_compressed == 0 ) && ( &( chunk_buffer[ chunk_buffer_size ] ) == checksum_buffer ) ) { write_size += sizeof( uint32_t ); write_checksum = 0; } } /* Write the chunk data to the segment file */ write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, chunk_buffer, write_size, error ); if( write_count != (ssize_t) write_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write chunk: %d data.", function, chunk_index ); return( -1 ); } total_write_count += write_count; /* Check if the chunk and checksum buffers are aligned * if not the chunk and checksum need to be written separately */ if( write_checksum != 0 ) { write_count = libbfio_pool_write_buffer( file_io_pool, file_io_pool_entry, checksum_buffer, sizeof( uint32_t ), error ); if( write_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write chunk: %d checksum.", function, chunk_index ); return( -1 ); } total_write_count += write_count; } if( is_compressed != 0 ) { chunk_flags = LIBMFDATA_RANGE_FLAG_IS_COMPRESSED; } else { chunk_flags = 0; } if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, file_io_pool_entry, segment_file_offset, (size64_t) total_write_count, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %d.", function, chunk_index ); return( -1 ); } return( total_write_count ); } /* Write a delta chunk of data to a segment file and update the chunk table * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_delta_chunk( libewf_segment_file_t *segment_file, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, libmfdata_list_t *chunk_table_list, int chunk_index, uint8_t *chunk_buffer, size_t chunk_size, uint8_t *checksum_buffer, uint32_t *chunk_checksum, uint8_t write_checksum, uint8_t no_section_append, libcerror_error_t **error ) { libewf_section_t *section = NULL; static char *function = "libewf_segment_file_write_delta_chunk"; off64_t chunk_offset = 0; ssize_t write_count = 0; int chunk_exists = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( ( section_offset < 0 ) || ( section_offset > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid section offset value out of bounds.", function ); return( -1 ); } chunk_exists = libmfdata_list_is_set( chunk_table_list, chunk_index, error ); if( chunk_exists == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if the chunk: %d exists in the chunk table.", function, chunk_index ); goto on_error; } else if( chunk_exists == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk: %d.", function, chunk_index ); goto on_error; } chunk_offset = section_offset + sizeof( ewf_section_start_t ) + sizeof( ewfx_delta_chunk_header_t ); if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_delta_chunk_write( section, file_io_pool, file_io_pool_entry, section_offset, (uint32_t) chunk_index, chunk_buffer, (uint32_t) chunk_size, checksum_buffer, chunk_checksum, write_checksum, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write delta chunk.", function ); goto on_error; } if( no_section_append == 0 ) { if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } else { if( libewf_section_free( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free section.", function ); section = NULL; goto on_error; } } if( write_checksum != 0 ) { chunk_size += sizeof( uint32_t ); } if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, file_io_pool_entry, chunk_offset, (size64_t) chunk_size, LIBEWF_RANGE_FLAG_IS_DELTA, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %d.", function, chunk_index ); goto on_error; } return( write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Closes the segment file, necessary sections at the end of the segment file will be written * Returns the number of bytes written or -1 on error */ ssize_t libewf_segment_file_write_close( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, off64_t section_offset, uint32_t number_of_chunks_written_to_segment, int last_segment_file, libewf_hash_sections_t *hash_sections, libfvalue_table_t *hash_values, libewf_media_values_t *media_values, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, ewf_data_t **cached_data_section, libcerror_error_t **error ) { libewf_section_t *section = NULL; static char *function = "libewf_segment_file_write_close"; ssize_t total_write_count = 0; ssize_t write_count = 0; int number_of_acquiry_errors = 0; int number_of_sessions = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( sessions == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sessions.", function ); return( -1 ); } if( acquiry_errors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid acquiry errors.", function ); return( -1 ); } if( last_segment_file != 0 ) { /* Write the data section for a single segment file only for EWF-E01 */ if( io_handle->ewf_format == EWF_FORMAT_E01 ) { if( segment_file->segment_number == 1 ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_data_write( section, io_handle, file_io_pool, file_io_pool_entry, section_offset, media_values, cached_data_section, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data section.", function ); goto on_error; } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } } /* Write the session section if required */ if( ( io_handle->format == LIBEWF_FORMAT_ENCASE5 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN5 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN6 ) || ( io_handle->format == LIBEWF_FORMAT_EWFX ) ) { if( libcdata_array_get_number_of_entries( sessions, &number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from sessions array.", function ); goto on_error; } if( number_of_sessions > 0 ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_session_write( section, file_io_pool, file_io_pool_entry, section_offset, sessions, tracks, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write sessions section.", function ); goto on_error; } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } } /* Write the error2 section if required */ if( ( io_handle->format == LIBEWF_FORMAT_ENCASE3 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE4 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE5 ) || ( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN5 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN6 ) || ( io_handle->format == LIBEWF_FORMAT_EWFX ) ) { if( libcdata_range_list_get_number_of_elements( acquiry_errors, &number_of_acquiry_errors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from acquiry errors range list.", function ); goto on_error; } if( number_of_acquiry_errors > 0 ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_error2_write( section, file_io_pool, file_io_pool_entry, section_offset, acquiry_errors, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write error2 section.", function ); goto on_error; } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } } if( ( io_handle->format == LIBEWF_FORMAT_ENCASE6 ) || ( io_handle->format == LIBEWF_FORMAT_LINEN6 ) ) { /* Write the digest section if required */ if( hash_sections->sha1_digest_set != 0 ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_digest_write( section, file_io_pool, file_io_pool_entry, section_offset, hash_sections, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write digest section.", function ); goto on_error; } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } } /* Write the hash section if required */ if( hash_sections->md5_hash_set != 0 ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_hash_write( section, file_io_pool, file_io_pool_entry, section_offset, hash_sections, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write hash section.", function ); goto on_error; } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } /* Write the xhash section */ if( io_handle->format == LIBEWF_FORMAT_EWFX ) { if( hash_sections->xhash != NULL ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: xhash already set - cleaning previous defintion.\n", function ); } #endif memory_free( hash_sections->xhash ); hash_sections->xhash = NULL; } if( libewf_hash_values_generate_xhash( hash_values, &( hash_sections->xhash ), &( hash_sections->xhash_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to generate xhash.", function ); goto on_error; } if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } write_count = libewf_section_xhash_write( section, file_io_pool, file_io_pool_entry, section_offset, hash_sections, EWF_COMPRESSION_DEFAULT, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write xhash section.", function ); goto on_error; } section_offset += write_count; total_write_count += write_count; if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; } } /* Write the done or next section * The segment file offset is updated by the function */ write_count = libewf_segment_file_write_last_section( segment_file, io_handle, file_io_pool, file_io_pool_entry, section_offset, last_segment_file, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write end of segment file.", function ); goto on_error; } total_write_count += write_count; section_offset += write_count; segment_file->number_of_chunks = number_of_chunks_written_to_segment; /* Make sure the next time the file is opened * it is not truncated */ if( libbfio_pool_reopen( file_io_pool, file_io_pool_entry, LIBBFIO_OPEN_READ_WRITE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to reopen segment file: %" PRIu16 ".", function, segment_file->segment_number ); goto on_error; } if( libbfio_pool_close( file_io_pool, file_io_pool_entry, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close segment file: %" PRIu16 ".", function, segment_file->segment_number ); goto on_error; } segment_file->flags &= ~( LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN ); return( total_write_count ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Corrects sections after streamed write * Returns 1 if successful or -1 on error */ int libewf_segment_file_write_sections_correction( libewf_segment_file_t *segment_file, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, int file_io_pool_entry, uint32_t number_of_chunks_written_to_segment, int last_segment_file, libewf_media_values_t *media_values, libfvalue_table_t *hash_values, libewf_hash_sections_t *hash_sections, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, ewf_data_t **cached_data_section, libcerror_error_t **error ) { libcdata_list_element_t *section_list_element = NULL; libewf_section_t *section = NULL; static char *function = "libewf_segment_file_write_sections_correction"; off64_t next_section_start_offset = 0; ssize_t write_count = 0; int correct_last_next_section = 0; if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment file.", function ); return( -1 ); } if( segment_file->section_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid segment file - missing section list.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting sections in segment file: %" PRIu16 ".\n", function, segment_file->segment_number ); } #endif if( libcdata_list_get_first_element( segment_file->section_list, §ion_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first section list element.", function ); return( -1 ); } if( section_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing first section list element.", function ); return( -1 ); } while( section_list_element != NULL ) { if( libcdata_list_element_get_value( section_list_element, (intptr_t **) §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element.", function ); return( -1 ); } if( section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing section.", function ); return( -1 ); } if( section->type_length == 6 ) { if( memory_compare( section->type, "volume", 6 ) == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting volume section.\n", function ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, section->start_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to find offset to correct volume section.", function ); return( -1 ); } write_count = -1; if( io_handle->ewf_format == EWF_FORMAT_E01 ) { write_count = libewf_section_volume_e01_write( section, io_handle, file_io_pool, file_io_pool_entry, section->start_offset, media_values, error ); } else if( io_handle->ewf_format == EWF_FORMAT_S01 ) { write_count = libewf_section_volume_s01_write( section, io_handle, file_io_pool, file_io_pool_entry, section->start_offset, media_values, error ); } if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to correct volume section.", function ); return( -1 ); } } } else if( section->type_length == 4 ) { if( memory_compare( section->type, "data", 4 ) == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting data section.\n", function ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, section->start_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset of data section.", function ); return( -1 ); } write_count = libewf_section_data_write( section, io_handle, file_io_pool, file_io_pool_entry, section->start_offset, media_values, cached_data_section, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to correct data section.", function ); return( -1 ); } } /* The last segment file should be terminated with a done section and not with a next section */ else if( last_segment_file != 0 ) { if( memory_compare( section->type, "next", 4 ) == 0 ) { correct_last_next_section = 1; next_section_start_offset = section->start_offset; } } } if( libcdata_list_element_get_next_element( section_list_element, §ion_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element.", function ); return( -1 ); } } if( correct_last_next_section == 0 ) { if( libbfio_pool_close( file_io_pool, file_io_pool_entry, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file IO pool entry: %d.", function, file_io_pool_entry ); return( -1 ); } } else { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting last next section.\n", function ); } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, next_section_start_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to find offset to last next section.", function ); return( -1 ); } write_count = libewf_segment_file_write_close( segment_file, io_handle, file_io_pool, file_io_pool_entry, next_section_start_offset, number_of_chunks_written_to_segment, 1, hash_sections, hash_values, media_values, sessions, tracks, acquiry_errors, cached_data_section, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to close segment file.", function ); return( -1 ); } } return( 1 ); } libewf-20140807/libewf/libewf_debug.c0000664000175000017500000002443613421024433021370 0ustar00lordyestalordyesta00000000000000/* * Debugging functions * * 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 . */ #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_libuna.h" /* Prints a dump of data * Returns 1 if successful or -1 on error */ int libewf_debug_dump_data( const char *header_string, const uint8_t *data, size_t data_size, libcerror_error_t **error ) { static char *function = "libewf_debug_dump_data"; uint32_t stored_checksum = 0; uint32_t calculated_checksum = 0; if( header_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header string.", function ); return( -1 ); } if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data.", function ); return( -1 ); } if( data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } if( libewf_checksum_calculate_adler32( &calculated_checksum, data, data_size - sizeof( uint32_t ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_to_uint32_little_endian( &( data[ data_size - sizeof( uint32_t ) ] ), stored_checksum ); libcnotify_printf( "%s:\n", header_string ); libcnotify_print_data( data, data_size, 0 ); libcnotify_printf( "%s: possible checksum (in file: %" PRIu32 " calculated: %" PRIu32 ").\n", function, stored_checksum, calculated_checksum ); return( 1 ); } /* Prints the byte stream data to the notify stream * Returns 1 if successful or -1 on error */ int libewf_debug_byte_stream_print( const char *header_string, const uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ) { 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 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header string.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_size_from_byte_stream( byte_stream, byte_stream_size, LIBUNA_CODEPAGE_ASCII, &string_size, error ); #else result = libuna_utf8_string_size_from_byte_stream( byte_stream, byte_stream_size, LIBUNA_CODEPAGE_ASCII, &string_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine string size.", function ); return( -1 ); } string = system_string_allocate( string_size ); if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_byte_stream( (uint16_t *) string, string_size, byte_stream, byte_stream_size, LIBUNA_CODEPAGE_ASCII, error ); #else result = libuna_utf8_string_copy_from_byte_stream( (uint8_t *) string, string_size, byte_stream, byte_stream_size, LIBUNA_CODEPAGE_ASCII, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string from byte stream.", function ); memory_free( string ); return( -1 ); } libcnotify_printf( "%s:\n" "%" PRIs_SYSTEM "", header_string, string ); memory_free( string ); return( 1 ); } /* Prints the UTF-8 stream data to the notify stream * Returns 1 if successful or -1 on error */ int libewf_debug_utf8_stream_print( const char *header_string, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { 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 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header string.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_size_from_utf8_stream( utf8_stream, utf8_stream_size, &string_size, error ); #else result = libuna_utf8_string_size_from_utf8_stream( utf8_stream, utf8_stream_size, &string_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine string size.", function ); return( -1 ); } string = system_string_allocate( string_size ); if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_utf8_stream( (uint16_t *) string, string_size, utf8_stream, utf8_stream_size, error ); #else result = libuna_utf8_string_copy_from_utf8_stream( (uint8_t *) string, string_size, utf8_stream, utf8_stream_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string from UTF-8 stream.", function ); memory_free( string ); return( -1 ); } libcnotify_printf( "%s:\n" "%" PRIs_SYSTEM "", header_string, string ); memory_free( string ); return( 1 ); } /* Prints the UTF-16 data to the notify stream * Returns 1 if successful or -1 on error */ int libewf_debug_utf16_stream_print( const char *header_string, const uint8_t *utf16_stream, size_t utf16_stream_size, libcerror_error_t **error ) { 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 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header string.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_size_from_utf16_stream( utf16_stream, utf16_stream_size, LIBUNA_ENDIAN_LITTLE, &string_size, error ); #else result = libuna_utf8_string_size_from_utf16_stream( utf16_stream, utf16_stream_size, LIBUNA_ENDIAN_LITTLE, &string_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine string size.", function ); return( -1 ); } string = system_string_allocate( string_size ); if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_utf16_stream( (uint16_t *) string, string_size, utf16_stream, utf16_stream_size, LIBUNA_ENDIAN_LITTLE, error ); #else result = libuna_utf8_string_copy_from_utf16_stream( (uint8_t *) string, string_size, utf16_stream, utf16_stream_size, LIBUNA_ENDIAN_LITTLE, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string from UTF-16 stream.", function ); memory_free( string ); return( -1 ); } libcnotify_printf( "%s:\n" "%" PRIs_SYSTEM "", header_string, string ); memory_free( string ); return( 1 ); } libewf-20140807/libewf/libewf_hash_sections.h0000644000175000017500000000425613421013624023135 0ustar00lordyestalordyesta00000000000000/* * Hash sections functions * * 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_HASH_SECTIONS_H ) #define _LIBEWF_HASH_SECTIONS_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_hash_sections libewf_hash_sections_t; /* Additional subhandle for media specific parameters */ struct libewf_hash_sections { /* The stored xhash */ uint8_t *xhash; /* The size of the stored xhash */ size_t xhash_size; /* The MD5 hash of the data as found in the hash section */ uint8_t md5_hash[ 16 ]; /* Value to indicate if the MD5 hash was set */ uint8_t md5_hash_set; /* The MD5 hash of the data as found in the digest section */ uint8_t md5_digest[ 16 ]; /* Value to indicate if the MD5 digest was set */ uint8_t md5_digest_set; /* The SHA1 hash of the data as found in the digest section */ uint8_t sha1_digest[ 20 ]; /* Value to indicate if the SHA1 digest was set */ uint8_t sha1_digest_set; }; int libewf_hash_sections_initialize( libewf_hash_sections_t **hash_sections, libcerror_error_t **error ); int libewf_hash_sections_free( libewf_hash_sections_t **hash_sections, libcerror_error_t **error ); int libewf_hash_sections_clone( libewf_hash_sections_t **destination_hash_sections, libewf_hash_sections_t *source_hash_sections, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_file_entry.c0000664000175000017500000016604413421024433022444 0ustar00lordyestalordyesta00000000000000/* * File entry functions * * 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 . */ #include #include #include #include "libewf_definitions.h" #include "libewf_extern.h" #include "libewf_file_entry.h" #include "libewf_handle.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_single_file_entry.h" #include "libewf_single_file_tree.h" #include "libewf_types.h" /* Initializes the file entry and its values * Returns 1 if successful or -1 on error */ int libewf_file_entry_initialize( libewf_file_entry_t **file_entry, libewf_internal_handle_t *internal_handle, libcdata_tree_node_t *file_entry_tree_node, uint8_t flags, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; static char *function = "libewf_file_entry_initialize"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( *file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file entry value already set.", function ); return( -1 ); } if( ( flags & ~( LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function, flags ); return( -1 ); } internal_file_entry = memory_allocate_structure( libewf_internal_file_entry_t ); if( internal_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file entry.", function ); goto on_error; } if( memory_set( internal_file_entry, 0, sizeof( libewf_internal_file_entry_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file entry.", function ); goto on_error; } internal_file_entry->internal_handle = internal_handle; internal_file_entry->flags = flags; if( ( flags & LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE ) == 0 ) { internal_file_entry->file_entry_tree_node = file_entry_tree_node; } else { if( libcdata_tree_node_clone( &( internal_file_entry->file_entry_tree_node ), file_entry_tree_node, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_single_file_entry_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libewf_single_file_entry_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy file entry tree node.", function ); goto on_error; } } *file_entry = (libewf_file_entry_t *) internal_file_entry; return( 1 ); on_error: if( internal_file_entry != NULL ) { memory_free( internal_file_entry ); } return( -1 ); } /* Frees a file entry * Returns 1 if successful or -1 on error */ int libewf_file_entry_free( libewf_file_entry_t **file_entry, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; static char *function = "libewf_file_entry_free"; int result = 1; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( *file_entry != NULL ) { internal_file_entry = (libewf_internal_file_entry_t *) *file_entry; *file_entry = NULL; /* The internal_handle reference is freed elsewhere */ /* If not managed the file_entry_tree_node reference is freed elsewhere */ if( ( internal_file_entry->flags & LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE ) != 0 ) { if( internal_file_entry->file_entry_tree_node != NULL ) { if( libcdata_tree_node_free( &( internal_file_entry->file_entry_tree_node ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_single_file_entry_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file entry tree node.", function ); return( -1 ); } } } memory_free( internal_file_entry ); } return( result ); } /* Retrieves the type * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_type( libewf_file_entry_t *file_entry, uint8_t *type, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_type"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_type( single_file_entry, type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve type.", function ); return( -1 ); } return( 1 ); } /* Retrieves the flags * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_flags( libewf_file_entry_t *file_entry, uint32_t *flags, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_flags"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_flags( single_file_entry, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve flags.", function ); return( -1 ); } return( 1 ); } /* Retrieves the media data offset * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_media_data_offset( libewf_file_entry_t *file_entry, off64_t *media_data_offset, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_media_data_offset"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_data_offset( single_file_entry, media_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data offset.", function ); return( -1 ); } return( 1 ); } /* Retrieves the media data size * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_media_data_size( libewf_file_entry_t *file_entry, size64_t *media_data_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_media_data_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_data_size( single_file_entry, media_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the duplicate media data offset * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_duplicate_media_data_offset( libewf_file_entry_t *file_entry, off64_t *duplicate_media_data_offset, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_media_data_offset"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_duplicate_data_offset( single_file_entry, duplicate_media_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve duplicate data offset.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of the UTF-8 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_utf8_name_size( libewf_file_entry_t *file_entry, size_t *utf8_name_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf8_name_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_utf8_name_size( single_file_entry, utf8_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-8 name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-8 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_utf8_name( libewf_file_entry_t *file_entry, uint8_t *utf8_name, size_t utf8_name_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf8_name_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_utf8_name( single_file_entry, utf8_name, utf8_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-8 name.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of the UTF-16 encoded name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_utf16_name_size( libewf_file_entry_t *file_entry, size_t *utf16_name_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf16_name_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_utf16_name_size( single_file_entry, utf16_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-16 name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-16 encoded name value * The size should include the end of string character * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_utf16_name( libewf_file_entry_t *file_entry, uint16_t *utf16_name, size_t utf16_name_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf16_name_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_utf16_name( single_file_entry, utf16_name, utf16_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-8 name.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_size( libewf_file_entry_t *file_entry, size64_t *size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_size( single_file_entry, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the creation date and time * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_creation_time( libewf_file_entry_t *file_entry, uint32_t *creation_time, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_creation_time"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_creation_time( single_file_entry, creation_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve creation time.", function ); return( -1 ); } return( 1 ); } /* Retrieves the (file) modification (last written) date and time * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_modification_time( libewf_file_entry_t *file_entry, uint32_t *modification_time, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_modification_time"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_modification_time( single_file_entry, modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve modification time.", function ); return( -1 ); } return( 1 ); } /* Retrieves the access date and time * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_access_time( libewf_file_entry_t *file_entry, uint32_t *access_time, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_access_time"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_access_time( single_file_entry, access_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access time.", function ); return( -1 ); } return( 1 ); } /* Retrieves the (file system entry) modification date and time * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_entry_modification_time( libewf_file_entry_t *file_entry, uint32_t *entry_modification_time, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_entry_modification_time"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_entry_modification_time( single_file_entry, entry_modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry modification time.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-8 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_file_entry_get_utf8_hash_value_md5( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf8_hash_value_md5"; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } result = libewf_single_file_entry_get_utf8_hash_value_md5( single_file_entry, utf8_string, utf8_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: MD5.", function ); return( -1 ); } return( result ); } /* Retrieves the UTF-16 encoded MD5 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_file_entry_get_utf16_hash_value_md5( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf16_hash_value_md5"; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } result = libewf_single_file_entry_get_utf16_hash_value_md5( single_file_entry, utf16_string, utf16_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: MD5.", function ); return( -1 ); } return( result ); } /* Retrieves the UTF-8 encoded SHA1 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_file_entry_get_utf8_hash_value_sha1( libewf_file_entry_t *file_entry, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf8_hash_value_sha1"; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } result = libewf_single_file_entry_get_utf8_hash_value_sha1( single_file_entry, utf8_string, utf8_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: SHA1.", function ); return( -1 ); } return( result ); } /* Retrieves the UTF-16 encoded SHA1 hash value * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_file_entry_get_utf16_hash_value_sha1( libewf_file_entry_t *file_entry, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_get_utf16_hash_value_sha1"; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } result = libewf_single_file_entry_get_utf16_hash_value_sha1( single_file_entry, utf16_string, utf16_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: SHA1.", function ); return( -1 ); } return( result ); } /* Reads data at the current offset * Returns the number of bytes read or -1 on error */ ssize_t libewf_file_entry_read_buffer( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_read_buffer"; off64_t data_offset = 0; off64_t duplicate_data_offset = 0; size64_t data_size = 0; size64_t size = 0; size_t read_size = 0; ssize_t read_count = 0; uint32_t flags = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( internal_file_entry->offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file entry - offset value out of bounds.", function ); return( -1 ); } if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_size( single_file_entry, &size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size.", function ); return( -1 ); } if( libewf_single_file_entry_get_data_offset( single_file_entry, &data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data offset.", function ); return( -1 ); } if( libewf_single_file_entry_get_data_size( single_file_entry, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data size.", function ); return( -1 ); } if( libewf_single_file_entry_get_flags( single_file_entry, &flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve flags.", function ); return( -1 ); } if( ( flags & LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA ) == 0 ) { if( ( ( size == 0 ) && ( data_size != 1 ) ) || ( ( size != 0 ) && ( data_size != size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported data size.", function ); return( -1 ); } } else { if( ( data_size != 1 ) && ( data_size != size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported data size.", function ); return( -1 ); } if( libewf_single_file_entry_get_duplicate_data_offset( single_file_entry, &duplicate_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve duplicate data offset.", function ); return( -1 ); } } if( internal_file_entry->offset >= (off64_t) size ) { return( 0 ); } if( (off64_t) ( internal_file_entry->offset + buffer_size ) > (off64_t) size ) { buffer_size = (size_t) ( size - internal_file_entry->offset ); } if( ( flags & LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA ) == 0 ) { data_offset += internal_file_entry->offset; read_size = buffer_size; } else if( duplicate_data_offset >= 0 ) { data_offset = duplicate_data_offset + internal_file_entry->offset; read_size = buffer_size; } else { read_size = 1; } if( libewf_handle_seek_offset( (libewf_handle_t *) internal_file_entry->internal_handle, data_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, data_offset ); return( -1 ); } read_count = libewf_handle_read_buffer( (libewf_handle_t *) internal_file_entry->internal_handle, buffer, read_size, error ); if( read_count <= -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } internal_file_entry->offset += read_count; if( ( flags & LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA ) != 0 ) { if( read_count == 1 ) { if( memory_set( &( ( (uint8_t *) buffer )[ 1 ] ), ( (uint8_t *) buffer )[ 0 ], buffer_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set sparse data in buffer.", function ); return( -1 ); } read_count = (ssize_t) buffer_size; } } return( read_count ); } /* Reads data at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t libewf_file_entry_read_random( libewf_file_entry_t *file_entry, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libewf_file_entry_read_random"; ssize_t read_count = 0; if( libewf_file_entry_seek_offset( file_entry, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } read_count = libewf_file_entry_read_buffer( file_entry, buffer, buffer_size, error ); if( read_count <= -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } return( read_count ); } /* Seeks a certain offset of the data * Returns the offset if seek is successful or -1 on error */ off64_t libewf_file_entry_seek_offset( libewf_file_entry_t *file_entry, off64_t offset, int whence, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; static char *function = "libewf_file_entry_seek_offset"; size64_t size = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( libewf_single_file_entry_get_size( single_file_entry, &size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( whence == SEEK_CUR ) { offset += internal_file_entry->offset; } else if( whence == SEEK_END ) { offset += (off64_t) size; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: seeking offset: %" PRIi64 ".\n", function, offset ); } #endif if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } internal_file_entry->offset = offset; return( offset ); } /* Retrieves the current offset of the data * Returns the offset if successful or -1 on error */ int libewf_file_entry_get_offset( libewf_file_entry_t *file_entry, off64_t *offset, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; static char *function = "libewf_file_entry_get_offset"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( internal_file_entry->file_entry_tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file entry - missing file entry tree node.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } *offset = internal_file_entry->offset; return( 1 ); } /* Retrieves the number of sub file entries * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_number_of_sub_file_entries( libewf_file_entry_t *file_entry, int *number_of_sub_file_entries, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; static char *function = "libewf_file_entry_get_number_of_sub_file_entries"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( libcdata_tree_node_get_number_of_sub_nodes( internal_file_entry->file_entry_tree_node, number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); return( -1 ); } return( 1 ); } /* Retrieves the sub file entry for the specific index * Returns 1 if successful or -1 on error */ int libewf_file_entry_get_sub_file_entry( libewf_file_entry_t *file_entry, int sub_file_entry_index, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libewf_file_entry_get_sub_file_entry"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( internal_file_entry->file_entry_tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file entry - missing file entry tree node.", function ); return( -1 ); } if( sub_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub file entry.", function ); return( -1 ); } if( *sub_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: sub file entry already set.", function ); return( -1 ); } if( libcdata_tree_node_get_sub_node_by_index( internal_file_entry->file_entry_tree_node, sub_file_entry_index, &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry tree node.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid sub node.", function ); return( -1 ); } if( libewf_file_entry_initialize( sub_file_entry, internal_file_entry->internal_handle, sub_node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize sub file entry.", function ); return( -1 ); } return( 1 ); } /* Retrieves the sub file entry for the specific UTF-8 encoded name * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ int libewf_file_entry_get_sub_file_entry_by_utf8_name( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *sub_single_file_entry = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libewf_file_entry_get_sub_file_entry_by_utf8_name"; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( internal_file_entry->file_entry_tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file entry - missing file entry tree node.", function ); return( -1 ); } if( sub_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub file entry.", function ); return( -1 ); } if( *sub_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: sub file entry already set.", function ); return( -1 ); } result = libewf_single_file_tree_get_sub_node_by_utf8_name( internal_file_entry->file_entry_tree_node, utf8_string, utf8_string_length, &sub_node, &sub_single_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry by UTF-8 name.", function ); return( -1 ); } else if( result != 0 ) { if( libewf_file_entry_initialize( sub_file_entry, internal_file_entry->internal_handle, sub_node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize sub file entry.", function ); return( -1 ); } } return( result ); } /* Retrieves the sub file entry for the specific UTF-8 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ int libewf_file_entry_get_sub_file_entry_by_utf8_path( libewf_file_entry_t *file_entry, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; libewf_single_file_entry_t *sub_single_file_entry = NULL; libcdata_tree_node_t *node = NULL; libcdata_tree_node_t *sub_node = NULL; uint8_t *utf8_string_segment = NULL; static char *function = "libewf_file_entry_get_sub_file_entry_by_utf8_path"; size_t utf8_string_index = 0; size_t utf8_string_segment_length = 0; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string length value exceeds maximum.", function ); return( -1 ); } if( sub_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub file entry.", function ); return( -1 ); } if( *sub_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: sub file entry already set.", function ); return( -1 ); } if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing file entry values.", function ); return( -1 ); } node = internal_file_entry->file_entry_tree_node; if( utf8_string_length > 0 ) { /* Ignore a leading separator */ if( utf8_string[ utf8_string_index ] == (uint8_t) LIBEWF_SEPARATOR ) { utf8_string_index++; } } if( ( utf8_string_length == 0 ) || ( utf8_string_length == 1 ) ) { result = 1; } while( utf8_string_index < utf8_string_length ) { utf8_string_segment = (uint8_t *) &( utf8_string[ utf8_string_index ] ); utf8_string_segment_length = 0; while( utf8_string_index < utf8_string_length ) { if( ( utf8_string[ utf8_string_index ] == (uint8_t) LIBEWF_SEPARATOR ) || ( utf8_string[ utf8_string_index ] == (uint8_t) 0 ) ) { utf8_string_index++; break; } utf8_string_index++; utf8_string_segment_length++; } if( utf8_string_segment_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub file entry name.", function ); return( -1 ); } result = libewf_single_file_tree_get_sub_node_by_utf8_name( node, utf8_string_segment, utf8_string_segment_length, &sub_node, &sub_single_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node by name.", function ); return( -1 ); } else if( result == 0 ) { break; } node = sub_node; } if( result != 0 ) { if( libewf_file_entry_initialize( sub_file_entry, internal_file_entry->internal_handle, sub_node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize sub file entry.", function ); return( -1 ); } } return( result ); } /* Retrieves the sub file entry for the specific UTF-16 encoded name * Returns 1 if successful, 0 if no such sub file entry or -1 on error */ int libewf_file_entry_get_sub_file_entry_by_utf16_name( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *sub_single_file_entry = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libewf_file_entry_get_sub_file_entry_by_utf16_name"; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( internal_file_entry->file_entry_tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file entry - missing file entry tree node.", function ); return( -1 ); } if( sub_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub file entry.", function ); return( -1 ); } if( *sub_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: sub file entry already set.", function ); return( -1 ); } result = libewf_single_file_tree_get_sub_node_by_utf16_name( internal_file_entry->file_entry_tree_node, utf16_string, utf16_string_length, &sub_node, &sub_single_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry by UTF-16 name.", function ); return( -1 ); } else if( result != 0 ) { if( libewf_file_entry_initialize( sub_file_entry, internal_file_entry->internal_handle, sub_node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize sub file entry.", function ); return( -1 ); } } return( result ); } /* Retrieves the sub file entry for the specific UTF-16 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ int libewf_file_entry_get_sub_file_entry_by_utf16_path( libewf_file_entry_t *file_entry, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **sub_file_entry, libcerror_error_t **error ) { libewf_internal_file_entry_t *internal_file_entry = NULL; libewf_single_file_entry_t *single_file_entry = NULL; libewf_single_file_entry_t *sub_single_file_entry = NULL; libcdata_tree_node_t *node = NULL; libcdata_tree_node_t *sub_node = NULL; uint16_t *utf16_string_segment = NULL; static char *function = "libewf_file_entry_get_sub_file_entry_by_utf16_path"; size_t utf16_string_index = 0; size_t utf16_string_segment_length = 0; int result = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } internal_file_entry = (libewf_internal_file_entry_t *) file_entry; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string length value exceeds maximum.", function ); return( -1 ); } if( sub_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub file entry.", function ); return( -1 ); } if( *sub_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: sub file entry already set.", function ); return( -1 ); } if( libcdata_tree_node_get_value( internal_file_entry->file_entry_tree_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from file entry tree node.", function ); return( -1 ); } if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing file entry values.", function ); return( -1 ); } node = internal_file_entry->file_entry_tree_node; if( utf16_string_length > 0 ) { /* Ignore a leading separator */ if( utf16_string[ utf16_string_index ] == (uint16_t) LIBEWF_SEPARATOR ) { utf16_string_index++; } } if( ( utf16_string_length == 0 ) || ( utf16_string_length == 1 ) ) { result = 1; } while( utf16_string_index < utf16_string_length ) { utf16_string_segment = (uint16_t *) &( utf16_string[ utf16_string_index ] ); utf16_string_segment_length = 0; while( utf16_string_index < utf16_string_length ) { if( ( utf16_string[ utf16_string_index ] == (uint16_t) LIBEWF_SEPARATOR ) || ( utf16_string[ utf16_string_index ] == (uint16_t) 0 ) ) { utf16_string_index++; break; } utf16_string_index++; utf16_string_segment_length++; } if( utf16_string_segment_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub file entry name.", function ); return( -1 ); } result = libewf_single_file_tree_get_sub_node_by_utf16_name( node, utf16_string_segment, utf16_string_segment_length, &sub_node, &sub_single_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node by name.", function ); return( -1 ); } else if( result == 0 ) { break; } node = sub_node; } if( result != 0 ) { if( libewf_file_entry_initialize( sub_file_entry, internal_file_entry->internal_handle, sub_node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize sub file entry.", function ); return( -1 ); } } return( result ); } libewf-20140807/libewf/libewf_definitions.h.in0000644000175000017500000001642313224371453023232 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * 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_INTERNAL_DEFINITIONS_H ) #define _LIBEWF_INTERNAL_DEFINITIONS_H #include #include #include "libewf_libmfdata.h" /* Define HAVE_LOCAL_LIBEWF for local use of libewf */ #if !defined( HAVE_LOCAL_LIBEWF ) #include #else #define LIBEWF_VERSION @VERSION@ /* The version string */ #define LIBEWF_VERSION_STRING "@VERSION@" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3-4 not used * bit 5 set to 1 to resume write * bit 6-8 not used */ enum LIBEWF_ACCESS_FLAGS { LIBEWF_ACCESS_FLAG_READ = 0x01, LIBEWF_ACCESS_FLAG_WRITE = 0x02, LIBEWF_ACCESS_FLAG_RESUME = 0x10 }; /* The file access macros */ #define LIBEWF_OPEN_READ ( LIBEWF_ACCESS_FLAG_READ ) #define LIBEWF_OPEN_READ_WRITE ( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE ( LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE_RESUME ( LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ) /* The file formats */ enum LIBEWF_FORMAT { LIBEWF_FORMAT_UNKNOWN = 0x00, LIBEWF_FORMAT_ENCASE1 = 0x01, LIBEWF_FORMAT_ENCASE2 = 0x02, LIBEWF_FORMAT_ENCASE3 = 0x03, LIBEWF_FORMAT_ENCASE4 = 0x04, LIBEWF_FORMAT_ENCASE5 = 0x05, LIBEWF_FORMAT_ENCASE6 = 0x06, LIBEWF_FORMAT_ENCASE7 = 0x07, LIBEWF_FORMAT_SMART = 0x0e, LIBEWF_FORMAT_FTK_IMAGER = 0x0f, LIBEWF_FORMAT_LOGICAL_ENCASE5 = 0x10, LIBEWF_FORMAT_LOGICAL_ENCASE6 = 0x11, LIBEWF_FORMAT_LOGICAL_ENCASE7 = 0x12, LIBEWF_FORMAT_LINEN5 = 0x25, LIBEWF_FORMAT_LINEN6 = 0x26, LIBEWF_FORMAT_LINEN7 = 0x27, /* The format as specified by Andrew Rosen */ LIBEWF_FORMAT_EWF = 0x70, /* Libewf eXtended EWF format */ LIBEWF_FORMAT_EWFX = 0x71 }; /* TODO deprecated remove after a while */ #define LIBEWF_FORMAT_LVF LIBEWF_FORMAT_LOGICAL_ENCASE5 #define LIBEWF_FORMAT_FTK LIBEWF_FORMAT_FTK_IMAGER /* The default segment file size */ #define LIBEWF_DEFAULT_SEGMENT_FILE_SIZE ( 1500 * 1024 * 1024 ) /* The compression methods definitions */ enum LIBEWF_COMPRESSION_METHODS { LIBEWF_COMPRESSION_METHOD_NONE = 0, LIBEWF_COMPRESSION_METHOD_DEFLATE = 1, LIBEWF_COMPRESSION_METHOD_BZIP2 = 2, }; /* The compression level definitions */ enum LIBEWF_COMPRESSION_LEVELS { LIBEWF_COMPRESSION_DEFAULT = -1, LIBEWF_COMPRESSION_NONE = 0, LIBEWF_COMPRESSION_FAST = 1, LIBEWF_COMPRESSION_BEST = 2, }; /* The compression flags * bit 1 set to 1 for empty block compression * detects empty blocks and stored them compressed, the compression * is only done once * bit 2-8 not used */ enum LIBEWF_COMPRESSION_FLAGS { LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION = (uint8_t) 0x01, }; /* TODO deprecated remove after a while */ #define LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION /* The media type definitions */ enum LIBEWF_MEDIA_TYPES { LIBEWF_MEDIA_TYPE_REMOVABLE = 0x00, LIBEWF_MEDIA_TYPE_FIXED = 0x01, LIBEWF_MEDIA_TYPE_OPTICAL = 0x03, LIBEWF_MEDIA_TYPE_SINGLE_FILES = 0x0e, LIBEWF_MEDIA_TYPE_MEMORY = 0x10 }; /* The media flags definitions */ enum LIBEWF_MEDIA_FLAGS { LIBEWF_MEDIA_FLAG_PHYSICAL = 0x02, LIBEWF_MEDIA_FLAG_FASTBLOC = 0x04, LIBEWF_MEDIA_FLAG_TABLEAU = 0x08 }; #if defined( HAVE_V1_API ) /* The volume type definitions */ enum LIBEWF_VOLUME_TYPES { LIBEWF_VOLUME_TYPE_LOGICAL = 0x00, LIBEWF_VOLUME_TYPE_PHYSICAL = 0x01 }; #endif /* The date representation formats */ enum LIBEWF_DATE_FORMATS { LIBEWF_DATE_FORMAT_DAYMONTH = 0x01, LIBEWF_DATE_FORMAT_MONTHDAY = 0x02, LIBEWF_DATE_FORMAT_ISO8601 = 0x03, LIBEWF_DATE_FORMAT_CTIME = 0x04 }; /* The header value compression levels definitions */ #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST "b" /* TODO deprecated remove after a while */ #define LIBEWF_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_COMPRESSION_LEVEL_BEST "b" /* The segment file type definitions */ enum LIBEWF_SEGMENT_FILE_TYPES { LIBEWF_SEGMENT_FILE_TYPE_DWF = (int) 'd', LIBEWF_SEGMENT_FILE_TYPE_EWF = (int) 'E', LIBEWF_SEGMENT_FILE_TYPE_LWF = (int) 'L' }; /* The (single) file entry types */ enum LIBEWF_FILE_ENTRY_TYPES { LIBEWF_FILE_ENTRY_TYPE_DIRECTORY = (uint8_t) 'd', LIBEWF_FILE_ENTRY_TYPE_FILE = (uint8_t) 'f' }; #define LIBEWF_FILE_ENTRY_TYPE_FOLDER LIBEWF_FILE_ENTRY_TYPE_DIRECTORY /* The (single) file entry flags */ enum LIBEWF_FILE_ENTRY_FLAGS { LIBEWF_FILE_ENTRY_FLAG_ARCHIVE = 0x00000008UL, LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA = 0x04000000UL, }; /* The (single) file entry name separator */ #define LIBEWF_SEPARATOR '\\' #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ /* The item flags definitions */ enum LIBEWF_ITEM_FLAGS { /* The file entry tree node is not managed by the item */ LIBEWF_ITEM_FLAG_NON_MANAGED_FILE_ENTRY_TREE_NODE = 0x00, /* The file entry tree node is managed by the item */ LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE = 0x01 }; /* The segment table flags definitions */ enum LIBEWF_SEGMENT_TABLE_FLAGS { /* The segment table is corrupted */ LIBEWF_SEGMENT_TABLE_FLAG_CORRUPTED = 0x01 }; /* The segment file flags definitions */ enum LIBEWF_SEGMENT_FILE_FLAGS { /* The segment file is corrupted */ LIBEWF_SEGMENT_FILE_FLAG_CORRUPTED = 0x01, /* The segment file is open for writing */ LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN = 0x02 }; #if defined( HAVE_DEBUG_OUTPUT ) #define LIBEWF_ITEM_FLAGS_DEFAULT LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE #else #define LIBEWF_ITEM_FLAGS_DEFAULT LIBEWF_ITEM_FLAG_NON_MANAGED_FILE_ENTRY_TREE_NODE #endif #define LIBEWF_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBEWF_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE /* The chunk data range refers to a delta chunk */ #define LIBEWF_RANGE_FLAG_IS_DELTA LIBMFDATA_RANGE_FLAG_USER_DEFINED_4 /* The chunk data range is tainted (possibly corrupted) */ #define LIBEWF_RANGE_FLAG_IS_TAINTED LIBMFDATA_RANGE_FLAG_USER_DEFINED_5 /* The chunk data range is corrupted */ #define LIBEWF_RANGE_FLAG_IS_CORRUPTED LIBMFDATA_RANGE_FLAG_USER_DEFINED_6 #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define LIBEWF_2_TIB 0x20000000000UL #else #define LIBEWF_2_TIB 0x20000000000ULL #endif #endif libewf-20140807/libewf/libewf_single_file_tree.h0000644000175000017500000000334613421013625023602 0ustar00lordyestalordyesta00000000000000/* * Single file tree functions * * 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_SINGLE_FILE_TREE_H ) #define _LIBEWF_SINGLE_FILE_TREE_H #include #include #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_single_file_entry.h" #if defined( __cplusplus ) extern "C" { #endif int libewf_single_file_tree_get_sub_node_by_utf8_name( libcdata_tree_node_t *single_file_tree_node, const uint8_t *utf8_string, size_t utf8_string_length, libcdata_tree_node_t **single_file_tree_sub_node, libewf_single_file_entry_t **sub_single_file_entry, libcerror_error_t **error ); int libewf_single_file_tree_get_sub_node_by_utf16_name( libcdata_tree_node_t *single_file_tree_node, const uint16_t *utf16_string, size_t utf16_string_length, libcdata_tree_node_t **single_file_tree_sub_node, libewf_single_file_entry_t **sub_single_file_entry, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_checksum.c0000664000175000017500000000456613421013623022105 0ustar00lordyestalordyesta00000000000000/* * Checksum functions * * Copyright (C) 2006-2017, 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 . */ #include #include #include #if defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) #include #endif #include "libewf_checksum.h" #include "libewf_libcerror.h" #include "libewf_types.h" #if defined( HAVE_ADLER32 ) && ( defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) ) /* Calculates the little-endian Adler-32 of a buffer * It uses the initial value to calculate a new Adler-32 * Returns 1 if successful or -1 on error */ int libewf_checksum_calculate_adler32( uint32_t *checksum_value, const uint8_t *buffer, size_t size, uint32_t initial_value, libcerror_error_t **error ) { static char *function = "libewf_checksum_calculate_adler32"; if( checksum_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid checksum value.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) UINT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } *checksum_value = adler32( (uLong) initial_value, (const Bytef *) buffer, (uInt) size ); return( 1 ); } #endif /* defined( HAVE_ADLER32 ) && ( defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) ) */ libewf-20140807/libewf/libewf_libbfio.h0000664000175000017500000000324313440663046021720 0ustar00lordyestalordyesta00000000000000/* * The libbfio header wrapper * * Copyright (C) 2006-2018, 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_LIBBFIO_H ) #define _LIBEWF_LIBBFIO_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT * before including libbfio.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBBFIO_DLL_IMPORT #endif #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) #error Multi-threading support requires libbfio with multi-threading support #endif #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ #endif /* !defined( _LIBEWF_LIBBFIO_H ) */ libewf-20140807/libewf/ewf_definitions.h0000644000175000017500000000350413421013623022121 0ustar00lordyestalordyesta00000000000000/* * Definitions for libewf * * 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( _EWF_DEFINIONS_H ) #define _EWF_DEFINIONS_H #include #include /* The minimum chunk size is 32k (32 * 1024) * 64 * 512 (64 sectors) */ #define EWF_MINIMUM_CHUNK_SIZE 32768 /* The possible EWF file formats */ #define EWF_FORMAT_UNKNOWN (uint8_t) 'u' #define EWF_FORMAT_D01 (uint8_t) 'd' #define EWF_FORMAT_E01 (uint8_t) 'e' #define EWF_FORMAT_L01 (uint8_t) 'l' #define EWF_FORMAT_S01 (uint8_t) 's' /* The EWF compression levels */ #define EWF_COMPRESSION_UNKNOWN -2 #define EWF_COMPRESSION_DEFAULT -1 #define EWF_COMPRESSION_NONE 0 #define EWF_COMPRESSION_FAST 1 #define EWF_COMPRESSION_BEST 2 /* The EWF offset masks */ #define EWF_OFFSET_COMPRESSED_READ_MASK 0x7fffffff #define EWF_OFFSET_COMPRESSED_WRITE_MASK 0x80000000 /* EWF the initial maximum number of offsets in a table section */ #define EWF_MAXIMUM_OFFSETS_IN_TABLE 16375 /* EWF maximum number of offsets in a table section * as of EnCase 6 */ #define EWF_MAXIMUM_OFFSETS_IN_TABLE_ENCASE6 65534 #endif libewf-20140807/libewf/libewf_date_time_values.c0000664000175000017500000024055713421024433023620 0ustar00lordyestalordyesta00000000000000/* * Date and time values functions * * 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 . */ #include #include #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_date_time.h" #include "libewf_date_time_values.h" #include "libewf_definitions.h" #include "libewf_libcerror.h" #include "libewf_libfvalue.h" /* Copies date and time values string from a timestamp * The string must be at least 20 characters + the length of the timezone string and/or timezone name of size including the end of string character * Returns 1 if successful or -1 on error */ int libewf_date_time_values_copy_from_timestamp( uint8_t *date_time_values_string, size_t date_time_values_string_size, time_t timestamp, libcerror_error_t **error ) { struct tm time_elements; static char *function = "libewf_date_time_values_copy_from_timestamp"; size_t string_index = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( date_time_values_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid date time values string size.", function ); return( -1 ); } if( date_time_values_string_size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: date time values string too small.", function ); return( -1 ); } if( libewf_date_time_localtime( ×tamp, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create time elements.", function ); return( -1 ); } if( ( time_elements.tm_year + 1900 ) > 10000 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported year value.", function ); return( -1 ); } if( ( time_elements.tm_mon < 0 ) || ( time_elements.tm_mon > 11 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month.", function ); return( -1 ); } if( ( time_elements.tm_mday < 1 ) || ( time_elements.tm_mday > 31 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of month.", function ); return( -1 ); } if( ( time_elements.tm_hour < 0 ) || ( time_elements.tm_hour > 23 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported hours.", function ); return( -1 ); } if( ( time_elements.tm_min < 0 ) || ( time_elements.tm_min > 59 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported minutes.", function ); return( -1 ); } /* Note a value of 60 is used for a leap-second */ if( ( time_elements.tm_sec < 0 ) || ( time_elements.tm_sec > 60 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported seconds.", function ); return( -1 ); } if( libfvalue_utf8_string_with_index_copy_from_integer( date_time_values_string, date_time_values_string_size, &string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to date time values string.", function ); return( -1 ); } date_time_values_string[ string_index - 1 ] = (uint8_t) ' '; if( ( time_elements.tm_mon + 1 ) < 10 ) { date_time_values_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( date_time_values_string, date_time_values_string_size, &string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to date time values string.", function ); return( -1 ); } date_time_values_string[ string_index - 1 ] = (uint8_t) ' '; if( time_elements.tm_mday < 10 ) { date_time_values_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( date_time_values_string, date_time_values_string_size, &string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to date time values string.", function ); return( -1 ); } date_time_values_string[ string_index - 1 ] = (uint8_t) ' '; if( time_elements.tm_hour < 10 ) { date_time_values_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( date_time_values_string, date_time_values_string_size, &string_index, (uint64_t) time_elements.tm_hour, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours to date time values string.", function ); return( -1 ); } date_time_values_string[ string_index - 1 ] = (uint8_t) ' '; if( time_elements.tm_min < 10 ) { date_time_values_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( date_time_values_string, date_time_values_string_size, &string_index, (uint64_t) time_elements.tm_min, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes to date time values string.", function ); return( -1 ); } date_time_values_string[ string_index - 1 ] = (uint8_t) ' '; if( time_elements.tm_sec < 10 ) { date_time_values_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( date_time_values_string, date_time_values_string_size, &string_index, (uint64_t) time_elements.tm_sec, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds to date time values string.", function ); return( -1 ); } date_time_values_string[ string_index - 1 ] = 0; return( 1 ); } /* Copies date and time values string to a timestamp * Returns 1 if successful or -1 on error */ int libewf_date_time_values_copy_to_timestamp( const uint8_t *date_time_values_string, size_t date_time_values_string_size, time_t *timestamp, libcerror_error_t **error ) { struct tm time_elements; libfvalue_split_utf8_string_t *date_time_values = NULL; uint8_t *date_time_value_string = NULL; static char *function = "libewf_date_time_values_copy_to_timestamp"; size_t date_time_value_string_size = 0; int number_of_date_time_values = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( date_time_values_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid date time values string size.", function ); return( -1 ); } if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } if( libfvalue_utf8_string_split( date_time_values_string, date_time_values_string_size, (uint8_t) ' ', &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split date time values string.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( date_time_values, &number_of_date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of date time values.", function ); goto on_error; } if( number_of_date_time_values < 6 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported number of date time values in string.", function ); goto on_error; } /* Set the year */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 0, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 0.", function ); goto on_error; } if( libewf_utf8_string_year_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year value.", function ); goto on_error; } /* Set the month */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 1, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 1.", function ); goto on_error; } if( date_time_value_string_size != 3 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 1.", function ); goto on_error; } if( libewf_utf8_string_month_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month value.", function ); goto on_error; } /* Set the day of the month */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 2, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 2.", function ); goto on_error; } if( date_time_value_string_size != 3 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 2.", function ); goto on_error; } if( libewf_utf8_string_day_of_month_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month value.", function ); goto on_error; } /* Set the hours */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 3, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 3.", function ); goto on_error; } if( date_time_value_string_size != 3 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 3.", function ); goto on_error; } if( libewf_utf8_string_hours_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours value.", function ); goto on_error; } /* Set the minutes */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 4, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 4.", function ); goto on_error; } if( date_time_value_string_size != 3 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 4.", function ); goto on_error; } if( libewf_utf8_string_minutes_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes value.", function ); goto on_error; } /* Set the seconds */ if( libfvalue_split_utf8_string_get_segment_by_index( date_time_values, 5, &date_time_value_string, &date_time_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve date time value string: 5.", function ); goto on_error; } if( date_time_value_string_size != 3 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date time value string size: 5.", function ); goto on_error; } if( libewf_utf8_string_seconds_copy_to_time_elements( date_time_value_string, date_time_value_string_size, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds value.", function ); goto on_error; } /* Set to ignore the daylight saving time */ time_elements.tm_isdst = -1; if( libfvalue_split_utf8_string_free( &date_time_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split date time elements.", function ); goto on_error; } /* Create a timestamp */ *timestamp = libewf_date_time_mktime( &time_elements ); if( *timestamp == (time_t) -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create timestamp.", function ); goto on_error; } return( 1 ); on_error: if( date_time_values != NULL ) { libfvalue_split_utf8_string_free( &date_time_values, NULL ); } return( -1 ); } /* Copies an UTF-8 encoded string of a day of week from time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_day_of_week_copy_from_time_elements( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, struct tm *time_elements, libcerror_error_t **error ) { const char *day_of_week = NULL; static char *function = "libewf_utf8_string_day_of_week_copy_from_time_elements"; size_t string_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } if( ( *utf8_string_index + 3 ) >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( ( time_elements->tm_wday < 0 ) || ( time_elements->tm_wday > 6 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of week.", function ); return( -1 ); } string_index = *utf8_string_index; switch( time_elements->tm_wday ) { case 0: day_of_week = "Sun"; break; case 1: day_of_week = "Mon"; break; case 2: day_of_week = "Tue"; break; case 3: day_of_week = "Wed"; break; case 4: day_of_week = "Thu"; break; case 5: day_of_week = "Fri"; break; case 6: day_of_week = "Sat"; break; } utf8_string[ string_index++ ] = (uint8_t) day_of_week[ 0 ]; utf8_string[ string_index++ ] = (uint8_t) day_of_week[ 1 ]; utf8_string[ string_index++ ] = (uint8_t) day_of_week[ 2 ]; *utf8_string_index = string_index; return( 1 ); } /* Copies an UTF-8 encoded string of a day of week to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_day_of_week_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_day_of_week_copy_to_time_elements"; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( narrow_string_compare( utf8_string, "Sun", 3 ) == 0 ) { time_elements->tm_wday = 0; } else if( narrow_string_compare( utf8_string, "Mon", 3 ) == 0 ) { time_elements->tm_wday = 1; } else if( narrow_string_compare( utf8_string, "Tue", 3 ) == 0 ) { time_elements->tm_wday = 2; } else if( narrow_string_compare( utf8_string, "Wed", 3 ) == 0 ) { time_elements->tm_wday = 3; } else if( narrow_string_compare( utf8_string, "Thu", 3 ) == 0 ) { time_elements->tm_wday = 4; } else if( narrow_string_compare( utf8_string, "Fri", 3 ) == 0 ) { time_elements->tm_wday = 5; } else if( narrow_string_compare( utf8_string, "Sat", 3 ) == 0 ) { time_elements->tm_wday = 6; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of week value.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 encoded string of a day of the month to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_day_of_month_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_day_of_month_copy_to_time_elements"; uint64_t value_64bit = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libfvalue_utf8_string_copy_to_integer( utf8_string, utf8_string_size, &value_64bit, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to UTF-8 string to 8-bit value.", function ); return( -1 ); } if( ( value_64bit < 1 ) || ( value_64bit >= 32 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of the month value.", function ); return( -1 ); } time_elements->tm_mday = (int) value_64bit; return( 1 ); } /* Copies an UTF-8 encoded string of a month from time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_month_copy_from_time_elements( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, struct tm *time_elements, libcerror_error_t **error ) { const char *month = NULL; static char *function = "libewf_utf8_string_month_copy_from_time_elements"; size_t string_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } if( ( *utf8_string_index + 3 ) >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( ( time_elements->tm_mon < 0 ) || ( time_elements->tm_mon >= 12 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month.", function ); return( -1 ); } string_index = *utf8_string_index; switch( time_elements->tm_mon ) { case 0: month = "Jan"; break; case 1: month = "Feb"; break; case 2: month = "Mar"; break; case 3: month = "Apr"; break; case 4: month = "May"; break; case 5: month = "Jun"; break; case 6: month = "Jul"; break; case 7: month = "Aug"; break; case 8: month = "Sep"; break; case 9: month = "Oct"; break; case 10: month = "Nov"; break; case 11: month = "Dec"; break; } utf8_string[ string_index++ ] = (uint8_t) month[ 0 ]; utf8_string[ string_index++ ] = (uint8_t) month[ 1 ]; utf8_string[ string_index++ ] = (uint8_t) month[ 2 ]; *utf8_string_index = string_index; return( 1 ); } /* Copies an UTF-8 encoded string of a month to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_month_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_month_copy_to_time_elements"; uint64_t value_64bit = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( ( utf8_string[ 0 ] >= (uint8_t) '0' ) && ( utf8_string[ 0 ] <= (uint8_t) '9' ) ) { if( libfvalue_utf8_string_copy_to_integer( utf8_string, utf8_string_size, &value_64bit, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to UTF-8 string to 16-bit value.", function ); return( -1 ); } if( ( value_64bit < 1 ) || ( value_64bit >= 13 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month value.", function ); return( -1 ); } time_elements->tm_mon = (int) ( value_64bit - 1 ); } else { if( utf8_string_size < 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( narrow_string_compare( utf8_string, "Jan", 3 ) == 0 ) { time_elements->tm_mon = 0; } else if( narrow_string_compare( utf8_string, "Feb", 3 ) == 0 ) { time_elements->tm_mon = 1; } else if( narrow_string_compare( utf8_string, "Mar", 3 ) == 0 ) { time_elements->tm_mon = 2; } else if( narrow_string_compare( utf8_string, "Apr", 3 ) == 0 ) { time_elements->tm_mon = 3; } else if( narrow_string_compare( utf8_string, "May", 3 ) == 0 ) { time_elements->tm_mon = 4; } else if( narrow_string_compare( utf8_string, "Jun", 3 ) == 0 ) { time_elements->tm_mon = 5; } else if( narrow_string_compare( utf8_string, "Jul", 3 ) == 0 ) { time_elements->tm_mon = 6; } else if( narrow_string_compare( utf8_string, "Aug", 3 ) == 0 ) { time_elements->tm_mon = 7; } else if( narrow_string_compare( utf8_string, "Sep", 3 ) == 0 ) { time_elements->tm_mon = 8; } else if( narrow_string_compare( utf8_string, "Oct", 3 ) == 0 ) { time_elements->tm_mon = 9; } else if( narrow_string_compare( utf8_string, "Nov", 3 ) == 0 ) { time_elements->tm_mon = 10; } else if( narrow_string_compare( utf8_string, "Dec", 3 ) == 0 ) { time_elements->tm_mon = 11; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month value.", function ); return( -1 ); } } return( 1 ); } /* Copies an UTF-8 encoded string of a year to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_year_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_year_copy_to_time_elements"; uint64_t value_64bit = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 5 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libfvalue_utf8_string_copy_to_integer( utf8_string, utf8_string_size, &value_64bit, 32, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to copy UTF-8 string to 32-bit value.", function ); return( -1 ); } if( ( value_64bit < 1900 ) || ( value_64bit >= 11900 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported year value.", function ); return( -1 ); } time_elements->tm_year = (int)( value_64bit - 1900 ); return( 1 ); } /* Copies an UTF-8 encoded string of a time value in the format (HH:MM:SS) from time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_time_copy_from_time_elements( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_time_copy_from_time_elements"; size_t string_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } if( ( *utf8_string_index + 8 ) >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( ( time_elements->tm_hour < 0 ) || ( time_elements->tm_hour > 23 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported hours.", function ); return( -1 ); } if( ( time_elements->tm_min < 0 ) || ( time_elements->tm_min > 59 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported minutes.", function ); return( -1 ); } /* Note a value of 60 is used for a leap-second */ if( ( time_elements->tm_sec < 0 ) || ( time_elements->tm_sec > 60 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported seconds.", function ); return( -1 ); } string_index = *utf8_string_index; if( time_elements->tm_hour < 10 ) { utf8_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &string_index, (uint64_t) time_elements->tm_hour, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours to UTF-8 string.", function ); return( -1 ); } utf8_string[ string_index - 1 ] = (uint8_t) ':'; if( time_elements->tm_min < 10 ) { utf8_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &string_index, (uint64_t) time_elements->tm_min, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes to UTF-8 string.", function ); return( -1 ); } utf8_string[ string_index - 1 ] = (uint8_t) ':'; if( time_elements->tm_sec < 10 ) { utf8_string[ string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &string_index, (uint64_t) time_elements->tm_sec, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds to UTF-8 string.", function ); return( -1 ); } *utf8_string_index = string_index - 1; return( 1 ); } /* Copies an UTF-8 encoded string of hours to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_hours_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_hours_copy_to_time_elements"; uint64_t value_64bit = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libfvalue_utf8_string_copy_to_integer( utf8_string, utf8_string_size, &value_64bit, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to UTF-8 string to 8-bit value.", function ); return( -1 ); } if( value_64bit >= 24 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported hours value.", function ); return( -1 ); } time_elements->tm_hour = (int) value_64bit; return( 1 ); } /* Copies an UTF-8 encoded string of minutes to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_minutes_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_minutes_copy_to_time_elements"; uint64_t value_64bit = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libfvalue_utf8_string_copy_to_integer( utf8_string, utf8_string_size, &value_64bit, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to UTF-8 string to 8-bit value.", function ); return( -1 ); } if( value_64bit >= 60 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported minutes value.", function ); return( -1 ); } time_elements->tm_min = (int) value_64bit; return( 1 ); } /* Copies an UTF-8 encoded string of seconds to time elements * Returns 1 if successful or -1 on error */ int libewf_utf8_string_seconds_copy_to_time_elements( uint8_t *utf8_string, size_t utf8_string_size, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf8_string_seconds_copy_to_time_elements"; uint64_t value_64bit = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( utf8_string_size < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libfvalue_utf8_string_copy_to_integer( utf8_string, utf8_string_size, &value_64bit, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to UTF-8 string to 8-bit value.", function ); return( -1 ); } if( value_64bit >= 60 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported seconds value.", function ); return( -1 ); } time_elements->tm_sec = (int) value_64bit; return( 1 ); } /* Copies an UTF-16 encoded string of a day of week from time elements * Returns 1 if successful or -1 on error */ int libewf_utf16_string_day_of_week_copy_from_time_elements( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, struct tm *time_elements, libcerror_error_t **error ) { const char *day_of_week = NULL; static char *function = "libewf_utf16_string_day_of_week_copy_from_time_elements"; size_t string_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } if( ( *utf16_string_index + 3 ) >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( ( time_elements->tm_wday < 0 ) || ( time_elements->tm_wday > 6 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of week.", function ); return( -1 ); } string_index = *utf16_string_index; switch( time_elements->tm_wday ) { case 0: day_of_week = "Sun"; break; case 1: day_of_week = "Mon"; break; case 2: day_of_week = "Tue"; break; case 3: day_of_week = "Wed"; break; case 4: day_of_week = "Thu"; break; case 5: day_of_week = "Fri"; break; case 6: day_of_week = "Sat"; break; } utf16_string[ string_index++ ] = (uint16_t) day_of_week[ 0 ]; utf16_string[ string_index++ ] = (uint16_t) day_of_week[ 1 ]; utf16_string[ string_index++ ] = (uint16_t) day_of_week[ 2 ]; *utf16_string_index = string_index; return( 1 ); } /* Copies an UTF-16 encoded string of a month from time elements * Returns 1 if successful or -1 on error */ int libewf_utf16_string_month_copy_from_time_elements( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, struct tm *time_elements, libcerror_error_t **error ) { const char *month = NULL; static char *function = "libewf_utf16_string_month_copy_from_time_elements"; size_t string_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } if( ( *utf16_string_index + 3 ) >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( ( time_elements->tm_mon < 0 ) || ( time_elements->tm_mon > 11 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month.", function ); return( -1 ); } string_index = *utf16_string_index; switch( time_elements->tm_mon ) { case 0: month = "Jan"; break; case 1: month = "Feb"; break; case 2: month = "Mar"; break; case 3: month = "Apr"; break; case 4: month = "May"; break; case 5: month = "Jun"; break; case 6: month = "Jul"; break; case 7: month = "Aug"; break; case 8: month = "Sep"; break; case 9: month = "Oct"; break; case 10: month = "Nov"; break; case 11: month = "Dec"; break; } utf16_string[ string_index++ ] = (uint16_t) month[ 0 ]; utf16_string[ string_index++ ] = (uint16_t) month[ 1 ]; utf16_string[ string_index++ ] = (uint16_t) month[ 2 ]; *utf16_string_index = string_index; return( 1 ); } /* Copies an UTF-16 encoded string of a time value in the format (HH:MM:SS) from time elements * Returns 1 if successful or -1 on error */ int libewf_utf16_string_time_copy_from_time_elements( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, struct tm *time_elements, libcerror_error_t **error ) { static char *function = "libewf_utf16_string_time_copy_from_time_elements"; size_t string_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } if( ( *utf16_string_index + 8 ) >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( time_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time elements.", function ); return( -1 ); } if( ( time_elements->tm_hour < 0 ) || ( time_elements->tm_hour > 23 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported hours.", function ); return( -1 ); } if( ( time_elements->tm_min < 0 ) || ( time_elements->tm_min > 59 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported minutes.", function ); return( -1 ); } /* Note a value of 60 is used for a leap-second */ if( ( time_elements->tm_sec < 0 ) || ( time_elements->tm_sec > 60 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported seconds.", function ); return( -1 ); } string_index = *utf16_string_index; if( time_elements->tm_hour < 10 ) { utf16_string[ string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &string_index, (uint64_t) time_elements->tm_hour, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hours to UTF-16 string.", function ); return( -1 ); } utf16_string[ string_index - 1 ] = (uint16_t) ':'; if( time_elements->tm_min < 10 ) { utf16_string[ string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &string_index, (uint64_t) time_elements->tm_min, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy minutes to UTF-16 string.", function ); return( -1 ); } utf16_string[ string_index - 1 ] = (uint16_t) ':'; if( time_elements->tm_sec < 10 ) { utf16_string[ string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &string_index, (uint64_t) time_elements->tm_sec, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy seconds to UTF-16 string.", function ); return( -1 ); } *utf16_string_index = string_index - 1; return( 1 ); } /* Copies a date time values string to a string in a specific formatted UTF-8 encoded date and time string * The string must be at least 32 characters of size this includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_date_time_values_copy_to_utf8_string( const uint8_t *date_time_values_string, size_t date_time_values_string_size, int date_format, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { struct tm time_elements; static char *function = "libewf_date_time_values_copy_to_utf8_string"; size_t date_time_values_string_index = 0; size_t utf8_string_index = 0; time_t timestamp = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( date_time_values_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid date time values string size.", function ); return( -1 ); } if( ( date_format != LIBEWF_DATE_FORMAT_CTIME ) && ( date_format != LIBEWF_DATE_FORMAT_DAYMONTH ) && ( date_format != LIBEWF_DATE_FORMAT_MONTHDAY ) && ( date_format != LIBEWF_DATE_FORMAT_ISO8601 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date format.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libewf_date_time_values_copy_to_timestamp( date_time_values_string, date_time_values_string_size, ×tamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create timestamp.", function ); return( -1 ); } if( libewf_date_time_localtime( ×tamp, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create time elements.", function ); return( -1 ); } if( ( time_elements.tm_year + 1900 ) > 10000 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported year value.", function ); return( -1 ); } if( date_format == LIBEWF_DATE_FORMAT_CTIME ) { if( utf8_string_size < 25 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( libewf_utf8_string_day_of_week_copy_from_time_elements( utf8_string, utf8_string_size, &utf8_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of week to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index++ ] = (uint8_t) ' '; if( libewf_utf8_string_month_copy_from_time_elements( utf8_string, utf8_string_size, &utf8_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index++ ] = (uint8_t) ' '; if( time_elements.tm_mday < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) ' '; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) ' '; if( libewf_utf8_string_time_copy_from_time_elements( utf8_string, utf8_string_size, &utf8_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy time to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index++ ] = (uint8_t) ' '; if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to UTF-8 string.", function ); return( -1 ); } utf8_string_index--; } else if( ( date_format == LIBEWF_DATE_FORMAT_MONTHDAY ) || ( date_format == LIBEWF_DATE_FORMAT_DAYMONTH ) || ( date_format == LIBEWF_DATE_FORMAT_ISO8601 ) ) { if( ( time_elements.tm_mon < 0 ) || ( time_elements.tm_mon > 11 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month.", function ); return( -1 ); } if( ( time_elements.tm_mday < 1 ) || ( time_elements.tm_mday > 31 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of month.", function ); return( -1 ); } if( ( date_format == LIBEWF_DATE_FORMAT_MONTHDAY ) || ( date_format == LIBEWF_DATE_FORMAT_DAYMONTH ) ) { if( date_format == LIBEWF_DATE_FORMAT_MONTHDAY ) { if( ( time_elements.tm_mon + 1 ) < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) '/'; if( time_elements.tm_mday < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-8 string.", function ); return( -1 ); } utf8_string_index--; } else if( date_format == LIBEWF_DATE_FORMAT_DAYMONTH ) { if( time_elements.tm_mday < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) '/'; if( ( time_elements.tm_mon + 1 ) < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-8 string.", function ); return( -1 ); } utf8_string_index--; } utf8_string[ utf8_string_index++ ] = (uint8_t) '/'; if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) ' '; } else if( date_format == LIBEWF_DATE_FORMAT_ISO8601 ) { if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) '-'; if( ( time_elements.tm_mon + 1 ) < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) '-'; if( time_elements.tm_mday < 10 ) { utf8_string[ utf8_string_index++ ] = (uint8_t) '0'; } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-8 string.", function ); return( -1 ); } utf8_string[ utf8_string_index - 1 ] = (uint8_t) 'T'; } if( libewf_utf8_string_time_copy_from_time_elements( utf8_string, utf8_string_size, &utf8_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy time to UTF-8 string.", function ); return( -1 ); } } if( date_format == LIBEWF_DATE_FORMAT_ISO8601 ) { if( date_time_values_string_size >= 28 ) { if( ( utf8_string_index + 7 ) >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( ( date_time_values_string[ 20 ] == (uint8_t ) '+' ) || ( date_time_values_string[ 20 ] == (uint8_t ) '-' ) ) { utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 20 ]; utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 21 ]; utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 22 ]; utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 23 ]; utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 24 ]; utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 25 ]; utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ 26 ]; } } } else if( date_time_values_string_size > 20 ) { if( ( utf8_string_index + ( date_time_values_string_size - 20 ) ) >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } for( date_time_values_string_index = 19; date_time_values_string_index < date_time_values_string_size - 1; date_time_values_string_index++ ) { utf8_string[ utf8_string_index++ ] = (uint8_t) date_time_values_string[ date_time_values_string_index ]; } } if( utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ utf8_string_index ] = 0; return( 1 ); } /* Copies a date time values string to a string in a specific formatted UTF-16 encoded date and time string * The string must be at least 32 characters of size this includes the end of string character * Returns 1 if successful or -1 on error */ int libewf_date_time_values_copy_to_utf16_string( const uint8_t *date_time_values_string, size_t date_time_values_string_size, int date_format, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { struct tm time_elements; static char *function = "libewf_date_time_values_copy_to_utf16_string"; size_t date_time_values_string_index = 0; size_t utf16_string_index = 0; time_t timestamp = 0; if( date_time_values_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values string.", function ); return( -1 ); } if( date_time_values_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid date time values string size.", function ); return( -1 ); } if( ( date_format != LIBEWF_DATE_FORMAT_CTIME ) && ( date_format != LIBEWF_DATE_FORMAT_DAYMONTH ) && ( date_format != LIBEWF_DATE_FORMAT_MONTHDAY ) && ( date_format != LIBEWF_DATE_FORMAT_ISO8601 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date format.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( libewf_date_time_values_copy_to_timestamp( date_time_values_string, date_time_values_string_size, ×tamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create timestamp.", function ); return( -1 ); } if( libewf_date_time_localtime( ×tamp, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create time elements.", function ); return( -1 ); } if( ( time_elements.tm_year + 1900 ) > 10000 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported year value.", function ); return( -1 ); } if( date_format == LIBEWF_DATE_FORMAT_CTIME ) { if( utf16_string_size < 25 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( libewf_utf16_string_day_of_week_copy_from_time_elements( utf16_string, utf16_string_size, &utf16_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of week to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index++ ] = (uint16_t) ' '; if( libewf_utf16_string_month_copy_from_time_elements( utf16_string, utf16_string_size, &utf16_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index++ ] = (uint16_t) ' '; if( time_elements.tm_mday < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) ' '; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) ' '; if( libewf_utf16_string_time_copy_from_time_elements( utf16_string, utf16_string_size, &utf16_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy time to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index++ ] = (uint16_t) ' '; if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to UTF-16 string.", function ); return( -1 ); } utf16_string_index--; } else if( ( date_format == LIBEWF_DATE_FORMAT_MONTHDAY ) || ( date_format == LIBEWF_DATE_FORMAT_DAYMONTH ) || ( date_format == LIBEWF_DATE_FORMAT_ISO8601 ) ) { if( ( time_elements.tm_mon < 0 ) || ( time_elements.tm_mon > 11 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported month.", function ); return( -1 ); } if( ( time_elements.tm_mday < 1 ) || ( time_elements.tm_mday > 31 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported day of month.", function ); return( -1 ); } if( ( date_format == LIBEWF_DATE_FORMAT_MONTHDAY ) || ( date_format == LIBEWF_DATE_FORMAT_DAYMONTH ) ) { if( date_format == LIBEWF_DATE_FORMAT_MONTHDAY ) { if( ( time_elements.tm_mon + 1 ) < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) '/'; if( time_elements.tm_mday < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint16_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-16 string.", function ); return( -1 ); } utf16_string_index--; } else if( date_format == LIBEWF_DATE_FORMAT_DAYMONTH ) { if( time_elements.tm_mday < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) '/'; if( ( time_elements.tm_mon + 1 ) < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-16 string.", function ); return( -1 ); } } utf16_string[ utf16_string_index - 1 ] = (uint16_t) '/'; if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) ' '; } else if( date_format == LIBEWF_DATE_FORMAT_ISO8601 ) { if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_year + 1900, 16, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy year to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) '-'; if( ( time_elements.tm_mon + 1 ) < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_mon + 1, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy month to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) '-'; if( time_elements.tm_mday < 10 ) { utf16_string[ utf16_string_index++ ] = (uint16_t) '0'; } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, (uint64_t) time_elements.tm_mday, 8, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy day of month to UTF-16 string.", function ); return( -1 ); } utf16_string[ utf16_string_index - 1 ] = (uint16_t) 'T'; } if( libewf_utf16_string_time_copy_from_time_elements( utf16_string, utf16_string_size, &utf16_string_index, &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy time to UTF-16 string.", function ); return( -1 ); } } if( date_format == LIBEWF_DATE_FORMAT_ISO8601 ) { if( date_time_values_string_size >= 28 ) { if( ( utf16_string_index + 7 ) >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } if( ( date_time_values_string[ 20 ] == (uint16_t ) '+' ) || ( date_time_values_string[ 20 ] == (uint16_t ) '-' ) ) { utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 20 ]; utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 21 ]; utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 22 ]; utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 23 ]; utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 24 ]; utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 25 ]; utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ 26 ]; } } } else if( date_time_values_string_size > 20 ) { if( ( utf16_string_index + ( date_time_values_string_size - 20 ) ) >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } for( date_time_values_string_index = 19; date_time_values_string_index < date_time_values_string_size - 1; date_time_values_string_index++ ) { utf16_string[ utf16_string_index++ ] = (uint16_t) date_time_values_string[ date_time_values_string_index ]; } } if( utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ utf16_string_index ] = 0; return( 1 ); } libewf-20140807/libewf/libewf_single_file_tree.c0000664000175000017500000002027213421013625023574 0ustar00lordyestalordyesta00000000000000/* * Single file tree functions * * 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 . */ #include #include #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libuna.h" #include "libewf_single_file_entry.h" #include "libewf_single_file_tree.h" /* Retrieves the single file entry sub node for the specific UTF-8 formatted name * Returns 1 if successful, 0 if no such sub single file entry or -1 on error */ int libewf_single_file_tree_get_sub_node_by_utf8_name( libcdata_tree_node_t *node, const uint8_t *utf8_string, size_t utf8_string_length, libcdata_tree_node_t **sub_node, libewf_single_file_entry_t **sub_single_file_entry, libcerror_error_t **error ) { static char *function = "libewf_single_file_tree_get_sub_node_by_utf8_name"; int number_of_sub_nodes = 0; int result = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node.", function ); return( -1 ); } if( sub_single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub single file entry.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); goto on_error; } if( libcdata_tree_node_get_sub_node_by_index( node, 0, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first sub node.", function ); goto on_error; } for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_tree_node_get_value( *sub_node, (intptr_t **) sub_single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from sub node: %d.", function, sub_node_index ); goto on_error; } if( *sub_single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub single file entry: %d.", function, sub_node_index ); goto on_error; } if( ( *sub_single_file_entry )->name != NULL ) { result = libuna_utf8_string_compare_with_utf8_stream( utf8_string, utf8_string_length, ( *sub_single_file_entry )->name, (size_t) ( *sub_single_file_entry )->name_size, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to compare UTF-8 string.", function ); return( -1 ); } else if( result == LIBUNA_COMPARE_EQUAL ) { break; } if( libcdata_tree_node_get_next_node( *sub_node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node from sub node: %d.", function, sub_node_index ); goto on_error; } } if( sub_node_index >= number_of_sub_nodes ) { *sub_node = NULL; *sub_single_file_entry = NULL; return( 0 ); } return( 1 ); on_error: *sub_node = NULL; *sub_single_file_entry = NULL; return( -1 ); } /* Retrieves the single file entry sub node for the specific UTF-16 formatted name * Returns 1 if successful, 0 if no such sub single file entry or -1 on error */ int libewf_single_file_tree_get_sub_node_by_utf16_name( libcdata_tree_node_t *node, const uint16_t *utf16_string, size_t utf16_string_length, libcdata_tree_node_t **sub_node, libewf_single_file_entry_t **sub_single_file_entry, libcerror_error_t **error ) { static char *function = "libewf_single_file_tree_get_sub_node_by_utf16_name"; int number_of_sub_nodes = 0; int result = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node.", function ); return( -1 ); } if( sub_single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub single file entry.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); goto on_error; } if( libcdata_tree_node_get_sub_node_by_index( node, 0, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first sub node.", function ); goto on_error; } for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_tree_node_get_value( *sub_node, (intptr_t **) sub_single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from sub node: %d.", function, sub_node_index ); goto on_error; } if( *sub_single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub single file entry: %d.", function, sub_node_index ); goto on_error; } if( ( *sub_single_file_entry )->name != NULL ) { result = libuna_utf16_string_compare_with_utf8_stream( utf16_string, utf16_string_length, ( *sub_single_file_entry )->name, (size_t) ( *sub_single_file_entry )->name_size, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to compare UTF-16 string.", function ); return( -1 ); } else if( result == LIBUNA_COMPARE_EQUAL ) { break; } if( libcdata_tree_node_get_next_node( *sub_node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node from sub node: %d.", function, sub_node_index ); goto on_error; } } if( sub_node_index >= number_of_sub_nodes ) { *sub_node = NULL; *sub_single_file_entry = NULL; return( 0 ); } return( 1 ); on_error: *sub_node = NULL; *sub_single_file_entry = NULL; return( -1 ); } libewf-20140807/libewf/libewf_header_sections.h0000644000175000017500000000476213421013624023444 0ustar00lordyestalordyesta00000000000000/* * Header sections functions * * 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_HEADER_SECTIONS_H ) #define _LIBEWF_HEADER_SECTIONS_H #include #include #include "libewf_io_handle.h" #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_header_sections libewf_header_sections_t; struct libewf_header_sections { /* The stored header */ uint8_t *header; /* The size of the stored header */ size_t header_size; /* The stored header2 */ uint8_t *header2; /* The size of the stored header2 */ size_t header2_size; /* The stored xheader */ uint8_t *xheader; /* The size of the stored xheader */ size_t xheader_size; /* Value to indicate the number of header sections found */ uint8_t number_of_header_sections; }; int libewf_header_sections_initialize( libewf_header_sections_t **header_sections, libcerror_error_t **error ); int libewf_header_sections_free( libewf_header_sections_t **header_sections, libcerror_error_t **error ); int libewf_header_sections_clone( libewf_header_sections_t **destination_header_sections, libewf_header_sections_t *source_header_sections, libcerror_error_t **error ); int libewf_header_sections_generate( libewf_header_sections_t *header_sections, libfvalue_table_t *header_values, time_t timestamp, int8_t compression_level, uint8_t format, int header_codepage, libcerror_error_t **error ); int libewf_header_sections_parse( libewf_header_sections_t *header_sections, libewf_io_handle_t *io_handle, libfvalue_table_t *header_values, uint8_t *format, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_libclocale.h0000664000175000017500000000265713440663047022414 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2006-2018, 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_LIBCLOCALE_H ) #define _LIBEWF_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBEWF_LIBCLOCALE_H ) */ libewf-20140807/libewf/libewf_chunk_data.c0000664000175000017500000003340513421013623022376 0ustar00lordyestalordyesta00000000000000/* * Chunk data functions * * 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 . */ #include #include #include #include #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_checksum.h" #include "libewf_chunk_data.h" #include "libewf_compression.h" #include "libewf_definitions.h" #include "libewf_empty_block.h" #include "ewf_definitions.h" /* Initialize the chunk data * Returns 1 if successful or -1 on error */ int libewf_chunk_data_initialize( libewf_chunk_data_t **chunk_data, size_t data_size, libcerror_error_t **error ) { static char *function = "libewf_chunk_data_initialize"; if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk data.", function ); return( -1 ); } if( *chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid chunk data value already set.", function ); return( -1 ); } if( data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } *chunk_data = memory_allocate_structure( libewf_chunk_data_t ); if( *chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create chunk data.", function ); goto on_error; } if( memory_set( *chunk_data, 0, sizeof( libewf_chunk_data_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear chunk data.", function ); goto on_error; } ( *chunk_data )->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * data_size ); if( ( *chunk_data )->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); goto on_error; } ( *chunk_data )->allocated_data_size = data_size; return( 1 ); on_error: if( *chunk_data != NULL ) { memory_free( *chunk_data ); *chunk_data = NULL; } return( -1 ); } /* Frees the chunk data including elements * Returns 1 if successful or -1 on error */ int libewf_chunk_data_free( libewf_chunk_data_t **chunk_data, libcerror_error_t **error ) { static char *function = "libewf_chunk_data_free"; if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk data.", function ); return( -1 ); } if( *chunk_data != NULL ) { if( ( *chunk_data )->data != NULL ) { memory_free( ( *chunk_data )->data ); } if( ( *chunk_data )->compressed_data != NULL ) { memory_free( ( *chunk_data )->compressed_data ); } memory_free( *chunk_data ); *chunk_data = NULL; } return( 1 ); } /* Packs the chunk data * This function either adds the checksum or compresses the chunk data * Returns 1 if successful or -1 on error */ int libewf_chunk_data_pack( libewf_chunk_data_t *chunk_data, int8_t compression_level, uint8_t compression_flags, uint8_t ewf_format, size32_t chunk_size, const uint8_t *compressed_zero_byte_empty_block, size_t compressed_zero_byte_empty_block_size, libcerror_error_t **error ) { static char *function = "libewf_chunk_data_pack"; void *reallocation = NULL; uint32_t calculated_checksum = 0; int is_empty_zero_block = 0; int result = 0; if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk data.", function ); return( -1 ); } if( chunk_data->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid chunk data - missing data.", function ); return( -1 ); } if( chunk_data->is_packed != 0 ) { return( 1 ); } chunk_data->is_compressed = 0; /* Skip the empty block check only if the compression is none and * the empty block compression flag is not set. */ if( ( compression_level != EWF_COMPRESSION_NONE ) || ( ( compression_flags & LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK ) != 0 ) ) { #if defined( TEST_EMPTY_BLOCK_MEMCMP ) if( memory_compare( chunk_data->data, &( chunk_data->data[ 1 ] ) chunk_data->data_size - 1 ) == 0 ) #else result = libewf_empty_block_test( chunk_data->data, chunk_data->data_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunk data is empty an empty block.", function ); return( -1 ); } else if( result == 1 ) #endif { if( ( chunk_data->data )[ 0 ] == 0 ) { is_empty_zero_block = 1; } else if( compression_level == EWF_COMPRESSION_NONE ) { compression_level = EWF_COMPRESSION_DEFAULT; } } } if( ( ewf_format == EWF_FORMAT_S01 ) || ( compression_level != EWF_COMPRESSION_NONE ) || ( is_empty_zero_block != 0 ) ) { chunk_data->compressed_data_size = 2 * chunk_data->data_size; chunk_data->compressed_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * chunk_data->compressed_data_size ); if( chunk_data->compressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create compressed data.", function ); return( -1 ); } if( ( is_empty_zero_block != 0 ) && ( chunk_data->data_size == (size_t) chunk_size ) && ( compressed_zero_byte_empty_block != NULL ) ) { if( memory_copy( chunk_data->compressed_data, compressed_zero_byte_empty_block, compressed_zero_byte_empty_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy compressed zero byte empty block to compressed chunk buffer.", function ); return( -1 ); } chunk_data->compressed_data_size = compressed_zero_byte_empty_block_size; } else { result = libewf_compress_data( chunk_data->compressed_data, &( chunk_data->compressed_data_size ), compression_level, chunk_data->data, chunk_data->data_size, error ); /* Check if the compressed buffer was too small * and a new compressed data size buffer was passed back */ if( ( result == -1 ) && ( chunk_data->compressed_data_size > 0 ) ) { libcerror_error_free( error ); reallocation = memory_reallocate( chunk_data->compressed_data, sizeof( uint8_t ) * chunk_data->compressed_data_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize compressed data.", function ); return( -1 ); } chunk_data->compressed_data = (uint8_t *) reallocation; result = libewf_compress_data( chunk_data->compressed_data, &( chunk_data->compressed_data_size ), compression_level, chunk_data->data, chunk_data->data_size, error ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED, "%s: unable to compress chunk data.", function ); return( -1 ); } } if( ( ewf_format == EWF_FORMAT_S01 ) || ( chunk_data->compressed_data_size < chunk_data->data_size ) ) { memory_free( chunk_data->data ); chunk_data->data = chunk_data->compressed_data; chunk_data->data_size = chunk_data->compressed_data_size; chunk_data->compressed_data = NULL; chunk_data->compressed_data_size = 0; chunk_data->is_compressed = 1; } } if( chunk_data->is_compressed == 0 ) { if( ( chunk_data->data_size + sizeof( uint32_t ) ) > chunk_data->allocated_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: chunk data size value out of bounds.", function ); return( -1 ); } if( libewf_checksum_calculate_adler32( &calculated_checksum, chunk_data->data, chunk_data->data_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } byte_stream_copy_from_uint32_little_endian( &( ( chunk_data->data )[ chunk_data->data_size ] ), calculated_checksum ); chunk_data->data_size += sizeof( uint32_t ); } chunk_data->is_packed = 1; return( 1 ); } /* Unpacks the chunk data * This function either validates the checksum or decompresses the chunk data * Returns 1 if successful or -1 on error */ int libewf_chunk_data_unpack( libewf_chunk_data_t *chunk_data, size_t chunk_size, libcerror_error_t **error ) { static char *function = "libewf_chunk_data_unpack"; uint32_t calculated_checksum = 0; uint32_t stored_checksum = 0; int result = 0; if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk data.", function ); return( -1 ); } if( chunk_data->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid chunk data - missing data.", function ); return( -1 ); } if( ( chunk_size == 0 ) || ( chunk_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: chunk size value out of bounds.", function ); return( -1 ); } if( chunk_data->is_packed == 0 ) { return( 1 ); } if( chunk_data->is_compressed == 0 ) { if( ( chunk_data->data_size < sizeof( uint32_t ) ) || ( chunk_data->data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: chunk data size value out of bounds.", function ); return( -1 ); } chunk_data->data_size -= sizeof( uint32_t ); byte_stream_copy_to_uint32_little_endian( &( ( chunk_data->data )[ chunk_data->data_size ] ), stored_checksum ); if( libewf_checksum_calculate_adler32( &calculated_checksum, chunk_data->data, chunk_data->data_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk data checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").\n", function, stored_checksum, calculated_checksum ); } #endif chunk_data->is_corrupt = 1; } } else { if( chunk_data->compressed_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid chunk data - compressed data value already set.", function ); return( -1 ); } chunk_data->compressed_data = chunk_data->data; chunk_data->compressed_data_size = chunk_data->data_size; /* Reserve 4 bytes for the checksum */ chunk_data->allocated_data_size = chunk_size + sizeof( uint32_t ); chunk_data->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * chunk_data->allocated_data_size ); if( chunk_data->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); return( -1 ); } chunk_data->data_size = chunk_size; result = libewf_decompress_data( chunk_data->compressed_data, chunk_data->compressed_data_size, chunk_data->data, &( chunk_data->data_size ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_DECOMPRESS_FAILED, "%s: unable to decompress chunk data.", function ); return( -1 ); } else if( result == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unable to decompress chunk data.\n", function ); } #endif chunk_data->is_corrupt = 1; } } chunk_data->is_packed = 0; return( 1 ); } libewf-20140807/libewf/libewf_segment_file_handle.h0000644000175000017500000000331213421013625024250 0ustar00lordyestalordyesta00000000000000/* * Segment file handle functions * * 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_SEGMENT_FILE_HANDLE_H ) #define _LIBEWF_SEGMENT_FILE_HANDLE_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_segment_file_handle libewf_segment_file_handle_t; struct libewf_segment_file_handle { /* The segment file index */ int segment_file_index; }; int libewf_segment_file_handle_initialize( libewf_segment_file_handle_t **segment_file_handle, int file_io_pool_entry, libcerror_error_t **error ); int libewf_segment_file_handle_free( libewf_segment_file_handle_t **segment_file_handle, libcerror_error_t **error ); int libewf_segment_file_handle_clone( libewf_segment_file_handle_t **destination_segment_file_handle, libewf_segment_file_handle_t *source_segment_file_handle, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_definitions.h0000664000175000017500000001642113443455443022632 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * 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_INTERNAL_DEFINITIONS_H ) #define _LIBEWF_INTERNAL_DEFINITIONS_H #include #include #include "libewf_libmfdata.h" /* Define HAVE_LOCAL_LIBEWF for local use of libewf */ #if !defined( HAVE_LOCAL_LIBEWF ) #include #else #define LIBEWF_VERSION 20140807 /* The version string */ #define LIBEWF_VERSION_STRING "20140807" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3-4 not used * bit 5 set to 1 to resume write * bit 6-8 not used */ enum LIBEWF_ACCESS_FLAGS { LIBEWF_ACCESS_FLAG_READ = 0x01, LIBEWF_ACCESS_FLAG_WRITE = 0x02, LIBEWF_ACCESS_FLAG_RESUME = 0x10 }; /* The file access macros */ #define LIBEWF_OPEN_READ ( LIBEWF_ACCESS_FLAG_READ ) #define LIBEWF_OPEN_READ_WRITE ( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE ( LIBEWF_ACCESS_FLAG_WRITE ) #define LIBEWF_OPEN_WRITE_RESUME ( LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ) /* The file formats */ enum LIBEWF_FORMAT { LIBEWF_FORMAT_UNKNOWN = 0x00, LIBEWF_FORMAT_ENCASE1 = 0x01, LIBEWF_FORMAT_ENCASE2 = 0x02, LIBEWF_FORMAT_ENCASE3 = 0x03, LIBEWF_FORMAT_ENCASE4 = 0x04, LIBEWF_FORMAT_ENCASE5 = 0x05, LIBEWF_FORMAT_ENCASE6 = 0x06, LIBEWF_FORMAT_ENCASE7 = 0x07, LIBEWF_FORMAT_SMART = 0x0e, LIBEWF_FORMAT_FTK_IMAGER = 0x0f, LIBEWF_FORMAT_LOGICAL_ENCASE5 = 0x10, LIBEWF_FORMAT_LOGICAL_ENCASE6 = 0x11, LIBEWF_FORMAT_LOGICAL_ENCASE7 = 0x12, LIBEWF_FORMAT_LINEN5 = 0x25, LIBEWF_FORMAT_LINEN6 = 0x26, LIBEWF_FORMAT_LINEN7 = 0x27, /* The format as specified by Andrew Rosen */ LIBEWF_FORMAT_EWF = 0x70, /* Libewf eXtended EWF format */ LIBEWF_FORMAT_EWFX = 0x71 }; /* TODO deprecated remove after a while */ #define LIBEWF_FORMAT_LVF LIBEWF_FORMAT_LOGICAL_ENCASE5 #define LIBEWF_FORMAT_FTK LIBEWF_FORMAT_FTK_IMAGER /* The default segment file size */ #define LIBEWF_DEFAULT_SEGMENT_FILE_SIZE ( 1500 * 1024 * 1024 ) /* The compression methods definitions */ enum LIBEWF_COMPRESSION_METHODS { LIBEWF_COMPRESSION_METHOD_NONE = 0, LIBEWF_COMPRESSION_METHOD_DEFLATE = 1, LIBEWF_COMPRESSION_METHOD_BZIP2 = 2, }; /* The compression level definitions */ enum LIBEWF_COMPRESSION_LEVELS { LIBEWF_COMPRESSION_DEFAULT = -1, LIBEWF_COMPRESSION_NONE = 0, LIBEWF_COMPRESSION_FAST = 1, LIBEWF_COMPRESSION_BEST = 2, }; /* The compression flags * bit 1 set to 1 for empty block compression * detects empty blocks and stored them compressed, the compression * is only done once * bit 2-8 not used */ enum LIBEWF_COMPRESSION_FLAGS { LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION = (uint8_t) 0x01, }; /* TODO deprecated remove after a while */ #define LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION /* The media type definitions */ enum LIBEWF_MEDIA_TYPES { LIBEWF_MEDIA_TYPE_REMOVABLE = 0x00, LIBEWF_MEDIA_TYPE_FIXED = 0x01, LIBEWF_MEDIA_TYPE_OPTICAL = 0x03, LIBEWF_MEDIA_TYPE_SINGLE_FILES = 0x0e, LIBEWF_MEDIA_TYPE_MEMORY = 0x10 }; /* The media flags definitions */ enum LIBEWF_MEDIA_FLAGS { LIBEWF_MEDIA_FLAG_PHYSICAL = 0x02, LIBEWF_MEDIA_FLAG_FASTBLOC = 0x04, LIBEWF_MEDIA_FLAG_TABLEAU = 0x08 }; #if defined( HAVE_V1_API ) /* The volume type definitions */ enum LIBEWF_VOLUME_TYPES { LIBEWF_VOLUME_TYPE_LOGICAL = 0x00, LIBEWF_VOLUME_TYPE_PHYSICAL = 0x01 }; #endif /* The date representation formats */ enum LIBEWF_DATE_FORMATS { LIBEWF_DATE_FORMAT_DAYMONTH = 0x01, LIBEWF_DATE_FORMAT_MONTHDAY = 0x02, LIBEWF_DATE_FORMAT_ISO8601 = 0x03, LIBEWF_DATE_FORMAT_CTIME = 0x04 }; /* The header value compression levels definitions */ #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST "b" /* TODO deprecated remove after a while */ #define LIBEWF_COMPRESSION_LEVEL_NONE "n" #define LIBEWF_COMPRESSION_LEVEL_FAST "f" #define LIBEWF_COMPRESSION_LEVEL_BEST "b" /* The segment file type definitions */ enum LIBEWF_SEGMENT_FILE_TYPES { LIBEWF_SEGMENT_FILE_TYPE_DWF = (int) 'd', LIBEWF_SEGMENT_FILE_TYPE_EWF = (int) 'E', LIBEWF_SEGMENT_FILE_TYPE_LWF = (int) 'L' }; /* The (single) file entry types */ enum LIBEWF_FILE_ENTRY_TYPES { LIBEWF_FILE_ENTRY_TYPE_DIRECTORY = (uint8_t) 'd', LIBEWF_FILE_ENTRY_TYPE_FILE = (uint8_t) 'f' }; #define LIBEWF_FILE_ENTRY_TYPE_FOLDER LIBEWF_FILE_ENTRY_TYPE_DIRECTORY /* The (single) file entry flags */ enum LIBEWF_FILE_ENTRY_FLAGS { LIBEWF_FILE_ENTRY_FLAG_ARCHIVE = 0x00000008UL, LIBEWF_FILE_ENTRY_FLAG_SPARSE_DATA = 0x04000000UL, }; /* The (single) file entry name separator */ #define LIBEWF_SEPARATOR '\\' #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ /* The item flags definitions */ enum LIBEWF_ITEM_FLAGS { /* The file entry tree node is not managed by the item */ LIBEWF_ITEM_FLAG_NON_MANAGED_FILE_ENTRY_TREE_NODE = 0x00, /* The file entry tree node is managed by the item */ LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE = 0x01 }; /* The segment table flags definitions */ enum LIBEWF_SEGMENT_TABLE_FLAGS { /* The segment table is corrupted */ LIBEWF_SEGMENT_TABLE_FLAG_CORRUPTED = 0x01 }; /* The segment file flags definitions */ enum LIBEWF_SEGMENT_FILE_FLAGS { /* The segment file is corrupted */ LIBEWF_SEGMENT_FILE_FLAG_CORRUPTED = 0x01, /* The segment file is open for writing */ LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN = 0x02 }; #if defined( HAVE_DEBUG_OUTPUT ) #define LIBEWF_ITEM_FLAGS_DEFAULT LIBEWF_ITEM_FLAG_MANAGED_FILE_ENTRY_TREE_NODE #else #define LIBEWF_ITEM_FLAGS_DEFAULT LIBEWF_ITEM_FLAG_NON_MANAGED_FILE_ENTRY_TREE_NODE #endif #define LIBEWF_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBEWF_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE /* The chunk data range refers to a delta chunk */ #define LIBEWF_RANGE_FLAG_IS_DELTA LIBMFDATA_RANGE_FLAG_USER_DEFINED_4 /* The chunk data range is tainted (possibly corrupted) */ #define LIBEWF_RANGE_FLAG_IS_TAINTED LIBMFDATA_RANGE_FLAG_USER_DEFINED_5 /* The chunk data range is corrupted */ #define LIBEWF_RANGE_FLAG_IS_CORRUPTED LIBMFDATA_RANGE_FLAG_USER_DEFINED_6 #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define LIBEWF_2_TIB 0x20000000000UL #else #define LIBEWF_2_TIB 0x20000000000ULL #endif #endif libewf-20140807/libewf/libewf_codepage.h0000664000175000017500000000501513440663046022060 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2006-2018, 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_INTERNAL_CODEPAGE_H ) #define _LIBEWF_INTERNAL_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBEWF ) #include /* Define HAVE_LOCAL_LIBEWF for local use of libewf * The definitions in are copied here * for local use of libewf */ #else /* The codepage definitions */ enum LIBEWF_CODEPAGES { LIBEWF_CODEPAGE_ASCII = 20127, LIBEWF_CODEPAGE_ISO_8859_1 = 28591, LIBEWF_CODEPAGE_ISO_8859_2 = 28592, LIBEWF_CODEPAGE_ISO_8859_3 = 28593, LIBEWF_CODEPAGE_ISO_8859_4 = 28594, LIBEWF_CODEPAGE_ISO_8859_5 = 28595, LIBEWF_CODEPAGE_ISO_8859_6 = 28596, LIBEWF_CODEPAGE_ISO_8859_7 = 28597, LIBEWF_CODEPAGE_ISO_8859_8 = 28598, LIBEWF_CODEPAGE_ISO_8859_9 = 28599, LIBEWF_CODEPAGE_ISO_8859_10 = 28600, LIBEWF_CODEPAGE_ISO_8859_11 = 28601, LIBEWF_CODEPAGE_ISO_8859_13 = 28603, LIBEWF_CODEPAGE_ISO_8859_14 = 28604, LIBEWF_CODEPAGE_ISO_8859_15 = 28605, LIBEWF_CODEPAGE_ISO_8859_16 = 28606, LIBEWF_CODEPAGE_KOI8_R = 20866, LIBEWF_CODEPAGE_KOI8_U = 21866, LIBEWF_CODEPAGE_WINDOWS_874 = 874, LIBEWF_CODEPAGE_WINDOWS_932 = 932, LIBEWF_CODEPAGE_WINDOWS_936 = 936, LIBEWF_CODEPAGE_WINDOWS_949 = 949, LIBEWF_CODEPAGE_WINDOWS_950 = 950, LIBEWF_CODEPAGE_WINDOWS_1250 = 1250, LIBEWF_CODEPAGE_WINDOWS_1251 = 1251, LIBEWF_CODEPAGE_WINDOWS_1252 = 1252, LIBEWF_CODEPAGE_WINDOWS_1253 = 1253, LIBEWF_CODEPAGE_WINDOWS_1254 = 1254, LIBEWF_CODEPAGE_WINDOWS_1255 = 1255, LIBEWF_CODEPAGE_WINDOWS_1256 = 1256, LIBEWF_CODEPAGE_WINDOWS_1257 = 1257, LIBEWF_CODEPAGE_WINDOWS_1258 = 1258 }; #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_INTERNAL_CODEPAGE_H ) */ libewf-20140807/libewf/ewf_volume.h0000644000175000017500000000650613421013623021122 0ustar00lordyestalordyesta00000000000000/* * EWF volume section (EWF-E01 EWF-L01) * * 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( _EWF_VOLUME_H ) #define _EWF_VOLUME_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_volume ewf_volume_t; struct ewf_volume { /* The media type * consists of 1 byte * 0x00 => remobable disk * 0x01 => fixed disk * 0x03 => optical disk * 0x0e => LVF * 0x10 => memory (RAM/process) */ uint8_t media_type; /* Unknown * consists of 3 bytes * contains 0x00 */ uint8_t unknown1[ 3 ]; /* The number of chunks * consists of 4 bytes (32 bits) */ uint8_t number_of_chunks[ 4 ]; /* The number of sectors per chunks * consists of 4 bytes (32 bits) */ uint8_t sectors_per_chunk[ 4 ]; /* The number of bytes per chunks * consists of 4 bytes (32 bits) */ uint8_t bytes_per_sector[ 4 ]; /* The number of sectors * consists of 8 bytes (64 bits) */ uint8_t number_of_sectors[ 8 ]; /* C:H:S values * consists of 12 bytes, 4 bytes per value */ uint8_t chs_cylinders[ 4 ]; uint8_t chs_heads[ 4 ]; uint8_t chs_sectors[ 4 ]; /* Media flags * consists of 1 byte * 0x01 => image (1) or device (0) ? * 0x02 => physical (1) * 0x04 => Fastblock Tableau write blocker (1) * 0x08 => Tableau write blocker (1) */ uint8_t media_flags; /* Unknown * consists of 3 bytes * contains 0x00 */ uint8_t unknown2[ 3 ]; /* PALM volume start sector * consists of 4 bytes */ uint8_t palm_volume_start_sector[ 4 ]; /* Unknown * consists of 4 bytes * contains 0x00 */ uint8_t unknown3[ 4 ]; /* SMART logs start sector * consists of 4 bytes * contains 0x00 */ uint8_t smart_logs_start_sector[ 4 ]; /* Compression level (Encase 5 or later) * consists of 1 byte * 0x00 => no compression, * 0x01 => fast/good compression * 0x02 => best compression */ uint8_t compression_level; /* Unknown * consists of 3 bytes * contains 0x00 */ uint8_t unknown4[ 3 ]; /* The number of sectors to use for error granularity * consists of 4 bytes (32 bits) */ uint8_t error_granularity[ 4 ]; /* Unknown * consists of 4 bytes * contains 0x00 */ uint8_t unknown5[ 4 ]; /* The GUID (Encase 5 or later) * consists of 16 bytes */ uint8_t guid[ 16 ]; /* Unknown * consists of 963 bytes * contains 0x00 */ uint8_t unknown6[ 963 ]; /* Reserved (signature) * consists of 5 bytes */ uint8_t signature[ 5 ]; /* The section checksum of all (previous) volume data * consists of 4 bytes (32 bits) * starts with offset 76 */ uint8_t checksum[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_checksum.h0000664000175000017500000000315413421013623022102 0ustar00lordyestalordyesta00000000000000/* * Checksum functions * * Copyright (C) 2006-2017, 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_CHECKSUM_H ) #define _LIBEWF_CHECKSUM_H #include #include #include "libewf_deflate.h" #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_ADLER32 ) && ( defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) ) int libewf_checksum_calculate_adler32( uint32_t *checksum_value, const uint8_t *buffer, size_t size, uint32_t initial_value, libcerror_error_t **error ); #else #define libewf_checksum_calculate_adler32( checksum_value, buffer, size, initial_value, error ) \ libewf_deflate_calculate_adler32( checksum_value, buffer, size, initial_value, error ) #endif /* defined( HAVE_ADLER32 ) && ( defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_CHECKSUM_H ) */ libewf-20140807/libewf/libewf.c0000664000175000017500000000340513440663046020225 0ustar00lordyestalordyesta00000000000000/* * Library to access the Expert Witness Compression Format (EWF) * * 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 . */ #include #if defined( WINAPI ) #include #endif #include "libewf_unused.h" /* Define HAVE_LOCAL_LIBEWF for local use of libewf */ #if !defined( HAVE_LOCAL_LIBEWF ) #if defined( WINAPI ) && defined( HAVE_DLLMAIN ) #if defined( _MANAGED ) #pragma managed( push, off ) #endif /* Defines the entry point for the DLL */ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { LIBEWF_UNREFERENCED_PARAMETER( lpvReserved ) switch( fdwReason ) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinstDLL ); break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: break; } return( TRUE ); } /* Function that indicates the library is a DLL * Returns 1 */ int libewf_is_dll( void ) { return( 1 ); } #endif /* defined( WINAPI ) */ #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ libewf-20140807/libewf/Makefile.in0000664000175000017500000012631213443455350020661 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libewf ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = libewf_definitions.h libewf.rc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libewf_la_DEPENDENCIES = am_libewf_la_OBJECTS = libewf.lo libewf_checksum.lo \ libewf_chunk_data.lo libewf_chunk_table.lo \ libewf_compression.lo libewf_date_time.lo \ libewf_date_time_values.lo libewf_debug.lo libewf_deflate.lo \ libewf_empty_block.lo libewf_error.lo libewf_filename.lo \ libewf_file_entry.lo libewf_handle.lo libewf_hash_sections.lo \ libewf_hash_values.lo libewf_header_sections.lo \ libewf_header_values.lo libewf_io_handle.lo libewf_legacy.lo \ libewf_media_values.lo libewf_metadata.lo libewf_notify.lo \ libewf_read_io_handle.lo libewf_section.lo \ libewf_sector_range.lo libewf_segment_file.lo \ libewf_segment_file_handle.lo libewf_segment_table.lo \ libewf_single_files.lo libewf_single_file_entry.lo \ libewf_single_file_tree.lo libewf_support.lo \ libewf_write_io_handle.lo libewf_la_OBJECTS = $(am_libewf_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libewf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libewf_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libewf.Plo \ ./$(DEPDIR)/libewf_checksum.Plo \ ./$(DEPDIR)/libewf_chunk_data.Plo \ ./$(DEPDIR)/libewf_chunk_table.Plo \ ./$(DEPDIR)/libewf_compression.Plo \ ./$(DEPDIR)/libewf_date_time.Plo \ ./$(DEPDIR)/libewf_date_time_values.Plo \ ./$(DEPDIR)/libewf_debug.Plo ./$(DEPDIR)/libewf_deflate.Plo \ ./$(DEPDIR)/libewf_empty_block.Plo \ ./$(DEPDIR)/libewf_error.Plo ./$(DEPDIR)/libewf_file_entry.Plo \ ./$(DEPDIR)/libewf_filename.Plo ./$(DEPDIR)/libewf_handle.Plo \ ./$(DEPDIR)/libewf_hash_sections.Plo \ ./$(DEPDIR)/libewf_hash_values.Plo \ ./$(DEPDIR)/libewf_header_sections.Plo \ ./$(DEPDIR)/libewf_header_values.Plo \ ./$(DEPDIR)/libewf_io_handle.Plo ./$(DEPDIR)/libewf_legacy.Plo \ ./$(DEPDIR)/libewf_media_values.Plo \ ./$(DEPDIR)/libewf_metadata.Plo ./$(DEPDIR)/libewf_notify.Plo \ ./$(DEPDIR)/libewf_read_io_handle.Plo \ ./$(DEPDIR)/libewf_section.Plo \ ./$(DEPDIR)/libewf_sector_range.Plo \ ./$(DEPDIR)/libewf_segment_file.Plo \ ./$(DEPDIR)/libewf_segment_file_handle.Plo \ ./$(DEPDIR)/libewf_segment_table.Plo \ ./$(DEPDIR)/libewf_single_file_entry.Plo \ ./$(DEPDIR)/libewf_single_file_tree.Plo \ ./$(DEPDIR)/libewf_single_files.Plo \ ./$(DEPDIR)/libewf_support.Plo \ ./$(DEPDIR)/libewf_write_io_handle.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libewf_la_SOURCES) DIST_SOURCES = $(libewf_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libewf.rc.in \ $(srcdir)/libewf_definitions.h.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ @LIBFDATA_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @LIBMFDATA_CPPFLAGS@ \ @ZLIB_CPPFLAGS@ \ @LIBCRYPTO_CPPFLAGS@ \ @LIBHMAC_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ lib_LTLIBRARIES = libewf.la libewf_la_SOURCES = \ ewf_data.h \ ewf_definitions.h \ ewf_digest.h \ ewf_error2.h \ ewf_file_header.h \ ewf_hash.h \ ewf_ltree.h \ ewf_section.h \ ewf_session.h \ ewf_table.h \ ewf_volume.h \ ewf_volume_smart.h \ ewfx_delta_chunk.h \ libewf.c \ libewf_checksum.c libewf_checksum.h \ libewf_chunk_data.c libewf_chunk_data.h \ libewf_chunk_table.c libewf_chunk_table.h \ libewf_codepage.h \ libewf_compression.c libewf_compression.h \ libewf_date_time.c libewf_date_time.h \ libewf_date_time_values.c libewf_date_time_values.h \ libewf_debug.c libewf_debug.h \ libewf_definitions.h \ libewf_deflate.c libewf_deflate.h \ libewf_empty_block.c libewf_empty_block.h \ libewf_error.c libewf_error.h \ libewf_extern.h \ libewf_filename.c libewf_filename.h \ libewf_file_entry.c libewf_file_entry.h \ libewf_handle.c libewf_handle.h \ libewf_hash_sections.c libewf_hash_sections.h \ libewf_hash_values.c libewf_hash_values.h \ libewf_header_sections.c libewf_header_sections.h \ libewf_header_values.c libewf_header_values.h \ libewf_io_handle.c libewf_io_handle.h \ libewf_legacy.c libewf_legacy.h \ libewf_libcdata.h \ libewf_libcerror.h \ libewf_libclocale.h \ libewf_libcnotify.h \ libewf_libbfio.h \ libewf_libfcache.h \ libewf_libfdata.h \ libewf_libfvalue.h \ libewf_libmfdata.h \ libewf_libuna.h \ libewf_media_values.c libewf_media_values.h \ libewf_metadata.c libewf_metadata.h \ libewf_notify.c libewf_notify.h \ libewf_read_io_handle.c libewf_read_io_handle.h \ libewf_section.c libewf_section.h \ libewf_sector_range.c libewf_sector_range.h \ libewf_segment_file.c libewf_segment_file.h \ libewf_segment_file_handle.c libewf_segment_file_handle.h \ libewf_segment_table.c libewf_segment_table.h \ libewf_single_files.c libewf_single_files.h \ libewf_single_file_entry.c libewf_single_file_entry.h \ libewf_single_file_tree.c libewf_single_file_tree.h \ libewf_support.c libewf_support.h \ libewf_types.h \ libewf_unused.h \ libewf_write_io_handle.c libewf_write_io_handle.h libewf_la_LIBADD = \ @LIBCERROR_LIBADD@ \ @LIBCTHREADS_LIBADD@ \ @LIBCDATA_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBFCACHE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBMFDATA_LIBADD@ \ @ZLIB_LIBADD@ \ @LIBDL_LIBADD@ \ @PTHREAD_LIBADD@ libewf_la_LDFLAGS = -no-undefined -version-info 2:0:0 EXTRA_DIST = \ libewf_definitions.h.in \ libewf.rc \ libewf.rc.in MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libewf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libewf/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libewf_definitions.h: $(top_builddir)/config.status $(srcdir)/libewf_definitions.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ libewf.rc: $(top_builddir)/config.status $(srcdir)/libewf.rc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libewf.la: $(libewf_la_OBJECTS) $(libewf_la_DEPENDENCIES) $(EXTRA_libewf_la_DEPENDENCIES) $(AM_V_CCLD)$(libewf_la_LINK) -rpath $(libdir) $(libewf_la_OBJECTS) $(libewf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_checksum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_chunk_data.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_chunk_table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_compression.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_date_time.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_date_time_values.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_deflate.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_empty_block.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_file_entry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_filename.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_hash_sections.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_hash_values.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_header_sections.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_header_values.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_legacy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_media_values.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_metadata.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_read_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_section.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_sector_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_segment_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_segment_file_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_segment_table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_single_file_entry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_single_file_tree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_single_files.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libewf_write_io_handle.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libewf.Plo -rm -f ./$(DEPDIR)/libewf_checksum.Plo -rm -f ./$(DEPDIR)/libewf_chunk_data.Plo -rm -f ./$(DEPDIR)/libewf_chunk_table.Plo -rm -f ./$(DEPDIR)/libewf_compression.Plo -rm -f ./$(DEPDIR)/libewf_date_time.Plo -rm -f ./$(DEPDIR)/libewf_date_time_values.Plo -rm -f ./$(DEPDIR)/libewf_debug.Plo -rm -f ./$(DEPDIR)/libewf_deflate.Plo -rm -f ./$(DEPDIR)/libewf_empty_block.Plo -rm -f ./$(DEPDIR)/libewf_error.Plo -rm -f ./$(DEPDIR)/libewf_file_entry.Plo -rm -f ./$(DEPDIR)/libewf_filename.Plo -rm -f ./$(DEPDIR)/libewf_handle.Plo -rm -f ./$(DEPDIR)/libewf_hash_sections.Plo -rm -f ./$(DEPDIR)/libewf_hash_values.Plo -rm -f ./$(DEPDIR)/libewf_header_sections.Plo -rm -f ./$(DEPDIR)/libewf_header_values.Plo -rm -f ./$(DEPDIR)/libewf_io_handle.Plo -rm -f ./$(DEPDIR)/libewf_legacy.Plo -rm -f ./$(DEPDIR)/libewf_media_values.Plo -rm -f ./$(DEPDIR)/libewf_metadata.Plo -rm -f ./$(DEPDIR)/libewf_notify.Plo -rm -f ./$(DEPDIR)/libewf_read_io_handle.Plo -rm -f ./$(DEPDIR)/libewf_section.Plo -rm -f ./$(DEPDIR)/libewf_sector_range.Plo -rm -f ./$(DEPDIR)/libewf_segment_file.Plo -rm -f ./$(DEPDIR)/libewf_segment_file_handle.Plo -rm -f ./$(DEPDIR)/libewf_segment_table.Plo -rm -f ./$(DEPDIR)/libewf_single_file_entry.Plo -rm -f ./$(DEPDIR)/libewf_single_file_tree.Plo -rm -f ./$(DEPDIR)/libewf_single_files.Plo -rm -f ./$(DEPDIR)/libewf_support.Plo -rm -f ./$(DEPDIR)/libewf_write_io_handle.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile distclean: clean /bin/rm -f libewf_definitions.h /bin/rm -f libewf.rc /bin/rm -f Makefile splint: @echo "Running splint on libewf ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libewf_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libewf/ewf_hash.h0000644000175000017500000000245713421013623020537 0ustar00lordyestalordyesta00000000000000/* * EWF hash section * * 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( _EWF_HASH_H ) #define _EWF_HASH_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_hash ewf_hash_t; struct ewf_hash { /* The MD5 hash of the aquired data * consists of 16 bytes */ uint8_t md5_hash[ 16 ]; /* Unknown */ uint8_t unknown1[ 16 ]; /* The section checksum of all (previous) hash data * consists of 4 bytes (32 bits) * starts with offset 76 */ uint8_t checksum[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_chunk_table.c0000664000175000017500000014077513421013623022565 0ustar00lordyestalordyesta00000000000000/* * Chunk table functions * * 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 . */ #include #include #include #include #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_checksum.h" #include "libewf_chunk_data.h" #include "libewf_chunk_table.h" #include "libewf_definitions.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_section.h" #include "libewf_unused.h" #include "ewf_definitions.h" #include "ewf_table.h" /* Initialize the chunk table * Returns 1 if successful or -1 on error */ int libewf_chunk_table_initialize( libewf_chunk_table_t **chunk_table, libewf_io_handle_t *io_handle, libcerror_error_t **error ) { static char *function = "libewf_chunk_table_initialize"; if( chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table.", function ); return( -1 ); } if( *chunk_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid chunk table value already set.", function ); return( -1 ); } if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } *chunk_table = memory_allocate_structure( libewf_chunk_table_t ); if( *chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create chunk table.", function ); goto on_error; } if( memory_set( *chunk_table, 0, sizeof( libewf_chunk_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear chunk table.", function ); goto on_error; } ( *chunk_table )->io_handle = io_handle; return( 1 ); on_error: if( *chunk_table != NULL ) { memory_free( *chunk_table ); *chunk_table = NULL; } return( -1 ); } /* Frees the chunk table including elements * Returns 1 if successful or -1 on error */ int libewf_chunk_table_free( libewf_chunk_table_t **chunk_table, libcerror_error_t **error ) { static char *function = "libewf_chunk_table_free"; if( chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table.", function ); return( -1 ); } if( *chunk_table != NULL ) { memory_free( *chunk_table ); *chunk_table = NULL; } return( 1 ); } /* Clones the chunk table * Returns 1 if successful or -1 on error */ int libewf_chunk_table_clone( intptr_t **destination_chunk_table, intptr_t *source_chunk_table, libcerror_error_t **error ) { static char *function = "libewf_chunk_table_clone"; if( destination_chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination chunk table.", function ); return( -1 ); } if( *destination_chunk_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination chunk table value already set.", function ); return( -1 ); } if( source_chunk_table == NULL ) { *destination_chunk_table = NULL; return( 1 ); } *destination_chunk_table = memory_allocate_structure_as_value( libewf_chunk_table_t ); if( *destination_chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination chunk table.", function ); goto on_error; } if( memory_copy( *destination_chunk_table, source_chunk_table, sizeof( libewf_chunk_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination chunk table.", function ); goto on_error; } return( 1 ); on_error: if( *destination_chunk_table != NULL ) { memory_free( *destination_chunk_table ); *destination_chunk_table = NULL; } return( -1 ); } /* Reads a chunk * Callback function for the chunk table list * Returns 1 if successful or -1 on error */ int libewf_chunk_table_read_chunk( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_element_t *list_element, libfcache_cache_t *cache, int file_io_pool_entry, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags LIBEWF_ATTRIBUTE_UNUSED, libcerror_error_t **error ) { libewf_chunk_data_t *chunk_data = NULL; static char *function = "libewf_chunk_table_read_chunk"; ssize_t read_count = 0; #if defined( HAVE_DEBUG_OUTPUT ) int element_index = 0; #endif LIBEWF_UNREFERENCED_PARAMETER( read_flags ) if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( element_data_size > (size64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid element data size value exceeds maximum.", function ); return( -1 ); } if( ( element_data_flags & LIBMFDATA_RANGE_FLAG_IS_SPARSE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported element data flags.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libmfdata_list_element_get_element_index( list_element, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from list element.", function ); goto on_error; } if( ( element_data_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) != 0 ) { libcnotify_printf( "%s: reading compressed chunk: %d from file IO pool entry: %d at offset: %" PRIi64 " of size: %" PRIu64 "\n", function, element_index, file_io_pool_entry, element_data_offset, element_data_size ); } else { libcnotify_printf( "%s: reading uncompressed chunk: %d from file IO pool entry: %d at offset: %" PRIi64 " of size: %" PRIu64 "\n", function, element_index, file_io_pool_entry, element_data_offset, element_data_size ); } } #endif if( libbfio_pool_seek_offset( file_io_pool, file_io_pool_entry, element_data_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek chunk offset: %" PRIi64 " in file IO pool entry: %d.", function, element_data_offset, file_io_pool_entry ); goto on_error; } if( libewf_chunk_data_initialize( &chunk_data, (size_t) element_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk data.", function ); goto on_error; } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, chunk_data->data, (size_t) element_data_size, error ); if( read_count != (ssize_t) element_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read chunk data.", function ); goto on_error; } chunk_data->data_size = (size_t) read_count; if( ( element_data_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) != 0 ) { chunk_data->is_compressed = 1; } chunk_data->is_packed = 1; if( libmfdata_list_element_set_element_value( list_element, cache, (intptr_t *) chunk_data, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_chunk_data_free, LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk data as element value.", function ); goto on_error; } return( 1 ); on_error: if( chunk_data != NULL ) { libewf_chunk_data_free( &chunk_data, NULL ); } return( -1 ); } /* Reads a table section for the chunk offsets * Callback function for the chunk table list * Returns 1 if successful, 0 if not or -1 on error */ int libewf_chunk_table_read_offsets( intptr_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_list_t *chunk_table_list, int element_index, int number_of_elements LIBEWF_ATTRIBUTE_UNUSED, libfcache_cache_t *cache LIBEWF_ATTRIBUTE_UNUSED, int file_io_pool_entry, off64_t element_group_offset, size64_t element_group_size, uint32_t element_group_flags LIBEWF_ATTRIBUTE_UNUSED, uint8_t read_flags, libcerror_error_t **error ) { uint8_t table_offsets_checksum[ 4 ]; libewf_chunk_table_t *chunk_table = NULL; libewf_section_t *section = NULL; uint8_t *table_offsets_data = NULL; static char *function = "libewf_chunk_table_read_offsets"; size_t table_offsets_data_size = 0; ssize_t read_count = 0; uint64_t base_offset = 0; uint32_t calculated_checksum = 0; uint32_t number_of_offsets = 0; uint32_t stored_checksum = 0; uint8_t table_offsets_corrupted = 0; #if defined( HAVE_DEBUG_OUTPUT ) uint8_t *trailing_data = NULL; #endif LIBEWF_UNREFERENCED_PARAMETER( number_of_elements ) LIBEWF_UNREFERENCED_PARAMETER( cache ) LIBEWF_UNREFERENCED_PARAMETER( element_group_flags ) if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } chunk_table = (libewf_chunk_table_t *) io_handle; if( chunk_table->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid chunk table - missing IO handle.", function ); return( -1 ); } if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } read_count = libewf_section_start_read( section, file_io_pool, file_io_pool_entry, element_group_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section start.", function ); goto on_error; } if( element_group_size != section->size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element group size value out of bounds.", function ); goto on_error; } element_group_size -= read_count; read_count = libewf_section_table_header_read( section, file_io_pool, file_io_pool_entry, chunk_table->io_handle->format, &number_of_offsets, &base_offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read table section header.", function ); goto on_error; } element_group_size -= read_count; if( number_of_offsets == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_INVALID_DATA, "%s: invalid number of offsets.", function ); goto on_error; } table_offsets_data_size = sizeof( ewf_table_offset_t ) * number_of_offsets; if( table_offsets_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid table offsets data size value exceeds maximum.", function ); goto on_error; } table_offsets_data = (uint8_t *) memory_allocate( table_offsets_data_size ); if( table_offsets_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create table offsets data.", function ); goto on_error; } if( element_group_size < (size64_t) table_offsets_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid element group size value too small.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, table_offsets_data, table_offsets_data_size, error ); if( read_count != (ssize_t) table_offsets_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read table offsets data.", function ); goto on_error; } element_group_size -= read_count; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: table offsets data:\n", function ); libcnotify_print_data( table_offsets_data, table_offsets_data_size, 0 ); } #endif /* The EWF-S01 format does not contain a checksum after the table offsets */ if( chunk_table->io_handle->ewf_format != EWF_FORMAT_S01 ) { if( element_group_size < (size64_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid element group size value too small.", function ); return( -1 ); } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, table_offsets_checksum, sizeof( uint32_t ), error ); if( read_count != (ssize_t) sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read checksum from file descriptor.", function ); goto on_error; } element_group_size -= read_count; byte_stream_copy_to_uint32_little_endian( table_offsets_checksum, stored_checksum ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: table offsets checksum\t\t\t: 0x%" PRIx32 "\n", function, table_offsets_checksum ); libcnotify_printf( "\n" ); } #endif if( libewf_checksum_calculate_adler32( &calculated_checksum, table_offsets_data, table_offsets_data_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").\n", function, stored_checksum, calculated_checksum ); } #endif /* The table offsets cannot be fully trusted therefore mark them as corrupted */ table_offsets_corrupted = 1; } } if( ( read_flags & LIBMFDATA_READ_FLAG_IS_BACKUP_RANGE ) == 0 ) { if( libewf_chunk_table_fill( chunk_table, chunk_table_list, element_index, file_io_pool_entry, section, (off64_t) base_offset, (ewf_table_offset_t *) table_offsets_data, number_of_offsets, table_offsets_corrupted, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to fill chunk table.", function ); goto on_error; } } else { if( libewf_chunk_table_correct( chunk_table, chunk_table_list, element_index, file_io_pool_entry, section, (off64_t) base_offset, (ewf_table_offset_t *) table_offsets_data, number_of_offsets, table_offsets_corrupted, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to correct chunk table.", function ); goto on_error; } } memory_free( table_offsets_data ); table_offsets_data = NULL; if( libewf_section_free( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free section.", function ); section = NULL; goto on_error; } #if defined( HAVE_VERBOSE_OUTPUT ) || defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( element_group_size > (size64_t) 0 ) && ( chunk_table->io_handle->ewf_format != EWF_FORMAT_S01 ) && ( chunk_table->io_handle->format != LIBEWF_FORMAT_ENCASE1 ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( element_group_size > (size64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid element group size value exceeds maximum.", function ); goto on_error; } libcnotify_printf( "%s: trailing data:\n", function ); trailing_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * (size_t) element_group_size ); if( trailing_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create trailing data.", function ); goto on_error; } read_count = libbfio_pool_read_buffer( file_io_pool, file_io_pool_entry, trailing_data, (size_t) element_group_size, error ); if( read_count != (ssize_t) element_group_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read trailing data.", function ); goto on_error; } libcnotify_printf( "%s: trailing data:\n", function ); libcnotify_print_data( trailing_data, (size_t) element_group_size, 0 ); memory_free( trailing_data ); trailing_data = NULL; #elif defined( HAVE_VERBOSE_OUTPUT ) libcnotify_printf( "%s: trailing data after table section offsets.\n", function ); #endif } } #endif if( table_offsets_corrupted != 0 ) { return( 0 ); } return( 1 ); on_error: #if defined( HAVE_DEBUG_OUTPUT ) if( trailing_data != NULL ) { memory_free( trailing_data ); } #endif if( table_offsets_data != NULL ) { memory_free( table_offsets_data ); } if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Fills the chunk table from the offsets * Returns 1 if successful or -1 on error */ int libewf_chunk_table_fill( libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, int chunk_index, int file_io_pool_entry, libewf_section_t *table_section, off64_t base_offset, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, uint8_t tainted, libcerror_error_t **error ) { static char *function = "libewf_chunk_table_fill"; off64_t last_chunk_offset = 0; off64_t last_chunk_size = 0; off64_t previous_chunk_offset = 0; size64_t previous_chunk_size = 0; uint32_t chunk_flags = 0; uint32_t chunk_size = 0; uint32_t current_offset = 0; uint32_t next_offset = 0; uint32_t previous_chunk_flags = 0; uint32_t stored_offset = 0; uint32_t table_offset_index = 0; uint8_t corrupted = 0; uint8_t is_compressed = 0; uint8_t overflow = 0; int previous_file_io_pool_entry = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) char *chunk_type = NULL; char *remarks = NULL; #endif if( chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table.", function ); return( -1 ); } if( table_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table section.", function ); return( -1 ); } if( base_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid base offset.", function ); return( -1 ); } if( table_offsets == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table offsets.", function ); return( -1 ); } byte_stream_copy_to_uint32_little_endian( table_offsets[ table_offset_index ].offset, stored_offset ); while( table_offset_index < ( number_of_offsets - 1 ) ) { if( overflow == 0 ) { is_compressed = (uint8_t) ( stored_offset >> 31 ); current_offset = stored_offset & EWF_OFFSET_COMPRESSED_READ_MASK; } else { current_offset = stored_offset; } byte_stream_copy_to_uint32_little_endian( table_offsets[ table_offset_index + 1 ].offset, stored_offset ); if( overflow == 0 ) { next_offset = stored_offset & EWF_OFFSET_COMPRESSED_READ_MASK; } else { next_offset = stored_offset; } corrupted = 0; /* This is to compensate for the crappy > 2 GiB segment file solution in EnCase 6.7 */ if( next_offset < current_offset ) { if( stored_offset < current_offset ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk offset: %" PRIu32 " larger than stored chunk offset: %" PRIu32 ".\n", function, current_offset, stored_offset ); } #endif corrupted = 1; } #if defined( HAVE_DEBUG_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk offset: %" PRIu32 " larger than next chunk offset: %" PRIu32 ".\n", function, current_offset, next_offset ); } #endif chunk_size = stored_offset - current_offset; } else { chunk_size = next_offset - current_offset; } if( chunk_size == 0 ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid chunk size value is zero.\n", function ); } corrupted = 1; } if( chunk_size > (uint32_t) INT32_MAX ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid chunk size value exceeds maximum.\n", function ); } corrupted = 1; } chunk_flags = 0; if( is_compressed != 0 ) { chunk_flags |= LIBMFDATA_RANGE_FLAG_IS_COMPRESSED; } if( corrupted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_CORRUPTED; } if( tainted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_TAINTED; } #if defined( HAVE_DEBUG_OUTPUT ) if( is_compressed == 0 ) { chunk_type = "uncompressed"; } else { chunk_type = "compressed"; } if( corrupted != 0 ) { remarks = " corrupted"; } else if( tainted != 0 ) { remarks = " tainted"; } else { remarks = ""; } if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s chunk %d read with: base %" PRIi64 ", offset %" PRIu32 " and size %" PRIu32 "%s.\n", function, chunk_type, chunk_index, base_offset, current_offset, chunk_size, remarks ); } #endif result = libmfdata_list_is_group( chunk_table_list, chunk_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunk: %d is a group.", function, chunk_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, file_io_pool_entry, base_offset + current_offset, (size64_t) chunk_size, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %d.", function, chunk_index ); return( -1 ); } } else { if( libmfdata_list_get_data_range_by_index( chunk_table_list, chunk_index, &previous_file_io_pool_entry, &previous_chunk_offset, &previous_chunk_size, &previous_chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %d.", function, chunk_index ); return( -1 ); } if( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_DELTA ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: unable to set data range of chunk: %d value already set.", function, chunk_index ); return( -1 ); } /* No need to overwrite the data range of a delta chunk */ } /* This is to compensate for the crappy > 2 GiB segment file solution in EnCase 6.7 */ if( ( overflow == 0 ) && ( ( current_offset + chunk_size ) > (uint32_t) INT32_MAX ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk offset overflow at: %" PRIu32 ".\n", function, current_offset ); } #endif overflow = 1; is_compressed = 0; } chunk_index++; table_offset_index++; } byte_stream_copy_to_uint32_little_endian( table_offsets[ table_offset_index ].offset, stored_offset ); if( overflow == 0 ) { is_compressed = (uint8_t) ( stored_offset >> 31 ); current_offset = stored_offset & EWF_OFFSET_COMPRESSED_READ_MASK; } else { current_offset = stored_offset; } corrupted = 0; /* There is no indication how large the last chunk is. * The only thing known is where it starts. * However it can be determined using the offset of the next section. * The size of the last chunk is determined by subtracting the last offset from the offset of the next section. * * The offset of the next section is either table_section->end_offset for original EWF and EWF-S01 * or table_section->start_offset for other types of EWF */ last_chunk_offset = (off64_t) base_offset + current_offset; if( last_chunk_offset > (off64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid last chunk offset value exceeds maximum.", function ); return( -1 ); } if( last_chunk_offset < table_section->start_offset ) { last_chunk_size = table_section->start_offset - last_chunk_offset; } else if( last_chunk_offset < table_section->end_offset ) { last_chunk_size = table_section->end_offset - last_chunk_offset; } #if defined( HAVE_DEBUG_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid last chunk offset value exceeds table section end offset.\n", function ); } #endif if( last_chunk_size <= 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid last chunk size value is zero or less.\n", function ); } #endif corrupted = 1; } if( last_chunk_size > (off64_t) INT32_MAX ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid last chunk size value exceeds maximum.\n", function ); } #endif corrupted = 1; } chunk_flags = 0; if( is_compressed != 0 ) { chunk_flags |= LIBMFDATA_RANGE_FLAG_IS_COMPRESSED; } if( corrupted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_CORRUPTED; } if( tainted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_TAINTED; } #if defined( HAVE_DEBUG_OUTPUT ) if( is_compressed == 0 ) { chunk_type = "uncompressed"; } else { chunk_type = "compressed"; } if( corrupted != 0 ) { remarks = " corrupted"; } else if( tainted != 0 ) { remarks = " tainted"; } else { remarks = ""; } if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s last chunk %d read with: base %" PRIi64 ", offset %" PRIu32 " and calculated size %" PRIi64 "%s.\n", function, chunk_type, chunk_index, base_offset, current_offset, last_chunk_size, remarks ); } #endif result = libmfdata_list_is_group( chunk_table_list, chunk_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunk: %d is a group.", function, chunk_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, file_io_pool_entry, last_chunk_offset, (size64_t) last_chunk_size, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %d.", function, chunk_index ); return( -1 ); } } else { if( libmfdata_list_get_data_range_by_index( chunk_table_list, chunk_index, &previous_file_io_pool_entry, &previous_chunk_offset, &previous_chunk_size, &previous_chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %d.", function, chunk_index ); return( -1 ); } if( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_DELTA ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: unable to set data range of chunk: %d value already set.", function, chunk_index ); return( -1 ); } /* No need to overwrite the data range of a delta chunk */ } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( 1 ); } /* Corrects the chunk table from the offsets * Returns 1 if successful or -1 on error */ int libewf_chunk_table_correct( libewf_chunk_table_t *chunk_table, libmfdata_list_t *chunk_table_list, int chunk_index, int file_io_pool_entry, libewf_section_t *table_section, off64_t base_offset, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, uint8_t tainted, libcerror_error_t **error ) { static char *function = "libewf_chunk_table_correct"; off64_t last_chunk_offset = 0; off64_t last_chunk_size = 0; off64_t previous_chunk_offset = 0; size64_t previous_chunk_size = 0; uint32_t chunk_flags = 0; uint32_t chunk_size = 0; uint32_t current_offset = 0; uint32_t next_offset = 0; uint32_t previous_chunk_flags = 0; uint32_t stored_offset = 0; uint32_t table_offset_index = 0; uint8_t corrupted = 0; uint8_t is_compressed = 0; uint8_t mismatch = 0; uint8_t overflow = 0; uint8_t update_data_range = 0; int previous_file_io_pool_entry = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) char *chunk_type = NULL; char *remarks = NULL; #endif if( chunk_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table.", function ); return( -1 ); } if( table_section == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table section.", function ); return( -1 ); } if( base_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid base offset.", function ); return( -1 ); } if( table_offsets == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table offsets.", function ); return( -1 ); } byte_stream_copy_to_uint32_little_endian( table_offsets[ table_offset_index ].offset, stored_offset ); while( table_offset_index < ( number_of_offsets - 1 ) ) { if( overflow == 0 ) { is_compressed = (uint8_t) ( stored_offset >> 31 ); current_offset = stored_offset & EWF_OFFSET_COMPRESSED_READ_MASK; } else { current_offset = stored_offset; } byte_stream_copy_to_uint32_little_endian( table_offsets[ table_offset_index + 1 ].offset, stored_offset ); if( overflow == 0 ) { next_offset = stored_offset & EWF_OFFSET_COMPRESSED_READ_MASK; } else { next_offset = stored_offset; } corrupted = 0; /* This is to compensate for the crappy > 2 GiB segment file solution in EnCase 6.7 */ if( next_offset < current_offset ) { if( stored_offset < current_offset ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk offset: %" PRIu32 " larger than stored chunk offset: %" PRIu32 ".\n", function, current_offset, stored_offset ); } #endif corrupted = 1; } #if defined( HAVE_DEBUG_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk offset: %" PRIu32 " larger than next chunk offset: %" PRIu32 ".\n", function, current_offset, next_offset ); } #endif chunk_size = stored_offset - current_offset; } else { chunk_size = next_offset - current_offset; } if( chunk_size == 0 ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid chunk size value is zero.\n", function ); } corrupted = 1; } if( chunk_size > (uint32_t) INT32_MAX ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid chunk size value exceeds maximum.\n", function ); } corrupted = 1; } chunk_flags = 0; if( is_compressed != 0 ) { chunk_flags |= LIBMFDATA_RANGE_FLAG_IS_COMPRESSED; } if( corrupted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_CORRUPTED; } if( tainted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_TAINTED; } #if defined( HAVE_DEBUG_OUTPUT ) if( is_compressed == 0 ) { chunk_type = "uncompressed"; } else { chunk_type = "compressed"; } if( corrupted != 0 ) { remarks = " corrupted"; } else if( tainted != 0 ) { remarks = " tainted"; } else { remarks = ""; } if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s chunk %d read with: base %" PRIi64 ", offset %" PRIu32 " and size %" PRIu32 "%s.\n", function, chunk_type, chunk_index, base_offset, current_offset, chunk_size, remarks ); } #endif result = libmfdata_list_is_group( chunk_table_list, chunk_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunk: %d is a group.", function, chunk_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, file_io_pool_entry, base_offset + current_offset, (size64_t) chunk_size, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %d.", function, chunk_index ); return( -1 ); } } else { if( libmfdata_list_get_data_range_by_index( chunk_table_list, chunk_index, &previous_file_io_pool_entry, &previous_chunk_offset, &previous_chunk_size, &previous_chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %d.", function, chunk_index ); return( -1 ); } if( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_DELTA ) == 0 ) { if( (off64_t) ( base_offset + current_offset ) != previous_chunk_offset ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk: %d offset mismatch.\n", function, chunk_index ); } #endif mismatch = 1; } else if( (size64_t) chunk_size != previous_chunk_size ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk: %d size mismatch.\n", function, chunk_index ); } #endif mismatch = 1; } else if( ( chunk_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) != ( previous_chunk_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk: %d compression flag mismatch.\n", function, chunk_index ); } #endif mismatch = 1; } else { mismatch = 0; } update_data_range = 0; if( mismatch != 0 ) { if( ( corrupted == 0 ) && ( tainted == 0 ) ) { update_data_range = 1; } else if( ( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_CORRUPTED ) != 0 ) && ( corrupted == 0 ) ) { update_data_range = 1; } } else if( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_TAINTED ) != 0 ) { update_data_range = 1; } if( update_data_range != 0 ) { if( libmfdata_list_set_data_range_by_index( chunk_table_list, chunk_index, file_io_pool_entry, base_offset + current_offset, (size64_t) chunk_size, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of chunk: %d.", function, chunk_index ); return( -1 ); } } } } /* This is to compensate for the crappy > 2 GiB segment file solution in EnCase 6.7 */ if( ( overflow == 0 ) && ( ( current_offset + chunk_size ) > (uint32_t) INT32_MAX ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk offset overflow at: %" PRIu32 ".\n", function, current_offset ); } #endif overflow = 1; is_compressed = 0; } chunk_index++; table_offset_index++; } byte_stream_copy_to_uint32_little_endian( table_offsets[ table_offset_index ].offset, stored_offset ); if( overflow == 0 ) { is_compressed = (uint8_t) ( stored_offset >> 31 ); current_offset = stored_offset & EWF_OFFSET_COMPRESSED_READ_MASK; } else { current_offset = stored_offset; } corrupted = 0; /* There is no indication how large the last chunk is. * The only thing known is where it starts. * However it can be determined using the offset of the next section. * The size of the last chunk is determined by subtracting the last offset from the offset of the next section. * * The offset of the next section is either table_section->end_offset for original EWF and EWF-S01 * or table_section->start_offset for other types of EWF */ last_chunk_offset = (off64_t) base_offset + current_offset; if( last_chunk_offset > (off64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid last chunk offset value exceeds maximum.", function ); return( -1 ); } if( last_chunk_offset < table_section->start_offset ) { last_chunk_size = table_section->start_offset - last_chunk_offset; } else if( last_chunk_offset < table_section->end_offset ) { last_chunk_size = table_section->end_offset - last_chunk_offset; } #if defined( HAVE_DEBUG_OUTPUT ) else if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid last chunk offset value exceeds table section end offset.\n", function ); } #endif last_chunk_size -= table_section->size; if( last_chunk_size <= 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid last chunk size value is zero or less.\n", function ); } #endif corrupted = 1; } if( last_chunk_size > (off64_t) INT32_MAX ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: invalid last chunk size value exceeds maximum.\n", function ); } #endif corrupted = 1; } chunk_flags = 0; if( is_compressed != 0 ) { chunk_flags |= LIBMFDATA_RANGE_FLAG_IS_COMPRESSED; } if( corrupted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_CORRUPTED; } if( tainted != 0 ) { chunk_flags |= LIBEWF_RANGE_FLAG_IS_TAINTED; } #if defined( HAVE_DEBUG_OUTPUT ) if( is_compressed == 0 ) { chunk_type = "uncompressed"; } else { chunk_type = "compressed"; } if( corrupted != 0 ) { remarks = " corrupted"; } else if( tainted != 0 ) { remarks = " tainted"; } else { remarks = ""; } if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s last chunk %d read with: base %" PRIi64 ", offset %" PRIu32 " and calculated size %" PRIi64 "%s.\n", function, chunk_type, chunk_index, base_offset, current_offset, last_chunk_size, remarks ); } #endif result = libmfdata_list_is_group( chunk_table_list, chunk_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunk: %d is a group.", function, chunk_index ); return( -1 ); } else if( result != 0 ) { if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, file_io_pool_entry, last_chunk_offset, (size64_t) last_chunk_size, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk: %d.", function, chunk_index ); return( -1 ); } } else { if( libmfdata_list_get_data_range_by_index( chunk_table_list, chunk_index, &previous_file_io_pool_entry, &previous_chunk_offset, &previous_chunk_size, &previous_chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %d.", function, chunk_index ); return( -1 ); } if( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_DELTA ) == 0 ) { if( (off64_t) ( base_offset + current_offset ) != previous_chunk_offset ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk: %d offset mismatch.\n", function, chunk_index ); } #endif mismatch = 1; } else if( (size64_t) chunk_size != previous_chunk_size ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk: %d size mismatch.\n", function, chunk_index ); } #endif mismatch = 1; } else if( ( chunk_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) != ( previous_chunk_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: chunk: %d compression flag mismatch.\n", function, chunk_index ); } #endif mismatch = 1; } else { mismatch = 0; } update_data_range = 0; if( mismatch != 0 ) { if( ( corrupted == 0 ) && ( tainted == 0 ) ) { update_data_range = 1; } else if( ( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_CORRUPTED ) != 0 ) && ( corrupted == 0 ) ) { update_data_range = 1; } } else if( ( previous_chunk_flags & LIBEWF_RANGE_FLAG_IS_TAINTED ) != 0 ) { update_data_range = 1; } if( update_data_range != 0 ) { if( libmfdata_list_set_data_range_by_index( chunk_table_list, chunk_index, file_io_pool_entry, base_offset + current_offset, (size64_t) chunk_size, chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of chunk: %d.", function, chunk_index ); return( -1 ); } } } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( 1 ); } /* Fills the offsets from the chunk table * Returns 1 if successful or -1 on error */ int libewf_chunk_table_fill_offsets( libmfdata_list_t *chunk_table_list, int chunk_index, off64_t base_offset, ewf_table_offset_t *table_offsets, uint32_t number_of_offsets, libcerror_error_t **error ) { static char *function = "libewf_chunk_table_fill_offsets"; off64_t chunk_offset = 0; size64_t chunk_size = 0; uint32_t chunk_flags = 0; uint32_t table_offset = 0; uint32_t table_offset_index = 0; int file_io_pool_entry = 0; if( chunk_table_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk table list.", function ); return( -1 ); } if( base_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid base offset.", function ); return( -1 ); } if( table_offsets == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table offsets.", function ); return( -1 ); } for( table_offset_index = 0; table_offset_index < number_of_offsets; table_offset_index++ ) { if( libmfdata_list_get_data_range_by_index( chunk_table_list, chunk_index, &file_io_pool_entry, &chunk_offset, &chunk_size, &chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %d.", function, chunk_index ); return( -1 ); } chunk_offset -= base_offset; if( ( chunk_offset < 0 ) || ( chunk_offset > (off64_t) INT32_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk: %d offset value out of bounds.", function, chunk_index ); return( -1 ); } table_offset = (uint32_t) chunk_offset; if( ( chunk_flags & LIBMFDATA_RANGE_FLAG_IS_COMPRESSED ) != 0 ) { table_offset |= EWF_OFFSET_COMPRESSED_WRITE_MASK; } byte_stream_copy_from_uint32_little_endian( table_offsets[ table_offset_index ].offset, table_offset ); chunk_index++; } return( 1 ); } libewf-20140807/libewf/libewf_compression.h0000664000175000017500000000276313421013624022647 0ustar00lordyestalordyesta00000000000000/* * Compression handling functions * * Copyright (C) 2006-2017, 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_COMPRESS_H ) #define _LIBEWF_COMPRESS_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libewf_compress_data( uint8_t *compressed_data, size_t *compressed_data_size, int8_t compression_level, const uint8_t *uncompressed_data, size_t uncompressed_data_size, libcerror_error_t **error ); int libewf_decompress_data( const uint8_t *compressed_data, size_t compressed_data_size, uint8_t *uncompressed_data, size_t *uncompressed_data_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_COMPRESS_H ) */ libewf-20140807/libewf/libewf_libfcache.h0000664000175000017500000000263513440663047022217 0ustar00lordyestalordyesta00000000000000/* * The libfcache header wrapper * * Copyright (C) 2006-2018, 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_LIBFCACHE_H ) #define _LIBEWF_LIBFCACHE_H #include /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache */ #if defined( HAVE_LOCAL_LIBFCACHE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBFCACHE_DLL_IMPORT * before including libfcache.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFCACHE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFCACHE ) */ #endif /* !defined( _LIBEWF_LIBFCACHE_H ) */ libewf-20140807/libewf/libewf_filename.h0000664000175000017500000000374213421024433022064 0ustar00lordyestalordyesta00000000000000/* * Filename functions * * 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_FILENAME_H ) #define _LIBEWF_FILENAME_H #include #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libewf_filename_set_extension( char *extension, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libewf_filename_set_extension_wide( wchar_t *extension, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ int libewf_filename_create( system_character_t **filename, size_t *filename_size, system_character_t *basename, size_t basename_length, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_FILENAME_H ) */ libewf-20140807/libewf/libewf_extern.h0000664000175000017500000000235613440663046021623 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2006-2018, 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_INTERNAL_EXTERN_H ) #define _LIBEWF_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBEWF for local use of libewf */ #if !defined( HAVE_LOCAL_LIBEWF ) #include #define LIBEWF_EXTERN_VARIABLE LIBEWF_EXTERN #else #define LIBEWF_EXTERN /* extern */ #define LIBEWF_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ #endif /* !defined( _LIBEWF_INTERNAL_EXTERN_H ) */ libewf-20140807/libewf/ewf_volume_smart.h0000644000175000017500000000406013421013623022321 0ustar00lordyestalordyesta00000000000000/* * EWF SMART volume section (EWF-S01) * * 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( _EWF_VOLUME_SMART_H ) #define _EWF_VOLUME_SMART_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_volume_smart ewf_volume_smart_t; struct ewf_volume_smart { /* Reserved (The media type) * consists of 4 bytes (32 bits) * contains 0x01 */ uint8_t unknown1[ 4 ]; /* The number of chunks * consists of 4 bytes (32 bits) */ uint8_t number_of_chunks[ 4 ]; /* The number of sectors per chunks * consists of 4 bytes (32 bits) * value should be 64 */ uint8_t sectors_per_chunk[ 4 ]; /* The number of bytes per chunks * consists of 4 bytes (32 bits) * value should be 512 */ uint8_t bytes_per_sector[ 4 ]; /* The number of sectors * consists of 4 bytes (32 bits) */ uint8_t number_of_sectors[ 4 ]; /* Unknown - reserved * consists of 20 bytes * contains 0x00 */ uint8_t unknown2[ 20 ]; /* Unknown - padding * consists of 45 bytes * contains 0x00 */ uint8_t unknown3[ 45 ]; /* Reserved (signature) * consists of 5 bytes */ uint8_t signature[ 5 ]; /* The section checksum of all (previous) volume data * consists of 4 bytes (32 bits) * starts with offset 76 */ uint8_t checksum[ 4 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_error.h0000664000175000017500000000332713440663046021446 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2006-2018, 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_INTERNAL_ERROR_H ) #define _LIBEWF_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBEWF ) #include #endif #include "libewf_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBEWF ) LIBEWF_EXTERN \ void libewf_error_free( libewf_error_t **error ); LIBEWF_EXTERN \ int libewf_error_fprint( libewf_error_t *error, FILE *stream ); LIBEWF_EXTERN \ int libewf_error_sprint( libewf_error_t *error, char *string, size_t size ); LIBEWF_EXTERN \ int libewf_error_backtrace_fprint( libewf_error_t *error, FILE *stream ); LIBEWF_EXTERN \ int libewf_error_backtrace_sprint( libewf_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_INTERNAL_ERROR_H ) */ libewf-20140807/libewf/libewf_notify.c0000664000175000017500000000525413440663047021622 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2006-2018, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_notify.h" #if !defined( HAVE_LOCAL_LIBEWF ) /* Sets the verbose notification */ void libewf_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libewf_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libewf_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libewf_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libewf_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libewf_notify_stream_close( libcerror_error_t **error ) { static char *function = "libewf_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ libewf-20140807/libewf/libewf_single_files.c0000664000175000017500000014566213421024433022752 0ustar00lordyestalordyesta00000000000000/* * Single file entries functions * * 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 . */ #include #include #include #include "libewf_definitions.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" #include "libewf_single_file_entry.h" #include "libewf_single_files.h" /* Initialize the single files * Returns 1 if successful or -1 on error */ int libewf_single_files_initialize( libewf_single_files_t **single_files, libcerror_error_t **error ) { static char *function = "libewf_single_files_initialize"; if( single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single files.", function ); return( -1 ); } if( *single_files != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid single files value already set.", function ); return( -1 ); } *single_files = memory_allocate_structure( libewf_single_files_t ); if( *single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create single files.", function ); goto on_error; } if( memory_set( *single_files, 0, sizeof( libewf_single_files_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear single files.", function ); goto on_error; } return( 1 ); on_error: if( *single_files != NULL ) { memory_free( *single_files ); *single_files = NULL; } return( -1 ); } /* Frees the single files including elements * Returns 1 if successful or -1 on error */ int libewf_single_files_free( libewf_single_files_t **single_files, libcerror_error_t **error ) { static char *function = "libewf_single_files_free"; int result = 1; if( single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single files.", function ); return( -1 ); } if( *single_files != NULL ) { if( ( *single_files )->section_data != NULL ) { memory_free( ( *single_files )->section_data ); } if( ( *single_files )->root_file_entry_node != NULL ) { if( libcdata_tree_node_free( &( ( *single_files )->root_file_entry_node ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_single_file_entry_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free single file entry tree.", function ); result = -1; } } memory_free( *single_files ); *single_files = NULL; } return( result ); } /* Parse an EWF ltree for the values * Returns 1 if successful or -1 on error */ int libewf_single_files_parse( libewf_single_files_t *single_files, size64_t *media_size, uint8_t *format, libcerror_error_t **error ) { uint8_t *file_entries_string = NULL; static char *function = "libewf_single_files_parse"; size_t file_entries_string_size = 0; if( single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single files.", function ); return( -1 ); } if( single_files->ltree_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid single files - missing ltree data.", function ); return( -1 ); } if( libuna_utf8_string_size_from_utf16_stream( single_files->ltree_data, single_files->ltree_data_size, LIBUNA_ENDIAN_LITTLE, &file_entries_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine file entries string size.", function ); return( -1 ); } file_entries_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * (size_t) file_entries_string_size ); if( file_entries_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file entries string.", function ); goto on_error; } if( libuna_utf8_string_copy_from_utf16_stream( file_entries_string, file_entries_string_size, single_files->ltree_data, single_files->ltree_data_size, LIBUNA_ENDIAN_LITTLE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set file entries string.", function ); goto on_error; } if( libewf_single_files_parse_file_entries( single_files, media_size, file_entries_string, file_entries_string_size, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse file entries string.", function ); goto on_error; } memory_free( file_entries_string ); return( 1 ); on_error: if( file_entries_string != NULL ) { memory_free( file_entries_string ); } return( -1 ); } /* Parse a single file entries string for the values * Returns 1 if successful or -1 on error */ int libewf_single_files_parse_file_entries( libewf_single_files_t *single_files, size64_t *media_size, const uint8_t *entries_string, size_t entries_string_size, uint8_t *format, libcerror_error_t **error ) { libfvalue_split_utf8_string_t *lines = NULL; libfvalue_split_utf8_string_t *types = NULL; uint8_t *line_string = NULL; static char *function = "libewf_single_files_parse_file_entries"; size_t line_string_size = 0; int line_index = 0; int number_of_lines = 0; if( single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single files.", function ); return( -1 ); } if( entries_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entries string.", function ); return( -1 ); } if( libfvalue_utf8_string_split( entries_string, entries_string_size - 1, (uint8_t) '\n', &lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split entries string into lines.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( lines, &number_of_lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of lines", function ); goto on_error; } if( number_of_lines > 0 ) { if( libfvalue_split_utf8_string_get_segment_by_index( lines, 0, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: 0.", function ); goto on_error; } if( ( line_string == NULL ) || ( line_string_size < 2 ) || ( line_string[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: 0.", function ); goto on_error; } /* Remove trailing carriage return */ else if( line_string[ line_string_size - 2 ] == (uint8_t) '\r' ) { line_string[ line_string_size - 2 ] = 0; line_string_size -= 1; } if( line_string_size != 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported single file entries string.", function ); goto on_error; } if( ( line_string[ 0 ] < (uint8_t) '0' ) || ( line_string[ 0 ] > (uint8_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported single file entries string.", function ); goto on_error; } /* Find the line containing: "rec" */ for( line_index = 0; line_index < number_of_lines; line_index++ ) { if( libfvalue_split_utf8_string_get_segment_by_index( lines, line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, line_index ); goto on_error; } if( line_string_size == 4 ) { if( line_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: %d.", function, line_index ); goto on_error; } if( ( line_string[ 0 ] == (uint8_t) 'r' ) && ( line_string[ 1 ] == (uint8_t) 'e' ) && ( line_string[ 2 ] == (uint8_t) 'c' ) ) { line_index += 1; break; } } } if( libewf_single_files_parse_record_values( media_size, lines, &line_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse record values.", function ); goto on_error; } /* Find the line containing: "entry" */ for( line_index = 0; line_index < number_of_lines; line_index++ ) { if( libfvalue_split_utf8_string_get_segment_by_index( lines, line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, line_index ); goto on_error; } if( line_string_size == 6 ) { if( line_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing line string: %d.", function, line_index ); goto on_error; } if( ( line_string[ 0 ] == (uint8_t) 'e' ) && ( line_string[ 1 ] == (uint8_t) 'n' ) && ( line_string[ 2 ] == (uint8_t) 't' ) && ( line_string[ 3 ] == (uint8_t) 'r' ) && ( line_string[ 4 ] == (uint8_t) 'y' ) ) { line_index += 2; break; } } } if( line_index < number_of_lines ) { if( libfvalue_split_utf8_string_get_segment_by_index( lines, line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, line_index ); goto on_error; } line_index += 1; if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split entries string into types.", function ); goto on_error; } if( libcdata_tree_node_initialize( &( single_files->root_file_entry_node ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create root single file entry node.", function ); goto on_error; } if( libewf_single_files_parse_file_entry( single_files->root_file_entry_node, lines, &line_index, types, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse file entry.", function ); goto on_error; } /* The single files entries should be followed by an empty line */ if( libfvalue_split_utf8_string_get_segment_by_index( lines, line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, line_index ); goto on_error; } if( ( line_string_size != 1 ) || ( line_string[ 0 ] != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported empty line string: %d - not empty.", function, line_index ); goto on_error; } } if( libfvalue_split_utf8_string_free( &types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split types.", function ); goto on_error; } } if( libfvalue_split_utf8_string_free( &lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split lines.", function ); goto on_error; } return( 1 ); on_error: if( types != NULL ) { libfvalue_split_utf8_string_free( &types, NULL ); } if( lines != NULL ) { libfvalue_split_utf8_string_free( &lines, NULL ); } return( -1 ); } /* Parse a record string for the values * Returns 1 if successful or -1 on error */ int libewf_single_files_parse_record_values( size64_t *media_size, libfvalue_split_utf8_string_t *lines, int *line_index, libcerror_error_t **error ) { libfvalue_split_utf8_string_t *types = NULL; libfvalue_split_utf8_string_t *values = NULL; uint8_t *line_string = NULL; uint8_t *type_string = NULL; uint8_t *value_string = NULL; static char *function = "libewf_single_files_parse_record_values"; size_t line_string_size = 0; size_t type_string_size = 0; size_t value_string_size = 0; uint64_t value_64bit = 0; int number_of_types = 0; int number_of_values = 0; int value_index = 0; if( media_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media size.", function ); return( -1 ); } if( line_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid line index.", function ); return( -1 ); } if( libfvalue_split_utf8_string_get_segment_by_index( lines, *line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, *line_index ); goto on_error; } *line_index += 1; if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split entries string into types.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( types, &number_of_types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of types", function ); goto on_error; } if( libfvalue_split_utf8_string_get_segment_by_index( lines, *line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, *line_index ); goto on_error; } *line_index += 1; if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split entries string into values.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( values, &number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values", function ); goto on_error; } #if defined( HAVE_VERBOSE_OUTPUT ) if( number_of_types != number_of_values ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mismatch in number of types and values.\n", function ); } } #endif for( value_index = 0; value_index < number_of_types; value_index++ ) { if( libfvalue_split_utf8_string_get_segment_by_index( types, value_index, &type_string, &type_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve type string: %d.", function, value_index ); goto on_error; } if( ( type_string == NULL ) || ( type_string_size < 2 ) || ( type_string[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing type string: %d.", function, value_index ); goto on_error; } /* Remove trailing carriage return */ else if( type_string[ type_string_size - 2 ] == (uint8_t) '\r' ) { type_string[ type_string_size - 2 ] = 0; type_string_size -= 1; } if( value_index < number_of_values ) { if( libfvalue_split_utf8_string_get_segment_by_index( values, value_index, &value_string, &value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value string: %d.", function, value_index ); goto on_error; } if( ( value_string == NULL ) || ( value_string_size < 2 ) || ( value_string[ 0 ] == 0 ) ) { value_string = NULL; value_string_size = 0; } /* Remove trailing carriage return */ else if( value_string[ value_string_size - 2 ] == (uint8_t) '\r' ) { value_string[ value_string_size - 2 ] = 0; value_string_size -= 1; } } else { value_string = NULL; value_string_size = 0; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: type: %s with value: %s.\n", function, (char *) type_string, (char *) value_string ); } #endif /* Ignore empty values */ if( value_string == NULL ) { continue; } if( type_string_size == 3 ) { if( ( type_string[ 0 ] == (uint8_t) 'c' ) && ( type_string[ 1 ] == (uint8_t) 'l' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 't' ) && ( type_string[ 1 ] == (uint8_t) 'b' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set media size.", function ); goto on_error; } *media_size = (size64_t) value_64bit; } } } if( libfvalue_split_utf8_string_free( &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split values.", function ); goto on_error; } if( libfvalue_split_utf8_string_free( &types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split types.", function ); goto on_error; } return( 1 ); on_error: if( values != NULL ) { libfvalue_split_utf8_string_free( &values, NULL ); } if( types != NULL ) { libfvalue_split_utf8_string_free( &types, NULL ); } return( -1 ); } /* Parse a single file entry string for the values * Returns 1 if successful or -1 on error */ int libewf_single_files_parse_file_entry( libcdata_tree_node_t *parent_file_entry_node, libfvalue_split_utf8_string_t *lines, int *line_index, libfvalue_split_utf8_string_t *types, uint8_t *format, libcerror_error_t **error ) { libewf_single_file_entry_t *single_file_entry = NULL; libfvalue_split_utf8_string_t *values = NULL; libcdata_tree_node_t *file_entry_node = NULL; uint8_t *line_string = NULL; uint8_t *type_string = NULL; uint8_t *value_string = NULL; static char *function = "libewf_single_files_parse_file_entry"; size_t line_string_size = 0; size_t type_string_size = 0; size_t value_string_size = 0; size_t value_string_index = 0; uint64_t number_of_sub_entries = 0; uint64_t value_64bit = 0; int number_of_lines = 0; int number_of_types = 0; int number_of_values = 0; int value_index = 0; int zero_values_only = 0; if( parent_file_entry_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid parent file entry node.", function ); return( -1 ); } if( line_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid line index.", function ); return( -1 ); } if( format == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid format.", function ); return( -1 ); } if( libfvalue_split_utf8_string_get_number_of_segments( types, &number_of_types, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of types", function ); goto on_error; } if( libewf_single_files_parse_file_entry_number_of_sub_entries( lines, line_index, &number_of_sub_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse file entry number of sub entries.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_segment_by_index( lines, *line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, *line_index ); goto on_error; } *line_index += 1; if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split entries string into values.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( values, &number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values", function ); goto on_error; } #if defined( HAVE_VERBOSE_OUTPUT ) if( number_of_types != number_of_values ) { if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mismatch in number of types and values.\n", function ); } } #endif if( libewf_single_file_entry_initialize( &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create single file entry.", function ); goto on_error; } for( value_index = 0; value_index < number_of_types; value_index++ ) { if( libfvalue_split_utf8_string_get_segment_by_index( types, value_index, &type_string, &type_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve type string: %d.", function, value_index ); goto on_error; } if( ( type_string == NULL ) || ( type_string_size < 2 ) || ( type_string[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing type string: %d.", function, value_index ); goto on_error; } /* Remove trailing carriage return */ else if( type_string[ type_string_size - 2 ] == (uint8_t) '\r' ) { type_string[ type_string_size - 2 ] = 0; type_string_size -= 1; } if( value_index < number_of_values ) { if( libfvalue_split_utf8_string_get_segment_by_index( values, value_index, &value_string, &value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value string: %d.", function, value_index ); goto on_error; } if( ( value_string == NULL ) || ( value_string_size < 2 ) || ( value_string[ 0 ] == 0 ) ) { value_string = NULL; value_string_size = 0; } /* Remove trailing carriage return */ else if( value_string[ value_string_size - 2 ] == (uint8_t) '\r' ) { value_string[ value_string_size - 2 ] = 0; value_string_size -= 1; } } else { value_string = NULL; value_string_size = 0; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: type: %s with value: %s.\n", function, (char *) type_string, (char *) value_string ); } #endif if( value_string == NULL ) { /* Ignore empty values */ } else if( type_string_size == 4 ) { if( ( type_string[ 0 ] == (uint8_t) 'c' ) && ( type_string[ 1 ] == (uint8_t) 'i' ) && ( type_string[ 2 ] == (uint8_t) 'd' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 'o' ) && ( type_string[ 1 ] == (uint8_t) 'p' ) && ( type_string[ 2 ] == (uint8_t) 'r' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set entry flags.", function ); goto on_error; } if( value_64bit > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid entry flags value exceeds maximum.", function ); goto on_error; } single_file_entry->flags = (uint32_t) value_64bit; } else if( ( type_string[ 0 ] == (uint8_t) 's' ) && ( type_string[ 1 ] == (uint8_t) 'r' ) && ( type_string[ 2 ] == (uint8_t) 'c' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 's' ) && ( type_string[ 1 ] == (uint8_t) 'u' ) && ( type_string[ 2 ] == (uint8_t) 'b' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 's' ) && ( type_string[ 1 ] == (uint8_t) 'h' ) && ( type_string[ 2 ] == (uint8_t) 'a' ) ) { single_file_entry->sha1_hash = (uint8_t *) memory_allocate( sizeof( uint8_t ) * value_string_size ); if( single_file_entry->sha1_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create MD5 hash.", function ); goto on_error; } zero_values_only = 1; for( value_string_index = 0; value_string_index < value_string_size - 1; value_string_index++ ) { if( ( value_string[ value_string_index ] >= (uint8_t) '0' ) && ( value_string[ value_string_index ] <= (uint8_t) '9' ) ) { single_file_entry->sha1_hash[ value_string_index ] = value_string[ value_string_index ]; } else if( ( value_string[ value_string_index ] >= (uint8_t) 'A' ) && ( value_string[ value_string_index ] <= (uint8_t) 'F' ) ) { single_file_entry->sha1_hash[ value_string_index ] = (uint8_t) ( 'a' - 'A' ) + value_string[ value_string_index ]; } else if( ( value_string[ value_string_index ] >= (uint8_t) 'a' ) && ( value_string[ value_string_index ] <= (uint8_t) 'f' ) ) { single_file_entry->sha1_hash[ value_string_index ] = value_string[ value_string_index ]; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character in MD5 hash.", function ); goto on_error; } if( value_string[ value_string_index ] != (uint8_t) '0' ) { zero_values_only = 0; } } single_file_entry->sha1_hash[ value_string_size - 1 ] = 0; if( zero_values_only == 0 ) { single_file_entry->sha1_hash_size = value_string_size; } } } else if( type_string_size == 3 ) { /* Access time */ if( ( type_string[ 0 ] == (uint8_t) 'a' ) && ( type_string[ 1 ] == (uint8_t) 'c' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 32, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set access time.", function ); goto on_error; } single_file_entry->access_time = (uint32_t) value_64bit; } else if( ( type_string[ 0 ] == (uint8_t) 'a' ) && ( type_string[ 1 ] == (uint8_t) 'q' ) ) { } /* Data offset * consist of: unknown, offset and size */ else if( ( type_string[ 0 ] == (uint8_t) 'b' ) && ( type_string[ 1 ] == (uint8_t) 'e' ) ) { if( libewf_single_files_parse_file_entry_offset_values( single_file_entry, value_string, value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse offset values string.", function ); goto on_error; } if( value_index == 19 ) { *format = LIBEWF_FORMAT_LOGICAL_ENCASE5; } else if( ( value_index == 20 ) || ( value_index == 21 ) ) { *format = LIBEWF_FORMAT_LOGICAL_ENCASE6; } else if( value_index == 2 ) { *format = LIBEWF_FORMAT_LOGICAL_ENCASE7; } } /* Creation time */ else if( ( type_string[ 0 ] == (uint8_t) 'c' ) && ( type_string[ 1 ] == (uint8_t) 'r' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 32, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set creation time.", function ); goto on_error; } single_file_entry->creation_time = (uint32_t) value_64bit; } else if( ( type_string[ 0 ] == (uint8_t) 'd' ) && ( type_string[ 1 ] == (uint8_t) 'l' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 'd' ) && ( type_string[ 1 ] == (uint8_t) 'u' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set duplicate data offset.", function ); goto on_error; } single_file_entry->duplicate_data_offset = (off64_t) value_64bit; } /* MD5 digest hash */ else if( ( type_string[ 0 ] == (uint8_t) 'h' ) && ( type_string[ 1 ] == (uint8_t) 'a' ) ) { single_file_entry->md5_hash = (uint8_t *) memory_allocate( sizeof( uint8_t ) * value_string_size ); if( single_file_entry->md5_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create MD5 hash.", function ); goto on_error; } zero_values_only = 1; for( value_string_index = 0; value_string_index < value_string_size - 1; value_string_index++ ) { if( ( value_string[ value_string_index ] >= (uint8_t) '0' ) && ( value_string[ value_string_index ] <= (uint8_t) '9' ) ) { single_file_entry->md5_hash[ value_string_index ] = value_string[ value_string_index ]; } else if( ( value_string[ value_string_index ] >= (uint8_t) 'A' ) && ( value_string[ value_string_index ] <= (uint8_t) 'F' ) ) { single_file_entry->md5_hash[ value_string_index ] = (uint8_t) ( 'a' - 'A' ) + value_string[ value_string_index ]; } else if( ( value_string[ value_string_index ] >= (uint8_t) 'a' ) && ( value_string[ value_string_index ] <= (uint8_t) 'f' ) ) { single_file_entry->md5_hash[ value_string_index ] = value_string[ value_string_index ]; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character in MD5 hash.", function ); goto on_error; } if( value_string[ value_string_index ] != (uint8_t) '0' ) { zero_values_only = 0; } } single_file_entry->md5_hash[ value_string_size - 1 ] = 0; if( zero_values_only == 0 ) { single_file_entry->md5_hash_size = value_string_size; } } else if( ( type_string[ 0 ] == (uint8_t) 'i' ) && ( type_string[ 1 ] == (uint8_t) 'd' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 'j' ) && ( type_string[ 1 ] == (uint8_t) 'q' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 'l' ) && ( type_string[ 1 ] == (uint8_t) 'o' ) ) { } /* Size */ else if( ( type_string[ 0 ] == (uint8_t) 'l' ) && ( type_string[ 1 ] == (uint8_t) 's' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set size.", function ); goto on_error; } single_file_entry->size = (size64_t) value_64bit; } else if( ( type_string[ 0 ] == (uint8_t) 'm' ) && ( type_string[ 1 ] == (uint8_t) 'o' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 32, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set entry modification time.", function ); goto on_error; } single_file_entry->entry_modification_time = (uint32_t) value_64bit; } else if( ( type_string[ 0 ] == (uint8_t) 'p' ) && ( type_string[ 1 ] == (uint8_t) 'm' ) ) { } else if( ( type_string[ 0 ] == (uint8_t) 'p' ) && ( type_string[ 1 ] == (uint8_t) 'o' ) ) { } /* Modification time */ else if( ( type_string[ 0 ] == (uint8_t) 'w' ) && ( type_string[ 1 ] == (uint8_t) 'r' ) ) { if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, &value_64bit, 32, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set modification time.", function ); goto on_error; } single_file_entry->modification_time = (uint32_t) value_64bit; } } else if( type_string_size == 2 ) { /* Name */ if( type_string[ 0 ] == (uint8_t) 'n' ) { single_file_entry->name = (uint8_t *) memory_allocate( sizeof( uint8_t ) * value_string_size ); if( single_file_entry->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } if( memory_copy( single_file_entry->name, value_string, value_string_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set name.", function ); goto on_error; } single_file_entry->name[ value_string_size - 1 ] = 0; single_file_entry->name_size = value_string_size; } } if( type_string_size == 2 ) { if( type_string[ 0 ] == (uint8_t) 'p' ) { /* p = 1 if directory * p = empty if file */ if( value_string == NULL ) { single_file_entry->type = LIBEWF_FILE_ENTRY_TYPE_FILE; } else if( ( value_string_size == 2 ) && ( value_string[ 0 ] == (uint8_t) '1' ) ) { single_file_entry->type = LIBEWF_FILE_ENTRY_TYPE_DIRECTORY; } } } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif if( libfvalue_split_utf8_string_free( &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split values.", function ); goto on_error; } if( libcdata_tree_node_set_value( parent_file_entry_node, (intptr_t *) single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set single file entry in node.", function ); goto on_error; } single_file_entry = NULL; if( libfvalue_split_utf8_string_get_number_of_segments( lines, &number_of_lines, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of lines", function ); goto on_error; } if( ( *line_index + number_of_sub_entries ) > (uint64_t) number_of_lines ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of sub entries exceed the number of available lines.", function ); goto on_error; } while( number_of_sub_entries > 0 ) { if( libcdata_tree_node_initialize( &file_entry_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create single file entry node.", function ); goto on_error; } if( libewf_single_files_parse_file_entry( file_entry_node, lines, line_index, types, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to parse file entry.", function ); goto on_error; } if( libcdata_tree_node_append_node( parent_file_entry_node, file_entry_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append single file entry node to parent.", function ); goto on_error; } file_entry_node = NULL; number_of_sub_entries--; } return( 1 ); on_error: if( file_entry_node != NULL ) { libcdata_tree_node_free( &file_entry_node, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_single_file_entry_free, NULL ); } if( single_file_entry != NULL ) { libewf_single_file_entry_free( &single_file_entry, NULL ); } if( values != NULL ) { libfvalue_split_utf8_string_free( &values, NULL ); } return( -1 ); } /* Parse a single file entry string for the number of sub entries * Returns 1 if successful or -1 on error */ int libewf_single_files_parse_file_entry_number_of_sub_entries( libfvalue_split_utf8_string_t *lines, int *line_index, uint64_t *number_of_sub_entries, libcerror_error_t **error ) { libfvalue_split_utf8_string_t *values = NULL; uint8_t *line_string = NULL; uint8_t *value_string = NULL; static char *function = "libewf_single_files_parse_file_entry_number_of_sub_entries"; size_t line_string_size = 0; size_t value_string_size = 0; int number_of_values = 0; if( line_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid line index.", function ); return( -1 ); } if( libfvalue_split_utf8_string_get_segment_by_index( lines, *line_index, &line_string, &line_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve line string: %d.", function, *line_index ); goto on_error; } *line_index += 1; if( libfvalue_utf8_string_split( line_string, line_string_size, (uint8_t) '\t', &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split entries string into values.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( values, &number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values", function ); goto on_error; } if( number_of_values != 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported number of values.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_segment_by_index( values, 0, &value_string, &value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value string: 0.", function ); goto on_error; } if( value_string_size == 2 ) { if( value_string[ 0 ] != (uint8_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported first value: %c.", function, value_string[ 0 ] ); goto on_error; } } else if( value_string_size == 3 ) { if( ( value_string[ 0 ] != (uint8_t) '2' ) || ( value_string[ 1 ] != (uint8_t) '6' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported first value: %c%c.", function, value_string[ 0 ], value_string[ 1 ] ); goto on_error; } } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported first value.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_segment_by_index( values, 1, &value_string, &value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value string: 1.", function ); goto on_error; } if( libfvalue_utf8_string_copy_to_integer( value_string, value_string_size, number_of_sub_entries, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set number fo sub entries.", function ); goto on_error; } if( libfvalue_split_utf8_string_free( &values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split values.", function ); goto on_error; } return( 1 ); on_error: if( values != NULL ) { libfvalue_split_utf8_string_free( &values, NULL ); } return( -1 ); } /* Parse a single file entry offset values string for the values * Returns 1 if successful or -1 on error */ int libewf_single_files_parse_file_entry_offset_values( libewf_single_file_entry_t *single_file_entry, const uint8_t *offset_values_string, size_t offset_values_string_size, libcerror_error_t **error ) { libfvalue_split_utf8_string_t *offset_values = NULL; uint8_t *offset_value_string = NULL; static char *function = "libewf_single_files_parse_file_entry_offset_values"; size_t offset_value_string_size = 0; uint64_t value_64bit = 0; int number_of_offset_values = 0; if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid single file entry.", function ); return( -1 ); } if( libfvalue_utf8_string_split( offset_values_string, offset_values_string_size, (uint8_t) ' ', &offset_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string into offset values.", function ); goto on_error; } if( libfvalue_split_utf8_string_get_number_of_segments( offset_values, &number_of_offset_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of offset values", function ); goto on_error; } if( ( number_of_offset_values != 1 ) && ( number_of_offset_values != 3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported number of offset values.", function ); goto on_error; } if( number_of_offset_values == 3 ) { if( libfvalue_split_utf8_string_get_segment_by_index( offset_values, 1, &offset_value_string, &offset_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset value string: 1.", function ); goto on_error; } if( libfvalue_utf8_string_copy_to_integer( offset_value_string, offset_value_string_size, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set data offset.", function ); goto on_error; } single_file_entry->data_offset = (off64_t) value_64bit; if( libfvalue_split_utf8_string_get_segment_by_index( offset_values, 2, &offset_value_string, &offset_value_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset value string: 2.", function ); goto on_error; } if( libfvalue_utf8_string_copy_to_integer( offset_value_string, offset_value_string_size, &value_64bit, 64, LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set data size.", function ); goto on_error; } single_file_entry->data_size = (size64_t) value_64bit; } if( libfvalue_split_utf8_string_free( &offset_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split offset values.", function ); goto on_error; } return( 1 ); on_error: if( offset_values != NULL ) { libfvalue_split_utf8_string_free( &offset_values, NULL ); } return( -1 ); } libewf-20140807/libewf/libewf_libcdata.h0000664000175000017500000000301013440663046022045 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2006-2018, 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_LIBCDATA_H ) #define _LIBEWF_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBEWF_LIBCDATA_H ) */ libewf-20140807/libewf/libewf_hash_values.h0000644000175000017500000000446413421013624022606 0ustar00lordyestalordyesta00000000000000/* * Hash values functions * * 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_HASH_VALUES_H ) #define _LIBEWF_HASH_VALUES_H #include #include #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #if defined( __cplusplus ) extern "C" { #endif enum LIBEWF_HASH_VALUES_INDEXES { /* Value to indicate the number of hash values */ LIBEWF_HASH_VALUES_DEFAULT_NUMBER }; int libewf_hash_values_initialize( libfvalue_table_t **hash_values, libcerror_error_t **error ); int libewf_hash_values_parse_md5_hash( libfvalue_table_t *hash_values, const uint8_t *md5_hash, size_t md5_hash_size, libcerror_error_t **error ); int libewf_hash_values_parse_sha1_hash( libfvalue_table_t *hash_values, const uint8_t *sha1_hash, size_t sha1_hash_size, libcerror_error_t **error ); int libewf_hash_values_parse_xhash( libfvalue_table_t *hash_values, const uint8_t *xhash, size_t xhash_size, libcerror_error_t **error ); int libewf_hash_values_generate_xhash( libfvalue_table_t *hash_values, uint8_t **xhash, size_t *xhash_size, libcerror_error_t **error ); int libewf_hash_values_generate_md5_hash( libfvalue_table_t *hash_values, uint8_t *md5_hash, size_t md5_hash_size, uint8_t *md5_hash_set, libcerror_error_t **error ); int libewf_hash_values_generate_sha1_hash( libfvalue_table_t *hash_values, uint8_t *sha1_hash, size_t sha1_hash_size, uint8_t *sha1_hash_set, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_deflate.c0000664000175000017500000012033313442120661021702 0ustar00lordyestalordyesta00000000000000/* * Deflate (zlib) (un)compression functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include "libewf_deflate.h" #include "libewf_libcerror.h" /* Retrieves a value from the bit stream * Returns 1 on success or -1 on error */ int libewf_deflate_bit_stream_get_value( libewf_deflate_bit_stream_t *bit_stream, uint8_t number_of_bits, uint32_t *value_32bit, libcerror_error_t **error ) { static char *function = "libewf_deflate_bit_stream_get_value"; uint32_t safe_value_32bit = 0; if( bit_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bit stream.", function ); return( -1 ); } if( number_of_bits > (uint8_t) 32 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of bits value exceeds maximum.", function ); return( -1 ); } if( value_32bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid 32-bit value.", function ); return( -1 ); } if( number_of_bits == 0 ) { *value_32bit = 0; return( 1 ); } while( bit_stream->bit_buffer_size < number_of_bits ) { if( bit_stream->byte_stream_offset >= bit_stream->byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid byte stream value to small.", function ); return( -1 ); } safe_value_32bit = bit_stream->byte_stream[ bit_stream->byte_stream_offset++ ]; safe_value_32bit <<= bit_stream->bit_buffer_size; bit_stream->bit_buffer |= safe_value_32bit; bit_stream->bit_buffer_size += 8; } safe_value_32bit = bit_stream->bit_buffer; if( number_of_bits < 32 ) { /* On VS 2008 32-bit "~( 0xfffffffUL << 32 )" does not behave as expected */ safe_value_32bit &= ~( 0xffffffffUL << number_of_bits ); bit_stream->bit_buffer >>= number_of_bits; bit_stream->bit_buffer_size -= number_of_bits; } else { bit_stream->bit_buffer = 0; bit_stream->bit_buffer_size = 0; } *value_32bit = safe_value_32bit; return( 1 ); } /* Constructs the Huffman table * Returns 1 on success, 0 if the table is empty or -1 on error */ int libewf_deflate_huffman_table_construct( libewf_deflate_huffman_table_t *table, const uint16_t *code_sizes_array, int number_of_code_sizes, libcerror_error_t **error ) { int code_offsets_array[ 16 ]; static char *function = "libewf_deflate_huffman_table_construct"; uint16_t code_size = 0; uint8_t bit_index = 0; int code_offset = 0; int left_value = 0; int symbol = 0; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table.", function ); return( -1 ); } if( code_sizes_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid code sizes array.", function ); return( -1 ); } if( number_of_code_sizes < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of code sizes value out of bounds.", function ); return( -1 ); } /* TODO hardcoded for now */ table->maximum_number_of_bits = 15; if( table->maximum_number_of_bits > 15 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid table - number of bits values out of bounds.", function ); return( -1 ); } table->number_of_codes = (int) table->maximum_number_of_bits + 1; if( memory_set( &( table->codes_array ), 0, 288 * sizeof( int ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear code counts array.", function ); return( -1 ); } if( memory_set( &( table->code_counts_array ), 0, 16 * sizeof( int ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear code counts array.", function ); return( -1 ); } for( symbol = 0; symbol < number_of_code_sizes; symbol++ ) { code_size = code_sizes_array[ symbol ]; if( code_size > table->number_of_codes ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid symbol: %d code size: %" PRIu16 " value out of bounds.", function, symbol, code_size ); return( -1 ); } table->code_counts_array[ code_size ] += 1; } /* The table has no codes */ if( table->code_counts_array[ 0 ] == number_of_code_sizes ) { return( 0 ); } /* Check if the set of code sizes is incomplete or over-subscribed */ left_value = 1; for( bit_index = 1; bit_index <= table->maximum_number_of_bits; bit_index++ ) { left_value <<= 1; left_value -= table->code_counts_array[ bit_index ]; if( left_value < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: code sizes are over-subscribed.", function ); return( -1 ); } } /* Calculate the offsets for sorting the symbol table */ code_offsets_array[ 0 ] = 0; code_offsets_array[ 1 ] = 0; for( bit_index = 1; bit_index < table->maximum_number_of_bits; bit_index++ ) { code_offsets_array[ bit_index + 1 ] = code_offsets_array[ bit_index ] + table->code_counts_array[ bit_index ]; } for( symbol = 0; symbol < number_of_code_sizes; symbol++ ) { code_size = code_sizes_array[ symbol ]; if( code_size == 0 ) { continue; } code_offset = code_offsets_array[ code_size ]; if( ( code_offset < 0 ) || ( code_offset > number_of_code_sizes ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid symbol: %d code offset: %d value out of bounds.", function, symbol, code_offset ); return( -1 ); } code_offsets_array[ code_size ] += 1; table->codes_array[ code_offset ] = symbol; } /* TODO only used by dynamic Huffman if( left_value > 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: code sizes are incomplete.", function ); return( -1 ); } */ return( 1 ); } /* Retrieves a Huffman encoded value from the bit stream * Returns 1 on success or -1 on error */ int libewf_deflate_bit_stream_get_huffman_encoded_value( libewf_deflate_bit_stream_t *bit_stream, libewf_deflate_huffman_table_t *table, uint32_t *value_32bit, libcerror_error_t **error ) { static char *function = "libewf_deflate_bit_stream_get_huffman_encoded_value"; uint32_t bit_buffer = 0; uint32_t safe_value_32bit = 0; uint8_t bit_index = 0; uint8_t number_of_bits = 0; int code_size_count = 0; int first_huffman_code = 0; int first_index = 0; int huffman_code = 0; int result = 0; if( bit_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bit stream.", function ); return( -1 ); } if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table.", function ); return( -1 ); } if( value_32bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid 32-bit value.", function ); return( -1 ); } /* Try to fill the bit buffer with the maximum number of bits */ while( bit_stream->bit_buffer_size < table->maximum_number_of_bits ) { if( bit_stream->byte_stream_offset >= bit_stream->byte_stream_size ) { break; } safe_value_32bit = bit_stream->byte_stream[ bit_stream->byte_stream_offset++ ]; safe_value_32bit <<= bit_stream->bit_buffer_size; bit_stream->bit_buffer |= safe_value_32bit; bit_stream->bit_buffer_size += 8; } if( table->maximum_number_of_bits < bit_stream->bit_buffer_size ) { number_of_bits = table->maximum_number_of_bits; } else { number_of_bits = bit_stream->bit_buffer_size; } bit_buffer = bit_stream->bit_buffer; for( bit_index = 1; bit_index <= number_of_bits; bit_index++ ) { huffman_code <<= 1; huffman_code |= (int) bit_buffer & 0x00000001UL; bit_buffer >>= 1; code_size_count = table->code_counts_array[ bit_index ]; if( ( huffman_code - code_size_count ) < first_huffman_code ) { safe_value_32bit = table->codes_array[ first_index + ( huffman_code - first_huffman_code ) ]; result = 1; break; } first_huffman_code += code_size_count; first_huffman_code <<= 1; first_index += code_size_count; } if( result != 0 ) { bit_stream->bit_buffer >>= bit_index; bit_stream->bit_buffer_size -= bit_index; } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid huffman encoded value.", function ); return( -1 ); } *value_32bit = safe_value_32bit; return( 1 ); } /* Initializes the dynamic Huffman tables * Returns 1 on success or -1 on error */ int libewf_deflate_initialize_dynamic_huffman_tables( libewf_deflate_bit_stream_t *bit_stream, libewf_deflate_huffman_table_t *literals_table, libewf_deflate_huffman_table_t *distances_table, libcerror_error_t **error ) { uint16_t code_size_array[ 316 ]; uint8_t code_sizes_sequence[ 19 ] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; libewf_deflate_huffman_table_t codes_table; static char *function = "libewf_deflate_initialize_dynamic_huffman_tables"; uint32_t code_size = 0; uint32_t code_size_index = 0; uint32_t code_size_sequence = 0; uint32_t number_of_code_sizes = 0; uint32_t number_of_distance_codes = 0; uint32_t number_of_literal_codes = 0; uint32_t symbol = 0; uint32_t times_to_repeat = 0; if( libewf_deflate_bit_stream_get_value( bit_stream, 14, &number_of_code_sizes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } number_of_literal_codes = number_of_code_sizes & 0x0000001fUL; number_of_code_sizes >>= 5; number_of_distance_codes = number_of_code_sizes & 0x0000001fUL; number_of_code_sizes >>= 5; number_of_literal_codes += 257; if( number_of_literal_codes > 286 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of literal codes value out of bounds.", function ); return( -1 ); } number_of_distance_codes += 1; if( number_of_distance_codes > 30 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of distance codes value out of bounds.", function ); return( -1 ); } number_of_code_sizes += 4; for( code_size_index = 0; code_size_index < number_of_code_sizes; code_size_index++ ) { if( libewf_deflate_bit_stream_get_value( bit_stream, 3, &code_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } code_size_sequence = code_sizes_sequence[ code_size_index ]; code_size_array[ code_size_sequence ] = (uint16_t) code_size; } while( code_size_index < 19 ) { code_size_sequence = code_sizes_sequence[ code_size_index++ ]; code_size_array[ code_size_sequence ] = 0; } if( libewf_deflate_huffman_table_construct( &codes_table, code_size_array, 19, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct codes table.", function ); return( -1 ); } number_of_code_sizes = number_of_literal_codes + number_of_distance_codes; code_size_index = 0; while( code_size_index < number_of_code_sizes ) { if( libewf_deflate_bit_stream_get_huffman_encoded_value( bit_stream, &codes_table, &symbol, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve literal value from bit stream.", function ); return( -1 ); } if( symbol < 16 ) { code_size_array[ code_size_index++ ] = (uint16_t) symbol; continue; } code_size = 0; if( symbol == 16 ) { if( code_size_index == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid code size index value out of bounds.", function ); return( -1 ); } code_size = (uint32_t) code_size_array[ code_size_index - 1 ]; if( libewf_deflate_bit_stream_get_value( bit_stream, 2, ×_to_repeat, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } times_to_repeat += 3; } else if( symbol == 17 ) { if( libewf_deflate_bit_stream_get_value( bit_stream, 3, ×_to_repeat, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } times_to_repeat += 3; } else if( symbol == 18 ) { if( libewf_deflate_bit_stream_get_value( bit_stream, 7, ×_to_repeat, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } times_to_repeat += 11; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid code value value out of bounds.", function ); return( -1 ); } if( ( code_size_index + times_to_repeat ) > number_of_code_sizes ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid times to repeat value out of bounds.", function ); return( -1 ); } while( times_to_repeat > 0 ) { code_size_array[ code_size_index++ ] = (uint16_t) code_size; times_to_repeat--; } } if( code_size_array[ 256 ] == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: end-of-block code value missing in literal codes array.", function ); return( -1 ); } if( libewf_deflate_huffman_table_construct( literals_table, code_size_array, number_of_literal_codes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct literals table.", function ); return( -1 ); } if( libewf_deflate_huffman_table_construct( distances_table, &( code_size_array[ number_of_literal_codes ] ), number_of_distance_codes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct distances table.", function ); return( -1 ); } return( 1 ); } /* Initializes the fixed Huffman tables * Returns 1 on success or -1 on error */ int libewf_deflate_initialize_fixed_huffman_tables( libewf_deflate_huffman_table_t *literals_table, libewf_deflate_huffman_table_t *distances_table, libcerror_error_t **error ) { uint16_t code_size_array[ 318 ]; static char *function = "libewf_deflate_initialize_fixed_huffman_tables"; uint16_t symbol = 0; for( symbol = 0; symbol < 318; symbol++ ) { if( symbol < 144 ) { code_size_array[ symbol ] = 8; } else if( symbol < 256 ) { code_size_array[ symbol ] = 9; } else if( symbol < 280 ) { code_size_array[ symbol ] = 7; } else if( symbol < 288 ) { code_size_array[ symbol ] = 8; } else { code_size_array[ symbol ] = 5; } } if( libewf_deflate_huffman_table_construct( literals_table, code_size_array, 288, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct literals table.", function ); return( -1 ); } if( libewf_deflate_huffman_table_construct( distances_table, &( code_size_array[ 288 ] ), 30, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct distances table.", function ); return( -1 ); } return( 1 ); } /* Decodes a Huffman compressed block * Returns 1 on success or -1 on error */ int libewf_deflate_decode_huffman( libewf_deflate_bit_stream_t *bit_stream, libewf_deflate_huffman_table_t *literals_table, libewf_deflate_huffman_table_t *distances_table, uint8_t *uncompressed_data, size_t uncompressed_data_size, size_t *uncompressed_data_offset, libcerror_error_t **error ) { uint16_t literal_codes_base[ 29 ] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; uint16_t literal_codes_number_of_extra_bits[ 29 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; uint16_t distance_codes_base[ 30 ] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; uint16_t distance_codes_number_of_extra_bits[ 30 ] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; static char *function = "libewf_deflate_decode_huffman"; size_t data_offset = 0; uint32_t code_value = 0; uint32_t extra_bits = 0; uint16_t compression_offset = 0; uint16_t compression_size = 0; uint16_t number_of_extra_bits = 0; if( uncompressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data.", function ); return( -1 ); } if( uncompressed_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid uncompressed data size value exceeds maximum.", function ); return( -1 ); } if( uncompressed_data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data offset.", function ); return( -1 ); } data_offset = *uncompressed_data_offset; do { if( libewf_deflate_bit_stream_get_huffman_encoded_value( bit_stream, literals_table, &code_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve listeral value from bit stream.", function ); return( -1 ); } if( code_value < 256 ) { if( data_offset >= uncompressed_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid uncompressed data value too small.", function ); return( -1 ); } uncompressed_data[ data_offset++ ] = (uint8_t) code_value; } else if( ( code_value > 256 ) && ( code_value < 286 ) ) { code_value -= 257; number_of_extra_bits = literal_codes_number_of_extra_bits[ code_value ]; if( libewf_deflate_bit_stream_get_value( bit_stream, (uint8_t) number_of_extra_bits, &extra_bits, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve literal extra value from bit stream.", function ); return( -1 ); } compression_size = literal_codes_base[ code_value ] + (uint16_t) extra_bits; if( libewf_deflate_bit_stream_get_huffman_encoded_value( bit_stream, distances_table, &code_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve distance value from bit stream.", function ); return( -1 ); } number_of_extra_bits = distance_codes_number_of_extra_bits[ code_value ]; if( libewf_deflate_bit_stream_get_value( bit_stream, (uint8_t) number_of_extra_bits, &extra_bits, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve distance extra value from bit stream.", function ); return( -1 ); } compression_offset = distance_codes_base[ code_value ] + (uint16_t) extra_bits; if( compression_offset > data_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid compression offset value out of bounds.", function ); return( -1 ); } if( ( data_offset + compression_size ) > uncompressed_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid uncompressed data value too small.", function ); return( -1 ); } while( compression_size > 0 ) { uncompressed_data[ data_offset ] = uncompressed_data[ data_offset - compression_offset ]; data_offset++; compression_size--; } } else if( code_value != 256 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: invalid code value: %" PRIu16 ".", function, code_value ); return( -1 ); } } while( code_value != 256 ); *uncompressed_data_offset = data_offset; return( 1 ); } /* Calculates the little-endian Adler-32 of a buffer * It uses the initial value to calculate a new Adler-32 * Returns 1 if successful or -1 on error */ int libewf_deflate_calculate_adler32( uint32_t *checksum_value, const uint8_t *buffer, size_t size, uint32_t initial_value, libcerror_error_t **error ) { static char *function = "libewf_deflate_calculate_adler32"; size_t buffer_offset = 0; uint32_t lower_word = 0; uint32_t upper_word = 0; uint32_t value_32bit = 0; int block_index = 0; if( checksum_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid checksum value.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } lower_word = initial_value & 0xffff; upper_word = ( initial_value >> 16 ) & 0xffff; while( size >= 0x15b0 ) { /* The modulo calculation is needed per 5552 (0x15b0) bytes * 5552 / 16 = 347 */ for( block_index = 0; block_index < 347; block_index++ ) { lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; } /* Optimized equivalent of: * lower_word %= 0xfff1 */ value_32bit = lower_word >> 16; lower_word &= 0x0000ffffUL; lower_word += ( value_32bit << 4 ) - value_32bit; if( lower_word > 65521 ) { value_32bit = lower_word >> 16; lower_word &= 0x0000ffffUL; lower_word += ( value_32bit << 4 ) - value_32bit; } if( lower_word >= 65521 ) { lower_word -= 65521; } /* Optimized equivalent of: * upper_word %= 0xfff1 */ value_32bit = upper_word >> 16; upper_word &= 0x0000ffffUL; upper_word += ( value_32bit << 4 ) - value_32bit; if( upper_word > 65521 ) { value_32bit = upper_word >> 16; upper_word &= 0x0000ffffUL; upper_word += ( value_32bit << 4 ) - value_32bit; } if( upper_word >= 65521 ) { upper_word -= 65521; } size -= 0x15b0; } if( size > 0 ) { while( size > 16 ) { lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; size -= 16; } while( size > 0 ) { lower_word += buffer[ buffer_offset++ ]; upper_word += lower_word; size--; } /* Optimized equivalent of: * lower_word %= 0xfff1 */ value_32bit = lower_word >> 16; lower_word &= 0x0000ffffUL; lower_word += ( value_32bit << 4 ) - value_32bit; if( lower_word > 65521 ) { value_32bit = lower_word >> 16; lower_word &= 0x0000ffffUL; lower_word += ( value_32bit << 4 ) - value_32bit; } if( lower_word >= 65521 ) { lower_word -= 65521; } /* Optimized equivalent of: * upper_word %= 0xfff1 */ value_32bit = upper_word >> 16; upper_word &= 0x0000ffffUL; upper_word += ( value_32bit << 4 ) - value_32bit; if( upper_word > 65521 ) { value_32bit = upper_word >> 16; upper_word &= 0x0000ffffUL; upper_word += ( value_32bit << 4 ) - value_32bit; } if( upper_word >= 65521 ) { upper_word -= 65521; } } *checksum_value = ( upper_word << 16 ) | lower_word; return( 1 ); } /* Decompresses data using zlib compression * Returns 1 on success or -1 on error */ int libewf_deflate_decompress( const uint8_t *compressed_data, size_t compressed_data_size, uint8_t *uncompressed_data, size_t *uncompressed_data_size, libcerror_error_t **error ) { libewf_deflate_bit_stream_t bit_stream; libewf_deflate_huffman_table_t dynamic_huffman_distances_table; libewf_deflate_huffman_table_t dynamic_huffman_literals_table; libewf_deflate_huffman_table_t fixed_huffman_distances_table; libewf_deflate_huffman_table_t fixed_huffman_literals_table; static char *function = "libewf_deflate_decompress"; size_t compressed_data_offset = 0; size_t uncompressed_data_offset = 0; uint32_t block_size = 0; uint32_t block_size_copy = 0; uint32_t compression_window_size = 0; uint32_t calculated_checksum = 0; uint32_t preset_dictionary_identifier = 0; uint32_t stored_checksum = 0; uint32_t value_32bit = 0; uint8_t block_type = 0; uint8_t compression_information = 0; uint8_t compression_method = 0; uint8_t compression_window_bits = 0; uint8_t last_block_flag = 0; uint8_t skip_bits = 0; if( compressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed data.", function ); return( -1 ); } if( compressed_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid compressed data size value exceeds maximum.", function ); return( -1 ); } if( uncompressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data.", function ); return( -1 ); } if( uncompressed_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data size.", function ); return( -1 ); } if( *uncompressed_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid uncompressed data size value exceeds maximum.", function ); return( -1 ); } if( compressed_data_offset >= compressed_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid compressed data value too small.", function ); return( -1 ); } compression_method = compressed_data[ 0 ] & 0x0f; compression_information = compressed_data[ 0 ] >> 4; /* TODO validate check bits */ if( ( compressed_data[ 1 ] & 0x20 ) != 0 ) { if( compressed_data_size < 6 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid compressed data value too small.", function ); return( -1 ); } byte_stream_copy_to_uint32_big_endian( &( compressed_data[ 2 ] ), preset_dictionary_identifier ); compressed_data_offset += 4; compressed_data_size -= 4; } compressed_data_offset += 2; compressed_data_size -= 2; if( compression_method != 8 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported compression method: %" PRIu8 ".", function, compression_method ); return( -1 ); } compression_window_bits = (uint8_t) compression_information + 8; compression_window_size = 1UL << compression_window_bits; if( compression_window_size > 32768 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported compression window size: %" PRIu32 ".", function, compression_window_size ); return( -1 ); } if( compressed_data_offset >= compressed_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid compressed data value too small.", function ); return( -1 ); } bit_stream.byte_stream = compressed_data; bit_stream.byte_stream_size = compressed_data_size; bit_stream.byte_stream_offset = compressed_data_offset; bit_stream.bit_buffer = 0; bit_stream.bit_buffer_size = 0; if( libewf_deflate_initialize_fixed_huffman_tables( &fixed_huffman_literals_table, &fixed_huffman_distances_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct fixed Huffman tables.", function ); return( -1 ); } /* TODO find optimized solution to read bit stream from bytes */ while( bit_stream.byte_stream_offset < bit_stream.byte_stream_size ) { if( libewf_deflate_bit_stream_get_value( &bit_stream, 3, &value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } last_block_flag = (uint8_t) ( value_32bit & 0x00000001UL ); value_32bit >>= 1; block_type = (uint8_t) value_32bit; switch( block_type ) { case LIBEWF_DEFLATE_BLOCK_TYPE_UNCOMPRESSED: /* Ignore the bits in the buffer upto the next byte */ skip_bits = bit_stream.bit_buffer_size & 0x07; if( skip_bits > 0 ) { if( libewf_deflate_bit_stream_get_value( &bit_stream, skip_bits, &value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } } if( libewf_deflate_bit_stream_get_value( &bit_stream, 32, &block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from bit stream.", function ); return( -1 ); } block_size_copy = ( block_size >> 16 ) ^ 0x0000ffffUL; block_size &= 0x0000ffffUL; if( block_size != block_size_copy ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: mismatch in block size ( %" PRIu32 " != %" PRIu32 " ).", function, block_size, block_size_copy ); return( -1 ); } if( block_size == 0 ) { break; } if( (size_t) block_size > ( bit_stream.byte_stream_size - bit_stream.byte_stream_offset ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid compressed data value too small.", function ); return( -1 ); } if( (size_t) block_size > ( *uncompressed_data_size - uncompressed_data_offset ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid uncompressed data value too small.", function ); return( -1 ); } if( memory_copy( &( uncompressed_data[ uncompressed_data_offset ] ), &( compressed_data[ bit_stream.byte_stream_offset ] ), (size_t) block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to initialize lz buffer.", function ); return( -1 ); } bit_stream.byte_stream_offset += block_size; uncompressed_data_offset += block_size; /* Flush the bit-stream buffer */ bit_stream.bit_buffer = 0; bit_stream.bit_buffer_size = 0; break; case LIBEWF_DEFLATE_BLOCK_TYPE_HUFFMAN_FIXED: if( libewf_deflate_decode_huffman( &bit_stream, &fixed_huffman_literals_table, &fixed_huffman_distances_table, uncompressed_data, *uncompressed_data_size, &uncompressed_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to decode fixed Huffman encoded bit stream.", function ); return( -1 ); } break; case LIBEWF_DEFLATE_BLOCK_TYPE_HUFFMAN_DYNAMIC: if( libewf_deflate_initialize_dynamic_huffman_tables( &bit_stream, &dynamic_huffman_literals_table, &dynamic_huffman_distances_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to construct dynamic Huffman tables.", function ); return( -1 ); } if( libewf_deflate_decode_huffman( &bit_stream, &dynamic_huffman_literals_table, &dynamic_huffman_distances_table, uncompressed_data, *uncompressed_data_size, &uncompressed_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to decode dynamic Huffman encoded bit stream.", function ); return( -1 ); } break; case LIBEWF_DEFLATE_BLOCK_TYPE_RESERVED: default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported block type.", function ); return( -1 ); } if( last_block_flag != 0 ) { break; } } if( ( bit_stream.byte_stream_size - bit_stream.byte_stream_offset ) >= 4 ) { while( bit_stream.bit_buffer_size >= 8 ) { bit_stream.byte_stream_offset -= 1; bit_stream.bit_buffer_size -= 8; } byte_stream_copy_to_uint32_big_endian( &( bit_stream.byte_stream[ bit_stream.byte_stream_offset ] ), stored_checksum ); if( libewf_deflate_calculate_adler32( &calculated_checksum, uncompressed_data, uncompressed_data_offset, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( stored_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: checksum does not match (stored: 0x%08" PRIx32 ", calculated: 0x%08" PRIx32 ").", function, stored_checksum, calculated_checksum ); return( -1 ); } } *uncompressed_data_size = uncompressed_data_offset; return( 1 ); } libewf-20140807/libewf/libewf_libcerror.h0000664000175000017500000000263213440663046022276 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2006-2018, 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_LIBCERROR_H ) #define _LIBEWF_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBEWF_LIBCERROR_H ) */ libewf-20140807/libewf/libewf_libmfdata.h0000644000175000017500000000272413421013624022224 0ustar00lordyestalordyesta00000000000000/* * The libmfdata header wrapper * * 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_LIBMFDATA_H ) #define _LIBEWF_LIBMFDATA_H #include /* Define HAVE_LOCAL_LIBMFDATA for local use of libmfdata */ #if defined( HAVE_LOCAL_LIBMFDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBMFDATA_DLL_IMPORT * before including libmfdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBMFDATA_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libewf/libewf_handle.c0000664000175000017500000073412213421024433021535 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * 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 . */ #include #include #include #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "libewf_checksum.h" #include "libewf_chunk_data.h" #include "libewf_chunk_table.h" #include "libewf_compression.h" #include "libewf_definitions.h" #include "libewf_empty_block.h" #include "libewf_file_entry.h" #include "libewf_handle.h" #include "libewf_header_values.h" #include "libewf_io_handle.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.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_files.h" #include "libewf_single_file_tree.h" #include "libewf_types.h" #include "libewf_unused.h" #include "libewf_write_io_handle.h" #include "ewf_data.h" #include "ewf_definitions.h" #include "ewf_file_header.h" /* Initialize the handle * The handle must point to a NULL pointer to be allocated * Returns 1 if successful or -1 on error */ int libewf_handle_initialize( libewf_handle_t **handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } internal_handle = memory_allocate_structure( libewf_internal_handle_t ); if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create handle.", function ); goto on_error; } if( memory_set( internal_handle, 0, sizeof( libewf_internal_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear handle.", function ); memory_free( internal_handle ); return( -1 ); } if( libewf_io_handle_initialize( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create IO handle.", function ); goto on_error; } if( libewf_media_values_initialize( &( internal_handle->media_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create media values.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->sessions ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sessions array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->tracks ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create tracks array.", function ); goto on_error; } if( libcdata_range_list_initialize( &( internal_handle->acquiry_errors ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create acquiry errors range list.", function ); goto on_error; } internal_handle->date_format = LIBEWF_DATE_FORMAT_CTIME; internal_handle->maximum_number_of_open_handles = LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES; *handle = (libewf_handle_t *) internal_handle; return( 1 ); on_error: if( internal_handle != NULL ) { if( internal_handle->tracks != NULL ) { libcdata_array_free( &( internal_handle->tracks ), NULL, NULL ); } if( internal_handle->sessions != NULL ) { libcdata_array_free( &( internal_handle->sessions ), NULL, NULL ); } if( internal_handle->media_values != NULL ) { libewf_media_values_free( &( internal_handle->media_values ), NULL ); } if( internal_handle->io_handle != NULL ) { libewf_io_handle_free( &( internal_handle->io_handle ), NULL ); } memory_free( internal_handle ); } return( -1 ); } /* Frees the handle including elements * Returns 1 if successful or -1 on error */ int libewf_handle_free( libewf_handle_t **handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_internal_handle_free"; int result = 1; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { internal_handle = (libewf_internal_handle_t *) *handle; if( internal_handle->file_io_pool != NULL ) { if( libewf_handle_close( *handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); result = -1; } } *handle = NULL; if( libewf_io_handle_free( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } if( libewf_media_values_free( &( internal_handle->media_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free media values.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->sessions ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sessions array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->tracks ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free tracks array.", function ); result = -1; } if( libcdata_range_list_free( &( internal_handle->acquiry_errors ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free acquiry errors range list.", function ); result = -1; } memory_free( internal_handle ); } return( result ); } /* Clones the handle including elements * Returns 1 if successful or -1 on error */ int libewf_handle_clone( libewf_handle_t **destination_handle, libewf_handle_t *source_handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_destination_handle = NULL; libewf_internal_handle_t *internal_source_handle = NULL; static char *function = "libewf_handle_clone"; if( destination_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination handle.", function ); return( -1 ); } if( *destination_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination handle value already set.", function ); return( -1 ); } if( source_handle == NULL ) { *destination_handle = NULL; return( 1 ); } internal_source_handle = (libewf_internal_handle_t *) *source_handle; if( internal_source_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source handle - missing IO handle.", function ); return( -1 ); } if( ( internal_source_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); return( -1 ); } internal_destination_handle = memory_allocate_structure( libewf_internal_handle_t ); if( internal_destination_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination handle.", function ); goto on_error; } if( memory_set( internal_destination_handle, 0, sizeof( libewf_internal_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination handle.", function ); goto on_error; } if( libewf_io_handle_clone( &( internal_destination_handle->io_handle ), internal_source_handle->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination IO handle.", function ); goto on_error; } if( libewf_media_values_clone( &( internal_destination_handle->media_values ), internal_source_handle->media_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination media values.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_handle->sessions ), internal_source_handle->sessions, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libewf_sector_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination sessions array.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_handle->tracks ), internal_source_handle->tracks, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libewf_sector_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination tracks array.", function ); goto on_error; } if( libcdata_range_list_clone( &( internal_destination_handle->acquiry_errors ), internal_source_handle->acquiry_errors, NULL, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination acquiry errors range list.", function ); goto on_error; } if( internal_source_handle->file_io_pool != NULL ) { if( libbfio_pool_clone( &( internal_destination_handle->file_io_pool ), internal_source_handle->file_io_pool, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination file IO pool.", function ); goto on_error; } internal_destination_handle->file_io_pool_created_in_library = 1; } if( internal_source_handle->read_io_handle != NULL ) { if( libewf_read_io_handle_clone( &( internal_destination_handle->read_io_handle ), internal_source_handle->read_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination read IO handle.", function ); goto on_error; } } if( internal_source_handle->write_io_handle != NULL ) { if( libewf_write_io_handle_clone( &( internal_destination_handle->write_io_handle ), internal_source_handle->write_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination write IO handle.", function ); goto on_error; } } if( internal_source_handle->segment_files_list != NULL ) { if( libmfdata_file_list_clone( &( internal_destination_handle->segment_files_list ), internal_source_handle->segment_files_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segment files list.", function ); goto on_error; } } if( internal_source_handle->delta_segment_files_list != NULL ) { if( libmfdata_file_list_clone( &( internal_destination_handle->delta_segment_files_list ), internal_source_handle->delta_segment_files_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination delta segment files list.", function ); goto on_error; } } if( internal_source_handle->segment_files_cache != NULL ) { if( libfcache_cache_clone( &( internal_destination_handle->segment_files_cache ), internal_source_handle->segment_files_cache, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segment files cache.", function ); goto on_error; } } if( internal_source_handle->segment_table != NULL ) { if( libewf_segment_table_clone( &( internal_destination_handle->segment_table ), internal_source_handle->segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segment table.", function ); goto on_error; } } if( internal_source_handle->delta_segment_table != NULL ) { if( libewf_segment_table_clone( &( internal_destination_handle->delta_segment_table ), internal_source_handle->delta_segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination delta segment table.", function ); goto on_error; } } if( internal_source_handle->chunk_table_list != NULL ) { if( libmfdata_list_clone( &( internal_destination_handle->chunk_table_list ), internal_source_handle->chunk_table_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination chunk table list.", function ); goto on_error; } } if( internal_source_handle->chunk_table_cache != NULL ) { if( libfcache_cache_clone( &( internal_destination_handle->chunk_table_cache ), internal_source_handle->chunk_table_cache, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination chunk table cache.", function ); goto on_error; } } if( internal_source_handle->header_sections != NULL ) { if( libewf_header_sections_clone( &( internal_destination_handle->header_sections ), internal_source_handle->header_sections, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination header sections.", function ); goto on_error; } } if( internal_source_handle->hash_sections != NULL ) { if( libewf_hash_sections_clone( &( internal_destination_handle->hash_sections ), internal_source_handle->hash_sections, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination hash sections.", function ); goto on_error; } } if( internal_source_handle->header_values != NULL ) { if( libfvalue_table_clone( &( internal_destination_handle->header_values ), internal_source_handle->header_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination header values.", function ); goto on_error; } internal_destination_handle->header_values_parsed = internal_source_handle->header_values_parsed; } if( internal_source_handle->hash_values != NULL ) { if( libfvalue_table_clone( &( internal_destination_handle->hash_values ), internal_source_handle->hash_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination hash values.", function ); goto on_error; } internal_destination_handle->hash_values_parsed = internal_source_handle->hash_values_parsed; } internal_destination_handle->maximum_number_of_open_handles = internal_source_handle->maximum_number_of_open_handles; internal_destination_handle->date_format = internal_source_handle->date_format; return( 1 ); on_error: if( internal_destination_handle != NULL ) { if( internal_destination_handle->hash_values != NULL ) { libfvalue_table_free( &( internal_destination_handle->hash_values ), NULL ); } if( internal_destination_handle->header_values != NULL ) { libfvalue_table_free( &( internal_destination_handle->header_values ), NULL ); } if( internal_destination_handle->hash_sections != NULL ) { libewf_hash_sections_free( &( internal_destination_handle->hash_sections ), NULL ); } if( internal_destination_handle->header_sections != NULL ) { libewf_header_sections_free( &( internal_destination_handle->header_sections ), NULL ); } if( internal_destination_handle->chunk_table_list != NULL ) { libmfdata_list_free( &( internal_destination_handle->chunk_table_list ), NULL ); } if( internal_destination_handle->chunk_table_cache != NULL ) { libfcache_cache_free( &( internal_destination_handle->chunk_table_cache ), NULL ); } if( internal_destination_handle->delta_segment_table != NULL ) { libewf_segment_table_free( &( internal_destination_handle->delta_segment_table ), NULL ); } if( internal_destination_handle->segment_table != NULL ) { libewf_segment_table_free( &( internal_destination_handle->segment_table ), NULL ); } if( internal_destination_handle->segment_files_cache != NULL ) { libfcache_cache_free( &( internal_destination_handle->segment_files_cache ), NULL ); } if( internal_destination_handle->delta_segment_files_list != NULL ) { libmfdata_file_list_free( &( internal_destination_handle->delta_segment_files_list ), NULL ); } if( internal_destination_handle->segment_files_list != NULL ) { libmfdata_file_list_free( &( internal_destination_handle->segment_files_list ), NULL ); } if( internal_destination_handle->write_io_handle != NULL ) { libewf_write_io_handle_free( &( internal_destination_handle->write_io_handle ), NULL ); } if( internal_destination_handle->read_io_handle != NULL ) { libewf_read_io_handle_free( &( internal_destination_handle->read_io_handle ), NULL ); } if( internal_destination_handle->file_io_pool != NULL ) { libbfio_pool_free( &( internal_destination_handle->file_io_pool ), NULL ); } if( internal_destination_handle->acquiry_errors != NULL ) { libcdata_range_list_free( &( internal_destination_handle->acquiry_errors ), NULL, NULL ); } if( internal_destination_handle->tracks != NULL ) { libcdata_array_free( &( internal_destination_handle->tracks ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, NULL ); } if( internal_destination_handle->sessions != NULL ) { libcdata_array_free( &( internal_destination_handle->sessions ), (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, NULL ); } if( internal_destination_handle->media_values != NULL ) { libewf_media_values_free( &( internal_destination_handle->media_values ), NULL ); } if( internal_destination_handle->io_handle != NULL ) { libewf_io_handle_free( &( internal_destination_handle->io_handle ), NULL ); } memory_free( internal_destination_handle ); } return( -1 ); } /* Signals the handle to abort its current activity * Returns 1 if successful or -1 on error */ int libewf_handle_signal_abort( libewf_handle_t *handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_signal_abort"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } internal_handle->io_handle->abort = 1; return( 1 ); } /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns 1 if successful or -1 on error */ int libewf_handle_open( libewf_handle_t *handle, char * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libbfio_pool_t *file_io_pool = NULL; libewf_internal_handle_t *internal_handle = NULL; char *first_delta_segment_filename = NULL; char *first_segment_filename = NULL; static char *function = "libewf_handle_open"; size_t filename_length = 0; int file_io_pool_entry = 0; int filename_iterator = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - segment table already set.", function ); return( -1 ); } if( internal_handle->delta_segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - delta segment table already set.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of files zero or less.", function ); return( -1 ); } if( libbfio_pool_initialize( &file_io_pool, 0, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO pool.", function ); goto on_error; } if( ( ( access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) || ( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) ) { for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { filename_length = narrow_string_length( filenames[ filename_iterator ] ); /* Make sure there is more to the filename than the extension */ if( filename_length <= 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: filename: %s is too small.", function, filenames[ filename_iterator ] ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle.", function ); goto on_error; } #endif if( libbfio_file_set_name( file_io_handle, filenames[ filename_iterator ], filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } if( libbfio_pool_append_handle( file_io_pool, &file_io_pool_entry, file_io_handle, LIBBFIO_OPEN_READ, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle to pool.", function ); goto on_error; } file_io_handle = NULL; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: added file IO pool entry: %d with filename: %s.\n", function, file_io_pool_entry, filenames[ filename_iterator ] ); } #endif if( ( filenames[ filename_iterator ][ filename_length - 3 ] == 'e' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'E' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'l' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'L' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 's' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'S' ) ) { if( ( filenames[ filename_iterator ][ filename_length - 2 ] == '0' ) && ( filenames[ filename_iterator ][ filename_length - 1 ] == '1' ) ) { first_segment_filename = filenames[ filename_iterator ]; if( first_delta_segment_filename == NULL ) { first_delta_segment_filename = filenames[ filename_iterator ]; } } } else if( ( filenames[ filename_iterator ][ filename_length - 3 ] == 'd' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'D' ) ) { if( ( filenames[ filename_iterator ][ filename_length - 2 ] == '0' ) && ( filenames[ filename_iterator ][ filename_length - 1 ] == '1' ) ) { first_delta_segment_filename = filenames[ filename_iterator ]; } } } } if( libewf_segment_table_initialize( &( internal_handle->segment_table ), LIBEWF_DEFAULT_SEGMENT_FILE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment table.", function ); goto on_error; } if( libewf_segment_table_initialize( &( internal_handle->delta_segment_table ), INT64_MAX, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create delta segment table.", function ); goto on_error; } if( ( access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) { /* Get the basename of the first segment file */ if( first_segment_filename != NULL ) { filename_length = narrow_string_length( first_segment_filename ); /* Set segment table basename */ if( libewf_segment_table_set_basename( internal_handle->segment_table, first_segment_filename, filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in segment table.", function ); goto on_error; } } /* Get the basename of the first delta segment file */ if( first_delta_segment_filename != NULL ) { filename_length = narrow_string_length( first_delta_segment_filename ); /* Set delta segment table basename */ if( libewf_segment_table_set_basename( internal_handle->delta_segment_table, first_delta_segment_filename, filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in delta segment table.", function ); goto on_error; } } } else if( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) { /* Get the basename of the first segment file */ if( first_segment_filename != NULL ) { filename_length = narrow_string_length( first_segment_filename ); /* Set segment table basename */ if( libewf_segment_table_set_basename( internal_handle->segment_table, first_segment_filename, filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in segment table.", function ); goto on_error; } } } else if( ( access_flags & LIBEWF_ACCESS_FLAG_WRITE ) != 0 ) { /* Get the basename and store it in the segment tables */ filename_length = narrow_string_length( filenames[ 0 ] ); /* Set segment table basename */ if( libewf_segment_table_set_basename( internal_handle->segment_table, filenames[ 0 ], filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in segment table.", function ); goto on_error; } } if( libewf_handle_open_file_io_pool( handle, file_io_pool, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle using a file IO pool.", function ); goto on_error; } internal_handle->file_io_pool_created_in_library = 1; return( 1 ); on_error: if( internal_handle->delta_segment_table != NULL ) { libewf_segment_table_free( &( internal_handle->delta_segment_table ), NULL ); } if( internal_handle->segment_table != NULL ) { libewf_segment_table_free( &( internal_handle->segment_table ), NULL ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( file_io_pool != NULL ) { libbfio_pool_free( &file_io_pool, NULL ); } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a set of EWF file(s) * For reading files should contain all filenames that make up an EWF image * For writing files should contain the base of the filename, extentions like .e01 will be automatically added * Returns 1 if successful or -1 on error */ int libewf_handle_open_wide( libewf_handle_t *handle, wchar_t * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libbfio_pool_t *file_io_pool = NULL; libewf_internal_handle_t *internal_handle = NULL; wchar_t *first_delta_segment_filename = NULL; wchar_t *first_segment_filename = NULL; static char *function = "libewf_handle_open_wide"; size_t filename_length = 0; int file_io_pool_entry = 0; int filename_iterator = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - segment table already set.", function ); return( -1 ); } if( internal_handle->delta_segment_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - delta segment table already set.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of files zero or less.", function ); return( -1 ); } if( libbfio_pool_initialize( &file_io_pool, 0, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO pool.", function ); goto on_error; } if( ( ( access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) || ( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) ) { for( filename_iterator = 0; filename_iterator < number_of_filenames; filename_iterator++ ) { filename_length = wide_string_length( filenames[ filename_iterator ] ); /* Make sure there is more to the filename than the extension */ if( filename_length <= 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: filename: %ls is too small.", function, filenames[ filename_iterator ] ); goto on_error; } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle.", function ); goto on_error; } #endif if( libbfio_file_set_name_wide( file_io_handle, filenames[ filename_iterator ], filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in file IO handle.", function ); goto on_error; } if( libbfio_pool_append_handle( file_io_pool, &file_io_pool_entry, file_io_handle, LIBBFIO_OPEN_READ, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append file IO handle to pool.", function ); goto on_error; } file_io_handle = NULL; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: added file IO pool entry: %d with filename: %ls.\n", function, file_io_pool_entry, filenames[ filename_iterator ] ); } #endif if( ( filenames[ filename_iterator ][ filename_length - 3 ] == 'e' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'E' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'l' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'L' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 's' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'S' ) ) { if( ( filenames[ filename_iterator ][ filename_length - 2 ] == '0' ) && ( filenames[ filename_iterator ][ filename_length - 1 ] == '1' ) ) { first_segment_filename = filenames[ filename_iterator ]; if( first_delta_segment_filename == NULL ) { first_delta_segment_filename = filenames[ filename_iterator ]; } } } else if( ( filenames[ filename_iterator ][ filename_length - 3 ] == 'd' ) || ( filenames[ filename_iterator ][ filename_length - 3 ] == 'D' ) ) { if( ( filenames[ filename_iterator ][ filename_length - 2 ] == '0' ) && ( filenames[ filename_iterator ][ filename_length - 1 ] == '1' ) ) { first_delta_segment_filename = filenames[ filename_iterator ]; } } } } if( libewf_segment_table_initialize( &( internal_handle->segment_table ), LIBEWF_DEFAULT_SEGMENT_FILE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment table.", function ); goto on_error; } if( libewf_segment_table_initialize( &( internal_handle->delta_segment_table ), INT64_MAX, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create delta segment table.", function ); goto on_error; } if( ( access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) { /* Get the basename of the first segment file */ if( first_segment_filename != NULL ) { filename_length = wide_string_length( first_segment_filename ); /* Set segment table basename */ if( libewf_segment_table_set_basename_wide( internal_handle->segment_table, first_segment_filename, filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in segment table.", function ); goto on_error; } } /* Get the basename of the first delta segment file */ if( first_delta_segment_filename != NULL ) { filename_length = wide_string_length( first_delta_segment_filename ); /* Set delta segment table basename */ if( libewf_segment_table_set_basename_wide( internal_handle->delta_segment_table, first_delta_segment_filename, filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in delta segment table.", function ); goto on_error; } } } else if( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) { /* Get the basename of the first segment file */ if( first_segment_filename != NULL ) { filename_length = wide_string_length( first_segment_filename ); /* Set segment table basename */ if( libewf_segment_table_set_basename_wide( internal_handle->segment_table, first_segment_filename, filename_length - 4, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in segment table.", function ); goto on_error; } } } else if( ( access_flags & LIBEWF_ACCESS_FLAG_WRITE ) != 0 ) { /* Get the basename and store it in the segment tables */ filename_length = wide_string_length( filenames[ 0 ] ); /* Set segment table basename */ if( libewf_segment_table_set_basename_wide( internal_handle->segment_table, filenames[ 0 ], filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename in segment table.", function ); goto on_error; } } if( libewf_handle_open_file_io_pool( handle, file_io_pool, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open handle using a file IO pool.", function ); goto on_error; } internal_handle->file_io_pool_created_in_library = 1; return( 1 ); on_error: if( internal_handle->delta_segment_table != NULL ) { libewf_segment_table_free( &( internal_handle->delta_segment_table ), NULL ); } if( internal_handle->segment_table != NULL ) { libewf_segment_table_free( &( internal_handle->segment_table ), NULL ); } if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } if( file_io_pool != NULL ) { libbfio_pool_free( &file_io_pool, NULL ); } return( -1 ); } #endif /* Opens a set of EWF file(s) using a Basic File IO (bfio) pool * Returns 1 if successful or -1 on error */ int libewf_handle_open_file_io_pool( libewf_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libewf_chunk_table_t *chunk_table = NULL; libewf_internal_handle_t *internal_handle = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_handle_open_file_io_pool"; ssize_t read_count = 0; uint16_t maximum_delta_segment_number = 0; uint16_t maximum_segment_number = 0; int file_io_pool_entry = 0; int number_of_file_io_handles = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - file IO pool already set.", function ); return( -1 ); } if( internal_handle->segment_files_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - segment files list already set.", function ); return( -1 ); } if( internal_handle->delta_segment_files_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - delta segment files list already set.", function ); return( -1 ); } if( internal_handle->chunk_table_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk table list already set.", function ); return( -1 ); } if( internal_handle->chunk_table_cache != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk table cache already set.", function ); return( -1 ); } if( internal_handle->header_sections != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - header sections already set.", function ); return( -1 ); } if( internal_handle->hash_sections != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - hash sections already set.", function ); return( -1 ); } if( internal_handle->single_files != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - single files already set.", function ); return( -1 ); } if( file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool.", function ); return( -1 ); } if( ( access_flags & ~( LIBEWF_ACCESS_FLAG_READ | LIBEWF_ACCESS_FLAG_WRITE | LIBEWF_ACCESS_FLAG_RESUME ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( internal_handle->segment_table == NULL ) { if( libewf_segment_table_initialize( &( internal_handle->segment_table ), LIBEWF_DEFAULT_SEGMENT_FILE_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment table.", function ); goto on_error; } } if( internal_handle->delta_segment_table == NULL ) { if( libewf_segment_table_initialize( &( internal_handle->delta_segment_table ), INT64_MAX, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create delta segment table.", function ); goto on_error; } } if( ( ( access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) || ( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) ) { if( libewf_read_io_handle_initialize( &( internal_handle->read_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create read IO handle.", function ); goto on_error; } } if( ( access_flags & LIBEWF_ACCESS_FLAG_WRITE ) != 0 ) { if( libewf_write_io_handle_initialize( &( internal_handle->write_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create write IO handle.", function ); goto on_error; } if( libewf_write_io_handle_set_compressed_zero_byte_empty_block( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->media_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compressed zero byte empty block in write IO handle.", function ); goto on_error; } } if( libmfdata_file_list_initialize( &( internal_handle->segment_files_list ), NULL, NULL, NULL, &libewf_segment_file_read, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment files list.", function ); goto on_error; } if( libmfdata_file_list_initialize( &( internal_handle->delta_segment_files_list ), NULL, NULL, NULL, &libewf_segment_file_read, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create delta segment files list.", function ); goto on_error; } if( libfcache_cache_initialize( &( internal_handle->segment_files_cache ), 8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to segment files table cache.", function ); goto on_error; } if( libewf_chunk_table_initialize( &chunk_table, internal_handle->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk table.", function ); goto on_error; } if( libmfdata_list_initialize( &( internal_handle->chunk_table_list ), (intptr_t *) chunk_table, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_chunk_table_free, &libewf_chunk_table_clone, &libewf_chunk_table_read_chunk, &libewf_chunk_table_read_offsets, LIBMFDATA_FLAG_IO_HANDLE_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk table list.", function ); libewf_chunk_table_free( &chunk_table, NULL ); goto on_error; } if( libfcache_cache_initialize( &( internal_handle->chunk_table_cache ), 8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk table cache.", function ); goto on_error; } if( libewf_header_sections_initialize( &( internal_handle->header_sections ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header sections.", function ); goto on_error; } if( libewf_header_values_initialize( &( internal_handle->header_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header values.", function ); goto on_error; } if( libewf_hash_sections_initialize( &( internal_handle->hash_sections ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash sections.", function ); goto on_error; } if( libewf_single_files_initialize( &( internal_handle->single_files ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create single files.", function ); goto on_error; } if( internal_handle->read_io_handle != NULL ) { if( libcdata_range_list_empty( internal_handle->read_io_handle->checksum_errors, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty checksum errors range list.", function ); goto on_error; } } if( libcdata_array_empty( internal_handle->sessions, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->tracks, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); goto on_error; } if( libcdata_range_list_empty( internal_handle->acquiry_errors, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty acquiry errors range list.", function ); goto on_error; } if( ( ( access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) || ( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) ) { if( libbfio_pool_get_number_of_handles( file_io_pool, &number_of_file_io_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of handles in the pool.", function ); goto on_error; } if( libewf_segment_file_initialize( &segment_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment file.", function ); goto on_error; } for( file_io_pool_entry = 0; file_io_pool_entry < number_of_file_io_handles; file_io_pool_entry++ ) { if( libbfio_pool_get_handle( file_io_pool, file_io_pool_entry, &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to retrieve file IO handle: %d from pool.", function, file_io_pool_entry ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: processing file IO pool entry: %d.\n", function, file_io_pool_entry ); } #endif read_count = libewf_segment_file_read_file_header( segment_file, file_io_pool, file_io_pool_entry, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment file header.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( segment_file->segment_number == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_INVALID_DATA, "%s: invalid segment number: 0 in file IO pool entry: %d.", function, file_io_pool_entry ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( ( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_EWF ) || ( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_LWF ) ) { if( segment_file->segment_number > maximum_segment_number ) { if( libmfdata_file_list_resize( internal_handle->segment_files_list, (int) segment_file->segment_number, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to resize data file list.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } maximum_segment_number = segment_file->segment_number; } if( libmfdata_file_list_set_file_by_index( internal_handle->segment_files_list, (int) ( segment_file->segment_number - 1 ), file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file: %" PRIu16 " in list.", function, segment_file->segment_number ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } } else if( segment_file->type == LIBEWF_SEGMENT_FILE_TYPE_DWF ) { if( segment_file->segment_number > maximum_delta_segment_number ) { if( libmfdata_file_list_resize( internal_handle->delta_segment_files_list, (int) segment_file->segment_number, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to resize delta segment files list.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } maximum_delta_segment_number = segment_file->segment_number; } if( libmfdata_file_list_set_file_by_index( internal_handle->delta_segment_files_list, (int) ( segment_file->segment_number - 1 ), file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set delta segment file: %" PRIu16 " in list.", function, segment_file->segment_number ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } /* Re-open the delta segment file with write access */ if( ( access_flags & LIBEWF_ACCESS_FLAG_WRITE ) != 0 ) { if( libbfio_pool_reopen( file_io_pool, file_io_pool_entry, LIBBFIO_OPEN_READ_WRITE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to reopen file IO pool entry: %d.", function, file_io_pool_entry ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } } } } if( libewf_segment_file_free( &segment_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free segment file.", function ); goto on_error; } if( libewf_handle_open_read_segment_files( internal_handle, file_io_pool, chunk_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment files.", function ); if( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) { goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } if( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) { if( libewf_handle_open_read_delta_segment_files( internal_handle, file_io_pool, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read delta segment files.", function ); goto on_error; } } /* Determine the EWF format */ if( libewf_header_sections_parse( internal_handle->header_sections, internal_handle->io_handle, internal_handle->header_values, &( internal_handle->io_handle->format ), error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine format.", function ); goto on_error; } if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { internal_handle->io_handle->format = LIBEWF_FORMAT_SMART; } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); goto on_error; } if( internal_handle->single_files->ltree_data != NULL ) { if( libewf_single_files_parse( internal_handle->single_files, &( internal_handle->media_values->media_size ), &( internal_handle->io_handle->format ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse single files.", function ); goto on_error; } } else { if( libewf_internal_handle_get_media_values( internal_handle, &( internal_handle->media_values->media_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media values.", function ); goto on_error; } } } /* Make sure format specific values are set */ if( internal_handle->io_handle->format != 0 ) { if( libewf_internal_handle_set_format( internal_handle, internal_handle->io_handle->format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set format.", function ); goto on_error; } } if( ( ( access_flags & LIBEWF_ACCESS_FLAG_WRITE ) != 0 ) && ( ( access_flags & LIBEWF_ACCESS_FLAG_RESUME ) != 0 ) ) { if( internal_handle->write_io_handle->values_initialized == 0 ) { if( libewf_write_io_handle_initialize_values( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->media_values, internal_handle->segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize write IO handle values.", function ); goto on_error; } } if( libewf_write_io_handle_initialize_resume( internal_handle->write_io_handle, internal_handle->io_handle, file_io_pool, internal_handle->media_values, internal_handle->segment_files_list, internal_handle->segment_files_cache, internal_handle->chunk_table_list, chunk_table, internal_handle->segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize write IO handle to resume.", function ); goto on_error; } } internal_handle->io_handle->access_flags = access_flags; internal_handle->file_io_pool = file_io_pool; return( 1 ); on_error: if( internal_handle->single_files != NULL ) { libewf_single_files_free( &( internal_handle->single_files ), NULL ); } if( internal_handle->hash_sections != NULL ) { libewf_hash_sections_free( &( internal_handle->hash_sections ), NULL ); } if( internal_handle->header_values != NULL ) { libfvalue_table_free( &( internal_handle->header_values ), NULL ); } if( internal_handle->header_sections != NULL ) { libewf_header_sections_free( &( internal_handle->header_sections ), NULL ); } if( internal_handle->chunk_table_cache != NULL ) { libfcache_cache_free( &( internal_handle->chunk_table_cache ), NULL ); } if( internal_handle->chunk_table_list != NULL ) { libmfdata_list_free( &( internal_handle->chunk_table_list ), NULL ); } if( internal_handle->segment_files_cache != NULL ) { libfcache_cache_free( &( internal_handle->segment_files_cache ), NULL ); } if( internal_handle->segment_files_list != NULL ) { libmfdata_file_list_free( &( internal_handle->segment_files_list ), NULL ); } if( internal_handle->delta_segment_files_list != NULL ) { libmfdata_file_list_free( &( internal_handle->delta_segment_files_list ), NULL ); } if( internal_handle->write_io_handle != NULL ) { libewf_write_io_handle_free( &( internal_handle->write_io_handle ), error ); } if( internal_handle->read_io_handle != NULL ) { libewf_read_io_handle_free( &( internal_handle->read_io_handle ), error ); } return( -1 ); } /* Opens the segment files for reading * Returns 1 if successful or -1 on error */ int libewf_handle_open_read_segment_files( libewf_internal_handle_t *internal_handle, libbfio_pool_t *file_io_pool, libewf_chunk_table_t *chunk_table, libcerror_error_t **error ) { libewf_section_t *section = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_handle_open_read_segment_files"; off64_t section_offset = 0; size64_t maximum_segment_size = 0; size64_t segment_file_size = 0; ssize_t read_count = 0; int file_io_pool_entry = 0; int number_of_segment_files = 0; int known_section = 0; int last_section = 0; int last_segment_file = 0; int segment_files_list_index = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing header sections.", function ); return( -1 ); } if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } if( internal_handle->single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing single files.", function ); return( -1 ); } if( libmfdata_file_list_get_number_of_files( internal_handle->segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segment files in list.", function ); goto on_error; } if( number_of_segment_files <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of segment files value out of bounds.", function ); goto on_error; } for( segment_files_list_index = 0; segment_files_list_index < number_of_segment_files; segment_files_list_index++ ) { if( libmfdata_file_list_get_file_by_index( internal_handle->segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); goto on_error; } if( libbfio_pool_get_size( file_io_pool, file_io_pool_entry, &segment_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of file IO pool entry: %d.", function, file_io_pool_entry ); goto on_error; } if( ( segment_files_list_index == 0 ) && ( number_of_segment_files > 1 ) ) { /* Round the maximum segment size to nearest number of KiB */ maximum_segment_size = ( segment_file_size >> 10 ) << 10; if( libewf_segment_table_set_maximum_segment_size( internal_handle->segment_table, maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size in segment table.", function ); goto on_error; } } if( libewf_segment_file_initialize( &segment_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment file.", function ); goto on_error; } read_count = libewf_segment_file_read_file_header( segment_file, file_io_pool, file_io_pool_entry, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment file header.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( ( segment_file->type != LIBEWF_SEGMENT_FILE_TYPE_EWF ) && ( segment_file->type != LIBEWF_SEGMENT_FILE_TYPE_LWF ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported segment file type.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( segment_file->segment_number != ( segment_files_list_index + 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: segment number mismatch.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } /* The segment file is cached here in case of resume */ if( libmfdata_file_list_set_file_value_by_index( internal_handle->segment_files_list, internal_handle->segment_files_cache, segment_files_list_index, (intptr_t *) segment_file, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_segment_file_free, LIBMFDATA_FILE_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file: %d in list.", function, segment_files_list_index + 1 ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } /* The segment file is now handled by the segment files list */ section_offset = (off64_t) read_count; last_section = 0; while( (size64_t) section_offset < segment_file_size ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } read_count = libewf_section_start_read( section, file_io_pool, file_io_pool_entry, section_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section start.", function ); if( libewf_section_free( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free section.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); segment_file->flags |= LIBEWF_SEGMENT_FILE_FLAG_CORRUPTED; internal_handle->segment_table->flags |= LIBEWF_SEGMENT_TABLE_FLAG_CORRUPTED; break; } if( section->type_length == 4 ) { if( memory_compare( (void *) section->type, (void *) "data", 4 ) == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { libcnotify_printf( "%s: found data section in EWF-S01 format.\n", function ); } } #endif read_count = libewf_section_data_read( section, internal_handle->io_handle, file_io_pool, file_io_pool_entry, internal_handle->media_values, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "disk", 4 ) == 0 ) { read_count = libewf_segment_file_read_volume_section( segment_file, section, internal_handle->io_handle, file_io_pool, file_io_pool_entry, internal_handle->media_values, internal_handle->chunk_table_list, error ); /* Check if the EWF file format is that of EnCase1 * this allows the table read function to reduce verbose * output of additional data in table section */ if( ( internal_handle->io_handle->ewf_format == EWF_FORMAT_E01 ) && ( internal_handle->header_sections->number_of_header_sections == 1 ) ) { internal_handle->io_handle->format = LIBEWF_FORMAT_ENCASE1; } known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "done", 4 ) == 0 ) { if( ( segment_files_list_index + 1 ) != number_of_segment_files ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: last segment number mismatch.", function ); goto on_error; } /* Nothing to do for the done section */ known_section = 1; last_section = 1; last_segment_file = 1; } else if( memory_compare( (void *) section->type, (void *) "hash", 4 ) == 0 ) { read_count = libewf_section_hash_read( section, file_io_pool, file_io_pool_entry, internal_handle->hash_sections, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "next", 4 ) == 0 ) { /* Nothing to do for the next section */ known_section = 1; last_section = 1; } } else if( section->type_length == 5 ) { if( memory_compare( (void *) section->type, (void *) "ltree", 5 ) == 0 ) { if( internal_handle->io_handle->ewf_format != EWF_FORMAT_L01 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: found ltree section in EWF-E01 or EWF-S01 format.\n", function ); } #endif internal_handle->io_handle->ewf_format = EWF_FORMAT_L01; } read_count = libewf_section_ltree_read( section, file_io_pool, file_io_pool_entry, &( internal_handle->single_files->ltree_data ), &( internal_handle->single_files->ltree_data_size ), error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "table", 5 ) == 0 ) { read_count = libewf_segment_file_read_table_section( segment_file, section, internal_handle->io_handle, file_io_pool, file_io_pool_entry, internal_handle->media_values, chunk_table, internal_handle->chunk_table_list, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "xhash", 5 ) == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { libcnotify_printf( "%s: found xhash section in EWF-S01 format.\n", function ); } } #endif read_count = libewf_section_xhash_read( section, file_io_pool, file_io_pool_entry, internal_handle->hash_sections, error ); known_section = 1; } } else if( section->type_length == 6 ) { if( memory_compare( (void *) section->type, (void *) "digest", 6 ) == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { libcnotify_printf( "%s: found digest section in EWF-S01 format.\n", function ); } } #endif read_count = libewf_section_digest_read( section, file_io_pool, file_io_pool_entry, internal_handle->hash_sections, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "error2", 6 ) == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { libcnotify_printf( "%s: found error2 section in EWF-S01 format.\n", function ); } } #endif read_count = libewf_section_error2_read( section, file_io_pool, file_io_pool_entry, internal_handle->acquiry_errors, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "header", 6 ) == 0 ) { read_count = libewf_section_header_read( section, file_io_pool, file_io_pool_entry, internal_handle->header_sections, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "table2", 6 ) == 0 ) { read_count = libewf_segment_file_read_table2_section( segment_file, section, internal_handle->io_handle, file_io_pool, file_io_pool_entry, chunk_table, internal_handle->chunk_table_list, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "volume", 6 ) == 0 ) { read_count = libewf_segment_file_read_volume_section( segment_file, section, internal_handle->io_handle, file_io_pool, file_io_pool_entry, internal_handle->media_values, internal_handle->chunk_table_list, error ); /* Check if the EWF file format is that of EnCase1 * this allows the table read function to reduce verbose * output of additional data in table section */ if( ( internal_handle->io_handle->ewf_format == EWF_FORMAT_E01 ) && ( internal_handle->header_sections->number_of_header_sections == 1 ) ) { internal_handle->io_handle->format = LIBEWF_FORMAT_ENCASE1; } known_section = 1; } } else if( section->type_length == 7 ) { if( memory_compare( (void *) section->type, (void *) "header2", 7 ) == 0 ) { read_count = libewf_section_header2_read( section, file_io_pool, file_io_pool_entry, internal_handle->header_sections, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "sectors", 7 ) == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { libcnotify_printf( "%s: found sectors section in EWF-S01 format.\n", function ); } } #endif /* Nothing to do for the sectors section */ known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "session", 7 ) == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) { libcnotify_printf( "%s: found session section in EWF-S01 format.\n", function ); } } #endif read_count = libewf_section_session_read( section, file_io_pool, file_io_pool_entry, internal_handle->media_values, internal_handle->sessions, internal_handle->tracks, error ); known_section = 1; } else if( memory_compare( (void *) section->type, (void *) "xheader", 7 ) == 0 ) { read_count = libewf_section_xheader_read( section, file_io_pool, file_io_pool_entry, internal_handle->header_sections, error ); known_section = 1; } } if( known_section == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unsupported section type: %s.\n", function, (char *) section->type ); } #elif defined( HAVE_DEBUG_OUTPUT ) read_count = libewf_section_debug_read( section, file_io_pool, file_io_pool_entry, error ); #endif } if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section: %s.", function, (char *) section->type ); goto on_error; } section_offset += section->size; if( ( last_section != 0 ) && ( section->size == 0 ) ) { section_offset += sizeof( ewf_section_start_t ); } if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; segment_file->last_section_offset = section_offset; if( last_section != 0 ) { break; } } if( ( segment_file->flags & LIBEWF_SEGMENT_FILE_FLAG_CORRUPTED ) == 0 ) { if( last_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing next or done section.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); segment_file->flags |= LIBEWF_SEGMENT_FILE_FLAG_CORRUPTED; internal_handle->segment_table->flags |= LIBEWF_SEGMENT_TABLE_FLAG_CORRUPTED; break; } #if defined( HAVE_DEBUG_OUTPUT ) else if( libcnotify_verbose != 0 ) { if( (size64_t) section_offset < segment_file_size ) { libcnotify_printf( "%s: trailing data in segment file: %" PRIu16 "\n", function, segment_files_list_index ); } } #endif } segment_file = NULL; } if( last_segment_file == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing done section.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); internal_handle->segment_table->flags |= LIBEWF_SEGMENT_TABLE_FLAG_CORRUPTED; } return( 1 ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Opens the delta segment files for reading * Returns 1 if successful or -1 on error */ int libewf_handle_open_read_delta_segment_files( libewf_internal_handle_t *internal_handle, libbfio_pool_t *file_io_pool, libcerror_error_t **error ) { libewf_section_t *section = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_handle_open_read_delta_segment_files"; off64_t section_offset = 0; size64_t maximum_segment_size = 0; size64_t segment_file_size = 0; ssize_t read_count = 0; int file_io_pool_entry = 0; int number_of_segment_files = 0; int known_section = 0; int last_section = 0; int last_segment_file = 0; int segment_files_list_index = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } if( libmfdata_file_list_get_number_of_files( internal_handle->delta_segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of delta segment files in list.", function ); goto on_error; } if( number_of_segment_files <= 1 ) { return( 1 ); } for( segment_files_list_index = 0; segment_files_list_index < number_of_segment_files; segment_files_list_index++ ) { if( libmfdata_file_list_get_file_by_index( internal_handle->segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file: %d from segment files list.", function, segment_files_list_index + 1 ); goto on_error; } if( libbfio_pool_get_size( file_io_pool, file_io_pool_entry, &segment_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size of file IO pool entry: %d.", function, file_io_pool_entry ); goto on_error; } if( ( segment_files_list_index == 0 ) && ( number_of_segment_files > 1 ) ) { /* Round the maximum segment size to nearest number of KiB */ maximum_segment_size = ( segment_file_size >> 10 ) << 10; if( libewf_segment_table_set_maximum_segment_size( internal_handle->delta_segment_table, maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size in delta segment table.", function ); goto on_error; } } if( libewf_segment_file_initialize( &segment_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment file.", function ); goto on_error; } read_count = libewf_segment_file_read_file_header( segment_file, file_io_pool, file_io_pool_entry, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment file header.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( segment_file->type != LIBEWF_SEGMENT_FILE_TYPE_DWF ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported segment file type.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( segment_file->segment_number != ( segment_files_list_index + 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: segment number mismatch.", function ); libewf_segment_file_free( &segment_file, NULL ); goto on_error; } if( libmfdata_file_list_set_file_value_by_index( internal_handle->segment_files_list, internal_handle->segment_files_cache, segment_files_list_index, (intptr_t *) segment_file, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_segment_file_free, LIBMFDATA_FILE_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file: %d in segment files list.", function, segment_files_list_index + 1 ); goto on_error; } section_offset = (off64_t) read_count; last_section = 0; while( (size64_t) section_offset < segment_file_size ) { if( libewf_section_initialize( §ion, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create section.", function ); goto on_error; } read_count = libewf_section_start_read( section, file_io_pool, file_io_pool_entry, section_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section start.", function ); goto on_error; } if( section->type_length == 4 ) { if( memory_compare( (void *) section->type, (void *) "done", 4 ) == 0 ) { if( ( segment_files_list_index + 1 ) != number_of_segment_files ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: last segment number mismatch.", function ); goto on_error; } /* Nothing to do for the done section */ known_section = 1; last_section = 1; last_segment_file = 1; } else if( memory_compare( (void *) section->type, (void *) "next", 4 ) == 0 ) { /* Nothing to do for the next section */ known_section = 1; last_section = 1; } } else if( section->type_length == 11 ) { if( memory_compare( (void *) section->type, (void *) "delta_chunk", 11 ) == 0 ) { read_count = libewf_segment_file_read_delta_chunk_section( segment_file, section, file_io_pool, file_io_pool_entry, internal_handle->chunk_table_list, error ); known_section = 1; } } if( known_section == 0 ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unsupported section type: %s.\n", function, (char *) section->type ); } #elif defined( HAVE_DEBUG_OUTPUT ) read_count = libewf_section_debug_read( section, file_io_pool, file_io_pool_entry, error ); #endif } if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read section: %s.", function, (char *) section->type ); goto on_error; } section_offset += section->size; if( ( last_section != 0 ) && ( section->size == 0 ) ) { section_offset += sizeof( ewf_section_start_t ); } if( libcdata_list_append_value( segment_file->section_list, (intptr_t *) section, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append section to list.", function ); goto on_error; } section = NULL; if( last_section != 0 ) { break; } } if( last_section == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing next or done section.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( (size64_t) section_offset < segment_file_size ) { libcnotify_printf( "%s: trailing data in segment file: %" PRIu16 "\n", function, segment_files_list_index ); } } #endif segment_file = NULL; } if( last_segment_file == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing done section.", function ); goto on_error; } return( 1 ); on_error: if( section != NULL ) { libewf_section_free( §ion, NULL ); } return( -1 ); } /* Closes the EWF handle * Returns 0 if successful or -1 on error */ int libewf_handle_close( libewf_handle_t *handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_close"; ssize_t write_count = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( ( internal_handle->write_io_handle != NULL ) && ( internal_handle->write_io_handle->write_finalized == 0 ) ) { write_count = libewf_handle_write_finalize( handle, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize write.", function ); return( -1 ); } } if( internal_handle->file_io_pool_created_in_library != 0 ) { if( libbfio_pool_close_all( internal_handle->file_io_pool, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close all file IO pool handles.", function ); result = -1; } if( libbfio_pool_free( &( internal_handle->file_io_pool ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file IO pool.", function ); result = -1; } internal_handle->file_io_pool_created_in_library = 0; } internal_handle->file_io_pool = NULL; if( libewf_io_handle_clear( internal_handle->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear IO handle.", function ); result = -1; } if( internal_handle->read_io_handle != NULL ) { if( libewf_read_io_handle_free( &( internal_handle->read_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read IO handle.", function ); result = -1; } } if( internal_handle->write_io_handle != NULL ) { if( libewf_write_io_handle_free( &( internal_handle->write_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free write IO handle.", function ); result = -1; } } if( internal_handle->segment_files_list != NULL ) { if( libmfdata_file_list_free( &( internal_handle->segment_files_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free segment files list.", function ); result = -1; } } if( internal_handle->delta_segment_files_list != NULL ) { if( libmfdata_file_list_free( &( internal_handle->delta_segment_files_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free delta segment files list.", function ); result = -1; } } if( internal_handle->segment_files_cache != NULL ) { if( libfcache_cache_free( &( internal_handle->segment_files_cache ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free segment files cache.", function ); result = -1; } } if( internal_handle->segment_table != NULL ) { if( libewf_segment_table_free( &( internal_handle->segment_table ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free segment table.", function ); result = -1; } } if( internal_handle->delta_segment_table != NULL ) { if( libewf_segment_table_free( &( internal_handle->delta_segment_table ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free delta segment table.", function ); result = -1; } } if( internal_handle->chunk_table_list != NULL ) { if( libmfdata_list_free( &( internal_handle->chunk_table_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free chunk table list.", function ); result = -1; } } if( internal_handle->chunk_table_cache != NULL ) { if( libfcache_cache_free( &( internal_handle->chunk_table_cache ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free chunk table cache.", function ); result = -1; } } if( internal_handle->header_sections != NULL ) { if( libewf_header_sections_free( &( internal_handle->header_sections ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free header sections.", function ); result = -1; } } if( internal_handle->hash_sections != NULL ) { if( libewf_hash_sections_free( &( internal_handle->hash_sections ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free hash sections.", function ); result = -1; } } if( internal_handle->header_values != NULL ) { if( libfvalue_table_free( &( internal_handle->header_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free header values.", function ); result = -1; } } if( internal_handle->hash_values != NULL ) { if( libfvalue_table_free( &( internal_handle->hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free hash values.", function ); result = -1; } } if( internal_handle->single_files != NULL ) { if( libewf_single_files_free( &( internal_handle->single_files ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free single files.", function ); result = -1; } } if( internal_handle->read_io_handle != NULL ) { if( libcdata_range_list_empty( internal_handle->read_io_handle->checksum_errors, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty checksum errors range list.", function ); result = -1; } } if( libcdata_array_empty( internal_handle->sessions, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->tracks, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); result = -1; } if( libcdata_range_list_empty( internal_handle->acquiry_errors, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty acquiry errors range list.", function ); result = -1; } return( result ); } /* Prepares chunk of (media) data after reading it according to the handle settings * It applies decompression if necessary and validates the chunk checksum * This function should be used after libewf_handle_read_chunk * The value chunk_buffer_size contains the size of the chunk * Returns the resulting chunk size or -1 on error */ ssize_t libewf_handle_prepare_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, void *uncompressed_chunk_buffer, size_t *uncompressed_chunk_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum, libcerror_error_t **error ) { uint8_t *checksum_buffer = NULL; static char *function = "libewf_handle_prepare_read_chunk"; uint32_t calculated_checksum = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( ( chunk_buffer_size == 0 ) || ( chunk_buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk buffer size value out of bounds.", function ); return( -1 ); } if( uncompressed_chunk_buffer_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed chunk buffer size.", function ); return( -1 ); } if( is_compressed == 0 ) { if( chunk_buffer_size < sizeof( uint32_t ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk buffer size value out of bounds.", function ); return( -1 ); } chunk_buffer_size -= sizeof( uint32_t ); if( read_checksum == 0 ) { checksum_buffer = &( ( (uint8_t *) chunk_buffer )[ chunk_buffer_size ] ); byte_stream_copy_to_uint32_little_endian( checksum_buffer, chunk_checksum ); } if( libewf_checksum_calculate_adler32( &calculated_checksum, chunk_buffer, chunk_buffer_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } if( chunk_checksum != calculated_checksum ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH, "%s: chunk data checksum does not match (stored: 0x%08" PRIx32 " calculated: 0x%08" PRIx32 ").", function, chunk_checksum, calculated_checksum ); return( -1 ); } *uncompressed_chunk_buffer_size = chunk_buffer_size; } else { if( uncompressed_chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed chunk buffer.", function ); return( -1 ); } if( uncompressed_chunk_buffer == chunk_buffer ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed chunk buffer is the same as chunk buffer.", function ); return( -1 ); } if( *uncompressed_chunk_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid uncompressed chunk buffer size value exceeds maximum.", function ); return( -1 ); } if( libewf_decompress_data( chunk_buffer, chunk_buffer_size, uncompressed_chunk_buffer, uncompressed_chunk_buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_DECOMPRESS_FAILED, "%s: unable to decompress chunk buffer.", function ); return( -1 ); } } return( (ssize_t) *uncompressed_chunk_buffer_size ); } /* Reads a chunk of (media) data from the current offset into a buffer * Will read until the requested size is filled or the entire chunk is read * The values read_checksum and chunk_checksum are used for uncompressed chunks only * The value chunk_checksum is set to a runtime version of the value in the checksum_buffer * The value read_checksum is set if the checksum has been read into checksum_buffer * The value chunk_buffer_size contains the size of the chunk buffer * Returns the number of bytes read or -1 on error */ ssize_t libewf_handle_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, int8_t *is_compressed, void *checksum_buffer, uint32_t *chunk_checksum, int8_t *read_checksum, libcerror_error_t **error ) { libewf_chunk_data_t *chunk_data = NULL; libewf_internal_handle_t *internal_handle = NULL; uint8_t *chunk_data_buffer = NULL; static char *function = "libewf_handle_read_chunk"; size_t data_size = 0; size_t read_size = 0; uint64_t chunk_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk data set.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( ( chunk_buffer_size == 0 ) || ( chunk_buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk buffer size value out of bounds.", function ); return( -1 ); } if( is_compressed == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid is compressed.", function ); return( -1 ); } if( checksum_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid checksum buffer.", function ); return( -1 ); } if( chunk_checksum == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk checksum.", function ); return( -1 ); } if( read_checksum == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read checksum.", function ); return( -1 ); } if( (size64_t) internal_handle->io_handle->current_offset >= internal_handle->media_values->media_size ) { return( 0 ); } chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } /* This function will expand element groups */ if( libmfdata_list_get_element_value_by_index( internal_handle->chunk_table_list, internal_handle->file_io_pool, internal_handle->chunk_table_cache, (int) chunk_index, (intptr_t **) &chunk_data, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } chunk_data_buffer = chunk_data->data; read_size = chunk_data->data_size; *is_compressed = chunk_data->is_compressed; *read_checksum = 0; if( chunk_data->is_compressed == 0 ) { if( chunk_data->is_packed != 0 ) { if( ( chunk_data->data_size < sizeof( uint32_t ) ) || ( chunk_data->data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk data size value out of bounds.", function ); return( -1 ); } read_size -= sizeof( uint32_t ); } if( chunk_buffer_size < read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid chunk buffer size value too small.", function ); return( -1 ); } /* If the chunk and checksum buffers are not aligned * read the chunk and checksum separately */ if( &( ( (uint8_t *) chunk_buffer )[ read_size ] ) != checksum_buffer ) { *read_checksum = 1; } else { read_size += sizeof( uint32_t ); } } else if( chunk_data->is_packed == 0 ) { chunk_data_buffer = chunk_data->compressed_data; read_size = chunk_data->compressed_data_size; } if( memory_copy( chunk_buffer, chunk_data_buffer, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy chunk data to chunk buffer.", function ); return( -1 ); } if( *read_checksum != 0 ) { if( memory_copy( checksum_buffer, &( chunk_data_buffer[ read_size ] ), sizeof( uint32_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy chunk checksum data in chunk buffer.", function ); return( -1 ); } read_size += sizeof( uint32_t ); byte_stream_copy_to_uint32_little_endian( (uint8_t *) checksum_buffer, *chunk_checksum ); } if( chunk_data->is_packed == 0 ) { data_size = chunk_data->data_size; } else { data_size = (size_t) internal_handle->media_values->chunk_size; if( (size64_t) ( internal_handle->io_handle->current_offset + data_size ) >= internal_handle->media_values->media_size ) { data_size = (size_t) ( internal_handle->media_values->media_size - internal_handle->io_handle->current_offset ); } } internal_handle->io_handle->current_offset += (off64_t) data_size; return( (ssize_t) read_size ); } /* Reads (media) data at the current offset into a buffer * Returns the number of bytes read or -1 on error */ ssize_t libewf_handle_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, libcerror_error_t **error ) { libewf_chunk_data_t *chunk_data = NULL; libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_read_buffer"; off64_t chunk_offset = 0; size_t buffer_offset = 0; size_t read_size = 0; ssize_t total_read_count = 0; uint64_t chunk_index = 0; uint64_t chunk_data_offset = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk data set.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( (size64_t) internal_handle->io_handle->current_offset >= internal_handle->media_values->media_size ) { return( 0 ); } if( (size64_t) ( internal_handle->io_handle->current_offset + buffer_size ) >= internal_handle->media_values->media_size ) { buffer_size = (size_t) ( internal_handle->media_values->media_size - internal_handle->io_handle->current_offset ); } chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } chunk_offset = chunk_index * internal_handle->media_values->chunk_size; chunk_data_offset = internal_handle->io_handle->current_offset - chunk_offset; if( chunk_data_offset >= (uint64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk data offset value exceeds maximum.", function ); return( -1 ); } while( buffer_size > 0 ) { if( libewf_read_io_handle_read_chunk_data( internal_handle->read_io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->chunk_table_list, internal_handle->chunk_table_cache, (int) chunk_index, chunk_offset, &chunk_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data_offset > chunk_data->data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: chunk offset exceeds chunk data size.", function ); return( -1 ); } read_size = (size_t) ( chunk_data->data_size - chunk_data_offset ); if( read_size > buffer_size ) { read_size = buffer_size; } if( read_size == 0 ) { break; } if( memory_copy( &( ( (uint8_t *) buffer )[ buffer_offset ] ), &( ( chunk_data->data )[ chunk_data_offset ] ), read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy chunk data to buffer.", function ); return( -1 ); } buffer_offset += read_size; buffer_size -= read_size; total_read_count += (ssize_t) read_size; chunk_index += 1; chunk_offset += internal_handle->media_values->chunk_size; chunk_data_offset = 0; internal_handle->io_handle->current_offset += (off64_t) read_size; if( (size64_t) internal_handle->io_handle->current_offset >= internal_handle->media_values->media_size ) { break; } if( internal_handle->io_handle->abort != 0 ) { break; } } return( total_read_count ); } /* Reads (media) data at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t libewf_handle_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libewf_handle_read_random"; ssize_t read_count = 0; if( libewf_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } read_count = libewf_handle_read_buffer( handle, buffer, buffer_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } return( read_count ); } /* Prepares a chunk of (media) data before writing according to the handle settings * This function should be used before libewf_handle_write_chunk * The chunk_buffer_size should contain the actual chunk size * The function sets the chunk checksum, is compressed and write checksum values * Returns the resulting chunk size or -1 on error */ ssize_t libewf_handle_prepare_write_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, void *compressed_chunk_buffer, size_t *compressed_chunk_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_prepare_write_chunk"; size_t chunk_write_size = 0; uint64_t chunk_index = 0; int8_t compression_level = 0; int chunk_exists = 0; int is_empty_zero_block = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( chunk_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk buffer size value exceeds maximum.", function ); return( -1 ); } if( chunk_buffer_size > (size_t) internal_handle->media_values->chunk_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: invalid chunk buffer size: %" PRIzd " value exceeds media values chunk size: %" PRIu32 ".", function, chunk_buffer_size, internal_handle->media_values->chunk_size ); return( -1 ); } if( chunk_checksum == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk checksum.", function ); return( -1 ); } if( is_compressed == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid is compressed.", function ); return( -1 ); } if( write_checksum == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid write checksum.", function ); return( -1 ); } if( chunk_buffer_size == 0 ) { return( 0 ); } if( internal_handle->read_io_handle != NULL ) { chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } chunk_exists = libmfdata_list_is_set( internal_handle->chunk_table_list, (int) chunk_index, error ); if( chunk_exists == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if the chunk: %" PRIu64 " exists in the chunk table list.", function, chunk_index ); return( -1 ); } else if( chunk_exists == 0 ) { if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk: %" PRIu64 ".", function, chunk_index ); return( -1 ); } } } *is_compressed = 0; if( chunk_exists == 0 ) { compression_level = internal_handle->io_handle->compression_level; /* Skip the empty block check only if the compression is none and * the empty block compression flag is not set. */ if( ( compression_level != EWF_COMPRESSION_NONE ) || ( ( internal_handle->io_handle->compression_flags & LIBEWF_FLAG_COMPRESS_EMPTY_BLOCK ) != 0 ) ) { #if defined( TEST_EMPTY_BLOCK_MEMCMP ) if( memory_compare( chunk_buffer, &( ( (uint8_t *) chunk_buffer )[ 1 ] ), chunk_buffer_size - 1 ) == 0 ) #else result = libewf_empty_block_test( chunk_buffer, chunk_buffer_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if chunk buffer is empty.", function ); return( -1 ); } else if( result == 1 ) #endif { if( ( (uint8_t *) chunk_buffer )[ 0 ] == 0 ) { is_empty_zero_block = 1; } else if( compression_level == EWF_COMPRESSION_NONE ) { compression_level = EWF_COMPRESSION_DEFAULT; } } } if( ( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) || ( compression_level != EWF_COMPRESSION_NONE ) || ( is_empty_zero_block != 0 ) ) { if( compressed_chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed chunk buffer.", function ); return( -1 ); } if( compressed_chunk_buffer == chunk_buffer ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed chunk buffer is the same as chunk buffer.", function ); return( -1 ); } if( compressed_chunk_buffer_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed chunk buffer size.", function ); return( -1 ); } /* The compressed data size contains the maximum allowed buffer size on entry */ if( *compressed_chunk_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid compressed chunk buffer size value exceeds maximum.", function ); return( -1 ); } /* Use the cached version of the zero byte empty block data if available */ if( ( is_empty_zero_block != 0 ) && ( (size_t) internal_handle->media_values->chunk_size == chunk_buffer_size ) && ( internal_handle->write_io_handle->compressed_zero_byte_empty_block != NULL ) ) { if( memory_copy( compressed_chunk_buffer, internal_handle->write_io_handle->compressed_zero_byte_empty_block, internal_handle->write_io_handle->compressed_zero_byte_empty_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy compressed zero byte empty block to compressed chunk buffer.", function ); return( -1 ); } *compressed_chunk_buffer_size = internal_handle->write_io_handle->compressed_zero_byte_empty_block_size; } else { result = libewf_compress_data( (uint8_t *) compressed_chunk_buffer, compressed_chunk_buffer_size, compression_level, (uint8_t *) chunk_buffer, chunk_buffer_size, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED, "%s: unable to compress chunk.", function ); return( -1 ); } } if( ( internal_handle->io_handle->ewf_format == EWF_FORMAT_S01 ) || ( *compressed_chunk_buffer_size < chunk_buffer_size ) ) { *is_compressed = 1; } } } if( *is_compressed == 0 ) { if( libewf_checksum_calculate_adler32( chunk_checksum, chunk_buffer, chunk_buffer_size, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to calculate checksum.", function ); return( -1 ); } chunk_write_size = chunk_buffer_size; *write_checksum = 1; } else { /* Zlib creates its own checksum */ if( memory_copy( chunk_checksum, &( ( (uint8_t *) compressed_chunk_buffer )[ *compressed_chunk_buffer_size - sizeof( uint32_t ) ] ), sizeof( uint32_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set checksum.", function ); return( -1 ); } chunk_write_size = *compressed_chunk_buffer_size; *write_checksum = 0; } return( (ssize_t) chunk_write_size ); } /* Writes a chunk of (media) data in EWF format at the current offset * the necessary settings of the write values must have been made * chunk_buffer_size contains the size of the data within the buffer while * data_size contains the size of the actual input data * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_handle_write_chunk( libewf_handle_t *handle, const void *chunk_buffer, size_t chunk_buffer_size, size_t data_size, int8_t is_compressed, void *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_write_chunk"; ssize_t write_count = 0; uint64_t chunk_index = 0; int chunk_exists = 0; #if defined( HAVE_DEBUG_OUTPUT ) int number_of_chunks = 0; #endif if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk data set.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing subhandle write.", function ); return( -1 ); } if( internal_handle->write_io_handle->values_initialized == 0 ) { if( libewf_write_io_handle_initialize_values( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->media_values, internal_handle->segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize write IO handle values.", function ); return( -1 ); } } if( chunk_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk buffer.", function ); return( -1 ); } if( data_size > internal_handle->media_values->chunk_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: data size cannot be larger than maximum chunk size.", function ); return( -1 ); } if( ( internal_handle->media_values->media_size != 0 ) && ( (size64_t) internal_handle->io_handle->current_offset >= internal_handle->media_values->media_size ) ) { return( 0 ); } if( chunk_buffer_size == 0 ) { return( 0 ); } chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } if( ( internal_handle->media_values->media_size != 0 ) && ( (size64_t) ( internal_handle->io_handle->current_offset + data_size ) >= internal_handle->media_values->media_size ) ) { data_size = (size_t) ( internal_handle->media_values->media_size - internal_handle->io_handle->current_offset ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libmfdata_list_get_number_of_elements( internal_handle->chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of chunks in the chunk table list.", function ); return( -1 ); } libcnotify_printf( "%s: writing chunk: %" PRIu64 " of total: %d.\n", function, chunk_index, number_of_chunks ); libcnotify_printf( "%s: writing chunk buffer of size: %" PRIzd " with data of size: %" PRIzd ".\n", function, chunk_buffer_size, data_size ); } #endif if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { chunk_exists = libmfdata_list_is_set( internal_handle->chunk_table_list, (int) chunk_index, error ); if( chunk_exists == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if the chunk: %" PRIu64 " exists in the chunk table list.", function, chunk_index ); return( -1 ); } else if( chunk_exists == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk: %" PRIu64 ".", function, chunk_index ); return( -1 ); } write_count = libewf_write_io_handle_write_existing_chunk( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->delta_segment_files_list, internal_handle->segment_files_cache, internal_handle->delta_segment_table, internal_handle->chunk_table_list, internal_handle->header_sections, (int) chunk_index, (uint8_t *) chunk_buffer, chunk_buffer_size, data_size, is_compressed, (uint8_t *) checksum_buffer, chunk_checksum, write_checksum, error ); } else { write_count = libewf_write_io_handle_write_new_chunk( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->segment_files_list, internal_handle->segment_files_cache, internal_handle->segment_table, internal_handle->chunk_table_list, internal_handle->header_values, internal_handle->hash_values, internal_handle->header_sections, internal_handle->hash_sections, internal_handle->sessions, internal_handle->tracks, internal_handle->acquiry_errors, (int) chunk_index, (uint8_t *) chunk_buffer, chunk_buffer_size, data_size, is_compressed, (uint8_t *) checksum_buffer, chunk_checksum, write_checksum, error ); } if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write raw chunk data.", function ); return( -1 ); } internal_handle->io_handle->current_offset += (off64_t) data_size; return( (ssize_t) chunk_buffer_size ); } /* Writes (media) data at the current offset * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_handle_write_buffer( libewf_handle_t *handle, const void *buffer, size_t buffer_size, libcerror_error_t **error ) { libewf_chunk_data_t *chunk_data = NULL; libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_write_buffer"; off64_t chunk_offset = 0; size_t buffer_offset = 0; size_t chunk_data_size = 0; size_t write_size = 0; ssize_t write_count = 0; uint64_t chunk_index = 0; uint64_t chunk_data_offset = 0; int chunk_exists = 0; int write_chunk = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { if( internal_handle->chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk data set.", function ); return( -1 ); } } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing subhandle write.", function ); return( -1 ); } if( internal_handle->write_io_handle->values_initialized == 0 ) { if( libewf_write_io_handle_initialize_values( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->media_values, internal_handle->segment_table, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize write IO handle values.", function ); return( -1 ); } } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } if( ( internal_handle->media_values->media_size != 0 ) && ( (size64_t) internal_handle->io_handle->current_offset >= internal_handle->media_values->media_size ) ) { return( 0 ); } if( ( internal_handle->media_values->media_size != 0 ) && ( (size64_t) ( internal_handle->io_handle->current_offset + buffer_size ) >= internal_handle->media_values->media_size ) ) { buffer_size = (size_t) ( internal_handle->media_values->media_size - internal_handle->io_handle->current_offset ); } chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } chunk_offset = chunk_index * internal_handle->media_values->chunk_size; chunk_data_offset = internal_handle->io_handle->current_offset - chunk_offset; if( chunk_data_offset >= (uint64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk data offset value exceeds maximum.", function ); return( -1 ); } while( buffer_size > 0 ) { chunk_exists = libmfdata_list_is_set( internal_handle->chunk_table_list, (int) chunk_index, error ); if( chunk_exists == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if the chunk: %" PRIu64 " exists in the chunk table list.", function, chunk_index ); return( -1 ); } if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { if( chunk_exists == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( ( chunk_data_offset != 0 ) || ( buffer_size < internal_handle->media_values->chunk_size ) ) { if( libewf_read_io_handle_read_chunk_data( internal_handle->read_io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->chunk_table_list, internal_handle->chunk_table_cache, (int) chunk_index, chunk_offset, &chunk_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data_offset > chunk_data->data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: chunk offset exceeds chunk data size.", function ); return( -1 ); } write_size = (size_t) ( chunk_data->data_size - chunk_data_offset ); if( write_size > buffer_size ) { write_size = buffer_size; } if( write_size == 0 ) { break; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: updating chunk data: %" PRIu64 " at offset: %" PRIu64 " with size: %" PRIzd ".\n", function, chunk_index, chunk_data_offset, write_size ); } #endif } else { /* Reserve 4 bytes for the chunk checksum */ if( libewf_chunk_data_initialize( &chunk_data, (size_t) internal_handle->media_values->chunk_size + sizeof( uint32_t ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( libmfdata_list_set_element_value_by_index( internal_handle->chunk_table_list, internal_handle->chunk_table_cache, (int) chunk_index, (intptr_t *) chunk_data, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_chunk_data_free, LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk data: %" PRIu64 ".", function, chunk_index ); libewf_chunk_data_free( &chunk_data, NULL ); return( -1 ); } chunk_data->data_size = internal_handle->media_values->chunk_size; write_size = chunk_data->data_size; } if( memory_copy( &( ( chunk_data->data )[ chunk_data_offset ] ), &( ( (uint8_t *) buffer )[ buffer_offset ] ), write_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy buffer to chunk data.", function ); return( -1 ); } buffer_offset += write_size; buffer_size -= write_size; chunk_data_size = chunk_data->data_size; if( libewf_chunk_data_pack( chunk_data, EWF_COMPRESSION_NONE, 0, EWF_FORMAT_D01, internal_handle->media_values->chunk_size, internal_handle->write_io_handle->compressed_zero_byte_empty_block, internal_handle->write_io_handle->compressed_zero_byte_empty_block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to pack chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } write_count = libewf_write_io_handle_write_existing_chunk( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->delta_segment_files_list, internal_handle->segment_files_cache, internal_handle->delta_segment_table, internal_handle->chunk_table_list, internal_handle->header_sections, (int) chunk_index, chunk_data->data, chunk_data->data_size, chunk_data_size, 0, NULL, 0, 0, error ); if( write_count <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write existing chunk.", function ); return( -1 ); } } else { if( internal_handle->write_io_handle->write_finalized != 0 ) { break; } if( chunk_exists != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: chunk: %" PRIu64 " already set.", function, chunk_index ); return( -1 ); } if( internal_handle->chunk_data == NULL ) { /* Reserve 4 bytes for the chunk checksum */ if( libewf_chunk_data_initialize( &( internal_handle->chunk_data ), (size_t) internal_handle->media_values->chunk_size + sizeof( uint32_t ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( internal_handle->chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } } if( internal_handle->chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: internal handle - missing chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( chunk_data_offset > internal_handle->media_values->chunk_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: chunk offset exceeds chunk data size.", function ); return( -1 ); } write_size = (size_t) ( internal_handle->media_values->chunk_size - chunk_data_offset ); if( write_size > buffer_size ) { write_size = buffer_size; } if( write_size == 0 ) { break; } if( memory_copy( &( ( internal_handle->chunk_data->data )[ chunk_data_offset ] ), &( ( (uint8_t *) buffer )[ buffer_offset ] ), write_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy buffer to chunk data.", function ); return( -1 ); } internal_handle->chunk_data->data_size = (size_t) ( chunk_data_offset + write_size ); buffer_offset += write_size; buffer_size -= write_size; if( internal_handle->chunk_data->data_size == internal_handle->media_values->chunk_size ) { write_chunk = 1; } else if( ( internal_handle->media_values->media_size != 0 ) && ( ( (size64_t) internal_handle->io_handle->current_offset + write_size ) == internal_handle->media_values->media_size ) ) { write_chunk = 1; } else { write_chunk = 0; } if( write_chunk != 0 ) { chunk_data_size = internal_handle->chunk_data->data_size; if( libewf_chunk_data_pack( internal_handle->chunk_data, internal_handle->io_handle->compression_level, internal_handle->io_handle->compression_flags, internal_handle->io_handle->ewf_format, internal_handle->media_values->chunk_size, internal_handle->write_io_handle->compressed_zero_byte_empty_block, internal_handle->write_io_handle->compressed_zero_byte_empty_block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to pack chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } write_count = libewf_write_io_handle_write_new_chunk( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->segment_files_list, internal_handle->segment_files_cache, internal_handle->segment_table, internal_handle->chunk_table_list, internal_handle->header_values, internal_handle->hash_values, internal_handle->header_sections, internal_handle->hash_sections, internal_handle->sessions, internal_handle->tracks, internal_handle->acquiry_errors, (int) chunk_index, internal_handle->chunk_data->data, internal_handle->chunk_data->data_size, chunk_data_size, internal_handle->chunk_data->is_compressed, NULL, 0, 0, error ); if( write_count <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write new chunk.", function ); return( -1 ); } if( libmfdata_list_set_element_value_by_index( internal_handle->chunk_table_list, internal_handle->chunk_table_cache, (int) chunk_index, (intptr_t *) internal_handle->chunk_data, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_chunk_data_free, LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } internal_handle->chunk_data = NULL; } } chunk_index += 1; chunk_offset += internal_handle->media_values->chunk_size; chunk_data_offset = 0; internal_handle->io_handle->current_offset += (off64_t) write_size; if( ( internal_handle->media_values->media_size != 0 ) && ( (size64_t) internal_handle->io_handle->current_offset >= internal_handle->media_values->media_size ) ) { break; } if( internal_handle->io_handle->abort != 0 ) { break; } } return( (ssize_t) buffer_offset ); } /* Writes (media) data at a specific offset, * the necessary settings of the write values must have been made * Will initialize write if necessary * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libewf_handle_write_random( libewf_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libewf_handle_write_random"; ssize_t write_count = 0; if( libewf_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } write_count = libewf_handle_write_buffer( handle, buffer, buffer_size, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write buffer.", function ); return( -1 ); } return( write_count ); } /* Finalizes the write by correcting the EWF the meta data in the segment files * This function is required after write from stream * Returns the number of bytes written or -1 on error */ ssize_t libewf_handle_write_finalize( libewf_handle_t *handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_segment_file_t *segment_file = NULL; static char *function = "libewf_handle_write_finalize"; void *reallocation = NULL; off64_t segment_file_offset = 0; size_t chunk_data_size = 0; ssize_t write_count = 0; ssize_t write_finalize_count = 0; uint64_t chunk_index = 0; int file_io_pool_entry = -1; int number_of_segment_files = 0; int segment_files_list_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { if( internal_handle->chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk data set.", function ); return( -1 ); } } if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing write IO handle.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( internal_handle->write_io_handle->write_finalized != 0 ) { return( 0 ); } if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { return( 0 ); } chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } if( internal_handle->chunk_data != NULL ) { chunk_data_size = internal_handle->chunk_data->data_size; if( libewf_chunk_data_pack( internal_handle->chunk_data, internal_handle->io_handle->compression_level, internal_handle->io_handle->compression_flags, internal_handle->io_handle->ewf_format, internal_handle->media_values->chunk_size, internal_handle->write_io_handle->compressed_zero_byte_empty_block, internal_handle->write_io_handle->compressed_zero_byte_empty_block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to pack chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } write_count = libewf_write_io_handle_write_new_chunk( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->media_values, internal_handle->segment_files_list, internal_handle->segment_files_cache, internal_handle->segment_table, internal_handle->chunk_table_list, internal_handle->header_values, internal_handle->hash_values, internal_handle->header_sections, internal_handle->hash_sections, internal_handle->sessions, internal_handle->tracks, internal_handle->acquiry_errors, (int) chunk_index, internal_handle->chunk_data->data, internal_handle->chunk_data->data_size, chunk_data_size, internal_handle->chunk_data->is_compressed, NULL, 0, 0, error ); if( write_count <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write new chunk.", function ); return( -1 ); } write_finalize_count += write_count; if( libmfdata_list_set_element_value_by_index( internal_handle->chunk_table_list, internal_handle->chunk_table_cache, (int) chunk_index, (intptr_t *) internal_handle->chunk_data, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_chunk_data_free, LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set chunk data: %" PRIu64 ".", function, chunk_index ); return( -1 ); } internal_handle->chunk_data = NULL; } /* Check if all media data has been written */ if( ( internal_handle->media_values->media_size != 0 ) && ( internal_handle->write_io_handle->input_write_count < (ssize64_t) internal_handle->media_values->media_size ) ) { return( write_finalize_count ); } if( libmfdata_file_list_get_number_of_files( internal_handle->segment_files_list, &number_of_segment_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segment files.", function ); return( -1 ); } if( ( number_of_segment_files < 0 ) || ( number_of_segment_files > (int) UINT16_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segment files value out of bounds.", function ); return( -1 ); } if( number_of_segment_files == 0 ) { /* No segment file need to be created */ if( internal_handle->media_values->media_size != 0 ) { return( write_finalize_count ); } /* Create the headers if required */ if( internal_handle->header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header sections.", function ); return( -1 ); } if( ( internal_handle->header_sections->header == NULL ) && ( internal_handle->header_sections->header2 == NULL ) && ( internal_handle->header_sections->xheader == NULL ) ) { if( libewf_header_sections_generate( internal_handle->header_sections, internal_handle->header_values, time( NULL ), internal_handle->io_handle->compression_level, internal_handle->io_handle->format, internal_handle->io_handle->header_codepage, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header(s).", function ); return( -1 ); } } if( libewf_write_io_handle_create_segment_file( internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->segment_files_list, internal_handle->segment_files_cache, internal_handle->segment_table, 1, internal_handle->write_io_handle->maximum_number_of_segments, LIBEWF_SEGMENT_FILE_TYPE_EWF, &segment_file, &segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to create segment file: 1.", function ); return( -1 ); } write_count = libewf_segment_file_write_start( segment_file, internal_handle->io_handle, internal_handle->file_io_pool, file_io_pool_entry, internal_handle->media_values, internal_handle->header_sections, &( internal_handle->write_io_handle->data_section ), error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write segment file start.", function ); return( -1 ); } write_finalize_count += write_count; } else { segment_files_list_index = number_of_segment_files - 1; if( libmfdata_file_list_get_file_by_index( internal_handle->segment_files_list, segment_files_list_index, &file_io_pool_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( libmfdata_file_list_get_file_value_by_index( internal_handle->segment_files_list, internal_handle->file_io_pool, internal_handle->segment_files_cache, segment_files_list_index, (intptr_t **) &segment_file, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file: %d value from list.", function, segment_files_list_index + 1 ); return( -1 ); } if( segment_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment file: %d.", function, segment_files_list_index + 1 ); return( -1 ); } } /* Set segment file to the correct offset if write is resumed */ if( internal_handle->write_io_handle->resume_segment_file_offset > 0 ) { if( libbfio_pool_seek_offset( internal_handle->file_io_pool, file_io_pool_entry, internal_handle->write_io_handle->resume_segment_file_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to seek resume segment file offset: %" PRIi64 " in segment file: %d.", function, internal_handle->write_io_handle->resume_segment_file_offset, segment_files_list_index + 1 ); return( -1 ); } internal_handle->write_io_handle->resume_segment_file_offset = 0; } /* Check if the last segment file is still open for writing */ if( ( segment_file->flags & LIBEWF_SEGMENT_FILE_FLAG_WRITE_OPEN ) != 0 ) { if( libbfio_pool_get_offset( internal_handle->file_io_pool, file_io_pool_entry, &segment_file_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset in segment file.", function ); return( -1 ); } /* Check if chunks section needs to be corrected */ if( internal_handle->write_io_handle->chunks_section_offset != 0 ) { /* Correct the offset, size in the chunks section */ #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: correcting chunks section.\n", function ); } #endif if( internal_handle->write_io_handle->number_of_table_offsets < internal_handle->write_io_handle->number_of_chunks_written_to_section ) { reallocation = memory_reallocate( internal_handle->write_io_handle->table_offsets, sizeof( ewf_table_offset_t ) * internal_handle->write_io_handle->number_of_chunks_written_to_section ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create table offsets.", function ); return( -1 ); } internal_handle->write_io_handle->table_offsets = (ewf_table_offset_t *) reallocation; internal_handle->write_io_handle->number_of_table_offsets = internal_handle->write_io_handle->number_of_chunks_written_to_section; } write_count = libewf_segment_file_write_chunks_section_correction( segment_file, internal_handle->io_handle, internal_handle->file_io_pool, file_io_pool_entry, segment_file_offset, internal_handle->chunk_table_list, internal_handle->write_io_handle->table_offsets, internal_handle->write_io_handle->number_of_table_offsets, internal_handle->write_io_handle->chunks_section_offset, (size64_t) internal_handle->write_io_handle->chunks_section_write_count, internal_handle->write_io_handle->number_of_chunks_written, internal_handle->write_io_handle->number_of_chunks_written_to_section, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to correct chunks section.", function ); return( -1 ); } segment_file_offset += write_count; write_finalize_count += write_count; } /* Close the segment file */ #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: closing last segment file.\n", function ); } #endif write_count = libewf_segment_file_write_close( segment_file, internal_handle->io_handle, internal_handle->file_io_pool, file_io_pool_entry, segment_file_offset, internal_handle->write_io_handle->number_of_chunks_written_to_segment, 1, internal_handle->hash_sections, internal_handle->hash_values, internal_handle->media_values, internal_handle->sessions, internal_handle->tracks, internal_handle->acquiry_errors, &( internal_handle->write_io_handle->data_section ), error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to close segment file.", function ); return( -1 ); } write_finalize_count += write_count; } /* Correct the media values if streamed write was used */ if( internal_handle->media_values->media_size == 0 ) { /* Determine the media values */ internal_handle->media_values->number_of_chunks = internal_handle->write_io_handle->number_of_chunks_written; internal_handle->media_values->number_of_sectors = (uint64_t) ( internal_handle->write_io_handle->input_write_count / internal_handle->media_values->bytes_per_sector ); internal_handle->media_values->media_size = (size64_t) internal_handle->write_io_handle->input_write_count; /* Flush the data section write cache */ memory_free( internal_handle->write_io_handle->data_section ); internal_handle->write_io_handle->data_section = NULL; /* Correct the sections in the segment files */ if( libewf_write_io_handle_finalize_write_sections_corrections( internal_handle->io_handle, internal_handle->file_io_pool, internal_handle->write_io_handle->number_of_chunks_written_to_segment, internal_handle->media_values, internal_handle->segment_files_list, internal_handle->segment_files_cache, internal_handle->hash_values, internal_handle->hash_sections, internal_handle->sessions, internal_handle->tracks, internal_handle->acquiry_errors, &( internal_handle->write_io_handle->data_section ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write sections corrections to segment files.", function ); return( -1 ); } } internal_handle->write_io_handle->write_finalized = 1; return( write_finalize_count ); } /* Seeks a certain offset of the (media) data * Returns the offset if seek is successful or -1 on error */ off64_t libewf_handle_seek_offset( libewf_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_seek_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->chunk_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - chunk data set.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( whence == SEEK_CUR ) { offset += internal_handle->io_handle->current_offset; } else if( whence == SEEK_END ) { offset += (off64_t) internal_handle->media_values->media_size; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: seeking media data offset: %" PRIi64 ".\n", function, offset ); } #endif if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } internal_handle->io_handle->current_offset = offset; return( offset ); } /* Retrieves the current offset of the (media) data * Returns 1 if successful or -1 on error */ int libewf_handle_get_offset( libewf_handle_t *handle, off64_t *offset, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } *offset = internal_handle->io_handle->current_offset; return( 1 ); } /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int libewf_handle_set_maximum_number_of_open_handles( libewf_handle_t *handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_maximum_number_of_open_handles"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->file_io_pool != NULL ) { if( libbfio_pool_set_maximum_number_of_open_handles( internal_handle->file_io_pool, maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in file IO handle.", function ); return( -1 ); } } internal_handle->maximum_number_of_open_handles = maximum_number_of_open_handles; return( 1 ); } /* Determine if the segment files are corrupted * Returns 1 if corrupted, 0 if not or -1 on error */ int libewf_handle_segment_files_corrupted( libewf_handle_t *handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_segment_files_corrupted"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } if( ( internal_handle->segment_table->flags & LIBEWF_SEGMENT_TABLE_FLAG_CORRUPTED ) != 0 ) { return( 1 ); } return( 0 ); } /* Retrieves the segment filename size * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_segment_filename_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename_size( internal_handle->segment_table, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename size.", function ); return( -1 ); } return( result ); } /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_segment_filename"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename( internal_handle->segment_table, filename, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename.", function ); return( -1 ); } return( result ); } /* Sets the segment file * Returns 1 if successful or -1 on error */ int libewf_handle_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_segment_filename"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: segment filename cannot be changed.", function ); return( -1 ); } if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } if( libewf_segment_table_set_basename( internal_handle->segment_table, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment table basename.", function ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_segment_filename_size_wide"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename_size_wide( internal_handle->segment_table, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename size.", function ); return( -1 ); } return( result ); } /* Retrieves the segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_segment_filename_wide"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename_wide( internal_handle->segment_table, filename, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename.", function ); return( -1 ); } return( result ); } /* Sets the segment file * Returns 1 if successful or -1 on error */ int libewf_handle_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_segment_filename_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: segment filename cannot be changed.", function ); return( -1 ); } if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } if( libewf_segment_table_set_basename_wide( internal_handle->segment_table, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment table basename.", function ); return( -1 ); } return( 1 ); } #endif /* Retrieves the maximum segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_get_maximum_segment_size( libewf_handle_t *handle, size64_t *maximum_segment_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_maximum_segment_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } if( maximum_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum segment size.", function ); return( -1 ); } *maximum_segment_size = internal_handle->segment_table->maximum_segment_size; return( 1 ); } /* Sets the maximum segment file size * A maximum segment file size of 0 represents the maximum possible size for the format * If the maximum segment file size is smaller than the size needed to store a single chunk * the size off the latter is enforced and not the maximum segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_set_maximum_segment_size( libewf_handle_t *handle, size64_t maximum_segment_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_maximum_segment_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing segment table.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: maximum segment size cannot be changed.", function ); return( -1 ); } if( maximum_segment_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum segment size value exceeds maximum.", function ); return( -1 ); } if( maximum_segment_size > internal_handle->write_io_handle->maximum_segment_file_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment file size value out of bounds.", function ); return( -1 ); } internal_handle->segment_table->maximum_segment_size = maximum_segment_size; return( 1 ); } /* Retrieves the delta segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_delta_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_delta_segment_filename_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename_size( internal_handle->delta_segment_table, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename size.", function ); return( -1 ); } return( result ); } /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_delta_segment_filename"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename( internal_handle->delta_segment_table, filename, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename.", function ); return( -1 ); } return( result ); } /* Sets the delta segment file * Returns 1 if successful or -1 on error */ int libewf_handle_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_delta_segment_filename"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: delta segment filename cannot be changed.", function ); return( -1 ); } if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } if( libewf_segment_table_set_basename( internal_handle->delta_segment_table, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment table basename.", function ); return( -1 ); } return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the delta segment filename size * The filename size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_delta_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_delta_segment_filename_size_wide"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename_size_wide( internal_handle->delta_segment_table, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename size.", function ); return( -1 ); } return( result ); } /* Retrieves the delta segment filename * The filename size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_delta_segment_filename_wide"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } result = libewf_segment_table_get_basename_wide( internal_handle->delta_segment_table, filename, filename_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment table basename.", function ); return( -1 ); } return( result ); } /* Sets the delta segment file * Returns 1 if successful or -1 on error */ int libewf_handle_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_delta_segment_filename_wide"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: delta segment filename cannot be changed.", function ); return( -1 ); } if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } if( libewf_segment_table_set_basename_wide( internal_handle->delta_segment_table, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment table basename.", function ); return( -1 ); } return( 1 ); } #endif /* Retrieves the maximum delta segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_get_maximum_delta_segment_size( libewf_handle_t *handle, size64_t *maximum_delta_segment_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_maximum_delta_segment_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } if( maximum_delta_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum delta segment size.", function ); return( -1 ); } *maximum_delta_segment_size = internal_handle->delta_segment_table->maximum_segment_size; return( 1 ); } /* Sets the maximum delta segment file size * Returns 1 if successful or -1 on error */ int libewf_handle_set_maximum_delta_segment_size( libewf_handle_t *handle, size64_t maximum_delta_segment_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_maximum_delta_segment_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->delta_segment_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing delta segment table.", function ); return( -1 ); } if( ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: maximum delta segment size cannot be changed.", function ); return( -1 ); } if( maximum_delta_segment_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum delta segment size value exceeds maximum.", function ); return( -1 ); } if( maximum_delta_segment_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid maximum delta segment size value out of bounds.", function ); return( -1 ); } internal_handle->delta_segment_table->maximum_segment_size = maximum_delta_segment_size; return( 1 ); } /* Retrieves the filename size of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ int libewf_handle_get_filename_size( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libewf_handle_get_filename_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } result = libewf_handle_get_file_io_handle( handle, &file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current chunk.", function ); return( -1 ); } else if( result != 0 ) { if( libbfio_file_get_name_size( file_io_handle, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename size.", function ); return( -1 ); } } return( result ); } /* Retrieves the filename of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ int libewf_handle_get_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libewf_handle_get_filename"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } result = libewf_handle_get_file_io_handle( handle, &file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current chunk.", function ); return( -1 ); } else if( result != 0 ) { if( libbfio_file_get_name( file_io_handle, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename.", function ); return( -1 ); } } return( result ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the filename size of the (delta) segment file of the current chunk * The filename size includes the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ int libewf_handle_get_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libewf_handle_get_filename_size_wide"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } result = libewf_handle_get_file_io_handle( handle, &file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current chunk.", function ); return( -1 ); } else if( result != 0 ) { if( libbfio_file_get_name_size_wide( file_io_handle, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename size.", function ); return( -1 ); } } return( result ); } /* Retrieves the filename of the (delta) segment file of the current chunk * The filename size should include the end of string character * Returns 1 if successful, 0 if no such filename or -1 on error */ int libewf_handle_get_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libewf_handle_get_filename_wide"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } result = libewf_handle_get_file_io_handle( handle, &file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle for current chunk.", function ); return( -1 ); } else if( result != 0 ) { if( libbfio_file_get_name_wide( file_io_handle, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename.", function ); return( -1 ); } } return( result ); } #endif /* Retrieves the file IO handle of the (delta) segment file of the current chunk * Returns 1 if successful, 0 if no such file IO handle or -1 on error */ int libewf_handle_get_file_io_handle( libewf_handle_t *handle, libbfio_handle_t **file_io_handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_file_io_handle"; off64_t chunk_offset = 0; size64_t chunk_size = 0; uint64_t chunk_index = 0; uint32_t chunk_flags = 0; int file_io_pool_entry = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid media values - missing chunk size.", function ); return( -1 ); } chunk_index = internal_handle->io_handle->current_offset / internal_handle->media_values->chunk_size; if( chunk_index >= (uint64_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk index value exceeds maximum.", function ); return( -1 ); } if( libmfdata_list_get_data_range_by_index( internal_handle->chunk_table_list, (int) chunk_index, &file_io_pool_entry, &chunk_offset, &chunk_size, &chunk_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of chunk: %" PRIu64 ".", function, chunk_index ); return( -1 ); } if( file_io_pool_entry == -1 ) { return( 0 ); } if( libbfio_pool_get_handle( internal_handle->file_io_pool, file_io_pool_entry, file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file IO handle: %d from pool (chunk: %" PRIu64 ").", function, file_io_pool_entry, chunk_index ); return( -1 ); } return( 1 ); } /* Retrieves the maximum number of supported segment files to write * Returns 1 if successful or -1 on error */ int libewf_internal_handle_get_write_maximum_number_of_segments( uint8_t ewf_format, uint16_t *maximum_number_of_segments, libcerror_error_t **error ) { static char *function = "libewf_internal_handle_get_write_maximum_number_of_segments"; if( maximum_number_of_segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid maximum number of segments.", function ); return( -1 ); } if( ewf_format == EWF_FORMAT_S01 ) { /* 'z' - 's' + 1 = 8 * ( ( 8 * 26 * 26 ) + 99 ) = 5507 */ *maximum_number_of_segments = (uint16_t) 5507; } else if( ewf_format == EWF_FORMAT_E01 ) { /* 'Z' - 'E' + 1 = 22 * ( ( 22 * 26 * 26 ) + 99 ) = 14971 */ *maximum_number_of_segments = (uint16_t) 14971; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported EWF format.", function ); return( -1 ); } return( 1 ); } /* Retrieves the media values * Returns 1 if successful or -1 on error */ int libewf_internal_handle_get_media_values( libewf_internal_handle_t *internal_handle, size64_t *media_size, libcerror_error_t **error ) { libewf_chunk_data_t *chunk_data = NULL; static char *function = "libewf_internal_handle_get_media_values"; size64_t chunks_data_size = 0; size64_t sector_data_size = 0; int chunk_index = 0; int number_of_chunks = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( media_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media size.", function ); return( -1 ); } sector_data_size = internal_handle->media_values->number_of_sectors; sector_data_size *= internal_handle->media_values->bytes_per_sector; if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { if( libmfdata_list_get_number_of_elements( internal_handle->chunk_table_list, &number_of_chunks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of chunks in chunk table list.", function ); return( -1 ); } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( internal_handle->media_values->number_of_chunks != 0 ) && ( internal_handle->media_values->number_of_chunks != (uint32_t) number_of_chunks ) ) { libcnotify_printf( "%s: mismatch of number of chunks in volume: %" PRIu32 " and chunk table: %d\n", function, internal_handle->media_values->number_of_chunks, number_of_chunks ); } } #endif if( number_of_chunks > 0 ) { chunk_index = number_of_chunks - 1; /* This function will expand element groups */ if( libmfdata_list_get_element_value_by_index( internal_handle->chunk_table_list, internal_handle->file_io_pool, internal_handle->chunk_table_cache, chunk_index, (intptr_t **) &chunk_data, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk data: %d.", function, chunk_index ); return( -1 ); } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %d.", function, chunk_index ); return( -1 ); } chunks_data_size = chunk_index * internal_handle->media_values->sectors_per_chunk * internal_handle->media_values->bytes_per_sector; /* The only way to determine the size of the last compressed chunk * is to decompress it */ if( libewf_chunk_data_unpack( chunk_data, internal_handle->media_values->chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to unpack chunk data: %d.", function, chunk_index ); return( -1 ); } if( chunk_data->is_corrupt == 0 ) { chunks_data_size += chunk_data->data_size; } if( sector_data_size != chunks_data_size ) { #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mismatch of media data size in volume: %" PRIu64 " and chunk table: %" PRIu64 "\n", function, sector_data_size, chunks_data_size ); } #endif if( sector_data_size < chunks_data_size ) { sector_data_size = chunks_data_size; } } } } *media_size = sector_data_size; return( 1 ); } /* Sets the media values * Returns 1 if successful or -1 on error */ int libewf_internal_handle_set_media_values( libewf_internal_handle_t *internal_handle, uint32_t sectors_per_chunk, uint32_t bytes_per_sector, size64_t media_size, libcerror_error_t **error ) { static char *function = "libewf_internal_handle_set_media_values"; size32_t chunk_size = 0; size64_t maximum_input_file_size = 0; uint64_t number_of_chunks = 0; uint64_t number_of_sectors = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( sectors_per_chunk == 0 ) || ( sectors_per_chunk > (uint32_t) INT32_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sectors per chunk.", function ); return( -1 ); } if( ( bytes_per_sector == 0 ) || ( bytes_per_sector > (uint32_t) INT32_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid bytes per sector.", function ); return( -1 ); } if( media_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid media size value exceeds maximum.", function ); return( -1 ); } /* Determine the chunk size */ chunk_size = sectors_per_chunk * bytes_per_sector; if( ( chunk_size == 0 ) || ( chunk_size > (size32_t) INT32_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid chunk size.", function ); return( -1 ); } /* Check if the input file size does not exceed the maximum possible input file size * for the chunk size */ maximum_input_file_size = (size64_t) chunk_size * (size64_t) UINT32_MAX; if( media_size > maximum_input_file_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: media size cannot be larger than size: %" PRIu64 " with a chunk size of: %" PRIu32 ".", function, maximum_input_file_size, chunk_size ); return( -1 ); } internal_handle->media_values->sectors_per_chunk = sectors_per_chunk; internal_handle->media_values->bytes_per_sector = bytes_per_sector; internal_handle->media_values->chunk_size = chunk_size; internal_handle->media_values->media_size = media_size; /* If a media size was provided */ if( media_size > 0 ) { /* Determine the number of chunks to write */ number_of_chunks = (uint64_t) media_size / (uint64_t) chunk_size; if( ( (uint64_t) media_size % (uint64_t) chunk_size ) != 0 ) { number_of_chunks += 1; } if( number_of_chunks > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of chunks value exceeds maximum.", function ); return( -1 ); } internal_handle->media_values->number_of_chunks = (uint32_t) number_of_chunks; /* Determine the number of sectors to write */ number_of_sectors = (uint64_t) media_size / (uint64_t) bytes_per_sector; if( number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } internal_handle->media_values->number_of_sectors = number_of_sectors; } if( internal_handle->write_io_handle != NULL ) { if( libewf_write_io_handle_set_compressed_zero_byte_empty_block( internal_handle->write_io_handle, internal_handle->io_handle, internal_handle->media_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compressed zero byte empty block in write IO handle.", function ); return( -1 ); } } return( 1 ); } /* Sets internal values based on the EWF file format * Returns 1 if successful or -1 on error */ int libewf_internal_handle_set_format( libewf_internal_handle_t *internal_handle, uint8_t format, libcerror_error_t **error ) { static char *function = "libewf_internal_handle_set_format"; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( format != LIBEWF_FORMAT_ENCASE1 ) && ( format != LIBEWF_FORMAT_ENCASE2 ) && ( format != LIBEWF_FORMAT_ENCASE3 ) && ( format != LIBEWF_FORMAT_ENCASE4 ) && ( format != LIBEWF_FORMAT_ENCASE5 ) && ( format != LIBEWF_FORMAT_ENCASE6 ) && ( format != LIBEWF_FORMAT_ENCASE7 ) && ( format != LIBEWF_FORMAT_LINEN5 ) && ( format != LIBEWF_FORMAT_LINEN6 ) && ( format != LIBEWF_FORMAT_LINEN7 ) && ( format != LIBEWF_FORMAT_SMART ) && ( format != LIBEWF_FORMAT_FTK ) && ( format != LIBEWF_FORMAT_LOGICAL_ENCASE5 ) && ( format != LIBEWF_FORMAT_LOGICAL_ENCASE6 ) && ( format != LIBEWF_FORMAT_LOGICAL_ENCASE7 ) && ( format != LIBEWF_FORMAT_EWF ) && ( format != LIBEWF_FORMAT_EWFX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported format: %d.", function, format ); return( -1 ); } internal_handle->io_handle->format = format; if( ( format == LIBEWF_FORMAT_EWF ) || ( format == LIBEWF_FORMAT_SMART ) ) { internal_handle->io_handle->ewf_format = EWF_FORMAT_S01; } else if( format == LIBEWF_FORMAT_LVF ) { internal_handle->io_handle->ewf_format = EWF_FORMAT_L01; } else { internal_handle->io_handle->ewf_format = EWF_FORMAT_E01; } if( internal_handle->write_io_handle != NULL ) { if( format == LIBEWF_FORMAT_ENCASE6 ) { internal_handle->write_io_handle->maximum_segment_file_size = INT64_MAX; internal_handle->write_io_handle->maximum_chunks_per_section = EWF_MAXIMUM_OFFSETS_IN_TABLE_ENCASE6; } else if( format == LIBEWF_FORMAT_EWFX ) { internal_handle->write_io_handle->unrestrict_offset_table = 1; internal_handle->write_io_handle->maximum_segment_file_size = INT32_MAX; internal_handle->write_io_handle->maximum_chunks_per_section = INT32_MAX; } else { internal_handle->write_io_handle->maximum_segment_file_size = INT32_MAX; internal_handle->write_io_handle->maximum_chunks_per_section = EWF_MAXIMUM_OFFSETS_IN_TABLE; } /* Determine the maximum number of segments allowed to write */ if( libewf_internal_handle_get_write_maximum_number_of_segments( internal_handle->io_handle->ewf_format, &( internal_handle->write_io_handle->maximum_number_of_segments ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine the maximum number of allowed segment files.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the root (single) file entry * Returns 1 if successful, 0 if no file entries are present or -1 on error */ int libewf_handle_get_root_file_entry( libewf_handle_t *handle, libewf_file_entry_t **root_file_entry, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_root_file_entry"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing single files.", function ); return( -1 ); } if( root_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid root file entry.", function ); return( -1 ); } if( *root_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: root file entry already set.", function ); return( -1 ); } if( internal_handle->single_files->root_file_entry_node == NULL ) { return( 0 ); } if( libewf_file_entry_initialize( root_file_entry, internal_handle, internal_handle->single_files->root_file_entry_node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create root file entry.", function ); return( -1 ); } return( 1 ); } /* Retrieves the (single) file entry for the specific UTF-8 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ int libewf_file_get_file_entry_by_utf8_path( libewf_handle_t *handle, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **file_entry, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_single_file_entry_t *single_file_entry = NULL; libewf_single_file_entry_t *sub_single_file_entry = NULL; libcdata_tree_node_t *node = NULL; libcdata_tree_node_t *sub_node = NULL; uint8_t *utf8_string_segment = NULL; static char *function = "libewf_file_get_file_entry_by_utf8_path"; size_t utf8_string_index = 0; size_t utf8_string_segment_length = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing single files.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string length value exceeds maximum.", function ); return( -1 ); } if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( *file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: file entry already set.", function ); return( -1 ); } if( internal_handle->single_files->root_file_entry_node == NULL ) { return( 0 ); } if( libcdata_tree_node_get_value( internal_handle->single_files->root_file_entry_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from root file entry node.", function ); return( -1 ); } if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing root file entry values.", function ); return( -1 ); } if( utf8_string_length > 0 ) { /* Ignore a leading separator */ if( utf8_string[ utf8_string_index ] == (uint8_t) LIBEWF_SEPARATOR ) { utf8_string_index++; } } node = internal_handle->single_files->root_file_entry_node; if( ( utf8_string_length == 0 ) || ( utf8_string_length == 1 ) ) { result = 1; } else while( utf8_string_index < utf8_string_length ) { utf8_string_segment = (uint8_t *) &( utf8_string[ utf8_string_index ] ); utf8_string_segment_length = 0; while( utf8_string_index < utf8_string_length ) { if( ( utf8_string[ utf8_string_index ] == (uint8_t) LIBEWF_SEPARATOR ) || ( utf8_string[ utf8_string_index ] == (uint8_t) 0 ) ) { utf8_string_index++; break; } utf8_string_index++; utf8_string_segment_length++; } if( utf8_string_segment_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub file entry name.", function ); return( -1 ); } result = libewf_single_file_tree_get_sub_node_by_utf8_name( node, utf8_string_segment, utf8_string_segment_length, &sub_node, &sub_single_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve single file entry sub node by name.", function ); return( -1 ); } else if( result == 0 ) { break; } node = sub_node; } if( result != 0 ) { if( libewf_file_entry_initialize( file_entry, internal_handle, node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file entry.", function ); return( -1 ); } } return( result ); } /* Retrieves the (single) file entry for the specific UTF-16 encoded path * The path separator is the \ character * Returns 1 if successful, 0 if no such file entry or -1 on error */ int libewf_file_get_file_entry_by_utf16_path( libewf_handle_t *handle, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **file_entry, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_single_file_entry_t *single_file_entry = NULL; libewf_single_file_entry_t *sub_single_file_entry = NULL; libcdata_tree_node_t *node = NULL; libcdata_tree_node_t *sub_node = NULL; uint16_t *utf16_string_segment = NULL; static char *function = "libewf_file_get_file_entry_by_utf16_path"; size_t utf16_string_index = 0; size_t utf16_string_segment_length = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->single_files == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing single files.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string length value exceeds maximum.", function ); return( -1 ); } if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( *file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: file entry already set.", function ); return( -1 ); } if( internal_handle->single_files->root_file_entry_node == NULL ) { return( 0 ); } if( libcdata_tree_node_get_value( internal_handle->single_files->root_file_entry_node, (intptr_t **) &single_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from root file entry node.", function ); return( -1 ); } if( single_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing root file entry values.", function ); return( -1 ); } if( utf16_string_length > 0 ) { /* Ignore a leading separator */ if( utf16_string[ utf16_string_index ] == (uint16_t) LIBEWF_SEPARATOR ) { utf16_string_index++; } } node = internal_handle->single_files->root_file_entry_node; if( ( utf16_string_length == 0 ) || ( utf16_string_length == 1 ) ) { result = 1; } else while( utf16_string_index < utf16_string_length ) { utf16_string_segment = (uint16_t *) &( utf16_string[ utf16_string_index ] ); utf16_string_segment_length = 0; while( utf16_string_index < utf16_string_length ) { if( ( utf16_string[ utf16_string_index ] == (uint16_t) LIBEWF_SEPARATOR ) || ( utf16_string[ utf16_string_index ] == (uint16_t) 0 ) ) { utf16_string_index++; break; } utf16_string_index++; utf16_string_segment_length++; } if( utf16_string_segment_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub file entry name.", function ); return( -1 ); } result = libewf_single_file_tree_get_sub_node_by_utf16_name( node, utf16_string_segment, utf16_string_segment_length, &sub_node, &sub_single_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve single file entry sub node by name.", function ); return( -1 ); } else if( result == 0 ) { break; } node = sub_node; } if( result != 0 ) { if( libewf_file_entry_initialize( file_entry, internal_handle, node, LIBEWF_ITEM_FLAGS_DEFAULT, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file entry.", function ); return( -1 ); } } return( result ); } libewf-20140807/libewf/libewf_write_io_handle.h0000644000175000017500000002276213421013625023442 0ustar00lordyestalordyesta00000000000000/* * Low level writing functions * * 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_WRITE_IO_HANDLE_H ) #define _LIBEWF_WRITE_IO_HANDLE_H #include #include #include "libewf_chunk_table.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_io_handle.h" #include "libewf_media_values.h" #include "libewf_read_io_handle.h" #include "libewf_segment_file.h" #include "libewf_segment_table.h" #include "ewf_data.h" #include "ewf_table.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_write_io_handle libewf_write_io_handle_t; struct libewf_write_io_handle { /* A cached version of the data section */ ewf_data_t *data_section; /* A cached version of the table offsets */ ewf_table_offset_t *table_offsets; /* The number of allocated table offsets */ uint32_t number_of_table_offsets; /* The number of bytes of the input written */ ssize64_t input_write_count; /* The maximum segment file size */ size64_t maximum_segment_file_size; /* The remaining segment file size */ ssize64_t remaining_segment_file_size; /* The maximum number of segments */ uint16_t maximum_number_of_segments; /* The number of bytes written to a section containing chunks */ ssize64_t chunks_section_write_count; /* The (total) number of chunks written */ uint32_t number_of_chunks_written; /* The number of chunks written of the current segment file */ uint32_t number_of_chunks_written_to_segment; /* The number of chunks written of the current (chunks) section */ uint32_t number_of_chunks_written_to_section; /* The determined (estimated) number of chunks per segment file */ uint32_t chunks_per_segment_file; /* The determined (estimated) number of chunks per section */ uint32_t chunks_per_section; /* The maximum number of chunks that can be written to a chunks section */ uint32_t maximum_chunks_per_section; /* The offset of the chunks section within the current segment file */ off64_t chunks_section_offset; /* Value to indicate if the offset table should not be restricted * to the maximum number of offsets */ uint8_t unrestrict_offset_table; /* Value to indicate the write values were initialized */ uint8_t values_initialized; /* Value to indicate a new chunks section should be created */ uint8_t create_chunks_section; /* The offset in the segment file from which to resume write */ off64_t resume_segment_file_offset; /* Value to indicate if the write has been finalized */ uint8_t write_finalized; /* The compressed zero byte empty block */ uint8_t *compressed_zero_byte_empty_block; /* The size of the compressed zero byte empty block */ size_t compressed_zero_byte_empty_block_size; }; int libewf_write_io_handle_initialize( libewf_write_io_handle_t **write_io_handle, libcerror_error_t **error ); int libewf_write_io_handle_free( libewf_write_io_handle_t **write_io_handle, libcerror_error_t **error ); int libewf_write_io_handle_clone( libewf_write_io_handle_t **destination_write_io_handle, libewf_write_io_handle_t *source_write_io_handle, libcerror_error_t **error ); int libewf_write_io_handle_initialize_values( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libewf_media_values_t *media_values, libewf_segment_table_t *segment_table, libcerror_error_t **error ); int libewf_write_io_handle_initialize_resume( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libmfdata_list_t *chunk_table_list, libewf_chunk_table_t *chunk_table, libewf_segment_table_t *segment_table, libcerror_error_t **error ); int libewf_write_io_handle_set_compressed_zero_byte_empty_block( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libewf_media_values_t *media_values, libcerror_error_t **error ); int libewf_write_io_handle_calculate_chunks_per_segment_file( uint32_t *chunks_per_segment_file, size64_t remaining_segment_file_size, uint32_t maximum_chunks_per_section, uint32_t number_of_chunks_written_to_segment, uint32_t number_of_chunks_written, libewf_media_values_t *media_values, uint8_t format, uint8_t ewf_format, uint8_t unrestrict_offset_table, libcerror_error_t **error ); int libewf_write_io_handle_calculate_chunks_per_section( uint32_t *chunks_per_section, uint32_t maximum_chunks_per_section, uint32_t number_of_chunks_written_to_segment, uint32_t chunks_per_segment_file, uint8_t unrestrict_offset_table, libcerror_error_t **error ); int libewf_write_io_handle_test_segment_file_full( ssize64_t remaining_segment_file_size, uint32_t number_of_chunks_written_to_segment, libewf_media_values_t *media_values, ssize64_t input_write_count, uint32_t chunks_per_segment_file, uint32_t number_of_chunks_written, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ); int libewf_write_io_handle_test_chunks_section_full( off64_t chunks_section_offset, ssize64_t remaining_segment_file_size, libewf_media_values_t *media_values, ssize64_t input_write_count, off64_t segment_file_offset, uint32_t maximum_chunks_per_section, uint32_t number_of_chunks_written_to_section, uint32_t number_of_chunks_written, uint32_t chunks_per_section, uint8_t format, uint8_t ewf_format, uint8_t unrestrict_offset_table, libcerror_error_t **error ); int libewf_write_io_handle_create_segment_file( libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libewf_segment_table_t *segment_table, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, libewf_segment_file_t **segment_file, int *segment_files_list_index, int *file_io_pool_entry, libcerror_error_t **error ); ssize_t libewf_write_io_handle_write_new_chunk( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libewf_segment_table_t *segment_table, libmfdata_list_t *chunk_table_list, libfvalue_table_t *header_values, libfvalue_table_t *hash_values, libewf_header_sections_t *header_sections, libewf_hash_sections_t *hash_sections, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, int chunk_index, uint8_t *chunk_buffer, size_t chunk_buffer_size, size_t chunk_data_size, int8_t is_compressed, uint8_t *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libcerror_error_t **error ); ssize_t libewf_write_io_handle_write_existing_chunk( libewf_write_io_handle_t *write_io_handle, libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_file_list_t *delta_segment_files_list, libfcache_cache_t *segment_files_cache, libewf_segment_table_t *delta_segment_table, libmfdata_list_t *chunk_table_list, libewf_header_sections_t *header_sections, int chunk_index, uint8_t *chunk_buffer, size_t chunk_buffer_size, size_t chunk_data_size, int8_t is_compressed, uint8_t *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libcerror_error_t **error ); int libewf_write_io_handle_finalize_write_sections_corrections( libewf_io_handle_t *io_handle, libbfio_pool_t *file_io_pool, uint32_t number_of_chunks_written_to_last_segment, libewf_media_values_t *media_values, libmfdata_file_list_t *segment_files_list, libfcache_cache_t *segment_files_cache, libfvalue_table_t *hash_values, libewf_hash_sections_t *hash_sections, libcdata_array_t *sessions, libcdata_array_t *tracks, libcdata_range_list_t *acquiry_errors, ewf_data_t **cached_data_section, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_error.c0000664000175000017500000000550413440663046021440 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2006-2018, 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 . */ #include #include #include #include "libewf_error.h" #include "libewf_libcerror.h" #if !defined( HAVE_LOCAL_LIBEWF ) /* Free an error and its elements */ void libewf_error_free( libewf_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libewf_error_fprint( libewf_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libewf_error_sprint( libewf_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libewf_error_backtrace_fprint( libewf_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libewf_error_backtrace_sprint( libewf_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ libewf-20140807/libewf/libewf_read_io_handle.h0000644000175000017500000000440113421013625023211 0ustar00lordyestalordyesta00000000000000/* * Low level reading functions * * 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_READ_IO_HANDLE_H ) #define _LIBEWF_READ_IO_HANDLE_H #include #include #include "libewf_chunk_data.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_read_io_handle libewf_read_io_handle_t; struct libewf_read_io_handle { /* The sectors with checksum errors */ libcdata_range_list_t *checksum_errors; /* A value to indicate if the chunk data should be zeroed on error */ uint8_t zero_on_error; }; int libewf_read_io_handle_initialize( libewf_read_io_handle_t **read_io_handle, libcerror_error_t **error ); int libewf_read_io_handle_free( libewf_read_io_handle_t **read_io_handle, libcerror_error_t **error ); int libewf_read_io_handle_clone( libewf_read_io_handle_t **destination_read_io_handle, libewf_read_io_handle_t *source_read_io_handle, libcerror_error_t **error ); int libewf_read_io_handle_read_chunk_data( libewf_read_io_handle_t *read_io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_list_t *chunk_table_list, libfcache_cache_t *chunk_table_cache, int chunk_index, off64_t chunk_offset, libewf_chunk_data_t **chunk_data, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/ewf_ltree.h0000644000175000017500000000273513421013623020726 0ustar00lordyestalordyesta00000000000000/* * EWF ltree section * * 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( _EWF_LTREE_H ) #define _EWF_LTREE_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_ltree_header ewf_ltree_header_t; struct ewf_ltree_header { /* Unknown * consists of 16 bytes */ uint8_t unknown1[ 16 ]; /* The size of the tree in bytes * consists of 4 bytes (32 bits) */ uint8_t tree_size[ 4 ]; /* Unknown * consists of 4 bytes * contains 0x00 */ uint8_t unknown2[ 4 ]; /* Unknown * consists of 4 bytes * possible checksum? */ uint8_t unknown3[ 4 ]; /* Unknown * consists of 20 bytes * contains 0x00 */ uint8_t unknown4[ 20 ]; }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_metadata.c0000664000175000017500000042427213421024433022064 0ustar00lordyestalordyesta00000000000000/* * Metadata functions * * 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 . */ #include #include #include #include #include "libewf_codepage.h" #include "libewf_date_time_values.h" #include "libewf_definitions.h" #include "libewf_handle.h" #include "libewf_hash_values.h" #include "libewf_header_values.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfvalue.h" #include "libewf_metadata.h" #include "libewf_sector_range.h" #include "libewf_segment_file_handle.h" #include "libewf_types.h" #include "ewf_definitions.h" /* Retrieves the number of sectors per chunk * Returns 1 if successful or -1 on error */ int libewf_handle_get_sectors_per_chunk( libewf_handle_t *handle, uint32_t *sectors_per_chunk, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_sectors_per_chunk"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( sectors_per_chunk == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sectors per chunk.", function ); return( -1 ); } if( internal_handle->media_values->sectors_per_chunk > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sectors per chunk value exceeds maximum.", function ); return( -1 ); } *sectors_per_chunk = internal_handle->media_values->sectors_per_chunk; return( 1 ); } /* Sets the number of sectors per chunk * Returns 1 if successful or -1 on error */ int libewf_handle_set_sectors_per_chunk( libewf_handle_t *handle, uint32_t sectors_per_chunk, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_sectors_per_chunk"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: sectors per chunk cannot be changed.", function ); return( -1 ); } if( libewf_internal_handle_set_media_values( internal_handle, sectors_per_chunk, internal_handle->media_values->bytes_per_sector, internal_handle->media_values->media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media values.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of bytes per sector * Returns 1 if successful or -1 on error */ int libewf_handle_get_bytes_per_sector( libewf_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_bytes_per_sector"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( bytes_per_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } if( internal_handle->media_values->bytes_per_sector > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid bytes per sector value exceeds maximum.", function ); return( -1 ); } *bytes_per_sector = internal_handle->media_values->bytes_per_sector; return( 1 ); } /* Sets the number of bytes per sector * Returns 1 if successful or -1 on error */ int libewf_handle_set_bytes_per_sector( libewf_handle_t *handle, uint32_t bytes_per_sector, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_bytes_per_sector"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: bytes per sector cannot be changed.", function ); return( -1 ); } if( libewf_internal_handle_set_media_values( internal_handle, internal_handle->media_values->sectors_per_chunk, bytes_per_sector, internal_handle->media_values->media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media values.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of sectors * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_sectors( libewf_handle_t *handle, uint64_t *number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_sectors"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } if( internal_handle->media_values->number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } *number_of_sectors = internal_handle->media_values->number_of_sectors; return( 1 ); } /* Retrieves the chunk size * Returns 1 if successful or -1 on error */ int libewf_handle_get_chunk_size( libewf_handle_t *handle, size32_t *chunk_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_chunk_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( chunk_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk size.", function ); return( -1 ); } if( internal_handle->media_values->chunk_size > (size32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk size value exceeds maximum.", function ); return( -1 ); } *chunk_size = internal_handle->media_values->chunk_size; return( 1 ); } /* Retrieves the error granularity * Returns 1 if successful or -1 on error */ int libewf_handle_get_error_granularity( libewf_handle_t *handle, uint32_t *error_granularity, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_error_granularity"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( error_granularity == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error granularity.", function ); return( -1 ); } if( internal_handle->media_values->error_granularity > (uint32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid error granularity value exceeds maximum.", function ); return( -1 ); } *error_granularity = internal_handle->media_values->error_granularity; return( 1 ); } /* Sets the error granularity * Returns 1 if successful or -1 on error */ int libewf_handle_set_error_granularity( libewf_handle_t *handle, uint32_t error_granularity, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_error_granularity"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: error granularity cannot be changed.", function ); return( -1 ); } internal_handle->media_values->error_granularity = error_granularity; return( 1 ); } /* Retrieves the compression values * Returns 1 if successful or -1 on error */ int libewf_handle_get_compression_values( libewf_handle_t *handle, int8_t *compression_level, uint8_t *compression_flags, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_compression_values"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( compression_level == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compression level.", function ); return( -1 ); } if( compression_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compression flags.", function ); return( -1 ); } *compression_level = internal_handle->io_handle->compression_level; *compression_flags = internal_handle->io_handle->compression_flags; return( 1 ); } /* Sets the compression values * Returns 1 if successful or -1 on error */ int libewf_handle_set_compression_values( libewf_handle_t *handle, int8_t compression_level, uint8_t compression_flags , libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_compression_values"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: compression values cannot be changed.", function ); return( -1 ); } if( ( compression_level != EWF_COMPRESSION_NONE ) && ( compression_level != EWF_COMPRESSION_FAST ) && ( compression_level != EWF_COMPRESSION_BEST ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported compression level.", function ); return( -1 ); } internal_handle->io_handle->compression_level = compression_level; internal_handle->io_handle->compression_flags = compression_flags; return( 1 ); } /* Retrieves the size of the contained media data * Returns 1 if successful or -1 on error */ int libewf_handle_get_media_size( libewf_handle_t *handle, size64_t *media_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_media_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( media_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media size.", function ); return( -1 ); } *media_size = internal_handle->media_values->media_size; return( 1 ); } /* Sets the media size * Returns 1 if successful or -1 on error */ int libewf_handle_set_media_size( libewf_handle_t *handle, size64_t media_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_media_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media size cannot be changed.", function ); return( -1 ); } if( libewf_internal_handle_set_media_values( internal_handle, internal_handle->media_values->sectors_per_chunk, internal_handle->media_values->bytes_per_sector, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media values.", function ); return( -1 ); } return( 1 ); } /* Retrieves the media type value * Returns 1 if successful or -1 on error */ int libewf_handle_get_media_type( libewf_handle_t *handle, uint8_t *media_type, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_media_type"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->media_type > (uint8_t) INT8_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid media type value exceeds maximum.", function ); return( -1 ); } if( media_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media type.", function ); return( -1 ); } *media_type = internal_handle->media_values->media_type; return( 1 ); } /* Sets the media type * Returns 1 if successful or -1 on error */ int libewf_handle_set_media_type( libewf_handle_t *handle, uint8_t media_type, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_media_type"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media type cannot be changed.", function ); return( -1 ); } internal_handle->media_values->media_type = media_type; return( 1 ); } /* Retrieves the media flags * Returns 1 if successful or -1 on error */ int libewf_handle_get_media_flags( libewf_handle_t *handle, uint8_t *media_flags, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_media_flags"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->media_values->media_flags > (uint8_t) INT8_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid media flags value exceeds maximum.", function ); return( -1 ); } if( media_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media flags.", function ); return( -1 ); } *media_flags = internal_handle->media_values->media_flags; return( 1 ); } /* Sets the media flags * Returns 1 if successful or -1 on error */ int libewf_handle_set_media_flags( libewf_handle_t *handle, uint8_t media_flags, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_media_flags"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: media flags cannot be changed.", function ); return( -1 ); } internal_handle->media_values->media_flags = media_flags; /* Make sure the lowest bit is always set */ internal_handle->media_values->media_flags |= 0x01; return( 1 ); } /* Retrieves the format type value * Returns 1 if successful or -1 on error */ int libewf_handle_get_format( libewf_handle_t *handle, uint8_t *format, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_format"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( internal_handle->io_handle->format > (uint8_t) INT8_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid format value exceeds maximum.", function ); return( -1 ); } if( format == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid format.", function ); return( -1 ); } *format = internal_handle->io_handle->format; return( 1 ); } /* Sets the output format * Returns 1 if successful or -1 on error */ int libewf_handle_set_format( libewf_handle_t *handle, uint8_t format, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_format"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: format cannot be changed.", function ); return( -1 ); } if( libewf_internal_handle_set_format( internal_handle, format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set format.", function ); return( -1 ); } return( 1 ); } /* Retrieves the segment file set identifier * The identifier is a GUID and is 16 bytes of size * Returns 1 if successful or -1 on error */ int libewf_handle_get_segment_file_set_identifier( libewf_handle_t *handle, uint8_t *set_identifier, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_segment_file_set_identifier"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( set_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid set identifier.", function ); return( -1 ); } if( size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: set identifier too small.", function ); return( -1 ); } if( memory_copy( set_identifier, internal_handle->media_values->guid, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy set identifier.", function ); return( -1 ); } return( 1 ); } /* Sets the segment file set identifier * The identifier is a GUID and is 16 bytes of size * Returns 1 if successful or -1 on error */ int libewf_handle_set_segment_file_set_identifier( libewf_handle_t *handle, const uint8_t *set_identifier, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_segment_file_set_identifier"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing media values.", function ); return( -1 ); } if( set_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid set identifier.", function ); return( -1 ); } if( size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: set identifier too small.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: set identifier cannot be changed.", function ); return( -1 ); } if( memory_copy( internal_handle->media_values->guid, set_identifier, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy set identifier.", function ); return( -1 ); } return( 1 ); } /* Retrieves the MD5 hash * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_md5_hash"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing hash sections.", function ); return( -1 ); } if( ( ( internal_handle->hash_sections->md5_hash_set == 0 ) || ( internal_handle->hash_sections->md5_digest_set == 0 ) ) && ( internal_handle->hash_values != NULL ) ) { if( libewf_hash_values_generate_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_hash, 16, &( internal_handle->hash_sections->md5_hash_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash value for its value.", function ); return( -1 ); } } if( ( internal_handle->hash_sections->md5_hash_set == 0 ) && ( internal_handle->hash_sections->md5_digest_set == 0 ) ) { return( 0 ); } if( md5_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid MD5 hash.", function ); return( -1 ); } if( size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: MD5 hash too small.", function ); return( -1 ); } if( internal_handle->hash_sections->md5_hash_set == 0 ) { if( memory_copy( md5_hash, internal_handle->hash_sections->md5_digest, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } } else { if( memory_copy( md5_hash, internal_handle->hash_sections->md5_hash, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } } return( 1 ); } /* Sets the MD5 hash * Returns 1 if successful or -1 on error */ int libewf_handle_set_md5_hash( libewf_handle_t *handle, uint8_t *md5_hash, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_md5_hash"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing hash sections.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->hash_sections->md5_hash_set ) || ( internal_handle->hash_sections->md5_digest_set ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: md5 hash cannot be changed.", function ); return( -1 ); } if( md5_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid MD5 hash.", function ); return( -1 ); } if( size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: MD5 hash too small.", function ); return( -1 ); } if( memory_copy( internal_handle->hash_sections->md5_hash, md5_hash, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } if( memory_copy( internal_handle->hash_sections->md5_digest, md5_hash, 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } if( internal_handle->hash_values == NULL ) { if( libewf_hash_values_initialize( &( internal_handle->hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( libewf_hash_values_parse_md5_hash( internal_handle->hash_values, md5_hash, 16, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash for its value.", function ); return( -1 ); } internal_handle->hash_sections->md5_hash_set = 1; internal_handle->hash_sections->md5_digest_set = 1; return( 1 ); } /* Retrieves the SHA1 hash * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_sha1_hash"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing hash sections.", function ); return( -1 ); } if( ( internal_handle->hash_sections->sha1_digest_set == 0 ) && ( internal_handle->hash_values != NULL ) ) { if( libewf_hash_values_generate_sha1_hash( internal_handle->hash_values, internal_handle->hash_sections->sha1_digest, 20, &( internal_handle->hash_sections->sha1_digest_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash value for its value.", function ); return( -1 ); } } if( internal_handle->hash_sections->sha1_digest_set == 0 ) { return( 0 ); } if( sha1_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid SHA1 hash.", function ); return( -1 ); } if( size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: SHA1 hash too small.", function ); return( -1 ); } if( memory_copy( sha1_hash, internal_handle->hash_sections->sha1_digest, 20 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set MD5 hash.", function ); return( -1 ); } return( 1 ); } /* Sets the SHA1 hash * Returns 1 if successful or -1 on error */ int libewf_handle_set_sha1_hash( libewf_handle_t *handle, uint8_t *sha1_hash, size_t size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_sha1_hash"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing hash sections.", function ); return( -1 ); } if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->hash_sections->sha1_digest_set ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: sha1 hash cannot be changed.", function ); return( -1 ); } if( sha1_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid SHA1 hash.", function ); return( -1 ); } if( size < 20 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: SHA1 hash too small.", function ); return( -1 ); } if( memory_copy( internal_handle->hash_sections->sha1_digest, sha1_hash, 20 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set SHA1 hash.", function ); return( -1 ); } if( internal_handle->hash_values == NULL ) { if( libewf_hash_values_initialize( &( internal_handle->hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( libewf_hash_values_parse_sha1_hash( internal_handle->hash_values, sha1_hash, 20, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse SHA1 hash for its value.", function ); return( -1 ); } internal_handle->hash_sections->sha1_digest_set = 1; return( 1 ); } /* Retrieves the number of chunks written * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_chunks_written( libewf_handle_t *handle, uint32_t *number_of_chunks, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_chunks_written"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->write_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing subhandle write.", function ); return( -1 ); } if( number_of_chunks == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of chunks.", function ); return( -1 ); } *number_of_chunks = internal_handle->write_io_handle->number_of_chunks_written; return( 1 ); } /* Sets the read zero chunk on error * The chunk is not zeroed if read raw is used * Returns 1 if successful or -1 on error */ int libewf_handle_set_read_zero_chunk_on_error( libewf_handle_t *handle, uint8_t zero_on_error, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_read_zero_chunk_on_error"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing read IO handle.", function ); return( -1 ); } internal_handle->read_io_handle->zero_on_error = zero_on_error; return( 1 ); } /* Copies the media values from the source to the destination handle * Returns 1 if successful or -1 on error */ int libewf_handle_copy_media_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_destination_handle = NULL; libewf_internal_handle_t *internal_source_handle = NULL; static char *function = "libewf_handle_copy_media_values"; if( destination_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination handle.", function ); return( -1 ); } if( source_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source handle.", function ); return( -1 ); } internal_destination_handle = (libewf_internal_handle_t *) destination_handle; internal_source_handle = (libewf_internal_handle_t *) source_handle; if( internal_source_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source handle - missing media values.", function ); return( -1 ); } if( internal_destination_handle->media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid destination handle - missing media values.", function ); return( -1 ); } if( memory_copy( internal_destination_handle->media_values, internal_source_handle->media_values, sizeof( libewf_media_values_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy media values.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of acquiry errors * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_acquiry_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_acquiry_errors"; int number_of_elements = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( number_of_errors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of errors.", function ); return( -1 ); } if( libcdata_range_list_get_number_of_elements( internal_handle->acquiry_errors, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from acquiry errors range list.", function ); return( -1 ); } if( number_of_elements < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of elements value out of bounds.", function ); return( -1 ); } *number_of_errors = (uint32_t) number_of_elements; return( 1 ); } /* Retrieves an acquiry error * Returns 1 if successful or -1 on error */ int libewf_handle_get_acquiry_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_acquiry_error"; intptr_t *value = NULL; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( libcdata_range_list_get_range_by_index( internal_handle->acquiry_errors, (int) index, start_sector, number_of_sectors, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve acquiry error: %" PRIu32 ".", function, index ); return( -1 ); } return( 1 ); } /* Append an acquiry error * Returns 1 if successful or -1 on error */ int libewf_handle_append_acquiry_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_append_acquiry_error"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; result = libcdata_range_list_insert_range( internal_handle->acquiry_errors, start_sector, number_of_sectors, NULL, NULL, NULL, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append acquiry error.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of checksum errors * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_checksum_errors( libewf_handle_t *handle, uint32_t *number_of_errors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_checksum_errors"; int number_of_elements = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing read IO handle.", function ); return( -1 ); } if( number_of_errors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of errors.", function ); return( -1 ); } if( libcdata_range_list_get_number_of_elements( internal_handle->read_io_handle->checksum_errors, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from checksum errors range list.", function ); return( -1 ); } if( number_of_elements < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of elements value out of bounds.", function ); return( -1 ); } *number_of_errors = (uint32_t) number_of_elements; return( 1 ); } /* Retrieves a checksum error * Returns 1 if successful or -1 on error */ int libewf_handle_get_checksum_error( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_checksum_error"; intptr_t *value = NULL; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing read IO handle.", function ); return( -1 ); } if( libcdata_range_list_get_range_by_index( internal_handle->read_io_handle->checksum_errors, (int) index, start_sector, number_of_sectors, &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve checksum error: %" PRIu32 ".", function, index ); return( -1 ); } return( 1 ); } /* Append a checksum error * Returns 1 if successful or -1 on error */ int libewf_handle_append_checksum_error( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_append_checksum_error"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing read IO handle.", function ); return( -1 ); } result = libcdata_range_list_insert_range( internal_handle->read_io_handle->checksum_errors, start_sector, number_of_sectors, NULL, NULL, NULL, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append checksum error.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of sessions * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_sessions( libewf_handle_t *handle, uint32_t *number_of_sessions, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_sessions"; int number_of_entries = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( number_of_sessions == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sessions.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->sessions, &number_of_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sessions array.", function ); return( -1 ); } if( number_of_entries < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of elements value out of bounds.", function ); return( -1 ); } *number_of_sessions = (uint32_t) number_of_entries; return( 1 ); } /* Retrieves a session * Returns 1 if successful or -1 on error */ int libewf_handle_get_session( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_sector_range_t *sector_range = NULL; static char *function = "libewf_handle_get_session"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->sessions, (int) index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session sector range: %" PRIu32 " from array.", function, index ); return( -1 ); } if( libewf_sector_range_get( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %" PRIu32 " sector range.", function, index ); return( -1 ); } return( 1 ); } /* Appends a session * Returns 1 if successful or -1 on error */ int libewf_handle_append_session( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_sector_range_t *sector_range = NULL; static char *function = "libewf_handle_append_session"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( libewf_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create session sector range.", function ); goto on_error; } if( libewf_sector_range_set( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set session sector range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->sessions, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session sector range to array.", function ); goto on_error; } return( 1 ); on_error: if( sector_range != NULL ) { libewf_sector_range_free( §or_range, NULL ); } return( -1 ); } /* Retrieves the number of tracks * Returns 1 if successful or -1 on error */ int libewf_handle_get_number_of_tracks( libewf_handle_t *handle, uint32_t *number_of_tracks, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_tracks"; int number_of_entries = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( number_of_tracks == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of tracks.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->tracks, &number_of_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from tracks array.", function ); return( -1 ); } if( number_of_entries < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of elements value out of bounds.", function ); return( -1 ); } *number_of_tracks = (uint32_t) number_of_entries; return( 1 ); } /* Retrieves a track * Returns 1 if successful or -1 on error */ int libewf_handle_get_track( libewf_handle_t *handle, uint32_t index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_sector_range_t *sector_range = NULL; static char *function = "libewf_handle_get_track"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->tracks, (int) index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track sector range: %" PRIu32 " from array.", function, index ); return( -1 ); } if( libewf_sector_range_get( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %" PRIu32 " sector range.", function, index ); return( -1 ); } return( 1 ); } /* Appends a track * Returns 1 if successful or -1 on error */ int libewf_handle_append_track( libewf_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libewf_sector_range_t *sector_range = NULL; static char *function = "libewf_handle_append_track"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( libewf_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create track sector range.", function ); goto on_error; } if( libewf_sector_range_set( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track sector range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->tracks, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track sector range to array.", function ); goto on_error; } return( 1 ); on_error: if( sector_range != NULL ) { libewf_sector_range_free( §or_range, NULL ); } return( -1 ); } /* Retrieves the header codepage * Returns 1 if successful or -1 on error */ int libewf_handle_get_header_codepage( libewf_handle_t *handle, int *header_codepage, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_header_codepage"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( header_codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header codepage.", function ); return( -1 ); } *header_codepage = internal_handle->io_handle->header_codepage; return( 1 ); } /* Sets the header codepage * Returns 1 if successful or -1 on error */ int libewf_handle_set_header_codepage( libewf_handle_t *handle, int header_codepage, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_header_codepage"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( header_codepage != LIBEWF_CODEPAGE_ASCII ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_874 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_932 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_936 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1250 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1251 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1252 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1253 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1254 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1255 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1256 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1257 ) && ( header_codepage != LIBEWF_CODEPAGE_WINDOWS_1258 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported header codepage.", function ); return( -1 ); } internal_handle->io_handle->header_codepage = header_codepage; return( 1 ); } /* Retrieves the header value date format * Returns 1 if successful or -1 on error */ int libewf_handle_get_header_values_date_format( libewf_handle_t *handle, int *date_format, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_header_values_date_format"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing header sections.", function ); return( -1 ); } if( date_format == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date format.", function ); return( -1 ); } *date_format = internal_handle->date_format; return( 1 ); } /* Sets the header values date format * Returns 1 if successful or -1 on error */ int libewf_handle_set_header_values_date_format( libewf_handle_t *handle, int date_format, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_set_header_values_date_format"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing header sections.", function ); return( -1 ); } if( ( date_format != LIBEWF_DATE_FORMAT_CTIME ) && ( date_format != LIBEWF_DATE_FORMAT_DAYMONTH ) && ( date_format != LIBEWF_DATE_FORMAT_MONTHDAY ) && ( date_format != LIBEWF_DATE_FORMAT_ISO8601 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported date format.", function ); return( -1 ); } internal_handle->date_format = date_format; return( 1 ); } /* Retrieves the number of header values * Returns 1 if successful, 0 if no header values are present or -1 on error */ int libewf_handle_get_number_of_header_values( libewf_handle_t *handle, uint32_t *number_of_values, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_header_values"; int number_of_header_values = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( number_of_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of values.", function ); return( -1 ); } if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( libfvalue_table_get_number_of_values( internal_handle->header_values, &number_of_header_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of header values.", function ); return( -1 ); } if( number_of_header_values < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of header values value out of bounds.", function ); return( -1 ); } *number_of_values = (uint32_t) number_of_header_values; return( 1 ); } /* Retrieves the size of the value identifier of a specific index * The identifier size includes the end of string character * Returns 1 if successful, 0 if no header values are present or -1 on error */ int libewf_handle_get_header_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; uint8_t *header_value_identifier = NULL; static char *function = "libewf_handle_get_header_value_identifier_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( libfvalue_table_get_value_by_index( internal_handle->header_values, (int) index, &header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %" PRIu32 ".", function, index ); return( -1 ); } if( libfvalue_value_get_identifier( header_value, &header_value_identifier, identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value identifier size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the header value identifier of a specific index * The identifier size should include the end of string character * Returns 1 if successful, 0 if no header values are present or -1 on error */ int libewf_handle_get_header_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; uint8_t *header_value_identifier = NULL; static char *function = "libewf_handle_get_header_value_identifier"; size_t header_value_identifier_size = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( libfvalue_table_get_value_by_index( internal_handle->header_values, (int) index, &header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %" PRIu32 ".", function, index ); return( -1 ); } if( libfvalue_value_get_identifier( header_value, &header_value_identifier, &header_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value identifier size.", function ); return( -1 ); } if( identifier_size < header_value_identifier_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: identifier size too small.", function ); return( -1 ); } if( memory_copy( identifier, header_value_identifier, header_value_identifier_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy identifier.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of the UTF-8 encoded header value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf8_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ) { uint8_t date_time_string[ 64 ]; libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; uint8_t *header_value_data = NULL; static char *function = "libewf_handle_get_utf8_header_value_size"; size_t date_time_string_size = 64; size_t header_value_data_size = 0; size_t string_index = 0; int encoding = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( ( identifier_length == 16 ) && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, (uint8_t *) "compression_level", 18, &header_value, 0, error ); } else { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, identifier, identifier_length + 1, &header_value, 0, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if header value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( ( ( identifier_length == 11 ) && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) { if( libfvalue_value_get_data( header_value, &header_value_data, &header_value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value data.", function ); return( -1 ); } if( libewf_date_time_values_copy_to_utf8_string( header_value_data, header_value_data_size, internal_handle->date_format, date_time_string, date_time_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value data to date time string.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } for( string_index = 0; string_index < date_time_string_size; string_index++ ) { if( date_time_string[ string_index ] == 0 ) { break; } } *utf8_string_size = 1 + string_index; } else { if( libfvalue_value_get_utf8_string_size( header_value, 0, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-8 string size of header value.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the UTF-8 encoded header value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; uint8_t *header_value_data = NULL; static char *function = "libewf_handle_get_utf8_header_value"; size_t header_value_data_size = 0; int encoding = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( ( identifier_length == 16 ) && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, (uint8_t *) "compression_level", 18, &header_value, 0, error ); } else { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, identifier, identifier_length + 1, &header_value, 0, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if header value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( ( ( identifier_length == 11 ) && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) { if( libfvalue_value_get_data( header_value, &header_value_data, &header_value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value data.", function ); return( -1 ); } if( libewf_date_time_values_copy_to_utf8_string( header_value_data, header_value_data_size, internal_handle->date_format, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value data to UTF-8 string.", function ); return( -1 ); } } else { if( libfvalue_value_copy_to_utf8_string( header_value, 0, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value to UTF-8 string.", function ); return( -1 ); } } return( 1 ); } /* Sets the UTF-8 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ int libewf_handle_set_utf8_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; static char *function = "libewf_handle_set_utf8_header_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: header value cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( internal_handle->header_values == NULL ) { if( libewf_header_values_initialize( &( internal_handle->header_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header values.", function ); return( -1 ); } } result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, identifier, identifier_length + 1, &header_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &header_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( header_value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s identifier.", function, (char *) identifier ); libfvalue_value_free( &header_value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->header_values, header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s in table.", function, (char *) identifier ); libfvalue_value_free( &header_value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf8_string( header_value, 0, utf8_string, utf8_string_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value from UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of the UTF-16 encoded header value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf16_header_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ) { uint16_t date_time_string[ 64 ]; libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; uint8_t *header_value_data = NULL; static char *function = "libewf_handle_get_utf8_header_value_size"; size_t date_time_string_size = 64; size_t header_value_data_size = 0; size_t string_index = 0; int encoding = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( ( identifier_length == 16 ) && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, (uint8_t *) "compression_level", 18, &header_value, 0, error ); } else { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, identifier, identifier_length + 1, &header_value, 0, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if header value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( ( ( identifier_length == 11 ) && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) { if( libfvalue_value_get_data( header_value, &header_value_data, &header_value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value data.", function ); return( -1 ); } if( libewf_date_time_values_copy_to_utf16_string( header_value_data, header_value_data_size, internal_handle->date_format, date_time_string, date_time_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value data to date time string.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } for( string_index = 0; string_index < date_time_string_size; string_index++ ) { if( date_time_string[ string_index ] == 0 ) { break; } } *utf16_string_size = 1 + string_index; } else { if( libfvalue_value_get_utf16_string_size( header_value, 0, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-16 string size of header value.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the UTF-16 encoded header value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; uint8_t *header_value_data = NULL; static char *function = "libewf_handle_get_utf16_header_value"; size_t header_value_data_size = 0; int encoding = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header values.", function ); return( -1 ); } internal_handle->header_values_parsed = 1; } if( internal_handle->header_values == NULL ) { return( 0 ); } if( ( identifier_length == 16 ) && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, (uint8_t *) "compression_level", 18, &header_value, 0, error ); } else { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, identifier, identifier_length + 1, &header_value, 0, error ); } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( header_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if header value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( ( ( identifier_length == 11 ) && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) { if( libfvalue_value_get_data( header_value, &header_value_data, &header_value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value data.", function ); return( -1 ); } if( libewf_date_time_values_copy_to_utf16_string( header_value_data, header_value_data_size, internal_handle->date_format, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value data to UTF-16 string.", function ); return( -1 ); } } else { if( libfvalue_value_copy_to_utf16_string( header_value, 0, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value to UTF-16 string.", function ); return( -1 ); } } return( 1 ); } /* Sets the UTF-16 encoded header value specified by the identifier * Returns 1 if successful or -1 on error */ int libewf_handle_set_utf16_header_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *header_value = NULL; static char *function = "libewf_handle_set_utf16_header_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( ( internal_handle->read_io_handle != NULL ) || ( internal_handle->write_io_handle == NULL ) || ( internal_handle->write_io_handle->values_initialized != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: header value cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( internal_handle->header_values == NULL ) { if( libewf_header_values_initialize( &( internal_handle->header_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header values.", function ); return( -1 ); } } result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, identifier, identifier_length + 1, &header_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &header_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( header_value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s identifier.", function, (char *) identifier ); libfvalue_value_free( &header_value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->header_values, header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s in table.", function, (char *) identifier ); libfvalue_value_free( &header_value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf16_string( header_value, 0, utf16_string, utf16_string_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header value from UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies the header values from the source to the destination handle * Returns 1 if successful or -1 on error */ int libewf_handle_copy_header_values( libewf_handle_t *destination_handle, libewf_handle_t *source_handle, libcerror_error_t **error ) { libewf_internal_handle_t *internal_destination_handle = NULL; libewf_internal_handle_t *internal_source_handle = NULL; static char *function = "libewf_handle_copy_header_values"; if( destination_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination handle.", function ); return( -1 ); } if( source_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source handle.", function ); return( -1 ); } internal_destination_handle = (libewf_internal_handle_t *) destination_handle; internal_source_handle = (libewf_internal_handle_t *) source_handle; if( internal_source_handle->header_values_parsed == 0 ) { if( libewf_handle_parse_header_values( internal_source_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse source handle header values.", function ); return( -1 ); } internal_source_handle->header_values_parsed = 1; } if( internal_source_handle->header_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source handle - missing header values.", function ); return( -1 ); } if( internal_destination_handle->header_values == NULL ) { if( libewf_header_values_initialize( &( internal_destination_handle->header_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header values.", function ); return( -1 ); } } if( libewf_header_values_copy( internal_destination_handle->header_values, internal_source_handle->header_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header values.", function ); return( -1 ); } internal_destination_handle->header_values_parsed = 1; return( 1 ); } /* Parses the header values from the header, header2 and/or xheader section * Will parse all the available headers in order mentioned above * Returns 1 if successful or -1 on error */ int libewf_handle_parse_header_values( libewf_internal_handle_t *internal_handle, libcerror_error_t **error ) { libfvalue_value_t *header_value = NULL; uint8_t *header_value_data = NULL; static char *function = "libewf_handle_parse_header_values"; size_t header_value_data_size = 0; int encoding = 0; int result = 0; int result_header = 1; int result_header2 = 1; int result_xheader = 1; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->header_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing header sections.", function ); return( -1 ); } if( internal_handle->header_values == NULL ) { if( libewf_header_values_initialize( &( internal_handle->header_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create header values.", function ); return( -1 ); } } if( internal_handle->header_sections->header != NULL ) { if( libewf_header_values_parse_header( internal_handle->header_values, internal_handle->header_sections->header, internal_handle->header_sections->header_size, internal_handle->io_handle->header_codepage, &( internal_handle->io_handle->format ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header.", function ); result_header = -1; } } if( internal_handle->header_sections->header2 != NULL ) { if( libewf_header_values_parse_header2( internal_handle->header_values, internal_handle->header_sections->header2, internal_handle->header_sections->header2_size, &( internal_handle->io_handle->format ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse header2.", function ); result_header2 = -1; } } if( internal_handle->header_sections->xheader != NULL ) { if( libewf_header_values_parse_xheader( internal_handle->header_values, internal_handle->header_sections->xheader, internal_handle->header_sections->xheader_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse xheader.", function ); result_xheader = -1; } } if( ( result_header != 1 ) && ( result_header2 != 1 ) && ( result_xheader != 1 ) ) { return( -1 ); } if( ( result_header != 1 ) || ( result_header2 != 1 ) || ( result_xheader != 1 ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } /* The EnCase2 and EnCase3 format are the same * only the acquiry software version provides insight in which version of EnCase was used */ if( internal_handle->io_handle->format == LIBEWF_FORMAT_ENCASE2 ) { result = libfvalue_table_get_value_by_identifier( internal_handle->header_values, (uint8_t *) "acquiry_software_version", 25, &header_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: acquiry_software_version.", function ); return( -1 ); } else if( result != 0 ) { if( libfvalue_value_get_data( header_value, &header_value_data, &header_value_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value data.", function ); return( -1 ); } if( header_value_data[ 0 ] == (uint8_t) '3' ) { internal_handle->io_handle->format = LIBEWF_FORMAT_ENCASE3; } } } return( 1 ); } /* Retrieves the number of hash values * Returns 1 if successful, 0 if no hash values are present or -1 on error */ int libewf_handle_get_number_of_hash_values( libewf_handle_t *handle, uint32_t *number_of_values, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; static char *function = "libewf_handle_get_number_of_hash_values"; int number_of_hash_values = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( number_of_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of values.", function ); return( -1 ); } if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } if( libfvalue_table_get_number_of_values( internal_handle->hash_values, &number_of_hash_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of hash values.", function ); return( -1 ); } if( number_of_hash_values < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of hash values value out of bounds.", function ); return( -1 ); } *number_of_values = (uint32_t) number_of_hash_values; return( 1 ); } /* Retrieves the size of the hash value identifier of a specific index * The identifier size includes the end of string character * Returns 1 if successful, 0 if if no hash values are present or -1 on error */ int libewf_handle_get_hash_value_identifier_size( libewf_handle_t *handle, uint32_t index, size_t *identifier_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; uint8_t *hash_value_identifier = NULL; static char *function = "libewf_handle_get_hash_value_identifier_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } if( libfvalue_table_get_value_by_index( internal_handle->hash_values, (int) index, &hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %" PRIu32 ".", function, index ); return( -1 ); } if( libfvalue_value_get_identifier( hash_value, &hash_value_identifier, identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value identifier size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the hash value identifier of a specific index * The identifier size should include the end of string character * Returns 1 if successful, 0 if no hash values are present or -1 on error */ int libewf_handle_get_hash_value_identifier( libewf_handle_t *handle, uint32_t index, uint8_t *identifier, size_t identifier_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; uint8_t *hash_value_identifier = NULL; static char *function = "libewf_handle_get_hash_value_identifier"; size_t hash_value_identifier_size = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } if( libfvalue_table_get_value_by_index( internal_handle->hash_values, (int) index, &hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %" PRIu32 ".", function, index ); return( -1 ); } if( libfvalue_value_get_identifier( hash_value, &hash_value_identifier, &hash_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value identifier size.", function ); return( -1 ); } if( identifier_size < hash_value_identifier_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: identifier size too small.", function ); return( -1 ); } if( memory_copy( identifier, hash_value_identifier, hash_value_identifier_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy identifier.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size of the UTF-8 encoded hash value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf8_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf8_string_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_handle_get_utf8_hash_value_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } result = libfvalue_table_get_value_by_identifier( internal_handle->hash_values, identifier, identifier_length + 1, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( hash_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if hash value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfvalue_value_get_utf8_string_size( hash_value, 0, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-8 string size of hash value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-8 encoded hash value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_handle_get_utf8_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } result = libfvalue_table_get_value_by_identifier( internal_handle->hash_values, identifier, identifier_length + 1, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( hash_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if hash value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfvalue_value_copy_to_utf8_string( hash_value, 0, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hash value to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Sets the UTF-8 encoded hash value specified by the identifier * Returns 1 if successful or -1 on error */ int libewf_handle_set_utf8_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_handle_set_utf8_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: hash value cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( internal_handle->hash_values == NULL ) { if( libewf_hash_values_initialize( &( internal_handle->hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } result = libfvalue_table_get_value_by_identifier( internal_handle->hash_values, identifier, identifier_length + 1, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &hash_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( hash_value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s identifier.", function, (char *) identifier ); libfvalue_value_free( &hash_value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->hash_values, hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s in table.", function, (char *) identifier ); libfvalue_value_free( &hash_value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf8_string( hash_value, 0, utf8_string, utf8_string_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hash value from UTF-8 string.", function ); return( -1 ); } if( internal_handle->hash_sections != NULL ) { if( ( identifier_length == 3 ) && ( narrow_string_compare( (char *) identifier, "MD5", identifier_length ) == 0 ) ) { if( libewf_hash_values_generate_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_hash, 16, &( internal_handle->hash_sections->md5_hash_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash value for its value.", function ); return( -1 ); } if( libewf_hash_values_generate_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_digest, 16, &( internal_handle->hash_sections->md5_digest_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash value for its value.", function ); return( -1 ); } } else if( ( identifier_length == 4 ) && ( narrow_string_compare( (char *) identifier, "SHA1", identifier_length ) == 0 ) ) { if( libewf_hash_values_generate_sha1_hash( internal_handle->hash_values, internal_handle->hash_sections->sha1_digest, 20, &( internal_handle->hash_sections->sha1_digest_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse SHA1 hash value for its value.", function ); return( -1 ); } } } return( 1 ); } /* Retrieves the size of the UTF-16 encoded hash value of an identifier * The string size includes the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf16_hash_value_size( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, size_t *utf16_string_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_handle_get_utf16_hash_value_size"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } result = libfvalue_table_get_value_by_identifier( internal_handle->hash_values, identifier, identifier_length + 1, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( hash_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if hash value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfvalue_value_get_utf16_string_size( hash_value, 0, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve UTF-16 string size of hash value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the UTF-16 encoded hash value of an identifier * The string size should include the end of string character * Returns 1 if successful, 0 if value not present or -1 on error */ int libewf_handle_get_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_handle_get_utf16_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid indentifier.", function ); return( -1 ); } if( internal_handle->hash_values_parsed == 0 ) { if( libewf_handle_parse_hash_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } if( internal_handle->hash_values == NULL ) { return( 0 ); } result = libfvalue_table_get_value_by_identifier( internal_handle->hash_values, identifier, identifier_length + 1, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { return( 0 ); } result = libfvalue_value_has_data( hash_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if hash value has data.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfvalue_value_copy_to_utf16_string( hash_value, 0, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hash value to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Sets the UTF-16 encoded hash value specified by the identifier * Returns 1 if successful or -1 on error */ int libewf_handle_set_utf16_hash_value( libewf_handle_t *handle, const uint8_t *identifier, size_t identifier_length, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ) { libewf_internal_handle_t *internal_handle = NULL; libfvalue_value_t *hash_value = NULL; static char *function = "libewf_handle_set_utf16_hash_value"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libewf_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_READ ) != 0 ) && ( ( internal_handle->io_handle->access_flags & LIBEWF_ACCESS_FLAG_RESUME ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: hash value cannot be changed.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( internal_handle->hash_values == NULL ) { if( libewf_hash_values_initialize( &( internal_handle->hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash values.", function ); return( -1 ); } internal_handle->hash_values_parsed = 1; } result = libfvalue_table_get_value_by_identifier( internal_handle->hash_values, identifier, identifier_length + 1, &hash_value, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, (char *) identifier ); return( -1 ); } else if( result == 0 ) { if( libfvalue_value_type_initialize( &hash_value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash value.", function ); return( -1 ); } if( libfvalue_value_set_identifier( hash_value, identifier, identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s identifier.", function, (char *) identifier ); libfvalue_value_free( &hash_value, NULL ); return( -1 ); } if( libfvalue_table_set_value( internal_handle->hash_values, hash_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s in table.", function, (char *) identifier ); libfvalue_value_free( &hash_value, NULL ); return( -1 ); } } if( libfvalue_value_copy_from_utf16_string( hash_value, 0, utf16_string, utf16_string_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy hash value from UTF-16 string.", function ); return( -1 ); } if( internal_handle->hash_sections != NULL ) { if( ( identifier_length == 3 ) && ( narrow_string_compare( (char *) identifier, "MD5", identifier_length ) == 0 ) ) { if( libewf_hash_values_generate_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_hash, 16, &( internal_handle->hash_sections->md5_hash_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash value for its value.", function ); return( -1 ); } if( libewf_hash_values_generate_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_digest, 16, &( internal_handle->hash_sections->md5_digest_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash value for its value.", function ); return( -1 ); } } else if( ( identifier_length == 4 ) && ( narrow_string_compare( (char *) identifier, "SHA1", identifier_length ) == 0 ) ) { if( libewf_hash_values_generate_sha1_hash( internal_handle->hash_values, internal_handle->hash_sections->sha1_digest, 20, &( internal_handle->hash_sections->sha1_digest_set ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse SHA1 hash value for its value.", function ); return( -1 ); } } } return( 1 ); } /* Parses the hash values from the hash, digest and/or xhash section * Returns 1 if successful or -1 on error */ int libewf_handle_parse_hash_values( libewf_internal_handle_t *internal_handle, libcerror_error_t **error ) { static char *function = "libewf_handle_parse_hash_values"; int result = 1; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing hash sections.", function ); return( -1 ); } if( internal_handle->hash_values != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - hash sections already set.", function ); return( -1 ); } if( libewf_hash_values_initialize( &( internal_handle->hash_values ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash values.", function ); return( -1 ); } if( ( internal_handle->hash_sections->md5_hash_set != 0 ) && ( libewf_hash_values_parse_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_hash, 16, error ) != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash for its value.", function ); result = -1; } if( ( internal_handle->hash_sections->md5_digest_set != 0 ) || ( internal_handle->hash_sections->sha1_digest_set != 0 ) ) { if( ( internal_handle->hash_sections->md5_digest_set != 0 ) && ( libewf_hash_values_parse_md5_hash( internal_handle->hash_values, internal_handle->hash_sections->md5_digest, 16, error ) != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse MD5 hash for its value.", function ); result = -1; } if( ( internal_handle->hash_sections->sha1_digest_set != 0 ) && ( libewf_hash_values_parse_sha1_hash( internal_handle->hash_values, internal_handle->hash_sections->sha1_digest, 20, error ) != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse SHA1 hash for its value.", function ); result = -1; } } if( ( internal_handle->hash_sections->xhash != NULL ) && ( libewf_hash_values_parse_xhash( internal_handle->hash_values, internal_handle->hash_sections->xhash, internal_handle->hash_sections->xhash_size, error ) != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to parse xhash for values.", function ); result = -1; } if( result != 1 ) { return( -1 ); } return( 1 ); } libewf-20140807/libewf/libewf_filename.c0000664000175000017500000002511213421024433022052 0ustar00lordyestalordyesta00000000000000/* * Filename functions * * 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 . */ #include #include #include #include #include #include #include "libewf_definitions.h" #include "libewf_filename.h" #include "libewf_libcerror.h" #include "ewf_definitions.h" /* Creates the filename extension for a certain segment file * For EWF-E01, EWF-S01 segment file extension naming schema * Returns 1 on success or -1 on error */ int libewf_filename_set_extension( char *extension, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ) { static char *function = "libewf_filename_set_extension"; char extension_first_character = 0; char extension_additional_characters = 0; if( extension == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid extension.", function ); return( -1 ); } if( ( segment_number == 0 ) || ( segment_number > maximum_number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: segment number: %" PRIu16 " is out of bounds.", function, segment_number ); return( -1 ); } if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_EWF ) { if( ( format == LIBEWF_FORMAT_EWF ) || ( format == LIBEWF_FORMAT_EWFX ) ) { extension_first_character = (char) 'e'; extension_additional_characters = (char) 'a'; } else if( ewf_format == EWF_FORMAT_S01 ) { extension_first_character = (char) 's'; extension_additional_characters = (char) 'a'; } else { extension_first_character = (char) 'E'; extension_additional_characters = (char) 'A'; } } else if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_LWF ) { extension_first_character = (char) 'L'; extension_additional_characters = (char) 'A'; } else if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_DWF ) { extension_first_character = (char) 'd'; extension_additional_characters = (char) 'a'; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported segment file type.", function ); return( -1 ); } extension[ 0 ] = extension_first_character; if( segment_number <= 99 ) { extension[ 2 ] = (char) '0' + (char) ( segment_number % 10 ); extension[ 1 ] = (char) '0' + (char) ( segment_number / 10 ); } else if( segment_number >= 100 ) { segment_number -= 100; extension[ 2 ] = extension_additional_characters + (char) ( segment_number % 26 ); segment_number /= 26; extension[ 1 ] = extension_additional_characters + (char) ( segment_number % 26 ); segment_number /= 26; if( segment_number >= 26 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unable to support for more segment files.", function ); return( -1 ); } extension[ 0 ] = extension_first_character + (char) segment_number; } /* Safety check */ if( ( extension[ 0 ] > (char) 'z' ) || ( ( extension[ 0 ] > (char) 'Z' ) && ( extension[ 0 ] < (char) 'a' ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unable to support for more segment files.", function ); return( -1 ); } extension[ 3 ] = 0; return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Creates the filename extension for a certain segment file * For EWF-E01, EWF-S01 segment file extension naming schema * Returns 1 on success or -1 on error */ int libewf_filename_set_extension_wide( wchar_t *extension, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ) { static char *function = "libewf_filename_set_extension_wide"; wchar_t extension_first_character = 0; wchar_t extension_additional_characters = 0; if( extension == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid extension.", function ); return( -1 ); } if( ( segment_number == 0 ) || ( segment_number > maximum_number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: segment number: %" PRIu16 " is out of bounds.", function, segment_number ); return( -1 ); } if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_EWF ) { if( ( format == LIBEWF_FORMAT_EWF ) || ( format == LIBEWF_FORMAT_EWFX ) ) { extension_first_character = (wchar_t) 'e'; extension_additional_characters = (wchar_t) 'a'; } else if( ewf_format == EWF_FORMAT_S01 ) { extension_first_character = (wchar_t) 's'; extension_additional_characters = (wchar_t) 'a'; } else { extension_first_character = (wchar_t) 'E'; extension_additional_characters = (wchar_t) 'A'; } } else if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_LWF ) { extension_first_character = (wchar_t) 'L'; extension_additional_characters = (wchar_t) 'A'; } else if( segment_file_type == LIBEWF_SEGMENT_FILE_TYPE_DWF ) { extension_first_character = (wchar_t) 'd'; extension_additional_characters = (wchar_t) 'a'; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported segment file type.", function ); return( -1 ); } extension[ 0 ] = extension_first_character; if( segment_number <= 99 ) { extension[ 2 ] = (wchar_t) '0' + (wchar_t) ( segment_number % 10 ); extension[ 1 ] = (wchar_t) '0' + (wchar_t) ( segment_number / 10 ); } else if( segment_number >= 100 ) { segment_number -= 100; extension[ 2 ] = extension_additional_characters + (wchar_t) ( segment_number % 26 ); segment_number /= 26; extension[ 1 ] = extension_additional_characters + (wchar_t) ( segment_number % 26 ); segment_number /= 26; if( segment_number >= 26 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unable to support for more segment files.", function ); return( -1 ); } extension[ 0 ] = extension_first_character + (wchar_t) segment_number; } /* Safety check */ if( ( extension[ 0 ] > (wchar_t) 'z' ) || ( ( extension[ 0 ] > (wchar_t) 'Z' ) && ( extension[ 0 ] < (wchar_t) 'a' ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unable to support for more segment files.", function ); return( -1 ); } extension[ 3 ] = 0; return( 1 ); } #endif /* Creates a filename for a certain segment file * Returns 1 if successful or -1 on error */ int libewf_filename_create( system_character_t **filename, size_t *filename_size, system_character_t *basename, size_t basename_length, uint16_t segment_number, uint16_t maximum_number_of_segments, uint8_t segment_file_type, uint8_t format, uint8_t ewf_format, libcerror_error_t **error ) { system_character_t *new_filename = NULL; static char *function = "libewf_filename_create"; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( *filename != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: filename already set.", function ); return( -1 ); } if( filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename size.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } /* The actual filename also contains a '.', 3 character extension and a end of string byte */ new_filename = system_string_allocate( basename_length + 5 ); if( new_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create filename.", function ); return( -1 ); } /* Add one additional character for the end of line */ if( system_string_copy( new_filename, basename, ( basename_length + 1 ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( new_filename ); return( -1 ); } new_filename[ basename_length ] = (system_character_t) '.'; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_filename_set_extension_wide( &( new_filename[ basename_length + 1 ] ), segment_number, maximum_number_of_segments, segment_file_type, format, ewf_format, error ) != 1 ) #else if( libewf_filename_set_extension( &( new_filename[ basename_length + 1 ] ), segment_number, maximum_number_of_segments, segment_file_type, format, ewf_format, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set extension.", function ); memory_free( new_filename ); return( -1 ); } *filename = new_filename; *filename_size = basename_length + 5; return( 1 ); } libewf-20140807/libewf/libewf_support.h0000644000175000017500000000537113421013625022017 0ustar00lordyestalordyesta00000000000000/* * Support functions * * 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_SUPPORT_H ) #define _LIBEWF_SUPPORT_H #include #include #include #include "libewf_extern.h" #include "libewf_libbfio.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBEWF ) LIBEWF_EXTERN \ const char *libewf_get_version( void ); LIBEWF_EXTERN \ int libewf_get_access_flags_read( void ); LIBEWF_EXTERN \ int libewf_get_access_flags_read_write( void ); LIBEWF_EXTERN \ int libewf_get_access_flags_write( void ); LIBEWF_EXTERN \ int libewf_get_access_flags_write_resume( void ); LIBEWF_EXTERN \ int libewf_get_codepage( int *codepage, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBEWF ) */ LIBEWF_EXTERN \ int libewf_check_file_signature( const char *filename, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_check_file_signature_wide( const wchar_t *filename, libcerror_error_t **error ); #endif LIBEWF_EXTERN \ int libewf_check_file_signature_file_io_handle( libbfio_handle_t *file_io_handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_glob( const char *filename, size_t length, uint8_t format, char **filenames[], int *number_of_filenames, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_glob_free( char *filenames[], int number_of_filenames, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_glob_wide( const wchar_t *filename, size_t length, uint8_t format, wchar_t **filenames[], int *number_of_filenames, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_glob_wide_free( wchar_t *filenames[], int number_of_filenames, libcerror_error_t **error ); #endif #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_libuna.h0000664000175000017500000000330413440663047021563 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2006-2018, 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_LIBUNA_H ) #define _LIBEWF_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBEWF_LIBUNA_H ) */ libewf-20140807/libewf/libewf_deflate.h0000664000175000017500000000757213442120661021720 0ustar00lordyestalordyesta00000000000000/* * Deflate (zlib) (un)compression functions * * Copyright (C) 2006-2019, 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_DEFLATE_COMPRESSION_H ) #define _LIBEWF_DEFLATE_COMPRESSION_H #include #include #include "libewf_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif /* The block types */ enum LIBEWF_DEFLATE_BLOCK_TYPES { LIBEWF_DEFLATE_BLOCK_TYPE_UNCOMPRESSED = 0x00, LIBEWF_DEFLATE_BLOCK_TYPE_HUFFMAN_FIXED = 0x01, LIBEWF_DEFLATE_BLOCK_TYPE_HUFFMAN_DYNAMIC = 0x02, LIBEWF_DEFLATE_BLOCK_TYPE_RESERVED = 0x03 }; typedef struct libewf_deflate_bit_stream libewf_deflate_bit_stream_t; struct libewf_deflate_bit_stream { /* The byte stream */ const uint8_t *byte_stream; /* The byte stream size */ size_t byte_stream_size; /* The byte stream offset */ size_t byte_stream_offset; /* The bit buffer */ uint32_t bit_buffer; /* The number of bits remaining in the bit buffer */ uint8_t bit_buffer_size; }; typedef struct libewf_deflate_huffman_table libewf_deflate_huffman_table_t; struct libewf_deflate_huffman_table { /* The maximum number of bits representable by the Huffman table */ uint8_t maximum_number_of_bits; /* TODO create initialize and set size? */ /* The codes array */ int codes_array[ 288 ]; /* The code counts array */ int code_counts_array[ 16 ]; /* The number of codes */ int number_of_codes; }; int libewf_deflate_bit_stream_get_value( libewf_deflate_bit_stream_t *bit_stream, uint8_t number_of_bits, uint32_t *value_32bit, libcerror_error_t **error ); int libewf_deflate_huffman_table_construct( libewf_deflate_huffman_table_t *table, const uint16_t *code_sizes_array, int number_of_code_sizes, libcerror_error_t **error ); int libewf_deflate_bit_stream_get_huffman_encoded_value( libewf_deflate_bit_stream_t *bit_stream, libewf_deflate_huffman_table_t *table, uint32_t *value_32bit, libcerror_error_t **error ); int libewf_deflate_initialize_dynamic_huffman_tables( libewf_deflate_bit_stream_t *bit_stream, libewf_deflate_huffman_table_t *literals_table, libewf_deflate_huffman_table_t *distances_table, libcerror_error_t **error ); int libewf_deflate_initialize_fixed_huffman_tables( libewf_deflate_huffman_table_t *literals_table, libewf_deflate_huffman_table_t *distances_table, libcerror_error_t **error ); int libewf_deflate_decode_huffman( libewf_deflate_bit_stream_t *bit_stream, libewf_deflate_huffman_table_t *literals_table, libewf_deflate_huffman_table_t *distances_table, uint8_t *uncompressed_data, size_t uncompressed_data_size, size_t *uncompressed_data_offset, libcerror_error_t **error ); int libewf_deflate_calculate_adler32( uint32_t *checksum_value, const uint8_t *buffer, size_t size, uint32_t initial_value, libcerror_error_t **error ); int libewf_deflate_decompress( const uint8_t *compressed_data, size_t compressed_data_size, uint8_t *uncompressed_data, size_t *uncompressed_data_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEWF_DEFLATE_COMPRESSION_H ) */ libewf-20140807/libewf/libewf_segment_table.h0000664000175000017500000000621113421024433023107 0ustar00lordyestalordyesta00000000000000/* * Segment table functions * * 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_SEGMENT_TABLE_H ) #define _LIBEWF_SEGMENT_TABLE_H #include #include #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_segment_table libewf_segment_table_t; struct libewf_segment_table { /* The basename */ system_character_t *basename; /* The basename size */ size_t basename_size; /* The maximum segment size */ size64_t maximum_segment_size; /* The segment files (handles) array */ libcdata_array_t *segment_files_array; /* Flags */ uint8_t flags; }; int libewf_segment_table_initialize( libewf_segment_table_t **segment_table, size64_t maximum_segment_size, libcerror_error_t **error ); int libewf_segment_table_free( libewf_segment_table_t **segment_table, libcerror_error_t **error ); int libewf_segment_table_clone( libewf_segment_table_t **destination_segment_table, libewf_segment_table_t *source_segment_table, libcerror_error_t **error ); int libewf_segment_table_get_basename_size( libewf_segment_table_t *segment_table, size_t *basename_size, libcerror_error_t **error ); int libewf_segment_table_get_basename( libewf_segment_table_t *segment_table, char *basename, size_t basename_size, libcerror_error_t **error ); int libewf_segment_table_set_basename( libewf_segment_table_t *segment_table, const char *basename, size_t basename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libewf_segment_table_get_basename_size_wide( libewf_segment_table_t *segment_table, size_t *basename_size, libcerror_error_t **error ); int libewf_segment_table_get_basename_wide( libewf_segment_table_t *segment_table, wchar_t *basename, size_t basename_size, libcerror_error_t **error ); int libewf_segment_table_set_basename_wide( libewf_segment_table_t *segment_table, const wchar_t *basename, size_t basename_length, libcerror_error_t **error ); #endif int libewf_segment_table_set_maximum_segment_size( libewf_segment_table_t *segment_table, size64_t maximum_segment_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_read_io_handle.c0000664000175000017500000003010213421013625023203 0ustar00lordyestalordyesta00000000000000/* * Low level reading functions * * 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 . */ #include #include #include "libewf_chunk_data.h" #include "libewf_definitions.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #include "libewf_read_io_handle.h" /* Initialize the read IO handle * Returns 1 if successful or -1 on error */ int libewf_read_io_handle_initialize( libewf_read_io_handle_t **read_io_handle, libcerror_error_t **error ) { static char *function = "libewf_read_io_handle_initialize"; if( read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read IO handle.", function ); return( -1 ); } if( *read_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid read IO handle value already set.", function ); return( -1 ); } *read_io_handle = memory_allocate_structure( libewf_read_io_handle_t ); if( *read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create read IO handle.", function ); goto on_error; } if( memory_set( *read_io_handle, 0, sizeof( libewf_read_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear read IO handle.", function ); goto on_error; } if( libcdata_range_list_initialize( &( ( *read_io_handle )->checksum_errors ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create checksum errors range list.", function ); goto on_error; } ( *read_io_handle )->zero_on_error = 1; return( 1 ); on_error: if( *read_io_handle != NULL ) { memory_free( *read_io_handle ); *read_io_handle = NULL; } return( -1 ); } /* Frees the read IO handle including elements * Returns 1 if successful or -1 on error */ int libewf_read_io_handle_free( libewf_read_io_handle_t **read_io_handle, libcerror_error_t **error ) { static char *function = "libewf_read_io_handle_free"; int result = 1; if( read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read IO handle.", function ); return( -1 ); } if( *read_io_handle != NULL ) { if( libcdata_range_list_free( &( ( *read_io_handle )->checksum_errors ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free checksum errors range list.", function ); result = -1; } memory_free( *read_io_handle ); *read_io_handle = NULL; } return( result ); } /* Clones the read IO handle * Returns 1 if successful or -1 on error */ int libewf_read_io_handle_clone( libewf_read_io_handle_t **destination_read_io_handle, libewf_read_io_handle_t *source_read_io_handle, libcerror_error_t **error ) { static char *function = "libewf_read_io_handle_clone"; if( destination_read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination read IO handle.", function ); return( -1 ); } if( *destination_read_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination read IO handle value already set.", function ); return( -1 ); } if( source_read_io_handle == NULL ) { *destination_read_io_handle = NULL; return( 1 ); } *destination_read_io_handle = memory_allocate_structure( libewf_read_io_handle_t ); if( *destination_read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination read IO handle.", function ); goto on_error; } if( memory_set( *destination_read_io_handle, 0, sizeof( libewf_read_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear source to destination read IO handle.", function ); goto on_error; } if( libcdata_range_list_clone( &( ( *destination_read_io_handle )->checksum_errors ), source_read_io_handle->checksum_errors, NULL, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination checksum errors range list.", function ); goto on_error; } ( *destination_read_io_handle )->zero_on_error = source_read_io_handle->zero_on_error; return( 1 ); on_error: if( *destination_read_io_handle != NULL ) { memory_free( *destination_read_io_handle ); *destination_read_io_handle = NULL; } return( -1 ); } /* Reads a certain chunk of data * Adds a checksum error if the data is corrupted * Returns 1 if successful or -1 on error */ int libewf_read_io_handle_read_chunk_data( libewf_read_io_handle_t *read_io_handle, libbfio_pool_t *file_io_pool, libewf_media_values_t *media_values, libmfdata_list_t *chunk_table_list, libfcache_cache_t *chunk_table_cache, int chunk_index, off64_t chunk_offset, libewf_chunk_data_t **chunk_data, libcerror_error_t **error ) { static char *function = "libewf_read_io_handle_read_chunk_data"; size_t chunk_size = 0; uint64_t start_sector = 0; uint32_t number_of_sectors = 0; int result = 0; if( read_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read IO handle.", function ); return( -1 ); } if( media_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media values.", function ); return( -1 ); } if( chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk data.", function ); return( -1 ); } /* This function will expand element groups */ result = libmfdata_list_get_element_value_by_index( chunk_table_list, file_io_pool, chunk_table_cache, chunk_index, (intptr_t **) chunk_data, 0, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk data: %d.", function, chunk_index ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); chunk_size = media_values->chunk_size; if( (size64_t) ( chunk_offset + chunk_size ) > media_values->media_size ) { chunk_size = (size_t) ( media_values->media_size - chunk_offset ); } chunk_data = NULL; if( libewf_chunk_data_initialize( chunk_data, chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create chunk data.", function ); return( -1 ); } if( *chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %d.", function, chunk_index ); return( -1 ); } ( *chunk_data )->data_size = chunk_size; ( *chunk_data )->is_corrupt = 1; if( memory_set( ( *chunk_data )->data, 0, ( *chunk_data )->data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero chunk data.", function ); libewf_chunk_data_free( chunk_data, NULL ); return( -1 ); } if( libmfdata_list_set_element_by_index( chunk_table_list, chunk_index, -1, chunk_offset, chunk_size, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set chunk: %d in table.", function, chunk_index ); libewf_chunk_data_free( chunk_data, NULL ); return( -1 ); } if( libmfdata_list_set_element_value_by_index( chunk_table_list, chunk_table_cache, chunk_index, (intptr_t *) *chunk_data, (int (*)(intptr_t **, libcerror_error_t **)) &libewf_chunk_data_free, LIBMFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set chunk data: %d as element value.", function, chunk_index ); libewf_chunk_data_free( chunk_data, NULL ); return( -1 ); } } else { if( *chunk_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk data: %d.", function, chunk_index ); return( -1 ); } if( libewf_chunk_data_unpack( *chunk_data, media_values->chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to unpack chunk data: %d.", function, chunk_index ); return( -1 ); } if( ( *chunk_data )->is_corrupt != 0 ) { if( read_io_handle->zero_on_error != 0 ) { if( memory_set( ( *chunk_data )->data, 0, ( *chunk_data )->data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero chunk data.", function ); return( -1 ); } } } } if( ( *chunk_data )->is_corrupt != 0 ) { /* Add checksum error */ start_sector = (uint64_t) chunk_index * (uint64_t) media_values->sectors_per_chunk; number_of_sectors = media_values->sectors_per_chunk; if( ( start_sector + number_of_sectors ) > (uint64_t) media_values->number_of_sectors ) { number_of_sectors = (uint32_t) ( (uint64_t) media_values->number_of_sectors - start_sector ); } result = libcdata_range_list_insert_range( read_io_handle->checksum_errors, start_sector, number_of_sectors, NULL, NULL, NULL, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append checksum error to range list.", function ); return( -1 ); } } return( 1 ); } libewf-20140807/libewf/libewf_unused.h0000664000175000017500000000252613440663047021621 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2006-2018, 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_INTERNAL_UNUSED_H ) #define _LIBEWF_INTERNAL_UNUSED_H #include #if !defined( LIBEWF_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBEWF_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBEWF_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBEWF_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBEWF_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBEWF_INTERNAL_UNUSED_H ) */ libewf-20140807/libewf/libewf_compression.c0000664000175000017500000002326713421013623022643 0ustar00lordyestalordyesta00000000000000/* * Compression handling functions * * Copyright (C) 2006-2017, 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 . */ #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) #include #endif #include "libewf_compression.h" #include "libewf_definitions.h" #include "libewf_deflate.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" /* Compresses data using the compression method * Returns 1 on success, 0 if buffer is too small or -1 on error */ int libewf_compress_data( uint8_t *compressed_data, size_t *compressed_data_size, int8_t compression_level, const uint8_t *uncompressed_data, size_t uncompressed_data_size, libcerror_error_t **error ) { static char *function = "libewf_compress_data"; int result = 0; #if ( defined( HAVE_ZLIB ) && defined( HAVE_ZLIB_COMPRESS2 ) ) || defined( ZLIB_DLL ) uLongf zlib_compressed_data_size = 0; int zlib_compression_level = 0; #endif if( compressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed data buffer.", function ); return( -1 ); } if( uncompressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data buffer.", function ); return( -1 ); } if( compressed_data == uncompressed_data ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data buffer equals compressed data buffer.", function ); return( -1 ); } if( compressed_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed data size.", function ); return( -1 ); } #if ( defined( HAVE_ZLIB ) && defined( HAVE_ZLIB_COMPRESS2 ) ) || defined( ZLIB_DLL ) if( compression_level == LIBEWF_COMPRESSION_DEFAULT ) { zlib_compression_level = Z_DEFAULT_COMPRESSION; } else if( compression_level == LIBEWF_COMPRESSION_FAST ) { zlib_compression_level = Z_BEST_SPEED; } else if( compression_level == LIBEWF_COMPRESSION_BEST ) { zlib_compression_level = Z_BEST_COMPRESSION; } else if( compression_level == LIBEWF_COMPRESSION_NONE ) { zlib_compression_level = Z_NO_COMPRESSION; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported compression level.", function ); return( -1 ); } if( *compressed_data_size > (size_t) ULONG_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid compressed data size value exceeds maximum.", function ); return( -1 ); } if( uncompressed_data_size > (size_t) ULONG_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid uncompressed data size value exceeds maximum.", function ); return( -1 ); } zlib_compressed_data_size = (uLongf) *compressed_data_size; result = compress2( (Bytef *) compressed_data, &zlib_compressed_data_size, (Bytef *) uncompressed_data, (uLong) uncompressed_data_size, zlib_compression_level ); if( result == Z_OK ) { *compressed_data_size = (size_t) zlib_compressed_data_size; result = 1; } else if( result == Z_BUF_ERROR ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unable to write compressed data: target buffer too small.\n", function ); } #endif #if defined( HAVE_COMPRESS_BOUND ) || defined( WINAPI ) /* Use compressBound to determine the size of the uncompressed buffer */ zlib_compressed_data_size = compressBound( (uLong) uncompressed_data_size ); *compressed_data_size = (size_t) zlib_compressed_data_size; #else /* Estimate that a factor 2 enlargement should suffice */ *compressed_data_size *= 2; #endif result = 0; } else if( result == Z_MEM_ERROR ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to write compressed data: insufficient memory.", function ); *compressed_data_size = 0; result = -1; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED, "%s: zlib returned undefined error: %d.", function, result ); *compressed_data_size = 0; result = -1; } #else libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: missing support for deflate compression.", function ); result = -1; #endif /* ( defined( HAVE_ZLIB ) && defined( HAVE_ZLIB_COMPRESS2 ) ) || defined( ZLIB_DLL ) */ return( result ); } /* Decompresses data using the compression method * Returns 1 on success, 0 on failure or -1 on error */ int libewf_decompress_data( const uint8_t *compressed_data, size_t compressed_data_size, uint8_t *uncompressed_data, size_t *uncompressed_data_size, libcerror_error_t **error ) { static char *function = "libewf_decompress_data"; int result = 0; #if ( defined( HAVE_ZLIB ) && defined( HAVE_ZLIB_UNCOMPRESS ) ) || defined( ZLIB_DLL ) uLongf zlib_uncompressed_data_size = 0; #endif if( compressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed data buffer.", function ); return( -1 ); } if( uncompressed_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data buffer.", function ); return( -1 ); } if( uncompressed_data == compressed_data ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compressed data buffer equals uncompressed data buffer.", function ); return( -1 ); } if( uncompressed_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid uncompressed data size.", function ); return( -1 ); } #if ( defined( HAVE_ZLIB ) && defined( HAVE_ZLIB_UNCOMPRESS ) ) || defined( ZLIB_DLL ) if( compressed_data_size > (size_t) ULONG_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid compressed data size value exceeds maximum.", function ); return( -1 ); } if( *uncompressed_data_size > (size_t) ULONG_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid uncompressed data size value exceeds maximum.", function ); return( -1 ); } zlib_uncompressed_data_size = (uLongf) *uncompressed_data_size; result = uncompress( (Bytef *) uncompressed_data, &zlib_uncompressed_data_size, (Bytef *) compressed_data, (uLong) compressed_data_size ); if( result == Z_OK ) { *uncompressed_data_size = (size_t) zlib_uncompressed_data_size; result = 1; } else if( result == Z_DATA_ERROR ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unable to read compressed data: data error.\n", function ); } #endif *uncompressed_data_size = 0; result = -1; } else if( result == Z_BUF_ERROR ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: unable to read compressed data: target buffer too small.\n", function ); } #endif /* Estimate that a factor 2 enlargement should suffice */ *uncompressed_data_size *= 2; result = 0; } else if( result == Z_MEM_ERROR ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to read compressed data: insufficient memory.", function ); *uncompressed_data_size = 0; result = -1; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_COMPRESSION, LIBCERROR_COMPRESSION_ERROR_DECOMPRESS_FAILED, "%s: zlib returned undefined error: %d.", function, result ); *uncompressed_data_size = 0; result = -1; } #else result = libewf_deflate_decompress( compressed_data, compressed_data_size, uncompressed_data, uncompressed_data_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ENCRYPTION, LIBCERROR_ENCRYPTION_ERROR_GENERIC, "%s: unable to decompress deflate compressed data.", function ); return( -1 ); } #endif /* ( defined( HAVE_ZLIB ) && defined( HAVE_ZLIB_UNCOMPRESS ) ) || defined( ZLIB_DLL ) */ return( result ); } libewf-20140807/libewf/libewf_libcnotify.h0000664000175000017500000000265413440663047022462 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2006-2018, 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_LIBCNOTIFY_H ) #define _LIBEWF_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBEWF_LIBCNOTIFY_H ) */ libewf-20140807/libewf/libewf_io_handle.h0000644000175000017500000000420613421013624022220 0ustar00lordyestalordyesta00000000000000/* * IO handle functions * * 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_IO_HANDLE_H ) #define _LIBEWF_IO_HANDLE_H #include #include #include "libewf_libcerror.h" #include "libewf_libbfio.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_io_handle libewf_io_handle_t; struct libewf_io_handle { /* The access flags */ int access_flags; /* The current (storage media) offset */ off64_t current_offset; /* Value to indicate which file format is used */ uint8_t format; /* Value to indicate which ewf format is used */ uint8_t ewf_format; /* Value to indicate the compression level used */ int8_t compression_level; /* Value to indicate certain compression modes * like empty block compression */ uint8_t compression_flags; /* The header codepage */ int header_codepage; /* Value to indicate if abort was signalled */ int abort; }; int libewf_io_handle_initialize( libewf_io_handle_t **io_handle, libcerror_error_t **error ); int libewf_io_handle_free( libewf_io_handle_t **io_handle, libcerror_error_t **error ); int libewf_io_handle_clear( libewf_io_handle_t *io_handle, libcerror_error_t **error ); int libewf_io_handle_clone( libewf_io_handle_t **destination_io_handle, libewf_io_handle_t *source_io_handle, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_handle.h0000644000175000017500000003210513421013624021530 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * 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_INTERNAL_HANDLE_H ) #define _LIBEWF_INTERNAL_HANDLE_H #include #include #include "libewf_chunk_data.h" #include "libewf_chunk_table.h" #include "libewf_extern.h" #include "libewf_hash_sections.h" #include "libewf_libbfio.h" #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libfvalue.h" #include "libewf_libfcache.h" #include "libewf_libmfdata.h" #include "libewf_header_sections.h" #include "libewf_io_handle.h" #include "libewf_media_values.h" #include "libewf_read_io_handle.h" #include "libewf_segment_table.h" #include "libewf_single_files.h" #include "libewf_types.h" #include "libewf_write_io_handle.h" #if defined( _MSC_VER ) || defined( __BORLANDC__ ) || defined( __MINGW32_VERSION ) || defined( __MINGW64_VERSION_MAJOR ) /* This inclusion is needed otherwise some linkers * mess up exporting the legacy functions */ #include "libewf_legacy.h" #endif #if defined( __cplusplus ) extern "C" { #endif typedef struct libewf_internal_handle libewf_internal_handle_t; struct libewf_internal_handle { /* The IO handle */ libewf_io_handle_t *io_handle; /* The current chunk data */ libewf_chunk_data_t *chunk_data; /* The media values */ libewf_media_values_t *media_values; /* The stored sessions information */ libcdata_array_t *sessions; /* The stored tracks information */ libcdata_array_t *tracks; /* The sectors with acquiry read errors */ libcdata_range_list_t *acquiry_errors; /* The file IO pool */ libbfio_pool_t *file_io_pool; /* Value to indicate if the pool was created inside the library */ uint8_t file_io_pool_created_in_library; /* The read IO handle */ libewf_read_io_handle_t *read_io_handle; /* The write IO handle */ libewf_write_io_handle_t *write_io_handle; /* The maximum number of open handles in the pool */ int maximum_number_of_open_handles; /* The segment files list */ libmfdata_file_list_t *segment_files_list; /* The delta segment files list */ libmfdata_file_list_t *delta_segment_files_list; /* The segment files cache */ libfcache_cache_t *segment_files_cache; /* The segment file table */ libewf_segment_table_t *segment_table; /* The delta segment file table */ libewf_segment_table_t *delta_segment_table; /* The chunk table (data) list */ libmfdata_list_t *chunk_table_list; /* The chunk table cache */ libfcache_cache_t *chunk_table_cache; /* The stored header sections */ libewf_header_sections_t *header_sections; /* The stored hash sections */ libewf_hash_sections_t *hash_sections; /* The date format for certain header values */ int date_format; /* The header values */ libfvalue_table_t *header_values; /* Value to indicate the header values were parsed */ uint8_t header_values_parsed; /* The hash values */ libfvalue_table_t *hash_values; /* Value to indicate the hash values were parsed */ uint8_t hash_values_parsed; /* The single files */ libewf_single_files_t *single_files; }; LIBEWF_EXTERN \ int libewf_handle_initialize( libewf_handle_t **handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_free( libewf_handle_t **handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_clone( libewf_handle_t **destination_handle, libewf_handle_t *source_handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_signal_abort( libewf_handle_t *handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_open( libewf_handle_t *handle, char * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_handle_open_wide( libewf_handle_t *handle, wchar_t * const filenames[], int number_of_filenames, int access_flags, libcerror_error_t **error ); #endif LIBEWF_EXTERN \ int libewf_handle_open_file_io_pool( libewf_handle_t *handle, libbfio_pool_t *file_io_pool, int access_flags, libcerror_error_t **error ); int libewf_handle_open_read_segment_files( libewf_internal_handle_t *internal_handle, libbfio_pool_t *file_io_pool, libewf_chunk_table_t *chunk_table, libcerror_error_t **error ); int libewf_handle_open_read_delta_segment_files( libewf_internal_handle_t *internal_handle, libbfio_pool_t *file_io_pool, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_close( libewf_handle_t *handle, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_prepare_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, void *uncompressed_chunk_buffer, size_t *uncompressed_chunk_buffer_size, int8_t is_compressed, uint32_t chunk_checksum, int8_t read_checksum, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_read_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, int8_t *is_compressed, void *checksum_buffer, uint32_t *chunk_checksum, int8_t *read_checksum, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_read_buffer( libewf_handle_t *handle, void *buffer, size_t buffer_size, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_read_random( libewf_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_prepare_write_chunk( libewf_handle_t *handle, void *chunk_buffer, size_t chunk_buffer_size, void *compressed_chunk_buffer, size_t *compressed_chunk_buffer_size, int8_t *is_compressed, uint32_t *chunk_checksum, int8_t *write_checksum, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_write_chunk( libewf_handle_t *handle, const void *chunk_buffer, size_t chunk_buffer_size, size_t data_size, int8_t is_compressed, void *checksum_buffer, uint32_t chunk_checksum, int8_t write_checksum, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_write_buffer( libewf_handle_t *handle, const void *buffer, size_t buffer_size, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_write_random( libewf_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); LIBEWF_EXTERN \ ssize_t libewf_handle_write_finalize( libewf_handle_t *handle, libcerror_error_t **error ); LIBEWF_EXTERN \ off64_t libewf_handle_seek_offset( libewf_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_offset( libewf_handle_t *handle, off64_t *offset, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_maximum_number_of_open_handles( libewf_handle_t *handle, int maximum_number_of_open_handles, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_segment_files_corrupted( libewf_handle_t *handle, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ); #endif LIBEWF_EXTERN \ int libewf_handle_get_maximum_segment_size( libewf_handle_t *handle, size64_t *maximum_segment_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_maximum_segment_size( libewf_handle_t *handle, size64_t maximum_segment_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_size( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_filename( libewf_handle_t *handle, const char *filename, size_t filename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_delta_segment_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_delta_segment_filename_wide( libewf_handle_t *handle, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ); #endif LIBEWF_EXTERN \ int libewf_handle_get_maximum_delta_segment_size( libewf_handle_t *handle, size64_t *maximum_delta_segment_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_set_maximum_delta_segment_size( libewf_handle_t *handle, size64_t maximum_delta_segment_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_filename_size( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_filename( libewf_handle_t *handle, char *filename, size_t filename_size, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBEWF_EXTERN \ int libewf_handle_get_filename_size_wide( libewf_handle_t *handle, size_t *filename_size, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_filename_wide( libewf_handle_t *handle, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); #endif LIBEWF_EXTERN \ int libewf_handle_get_file_io_handle( libewf_handle_t *handle, libbfio_handle_t **file_io_handle, libcerror_error_t **error ); int libewf_internal_handle_get_write_maximum_number_of_segments( uint8_t ewf_format, uint16_t *maximum_number_of_segments, libcerror_error_t **error ); int libewf_internal_handle_get_media_values( libewf_internal_handle_t *internal_handle, size64_t *media_size, libcerror_error_t **error ); int libewf_internal_handle_set_media_values( libewf_internal_handle_t *internal_handle, uint32_t sectors_per_chunk, uint32_t bytes_per_sector, size64_t media_size, libcerror_error_t **error ); int libewf_internal_handle_set_format( libewf_internal_handle_t *internal_handle, uint8_t format, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_handle_get_root_file_entry( libewf_handle_t *handle, libewf_file_entry_t **root_file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_get_file_entry_by_utf8_path( libewf_handle_t *handle, const uint8_t *utf8_string, size_t utf8_string_length, libewf_file_entry_t **file_entry, libcerror_error_t **error ); LIBEWF_EXTERN \ int libewf_file_get_file_entry_by_utf16_path( libewf_handle_t *handle, const uint16_t *utf16_string, size_t utf16_string_length, libewf_file_entry_t **file_entry, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/ewf_section.h0000644000175000017500000000301313421013623021245 0ustar00lordyestalordyesta00000000000000/* * EWF section start * * 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( _EWF_SECTION_H ) #define _EWF_SECTION_H #include #include #if defined( __cplusplus ) extern "C" { #endif typedef struct ewf_section_start ewf_section_start_t; struct ewf_section_start { /* The section type string * consists of 16 bytes */ uint8_t type[ 16 ]; /* The offset to the next section * consists of 8 bytes (64 bits) */ uint8_t next_offset[ 8 ]; /* The size of the section * consists of 8 bytes (64 bits) */ uint8_t size[ 8 ]; /* The padding * consists of 40 bytes */ uint8_t padding[ 40 ]; /* The checksum of the section start data * consists of 4 bytes */ uint8_t checksum[ 4 ]; /* The section data */ }; #if defined( __cplusplus ) } #endif #endif libewf-20140807/libewf/libewf_sector_range.c0000644000175000017500000001547413421013625022756 0ustar00lordyestalordyesta00000000000000/* * Sector range functions * * 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 . */ #include #include #include #include "libewf_libcerror.h" #include "libewf_sector_range.h" /* Initialize a session value * Make sure the value is pointing to is set to NULL * Returns 1 if successful or -1 on error */ int libewf_sector_range_initialize( libewf_sector_range_t **sector_range, libcerror_error_t **error ) { static char *function = "libewf_sector_range_initialize"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid session value.", function ); return( -1 ); } if( *sector_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sector range value already set.", function ); return( -1 ); } *sector_range = memory_allocate_structure( libewf_sector_range_t ); if( *sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create session value.", function ); goto on_error; } if( memory_set( *sector_range, 0, sizeof( libewf_sector_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear session value.", function ); goto on_error; } return( 1 ); on_error: if( *sector_range != NULL ) { memory_free( *sector_range ); *sector_range = NULL; } return( -1 ); } /* Frees a session value * Returns 1 if successful or -1 on error */ int libewf_sector_range_free( libewf_sector_range_t **sector_range, libcerror_error_t **error ) { static char *function = "libewf_sector_range_free"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid session value.", function ); return( -1 ); } if( *sector_range != NULL ) { memory_free( *sector_range ); *sector_range = NULL; } return( 1 ); } /* Clones the sector range * Returns 1 if successful or -1 on error */ int libewf_sector_range_clone( libewf_sector_range_t **destination_sector_range, libewf_sector_range_t *source_sector_range, libcerror_error_t **error ) { static char *function = "libewf_sector_range_clone"; if( destination_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination sector range.", function ); return( -1 ); } if( *destination_sector_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination sector range already set.", function ); return( -1 ); } if( source_sector_range == NULL ) { *destination_sector_range = NULL; return( 1 ); } *destination_sector_range = memory_allocate_structure( libewf_sector_range_t ); if( *destination_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination sector range.", function ); goto on_error; } if( memory_copy( *destination_sector_range, source_sector_range, sizeof( libewf_sector_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination sector range.", function ); goto on_error; } return( 1 ); on_error: if( *destination_sector_range != NULL ) { memory_free( *destination_sector_range ); *destination_sector_range = NULL; } return( -1 ); } /* Retrieves a session value * Returns 1 if successful or -1 on error */ int libewf_sector_range_get( libewf_sector_range_t *sector_range, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { static char *function = "libewf_sector_range_get"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid session value.", function ); return( -1 ); } if( start_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid start sector.", function ); return( -1 ); } if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sectors.", function ); return( -1 ); } *start_sector = sector_range->start_sector; *number_of_sectors = sector_range->number_of_sectors; return( 1 ); } /* Sets a session value * Returns 1 if successful or -1 on error */ int libewf_sector_range_set( libewf_sector_range_t *sector_range, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { static char *function = "libewf_sector_range_set"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid session value.", function ); return( -1 ); } if( start_sector > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid start sector value exceeds maximum.", function ); return( -1 ); } if( number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } sector_range->start_sector = start_sector; sector_range->end_sector = start_sector + number_of_sectors; sector_range->number_of_sectors = number_of_sectors; return( 1 ); } libewf-20140807/libewf/libewf_hash_sections.c0000644000175000017500000001350113421013624023121 0ustar00lordyestalordyesta00000000000000/* * Hash sections functions * * 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 . */ #include #include #include "libewf_hash_sections.h" /* Initialize the hash sections * Returns 1 if successful or -1 on error */ int libewf_hash_sections_initialize( libewf_hash_sections_t **hash_sections, libcerror_error_t **error ) { static char *function = "libewf_hash_sections_initialize"; if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } if( *hash_sections != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid hash sections value already set.", function ); return( -1 ); } *hash_sections = memory_allocate_structure( libewf_hash_sections_t ); if( *hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create hash sections.", function ); goto on_error; } if( memory_set( *hash_sections, 0, sizeof( libewf_hash_sections_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash sections.", function ); goto on_error; } return( 1 ); on_error: if( *hash_sections != NULL ) { memory_free( *hash_sections ); *hash_sections = NULL; } return( -1 ); } /* Frees the hash sections including elements * Returns 1 if successful or -1 on error */ int libewf_hash_sections_free( libewf_hash_sections_t **hash_sections, libcerror_error_t **error ) { static char *function = "libewf_hash_sections_free"; if( hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash sections.", function ); return( -1 ); } if( *hash_sections != NULL ) { if( ( *hash_sections )->xhash != NULL ) { memory_free( ( *hash_sections )->xhash ); } memory_free( *hash_sections ); *hash_sections = NULL; } return( 1 ); } /* Clones the hash sections * Returns 1 if successful or -1 on error */ int libewf_hash_sections_clone( libewf_hash_sections_t **destination_hash_sections, libewf_hash_sections_t *source_hash_sections, libcerror_error_t **error ) { static char *function = "libewf_hash_sections_clone"; if( destination_hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination hash sections.", function ); return( -1 ); } if( *destination_hash_sections != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination hash sections already set.", function ); return( -1 ); } if( source_hash_sections == NULL ) { *destination_hash_sections = NULL; return( 1 ); } *destination_hash_sections = memory_allocate_structure( libewf_hash_sections_t ); if( *destination_hash_sections == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination hash sections.", function ); goto on_error; } if( memory_copy( *destination_hash_sections, source_hash_sections, sizeof( libewf_hash_sections_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination hash sections.", function ); goto on_error; } ( *destination_hash_sections )->xhash = NULL; ( *destination_hash_sections )->xhash_size = 0; if( source_hash_sections->xhash != NULL ) { ( *destination_hash_sections )->xhash = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_hash_sections->xhash_size ); if( ( *destination_hash_sections )->xhash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination xhash.", function ); goto on_error; } if( memory_copy( ( *destination_hash_sections )->xhash, source_hash_sections->xhash, sizeof( uint8_t ) * source_hash_sections->xhash_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination xhash.", function ); goto on_error; } ( *destination_hash_sections )->xhash_size = source_hash_sections->xhash_size; } return( 1 ); on_error: if( *destination_hash_sections != NULL ) { if( ( *destination_hash_sections )->xhash != NULL ) { memory_free( ( *destination_hash_sections )->xhash ); } memory_free( *destination_hash_sections ); *destination_hash_sections = NULL; } return( -1 ); } libewf-20140807/install-sh0000755000175000017500000003601013443455347017347 0ustar00lordyestalordyesta00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libewf-20140807/INSTALL0000644000175000017500000003661413443455347016406 0ustar00lordyestalordyesta00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. libewf-20140807/dpkg/0000775000175000017500000000000013443455444016270 5ustar00lordyestalordyesta00000000000000libewf-20140807/dpkg/libewf.install0000664000175000017500000000002613440662652021124 0ustar00lordyestalordyesta00000000000000usr/lib/*-*/lib*.so.* libewf-20140807/dpkg/changelog.in0000664000175000017500000000016713440662652020551 0ustar00lordyestalordyesta00000000000000libewf (@VERSION@-1) unstable; urgency=low * Auto-generated -- Joachim Metz @DPKG_DATE@ libewf-20140807/dpkg/changelog0000664000175000017500000000021213443455443020134 0ustar00lordyestalordyesta00000000000000libewf (20140807-1) unstable; urgency=low * Auto-generated -- Joachim Metz Sun, 17 Mar 2019 15:35:13 +0100 libewf-20140807/dpkg/libewf-dev.install0000664000175000017500000000014013440662652021675 0ustar00lordyestalordyesta00000000000000usr/include/* usr/lib/*-*/lib*.a usr/lib/*-*/lib*.so usr/lib/*-*/pkgconfig/* usr/share/man/man3 libewf-20140807/dpkg/libewf-python3.install0000664000175000017500000000002213440662652022522 0ustar00lordyestalordyesta00000000000000/usr/lib/python3* libewf-20140807/dpkg/copyright0000664000175000017500000000177613440663046020232 0ustar00lordyestalordyesta00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libewf Source: https://github.com/libyal/libewf Files: * Copyright: 2006-2017, Joachim Metz License: LGPL-3.0+ License: LGPL-3.0+ This package 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 package 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 Lesser General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the complete text of the GNU Lesser General Public License can be found in "/usr/share/common-licenses/LGPL-3". libewf-20140807/dpkg/libewf-python.install0000664000175000017500000000002213440662652022437 0ustar00lordyestalordyesta00000000000000/usr/lib/python2* libewf-20140807/dpkg/source/0000775000175000017500000000000013443455444017570 5ustar00lordyestalordyesta00000000000000libewf-20140807/dpkg/source/format0000664000175000017500000000001413440662652020774 0ustar00lordyestalordyesta000000000000003.0 (quilt) libewf-20140807/dpkg/rules0000664000175000017500000000130013440662652017335 0ustar00lordyestalordyesta00000000000000#!/usr/bin/make -f # -*- makefile -*- # Uncomment for debhelper verbose output. # export DH_VERBOSE=1 export SKIP_PYTHON_TESTS=1 %: dh $@ --with autoreconf .PHONY: override_dh_auto_configure override_dh_auto_configure: dh_auto_configure -- --enable-python2 --enable-python3 CFLAGS="-g" .PHONY: override_dh_install override_dh_install: dh_install --fail-missing -X.la -X/pyewf.a .PHONY: override_dh_strip override_dh_strip: ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) dh_strip -plibewf --dbg-package=libewf-dbg dh_strip -plibewf-tools --dbg-package=libewf-tools-dbg dh_strip -plibewf-python --dbg-package=libewf-python-dbg dh_strip -plibewf-python3 --dbg-package=libewf-python3-dbg endif libewf-20140807/dpkg/libewf-tools.install0000664000175000017500000000003313440662652022260 0ustar00lordyestalordyesta00000000000000usr/bin usr/share/man/man1 libewf-20140807/dpkg/compat0000664000175000017500000000000213440662652017464 0ustar00lordyestalordyesta000000000000009 libewf-20140807/dpkg/control0000664000175000017500000000470413440663046017674 0ustar00lordyestalordyesta00000000000000Source: libewf Priority: extra Maintainer: Joachim Metz Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config, zlib1g-dev, libssl-dev, libfuse-dev, python-dev, python3-dev Standards-Version: 3.9.5 Section: libs Homepage: https://github.com/libyal/libewf Package: libewf Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Conflicts: libewf2 Replaces: libewf2 Suggests: libewf-dbg Description: Library to access the Expert Witness Compression Format (EWF) libewf is a library to access the Expert Witness Compression Format (EWF). Package: libewf-dbg Architecture: any Section: debug Depends: libewf (= ${binary:Version}), ${misc:Depends} Description: Debugging symbols for libewf Debugging symbols for libewf. Package: libewf-dev Section: libdevel Architecture: any Depends: libewf (= ${binary:Version}), ${misc:Depends} Description: Header files and libraries for developing applications for libewf Header files and libraries for developing applications for libewf. Package: libewf-tools Section: utils Architecture: any Depends: libewf (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Conflicts: libewf-utils Replaces: libewf-utils Description: Several tools for reading and writing EWF files Several tools for reading and writing EWF files. Package: libewf-tools-dbg Section: debug Architecture: any Depends: libewf-tools (= ${binary:Version}), ${misc:Depends} Description: Debugging symbols for libewf-tools Debugging symbols for libewf-tools. Package: libewf-python Section: python Architecture: any Depends: libewf (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Conflicts: python-libewf Replaces: python-libewf Suggests: libewf-python-dbg Description: Python 2 bindings for libewf Python 2 bindings for libewf. Package: libewf-python-dbg Section: debug Architecture: any Depends: libewf-python (= ${binary:Version}), ${misc:Depends} Description: Debugging symbols for libewf-python Debugging symbols for libewf-python. Package: libewf-python3 Section: python Architecture: any Depends: libewf (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Conflicts: python3-libewf Replaces: python3-libewf Suggests: libewf-python3-dbg Description: Python 3 bindings for libewf Python 3 bindings for libewf. Package: libewf-python3-dbg Section: debug Architecture: any Depends: libewf-python3 (= ${binary:Version}), ${misc:Depends} Description: Debugging symbols for libewf-python3 Debugging symbols for libewf-python3. libewf-20140807/examples/0000775000175000017500000000000013443455447017164 5ustar00lordyestalordyesta00000000000000libewf-20140807/examples/ewf.net/0000775000175000017500000000000013443455447020532 5ustar00lordyestalordyesta00000000000000libewf-20140807/examples/ewf.net/MD5sum.vb0000644000175000017500000000374212076507440022171 0ustar00lordyestalordyesta00000000000000REM VB.Net program to calculate the MD5 of Expert Witness Compression Format file(s) using ewf.net REM REM Author: Joachim Metz REM Creation date: November 3, 2010 REM Modification date: October 16, 2011 Imports MD5net Imports EWF Module MD5sum Function BinaryToHexString(ByVal data() As Byte) As String Dim string_builder As New System.Text.StringBuilder( data.Length() * 2 ) For Each value As Byte In data string_builder.Append(value.ToString("X2")) Next Return string_builder.ToString().ToLower() End Function Function Main(ByVal args() As String) As Integer Dim md5_context As New MD5net.Context Dim handle As New EWF.Handle Dim filenames As Array = Nothing Dim md5_hash() As Byte = Nothing Dim program As String = "MD5sum.exe" Dim media_size As UInt64 = 0 Dim read_count As Integer = 0 Dim read_size As Integer = 0 Dim buffer(4096) As Byte Console.WriteLine(program + " (ewf.net " + EWF.Support.GetVersion() + ")") If args.Length() < 1 Then Console.WriteLine("Usage: " + program + " filename") Return 1 End If If args.Length() = 1 Then filenames = EWF.Handle.Glob(args(0)) Else filenames = args End If If filenames.Length() <= 0 Then Console.WriteLine("Unable to determine filename(s)") Return 1 End If handle.Open(filenames, EWF.Handle.GetAccessFlagsRead()) media_size = handle.GetMediaSize() While media_size > 0 If media_size > 4096 Then read_size = 4096 Else read_size = media_size End If read_count = handle.ReadBuffer(buffer, read_size) If read_count <> read_size Then Console.WriteLine("Unable to read from files") Return 1 End If md5_context.Update(buffer, read_size) media_size -= read_size End While handle.Close() md5_hash = md5_context.GetHash() Console.WriteLine("MD5: " + BinaryToHexString(md5_hash)) Console.WriteLine("") Return 0 End Function End Module libewf-20140807/examples/ewf.net/Glob.vb0000644000175000017500000000152712076507440021741 0ustar00lordyestalordyesta00000000000000REM VB.Net program to glob Expert Witness Compression Format file(s) using ewf.net REM REM Author: Joachim Metz REM Creation date: November 3, 2010 REM Modification date: October 16, 2011 Imports EWF Module Glob Function Main(ByVal args() As String) As Integer Dim filenames As Array = Nothing Dim filename As String = Nothing Dim program As String = "Glob.exe" Console.WriteLine(program + " (ewf.net " + EWF.Support.GetVersion() + ")") If args.Length() <> 1 Then Console.WriteLine("Usage: " + program + " filename") Return 1 End If filenames = EWF.Handle.Glob(args(0)) If filenames.Length() > 0 Then Console.WriteLine("Filenames:") For Each filename In filenames Console.WriteLine(filename) Next End If Console.WriteLine("") Return 0 End Function End Module libewf-20140807/examples/ewf.net/OpenClose.vb0000644000175000017500000000133512076507440022742 0ustar00lordyestalordyesta00000000000000REM VB.Net program to open and close (split) Expert Witness Compression Format file(s) using ewf.net REM REM Author: Joachim Metz REM Creation date: November 3, 2010 REM Modification date: October 16, 2011 Imports EWF Module OpenClose Function Main(ByVal args() As String) As Integer Dim handle As New EWF.Handle Dim program As String = "OpenClose.exe" Console.WriteLine(program + " (ewf.net " + EWF.Support.GetVersion() + ")") If args.Length() < 1 Then Console.WriteLine("Usage: " + program + " filename(s)") Return 1 End If handle.Open(args, EWF.Handle.GetAccessFlagsRead()) handle.Close() Console.WriteLine("") Return 0 End Function End Module libewf-20140807/examples/pyewf/0000775000175000017500000000000013443455447020316 5ustar00lordyestalordyesta00000000000000libewf-20140807/examples/pyewf/open_close.py0000754000175000017500000000227012100677636023012 0ustar00lordyestalordyesta00000000000000#! /usr/bin/env python # # Python script to open and close Expert Witness Compression format file(s) using pyewf # # Author: Joachim Metz # Creation date: September 29, 2010 # Modification date: January 26, 2013 # __author__ = "Joachim Metz" __version__ = "20130126" __date__ = "Jan 26, 2013" __copyright__ = "Copyright (c) 2006-2012, Joachim Metz " __license__ = "GNU LGPL version 3" import sys import pyewf # ---------------------------------------------------------------------------- # Main # ---------------------------------------------------------------------------- print "open_close.py " + __version__ + " (libewf " + pyewf.get_version() + ")\n" argc = len( sys.argv ) if argc < 2: print "Usage: open_close.py filename(s)\n" sys.exit( 1 ) filenames = sys.argv[ 1: ] handle = pyewf.handle(); if handle == None: print "Missing handle object\n" sys.exit( 1 ) try: # Open requires a list of filenames handle.open( filenames ) except: print "Unable to open file(s)\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) try: handle.close() except: print "Unable to close file(s)\n" print sys.exc_info() sys.exit( 1 ) sys.exit( 0 ) libewf-20140807/examples/pyewf/glob.py0000754000175000017500000000205512076777626021624 0ustar00lordyestalordyesta00000000000000#! /usr/bin/env python # # Python script to glob Expert Witness Compression format file(s) using pyewf # # Author: Joachim Metz # Creation date: October 14, 2010 # Modification date: January 20, 2010 # __author__ = "Joachim Metz" __version__ = "20130120" __date__ = "Jan 20, 2013" __copyright__ = "Copyright (c) 2006-2013, Joachim Metz " __license__ = "GNU LGPL version 3" import sys import pyewf # ---------------------------------------------------------------------------- # Main # ---------------------------------------------------------------------------- print "glob.py " + __version__ + " (libewf " + pyewf.get_version() + ")\n" argc = len( sys.argv ) if argc != 2: print "Usage: glob.py filename\n" sys.exit( 1 ) try: filenames = pyewf.glob( sys.argv[ 1 ] ) except: print "Unable to glob filename(s)\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if len( filenames ) > 0: print "Filenames:" for filename in filenames: print filename.encode( "utf8" ) print "" sys.exit( 0 ) libewf-20140807/examples/pyewf/metadata.py0000754000175000017500000000427012100677714022443 0ustar00lordyestalordyesta00000000000000#! /usr/bin/env python # # Python script to print the metadata in Expert Witness Compression format file(s) using pyewf # # Author: Joachim Metz # Creation date: October 14, 2010 # Modification date: January 26, 2013 # __author__ = "Joachim Metz" __version__ = "20130126" __date__ = "Jan 26, 2013" __copyright__ = "Copyright (c) 2006-2013, Joachim Metz " __license__ = "GNU LGPL version 3" import sys import pyewf # ---------------------------------------------------------------------------- # Main # ---------------------------------------------------------------------------- print "metadata.py " + __version__ + " (libewf " + pyewf.get_version() + ")\n" argc = len( sys.argv ) if argc < 2: print "Usage: metadata.py filename(s)\n" sys.exit( 1 ) if argc == 2: try: filenames = pyewf.glob( sys.argv[ 1 ] ) except: print "Unable to glob filename(s)\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) else: filenames = sys.argv[ 1: ] handle = pyewf.handle(); if handle == None: print "Missing handle object\n" sys.exit( 1 ) try: # Open requires a list of filenames handle.open( filenames ) except: print "Unable to open file(s)\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) try: media_size = handle.get_media_size() except: print "Unable to retrieve media size\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) try: header_values = handle.get_header_values() except: print "Unable to retrieve header values\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) try: hash_values = handle.get_hash_values() except: print "Unable to retrieve hash values\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) try: handle.close() except: print "Unable to close file(s)\n" print sys.exc_info() sys.exit( 1 ) print "Media size: " + str( media_size ) + " bytes" print "" if len( header_values ) > 0: print "Header values:" for identifier, value in header_values.items(): print identifier.encode( "utf8" ) + ": " + value.encode( "utf8" ) print "" if len( hash_values ) > 0: print "Hash values:" for identifier, value in hash_values.items(): print identifier.encode( "utf8" ) + ": " + value.encode( "utf8" ) print "" sys.exit( 0 ) libewf-20140807/examples/pyewf/file_entries.py0000754000175000017500000000725012100677604023332 0ustar00lordyestalordyesta00000000000000#! /usr/bin/env python # # Python script to print the file entries in Expert Witness Compression format file(s) using pyewf # # Author: Joachim Metz # Creation date: October 16, 2011 # Modification date: January 26, 2013 # __author__ = "Joachim Metz" __version__ = "20130126" __date__ = "Jan 26, 2013" __copyright__ = "Copyright (c) 2006-2013, Joachim Metz " __license__ = "GNU LGPL version 3" import datetime import sys import pyewf # ---------------------------------------------------------------------------- # Functions # ---------------------------------------------------------------------------- def print_file_entry( file_entry ): print "File entry:" try: name = file_entry.get_name() except: print "Unable to retrieve name\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if name: print "Name\t\t\t: " + name.encode( "utf8" ) try: creation_time = file_entry.get_creation_time() except: print "Unable to retrieve creation time\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if creation_time: print "Creation time\t\t: " + creation_time.strftime("%Y-%m-%d %H:%M:%S") try: modification_time = file_entry.get_modification_time() except: print "Unable to retrieve modification time\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if modification_time: print "Modification time\t: " + modification_time.strftime("%Y-%m-%d %H:%M:%S") try: access_time = file_entry.get_access_time() except: print "Unable to retrieve access time\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if access_time: print "Access time\t\t: " + access_time.strftime("%Y-%m-%d %H:%M:%S") try: entry_modification_time = file_entry.get_entry_modification_time() except: print "Unable to retrieve entry modification time\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if entry_modification_time: print "Entry modification time\t: " + entry_modification_time.strftime("%Y-%m-%d %H:%M:%S") try: md5_hash = file_entry.get_hash_value_md5() except: print "Unable to retrieve MD5 hash\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) if md5_hash: print "MD5 hash\t\t: " + md5_hash print "" try: number_of_sub_file_entries = file_entry.get_number_of_sub_file_entries() except: print "Unable to retrieve number of file entries\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) for sub_file_entry_index in range( 0, number_of_sub_file_entries ): try: sub_file_entry = file_entry.get_sub_file_entry( sub_file_entry_index ) except: print "Unable to retrieve number of file entry: " + sub_file_entry_index + "\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) print_file_entry( sub_file_entry ) # ---------------------------------------------------------------------------- # Main # ---------------------------------------------------------------------------- print "file_entries.py " + __version__ + " (libewf " + pyewf.get_version() + ")\n" argc = len( sys.argv ) if argc < 2: print "Usage: file_entries.py filename(s)\n" sys.exit( 1 ) if argc == 2: try: filenames = pyewf.glob( sys.argv[ 1 ] ) except: print "Unable to glob filename(s)\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) else: filenames = sys.argv[ 1: ] handle = pyewf.handle(); if handle == None: print "Missing handle object\n" sys.exit( 1 ) try: # Open requires a list of filenames handle.open( filenames ) except: print "Unable to open file(s)\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) try: root_file_entry = handle.get_root_file_entry() except: print "Unable to retrieve root file entry\n" print sys.exc_info()[ 1 ] sys.exit( 1 ) print "Single files:" print_file_entry( root_file_entry ) sys.exit( 0 ) libewf-20140807/examples/Makefile.am0000644000175000017500000000060412654056261021210 0ustar00lordyestalordyesta00000000000000EWF_NET_EXAMPLES = \ ewf.net/Glob.vb \ ewf.net/MD5sum.vb \ ewf.net/OpenClose.vb LIBEWF_EXAMPLES = \ libewf/open_close.c PYEWF_EXAMPLES = \ pyewf/file_entries.py \ pyewf/glob.py \ pyewf/metadata.py \ pyewf/open_close.py EXTRA_DIST = \ $(EWF_NET_EXAMPLES) \ $(LIBEWF_EXAMPLES) \ $(PYEWF_EXAMPLES) MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/examples/libewf/0000775000175000017500000000000013443455447020434 5ustar00lordyestalordyesta00000000000000libewf-20140807/examples/libewf/open_close.c0000644000175000017500000000457012320217072022711 0ustar00lordyestalordyesta00000000000000/* * C application to open and close Expert Witness Compression Format file(s) using libewf * * 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 . */ #include #include #include int main( int argc, char * const argv[] ) { libewf_error_t *error = NULL; libewf_handle_t *handle = NULL; if( argc <= 1 ) { fprintf( stderr, "Usage: ./open_close filename(s)\n" ); return( EXIT_FAILURE ); } /* The function will return 1 if successful or -1 on error. * On error the error 'object' is created by the library. * * handle must refer to NULL to create a new libewf handle 'object'. * * If error is NULL e.g. libewf_handle_initialize( &handle, NULL ) * no error 'object' is created * * The error 'object' can be freed by libewf_error_free() */ if( libewf_handle_initialize( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to initialize handle.\n" ); goto on_error; } if( libewf_handle_open( handle, &( argv[ 1 ] ), argc - 1, LIBEWF_OPEN_READ, &error ) != 1 ) { fprintf( stderr, "Unable to open file(s).\n" ); goto on_error; } if( libewf_handle_close( handle, &error ) != 0 ) { fprintf( stderr, "Unable to close handle.\n" ); goto on_error; } if( libewf_handle_free( &handle, &error ) != 1 ) { fprintf( stderr, "Unable to free handle.\n" ); goto on_error; } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libewf_error_backtrace_fprint( error, stderr ); libewf_error_free( &error ); } if( handle != NULL ) { libewf_handle_free( &handle, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/examples/Makefile.in0000664000175000017500000006242313443455347021237 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ EWF_NET_EXAMPLES = \ ewf.net/Glob.vb \ ewf.net/MD5sum.vb \ ewf.net/OpenClose.vb LIBEWF_EXAMPLES = \ libewf/open_close.c PYEWF_EXAMPLES = \ pyewf/file_entries.py \ pyewf/glob.py \ pyewf/metadata.py \ pyewf/open_close.py EXTRA_DIST = \ $(EWF_NET_EXAMPLES) \ $(LIBEWF_EXAMPLES) \ $(PYEWF_EXAMPLES) MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcdatetime/0000775000175000017500000000000013443455445017772 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcdatetime/libcdatetime_error.h0000664000175000017500000000354113443450024023771 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_INTERNAL_ERROR_H ) #define _LIBCDATETIME_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBCDATETIME ) #include #endif #include "libcdatetime_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCDATETIME ) LIBCDATETIME_EXTERN \ void libcdatetime_error_free( libcdatetime_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_error_fprint( libcdatetime_error_t *error, FILE *stream ); LIBCDATETIME_EXTERN \ int libcdatetime_error_sprint( libcdatetime_error_t *error, char *string, size_t size ); LIBCDATETIME_EXTERN \ int libcdatetime_error_backtrace_fprint( libcdatetime_error_t *error, FILE *stream ); LIBCDATETIME_EXTERN \ int libcdatetime_error_backtrace_sprint( libcdatetime_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATETIME_INTERNAL_ERROR_H ) */ libewf-20140807/libcdatetime/Makefile.am0000664000175000017500000000136713443450024022021 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCDATETIME AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libcdatetime.la libcdatetime_la_SOURCES = \ libcdatetime_definitions.h \ libcdatetime_elements.c libcdatetime_elements.h \ libcdatetime_error.c libcdatetime_error.h \ libcdatetime_extern.h \ libcdatetime_libcerror.h \ libcdatetime_timestamp.c libcdatetime_timestamp.h \ libcdatetime_support.c libcdatetime_support.h \ libcdatetime_types.h \ libcdatetime_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcdatetime ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcdatetime_la_SOURCES) libewf-20140807/libcdatetime/libcdatetime_definitions.h0000664000175000017500000000740213443450024025153 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2013-2018, 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( LIBCDATETIME_INTERNAL_DEFINITIONS_H ) #define LIBCDATETIME_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCDATETIME for local use of libcdatetime */ #if !defined( HAVE_LOCAL_LIBCDATETIME ) #include /* The definitions in are copied here * for local use of libcdatetime */ #else #define LIBCDATETIME_VERSION 20181004 /* The libcdatetime version string */ #define LIBCDATETIME_VERSION_STRING "20181004" /* The string format definition flags */ enum LIBCDATETIME_STRING_FORMAT_FLAGS { /* Format the date time value in C time */ LIBCDATETIME_STRING_FORMAT_TYPE_CTIME = 0x00000001UL, /* Format the date time value in ISO 8601 */ LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 = 0x00000002UL, /* Format the date time value as a date only */ LIBCDATETIME_STRING_FORMAT_FLAG_DATE = 0x00000100UL, /* Format the date time value as a time only */ LIBCDATETIME_STRING_FORMAT_FLAG_TIME = 0x00000200UL, /* Format the date time value as a duration */ LIBCDATETIME_STRING_FORMAT_FLAG_DURATION = 0x00000400UL, /* Format the date time value with a time in milli seconds */ LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS = 0x00010000UL, /* Format the date time value with a time in micro seconds */ LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS = 0x00020000UL, /* Format the date time value with a time in nano seconds */ LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS = 0x00040000UL, /* Add a timezone indicator */ LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR = 0x80000000UL, }; #define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME \ (uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) #define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME_MILLI_SECONDS \ (uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS ) #define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME_MICRO_SECONDS \ (uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) #define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME_NANO_SECONDS \ (uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) #endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */ /* The month values */ enum LIBCDATETIME_MONTHS { LIBCDATETIME_MONTH_JANUARY = 0, LIBCDATETIME_MONTH_FEBRUARY = 1, LIBCDATETIME_MONTH_MARCH = 2, LIBCDATETIME_MONTH_APRIL = 3, LIBCDATETIME_MONTH_MAY = 4, LIBCDATETIME_MONTH_JUNE = 5, LIBCDATETIME_MONTH_JULY = 6, LIBCDATETIME_MONTH_AUGUST = 7, LIBCDATETIME_MONTH_SEPTEMBER = 8, LIBCDATETIME_MONTH_OCTOBER = 9, LIBCDATETIME_MONTH_NOVEMBER = 10, LIBCDATETIME_MONTH_DECEMBER = 11 }; #endif /* !defined( LIBCDATETIME_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libcdatetime/libcdatetime_unused.h0000664000175000017500000000260613443450024024144 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_INTERNAL_UNUSED_H ) #define _LIBCDATETIME_INTERNAL_UNUSED_H #include #if !defined( LIBCDATETIME_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCDATETIME_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCDATETIME_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCDATETIME_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCDATETIME_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCDATETIME_INTERNAL_UNUSED_H ) */ libewf-20140807/libcdatetime/libcdatetime_timestamp.c0000664000175000017500000005044613443450024024644 0ustar00lordyestalordyesta00000000000000/* * Timestamp functions * * Copyright (C) 2013-2018, 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 . */ #include #include #include #if !defined( WINAPI ) #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #endif #include #include "libcdatetime_definitions.h" #include "libcdatetime_elements.h" #include "libcdatetime_libcerror.h" #include "libcdatetime_timestamp.h" #include "libcdatetime_types.h" /* Creates a timestamp * Make sure the value timestamp is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_initialize( libcdatetime_timestamp_t **timestamp, libcerror_error_t **error ) { libcdatetime_internal_timestamp_t *internal_timestamp = NULL; static char *function = "libcdatetime_timestamp_initialize"; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } if( *timestamp != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid timestamp value already set.", function ); return( -1 ); } internal_timestamp = memory_allocate_structure( libcdatetime_internal_timestamp_t ); if( internal_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create timestamp.", function ); goto on_error; } if( memory_set( internal_timestamp, 0, sizeof( libcdatetime_internal_timestamp_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear timestamp.", function ); goto on_error; } *timestamp = (libcdatetime_timestamp_t *) internal_timestamp; return( 1 ); on_error: if( internal_timestamp != NULL ) { memory_free( internal_timestamp ); } return( -1 ); } /* Frees a timestamp * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_free( libcdatetime_timestamp_t **timestamp, libcerror_error_t **error ) { libcdatetime_internal_timestamp_t *internal_timestamp = NULL; static char *function = "libcdatetime_timestamp_free"; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } if( *timestamp != NULL ) { internal_timestamp = (libcdatetime_internal_timestamp_t *) *timestamp; *timestamp = NULL; memory_free( internal_timestamp ); } return( 1 ); } /* Copies the timestamp * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_copy( libcdatetime_timestamp_t *destination_timestamp, const libcdatetime_timestamp_t *source_timestamp, libcerror_error_t **error ) { static char *function = "libcdatetime_timestamp_copy"; if( destination_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination timestamp.", function ); return( -1 ); } if( source_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source timestamp.", function ); return( -1 ); } if( memory_copy( destination_timestamp, source_timestamp, sizeof( libcdatetime_internal_timestamp_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy timestamp.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Sets the timestamp to the current (system) date and time in UTC * This function uses the WINAPI function for Windows 2000 or later * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_set_current_time( libcdatetime_timestamp_t *timestamp, libcerror_error_t **error ) { SYSTEMTIME systemtime; libcdatetime_internal_timestamp_t *internal_timestamp = NULL; static char *function = "libcdatetime_timestamp_set_current_time"; DWORD error_code = 0; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } internal_timestamp = (libcdatetime_internal_timestamp_t *) timestamp; if( memory_set( &systemtime, 0, sizeof( SYSTEMTIME ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear systemtime.", function ); return( -1 ); } GetSystemTime( &systemtime ); if( SystemTimeToFileTime( &systemtime, &( internal_timestamp->filetime ) ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve filetime.", function ); return( -1 ); } return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get current time function for Windows NT4 or earlier NOT implemented yet #elif defined( HAVE_TIME ) /* Sets the timestamp to the current (system) date and time in UTC * This function uses the POSIX time function or equivalent * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_set_current_time( libcdatetime_timestamp_t *timestamp, libcerror_error_t **error ) { libcdatetime_internal_timestamp_t *internal_timestamp = NULL; static char *function = "libcdatetime_timestamp_set_current_time"; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid timestamp.", function ); return( -1 ); } internal_timestamp = (libcdatetime_internal_timestamp_t *) timestamp; if( time( &( internal_timestamp->time ) ) == (time_t) -1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, errno, "%s: unable to set current time.", function ); return( -1 ); } return( 1 ); } #else #error Missing get current time function #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Determines the delta in seconds between the first and second timestamp * This function uses the WINAPI function for Windows 2000 or later * The number_of_seconds value with be negative if the first timestamp * pre-dates the second timestamp * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_get_delta_in_seconds( libcdatetime_timestamp_t *first_timestamp, libcdatetime_timestamp_t *second_timestamp, int64_t *number_of_seconds, libcerror_error_t **error ) { libcdatetime_internal_timestamp_t *internal_first_timestamp = NULL; libcdatetime_internal_timestamp_t *internal_second_timestamp = NULL; static char *function = "libcdatetime_timestamp_get_delta_in_seconds"; int64_t time_delta = 0; if( first_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first timestamp.", function ); return( -1 ); } internal_first_timestamp = (libcdatetime_internal_timestamp_t *) first_timestamp; if( second_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid second timestamp.", function ); return( -1 ); } internal_second_timestamp = (libcdatetime_internal_timestamp_t *) second_timestamp; if( number_of_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of seconds.", function ); return( -1 ); } time_delta = (int64_t) internal_first_timestamp->filetime.dwHighDateTime - (int64_t) internal_second_timestamp->filetime.dwHighDateTime; if( time_delta < 0 ) { if( (uint64_t) -time_delta > (uint64_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } else { if( (uint64_t) time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } time_delta <<= 32; time_delta += (int64_t) internal_first_timestamp->filetime.dwLowDateTime - (int64_t) internal_second_timestamp->filetime.dwLowDateTime; if( time_delta < 0 ) { if( (uint64_t) -time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } else { if( (uint64_t) time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } *number_of_seconds = (int64_t) time_delta; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI timestamp type for Windows NT4 or earlier NOT implemented yet #else /* Determines the delta in seconds between the first and second timestamp * The number_of_seconds value with be negative if the first timestamp * pre-dates the second timestamp * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_get_delta_in_seconds( libcdatetime_timestamp_t *first_timestamp, libcdatetime_timestamp_t *second_timestamp, int64_t *number_of_seconds, libcerror_error_t **error ) { libcdatetime_internal_timestamp_t *internal_first_timestamp = NULL; libcdatetime_internal_timestamp_t *internal_second_timestamp = NULL; static char *function = "libcdatetime_timestamp_set_current_time"; time_t time_delta = 0; if( first_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first timestamp.", function ); return( -1 ); } internal_first_timestamp = (libcdatetime_internal_timestamp_t *) first_timestamp; if( second_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid second timestamp.", function ); return( -1 ); } internal_second_timestamp = (libcdatetime_internal_timestamp_t *) second_timestamp; if( number_of_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of seconds.", function ); return( -1 ); } time_delta = internal_first_timestamp->time - internal_second_timestamp->time; if( time_delta < 0 ) { if( (uint64_t) -time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } else { if( (uint64_t) time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } *number_of_seconds = (int64_t) time_delta; return( 1 ); } #endif /* defined( WINAPI ) && ( WINVER >= 0x0500 ) */ /* Deterimes the size of the string for the timestamp * The string size includes the end of string character * Returns 1 if successful or -1 on error */ int libcdatetime_timestamp_get_string_size( libcdatetime_timestamp_t *timestamp, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libcdatetime_timestamp_get_string_size"; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values.", function ); return( -1 ); } if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_DURATION | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) && ( string_format_type != LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type: 0x%08" PRIx32 ".", function, string_format_type ); return( -1 ); } /* End of string character */ *string_size = 1; /* Determine the size of the date and time string */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_DATE ) != 0 ) { /* Example: Jan 01, 1970 */ if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) { *string_size += 12; } /* Example: 1970-01-01 */ else if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) { *string_size += 10; } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) != 0 ) { /* Date and time separator */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_DATE ) != 0 ) { *string_size += 1; } /* Example: 00:00:00 */ *string_size += 8; /* Example: .000 */ if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { *string_size += 4; } /* Example: .000000 */ if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { *string_size += 3; } /* Example: .000000000 */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) { *string_size += 3; } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR ) != 0 ) { /* Example: UTC */ if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) { *string_size += 4; } /* Example: Z */ else if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) { *string_size += 1; } } return( 1 ); } /* Converts the timestamp into a string * The string size should include the end of string character * Returns 1 if successful, 0 if the timestamp is not a valid or -1 on error */ int libcdatetime_timestamp_copy_to_string( libcdatetime_timestamp_t *timestamp, uint8_t *string, size_t string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libcdatetime_timestamp_copy_to_string"; size_t string_index = 0; if( libcdatetime_timestamp_copy_to_string_with_index( timestamp, string, string_size, &string_index, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy timestamp to string.", function ); return( -1 ); } return( 1 ); } /* Converts the timestamp into a string * The string size should include the end of string character * Returns 1 if successful, 0 if the timestamp is not a valid or -1 on error */ int libcdatetime_timestamp_copy_to_string_with_index( libcdatetime_timestamp_t *timestamp, uint8_t *string, size_t string_size, size_t *string_index, uint32_t string_format_flags, libcerror_error_t **error ) { libcdatetime_elements_t *time_elements = NULL; libcdatetime_internal_timestamp_t *internal_timestamp = NULL; static char *function = "libcdatetime_timestamp_copy_to_string_with_index"; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values.", function ); return( -1 ); } internal_timestamp = (libcdatetime_internal_timestamp_t *) timestamp; if( libcdatetime_elements_initialize( &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create time elements.", function ); goto on_error; } /* TODO convert timestamp into elements */ #if defined( WINAPI ) && ( WINVER < 0x0500 ) /* TODO */ #error WINAPI support for Windows NT4 or earlier NOT implemented yet #endif /* TODO move this function into time elements ? */ #if defined( WINAPI ) if( libcdatetime_internal_elements_set_from_filetime_utc( (libcdatetime_internal_elements_t *) time_elements, &( internal_timestamp->filetime ), error ) != 1 ) #else if( libcdatetime_internal_elements_set_from_time_utc( (libcdatetime_internal_elements_t *) time_elements, &( internal_timestamp->time ), error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements from timestamp.", function ); goto on_error; } if( libcdatetime_elements_copy_to_string_with_index( time_elements, string, string_size, string_index, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy time elements to string.", function ); goto on_error; } if( libcdatetime_elements_free( &time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free time elements.", function ); goto on_error; } return( 1 ); on_error: if( time_elements != NULL ) { libcdatetime_elements_free( &time_elements, NULL ); } return( -1 ); } libewf-20140807/libcdatetime/libcdatetime_support.h0000664000175000017500000000317213443450024024354 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_SUPPORT_H ) #define _LIBCDATETIME_SUPPORT_H #include #include #include "libcdatetime_extern.h" #include "libcdatetime_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCDATETIME ) LIBCDATETIME_EXTERN \ const char *libcdatetime_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */ int libcdatetime_is_leap_year( uint16_t year ); int libcdatetime_get_days_in_month( uint8_t *days_in_month, uint16_t year, uint8_t month, libcerror_error_t **error ); int libcdatetime_get_day_of_year( uint16_t *day_of_year, uint16_t year, uint8_t month, uint8_t day_of_month, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATETIME_SUPPORT_H ) */ libewf-20140807/libcdatetime/libcdatetime_elements.c0000664000175000017500000022270013443450024024447 0ustar00lordyestalordyesta00000000000000/* * Date and time elements functions * * Copyright (C) 2013-2018, 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 . */ #include #include #include #if !defined( WINAPI ) #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #endif #include #include "libcdatetime_definitions.h" #include "libcdatetime_elements.h" #include "libcdatetime_libcerror.h" #include "libcdatetime_support.h" #include "libcdatetime_types.h" /* Creates date and time elements * Make sure the value elements is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdatetime_elements_initialize( libcdatetime_elements_t **elements, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_initialize"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( *elements != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid elements value already set.", function ); return( -1 ); } internal_elements = memory_allocate_structure( libcdatetime_internal_elements_t ); if( internal_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create elements.", function ); goto on_error; } if( memory_set( internal_elements, 0, sizeof( libcdatetime_internal_elements_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear elements.", function ); goto on_error; } *elements = (libcdatetime_elements_t *) internal_elements; return( 1 ); on_error: if( internal_elements != NULL ) { memory_free( internal_elements ); } return( -1 ); } /* Frees date and time elements * Returns 1 if successful or -1 on error */ int libcdatetime_elements_free( libcdatetime_elements_t **elements, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_free"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( *elements != NULL ) { internal_elements = (libcdatetime_internal_elements_t *) *elements; *elements = NULL; memory_free( internal_elements ); } return( 1 ); } /* Copies the date and time elements * Returns 1 if successful or -1 on error */ int libcdatetime_elements_copy( libcdatetime_elements_t *destination_elements, const libcdatetime_elements_t *source_elements, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_copy"; if( destination_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination elements.", function ); return( -1 ); } if( source_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source elements.", function ); return( -1 ); } if( memory_copy( destination_elements, source_elements, sizeof( libcdatetime_internal_elements_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy elements.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the year * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_year( libcdatetime_elements_t *elements, uint16_t *year, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_year"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( year == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid year.", function ); return( -1 ); } /* Valid values for the wYear member are 1601 through 30827. */ if( ( internal_elements->systemtime.wYear < (WORD) 1601 ) || ( internal_elements->systemtime.wYear > (WORD) 30827 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member year value out of bounds.", function ); return( -1 ); } *year = (uint16_t) internal_elements->systemtime.wYear; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get year function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the year * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_year( libcdatetime_elements_t *elements, uint16_t *year, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_year"; int safe_year = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( year == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid year.", function ); return( -1 ); } safe_year = 1900 + internal_elements->tm.tm_year; /* The number of years since 1900 */ if( ( safe_year < (int) -UINT16_MAX ) || ( safe_year > (int) UINT16_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member year value out of bounds.", function ); return( -1 ); } *year = (uint16_t) safe_year; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the day of year * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_day_of_year( libcdatetime_elements_t *elements, uint16_t *day_of_year, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_day_of_year"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; /* Valid values for the wMonth member are 1 through 12. */ if( ( internal_elements->systemtime.wMonth == (WORD) 0 ) || ( internal_elements->systemtime.wMonth > (WORD) 12 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member month value out of bounds.", function ); return( -1 ); } if( libcdatetime_get_day_of_year( day_of_year, (uint16_t) internal_elements->systemtime.wYear, (uint8_t) ( internal_elements->systemtime.wMonth - 1 ), (uint8_t) internal_elements->systemtime.wDay, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to determine day of year.", function ); return( -1 ); } return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get day of year function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the day of year * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_day_of_year( libcdatetime_elements_t *elements, uint16_t *day_of_year, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_day_of_year"; int days_in_year = 0; int safe_year = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( day_of_year == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid day of year.", function ); return( -1 ); } safe_year = 1900 + internal_elements->tm.tm_year; if( libcdatetime_is_leap_year( safe_year ) != 0 ) { days_in_year = 366; } else { days_in_year = 365; } /* Valid values for the tm_yday member are 0 through 365. */ if( ( internal_elements->tm.tm_yday < 0 ) || ( internal_elements->tm.tm_yday >= days_in_year ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member day of year value out of bounds.", function ); return( -1 ); } *day_of_year = (uint8_t) internal_elements->tm.tm_yday; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the month * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_month( libcdatetime_elements_t *elements, uint8_t *month, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_month"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( month == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid month.", function ); return( -1 ); } /* Valid values for the wMonth member are 1 through 12. */ if( ( internal_elements->systemtime.wMonth == (WORD) 0 ) || ( internal_elements->systemtime.wMonth > (WORD) 12 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member month value out of bounds.", function ); return( -1 ); } *month = (uint8_t) internal_elements->systemtime.wMonth; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get month function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the month * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_month( libcdatetime_elements_t *elements, uint8_t *month, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_month"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( month == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid month.", function ); return( -1 ); } /* Valid values for the tm_mon member are 0 through 11. */ if( ( internal_elements->tm.tm_mon < 0 ) || ( internal_elements->tm.tm_mon > 11 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member month value out of bounds.", function ); return( -1 ); } *month = (uint8_t) internal_elements->tm.tm_mon + 1; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the day of month * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_day_of_month( libcdatetime_elements_t *elements, uint8_t *day_of_month, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_day_of_month"; uint8_t days_in_month = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( day_of_month == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid day of month.", function ); return( -1 ); } /* Valid values for the wMonth member are 1 through 12. */ if( ( internal_elements->systemtime.wMonth == (WORD) 0 ) || ( internal_elements->systemtime.wMonth > (WORD) 12 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member month value out of bounds.", function ); return( -1 ); } if( libcdatetime_get_days_in_month( &days_in_month, (uint16_t) internal_elements->systemtime.wYear, (uint8_t) ( internal_elements->systemtime.wMonth - 1 ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve days in month.", function ); return( -1 ); } /* Valid values for the wDay member are 1 through 31. */ if( ( internal_elements->systemtime.wDay == (WORD) 0 ) || ( internal_elements->systemtime.wDay >= (WORD) days_in_month ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member day of month value out of bounds.", function ); return( -1 ); } *day_of_month = (uint8_t) internal_elements->systemtime.wDay; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get day of month function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the day of month * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_day_of_month( libcdatetime_elements_t *elements, uint8_t *day_of_month, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_day_of_month"; uint8_t days_in_month = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( day_of_month == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid day of month.", function ); return( -1 ); } /* Valid values for the tm_mon member are 0 through 11. */ if( ( internal_elements->tm.tm_mon < 0 ) || ( internal_elements->tm.tm_mon > 11 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member month value out of bounds.", function ); return( -1 ); } if( libcdatetime_get_days_in_month( &days_in_month, (uint16_t) ( 1900 + internal_elements->tm.tm_year ), (uint8_t) internal_elements->tm.tm_mon, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve days in month.", function ); return( -1 ); } /* Valid values for the tm_mday member are 1 through 31. */ if( ( internal_elements->tm.tm_mday <= 0 ) || ( internal_elements->tm.tm_mday > (int) days_in_month ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member day of month value out of bounds.", function ); return( -1 ); } *day_of_month = (uint8_t) internal_elements->tm.tm_mday; return( 1 ); } #endif /* Retrieves the date values * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_date_values( libcdatetime_elements_t *elements, uint16_t *year, uint8_t *month, uint8_t *day_of_month, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_get_date_values"; if( libcdatetime_elements_get_year( elements, year, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve year.", function ); return( -1 ); } if( libcdatetime_elements_get_month( elements, month, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve month.", function ); return( -1 ); } if( libcdatetime_elements_get_day_of_month( elements, day_of_month, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve day of month.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the hours * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_hours( libcdatetime_elements_t *elements, uint8_t *hours, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_hours"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( hours == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hours.", function ); return( -1 ); } /* Valid values for the wHour member are 0 through 23. */ if( internal_elements->systemtime.wHour > (WORD) 23 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member hours value out of bounds.", function ); return( -1 ); } *hours = (uint8_t) internal_elements->systemtime.wHour; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get hours function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the hours * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_hours( libcdatetime_elements_t *elements, uint8_t *hours, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_hours"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( hours == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hours.", function ); return( -1 ); } /* Valid values for the tm_hour member are 0 through 23. */ if( ( internal_elements->tm.tm_hour < 0 ) || ( internal_elements->tm.tm_hour > 23 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member hours value out of bounds.", function ); return( -1 ); } *hours = (uint8_t) internal_elements->tm.tm_hour; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the minutes * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_minutes( libcdatetime_elements_t *elements, uint8_t *minutes, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_minutes"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( minutes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid minutes.", function ); return( -1 ); } /* Valid values for the wMinute member are 0 through 59. */ if( internal_elements->systemtime.wMinute > (WORD) 59 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member minutes value out of bounds.", function ); return( -1 ); } *minutes = (uint8_t) internal_elements->systemtime.wMinute; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get minutes function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the minutes * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_minutes( libcdatetime_elements_t *elements, uint8_t *minutes, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_minutes"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( minutes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid minutes.", function ); return( -1 ); } /* Valid values for the tm_min member are 0 through 59. */ if( ( internal_elements->tm.tm_min < 0 ) || ( internal_elements->tm.tm_min > 59 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member minutes value out of bounds.", function ); return( -1 ); } *minutes = (uint8_t) internal_elements->tm.tm_min; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_seconds( libcdatetime_elements_t *elements, uint8_t *seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid seconds.", function ); return( -1 ); } /* Valid values for the wSecond member are 0 through 59. */ if( internal_elements->systemtime.wSecond > (WORD) 59 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member seconds value out of bounds.", function ); return( -1 ); } *seconds = (uint8_t) internal_elements->systemtime.wSecond; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get seconds function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_seconds( libcdatetime_elements_t *elements, uint8_t *seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid seconds.", function ); return( -1 ); } /* Valid values for the tm_sec member are 0 through 59. */ if( ( internal_elements->tm.tm_sec < 0 ) || ( internal_elements->tm.tm_sec > 59 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member seconds value out of bounds.", function ); return( -1 ); } *seconds = (uint8_t) internal_elements->tm.tm_sec; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Retrieves the milli seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_milli_seconds( libcdatetime_elements_t *elements, uint16_t *milli_seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_milli_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( milli_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid milli seconds.", function ); return( -1 ); } /* Valid values for the wMilliseconds member are 0 through 999. */ if( internal_elements->systemtime.wMilliseconds > (WORD) 999 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time member milli seconds value out of bounds.", function ); return( -1 ); } *milli_seconds = (uint16_t) internal_elements->systemtime.wMilliseconds; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI get milli seconds function for Windows NT4 or earlier NOT implemented yet #else /* Retrieves the milli seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_milli_seconds( libcdatetime_elements_t *elements, uint16_t *milli_seconds, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_get_milli_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( milli_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid milli seconds.", function ); return( -1 ); } /* Seconds is the smallest granularity we have so default to 0. */ *milli_seconds = 0; return( 1 ); } #endif /* Retrieves the micro seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_micro_seconds( libcdatetime_elements_t *elements, uint16_t *micro_seconds, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_get_micro_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( micro_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid micro seconds.", function ); return( -1 ); } /* Milli seconds is the smallest granularity we have so default to 0. */ *micro_seconds = 0; return( 1 ); } /* Retrieves the nano seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_nano_seconds( libcdatetime_elements_t *elements, uint16_t *nano_seconds, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_get_nano_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( nano_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid nano seconds.", function ); return( -1 ); } /* Milli seconds is the smallest granularity we have so default to 0. */ *nano_seconds = 0; return( 1 ); } /* Retrieves the time values * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_time_values( libcdatetime_elements_t *elements, uint8_t *hours, uint8_t *minutes, uint8_t *seconds, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_get_time_values"; if( libcdatetime_elements_get_hours( elements, hours, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve hours.", function ); return( -1 ); } if( libcdatetime_elements_get_minutes( elements, minutes, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve minutes.", function ); return( -1 ); } if( libcdatetime_elements_get_seconds( elements, seconds, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve seconds.", function ); return( -1 ); } return( 1 ); } /* Sets the date and time elements * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_date_and_time_values( libcdatetime_elements_t *elements, uint16_t year, uint8_t month, uint8_t day_of_month, uint8_t hours, uint8_t minutes, uint8_t seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_get_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( month > 11 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid month value out of bounds.", function ); return( -1 ); } /* TODO validate day_of_month */ if( hours > 24 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid hours value out of bounds.", function ); return( -1 ); } if( minutes > 59 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid minutes value out of bounds.", function ); return( -1 ); } if( seconds > 59 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid seconds value out of bounds.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* TODO implement */ #else /* TODO get day_of_year */ /* TODO get day_of_week */ internal_elements->tm.tm_year = (int) year - 1900; internal_elements->tm.tm_yday = 0; internal_elements->tm.tm_mon = (int) month; internal_elements->tm.tm_mday = (int) day_of_month; internal_elements->tm.tm_wday = 0; internal_elements->tm.tm_hour = (int) hours; internal_elements->tm.tm_min = (int) minutes; internal_elements->tm.tm_sec = (int) seconds; internal_elements->tm.tm_isdst = 0; #endif return( 1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Sets the date and time elements from a FILETIME value in UTC * Returns 1 if successful or -1 on error */ int libcdatetime_internal_elements_set_from_filetime_utc( libcdatetime_internal_elements_t *internal_elements, FILETIME *filetime, libcerror_error_t **error ) { static char *function = "libcdatetime_internal_elements_set_from_filetime_utc"; DWORD error_code = 0; if( internal_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( filetime == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filetime.", function ); return( -1 ); } if( FileTimeToSystemTime( filetime, &( internal_elements->systemtime ) ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve systemtime.", function ); return( -1 ); } return( 1 ); } #endif /* defined( WINAPI ) && ( WINVER >= 0x0500 ) */ #if !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_GMTIME ) || defined( HAVE_GMTIME_R ) ) /* Sets the date and time elements from a POSIX time value in UTC * Returns 1 if successful or -1 on error */ int libcdatetime_internal_elements_set_from_time_utc( libcdatetime_internal_elements_t *internal_elements, time_t *time, libcerror_error_t **error ) { static char *function = "libcdatetime_internal_elements_set_from_time_utc"; #if !defined( HAVE_GMTIME_R ) struct tm *static_tm = NULL; #endif if( internal_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( time == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time.", function ); return( -1 ); } #if defined( HAVE_GMTIME_R ) if( gmtime_r( time, &( internal_elements->tm ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements.", function ); return( -1 ); } #else static_tm = gmtime( time ); if( static_tm == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create static time members.", function ); return( -1 ); } if( memory_copy( internal_elements->tm, static_tm, sizeof( struct tm ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy time members.", function ); return( -1 ); } #endif return( 1 ); } #endif /* !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_GMTIME ) || defined( HAVE_GMTIME_R ) ) */ #if !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_LOCALTIME ) || defined( HAVE_LOCALTIME_R ) ) /* Sets the date and time elements from a POSIX time value in localtime * Returns 1 if successful or -1 on error */ int libcdatetime_internal_elements_set_from_time_localtime( libcdatetime_internal_elements_t *internal_elements, time_t *time, libcerror_error_t **error ) { static char *function = "libcdatetime_internal_elements_set_from_time_localtime"; #if !defined( HAVE_LOCALTIME_R ) struct tm *static_tm = NULL; #endif if( internal_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( time == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time.", function ); return( -1 ); } #if defined( HAVE_LOCALTIME_R ) if( localtime_r( time, &( internal_elements->tm ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements.", function ); return( -1 ); } #else static_tm = localtime( time ); if( static_tm == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create static time members.", function ); return( -1 ); } if( memory_copy( internal_elements->tm, static_tm, sizeof( struct tm ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy time members.", function ); return( -1 ); } #endif return( 1 ); } #endif /* if !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_LOCALTIME ) || defined( HAVE_LOCALTIME_R ) ) */ #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Sets the date and time elements to the current (system) date and time in UTC * This function uses the WINAPI function for Windows 2000 or later * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_current_time_utc( libcdatetime_elements_t *elements, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_set_current_time_utc"; DWORD error_code = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; GetSystemTime( &( internal_elements->systemtime ) ); if( SystemTimeToFileTime( &( internal_elements->systemtime ), &( internal_elements->filetime ) ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve filetime.", function ); return( -1 ); } internal_elements->mode = LIBCDATETIME_ELEMENTS_MODE_DATE_TIME_IN_UTC; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI set current time in UTC function for Windows NT4 or earlier NOT implemented yet #elif defined( HAVE_TIME ) && ( defined( HAVE_GMTIME ) || defined( HAVE_GMTIME_R ) ) /* Sets the date and time elements to the current (system) date and time in UTC * This function uses the POSIX time function or equivalent * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_current_time_utc( libcdatetime_elements_t *elements, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_set_current_time_utc"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( time( &( internal_elements->time ) ) == (time_t) -1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve time.", function ); return( -1 ); } if( libcdatetime_internal_elements_set_from_time_utc( internal_elements, &( internal_elements->time ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements from time.", function ); return( -1 ); } internal_elements->mode = LIBCDATETIME_ELEMENTS_MODE_DATE_TIME_IN_UTC; return( 1 ); } #else #error Missing get current time in UTC function #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Sets the date and time elements to the current (system) date and time in localtime * This function uses the WINAPI function for Windows 2000 or later * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_current_time_localtime( libcdatetime_elements_t *elements, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_set_current_time_localtime"; DWORD error_code = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; GetLocalTime( &( internal_elements->systemtime ) ); if( SystemTimeToFileTime( &( internal_elements->systemtime ), &( internal_elements->filetime ) ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve filetime.", function ); return( -1 ); } internal_elements->mode = LIBCDATETIME_ELEMENTS_MODE_DATE_TIME_IN_LOCALTIME; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI set current time in localtime function for Windows NT4 or earlier NOT implemented yet #elif defined( HAVE_TIME ) && ( defined( HAVE_LOCALTIME ) || defined( HAVE_LOCALTIME_R ) ) /* Sets the date and time elements to the current (system) date and time in localtime * This function uses the POSIX time function or equivalent * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_current_time_localtime( libcdatetime_elements_t *elements, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_set_current_time_localtime"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( time( &( internal_elements->time ) ) == (time_t) -1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve time.", function ); return( -1 ); } if( libcdatetime_internal_elements_set_from_time_localtime( internal_elements, &( internal_elements->time ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements from time.", function ); return( -1 ); } internal_elements->mode = LIBCDATETIME_ELEMENTS_MODE_DATE_TIME_IN_LOCALTIME; return( 1 ); } #else #error Missing get current time in localtime function #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Determines the delta in seconds between the first and second date and time elements * This function uses the WINAPI function for Windows 2000 or later * The number_of_seconds value with be negative if the first date and time * pre-dates the second date and time * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_delta_in_seconds( libcdatetime_elements_t *first_elements, libcdatetime_elements_t *second_elements, int64_t *number_of_seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_first_elements = NULL; libcdatetime_internal_elements_t *internal_second_elements = NULL; static char *function = "libcdatetime_elements_get_delta_in_seconds"; int64_t time_delta = 0; if( first_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first elements.", function ); return( -1 ); } internal_first_elements = (libcdatetime_internal_elements_t *) first_elements; if( second_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid second elements.", function ); return( -1 ); } internal_second_elements = (libcdatetime_internal_elements_t *) second_elements; if( number_of_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of seconds.", function ); return( -1 ); } if( internal_first_elements->mode != internal_second_elements->mode ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid second elements - mismatch in mode value.", function ); return( -1 ); } time_delta = (int64_t) internal_first_elements->filetime.dwHighDateTime - (int64_t) internal_second_elements->filetime.dwHighDateTime; if( time_delta < 0 ) { if( (uint64_t) -time_delta > (uint64_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } else { if( (uint64_t) time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } time_delta <<= 32; time_delta += (int64_t) internal_first_elements->filetime.dwLowDateTime - (int64_t) internal_second_elements->filetime.dwLowDateTime; if( time_delta < 0 ) { if( (uint64_t) -time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } else { if( (uint64_t) time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } *number_of_seconds = (int64_t) time_delta / 10000000; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI date and time elements type for Windows NT4 or earlier NOT implemented yet #else /* Determines the delta in seconds between the first and second date and time elements * The number_of_seconds value with be negative if the first date and time * pre-dates the second date and time * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_delta_in_seconds( libcdatetime_elements_t *first_elements, libcdatetime_elements_t *second_elements, int64_t *number_of_seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_first_elements = NULL; libcdatetime_internal_elements_t *internal_second_elements = NULL; static char *function = "libcdatetime_elements_get_delta_in_seconds"; time_t time_delta = 0; if( first_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first elements.", function ); return( -1 ); } internal_first_elements = (libcdatetime_internal_elements_t *) first_elements; if( second_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid second elements.", function ); return( -1 ); } internal_second_elements = (libcdatetime_internal_elements_t *) second_elements; if( number_of_seconds == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of seconds.", function ); return( -1 ); } time_delta = internal_first_elements->time - internal_second_elements->time; if( time_delta < 0 ) { if( (uint64_t) -time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } else { if( (uint64_t) time_delta > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid time delta value out of bounds.", function ); return( -1 ); } } *number_of_seconds = (int64_t) time_delta; return( 1 ); } #endif #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* Sets the time elements from the delta in seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_from_delta_in_seconds( libcdatetime_elements_t *elements, int64_t number_of_seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_set_from_delta_in_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; if( number_of_seconds < 0 ) { /* TODO mark duration as negative ? */ number_of_seconds *= -1; } number_of_seconds *= 10000000; internal_elements->filetime.dwHighDateTime = (DWORD) ( ( number_of_seconds >> 32 ) & 0xffffffffUL ); internal_elements->filetime.dwLowDateTime = (DWORD) ( number_of_seconds & 0xffffffffUL ); if( libcdatetime_internal_elements_set_from_filetime_utc( internal_elements, &( internal_elements->filetime ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements from filetime.", function ); return( -1 ); } internal_elements->mode = LIBCDATETIME_ELEMENTS_MODE_DURATION; return( 1 ); } #elif defined( WINAPI ) /* TODO */ #error WINAPI set from delta in seconds function for Windows NT4 or earlier NOT implemented yet #else /* Sets the time elements from the delta in seconds * Returns 1 if successful or -1 on error */ int libcdatetime_elements_set_from_delta_in_seconds( libcdatetime_elements_t *elements, int64_t number_of_seconds, libcerror_error_t **error ) { libcdatetime_internal_elements_t *internal_elements = NULL; static char *function = "libcdatetime_elements_set_from_delta_in_seconds"; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } internal_elements = (libcdatetime_internal_elements_t *) elements; /* TODO check bounds of number_of_seconds for time_t cast */ if( number_of_seconds < 0 ) { /* TODO mark duration as negative ? */ number_of_seconds *= -1; } internal_elements->time = (time_t) number_of_seconds; if( libcdatetime_internal_elements_set_from_time_utc( internal_elements, &( internal_elements->time ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set time elements from time.", function ); return( -1 ); } internal_elements->mode = LIBCDATETIME_ELEMENTS_MODE_DURATION; return( 1 ); } #endif /* Deterimes the size of the string for the date and time elements * The string size includes the end of string character * Returns 1 if successful or -1 on error */ int libcdatetime_elements_get_string_size( libcdatetime_elements_t *elements, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_get_string_size"; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid elements.", function ); return( -1 ); } if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_DURATION | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR; if( ( string_format_flags & supported_flags ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) && ( string_format_type != LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type: 0x%08" PRIx32 ".", function, string_format_type ); return( -1 ); } /* End of string character */ *string_size = 1; /* Determine the size of the date and time string */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_DATE ) != 0 ) { /* Example: Jan 01, 1970 */ if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) { *string_size += 12; } /* Example: 1970-01-01 */ else if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) { *string_size += 10; } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) != 0 ) { /* Date and time separator */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_DATE ) != 0 ) { *string_size += 1; } /* Example: 00:00:00 */ *string_size += 8; /* Example: .000 */ if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { *string_size += 4; } /* Example: .000000 */ if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { *string_size += 3; } /* Example: .000000000 */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) { *string_size += 3; } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR ) != 0 ) { /* Example: UTC */ if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) { *string_size += 4; } /* Example: Z */ else if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) { *string_size += 1; } } return( 1 ); } /* Converts the date and time elements into a string * The string size should include the end of string character * Returns 1 if successful, 0 if the elements are not a valid or -1 on error */ int libcdatetime_elements_copy_to_string( libcdatetime_elements_t *elements, uint8_t *string, size_t string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libcdatetime_elements_copy_to_string"; size_t string_index = 0; if( libcdatetime_elements_copy_to_string_with_index( elements, string, string_size, &string_index, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy elements to string.", function ); return( -1 ); } return( 1 ); } /* Converts the date and time elements into a string * The string size should include the end of string character * Returns 1 if successful, 0 if the elements are not a valid or -1 on error */ int libcdatetime_elements_copy_to_string_with_index( libcdatetime_elements_t *elements, uint8_t *string, size_t string_size, size_t *string_index, uint32_t string_format_flags, libcerror_error_t **error ) { uint8_t *month_string = NULL; static char *function = "libcdatetime_elements_copy_to_string_with_index"; size_t internal_string_index = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint16_t micro_seconds = 0; uint16_t milli_seconds = 0; uint16_t nano_seconds = 0; uint16_t year = 0; uint8_t day_of_month = 0; uint8_t hours = 0; uint8_t minutes = 0; uint8_t month = 0; uint8_t seconds = 0; if( elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid date time values.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string index.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_DURATION | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS | LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR; if( ( string_format_flags & supported_flags ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) && ( string_format_type != LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type: 0x%08" PRIx32 ".", function, string_format_type ); return( -1 ); } internal_string_index = *string_index; /* Validate the date and time if necessary */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_DATE ) != 0 ) { /* The libcdatetime_elements_get_date_value function returns sane values. */ if( libcdatetime_elements_get_date_values( elements, &year, &month, &day_of_month, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve date values.", function ); return( -1 ); } if( year > 9999 ) { return( 0 ); } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) != 0 ) { /* The libcdatetime_elements_get_time_value function returns sane values. */ if( libcdatetime_elements_get_time_values( elements, &hours, &minutes, &seconds, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve time values.", function ); return( -1 ); } if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { if( libcdatetime_elements_get_milli_seconds( elements, &milli_seconds, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve milli seconds.", function ); return( -1 ); } if( milli_seconds > 999 ) { return( 0 ); } } if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { if( libcdatetime_elements_get_micro_seconds( elements, µ_seconds, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve micro seconds.", function ); return( -1 ); } if( micro_seconds > 999 ) { return( 0 ); } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) { if( libcdatetime_elements_get_nano_seconds( elements, &nano_seconds, error ) != 1 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve nano seconds.", function ); return( -1 ); } if( nano_seconds > 999 ) { return( 0 ); } } } /* Create the date and time string */ if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_DATE ) != 0 ) { if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) { switch( month ) { case 1: month_string = (uint8_t *) "Jan"; break; case 2: month_string = (uint8_t *) "Feb"; break; case 3: month_string = (uint8_t *) "Mar"; break; case 4: month_string = (uint8_t *) "Apr"; break; case 5: month_string = (uint8_t *) "May"; break; case 6: month_string = (uint8_t *) "Jun"; break; case 7: month_string = (uint8_t *) "Jul"; break; case 8: month_string = (uint8_t *) "Aug"; break; case 9: month_string = (uint8_t *) "Sep"; break; case 10: month_string = (uint8_t *) "Oct"; break; case 11: month_string = (uint8_t *) "Nov"; break; case 12: month_string = (uint8_t *) "Dec"; break; } if( ( internal_string_index + 12 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } /* Format: mmm dd, yyyy */ string[ internal_string_index++ ] = month_string[ 0 ]; string[ internal_string_index++ ] = month_string[ 1 ]; string[ internal_string_index++ ] = month_string[ 2 ]; string[ internal_string_index++ ] = (uint8_t) ' '; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( day_of_month / 10 ); string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( day_of_month % 10 ); string[ internal_string_index++ ] = (uint8_t) ','; string[ internal_string_index++ ] = (uint8_t) ' '; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( year / 1000 ); year %= 1000; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( year / 100 ); year %= 100; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( year / 10 ); year %= 10; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) year; if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) != 0 ) { if( ( internal_string_index + 1 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } string[ internal_string_index++ ] = (uint8_t) ' '; } } else if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) { if( ( internal_string_index + 10 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } /* Format: yyyy-mm-dd */ string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( year / 1000 ); year %= 1000; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( year / 100 ); year %= 100; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( year / 10 ); year %= 10; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) year; string[ internal_string_index++ ] = (uint8_t) '-'; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( month / 10 ); string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( month % 10 ); string[ internal_string_index++ ] = (uint8_t) '-'; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( day_of_month / 10 ); string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( day_of_month % 10 ); if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) != 0 ) { if( ( internal_string_index + 1 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } string[ internal_string_index++ ] = (uint8_t) 'T'; } } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME ) != 0 ) { if( ( internal_string_index + 8 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } /* Format: HH:MM:SS */ string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( hours / 10 ); string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( hours % 10 ); string[ internal_string_index++ ] = (uint8_t) ':'; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( minutes / 10 ); string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( minutes % 10 ); string[ internal_string_index++ ] = (uint8_t) ':'; string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( seconds / 10 ); string[ internal_string_index++ ] = (uint8_t) '0' + (uint8_t) ( seconds % 10 ); if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { if( ( internal_string_index + 4 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } /* Format: .### */ string[ internal_string_index++ ] = (uint8_t) '.'; string[ internal_string_index + 2 ] = (uint8_t) '0' + (uint8_t) ( milli_seconds % 10 ); milli_seconds /= 10; string[ internal_string_index + 1 ] = (uint8_t) '0' + (uint8_t) ( milli_seconds % 10 ); milli_seconds /= 10; string[ internal_string_index ] = (uint8_t) '0' + (uint8_t) ( milli_seconds % 10 ); milli_seconds /= 10; internal_string_index += 3; } if( ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS ) != 0 ) || ( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) ) { if( ( internal_string_index + 3 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } /* Format: ### */ string[ internal_string_index + 2 ] = (uint8_t) '0' + (uint8_t) ( micro_seconds % 10 ); micro_seconds /= 10; string[ internal_string_index + 1 ] = (uint8_t) '0' + (uint8_t) ( micro_seconds % 10 ); micro_seconds /= 10; string[ internal_string_index ] = (uint8_t) '0' + (uint8_t) ( micro_seconds % 10 ); micro_seconds /= 10; internal_string_index += 3; } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS ) != 0 ) { if( ( internal_string_index + 3 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } /* Format: ### */ string[ internal_string_index + 2 ] = (uint8_t) '0' + (uint8_t) ( nano_seconds % 10 ); nano_seconds /= 10; string[ internal_string_index + 1 ] = (uint8_t) '0' + (uint8_t) ( nano_seconds % 10 ); nano_seconds /= 10; string[ internal_string_index ] = (uint8_t) '0' + (uint8_t) ( nano_seconds % 10 ); nano_seconds /= 10; internal_string_index += 3; } } if( ( string_format_flags & LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR ) != 0 ) { if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_CTIME ) { if( ( internal_string_index + 4 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } string[ internal_string_index++ ] = (uint8_t) ' '; string[ internal_string_index++ ] = (uint8_t) 'U'; string[ internal_string_index++ ] = (uint8_t) 'T'; string[ internal_string_index++ ] = (uint8_t) 'C'; } else if( string_format_type == LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 ) { if( ( internal_string_index + 1 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } string[ internal_string_index++ ] = (uint8_t) 'Z'; } } if( ( internal_string_index + 1 ) > string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string is too small.", function ); return( -1 ); } string[ internal_string_index++ ] = 0; *string_index = internal_string_index; return( 1 ); } libewf-20140807/libcdatetime/libcdatetime_support.c0000664000175000017500000001275513443450024024356 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2013-2018, 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 . */ #include #include #include "libcdatetime_definitions.h" #include "libcdatetime_libcerror.h" #include "libcdatetime_support.h" #if !defined( LIBCDATETIME_ATTRIBUTE_FALLTHROUGH ) #if defined( __GNUC__ ) && __GNUC__ >= 7 #define LIBCDATETIME_ATTRIBUTE_FALLTHROUGH __attribute__ ((fallthrough)) #else #define LIBCDATETIME_ATTRIBUTE_FALLTHROUGH #endif #endif #if !defined( HAVE_LOCAL_LIBCDATETIME ) /* Returns the library version as a string */ const char *libcdatetime_get_version( void ) { return( (const char *) LIBCDATETIME_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */ /* Determines if the year is a leap year * Returns 1 if a leay year or 0 if not */ int libcdatetime_is_leap_year( uint16_t year ) { if( ( ( year % 4 ) == 0 ) && ( ( year % 100 ) != 0 ) ) { return( 1 ); } if( ( year % 400 ) == 0 ) { return( 1 ); } return( 0 ); } /* Calculates the days in a month * Returns 1 if successful or -1 on error */ int libcdatetime_get_days_in_month( uint8_t *days_in_month, uint16_t year, uint8_t month, libcerror_error_t **error ) { static char *function = "libcdatetime_get_days_in_month"; if( days_in_month == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid days in month.", function ); return( -1 ); } if( month > 11 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid month value out of bounds.", function ); return( -1 ); } switch( month ) { case LIBCDATETIME_MONTH_JANUARY: case LIBCDATETIME_MONTH_MARCH: case LIBCDATETIME_MONTH_MAY: case LIBCDATETIME_MONTH_JULY: case LIBCDATETIME_MONTH_AUGUST: case LIBCDATETIME_MONTH_OCTOBER: case LIBCDATETIME_MONTH_DECEMBER: *days_in_month = 31; break; case LIBCDATETIME_MONTH_APRIL: case LIBCDATETIME_MONTH_JUNE: case LIBCDATETIME_MONTH_SEPTEMBER: case LIBCDATETIME_MONTH_NOVEMBER: *days_in_month = 30; break; case LIBCDATETIME_MONTH_FEBRUARY: if( libcdatetime_is_leap_year( year ) != 0 ) { *days_in_month = 29; } else { *days_in_month = 28; } break; } return( 1 ); } /* Calculates the day of year * Returns 1 if successful or -1 on error */ int libcdatetime_get_day_of_year( uint16_t *day_of_year, uint16_t year, uint8_t month, uint8_t day_of_month, libcerror_error_t **error ) { static char *function = "libcdatetime_get_day_of_year"; uint16_t safe_day_of_year = 0; uint8_t days_in_month = 0; if( day_of_year == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid day of year.", function ); return( -1 ); } if( libcdatetime_get_days_in_month( &days_in_month, year, month, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve days in month.", function ); return( -1 ); } if( ( day_of_month == 0 ) || ( day_of_month > days_in_month ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid day of month value out of bounds.", function ); return( -1 ); } safe_day_of_year = 0; switch( month ) { case LIBCDATETIME_MONTH_DECEMBER: safe_day_of_year += 30; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_NOVEMBER: safe_day_of_year += 31; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_OCTOBER: safe_day_of_year += 30; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_SEPTEMBER: safe_day_of_year += 31; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_AUGUST: safe_day_of_year += 31; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_JULY: safe_day_of_year += 30; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_JUNE: safe_day_of_year += 31; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_MAY: safe_day_of_year += 30; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_APRIL: safe_day_of_year += 31; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_MARCH: if( libcdatetime_is_leap_year( year ) != 0 ) { safe_day_of_year += 29; } else { safe_day_of_year += 28; } LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; case LIBCDATETIME_MONTH_FEBRUARY: safe_day_of_year += 31; LIBCDATETIME_ATTRIBUTE_FALLTHROUGH; default: safe_day_of_year += day_of_month - 1; } *day_of_year = safe_day_of_year; return( 1 ); } libewf-20140807/libcdatetime/libcdatetime_error.c0000664000175000017500000000563013443450024023765 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2013-2018, 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 . */ #include #include #include #include "libcdatetime_error.h" #include "libcdatetime_libcerror.h" #if !defined( HAVE_LOCAL_LIBCDATETIME ) /* Free an error and its elements */ void libcdatetime_error_free( libcdatetime_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcdatetime_error_fprint( libcdatetime_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcdatetime_error_sprint( libcdatetime_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcdatetime_error_backtrace_fprint( libcdatetime_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcdatetime_error_backtrace_sprint( libcdatetime_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */ libewf-20140807/libcdatetime/libcdatetime_libcerror.h0000664000175000017500000000265413443450024024627 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_LIBCERROR_H ) #define _LIBCDATETIME_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCDATETIME_LIBCERROR_H ) */ libewf-20140807/libcdatetime/libcdatetime_extern.h0000664000175000017500000000246613443450024024152 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_INTERNAL_EXTERN_H ) #define _LIBCDATETIME_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCDATETIME for local use of libcdatetime */ #if !defined( HAVE_LOCAL_LIBCDATETIME ) #include #define LIBCDATETIME_EXTERN_VARIABLE LIBCDATETIME_EXTERN #else #define LIBCDATETIME_EXTERN /* extern */ #define LIBCDATETIME_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */ #endif /* !defined( _LIBCDATETIME_INTERNAL_EXTERN_H ) */ libewf-20140807/libcdatetime/Makefile.in0000664000175000017500000010160113443455347022037 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcdatetime ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcdatetime_la_LIBADD = am__libcdatetime_la_SOURCES_DIST = libcdatetime_definitions.h \ libcdatetime_elements.c libcdatetime_elements.h \ libcdatetime_error.c libcdatetime_error.h \ libcdatetime_extern.h libcdatetime_libcerror.h \ libcdatetime_timestamp.c libcdatetime_timestamp.h \ libcdatetime_support.c libcdatetime_support.h \ libcdatetime_types.h libcdatetime_unused.h @HAVE_LOCAL_LIBCDATETIME_TRUE@am_libcdatetime_la_OBJECTS = \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_elements.lo \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_error.lo \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_timestamp.lo \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_support.lo libcdatetime_la_OBJECTS = $(am_libcdatetime_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCDATETIME_TRUE@am_libcdatetime_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcdatetime_elements.Plo \ ./$(DEPDIR)/libcdatetime_error.Plo \ ./$(DEPDIR)/libcdatetime_support.Plo \ ./$(DEPDIR)/libcdatetime_timestamp.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcdatetime_la_SOURCES) DIST_SOURCES = $(am__libcdatetime_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCDATETIME_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCDATETIME_TRUE@noinst_LTLIBRARIES = libcdatetime.la @HAVE_LOCAL_LIBCDATETIME_TRUE@libcdatetime_la_SOURCES = \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_definitions.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_elements.c libcdatetime_elements.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_error.c libcdatetime_error.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_extern.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_libcerror.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_timestamp.c libcdatetime_timestamp.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_support.c libcdatetime_support.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_types.h \ @HAVE_LOCAL_LIBCDATETIME_TRUE@ libcdatetime_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcdatetime/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcdatetime/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcdatetime.la: $(libcdatetime_la_OBJECTS) $(libcdatetime_la_DEPENDENCIES) $(EXTRA_libcdatetime_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcdatetime_la_rpath) $(libcdatetime_la_OBJECTS) $(libcdatetime_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdatetime_elements.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdatetime_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdatetime_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdatetime_timestamp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcdatetime_elements.Plo -rm -f ./$(DEPDIR)/libcdatetime_error.Plo -rm -f ./$(DEPDIR)/libcdatetime_support.Plo -rm -f ./$(DEPDIR)/libcdatetime_timestamp.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcdatetime ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcdatetime_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcdatetime/libcdatetime_types.h0000664000175000017500000000320613443450024024002 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_INTERNAL_TYPES_H ) #define _LIBCDATETIME_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBCDATETIME for local use of libcdatetime * The definitions in are copied here * for local use of libcdatetime */ #if defined( HAVE_LOCAL_LIBCDATETIME ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libcdatetime_elements {} libcdatetime_elements_t; typedef struct libcdatetime_timestamp {} libcdatetime_timestamp_t; #else typedef intptr_t libcdatetime_elements_t; typedef intptr_t libcdatetime_timestamp_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBCDATETIME ) */ #endif /* !defined( _LIBCDATETIME_INTERNAL_TYPES_H ) */ libewf-20140807/libcdatetime/libcdatetime_elements.h0000664000175000017500000001644313443450024024461 0ustar00lordyestalordyesta00000000000000/* * Date and time elements functions * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_INTERNAL_ELEMENTS_H ) #define _LIBCDATETIME_INTERNAL_ELEMENTS_H #include #include #if !defined( WINAPI ) #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #endif #include "libcdatetime_extern.h" #include "libcdatetime_libcerror.h" #include "libcdatetime_types.h" #if defined( __cplusplus ) extern "C" { #endif enum LIBCDATETIME_ELEMENTS_MODES { LIBCDATETIME_ELEMENTS_MODE_DATE_TIME_IN_UTC, LIBCDATETIME_ELEMENTS_MODE_DATE_TIME_IN_LOCALTIME, LIBCDATETIME_ELEMENTS_MODE_DURATION, }; typedef struct libcdatetime_internal_elements libcdatetime_internal_elements_t; struct libcdatetime_internal_elements { #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* The filetime */ FILETIME filetime; /* The systemtime */ SYSTEMTIME systemtime; #elif defined( WINAPI ) /* TODO */ #error WINAPI date and time elements type for Windows NT4 or earlier NOT implemented yet #else /* The time */ time_t time; /* The struct tm */ struct tm tm; #endif /* defined( WINAPI ) && ( WINVER >= 0x0500 ) */ /* Value to indicate how the time elements are used * e.g. to store a date time in UCT or localtime or a duration */ uint8_t mode; }; LIBCDATETIME_EXTERN \ int libcdatetime_elements_initialize( libcdatetime_elements_t **elements, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_free( libcdatetime_elements_t **elements, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_copy( libcdatetime_elements_t *destination_elements, const libcdatetime_elements_t *source_elements, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_year( libcdatetime_elements_t *elements, uint16_t *year, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_day_of_year( libcdatetime_elements_t *elements, uint16_t *day_of_year, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_month( libcdatetime_elements_t *elements, uint8_t *month, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_day_of_month( libcdatetime_elements_t *elements, uint8_t *day_of_month, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_date_values( libcdatetime_elements_t *elements, uint16_t *year, uint8_t *month, uint8_t *day_of_month, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_hours( libcdatetime_elements_t *elements, uint8_t *hours, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_minutes( libcdatetime_elements_t *elements, uint8_t *minutes, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_seconds( libcdatetime_elements_t *elements, uint8_t *seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_milli_seconds( libcdatetime_elements_t *elements, uint16_t *milli_seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_micro_seconds( libcdatetime_elements_t *elements, uint16_t *micro_seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_nano_seconds( libcdatetime_elements_t *elements, uint16_t *nano_seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_time_values( libcdatetime_elements_t *elements, uint8_t *hours, uint8_t *minutes, uint8_t *seconds, libcerror_error_t **error ); int libcdatetime_elements_set_date_and_time_values( libcdatetime_elements_t *elements, uint16_t year, uint8_t month, uint8_t day_of_month, uint8_t hours, uint8_t minutes, uint8_t seconds, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER >= 0x0500 ) int libcdatetime_internal_elements_set_from_filetime_utc( libcdatetime_internal_elements_t *internal_elements, FILETIME *filetime, libcerror_error_t **error ); #endif /* defined( WINAPI ) && ( WINVER >= 0x0500 ) */ #if !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_GMTIME ) || defined( HAVE_GMTIME_R ) ) int libcdatetime_internal_elements_set_from_time_utc( libcdatetime_internal_elements_t *internal_elements, time_t *time, libcerror_error_t **error ); #endif /* !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_GMTIME ) || defined( HAVE_GMTIME_R ) ) */ #if !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_LOCALTIME ) || defined( HAVE_LOCALTIME_R ) ) int libcdatetime_internal_elements_set_from_time_localtime( libcdatetime_internal_elements_t *internal_elements, time_t *time, libcerror_error_t **error ); #endif /* !defined( WINAPI ) && defined( HAVE_TIME ) && ( defined( HAVE_LOCALTIME ) || defined( HAVE_LOCALTIME_R ) ) */ LIBCDATETIME_EXTERN \ int libcdatetime_elements_set_current_time_utc( libcdatetime_elements_t *elements, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_set_current_time_localtime( libcdatetime_elements_t *elements, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_delta_in_seconds( libcdatetime_elements_t *first_elements, libcdatetime_elements_t *second_elements, int64_t *number_of_seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_set_from_delta_in_seconds( libcdatetime_elements_t *elements, int64_t number_of_seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_get_string_size( libcdatetime_elements_t *elements, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_copy_to_string( libcdatetime_elements_t *elements, uint8_t *string, size_t string_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_elements_copy_to_string_with_index( libcdatetime_elements_t *elements, uint8_t *string, size_t string_size, size_t *string_index, uint32_t string_format_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATETIME_INTERNAL_ELEMENTS_H ) */ libewf-20140807/libcdatetime/libcdatetime_timestamp.h0000664000175000017500000000635713443450024024653 0ustar00lordyestalordyesta00000000000000/* * Timestamp functions * * Copyright (C) 2013-2018, 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( _LIBCDATETIME_INTERNAL_TIMESTAMP_H ) #define _LIBCDATETIME_INTERNAL_TIMESTAMP_H #include #include #if !defined( WINAPI ) #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #endif #include "libcdatetime_extern.h" #include "libcdatetime_libcerror.h" #include "libcdatetime_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdatetime_internal_timestamp libcdatetime_internal_timestamp_t; struct libcdatetime_internal_timestamp { #if defined( WINAPI ) && ( WINVER >= 0x0500 ) /* The filetime timestamp */ FILETIME filetime; #elif defined( WINAPI ) /* TODO */ #error WINAPI timestamp type for Windows NT4 or earlier NOT implemented yet #else /* The time */ time_t time; #endif }; LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_initialize( libcdatetime_timestamp_t **timestamp, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_free( libcdatetime_timestamp_t **timestamp, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_copy( libcdatetime_timestamp_t *destination_timestamp, const libcdatetime_timestamp_t *source_timestamp, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_set_current_time( libcdatetime_timestamp_t *timestamp, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_get_delta_in_seconds( libcdatetime_timestamp_t *first_timestamp, libcdatetime_timestamp_t *second_timestamp, int64_t *number_of_seconds, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_get_string_size( libcdatetime_timestamp_t *timestamp, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_copy_to_string( libcdatetime_timestamp_t *timestamp, uint8_t *string, size_t string_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBCDATETIME_EXTERN \ int libcdatetime_timestamp_copy_to_string_with_index( libcdatetime_timestamp_t *timestamp, uint8_t *string, size_t string_size, size_t *string_index, uint32_t string_format_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATETIME_INTERNAL_TIMESTAMP_H ) */ libewf-20140807/libodraw/0000775000175000017500000000000013443455446017150 5ustar00lordyestalordyesta00000000000000libewf-20140807/libodraw/libodraw_support.h0000664000175000017500000000325013443450062022705 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_SUPPORT_H ) #define _LIBODRAW_SUPPORT_H #include #include #include "libodraw_extern.h" #include "libodraw_libbfio.h" #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBODRAW ) LIBODRAW_EXTERN \ const char *libodraw_get_version( void ); LIBODRAW_EXTERN \ int libodraw_get_access_flags_read( void ); LIBODRAW_EXTERN \ int libodraw_get_access_flags_read_write( void ); LIBODRAW_EXTERN \ int libodraw_get_access_flags_write( void ); LIBODRAW_EXTERN \ int libodraw_get_codepage( int *codepage, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_SUPPORT_H ) */ libewf-20140807/libodraw/libodraw_libclocale.h0000664000175000017500000000266513443450062023273 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBCLOCALE_H ) #define _LIBODRAW_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBODRAW_LIBCLOCALE_H ) */ libewf-20140807/libodraw/libodraw_cue_parser.c0000664000175000017500000025622013443450232023322 0ustar00lordyestalordyesta00000000000000/* A Bison parser, made by GNU Bison 3.0.5. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Substitute the variable and function names. */ #define yyparse cue_scanner_parse #define yylex cue_scanner_lex #define yyerror cue_scanner_error #define yydebug cue_scanner_debug #define yynerrs cue_scanner_nerrs #define yylval cue_scanner_lval #define yychar cue_scanner_char /* Copy the first part of user declarations. */ /* * CUE parser functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libodraw_definitions.h" #include "libodraw_handle.h" #include "libodraw_libcerror.h" #include "libodraw_libcnotify.h" #include "libodraw_types.h" #define YYMALLOC cue_scanner_alloc #define YYREALLOC cue_scanner_realloc #define YYFREE cue_scanner_free #define YYLEX_PARAM NULL #define YYPARSE_PARAM parser_state #if defined( HAVE_DEBUG_OUTPUT ) #define cue_parser_rule_print( string ) \ if( libcnotify_verbose != 0 ) libcnotify_printf( "cue_parser: rule: %s\n", string ) #else #define cue_parser_rule_print( string ) #endif #if !defined( CD_SECS ) /* seconds per minute */ #define CD_SECS 60 #endif #if !defined( CD_FRAMES ) /* frames per second */ #define CD_FRAMES 75 #endif /* Note that the MSF are relative, so there is no need for the MSF offset correction */ #define cue_parser_copy_relative_msf_to_lba( msf_string, lba ) \ lba = ( ( msf_string[ 0 ] - '0' ) * 10 ) + ( msf_string[ 1 ] - '0' ); \ lba *= CD_SECS; \ lba += ( ( msf_string[ 3 ] - '0' ) * 10 ) + ( msf_string[ 4 ] - '0' ); \ lba *= CD_FRAMES; \ lba += ( ( msf_string[ 6 ] - '0' ) * 10 ) + ( msf_string[ 7 ] - '0' ); # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ #ifndef YY_CUE_SCANNER_LIBODRAW_CUE_PARSER_H_INCLUDED # define YY_CUE_SCANNER_LIBODRAW_CUE_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int cue_scanner_debug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { CUE_END_OF_LINE = 258, CUE_SEMI_COLON = 259, CUE_2DIGIT = 260, CUE_CATALOG_NUMBER = 261, CUE_ISRC_CODE = 262, CUE_KEYWORD_STRING = 263, CUE_MSF = 264, CUE_STRING = 265, CUE_CATALOG = 266, CUE_CDTEXTFILE = 267, CUE_FLAGS = 268, CUE_FILE = 269, CUE_INDEX = 270, CUE_ISRC = 271, CUE_POSTGAP = 272, CUE_PREGAP = 273, CUE_REMARK = 274, CUE_TRACK = 275, CUE_CDTEXT_ARRANGER = 276, CUE_CDTEXT_COMPOSER = 277, CUE_CDTEXT_DISC_ID = 278, CUE_CDTEXT_GENRE = 279, CUE_CDTEXT_MESSAGE = 280, CUE_CDTEXT_PERFORMER = 281, CUE_CDTEXT_SIZE_INFO = 282, CUE_CDTEXT_SONGWRITER = 283, CUE_CDTEXT_TITLE = 284, CUE_CDTEXT_TOC_INFO1 = 285, CUE_CDTEXT_TOC_INFO2 = 286, CUE_CDTEXT_UPC_EAN = 287, CUE_REMARK_LEAD_OUT = 288, CUE_REMARK_ORIGINAL_MEDIA_TYPE = 289, CUE_REMARK_RUN_OUT = 290, CUE_REMARK_SESSION = 291 }; #endif /* Tokens. */ #define CUE_END_OF_LINE 258 #define CUE_SEMI_COLON 259 #define CUE_2DIGIT 260 #define CUE_CATALOG_NUMBER 261 #define CUE_ISRC_CODE 262 #define CUE_KEYWORD_STRING 263 #define CUE_MSF 264 #define CUE_STRING 265 #define CUE_CATALOG 266 #define CUE_CDTEXTFILE 267 #define CUE_FLAGS 268 #define CUE_FILE 269 #define CUE_INDEX 270 #define CUE_ISRC 271 #define CUE_POSTGAP 272 #define CUE_PREGAP 273 #define CUE_REMARK 274 #define CUE_TRACK 275 #define CUE_CDTEXT_ARRANGER 276 #define CUE_CDTEXT_COMPOSER 277 #define CUE_CDTEXT_DISC_ID 278 #define CUE_CDTEXT_GENRE 279 #define CUE_CDTEXT_MESSAGE 280 #define CUE_CDTEXT_PERFORMER 281 #define CUE_CDTEXT_SIZE_INFO 282 #define CUE_CDTEXT_SONGWRITER 283 #define CUE_CDTEXT_TITLE 284 #define CUE_CDTEXT_TOC_INFO1 285 #define CUE_CDTEXT_TOC_INFO2 286 #define CUE_CDTEXT_UPC_EAN 287 #define CUE_REMARK_LEAD_OUT 288 #define CUE_REMARK_ORIGINAL_MEDIA_TYPE 289 #define CUE_REMARK_RUN_OUT 290 #define CUE_REMARK_SESSION 291 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { /* The numeric value */ uint32_t numeric_value; /* The string value */ struct cue_string_value { /* The string data */ const char *data; /* The string length */ size_t length; } string_value; }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE cue_scanner_lval; int cue_scanner_parse (void *parser_state); #endif /* !YY_CUE_SCANNER_LIBODRAW_CUE_PARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ typedef struct cue_parser_state cue_parser_state_t; struct cue_parser_state { /* The file */ libodraw_handle_t *handle; /* The error */ libcerror_error_t **error; /* The previous file index */ int previous_file_index; /* The current file index */ int current_file_index; /* The file type */ uint8_t file_type; /* Value to indicate a new file command was issued */ uint8_t new_file; /* The previous file sector */ uint64_t previous_file_sector; /* The file sector */ uint64_t file_sector; /* The previous session start sector */ uint64_t previous_session_start_sector; /* The previous lead-out start sector */ uint64_t previous_lead_out_start_sector; /* The previous track start sector */ uint64_t previous_track_start_sector; /* The current start sector */ uint64_t current_start_sector; /* The session number of sectors */ uint64_t session_number_of_sectors; /* The lead-out number of sectors */ uint64_t lead_out_number_of_sectors; /* The track number of sectors */ uint64_t track_number_of_sectors; /* The previous track type */ uint8_t previous_track_type; /* The current track type */ uint8_t current_track_type; /* The previous session */ int previous_session; /* The current session */ int current_session; /* The previous lead-out */ int previous_lead_out; /* The current lead-out */ int current_lead_out; /* The previous track */ int previous_track; /* The current track */ int current_track; /* The previous index */ int previous_index; /* The current index */ int current_index; }; typedef size_t yy_size_t; typedef struct yy_buffer_state* YY_BUFFER_STATE; extern \ int cue_scanner_suppress_error; extern \ int cue_scanner_lex_destroy( void ); extern \ void *cue_scanner_alloc( yy_size_t size ); extern \ void *cue_scanner_realloc( void *buffer, yy_size_t size ); extern \ void cue_scanner_free( void *buffer ); extern \ int cue_scanner_lex( void *user_data ); extern \ void cue_scanner_error( void *parser_state, const char *error_string ); extern \ YY_BUFFER_STATE cue_scanner__scan_buffer( char *buffer, yy_size_t buffer_size ); extern \ void cue_scanner__delete_buffer( YY_BUFFER_STATE buffer_state ); extern \ size_t cue_scanner_buffer_offset; static char *cue_parser_function = "cue_parser"; int cue_parser_parse_buffer( libodraw_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 42 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 178 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 37 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ #define YYNRULES 72 /* YYNSTATES -- Number of states. */ #define YYNSTATES 114 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 291 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 318, 318, 321, 323, 327, 328, 329, 330, 331, 334, 336, 340, 343, 345, 349, 350, 351, 354, 356, 360, 361, 362, 363, 364, 365, 368, 370, 374, 375, 376, 379, 381, 385, 386, 387, 388, 392, 400, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 424, 432, 530, 537, 539, 543, 792, 800, 808, 816, 817, 818, 819, 820, 824, 890, 898, 908, 918, 983, 1049, 1238 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "CUE_END_OF_LINE", "CUE_SEMI_COLON", "CUE_2DIGIT", "CUE_CATALOG_NUMBER", "CUE_ISRC_CODE", "CUE_KEYWORD_STRING", "CUE_MSF", "CUE_STRING", "CUE_CATALOG", "CUE_CDTEXTFILE", "CUE_FLAGS", "CUE_FILE", "CUE_INDEX", "CUE_ISRC", "CUE_POSTGAP", "CUE_PREGAP", "CUE_REMARK", "CUE_TRACK", "CUE_CDTEXT_ARRANGER", "CUE_CDTEXT_COMPOSER", "CUE_CDTEXT_DISC_ID", "CUE_CDTEXT_GENRE", "CUE_CDTEXT_MESSAGE", "CUE_CDTEXT_PERFORMER", "CUE_CDTEXT_SIZE_INFO", "CUE_CDTEXT_SONGWRITER", "CUE_CDTEXT_TITLE", "CUE_CDTEXT_TOC_INFO1", "CUE_CDTEXT_TOC_INFO2", "CUE_CDTEXT_UPC_EAN", "CUE_REMARK_LEAD_OUT", "CUE_REMARK_ORIGINAL_MEDIA_TYPE", "CUE_REMARK_RUN_OUT", "CUE_REMARK_SESSION", "$accept", "cue_main", "cue_main_items", "cue_main_item", "cue_main_tracks", "cue_main_track", "cue_main_track_preceding_items", "cue_main_track_preceding_item", "cue_main_track_leading_items", "cue_main_track_leading_item", "cue_main_track_index_items", "cue_main_track_index_item", "cue_main_track_trailing_items", "cue_main_track_trailing_item", "cue_catalog", "cue_cdtext", "cue_cdtext_type", "cue_cdtextfile", "cue_file", "cue_flags", "cue_flags_types", "cue_index", "cue_isrc", "cue_postgap", "cue_pregap", "cue_remark_item", "cue_lead_out", "cue_original_media_type", "cue_remark", "cue_remark_start", "cue_run_out", "cue_session", "cue_track", "cue_empty_line", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291 }; # endif #define YYPACT_NINF -68 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-68))) #define YYTABLE_NINF -14 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 70, -68, -5, -6, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, 2, 4, 6, 11, 18, 5, 70, -68, -68, 16, -68, -68, -68, -68, -68, 27, -68, -68, -68, 28, 29, 30, 37, 38, 39, -68, 20, 70, -68, 44, 47, -68, -68, -68, -68, -68, -68, 45, 138, -68, -68, 53, -68, 138, 54, 142, -68, -68, -68, -68, -68, 71, 36, -68, 67, 69, 72, 74, 10, 36, -68, -68, -68, -68, -68, -68, 75, 69, 77, 81, 82, 83, 104, 10, -68, -68, -68, -68, -68, -68, -68, -68, -68, 78, 99, -68, 104, -68, -68, -68, -68, -68, 87, 106, -68, -68, -68 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 3, 72, 0, 0, 68, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 0, 0, 0, 0, 0, 3, 5, 7, 0, 6, 8, 60, 61, 62, 0, 63, 64, 9, 0, 0, 0, 0, 0, 0, 1, 0, 3, 4, 0, 0, 37, 51, 65, 66, 69, 70, 0, 10, 38, 67, 0, 2, 10, 0, 13, 15, 16, 17, 52, 11, 0, 18, 14, 0, 54, 0, 0, 26, 18, 20, 21, 22, 23, 24, 25, 0, 54, 0, 0, 0, 0, 31, 26, 28, 29, 30, 19, 71, 55, 53, 57, 59, 0, 0, 12, 31, 33, 34, 35, 36, 27, 0, 0, 32, 56, 58 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -68, -68, -17, -68, 26, -68, 48, -68, 35, -68, 22, -68, 12, -68, -68, -67, -68, -68, 91, -68, 32, -68, -68, -68, -68, -55, -68, -68, -68, -68, -68, -68, -68, -52 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 21, 22, 23, 59, 60, 61, 62, 75, 76, 89, 90, 102, 103, 24, 25, 26, 27, 63, 78, 85, 91, 79, 105, 80, 28, 29, 30, 31, 32, 33, 34, 69, 35 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 64, 36, 77, 65, 37, 64, 45, 64, 65, 77, 65, 38, 39, 1, 81, 40, 41, 82, 42, 43, 92, 81, 104, 93, 82, 88, 46, 55, 47, 4, 54, 48, 49, 50, 106, 92, 104, 107, 93, 1, 51, 52, 53, 17, 18, 19, 20, 56, 106, 72, 57, 107, 73, 58, 74, 4, 66, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 68, 83, 71, 84, 95, 86, 97, 2, 3, 87, 98, 99, 67, 109, 100, 4, 112, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 110, 113, 70, 94, 108, 44, 0, 111, 96, 0, 0, 0, 0, 101, 0, 4, 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 43, 4, -13, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 17, 18, 19, 20 }; static const yytype_int8 yycheck[] = { 55, 6, 69, 55, 10, 60, 23, 62, 60, 76, 62, 9, 8, 3, 69, 9, 5, 69, 0, 14, 75, 76, 89, 75, 76, 15, 10, 44, 1, 19, 10, 3, 3, 3, 89, 90, 103, 89, 90, 3, 3, 3, 3, 33, 34, 35, 36, 3, 103, 13, 3, 103, 16, 8, 18, 19, 3, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 3, 20, 8, 5, 8, 3, 7, 3, 11, 12, 9, 3, 3, 60, 9, 5, 19, 3, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 3, 9, 3, 62, 76, 90, 22, -1, 103, 84, -1, -1, -1, -1, 17, -1, 19, -1, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 3, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, 14, 19, 20, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, 33, 34, 35, 36 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 11, 12, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 51, 52, 53, 54, 62, 63, 64, 65, 66, 67, 68, 70, 6, 10, 9, 8, 9, 5, 0, 14, 55, 39, 10, 1, 3, 3, 3, 3, 3, 3, 10, 39, 3, 3, 8, 41, 42, 43, 44, 55, 62, 70, 3, 41, 20, 69, 43, 5, 13, 16, 18, 45, 46, 52, 56, 59, 61, 62, 70, 8, 8, 57, 7, 9, 15, 47, 48, 58, 62, 70, 45, 3, 57, 3, 3, 3, 5, 17, 49, 50, 52, 60, 62, 70, 47, 9, 9, 49, 3, 3 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 37, 38, 39, 39, 40, 40, 40, 40, 40, 41, 41, 42, 43, 43, 44, 44, 44, 45, 45, 46, 46, 46, 46, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 50, 51, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 55, 56, 57, 57, 58, 59, 60, 61, 62, 62, 62, 62, 62, 63, 64, 65, 66, 67, 68, 69, 70 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 4, 0, 2, 1, 1, 1, 1, 1, 0, 2, 5, 0, 2, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 0, 2, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 3, 0, 2, 4, 3, 3, 3, 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, 4, 1 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (parser_state, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, parser_state); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *parser_state) { FILE *yyo = yyoutput; YYUSE (yyo); YYUSE (parser_state); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *parser_state) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep, parser_state); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void *parser_state) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) , parser_state); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule, parser_state); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *parser_state) { YYUSE (yyvaluep); YYUSE (parser_state); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void *parser_state) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (NULL); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 37: { cue_parser_rule_print( "cue_catalog" ); } break; case 38: { cue_parser_rule_print( "cue_cdtext" ); } break; case 51: { cue_parser_rule_print( "cue_cdtextfile" ); } break; case 52: { cue_parser_rule_print( "cue_file" ); if( (yyvsp[-2].string_value).data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", cue_parser_function ); YYABORT; } /* TODO what about the string quotation marks */ if( (yyvsp[-1].string_value).data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file type.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_UNKNOWN; if( (yyvsp[-1].string_value).length == 3 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "MP3", 3 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_AUDIO_MPEG1_LAYER3; } } else if( (yyvsp[-1].string_value).length == 4 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "AIFF", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_AUDIO_AIFF; } else if( narrow_string_compare( (yyvsp[-1].string_value).data, "WAVE", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_AUDIO_WAVE; } } else if( (yyvsp[-1].string_value).length == 6 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "BINARY", 6 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_BINARY_LITTLE_ENDIAN; } } else if( (yyvsp[-1].string_value).length == 8 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "MOTOROLA", 8 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_BINARY_BIG_ENDIAN; } } if( libodraw_handle_append_data_file( ( (cue_parser_state_t *) parser_state )->handle, (yyvsp[-2].string_value).data, (yyvsp[-2].string_value).length, ( (cue_parser_state_t *) parser_state )->file_type, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data file.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_file_index += 1; } break; case 53: { cue_parser_rule_print( "cue_flags" ); } break; case 56: { cue_parser_rule_print( "cue_index" ); if( (yyvsp[-2].string_value).data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_index = ( (cue_parser_state_t *) parser_state )->current_index; if( ( ( (yyvsp[-2].string_value).data )[ 0 ] < '0' ) || ( ( (yyvsp[-2].string_value).data )[ 0 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_index = ( (yyvsp[-2].string_value).data )[ 0 ] - '0'; if( (yyvsp[-2].string_value).length == 2 ) { ( (cue_parser_state_t *) parser_state )->current_index *= 10; if( ( ( (yyvsp[-2].string_value).data )[ 1 ] < '0' ) || ( ( (yyvsp[-2].string_value).data )[ 1 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_index += ( (yyvsp[-2].string_value).data )[ 1 ] - '0'; } if( ( ( (cue_parser_state_t *) parser_state )->current_index != 0 ) && ( ( (cue_parser_state_t *) parser_state )->current_index != ( ( (cue_parser_state_t *) parser_state )->previous_index + 1 ) ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index number - values are not sequential.", cue_parser_function ); YYABORT; } if( ( (yyvsp[-1].string_value).data == NULL ) || ( (yyvsp[-1].string_value).length != 8 ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index MSF.", cue_parser_function ); YYABORT; } if( ( ( (yyvsp[-1].string_value).data )[ 0 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 0 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 2 ] != ':' ) || ( ( (yyvsp[-1].string_value).data )[ 3 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 3 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 4 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 4 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 5 ] != ':' ) || ( ( (yyvsp[-1].string_value).data )[ 6 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 6 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 7 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 7 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index MSF.", cue_parser_function ); YYABORT; } cue_parser_copy_relative_msf_to_lba( (yyvsp[-1].string_value).data, ( (cue_parser_state_t *) parser_state )->current_start_sector ); /* The MSF can be relative to the start of the file */ if( ( (cue_parser_state_t *) parser_state )->current_start_sector != 0 ) { if( ( ( (cue_parser_state_t *) parser_state )->current_index == 0 ) || ( ( (cue_parser_state_t *) parser_state )->current_index == 1 ) ) { if( ( ( (cue_parser_state_t *) parser_state )->session_number_of_sectors == 0 ) || ( ( (cue_parser_state_t *) parser_state )->previous_track_type == LIBODRAW_TRACK_TYPE_AUDIO ) ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_session_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid session start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->session_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_session_start_sector; } if( ( ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors == 0 ) || ( ( (cue_parser_state_t *) parser_state )->previous_track_type == LIBODRAW_TRACK_TYPE_AUDIO ) ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid lead-out start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector; } } if( ( (cue_parser_state_t *) parser_state )->current_index == 1 ) { if( ( (cue_parser_state_t *) parser_state )->track_number_of_sectors == 0 ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_track_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; } } } if( ( (cue_parser_state_t *) parser_state )->current_index == 1 ) { if( ( (cue_parser_state_t *) parser_state )->current_session > 1 ) { if( libodraw_handle_append_session( ( (cue_parser_state_t *) parser_state )->handle, ( (cue_parser_state_t *) parser_state )->previous_session_start_sector, ( (cue_parser_state_t *) parser_state )->session_number_of_sectors, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_session_start_sector = ( (cue_parser_state_t *) parser_state )->current_start_sector; ( (cue_parser_state_t *) parser_state )->session_number_of_sectors = 0; } if( ( (cue_parser_state_t *) parser_state )->current_lead_out > ( (cue_parser_state_t *) parser_state )->previous_lead_out ) { if( libodraw_handle_append_lead_out( ( (cue_parser_state_t *) parser_state )->handle, ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector, ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead-out.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_lead_out = ( (cue_parser_state_t *) parser_state )->current_lead_out; ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors = 0; } if( ( (cue_parser_state_t *) parser_state )->current_track > 1 ) { if( ( (cue_parser_state_t *) parser_state )->previous_file_index < 0 ) { ( (cue_parser_state_t *) parser_state )->file_sector = ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; ( (cue_parser_state_t *) parser_state )->previous_file_index += 1; } ( (cue_parser_state_t *) parser_state )->previous_file_sector = ( (cue_parser_state_t *) parser_state )->previous_track_start_sector - ( (cue_parser_state_t *) parser_state )->file_sector; if( libodraw_handle_append_track( ( (cue_parser_state_t *) parser_state )->handle, ( (cue_parser_state_t *) parser_state )->previous_track_start_sector, ( (cue_parser_state_t *) parser_state )->track_number_of_sectors, ( (cue_parser_state_t *) parser_state )->previous_track_type, ( (cue_parser_state_t *) parser_state )->previous_file_index, ( (cue_parser_state_t *) parser_state )->previous_file_sector, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track.", cue_parser_function ); YYABORT; } if( ( (cue_parser_state_t *) parser_state )->previous_file_index < ( (cue_parser_state_t *) parser_state )->current_file_index ) { ( (cue_parser_state_t *) parser_state )->file_sector = ( (cue_parser_state_t *) parser_state )->current_start_sector; ( (cue_parser_state_t *) parser_state )->previous_file_index += 1; } ( (cue_parser_state_t *) parser_state )->previous_track_start_sector = ( (cue_parser_state_t *) parser_state )->current_start_sector; ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = 0; } } } break; case 57: { cue_parser_rule_print( "cue_isrc" ); } break; case 58: { cue_parser_rule_print( "cue_postgap" ); } break; case 59: { cue_parser_rule_print( "cue_pregap" ); } break; case 65: { cue_parser_rule_print( "cue_lead_out" ); if( ( (yyvsp[-1].string_value).data == NULL ) || ( (yyvsp[-1].string_value).length != 8 ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index MSF.", cue_parser_function ); YYABORT; } if( ( ( (yyvsp[-1].string_value).data )[ 0 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 0 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 2 ] != ':' ) || ( ( (yyvsp[-1].string_value).data )[ 3 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 3 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 4 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 4 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 5 ] != ':' ) || ( ( (yyvsp[-1].string_value).data )[ 6 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 6 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 7 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 7 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index MSF.", cue_parser_function ); YYABORT; } cue_parser_copy_relative_msf_to_lba( (yyvsp[-1].string_value).data, ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector ); if( ( (cue_parser_state_t *) parser_state )->track_number_of_sectors == 0 ) { if( ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector < ( (cue_parser_state_t *) parser_state )->previous_track_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid lead-out start sector value preceeds previous track start sector.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector - ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; } ( (cue_parser_state_t *) parser_state )->current_lead_out += 1; } break; case 66: { cue_parser_rule_print( "cue_original_media_type" ); } break; case 67: { cue_parser_rule_print( "cue_remark" ); cue_scanner_suppress_error = 0; } break; case 68: { /* The build-in rule error will gobble up all the tokens until the end-of-line * because these are no syntax errors suppress the error output */ cue_scanner_suppress_error = 1; } break; case 69: { cue_parser_rule_print( "cue_run_out" ); if( ( (yyvsp[-1].string_value).data == NULL ) || ( (yyvsp[-1].string_value).length != 8 ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index MSF.", cue_parser_function ); YYABORT; } if( ( ( (yyvsp[-1].string_value).data )[ 0 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 0 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 2 ] != ':' ) || ( ( (yyvsp[-1].string_value).data )[ 3 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 3 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 4 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 4 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 5 ] != ':' ) || ( ( (yyvsp[-1].string_value).data )[ 6 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 6 ] > '9' ) || ( ( (yyvsp[-1].string_value).data )[ 7 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 7 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index MSF.", cue_parser_function ); YYABORT; } cue_parser_copy_relative_msf_to_lba( (yyvsp[-1].string_value).data, ( (cue_parser_state_t *) parser_state )->current_start_sector ); if( ( (cue_parser_state_t *) parser_state )->track_number_of_sectors == 0 ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_track_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; } } break; case 70: { cue_parser_rule_print( "cue_session" ); if( (yyvsp[-1].string_value).data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid session number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_session = ( (cue_parser_state_t *) parser_state )->current_session; if( ( ( (yyvsp[-1].string_value).data )[ 0 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 0 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported session number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_session = ( (yyvsp[-1].string_value).data )[ 0 ] - '0'; if( (yyvsp[-1].string_value).length == 2 ) { ( (cue_parser_state_t *) parser_state )->current_session *= 10; if( ( ( (yyvsp[-1].string_value).data )[ 1 ] < '0' ) || ( ( (yyvsp[-1].string_value).data )[ 1 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported session number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_session += ( (yyvsp[-1].string_value).data )[ 1 ] - '0'; } if( ( ( (cue_parser_state_t *) parser_state )->current_session != 0 ) && ( ( (cue_parser_state_t *) parser_state )->current_session != ( ( (cue_parser_state_t *) parser_state )->previous_session + 1 ) ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported session number - values are not sequential.", cue_parser_function ); YYABORT; } } break; case 71: { cue_parser_rule_print( "cue_track" ); if( (yyvsp[-2].string_value).data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_track = ( (cue_parser_state_t *) parser_state )->current_track; if( ( ( (yyvsp[-2].string_value).data )[ 0 ] < '0' ) || ( ( (yyvsp[-2].string_value).data )[ 0 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_track = ( (yyvsp[-2].string_value).data )[ 0 ] - '0'; if( (yyvsp[-2].string_value).length == 2 ) { ( (cue_parser_state_t *) parser_state )->current_track *= 10; if( ( ( (yyvsp[-2].string_value).data )[ 1 ] < '0' ) || ( ( (yyvsp[-2].string_value).data )[ 1 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_track += ( (yyvsp[-2].string_value).data )[ 1 ] - '0'; } if( ( ( (cue_parser_state_t *) parser_state )->current_track != 0 ) && ( ( (cue_parser_state_t *) parser_state )->current_track != ( ( (cue_parser_state_t *) parser_state )->previous_track + 1 ) ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track number - values are not sequential.", cue_parser_function ); YYABORT; } if( (yyvsp[-1].string_value).data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_track_type = ( (cue_parser_state_t *) parser_state )->current_track_type; ( (cue_parser_state_t *) parser_state )->previous_index = 0; ( (cue_parser_state_t *) parser_state )->current_index = 0; ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_UNKNOWN; if( (yyvsp[-1].string_value).length == 3 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "CDG", 3 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_CDG; } } else if( (yyvsp[-1].string_value).length == 5 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "AUDIO", 5 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_AUDIO; } } else if( (yyvsp[-1].string_value).length == 8 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "CDI", 3 ) == 0 ) { if( ( (yyvsp[-1].string_value).data )[ 3 ] == '/' ) { if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 4 ] ), "2336", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_CDI_2336; } else if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 4 ] ), "2352", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_CDI_2352; } } } } else if( (yyvsp[-1].string_value).length == 10 ) { if( narrow_string_compare( (yyvsp[-1].string_value).data, "MODE", 4 ) == 0 ) { if( ( (yyvsp[-1].string_value).data )[ 5 ] == '/' ) { if( ( (yyvsp[-1].string_value).data )[ 4 ] == '1' ) { if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 6 ] ), "2048", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE1_2048; } else if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 6 ] ), "2352", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE1_2352; } } else if( ( (yyvsp[-1].string_value).data )[ 4 ] == '2' ) { if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 6 ] ), "2048", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2048; } else if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 6 ] ), "2324", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2324; } else if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 6 ] ), "2336", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2336; } else if( narrow_string_compare( &( ( (yyvsp[-1].string_value).data )[ 6 ] ), "2352", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2352; } } } } } } break; default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (parser_state, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (parser_state, yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, parser_state); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp, parser_state); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (parser_state, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, parser_state); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, parser_state); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } int cue_parser_parse_buffer( libodraw_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { cue_parser_state_t parser_state; YY_BUFFER_STATE buffer_state = NULL; size_t buffer_offset = 0; int result = -1; if( buffer_size >= 3 ) { if( ( buffer[ 0 ] == 0x0ef ) && ( buffer[ 1 ] == 0x0bb ) && ( buffer[ 2 ] == 0x0bf ) ) { buffer_offset = 3; } } buffer_state = cue_scanner__scan_buffer( (char *) &( buffer[ buffer_offset ] ), buffer_size - buffer_offset ); cue_scanner_buffer_offset = (size_t) buffer_offset; if( buffer_state != NULL ) { parser_state.handle = handle; parser_state.error = error; parser_state.previous_file_index = -1; parser_state.current_file_index = -1; parser_state.file_type = 0; parser_state.previous_file_sector = 0; parser_state.file_sector = 0; parser_state.previous_session_start_sector = 0; parser_state.previous_lead_out_start_sector = 0; parser_state.previous_track_start_sector = 0; parser_state.current_start_sector = 0; parser_state.session_number_of_sectors = 0; parser_state.lead_out_number_of_sectors = 0; parser_state.track_number_of_sectors = 0; parser_state.previous_track_type = 0; parser_state.current_track_type = 0; parser_state.previous_session = 0; parser_state.current_session = 0; parser_state.previous_lead_out = 0; parser_state.current_lead_out = 0; parser_state.previous_track = 0; parser_state.current_track = 0; parser_state.previous_index = 0; parser_state.current_index = 0; if( cue_scanner_parse( &parser_state ) == 0 ) { result = 1; } cue_scanner__delete_buffer( buffer_state ); if( parser_state.current_session > 0 ) { if( libodraw_handle_append_session( parser_state.handle, parser_state.previous_session_start_sector, 0, parser_state.error ) != 1 ) { libcerror_error_set( parser_state.error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session.", cue_parser_function ); result = -1; } } if( parser_state.current_lead_out > parser_state.previous_lead_out ) { if( libodraw_handle_append_lead_out( parser_state.handle, parser_state.previous_lead_out_start_sector, 0, parser_state.error ) != 1 ) { libcerror_error_set( parser_state.error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead-out.", cue_parser_function ); result = -1; } } if( parser_state.current_track > 0 ) { if( parser_state.previous_file_index < 0 ) { parser_state.file_sector = parser_state.previous_track_start_sector; parser_state.previous_file_index += 1; } parser_state.previous_file_sector = parser_state.previous_track_start_sector - parser_state.file_sector; if( libodraw_handle_append_track( parser_state.handle, parser_state.previous_track_start_sector, 0, parser_state.current_track_type, parser_state.current_file_index, parser_state.previous_file_sector, parser_state.error ) != 1 ) { libcerror_error_set( parser_state.error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track.", cue_parser_function ); result = -1; } } } cue_scanner_lex_destroy(); return( result ); } libewf-20140807/libodraw/libodraw_sector_range.h0000664000175000017500000000361013443450062023644 0ustar00lordyestalordyesta00000000000000/* * Sector range functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_SECTOR_RANGE_H ) #define _LIBODRAW_SECTOR_RANGE_H #include #include #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libodraw_sector_range libodraw_sector_range_t; struct libodraw_sector_range { /* The start sector */ uint64_t start_sector; /* The end sector */ uint64_t end_sector; /* The number of sectors */ uint64_t number_of_sectors; }; int libodraw_sector_range_initialize( libodraw_sector_range_t **sector_range, libcerror_error_t **error ); int libodraw_sector_range_free( libodraw_sector_range_t **sector_range, libcerror_error_t **error ); int libodraw_sector_range_get( libodraw_sector_range_t *sector_range, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); int libodraw_sector_range_set( libodraw_sector_range_t *sector_range, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_SECTOR_RANGE_H ) */ libewf-20140807/libodraw/libodraw_libcdata.h0000664000175000017500000000301613443450062022734 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBCDATA_H ) #define _LIBODRAW_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBODRAW_LIBCDATA_H ) */ libewf-20140807/libodraw/libodraw_extern.h0000664000175000017500000000240613443450062022500 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2019, 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( _LIBODRAW_INTERNAL_EXTERN_H ) #define _LIBODRAW_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBODRAW for local use of libodraw */ #if !defined( HAVE_LOCAL_LIBODRAW ) #include #define LIBODRAW_EXTERN_VARIABLE LIBODRAW_EXTERN #else #define LIBODRAW_EXTERN /* extern */ #define LIBODRAW_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ #endif /* !defined( _LIBODRAW_INTERNAL_EXTERN_H ) */ libewf-20140807/libodraw/libodraw_cue_parser.y0000664000175000017500000010777313443450062023361 0ustar00lordyestalordyesta00000000000000%{ /* * CUE parser functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libodraw_definitions.h" #include "libodraw_handle.h" #include "libodraw_libcerror.h" #include "libodraw_libcnotify.h" #include "libodraw_types.h" #define YYMALLOC cue_scanner_alloc #define YYREALLOC cue_scanner_realloc #define YYFREE cue_scanner_free #define YYLEX_PARAM NULL #define YYPARSE_PARAM parser_state #if defined( HAVE_DEBUG_OUTPUT ) #define cue_parser_rule_print( string ) \ if( libcnotify_verbose != 0 ) libcnotify_printf( "cue_parser: rule: %s\n", string ) #else #define cue_parser_rule_print( string ) #endif #if !defined( CD_SECS ) /* seconds per minute */ #define CD_SECS 60 #endif #if !defined( CD_FRAMES ) /* frames per second */ #define CD_FRAMES 75 #endif /* Note that the MSF are relative, so there is no need for the MSF offset correction */ #define cue_parser_copy_relative_msf_to_lba( msf_string, lba ) \ lba = ( ( msf_string[ 0 ] - '0' ) * 10 ) + ( msf_string[ 1 ] - '0' ); \ lba *= CD_SECS; \ lba += ( ( msf_string[ 3 ] - '0' ) * 10 ) + ( msf_string[ 4 ] - '0' ); \ lba *= CD_FRAMES; \ lba += ( ( msf_string[ 6 ] - '0' ) * 10 ) + ( msf_string[ 7 ] - '0' ); %} /* %name-prefix="cue_scanner_" replaced by -p cue_scanner_ */ /* %no-lines replaced by -l */ %lex-param { (void *) NULL } %parse-param { void *parser_state } %start cue_main %union { /* The numeric value */ uint32_t numeric_value; /* The string value */ struct cue_string_value { /* The string data */ const char *data; /* The string length */ size_t length; } string_value; } %{ typedef struct cue_parser_state cue_parser_state_t; struct cue_parser_state { /* The file */ libodraw_handle_t *handle; /* The error */ libcerror_error_t **error; /* The previous file index */ int previous_file_index; /* The current file index */ int current_file_index; /* The file type */ uint8_t file_type; /* Value to indicate a new file command was issued */ uint8_t new_file; /* The previous file sector */ uint64_t previous_file_sector; /* The file sector */ uint64_t file_sector; /* The previous session start sector */ uint64_t previous_session_start_sector; /* The previous lead-out start sector */ uint64_t previous_lead_out_start_sector; /* The previous track start sector */ uint64_t previous_track_start_sector; /* The current start sector */ uint64_t current_start_sector; /* The session number of sectors */ uint64_t session_number_of_sectors; /* The lead-out number of sectors */ uint64_t lead_out_number_of_sectors; /* The track number of sectors */ uint64_t track_number_of_sectors; /* The previous track type */ uint8_t previous_track_type; /* The current track type */ uint8_t current_track_type; /* The previous session */ int previous_session; /* The current session */ int current_session; /* The previous lead-out */ int previous_lead_out; /* The current lead-out */ int current_lead_out; /* The previous track */ int previous_track; /* The current track */ int current_track; /* The previous index */ int previous_index; /* The current index */ int current_index; }; typedef size_t yy_size_t; typedef struct yy_buffer_state* YY_BUFFER_STATE; extern \ int cue_scanner_suppress_error; extern \ int cue_scanner_lex_destroy( void ); extern \ void *cue_scanner_alloc( yy_size_t size ); extern \ void *cue_scanner_realloc( void *buffer, yy_size_t size ); extern \ void cue_scanner_free( void *buffer ); extern \ int cue_scanner_lex( void *user_data ); extern \ void cue_scanner_error( void *parser_state, const char *error_string ); extern \ YY_BUFFER_STATE cue_scanner__scan_buffer( char *buffer, yy_size_t buffer_size ); extern \ void cue_scanner__delete_buffer( YY_BUFFER_STATE buffer_state ); extern \ size_t cue_scanner_buffer_offset; static char *cue_parser_function = "cue_parser"; int cue_parser_parse_buffer( libodraw_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); %} /* Associativity rules */ /* Token definitions */ %token CUE_END_OF_LINE %token CUE_SEMI_COLON %token CUE_2DIGIT %token CUE_CATALOG_NUMBER %token CUE_ISRC_CODE %token CUE_KEYWORD_STRING %token CUE_MSF %token CUE_STRING /* Reserved words */ %token CUE_CATALOG %token CUE_CDTEXTFILE %token CUE_FLAGS %token CUE_FILE %token CUE_INDEX %token CUE_ISRC %token CUE_POSTGAP %token CUE_PREGAP %token CUE_REMARK %token CUE_TRACK /* CD-text reserved words */ %token CUE_CDTEXT_ARRANGER %token CUE_CDTEXT_COMPOSER %token CUE_CDTEXT_DISC_ID %token CUE_CDTEXT_GENRE %token CUE_CDTEXT_MESSAGE %token CUE_CDTEXT_PERFORMER %token CUE_CDTEXT_SIZE_INFO %token CUE_CDTEXT_SONGWRITER %token CUE_CDTEXT_TITLE %token CUE_CDTEXT_TOC_INFO1 %token CUE_CDTEXT_TOC_INFO2 %token CUE_CDTEXT_UPC_EAN /* Remark reserved words */ %token CUE_REMARK_LEAD_OUT %token CUE_REMARK_ORIGINAL_MEDIA_TYPE %token CUE_REMARK_RUN_OUT %token CUE_REMARK_SESSION %% /* Parser rules */ cue_main : cue_main_items cue_file cue_main_items cue_main_tracks ; cue_main_items : /* empty */ | cue_main_item cue_main_items ; cue_main_item : cue_catalog | cue_cdtextfile | cue_cdtext | cue_remark_item | cue_empty_line ; cue_main_tracks : /* empty */ | cue_main_track cue_main_tracks ; cue_main_track : cue_main_track_preceding_items cue_track cue_main_track_leading_items cue_main_track_index_items cue_main_track_trailing_items ; cue_main_track_preceding_items : /* empty */ | cue_main_track_preceding_item cue_main_track_preceding_items ; cue_main_track_preceding_item : cue_file | cue_remark_item | cue_empty_line ; cue_main_track_leading_items : /* empty */ | cue_main_track_leading_item cue_main_track_leading_items ; cue_main_track_leading_item : cue_cdtext | cue_flags | cue_isrc | cue_pregap | cue_remark_item | cue_empty_line ; cue_main_track_index_items : /* empty */ | cue_main_track_index_item cue_main_track_index_items ; cue_main_track_index_item : cue_index | cue_remark_item | cue_empty_line ; cue_main_track_trailing_items : /* empty */ | cue_main_track_trailing_item cue_main_track_trailing_items ; cue_main_track_trailing_item : cue_cdtext | cue_postgap | cue_remark_item | cue_empty_line ; cue_catalog : CUE_CATALOG CUE_CATALOG_NUMBER CUE_END_OF_LINE { cue_parser_rule_print( "cue_catalog" ); } ; cue_cdtext : cue_cdtext_type CUE_STRING CUE_END_OF_LINE { cue_parser_rule_print( "cue_cdtext" ); } ; cue_cdtext_type : CUE_CDTEXT_ARRANGER | CUE_CDTEXT_COMPOSER | CUE_CDTEXT_DISC_ID | CUE_CDTEXT_GENRE | CUE_CDTEXT_MESSAGE | CUE_CDTEXT_PERFORMER | CUE_CDTEXT_SIZE_INFO | CUE_CDTEXT_SONGWRITER | CUE_CDTEXT_TITLE | CUE_CDTEXT_TOC_INFO1 | CUE_CDTEXT_TOC_INFO2 | CUE_CDTEXT_UPC_EAN /* TODO IRSC definition */ ; cue_cdtextfile : CUE_CDTEXTFILE CUE_STRING CUE_END_OF_LINE { cue_parser_rule_print( "cue_cdtextfile" ); } ; cue_file : CUE_FILE CUE_STRING CUE_KEYWORD_STRING CUE_END_OF_LINE { cue_parser_rule_print( "cue_file" ); if( $2.data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", cue_parser_function ); YYABORT; } /* TODO what about the string quotation marks */ if( $3.data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file type.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_UNKNOWN; if( $3.length == 3 ) { if( narrow_string_compare( $3.data, "MP3", 3 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_AUDIO_MPEG1_LAYER3; } } else if( $3.length == 4 ) { if( narrow_string_compare( $3.data, "AIFF", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_AUDIO_AIFF; } else if( narrow_string_compare( $3.data, "WAVE", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_AUDIO_WAVE; } } else if( $3.length == 6 ) { if( narrow_string_compare( $3.data, "BINARY", 6 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_BINARY_LITTLE_ENDIAN; } } else if( $3.length == 8 ) { if( narrow_string_compare( $3.data, "MOTOROLA", 8 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->file_type = LIBODRAW_FILE_TYPE_BINARY_BIG_ENDIAN; } } if( libodraw_handle_append_data_file( ( (cue_parser_state_t *) parser_state )->handle, $2.data, $2.length, ( (cue_parser_state_t *) parser_state )->file_type, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data file.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_file_index += 1; } ; cue_flags : CUE_FLAGS cue_flags_types CUE_END_OF_LINE { cue_parser_rule_print( "cue_flags" ); } ; cue_flags_types : /* empty */ | CUE_KEYWORD_STRING cue_flags_types ; cue_index : CUE_INDEX CUE_2DIGIT CUE_MSF CUE_END_OF_LINE { cue_parser_rule_print( "cue_index" ); if( $2.data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_index = ( (cue_parser_state_t *) parser_state )->current_index; if( ( ( $2.data )[ 0 ] < '0' ) || ( ( $2.data )[ 0 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_index = ( $2.data )[ 0 ] - '0'; if( $2.length == 2 ) { ( (cue_parser_state_t *) parser_state )->current_index *= 10; if( ( ( $2.data )[ 1 ] < '0' ) || ( ( $2.data )[ 1 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_index += ( $2.data )[ 1 ] - '0'; } if( ( ( (cue_parser_state_t *) parser_state )->current_index != 0 ) && ( ( (cue_parser_state_t *) parser_state )->current_index != ( ( (cue_parser_state_t *) parser_state )->previous_index + 1 ) ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index number - values are not sequential.", cue_parser_function ); YYABORT; } if( ( $3.data == NULL ) || ( $3.length != 8 ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index MSF.", cue_parser_function ); YYABORT; } if( ( ( $3.data )[ 0 ] < '0' ) || ( ( $3.data )[ 0 ] > '9' ) || ( ( $3.data )[ 1 ] < '0' ) || ( ( $3.data )[ 1 ] > '9' ) || ( ( $3.data )[ 2 ] != ':' ) || ( ( $3.data )[ 3 ] < '0' ) || ( ( $3.data )[ 3 ] > '9' ) || ( ( $3.data )[ 4 ] < '0' ) || ( ( $3.data )[ 4 ] > '9' ) || ( ( $3.data )[ 5 ] != ':' ) || ( ( $3.data )[ 6 ] < '0' ) || ( ( $3.data )[ 6 ] > '9' ) || ( ( $3.data )[ 7 ] < '0' ) || ( ( $3.data )[ 7 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index MSF.", cue_parser_function ); YYABORT; } cue_parser_copy_relative_msf_to_lba( $3.data, ( (cue_parser_state_t *) parser_state )->current_start_sector ); /* The MSF can be relative to the start of the file */ if( ( (cue_parser_state_t *) parser_state )->current_start_sector != 0 ) { if( ( ( (cue_parser_state_t *) parser_state )->current_index == 0 ) || ( ( (cue_parser_state_t *) parser_state )->current_index == 1 ) ) { if( ( ( (cue_parser_state_t *) parser_state )->session_number_of_sectors == 0 ) || ( ( (cue_parser_state_t *) parser_state )->previous_track_type == LIBODRAW_TRACK_TYPE_AUDIO ) ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_session_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid session start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->session_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_session_start_sector; } if( ( ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors == 0 ) || ( ( (cue_parser_state_t *) parser_state )->previous_track_type == LIBODRAW_TRACK_TYPE_AUDIO ) ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid lead-out start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector; } } if( ( (cue_parser_state_t *) parser_state )->current_index == 1 ) { if( ( (cue_parser_state_t *) parser_state )->track_number_of_sectors == 0 ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_track_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; } } } if( ( (cue_parser_state_t *) parser_state )->current_index == 1 ) { if( ( (cue_parser_state_t *) parser_state )->current_session > 1 ) { if( libodraw_handle_append_session( ( (cue_parser_state_t *) parser_state )->handle, ( (cue_parser_state_t *) parser_state )->previous_session_start_sector, ( (cue_parser_state_t *) parser_state )->session_number_of_sectors, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_session_start_sector = ( (cue_parser_state_t *) parser_state )->current_start_sector; ( (cue_parser_state_t *) parser_state )->session_number_of_sectors = 0; } if( ( (cue_parser_state_t *) parser_state )->current_lead_out > ( (cue_parser_state_t *) parser_state )->previous_lead_out ) { if( libodraw_handle_append_lead_out( ( (cue_parser_state_t *) parser_state )->handle, ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector, ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead-out.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_lead_out = ( (cue_parser_state_t *) parser_state )->current_lead_out; ( (cue_parser_state_t *) parser_state )->lead_out_number_of_sectors = 0; } if( ( (cue_parser_state_t *) parser_state )->current_track > 1 ) { if( ( (cue_parser_state_t *) parser_state )->previous_file_index < 0 ) { ( (cue_parser_state_t *) parser_state )->file_sector = ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; ( (cue_parser_state_t *) parser_state )->previous_file_index += 1; } ( (cue_parser_state_t *) parser_state )->previous_file_sector = ( (cue_parser_state_t *) parser_state )->previous_track_start_sector - ( (cue_parser_state_t *) parser_state )->file_sector; if( libodraw_handle_append_track( ( (cue_parser_state_t *) parser_state )->handle, ( (cue_parser_state_t *) parser_state )->previous_track_start_sector, ( (cue_parser_state_t *) parser_state )->track_number_of_sectors, ( (cue_parser_state_t *) parser_state )->previous_track_type, ( (cue_parser_state_t *) parser_state )->previous_file_index, ( (cue_parser_state_t *) parser_state )->previous_file_sector, ( (cue_parser_state_t *) parser_state )->error ) != 1 ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track.", cue_parser_function ); YYABORT; } if( ( (cue_parser_state_t *) parser_state )->previous_file_index < ( (cue_parser_state_t *) parser_state )->current_file_index ) { ( (cue_parser_state_t *) parser_state )->file_sector = ( (cue_parser_state_t *) parser_state )->current_start_sector; ( (cue_parser_state_t *) parser_state )->previous_file_index += 1; } ( (cue_parser_state_t *) parser_state )->previous_track_start_sector = ( (cue_parser_state_t *) parser_state )->current_start_sector; ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = 0; } } } ; cue_isrc : CUE_ISRC CUE_ISRC_CODE CUE_END_OF_LINE { cue_parser_rule_print( "cue_isrc" ); } ; cue_postgap : CUE_POSTGAP CUE_MSF CUE_END_OF_LINE { cue_parser_rule_print( "cue_postgap" ); } ; cue_pregap : CUE_PREGAP CUE_MSF CUE_END_OF_LINE { cue_parser_rule_print( "cue_pregap" ); } ; cue_remark_item : cue_lead_out | cue_original_media_type | cue_remark | cue_run_out | cue_session ; cue_lead_out : CUE_REMARK_LEAD_OUT CUE_MSF CUE_END_OF_LINE { cue_parser_rule_print( "cue_lead_out" ); if( ( $2.data == NULL ) || ( $2.length != 8 ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index MSF.", cue_parser_function ); YYABORT; } if( ( ( $2.data )[ 0 ] < '0' ) || ( ( $2.data )[ 0 ] > '9' ) || ( ( $2.data )[ 1 ] < '0' ) || ( ( $2.data )[ 1 ] > '9' ) || ( ( $2.data )[ 2 ] != ':' ) || ( ( $2.data )[ 3 ] < '0' ) || ( ( $2.data )[ 3 ] > '9' ) || ( ( $2.data )[ 4 ] < '0' ) || ( ( $2.data )[ 4 ] > '9' ) || ( ( $2.data )[ 5 ] != ':' ) || ( ( $2.data )[ 6 ] < '0' ) || ( ( $2.data )[ 6 ] > '9' ) || ( ( $2.data )[ 7 ] < '0' ) || ( ( $2.data )[ 7 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index MSF.", cue_parser_function ); YYABORT; } cue_parser_copy_relative_msf_to_lba( $2.data, ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector ); if( ( (cue_parser_state_t *) parser_state )->track_number_of_sectors == 0 ) { if( ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector < ( (cue_parser_state_t *) parser_state )->previous_track_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid lead-out start sector value preceeds previous track start sector.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = ( (cue_parser_state_t *) parser_state )->previous_lead_out_start_sector - ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; } ( (cue_parser_state_t *) parser_state )->current_lead_out += 1; } ; cue_original_media_type : CUE_REMARK_ORIGINAL_MEDIA_TYPE CUE_KEYWORD_STRING CUE_END_OF_LINE { cue_parser_rule_print( "cue_original_media_type" ); } ; cue_remark : cue_remark_start error CUE_END_OF_LINE { cue_parser_rule_print( "cue_remark" ); cue_scanner_suppress_error = 0; } ; cue_remark_start : CUE_REMARK { /* The build-in rule error will gobble up all the tokens until the end-of-line * because these are no syntax errors suppress the error output */ cue_scanner_suppress_error = 1; } ; cue_run_out : CUE_REMARK_RUN_OUT CUE_MSF CUE_END_OF_LINE { cue_parser_rule_print( "cue_run_out" ); if( ( $2.data == NULL ) || ( $2.length != 8 ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid index MSF.", cue_parser_function ); YYABORT; } if( ( ( $2.data )[ 0 ] < '0' ) || ( ( $2.data )[ 0 ] > '9' ) || ( ( $2.data )[ 1 ] < '0' ) || ( ( $2.data )[ 1 ] > '9' ) || ( ( $2.data )[ 2 ] != ':' ) || ( ( $2.data )[ 3 ] < '0' ) || ( ( $2.data )[ 3 ] > '9' ) || ( ( $2.data )[ 4 ] < '0' ) || ( ( $2.data )[ 4 ] > '9' ) || ( ( $2.data )[ 5 ] != ':' ) || ( ( $2.data )[ 6 ] < '0' ) || ( ( $2.data )[ 6 ] > '9' ) || ( ( $2.data )[ 7 ] < '0' ) || ( ( $2.data )[ 7 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported index MSF.", cue_parser_function ); YYABORT; } cue_parser_copy_relative_msf_to_lba( $2.data, ( (cue_parser_state_t *) parser_state )->current_start_sector ); if( ( (cue_parser_state_t *) parser_state )->track_number_of_sectors == 0 ) { if( ( (cue_parser_state_t *) parser_state )->current_start_sector < ( (cue_parser_state_t *) parser_state )->previous_track_start_sector ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid track start sector value preceeds previous.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->track_number_of_sectors = ( (cue_parser_state_t *) parser_state )->current_start_sector - ( (cue_parser_state_t *) parser_state )->previous_track_start_sector; } } ; cue_session : CUE_REMARK_SESSION CUE_2DIGIT CUE_END_OF_LINE { cue_parser_rule_print( "cue_session" ); if( $2.data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid session number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_session = ( (cue_parser_state_t *) parser_state )->current_session; if( ( ( $2.data )[ 0 ] < '0' ) || ( ( $2.data )[ 0 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported session number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_session = ( $2.data )[ 0 ] - '0'; if( $2.length == 2 ) { ( (cue_parser_state_t *) parser_state )->current_session *= 10; if( ( ( $2.data )[ 1 ] < '0' ) || ( ( $2.data )[ 1 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported session number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_session += ( $2.data )[ 1 ] - '0'; } if( ( ( (cue_parser_state_t *) parser_state )->current_session != 0 ) && ( ( (cue_parser_state_t *) parser_state )->current_session != ( ( (cue_parser_state_t *) parser_state )->previous_session + 1 ) ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported session number - values are not sequential.", cue_parser_function ); YYABORT; } } ; cue_track : CUE_TRACK CUE_2DIGIT CUE_KEYWORD_STRING CUE_END_OF_LINE { cue_parser_rule_print( "cue_track" ); if( $2.data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_track = ( (cue_parser_state_t *) parser_state )->current_track; if( ( ( $2.data )[ 0 ] < '0' ) || ( ( $2.data )[ 0 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_track = ( $2.data )[ 0 ] - '0'; if( $2.length == 2 ) { ( (cue_parser_state_t *) parser_state )->current_track *= 10; if( ( ( $2.data )[ 1 ] < '0' ) || ( ( $2.data )[ 1 ] > '9' ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->current_track += ( $2.data )[ 1 ] - '0'; } if( ( ( (cue_parser_state_t *) parser_state )->current_track != 0 ) && ( ( (cue_parser_state_t *) parser_state )->current_track != ( ( (cue_parser_state_t *) parser_state )->previous_track + 1 ) ) ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track number - values are not sequential.", cue_parser_function ); YYABORT; } if( $3.data == NULL ) { libcerror_error_set( ( (cue_parser_state_t *) parser_state )->error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track number.", cue_parser_function ); YYABORT; } ( (cue_parser_state_t *) parser_state )->previous_track_type = ( (cue_parser_state_t *) parser_state )->current_track_type; ( (cue_parser_state_t *) parser_state )->previous_index = 0; ( (cue_parser_state_t *) parser_state )->current_index = 0; ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_UNKNOWN; if( $3.length == 3 ) { if( narrow_string_compare( $3.data, "CDG", 3 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_CDG; } } else if( $3.length == 5 ) { if( narrow_string_compare( $3.data, "AUDIO", 5 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_AUDIO; } } else if( $3.length == 8 ) { if( narrow_string_compare( $3.data, "CDI", 3 ) == 0 ) { if( ( $3.data )[ 3 ] == '/' ) { if( narrow_string_compare( &( ( $3.data )[ 4 ] ), "2336", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_CDI_2336; } else if( narrow_string_compare( &( ( $3.data )[ 4 ] ), "2352", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_CDI_2352; } } } } else if( $3.length == 10 ) { if( narrow_string_compare( $3.data, "MODE", 4 ) == 0 ) { if( ( $3.data )[ 5 ] == '/' ) { if( ( $3.data )[ 4 ] == '1' ) { if( narrow_string_compare( &( ( $3.data )[ 6 ] ), "2048", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE1_2048; } else if( narrow_string_compare( &( ( $3.data )[ 6 ] ), "2352", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE1_2352; } } else if( ( $3.data )[ 4 ] == '2' ) { if( narrow_string_compare( &( ( $3.data )[ 6 ] ), "2048", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2048; } else if( narrow_string_compare( &( ( $3.data )[ 6 ] ), "2324", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2324; } else if( narrow_string_compare( &( ( $3.data )[ 6 ] ), "2336", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2336; } else if( narrow_string_compare( &( ( $3.data )[ 6 ] ), "2352", 4 ) == 0 ) { ( (cue_parser_state_t *) parser_state )->current_track_type = LIBODRAW_TRACK_TYPE_MODE2_2352; } } } } } } ; cue_empty_line : CUE_END_OF_LINE ; %% int cue_parser_parse_buffer( libodraw_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { cue_parser_state_t parser_state; YY_BUFFER_STATE buffer_state = NULL; size_t buffer_offset = 0; int result = -1; if( buffer_size >= 3 ) { if( ( buffer[ 0 ] == 0x0ef ) && ( buffer[ 1 ] == 0x0bb ) && ( buffer[ 2 ] == 0x0bf ) ) { buffer_offset = 3; } } buffer_state = cue_scanner__scan_buffer( (char *) &( buffer[ buffer_offset ] ), buffer_size - buffer_offset ); cue_scanner_buffer_offset = (size_t) buffer_offset; if( buffer_state != NULL ) { parser_state.handle = handle; parser_state.error = error; parser_state.previous_file_index = -1; parser_state.current_file_index = -1; parser_state.file_type = 0; parser_state.previous_file_sector = 0; parser_state.file_sector = 0; parser_state.previous_session_start_sector = 0; parser_state.previous_lead_out_start_sector = 0; parser_state.previous_track_start_sector = 0; parser_state.current_start_sector = 0; parser_state.session_number_of_sectors = 0; parser_state.lead_out_number_of_sectors = 0; parser_state.track_number_of_sectors = 0; parser_state.previous_track_type = 0; parser_state.current_track_type = 0; parser_state.previous_session = 0; parser_state.current_session = 0; parser_state.previous_lead_out = 0; parser_state.current_lead_out = 0; parser_state.previous_track = 0; parser_state.current_track = 0; parser_state.previous_index = 0; parser_state.current_index = 0; if( cue_scanner_parse( &parser_state ) == 0 ) { result = 1; } cue_scanner__delete_buffer( buffer_state ); if( parser_state.current_session > 0 ) { if( libodraw_handle_append_session( parser_state.handle, parser_state.previous_session_start_sector, 0, parser_state.error ) != 1 ) { libcerror_error_set( parser_state.error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session.", cue_parser_function ); result = -1; } } if( parser_state.current_lead_out > parser_state.previous_lead_out ) { if( libodraw_handle_append_lead_out( parser_state.handle, parser_state.previous_lead_out_start_sector, 0, parser_state.error ) != 1 ) { libcerror_error_set( parser_state.error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead-out.", cue_parser_function ); result = -1; } } if( parser_state.current_track > 0 ) { if( parser_state.previous_file_index < 0 ) { parser_state.file_sector = parser_state.previous_track_start_sector; parser_state.previous_file_index += 1; } parser_state.previous_file_sector = parser_state.previous_track_start_sector - parser_state.file_sector; if( libodraw_handle_append_track( parser_state.handle, parser_state.previous_track_start_sector, 0, parser_state.current_track_type, parser_state.current_file_index, parser_state.previous_file_sector, parser_state.error ) != 1 ) { libcerror_error_set( parser_state.error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track.", cue_parser_function ); result = -1; } } } cue_scanner_lex_destroy(); return( result ); } libewf-20140807/libodraw/libodraw_io_handle.h0000664000175000017500000000413013443450062023111 0ustar00lordyestalordyesta00000000000000/* * Input/Output (IO) handle functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_IO_HANDLE_H ) #define _LIBODRAW_IO_HANDLE_H #include #include #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libodraw_io_handle libodraw_io_handle_t; struct libodraw_io_handle { /* The number of bytes per sector */ uint32_t bytes_per_sector; /* The mode */ uint8_t mode; /* The codepage of the extended ASCII strings */ int ascii_codepage; /* Value to indicate if abort was signalled */ int abort; }; int libodraw_io_handle_initialize( libodraw_io_handle_t **io_handle, libcerror_error_t **error ); int libodraw_io_handle_free( libodraw_io_handle_t **io_handle, libcerror_error_t **error ); int libodraw_io_handle_clear( libodraw_io_handle_t *io_handle, libcerror_error_t **error ); ssize_t libodraw_io_handle_copy_sector_data_to_buffer( libodraw_io_handle_t *io_handle, const uint8_t *sector_data, size_t sector_data_size, uint32_t bytes_per_sector, uint8_t track_type, uint8_t *buffer, size_t buffer_size, uint32_t sector_index, uint32_t sector_offset, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_IO_HANDLE_H ) */ libewf-20140807/libodraw/Makefile.am0000664000175000017500000000331413443450062021172 0ustar00lordyestalordyesta00000000000000AM_LFLAGS = -Cf AM_YFLAGS = -d -v -l -p cue_scanner_ if HAVE_LOCAL_LIBODRAW AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ BUILT_SOURCES = libodraw_cue_parser.h noinst_LTLIBRARIES = libodraw.la libodraw_la_SOURCES = \ libodraw_codepage.h \ libodraw_cue_parser.y \ libodraw_cue_scanner.l \ libodraw_data_file.c libodraw_data_file.h \ libodraw_data_file_descriptor.c libodraw_data_file_descriptor.h \ libodraw_debug.c libodraw_debug.h \ libodraw_definitions.h \ libodraw_error.c libodraw_error.h \ libodraw_extern.h \ libodraw_handle.c libodraw_handle.h \ libodraw_io_handle.c libodraw_io_handle.h \ libodraw_libbfio.h \ libodraw_libcdata.h \ libodraw_libcerror.h \ libodraw_libclocale.h \ libodraw_libcnotify.h \ libodraw_libcpath.h \ libodraw_libuna.h \ libodraw_notify.c libodraw_notify.h \ libodraw_sector_range.c libodraw_sector_range.h \ libodraw_support.c libodraw_support.h \ libodraw_track_value.c libodraw_track_value.h \ libodraw_types.h \ libodraw_unused.h endif EXTRA_DIST = \ libodraw_cue_parser.c libodraw_cue_parser.h \ libodraw_cue_scanner.c MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f libodraw_cue_parser.c /bin/rm -f libodraw_cue_parser.h /bin/rm -f libodraw_cue_parser.output /bin/rm -f libodraw_cue_scanner.c /bin/rm -f Makefile splint: @echo "Running splint on libodraw ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libodraw_la_SOURCES) libewf-20140807/libodraw/libodraw_codepage.h0000664000175000017500000000514113443450062022741 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_INTERNAL_CODEPAGE_H ) #define _LIBODRAW_INTERNAL_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBODRAW ) #include /* Define HAVE_LOCAL_LIBODRAW for local use of libodraw * The definitions in are copied here * for local use of libodraw */ #else /* The codepage definitions */ enum LIBODRAW_CODEPAGES { LIBODRAW_CODEPAGE_ASCII = 20127, LIBODRAW_CODEPAGE_ISO_8859_1 = 28591, LIBODRAW_CODEPAGE_ISO_8859_2 = 28592, LIBODRAW_CODEPAGE_ISO_8859_3 = 28593, LIBODRAW_CODEPAGE_ISO_8859_4 = 28594, LIBODRAW_CODEPAGE_ISO_8859_5 = 28595, LIBODRAW_CODEPAGE_ISO_8859_6 = 28596, LIBODRAW_CODEPAGE_ISO_8859_7 = 28597, LIBODRAW_CODEPAGE_ISO_8859_8 = 28598, LIBODRAW_CODEPAGE_ISO_8859_9 = 28599, LIBODRAW_CODEPAGE_ISO_8859_10 = 28600, LIBODRAW_CODEPAGE_ISO_8859_11 = 28601, LIBODRAW_CODEPAGE_ISO_8859_13 = 28603, LIBODRAW_CODEPAGE_ISO_8859_14 = 28604, LIBODRAW_CODEPAGE_ISO_8859_15 = 28605, LIBODRAW_CODEPAGE_ISO_8859_16 = 28606, LIBODRAW_CODEPAGE_KOI8_R = 20866, LIBODRAW_CODEPAGE_KOI8_U = 21866, LIBODRAW_CODEPAGE_WINDOWS_874 = 874, LIBODRAW_CODEPAGE_WINDOWS_932 = 932, LIBODRAW_CODEPAGE_WINDOWS_936 = 936, LIBODRAW_CODEPAGE_WINDOWS_949 = 949, LIBODRAW_CODEPAGE_WINDOWS_950 = 950, LIBODRAW_CODEPAGE_WINDOWS_1250 = 1250, LIBODRAW_CODEPAGE_WINDOWS_1251 = 1251, LIBODRAW_CODEPAGE_WINDOWS_1252 = 1252, LIBODRAW_CODEPAGE_WINDOWS_1253 = 1253, LIBODRAW_CODEPAGE_WINDOWS_1254 = 1254, LIBODRAW_CODEPAGE_WINDOWS_1255 = 1255, LIBODRAW_CODEPAGE_WINDOWS_1256 = 1256, LIBODRAW_CODEPAGE_WINDOWS_1257 = 1257, LIBODRAW_CODEPAGE_WINDOWS_1258 = 1258 }; #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_INTERNAL_CODEPAGE_H ) */ libewf-20140807/libodraw/libodraw_unused.h0000664000175000017500000000260213443450062022474 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2010-2019, 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( _LIBODRAW_UNUSED_H ) #define _LIBODRAW_UNUSED_H #include #if !defined( LIBODRAW_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBODRAW_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBODRAW_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBODRAW_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBODRAW_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBODRAW_UNUSED_H ) */ libewf-20140807/libodraw/libodraw_debug.c0000664000175000017500000000512513443450062022255 0ustar00lordyestalordyesta00000000000000/* * Debug functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include "libodraw_debug.h" #include "libodraw_libbfio.h" #include "libodraw_libcerror.h" #include "libodraw_libcnotify.h" #if defined( HAVE_DEBUG_OUTPUT ) /* Prints the read offsets * Returns 1 if successful or -1 on error */ int libodraw_debug_print_read_offsets( libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { static char *function = "libodraw_debug_print_read_offsets"; off64_t offset = 0; size64_t size = 0; int number_of_offsets = 0; int offset_iterator = 0; if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( libbfio_handle_get_number_of_offsets_read( file_io_handle, &number_of_offsets, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of offsets read.", function ); return( -1 ); } libcnotify_printf( "Offsets read:\n" ); for( offset_iterator = 0; offset_iterator < number_of_offsets; offset_iterator++ ) { if( libbfio_handle_get_offset_read( file_io_handle, offset_iterator, &offset, &size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset: %d.", function, ( offset_iterator + 1 ) ); return( -1 ); } libcnotify_printf( "%08" PRIi64 " ( 0x%08" PRIx64 " ) - %08" PRIi64 " ( 0x%08" PRIx64 " ) size: %" PRIu64 "\n", offset, offset, offset + size, offset + size, size ); } libcnotify_printf( "\n" ); return( 1 ); } #endif libewf-20140807/libodraw/libodraw_data_file.c0000664000175000017500000003221213443450062023074 0ustar00lordyestalordyesta00000000000000/* * Data file functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_data_file.h" #include "libodraw_data_file_descriptor.h" #include "libodraw_handle.h" #include "libodraw_libcerror.h" #include "libodraw_libuna.h" #include "libodraw_types.h" /* Creates a data file * Make sure the value data_file is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libodraw_data_file_initialize( libodraw_data_file_t **data_file, libodraw_internal_handle_t *internal_handle, libodraw_data_file_descriptor_t *data_file_descriptor, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_initialize"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data_file.", function ); return( -1 ); } if( *data_file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid data file value already set.", function ); return( -1 ); } if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } internal_data_file = memory_allocate_structure( libodraw_internal_data_file_t ); if( internal_data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data file.", function ); goto on_error; } if( memory_set( internal_data_file, 0, sizeof( libodraw_internal_data_file_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear data file.", function ); goto on_error; } internal_data_file->internal_handle = internal_handle; internal_data_file->data_file_descriptor = data_file_descriptor; *data_file = (libodraw_data_file_t *) internal_data_file; return( 1 ); on_error: if( internal_data_file != NULL ) { memory_free( internal_data_file ); } return( -1 ); } /* Frees a data_file * Returns 1 if successful or -1 on error */ int libodraw_data_file_free( libodraw_data_file_t **data_file, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_free"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data_file.", function ); return( -1 ); } if( *data_file != NULL ) { internal_data_file = (libodraw_internal_data_file_t *) *data_file; *data_file = NULL; /* The internal_handle and data_file_descriptor references are freed elsewhere */ memory_free( internal_data_file ); } return( 1 ); } /* Retrieves the filename size * The filename size should include the end of string character * Returns 1 if successful or -1 on error */ int libodraw_data_file_get_filename_size( libodraw_data_file_t *data_file, size_t *filename_size, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_get_filename_size"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( libodraw_data_file_descriptor_get_name_size( internal_data_file->data_file_descriptor, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file descriptor name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the filename * The filename size should include the end of string character * Returns 1 if successful or -1 on error */ int libodraw_data_file_get_filename( libodraw_data_file_t *data_file, char *filename, size_t filename_size, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_get_filename"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( libodraw_data_file_descriptor_get_name( internal_data_file->data_file_descriptor, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file descriptor name.", function ); return( -1 ); } return( 1 ); } /* Sets the segment file * Returns 1 if successful or -1 on error */ int libodraw_data_file_set_filename( libodraw_data_file_t *data_file, const char *filename, size_t filename_length, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_set_filename"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( libodraw_data_file_descriptor_set_name( internal_data_file->data_file_descriptor, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data file descriptor name.", function ); return( -1 ); } internal_data_file->data_file_descriptor->name_set = 1; return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the filename size * The filename size includes the end of string character * Returns 1 if successful or -1 on error */ int libodraw_data_file_get_filename_size_wide( libodraw_data_file_t *data_file, size_t *filename_size, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_get_filename_size_wide"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( libodraw_data_file_descriptor_get_name_size_wide( internal_data_file->data_file_descriptor, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file descriptor name size.", function ); return( -1 ); } return( 1 ); } /* Retrieves the filename * The filename size should include the end of string character * Returns 1 if successful or -1 on error */ int libodraw_data_file_get_filename_wide( libodraw_data_file_t *data_file, wchar_t *filename, size_t filename_size, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_get_filename_wide"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( libodraw_data_file_descriptor_get_name_wide( internal_data_file->data_file_descriptor, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file descriptor name.", function ); return( -1 ); } return( 1 ); } /* Sets the segment file * Returns 1 if successful or -1 on error */ int libodraw_data_file_set_filename_wide( libodraw_data_file_t *data_file, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_set_filename_wide"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( libodraw_data_file_descriptor_set_name_wide( internal_data_file->data_file_descriptor, filename, filename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data file descriptor name.", function ); return( -1 ); } internal_data_file->data_file_descriptor->name_set = 1; return( 1 ); } #endif /* Retrieves the file type * Returns 1 if successful or -1 on error */ int libodraw_data_file_get_type( libodraw_data_file_t *data_file, uint8_t *type, libcerror_error_t **error ) { libodraw_internal_data_file_t *internal_data_file = NULL; static char *function = "libodraw_data_file_get_type"; if( data_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file.", function ); return( -1 ); } internal_data_file = (libodraw_internal_data_file_t *) data_file; if( internal_data_file->data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file - missing data file descriptor.", function ); return( -1 ); } if( type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type.", function ); return( -1 ); } *type = internal_data_file->data_file_descriptor->type; return( 1 ); } libewf-20140807/libodraw/libodraw_handle.h0000664000175000017500000003127013443450062022427 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_INTERNAL_FILE_H ) #define _LIBODRAW_INTERNAL_FILE_H #include #include #include "libodraw_extern.h" #include "libodraw_io_handle.h" #include "libodraw_libbfio.h" #include "libodraw_libcdata.h" #include "libodraw_libcerror.h" #include "libodraw_sector_range.h" #include "libodraw_track_value.h" #include "libodraw_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libodraw_internal_handle libodraw_internal_handle_t; struct libodraw_internal_handle { /* The current offset */ off64_t current_offset; /* The current run-out */ int current_run_out; /* The current lead-out */ int current_lead_out; /* The current track */ int current_track; /* The (storage) media size */ size64_t media_size; /* The number of sectors */ uint64_t number_of_sectors; /* The data file descriptors array */ libcdata_array_t *data_file_descriptors_array; /* The sessions array */ libcdata_array_t *sessions_array; /* The run-outs array */ libcdata_array_t *run_outs_array; /* The lead-outs array */ libcdata_array_t *lead_outs_array; /* The tracks array */ libcdata_array_t *tracks_array; /* The basename */ system_character_t *basename; /* The basename size */ size_t basename_size; /* The access flags */ int access_flags; /* The maximum number of open handles in the pool */ int maximum_number_of_open_handles; /* The IO handle */ libodraw_io_handle_t *io_handle; /* The table of contents (TOC) file IO handle */ libbfio_handle_t *toc_file_io_handle; /* Value to indicate if the table of contents (TOC) file IO handle was created inside the library */ uint8_t toc_file_io_handle_created_in_library; /* Value to indicate if the table of contents (TOC) file IO handle was opened inside the library */ uint8_t toc_file_io_handle_opened_in_library; /* The data file pool of file IO handles */ libbfio_pool_t *data_file_io_pool; /* Value to indicate if the data file IO pool was created inside the library */ uint8_t data_file_io_pool_created_in_library; }; LIBODRAW_EXTERN \ int libodraw_handle_initialize( libodraw_handle_t **handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_free( libodraw_handle_t **handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_signal_abort( libodraw_handle_t *handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_open( libodraw_handle_t *handle, const char *filename, int access_flags, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBODRAW_EXTERN \ int libodraw_handle_open_wide( libodraw_handle_t *handle, const wchar_t *filename, int access_flags, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBODRAW_EXTERN \ int libodraw_handle_open_file_io_handle( libodraw_handle_t *handle, libbfio_handle_t *file_io_handle, int access_flags, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_open_data_files( libodraw_handle_t *handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_open_data_files_file_io_pool( libodraw_handle_t *handle, libbfio_pool_t *file_io_pool, libcerror_error_t **error ); int libodraw_handle_open_data_file( libodraw_internal_handle_t *internal_handle, int data_file_index, const char *filename, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libodraw_handle_open_data_file_wide( libodraw_internal_handle_t *internal_handle, int data_file_index, const wchar_t *filename, libcerror_error_t **error ); #endif int libodraw_handle_open_data_file_io_handle( libodraw_internal_handle_t *internal_handle, int data_file_index, libbfio_handle_t *file_io_handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_close( libodraw_handle_t *handle, libcerror_error_t **error ); int libodraw_handle_open_read( libodraw_internal_handle_t *internal_handle, libbfio_handle_t *file_io_handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ ssize_t libodraw_handle_read_buffer( libodraw_handle_t *handle, void *buffer, size_t buffer_size, libcerror_error_t **error ); ssize_t libodraw_handle_read_buffer_from_run_out( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); ssize_t libodraw_handle_read_buffer_from_lead_out( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); ssize_t libodraw_handle_read_buffer_from_unspecified_sector( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); ssize_t libodraw_handle_read_buffer_from_track( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ ssize_t libodraw_handle_read_buffer_at_offset( libodraw_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); #ifdef TODO_WRITE_SUPPORT LIBODRAW_EXTERN \ ssize_t libodraw_handle_write_buffer( libodraw_handle_t *handle, const void *buffer, size_t buffer_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ ssize_t libodraw_handle_write_buffer_at_offset( libodraw_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); #endif /* TODO_WRITE_SUPPORT */ off64_t libodraw_internal_handle_seek_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int whence, libcerror_error_t **error ); LIBODRAW_EXTERN \ off64_t libodraw_handle_seek_offset( libodraw_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ); int libodraw_handle_get_run_out_at_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int *run_out_index, libodraw_sector_range_t **run_out_sector_range, off64_t *run_out_offset, libcerror_error_t **error ); int libodraw_handle_get_lead_out_at_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int *lead_out_index, libodraw_sector_range_t **lead_out_sector_range, off64_t *lead_out_offset, libcerror_error_t **error ); int libodraw_handle_get_track_at_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int *track_index, libodraw_track_value_t **track_value, off64_t *track_offset, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_offset( libodraw_handle_t *handle, off64_t *offset, libcerror_error_t **error ); int libodraw_handle_get_basename_size( libodraw_internal_handle_t *internal_handle, size_t *basename_size, libcerror_error_t **error ); int libodraw_handle_get_basename( libodraw_internal_handle_t *internal_handle, char *basename, size_t basename_size, libcerror_error_t **error ); int libodraw_handle_set_basename( libodraw_internal_handle_t *internal_handle, const char *basename, size_t basename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libodraw_handle_get_basename_size_wide( libodraw_internal_handle_t *internal_handle, size_t *basename_size, libcerror_error_t **error ); int libodraw_handle_get_basename_wide( libodraw_internal_handle_t *internal_handle, wchar_t *basename, size_t basename_size, libcerror_error_t **error ); int libodraw_handle_set_basename_wide( libodraw_internal_handle_t *internal_handle, const wchar_t *basename, size_t basename_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBODRAW_EXTERN \ int libodraw_handle_set_maximum_number_of_open_handles( libodraw_handle_t *handle, int maximum_number_of_open_handles, libcerror_error_t **error ); int libodraw_handle_set_media_values( libodraw_internal_handle_t *internal_handle, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_ascii_codepage( libodraw_handle_t *handle, int *ascii_codepage, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_set_ascii_codepage( libodraw_handle_t *handle, int ascii_codepage, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_number_of_data_files( libodraw_handle_t *handle, int *number_of_data_files, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_data_file( libodraw_handle_t *handle, int index, libodraw_data_file_t **data_file, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_append_data_file( libodraw_handle_t *handle, const char *name, size_t name_length, uint8_t type, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBODRAW_EXTERN \ int libodraw_handle_append_data_file_wide( libodraw_handle_t *handle, const wchar_t *name, size_t name_length, uint8_t type, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBODRAW_EXTERN \ int libodraw_handle_get_media_size( libodraw_handle_t *handle, size64_t *media_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_bytes_per_sector( libodraw_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_set_bytes_per_sector( libodraw_handle_t *handle, uint32_t bytes_per_sector, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_number_of_sectors( libodraw_handle_t *handle, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_number_of_sessions( libodraw_handle_t *handle, int *number_of_sessions, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_session( libodraw_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_append_session( libodraw_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_number_of_lead_outs( libodraw_handle_t *handle, int *number_of_lead_outs, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_lead_out( libodraw_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_append_lead_out( libodraw_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_number_of_tracks( libodraw_handle_t *handle, int *number_of_tracks, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_get_track( libodraw_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, int *data_file_index, uint64_t *data_file_start_sector, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_handle_append_track( libodraw_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, int data_file_index, uint64_t data_file_start_sector, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_INTERNAL_FILE_H ) */ libewf-20140807/libodraw/libodraw_track_value.c0000664000175000017500000002233613443450062023472 0ustar00lordyestalordyesta00000000000000/* * Track value functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_definitions.h" #include "libodraw_libcerror.h" #include "libodraw_track_value.h" /* Creates a track value * Make sure the value track_value is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libodraw_track_value_initialize( libodraw_track_value_t **track_value, libcerror_error_t **error ) { static char *function = "libodraw_track_value_initialize"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( *track_value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid track value value already set.", function ); return( -1 ); } *track_value = memory_allocate_structure( libodraw_track_value_t ); if( *track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create track value.", function ); goto on_error; } if( memory_set( *track_value, 0, sizeof( libodraw_track_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear track value.", function ); goto on_error; } return( 1 ); on_error: if( *track_value != NULL ) { memory_free( *track_value ); *track_value = NULL; } return( -1 ); } /* Frees a track value * Returns 1 if successful or -1 on error */ int libodraw_track_value_free( libodraw_track_value_t **track_value, libcerror_error_t **error ) { static char *function = "libodraw_track_value_free"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( *track_value != NULL ) { memory_free( *track_value ); *track_value = NULL; } return( 1 ); } /* Retrieves a track value * Returns 1 if successful or -1 on error */ int libodraw_track_value_get( libodraw_track_value_t *track_value, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, int *data_file_index, uint64_t *data_file_start_sector, libcerror_error_t **error ) { static char *function = "libodraw_track_value_get"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( start_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid start sector.", function ); return( -1 ); } if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sectors.", function ); return( -1 ); } if( type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type.", function ); return( -1 ); } if( data_file_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file index.", function ); return( -1 ); } if( data_file_start_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file start sector.", function ); return( -1 ); } *start_sector = track_value->start_sector; *number_of_sectors = track_value->number_of_sectors; *type = track_value->type; *data_file_index = track_value->data_file_index; *data_file_start_sector = track_value->data_file_start_sector; return( 1 ); } /* Sets a track value * Returns 1 if successful or -1 on error */ int libodraw_track_value_set( libodraw_track_value_t *track_value, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, int data_file_index, uint64_t data_file_start_sector, libcerror_error_t **error ) { static char *function = "libodraw_track_value_set"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( start_sector > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid start sector value exceeds maximum.", function ); return( -1 ); } if( number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } if( ( type != LIBODRAW_TRACK_TYPE_UNKNOWN ) && ( type != LIBODRAW_TRACK_TYPE_AUDIO ) && ( type != LIBODRAW_TRACK_TYPE_CDG ) && ( type != LIBODRAW_TRACK_TYPE_MODE1_2048 ) && ( type != LIBODRAW_TRACK_TYPE_MODE1_2352 ) && ( type != LIBODRAW_TRACK_TYPE_MODE2_2048 ) && ( type != LIBODRAW_TRACK_TYPE_MODE2_2324 ) && ( type != LIBODRAW_TRACK_TYPE_MODE2_2336 ) && ( type != LIBODRAW_TRACK_TYPE_MODE2_2352 ) && ( type != LIBODRAW_TRACK_TYPE_CDI_2336 ) && ( type != LIBODRAW_TRACK_TYPE_CDI_2352 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported type.", function ); return( -1 ); } if( data_file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid data file index value less than zero.", function ); return( -1 ); } if( data_file_start_sector > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data file start sector value exceeds maximum.", function ); return( -1 ); } if( data_file_start_sector > start_sector ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: data file start sector value out of bounds.", function ); return( -1 ); } switch( type ) { case LIBODRAW_TRACK_TYPE_MODE1_2048: case LIBODRAW_TRACK_TYPE_MODE2_2048: track_value->bytes_per_sector = 2048; break; case LIBODRAW_TRACK_TYPE_MODE2_2324: track_value->bytes_per_sector = 2324; break; case LIBODRAW_TRACK_TYPE_MODE2_2336: case LIBODRAW_TRACK_TYPE_CDI_2336: track_value->bytes_per_sector = 2336; break; case LIBODRAW_TRACK_TYPE_AUDIO: case LIBODRAW_TRACK_TYPE_MODE1_2352: case LIBODRAW_TRACK_TYPE_MODE2_2352: case LIBODRAW_TRACK_TYPE_CDI_2352: track_value->bytes_per_sector = 2352; break; case LIBODRAW_TRACK_TYPE_CDG: track_value->bytes_per_sector = 2448; break; } track_value->start_sector = start_sector; track_value->end_sector = start_sector + number_of_sectors; track_value->number_of_sectors = number_of_sectors; track_value->type = type; track_value->data_file_index = data_file_index; track_value->data_file_start_sector = data_file_start_sector; track_value->data_file_offset = data_file_start_sector * track_value->bytes_per_sector; return( 1 ); } /* Retrieves the bytes per sector * Returns 1 if successful or -1 on error */ int libodraw_track_value_get_bytes_per_sector( libodraw_track_value_t *track_value, uint32_t *bytes_per_sector, libcerror_error_t **error ) { static char *function = "libodraw_track_value_get_bytes_per_sector"; if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( bytes_per_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } *bytes_per_sector = track_value->bytes_per_sector; return( 1 ); } libewf-20140807/libodraw/libodraw_support.c0000664000175000017500000000554313443450062022707 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_codepage.h" #include "libodraw_definitions.h" #include "libodraw_io_handle.h" #include "libodraw_libbfio.h" #include "libodraw_libcerror.h" #include "libodraw_libclocale.h" #include "libodraw_support.h" #if !defined( HAVE_LOCAL_LIBODRAW ) /* Returns the library version */ const char *libodraw_get_version( void ) { return( (const char *) LIBODRAW_VERSION_STRING ); } /* Returns the access flags for reading */ int libodraw_get_access_flags_read( void ) { return( (int) LIBODRAW_ACCESS_FLAG_READ ); } /* Returns the access flags for reading and writing */ int libodraw_get_access_flags_read_write( void ) { return( (int) ( LIBODRAW_ACCESS_FLAG_READ | LIBODRAW_ACCESS_FLAG_WRITE ) ); } /* Returns the access flags for writing */ int libodraw_get_access_flags_write( void ) { return( (int) LIBODRAW_ACCESS_FLAG_WRITE ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libodraw_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libodraw_get_codepage"; if( libclocale_codepage_get( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libodraw_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libodraw_set_codepage"; if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ libewf-20140807/libodraw/libodraw_notify.h0000664000175000017500000000307313443450062022504 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_NOTIFY_H ) #define _LIBODRAW_NOTIFY_H #include #include #include #include "libodraw_extern.h" #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBODRAW ) LIBODRAW_EXTERN \ void libodraw_notify_set_verbose( int verbose ); LIBODRAW_EXTERN \ int libodraw_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_notify_stream_close( libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_NOTIFY_H ) */ libewf-20140807/libodraw/libodraw_data_file.h0000664000175000017500000000605613443450062023110 0ustar00lordyestalordyesta00000000000000/* * Data file functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_INTERNAL_DATA_FILE_H ) #define _LIBODRAW_INTERNAL_DATA_FILE_H #include #include #include "libodraw_extern.h" #include "libodraw_data_file_descriptor.h" #include "libodraw_handle.h" #include "libodraw_libcerror.h" #include "libodraw_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libodraw_internal_data_file libodraw_internal_data_file_t; struct libodraw_internal_data_file { /* The internal handle */ libodraw_internal_handle_t *internal_handle; /* The data file descriptor */ libodraw_data_file_descriptor_t *data_file_descriptor; }; int libodraw_data_file_initialize( libodraw_data_file_t **data_file, libodraw_internal_handle_t *internal_handle, libodraw_data_file_descriptor_t *data_file_descriptor, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_data_file_free( libodraw_data_file_t **data_file, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_data_file_get_filename_size( libodraw_data_file_t *data_file, size_t *filename_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_data_file_get_filename( libodraw_data_file_t *data_file, char *filename, size_t filename_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_data_file_set_filename( libodraw_data_file_t *data_file, const char *filename, size_t filename_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBODRAW_EXTERN \ int libodraw_data_file_get_filename_size_wide( libodraw_data_file_t *data_file, size_t *filename_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_data_file_get_filename_wide( libodraw_data_file_t *data_file, wchar_t *filename, size_t filename_size, libcerror_error_t **error ); LIBODRAW_EXTERN \ int libodraw_data_file_set_filename_wide( libodraw_data_file_t *data_file, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ); #endif LIBODRAW_EXTERN \ int libodraw_data_file_get_type( libodraw_data_file_t *data_file, uint8_t *type, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_INTERNAL_DATA_FILE_H ) */ libewf-20140807/libodraw/libodraw_track_value.h0000664000175000017500000000475213443450062023501 0ustar00lordyestalordyesta00000000000000/* * Track value functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_TRACK_VALUE_H ) #define _LIBODRAW_TRACK_VALUE_H #include #include #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libodraw_track_value libodraw_track_value_t; struct libodraw_track_value { /* The start sector */ uint64_t start_sector; /* The end sector */ uint64_t end_sector; /* The number of sectors */ uint64_t number_of_sectors; /* The bytes per sector */ uint32_t bytes_per_sector; /* The type */ uint8_t type; /* The data file index */ int data_file_index; /* The start sector relative to the start of the data file */ uint64_t data_file_start_sector; /* The data file offset */ off64_t data_file_offset; }; int libodraw_track_value_initialize( libodraw_track_value_t **track_value, libcerror_error_t **error ); int libodraw_track_value_free( libodraw_track_value_t **track_value, libcerror_error_t **error ); int libodraw_track_value_get( libodraw_track_value_t *track_value, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, int *data_file_index, uint64_t *data_file_start_sector, libcerror_error_t **error ); int libodraw_track_value_set( libodraw_track_value_t *track_value, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, int data_file_index, uint64_t data_file_start_sector, libcerror_error_t **error ); int libodraw_track_value_get_bytes_per_sector( libodraw_track_value_t *track_value, uint32_t *bytes_per_sector, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_TRACK_VALUE_H ) */ libewf-20140807/libodraw/libodraw_libcnotify.h0000664000175000017500000000266213443450062023341 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBCNOTIFY_H ) #define _LIBODRAW_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBODRAW_LIBCNOTIFY_H ) */ libewf-20140807/libodraw/libodraw_types.h0000664000175000017500000000310313443450062022332 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2010-2019, 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( _LIBODRAW_INTERNAL_TYPES_H ) #define _LIBODRAW_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBODRAW for local use of libodraw * The definitions in are copied here * for local use of libodraw */ #if defined( HAVE_LOCAL_LIBODRAW ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libodraw_data_file {} libodraw_data_file_t; typedef struct libodraw_handle {} libodraw_handle_t; #else typedef intptr_t libodraw_data_file_t; typedef intptr_t libodraw_handle_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBODRAW ) */ #endif /* !defined( _LIBODRAW_INTERNAL_TYPES_H ) */ libewf-20140807/libodraw/libodraw_libbfio.h0000664000175000017500000000325113443450062022600 0ustar00lordyestalordyesta00000000000000/* * The libbfio header wrapper * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBBFIO_H ) #define _LIBODRAW_LIBBFIO_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT * before including libbfio.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBBFIO_DLL_IMPORT #endif #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) #error Multi-threading support requires libbfio with multi-threading support #endif #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ #endif /* !defined( _LIBODRAW_LIBBFIO_H ) */ libewf-20140807/libodraw/libodraw_io_handle.c0000664000175000017500000004321413443450062023112 0ustar00lordyestalordyesta00000000000000/* * Input/Output (IO) handle functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_definitions.h" #include "libodraw_codepage.h" #include "libodraw_io_handle.h" #include "libodraw_libcerror.h" #include "libodraw_libcnotify.h" #define libodraw_optical_disk_copy_msf_to_lba( minutes, seconds, frames, lba ) \ lba = minutes; \ lba *= 60; \ lba += seconds; \ lba *= 75; \ lba += frames; \ lba -= 150; static uint8_t libodraw_sector_synchronisation_data[ 12 ] = \ { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; /* Creates an IO handle * Make sure the value io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libodraw_io_handle_initialize( libodraw_io_handle_t **io_handle, libcerror_error_t **error ) { static char *function = "libodraw_io_handle_initialize"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( *io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid IO handle value already set.", function ); return( -1 ); } *io_handle = memory_allocate_structure( libodraw_io_handle_t ); if( *io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create IO handle.", function ); goto on_error; } if( memory_set( *io_handle, 0, sizeof( libodraw_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file.", function ); goto on_error; } ( *io_handle )->bytes_per_sector = 2048; ( *io_handle )->ascii_codepage = LIBODRAW_CODEPAGE_WINDOWS_1252; return( 1 ); on_error: if( *io_handle != NULL ) { memory_free( *io_handle ); *io_handle = NULL; } return( -1 ); } /* Frees an IO handle * Returns 1 if successful or -1 on error */ int libodraw_io_handle_free( libodraw_io_handle_t **io_handle, libcerror_error_t **error ) { static char *function = "libodraw_io_handle_free"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( *io_handle != NULL ) { memory_free( *io_handle ); *io_handle = NULL; } return( 1 ); } /* Clears the IO handle * Returns 1 if successful or -1 on error */ int libodraw_io_handle_clear( libodraw_io_handle_t *io_handle, libcerror_error_t **error ) { static char *function = "libodraw_io_handle_clear"; if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( memory_set( io_handle, 0, sizeof( libodraw_io_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear IO handle.", function ); return( -1 ); } io_handle->bytes_per_sector = 2048; io_handle->ascii_codepage = LIBODRAW_CODEPAGE_WINDOWS_1252; return( 1 ); } /* Copies the sector data to the buffer * Returns the number of bytes copied if successful or -1 on error */ ssize_t libodraw_io_handle_copy_sector_data_to_buffer( libodraw_io_handle_t *io_handle, const uint8_t *sector_data, size_t sector_data_size, uint32_t bytes_per_sector, uint8_t track_type, uint8_t *buffer, size_t buffer_size, uint32_t sector_index, uint32_t sector_offset, libcerror_error_t **error ) { static char *function = "libodraw_io_handle_copy_sector_data_to_buffer"; size_t buffer_offset = 0; size_t read_size = 0; size_t sector_data_offset = 0; uint32_t sector_lba = 0; #if defined( HAVE_DEBUG_OUTPUT ) || defined( HAVE_VERBOSE_OUTPUT ) uint8_t sector_mode = 0; #endif if( io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid IO handle.", function ); return( -1 ); } if( sector_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector data.", function ); return( -1 ); } if( sector_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sector data size value exceeds maximum.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( ( (size_t) sector_offset >= sector_data_size ) || ( sector_offset >= io_handle->bytes_per_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sector offset value out of bounds.", function ); return( -1 ); } while( sector_data_offset < sector_data_size ) { if( io_handle->bytes_per_sector == 2048 ) { if( ( track_type == LIBODRAW_TRACK_TYPE_MODE1_2352 ) || ( track_type == LIBODRAW_TRACK_TYPE_MODE2_2352 ) ) { if( ( sector_data_offset + 16 ) >= sector_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: sector data too small.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: sector: %" PRIu32 " header:\n", function, sector_index ); libcnotify_print_data( &( sector_data[ sector_data_offset ] ), 16, 0 ); } #endif if( memory_compare( &( sector_data[ sector_data_offset ] ), libodraw_sector_synchronisation_data, 12 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: unsupported sector synchronisation data.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: sector: %" PRIu32 " synchronisation data:\n", function, sector_index ); libcnotify_print_data( &( sector_data[ sector_data_offset ] ), 12, 0 ); } #endif sector_data_offset += 12; libodraw_optical_disk_copy_msf_to_lba( sector_data[ sector_data_offset ], sector_data[ sector_data_offset + 1 ], sector_data[ sector_data_offset + 2 ], sector_lba ); #if defined( HAVE_DEBUG_OUTPUT ) || defined( HAVE_VERBOSE_OUTPUT ) sector_mode = sector_data[ sector_data_offset + 3 ] & 0x03; #endif #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: sector: %" PRIu32 " MSF\t\t: %02" PRIu8 ":%02" PRIu8 ":%02" PRIu8 " (%" PRIu32 ")\n", function, sector_index, sector_data[ sector_data_offset ], sector_data[ sector_data_offset + 1 ], sector_data[ sector_data_offset + 2 ], sector_lba ); libcnotify_printf( "%s: sector: %" PRIu32 " mode bits\t: 0x%02" PRIx8 "\n", function, sector_index, sector_data[ sector_data_offset + 3 ] ); } #endif #if defined( HAVE_VERBOSE_OUTPUT ) if( sector_lba != sector_index ) { libcnotify_printf( "%s: sector MSF (LBA) does not match current.\n", function ); } if( ( ( track_type == LIBODRAW_TRACK_TYPE_MODE1_2352 ) && ( sector_mode != 1 ) ) || ( ( track_type == LIBODRAW_TRACK_TYPE_MODE2_2352 ) && ( sector_mode != 2 ) ) ) { libcnotify_printf( "%s: sector mode does not match table of contents.\n", function ); } #endif sector_data_offset += 4; } else if( bytes_per_sector == 2352 ) { sector_data_offset += 16; } if( ( track_type == LIBODRAW_TRACK_TYPE_MODE2_2336 ) || ( track_type == LIBODRAW_TRACK_TYPE_MODE2_2352 ) ) { if( ( sector_data[ sector_data_offset ] != sector_data[ sector_data_offset + 4 ] ) || ( sector_data[ sector_data_offset + 1 ] != sector_data[ sector_data_offset + 5 ] ) || ( sector_data[ sector_data_offset + 2 ] != sector_data[ sector_data_offset + 6 ] ) || ( sector_data[ sector_data_offset + 3 ] != sector_data[ sector_data_offset + 7 ] ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: unsupported or corrupt XA sub-header.", function ); return( -1 ); } if( sector_data[ sector_data_offset + 1 ] >= 32 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: unsupported XA sub-header channel number.", function ); return( -1 ); } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( sector_data[ sector_data_offset + 2 ] & 0x08 ) != 0 ) { libcnotify_printf( "%s: data flag not set in XA sub-header sub-mode flags.\n", function ); } } #endif /* TODO some writers seem to ignore these flags if( ( sector_data[ sector_data_offset + 2 ] & 0x08 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_INPUT, LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, "%s: unsupported XA sub-header sub-mode flags - data flag not set.", function ); return( -1 ); } */ sector_data_offset += 8; } } else if( io_handle->bytes_per_sector == 2352 ) { if( sector_offset == 0 ) { /* TODO what about run-out and lead-out data (have argument indicate non-track data) */ if( ( io_handle->mode == 1 ) || ( io_handle->mode == 2 ) ) { read_size = 12; if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } if( memory_copy( &( buffer[ buffer_offset ] ), libodraw_sector_synchronisation_data, read_size ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unsupported copy sector synchronisation data to buffer.", function ); return( -1 ); } buffer_offset += read_size; if( buffer_offset >= buffer_size ) { break; } /* TODO set MSF requires current sector */ buffer[ buffer_offset++ ] = 0; if( buffer_offset >= buffer_size ) { break; } buffer[ buffer_offset++ ] = 0; if( buffer_offset >= buffer_size ) { break; } buffer[ buffer_offset++ ] = 0; if( buffer_offset >= buffer_size ) { break; } if( io_handle->mode == 1 ) { buffer[ buffer_offset++ ] = 1; } else if ( io_handle->mode == 2 ) { buffer[ buffer_offset++ ] = 2; } if( buffer_offset >= buffer_size ) { break; } } else { read_size = 16; if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } if( memory_set( &( buffer[ buffer_offset ] ), 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set sector data in buffer.", function ); return( -1 ); } buffer_offset += read_size; if( buffer_offset >= buffer_size ) { break; } } if( io_handle->mode == 2 ) { /* TODO what about XA sub-header */ } } } read_size = io_handle->bytes_per_sector; if( sector_offset != 0 ) { sector_data_offset += sector_offset; read_size -= (size_t) sector_offset; sector_offset = 0; } if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } if( ( track_type == LIBODRAW_TRACK_TYPE_AUDIO ) && ( io_handle->bytes_per_sector != 2352 ) ) { /* If the sector size is not 2352 just return 0 bytes * for audio data */ if( memory_set( &( buffer[ buffer_offset ] ), 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set sector data to buffer.", function ); return( -1 ); } } else { if( memory_copy( &( buffer[ buffer_offset ] ), &( sector_data[ sector_data_offset ] ), read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy sector data to buffer.", function ); return( -1 ); } } buffer_offset += read_size; sector_data_offset += read_size; if( buffer_offset >= buffer_size ) { break; } if( io_handle->bytes_per_sector == 2048 ) { if( track_type == LIBODRAW_TRACK_TYPE_MODE1_2352 ) { /* TODO calculate checksum, what about read errors ?*/ sector_data_offset += 4; /* TODO check padding */ sector_data_offset += 8; /* TODO check ECC data if necessary, what about read errors ? */ sector_data_offset += 276; } else if( ( track_type == LIBODRAW_TRACK_TYPE_MODE2_2336 ) || ( track_type == LIBODRAW_TRACK_TYPE_MODE2_2352 ) ) { /* TODO calculate checksum, what about read errors ?*/ sector_data_offset += 4; /* TODO check ECC data if necessary, what about read errors ? */ sector_data_offset += 276; } else if( bytes_per_sector == 2352 ) { sector_data_offset += 288; } } else if( io_handle->bytes_per_sector == 2352 ) { /* TODO what about run-out and lead-out data (have argument indicate non-track data) */ if( ( io_handle->mode == 1 ) || ( io_handle->mode == 2 ) ) { read_size = 4; if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } /* TODO determine missing data instead of 0 fill */ if( memory_set( &( buffer[ buffer_offset ] ), 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set sector checksum in buffer.", function ); return( -1 ); } buffer_offset += read_size; if( buffer_offset >= buffer_size ) { break; } } if( io_handle->mode == 1 ) { read_size = 8; if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } if( memory_set( &( buffer[ buffer_offset ] ), 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set sector reserved in buffer.", function ); return( -1 ); } buffer_offset += read_size; if( buffer_offset >= buffer_size ) { break; } } if( ( io_handle->mode == 1 ) || ( io_handle->mode == 2 ) ) { read_size = 276; if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } /* TODO determine missing data instead of 0 fill */ if( memory_set( &( buffer[ buffer_offset ] ), 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set sector error correction data in buffer.", function ); return( -1 ); } buffer_offset += read_size; if( buffer_offset >= buffer_size ) { break; } } else { read_size = 288; if( ( read_size + buffer_offset ) > buffer_size ) { read_size = buffer_size - buffer_offset; } if( memory_set( &( buffer[ buffer_offset ] ), 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set sector data in buffer.", function ); return( -1 ); } buffer_offset += read_size; if( buffer_offset >= buffer_size ) { break; } } } sector_index++; } return( (ssize_t) buffer_offset ); } libewf-20140807/libodraw/libodraw_sector_range.c0000664000175000017500000001223513443450062023642 0ustar00lordyestalordyesta00000000000000/* * Sector range functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_libcerror.h" #include "libodraw_sector_range.h" /* Creates a sector range * Make sure the value sector_range is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libodraw_sector_range_initialize( libodraw_sector_range_t **sector_range, libcerror_error_t **error ) { static char *function = "libodraw_sector_range_initialize"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( *sector_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sector range value already set.", function ); return( -1 ); } *sector_range = memory_allocate_structure( libodraw_sector_range_t ); if( *sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sector range.", function ); goto on_error; } if( memory_set( *sector_range, 0, sizeof( libodraw_sector_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear sector range.", function ); goto on_error; } return( 1 ); on_error: if( *sector_range != NULL ) { memory_free( *sector_range ); *sector_range = NULL; } return( -1 ); } /* Frees a sector range * Returns 1 if successful or -1 on error */ int libodraw_sector_range_free( libodraw_sector_range_t **sector_range, libcerror_error_t **error ) { static char *function = "libodraw_sector_range_free"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( *sector_range != NULL ) { memory_free( *sector_range ); *sector_range = NULL; } return( 1 ); } /* Retrieves a sector range * Returns 1 if successful or -1 on error */ int libodraw_sector_range_get( libodraw_sector_range_t *sector_range, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { static char *function = "libodraw_sector_range_get"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( start_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid start sector.", function ); return( -1 ); } if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sectors.", function ); return( -1 ); } *start_sector = sector_range->start_sector; *number_of_sectors = sector_range->number_of_sectors; return( 1 ); } /* Sets a sector range * Returns 1 if successful or -1 on error */ int libodraw_sector_range_set( libodraw_sector_range_t *sector_range, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { static char *function = "libodraw_sector_range_set"; if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sector range.", function ); return( -1 ); } if( start_sector > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid start sector value exceeds maximum.", function ); return( -1 ); } if( number_of_sectors > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of sectors value exceeds maximum.", function ); return( -1 ); } sector_range->start_sector = start_sector; sector_range->end_sector = start_sector + number_of_sectors; sector_range->number_of_sectors = number_of_sectors; return( 1 ); } libewf-20140807/libodraw/libodraw_data_file_descriptor.h0000664000175000017500000000557013443450062025346 0ustar00lordyestalordyesta00000000000000/* * Data file descriptor functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_DATA_FILE_DESCRIPTOR_H ) #define _LIBODRAW_DATA_FILE_DESCRIPTOR_H #include #include #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libodraw_data_file_descriptor libodraw_data_file_descriptor_t; struct libodraw_data_file_descriptor { /* The name */ system_character_t *name; /* The name size */ size_t name_size; /* Value to indicate the name was set by the data_file_set_filename functions */ uint8_t name_set; /* The type */ uint8_t type; }; int libodraw_data_file_descriptor_initialize( libodraw_data_file_descriptor_t **data_file_descriptor, libcerror_error_t **error ); int libodraw_data_file_descriptor_free( libodraw_data_file_descriptor_t **data_file_descriptor, libcerror_error_t **error ); int libodraw_data_file_descriptor_get_name_size( libodraw_data_file_descriptor_t *data_file_descriptor, size_t *name_size, libcerror_error_t **error ); int libodraw_data_file_descriptor_get_name( libodraw_data_file_descriptor_t *data_file_descriptor, char *name, size_t name_size, libcerror_error_t **error ); int libodraw_data_file_descriptor_set_name( libodraw_data_file_descriptor_t *data_file_descriptor, const char *name, size_t name_length, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libodraw_data_file_descriptor_get_name_size_wide( libodraw_data_file_descriptor_t *data_file_descriptor, size_t *name_size, libcerror_error_t **error ); int libodraw_data_file_descriptor_get_name_wide( libodraw_data_file_descriptor_t *data_file_descriptor, wchar_t *name, size_t name_size, libcerror_error_t **error ); int libodraw_data_file_descriptor_set_name_wide( libodraw_data_file_descriptor_t *data_file_descriptor, const wchar_t *name, size_t name_length, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_DATA_FILE_DESCRIPTOR_H ) */ libewf-20140807/libodraw/Makefile.in0000664000175000017500000011405613443455350021216 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libodraw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libodraw_la_LIBADD = am__libodraw_la_SOURCES_DIST = libodraw_codepage.h \ libodraw_cue_parser.y libodraw_cue_scanner.l \ libodraw_data_file.c libodraw_data_file.h \ libodraw_data_file_descriptor.c \ libodraw_data_file_descriptor.h libodraw_debug.c \ libodraw_debug.h libodraw_definitions.h libodraw_error.c \ libodraw_error.h libodraw_extern.h libodraw_handle.c \ libodraw_handle.h libodraw_io_handle.c libodraw_io_handle.h \ libodraw_libbfio.h libodraw_libcdata.h libodraw_libcerror.h \ libodraw_libclocale.h libodraw_libcnotify.h \ libodraw_libcpath.h libodraw_libuna.h libodraw_notify.c \ libodraw_notify.h libodraw_sector_range.c \ libodraw_sector_range.h libodraw_support.c libodraw_support.h \ libodraw_track_value.c libodraw_track_value.h libodraw_types.h \ libodraw_unused.h @HAVE_LOCAL_LIBODRAW_TRUE@am_libodraw_la_OBJECTS = \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_cue_parser.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_cue_scanner.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_data_file.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_data_file_descriptor.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_debug.lo libodraw_error.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_handle.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_io_handle.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_notify.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_sector_range.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_support.lo \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_track_value.lo libodraw_la_OBJECTS = $(am_libodraw_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBODRAW_TRUE@am_libodraw_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libodraw_cue_parser.Plo \ ./$(DEPDIR)/libodraw_cue_scanner.Plo \ ./$(DEPDIR)/libodraw_data_file.Plo \ ./$(DEPDIR)/libodraw_data_file_descriptor.Plo \ ./$(DEPDIR)/libodraw_debug.Plo ./$(DEPDIR)/libodraw_error.Plo \ ./$(DEPDIR)/libodraw_handle.Plo \ ./$(DEPDIR)/libodraw_io_handle.Plo \ ./$(DEPDIR)/libodraw_notify.Plo \ ./$(DEPDIR)/libodraw_sector_range.Plo \ ./$(DEPDIR)/libodraw_support.Plo \ ./$(DEPDIR)/libodraw_track_value.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = SOURCES = $(libodraw_la_SOURCES) DIST_SOURCES = $(am__libodraw_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/ylwrap libodraw_cue_parser.c \ libodraw_cue_parser.h libodraw_cue_scanner.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_LFLAGS = -Cf AM_YFLAGS = -d -v -l -p cue_scanner_ @HAVE_LOCAL_LIBODRAW_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBODRAW_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBODRAW_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @LIBBFIO_CPPFLAGS@ \ @HAVE_LOCAL_LIBODRAW_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBODRAW_TRUE@BUILT_SOURCES = libodraw_cue_parser.h @HAVE_LOCAL_LIBODRAW_TRUE@noinst_LTLIBRARIES = libodraw.la @HAVE_LOCAL_LIBODRAW_TRUE@libodraw_la_SOURCES = \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_codepage.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_cue_parser.y \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_cue_scanner.l \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_data_file.c libodraw_data_file.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_data_file_descriptor.c libodraw_data_file_descriptor.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_debug.c libodraw_debug.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_definitions.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_error.c libodraw_error.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_extern.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_handle.c libodraw_handle.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_io_handle.c libodraw_io_handle.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libbfio.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libcdata.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libcerror.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libclocale.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libcnotify.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libcpath.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_libuna.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_notify.c libodraw_notify.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_sector_range.c libodraw_sector_range.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_support.c libodraw_support.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_track_value.c libodraw_track_value.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_types.h \ @HAVE_LOCAL_LIBODRAW_TRUE@ libodraw_unused.h EXTRA_DIST = \ libodraw_cue_parser.c libodraw_cue_parser.h \ libodraw_cue_scanner.c MAINTAINERCLEANFILES = \ Makefile.in all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libodraw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libodraw/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodraw_cue_parser.h: libodraw_cue_parser.c @if test ! -f $@; then rm -f libodraw_cue_parser.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) libodraw_cue_parser.c; else :; fi libodraw.la: $(libodraw_la_OBJECTS) $(libodraw_la_DEPENDENCIES) $(EXTRA_libodraw_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libodraw_la_rpath) $(libodraw_la_OBJECTS) $(libodraw_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_cue_parser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_cue_scanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_data_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_data_file_descriptor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_sector_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libodraw_track_value.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f libodraw_cue_parser.c -rm -f libodraw_cue_parser.h -rm -f libodraw_cue_scanner.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libodraw_cue_parser.Plo -rm -f ./$(DEPDIR)/libodraw_cue_scanner.Plo -rm -f ./$(DEPDIR)/libodraw_data_file.Plo -rm -f ./$(DEPDIR)/libodraw_data_file_descriptor.Plo -rm -f ./$(DEPDIR)/libodraw_debug.Plo -rm -f ./$(DEPDIR)/libodraw_error.Plo -rm -f ./$(DEPDIR)/libodraw_handle.Plo -rm -f ./$(DEPDIR)/libodraw_io_handle.Plo -rm -f ./$(DEPDIR)/libodraw_notify.Plo -rm -f ./$(DEPDIR)/libodraw_sector_range.Plo -rm -f ./$(DEPDIR)/libodraw_support.Plo -rm -f ./$(DEPDIR)/libodraw_track_value.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f libodraw_cue_parser.c /bin/rm -f libodraw_cue_parser.h /bin/rm -f libodraw_cue_parser.output /bin/rm -f libodraw_cue_scanner.c /bin/rm -f Makefile splint: @echo "Running splint on libodraw ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libodraw_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libodraw/libodraw_error.c0000664000175000017500000000554013443450062022321 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_error.h" #include "libodraw_libcerror.h" #if !defined( HAVE_LOCAL_LIBODRAW ) /* Free an error and its elements */ void libodraw_error_free( libodraw_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libodraw_error_fprint( libodraw_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libodraw_error_sprint( libodraw_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libodraw_error_backtrace_fprint( libodraw_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libodraw_error_backtrace_sprint( libodraw_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ libewf-20140807/libodraw/libodraw_debug.h0000664000175000017500000000234713443450062022265 0ustar00lordyestalordyesta00000000000000/* * Debug functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_DEBUG_H ) #define _LIBODRAW_DEBUG_H #include #include #include "libodraw_libbfio.h" #include "libodraw_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_DEBUG_OUTPUT ) int libodraw_debug_print_read_offsets( libbfio_handle_t *file_io_handle, libcerror_error_t **error ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_DEBUG_H ) */ libewf-20140807/libodraw/libodraw_notify.c0000664000175000017500000000530413443450062022476 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libodraw_libcerror.h" #include "libodraw_libcnotify.h" #include "libodraw_notify.h" #if !defined( HAVE_LOCAL_LIBODRAW ) /* Sets the verbose notification */ void libodraw_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libodraw_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libodraw_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libodraw_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libodraw_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libodraw_notify_stream_close( libcerror_error_t **error ) { static char *function = "libodraw_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ libewf-20140807/libodraw/libodraw_error.h0000664000175000017500000000340513443450062022324 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2019, 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( _LIBODRAW_INTERNAL_ERROR_H ) #define _LIBODRAW_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBODRAW ) #include #endif #include "libodraw_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBODRAW ) LIBODRAW_EXTERN \ void libodraw_error_free( libodraw_error_t **error ); LIBODRAW_EXTERN \ int libodraw_error_fprint( libodraw_error_t *error, FILE *stream ); LIBODRAW_EXTERN \ int libodraw_error_sprint( libodraw_error_t *error, char *string, size_t size ); LIBODRAW_EXTERN \ int libodraw_error_backtrace_fprint( libodraw_error_t *error, FILE *stream ); LIBODRAW_EXTERN \ int libodraw_error_backtrace_sprint( libodraw_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBODRAW ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBODRAW_INTERNAL_ERROR_H ) */ libewf-20140807/libodraw/libodraw_definitions.h0000664000175000017500000000575713443450062023522 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (c) 2010-2013-2011, 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( _LIBODRAW_INTERNAL_DEFINITIONS_H ) #define _LIBODRAW_INTERNAL_DEFINITIONS_H #include #include #define LIBODRAW_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBODRAW_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE /* Define HAVE_LOCAL_LIBODRAW for local use of libodraw */ #if !defined( HAVE_LOCAL_LIBODRAW ) #include /* The definitions in are copied here * for local use of libodraw */ #else #define LIBODRAW_VERSION 20190118 /* The version string */ #define LIBODRAW_VERSION_STRING "20190118" /* The access flags definitions * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3-8 not used */ enum LIBODRAW_ACCESS_FLAGS { LIBODRAW_ACCESS_FLAG_READ = 0x01, /* Reserved: not supported yet */ LIBODRAW_ACCESS_FLAG_WRITE = 0x02 }; /* The file access macros */ #define LIBODRAW_OPEN_READ ( LIBODRAW_ACCESS_FLAG_READ ) /* Reserved: not supported yet */ #define LIBODRAW_OPEN_WRITE ( LIBODRAW_ACCESS_FLAG_WRITE ) /* Reserved: not supported yet */ #define LIBODRAW_OPEN_READ_WRITE ( LIBODRAW_ACCESS_FLAG_READ | LIBODRAW_ACCESS_FLAG_WRITE ) /* The file types */ enum LIBODRAW_FILE_TYPES { LIBODRAW_FILE_TYPE_UNKNOWN, LIBODRAW_FILE_TYPE_BINARY_LITTLE_ENDIAN, LIBODRAW_FILE_TYPE_BINARY_BIG_ENDIAN, LIBODRAW_FILE_TYPE_AUDIO_AIFF, LIBODRAW_FILE_TYPE_AUDIO_WAVE, LIBODRAW_FILE_TYPE_AUDIO_MPEG1_LAYER3, }; #define LIBODRAW_FILE_TYPE_BINARY LIBODRAW_FILE_TYPE_BINARY_LITTLE_ENDIAN #define LIBODRAW_FILE_TYPE_MOTOROLA LIBODRAW_FILE_TYPE_BINARY_BIG_ENDIAN #define LIBODRAW_FILE_TYPE_AIFF LIBODRAW_FILE_TYPE_AUDIO_AIFF #define LIBODRAW_FILE_TYPE_WAVE LIBODRAW_FILE_TYPE_AUDIO_WAVE #define LIBODRAW_FILE_TYPE_MP3 LIBODRAW_FILE_TYPE_AUDIO_MPEG1_LAYER3 /* The track types */ enum LIBODRAW_TRACK_TYPES { LIBODRAW_TRACK_TYPE_UNKNOWN, LIBODRAW_TRACK_TYPE_AUDIO, LIBODRAW_TRACK_TYPE_CDG, LIBODRAW_TRACK_TYPE_MODE1_2048, LIBODRAW_TRACK_TYPE_MODE1_2352, LIBODRAW_TRACK_TYPE_MODE2_2048, LIBODRAW_TRACK_TYPE_MODE2_2324, LIBODRAW_TRACK_TYPE_MODE2_2336, LIBODRAW_TRACK_TYPE_MODE2_2352, LIBODRAW_TRACK_TYPE_CDI_2336, LIBODRAW_TRACK_TYPE_CDI_2352, }; #endif #endif libewf-20140807/libodraw/libodraw_cue_parser.h0000664000175000017500000001035313443450232023322 0ustar00lordyestalordyesta00000000000000/* A Bison parser, made by GNU Bison 3.0.5. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_CUE_SCANNER_LIBODRAW_CUE_PARSER_H_INCLUDED # define YY_CUE_SCANNER_LIBODRAW_CUE_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int cue_scanner_debug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { CUE_END_OF_LINE = 258, CUE_SEMI_COLON = 259, CUE_2DIGIT = 260, CUE_CATALOG_NUMBER = 261, CUE_ISRC_CODE = 262, CUE_KEYWORD_STRING = 263, CUE_MSF = 264, CUE_STRING = 265, CUE_CATALOG = 266, CUE_CDTEXTFILE = 267, CUE_FLAGS = 268, CUE_FILE = 269, CUE_INDEX = 270, CUE_ISRC = 271, CUE_POSTGAP = 272, CUE_PREGAP = 273, CUE_REMARK = 274, CUE_TRACK = 275, CUE_CDTEXT_ARRANGER = 276, CUE_CDTEXT_COMPOSER = 277, CUE_CDTEXT_DISC_ID = 278, CUE_CDTEXT_GENRE = 279, CUE_CDTEXT_MESSAGE = 280, CUE_CDTEXT_PERFORMER = 281, CUE_CDTEXT_SIZE_INFO = 282, CUE_CDTEXT_SONGWRITER = 283, CUE_CDTEXT_TITLE = 284, CUE_CDTEXT_TOC_INFO1 = 285, CUE_CDTEXT_TOC_INFO2 = 286, CUE_CDTEXT_UPC_EAN = 287, CUE_REMARK_LEAD_OUT = 288, CUE_REMARK_ORIGINAL_MEDIA_TYPE = 289, CUE_REMARK_RUN_OUT = 290, CUE_REMARK_SESSION = 291 }; #endif /* Tokens. */ #define CUE_END_OF_LINE 258 #define CUE_SEMI_COLON 259 #define CUE_2DIGIT 260 #define CUE_CATALOG_NUMBER 261 #define CUE_ISRC_CODE 262 #define CUE_KEYWORD_STRING 263 #define CUE_MSF 264 #define CUE_STRING 265 #define CUE_CATALOG 266 #define CUE_CDTEXTFILE 267 #define CUE_FLAGS 268 #define CUE_FILE 269 #define CUE_INDEX 270 #define CUE_ISRC 271 #define CUE_POSTGAP 272 #define CUE_PREGAP 273 #define CUE_REMARK 274 #define CUE_TRACK 275 #define CUE_CDTEXT_ARRANGER 276 #define CUE_CDTEXT_COMPOSER 277 #define CUE_CDTEXT_DISC_ID 278 #define CUE_CDTEXT_GENRE 279 #define CUE_CDTEXT_MESSAGE 280 #define CUE_CDTEXT_PERFORMER 281 #define CUE_CDTEXT_SIZE_INFO 282 #define CUE_CDTEXT_SONGWRITER 283 #define CUE_CDTEXT_TITLE 284 #define CUE_CDTEXT_TOC_INFO1 285 #define CUE_CDTEXT_TOC_INFO2 286 #define CUE_CDTEXT_UPC_EAN 287 #define CUE_REMARK_LEAD_OUT 288 #define CUE_REMARK_ORIGINAL_MEDIA_TYPE 289 #define CUE_REMARK_RUN_OUT 290 #define CUE_REMARK_SESSION 291 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { /* The numeric value */ uint32_t numeric_value; /* The string value */ struct cue_string_value { /* The string data */ const char *data; /* The string length */ size_t length; } string_value; }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE cue_scanner_lval; int cue_scanner_parse (void *parser_state); #endif /* !YY_CUE_SCANNER_LIBODRAW_CUE_PARSER_H_INCLUDED */ libewf-20140807/libodraw/libodraw_handle.c0000664000175000017500000053315013443450062022426 0ustar00lordyestalordyesta00000000000000/* * Handle functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include #include #include #include "libodraw_codepage.h" #include "libodraw_cue_parser.h" #include "libodraw_data_file.h" #include "libodraw_data_file_descriptor.h" #include "libodraw_debug.h" #include "libodraw_definitions.h" #include "libodraw_io_handle.h" #include "libodraw_handle.h" #include "libodraw_libbfio.h" #include "libodraw_libcdata.h" #include "libodraw_libcerror.h" #include "libodraw_libclocale.h" #include "libodraw_libcnotify.h" #include "libodraw_libcpath.h" #include "libodraw_libuna.h" #include "libodraw_sector_range.h" #include "libodraw_track_value.h" #include "libodraw_types.h" extern int cue_parser_parse_buffer( libodraw_handle_t *handle, const uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); /* Creates a handle * Make sure the value handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libodraw_handle_initialize( libodraw_handle_t **handle, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_initialize"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle value already set.", function ); return( -1 ); } internal_handle = memory_allocate_structure( libodraw_internal_handle_t ); if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create handle.", function ); return( -1 ); } if( memory_set( internal_handle, 0, sizeof( libodraw_internal_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear handle.", function ); memory_free( internal_handle ); return( -1 ); } if( libcdata_array_initialize( &( internal_handle->data_file_descriptors_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data file descriptors array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->sessions_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sessions array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->run_outs_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create run-outs array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->lead_outs_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create lead-outs array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_handle->tracks_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create tracks array.", function ); goto on_error; } if( libodraw_io_handle_initialize( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create IO handle.", function ); goto on_error; } internal_handle->maximum_number_of_open_handles = LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES; *handle = (libodraw_handle_t *) internal_handle; return( 1 ); on_error: if( internal_handle != NULL ) { if( internal_handle->tracks_array != NULL ) { libcdata_array_free( &( internal_handle->tracks_array ), NULL, NULL ); } if( internal_handle->lead_outs_array != NULL ) { libcdata_array_free( &( internal_handle->lead_outs_array ), NULL, NULL ); } if( internal_handle->run_outs_array != NULL ) { libcdata_array_free( &( internal_handle->run_outs_array ), NULL, NULL ); } if( internal_handle->sessions_array != NULL ) { libcdata_array_free( &( internal_handle->sessions_array ), NULL, NULL ); } if( internal_handle->data_file_descriptors_array != NULL ) { libcdata_array_free( &( internal_handle->data_file_descriptors_array ), NULL, NULL ); } memory_free( internal_handle ); } return( -1 ); } /* Frees a handle * Returns 1 if successful or -1 on error */ int libodraw_handle_free( libodraw_handle_t **handle, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_free"; int result = 1; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( *handle != NULL ) { internal_handle = (libodraw_internal_handle_t *) *handle; if( ( internal_handle->toc_file_io_handle != NULL ) || ( internal_handle->data_file_io_pool != NULL ) ) { if( libodraw_handle_close( *handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); result = -1; } } *handle = NULL; if( libcdata_array_free( &( internal_handle->data_file_descriptors_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_data_file_descriptor_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free files array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->sessions_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sessions array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->run_outs_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free run-outs array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->lead_outs_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free lead-outs array.", function ); result = -1; } if( libcdata_array_free( &( internal_handle->tracks_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free tracks array.", function ); result = -1; } if( internal_handle->basename != NULL ) { memory_free( internal_handle->basename ); } if( libodraw_io_handle_free( &( internal_handle->io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free IO handle.", function ); result = -1; } memory_free( internal_handle ); } return( result ); } /* Signals the handle to abort its current activity * Returns 1 if successful or -1 on error */ int libodraw_handle_signal_abort( libodraw_handle_t *handle, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_signal_abort"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } internal_handle->io_handle->abort = 1; return( 1 ); } /* Opens a handle using a table of contents (TOC) file * Returns 1 if successful or -1 on error */ int libodraw_handle_open( libodraw_handle_t *handle, const char *filename, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libodraw_internal_handle_t *internal_handle = NULL; char *basename_end = NULL; static char *function = "libodraw_handle_open"; size_t basename_length = 0; size_t filename_length = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( ( access_flags & LIBODRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( ( access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); return( -1 ); } filename_length = narrow_string_length( filename ); basename_end = narrow_string_search_character_reverse( filename, (int) LIBCPATH_SEPARATOR, filename_length + 1 ); if( basename_end != NULL ) { basename_length = (size_t) ( basename_end - filename ) + 1; } if( basename_length > 0 ) { if( libodraw_handle_set_basename( internal_handle, filename, basename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename.", function ); goto on_error; } } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle.", function ); goto on_error; } #endif if( libbfio_file_set_name( file_io_handle, filename, filename_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } if( libodraw_handle_open_file_io_handle( handle, file_io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %s.", function, filename ); goto on_error; } internal_handle->toc_file_io_handle_created_in_library = 1; return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a handle using a table of contents (TOC) file * Returns 1 if successful or -1 on error */ int libodraw_handle_open_wide( libodraw_handle_t *handle, const wchar_t *filename, int access_flags, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; libodraw_internal_handle_t *internal_handle = NULL; wchar_t *basename_end = NULL; static char *function = "libodraw_handle_open_wide"; size_t basename_length = 0; size_t filename_length = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( ( access_flags & LIBODRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( ( access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); return( -1 ); } filename_length = wide_string_length( filename ); /* TODO does this work for UTF-16 ? */ basename_end = wide_string_search_character_reverse( filename, (wint_t) LIBCPATH_SEPARATOR, filename_length + 1 ); if( basename_end != NULL ) { basename_length = (size_t) ( basename_end - filename ) + 1; } if( basename_length > 0 ) { if( libodraw_handle_set_basename_wide( internal_handle, filename, basename_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set basename.", function ); goto on_error; } } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle.", function ); goto on_error; } #endif if( libbfio_file_set_name_wide( file_io_handle, filename, wide_string_length( filename ) + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } if( libodraw_handle_open_file_io_handle( handle, file_io_handle, access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %ls.", function, filename ); goto on_error; } internal_handle->toc_file_io_handle_created_in_library = 1; return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Opens a handle using a Basic File IO (bfio) handle of a table of contents (TOC) file * Returns 1 if successful or -1 on error */ int libodraw_handle_open_file_io_handle( libodraw_handle_t *handle, libbfio_handle_t *file_io_handle, int access_flags, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_open_file_io_handle"; int bfio_access_flags = 0; int file_io_handle_is_open = 0; int file_io_handle_opened_in_library = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->toc_file_io_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - file IO handle already set.", function ); return( -1 ); } if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( ( ( access_flags & LIBODRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( ( access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); return( -1 ); } if( ( access_flags & LIBODRAW_ACCESS_FLAG_READ ) != 0 ) { bfio_access_flags = LIBBFIO_ACCESS_FLAG_READ; } file_io_handle_is_open = libbfio_handle_is_open( file_io_handle, error ); if( file_io_handle_is_open == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); goto on_error; } else if( file_io_handle_is_open == 0 ) { if( libbfio_handle_open( file_io_handle, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file IO handle.", function ); goto on_error; } file_io_handle_opened_in_library = 1; } if( libodraw_handle_open_read( internal_handle, file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from handle.", function ); goto on_error; } internal_handle->access_flags = access_flags; internal_handle->toc_file_io_handle = file_io_handle; internal_handle->toc_file_io_handle_opened_in_library = file_io_handle_opened_in_library; return( 1 ); on_error: if( ( file_io_handle_is_open == 0 ) && ( file_io_handle_opened_in_library != 0 ) ) { libbfio_handle_close( file_io_handle, error ); } return( -1 ); } /* Opens the data files * If the data filenames were not set explicitly this function assumes the data files * are in the same location as the table of contents (TOC) file * Returns 1 if successful or -1 on error */ int libodraw_handle_open_data_files( libodraw_handle_t *handle, libcerror_error_t **error ) { libodraw_data_file_descriptor_t *data_file_descriptor = NULL; libodraw_internal_handle_t *internal_handle = NULL; system_character_t *data_file_location = NULL; system_character_t *data_file_name_start = NULL; static char *function = "libodraw_handle_open_data_files"; size_t data_file_location_size = 0; size_t data_file_name_size = 0; int data_file_descriptor_index = 0; int number_of_data_file_descriptors = 0; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->toc_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing TOC file IO handle.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->data_file_descriptors_array, &number_of_data_file_descriptors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of data file descriptors.", function ); return( -1 ); } for( data_file_descriptor_index = 0; data_file_descriptor_index < number_of_data_file_descriptors; data_file_descriptor_index++ ) { if( libcdata_array_get_entry_by_index( internal_handle->data_file_descriptors_array, data_file_descriptor_index, (intptr_t **) &data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file descriptor: %d.", function, data_file_descriptor_index ); goto on_error; } if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing data file descriptor: %d.", function, data_file_descriptor_index ); goto on_error; } if( ( data_file_descriptor->name == NULL ) || ( data_file_descriptor->name_size == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file descriptor: %d - missing name.", function, data_file_descriptor_index ); goto on_error; } if( data_file_descriptor->name_set == 0 ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) data_file_name_start = wide_string_search_character_reverse( data_file_descriptor->name, (wint_t) LIBCPATH_SEPARATOR, data_file_descriptor->name_size ); #else data_file_name_start = narrow_string_search_character_reverse( data_file_descriptor->name, (int) LIBCPATH_SEPARATOR, data_file_descriptor->name_size ); #endif } if( data_file_name_start != NULL ) { /* Ignore the path separator itself */ data_file_name_start++; /* TODO does this work for UTF-16 ? */ data_file_name_size = (size_t) ( data_file_name_start - data_file_descriptor->name ); } else { data_file_name_start = data_file_descriptor->name; data_file_name_size = data_file_descriptor->name_size; } if( ( data_file_descriptor->name_set == 0 ) && ( internal_handle->basename != NULL ) ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_join_wide( &data_file_location, &data_file_location_size, internal_handle->basename, internal_handle->basename_size - 1, data_file_name_start, data_file_name_size - 1, error ) != 1 ) #else if( libcpath_path_join( &data_file_location, &data_file_location_size, internal_handle->basename, internal_handle->basename_size - 1, data_file_name_start, data_file_name_size - 1, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data file location.", function ); goto on_error; } } else { data_file_location = data_file_name_start; data_file_location_size = data_file_name_size; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libodraw_handle_open_data_file_wide( internal_handle, data_file_descriptor_index, data_file_location, error ); #else result = libodraw_handle_open_data_file( internal_handle, data_file_descriptor_index, data_file_location, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open data file: %" PRIs_SYSTEM ".", function, data_file_location ); goto on_error; } if( ( data_file_location != NULL ) && ( data_file_location != data_file_name_start ) ) { memory_free( data_file_location ); } data_file_name_start = NULL; data_file_location = NULL; } if( libodraw_handle_set_media_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media values.", function ); goto on_error; } return( 1 ); on_error: if( ( data_file_location != NULL ) && ( data_file_location != data_file_name_start ) ) { memory_free( data_file_location ); } return( -1 ); } /* Opens the data files using a Basic File IO (bfio) pool * This function assumes the data files are in same order as defined by the table of contents (TOC) file * Returns 1 if successful or -1 on error */ int libodraw_handle_open_data_files_file_io_pool( libodraw_handle_t *handle, libbfio_pool_t *file_io_pool, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_open_data_files_file_io_pool"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->toc_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing TOC file IO handle.", function ); return( -1 ); } if( internal_handle->data_file_io_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid handle - data file IO pool already exists.", function ); return( -1 ); } if( file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO pool.", function ); return( -1 ); } internal_handle->data_file_io_pool = file_io_pool; if( libodraw_handle_set_media_values( internal_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media values.", function ); return( -1 ); } return( 1 ); } /* Opens a specific data file * Returns 1 if successful or -1 on error */ int libodraw_handle_open_data_file( libodraw_internal_handle_t *internal_handle, int data_file_index, const char *filename, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libodraw_handle_open_data_file"; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->toc_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing TOC file IO handle.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle.", function ); goto on_error; } #endif if( libbfio_file_set_name( file_io_handle, filename, narrow_string_length( filename ) + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } if( libodraw_handle_open_data_file_io_handle( internal_handle, data_file_index, file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open data file: %s.", function, filename ); goto on_error; } return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a specific data file * Returns 1 if successful or -1 on error */ int libodraw_handle_open_data_file_wide( libodraw_internal_handle_t *internal_handle, int data_file_index, const wchar_t *filename, libcerror_error_t **error ) { libbfio_handle_t *file_io_handle = NULL; static char *function = "libodraw_handle_open_data_file_wide"; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->toc_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing TOC file IO handle.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libbfio_file_initialize( &file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file IO handle.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libbfio_handle_set_track_offsets_read( file_io_handle, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track offsets read in file IO handle.", function ); goto on_error; } #endif if( libbfio_file_set_name_wide( file_io_handle, filename, wide_string_length( filename ) + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in file IO handle.", function ); goto on_error; } if( libodraw_handle_open_data_file_io_handle( internal_handle, data_file_index, file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open data file: %ls.", function, filename ); goto on_error; } return( 1 ); on_error: if( file_io_handle != NULL ) { libbfio_handle_free( &file_io_handle, NULL ); } return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Opens a data file using a Basic File IO (bfio) handle * Returns 1 if successful or -1 on error */ int libodraw_handle_open_data_file_io_handle( libodraw_internal_handle_t *internal_handle, int data_file_index, libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { static char *function = "libodraw_handle_open_data_file_io_handle"; int bfio_access_flags = 0; int number_of_data_file_descriptors = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->toc_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing TOC file IO handle.", function ); return( -1 ); } if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file IO handle.", function ); return( -1 ); } if( ( ( internal_handle->access_flags & LIBODRAW_ACCESS_FLAG_READ ) == 0 ) && ( ( internal_handle->access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags.", function ); return( -1 ); } if( ( internal_handle->access_flags & LIBODRAW_ACCESS_FLAG_WRITE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); return( -1 ); } if( internal_handle->data_file_io_pool == NULL ) { if( libcdata_array_get_number_of_entries( internal_handle->data_file_descriptors_array, &number_of_data_file_descriptors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of data file descriptors.", function ); return( -1 ); } if( libbfio_pool_initialize( &( internal_handle->data_file_io_pool ), number_of_data_file_descriptors, internal_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data file file IO pool.", function ); return( -1 ); } internal_handle->data_file_io_pool_created_in_library = 1; } if( ( internal_handle->access_flags & LIBODRAW_ACCESS_FLAG_READ ) != 0 ) { bfio_access_flags = LIBBFIO_ACCESS_FLAG_READ; } if( libbfio_handle_open( file_io_handle, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file IO handle.", function ); return( -1 ); } /* This function currently does not allow the file_io_handle to be set more than once */ if( libbfio_pool_set_handle( internal_handle->data_file_io_pool, data_file_index, file_io_handle, bfio_access_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file IO handle: %d in pool.", function, data_file_index ); return( -1 ); } return( 1 ); } /* Closes a handle * Returns 0 if successful or -1 on error */ int libodraw_handle_close( libodraw_handle_t *handle, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_close"; int result = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->toc_file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing TOC file IO handle.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( internal_handle->toc_file_io_handle_created_in_library != 0 ) { if( libodraw_debug_print_read_offsets( internal_handle->toc_file_io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print the read offsets.", function ); result = -1; } } } #endif if( internal_handle->toc_file_io_handle_opened_in_library != 0 ) { if( libbfio_handle_close( internal_handle->toc_file_io_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close TOC file IO handle.", function ); result = -1; } internal_handle->toc_file_io_handle_opened_in_library = 0; } if( internal_handle->toc_file_io_handle_created_in_library != 0 ) { if( libbfio_handle_free( &( internal_handle->toc_file_io_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free TOC file IO handle.", function ); result = -1; } internal_handle->toc_file_io_handle_created_in_library = 0; } internal_handle->toc_file_io_handle = NULL; if( internal_handle->data_file_io_pool != 0 ) { if( internal_handle->data_file_io_pool != NULL ) { if( libbfio_pool_close_all( internal_handle->data_file_io_pool, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable close data files IO pool.", function ); result = -1; } if( libbfio_pool_free( &( internal_handle->data_file_io_pool ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data files IO pool.", function ); result = -1; } } internal_handle->data_file_io_pool_created_in_library = 0; } internal_handle->data_file_io_pool = NULL; internal_handle->current_offset = 0; internal_handle->current_run_out = 0; internal_handle->current_lead_out = 0; internal_handle->current_track = 0; internal_handle->media_size = 0; internal_handle->number_of_sectors = 0; if( libodraw_io_handle_clear( internal_handle->io_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear IO handle.", function ); result = -1; } if( libcdata_array_empty( internal_handle->data_file_descriptors_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_data_file_descriptor_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty data file descriptors array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->run_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty run-outs array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty lead-outs array.", function ); result = -1; } if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); result = -1; } if( internal_handle->basename != NULL ) { memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; } return( result ); } /* Opens a handle for reading * Returns 1 if successful or -1 on error */ int libodraw_handle_open_read( libodraw_internal_handle_t *internal_handle, libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { uint8_t *buffer = NULL; static char *function = "libodraw_handle_open_read"; size64_t file_size = 0; size_t buffer_size = 0; ssize_t read_count = 0; int result = 1; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( libcdata_array_empty( internal_handle->data_file_descriptors_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty data file descriptors array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->sessions_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty sessions array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->run_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty run-outs array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->lead_outs_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_sector_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty lead-outs array.", function ); goto on_error; } if( libcdata_array_empty( internal_handle->tracks_array, (int (*)(intptr_t **, libcerror_error_t **)) &libodraw_track_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty tracks array.", function ); goto on_error; } if( internal_handle->io_handle->abort != 0 ) { internal_handle->io_handle->abort = 0; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "Reading file:\n" ); } #endif if( libbfio_handle_get_size( file_io_handle, &file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve TOC file size.", function ); goto on_error; } if( file_size > (size64_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid file size value exceeds maximum.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading TOC file header at offset: 0 (0x00000000)\n", function ); } #endif if( libbfio_handle_seek_offset( file_io_handle, 0, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek TOC file offset: 0.", function ); goto on_error; } /* Lex wants 2 zero bytes at the end of the buffer */ buffer_size = (size_t) file_size + 2; buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * buffer_size ); if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create buffer.", function ); goto on_error; } read_count = libbfio_handle_read_buffer( file_io_handle, buffer, (size_t) file_size, error ); if( read_count != (ssize_t) file_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read TOC file data.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: file data:\n", function ); libcnotify_print_data( buffer, (size_t) file_size, 0 ); } #endif /* Lex wants 2 zero bytes at the end of the buffer */ buffer[ buffer_size - 2 ] = 0; buffer[ buffer_size - 1 ] = 0; result = cue_parser_parse_buffer( (libodraw_handle_t *) internal_handle, buffer, buffer_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to parse file data.", function ); goto on_error; } memory_free( buffer ); buffer = NULL; if( internal_handle->io_handle->abort != 0 ) { internal_handle->io_handle->abort = 0; } return( result ); on_error: if( buffer != NULL ) { memory_free( buffer ); } return( -1 ); } /* Reads a buffer * Returns the number of bytes read or -1 on error */ ssize_t libodraw_handle_read_buffer( libodraw_handle_t *handle, void *buffer, size_t buffer_size, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_sector_range_t *sector_range = NULL; libodraw_track_value_t *track_value = NULL; static char *function = "libodraw_handle_read_buffer"; size_t buffer_offset = 0; ssize_t read_count = 0; uint64_t current_sector = 0; int in_known_range = 0; int number_of_lead_outs = 0; int number_of_run_outs = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( internal_handle->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle - invalid IO handle - current offset value out of bounds.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->run_outs_array, &number_of_run_outs, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in run-outs array.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->lead_outs_array, &number_of_lead_outs, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in lead-outs array.", function ); return( -1 ); } if( (size64_t) internal_handle->current_offset >= internal_handle->media_size ) { return( 0 ); } current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } while( buffer_offset < buffer_size ) { in_known_range = 0; if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, internal_handle->current_track, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, internal_handle->current_track ); return( -1 ); } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, internal_handle->current_track ); return( -1 ); } /* TODO currently assumes that current track start sector is always relative to the start of the media */ if( ( current_sector >= track_value->start_sector ) && ( current_sector < track_value->end_sector ) ) { in_known_range = 1; read_count = libodraw_handle_read_buffer_from_track( internal_handle, (uint8_t *) &( ( (uint8_t *) buffer )[ buffer_offset ] ), buffer_size - buffer_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from track: %d.", function, internal_handle->current_track ); return( -1 ); } buffer_offset += read_count; internal_handle->current_offset += (off64_t) read_count; current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } if( current_sector >= track_value->end_sector ) { internal_handle->current_track += 1; } } if( buffer_offset >= buffer_size ) { break; } if( (size64_t) internal_handle->current_offset >= internal_handle->media_size ) { break; } if( internal_handle->current_run_out < number_of_run_outs ) { if( libcdata_array_get_entry_by_index( internal_handle->run_outs_array, internal_handle->current_run_out, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve run-out sector range: %d from array.", function, internal_handle->current_run_out ); return( -1 ); } if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing run-out sector range: %d.", function, internal_handle->current_run_out ); return( -1 ); } /* TODO currently assumes that current run-out start sector is always relative to the start of the media */ if( ( current_sector >= sector_range->start_sector ) && ( current_sector < sector_range->end_sector ) ) { in_known_range = 1; read_count = libodraw_handle_read_buffer_from_run_out( internal_handle, (uint8_t *) &( ( (uint8_t *) buffer )[ buffer_offset ] ), buffer_size - buffer_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from run-out: %d.", function, internal_handle->current_run_out ); return( -1 ); } buffer_offset += read_count; internal_handle->current_offset += (off64_t) read_count; current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } if( current_sector >= sector_range->end_sector ) { internal_handle->current_run_out += 1; } } if( buffer_offset >= buffer_size ) { break; } if( (size64_t) internal_handle->current_offset >= internal_handle->media_size ) { break; } } if( internal_handle->current_lead_out < number_of_lead_outs ) { if( libcdata_array_get_entry_by_index( internal_handle->lead_outs_array, internal_handle->current_lead_out, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve lead-out sector range: %d from array.", function, internal_handle->current_lead_out ); return( -1 ); } if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing lead-out sector range: %d.", function, internal_handle->current_lead_out ); return( -1 ); } /* TODO currently assumes that current lead-out start sector is always relative to the start of the media */ if( ( current_sector >= sector_range->start_sector ) && ( current_sector < sector_range->end_sector ) ) { in_known_range = 1; read_count = libodraw_handle_read_buffer_from_lead_out( internal_handle, (uint8_t *) &( ( (uint8_t *) buffer )[ buffer_offset ] ), buffer_size - buffer_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from lead-out: %d.", function, internal_handle->current_lead_out ); return( -1 ); } buffer_offset += read_count; internal_handle->current_offset += (off64_t) read_count; current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } if( current_sector >= sector_range->end_sector ) { internal_handle->current_lead_out += 1; } } if( buffer_offset >= buffer_size ) { break; } if( (size64_t) internal_handle->current_offset >= internal_handle->media_size ) { break; } } if( in_known_range == 0 ) { read_count = libodraw_handle_read_buffer_from_unspecified_sector( internal_handle, (uint8_t *) &( ( (uint8_t *) buffer )[ buffer_offset ] ), buffer_size - buffer_offset, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from unspecified.", function ); return( -1 ); } buffer_offset += read_count; internal_handle->current_offset += (off64_t) read_count; current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } if( current_sector >= track_value->end_sector ) { internal_handle->current_track += 1; } if( buffer_offset >= buffer_size ) { break; } if( (size64_t) internal_handle->current_offset >= internal_handle->media_size ) { break; } } if( internal_handle->io_handle->abort != 0 ) { break; } } return( (size_t) buffer_offset ); } /* Reads a buffer from run-out * Returns the number of bytes read or -1 on error */ ssize_t libodraw_handle_read_buffer_from_run_out( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libodraw_track_value_t *track_value = NULL; libodraw_sector_range_t *sector_range = NULL; uint8_t *read_buffer = NULL; uint8_t *sector_data = NULL; static char *function = "libodraw_handle_read_buffer_from_run_out"; off64_t current_sector_offset = 0; off64_t run_out_data_offset = 0; size64_t data_file_number_of_sectors = 0; size64_t data_file_size = 0; size64_t required_number_of_sectors = 0; uint64_t current_sector = 0; uint64_t run_out_data_start_sector = 0; size_t read_number_of_sectors = 0; size_t read_size = 0; ssize_t read_count = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_handle->run_outs_array, internal_handle->current_run_out, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve run-out sector range: %d from array.", function, internal_handle->current_run_out ); goto on_error; } if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing run-out sector range: %d.", function, internal_handle->current_run_out ); goto on_error; } current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } /* TODO currently assumes that current run-out start sector is always relative to the start of the media */ if( ( current_sector < sector_range->start_sector ) || ( current_sector >= sector_range->end_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading data from run-out: %d at sector(s): %" PRIu64 " - %" PRIu64 "\n", function, internal_handle->current_run_out, sector_range->start_sector, sector_range->end_sector ); } #endif /* Retrieves the track that corresponds to the run-out */ if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, internal_handle->current_track - 1, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, internal_handle->current_track - 1 ); goto on_error; } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, internal_handle->current_track - 1 ); goto on_error; } if( track_value->end_sector != sector_range->start_sector ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: sector range start sector value out of bounds.", function ); goto on_error; } current_sector_offset = internal_handle->current_offset - (off64_t) ( current_sector * internal_handle->io_handle->bytes_per_sector ); if( ( current_sector_offset < 0 ) || ( current_sector_offset >= internal_handle->io_handle->bytes_per_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current sector offset value out of bounds.", function ); goto on_error; } read_number_of_sectors = buffer_size / internal_handle->io_handle->bytes_per_sector; if( ( buffer_size % internal_handle->io_handle->bytes_per_sector ) != 0 ) { read_number_of_sectors += 1; } if( ( (uint64_t) read_number_of_sectors + current_sector ) > sector_range->end_sector ) { read_number_of_sectors = (size_t) ( sector_range->end_sector - current_sector ); } if( libbfio_pool_get_size( internal_handle->data_file_io_pool, track_value->data_file_index, &data_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file: %d size.", function, track_value->data_file_index ); goto on_error; } data_file_number_of_sectors = data_file_size / track_value->bytes_per_sector; /* Determine if the required number of sectors are available in the data file */ required_number_of_sectors = track_value->data_file_start_sector + track_value->number_of_sectors + sector_range->number_of_sectors; if( required_number_of_sectors > data_file_number_of_sectors ) { read_size = ( read_number_of_sectors * internal_handle->io_handle->bytes_per_sector ) - (size_t) current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } /* Fill the buffer with 0 byte values if the run-out data is * not available in the data file */ if( memory_set( buffer, 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy run-out data to buffer.", function ); goto on_error; } read_count = (ssize_t) read_size; } else { run_out_data_start_sector = current_sector - sector_range->start_sector + track_value->number_of_sectors; run_out_data_offset = track_value->data_file_offset + ( run_out_data_start_sector * track_value->bytes_per_sector ); read_size = read_number_of_sectors * track_value->bytes_per_sector; if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { /* TODO use sector data cache ? */ sector_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * read_size ); if( sector_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sector data.", function ); goto on_error; } read_buffer = sector_data; } else { read_buffer = buffer; read_size -= (size_t) current_sector_offset; run_out_data_offset += current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } } if( libbfio_pool_seek_offset( internal_handle->data_file_io_pool, track_value->data_file_index, run_out_data_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek data file: %d offset: %" PRIi64 ".", function, track_value->data_file_index, run_out_data_offset ); goto on_error; } read_count = libbfio_pool_read_buffer( internal_handle->data_file_io_pool, track_value->data_file_index, read_buffer, read_size, error ); if( read_count != (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from data file: %d.", function, track_value->data_file_index ); goto on_error; } if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { read_count = libodraw_io_handle_copy_sector_data_to_buffer( internal_handle->io_handle, sector_data, read_size, track_value->bytes_per_sector, LIBODRAW_TRACK_TYPE_UNKNOWN, buffer, buffer_size, (uint32_t) current_sector, (uint32_t) current_sector_offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy sector data to buffer.", function ); goto on_error; } memory_free( sector_data ); sector_data = NULL; } } return( read_count ); on_error: if( sector_data != NULL ) { memory_free( sector_data ); } return( -1 ); } /* Reads a buffer from lead-out * Returns the number of bytes read or -1 on error */ ssize_t libodraw_handle_read_buffer_from_lead_out( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libodraw_track_value_t *track_value = NULL; libodraw_sector_range_t *sector_range = NULL; uint8_t *read_buffer = NULL; uint8_t *sector_data = NULL; static char *function = "libodraw_handle_read_buffer_from_lead_out"; off64_t current_sector_offset = 0; off64_t lead_out_data_offset = 0; size64_t data_file_number_of_sectors = 0; size64_t data_file_size = 0; size64_t required_number_of_sectors = 0; uint64_t current_sector = 0; uint64_t lead_out_data_start_sector = 0; size_t read_number_of_sectors = 0; size_t read_size = 0; ssize_t read_count = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_handle->lead_outs_array, internal_handle->current_lead_out, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve lead-out sector range: %d from array.", function, internal_handle->current_lead_out ); goto on_error; } if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing lead-out sector range: %d.", function, internal_handle->current_lead_out ); goto on_error; } current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } /* TODO currently assumes that current lead-out start sector is always relative to the start of the media */ if( ( current_sector < sector_range->start_sector ) || ( current_sector >= sector_range->end_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading data from lead-out: %d at sector(s): %" PRIu64 " - %" PRIu64 "\n", function, internal_handle->current_lead_out, sector_range->start_sector, sector_range->end_sector ); } #endif /* Retrieves the track that corresponds to the lead-out */ if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, internal_handle->current_track - 1, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, internal_handle->current_track - 1 ); goto on_error; } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, internal_handle->current_track - 1 ); goto on_error; } if( track_value->end_sector != sector_range->start_sector ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: sector range start sector value out of bounds.", function ); goto on_error; } current_sector_offset = internal_handle->current_offset - (off64_t) ( current_sector * internal_handle->io_handle->bytes_per_sector ); if( ( current_sector_offset < 0 ) || ( current_sector_offset >= internal_handle->io_handle->bytes_per_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current sector offset value out of bounds.", function ); goto on_error; } read_number_of_sectors = buffer_size / internal_handle->io_handle->bytes_per_sector; if( ( buffer_size % internal_handle->io_handle->bytes_per_sector ) != 0 ) { read_number_of_sectors += 1; } if( ( (uint64_t) read_number_of_sectors + current_sector ) > sector_range->end_sector ) { read_number_of_sectors = (size_t) ( sector_range->end_sector - current_sector ); } if( libbfio_pool_get_size( internal_handle->data_file_io_pool, track_value->data_file_index, &data_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file: %d size.", function, track_value->data_file_index ); goto on_error; } data_file_number_of_sectors = data_file_size / track_value->bytes_per_sector; /* Determine if the required number of sectors are available in the data file */ required_number_of_sectors = track_value->data_file_start_sector + track_value->number_of_sectors + sector_range->number_of_sectors; if( required_number_of_sectors > data_file_number_of_sectors ) { read_size = ( read_number_of_sectors * internal_handle->io_handle->bytes_per_sector ) - (size_t) current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } /* Fill the buffer with 0 byte values if the lead-out data is * not available in the data file */ if( memory_set( buffer, 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy lead-out data to buffer.", function ); goto on_error; } read_count = (ssize_t) read_size; } else { lead_out_data_start_sector = current_sector - sector_range->start_sector + track_value->number_of_sectors; lead_out_data_offset = track_value->data_file_offset + ( lead_out_data_start_sector * track_value->bytes_per_sector ); read_size = read_number_of_sectors * track_value->bytes_per_sector; if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { /* TODO use sector data cache ? */ sector_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * read_size ); if( sector_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sector data.", function ); goto on_error; } read_buffer = sector_data; } else { read_buffer = buffer; read_size -= (size_t) current_sector_offset; lead_out_data_offset += current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } } if( libbfio_pool_seek_offset( internal_handle->data_file_io_pool, track_value->data_file_index, lead_out_data_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek data file: %d offset: %" PRIi64 ".", function, track_value->data_file_index, lead_out_data_offset ); goto on_error; } read_count = libbfio_pool_read_buffer( internal_handle->data_file_io_pool, track_value->data_file_index, read_buffer, read_size, error ); if( read_count != (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from data file: %d.", function, track_value->data_file_index ); goto on_error; } if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { read_count = libodraw_io_handle_copy_sector_data_to_buffer( internal_handle->io_handle, sector_data, read_size, track_value->bytes_per_sector, LIBODRAW_TRACK_TYPE_UNKNOWN, buffer, buffer_size, (uint32_t) current_sector, (uint32_t) current_sector_offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy sector data to buffer.", function ); goto on_error; } memory_free( sector_data ); sector_data = NULL; } } return( read_count ); on_error: if( sector_data != NULL ) { memory_free( sector_data ); } return( -1 ); } /* Reads a buffer from a sector in an unspecified range * Returns the number of bytes read or -1 on error */ ssize_t libodraw_handle_read_buffer_from_unspecified_sector( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libodraw_track_value_t *track_value = NULL; uint8_t *read_buffer = NULL; uint8_t *sector_data = NULL; static char *function = "libodraw_handle_read_buffer_from_unspecified_sector"; off64_t current_sector_offset = 0; off64_t unspecified_data_offset = 0; size64_t data_file_number_of_sectors = 0; size64_t data_file_size = 0; size64_t required_number_of_sectors = 0; uint64_t current_sector = 0; uint64_t unspecified_data_start_sector = 0; size_t read_size = 0; ssize_t read_count = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading data from unspecified range.\n", function ); } #endif /* Retrieves the track that corresponds to the unspecified range */ if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, internal_handle->current_track - 1, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, internal_handle->current_track - 1 ); goto on_error; } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, internal_handle->current_track - 1 ); goto on_error; } current_sector_offset = internal_handle->current_offset - (off64_t) ( current_sector * internal_handle->io_handle->bytes_per_sector ); if( ( current_sector_offset < 0 ) || ( current_sector_offset >= internal_handle->io_handle->bytes_per_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current sector offset value out of bounds.", function ); goto on_error; } if( libbfio_pool_get_size( internal_handle->data_file_io_pool, track_value->data_file_index, &data_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file: %d size.", function, track_value->data_file_index ); goto on_error; } data_file_number_of_sectors = data_file_size / track_value->bytes_per_sector; unspecified_data_start_sector = current_sector - track_value->end_sector; /* Determine if the required number of sectors are available in the data file */ required_number_of_sectors = track_value->data_file_start_sector + track_value->number_of_sectors + unspecified_data_start_sector + 1; if( required_number_of_sectors > data_file_number_of_sectors ) { read_size = internal_handle->io_handle->bytes_per_sector - (size_t) current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } /* Fill the buffer with 0 byte values if the unspecified data is * not available in the data file */ if( memory_set( buffer, 0, read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy unspecified data to buffer.", function ); goto on_error; } read_count = (ssize_t) read_size; } else { unspecified_data_offset = track_value->data_file_offset + ( unspecified_data_start_sector * track_value->bytes_per_sector ); read_size = track_value->bytes_per_sector; if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { /* TODO use sector data cache ? */ sector_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * read_size ); if( sector_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sector data.", function ); goto on_error; } read_buffer = sector_data; } else { read_buffer = buffer; read_size -= (size_t) current_sector_offset; unspecified_data_offset += current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } } if( libbfio_pool_seek_offset( internal_handle->data_file_io_pool, track_value->data_file_index, unspecified_data_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek data file: %d offset: %" PRIi64 ".", function, track_value->data_file_index, unspecified_data_offset ); goto on_error; } read_count = libbfio_pool_read_buffer( internal_handle->data_file_io_pool, track_value->data_file_index, read_buffer, read_size, error ); if( read_count != (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from data file: %d.", function, track_value->data_file_index ); goto on_error; } if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { read_count = libodraw_io_handle_copy_sector_data_to_buffer( internal_handle->io_handle, sector_data, read_size, track_value->bytes_per_sector, LIBODRAW_TRACK_TYPE_UNKNOWN, buffer, buffer_size, (uint32_t) current_sector, (uint32_t) current_sector_offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy sector data to buffer.", function ); goto on_error; } memory_free( sector_data ); sector_data = NULL; } } return( read_count ); on_error: if( sector_data != NULL ) { memory_free( sector_data ); } return( -1 ); } /* Reads a buffer from track * Returns the number of bytes read or -1 on error */ ssize_t libodraw_handle_read_buffer_from_track( libodraw_internal_handle_t *internal_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { libodraw_track_value_t *track_value = NULL; uint8_t *read_buffer = NULL; uint8_t *sector_data = NULL; static char *function = "libodraw_handle_read_buffer_from_track"; off64_t current_sector_offset = 0; off64_t track_data_offset = 0; uint64_t current_sector = 0; uint64_t track_data_start_sector = 0; size_t read_number_of_sectors = 0; size_t read_size = 0; ssize_t read_count = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, internal_handle->current_track, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, internal_handle->current_track ); goto on_error; } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, internal_handle->current_track ); goto on_error; } current_sector = (uint64_t) ( internal_handle->current_offset / internal_handle->io_handle->bytes_per_sector ); if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } /* TODO currently assumes that current track start sector is always relative to the start of the media */ if( ( current_sector < track_value->start_sector ) || ( current_sector >= track_value->end_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading data from track: %d at sector(s): %" PRIu64 " - %" PRIu64 "\n", function, internal_handle->current_track, track_value->start_sector, track_value->end_sector ); } #endif current_sector_offset = internal_handle->current_offset - (off64_t) ( current_sector * internal_handle->io_handle->bytes_per_sector ); if( ( current_sector_offset < 0 ) || ( current_sector_offset >= internal_handle->io_handle->bytes_per_sector ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current sector offset value out of bounds.", function ); goto on_error; } track_data_start_sector = current_sector - track_value->start_sector; track_data_offset = track_value->data_file_offset + ( track_data_start_sector * track_value->bytes_per_sector ); read_number_of_sectors = buffer_size / internal_handle->io_handle->bytes_per_sector; if( ( buffer_size % internal_handle->io_handle->bytes_per_sector ) != 0 ) { read_number_of_sectors += 1; } if( ( (uint64_t) read_number_of_sectors + current_sector ) > track_value->end_sector ) { read_number_of_sectors = (size_t) ( track_value->end_sector - current_sector ); } read_size = read_number_of_sectors * track_value->bytes_per_sector; if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { /* TODO handle more track types */ if( ( track_value->type != LIBODRAW_TRACK_TYPE_AUDIO ) && ( track_value->type != LIBODRAW_TRACK_TYPE_MODE1_2048 ) && ( track_value->type != LIBODRAW_TRACK_TYPE_MODE1_2352 ) && ( track_value->type != LIBODRAW_TRACK_TYPE_MODE2_2048 ) && ( track_value->type != LIBODRAW_TRACK_TYPE_MODE2_2336 ) && ( track_value->type != LIBODRAW_TRACK_TYPE_MODE2_2352 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported track type.", function ); goto on_error; } /* TODO use sector data cache ? */ sector_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * read_size ); if( sector_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sector data.", function ); goto on_error; } read_buffer = sector_data; } else { read_buffer = buffer; read_size -= (size_t) current_sector_offset; track_data_offset += current_sector_offset; if( read_size > buffer_size ) { read_size = buffer_size; } } if( libbfio_pool_seek_offset( internal_handle->data_file_io_pool, track_value->data_file_index, track_data_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek data file: %d offset: %" PRIi64 ".", function, track_value->data_file_index, track_data_offset ); goto on_error; } read_count = libbfio_pool_read_buffer( internal_handle->data_file_io_pool, track_value->data_file_index, read_buffer, read_size, error ); if( read_count != (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from data file: %d.", function, track_value->data_file_index ); goto on_error; } if( track_value->bytes_per_sector != internal_handle->io_handle->bytes_per_sector ) { read_count = libodraw_io_handle_copy_sector_data_to_buffer( internal_handle->io_handle, sector_data, read_size, track_value->bytes_per_sector, track_value->type, buffer, buffer_size, (uint32_t) current_sector, (uint32_t) current_sector_offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy sector data to buffer.", function ); goto on_error; } memory_free( sector_data ); sector_data = NULL; } return( read_count ); on_error: if( sector_data != NULL ) { memory_free( sector_data ); } return( -1 ); } /* Reads (media) data at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t libodraw_handle_read_buffer_at_offset( libodraw_handle_t *handle, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libodraw_handle_read_buffer_at_offset"; ssize_t read_count = 0; if( libodraw_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } read_count = libodraw_handle_read_buffer( handle, buffer, buffer_size, error ); if( read_count <= -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } return( read_count ); } #ifdef TODO_WRITE_SUPPORT /* Writes a buffer * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libodraw_handle_write_buffer( libodraw_handle_t *handle, const void *buffer, size_t buffer_size, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_write_buffer"; ssize_t write_count = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; /* TODO */ return( write_count ); } /* Writes (media) data at a specific offset, * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error */ ssize_t libodraw_handle_write_buffer_at_offset( libodraw_handle_t *handle, const void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "libodraw_handle_write_buffer_at_offset"; ssize_t write_count = 0; if( libodraw_handle_seek_offset( handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } write_count = libodraw_handle_write_buffer( handle, buffer, buffer_size, error ); if( write_count <= -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write buffer.", function ); return( -1 ); } return( write_count ); } #endif /* TODO_WRITE_SUPPORT */ /* Seeks a certain offset of the (media) data * This function is not multi-thread safe acquire write lock before call * Returns the offset if seek is successful or -1 on error */ off64_t libodraw_internal_handle_seek_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int whence, libcerror_error_t **error ) { libodraw_sector_range_t *lead_out_sector_range = NULL; libodraw_sector_range_t *run_out_sector_range = NULL; libodraw_track_value_t *track_value = NULL; static char *function = "libodraw_internal_handle_seek_offset"; off64_t lead_out_offset = 0; off64_t run_out_offset = 0; off64_t track_offset = 0; int current_lead_out = 0; int current_run_out = 0; int current_track = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( whence == SEEK_CUR ) { offset += internal_handle->current_offset; } else if( whence == SEEK_END ) { offset += (off64_t) internal_handle->media_size; } if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } if( offset < (off64_t) internal_handle->media_size ) { if( libodraw_handle_get_run_out_at_offset( internal_handle, offset, ¤t_run_out, &run_out_sector_range, &run_out_offset, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve run-out at offset: %" PRIi64 ".", function, offset ); return( -1 ); } if( libodraw_handle_get_lead_out_at_offset( internal_handle, offset, ¤t_lead_out, &lead_out_sector_range, &lead_out_offset, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve lead-out at offset: %" PRIi64 ".", function, offset ); return( -1 ); } if( libodraw_handle_get_track_at_offset( internal_handle, offset, ¤t_track, &track_value, &track_offset, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track at offset: %" PRIi64 ".", function, offset ); return( -1 ); } } else { if( libcdata_array_get_number_of_entries( internal_handle->run_outs_array, ¤t_run_out, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in run-outs array.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->lead_outs_array, ¤t_lead_out, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in lead-outs array.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->tracks_array, ¤t_track, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in tracks array.", function ); return( -1 ); } } internal_handle->current_offset = offset; internal_handle->current_run_out = current_run_out; internal_handle->current_lead_out = current_lead_out; internal_handle->current_track = current_track; return( offset ); } /* Seeks a certain offset of the (media) data * Returns the offset if seek is successful or -1 on error */ off64_t libodraw_handle_seek_offset( libodraw_handle_t *handle, off64_t offset, int whence, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_seek_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->data_file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing data file IO pool.", function ); return( -1 ); } #if defined( HAVE_LIBODRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif offset = libodraw_internal_handle_seek_offset( internal_handle, offset, whence, error ); if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); offset = -1; } #if defined( HAVE_LIBODRAW_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( offset ); } /* Retrieves a run-out sector range for the specified offset * When no matching run-out was found the run_out_index value contains the next run-out index on return * Returns 1 if successful, 0 if no matching run-out was found or -1 on error */ int libodraw_handle_get_run_out_at_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int *run_out_index, libodraw_sector_range_t **run_out_sector_range, off64_t *run_out_offset, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_run_out_at_offset"; uint64_t current_sector = 0; int number_of_run_outs = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( run_out_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid run-out index.", function ); return( -1 ); } if( run_out_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid run-out sector range.", function ); return( -1 ); } if( run_out_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid run-out offset.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->run_outs_array, &number_of_run_outs, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in run-outs array.", function ); return( -1 ); } current_sector = offset / internal_handle->io_handle->bytes_per_sector; if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } for( *run_out_index = 0; *run_out_index < number_of_run_outs; *run_out_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_handle->run_outs_array, *run_out_index, (intptr_t **) run_out_sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve run-out sector range: %d from array.", function, number_of_run_outs - 1 ); return( -1 ); } if( *run_out_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing run-out sector range: %d.", function, *run_out_index ); return( -1 ); } if( ( current_sector >= ( *run_out_sector_range )->start_sector ) && ( current_sector < ( *run_out_sector_range )->end_sector ) ) { *run_out_offset = offset - ( ( *run_out_sector_range )->start_sector * internal_handle->io_handle->bytes_per_sector ); return( 1 ); } if( current_sector < ( *run_out_sector_range )->start_sector ) { break; } } *run_out_sector_range = NULL; *run_out_offset = 0; return( 0 ); } /* Retrieves a lead-out sector range for the specified offset * When no matching lead-out was found the lead_out_index value contains the next lead-out index on return * Returns 1 if successful, 0 if no matching lead-out was found or -1 on error */ int libodraw_handle_get_lead_out_at_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int *lead_out_index, libodraw_sector_range_t **lead_out_sector_range, off64_t *lead_out_offset, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_lead_out_at_offset"; uint64_t current_sector = 0; int number_of_lead_outs = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( lead_out_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lead-out index.", function ); return( -1 ); } if( lead_out_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lead-out sector range.", function ); return( -1 ); } if( lead_out_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lead-out offset.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->lead_outs_array, &number_of_lead_outs, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in lead-outs array.", function ); return( -1 ); } current_sector = offset / internal_handle->io_handle->bytes_per_sector; if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } for( *lead_out_index = 0; *lead_out_index < number_of_lead_outs; *lead_out_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_handle->lead_outs_array, *lead_out_index, (intptr_t **) lead_out_sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve lead-out sector range: %d from array.", function, number_of_lead_outs - 1 ); return( -1 ); } if( *lead_out_sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing lead-out sector range: %d.", function, *lead_out_index ); return( -1 ); } if( ( current_sector >= ( *lead_out_sector_range )->start_sector ) && ( current_sector < ( *lead_out_sector_range )->end_sector ) ) { *lead_out_offset = offset - ( ( *lead_out_sector_range )->start_sector * internal_handle->io_handle->bytes_per_sector ); return( 1 ); } if( current_sector < ( *lead_out_sector_range )->start_sector ) { break; } } *lead_out_sector_range = NULL; *lead_out_offset = 0; return( 0 ); } /* Retrieves a track value for the specified offset * When no matching track was found the track_index value contains the next track index on return * Returns 1 if successful, 0 if no matching track was found or -1 on error */ int libodraw_handle_get_track_at_offset( libodraw_internal_handle_t *internal_handle, off64_t offset, int *track_index, libodraw_track_value_t **track_value, off64_t *track_offset, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_track_at_offset"; uint64_t current_sector = 0; int number_of_tracks = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( track_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track index.", function ); return( -1 ); } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track value.", function ); return( -1 ); } if( track_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid track offset.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->tracks_array, &number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in tracks array.", function ); return( -1 ); } current_sector = offset / internal_handle->io_handle->bytes_per_sector; if( current_sector > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current sector value out of bounds.", function ); return( -1 ); } for( *track_index = 0; *track_index < number_of_tracks; *track_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, *track_index, (intptr_t **) track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, number_of_tracks - 1 ); return( -1 ); } if( *track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, *track_index ); return( -1 ); } if( ( current_sector >= ( *track_value )->start_sector ) && ( current_sector < ( *track_value )->end_sector ) ) { *track_offset = offset - ( ( *track_value )->start_sector * internal_handle->io_handle->bytes_per_sector ); return( 1 ); } if( current_sector < ( *track_value )->start_sector ) { break; } } *track_value = NULL; *track_offset = 0; return( 0 ); } /* Retrieves the current offset of the (media) data * Returns 1 if successful or -1 on error */ int libodraw_handle_get_offset( libodraw_handle_t *handle, off64_t *offset, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_offset"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } *offset = internal_handle->current_offset; return( 1 ); } /* Retrieves the size of the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libodraw_handle_get_basename_size( libodraw_internal_handle_t *internal_handle, size_t *basename_size, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_basename_size"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( basename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename size.", function ); return( -1 ); } if( internal_handle->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #else *basename_size = internal_handle->basename_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Retrieves the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libodraw_handle_get_basename( libodraw_internal_handle_t *internal_handle, char *basename, size_t basename_size, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_basename"; size_t narrow_basename_size = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( internal_handle->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, &narrow_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, &narrow_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, &narrow_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, &narrow_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow basename size.", function ); return( -1 ); } #else narrow_basename_size = internal_handle->basename_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( basename_size < narrow_basename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: basename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) basename, basename_size, (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) basename, basename_size, (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) basename, basename_size, libclocale_codepage, (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) basename, basename_size, libclocale_codepage, (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); return( -1 ); } #else if( system_string_copy( basename, internal_handle->basename, internal_handle->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); return( -1 ); } basename[ internal_handle->basename_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Sets the basename * Returns 1 if successful or -1 on error */ int libodraw_handle_set_basename( libodraw_internal_handle_t *internal_handle, const char *basename, size_t basename_length, libcerror_error_t **error ) { static char *function = "libodraw_handle_set_basename"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( internal_handle->basename != NULL ) { memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) basename, basename_length + 1, &( internal_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) basename, basename_length + 1, &( internal_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) basename, basename_length + 1, libclocale_codepage, &( internal_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) basename, basename_length + 1, libclocale_codepage, &( internal_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #else internal_handle->basename_size = basename_length + 1; #endif internal_handle->basename = system_string_allocate( internal_handle->basename_size ); if( internal_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create basename.", function ); internal_handle->basename_size = 0; return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, (libuna_utf8_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, (libuna_utf8_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) internal_handle->basename, internal_handle->basename_size, (uint8_t *) basename, basename_length + 1, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) internal_handle->basename, internal_handle->basename_size, (uint8_t *) basename, basename_length + 1, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; return( -1 ); } #else if( system_string_copy( internal_handle->basename, basename, basename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; return( -1 ); } internal_handle->basename[ basename_length ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the size of the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libodraw_handle_get_basename_size_wide( libodraw_internal_handle_t *internal_handle, size_t *basename_size, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_basename_size_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( basename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename size.", function ); return( -1 ); } if( internal_handle->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) *basename_size = internal_handle->basename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Retrieves the basename * Returns 1 if successful, 0 if value not present or -1 on error */ int libodraw_handle_get_basename_wide( libodraw_internal_handle_t *internal_handle, wchar_t *basename, size_t basename_size, libcerror_error_t **error ) { static char *function = "libodraw_handle_get_basename_wide"; size_t wide_basename_size = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( internal_handle->basename == NULL ) { return( 0 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wide_basename_size = internal_handle->basename_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, &wide_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, &wide_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, &wide_basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, &wide_basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( basename_size < wide_basename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: basename too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( basename, internal_handle->basename, internal_handle->basename_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); return( -1 ); } basename[ internal_handle->basename_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) basename, basename_size, (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) basename, basename_size, (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) basename, basename_size, (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) basename, basename_size, (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Sets the basename * Returns 1 if successful or -1 on error */ int libodraw_handle_set_basename_wide( libodraw_internal_handle_t *internal_handle, const wchar_t *basename, size_t basename_length, libcerror_error_t **error ) { static char *function = "libodraw_handle_set_basename_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid basename.", function ); return( -1 ); } if( internal_handle->basename != NULL ) { memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) internal_handle->basename_size = basename_length + 1; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) basename, basename_length + 1, &( internal_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) basename, basename_length + 1, &( internal_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) basename, basename_length + 1, libclocale_codepage, &( internal_handle->basename_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) basename, basename_length + 1, libclocale_codepage, &( internal_handle->basename_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine basename size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ internal_handle->basename = system_string_allocate( internal_handle->basename_size ); if( internal_handle->basename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create basename.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( internal_handle->basename, basename, basename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set basename.", function ); memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; return( -1 ); } internal_handle->basename[ basename_length ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, (libuna_utf32_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) internal_handle->basename, internal_handle->basename_size, (libuna_utf16_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, (libuna_utf32_character_t *) basename, basename_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) internal_handle->basename, internal_handle->basename_size, libclocale_codepage, (libuna_utf16_character_t *) basename, basename_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set basename.", function ); memory_free( internal_handle->basename ); internal_handle->basename = NULL; internal_handle->basename_size = 0; return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int libodraw_handle_set_maximum_number_of_open_handles( libodraw_handle_t *handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_set_maximum_number_of_open_handles"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->data_file_io_pool != NULL ) { if( libbfio_pool_set_maximum_number_of_open_handles( internal_handle->data_file_io_pool, maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in data files IO handle.", function ); return( -1 ); } } internal_handle->maximum_number_of_open_handles = maximum_number_of_open_handles; return( 1 ); } /* Sets the media values * Returns 1 if successful or -1 on error */ int libodraw_handle_set_media_values( libodraw_internal_handle_t *internal_handle, libcerror_error_t **error ) { static char *function = "libodraw_handle_set_media_values"; libodraw_sector_range_t *sector_range = NULL; libodraw_track_value_t *track_value = NULL; size64_t data_file_size = 0; uint64_t number_of_sectors = 0; int number_of_file_io_handles = 0; int number_of_sessions = 0; int number_of_tracks = 0; if( internal_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( internal_handle->io_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - invalid IO handle - missing bytes per sector.", function ); return( -1 ); } if( internal_handle->data_file_io_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing data file IO pool.", function ); return( -1 ); } if( libbfio_pool_get_number_of_handles( internal_handle->data_file_io_pool, &number_of_file_io_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of file IO handles in pool.", function ); return( -1 ); } if( libbfio_pool_get_size( internal_handle->data_file_io_pool, number_of_file_io_handles - 1, &data_file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file: %d size.", function, number_of_file_io_handles - 1 ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_handle->tracks_array, &number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in tracks array.", function ); return( -1 ); } if( number_of_tracks == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track values.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, number_of_tracks - 1, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, number_of_tracks - 1 ); return( -1 ); } if( track_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing track value: %d.", function, number_of_tracks - 1 ); return( -1 ); } if( track_value->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid track value: %d - missing bytes per sector.", function, number_of_tracks - 1 ); return( -1 ); } if( internal_handle->media_size == 0 ) { /* TODO currently assumes that last track start sector is always relative to the start of the media */ if( number_of_file_io_handles > 1 ) { internal_handle->media_size = track_value->start_sector * track_value->bytes_per_sector; } internal_handle->media_size += data_file_size; internal_handle->number_of_sectors = internal_handle->media_size / track_value->bytes_per_sector; internal_handle->media_size = internal_handle->number_of_sectors * internal_handle->io_handle->bytes_per_sector; } if( track_value->number_of_sectors == 0 ) { number_of_sectors = internal_handle->number_of_sectors - track_value->start_sector; if( number_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of sectors value out of bounds.", function ); return( -1 ); } if( libodraw_track_value_set( track_value, track_value->start_sector, number_of_sectors, track_value->type, track_value->data_file_index, track_value->data_file_start_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last track value.", function ); return( -1 ); } } if( libcdata_array_get_number_of_entries( internal_handle->sessions_array, &number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in sessions array.", function ); return( -1 ); } if( number_of_sessions > 0 ) { if( libcdata_array_get_entry_by_index( internal_handle->sessions_array, number_of_sessions - 1, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session sector range: %d from array.", function, number_of_sessions - 1 ); return( -1 ); } if( sector_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sessions sector range: %d.", function, number_of_sessions - 1 ); return( -1 ); } if( sector_range->number_of_sectors == 0 ) { /* TODO currently assumes that last session is not followed by a lead-out */ number_of_sectors = internal_handle->number_of_sectors - sector_range->start_sector; if( number_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of sectors value out of bounds.", function ); return( -1 ); } if( libodraw_sector_range_set( sector_range, sector_range->start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last session sector range.", function ); return( -1 ); } } } return( 1 ); } /* Retrieves the handle ASCII codepage * Returns 1 if successful or -1 on error */ int libodraw_handle_get_ascii_codepage( libodraw_handle_t *handle, int *ascii_codepage, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_ascii_codepage"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ascii_codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid ASCII codepage.", function ); return( -1 ); } *ascii_codepage = internal_handle->io_handle->ascii_codepage; return( 1 ); } /* Sets the handle ASCII codepage * Returns 1 if successful or -1 on error */ int libodraw_handle_set_ascii_codepage( libodraw_handle_t *handle, int ascii_codepage, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_set_ascii_codepage"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( ( ascii_codepage != LIBODRAW_CODEPAGE_ASCII ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_874 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_932 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_936 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_949 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_950 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1250 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1251 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1252 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1253 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1254 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1255 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1256 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1257 ) && ( ascii_codepage != LIBODRAW_CODEPAGE_WINDOWS_1258 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported ASCII codepage.", function ); return( -1 ); } internal_handle->io_handle->ascii_codepage = ascii_codepage; return( 1 ); } /* Retrieves the number of data files * Returns 1 if successful or -1 on error */ int libodraw_handle_get_number_of_data_files( libodraw_handle_t *handle, int *number_of_data_files, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_number_of_data_files"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_number_of_entries( internal_handle->data_file_descriptors_array, number_of_data_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries in data file descriptors array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a data file * Returns 1 if successful or -1 on error */ int libodraw_handle_get_data_file( libodraw_handle_t *handle, int index, libodraw_data_file_t **data_file, libcerror_error_t **error ) { libodraw_data_file_descriptor_t *data_file_descriptor = NULL; libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_data_file"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->data_file_descriptors_array, index, (intptr_t **) &data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data file descriptor: %d from array.", function, index ); return( -1 ); } if( libodraw_data_file_initialize( data_file, internal_handle, data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data file.", function ); return( -1 ); } return( 1 ); } /* Appends a data file * Returns 1 if successful or -1 on error */ int libodraw_handle_append_data_file( libodraw_handle_t *handle, const char *name, size_t name_length, uint8_t type, libcerror_error_t **error ) { libodraw_data_file_descriptor_t *data_file_descriptor = NULL; libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_append_data_file"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( ( type != LIBODRAW_FILE_TYPE_UNKNOWN ) && ( type != LIBODRAW_FILE_TYPE_BINARY_LITTLE_ENDIAN ) && ( type != LIBODRAW_FILE_TYPE_BINARY_BIG_ENDIAN ) && ( type != LIBODRAW_FILE_TYPE_AUDIO_AIFF ) && ( type != LIBODRAW_FILE_TYPE_AUDIO_WAVE ) && ( type != LIBODRAW_FILE_TYPE_AUDIO_MPEG1_LAYER3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported type codepage.", function ); return( -1 ); } if( libodraw_data_file_descriptor_initialize( &data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data file descriptor.", function ); goto on_error; } if( libodraw_data_file_descriptor_set_name( data_file_descriptor, name, name_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in data file descriptor.", function ); goto on_error; } data_file_descriptor->type = type; if( libcdata_array_append_entry( internal_handle->data_file_descriptors_array, &entry_index, (intptr_t *) data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data file descriptor.", function ); goto on_error; } return( 1 ); on_error: if( data_file_descriptor != NULL ) { libodraw_data_file_descriptor_free( &data_file_descriptor, NULL ); } return( -1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Appends a data file * Returns 1 if successful or -1 on error */ int libodraw_handle_append_data_file_wide( libodraw_handle_t *handle, const wchar_t *name, size_t name_length, uint8_t type, libcerror_error_t **error ) { libodraw_data_file_descriptor_t *data_file_descriptor = NULL; libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_append_data_file_wide"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( ( type != LIBODRAW_FILE_TYPE_UNKNOWN ) && ( type != LIBODRAW_FILE_TYPE_BINARY_LITTLE_ENDIAN ) && ( type != LIBODRAW_FILE_TYPE_BINARY_BIG_ENDIAN ) && ( type != LIBODRAW_FILE_TYPE_AUDIO_AIFF ) && ( type != LIBODRAW_FILE_TYPE_AUDIO_WAVE ) && ( type != LIBODRAW_FILE_TYPE_AUDIO_MPEG1_LAYER3 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported type codepage.", function ); return( -1 ); } if( libodraw_data_file_descriptor_initialize( &data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data file descriptor.", function ); goto on_error; } if( libodraw_data_file_descriptor_set_name_wide( data_file_descriptor, name, name_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set name in data file descriptor.", function ); goto on_error; } data_file_descriptor->type = type; if( libcdata_array_append_entry( internal_handle->data_file_descriptors_array, &entry_index, (intptr_t *) data_file_descriptor, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data file descriptor.", function ); goto on_error; } return( 1 ); on_error: if( data_file_descriptor != NULL ) { libodraw_data_file_descriptor_free( &data_file_descriptor, NULL ); } return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Retrieves the number of media size * Returns 1 if successful or -1 on error */ int libodraw_handle_get_media_size( libodraw_handle_t *handle, size64_t *media_size, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_media_size"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( media_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media size.", function ); return( -1 ); } *media_size = internal_handle->media_size; return( 1 ); } /* Retrieves the number of bytes per sector * Returns 1 if successful or -1 on error */ int libodraw_handle_get_bytes_per_sector( libodraw_handle_t *handle, uint32_t *bytes_per_sector, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_bytes_per_sector"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } if( bytes_per_sector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid bytes per sector.", function ); return( -1 ); } *bytes_per_sector = internal_handle->io_handle->bytes_per_sector; return( 1 ); } /* Sets the number of bytes per sector * Returns 1 if successful or -1 on error */ int libodraw_handle_set_bytes_per_sector( libodraw_handle_t *handle, uint32_t bytes_per_sector, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_set_bytes_per_sector"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( internal_handle->io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid handle - missing IO handle.", function ); return( -1 ); } /* TODO add support for 2352 */ if( bytes_per_sector != 2048 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported bytes per sector.", function ); return( -1 ); } internal_handle->io_handle->bytes_per_sector = bytes_per_sector; return( 1 ); } /* Retrieves the number of sectors * Returns 1 if successful or -1 on error */ int libodraw_handle_get_number_of_sectors( libodraw_handle_t *handle, uint64_t *number_of_sectors, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_number_of_sectors"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( number_of_sectors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sectors.", function ); return( -1 ); } *number_of_sectors = internal_handle->number_of_sectors; return( 1 ); } /* Retrieves the number of sessions * Returns 1 if successful or -1 on error */ int libodraw_handle_get_number_of_sessions( libodraw_handle_t *handle, int *number_of_sessions, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_number_of_sessions"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_number_of_entries( internal_handle->sessions_array, number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in sessions array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a session * Returns 1 if successful or -1 on error */ int libodraw_handle_get_session( libodraw_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_sector_range_t *sector_range = NULL; static char *function = "libodraw_handle_get_session"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->sessions_array, index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session sector range: %d from array.", function, index ); return( -1 ); } if( libodraw_sector_range_get( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sector range.", function ); return( -1 ); } return( 1 ); } /* Appends a session * Returns 1 if successful or -1 on error */ int libodraw_handle_append_session( libodraw_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_sector_range_t *sector_range = NULL; static char *function = "libodraw_handle_append_session"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libodraw_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sector range.", function ); goto on_error; } if( libodraw_sector_range_set( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sector range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->sessions_array, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session sector range to array.", function ); goto on_error; } return( 1 ); on_error: if( sector_range != NULL ) { libodraw_sector_range_free( §or_range, NULL ); } return( -1 ); } /* Retrieves the number of lead-outs * Returns 1 if successful or -1 on error */ int libodraw_handle_get_number_of_lead_outs( libodraw_handle_t *handle, int *number_of_lead_outs, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_number_of_lead_outs"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_number_of_entries( internal_handle->lead_outs_array, number_of_lead_outs, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in lead-outs array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a lead-out * Returns 1 if successful or -1 on error */ int libodraw_handle_get_lead_out( libodraw_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_sector_range_t *sector_range = NULL; static char *function = "libodraw_handle_get_lead_out"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->lead_outs_array, index, (intptr_t **) §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve lead-out sector range: %d from array.", function, index ); return( -1 ); } if( libodraw_sector_range_get( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sector range.", function ); return( -1 ); } return( 1 ); } /* Appends a lead-out * Returns 1 if successful or -1 on error */ int libodraw_handle_append_lead_out( libodraw_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_sector_range_t *sector_range = NULL; static char *function = "libodraw_handle_append_lead_out"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libodraw_sector_range_initialize( §or_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sector range.", function ); goto on_error; } if( libodraw_sector_range_set( sector_range, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sector range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->lead_outs_array, &entry_index, (intptr_t *) sector_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append lead-out sector range to array.", function ); goto on_error; } return( 1 ); on_error: if( sector_range != NULL ) { libodraw_sector_range_free( §or_range, NULL ); } return( -1 ); } /* Retrieves the number of tracks * Returns 1 if successful or -1 on error */ int libodraw_handle_get_number_of_tracks( libodraw_handle_t *handle, int *number_of_tracks, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; static char *function = "libodraw_handle_get_number_of_tracks"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_number_of_entries( internal_handle->tracks_array, number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements in tracks array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a track * Returns 1 if successful or -1 on error */ int libodraw_handle_get_track( libodraw_handle_t *handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, int *data_file_index, uint64_t *data_file_start_sector, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_track_value_t *track_value = NULL; static char *function = "libodraw_handle_get_track"; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libcdata_array_get_entry_by_index( internal_handle->tracks_array, index, (intptr_t **) &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value: %d from array.", function, index ); return( -1 ); } if( libodraw_track_value_get( track_value, start_sector, number_of_sectors, type, data_file_index, data_file_start_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track value.", function ); return( -1 ); } return( 1 ); } /* Appends a track * Returns 1 if successful or -1 on error */ int libodraw_handle_append_track( libodraw_handle_t *handle, uint64_t start_sector, uint64_t number_of_sectors, uint8_t type, int data_file_index, uint64_t data_file_start_sector, libcerror_error_t **error ) { libodraw_internal_handle_t *internal_handle = NULL; libodraw_track_value_t *track_value = NULL; static char *function = "libodraw_handle_append_track"; int entry_index = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } internal_handle = (libodraw_internal_handle_t *) handle; if( libodraw_track_value_initialize( &track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create track value.", function ); goto on_error; } if( libodraw_track_value_set( track_value, start_sector, number_of_sectors, type, data_file_index, data_file_start_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set track value.", function ); goto on_error; } if( libcdata_array_append_entry( internal_handle->tracks_array, &entry_index, (intptr_t *) track_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track to array.", function ); goto on_error; } return( 1 ); on_error: if( track_value != NULL ) { libodraw_track_value_free( &track_value, NULL ); } return( -1 ); } libewf-20140807/libodraw/libodraw_data_file_descriptor.c0000664000175000017500000007003013443450062025332 0ustar00lordyestalordyesta00000000000000/* * Data file descriptor functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include #include #include #include "libodraw_data_file_descriptor.h" #include "libodraw_libcerror.h" #include "libodraw_libclocale.h" #include "libodraw_libuna.h" /* Creates a data file descriptor * Make sure the value data_file_descriptor is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_initialize( libodraw_data_file_descriptor_t **data_file_descriptor, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_initialize"; if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( *data_file_descriptor != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid data file descriptor value already set.", function ); return( -1 ); } *data_file_descriptor = memory_allocate_structure( libodraw_data_file_descriptor_t ); if( *data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data file descriptor.", function ); goto on_error; } if( memory_set( *data_file_descriptor, 0, sizeof( libodraw_data_file_descriptor_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear data file descriptor.", function ); goto on_error; } return( 1 ); on_error: if( *data_file_descriptor != NULL ) { memory_free( *data_file_descriptor ); *data_file_descriptor = NULL; } return( -1 ); } /* Frees a data file descriptor * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_free( libodraw_data_file_descriptor_t **data_file_descriptor, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_free"; if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( *data_file_descriptor != NULL ) { if( ( *data_file_descriptor )->name != NULL ) { memory_free( ( *data_file_descriptor )->name ); } memory_free( *data_file_descriptor ); *data_file_descriptor = NULL; } return( 1 ); } /* Retrieves the size of the name * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_get_name_size( libodraw_data_file_descriptor_t *data_file_descriptor, size_t *name_size, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_get_name_size"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( data_file_descriptor->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file descriptor - missing name.", function ); return( -1 ); } if( name_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #else *name_size = data_file_descriptor->name_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Retrieves the name * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_get_name( libodraw_data_file_descriptor_t *data_file_descriptor, char *name, size_t name_size, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_get_name"; size_t narrow_name_size = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( data_file_descriptor->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file descriptor - missing name.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, &narrow_name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, &narrow_name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, &narrow_name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, &narrow_name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow name size.", function ); return( -1 ); } #else narrow_name_size = data_file_descriptor->name_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( name_size < narrow_name_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: name too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) name, name_size, (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) name, name_size, (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) name, name_size, libclocale_codepage, (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) name, name_size, libclocale_codepage, (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); return( -1 ); } #else if( system_string_copy( name, data_file_descriptor->name, data_file_descriptor->name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set name.", function ); return( -1 ); } name[ data_file_descriptor->name_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Sets the name * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_set_name( libodraw_data_file_descriptor_t *data_file_descriptor, const char *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_set_name"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( data_file_descriptor->name != NULL ) { memory_free( data_file_descriptor->name ); data_file_descriptor->name = NULL; data_file_descriptor->name_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) name, name_length + 1, &( data_file_descriptor->name_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) name, name_length + 1, &( data_file_descriptor->name_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) name, name_length + 1, libclocale_codepage, &( data_file_descriptor->name_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) name, name_length + 1, libclocale_codepage, &( data_file_descriptor->name_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #else data_file_descriptor->name_size = name_length + 1; #endif data_file_descriptor->name = system_string_allocate( data_file_descriptor->name_size ); if( data_file_descriptor->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); data_file_descriptor->name_size = 0; return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, (libuna_utf8_character_t *) name, name_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, (libuna_utf8_character_t *) name, name_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, (uint8_t *) name, name_length + 1, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, (uint8_t *) name, name_length + 1, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); memory_free( data_file_descriptor->name ); data_file_descriptor->name = NULL; data_file_descriptor->name_size = 0; return( -1 ); } #else if( system_string_copy( data_file_descriptor->name, name, name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set name.", function ); memory_free( data_file_descriptor->name ); data_file_descriptor->name = NULL; data_file_descriptor->name_size = 0; return( -1 ); } data_file_descriptor->name[ name_length ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Retrieves the size of the name * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_get_name_size_wide( libodraw_data_file_descriptor_t *data_file_descriptor, size_t *name_size, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_get_name_size_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( data_file_descriptor->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file descriptor - missing name.", function ); return( -1 ); } if( name_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) *name_size = data_file_descriptor->name_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Retrieves the name * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_get_name_wide( libodraw_data_file_descriptor_t *data_file_descriptor, wchar_t *name, size_t name_size, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_get_name_wide"; size_t wide_name_size = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( data_file_descriptor->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data file descriptor - missing name.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wide_name_size = data_file_descriptor->name_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, &wide_name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, &wide_name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, &wide_name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, &wide_name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( name_size < wide_name_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: name too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( name, data_file_descriptor->name, data_file_descriptor->name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set name.", function ); return( -1 ); } name[ data_file_descriptor->name_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) name, name_size, (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) name, name_size, (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) name, name_size, (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) name, name_size, (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Sets the name * Returns 1 if successful or -1 on error */ int libodraw_data_file_descriptor_set_name_wide( libodraw_data_file_descriptor_t *data_file_descriptor, const wchar_t *name, size_t name_length, libcerror_error_t **error ) { static char *function = "libodraw_data_file_descriptor_set_name_wide"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif if( data_file_descriptor == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file descriptor.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( data_file_descriptor->name != NULL ) { memory_free( data_file_descriptor->name ); data_file_descriptor->name = NULL; data_file_descriptor->name_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) data_file_descriptor->name_size = name_length + 1; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) name, name_length + 1, &( data_file_descriptor->name_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) name, name_length + 1, &( data_file_descriptor->name_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) name, name_length + 1, libclocale_codepage, &( data_file_descriptor->name_size ), error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) name, name_length + 1, libclocale_codepage, &( data_file_descriptor->name_size ), error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine name size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ data_file_descriptor->name = system_string_allocate( data_file_descriptor->name_size ); if( data_file_descriptor->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string_copy( data_file_descriptor->name, name, name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set name.", function ); memory_free( data_file_descriptor->name ); data_file_descriptor->name = NULL; data_file_descriptor->name_size = 0; return( -1 ); } data_file_descriptor->name[ name_length ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, (libuna_utf32_character_t *) name, name_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) data_file_descriptor->name, data_file_descriptor->name_size, (libuna_utf16_character_t *) name, name_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, (libuna_utf32_character_t *) name, name_length + 1, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) data_file_descriptor->name, data_file_descriptor->name_size, libclocale_codepage, (libuna_utf16_character_t *) name, name_length + 1, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); memory_free( data_file_descriptor->name ); data_file_descriptor->name = NULL; data_file_descriptor->name_size = 0; return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libodraw/libodraw_cue_scanner.c0000664000175000017500000171764313443450233023474 0ustar00lordyestalordyesta00000000000000#line 2 "libodraw_cue_scanner.c" #line 4 "libodraw_cue_scanner.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer cue_scanner__create_buffer #define yy_delete_buffer cue_scanner__delete_buffer #define yy_flex_debug cue_scanner__flex_debug #define yy_init_buffer cue_scanner__init_buffer #define yy_flush_buffer cue_scanner__flush_buffer #define yy_load_buffer_state cue_scanner__load_buffer_state #define yy_switch_to_buffer cue_scanner__switch_to_buffer #define yyin cue_scanner_in #define yyleng cue_scanner_leng #define yylex cue_scanner_lex #define yylineno cue_scanner_lineno #define yyout cue_scanner_out #define yyrestart cue_scanner_restart #define yytext cue_scanner_text #define yywrap cue_scanner_wrap #define yyalloc cue_scanner_alloc #define yyrealloc cue_scanner_realloc #define yyfree cue_scanner_free #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE cue_scanner_restart(cue_scanner_in ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern int cue_scanner_leng; extern FILE *cue_scanner_in, *cue_scanner_out; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up cue_scanner_text. */ \ yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up cue_scanner_text again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via cue_scanner_restart()), so that the user can continue scanning by * just pointing cue_scanner_in at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when cue_scanner_text is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int cue_scanner_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow cue_scanner_wrap()'s to do buffer switches * instead of setting up a fresh cue_scanner_in. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void cue_scanner_restart (FILE *input_file ); void cue_scanner__switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE cue_scanner__create_buffer (FILE *file,int size ); void cue_scanner__delete_buffer (YY_BUFFER_STATE b ); void cue_scanner__flush_buffer (YY_BUFFER_STATE b ); void cue_scanner_push_buffer_state (YY_BUFFER_STATE new_buffer ); void cue_scanner_pop_buffer_state (void ); static void cue_scanner_ensure_buffer_stack (void ); static void cue_scanner__load_buffer_state (void ); static void cue_scanner__init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER cue_scanner__flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE cue_scanner__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE cue_scanner__scan_string (yyconst char *yy_str ); YY_BUFFER_STATE cue_scanner__scan_bytes (yyconst char *bytes,int len ); void *cue_scanner_alloc (yy_size_t ); void *cue_scanner_realloc (void *,yy_size_t ); void cue_scanner_free (void * ); #define yy_new_buffer cue_scanner__create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ cue_scanner_ensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ cue_scanner__create_buffer(cue_scanner_in,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ cue_scanner_ensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ cue_scanner__create_buffer(cue_scanner_in,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *cue_scanner_in = NULL, *cue_scanner_out = NULL; typedef int yy_state_type; extern int cue_scanner_lineno; int cue_scanner_lineno = 1; extern char *cue_scanner_text; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr cue_scanner_text static yyconst flex_int16_t yy_nxt[][256] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 5, 5, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 11, 4, 4, 4, 4, 4, 12, 13, 14, 15, 13, 16, 17, 13, 18, 13, 13, 13, 19, 13, 13, 20, 13, 21, 22, 23, 24, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 25, 25, 26, 25, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 4, 27, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 5, 5, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 11, 4, 4, 4, 4, 4, 12, 13, 14, 15, 13, 16, 17, 13, 18, 13, 13, 13, 19, 13, 13, 20, 13, 21, 22, 23, 24, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 25, 25, 26, 25, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 4, 27, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3 }, { 3, 28, 28, 28, 28, 28, 28, -4, -4, -4, -4, -4, -4, -4, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -4, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -4, 28, -4, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -5, -5, -5, -5, -5, -5, 29, 29, 29, -5, 29, 29, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 29, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 29, -5, 29, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5 }, { 3, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6 }, { 3, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 30, 32, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 30, 30, 30, 30, 30, 30, 31, 30, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }, { 3, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 32, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 36, 34, 34, 34, 34, 34, 34, 35, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34 }, { 3, 28, 28, 28, 28, 28, 28, -9, -9, -9, -9, -9, -9, -9, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -9, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -9, 28, -9, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -10, -10, -10, -10, -10, -10, -10, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -10, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -11, -11, -11, -11, -11, -11, -11, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 42, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -11, 28, -11, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -12, -12, -12, -12, -12, -12, -12, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -12, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 43, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -13, -13, -13, -13, -13, -13, -13, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -13, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -14, -14, -14, -14, -14, -14, -14, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -14, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 44, 39, 39, 45, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 46, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -15, -15, -15, -15, -15, -15, -15, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -15, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 47, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -16, -16, -16, -16, -16, -16, -16, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -16, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 48, 39, 39, 49, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -17, -17, -17, -17, -17, -17, -17, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -17, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 50, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -18, -18, -18, -18, -18, -18, -18, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -18, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 51, 39, 39, 39, 39, 52, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -19, -19, -19, -19, -19, -19, -19, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -19, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 53, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -20, -20, -20, -20, -20, -20, -20, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -20, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 54, 39, 39, 39, 39, 39, 39, 39, 39, 39, 55, 39, 39, 56, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -21, -21, -21, -21, -21, -21, -21, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -21, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 57, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -22, -22, -22, -22, -22, -22, -22, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -22, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 58, 39, 39, 39, 39, 39, 59, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -23, -23, -23, -23, -23, -23, -23, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -23, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 60, 39, 39, 39, 39, 39, 61, 39, 39, 62, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -24, -24, -24, -24, -24, -24, -24, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -24, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 63, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -25, -25, -25, -25, -25, -25, -25, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -25, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 40, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -26, -26, -26, -26, -26, -26, 29, 29, 29, -26, 29, 29, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 29, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, -26, -26, -26, -26, -26, -26, -26, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, -26, -26, -26, -26, -26, -26, 41, 41, 64, 41, 64, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26 }, { 3, 28, 28, 28, 28, 28, 28, -27, -27, -27, -27, -27, -27, -27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -27, 28, -27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -28, -28, -28, -28, -28, -28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -29, -29, -29, -29, -29, -29, 29, 29, 29, -29, 29, 29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 29, -29, 29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29 }, { 3, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 30, 32, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 30, 30, 30, 30, 30, 30, 31, 30, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }, { 3, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 65, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 66, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, { 3, 28, 28, 28, 28, 28, 28, -32, -32, -32, -32, -32, -32, -32, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -32, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -32, 28, -32, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 30, 67, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 30, 30, 30, 30, 30, 30, 31, 30, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }, { 3, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 32, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 36, 34, 34, 34, 34, 34, 34, 35, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34 }, { 3, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 68, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35 }, { 3, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 69, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 36, 34, 34, 34, 34, 34, 34, 35, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34 }, { 3, 28, 28, 28, 28, 28, 28, -37, -37, -37, -37, -37, -37, -37, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -37, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -37, 28, -37, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -38, -38, -38, -38, -38, -38, -38, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -38, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -39, -39, -39, -39, -39, -39, -39, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -39, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -40, -40, -40, -40, -40, -40, -40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -40, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -41, -41, -41, -41, -41, -41, -41, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -41, -41, -41, -41, -41, -41, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41 }, { 3, 75, 75, 75, 75, 75, 75, 75, 75, 75, -42, 75, 75, -42, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75 }, { 3, 28, 28, 28, 28, 28, 28, -43, -43, -43, -43, -43, -43, -43, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -43, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 76, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -44, -44, -44, -44, -44, -44, -44, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -44, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 77, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -45, -45, -45, -45, -45, -45, -45, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -45, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 78, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -46, -46, -46, -46, -46, -46, -46, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -46, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 79, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -47, -47, -47, -47, -47, -47, -47, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -47, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 80, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -48, -48, -48, -48, -48, -48, -48, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -48, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 81, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -49, -49, -49, -49, -49, -49, -49, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -49, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 82, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -50, -50, -50, -50, -50, -50, -50, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -50, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 83, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -51, -51, -51, -51, -51, -51, -51, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -51, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 84, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -52, -52, -52, -52, -52, -52, -52, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -52, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 85, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -53, -53, -53, -53, -53, -53, -53, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -53, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 86, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -54, -54, -54, -54, -54, -54, -54, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -54, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 87, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -55, -55, -55, -55, -55, -55, -55, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -55, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 88, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -56, -56, -56, -56, -56, -56, -56, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -56, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 89, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -57, -57, -57, -57, -57, -57, -57, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -57, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 90, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -58, -58, -58, -58, -58, -58, -58, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -58, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 91, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -59, -59, -59, -59, -59, -59, -59, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -59, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 92, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -60, -60, -60, -60, -60, -60, -60, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -60, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 93, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -61, -61, -61, -61, -61, -61, -61, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -61, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 94, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -62, -62, -62, -62, -62, -62, -62, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -62, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 95, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -63, -63, -63, -63, -63, -63, -63, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -63, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 28, 72, 72, 96, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 28, 28, 28, 28, 28, 28, 73, 73, 74, 73, 74, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -64, -64, -64, -64, -64, -64, 29, 29, 29, -64, 29, 29, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 29, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -64, -64, -64, -64, -64, -64, -64, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -64, -64, -64, -64, -64, -64, 74, 74, 97, 74, 97, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64 }, { 3, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65 }, { 3, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 98, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 66, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, { 3, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 30, 32, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 30, 30, 30, 30, 30, 30, 31, 30, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }, { 3, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 99, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 68, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35 }, { 3, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 32, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 36, 34, 34, 34, 34, 34, 34, 35, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34 }, { 3, 28, 28, 28, 28, 28, 28, -70, -70, -70, -70, -70, -70, -70, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -70, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -71, -71, -71, -71, -71, -71, -71, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -71, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -71, 28, -71, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -72, -72, -72, -72, -72, -72, -72, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -72, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -73, -73, -73, -73, -73, -73, -73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -73, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -74, -74, -74, -74, -74, -74, -74, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -74, -74, -74, -74, -74, -74, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74 }, { 3, 75, 75, 75, 75, 75, 75, 75, 75, 75, -75, 75, 75, -75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75 }, { 3, 28, 28, 28, 28, 28, 28, -76, -76, -76, -76, -76, -76, -76, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -76, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 105, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -77, -77, -77, -77, -77, -77, -77, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -77, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 106, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -78, -78, -78, -78, -78, -78, -78, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -78, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 107, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -79, -79, -79, -79, -79, -79, -79, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -79, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 108, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -80, -80, -80, -80, -80, -80, -80, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -80, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 109, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -81, -81, -81, -81, -81, -81, -81, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -81, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 110, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -82, -82, -82, -82, -82, -82, -82, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -82, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 111, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -83, -83, -83, -83, -83, -83, -83, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -83, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 112, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -84, -84, -84, -84, -84, -84, -84, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -84, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 113, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -85, -85, -85, -85, -85, -85, -85, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -85, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 114, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -86, -86, -86, -86, -86, -86, -86, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -86, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 115, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -87, -87, -87, -87, -87, -87, -87, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -87, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 116, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -88, -88, -88, -88, -88, -88, -88, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -88, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 117, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -89, -89, -89, -89, -89, -89, -89, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -89, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 118, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -90, -90, 119, -90, -90, -90, -90, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 119, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -91, -91, -91, -91, -91, -91, -91, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -91, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 120, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -92, -92, -92, -92, -92, -92, -92, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -92, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 121, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -93, -93, -93, -93, -93, -93, -93, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -93, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 122, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -94, -94, -94, -94, -94, -94, -94, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -94, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 123, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -95, -95, -95, -95, -95, -95, -95, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -95, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 124, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -96, -96, -96, -96, -96, -96, -96, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -96, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 28, 28, 28, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 28, 28, 28, 28, 125, 28, 102, 102, 103, 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -97, -97, -97, -97, -97, -97, 29, 29, 29, -97, 29, 29, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, 29, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -97, -97, -97, -97, -97, -97, -97, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -97, -97, -97, -97, -97, -97, 103, 103, 126, 103, 126, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97 }, { 3, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 65, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 66, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, { 3, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 68, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35 }, { 3, 28, 28, 28, 28, 28, 28, -100, -100, -100, -100, -100, -100, -100, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -100, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -101, -101, -101, -101, -101, -101, -101, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -101, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -102, -102, -102, -102, -102, -102, -102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -103, -103, -103, -103, -103, -103, -103, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -103, -103, -103, -103, -103, -103, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103 }, { 3, 28, 28, 28, 28, 28, 28, -104, -104, -104, -104, -104, -104, -104, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -104, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -104, 28, -104, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -105, -105, -105, -105, -105, -105, -105, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -105, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 132, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -106, -106, -106, -106, -106, -106, -106, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -106, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 133, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -107, -107, -107, -107, -107, -107, -107, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -107, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 134, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -108, -108, -108, -108, -108, -108, -108, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -108, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 135, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -109, -109, -109, -109, -109, -109, -109, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -109, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 136, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -110, -110, -110, -110, -110, -110, -110, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -110, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -111, -111, -111, -111, -111, -111, -111, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -111, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 137, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -112, -112, -112, -112, -112, -112, -112, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -112, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 138, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -113, -113, -113, -113, -113, -113, -113, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -113, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 139, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -114, -114, -114, -114, -114, -114, -114, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -114, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -115, -115, -115, -115, -115, -115, -115, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -115, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 140, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -116, -116, -116, -116, -116, -116, -116, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -116, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 141, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -117, -117, -117, -117, -117, -117, -117, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -117, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 142, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -118, -118, -118, -118, -118, -118, -118, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -118, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 143, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -119, -119, -119, -119, -119, -119, -119, -119, 119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, 119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, 144, -119, -119, 145, -119, -119, 146, 147, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119 }, { 3, 28, 28, 28, 28, 28, 28, -120, -120, -120, -120, -120, -120, -120, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -120, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 148, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -121, -121, -121, -121, -121, -121, -121, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -121, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 149, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -122, -122, -122, -122, -122, -122, -122, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -122, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 150, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -123, -123, -123, -123, -123, -123, -123, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -123, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 151, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -123, 28, -123, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -124, -124, -124, -124, -124, -124, -124, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -124, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 28, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 152, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28, 28, 28, 28, 129, 129, 130, 129, 130, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -125, -125, -125, -125, -125, -125, -125, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -125, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 153, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -125, 28, -125, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -126, -126, -126, -126, -126, -126, 29, 29, 29, -126, 29, 29, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, 29, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -126, -126, -126, -126, -126, -126, -126, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -126, -126, -126, -126, -126, -126, 130, 130, 154, 130, 154, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126 }, { 3, 28, 28, 28, 28, 28, 28, -127, -127, -127, -127, -127, -127, -127, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -127, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -127, 28, -127, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -128, -128, -128, -128, -128, -128, -128, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -128, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -128, 28, -128, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -129, -129, -129, -129, -129, -129, -129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -129, 28, -129, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130 }, { 3, 28, 28, 28, 28, 28, 28, -131, -131, -131, -131, -131, -131, -131, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -131, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 159, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -131, 28, -131, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -132, -132, -132, -132, -132, -132, -132, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -132, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 160, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -132, 28, -132, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -133, -133, -133, -133, -133, -133, -133, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -133, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 161, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -133, 28, -133, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -134, -134, -134, -134, -134, -134, -134, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -134, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 162, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -134, 28, -134, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -135, -135, -135, -135, -135, -135, -135, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -135, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 163, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -135, 28, -135, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -136, -136, -136, -136, -136, -136, -136, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -136, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 164, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -136, 28, -136, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -137, -137, -137, -137, -137, -137, -137, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -137, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -137, 28, -137, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -138, -138, -138, -138, -138, -138, -138, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -138, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -138, 28, -138, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -139, -139, -139, -139, -139, -139, -139, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -139, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -139, 28, -139, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -140, -140, -140, -140, -140, -140, -140, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -140, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 165, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -140, 28, -140, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -141, -141, -141, -141, -141, -141, -141, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -141, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 166, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -141, 28, -141, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -142, -142, -142, -142, -142, -142, -142, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -142, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 167, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -142, 28, -142, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -143, -143, -143, -143, -143, -143, -143, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -143, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 168, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -143, 28, -143, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, 169, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144 }, { 3, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, 170, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145 }, { 3, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, 171, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146 }, { 3, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, 172, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147 }, { 3, 28, 28, 28, 28, 28, 28, -148, -148, -148, -148, -148, -148, -148, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -148, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 173, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -148, 28, -148, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -149, -149, -149, -149, -149, -149, -149, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -149, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 174, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -149, 28, -149, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -150, -150, -150, -150, -150, -150, -150, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -150, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -150, 28, -150, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -151, -151, -151, -151, -151, -151, -151, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -151, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 175, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -151, 28, -151, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -152, -152, -152, -152, -152, -152, -152, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -152, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -152, 28, -152, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -153, -153, -153, -153, -153, -153, -153, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -153, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 176, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -153, 28, -153, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -154, -154, -154, -154, -154, -154, 29, 29, 29, -154, 29, 29, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 29, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 29, -154, 29, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154 }, { 3, 28, 28, 28, 28, 28, 28, -155, -155, -155, -155, -155, -155, -155, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -155, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -155, 28, -155, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -156, -156, -156, -156, -156, -156, -156, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -156, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -156, 28, -156, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -157, -157, -157, -157, -157, -157, -157, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -157, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -157, 28, -157, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158 }, { 3, 28, 28, 28, 28, 28, 28, -159, -159, -159, -159, -159, -159, -159, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -159, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -159, 28, -159, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -160, -160, -160, -160, -160, -160, -160, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -160, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 182, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -160, 28, -160, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -161, -161, -161, -161, -161, -161, -161, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -161, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 183, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -161, 28, -161, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -162, -162, -162, -162, -162, -162, -162, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -162, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 184, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -162, 28, -162, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -163, -163, -163, -163, -163, -163, -163, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -163, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 185, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -163, 28, -163, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -164, -164, -164, -164, -164, -164, -164, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -164, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 186, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -164, 28, -164, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -165, -165, -165, -165, -165, -165, -165, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -165, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 187, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -165, 28, -165, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -166, -166, -166, -166, -166, -166, -166, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -166, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 188, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -166, 28, -166, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -167, -167, -167, -167, -167, -167, -167, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -167, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 189, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -167, 28, -167, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -168, -168, -168, -168, -168, -168, -168, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -168, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -168, 28, -168, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, 190, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169 }, { 3, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, 191, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170 }, { 3, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, 192, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171 }, { 3, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, 193, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172 }, { 3, 28, 28, 28, 28, 28, 28, -173, -173, -173, -173, -173, -173, -173, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -173, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 194, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -173, 28, -173, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -174, -174, -174, -174, -174, -174, -174, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -174, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 195, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -174, 28, -174, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -175, -175, -175, -175, -175, -175, -175, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -175, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 196, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -175, 28, -175, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -176, -176, -176, -176, -176, -176, -176, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -176, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 197, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -176, 28, -176, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -177, -177, -177, -177, -177, -177, -177, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -177, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -177, 28, -177, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -178, -178, -178, -178, -178, -178, -178, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -178, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -178, 28, -178, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -179, -179, -179, -179, -179, -179, -179, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -179, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -179, 28, -179, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180 }, { 3, 28, 28, 28, 28, 28, 28, -181, -181, -181, -181, -181, -181, -181, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -181, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -181, 28, -181, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -182, -182, -182, -182, -182, -182, -182, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -182, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 203, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -182, 28, -182, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -183, -183, -183, -183, -183, -183, -183, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -183, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -183, 28, -183, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -184, -184, -184, -184, -184, -184, -184, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -184, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 204, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -184, 28, -184, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -185, -185, -185, -185, -185, -185, -185, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -185, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 205, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -185, 28, -185, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -186, -186, -186, -186, -186, -186, -186, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -186, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -186, 28, -186, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -187, -187, -187, -187, -187, -187, -187, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -187, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -187, 28, -187, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -188, -188, -188, -188, -188, -188, -188, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -188, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 206, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -188, 28, -188, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -189, -189, -189, -189, -189, -189, -189, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -189, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -189, 28, -189, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, 207, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, -190 }, { 3, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, 208, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191 }, { 3, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, 209, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, -192 }, { 3, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, 210, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, -193 }, { 3, 28, 28, 28, 28, 28, 28, -194, -194, -194, -194, -194, -194, -194, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -194, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 211, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -194, 28, -194, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -195, -195, -195, -195, -195, -195, -195, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -195, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 212, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -195, 28, -195, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -196, -196, -196, -196, -196, -196, -196, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -196, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 213, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -196, 28, -196, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -197, -197, -197, -197, -197, -197, -197, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -197, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -197, 28, -197, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -198, -198, -198, -198, -198, -198, -198, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -198, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -198, 28, -198, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -199, -199, -199, -199, -199, -199, -199, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -199, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -199, 28, -199, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -200, -200, -200, -200, -200, -200, -200, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -200, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -200, 28, -200, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, -201 }, { 3, 28, 28, 28, 28, 28, 28, -202, -202, -202, -202, -202, -202, -202, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -202, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -202, 28, -202, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -203, -203, -203, -203, -203, -203, -203, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -203, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -203, 28, -203, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -204, -204, -204, -204, -204, -204, -204, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -204, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 218, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -204, 28, -204, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -205, -205, -205, -205, -205, -205, -205, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -205, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -205, 28, -205, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -206, -206, -206, -206, -206, -206, -206, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -206, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 219, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -206, 28, -206, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, 220, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, -207 }, { 3, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, 221, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, -208 }, { 3, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, 222, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, -209 }, { 3, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, 223, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, -210 }, { 3, 28, 28, 28, 28, 28, 28, -211, -211, -211, -211, -211, -211, -211, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -211, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 224, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -211, 28, -211, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -212, -212, -212, -212, -212, -212, -212, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -212, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 225, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -212, 28, -212, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -213, -213, -213, -213, -213, -213, -213, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -213, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 226, 227, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -213, 28, -213, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -214, -214, -214, -214, -214, -214, -214, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -214, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -214, 28, -214, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -215, -215, -215, -215, -215, -215, -215, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -215, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -215, 28, -215, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -216, -216, -216, -216, -216, -216, -216, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -216, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -216, 28, -216, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, -217 }, { 3, 28, 28, 28, 28, 28, 28, -218, -218, -218, -218, -218, -218, -218, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -218, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 232, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -218, 28, -218, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -219, -219, -219, -219, -219, -219, -219, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -219, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -219, 28, -219, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, 233, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220 }, { 3, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, 234, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, -221 }, { 3, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, 235, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, -222 }, { 3, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, 236, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, -223 }, { 3, 28, 28, 28, 28, 28, 28, -224, -224, -224, -224, -224, -224, -224, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -224, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -224, 28, -224, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -225, -225, -225, -225, -225, -225, -225, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -225, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 237, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -225, 28, -225, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -226, -226, -226, -226, -226, -226, -226, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -226, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -226, 28, -226, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -227, -227, -227, -227, -227, -227, -227, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -227, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -227, 28, -227, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -228, -228, -228, -228, -228, -228, -228, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -228, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -228, 28, -228, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -229, -229, -229, -229, -229, -229, -229, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -229, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -229, 28, -229, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -230, -230, -230, -230, -230, -230, -230, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -230, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -230, 28, -230, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, -231 }, { 3, 28, 28, 28, 28, 28, 28, -232, -232, -232, -232, -232, -232, -232, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -232, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -232, 28, -232, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, 242, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, -233 }, { 3, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, 243, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, -234 }, { 3, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, 244, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, -235 }, { 3, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, 245, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, -236 }, { 3, 28, 28, 28, 28, 28, 28, -237, -237, -237, -237, -237, -237, -237, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -237, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -237, 28, -237, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -238, -238, -238, -238, -238, -238, -238, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -238, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -238, 28, -238, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -239, -239, -239, -239, -239, -239, -239, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -239, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -239, 28, -239, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -240, -240, -240, -240, -240, -240, -240, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -240, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -240, 28, -240, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, -241 }, { 3, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, 250, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, -242 }, { 3, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, 251, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, -243 }, { 3, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, -244 }, { 3, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, -245 }, { 3, 28, 28, 28, 28, 28, 28, -246, -246, -246, -246, -246, -246, -246, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -246, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -246, 28, -246, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -247, -247, -247, -247, -247, -247, -247, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -247, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -247, 28, -247, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, 28, 28, 28, 28, 28, 28, -248, -248, -248, -248, -248, -248, -248, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -248, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -248, 28, -248, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, -249 }, { 3, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, -250 }, { 3, -251, -251, -251, -251, -251, -251, -251, -251, 253, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, 253, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, -251 }, { 3, 28, 28, 28, 28, 28, 28, -252, -252, -252, -252, -252, -252, -252, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -252, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 28, 28, 28, 28, 28, 28, 28, 28, -252, 28, -252, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28 }, { 3, -253, -253, -253, -253, -253, -253, -253, -253, 253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, 253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, 254, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, -253 }, { 3, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, 255, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, -254 }, { 3, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, 256, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255 }, { 3, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, 257, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256 }, { 3, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, 258, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, -257 }, { 3, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, 259, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, -258 }, { 3, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, 260, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, -259 }, { 3, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, 261, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, -260 }, { 3, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, 262, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, -261 }, { 3, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, 263, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, -262 }, { 3, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, 264, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, -263 }, { 3, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, -264 }, } ; static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yynoreturn yy_fatal_error (yyconst char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up cue_scanner_text. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ cue_scanner_leng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 37 #define YY_END_OF_BUFFER 38 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[265] = { 0, 0, 0, 38, 35, 36, 33, 35, 35, 31, 31, 35, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 35, 36, 33, 35, 36, 35, 0, 34, 35, 35, 0, 35, 31, 30, 31, 35, 0, 32, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 36, 34, 0, 34, 0, 34, 31, 35, 31, 35, 0, 32, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 36, 34, 34, 31, 31, 35, 0, 35, 31, 31, 31, 31, 31, 3, 31, 31, 31, 6, 31, 31, 31, 31, 26, 31, 31, 31, 35, 31, 35, 36, 31, 31, 35, 0, 35, 31, 31, 31, 31, 35, 4, 13, 5, 31, 31, 31, 31, 0, 0, 0, 0, 35, 31, 18, 35, 9, 35, 36, 31, 31, 35, 0, 35, 31, 31, 31, 31, 35, 31, 31, 31, 8, 0, 0, 0, 0, 35, 31, 35, 35, 31, 31, 35, 0, 35, 31, 1, 31, 31, 12, 14, 31, 7, 0, 0, 0, 0, 35, 31, 35, 21, 31, 31, 35, 0, 29, 10, 31, 11, 31, 0, 0, 0, 0, 35, 31, 35, 31, 31, 35, 0, 31, 15, 0, 0, 0, 0, 16, 31, 19, 20, 31, 31, 35, 0, 2, 0, 0, 0, 0, 17, 31, 31, 35, 0, 0, 0, 24, 25, 28, 28, 28, 28, 22, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; static yyconst yy_state_type yy_NUL_trans[265] = { 0, 4, 4, 0, 28, 0, 0, 30, 34, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 28, 28, 0, 30, 31, 28, 30, 34, 35, 34, 28, 28, 28, 28, 0, 75, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 31, 30, 35, 34, 28, 28, 28, 28, 0, 75, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 31, 35, 28, 28, 28, 0, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 28, 28, 28, 28, 28, 28, 0, 28, 28, 28, 0, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 0, 28, 28, 28, 0, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 28, 0, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 28, 0, 28, 28, 28, 28, 28, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 0, 28, 28, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 28, 0, 28, 0, 0, 0, 0, 28, 28, 28, 28, 0, 0, 0, 0, 0, 28, 28, 28, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ; extern int cue_scanner__flex_debug; int cue_scanner__flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *cue_scanner_text; #line 1 "libodraw_cue_scanner.l" #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 #line 7 "libodraw_cue_scanner.l" /* * CUE scanner functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_cue_parser.h" #include "libodraw_libcnotify.h" #define YYLEX_PARAM NULL int cue_scanner_suppress_error = 0; size_t cue_scanner_buffer_offset = 0; #define YY_USER_ACTION cue_scanner_buffer_offset += (size_t) cue_scanner_leng; #if defined( HAVE_DEBUG_OUTPUT ) #define cue_scanner_token_print( string ) \ if( libcnotify_verbose != 0 ) libcnotify_printf( "cue_scanner: offset: %" PRIzd " token: %s\n", cue_scanner_buffer_offset, string ) #else #define cue_scanner_token_print( string ) #endif /* The catalog number is a 13 digit number */ /* The ISRC code is a 12 character value, first 5 are alpha numeric, last 7 are numeric */ /* The MSF consists of mm:ss:ff (minutes:seconds:frames) */ #line 8900 "libodraw_cue_scanner.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int cue_scanner_lex_destroy (void ); int cue_scanner_get_debug (void ); void cue_scanner_set_debug (int debug_flag ); YY_EXTRA_TYPE cue_scanner_get_extra (void ); void cue_scanner_set_extra (YY_EXTRA_TYPE user_defined ); FILE *cue_scanner_get_in (void ); void cue_scanner_set_in (FILE * _in_str ); FILE *cue_scanner_get_out (void ); void cue_scanner_set_out (FILE * _out_str ); int cue_scanner_get_leng (void ); char *cue_scanner_get_text (void ); int cue_scanner_get_lineno (void ); void cue_scanner_set_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int cue_scanner_wrap (void ); #else extern int cue_scanner_wrap (void ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( cue_scanner_text, (size_t) cue_scanner_leng, 1, cue_scanner_out )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( cue_scanner_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( cue_scanner_in ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, cue_scanner_in)) == 0 && ferror(cue_scanner_in)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(cue_scanner_in); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int cue_scanner_lex (void); #define YY_DECL int cue_scanner_lex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after cue_scanner_text and cue_scanner_leng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! cue_scanner_in ) cue_scanner_in = stdin; if ( ! cue_scanner_out ) cue_scanner_out = stdout; if ( ! YY_CURRENT_BUFFER ) { cue_scanner_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = cue_scanner__create_buffer(cue_scanner_in,YY_BUF_SIZE ); } cue_scanner__load_buffer_state( ); } { #line 74 "libodraw_cue_scanner.l" #line 9119 "libodraw_cue_scanner.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of cue_scanner_text. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) { if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } ++yy_cp; } yy_current_state = -yy_current_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos) + 1; yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 76 "libodraw_cue_scanner.l" { cue_scanner_token_print( "CATALOG" ); return( CUE_CATALOG ); } YY_BREAK case 2: YY_RULE_SETUP #line 83 "libodraw_cue_scanner.l" { cue_scanner_token_print( "CDTEXTFILE" ); return( CUE_CDTEXTFILE ); } YY_BREAK case 3: YY_RULE_SETUP #line 90 "libodraw_cue_scanner.l" { cue_scanner_token_print( "FILE" ); return( CUE_FILE ); } YY_BREAK case 4: YY_RULE_SETUP #line 97 "libodraw_cue_scanner.l" { cue_scanner_token_print( "FLAGS" ); return( CUE_FLAGS ); } YY_BREAK case 5: YY_RULE_SETUP #line 104 "libodraw_cue_scanner.l" { cue_scanner_token_print( "INDEX" ); return( CUE_INDEX ); } YY_BREAK case 6: YY_RULE_SETUP #line 111 "libodraw_cue_scanner.l" { cue_scanner_token_print( "ISRC" ); return( CUE_ISRC ); } YY_BREAK case 7: YY_RULE_SETUP #line 118 "libodraw_cue_scanner.l" { cue_scanner_token_print( "POSTGAP" ); return( CUE_POSTGAP ); } YY_BREAK case 8: YY_RULE_SETUP #line 125 "libodraw_cue_scanner.l" { cue_scanner_token_print( "PREGAP" ); return( CUE_PREGAP ); } YY_BREAK case 9: YY_RULE_SETUP #line 132 "libodraw_cue_scanner.l" { cue_scanner_token_print( "TRACK" ); return( CUE_TRACK ); } YY_BREAK case 10: YY_RULE_SETUP #line 139 "libodraw_cue_scanner.l" { cue_scanner_token_print( "ARRANGER" ); return( CUE_CDTEXT_ARRANGER ); } YY_BREAK case 11: YY_RULE_SETUP #line 146 "libodraw_cue_scanner.l" { cue_scanner_token_print( "COMPOSER" ); return( CUE_CDTEXT_COMPOSER ); } YY_BREAK case 12: YY_RULE_SETUP #line 153 "libodraw_cue_scanner.l" { cue_scanner_token_print( "DISC_ID" ); return( CUE_CDTEXT_DISC_ID ); } YY_BREAK case 13: YY_RULE_SETUP #line 160 "libodraw_cue_scanner.l" { cue_scanner_token_print( "GENRE" ); return( CUE_CDTEXT_GENRE ); } YY_BREAK case 14: YY_RULE_SETUP #line 167 "libodraw_cue_scanner.l" { cue_scanner_token_print( "MESSAGE" ); return( CUE_CDTEXT_MESSAGE ); } YY_BREAK case 15: YY_RULE_SETUP #line 174 "libodraw_cue_scanner.l" { cue_scanner_token_print( "PERFORMER" ); return( CUE_CDTEXT_PERFORMER ); } YY_BREAK case 16: YY_RULE_SETUP #line 181 "libodraw_cue_scanner.l" { cue_scanner_token_print( "SIZE_INFO" ); return( CUE_CDTEXT_SIZE_INFO ); } YY_BREAK case 17: YY_RULE_SETUP #line 188 "libodraw_cue_scanner.l" { cue_scanner_token_print( "SONGWRITER" ); return( CUE_CDTEXT_SONGWRITER ); } YY_BREAK case 18: YY_RULE_SETUP #line 195 "libodraw_cue_scanner.l" { cue_scanner_token_print( "TITLE" ); return( CUE_CDTEXT_TITLE ); } YY_BREAK case 19: YY_RULE_SETUP #line 202 "libodraw_cue_scanner.l" { cue_scanner_token_print( "TOC_INFO1" ); return( CUE_CDTEXT_TOC_INFO1 ); } YY_BREAK case 20: YY_RULE_SETUP #line 209 "libodraw_cue_scanner.l" { cue_scanner_token_print( "TOC_INFO2" ); return( CUE_CDTEXT_TOC_INFO2 ); } YY_BREAK case 21: YY_RULE_SETUP #line 216 "libodraw_cue_scanner.l" { cue_scanner_token_print( "UPC_EAN" ); return( CUE_CDTEXT_UPC_EAN ); } YY_BREAK case 22: YY_RULE_SETUP #line 223 "libodraw_cue_scanner.l" { cue_scanner_token_print( "REM LEAD-OUT" ); return( CUE_REMARK_LEAD_OUT ); } YY_BREAK case 23: YY_RULE_SETUP #line 230 "libodraw_cue_scanner.l" { cue_scanner_token_print( "REM ORIGINAL MEDIA-TYPE" ); return( CUE_REMARK_ORIGINAL_MEDIA_TYPE ); } YY_BREAK case 24: YY_RULE_SETUP #line 237 "libodraw_cue_scanner.l" { cue_scanner_token_print( "REM RUN-OUT" ); return( CUE_REMARK_RUN_OUT ); } YY_BREAK case 25: YY_RULE_SETUP #line 244 "libodraw_cue_scanner.l" { cue_scanner_token_print( "REM SESSION" ); return( CUE_REMARK_SESSION ); } YY_BREAK case 26: YY_RULE_SETUP #line 251 "libodraw_cue_scanner.l" { /* BEGIN( REM ); */ cue_scanner_token_print( "REM" ); return( CUE_REMARK ); } YY_BREAK case 27: YY_RULE_SETUP #line 260 "libodraw_cue_scanner.l" { cue_scanner_token_print( "cue_catalog_number" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_CATALOG_NUMBER ); } YY_BREAK case 28: YY_RULE_SETUP #line 270 "libodraw_cue_scanner.l" { cue_scanner_token_print( "cue_isrc_code" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_ISRC_CODE ); } YY_BREAK case 29: YY_RULE_SETUP #line 280 "libodraw_cue_scanner.l" { cue_scanner_token_print( "cue_msf" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_MSF ); } YY_BREAK case 30: YY_RULE_SETUP #line 290 "libodraw_cue_scanner.l" { cue_scanner_token_print( "cue_2digit" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_2DIGIT ); } YY_BREAK case 31: YY_RULE_SETUP #line 300 "libodraw_cue_scanner.l" { cue_scanner_token_print( "cue_keyword" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_KEYWORD_STRING ); } YY_BREAK case 32: YY_RULE_SETUP #line 310 "libodraw_cue_scanner.l" ; YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP #line 312 "libodraw_cue_scanner.l" { return( CUE_END_OF_LINE ); } YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP #line 316 "libodraw_cue_scanner.l" { cue_scanner_token_print( "string" ); if( cue_scanner_leng > 2 ) { cue_scanner_lval.string_value.data = &( cue_scanner_text[ 1 ] ); cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng - 2; } else { cue_scanner_lval.string_value.data = NULL; cue_scanner_lval.string_value.length = 0; } return( CUE_STRING ); } YY_BREAK case 35: YY_RULE_SETUP #line 333 "libodraw_cue_scanner.l" { cue_scanner_token_print( "string" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_STRING ); } YY_BREAK case 36: YY_RULE_SETUP #line 343 "libodraw_cue_scanner.l" ; YY_BREAK case 37: YY_RULE_SETUP #line 345 "libodraw_cue_scanner.l" ECHO; YY_BREAK #line 9548 "libodraw_cue_scanner.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed cue_scanner_in at a new source and called * cue_scanner_lex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = cue_scanner_in; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( cue_scanner_wrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * cue_scanner_text, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of cue_scanner_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ cue_scanner_realloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; cue_scanner_restart(cue_scanner_in ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cue_scanner_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { if ( *yy_cp ) { yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; } else yy_current_state = yy_NUL_trans[yy_current_state]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); yy_current_state = yy_NUL_trans[yy_current_state]; yy_is_jam = (yy_current_state == 0); if ( ! yy_is_jam ) { if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } } return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ cue_scanner_restart(cue_scanner_in ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( cue_scanner_wrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve cue_scanner_text */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void cue_scanner_restart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ cue_scanner_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = cue_scanner__create_buffer(cue_scanner_in,YY_BUF_SIZE ); } cue_scanner__init_buffer(YY_CURRENT_BUFFER,input_file ); cue_scanner__load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void cue_scanner__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * cue_scanner_pop_buffer_state(); * cue_scanner_push_buffer_state(new_buffer); */ cue_scanner_ensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; cue_scanner__load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (cue_scanner_wrap()) processing, but the only time this flag * is looked at is after cue_scanner_wrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void cue_scanner__load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; cue_scanner_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE cue_scanner__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) cue_scanner_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in cue_scanner__create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) cue_scanner_alloc((yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in cue_scanner__create_buffer()" ); b->yy_is_our_buffer = 1; cue_scanner__init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with cue_scanner__create_buffer() * */ void cue_scanner__delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) cue_scanner_free((void *) b->yy_ch_buf ); cue_scanner_free((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a cue_scanner_restart() or at EOF. */ static void cue_scanner__init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; cue_scanner__flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then cue_scanner__init_buffer was _probably_ * called from cue_scanner_restart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void cue_scanner__flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) cue_scanner__load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void cue_scanner_push_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; cue_scanner_ensure_buffer_stack(); /* This block is copied from cue_scanner__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from cue_scanner__switch_to_buffer. */ cue_scanner__load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void cue_scanner_pop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; cue_scanner__delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { cue_scanner__load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void cue_scanner_ensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)cue_scanner_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in cue_scanner_ensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)cue_scanner_realloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in cue_scanner_ensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE cue_scanner__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) cue_scanner_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in cue_scanner__scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; cue_scanner__switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to cue_scanner_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * cue_scanner__scan_bytes() instead. */ YY_BUFFER_STATE cue_scanner__scan_string (yyconst char * yystr ) { return cue_scanner__scan_bytes(yystr,(int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to cue_scanner_lex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE cue_scanner__scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) cue_scanner_alloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in cue_scanner__scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = cue_scanner__scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in cue_scanner__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up cue_scanner_text. */ \ yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ cue_scanner_text[cue_scanner_leng] = (yy_hold_char); \ (yy_c_buf_p) = cue_scanner_text + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ cue_scanner_leng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int cue_scanner_get_lineno (void) { return cue_scanner_lineno; } /** Get the input stream. * */ FILE *cue_scanner_get_in (void) { return cue_scanner_in; } /** Get the output stream. * */ FILE *cue_scanner_get_out (void) { return cue_scanner_out; } /** Get the length of the current token. * */ int cue_scanner_get_leng (void) { return cue_scanner_leng; } /** Get the current token. * */ char *cue_scanner_get_text (void) { return cue_scanner_text; } /** Set the current line number. * @param _line_number line number * */ void cue_scanner_set_lineno (int _line_number ) { cue_scanner_lineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see cue_scanner__switch_to_buffer */ void cue_scanner_set_in (FILE * _in_str ) { cue_scanner_in = _in_str ; } void cue_scanner_set_out (FILE * _out_str ) { cue_scanner_out = _out_str ; } int cue_scanner_get_debug (void) { return cue_scanner__flex_debug; } void cue_scanner_set_debug (int _bdebug ) { cue_scanner__flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from cue_scanner_lex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT cue_scanner_in = stdin; cue_scanner_out = stdout; #else cue_scanner_in = NULL; cue_scanner_out = NULL; #endif /* For future reference: Set errno on error, since we are called by * cue_scanner_lex_init() */ return 0; } /* cue_scanner_lex_destroy is for both reentrant and non-reentrant scanners. */ int cue_scanner_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ cue_scanner__delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; cue_scanner_pop_buffer_state(); } /* Destroy the stack itself. */ cue_scanner_free((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * cue_scanner_lex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #define YYTABLES_NAME "yytables" #line 345 "libodraw_cue_scanner.l" void *cue_scanner_alloc( yy_size_t size ) { return( memory_allocate( size ) ); } void *cue_scanner_realloc( void *buffer, yy_size_t size ) { return( memory_reallocate( buffer, size ) ); } void cue_scanner_free( void *buffer ) { memory_free( buffer ); } int cue_scanner_wrap( void ) { return( 1 ); } void cue_scanner_error( void *parser_state, const char *error_string ) { if( cue_scanner_suppress_error == 0 ) { fprintf( stderr, "%s at token: %s (offset: %" PRIzd " size: %" PRIzd ")\n", error_string, cue_scanner_text, cue_scanner_buffer_offset - (size_t) cue_scanner_leng, (size_t) cue_scanner_leng ); } } libewf-20140807/libodraw/libodraw_libcpath.h0000664000175000017500000000252713443450062022765 0ustar00lordyestalordyesta00000000000000/* * The internal libcpath header * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBCPATH_H ) #define _LIBODRAW_LIBCPATH_H #include /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath */ #if defined( HAVE_LOCAL_LIBCPATH ) #include #include #else /* If libtool DLL support is enabled set LIBCPATH_DLL_IMPORT * before including libcpath.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCPATH_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCPATH ) */ #endif /* !defined( _LIBODRAW_LIBCPATH_H ) */ libewf-20140807/libodraw/libodraw_libcerror.h0000664000175000017500000000264013443450062023156 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBCERROR_H ) #define _LIBODRAW_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBODRAW_LIBCERROR_H ) */ libewf-20140807/libodraw/libodraw_libuna.h0000664000175000017500000000331213443450062022442 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2010-2019, 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( _LIBODRAW_LIBUNA_H ) #define _LIBODRAW_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBODRAW_LIBUNA_H ) */ libewf-20140807/libodraw/libodraw_cue_scanner.l0000664000175000017500000001566313443450062023475 0ustar00lordyestalordyesta00000000000000%option prefix="cue_scanner_" outfile="lex.yy.c" %option never-interactive 8bit %option noinput nounput noyylineno nounistd %option noyyalloc noyyrealloc noyyfree %{ /* * CUE scanner functions * * Copyright (C) 2010-2019, 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 . */ #include #include #include #include "libodraw_cue_parser.h" #include "libodraw_libcnotify.h" #define YYLEX_PARAM NULL int cue_scanner_suppress_error = 0; size_t cue_scanner_buffer_offset = 0; #define YY_USER_ACTION cue_scanner_buffer_offset += (size_t) cue_scanner_leng; #if defined( HAVE_DEBUG_OUTPUT ) #define cue_scanner_token_print( string ) \ if( libcnotify_verbose != 0 ) libcnotify_printf( "cue_scanner: offset: %" PRIzd " token: %s\n", cue_scanner_buffer_offset, string ) #else #define cue_scanner_token_print( string ) #endif %} cue_2digit [0-9][0-9] /* The catalog number is a 13 digit number */ cue_catalog_number [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] cue_comments ;[ ][^\r\n]* /* The ISRC code is a 12 character value, first 5 are alpha numeric, last 7 are numeric */ cue_isrc_code [A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] cue_keyword [A-Z0-9/]+ /* The MSF consists of mm:ss:ff (minutes:seconds:frames) */ cue_msf [0-9][0-9]:[0-9][0-9]:[0-9][0-9] end_of_line [\r\n|\n|\r] string_double_quoted ["]([^"]|\\["])*["] string_single_quoted [']([^']|\\['])*['] string_unquoted [^\a\b\c\e\f\n\r\t\v ]+ white_space [\a\b\c\e\f\t\v ]+ %% CATALOG { cue_scanner_token_print( "CATALOG" ); return( CUE_CATALOG ); } CDTEXTFILE { cue_scanner_token_print( "CDTEXTFILE" ); return( CUE_CDTEXTFILE ); } FILE { cue_scanner_token_print( "FILE" ); return( CUE_FILE ); } FLAGS { cue_scanner_token_print( "FLAGS" ); return( CUE_FLAGS ); } INDEX { cue_scanner_token_print( "INDEX" ); return( CUE_INDEX ); } ISRC { cue_scanner_token_print( "ISRC" ); return( CUE_ISRC ); } POSTGAP { cue_scanner_token_print( "POSTGAP" ); return( CUE_POSTGAP ); } PREGAP { cue_scanner_token_print( "PREGAP" ); return( CUE_PREGAP ); } TRACK { cue_scanner_token_print( "TRACK" ); return( CUE_TRACK ); } ARRANGER { cue_scanner_token_print( "ARRANGER" ); return( CUE_CDTEXT_ARRANGER ); } COMPOSER { cue_scanner_token_print( "COMPOSER" ); return( CUE_CDTEXT_COMPOSER ); } DISC_ID { cue_scanner_token_print( "DISC_ID" ); return( CUE_CDTEXT_DISC_ID ); } GENRE { cue_scanner_token_print( "GENRE" ); return( CUE_CDTEXT_GENRE ); } MESSAGE { cue_scanner_token_print( "MESSAGE" ); return( CUE_CDTEXT_MESSAGE ); } PERFORMER { cue_scanner_token_print( "PERFORMER" ); return( CUE_CDTEXT_PERFORMER ); } SIZE_INFO { cue_scanner_token_print( "SIZE_INFO" ); return( CUE_CDTEXT_SIZE_INFO ); } SONGWRITER { cue_scanner_token_print( "SONGWRITER" ); return( CUE_CDTEXT_SONGWRITER ); } TITLE { cue_scanner_token_print( "TITLE" ); return( CUE_CDTEXT_TITLE ); } TOC_INFO1 { cue_scanner_token_print( "TOC_INFO1" ); return( CUE_CDTEXT_TOC_INFO1 ); } TOC_INFO2 { cue_scanner_token_print( "TOC_INFO2" ); return( CUE_CDTEXT_TOC_INFO2 ); } UPC_EAN { cue_scanner_token_print( "UPC_EAN" ); return( CUE_CDTEXT_UPC_EAN ); } REM[ \t]+LEAD-OUT { cue_scanner_token_print( "REM LEAD-OUT" ); return( CUE_REMARK_LEAD_OUT ); } REM[ \t]+ORIGINAL[ \t]+MEDIA-TYPE: { cue_scanner_token_print( "REM ORIGINAL MEDIA-TYPE" ); return( CUE_REMARK_ORIGINAL_MEDIA_TYPE ); } REM[ \t]+RUN-OUT { cue_scanner_token_print( "REM RUN-OUT" ); return( CUE_REMARK_RUN_OUT ); } REM[ \t]+SESSION { cue_scanner_token_print( "REM SESSION" ); return( CUE_REMARK_SESSION ); } REM[ \t]+ { /* BEGIN( REM ); */ cue_scanner_token_print( "REM" ); return( CUE_REMARK ); } {cue_catalog_number} { cue_scanner_token_print( "cue_catalog_number" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_CATALOG_NUMBER ); } {cue_isrc_code} { cue_scanner_token_print( "cue_isrc_code" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_ISRC_CODE ); } {cue_msf} { cue_scanner_token_print( "cue_msf" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_MSF ); } {cue_2digit} { cue_scanner_token_print( "cue_2digit" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_2DIGIT ); } {cue_keyword} { cue_scanner_token_print( "cue_keyword" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_KEYWORD_STRING ); } {cue_comments} ; {end_of_line} { return( CUE_END_OF_LINE ); } {string_double_quoted}|{string_single_quoted} { cue_scanner_token_print( "string" ); if( cue_scanner_leng > 2 ) { cue_scanner_lval.string_value.data = &( cue_scanner_text[ 1 ] ); cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng - 2; } else { cue_scanner_lval.string_value.data = NULL; cue_scanner_lval.string_value.length = 0; } return( CUE_STRING ); } {string_unquoted} { cue_scanner_token_print( "string" ); cue_scanner_lval.string_value.data = cue_scanner_text; cue_scanner_lval.string_value.length = (size_t) cue_scanner_leng; return( CUE_STRING ); } {white_space} ; %% void *cue_scanner_alloc( yy_size_t size ) { return( memory_allocate( size ) ); } void *cue_scanner_realloc( void *buffer, yy_size_t size ) { return( memory_reallocate( buffer, size ) ); } void cue_scanner_free( void *buffer ) { memory_free( buffer ); } int cue_scanner_wrap( void ) { return( 1 ); } void cue_scanner_error( void *parser_state, const char *error_string ) { if( cue_scanner_suppress_error == 0 ) { fprintf( stderr, "%s at token: %s (offset: %" PRIzd " size: %" PRIzd ")\n", error_string, cue_scanner_text, cue_scanner_buffer_offset - (size_t) cue_scanner_leng, (size_t) cue_scanner_leng ); } } libewf-20140807/libewf.spec.in0000664000175000017500000001226713440663046020100 0ustar00lordyestalordyesta00000000000000Name: libewf Version: @VERSION@ Release: 1 Summary: Library to access the Expert Witness Compression Format (EWF) Group: System Environment/Libraries 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_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 gcc-c++ @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). libewf allows you to read media information of EWF files in the SMART (EWF-S01) format and the EnCase (EWF-E01, EWF-L01, EWF2-Ex01 and EWF2-Lx01) formats. 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_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@ %description -n libewf-static Static library version of libewf %package -n libewf-devel Summary: Header files and libraries for developing applications for libewf Group: Development/Libraries Requires: libewf = %{version}-%{release} %description -n libewf-devel Header files and libraries for developing applications for libewf. %package -n libewf-python2 Obsoletes: libewf-python < %{version} Provides: libewf-python = %{version} Summary: Python 2 bindings for libewf Group: System Environment/Libraries Requires: libewf = %{version}-%{release} python2 BuildRequires: python2-devel %description -n libewf-python2 Python 2 bindings for libewf %package -n libewf-python3 Summary: Python 3 bindings for libewf Group: System Environment/Libraries Requires: libewf = %{version}-%{release} python3 BuildRequires: python3-devel %description -n libewf-python3 Python 3 bindings for libewf %package -n libewf-tools Summary: Several tools for reading and writing EWF files Group: Applications/System Requires: libewf = %{version}-%{release} @ax_libcdatetime_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libfuse_spec_requires@ @ax_libodraw_spec_requires@ @ax_libsmdev_spec_requires@ @ax_libsmraw_spec_requires@ @ax_libuuid_spec_requires@ @libewf_spec_tools_build_requires@ byacc flex @ax_libcdatetime_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libfuse_spec_build_requires@ @ax_libodraw_spec_build_requires@ @ax_libsmdev_spec_build_requires@ @ax_libsmraw_spec_build_requires@ @ax_libuuid_spec_build_requires@ %description -n libewf-tools Several tools for reading and writing EWF files %prep %setup -q %build %configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python2 --enable-python3 make %{?_smp_mflags} %install rm -rf %{buildroot} %make_install %clean rm -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -n libewf %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %attr(755,root,root) %{_libdir}/*.so.* %files -n libewf-static %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %attr(755,root,root) %{_libdir}/*.a %files -n libewf-devel %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %{_libdir}/*.la %{_libdir}/*.so %{_libdir}/pkgconfig/libewf.pc %{_includedir}/* %{_mandir}/man3/* %files -n libewf-python2 %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %{_libdir}/python2*/site-packages/*.a %{_libdir}/python2*/site-packages/*.la %{_libdir}/python2*/site-packages/*.so %files -n libewf-python3 %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %{_libdir}/python3*/site-packages/*.a %{_libdir}/python3*/site-packages/*.la %{_libdir}/python3*/site-packages/*.so %files -n libewf-tools %defattr(644,root,root,755) %license COPYING %doc AUTHORS README %attr(755,root,root) %{_bindir}/* %{_mandir}/man1/* # Exclude ewfdebug tool %exclude %{_bindir}/ewfdebug %changelog * @SPEC_DATE@ Joachim Metz @VERSION@-1 - Auto-generated libewf-20140807/libcfile/0000775000175000017500000000000013443455445017115 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcfile/libcfile_file.c0000664000175000017500000033262013443450031022021 0ustar00lordyestalordyesta00000000000000/* * File functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_SYS_STAT_H ) #include #endif #if defined( HAVE_ERRNO_H ) #include #endif #if defined( HAVE_FCNTL_H ) #include #endif #if defined( WINAPI ) #include #endif #if defined( WINAPI ) && !defined( __CYGWIN__ ) #include #endif #if defined( HAVE_SYS_IOCTL_H ) #include #endif #if defined( WINAPI ) #include #elif defined( HAVE_CYGWIN_FS_H ) #include #elif defined( HAVE_LINUX_FS_H ) /* Required for Linux platforms that use a sizeof( u64 ) * in linux/fs.h but have no typedef of it */ #if !defined( HAVE_U64 ) typedef size_t u64; #endif #include #else #if defined( HAVE_SYS_DISK_H ) #include #endif #if defined( HAVE_SYS_DISKLABEL_H ) #include #endif #endif #if defined( HAVE_UNISTD_H ) #include #endif #if defined( HAVE_GLIB_H ) #include #include #endif #include "libcfile_definitions.h" #include "libcfile_file.h" #include "libcfile_libcerror.h" #include "libcfile_libcnotify.h" #include "libcfile_system_string.h" #include "libcfile_types.h" #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of CloseHandle * Returns TRUE if successful or FALSE on error */ BOOL libcfile_CloseHandle( HANDLE file_handle ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "CloseHandle" ); if( function != NULL ) { result = function( file_handle ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ /* Creates a file * Make sure the value file is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcfile_file_initialize( libcfile_file_t **file, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_initialize"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } if( *file != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file value already set.", function ); return( -1 ); } internal_file = memory_allocate_structure( libcfile_internal_file_t ); if( internal_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file.", function ); goto on_error; } if( memory_set( internal_file, 0, sizeof( libcfile_internal_file_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file.", function ); goto on_error; } #if defined( WINAPI ) internal_file->handle = INVALID_HANDLE_VALUE; #else internal_file->descriptor = -1; #endif *file = (libcfile_file_t *) internal_file; return( 1 ); on_error: if( internal_file != NULL ) { memory_free( internal_file ); } return( -1 ); } /* Frees a file * Returns 1 if successful or -1 on error */ int libcfile_file_free( libcfile_file_t **file, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_free"; int result = 1; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } if( *file != NULL ) { internal_file = (libcfile_internal_file_t *) *file; #if defined( WINAPI ) if( internal_file->handle != INVALID_HANDLE_VALUE ) #else if( internal_file->descriptor != -1 ) #endif { if( libcfile_file_close( *file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file.", function ); result = -1; } } *file = NULL; if( internal_file->block_data != NULL ) { memory_free( internal_file->block_data ); } memory_free( internal_file ); } return( result ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of CreateFileA * Returns a handle if successful or INVALID_HANDLE_VALUE on error */ HANDLE libcfile_CreateFileA( LPCSTR filename, DWORD desired_access, DWORD share_mode, SECURITY_ATTRIBUTES *security_attributes, DWORD creation_disposition, DWORD flags_and_attributes, HANDLE template_file ) { FARPROC function = NULL; HANDLE result = INVALID_HANDLE_VALUE; HMODULE library_handle = NULL; if( filename == NULL ) { return( INVALID_HANDLE_VALUE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( INVALID_HANDLE_VALUE ); } function = GetProcAddress( library_handle, (LPCSTR) "CreateFileA" ); if( function != NULL ) { result = (HANDLE) function( filename, desired_access, share_mode, security_attributes, creation_disposition, flags_and_attributes, template_file ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcfile_CloseHandle( result ); return( INVALID_HANDLE_VALUE ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ /* Opens a file * Returns 1 if successful or -1 on error */ int libcfile_file_open( libcfile_file_t *file, const char *filename, int access_flags, libcerror_error_t **error ) { static char *function = "libcfile_file_open"; uint32_t error_code = 0; if( libcfile_file_open_with_error_code( file, filename, access_flags, &error_code, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) /* Opens a file * This function uses the WINAPI function for Windows XP (0x0501) or later, * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcfile_file_open_with_error_code( libcfile_file_t *file, const char *filename, int access_flags, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_open_with_error_code"; DWORD file_io_access_flags = 0; DWORD file_io_creation_flags = 0; DWORD file_io_shared_flags = 0; DWORD flags_and_attributes = 0; size_t filename_length = 0; ssize_t read_count = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle != INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file - handle value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) ) { file_io_access_flags = GENERIC_WRITE | GENERIC_READ; file_io_creation_flags = OPEN_ALWAYS; file_io_shared_flags = FILE_SHARE_READ; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) { file_io_access_flags = GENERIC_READ; file_io_creation_flags = OPEN_EXISTING; /* FILE_SHARE_WRITE is set to allow reading files that are * currently being written FILE_SHARE_READ alone does not suffice */ file_io_shared_flags = FILE_SHARE_READ | FILE_SHARE_WRITE; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) { file_io_access_flags = GENERIC_WRITE; file_io_creation_flags = OPEN_ALWAYS; file_io_shared_flags = FILE_SHARE_READ; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags: 0x%02x.", function, access_flags ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_TRUNCATE ) != 0 ) ) { file_io_creation_flags = CREATE_ALWAYS; } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } filename_length = narrow_string_length( filename ); if( filename_length > 4 ) { if( ( filename[ 0 ] == '\\' ) && ( filename[ 1 ] == '\\' ) && ( filename[ 2 ] == '.' ) && ( filename[ 3 ] == '\\' ) ) { /* Ignore \\.\F:\ which is an alternative notation for F: */ if( ( filename_length < 7 ) || ( filename[ 5 ] != ':' ) || ( filename[ 6 ] != '\\' ) ) { internal_file->is_device_filename = 1; internal_file->use_asynchronous_io = 1; } } } flags_and_attributes = FILE_ATTRIBUTE_NORMAL; if( internal_file->use_asynchronous_io != 0 ) { flags_and_attributes |= FILE_FLAG_OVERLAPPED; } #if ( WINVER <= 0x0500 ) internal_file->handle = libcfile_CreateFileA( (LPCSTR) filename, file_io_access_flags, file_io_shared_flags, NULL, file_io_creation_flags, flags_and_attributes, NULL ); #else internal_file->handle = CreateFileA( (LPCSTR) filename, file_io_access_flags, file_io_shared_flags, NULL, file_io_creation_flags, flags_and_attributes, NULL ); #endif if( internal_file->handle == INVALID_HANDLE_VALUE ) { *error_code = (uint32_t) GetLastError(); switch( *error_code ) { case ERROR_ACCESS_DENIED: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_ACCESS_DENIED, "%s: access denied to file: %" PRIs_SYSTEM ".", function, filename ); break; case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_INVALID_RESOURCE, "%s: no such file: %" PRIs_SYSTEM ".", function, filename ); break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, *error_code, "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); break; } return( -1 ); } if( internal_file->is_device_filename != 0 ) { read_count = libcfile_file_io_control_read_with_error_code( file, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, error_code, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: FSCTL_ALLOW_EXTENDED_DASD_IO.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } } internal_file->access_flags = access_flags; internal_file->current_offset = 0; return( 1 ); } #elif defined( HAVE_OPEN ) /* Opens a file * This function uses the POSIX open function or equivalent * Returns 1 if successful or -1 on error */ int libcfile_file_open_with_error_code( libcfile_file_t *file, const char *filename, int access_flags, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_open_with_error_code"; int file_io_flags = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor != -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file - descriptor value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) ) { file_io_flags = O_RDWR | O_CREAT; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) { file_io_flags = O_RDONLY; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) { file_io_flags = O_WRONLY | O_CREAT; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags: 0x%02x.", function, access_flags ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_TRUNCATE ) != 0 ) ) { file_io_flags |= O_TRUNC; } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } #if defined( O_CLOEXEC ) /* Prevent the file descriptor to remain open across an execve */ file_io_flags |= O_CLOEXEC; #endif #if defined( HAVE_GLIB_H ) internal_file->descriptor = g_open( filename, file_io_flags, 0644 ); #else internal_file->descriptor = open( filename, file_io_flags, 0644 ); #endif if( internal_file->descriptor == -1 ) { *error_code = (uint32_t) errno; switch( *error_code ) { case EACCES: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_ACCESS_DENIED, "%s: access denied to file: %" PRIs_SYSTEM ".", function, filename ); break; case ENOENT: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_INVALID_RESOURCE, "%s: no such file: %" PRIs_SYSTEM ".", function, filename ); break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, *error_code, "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); break; } return( -1 ); } internal_file->access_flags = access_flags; internal_file->current_offset = 0; return( 1 ); } #else #error Missing file open function #endif #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of CreateFileW * Returns a handle if successful or INVALID_HANDLE_VALUE on error */ HANDLE libcfile_CreateFileW( LPCWSTR filename, DWORD desired_access, DWORD share_mode, SECURITY_ATTRIBUTES *security_attributes, DWORD creation_disposition, DWORD flags_and_attributes, HANDLE template_file ) { FARPROC function = NULL; HANDLE result = INVALID_HANDLE_VALUE; HMODULE library_handle = NULL; if( filename == NULL ) { return( INVALID_HANDLE_VALUE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( INVALID_HANDLE_VALUE ); } function = GetProcAddress( library_handle, (LPCSTR) "CreateFileW" ); if( function != NULL ) { result = (HANDLE) function( filename, desired_access, share_mode, security_attributes, creation_disposition, flags_and_attributes, template_file ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcfile_CloseHandle( result ); return( INVALID_HANDLE_VALUE ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ /* Opens a file * Returns 1 if successful or -1 on error */ int libcfile_file_open_wide( libcfile_file_t *file, const wchar_t *filename, int access_flags, libcerror_error_t **error ) { static char *function = "libcfile_file_open_wide"; uint32_t error_code = 0; if( libcfile_file_open_wide_with_error_code( file, filename, access_flags, &error_code, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) /* Opens a file * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcfile_file_open_wide_with_error_code( libcfile_file_t *file, const wchar_t *filename, int access_flags, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_open_wide_with_error_code"; DWORD file_io_access_flags = 0; DWORD file_io_creation_flags = 0; DWORD file_io_shared_flags = 0; DWORD flags_and_attributes = 0; size_t filename_length = 0; ssize_t read_count = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle != INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file - handle value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) ) { file_io_access_flags = GENERIC_WRITE | GENERIC_READ; file_io_creation_flags = OPEN_ALWAYS; file_io_shared_flags = FILE_SHARE_READ; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) { file_io_access_flags = GENERIC_READ; file_io_creation_flags = OPEN_EXISTING; /* FILE_SHARE_WRITE is set to allow reading files that are * currently being written FILE_SHARE_READ alone does not suffice */ file_io_shared_flags = FILE_SHARE_READ | FILE_SHARE_WRITE; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) { file_io_access_flags = GENERIC_WRITE; file_io_creation_flags = OPEN_ALWAYS; file_io_shared_flags = FILE_SHARE_READ; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags: 0x%02x.", function, access_flags ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_TRUNCATE ) != 0 ) ) { file_io_creation_flags = CREATE_ALWAYS; } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } filename_length = wide_string_length( filename ); if( filename_length > 4 ) { if( ( filename[ 0 ] == (wchar_t) '\\' ) && ( filename[ 1 ] == (wchar_t) '\\' ) && ( filename[ 2 ] == (wchar_t) '.' ) && ( filename[ 3 ] == (wchar_t) '\\' ) ) { /* Ignore \\.\F:\ which is an alternative notation for F: */ if( ( filename_length < 7 ) || ( filename[ 5 ] != (wchar_t) ':' ) || ( filename[ 6 ] != (wchar_t) '\\' ) ) { internal_file->is_device_filename = 1; internal_file->use_asynchronous_io = 1; } } } flags_and_attributes = FILE_ATTRIBUTE_NORMAL; if( internal_file->use_asynchronous_io != 0 ) { flags_and_attributes |= FILE_FLAG_OVERLAPPED; } #if ( WINVER <= 0x0500 ) internal_file->handle = libcfile_CreateFileW( (LPCWSTR) filename, file_io_access_flags, file_io_shared_flags, NULL, file_io_creation_flags, flags_and_attributes, NULL ); #else internal_file->handle = CreateFileW( (LPCWSTR) filename, file_io_access_flags, file_io_shared_flags, NULL, file_io_creation_flags, flags_and_attributes, NULL ); #endif if( internal_file->handle == INVALID_HANDLE_VALUE ) { *error_code = (uint32_t) GetLastError(); switch( *error_code ) { case ERROR_ACCESS_DENIED: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_ACCESS_DENIED, "%s: access denied to file: %" PRIs_SYSTEM ".", function, filename ); break; case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_INVALID_RESOURCE, "%s: no such file: %" PRIs_SYSTEM ".", function, filename ); break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, *error_code, "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); break; } return( -1 ); } if( internal_file->is_device_filename != 0 ) { read_count = libcfile_file_io_control_read_with_error_code( file, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, error_code, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: FSCTL_ALLOW_EXTENDED_DASD_IO.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } } return( 1 ); } #elif defined( HAVE_OPEN ) /* Opens a file * This function uses the POSIX open function or equivalent * Returns 1 if successful or -1 on error */ int libcfile_file_open_wide_with_error_code( libcfile_file_t *file, const wchar_t *filename, int access_flags, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_open_wide_with_error_code"; char *narrow_filename = NULL; size_t filename_size = 0; size_t narrow_filename_size = 0; int file_io_flags = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor != -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file - descriptor value already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) ) { file_io_flags = O_RDWR | O_CREAT; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_READ ) != 0 ) { file_io_flags = O_RDONLY; } else if( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) { file_io_flags = O_WRONLY | O_CREAT; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access flags: 0x%02x.", function, access_flags ); return( -1 ); } if( ( ( access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) && ( ( access_flags & LIBCFILE_ACCESS_FLAG_TRUNCATE ) != 0 ) ) { file_io_flags |= O_TRUNC; } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } filename_size = 1 + wide_string_length( filename ); if( libcfile_system_string_size_from_wide_string( filename, filename_size, &narrow_filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow character filename size.", function ); goto on_error; } narrow_filename = narrow_string_allocate( narrow_filename_size ); if( narrow_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create narrow character filename.", function ); goto on_error; } if( libcfile_system_string_copy_from_wide_string( narrow_filename, narrow_filename_size, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set narrow character filename.", function ); goto on_error; } #if defined( O_CLOEXEC ) /* Prevent the file descriptor to remain open across an execve */ file_io_flags |= O_CLOEXEC; #endif #if defined( HAVE_GLIB_H ) internal_file->descriptor = g_open( narrow_filename, file_io_flags, 0644 ); #else internal_file->descriptor = open( narrow_filename, file_io_flags, 0644 ); #endif memory_free( narrow_filename ); narrow_filename = NULL; if( internal_file->descriptor == -1 ) { *error_code = (uint32_t) errno; switch( *error_code ) { case EACCES: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_ACCESS_DENIED, "%s: access denied to file: %" PRIs_SYSTEM ".", function, filename ); break; case ENOENT: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_INVALID_RESOURCE, "%s: no such file: %" PRIs_SYSTEM ".", function, filename ); break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, *error_code, "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); break; } goto on_error; } return( 1 ); on_error: if( narrow_filename != NULL ) { memory_free( narrow_filename ); } return( -1 ); } #else #error Missing file open wide function #endif #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( WINAPI ) /* Closes the file * This function uses the WINAPI function for Windows 2000 (0x0500) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 0 if successful or -1 on error */ int libcfile_file_close( libcfile_file_t *file, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_close"; DWORD error_code = 0; BOOL result = FALSE; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle != INVALID_HANDLE_VALUE ) { #if ( WINVER <= 0x0500 ) result = libcfile_CloseHandle( internal_file->handle ); #else result = CloseHandle( internal_file->handle ); #endif if( result == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, error_code, "%s: unable to close file.", function ); return( -1 ); } internal_file->handle = INVALID_HANDLE_VALUE; internal_file->is_device_filename = 0; internal_file->use_asynchronous_io = 0; internal_file->access_flags = 0; internal_file->size = 0; internal_file->current_offset = 0; } if( internal_file->block_data != NULL ) { if( memory_set( internal_file->block_data, 0, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } } return( 0 ); } #elif defined( HAVE_CLOSE ) /* Closes the file * This function uses the POSIX close function or equivalent * Returns 0 if successful or -1 on error */ int libcfile_file_close( libcfile_file_t *file, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_close"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor != -1 ) { if( close( internal_file->descriptor ) != 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, errno, "%s: unable to close file.", function ); return( -1 ); } internal_file->descriptor = -1; internal_file->access_flags = 0; internal_file->size = 0; internal_file->current_offset = 0; } if( internal_file->block_data != NULL ) { if( memory_set( internal_file->block_data, 0, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } } return( 0 ); } #else #error Missing file close function #endif /* Reads a buffer from the file * Returns the number of bytes read if successful, or -1 on error */ ssize_t libcfile_file_read_buffer( libcfile_file_t *file, uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libcfile_file_read_buffer"; ssize_t read_count = 0; uint32_t error_code = 0; read_count = libcfile_file_read_buffer_with_error_code( file, buffer, size, &error_code, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file.", function ); return( -1 ); } return( read_count ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetOverlappedResult * Returns TRUE if successful or FALSE on error */ BOOL libcfile_GetOverlappedResult( HANDLE file_handle, OVERLAPPED *overlapped, DWORD *read_count, BOOL wait_io_complete ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } if( overlapped == NULL ) { return( FALSE ); } if( read_count == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "GetOverlappedResult" ); if( function != NULL ) { result = function( file_handle, overlapped, read_count, wait_io_complete ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* if defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of ReadFile * Returns TRUE if successful or FALSE on error */ BOOL libcfile_ReadFile( HANDLE file_handle, VOID *buffer, DWORD read_size, DWORD *read_count, OVERLAPPED *overlapped ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } if( buffer == NULL ) { return( FALSE ); } if( read_count == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "ReadFile" ); if( function != NULL ) { result = function( file_handle, buffer, read_size, read_count, overlapped ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Reads a buffer from the file * This is an internal function to wrap ReadFile in synchronous and asynchronous mode * the current_offset is only used in asynchronous mode. * Returns the number of bytes read if successful, or -1 on error */ ssize_t libcfile_internal_file_read_buffer_at_offset_with_error_code( libcfile_internal_file_t *internal_file, off64_t current_offset, uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ) { OVERLAPPED overlapped_data; static char *function = "libcfile_internal_file_read_buffer_at_offset_with_error_code"; OVERLAPPED *overlapped = NULL; DWORD read_count = 0; BOOL io_pending = FALSE; BOOL result = FALSE; if( internal_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } if( current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current offset value out of bounds.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( UINT32_MAX < SSIZE_MAX ) if( size > (size_t) UINT32_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } /* For Windows devices we need to use asynchronous IO here * otherwise the ReadFile function can return ERROR_INVALID_PARAMETER * if the device is read concurrently and the the block is too large * to fill. Using smaller block sizes decreases the likelyhood but * also impacts the performance. */ if( internal_file->use_asynchronous_io != 0 ) { if( memory_set( &overlapped_data, 0, sizeof( OVERLAPPED ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear overlapped data.", function ); return( -1 ); } overlapped = &overlapped_data; overlapped->Offset = (DWORD) ( 0x0ffffffffUL & current_offset ); overlapped->OffsetHigh = (DWORD) ( current_offset >> 32 ); } #if ( WINVER <= 0x0500 ) result = libcfile_ReadFile( internal_file->handle, buffer, (DWORD) size, &read_count, overlapped ); #else result = ReadFile( internal_file->handle, (VOID *) buffer, (DWORD) size, &read_count, overlapped ); #endif if( result == 0 ) { *error_code = (uint32_t) GetLastError(); switch( *error_code ) { case ERROR_HANDLE_EOF: break; case ERROR_IO_PENDING: io_pending = TRUE; break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, *error_code, "%s: unable to read from file.", function ); return( -1 ); } } if( io_pending == TRUE ) { #if ( WINVER <= 0x0500 ) result = libcfile_GetOverlappedResult( internal_file->handle, overlapped, &read_count, TRUE ); #else result = GetOverlappedResult( internal_file->handle, overlapped, &read_count, TRUE ); #endif if( result == 0 ) { *error_code = (uint32_t) GetLastError(); switch( *error_code ) { case ERROR_HANDLE_EOF: break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, *error_code, "%s: unable to read from file - overlapped result.", function ); return( -1 ); } } } return( (ssize_t) read_count ); } /* Reads a buffer from the file * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns the number of bytes read if successful, or -1 on error */ ssize_t libcfile_file_read_buffer_with_error_code( libcfile_file_t *file, uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_read_buffer_with_error_code"; size_t buffer_offset = 0; size_t read_size = 0; size_t read_size_remainder = 0; ssize_t read_count = 0; BOOL result = FALSE; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( UINT32_MAX < SSIZE_MAX ) if( size > (size_t) UINT32_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } if( internal_file->block_size != 0 ) { if( internal_file->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file - current offset value out of bounds.", function ); return( -1 ); } if( (size64_t) internal_file->current_offset > internal_file->size ) { return( 0 ); } if( ( (size64_t) internal_file->current_offset + size ) > internal_file->size ) { size = (size_t) ( internal_file->size - internal_file->current_offset ); } } if( size == 0 ) { return( 0 ); } if( ( internal_file->block_data_offset > 0 ) && ( internal_file->block_data_size == 0 ) ) { if( memory_set( internal_file->block_data, 0, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( internal_file, internal_file->current_offset - internal_file->block_data_offset, internal_file->block_data, internal_file->block_size, error_code, error ); if( read_count != (ssize_t) internal_file->block_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: invalid read count: %" PRIzd " returned.", function, read_count ); return( -1 ); } internal_file->block_data_size = (size_t) read_count; } if( ( internal_file->block_data_offset > 0 ) && ( internal_file->block_data_offset < internal_file->block_data_size ) ) { read_size = internal_file->block_data_size - internal_file->block_data_offset; if( read_size > size ) { read_size = size; } if( memory_copy( buffer, &( internal_file->block_data[ internal_file->block_data_offset ] ), read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy block data.", function ); return( -1 ); } buffer_offset += read_size; size -= read_size; internal_file->current_offset += read_size; internal_file->block_data_offset += read_size; } if( size == 0 ) { return( (ssize_t) buffer_offset ); } if( internal_file->block_size == 0 ) { read_size = size; } else { read_size_remainder = size % internal_file->block_size; read_size = size - read_size_remainder; } if( read_size > 0 ) { read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( internal_file, internal_file->current_offset, &( buffer[ buffer_offset ] ), read_size, error_code, error ); if( ( internal_file->block_size == 0 ) && ( read_count < 0 ) ) { result = 0; } else { result = 1; } if( result != 0 ) { buffer_offset += (size_t) read_count; internal_file->current_offset += read_count; } /* Non-buffered Windows devices require the buffer to be aligned. * The alignment can be determined by GetFileInformationByHandleEx. * The ReadFile function appears to return ERROR_INVALID_PARAMETER * in case it fails on alignment. */ else if( *error_code == ERROR_INVALID_PARAMETER ) { /* As a fallback read the data using the block data buffer */ while( read_size > 0 ) { read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( internal_file, internal_file->current_offset, internal_file->block_data, internal_file->block_size, error_code, error ); if( read_count != (ssize_t) internal_file->block_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: invalid read count: %" PRIzd " returned.", function, read_count ); return( -1 ); } if( memory_copy( &( buffer[ buffer_offset ] ), internal_file->block_data, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy block data.", function ); return( -1 ); } buffer_offset += internal_file->block_size; read_size -= internal_file->block_size; internal_file->current_offset += internal_file->block_size; } } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: invalid read count: %" PRIzd " returned.", function, read_count ); return( -1 ); } } if( read_size_remainder > 0 ) { /* The read was cut short */ if( read_count != (ssize_t) read_size ) { return( (ssize_t) buffer_offset ); } if( memory_set( internal_file->block_data, 0, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( internal_file, internal_file->current_offset, internal_file->block_data, internal_file->block_size, error_code, error ); if( read_count != (ssize_t) internal_file->block_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: invalid read count: %" PRIzd " returned.", function, read_count ); return( -1 ); } internal_file->block_data_offset = 0; internal_file->block_data_size = (size_t) read_count; if( memory_copy( &( buffer[ buffer_offset ] ), internal_file->block_data, read_size_remainder ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy block data.", function ); return( -1 ); } buffer_offset += read_size_remainder; internal_file->current_offset += read_size_remainder; internal_file->block_data_offset += read_size_remainder; } return( (ssize_t) buffer_offset ); } #elif defined( HAVE_READ ) /* Reads a buffer from the file * This function uses the POSIX read function or equivalent * Returns the number of bytes read if successful, or -1 on error */ ssize_t libcfile_file_read_buffer_with_error_code( libcfile_file_t *file, uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_read_buffer_with_error_code"; size_t buffer_offset = 0; size_t read_size = 0; size_t read_size_remainder = 0; ssize_t read_count = 0; int result = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } if( internal_file->block_size != 0 ) { if( internal_file->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file - current offset value out of bounds.", function ); return( -1 ); } if( (size64_t) internal_file->current_offset > internal_file->size ) { return( 0 ); } if( ( (size64_t) internal_file->current_offset + size ) > internal_file->size ) { size = (size_t) ( internal_file->size - internal_file->current_offset ); } } if( size == 0 ) { return( 0 ); } if( ( internal_file->block_data_offset > 0 ) && ( internal_file->block_data_size == 0 ) ) { if( memory_set( internal_file->block_data, 0, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } read_count = read( internal_file->descriptor, internal_file->block_data, internal_file->block_size ); if( read_count != (ssize_t) internal_file->block_size ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, *error_code, "%s: unable to read from file.", function ); return( -1 ); } internal_file->block_data_size = (size_t) read_count; } if( ( internal_file->block_data_offset > 0 ) && ( internal_file->block_data_offset < internal_file->block_data_size ) ) { read_size = internal_file->block_data_size - internal_file->block_data_offset; if( read_size > size ) { read_size = size; } if( memory_copy( buffer, &( internal_file->block_data[ internal_file->block_data_offset ] ), read_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy block data.", function ); return( -1 ); } buffer_offset += read_size; size -= read_size; internal_file->block_data_offset += read_size; internal_file->current_offset += read_size; } if( size == 0 ) { return( (ssize_t) buffer_offset ); } if( internal_file->block_size == 0 ) { read_size = size; } else { read_size_remainder = size % internal_file->block_size; read_size = size - read_size_remainder; } if( read_size > 0 ) { read_count = read( internal_file->descriptor, (void *) &( buffer[ buffer_offset ] ), read_size ); if( ( internal_file->block_size == 0 ) && ( read_count < 0 ) ) { result = 0; } else if( ( internal_file->block_size != 0 ) && ( read_count != (ssize_t) read_size ) ) { result = 0; } else { result = 1; } if( result == 0 ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, *error_code, "%s: unable to read from file.", function ); return( -1 ); } buffer_offset += (size_t) read_count; internal_file->current_offset += read_count; } if( read_size_remainder > 0 ) { /* The read was cut short */ if( read_count != (ssize_t) read_size ) { return( (ssize_t) buffer_offset ); } if( memory_set( internal_file->block_data, 0, internal_file->block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } read_count = read( internal_file->descriptor, internal_file->block_data, internal_file->block_size ); if( read_count != (ssize_t) internal_file->block_size ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, *error_code, "%s: unable to read from file.", function ); return( -1 ); } internal_file->block_data_offset = 0; internal_file->block_data_size = (size_t) read_count; if( memory_copy( &( buffer[ buffer_offset ] ), internal_file->block_data, read_size_remainder ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy block data.", function ); return( -1 ); } buffer_offset += read_size_remainder; internal_file->block_data_offset += read_size_remainder; internal_file->current_offset += read_size_remainder; } return( (ssize_t) buffer_offset ); } #else #error Missing file read function #endif /* Writes a buffer to the file * Returns the number of bytes written if successful, or -1 on error */ ssize_t libcfile_file_write_buffer( libcfile_file_t *file, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { static char *function = "libcfile_file_write_buffer"; ssize_t write_count = 0; uint32_t error_code = 0; write_count = libcfile_file_write_buffer_with_error_code( file, buffer, size, &error_code, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file.", function ); return( -1 ); } return( write_count ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of WriteFile * Returns TRUE if successful or FALSE on error */ BOOL libcfile_WriteFile( HANDLE file_handle, VOID *buffer, DWORD write_size, DWORD *write_count, OVERLAPPED *overlapped ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } if( buffer == NULL ) { return( FALSE ); } if( write_count == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "WriteFile" ); if( function != NULL ) { result = function( file_handle, buffer, write_size, write_count, overlapped ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Writes a buffer to the file * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns the number of bytes written if successful, or -1 on error */ ssize_t libcfile_file_write_buffer_with_error_code( libcfile_file_t *file, const uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_write_buffer_with_error_code"; ssize_t write_count = 0; BOOL result = FALSE; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( UINT32_MAX < SSIZE_MAX ) if( size > (size_t) UINT32_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } #if ( WINVER <= 0x0500 ) result = libcfile_WriteFile( internal_file->handle, (VOID *) buffer, (DWORD) size, (DWORD *) &write_count, NULL ); #else result = WriteFile( internal_file->handle, (VOID *) buffer, (DWORD) size, (DWORD *) &write_count, NULL ); #endif if( result == 0 ) { *error_code = (uint32_t) GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, *error_code, "%s: unable to write to file.", function ); return( -1 ); } if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: invalid write count: %" PRIzd " returned.", function, write_count ); return( -1 ); } internal_file->current_offset += write_count; return( write_count ); } #elif defined( HAVE_WRITE ) /* Writes a buffer to the file * This function uses the POSIX write function or equivalent * Returns the number of bytes written if successful, or -1 on error */ ssize_t libcfile_file_write_buffer_with_error_code( libcfile_file_t *file, const uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_write_buffer_with_error_code"; ssize_t write_count = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } write_count = write( internal_file->descriptor, (void *) buffer, size ); if( write_count < 0 ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, *error_code, "%s: unable to write to file.", function ); return( -1 ); } internal_file->current_offset += write_count; return( write_count ); } #else #error Missing file write function #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) #if !defined( INVALID_SET_FILE_POINTER ) #define INVALID_SET_FILE_POINTER ((LONG) -1) #endif /* Cross Windows safe version of SetFilePointerEx * Returns TRUE if successful or FALSE on error */ BOOL libcfile_SetFilePointerEx( HANDLE file_handle, LARGE_INTEGER distance_to_move_large_integer, LARGE_INTEGER *new_file_pointer_large_integer, DWORD move_method ) { FARPROC function = NULL; HMODULE library_handle = NULL; LONG distance_to_move_lower_long = 0; LONG distance_to_move_upper_long = 0; DWORD error_number = 0; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } if( new_file_pointer_large_integer == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "SetFilePointerEx" ); if( function != NULL ) { result = function( file_handle, distance_to_move_large_integer, new_file_pointer_large_integer, move_method ); } else { function = GetProcAddress( library_handle, (LPCSTR) "SetFilePointer" ); if( function != NULL ) { #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 distance_to_move_lower_long = distance_to_move_large_integer.QuadPart & 0xffffffffUL; distance_to_move_upper_long = distance_to_move_large_integer.QuadPart >> 32; #else distance_to_move_lower_long = distance_to_move_large_integer.LowPart; distance_to_move_upper_long = distance_to_move_large_integer.HighPart; #endif distance_to_move_lower_long = function( file_handle, distance_to_move_lower_long, &distance_to_move_upper_long, move_method ); error_number = GetLastError(); if( ( distance_to_move_lower_long != (LONG) INVALID_SET_FILE_POINTER ) || ( error_number == NO_ERROR ) ) { #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 new_file_pointer_large_integer->QuadPart = distance_to_move_upper_long; new_file_pointer_large_integer->QuadPart <<= 32; new_file_pointer_large_integer->QuadPart += distance_to_move_lower_long; #else new_file_pointer_large_integer->HighPart = distance_to_move_upper_long; new_file_pointer_large_integer->LowPart = distance_to_move_lower_long; #endif result = TRUE; } } } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Seeks a certain offset within the file * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns the offset if the seek is successful or -1 on error */ off64_t libcfile_file_seek_offset( libcfile_file_t *file, off64_t offset, int whence, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_seek_offset"; off64_t offset_remainder = 0; LARGE_INTEGER large_integer_offset = LIBCFILE_LARGE_INTEGER_ZERO; DWORD error_code = 0; DWORD move_method = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } if( offset > (off64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid offset value exceeds maximum.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( internal_file->block_size != 0 ) { if( whence == SEEK_CUR ) { offset += internal_file->current_offset; } else if( whence == SEEK_END ) { offset += internal_file->size; } whence = SEEK_SET; offset_remainder = offset % internal_file->block_size; offset -= offset_remainder; } if( whence == SEEK_SET ) { move_method = FILE_BEGIN; } else if( whence == SEEK_CUR ) { move_method = FILE_CURRENT; } else if( whence == SEEK_END ) { move_method = FILE_END; } /* SetFilePointerEx cannot be used in combination with FILE_FLAG_OVERLAPPED. */ if( internal_file->use_asynchronous_io == 0 ) { #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 large_integer_offset.QuadPart = (LONGLONG) offset; #else large_integer_offset.LowPart = (DWORD) ( 0x0ffffffffUL & offset ); large_integer_offset.HighPart = (LONG) ( offset >> 32 ); #endif #if ( WINVER <= 0x0500 ) if( libcfile_SetFilePointerEx( internal_file->handle, large_integer_offset, &large_integer_offset, move_method ) == 0 ) #else if( SetFilePointerEx( internal_file->handle, large_integer_offset, &large_integer_offset, move_method ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, error_code, "%s: unable to seek offset in file.", function ); return( -1 ); } #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 offset = (off64_t) large_integer_offset.QuadPart; #else offset = ( (off64_t) large_integer_offset.HighPart << 32 ) + large_integer_offset.LowPart; #endif if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: invalid offset: %" PRIi64 " returned.", function, offset ); return( -1 ); } } internal_file->current_offset = offset; if( internal_file->block_size != 0 ) { internal_file->current_offset += offset_remainder; internal_file->block_data_offset = (size_t) offset_remainder; internal_file->block_data_size = 0; } return( internal_file->current_offset ); } #elif defined( HAVE_LSEEK ) /* Seeks a certain offset within the file * This function uses the POSIX lseek function or equivalent * Returns the offset if the seek is successful or -1 on error */ off64_t libcfile_file_seek_offset( libcfile_file_t *file, off64_t offset, int whence, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_seek_offset"; off64_t offset_remainder = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } if( offset > (off64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid offset value exceeds maximum.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( internal_file->block_size != 0 ) { if( whence == SEEK_CUR ) { offset += internal_file->current_offset; } else if( whence == SEEK_END ) { offset += internal_file->size; } whence = SEEK_SET; offset_remainder = offset % internal_file->block_size; offset -= offset_remainder; } offset = lseek( internal_file->descriptor, (off_t) offset, whence ); if( offset < 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, errno, "%s: unable to seek offset in file.", function ); return( -1 ); } internal_file->current_offset = offset; if( internal_file->block_size != 0 ) { internal_file->current_offset += offset_remainder; internal_file->block_data_offset = (size_t) offset_remainder; internal_file->block_data_size = 0; } return( internal_file->current_offset ); } #else #error Missing file lseek function #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of SetEndOfFile * Returns TRUE if successful or FALSE on error */ BOOL libcfile_SetEndOfFile( HANDLE file_handle ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "SetEndOfFile" ); if( function != NULL ) { result = function( file_handle ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Resizes the file * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcfile_file_resize( libcfile_file_t *file, size64_t size, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_resize"; off64_t offset = 0; LARGE_INTEGER large_integer_offset = LIBCFILE_LARGE_INTEGER_ZERO; DWORD error_code = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } if( size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 large_integer_offset.QuadPart = (LONGLONG) size; #else large_integer_offset.LowPart = (DWORD) ( 0x0ffffffffUL & size ); large_integer_offset.HighPart = (LONG) ( size >> 32 ); #endif #if ( WINVER <= 0x0500 ) if( libcfile_SetFilePointerEx( internal_file->handle, large_integer_offset, &large_integer_offset, FILE_BEGIN ) == 0 ) #else if( SetFilePointerEx( internal_file->handle, large_integer_offset, &large_integer_offset, FILE_BEGIN ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, error_code, "%s: unable to seek offset in file.", function ); return( -1 ); } #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 offset = (off64_t) large_integer_offset.QuadPart; #else offset = ( (off64_t) large_integer_offset.HighPart << 32 ) + large_integer_offset.LowPart; #endif if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: invalid offset: %" PRIi64 " returned.", function, offset ); return( -1 ); } internal_file->current_offset = offset; #if ( WINVER <= 0x0500 ) if( libcfile_SetEndOfFile( internal_file->handle ) == 0 ) #else if( SetEndOfFile( internal_file->handle ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, error_code, "%s: unable to resize file.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_FTRUNCATE ) /* Resizes the file * This function uses the POSIX truncate function or equivalent * Returns 1 if successful or -1 on error */ int libcfile_file_resize( libcfile_file_t *file, size64_t size, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_resize"; off_t offset = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } #if SIZEOF_OFF_T >= 8 if( size > (size64_t) INT64_MAX ) #else if( size > (size64_t) INT32_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( ftruncate( internal_file->descriptor, (off_t) size ) != 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, errno, "%s: unable to resize file.", function ); return( -1 ); } offset = lseek( internal_file->descriptor, 0, SEEK_CUR ); if( offset < 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, errno, "%s: unable to seek offset in file.", function ); return( -1 ); } internal_file->current_offset = (off64_t) offset; return( 1 ); } #else #error Missing file truncate function #endif /* Checks if the file is open * Returns 1 if open, 0 if not or -1 on error */ int libcfile_file_is_open( libcfile_file_t *file, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_is_open"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; #if defined( WINAPI ) if( internal_file->handle == INVALID_HANDLE_VALUE ) #else if( internal_file->descriptor == -1 ) #endif { return( 0 ); } return( 1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetFileSizeEx * Returns TRUE if successful or FALSE on error */ BOOL libcfile_GetFileSizeEx( HANDLE file_handle, LARGE_INTEGER *file_size_large_integer ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD error_number = 0; DWORD file_size_upper_dword = 0; DWORD file_size_lower_dword = 0; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } if( file_size_large_integer == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "GetFileSizeEx" ); if( function != NULL ) { result = function( file_handle, file_size_large_integer ); } else { function = GetProcAddress( library_handle, (LPCSTR) "GetFileSize" ); if( function != NULL ) { file_size_lower_dword = function( file_handle, &file_size_upper_dword ); error_number = GetLastError(); if( ( file_size_lower_dword != INVALID_FILE_SIZE ) || ( error_number == NO_ERROR ) ) { #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 file_size_large_integer->QuadPart = file_size_upper_dword; file_size_large_integer->QuadPart <<= 32; file_size_large_integer->QuadPart += file_size_lower_dword; #else file_size_large_integer->HighPart = file_size_upper_dword; file_size_large_integer->LowPart = file_size_lower_dword; #endif result = TRUE; } } } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* Retrieves the current offset in the file * Returns 1 if successful or -1 on error */ int libcfile_file_get_offset( libcfile_file_t *file, off64_t *offset, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_get_offset"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; #if defined( WINAPI ) if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } #else if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } #endif if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } *offset = internal_file->current_offset; return( 1 ); } #if defined( WINAPI ) #if !defined( IOCTL_DISK_GET_LENGTH_INFO ) #define IOCTL_DISK_GET_LENGTH_INFO \ CTL_CODE( IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, FILE_READ_ACCESS ) typedef struct { LARGE_INTEGER Length; } GET_LENGTH_INFORMATION; #endif /* !defined( IOCTL_DISK_GET_LENGTH_INFO ) */ /* Retrieves the size of the file * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcfile_file_get_size( libcfile_file_t *file, size64_t *size, libcerror_error_t **error ) { DISK_GEOMETRY disk_geometry; GET_LENGTH_INFORMATION length_information; libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_get_size"; size_t read_count = 0; LARGE_INTEGER large_integer_size = LIBCFILE_LARGE_INTEGER_ZERO; uint32_t error_code = 0; int result = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } result = libcfile_file_is_device( file, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if file is a device.", function ); return( -1 ); } else if( result != 0 ) { read_count = libcfile_file_io_control_read_with_error_code( file, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (uint8_t *) &length_information, sizeof( GET_LENGTH_INFORMATION ), &error_code, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: IOCTL_DISK_GET_LENGTH_INFO.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); if( error_code == ERROR_NOT_SUPPORTED ) { /* A floppy device does not support IOCTL_DISK_GET_LENGTH_INFO */ read_count = libcfile_file_io_control_read( file, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, (uint8_t *) &disk_geometry, sizeof( DISK_GEOMETRY ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: IOCTL_DISK_GET_DRIVE_GEOMETRY.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { *size = disk_geometry.Cylinders.QuadPart; *size *= disk_geometry.TracksPerCylinder; *size *= disk_geometry.SectorsPerTrack; *size *= disk_geometry.BytesPerSector; } } } else { *size = (size64_t) length_information.Length.HighPart << 32; *size += length_information.Length.LowPart; } } else { #if ( WINVER <= 0x0500 ) if( libcfile_GetFileSizeEx( internal_file->handle, &large_integer_size ) == 0 ) #else if( GetFileSizeEx( internal_file->handle, &large_integer_size ) == 0 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file size.", function ); return( -1 ); } #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 *size = (size64_t) large_integer_size.QuadPart; #else *size = ( (size64_t) large_integer_size.HighPart << 32 ) + large_integer_size.LowPart; #endif } return( 1 ); } #elif defined( HAVE_FSTAT ) /* Retrieves the size of the file * This function uses the POSIX fstat function or equivalent * Returns 1 if successful or -1 on error */ int libcfile_file_get_size( libcfile_file_t *file, size64_t *size, libcerror_error_t **error ) { struct stat file_statistics; libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_get_size"; off64_t current_offset = 0; off64_t offset = 0; ssize_t read_count = 0; size_t file_statistics_size = 0; #if !defined( DIOCGMEDIASIZE ) && defined( DIOCGDINFO ) struct disklabel disk_label; #endif #if defined( DKIOCGETBLOCKCOUNT ) && defined( DKIOCGETBLOCKSIZE ) uint64_t block_count = 0; uint32_t bytes_per_sector = 0; #endif if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } file_statistics_size = sizeof( struct stat ); if( memory_set( &file_statistics, 0, file_statistics_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file statistics.", function ); return( -1 ); } if( fstat( internal_file->descriptor, &file_statistics ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file statistics.", function ); return( -1 ); } if( S_ISBLK( file_statistics.st_mode ) || S_ISCHR( file_statistics.st_mode ) ) { #if defined( BLKGETSIZE64 ) read_count = libcfile_file_io_control_read( file, (uint32_t) BLKGETSIZE64, NULL, 0, (uint8_t *) size, 8, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: BLKGETSIZE64.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } #elif defined( DIOCGMEDIASIZE ) read_count = libcfile_file_io_control_read( file, (uint32_t) DIOCGMEDIASIZE, NULL, 0, (uint8_t *) size, 8, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: DIOCGMEDIASIZE.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } #elif defined( DIOCGDINFO ) read_count = libcfile_file_io_control_read( file, (uint32_t) DIOCGDINFO, NULL, 0, (uint8_t *) &disk_label, sizeof( struct disklabel ), error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: DIOCGDINFO.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { *size = disk_label.d_secperunit * disk_label.d_secsize; } #elif defined( DKIOCGETBLOCKCOUNT ) && defined( DKIOCGETBLOCKSIZE ) read_count = libcfile_file_io_control_read( file, (uint32_t) DKIOCGETBLOCKSIZE, NULL, 0, (uint8_t *) &bytes_per_sector, 4, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: DKIOCGETBLOCKSIZE.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { read_count = libcfile_file_io_control_read( file, (uint32_t) DKIOCGETBLOCKCOUNT, NULL, 0, (uint8_t *) &block_count, 4, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to query device for: DKIOCGETBLOCKCOUNT.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } } #endif libcerror_error_free( error ); } else { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: block size: %" PRIu32 " block count: %" PRIu64 " ", function, bytes_per_sector, block_count ); } #endif *size = (size64_t) ( block_count * bytes_per_sector ); } } #endif if( read_count <= 0 ) { /* Try to seek the end of the file and determine the size based on the offset */ if( libcfile_file_get_offset( file, ¤t_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current offset.", function ); return( -1 ); } offset = libcfile_file_seek_offset( file, 0, SEEK_END, error ); if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek end of file.", function ); return( -1 ); } *size = (size64_t) offset; offset = libcfile_file_seek_offset( file, current_offset, SEEK_SET, error ); if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, current_offset ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: device media size: %" PRIu64 "\n", function, *size ); } #endif } else { *size = (size64_t) file_statistics.st_size; } return( 1 ); } #else #error Missing file get size function #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetFileType * Returns the file type if successful or FILE_TYPE_UNKNOWN on error */ DWORD libcfile_GetFileType( HANDLE file_handle ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD result = FILE_TYPE_UNKNOWN; if( file_handle == NULL ) { return( FILE_TYPE_UNKNOWN ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FILE_TYPE_UNKNOWN ); } function = GetProcAddress( library_handle, (LPCSTR) "GetFileType" ); if( function != NULL ) { result = function( file_handle ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FILE_TYPE_UNKNOWN; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Determines if a file is a device * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if true, 0 if not or -1 on error */ int libcfile_file_is_device( libcfile_file_t *file, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_is_device"; DWORD file_type = 0; int result = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } /* TODO what about FILE_ATTRIBUTE_DEVICE using GetFileAttributes() */ /* Use the GetFileType function to rule out certain file types * like pipes, sockets, etc. */ #if ( WINVER <= 0x0500 ) file_type = libcfile_GetFileType( internal_file->handle ); #else file_type = GetFileType( internal_file->handle ); #endif if( file_type == FILE_TYPE_UNKNOWN ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine file type.", function ); return( -1 ); } else if( file_type == FILE_TYPE_DISK ) { if( internal_file->is_device_filename ) { result = 1; } } return( result ); } #elif defined( HAVE_FSTAT ) /* Determines if a file is a device * This function uses the POSIX fstat function or equivalent * Returns 1 if true, 0 if not or -1 on error */ int libcfile_file_is_device( libcfile_file_t *file, libcerror_error_t **error ) { struct stat file_statistics; libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_is_device"; size_t file_statistics_size = 0; int result = 0; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } file_statistics_size = sizeof( struct stat ); if( memory_set( &file_statistics, 0, file_statistics_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file statistics.", function ); return( -1 ); } if( fstat( internal_file->descriptor, &file_statistics ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file statistics.", function ); return( -1 ); } if( S_ISBLK( file_statistics.st_mode ) || S_ISCHR( file_statistics.st_mode ) ) { result = 1; } return( result ); } #else #error Missing file is device function #endif /* Read data from a device file using IO control * Returns the number of bytes read if successful or -1 on error */ ssize_t libcfile_file_io_control_read( libcfile_file_t *file, uint32_t control_code, uint8_t *control_data, size_t control_data_size, uint8_t *data, size_t data_size, libcerror_error_t **error ) { static char *function = "libcfile_file_io_control_read"; ssize_t read_count = 0; uint32_t error_code = 0; read_count = libcfile_file_io_control_read_with_error_code( file, control_code, control_data, control_data_size, data, data_size, &error_code, error ); if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, "%s: unable to to IO control device.", function ); return( -1 ); } return( read_count ); } #if defined( HAVE_IOCTL ) || defined( WINAPI ) /* Read data from a device file using IO control * This function uses the POSIX ioctl function or WINAPI DeviceIoControl * Returns the number of bytes read if successful or -1 on error */ ssize_t libcfile_file_io_control_read_with_error_code( libcfile_file_t *file, uint32_t control_code, uint8_t *control_data, size_t control_data_size, uint8_t *data, size_t data_size, uint32_t *error_code, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_io_control_read_with_error_code"; #if defined( WINAPI ) DWORD response_count = 0; #endif if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; #if defined( WINAPI ) if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } #else if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } #endif if( control_data == NULL ) { if( control_data_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid control data size value exceeds maximum.", function ); return( -1 ); } } else { #if ( UINT32_MAX < SSIZE_MAX ) if( control_data_size > (size_t) UINT32_MAX ) #else if( control_data_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid control data size value exceeds maximum.", function ); return( -1 ); } } if( data == NULL ) { if( data_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } } else { #if ( UINT32_MAX < SSIZE_MAX ) if( data_size > (size_t) UINT32_MAX ) #else if( data_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } #if defined( WINAPI ) if( DeviceIoControl( internal_file->handle, (DWORD) control_code, control_data, (DWORD) control_data_size, data, (DWORD) data_size, &response_count, NULL ) == 0 ) { *error_code = (uint32_t) GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, *error_code, "%s: unable to IO control device.", function ); return( -1 ); } #if ( SSIZE_MAX < UINT32_MAX ) if( response_count > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid response count value out of bounds.", function ); return( -1 ); } #endif return( (ssize_t) response_count ); #elif defined( HAVE_IOCTL ) if( control_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported control data.", function ); return( -1 ); } if( ioctl( internal_file->descriptor, (int) control_code, data ) == -1 ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_IOCTL_FAILED, *error_code, "%s: unable to IO control device.", function ); return( -1 ); } return( (size_t) data_size ); #endif } #else #error Missing file IO control with data function #endif /* On some versions of Linux the FADVISE definions seem to be missing from fcntl.h */ #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) #if !defined( POSIX_FADV_NORMAL ) #define POSIX_FADV_NORMAL 0 #endif #if !defined( POSIX_FADV_RANDOM ) #define POSIX_FADV_RANDOM 1 #endif #if !defined( POSIX_FADV_SEQUENTIAL ) #define POSIX_FADV_SEQUENTIAL 2 #endif #endif /* #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) */ /* Sets the expected access behavior so the system can optimize the access * Returns 1 if successful or -1 on error */ int libcfile_file_set_access_behavior( libcfile_file_t *file, int access_behavior, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_set_access_behavior"; #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) int advice = POSIX_FADV_NORMAL; int result = 0; #endif if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; #if defined( WINAPI ) if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } #else if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } #endif if( ( access_behavior != LIBCFILE_ACCESS_BEHAVIOR_NORMAL ) && ( access_behavior != LIBCFILE_ACCESS_BEHAVIOR_RANDOM ) && ( access_behavior != LIBCFILE_ACCESS_BEHAVIOR_SEQUENTIAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported access behavior: %d.", function, access_behavior ); return( -1 ); } #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) if( access_behavior == LIBCFILE_ACCESS_BEHAVIOR_NORMAL ) { advice = POSIX_FADV_NORMAL; } else if( access_behavior == LIBCFILE_ACCESS_BEHAVIOR_RANDOM ) { advice = POSIX_FADV_RANDOM; } else if( access_behavior == LIBCFILE_ACCESS_BEHAVIOR_SEQUENTIAL ) { advice = POSIX_FADV_SEQUENTIAL; } result = posix_fadvise( internal_file->descriptor, 0, 0, advice ); /* Safely ignore if the device does not support fadvise. * Note that FreeBSD 10.0 had a bug and was returning -1 * and setting errno. */ if( ( result != 0 ) && ( result != ENODEV ) ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, errno, "%s: unable to advice file descriptor on access behavior.", function ); return( -1 ); } #endif /* defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) */ return( 1 ); } /* Sets the block size for the read and seek operations * A block size of 0 represents no block-based operations * The total size must be a multitude of block size * Returns 1 if successful or -1 on error */ int libcfile_file_set_block_size( libcfile_file_t *file, size_t block_size, libcerror_error_t **error ) { libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_set_block_size"; if( file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file.", function ); return( -1 ); } internal_file = (libcfile_internal_file_t *) file; if( ( internal_file->access_flags & LIBCFILE_ACCESS_FLAG_WRITE ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: setting block size not supported with write access.", function ); return( -1 ); } #if defined( WINAPI ) if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing handle.", function ); return( -1 ); } #else if( internal_file->descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file - missing descriptor.", function ); return( -1 ); } #endif #if defined( WINAPI ) && ( UINT32_MAX < SSIZE_MAX ) if( block_size > (size_t) UINT32_MAX ) #else if( block_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid block size value exceeds maximum.", function ); return( -1 ); } if( block_size != internal_file->block_size ) { if( libcfile_file_get_size( file, &( internal_file->size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size.", function ); return( -1 ); } if( internal_file->block_data != NULL ) { memory_free( internal_file->block_data ); internal_file->block_data = NULL; internal_file->block_data_size = 0; } if( block_size > 0 ) { if( ( internal_file->size % block_size ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid block size value out of bounds.", function ); return( -1 ); } internal_file->block_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( internal_file == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file.", function ); return( -1 ); } if( memory_set( internal_file->block_data, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear block data.", function ); return( -1 ); } } internal_file->block_size = block_size; } return( 1 ); } libewf-20140807/libcfile/libcfile_libclocale.h0000664000175000017500000000266513443450031023203 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2008-2019, 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( _LIBCFILE_LIBCLOCALE_H ) #define _LIBCFILE_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBCFILE_LIBCLOCALE_H ) */ libewf-20140807/libcfile/libcfile_support.c0000664000175000017500000006073713443450031022625 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_SYS_STAT_H ) #include #endif #if defined( HAVE_ERRNO_H ) #include #endif #if defined( HAVE_UNISTD_H ) #include #endif #include "libcfile_definitions.h" #include "libcfile_libcerror.h" #include "libcfile_libclocale.h" #include "libcfile_libuna.h" #include "libcfile_support.h" #if !defined( HAVE_LOCAL_LIBCFILE ) /* Returns the library version as a string */ const char *libcfile_get_version( void ) { return( (const char *) LIBCFILE_VERSION_STRING ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libcfile_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libcfile_get_codepage"; if( libclocale_codepage_get( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libcfile_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libcfile_set_codepage"; if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetFileAttributesA * Returns the file attributs if successful or INVALID_FILE_ATTRIBUTES on error */ DWORD libcfile_GetFileAttributesA( LPCSTR filename ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD result = 0; if( filename == NULL ) { return( INVALID_FILE_ATTRIBUTES ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( INVALID_FILE_ATTRIBUTES ); } function = GetProcAddress( library_handle, (LPCSTR) "GetFileAttributesA" ); if( function != NULL ) { result = function( filename ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = INVALID_FILE_ATTRIBUTES; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Determines if a file exists * This function uses the WINAPI function for Windows XP (0x0501) or later, * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if the file exists, 0 if not or -1 on error */ int libcfile_file_exists( const char *filename, libcerror_error_t **error ) { static char *function = "libcfile_file_exists"; int result = 1; DWORD error_code = 0; DWORD file_attributes = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } #if ( WINVER <= 0x0500 ) file_attributes = libcfile_GetFileAttributesA( (LPCSTR) filename ); #else file_attributes = GetFileAttributesA( (LPCSTR) filename ); #endif if( file_attributes == INVALID_FILE_ATTRIBUTES ) { error_code = GetLastError(); switch( error_code ) { case ERROR_ACCESS_DENIED: result = 1; break; case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: result = 0; break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, error_code, "%s: unable to determine attributes of file: %s.", function, filename ); return( -1 ); } } return( result ); } #elif defined( HAVE_STAT ) /* Determines if a file exists * This function uses the POSIX stat function or equivalent * Returns 1 if the file exists, 0 if not or -1 on error */ int libcfile_file_exists( const char *filename, libcerror_error_t **error ) { struct stat file_statistics; static char *function = "libcfile_file_exists"; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( memory_set( &file_statistics, 0, sizeof( struct stat ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file statistics.", function ); return( -1 ); } result = stat( filename, &file_statistics ); if( result != 0 ) { switch( errno ) { case EACCES: result = 1; break; case ENOENT: result = 0; break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, errno, "%s: unable to stat file: %" PRIs_SYSTEM ".", function, filename ); return( -1 ); } } else { result = 1; } return( result ); } #else #error Missing file exists function #endif #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetFileAttributesW * Returns the file attributs if successful or INVALID_FILE_ATTRIBUTES on error */ DWORD libcfile_GetFileAttributesW( LPCWSTR filename ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD result = 0; if( filename == NULL ) { return( INVALID_FILE_ATTRIBUTES ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( INVALID_FILE_ATTRIBUTES ); } function = GetProcAddress( library_handle, (LPCSTR) "GetFileAttributesW" ); if( function != NULL ) { result = function( filename ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = INVALID_FILE_ATTRIBUTES; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Determines if a file exists using get file attibutes * This function uses the WINAPI function for Windows XP (0x0501) or later, * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if the file exists, 0 if not or -1 on error */ int libcfile_file_exists_wide( const wchar_t *filename, libcerror_error_t **error ) { static char *function = "libcfile_file_exists_wide"; int result = 1; DWORD error_code = 0; DWORD file_attributes = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } #if ( WINVER <= 0x0500 ) file_attributes = libcfile_GetFileAttributesW( (LPCWSTR) filename ); #else file_attributes = GetFileAttributesW( (LPCWSTR) filename ); #endif if( file_attributes == INVALID_FILE_ATTRIBUTES ) { error_code = GetLastError(); switch( error_code ) { case ERROR_ACCESS_DENIED: result = 1; break; case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: result = 0; break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, error_code, "%s: unable to determine attributes of file: %ls.", function, filename ); return( -1 ); } } return( result ); } #elif defined( HAVE_STAT ) /* Determines if a file exists * This function uses the POSIX stat function or equivalent * Returns 1 if the file exists, 0 if not or -1 on error */ int libcfile_file_exists_wide( const wchar_t *filename, libcerror_error_t **error ) { struct stat file_statistics; char *narrow_filename = NULL; static char *function = "libcfile_file_exists_wide"; size_t narrow_filename_size = 0; size_t filename_size = 0; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } filename_size = 1 + wide_string_length( filename ); /* Convert the filename to a narrow string * if the platform has no wide character open function */ if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) filename, filename_size, &narrow_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) filename, filename_size, &narrow_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) filename, filename_size, libclocale_codepage, &narrow_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) filename, filename_size, libclocale_codepage, &narrow_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow character filename size.", function ); return( -1 ); } narrow_filename = narrow_string_allocate( narrow_filename_size ); if( narrow_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create narrow character filename.", function ); return( -1 ); } if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) narrow_filename, narrow_filename_size, (libuna_utf32_character_t *) filename, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) narrow_filename, narrow_filename_size, (libuna_utf16_character_t *) filename, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) narrow_filename, narrow_filename_size, libclocale_codepage, (libuna_utf32_character_t *) filename, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) narrow_filename, narrow_filename_size, libclocale_codepage, (libuna_utf16_character_t *) filename, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set narrow character filename.", function ); memory_free( narrow_filename ); return( -1 ); } result = stat( narrow_filename, &file_statistics ); memory_free( narrow_filename ); if( result != 0 ) { switch( errno ) { case EACCES: result = 1; break; case ENOENT: result = 0; break; default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, errno, "%s: unable to stat file: %" PRIs_SYSTEM ".", function, filename ); return( -1 ); } } else { result = 1; } return( result ); } #else #error Missing file exists wide function #endif #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of DeleteFileA * Returns TRUE if successful or FALSE on error */ BOOL libcfile_DeleteFileA( LPCSTR filename ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( filename == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "DeleteFileA" ); if( function != NULL ) { result = function( filename ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ /* Removes a file * Returns 1 if successful or -1 on error */ int libcfile_file_remove( const char *filename, libcerror_error_t **error ) { static char *function = "libcfile_file_remove"; uint32_t error_code = 0; if( libcfile_file_remove_with_error_code( filename, &error_code, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_UNLINK_FAILED, "%s: unable to remove file.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) /* Removes a file * This function uses the WINAPI function for Windows XP (0x0501) or later, * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcfile_file_remove_with_error_code( const char *filename, uint32_t *error_code, libcerror_error_t **error ) { static char *function = "libcfile_file_remove_with_error_code"; BOOL result = FALSE; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } #if ( WINVER <= 0x0500 ) result = libcfile_DeleteFileA( filename ); #else result = DeleteFileA( filename ); #endif if( result == 0 ) { *error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_UNLINK_FAILED, *error_code, "%s: unable to remove file.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_UNLINK ) /* Removes a file * This function uses the POSIX unlink function or equivalent * Returns 1 if successful or -1 on error */ int libcfile_file_remove_with_error_code( const char *filename, uint32_t *error_code, libcerror_error_t **error ) { static char *function = "libcfile_file_remove_with_error_code"; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } if( unlink( filename ) != 0 ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_UNLINK_FAILED, *error_code, "%s: unable to unlink file.", function ); return( -1 ); } return( 1 ); } #else #error Missing file remove function #endif #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of DeleteFileW * Returns TRUE if successful or FALSE on error */ BOOL libcfile_DeleteFileW( LPCWSTR filename ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( filename == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "DeleteFileW" ); if( function != NULL ) { result = function( filename ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ /* Removes a file * Returns 1 if successful or -1 on error */ int libcfile_file_remove_wide( const wchar_t *filename, libcerror_error_t **error ) { static char *function = "libcfile_file_remove_wide"; uint32_t error_code = 0; if( libcfile_file_remove_wide_with_error_code( filename, &error_code, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_UNLINK_FAILED, "%s: unable to remove file.", function ); return( -1 ); } return( 1 ); } #if defined( WINAPI ) /* Removes a file * This function uses the WINAPI function for Windows XP (0x0501) or later, * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcfile_file_remove_wide_with_error_code( const wchar_t *filename, uint32_t *error_code, libcerror_error_t **error ) { static char *function = "libcfile_file_remove_wide_with_error_code"; BOOL result = FALSE; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } #if ( WINVER <= 0x0500 ) result = libcfile_DeleteFileW( filename ); #else result = DeleteFileW( filename ); #endif if( result == 0 ) { *error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_UNLINK_FAILED, *error_code, "%s: unable to remove file.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_UNLINK ) /* Removes a file * This function uses the POSIX unlink function or equivalent * Returns 1 if successful or -1 on error */ int libcfile_file_remove_wide_with_error_code( const wchar_t *filename, uint32_t *error_code, libcerror_error_t **error ) { char *narrow_filename = NULL; static char *function = "libcfile_file_remove_wide_with_error_code"; size_t narrow_filename_size = 0; size_t filename_size = 0; int result = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( error_code == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid error code.", function ); return( -1 ); } filename_size = 1 + wide_string_length( filename ); /* Convert the filename to a narrow string * if the platform has no wide character open function */ if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) filename, filename_size, &narrow_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) filename, filename_size, &narrow_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) filename, filename_size, libclocale_codepage, &narrow_filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) filename, filename_size, libclocale_codepage, &narrow_filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow character filename size.", function ); goto on_error; } narrow_filename = narrow_string_allocate( narrow_filename_size ); if( narrow_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create narrow character filename.", function ); goto on_error; } if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) narrow_filename, narrow_filename_size, (libuna_utf32_character_t *) filename, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) narrow_filename, narrow_filename_size, (libuna_utf16_character_t *) filename, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) narrow_filename, narrow_filename_size, libclocale_codepage, (libuna_utf32_character_t *) filename, filename_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) narrow_filename, narrow_filename_size, libclocale_codepage, (libuna_utf16_character_t *) filename, filename_size, error ); #else #error Unsupported size of wchar_t #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set narrow character filename.", function ); goto on_error; } if( unlink( narrow_filename ) != 0 ) { *error_code = (uint32_t) errno; libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_UNLINK_FAILED, *error_code, "%s: unable to unlink file.", function ); goto on_error; } memory_free( narrow_filename ); return( 1 ); on_error: if( narrow_filename != NULL ) { memory_free( narrow_filename ); } return( -1 ); } #else #error Missing file remove wide function #endif #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libcfile/libcfile_support.h0000664000175000017500000000573413443450031022626 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2019, 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( _LIBCFILE_SUPPORT_H ) #define _LIBCFILE_SUPPORT_H #include #include #include "libcfile_extern.h" #include "libcfile_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCFILE ) LIBCFILE_EXTERN \ const char *libcfile_get_version( void ); LIBCFILE_EXTERN \ int libcfile_get_codepage( int *codepage, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) DWORD libcfile_GetFileAttributesA( LPCSTR filename ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_exists( const char *filename, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) DWORD libcfile_GetFileAttributesW( LPCWSTR filename ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_exists_wide( const wchar_t *filename, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_DeleteFileA( LPCSTR filename ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_remove( const char *filename, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_remove_with_error_code( const char *filename, uint32_t *error_code, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_DeleteFileW( LPCWSTR filename ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_remove_wide( const wchar_t *filename, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_remove_wide_with_error_code( const wchar_t *filename, uint32_t *error_code, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCFILE_SUPPORT_H ) */ libewf-20140807/libcfile/libcfile_error.c0000664000175000017500000000554013443450031022231 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libcfile_error.h" #include "libcfile_libcerror.h" #if !defined( HAVE_LOCAL_LIBCFILE ) /* Free an error and its elements */ void libcfile_error_free( libcfile_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcfile_error_fprint( libcfile_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcfile_error_sprint( libcfile_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcfile_error_backtrace_fprint( libcfile_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcfile_error_backtrace_sprint( libcfile_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ libewf-20140807/libcfile/Makefile.am0000664000175000017500000000154413443450031021137 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCFILE AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ noinst_LTLIBRARIES = libcfile.la libcfile_la_SOURCES = \ libcfile_definitions.h \ libcfile_error.c libcfile_error.h \ libcfile_extern.h \ libcfile_file.c libcfile_file.h \ libcfile_libcerror.h \ libcfile_libclocale.h \ libcfile_libcnotify.h \ libcfile_libuna.h \ libcfile_notify.c libcfile_notify.h \ libcfile_support.c libcfile_support.h \ libcfile_system_string.c libcfile_system_string.h \ libcfile_types.h \ libcfile_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcfile ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcfile_la_SOURCES) libewf-20140807/libcfile/libcfile_libcerror.h0000664000175000017500000000264013443450031023066 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2008-2019, 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( _LIBCFILE_LIBCERROR_H ) #define _LIBCFILE_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCFILE_LIBCERROR_H ) */ libewf-20140807/libcfile/libcfile_unused.h0000664000175000017500000000260213443450031022404 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2008-2019, 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( _LIBCFILE_UNUSED_H ) #define _LIBCFILE_UNUSED_H #include #if !defined( LIBCFILE_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCFILE_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCFILE_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCFILE_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCFILE_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCFILE_UNUSED_H ) */ libewf-20140807/libcfile/libcfile_types.h0000664000175000017500000000273313443450031022252 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2008-2019, 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( _LIBCFILE_INTERNAL_TYPES_H ) #define _LIBCFILE_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile * The definitions in are copied here * for local use of libcfile */ #if defined( HAVE_LOCAL_LIBCFILE ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libcfile_file {} libcfile_file_t; #else typedef intptr_t libcfile_file_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBCFILE ) */ #endif /* !defined( _LIBCFILE_INTERNAL_TYPES_H ) */ libewf-20140807/libcfile/libcfile_extern.h0000664000175000017500000000240613443450031022410 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2008-2019, 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( _LIBCFILE_INTERNAL_EXTERN_H ) #define _LIBCFILE_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile */ #if !defined( HAVE_LOCAL_LIBCFILE ) #include #define LIBCFILE_EXTERN_VARIABLE LIBCFILE_EXTERN #else #define LIBCFILE_EXTERN /* extern */ #define LIBCFILE_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ #endif /* !defined( _LIBCFILE_INTERNAL_EXTERN_H ) */ libewf-20140807/libcfile/libcfile_notify.h0000664000175000017500000000307313443450031022414 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2008-2019, 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( _LIBCFILE_NOTIFY_H ) #define _LIBCFILE_NOTIFY_H #include #include #include #include "libcfile_extern.h" #include "libcfile_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCFILE ) LIBCFILE_EXTERN \ void libcfile_notify_set_verbose( int verbose ); LIBCFILE_EXTERN \ int libcfile_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_notify_stream_close( libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCFILE_NOTIFY_H ) */ libewf-20140807/libcfile/libcfile_definitions.h0000664000175000017500000000550113443450031023415 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2008-2019, 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( LIBCFILE_INTERNAL_DEFINITIONS_H ) #define LIBCFILE_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile */ #if !defined( HAVE_LOCAL_LIBCFILE ) #include /* The definitions in are copied here * for local use of libcfile */ #else #define LIBCFILE_VERSION 20190314 /* The libcfile version string */ #define LIBCFILE_VERSION_STRING "20190314" /* The file access flags * bit 1 set to 1 for read access * bit 2 set to 1 for write access * bit 3 set to 1 to truncate an existing file on write * bit 4-8 not used */ enum LIBCFILE_ACCESS_FLAGS { LIBCFILE_ACCESS_FLAG_READ = 0x01, LIBCFILE_ACCESS_FLAG_WRITE = 0x02, LIBCFILE_ACCESS_FLAG_TRUNCATE = 0x04 }; /* The file access macros */ #define LIBCFILE_OPEN_READ ( LIBCFILE_ACCESS_FLAG_READ ) #define LIBCFILE_OPEN_WRITE ( LIBCFILE_ACCESS_FLAG_WRITE ) #define LIBCFILE_OPEN_READ_WRITE ( LIBCFILE_ACCESS_FLAG_READ | LIBCFILE_ACCESS_FLAG_WRITE ) #define LIBCFILE_OPEN_WRITE_TRUNCATE ( LIBCFILE_ACCESS_FLAG_WRITE | LIBCFILE_ACCESS_FLAG_TRUNCATE ) #define LIBCFILE_OPEN_READ_WRITE_TRUNCATE ( LIBCFILE_ACCESS_FLAG_READ | LIBCFILE_ACCESS_FLAG_WRITE | LIBCFILE_ACCESS_FLAG_TRUNCATE ) /* The access behavior types */ enum LIBCFILE_ACCESS_BEHAVIOR { LIBCFILE_ACCESS_BEHAVIOR_NORMAL, LIBCFILE_ACCESS_BEHAVIOR_RANDOM, LIBCFILE_ACCESS_BEHAVIOR_SEQUENTIAL }; #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ /* Platform specific macros */ #if defined( WINAPI ) #if defined( _MSC_VER ) #define LIBCFILE_LARGE_INTEGER_ZERO { 0, 0 } #elif defined( __BORLANDC__ ) #define LIBCFILE_LARGE_INTEGER_ZERO { 0 } #elif defined( __CYGWIN__ ) #define LIBCFILE_LARGE_INTEGER_ZERO { { 0, 0 } } #elif defined( __MINGW32_VERSION ) || defined( __MINGW64_VERSION_MAJOR ) #define LIBCFILE_LARGE_INTEGER_ZERO { { 0, 0 } } #endif #if !defined( INVALID_FILE_ATTRIBUTES ) #define INVALID_FILE_ATTRIBUTES ( (DWORD) -1 ) #endif #endif /* defined( WINAPI ) */ #endif libewf-20140807/libcfile/libcfile_file.h0000664000175000017500000002022313443450031022017 0ustar00lordyestalordyesta00000000000000/* * File functions * * Copyright (C) 2008-2019, 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( _LIBCFILE_INTERNAL_FILE_H ) #define _LIBCFILE_INTERNAL_FILE_H #include #include #include "libcfile_extern.h" #include "libcfile_libcerror.h" #include "libcfile_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcfile_internal_file libcfile_internal_file_t; struct libcfile_internal_file { #if defined( WINAPI ) /* The (file) handle */ HANDLE handle; /* Value to indicate the filename indicate this is a device file */ uint8_t is_device_filename; /* Value to indicate asynchronous IO should be used. */ uint8_t use_asynchronous_io; #else /* The (file) descriptor */ int descriptor; #endif /* defined( WINAPI ) */ /* The access flags */ int access_flags; /* The size */ size64_t size; /* The current offset */ off64_t current_offset; /* The block size */ size_t block_size; /* The block data */ uint8_t *block_data; /* The block data offset */ size_t block_data_offset; /* The block data size */ size_t block_data_size; }; #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_CloseHandle( HANDLE file_handle ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_initialize( libcfile_file_t **file, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_free( libcfile_file_t **file, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) HANDLE libcfile_CreateFileA( LPCSTR filename, DWORD desired_access, DWORD share_mode, SECURITY_ATTRIBUTES *security_attributes, DWORD creation_disposition, DWORD flags_and_attributes, HANDLE template_file ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_open( libcfile_file_t *file, const char *filename, int access_flags, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_open_with_error_code( libcfile_file_t *file, const char *filename, int access_flags, uint32_t *error_code, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) HANDLE libcfile_CreateFileW( LPCWSTR filename, DWORD desired_access, DWORD share_mode, SECURITY_ATTRIBUTES *security_attributes, DWORD creation_disposition, DWORD flags_and_attributes, HANDLE template_file ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_open_wide( libcfile_file_t *file, const wchar_t *filename, int access_flags, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_open_wide_with_error_code( libcfile_file_t *file, const wchar_t *filename, int access_flags, uint32_t *error_code, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ LIBCFILE_EXTERN \ int libcfile_file_close( libcfile_file_t *file, libcerror_error_t **error ); LIBCFILE_EXTERN \ ssize_t libcfile_file_read_buffer( libcfile_file_t *file, uint8_t *buffer, size_t size, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_GetOverlappedResult( HANDLE file_handle, OVERLAPPED *overlapped, DWORD *read_count, BOOL wait_io_complete ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_ReadFile( HANDLE file_handle, VOID *buffer, DWORD read_size, DWORD *read_count, OVERLAPPED *overlapped ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) ssize_t libcfile_internal_file_read_buffer_at_offset_with_error_code( libcfile_internal_file_t *internal_file, off64_t current_offset, uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ); #endif /* defined( WINAPI ) */ LIBCFILE_EXTERN \ ssize_t libcfile_file_read_buffer_with_error_code( libcfile_file_t *file, uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ); LIBCFILE_EXTERN \ ssize_t libcfile_file_write_buffer( libcfile_file_t *file, const uint8_t *buffer, size_t size, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_WriteFile( HANDLE file_handle, VOID *buffer, DWORD write_size, DWORD *write_count, OVERLAPPED *overlapped ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ ssize_t libcfile_file_write_buffer_with_error_code( libcfile_file_t *file, const uint8_t *buffer, size_t size, uint32_t *error_code, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_SetFilePointerEx( HANDLE file_handle, LARGE_INTEGER distance_to_move_large_integer, LARGE_INTEGER *new_file_pointer_large_integer, DWORD move_method ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ off64_t libcfile_file_seek_offset( libcfile_file_t *file, off64_t offset, int whence, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_SetEndOfFile( HANDLE file_handle ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_resize( libcfile_file_t *file, size64_t size, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_is_open( libcfile_file_t *file, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcfile_GetFileSizeEx( HANDLE file_handle, LARGE_INTEGER *file_size_large_integer ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_get_offset( libcfile_file_t *file, off64_t *offset, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_get_size( libcfile_file_t *file, size64_t *size, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) DWORD libcfile_GetFileType( HANDLE file_handle ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCFILE_EXTERN \ int libcfile_file_is_device( libcfile_file_t *file, libcerror_error_t **error ); LIBCFILE_EXTERN \ ssize_t libcfile_file_io_control_read( libcfile_file_t *file, uint32_t control_code, uint8_t *control_data, size_t control_data_size, uint8_t *data, size_t data_size, libcerror_error_t **error ); LIBCFILE_EXTERN \ ssize_t libcfile_file_io_control_read_with_error_code( libcfile_file_t *file, uint32_t control_code, uint8_t *control_data, size_t control_data_size, uint8_t *data, size_t data_size, uint32_t *error_code, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_set_access_behavior( libcfile_file_t *file, int access_behavior, libcerror_error_t **error ); LIBCFILE_EXTERN \ int libcfile_file_set_block_size( libcfile_file_t *file, size_t block_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCFILE_INTERNAL_FILE_H ) */ libewf-20140807/libcfile/libcfile_error.h0000664000175000017500000000340513443450031022234 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2019, 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( _LIBCFILE_INTERNAL_ERROR_H ) #define _LIBCFILE_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBCFILE ) #include #endif #include "libcfile_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCFILE ) LIBCFILE_EXTERN \ void libcfile_error_free( libcfile_error_t **error ); LIBCFILE_EXTERN \ int libcfile_error_fprint( libcfile_error_t *error, FILE *stream ); LIBCFILE_EXTERN \ int libcfile_error_sprint( libcfile_error_t *error, char *string, size_t size ); LIBCFILE_EXTERN \ int libcfile_error_backtrace_fprint( libcfile_error_t *error, FILE *stream ); LIBCFILE_EXTERN \ int libcfile_error_backtrace_sprint( libcfile_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCFILE_INTERNAL_ERROR_H ) */ libewf-20140807/libcfile/libcfile_system_string.c0000664000175000017500000006173213443450031024017 0ustar00lordyestalordyesta00000000000000/* * System string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include #include #include #include "libcfile_libcerror.h" #include "libcfile_libclocale.h" #include "libcfile_libuna.h" #include "libcfile_system_string.h" #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 #error Unsupported size of wchar_t #endif /* Determines the size of a narrow string from a system string * Returns 1 if successful or -1 on error */ int libcfile_system_string_size_to_narrow_string( const system_character_t *system_string, size_t system_string_size, size_t *narrow_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_size_to_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) system_string, system_string_size, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) system_string, system_string_size, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) system_string, system_string_size, libclocale_codepage, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) system_string, system_string_size, libclocale_codepage, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow string size.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string size.", function ); return( -1 ); } *narrow_string_size = system_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string to a narrow string * Returns 1 if successful or -1 on error */ int libcfile_system_string_copy_to_narrow_string( const system_character_t *system_string, size_t system_string_size, char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_copy_to_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) narrow_string, narrow_string_size, (libuna_utf32_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) narrow_string, narrow_string_size, (libuna_utf16_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, (libuna_utf32_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, (libuna_utf16_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set narrow string.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string_size < system_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid narrow string size value too small.", function ); return( -1 ); } if( system_string_copy( narrow_string, system_string, system_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set narrow string.", function ); return( -1 ); } narrow_string[ system_string_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Determines the size of a system string from a narrow string * Returns 1 if successful or -1 on error */ int libcfile_system_string_size_from_narrow_string( const char *narrow_string, size_t narrow_string_size, size_t *system_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_size_from_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) narrow_string, narrow_string_size, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) narrow_string, narrow_string_size, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine system string size.", function ); return( -1 ); } #else if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string size.", function ); return( -1 ); } *system_string_size = narrow_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string from a narrow string * Returns 1 if successful or -1 on error */ int libcfile_system_string_copy_from_narrow_string( system_character_t *system_string, size_t system_string_size, const char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_copy_from_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) system_string, system_string_size, (libuna_utf8_character_t *) narrow_string, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) system_string, system_string_size, (libuna_utf8_character_t *) narrow_string, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) system_string, system_string_size, (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) system_string, system_string_size, (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set system string.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size < narrow_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid system string size value too small.", function ); return( -1 ); } if( system_string_copy( system_string, narrow_string, narrow_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set narrow string.", function ); return( -1 ); } system_string[ narrow_string_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Determines the size of a wide string from a system string * Returns 1 if successful or -1 on error */ int libcfile_system_string_size_to_wide_string( const system_character_t *system_string, size_t system_string_size, size_t *wide_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_size_to_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string size.", function ); return( -1 ); } *wide_string_size = system_string_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) system_string, system_string_size, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) system_string, system_string_size, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) system_string, system_string_size, libclocale_codepage, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) system_string, system_string_size, libclocale_codepage, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide string size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string to a wide string * Returns 1 if successful or -1 on error */ int libcfile_system_string_copy_to_wide_string( const system_character_t *system_string, size_t system_string_size, wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_copy_to_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( wide_string_size < system_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid wide string size value too small.", function ); return( -1 ); } if( system_string_copy( wide_string, system_string, system_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set wide string.", function ); return( -1 ); } wide_string[ system_string_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) wide_string, wide_string_size, (libuna_utf8_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) wide_string, wide_string_size, (libuna_utf8_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) wide_string, wide_string_size, (uint8_t *) system_string, system_string_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) wide_string, wide_string_size, (uint8_t *) system_string, system_string_size, libclocale_codepage, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set wide string.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Determines the size of a system string from a wide string * Returns 1 if successful or -1 on error */ int libcfile_system_string_size_from_wide_string( const wchar_t *wide_string, size_t wide_string_size, size_t *system_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_size_from_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string size.", function ); return( -1 ); } *system_string_size = wide_string_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) wide_string, wide_string_size, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) wide_string, wide_string_size, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) wide_string, wide_string_size, libclocale_codepage, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) wide_string, wide_string_size, libclocale_codepage, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide string size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string from a wide string * Returns 1 if successful or -1 on error */ int libcfile_system_string_copy_from_wide_string( system_character_t *system_string, size_t system_string_size, const wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ) { static char *function = "libcfile_system_string_copy_from_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size < wide_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid system string size value too small.", function ); return( -1 ); } if( system_string_copy( system_string, wide_string, wide_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set wide string.", function ); return( -1 ); } system_string[ wide_string_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) system_string, system_string_size, (libuna_utf32_character_t *) wide_string, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) system_string, system_string_size, (libuna_utf16_character_t *) wide_string, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) system_string, system_string_size, libclocale_codepage, (libuna_utf32_character_t *) wide_string, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) system_string, system_string_size, libclocale_codepage, (libuna_utf16_character_t *) wide_string, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set wide string.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libcfile/Makefile.in0000664000175000017500000010223413443455347021165 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcfile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcfile_la_LIBADD = am__libcfile_la_SOURCES_DIST = libcfile_definitions.h libcfile_error.c \ libcfile_error.h libcfile_extern.h libcfile_file.c \ libcfile_file.h libcfile_libcerror.h libcfile_libclocale.h \ libcfile_libcnotify.h libcfile_libuna.h libcfile_notify.c \ libcfile_notify.h libcfile_support.c libcfile_support.h \ libcfile_system_string.c libcfile_system_string.h \ libcfile_types.h libcfile_unused.h @HAVE_LOCAL_LIBCFILE_TRUE@am_libcfile_la_OBJECTS = libcfile_error.lo \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_file.lo libcfile_notify.lo \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_support.lo \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_system_string.lo libcfile_la_OBJECTS = $(am_libcfile_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCFILE_TRUE@am_libcfile_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcfile_error.Plo \ ./$(DEPDIR)/libcfile_file.Plo ./$(DEPDIR)/libcfile_notify.Plo \ ./$(DEPDIR)/libcfile_support.Plo \ ./$(DEPDIR)/libcfile_system_string.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcfile_la_SOURCES) DIST_SOURCES = $(am__libcfile_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCFILE_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCFILE_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCFILE_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBUNA_CPPFLAGS@ @HAVE_LOCAL_LIBCFILE_TRUE@noinst_LTLIBRARIES = libcfile.la @HAVE_LOCAL_LIBCFILE_TRUE@libcfile_la_SOURCES = \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_definitions.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_error.c libcfile_error.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_extern.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_file.c libcfile_file.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_libcerror.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_libclocale.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_libcnotify.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_libuna.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_notify.c libcfile_notify.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_support.c libcfile_support.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_system_string.c libcfile_system_string.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_types.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcfile/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcfile/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcfile.la: $(libcfile_la_OBJECTS) $(libcfile_la_DEPENDENCIES) $(EXTRA_libcfile_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcfile_la_rpath) $(libcfile_la_OBJECTS) $(libcfile_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_system_string.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcfile_error.Plo -rm -f ./$(DEPDIR)/libcfile_file.Plo -rm -f ./$(DEPDIR)/libcfile_notify.Plo -rm -f ./$(DEPDIR)/libcfile_support.Plo -rm -f ./$(DEPDIR)/libcfile_system_string.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcfile ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcfile_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcfile/libcfile_system_string.h0000664000175000017500000000541413443450031024017 0ustar00lordyestalordyesta00000000000000/* * System string functions * * Copyright (C) 2008-2019, 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( _LIBCFILE_SYSTEM_STRING_H ) #define _LIBCFILE_SYSTEM_STRING_H #include #include #include "libcfile_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libcfile_system_string_size_to_narrow_string( const system_character_t *system_string, size_t system_string_size, size_t *narrow_string_size, libcerror_error_t **error ); int libcfile_system_string_copy_to_narrow_string( const system_character_t *system_string, size_t system_string_size, char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ); int libcfile_system_string_size_from_narrow_string( const char *narrow_string, size_t narrow_string_size, size_t *system_string_size, libcerror_error_t **error ); int libcfile_system_string_copy_from_narrow_string( system_character_t *system_string, size_t system_string_size, const char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libcfile_system_string_size_to_wide_string( const system_character_t *system_string, size_t system_string_size, size_t *wide_string_size, libcerror_error_t **error ); int libcfile_system_string_copy_to_wide_string( const system_character_t *system_string, size_t system_string_size, wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ); int libcfile_system_string_size_from_wide_string( const wchar_t *wide_string, size_t wide_string_size, size_t *system_string_size, libcerror_error_t **error ); int libcfile_system_string_copy_from_wide_string( system_character_t *system_string, size_t system_string_size, const wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCFILE_SYSTEM_STRING_H ) */ libewf-20140807/libcfile/libcfile_libcnotify.h0000664000175000017500000000266213443450031023251 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2008-2019, 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( _LIBCFILE_LIBCNOTIFY_H ) #define _LIBCFILE_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBCFILE_LIBCNOTIFY_H ) */ libewf-20140807/libcfile/libcfile_libuna.h0000664000175000017500000000331213443450031022352 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2008-2019, 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( _LIBCFILE_LIBUNA_H ) #define _LIBCFILE_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBCFILE_LIBUNA_H ) */ libewf-20140807/libcfile/libcfile_notify.c0000664000175000017500000000530413443450031022406 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libcfile_libcerror.h" #include "libcfile_libcnotify.h" #include "libcfile_notify.h" #if !defined( HAVE_LOCAL_LIBCFILE ) /* Sets the verbose notification */ void libcfile_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libcfile_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libcfile_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libcfile_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libcfile_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libcfile_notify_stream_close( libcerror_error_t **error ) { static char *function = "libcfile_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ libewf-20140807/libcthreads/0000775000175000017500000000000013443455444017627 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcthreads/libcthreads_thread_pool.h0000664000175000017500000001007213443450044024633 0ustar00lordyestalordyesta00000000000000/* * Thread pool functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_THREAD_POOL_H ) #define _LIBCTHREADS_INTERNAL_THREAD_POOL_H #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_thread_pool libcthreads_internal_thread_pool_t; struct libcthreads_internal_thread_pool { #if defined( WINAPI ) && ( WINVER >= 0x0602 ) /* The thread pool */ TP_POOL *thread_pool; /* The cleanup group. */ TP_CLEANUP_GROUP *cleanup_group; /* The callback environment */ TP_CALLBACK_ENVIRON callback_environment; #else /* The number of threads in the pool */ int number_of_threads; #if defined( WINAPI ) /* The thread handles array */ HANDLE *thread_handles_array; /* The thread identifiers array */ DWORD *thread_identifiers_array; #elif defined( HAVE_PTHREAD_H ) /* The threads array */ pthread_t *threads_array; #else #error Missing thread type #endif #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ /* The callback function */ int (*callback_function)( intptr_t *value, void *arguments ); /* The value function arguments */ void *callback_function_arguments; /* The (current) pop index */ int pop_index; /* The (current) push index */ int push_index; /* The number of values */ int number_of_values; /* The allocated number of values */ int allocated_number_of_values; /* The values array */ intptr_t **values_array; /* The condition mutex */ libcthreads_mutex_t *condition_mutex; /* The queue empty condition */ libcthreads_condition_t *empty_condition; /* The queue full condition */ libcthreads_condition_t *full_condition; /* The status */ uint8_t status; }; LIBCTHREADS_EXTERN \ int libcthreads_thread_pool_create( libcthreads_thread_pool_t **thread_pool, const libcthreads_thread_attributes_t *thread_attributes, int number_of_threads, int maximum_number_of_values, int (*callback_function)( intptr_t *value, void *arguments ), void *callback_function_arguments, libcerror_error_t **error ); int libcthreads_internal_thread_pool_pop( libcthreads_internal_thread_pool_t *internal_thread_pool, intptr_t **value, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_thread_pool_push( libcthreads_thread_pool_t *thread_pool, intptr_t *value, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_thread_pool_push_sorted( libcthreads_thread_pool_t *thread_pool, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t sort_flags, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_thread_pool_join( libcthreads_thread_pool_t **thread_pool, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_THREAD_POOL_H ) */ libewf-20140807/libcthreads/libcthreads_thread_pool.c0000664000175000017500000012406613443450044024637 0ustar00lordyestalordyesta00000000000000/* * Thread pool functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #include "libcthreads_condition.h" #include "libcthreads_definitions.h" #include "libcthreads_libcerror.h" #include "libcthreads_mutex.h" #include "libcthreads_queue.h" #include "libcthreads_thread.h" #include "libcthreads_thread_attributes.h" #include "libcthreads_thread_pool.h" #include "libcthreads_types.h" #include "libcthreads_unused.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) #if defined( WINAPI ) && ( WINVER >= 0x0602 ) void CALLBACK libcthreads_thread_pool_callback_function_helper( TP_CALLBACK_INSTANCE *callback_instance, void *arguments, TP_WORK *thread_pool_work ) { libcerror_error_t *error = NULL; libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; intptr_t *value = NULL; int callback_function_result = 0; int pop_result = 0; LIBCTHREADS_UNREFERENCED_PARAMETER( callback_instance ) LIBCTHREADS_UNREFERENCED_PARAMETER( thread_pool_work ) if( arguments == NULL ) { return; } internal_thread_pool = (libcthreads_internal_thread_pool_t *) arguments; if( ( internal_thread_pool == NULL ) || ( internal_thread_pool->callback_function == NULL ) ) { return; } pop_result = libcthreads_internal_thread_pool_pop( internal_thread_pool, &value, &error ); if( pop_result == -1 ) { #if defined( HAVE_VERBOSE_OUTPUT ) libcerror_error_backtrace_fprint( error, stdout ); #endif libcerror_error_free( &error ); return; } if( pop_result == 0 ) { return; } callback_function_result = internal_thread_pool->callback_function( value, internal_thread_pool->callback_function_arguments ); if( callback_function_result != 1 ) { #if defined( HAVE_VERBOSE_OUTPUT ) libcerror_error_backtrace_fprint( error, stdout ); #endif libcerror_error_free( &error ); } } #elif defined( WINAPI ) /* Start function helper function for WINAPI * Returns 0 if successful or 1 on error */ DWORD WINAPI libcthreads_thread_pool_callback_function_helper( void *arguments ) { libcerror_error_t *error = NULL; libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; intptr_t *value = NULL; DWORD result = 1; int callback_function_result = 0; int pop_result = 0; if( arguments != NULL ) { internal_thread_pool = (libcthreads_internal_thread_pool_t *) arguments; if( ( internal_thread_pool != NULL ) && ( internal_thread_pool->callback_function != NULL ) ) { result = 0; do { pop_result = libcthreads_internal_thread_pool_pop( internal_thread_pool, &value, &error ); if( pop_result == -1 ) { break; } else if( pop_result != 0 ) { callback_function_result = internal_thread_pool->callback_function( value, internal_thread_pool->callback_function_arguments ); if( ( callback_function_result != 1 ) && ( result == 1 ) ) { result = callback_function_result; } } else if( internal_thread_pool->status == LIBCTHREADS_STATUS_EXIT ) { break; } } while( pop_result != -1 ); if( pop_result == -1 ) { result = 1; } if( error != NULL ) { #if defined( HAVE_VERBOSE_OUTPUT ) libcerror_error_backtrace_fprint( error, stdout ); #endif libcerror_error_free( &error ); } } } ExitThread( result ); } #elif defined( HAVE_PTHREAD_H ) /* Start function helper function for pthread * Returns a pointer to a newly allocated int containing 1 if successful or -1 on error * NULL is return if the helper function was unable to run the callback */ void *libcthreads_thread_pool_callback_function_helper( void *arguments ) { libcerror_error_t *error = NULL; libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; intptr_t *value = NULL; int *result = NULL; int callback_function_result = 0; int pop_result = 0; if( arguments != NULL ) { internal_thread_pool = (libcthreads_internal_thread_pool_t *) arguments; if( ( internal_thread_pool != NULL ) && ( internal_thread_pool->callback_function != NULL ) ) { result = (int *) memory_allocate( sizeof( int ) ); if( result != NULL ) { *result = 1; do { pop_result = libcthreads_internal_thread_pool_pop( internal_thread_pool, &value, &error ); if( pop_result == -1 ) { break; } else if( pop_result != 0 ) { callback_function_result = internal_thread_pool->callback_function( value, internal_thread_pool->callback_function_arguments ); if( ( callback_function_result != 1 ) && ( *result == 1 ) ) { *result = callback_function_result; } } else if( internal_thread_pool->status == LIBCTHREADS_STATUS_EXIT ) { break; } } while( pop_result != -1 ); if( pop_result == -1 ) { *result = -1; } if( error != NULL ) { #if defined( HAVE_VERBOSE_OUTPUT ) libcerror_error_backtrace_fprint( error, stdout ); #endif libcerror_error_free( &error ); } } } } pthread_exit( (void *) result ); } #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ /* Creates a thread pool * Make sure the value thread_pool is referencing, is set to NULL * * The callback_function should return 1 if successful and -1 on error * Returns 1 if successful or -1 on error */ int libcthreads_thread_pool_create( libcthreads_thread_pool_t **thread_pool, const libcthreads_thread_attributes_t *thread_attributes, int number_of_threads, int maximum_number_of_values, int (*callback_function)( intptr_t *value, void *arguments ), void *callback_function_arguments, libcerror_error_t **error ) { libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; static char *function = "libcthreads_thread_pool_create"; size_t array_size = 0; #if !defined( WINAPI ) || ( WINVER < 0x0602 ) int thread_index = 0; #endif #if defined( WINAPI ) DWORD error_code = 0; #endif #if defined( WINAPI ) && ( WINVER >= 0x0602 ) BOOL result = FALSE; #elif defined( WINAPI ) SECURITY_ATTRIBUTES *security_attributes = NULL; HANDLE thread_handle = NULL; #elif defined( HAVE_PTHREAD_H ) pthread_attr_t *attributes = NULL; int *thread_return_value = NULL; int pthread_result = 0; #endif #if defined( WINAPI ) && ( WINVER >= 0x0602 ) LIBCTHREADS_UNREFERENCED_PARAMETER( thread_attributes ) #endif if( thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread pool.", function ); return( -1 ); } if( *thread_pool != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid thread pool value already set.", function ); return( -1 ); } if( number_of_threads <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of threads value zero or less.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #if SIZEOF_INT > 4 if( number_of_threads > (int) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of threads value exceeds maximum.", function ); return( -1 ); } #endif /* SIZEOF_INT > 4 */ #else #if SIZEOF_INT <= SIZEOF_SIZE_T if( (size_t) number_of_threads > (size_t) ( SSIZE_MAX / sizeof( libcthreads_thread_t * ) ) ) #else if( number_of_threads > (int) ( SSIZE_MAX / sizeof( libcthreads_thread_t * ) ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of threads value exceeds maximum.", function ); return( -1 ); } #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ if( maximum_number_of_values <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid maximum number of values value zero or less.", function ); return( -1 ); } #if SIZEOF_INT <= SIZEOF_SIZE_T if( (size_t) maximum_number_of_values > (size_t) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #else if( maximum_number_of_values > (int) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum number of values value exceeds maximum.", function ); return( -1 ); } if( callback_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid callback function.", function ); return( -1 ); } internal_thread_pool = memory_allocate_structure( libcthreads_internal_thread_pool_t ); if( internal_thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create thread pool.", function ); goto on_error; } if( memory_set( internal_thread_pool, 0, sizeof( libcthreads_internal_thread_pool_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear thread pool.", function ); memory_free( internal_thread_pool ); return( -1 ); } array_size = sizeof( intptr_t * ) * maximum_number_of_values; if( array_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid values array size value exceeds maximum.", function ); goto on_error; } internal_thread_pool->values_array = (intptr_t **) memory_allocate( array_size ); if( internal_thread_pool->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create values array.", function ); goto on_error; } if( memory_set( internal_thread_pool->values_array, 0, array_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear values array.", function ); goto on_error; } internal_thread_pool->allocated_number_of_values = maximum_number_of_values; /* The callback must be set before the callback function helper threads are created */ internal_thread_pool->callback_function = callback_function; internal_thread_pool->callback_function_arguments = callback_function_arguments; if( libcthreads_mutex_initialize( &( internal_thread_pool->condition_mutex ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create condition mutex.", function ); goto on_error; } if( libcthreads_condition_initialize( &( internal_thread_pool->empty_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create empty condition.", function ); goto on_error; } if( libcthreads_condition_initialize( &( internal_thread_pool->full_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create full condition.", function ); goto on_error; } #if defined( WINAPI ) && ( WINVER >= 0x0602 ) InitializeThreadpoolEnvironment( &( internal_thread_pool->callback_environment ) ); internal_thread_pool->thread_pool = CreateThreadpool( NULL ); if( internal_thread_pool->thread_pool == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread pool.", function ); goto on_error; } internal_thread_pool->cleanup_group = CreateThreadpoolCleanupGroup(); result = SetThreadpoolThreadMinimum( internal_thread_pool->thread_pool, (DWORD) number_of_threads ); if( result != TRUE ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set minimum number of threads.", function ); goto on_error; } SetThreadpoolThreadMaximum( internal_thread_pool->thread_pool, (DWORD) number_of_threads ); if( internal_thread_pool->cleanup_group == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread pool cleanup group.", function ); goto on_error; } SetThreadpoolCallbackPool( &( internal_thread_pool->callback_environment ), internal_thread_pool->thread_pool ); SetThreadpoolCallbackCleanupGroup( &( internal_thread_pool->callback_environment ), internal_thread_pool->cleanup_group, NULL ); #elif defined( WINAPI ) array_size = sizeof( HANDLE ) * number_of_threads; if( array_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid thread handles array size value out of bounds.", function ); goto on_error; } internal_thread_pool->thread_handles_array = (HANDLE *) memory_allocate( array_size ); if( internal_thread_pool->thread_handles_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create thread handles array.", function ); goto on_error; } if( memory_set( internal_thread_pool->thread_handles_array, 0, array_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear thread handles array.", function ); goto on_error; } internal_thread_pool->number_of_threads = number_of_threads; array_size = sizeof( DWORD ) * number_of_threads; if( array_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid thread identifiers array size value out of bounds.", function ); goto on_error; } internal_thread_pool->thread_identifiers_array = (DWORD *) memory_allocate( array_size ); if( internal_thread_pool->thread_identifiers_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create thread identifiers array.", function ); goto on_error; } if( memory_set( internal_thread_pool->thread_identifiers_array, 0, array_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear thread identifiers array.", function ); goto on_error; } if( thread_attributes != NULL ) { security_attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->security_attributes ); } for( thread_index = 0; thread_index < number_of_threads; thread_index++ ) { thread_handle = CreateThread( security_attributes, 0, /* stack size */ &libcthreads_thread_pool_callback_function_helper, (void *) internal_thread_pool, 0, /* creation flags */ &( internal_thread_pool->thread_identifiers_array[ thread_index ] ) ); if( thread_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread handle: %d.", function, thread_index ); goto on_error; } internal_thread_pool->thread_handles_array[ thread_index ] = thread_handle; } #elif defined( HAVE_PTHREAD_H ) array_size = sizeof( pthread_t ) * number_of_threads; if( array_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid threads array size value out of bounds.", function ); goto on_error; } internal_thread_pool->threads_array = (pthread_t *) memory_allocate( array_size ); if( internal_thread_pool->threads_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create threads array.", function ); goto on_error; } if( memory_set( internal_thread_pool->threads_array, 0, array_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear threads array.", function ); goto on_error; } internal_thread_pool->number_of_threads = number_of_threads; if( thread_attributes != NULL ) { attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->attributes ); } for( thread_index = 0; thread_index < number_of_threads; thread_index++ ) { pthread_result = pthread_create( &( internal_thread_pool->threads_array[ thread_index ] ), attributes, &libcthreads_thread_pool_callback_function_helper, (void *) internal_thread_pool ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to create thread: %d with error: Insufficient resources.", function, thread_index ); goto on_error; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to create thread: %d.", function, thread_index ); goto on_error; } } #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ *thread_pool = (libcthreads_thread_pool_t *) internal_thread_pool; return( 1 ); on_error: if( internal_thread_pool != NULL ) { #if defined( WINAPI ) && ( WINVER >= 0x0602 ) if( internal_thread_pool->cleanup_group != NULL ) { CloseThreadpoolCleanupGroup( internal_thread_pool->cleanup_group ); internal_thread_pool->cleanup_group = NULL; } if( internal_thread_pool->thread_pool != NULL ) { CloseThreadpool( internal_thread_pool->thread_pool ); internal_thread_pool->thread_pool = NULL; } #elif defined( WINAPI ) if( internal_thread_pool->thread_identifiers_array != NULL ) { memory_free( internal_thread_pool->thread_identifiers_array ); } if( internal_thread_pool->thread_handles_array != NULL ) { while( thread_index >= 0 ) { WaitForSingleObject( internal_thread_pool->thread_handles_array[ thread_index ], INFINITE ); thread_index--; } memory_free( internal_thread_pool->thread_handles_array ); } #elif defined( HAVE_PTHREAD_H ) if( internal_thread_pool->threads_array != NULL ) { while( thread_index >= 0 ) { pthread_join( internal_thread_pool->threads_array[ thread_index ], (void **) &thread_return_value ); if( thread_return_value != NULL ) { memory_free( thread_return_value ); thread_return_value = NULL; } thread_index--; } memory_free( internal_thread_pool->threads_array ); } #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ if( internal_thread_pool->full_condition != NULL ) { libcthreads_condition_free( &( internal_thread_pool->full_condition ), NULL ); } if( internal_thread_pool->empty_condition != NULL ) { libcthreads_condition_free( &( internal_thread_pool->empty_condition ), NULL ); } if( internal_thread_pool->condition_mutex != NULL ) { libcthreads_mutex_free( &( internal_thread_pool->condition_mutex ), NULL ); } if( internal_thread_pool->values_array != NULL ) { memory_free( internal_thread_pool->values_array ); } memory_free( internal_thread_pool ); } return( -1 ); } /* Pops a value off the queue of the thread pool * Returns 1 if successful, 0 if no value available or -1 on error */ int libcthreads_internal_thread_pool_pop( libcthreads_internal_thread_pool_t *internal_thread_pool, intptr_t **value, libcerror_error_t **error ) { static char *function = "libcthreads_internal_thread_pool_pop"; int result = 0; if( internal_thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread pool.", function ); return( -1 ); } if( internal_thread_pool->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid thread pool - missing values array.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_thread_pool->number_of_values == 0 ) { if( internal_thread_pool->status == LIBCTHREADS_STATUS_EXIT ) { break; } if( libcthreads_condition_wait( internal_thread_pool->empty_condition, internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for empty condition.", function ); goto on_error; } } if( internal_thread_pool->number_of_values > 0 ) { *value = internal_thread_pool->values_array[ internal_thread_pool->pop_index ]; internal_thread_pool->pop_index++; if( internal_thread_pool->pop_index >= internal_thread_pool->allocated_number_of_values ) { internal_thread_pool->pop_index = 0; } internal_thread_pool->number_of_values--; result = 1; if( libcthreads_condition_broadcast( internal_thread_pool->full_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast full condition.", function ); goto on_error; } } if( libcthreads_mutex_release( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( result ); on_error: libcthreads_mutex_release( internal_thread_pool->condition_mutex, NULL ); return( -1 ); } /* Pushes a value onto the queue of the thread pool * Returns 1 if successful or -1 on error */ int libcthreads_thread_pool_push( libcthreads_thread_pool_t *thread_pool, intptr_t *value, libcerror_error_t **error ) { libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; static char *function = "libcthreads_thread_pool_push"; #if defined( WINAPI ) && ( WINVER >= 0x0602 ) TP_WORK *thread_pool_work = NULL; DWORD error_code = 0; #endif if( thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread pool.", function ); return( -1 ); } internal_thread_pool = (libcthreads_internal_thread_pool_t *) thread_pool; if( internal_thread_pool->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid thread pool - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_thread_pool->number_of_values == internal_thread_pool->allocated_number_of_values ) { if( libcthreads_condition_wait( internal_thread_pool->full_condition, internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for full condition.", function ); goto on_error; } } internal_thread_pool->values_array[ internal_thread_pool->push_index ] = value; internal_thread_pool->push_index++; if( internal_thread_pool->push_index >= internal_thread_pool->allocated_number_of_values ) { internal_thread_pool->push_index = 0; } internal_thread_pool->number_of_values++; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_thread_pool->empty_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast empty condition.", function ); goto on_error; } if( libcthreads_mutex_release( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0602 ) thread_pool_work = CreateThreadpoolWork( &libcthreads_thread_pool_callback_function_helper, (void *) internal_thread_pool, &( internal_thread_pool->callback_environment ) ); if( thread_pool_work == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread pool work.", function ); return( -1 ); } SubmitThreadpoolWork( thread_pool_work ); #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ return( 1 ); on_error: libcthreads_mutex_release( internal_thread_pool->condition_mutex, NULL ); return( -1 ); } /* Pushes a value onto the thread pool in sorted order * * Uses the value_compare_function to determine the similarity of the values * The value_compare_function should return LIBCTHREADS_COMPARE_LESS, * LIBCTHREADS_COMPARE_EQUAL, LIBCTHREADS_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if the value already exists or -1 on error */ int libcthreads_thread_pool_push_sorted( libcthreads_thread_pool_t *thread_pool, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t sort_flags, libcerror_error_t **error ) { libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; static char *function = "libcthreads_thread_pool_push_sorted"; int compare_result = 0; int pop_index = 0; int previous_push_index = 0; int push_index = 0; int result = 1; int value_index = 0; #if defined( WINAPI ) && ( WINVER >= 0x0602 ) TP_WORK *thread_pool_work = NULL; DWORD error_code = 0; #endif if( thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread pool.", function ); return( -1 ); } internal_thread_pool = (libcthreads_internal_thread_pool_t *) thread_pool; if( internal_thread_pool->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( ( sort_flags & ~( LIBCTHREADS_SORT_FLAG_UNIQUE_VALUES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported sort flags: 0x%02" PRIx8 ".", function, sort_flags ); return( -1 ); } if( libcthreads_mutex_grab( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_thread_pool->number_of_values == internal_thread_pool->allocated_number_of_values ) { if( libcthreads_condition_wait( internal_thread_pool->full_condition, internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for full condition.", function ); goto on_error; } } pop_index = internal_thread_pool->pop_index; for( value_index = 0; value_index < internal_thread_pool->number_of_values; value_index++ ) { compare_result = value_compare_function( value, internal_thread_pool->values_array[ pop_index ], error ); if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare value: %d.", function, value_index ); goto on_error; } else if( compare_result == LIBCTHREADS_COMPARE_EQUAL ) { if( ( sort_flags & LIBCTHREADS_SORT_FLAG_UNIQUE_VALUES ) != 0 ) { result = 0; break; } } else if( compare_result == LIBCTHREADS_COMPARE_LESS ) { result = 1; break; } else if( compare_result != LIBCTHREADS_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, compare_result ); goto on_error; } pop_index++; if( pop_index >= internal_thread_pool->allocated_number_of_values ) { pop_index = 0; } } if( result != 0 ) { push_index = internal_thread_pool->push_index; if( compare_result == LIBCTHREADS_COMPARE_LESS ) { previous_push_index = push_index - 1; while( push_index != pop_index ) { if( previous_push_index < 0 ) { previous_push_index = internal_thread_pool->allocated_number_of_values - 1; } internal_thread_pool->values_array[ push_index ] = internal_thread_pool->values_array[ previous_push_index ]; push_index = previous_push_index; previous_push_index--; } } internal_thread_pool->values_array[ push_index ] = value; internal_thread_pool->push_index++; if( internal_thread_pool->push_index >= internal_thread_pool->allocated_number_of_values ) { internal_thread_pool->push_index = 0; } internal_thread_pool->number_of_values++; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_thread_pool->empty_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast empty condition.", function ); goto on_error; } } if( libcthreads_mutex_release( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0602 ) thread_pool_work = CreateThreadpoolWork( &libcthreads_thread_pool_callback_function_helper, (void *) internal_thread_pool, &( internal_thread_pool->callback_environment ) ); if( thread_pool_work == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread pool work.", function ); return( -1 ); } SubmitThreadpoolWork( thread_pool_work ); #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ return( result ); on_error: libcthreads_mutex_release( internal_thread_pool->condition_mutex, NULL ); return( -1 ); } /* Joins the current with a specified thread pool * The the thread is freed after join * Returns 1 if successful or -1 on error */ int libcthreads_thread_pool_join( libcthreads_thread_pool_t **thread_pool, libcerror_error_t **error ) { libcthreads_internal_thread_pool_t *internal_thread_pool = NULL; static char *function = "libcthreads_thread_pool_join"; int result = 1; #if !defined( WINAPI ) || ( WINVER < 0x0602 ) int thread_index = 0; #if defined( WINAPI ) DWORD error_code = 0; DWORD wait_status = 0; #elif defined( HAVE_PTHREAD_H ) int *thread_return_value = NULL; int pthread_result = 0; #endif #endif /* !defined( WINAPI ) || ( WINVER < 0x0602 ) */ if( thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread pool.", function ); return( -1 ); } if( *thread_pool == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing thread pool value.", function ); return( -1 ); } internal_thread_pool = (libcthreads_internal_thread_pool_t *) *thread_pool; *thread_pool = NULL; if( libcthreads_mutex_grab( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } internal_thread_pool->status = LIBCTHREADS_STATUS_EXIT; /* Wake up the worker threads */ if( libcthreads_condition_broadcast( internal_thread_pool->empty_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast empty condition.", function ); result = -1; } while( internal_thread_pool->number_of_values != 0 ) { /* Wait here to all the values in the queue have been processed */ if( libcthreads_condition_wait( internal_thread_pool->full_condition, internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for full condition.", function ); result = -1; break; } } if( libcthreads_mutex_release( internal_thread_pool->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0602 ) CloseThreadpoolCleanupGroupMembers( internal_thread_pool->cleanup_group, FALSE, NULL ); CloseThreadpoolCleanupGroup( internal_thread_pool->cleanup_group ); internal_thread_pool->cleanup_group = NULL; CloseThreadpool( internal_thread_pool->thread_pool ); internal_thread_pool->thread_pool = NULL; #elif defined( WINAPI ) for( thread_index = 0; thread_index < internal_thread_pool->number_of_threads; thread_index++ ) { wait_status = WaitForSingleObject( internal_thread_pool->thread_handles_array[ thread_index ], INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: wait for thread: %d failed.", function, thread_index ); result = -1; } } #elif defined( HAVE_PTHREAD_H ) for( thread_index = 0; thread_index < internal_thread_pool->number_of_threads; thread_index++ ) { pthread_result = pthread_join( internal_thread_pool->threads_array[ thread_index ], (void **) &thread_return_value ); if( pthread_result == EDEADLK ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to join thread: %d with error: Deadlock condition detected.", function, thread_index ); result = -1; } else if( pthread_result != 0 ) { libcerror_system_set_error( error, result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to join thread: %d.", function, thread_index ); result = -1; } /* If the thread returns NULL it never got around to launching the callback function */ else if( ( thread_return_value != NULL ) && ( *thread_return_value != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: thread: %d returned an error status of: %d.", function, thread_index, *thread_return_value ); result = -1; } if( thread_return_value != NULL ) { memory_free( thread_return_value ); thread_return_value = NULL; } } #endif /* defined( WINAPI ) && ( WINVER >= 0x0602 ) */ if( libcthreads_condition_free( &( internal_thread_pool->full_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free full condition.", function ); result = -1; } if( libcthreads_condition_free( &( internal_thread_pool->empty_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free empty condition.", function ); result = -1; } if( libcthreads_mutex_free( &( internal_thread_pool->condition_mutex ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free condition mutex.", function ); result = -1; } #if defined( WINAPI ) && ( WINVER < 0x0602 ) memory_free( internal_thread_pool->thread_identifiers_array ); memory_free( internal_thread_pool->thread_handles_array ); #elif defined( HAVE_PTHREAD_H ) memory_free( internal_thread_pool->threads_array ); #endif memory_free( internal_thread_pool->values_array ); memory_free( internal_thread_pool ); return( result ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_repeating_thread.c0000664000175000017500000004205713443450044025643 0ustar00lordyestalordyesta00000000000000/* * Repeating thread functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_condition.h" #include "libcthreads_definitions.h" #include "libcthreads_libcerror.h" #include "libcthreads_mutex.h" #include "libcthreads_repeating_thread.h" #include "libcthreads_thread_attributes.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) #if defined( WINAPI ) /* Start function helper function for WINAPI * Returns 0 if successful or 1 on error */ DWORD WINAPI libcthreads_repeating_thread_start_function_helper( void *arguments ) { libcthreads_internal_repeating_thread_t *internal_repeating_thread = NULL; DWORD result = 0; int start_function_result = 0; if( arguments != NULL ) { internal_repeating_thread = (libcthreads_internal_repeating_thread_t *) arguments; if( ( internal_repeating_thread != NULL ) && ( internal_repeating_thread->start_function != NULL ) ) { internal_repeating_thread->start_function_result = 1; do { libcthreads_mutex_grab( internal_repeating_thread->condition_mutex, NULL ); /* Check for exit status in case of the situation where the thread * is created after the join has been called */ while( internal_repeating_thread->status != LIBCTHREADS_STATUS_EXIT ) { libcthreads_condition_wait( internal_repeating_thread->status_condition, internal_repeating_thread->condition_mutex, NULL ); } libcthreads_mutex_release( internal_repeating_thread->condition_mutex, NULL ); start_function_result = internal_repeating_thread->start_function( internal_repeating_thread->start_function_arguments ); if( ( start_function_result != 1 ) && ( internal_repeating_thread->start_function_result == 1 ) ) { internal_repeating_thread->start_function_result = start_function_result; } } while( internal_repeating_thread->status != LIBCTHREADS_STATUS_EXIT ); if( internal_repeating_thread->start_function_result != 1 ) { result = 1; } } } ExitThread( result ); } #elif defined( HAVE_PTHREAD_H ) /* Start function helper function for pthread * Returns a pointer to the start function result if successful or NULL on error */ void *libcthreads_repeating_thread_start_function_helper( void *arguments ) { libcthreads_internal_repeating_thread_t *internal_repeating_thread = NULL; void *result = NULL; int start_function_result = 0; if( arguments != NULL ) { internal_repeating_thread = (libcthreads_internal_repeating_thread_t *) arguments; if( ( internal_repeating_thread != NULL ) && ( internal_repeating_thread->start_function != NULL ) ) { internal_repeating_thread->start_function_result = 1; do { libcthreads_mutex_grab( internal_repeating_thread->condition_mutex, NULL ); /* Check for exit status in case of the situation where the thread * is created after the join has been called */ while( internal_repeating_thread->status != LIBCTHREADS_STATUS_EXIT ) { libcthreads_condition_wait( internal_repeating_thread->status_condition, internal_repeating_thread->condition_mutex, NULL ); } libcthreads_mutex_release( internal_repeating_thread->condition_mutex, NULL ); start_function_result = internal_repeating_thread->start_function( internal_repeating_thread->start_function_arguments ); if( ( start_function_result != 1 ) && ( internal_repeating_thread->start_function_result == 1 ) ) { internal_repeating_thread->start_function_result = start_function_result; } } while( internal_repeating_thread->status != LIBCTHREADS_STATUS_EXIT ); result = (void *) &( internal_repeating_thread->start_function_result ); } } pthread_exit( result ); } #endif /* defined( WINAPI ) else defined( HAVE_PTHREAD_H ) */ /* Creates a repeating thread * Make sure the value repeating_thread is referencing, is set to NULL * * The start_function should return 1 if successful and -1 on error * Returns 1 if successful or -1 on error */ int libcthreads_repeating_thread_create( libcthreads_repeating_thread_t **repeating_thread, const libcthreads_thread_attributes_t *thread_attributes, int (*start_function)( void *arguments ), void *start_function_arguments, libcerror_error_t **error ) { libcthreads_internal_repeating_thread_t *internal_repeating_thread = NULL; static char *function = "libcthreads_repeating_thread_create"; #if defined( WINAPI ) SECURITY_ATTRIBUTES *security_attributes = NULL; DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) pthread_attr_t *attributes = NULL; int pthread_result = 0; #endif if( repeating_thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid repeating thread.", function ); return( -1 ); } if( *repeating_thread != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid repeating thread value already set.", function ); return( -1 ); } if( start_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid start function.", function ); return( -1 ); } internal_repeating_thread = memory_allocate_structure( libcthreads_internal_repeating_thread_t ); if( internal_repeating_thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create repeating thread.", function ); goto on_error; } if( memory_set( internal_repeating_thread, 0, sizeof( libcthreads_internal_repeating_thread_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear repeating thread.", function ); memory_free( internal_repeating_thread ); return( -1 ); } if( libcthreads_mutex_initialize( &( internal_repeating_thread->condition_mutex ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create condition mutex.", function ); goto on_error; } if( libcthreads_condition_initialize( &( internal_repeating_thread->status_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create status condition.", function ); goto on_error; } internal_repeating_thread->start_function = start_function; internal_repeating_thread->start_function_arguments = start_function_arguments; #if defined( WINAPI ) if( thread_attributes != NULL ) { security_attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->security_attributes ); } internal_repeating_thread->thread_handle = CreateThread( security_attributes, 0, /* stack size */ &libcthreads_repeating_thread_start_function_helper, (void *) internal_repeating_thread, 0, /* creation flags */ &( internal_repeating_thread->thread_identifier ) ); if( internal_repeating_thread->thread_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread handle.", function ); goto on_error; } #elif defined( HAVE_PTHREAD_H ) if( thread_attributes != NULL ) { attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->attributes ); } pthread_result = pthread_create( &( internal_repeating_thread->thread ), attributes, &libcthreads_repeating_thread_start_function_helper, (void *) internal_repeating_thread ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to create thread with error: Insufficient resources.", function ); goto on_error; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to create thread.", function ); goto on_error; } #endif *repeating_thread = (libcthreads_repeating_thread_t *) internal_repeating_thread; return( 1 ); on_error: if( internal_repeating_thread != NULL ) { if( internal_repeating_thread->status_condition != NULL ) { libcthreads_condition_free( &( internal_repeating_thread->status_condition ), NULL ); } if( internal_repeating_thread->condition_mutex != NULL ) { libcthreads_mutex_free( &( internal_repeating_thread->condition_mutex ), NULL ); } memory_free( internal_repeating_thread ); } return( -1 ); } /* Gives the thread a push * Returns 1 if successful or -1 on error */ int libcthreads_repeating_thread_push( libcthreads_repeating_thread_t *repeating_thread, libcerror_error_t **error ) { libcthreads_internal_repeating_thread_t *internal_repeating_thread = NULL; static char *function = "libcthreads_repeating_thread_push"; int result = 1; if( repeating_thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid repeating thread.", function ); return( -1 ); } internal_repeating_thread = (libcthreads_internal_repeating_thread_t *) repeating_thread; /* TODO some work */ if( libcthreads_mutex_grab( internal_repeating_thread->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } if( libcthreads_condition_signal( internal_repeating_thread->status_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal status condition.", function ); result = -1; } if( libcthreads_mutex_release( internal_repeating_thread->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( result ); } /* Joins the current with a specified repeating thread * The the thread is freed after join * Returns 1 if successful or -1 on error */ int libcthreads_repeating_thread_join( libcthreads_repeating_thread_t **repeating_thread, libcerror_error_t **error ) { libcthreads_internal_repeating_thread_t *internal_repeating_thread = NULL; static char *function = "libcthreads_repeating_thread_join"; int result = 1; #if defined( WINAPI ) DWORD error_code = 0; DWORD wait_status = 0; #elif defined( HAVE_PTHREAD_H ) int *thread_return_value = NULL; int pthread_result = 0; #endif if( repeating_thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid repeating thread.", function ); return( -1 ); } if( *repeating_thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing repeating thread value.", function ); return( -1 ); } internal_repeating_thread = (libcthreads_internal_repeating_thread_t *) *repeating_thread; *repeating_thread = NULL; if( libcthreads_mutex_grab( internal_repeating_thread->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } internal_repeating_thread->status = LIBCTHREADS_STATUS_EXIT; if( libcthreads_condition_signal( internal_repeating_thread->status_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal status condition.", function ); result = -1; } if( libcthreads_mutex_release( internal_repeating_thread->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } if( result != 1 ) { return( -1 ); } #if defined( WINAPI ) wait_status = WaitForSingleObject( internal_repeating_thread->thread_handle, INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: wait for thread failed.", function ); result = -1; } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_join( internal_repeating_thread->thread, (void **) &thread_return_value ); if( pthread_result == EDEADLK ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to join thread with error: Deadlock condition detected.", function ); result = -1; } else if( pthread_result != 0 ) { libcerror_system_set_error( error, result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to join thread.", function ); result = -1; } else if( ( thread_return_value == NULL ) || ( thread_return_value != &( internal_repeating_thread->start_function_result ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: invalid thread return value.", function ); result = -1; } else if( *thread_return_value != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: thread returned an error status.", function, *thread_return_value ); result = -1; } #endif if( libcthreads_condition_free( &( internal_repeating_thread->status_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free status condition.", function ); result = -1; } if( libcthreads_mutex_free( &( internal_repeating_thread->condition_mutex ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free condition mutex.", function ); result = -1; } memory_free( internal_repeating_thread ); return( result ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_error.c0000664000175000017500000000561213443450044023463 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include "libcthreads_error.h" #include "libcthreads_libcerror.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) /* Free an error and its elements */ void libcthreads_error_free( libcthreads_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcthreads_error_fprint( libcthreads_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcthreads_error_sprint( libcthreads_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcthreads_error_backtrace_fprint( libcthreads_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcthreads_error_backtrace_sprint( libcthreads_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) */ libewf-20140807/libcthreads/Makefile.am0000664000175000017500000000215713443450044021657 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCTHREADS AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libcthreads.la libcthreads_la_SOURCES = \ libcthreads_condition.c libcthreads_condition.h \ libcthreads_definitions.h \ libcthreads_error.c libcthreads_error.h \ libcthreads_extern.h \ libcthreads_libcerror.h \ libcthreads_lock.c libcthreads_lock.h \ libcthreads_mutex.c libcthreads_mutex.h \ libcthreads_queue.c libcthreads_queue.h \ libcthreads_read_write_lock.c libcthreads_read_write_lock.h \ libcthreads_repeating_thread.c libcthreads_repeating_thread.h \ libcthreads_support.c libcthreads_support.h \ libcthreads_thread.c libcthreads_thread.h \ libcthreads_thread_attributes.c libcthreads_thread_attributes.h \ libcthreads_thread_pool.c libcthreads_thread_pool.h \ libcthreads_types.h \ libcthreads_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcthreads ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcthreads_la_SOURCES) libewf-20140807/libcthreads/libcthreads_unused.h0000664000175000017500000000257613443450044023650 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_UNUSED_H ) #define _LIBCTHREADS_INTERNAL_UNUSED_H #include #if !defined( LIBCTHREADS_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCTHREADS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCTHREADS_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCTHREADS_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCTHREADS_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_UNUSED_H ) */ libewf-20140807/libcthreads/libcthreads_condition.h0000664000175000017500000000571313443450044024327 0ustar00lordyestalordyesta00000000000000/* * Condition functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_CONDITION_H ) #define _LIBCTHREADS_INTERNAL_CONDITION_H #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_condition libcthreads_internal_condition_t; struct libcthreads_internal_condition { #if defined( WINAPI ) && ( WINVER >= 0x0600 ) /* The condition variable */ CONDITION_VARIABLE condition_variable; #elif defined( WINAPI ) /* The number of waiting threads */ int number_of_waiting_threads; /* The wait critical section */ CRITICAL_SECTION wait_critical_section; /* Semaphore handle used to signal the waiting threads */ HANDLE signal_semaphore_handle; /* Event handle used to signal the waiting threads */ HANDLE signal_event_handle; /* Value to indicate last signal was a broadcast */ uint8_t signal_is_broadcast; #elif defined( HAVE_PTHREAD_H ) /* The condition */ pthread_cond_t condition; #else #error Missing condition type #endif }; LIBCTHREADS_EXTERN \ int libcthreads_condition_initialize( libcthreads_condition_t **condition, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_condition_free( libcthreads_condition_t **condition, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_condition_broadcast( libcthreads_condition_t *condition, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_condition_signal( libcthreads_condition_t *condition, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_condition_wait( libcthreads_condition_t *condition, libcthreads_mutex_t *mutex, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_CONDITION_H ) */ libewf-20140807/libcthreads/libcthreads_definitions.h0000664000175000017500000000412213443450044024645 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2012-2018, 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( LIBCTHREADS_INTERNAL_DEFINITIONS_H ) #define LIBCTHREADS_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads */ #if !defined( HAVE_LOCAL_LIBCTHREADS ) #include /* The definitions in are copied here * for local use of libcthreads */ #else #define LIBCTHREADS_VERSION 20180724 /* The libcthreads version string */ #define LIBCTHREADS_VERSION_STRING "20180724" /* The comparison function definitions */ enum LIBCTHREADS_COMPARE_DEFINITIONS { /* The first value is less than the second value */ LIBCTHREADS_COMPARE_LESS, /* The first and second values are equal */ LIBCTHREADS_COMPARE_EQUAL, /* The first value is greater than the second value */ LIBCTHREADS_COMPARE_GREATER }; /* The sort flag definitions */ enum LIBCTHREADS_SORT_FLAGS { /* Allow duplicate values */ LIBCTHREADS_SORT_FLAG_NON_UNIQUE_VALUES = 0x00, /* Only allow unique values, no duplicates */ LIBCTHREADS_SORT_FLAG_UNIQUE_VALUES = 0x01 }; #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) */ /* The status definitions */ enum LIBCTHREADS_STATUS { LIBCTHREADS_STATUS_EXIT = 1 }; #endif /* !defined( LIBCTHREADS_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libcthreads/libcthreads_thread.h0000664000175000017500000000446613443450044023614 0ustar00lordyestalordyesta00000000000000/* * Thread functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_THREAD_H ) #define _LIBCTHREADS_INTERNAL_THREAD_H #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_thread libcthreads_internal_thread_t; struct libcthreads_internal_thread { #if defined( WINAPI ) /* The thread handle */ HANDLE thread_handle; /* The thread identifier */ DWORD thread_identifier; #elif defined( HAVE_PTHREAD_H ) /* The thread */ pthread_t thread; #else #error Missing thread type #endif /* The callback function */ int (*callback_function)( void *arguments ); /* The callback function arguments */ void *callback_function_arguments; }; LIBCTHREADS_EXTERN \ int libcthreads_thread_create( libcthreads_thread_t **thread, const libcthreads_thread_attributes_t *thread_attributes, int (*callback_function)( void *arguments ), void *callback_function_arguments, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_thread_join( libcthreads_thread_t **thread, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_THREAD_H ) */ libewf-20140807/libcthreads/libcthreads_repeating_thread.h0000664000175000017500000000547013443450044025646 0ustar00lordyestalordyesta00000000000000/* * Repeating thread functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_REPEATING_THREAD_H ) #define _LIBCTHREADS_INTERNAL_REPEATING_THREAD_H #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_repeating_thread libcthreads_internal_repeating_thread_t; struct libcthreads_internal_repeating_thread { #if defined( WINAPI ) /* The thread handle */ HANDLE thread_handle; /* The thread identifier */ DWORD thread_identifier; #elif defined( HAVE_PTHREAD_H ) /* The thread */ pthread_t thread; #else #error Missing thread type #endif /* The start function */ int (*start_function)( void *arguments ); /* The start function arguments */ void *start_function_arguments; /* The start functions return value */ int start_function_result; /* The condition mutex */ libcthreads_mutex_t *condition_mutex; /* The status condition */ libcthreads_condition_t *status_condition; /* The status */ uint8_t status; }; LIBCTHREADS_EXTERN \ int libcthreads_repeating_thread_create( libcthreads_repeating_thread_t **repeating_thread, const libcthreads_thread_attributes_t *thread_attributes, int (*start_function)( void *arguments ), void *start_function_arguments, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_repeating_thread_push( libcthreads_repeating_thread_t *repeating_thread, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_repeating_thread_join( libcthreads_repeating_thread_t **repeating_thread, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_REPEATING_THREAD_H ) */ libewf-20140807/libcthreads/libcthreads_read_write_lock.c0000664000175000017500000004374513443450044025500 0ustar00lordyestalordyesta00000000000000/* * Read/Write lock functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_libcerror.h" #include "libcthreads_read_write_lock.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) /* Creates a read/write lock * Make sure the value read_write_lock is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcthreads_read_write_lock_initialize( libcthreads_read_write_lock_t **read_write_lock, libcerror_error_t **error ) { libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_initialize"; #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read/write lock.", function ); return( -1 ); } if( *read_write_lock != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid read/write lock value already set.", function ); return( -1 ); } internal_read_write_lock = memory_allocate_structure( libcthreads_internal_read_write_lock_t ); if( internal_read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create read/write lock.", function ); goto on_error; } if( memory_set( internal_read_write_lock, 0, sizeof( libcthreads_internal_read_write_lock_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear read/write lock.", function ); memory_free( internal_read_write_lock ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0600 ) InitializeSRWLock( &( internal_read_write_lock->slim_read_write_lock ) ); #elif defined( WINAPI ) && ( WINVER >= 0x0400 ) InitializeCriticalSection( &( internal_read_write_lock->write_critical_section ) ); InitializeCriticalSection( &( internal_read_write_lock->read_critical_section ) ); internal_read_write_lock->no_read_event_handle = CreateEvent( NULL, TRUE, TRUE, NULL ); if( internal_read_write_lock->no_read_event_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize no read event handle.", function ); goto on_error; } #elif defined( WINAPI ) #error libcthreads_read_write_lock_initialize for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_init( &( internal_read_write_lock->read_write_lock ), NULL ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to initialize read/write lock with error: Insufficient resources.", function ); goto on_error; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *read_write_lock = (libcthreads_read_write_lock_t *) internal_read_write_lock; return( 1 ); on_error: if( internal_read_write_lock != NULL ) { #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) DeleteCriticalSection( &( internal_read_write_lock->read_critical_section ) ); DeleteCriticalSection( &( internal_read_write_lock->write_critical_section ) ); #endif memory_free( internal_read_write_lock ); } return( -1 ); } /* Frees a read/write lock * Returns 1 if successful or -1 on error */ int libcthreads_read_write_lock_free( libcthreads_read_write_lock_t **read_write_lock, libcerror_error_t **error ) { libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_free"; int result = 1; #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read/write lock.", function ); return( -1 ); } if( *read_write_lock != NULL ) { internal_read_write_lock = (libcthreads_internal_read_write_lock_t *) *read_write_lock; *read_write_lock = NULL; #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) if( CloseHandle( internal_read_write_lock->no_read_event_handle ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free no read event handle.", function ); result = -1; } DeleteCriticalSection( &( internal_read_write_lock->read_critical_section ) ); DeleteCriticalSection( &( internal_read_write_lock->write_critical_section ) ); #elif defined( WINAPI ) && ( WINVER < 0x0400 ) #error libcthreads_read_write_lock_free for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_destroy( &( internal_read_write_lock->read_write_lock ) ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy read/write lock with error: Insufficient resources.", function ); result = -1; break; case EBUSY: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy read/write lock with error: Resource busy.", function ); result = -1; break; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy read/write lock.", function ); result = -1; break; } #endif memory_free( internal_read_write_lock ); } return( result ); } /* Grabs a read/write lock for reading * Returns 1 if successful or -1 on error */ int libcthreads_read_write_lock_grab_for_read( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ) { libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_grab_for_read"; #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; BOOL result = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read/write lock.", function ); return( -1 ); } internal_read_write_lock = (libcthreads_internal_read_write_lock_t *) read_write_lock; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) AcquireSRWLockShared( &( internal_read_write_lock->slim_read_write_lock ) ); #elif defined( WINAPI ) && ( WINVER >= 0x0400 ) EnterCriticalSection( &( internal_read_write_lock->write_critical_section ) ); EnterCriticalSection( &( internal_read_write_lock->read_critical_section ) ); internal_read_write_lock->number_of_readers++; if( internal_read_write_lock->number_of_readers == 1 ) { result = ResetEvent( internal_read_write_lock->no_read_event_handle ); if( result == 0 ) { error_code = GetLastError(); internal_read_write_lock->number_of_readers--; } } else { result = 1; } LeaveCriticalSection( &( internal_read_write_lock->read_critical_section ) ); LeaveCriticalSection( &( internal_read_write_lock->write_critical_section ) ); if( result == 0 ) { libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: reset of no read event failed.", function ); return( -1 ); } #elif defined( WINAPI ) #error libcthreads_read_write_lock_grab_for_read for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_rdlock( &( internal_read_write_lock->read_write_lock ) ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock read/write lock for read with error: Maximum number of locks exceeded.", function ); return( -1 ); case EDEADLK: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock read/write lock for read with error: Deadlock condition detected.", function ); return( -1 ); default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock read/write lock for read.", function ); return( -1 ); } #endif return( 1 ); } /* Grabs a read/write lock for writing * Returns 1 if successful or -1 on error */ int libcthreads_read_write_lock_grab_for_write( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ) { libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_grab_for_write"; #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; DWORD wait_status = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read/write lock.", function ); return( -1 ); } internal_read_write_lock = (libcthreads_internal_read_write_lock_t *) read_write_lock; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) AcquireSRWLockExclusive( &( internal_read_write_lock->slim_read_write_lock ) ); #elif defined( WINAPI ) && ( WINVER >= 0x0400 ) EnterCriticalSection( &( internal_read_write_lock->write_critical_section ) ); wait_status = WaitForSingleObject( internal_read_write_lock->no_read_event_handle, INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); LeaveCriticalSection( &( internal_read_write_lock->write_critical_section ) ); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: wait for no read event handle failed.", function ); return( -1 ); } #elif defined( WINAPI ) #error libcthreads_read_write_lock_grab_for_write for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_wrlock( &( internal_read_write_lock->read_write_lock ) ); switch( pthread_result ) { case 0: break; case EDEADLK: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock read/write lock for write with error: Deadlock condition detected.", function ); return( -1 ); default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock read/write lock for write.", function ); return( -1 ); } #endif return( 1 ); } /* Releases a read/write lock for reading * Returns 1 if successful or -1 on error */ int libcthreads_read_write_lock_release_for_read( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ) { libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_release_for_read"; #if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; BOOL result = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read/write lock.", function ); return( -1 ); } internal_read_write_lock = (libcthreads_internal_read_write_lock_t *) read_write_lock; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) ReleaseSRWLockShared( &( internal_read_write_lock->slim_read_write_lock ) ); #elif defined( WINAPI ) && ( WINVER >= 0x0400 ) EnterCriticalSection( &( internal_read_write_lock->read_critical_section ) ); internal_read_write_lock->number_of_readers--; if( internal_read_write_lock->number_of_readers == 0 ) { result = SetEvent( internal_read_write_lock->no_read_event_handle ); if( result == 0 ) { error_code = GetLastError(); internal_read_write_lock->number_of_readers++; } } else { result = 1; } LeaveCriticalSection( &( internal_read_write_lock->read_critical_section ) ); if( result == 0 ) { libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: set of no read event failed.", function ); return( -1 ); } #elif defined( WINAPI ) #error libcthreads_read_write_lock_release_for_read for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_unlock( &( internal_read_write_lock->read_write_lock ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to unlock read/write lock.", function ); return( -1 ); } #endif return( 1 ); } /* Releases a read/write lock for writing * Returns 1 if successful or -1 on error */ int libcthreads_read_write_lock_release_for_write( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ) { libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_release_for_write"; #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( read_write_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read/write lock.", function ); return( -1 ); } internal_read_write_lock = (libcthreads_internal_read_write_lock_t *) read_write_lock; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) ReleaseSRWLockExclusive( &( internal_read_write_lock->slim_read_write_lock ) ); #elif defined( WINAPI ) && ( WINVER >= 0x0400 ) LeaveCriticalSection( &( internal_read_write_lock->write_critical_section ) ); #elif defined( WINAPI ) #error libcthreads_read_write_lock_release_for_write for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_unlock( &( internal_read_write_lock->read_write_lock ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to unlock read/write lock.", function ); return( -1 ); } #endif return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_mutex.h0000664000175000017500000000460413443450044023501 0ustar00lordyestalordyesta00000000000000/* * Mutex functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_MUTEX_H ) #define _LIBCTHREADS_INTERNAL_MUTEX_H #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_mutex libcthreads_internal_mutex_t; struct libcthreads_internal_mutex { #if defined( WINAPI ) && ( WINVER >= 0x0600 ) /* The critical section */ CRITICAL_SECTION critical_section; #elif defined( WINAPI ) /* The mutex handle */ HANDLE mutex_handle; #elif defined( HAVE_PTHREAD_H ) /* The mutex */ pthread_mutex_t mutex; #else #error Missing mutex type #endif }; LIBCTHREADS_EXTERN \ int libcthreads_mutex_initialize( libcthreads_mutex_t **mutex, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_mutex_free( libcthreads_mutex_t **mutex, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_mutex_grab( libcthreads_mutex_t *mutex, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_mutex_try_grab( libcthreads_mutex_t *mutex, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_mutex_release( libcthreads_mutex_t *mutex, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_MUTEX_H ) */ libewf-20140807/libcthreads/libcthreads_support.h0000664000175000017500000000235013443450044024047 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_SUPPORT_H ) #define _LIBCTHREADS_SUPPORT_H #include #include #include "libcthreads_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) LIBCTHREADS_EXTERN \ const char *libcthreads_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_SUPPORT_H ) */ libewf-20140807/libcthreads/libcthreads_thread.c0000664000175000017500000002367413443450044023611 0ustar00lordyestalordyesta00000000000000/* * Thread functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_libcerror.h" #include "libcthreads_thread.h" #include "libcthreads_thread_attributes.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) #if defined( WINAPI ) /* Start function helper function for WINAPI * Returns 0 if successful or 1 on error */ DWORD WINAPI libcthreads_thread_callback_function_helper( void *arguments ) { libcthreads_internal_thread_t *internal_thread = NULL; DWORD result = 1; int callback_function_result = 0; if( arguments != NULL ) { internal_thread = (libcthreads_internal_thread_t *) arguments; if( ( internal_thread != NULL ) && ( internal_thread->callback_function != NULL ) ) { callback_function_result = internal_thread->callback_function( internal_thread->callback_function_arguments ); } result = (DWORD) ( callback_function_result != 1 ); } ExitThread( result ); } #elif defined( HAVE_PTHREAD_H ) /* Start function helper function for pthread * Returns a pointer to a newly allocated int containing 1 if successful or -1 on error * NULL is return if the helper function was unable to run the callback */ void *libcthreads_thread_callback_function_helper( void *arguments ) { libcthreads_internal_thread_t *internal_thread = NULL; int *result = NULL; if( arguments != NULL ) { internal_thread = (libcthreads_internal_thread_t *) arguments; if( ( internal_thread != NULL ) && ( internal_thread->callback_function != NULL ) ) { result = (int *) memory_allocate( sizeof( int ) ); if( result != NULL ) { *result = internal_thread->callback_function( internal_thread->callback_function_arguments ); } } } pthread_exit( (void *) result ); } #endif /* Creates a thread * Make sure the value thread is referencing, is set to NULL * * The callback_function should return 1 if successful and -1 on error * Returns 1 if successful or -1 on error */ int libcthreads_thread_create( libcthreads_thread_t **thread, const libcthreads_thread_attributes_t *thread_attributes, int (*callback_function)( void *arguments ), void *callback_function_arguments, libcerror_error_t **error ) { libcthreads_internal_thread_t *internal_thread = NULL; static char *function = "libcthreads_thread_create"; #if defined( WINAPI ) SECURITY_ATTRIBUTES *security_attributes = NULL; HANDLE thread_handle = NULL; DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) pthread_attr_t *attributes = NULL; int pthread_result = 0; #endif if( thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread.", function ); return( -1 ); } if( *thread != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid thread value already set.", function ); return( -1 ); } if( callback_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid callback function.", function ); return( -1 ); } internal_thread = memory_allocate_structure( libcthreads_internal_thread_t ); if( internal_thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create thread.", function ); goto on_error; } if( memory_set( internal_thread, 0, sizeof( libcthreads_internal_thread_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear thread.", function ); memory_free( internal_thread ); return( -1 ); } internal_thread->callback_function = callback_function; internal_thread->callback_function_arguments = callback_function_arguments; #if defined( WINAPI ) if( thread_attributes != NULL ) { security_attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->security_attributes ); } thread_handle = CreateThread( security_attributes, 0, /* stack size */ &libcthreads_thread_callback_function_helper, (void *) internal_thread, 0, /* creation flags */ &( internal_thread->thread_identifier ) ); if( thread_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create thread handle.", function ); goto on_error; } internal_thread->thread_handle = thread_handle; #elif defined( HAVE_PTHREAD_H ) if( thread_attributes != NULL ) { attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->attributes ); } pthread_result = pthread_create( &( internal_thread->thread ), attributes, &libcthreads_thread_callback_function_helper, (void *) internal_thread ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to create thread with error: Insufficient resources.", function ); goto on_error; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to create thread.", function ); goto on_error; } #endif *thread = (libcthreads_thread_t *) internal_thread; return( 1 ); on_error: if( internal_thread != NULL ) { memory_free( internal_thread ); } return( -1 ); } /* Joins the current with a specified thread * The the thread is freed after join * Returns 1 if successful or -1 on error */ int libcthreads_thread_join( libcthreads_thread_t **thread, libcerror_error_t **error ) { libcthreads_internal_thread_t *internal_thread = NULL; static char *function = "libcthreads_thread_join"; int result = 1; #if defined( WINAPI ) DWORD error_code = 0; DWORD wait_status = 0; #elif defined( HAVE_PTHREAD_H ) int *thread_return_value = NULL; int pthread_result = 0; #endif if( thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread.", function ); return( -1 ); } if( *thread == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing thread value.", function ); return( -1 ); } internal_thread = (libcthreads_internal_thread_t *) *thread; *thread = NULL; #if defined( WINAPI ) wait_status = WaitForSingleObject( internal_thread->thread_handle, INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: wait for thread failed.", function ); result = -1; } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_join( internal_thread->thread, (void **) &thread_return_value ); if( pthread_result == EDEADLK ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to join thread with error: Deadlock condition detected.", function ); result = -1; } else if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to join thread.", function ); result = -1; } /* If the thread returns NULL it never got around to launching the callback function */ else if( ( thread_return_value != NULL ) && ( *thread_return_value != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: thread returned an error status of: %d.", function, *thread_return_value ); result = -1; } if( thread_return_value != NULL ) { memory_free( thread_return_value ); thread_return_value = NULL; } #endif memory_free( internal_thread ); return( result ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_mutex.c0000664000175000017500000002632613443450044023501 0ustar00lordyestalordyesta00000000000000/* * Mutex functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_libcerror.h" #include "libcthreads_mutex.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) /* Creates a mutex * Make sure the value mutex is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcthreads_mutex_initialize( libcthreads_mutex_t **mutex, libcerror_error_t **error ) { libcthreads_internal_mutex_t *internal_mutex = NULL; static char *function = "libcthreads_mutex_initialize"; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mutex.", function ); return( -1 ); } if( *mutex != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid mutex value already set.", function ); return( -1 ); } internal_mutex = memory_allocate_structure( libcthreads_internal_mutex_t ); if( internal_mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create mutex.", function ); goto on_error; } if( memory_set( internal_mutex, 0, sizeof( libcthreads_internal_mutex_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear mutex.", function ); memory_free( internal_mutex ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0600 ) InitializeCriticalSection( &( internal_mutex->critical_section ) ); #elif defined( WINAPI ) internal_mutex->mutex_handle = CreateMutex( NULL, FALSE, NULL ); if( internal_mutex->mutex_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize mutex handle.", function ); goto on_error; } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_init( &( internal_mutex->mutex ), NULL ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize mutex.", function ); goto on_error; } #endif *mutex = (libcthreads_mutex_t *) internal_mutex; return( 1 ); on_error: if( internal_mutex != NULL ) { memory_free( internal_mutex ); } return( -1 ); } /* Frees a mutex * Returns 1 if successful or -1 on error */ int libcthreads_mutex_free( libcthreads_mutex_t **mutex, libcerror_error_t **error ) { libcthreads_internal_mutex_t *internal_mutex = NULL; static char *function = "libcthreads_mutex_free"; int result = 1; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mutex.", function ); return( -1 ); } if( *mutex != NULL ) { internal_mutex = (libcthreads_internal_mutex_t *) *mutex; *mutex = NULL; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) DeleteCriticalSection( &( internal_mutex->critical_section ) ); #elif defined( WINAPI ) if( CloseHandle( internal_mutex->mutex_handle ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free mutex handle.", function ); result = -1; } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_destroy( &( internal_mutex->mutex ) ); if( pthread_result != 0 ) { switch( pthread_result ) { case EBUSY: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy mutex with error: Resource busy.", function ); break; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy mutex.", function ); break; } result = -1; } #endif memory_free( internal_mutex ); } return( result ); } /* Grabs a mutex * Returns 1 if successful or -1 on error */ int libcthreads_mutex_grab( libcthreads_mutex_t *mutex, libcerror_error_t **error ) { libcthreads_internal_mutex_t *internal_mutex = NULL; static char *function = "libcthreads_mutex_grab"; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; DWORD wait_status = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mutex.", function ); return( -1 ); } internal_mutex = (libcthreads_internal_mutex_t *) mutex; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) EnterCriticalSection( &( internal_mutex->critical_section ) ); #elif defined( WINAPI ) wait_status = WaitForSingleObject( internal_mutex->mutex_handle, INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: wait for mutex handle failed.", function ); return( -1 ); } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_lock( &( internal_mutex->mutex ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to lock mutex.", function ); return( -1 ); } #endif return( 1 ); } /* Tries to grabs a mutex * Returns 1 if successful, 0 if not or -1 on error */ int libcthreads_mutex_try_grab( libcthreads_mutex_t *mutex, libcerror_error_t **error ) { libcthreads_internal_mutex_t *internal_mutex = NULL; static char *function = "libcthreads_mutex_try_grab"; int result = 1; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; DWORD wait_status = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mutex.", function ); return( -1 ); } internal_mutex = (libcthreads_internal_mutex_t *) mutex; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) if( TryEnterCriticalSection( &( internal_mutex->critical_section ) ) != 0 ) { result = 1; } else { result = 0; } #elif defined( WINAPI ) wait_status = WaitForSingleObject( internal_mutex->mutex_handle, 0 ); if( wait_status == WAIT_TIMEOUT ) { result = 0; } else if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: wait for mutex handle failed.", function ); return( -1 ); } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_trylock( &( internal_mutex->mutex ) ); if( pthread_result == EBUSY ) { result = 0; } else if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to lock mutex.", function ); return( -1 ); } #endif return( result ); } /* Releases a mutex * Returns 1 if successful or -1 on error */ int libcthreads_mutex_release( libcthreads_mutex_t *mutex, libcerror_error_t **error ) { libcthreads_internal_mutex_t *internal_mutex = NULL; static char *function = "libcthreads_mutex_release"; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; BOOL result = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mutex.", function ); return( -1 ); } internal_mutex = (libcthreads_internal_mutex_t *) mutex; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) LeaveCriticalSection( &( internal_mutex->critical_section ) ); #elif defined( WINAPI ) result = ReleaseMutex( internal_mutex->mutex_handle ); if( result == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to relates mutex handle.", function ); return( -1 ); } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_unlock( &( internal_mutex->mutex ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to unlock mutex.", function ); return( -1 ); } #endif return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_types.h0000664000175000017500000000472013443450044023502 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_TYPES_H ) #define _LIBCTHREADS_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads * The definitions in are copied here * for local use of libcthreads */ #if defined( HAVE_LOCAL_LIBCTHREADS ) && defined( HAVE_MULTI_THREAD_SUPPORT ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libcthreads_condition {} libcthreads_condition_t; typedef struct libcthreads_lock {} libcthreads_lock_t; typedef struct libcthreads_mutex {} libcthreads_mutex_t; typedef struct libcthreads_queue {} libcthreads_queue_t; typedef struct libcthreads_read_write_lock {} libcthreads_read_write_lock_t; typedef struct libcthreads_repeating_thread {} libcthreads_repeating_thread_t; typedef struct libcthreads_thread {} libcthreads_thread_t; typedef struct libcthreads_thread_attributes {} libcthreads_thread_attributes_t; typedef struct libcthreads_thread_pool {} libcthreads_thread_pool_t; #else typedef intptr_t libcthreads_condition_t; typedef intptr_t libcthreads_lock_t; typedef intptr_t libcthreads_mutex_t; typedef intptr_t libcthreads_queue_t; typedef intptr_t libcthreads_read_write_lock_t; typedef intptr_t libcthreads_repeating_thread_t; typedef intptr_t libcthreads_thread_t; typedef intptr_t libcthreads_thread_attributes_t; typedef intptr_t libcthreads_thread_pool_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBCTHREADS ) && defined( HAVE_MULTI_THREAD_SUPPORT ) */ #endif /* !defined( _LIBCTHREADS_INTERNAL_TYPES_H ) */ libewf-20140807/libcthreads/libcthreads_lock.h0000664000175000017500000000424213443450044023265 0ustar00lordyestalordyesta00000000000000/* * Lock functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_LOCK_H ) #define _LIBCTHREADS_INTERNAL_LOCK_H #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_lock libcthreads_internal_lock_t; struct libcthreads_internal_lock { #if defined( WINAPI ) /* The critical section */ CRITICAL_SECTION critical_section; #elif defined( HAVE_PTHREAD_H ) /* The mutex */ pthread_mutex_t mutex; #else #error Missing lock type #endif }; LIBCTHREADS_EXTERN \ int libcthreads_lock_initialize( libcthreads_lock_t **lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_lock_free( libcthreads_lock_t **lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_lock_grab( const libcthreads_lock_t *lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_lock_release( const libcthreads_lock_t *lock, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_LOCK_H ) */ libewf-20140807/libcthreads/libcthreads_extern.h0000664000175000017500000000275513443450044023651 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_EXTERN_H ) #define _LIBCTHREADS_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads */ #if !defined( HAVE_LOCAL_LIBCTHREADS ) /* If libtool DLL support is enabled set LIBCTHREADS_DLL_EXPORT * before including libcthreads/extern.h */ #if defined( _WIN32 ) && defined( DLL_EXPORT ) #define LIBCTHREADS_DLL_EXPORT #endif #include #define LIBCTHREADS_EXTERN_VARIABLE LIBCTHREADS_EXTERN #else #define LIBCTHREADS_EXTERN /* extern */ #define LIBCTHREADS_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) */ #endif /* !defined( _LIBCTHREADS_INTERNAL_EXTERN_H ) */ libewf-20140807/libcthreads/libcthreads_error.h0000664000175000017500000000351213443450044023465 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_ERROR_H ) #define _LIBCTHREADS_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBCTHREADS ) #include #endif #include "libcthreads_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) LIBCTHREADS_EXTERN \ void libcthreads_error_free( libcthreads_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_error_fprint( libcthreads_error_t *error, FILE *stream ); LIBCTHREADS_EXTERN \ int libcthreads_error_sprint( libcthreads_error_t *error, char *string, size_t size ); LIBCTHREADS_EXTERN \ int libcthreads_error_backtrace_fprint( libcthreads_error_t *error, FILE *stream ); LIBCTHREADS_EXTERN \ int libcthreads_error_backtrace_sprint( libcthreads_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_ERROR_H ) */ libewf-20140807/libcthreads/libcthreads_queue.c0000664000175000017500000006355713443450044023472 0ustar00lordyestalordyesta00000000000000/* * Queue functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include "libcthreads_condition.h" #include "libcthreads_definitions.h" #include "libcthreads_libcerror.h" #include "libcthreads_mutex.h" #include "libcthreads_queue.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) /* Creates a queue * Make sure the value queue is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcthreads_queue_initialize( libcthreads_queue_t **queue, int maximum_number_of_values, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_initialize"; size_t values_array_size = 0; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } if( *queue != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid queue value already set.", function ); return( -1 ); } if( maximum_number_of_values < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid maximum number of values value less than zero.", function ); return( -1 ); } #if SIZEOF_INT <= SIZEOF_SIZE_T if( (size_t) maximum_number_of_values > (size_t) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #else if( maximum_number_of_values > (int) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum number of values value exceeds maximum.", function ); return( -1 ); } values_array_size = sizeof( intptr_t * ) * maximum_number_of_values; if( values_array_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid values array size value exceeds maximum.", function ); goto on_error; } internal_queue = memory_allocate_structure( libcthreads_internal_queue_t ); if( internal_queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create queue.", function ); goto on_error; } if( memory_set( internal_queue, 0, sizeof( libcthreads_internal_queue_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear queue.", function ); memory_free( internal_queue ); return( -1 ); } internal_queue->values_array = (intptr_t **) memory_allocate( values_array_size ); if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create values array.", function ); goto on_error; } if( memory_set( internal_queue->values_array, 0, values_array_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear values array.", function ); goto on_error; } internal_queue->allocated_number_of_values = maximum_number_of_values; if( libcthreads_mutex_initialize( &( internal_queue->condition_mutex ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create condition mutex.", function ); goto on_error; } if( libcthreads_condition_initialize( &( internal_queue->empty_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create empty condition.", function ); goto on_error; } if( libcthreads_condition_initialize( &( internal_queue->full_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create full condition.", function ); goto on_error; } *queue = (libcthreads_queue_t *) internal_queue; return( 1 ); on_error: if( internal_queue != NULL ) { if( internal_queue->empty_condition != NULL ) { libcthreads_condition_free( &( internal_queue->empty_condition ), NULL ); } if( internal_queue->condition_mutex != NULL ) { libcthreads_mutex_free( &( internal_queue->condition_mutex ), NULL ); } if( internal_queue->values_array != NULL ) { memory_free( internal_queue->values_array ); } memory_free( internal_queue ); } return( -1 ); } /* Frees a queue * Uses the value_free_function to free the value * Returns 1 if successful or -1 on error */ int libcthreads_queue_free( libcthreads_queue_t **queue, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_free"; int result = 1; int value_index = 0; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } if( *queue != NULL ) { internal_queue = (libcthreads_internal_queue_t *) *queue; *queue = NULL; if( value_free_function != NULL ) { for( value_index = 0; value_index < internal_queue->number_of_values; value_index++ ) { if( value_free_function( &( internal_queue->values_array[ value_index ] ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value: %d.", function, value_index ); result = -1; } } } memory_free( internal_queue->values_array ); if( libcthreads_condition_free( &( internal_queue->full_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free full condition.", function ); result = -1; } if( libcthreads_condition_free( &( internal_queue->empty_condition ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free empty condition.", function ); result = -1; } if( libcthreads_mutex_free( &( internal_queue->condition_mutex ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free condition mutex.", function ); result = -1; } memory_free( internal_queue ); } return( result ); } /* Empties a queue * Returns 1 if successful or -1 on error */ int libcthreads_queue_empty( libcthreads_queue_t *queue, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_empty"; int result = 1; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } internal_queue = (libcthreads_internal_queue_t *) queue; if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_queue->number_of_values != 0 ) { if( libcthreads_condition_wait( internal_queue->full_condition, internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for full condition.", function ); goto on_error; } } if( libcthreads_mutex_release( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( result ); on_error: libcthreads_mutex_release( internal_queue->condition_mutex, NULL ); return( -1 ); } /* Tries to pop a value off the queue * Returns 1 if successful, 0 if not or -1 on error */ int libcthreads_queue_try_pop( libcthreads_queue_t *queue, intptr_t **value, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_try_pop"; int result = 1; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } internal_queue = (libcthreads_internal_queue_t *) queue; if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } if( internal_queue->number_of_values == 0 ) { result = 0; } else { *value = internal_queue->values_array[ internal_queue->pop_index ]; internal_queue->pop_index++; if( internal_queue->pop_index >= internal_queue->allocated_number_of_values ) { internal_queue->pop_index = 0; } internal_queue->number_of_values--; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_queue->full_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast full condition.", function ); goto on_error; } } if( libcthreads_mutex_release( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( result ); on_error: libcthreads_mutex_release( internal_queue->condition_mutex, NULL ); return( -1 ); } /* Pops a value off the queue * Returns 1 if successful or -1 on error */ int libcthreads_queue_pop( libcthreads_queue_t *queue, intptr_t **value, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_pop"; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } internal_queue = (libcthreads_internal_queue_t *) queue; if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_queue->number_of_values == 0 ) { if( libcthreads_condition_wait( internal_queue->empty_condition, internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for empty condition.", function ); goto on_error; } } *value = internal_queue->values_array[ internal_queue->pop_index ]; internal_queue->pop_index++; if( internal_queue->pop_index >= internal_queue->allocated_number_of_values ) { internal_queue->pop_index = 0; } internal_queue->number_of_values--; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_queue->full_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast full condition.", function ); goto on_error; } if( libcthreads_mutex_release( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( 1 ); on_error: libcthreads_mutex_release( internal_queue->condition_mutex, NULL ); return( -1 ); } /* Tries to push a value onto the queue * Returns 1 if successful, 0 if not or -1 on error */ int libcthreads_queue_try_push( libcthreads_queue_t *queue, intptr_t *value, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_try_push"; int result = 1; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } internal_queue = (libcthreads_internal_queue_t *) queue; if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } if( internal_queue->number_of_values == internal_queue->allocated_number_of_values ) { result = 0; } else { internal_queue->values_array[ internal_queue->push_index ] = value; internal_queue->push_index++; if( internal_queue->push_index >= internal_queue->allocated_number_of_values ) { internal_queue->push_index = 0; } internal_queue->number_of_values++; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_queue->empty_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast empty condition.", function ); goto on_error; } } if( libcthreads_mutex_release( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( result ); on_error: libcthreads_mutex_release( internal_queue->condition_mutex, NULL ); return( -1 ); } /* Pushes a value onto the queue * Returns 1 if successful or -1 on error */ int libcthreads_queue_push( libcthreads_queue_t *queue, intptr_t *value, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_push"; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } internal_queue = (libcthreads_internal_queue_t *) queue; if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( libcthreads_mutex_grab( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_queue->number_of_values == internal_queue->allocated_number_of_values ) { if( libcthreads_condition_wait( internal_queue->full_condition, internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for full condition.", function ); goto on_error; } } internal_queue->values_array[ internal_queue->push_index ] = value; internal_queue->push_index++; if( internal_queue->push_index >= internal_queue->allocated_number_of_values ) { internal_queue->push_index = 0; } internal_queue->number_of_values++; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_queue->empty_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast empty condition.", function ); goto on_error; } if( libcthreads_mutex_release( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( 1 ); on_error: libcthreads_mutex_release( internal_queue->condition_mutex, NULL ); return( -1 ); } /* Pushes a value onto the queue in sorted order * * Uses the value_compare_function to determine the similarity of the values * The value_compare_function should return LIBCTHREADS_COMPARE_LESS, * LIBCTHREADS_COMPARE_EQUAL, LIBCTHREADS_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if the value already exists or -1 on error */ int libcthreads_queue_push_sorted( libcthreads_queue_t *queue, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t sort_flags, libcerror_error_t **error ) { libcthreads_internal_queue_t *internal_queue = NULL; static char *function = "libcthreads_queue_push_sorted"; int compare_result = 0; int pop_index = 0; int previous_push_index = 0; int push_index = 0; int result = 1; int value_index = 0; if( queue == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid queue.", function ); return( -1 ); } internal_queue = (libcthreads_internal_queue_t *) queue; if( internal_queue->values_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid queue - missing values array.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( ( sort_flags & ~( LIBCTHREADS_SORT_FLAG_UNIQUE_VALUES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported sort flags: 0x%02" PRIx8 ".", function, sort_flags ); return( -1 ); } if( libcthreads_mutex_grab( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab condition mutex.", function ); return( -1 ); } while( internal_queue->number_of_values == internal_queue->allocated_number_of_values ) { if( libcthreads_condition_wait( internal_queue->full_condition, internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to wait for full condition.", function ); goto on_error; } } pop_index = internal_queue->pop_index; for( value_index = 0; value_index < internal_queue->number_of_values; value_index++ ) { compare_result = value_compare_function( value, internal_queue->values_array[ pop_index ], error ); if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare value: %d.", function, value_index ); goto on_error; } else if( compare_result == LIBCTHREADS_COMPARE_EQUAL ) { if( ( sort_flags & LIBCTHREADS_SORT_FLAG_UNIQUE_VALUES ) != 0 ) { result = 0; break; } } else if( compare_result == LIBCTHREADS_COMPARE_LESS ) { result = 1; break; } else if( compare_result != LIBCTHREADS_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, compare_result ); goto on_error; } pop_index++; if( pop_index >= internal_queue->allocated_number_of_values ) { pop_index = 0; } } if( result != 0 ) { push_index = internal_queue->push_index; if( compare_result == LIBCTHREADS_COMPARE_LESS ) { previous_push_index = push_index - 1; while( push_index != pop_index ) { if( previous_push_index < 0 ) { previous_push_index = internal_queue->allocated_number_of_values - 1; } internal_queue->values_array[ push_index ] = internal_queue->values_array[ previous_push_index ]; push_index = previous_push_index; previous_push_index--; } } internal_queue->values_array[ push_index ] = value; internal_queue->push_index++; if( internal_queue->push_index >= internal_queue->allocated_number_of_values ) { internal_queue->push_index = 0; } internal_queue->number_of_values++; /* The condition broadcast must be protected by the mutex for the WINAPI version */ if( libcthreads_condition_broadcast( internal_queue->empty_condition, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast empty condition.", function ); goto on_error; } } if( libcthreads_mutex_release( internal_queue->condition_mutex, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release condition mutex.", function ); return( -1 ); } return( result ); on_error: libcthreads_mutex_release( internal_queue->condition_mutex, NULL ); return( -1 ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_condition.c0000664000175000017500000004347013443450044024324 0ustar00lordyestalordyesta00000000000000/* * Condition functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_condition.h" #include "libcthreads_libcerror.h" #include "libcthreads_mutex.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) /* Creates a condition * Make sure the value condition is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcthreads_condition_initialize( libcthreads_condition_t **condition, libcerror_error_t **error ) { libcthreads_internal_condition_t *internal_condition = NULL; static char *function = "libcthreads_condition_initialize"; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( condition == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid condition.", function ); return( -1 ); } if( *condition != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid condition value already set.", function ); return( -1 ); } internal_condition = memory_allocate_structure( libcthreads_internal_condition_t ); if( internal_condition == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create condition.", function ); goto on_error; } if( memory_set( internal_condition, 0, sizeof( libcthreads_internal_condition_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear condition.", function ); memory_free( internal_condition ); return( -1 ); } #if defined( WINAPI ) && ( WINVER >= 0x0600 ) InitializeConditionVariable( &( internal_condition->condition_variable ) ); #elif defined( WINAPI ) InitializeCriticalSection( &( internal_condition->wait_critical_section ) ); internal_condition->signal_semaphore_handle = CreateSemaphore ( NULL, 0, INT_MAX, NULL ); if( internal_condition->signal_semaphore_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize signal semaphore handle.", function ); goto on_error; } internal_condition->signal_event_handle = CreateEvent ( NULL, FALSE, FALSE, NULL ); if( internal_condition->signal_event_handle == NULL ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize signal event handle.", function ); goto on_error; } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_cond_init( &( internal_condition->condition ), NULL ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to initialize condition with error: Insufficient resources.", function ); goto on_error; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to initialize condition.", function ); goto on_error; } #endif *condition = (libcthreads_condition_t *) internal_condition; return( 1 ); on_error: if( internal_condition != NULL ) { #if defined( WINAPI ) && ( WINVER < 0x0600 ) if( internal_condition->signal_semaphore_handle != NULL ) { CloseHandle( internal_condition->signal_semaphore_handle ); } DeleteCriticalSection( &( internal_condition->wait_critical_section ) ); #endif memory_free( internal_condition ); } return( -1 ); } /* Frees a condition * Returns 1 if successful or -1 on error */ int libcthreads_condition_free( libcthreads_condition_t **condition, libcerror_error_t **error ) { libcthreads_internal_condition_t *internal_condition = NULL; static char *function = "libcthreads_condition_free"; int result = 1; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( condition == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid condition.", function ); return( -1 ); } if( *condition != NULL ) { internal_condition = (libcthreads_internal_condition_t *) *condition; *condition = NULL; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) #elif defined( WINAPI ) if( CloseHandle( internal_condition->signal_event_handle ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free signal event handle.", function ); result = -1; } if( CloseHandle( internal_condition->signal_semaphore_handle ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free signal semaphore handle.", function ); result = -1; } DeleteCriticalSection( &( internal_condition->wait_critical_section ) ); #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_cond_destroy( &( internal_condition->condition ) ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy condition with error: Insufficient resources.", function ); result = -1; break; case EBUSY: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy condition with error: Resource busy.", function ); result = -1; break; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy condition.", function ); result = -1; break; } #endif memory_free( internal_condition ); } return( result ); } /* Broadcasts a condition * The of this function must be locked by the same mutex as used to wait * This is necessary for the WINAPI pre Vista (0x0600) implementation * Returns 1 if successful or -1 on error */ int libcthreads_condition_broadcast( libcthreads_condition_t *condition, libcerror_error_t **error ) { libcthreads_internal_condition_t *internal_condition = NULL; static char *function = "libcthreads_condition_broadcast"; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; DWORD wait_status = 0; BOOL result = 1; int number_of_waiting_threads = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( condition == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid condition.", function ); return( -1 ); } internal_condition = (libcthreads_internal_condition_t *) condition; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) WakeAllConditionVariable( &( internal_condition->condition_variable ) ); #elif defined( WINAPI ) EnterCriticalSection( &( internal_condition->wait_critical_section ) ); number_of_waiting_threads = internal_condition->number_of_waiting_threads; if( number_of_waiting_threads > 0 ) { internal_condition->signal_is_broadcast = 1; result = ReleaseSemaphore( internal_condition->signal_semaphore_handle, number_of_waiting_threads, 0 ); if( result == 0 ) { error_code = GetLastError(); internal_condition->signal_is_broadcast = 0; } } LeaveCriticalSection( &( internal_condition->wait_critical_section ) ); if( result == 0 ) { libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release signal semaphore handle.", function ); return( -1 ); } if( number_of_waiting_threads > 0 ) { wait_status = WaitForSingleObject( internal_condition->signal_event_handle, INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); internal_condition->signal_is_broadcast = 0; libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: wait for no read event handle failed.", function ); return( -1 ); } internal_condition->signal_is_broadcast = 0; } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_cond_broadcast( &( internal_condition->condition ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to broadcast condition.", function ); return( -1 ); } #endif return( 1 ); } /* Signals a condition * The of this function must be locked by the same mutex as used to wait * This is necessary for the WINAPI pre Vista (0x0600) implementation * Returns 1 if successful or -1 on error */ int libcthreads_condition_signal( libcthreads_condition_t *condition, libcerror_error_t **error ) { libcthreads_internal_condition_t *internal_condition = NULL; static char *function = "libcthreads_condition_signal"; #if defined( WINAPI ) && ( WINVER < 0x0600 ) DWORD error_code = 0; BOOL result = 1; int number_of_waiting_threads = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( condition == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid condition.", function ); return( -1 ); } internal_condition = (libcthreads_internal_condition_t *) condition; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) WakeConditionVariable( &( internal_condition->condition_variable ) ); #elif defined( WINAPI ) EnterCriticalSection( &( internal_condition->wait_critical_section ) ); number_of_waiting_threads = internal_condition->number_of_waiting_threads; LeaveCriticalSection( &( internal_condition->wait_critical_section ) ); if( number_of_waiting_threads > 0 ) { result = ReleaseSemaphore( internal_condition->signal_semaphore_handle, 1, 0 ); if( result == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release signal semaphore handle.", function ); return( -1 ); } } #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_cond_signal( &( internal_condition->condition ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal condition.", function ); return( -1 ); } #endif return( 1 ); } /* Waits for a condition * Returns 1 if successful or -1 on error */ int libcthreads_condition_wait( libcthreads_condition_t *condition, libcthreads_mutex_t *mutex, libcerror_error_t **error ) { libcthreads_internal_condition_t *internal_condition = NULL; libcthreads_internal_mutex_t *internal_mutex = NULL; static char *function = "libcthreads_condition_wait"; #if defined( WINAPI ) DWORD error_code = 0; DWORD wait_status = 0; #if ( WINVER >= 0x0600 ) BOOL result = 0; #else int is_last_waiting_thread = 0; #endif #elif defined( HAVE_PTHREAD_H ) int pthread_result = 0; #endif if( condition == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid condition.", function ); return( -1 ); } internal_condition = (libcthreads_internal_condition_t *) condition; if( mutex == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mutex.", function ); return( -1 ); } internal_mutex = (libcthreads_internal_mutex_t *) mutex; #if defined( WINAPI ) && ( WINVER >= 0x0600 ) result = SleepConditionVariableCS( &( internal_condition->condition_variable ), &( internal_mutex->critical_section ), INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to sleep on condition variable.", function ); return( -1 ); } #elif defined( WINAPI ) && ( WINVER >= 0x0400 ) EnterCriticalSection( &( internal_condition->wait_critical_section ) ); internal_condition->number_of_waiting_threads++; LeaveCriticalSection( &( internal_condition->wait_critical_section ) ); wait_status = SignalObjectAndWait( internal_mutex->mutex_handle, internal_condition->signal_semaphore_handle, INFINITE, FALSE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable signal mutex handle and wait for signal semaphore handle.", function ); return( -1 ); } EnterCriticalSection( &( internal_condition->wait_critical_section ) ); internal_condition->number_of_waiting_threads--; if( ( internal_condition->number_of_waiting_threads == 0 ) && ( internal_condition->signal_is_broadcast != 0 ) ) { is_last_waiting_thread = 1; } LeaveCriticalSection( &( internal_condition->wait_critical_section ) ); if( is_last_waiting_thread != 0 ) { wait_status = SignalObjectAndWait( internal_condition->signal_event_handle, internal_mutex->mutex_handle, INFINITE, FALSE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to signal signal event handle and wait for mutex handle.", function ); return( -1 ); } } else { wait_status = WaitForSingleObject( internal_mutex->mutex_handle, INFINITE ); if( wait_status == WAIT_FAILED ) { error_code = GetLastError(); libcerror_system_set_error( error, error_code, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: wait for mutex handle failed.", function ); return( -1 ); } } #elif defined( WINAPI ) #error libcthreads_condition_wait for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_cond_wait( &( internal_condition->condition ), &( internal_mutex->mutex ) ); if( pthread_result != 0 ) { libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to wait for condition.", function ); return( -1 ); } #endif return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/Makefile.in0000664000175000017500000010701513443455347021702 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcthreads ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcthreads_la_LIBADD = am__libcthreads_la_SOURCES_DIST = libcthreads_condition.c \ libcthreads_condition.h libcthreads_definitions.h \ libcthreads_error.c libcthreads_error.h libcthreads_extern.h \ libcthreads_libcerror.h libcthreads_lock.c libcthreads_lock.h \ libcthreads_mutex.c libcthreads_mutex.h libcthreads_queue.c \ libcthreads_queue.h libcthreads_read_write_lock.c \ libcthreads_read_write_lock.h libcthreads_repeating_thread.c \ libcthreads_repeating_thread.h libcthreads_support.c \ libcthreads_support.h libcthreads_thread.c \ libcthreads_thread.h libcthreads_thread_attributes.c \ libcthreads_thread_attributes.h libcthreads_thread_pool.c \ libcthreads_thread_pool.h libcthreads_types.h \ libcthreads_unused.h @HAVE_LOCAL_LIBCTHREADS_TRUE@am_libcthreads_la_OBJECTS = \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_condition.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_error.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_lock.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_mutex.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_queue.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_read_write_lock.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_repeating_thread.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_support.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_thread.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_thread_attributes.lo \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_thread_pool.lo libcthreads_la_OBJECTS = $(am_libcthreads_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCTHREADS_TRUE@am_libcthreads_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcthreads_condition.Plo \ ./$(DEPDIR)/libcthreads_error.Plo \ ./$(DEPDIR)/libcthreads_lock.Plo \ ./$(DEPDIR)/libcthreads_mutex.Plo \ ./$(DEPDIR)/libcthreads_queue.Plo \ ./$(DEPDIR)/libcthreads_read_write_lock.Plo \ ./$(DEPDIR)/libcthreads_repeating_thread.Plo \ ./$(DEPDIR)/libcthreads_support.Plo \ ./$(DEPDIR)/libcthreads_thread.Plo \ ./$(DEPDIR)/libcthreads_thread_attributes.Plo \ ./$(DEPDIR)/libcthreads_thread_pool.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcthreads_la_SOURCES) DIST_SOURCES = $(am__libcthreads_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCTHREADS_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBCTHREADS_TRUE@noinst_LTLIBRARIES = libcthreads.la @HAVE_LOCAL_LIBCTHREADS_TRUE@libcthreads_la_SOURCES = \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_condition.c libcthreads_condition.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_definitions.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_error.c libcthreads_error.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_extern.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_libcerror.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_lock.c libcthreads_lock.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_mutex.c libcthreads_mutex.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_queue.c libcthreads_queue.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_read_write_lock.c libcthreads_read_write_lock.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_repeating_thread.c libcthreads_repeating_thread.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_support.c libcthreads_support.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_thread.c libcthreads_thread.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_thread_attributes.c libcthreads_thread_attributes.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_thread_pool.c libcthreads_thread_pool.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_types.h \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ libcthreads_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcthreads/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcthreads/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcthreads.la: $(libcthreads_la_OBJECTS) $(libcthreads_la_DEPENDENCIES) $(EXTRA_libcthreads_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcthreads_la_rpath) $(libcthreads_la_OBJECTS) $(libcthreads_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_condition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_lock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_mutex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_queue.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_read_write_lock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_repeating_thread.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_thread.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_thread_attributes.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcthreads_thread_pool.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcthreads_condition.Plo -rm -f ./$(DEPDIR)/libcthreads_error.Plo -rm -f ./$(DEPDIR)/libcthreads_lock.Plo -rm -f ./$(DEPDIR)/libcthreads_mutex.Plo -rm -f ./$(DEPDIR)/libcthreads_queue.Plo -rm -f ./$(DEPDIR)/libcthreads_read_write_lock.Plo -rm -f ./$(DEPDIR)/libcthreads_repeating_thread.Plo -rm -f ./$(DEPDIR)/libcthreads_support.Plo -rm -f ./$(DEPDIR)/libcthreads_thread.Plo -rm -f ./$(DEPDIR)/libcthreads_thread_attributes.Plo -rm -f ./$(DEPDIR)/libcthreads_thread_pool.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcthreads ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcthreads_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcthreads/libcthreads_thread_attributes.c0000664000175000017500000001000213443450044026034 0ustar00lordyestalordyesta00000000000000/* * Thread attributes functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_libcerror.h" #include "libcthreads_thread_attributes.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) /* Creates thread attributes * Make sure the value thread_attributes is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcthreads_thread_attributes_initialize( libcthreads_thread_attributes_t **thread_attributes, libcerror_error_t **error ) { libcthreads_internal_thread_attributes_t *internal_thread_attributes = NULL; static char *function = "libcthreads_thread_attributes_initialize"; if( thread_attributes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread attributes.", function ); return( -1 ); } if( *thread_attributes != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid thread attributes value already set.", function ); return( -1 ); } internal_thread_attributes = memory_allocate_structure( libcthreads_internal_thread_attributes_t ); if( internal_thread_attributes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create thread attributes.", function ); goto on_error; } if( memory_set( internal_thread_attributes, 0, sizeof( libcthreads_internal_thread_attributes_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear thread attributes.", function ); memory_free( internal_thread_attributes ); return( -1 ); } /* TODO */ *thread_attributes = (libcthreads_thread_attributes_t *) internal_thread_attributes; return( 1 ); on_error: if( internal_thread_attributes != NULL ) { memory_free( internal_thread_attributes ); } return( -1 ); } /* Frees thread attributes * Returns 1 if successful or -1 on error */ int libcthreads_thread_attributes_free( libcthreads_thread_attributes_t **thread_attributes, libcerror_error_t **error ) { libcthreads_internal_thread_attributes_t *internal_thread_attributes = NULL; static char *function = "libcthreads_thread_attributes_free"; int result = 1; if( thread_attributes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid thread attributes.", function ); return( -1 ); } if( *thread_attributes != NULL ) { internal_thread_attributes = (libcthreads_internal_thread_attributes_t *) *thread_attributes; *thread_attributes = NULL; /* TODO */ memory_free( internal_thread_attributes ); } return( result ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_libcerror.h0000664000175000017500000000265113443450044024322 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_LIBCERROR_H ) #define _LIBCTHREADS_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCTHREADS_LIBCERROR_H ) */ libewf-20140807/libcthreads/libcthreads_lock.c0000664000175000017500000002106113443450044023256 0ustar00lordyestalordyesta00000000000000/* * Lock functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_libcerror.h" #include "libcthreads_lock.h" #include "libcthreads_types.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) /* Creates a lock * Make sure the value lock is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcthreads_lock_initialize( libcthreads_lock_t **lock, libcerror_error_t **error ) { libcthreads_internal_lock_t *internal_lock = NULL; static char *function = "libcthreads_lock_initialize"; #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lock.", function ); return( -1 ); } if( *lock != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid lock value already set.", function ); return( -1 ); } internal_lock = memory_allocate_structure( libcthreads_internal_lock_t ); if( internal_lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create lock.", function ); goto on_error; } if( memory_set( internal_lock, 0, sizeof( libcthreads_internal_lock_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear lock.", function ); memory_free( internal_lock ); return( -1 ); } #if defined( WINAPI ) InitializeCriticalSection( &( internal_lock->critical_section ) ); #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_init( &( internal_lock->mutex ), NULL ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to initialize mutex with error: Insufficient resources.", function ); goto on_error; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to initialize mutex.", function ); goto on_error; } #endif *lock = (libcthreads_lock_t *) internal_lock; return( 1 ); on_error: if( internal_lock != NULL ) { memory_free( internal_lock ); } return( -1 ); } /* Frees a lock * Returns 1 if successful or -1 on error */ int libcthreads_lock_free( libcthreads_lock_t **lock, libcerror_error_t **error ) { libcthreads_internal_lock_t *internal_lock = NULL; static char *function = "libcthreads_lock_free"; int result = 1; #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lock.", function ); return( -1 ); } if( *lock != NULL ) { internal_lock = (libcthreads_internal_lock_t *) *lock; *lock = NULL; #if defined( WINAPI ) DeleteCriticalSection( &( internal_lock->critical_section ) ); #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_destroy( &( internal_lock->mutex ) ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy mutex with error: Insufficient resources.", function ); result = -1; break; case EBUSY: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy mutex with error: Resource busy.", function ); result = -1; break; default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to destroy mutex.", function ); result = -1; break; } #endif memory_free( internal_lock ); } return( result ); } /* Grabs a lock * Returns 1 if successful or -1 on error */ int libcthreads_lock_grab( const libcthreads_lock_t *lock, libcerror_error_t **error ) { libcthreads_internal_lock_t *internal_lock = NULL; static char *function = "libcthreads_lock_grab"; #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lock.", function ); return( -1 ); } internal_lock = (libcthreads_internal_lock_t *) lock; #if defined( WINAPI ) EnterCriticalSection( &( internal_lock->critical_section ) ); #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_lock( &( internal_lock->mutex ) ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock mutex with error: Maximum number of locks exceeded.", function ); return( -1 ); case EDEADLK: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock mutex with error: Deadlock condition detected.", function ); return( -1 ); default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock mutex.", function ); return( -1 ); } #endif return( 1 ); } /* Releases a lock * Returns 1 if successful or -1 on error */ int libcthreads_lock_release( const libcthreads_lock_t *lock, libcerror_error_t **error ) { libcthreads_internal_lock_t *internal_lock = NULL; static char *function = "libcthreads_lock_release"; #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) int pthread_result = 0; #endif if( lock == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid lock.", function ); return( -1 ); } internal_lock = (libcthreads_internal_lock_t *) lock; #if defined( WINAPI ) LeaveCriticalSection( &( internal_lock->critical_section ) ); #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_mutex_unlock( &( internal_lock->mutex ) ); switch( pthread_result ) { case 0: break; case EAGAIN: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to lock mutex with error: Maximum number of locks exceeded.", function ); return( -1 ); case EDEADLK: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to unlock mutex with error: Deadlock condition detected.", function ); return( -1 ); default: libcerror_system_set_error( error, pthread_result, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to unlock mutex.", function ); return( -1 ); } #endif return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ libewf-20140807/libcthreads/libcthreads_support.c0000664000175000017500000000222413443450044024042 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2012-2018, 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 . */ #include #include #include "libcthreads_definitions.h" #include "libcthreads_support.h" #if !defined( HAVE_LOCAL_LIBCTHREADS ) /* Returns the library version as a string */ const char *libcthreads_get_version( void ) { return( (const char *) LIBCTHREADS_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) */ libewf-20140807/libcthreads/libcthreads_read_write_lock.h0000664000175000017500000000614613443450044025477 0ustar00lordyestalordyesta00000000000000/* * Read/Write lock functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_READ_WRITE_LOCK_H ) #define _LIBCTHREADS_INTERNAL_READ_WRITE_LOCK_H #include #include #if defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_read_write_lock libcthreads_internal_read_write_lock_t; struct libcthreads_internal_read_write_lock { #if defined( WINAPI ) && ( WINVER >= 0x0600 ) /* The slim read/write lock */ SRWLOCK slim_read_write_lock; #elif defined( WINAPI ) /* The read critical section */ CRITICAL_SECTION read_critical_section; /* The write critical section */ CRITICAL_SECTION write_critical_section; /* The number of readers */ int number_of_readers; /* The no read event handle */ HANDLE no_read_event_handle; #elif defined( HAVE_PTHREAD_H ) /* The read/write lock */ pthread_rwlock_t read_write_lock; #else #error Missing read/write lock type #endif }; LIBCTHREADS_EXTERN \ int libcthreads_read_write_lock_initialize( libcthreads_read_write_lock_t **read_write_lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_read_write_lock_free( libcthreads_read_write_lock_t **read_write_lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_read_write_lock_grab_for_read( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_read_write_lock_grab_for_write( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_read_write_lock_release_for_read( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_read_write_lock_release_for_write( libcthreads_read_write_lock_t *read_write_lock, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_READ_WRITE_LOCK_H ) */ libewf-20140807/libcthreads/libcthreads_thread_attributes.h0000664000175000017500000000413413443450044026052 0ustar00lordyestalordyesta00000000000000/* * Thread attributes functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_THREAD_ATTRIBUTES_H ) #define _LIBCTHREADS_THREAD_ATTRIBUTES_H #include #include #if defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) #include #endif #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_thread_attributes libcthreads_internal_thread_attributes_t; struct libcthreads_internal_thread_attributes { #if defined( WINAPI ) /* The security attributes */ SECURITY_ATTRIBUTES security_attributes; #elif defined( HAVE_PTHREAD_H ) /* The attributes */ pthread_attr_t attributes; #else #error Missing thread attributes type #endif }; LIBCTHREADS_EXTERN \ int libcthreads_thread_attributes_initialize( libcthreads_thread_attributes_t **thread_attributes, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_thread_attributes_free( libcthreads_thread_attributes_t **thread_attributes, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_THREAD_ATTRIBUTES_H ) */ libewf-20140807/libcthreads/libcthreads_queue.h0000664000175000017500000000641713443450044023467 0ustar00lordyestalordyesta00000000000000/* * Queue functions * * Copyright (C) 2012-2018, 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( _LIBCTHREADS_INTERNAL_QUEUE_H ) #define _LIBCTHREADS_INTERNAL_QUEUE_H #include #include #include "libcthreads_extern.h" #include "libcthreads_libcerror.h" #include "libcthreads_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) typedef struct libcthreads_internal_queue libcthreads_internal_queue_t; struct libcthreads_internal_queue { /* The (current) pop index */ int pop_index; /* The (current) push index */ int push_index; /* The number of values */ int number_of_values; /* The allocated number of values */ int allocated_number_of_values; /* The values array */ intptr_t **values_array; /* The condition mutex */ libcthreads_mutex_t *condition_mutex; /* The queue empty condition */ libcthreads_condition_t *empty_condition; /* The queue full condition */ libcthreads_condition_t *full_condition; }; LIBCTHREADS_EXTERN \ int libcthreads_queue_initialize( libcthreads_queue_t **queue, int maximum_number_of_values, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_free( libcthreads_queue_t **queue, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_empty( libcthreads_queue_t *queue, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_try_pop( libcthreads_queue_t *queue, intptr_t **value, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_pop( libcthreads_queue_t *queue, intptr_t **value, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_try_push( libcthreads_queue_t *queue, intptr_t *value, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_push( libcthreads_queue_t *queue, intptr_t *value, libcerror_error_t **error ); LIBCTHREADS_EXTERN \ int libcthreads_queue_push_sorted( libcthreads_queue_t *queue, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t sort_flags, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCTHREADS ) || defined( HAVE_MULTI_THREAD_SUPPORT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCTHREADS_INTERNAL_QUEUE_H ) */ libewf-20140807/AUTHORS0000664000175000017500000000406413440663046016413 0ustar00lordyestalordyesta00000000000000Acknowledgements: libewf Copyright (c) 2006-2014, Joachim Metz This code is derived from information and software contributed by: - Expert Witness Compression Format specification by Andrew Rosen (http://www.arsdata.com/SMART/whitepaper.html) - libevf from PyFlag by Michael Cohen (http://pyflag.sourceforge.net/) - Zlib for the implementation of the Zlib compression and optimized Adler32 function - OpenSSL for the implementation of the MD5 and SHA1 hash algorithm - libuuid for the implementation of GUID/UUID calculation - Wietse Venema for an example of the initial error handling code Additional credits go to: - Kees Mastwijk, Hoffmann Invesigations for writing the initial man pages. - Robert Jan Mora, Hoffmann Invesigations for testing and other contribution (http://www.hoffmannbv.nl/). - Rob Meijer, KLPD for providing libtool and header installation, and ISO8601 date string support patches/adjustments. - The OCFA team , for EWF Fuse integration. - George M. Garner Jr. for his support with the native Windows port. - Christophe Grenier for his various input and support for the SPEC file autoconf/automake integration. - Guy Voncken for his support and thorough testing of the EWF files generated by libewf and for help with the deb package support. - David Loveall for creating mount-ewf, a MacOS-X installation package and the providing for the delta segment file idea. - David Collett for providing the Python bindings (pyewf). - Simson Garfinkel for providing the MinGW compilation adjustments, Digital Forensics XML (DFXML) output for the ewftools and various input and support e.g. for autoconf/automake optimization. - Bernhard Zach , for providing a C++ 11 multi-threaded version of ewfacquirestream and proposing multiple write performance enhancements. - Several others for pointing out flaws within the product and its related documentation. Refer to the project website for more information: http://code.google.com/p/libewf/ libewf-20140807/config.sub0000755000175000017500000010707013443455347017333 0ustar00lordyestalordyesta00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-05-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Spilt fields of configuration type IFS="-" read -r field1 field2 field3 field4 <&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x$os != x ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; -*-eabi) case $basic_machine in arm*) ;; esac ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libewf-20140807/libcpath/0000775000175000017500000000000013443455445017132 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcpath/libcpath_unused.h0000664000175000017500000000254613443450040022445 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2008-2018, 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( _LIBCPATH_INTERNAL_UNUSED_H ) #define _LIBCPATH_INTERNAL_UNUSED_H #include #if !defined( LIBCPATH_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCPATH_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCPATH_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCPATH_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCPATH_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCPATH_INTERNAL_UNUSED_H ) */ libewf-20140807/libcpath/libcpath_support.c0000664000175000017500000000444213443450040022646 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include "libcpath_definitions.h" #include "libcpath_libcerror.h" #include "libcpath_libclocale.h" #include "libcpath_support.h" #if !defined( HAVE_LOCAL_LIBCPATH ) /* Returns the library version as a string */ const char *libcpath_get_version( void ) { return( (const char *) LIBCPATH_VERSION_STRING ); } /* Retrieves the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libcpath_get_codepage( int *codepage, libcerror_error_t **error ) { static char *function = "libcpath_get_codepage"; if( libclocale_codepage_get( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve codepage.", function ); return( -1 ); } return( 1 ); } /* Sets the narrow system string codepage * A value of 0 represents no codepage, UTF-8 encoding is used instead * Returns 1 if successful or -1 on error */ int libcpath_set_codepage( int codepage, libcerror_error_t **error ) { static char *function = "libcpath_set_codepage"; if( libclocale_codepage_set( codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set codepage.", function ); return( -1 ); } return( 1 ); } #endif /* !defined( HAVE_LOCAL_LIBCPATH ) */ libewf-20140807/libcpath/libcpath_libclocale.h0000664000175000017500000000266513443450040023235 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2008-2018, 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( _LIBCPATH_LIBCLOCALE_H ) #define _LIBCPATH_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _LIBCPATH_LIBCLOCALE_H ) */ libewf-20140807/libcpath/Makefile.am0000664000175000017500000000144713443450040021156 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCPATH AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ noinst_LTLIBRARIES = libcpath.la libcpath_la_SOURCES = \ libcpath_definitions.h \ libcpath_error.c libcpath_error.h \ libcpath_extern.h \ libcpath_path.c libcpath_path.h \ libcpath_libcerror.h \ libcpath_libclocale.h \ libcpath_libcsplit.h \ libcpath_libuna.h \ libcpath_support.c libcpath_support.h \ libcpath_system_string.c libcpath_system_string.h \ libcpath_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcpath ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcpath_la_SOURCES) libewf-20140807/libcpath/libcpath_error.h0000664000175000017500000000340513443450040022266 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2018, 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( _LIBCPATH_INTERNAL_ERROR_H ) #define _LIBCPATH_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBCPATH ) #include #endif #include "libcpath_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCPATH ) LIBCPATH_EXTERN \ void libcpath_error_free( libcpath_error_t **error ); LIBCPATH_EXTERN \ int libcpath_error_fprint( libcpath_error_t *error, FILE *stream ); LIBCPATH_EXTERN \ int libcpath_error_sprint( libcpath_error_t *error, char *string, size_t size ); LIBCPATH_EXTERN \ int libcpath_error_backtrace_fprint( libcpath_error_t *error, FILE *stream ); LIBCPATH_EXTERN \ int libcpath_error_backtrace_sprint( libcpath_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBCPATH ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCPATH_INTERNAL_ERROR_H ) */ libewf-20140807/libcpath/libcpath_system_string.h0000664000175000017500000000541413443450040024051 0ustar00lordyestalordyesta00000000000000/* * System string functions * * Copyright (C) 2008-2018, 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( _LIBCPATH_SYSTEM_STRING_H ) #define _LIBCPATH_SYSTEM_STRING_H #include #include #include "libcpath_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int libcpath_system_string_size_to_narrow_string( const system_character_t *system_string, size_t system_string_size, size_t *narrow_string_size, libcerror_error_t **error ); int libcpath_system_string_copy_to_narrow_string( const system_character_t *system_string, size_t system_string_size, char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ); int libcpath_system_string_size_from_narrow_string( const char *narrow_string, size_t narrow_string_size, size_t *system_string_size, libcerror_error_t **error ); int libcpath_system_string_copy_from_narrow_string( system_character_t *system_string, size_t system_string_size, const char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) int libcpath_system_string_size_to_wide_string( const system_character_t *system_string, size_t system_string_size, size_t *wide_string_size, libcerror_error_t **error ); int libcpath_system_string_copy_to_wide_string( const system_character_t *system_string, size_t system_string_size, wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ); int libcpath_system_string_size_from_wide_string( const wchar_t *wide_string, size_t wide_string_size, size_t *system_string_size, libcerror_error_t **error ); int libcpath_system_string_copy_from_wide_string( system_character_t *system_string, size_t system_string_size, const wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCPATH_SYSTEM_STRING_H ) */ libewf-20140807/libcpath/libcpath_error.c0000664000175000017500000000554013443450040022263 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #include "libcpath_error.h" #include "libcpath_libcerror.h" #if !defined( HAVE_LOCAL_LIBCPATH ) /* Free an error and its elements */ void libcpath_error_free( libcpath_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcpath_error_fprint( libcpath_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcpath_error_sprint( libcpath_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcpath_error_backtrace_fprint( libcpath_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcpath_error_backtrace_sprint( libcpath_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBCPATH ) */ libewf-20140807/libcpath/libcpath_libcsplit.h0000664000175000017500000000266413443450040023130 0ustar00lordyestalordyesta00000000000000/* * The internal libcsplit header * * Copyright (C) 2008-2018, 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( _LIBCPATH_LIBCSPLIT_H ) #define _LIBCPATH_LIBCSPLIT_H #include /* Define HAVE_LOCAL_LIBCSPLIT for local use of libcsplit */ #if defined( HAVE_LOCAL_LIBCSPLIT ) #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCSPLIT_DLL_IMPORT * before including libcsplit.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCSPLIT_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libcpath/libcpath_path.h0000664000175000017500000001600413443450040022070 0ustar00lordyestalordyesta00000000000000/* * Path functions * * Copyright (C) 2008-2018, 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( _LIBCPATH_PATH_H ) #define _LIBCPATH_PATH_H #include #include #include "libcpath_extern.h" #include "libcpath_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcpath_CloseHandle( HANDLE file_handle ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcpath_SetCurrentDirectoryA( LPCSTR path ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCPATH_EXTERN \ int libcpath_path_change_directory( const char *directory_name, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) DWORD libcpath_GetCurrentDirectoryA( DWORD buffer_size, LPCSTR buffer ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCPATH_EXTERN \ int libcpath_path_get_current_working_directory( char **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ); #if defined( WINAPI ) int libcpath_path_get_path_type( const char *path, size_t path_length, uint8_t *path_type, libcerror_error_t **error ); int libcpath_path_get_volume_name( const char *path, size_t path_length, char **volume_name, size_t *volume_name_length, size_t *directory_name_index, libcerror_error_t **error ); int libcpath_path_get_current_working_directory_by_volume( char *volume_name, size_t volume_name_length, char **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ); #endif /* defined( WINAPI ) */ LIBCPATH_EXTERN \ int libcpath_path_get_full_path( const char *path, size_t path_length, char **full_path, size_t *full_path_size, libcerror_error_t **error ); int libcpath_path_get_sanitized_character_size( char character, size_t *sanitized_character_size, libcerror_error_t **error ); int libcpath_path_get_sanitized_character( char character, size_t sanitized_character_size, char *sanitized_path, size_t sanitized_path_size, size_t *sanitized_path_index, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_path_get_sanitized_filename( const char *filename, size_t filename_length, char **sanitized_filename, size_t *sanitized_filename_size, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_path_get_sanitized_path( const char *path, size_t path_length, char **sanitized_path, size_t *sanitized_path_size, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_path_join( char **path, size_t *path_size, const char *directory_name, size_t directory_name_length, const char *filename, size_t filename_length, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcpath_CreateDirectoryA( LPCSTR path, SECURITY_ATTRIBUTES *security_attributes ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCPATH_EXTERN \ int libcpath_path_make_directory( const char *directory_name, libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcpath_SetCurrentDirectoryW( LPCWSTR path ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCPATH_EXTERN \ int libcpath_path_change_directory_wide( const wchar_t *directory_name, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) DWORD libcpath_GetCurrentDirectoryW( DWORD buffer_size, LPCWSTR buffer ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCPATH_EXTERN \ int libcpath_path_get_current_working_directory_wide( wchar_t **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ); #if defined( WINAPI ) int libcpath_path_get_path_type_wide( const wchar_t *path, size_t path_length, uint8_t *path_type, libcerror_error_t **error ); int libcpath_path_get_volume_name_wide( const wchar_t *path, size_t path_length, wchar_t **volume_name, size_t *volume_name_length, size_t *directory_name_index, libcerror_error_t **error ); int libcpath_path_get_current_working_directory_by_volume_wide( wchar_t *volume_name, size_t volume_name_length, wchar_t **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ); #endif /* defined( WINAPI ) */ LIBCPATH_EXTERN \ int libcpath_path_get_full_path_wide( const wchar_t *path, size_t path_length, wchar_t **full_path, size_t *full_path_size, libcerror_error_t **error ); int libcpath_path_get_sanitized_character_size_wide( wchar_t character, size_t *sanitized_character_size, libcerror_error_t **error ); int libcpath_path_get_sanitized_character_wide( wchar_t character, size_t sanitized_character_size, wchar_t *sanitized_path, size_t sanitized_path_size, size_t *sanitized_path_index, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_path_get_sanitized_filename_wide( const wchar_t *filename, size_t filename_length, wchar_t **sanitized_filename, size_t *sanitized_filename_size, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_path_get_sanitized_path_wide( const wchar_t *path, size_t path_length, wchar_t **sanitized_path, size_t *sanitized_path_size, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_path_join_wide( wchar_t **path, size_t *path_size, const wchar_t *directory_name, size_t directory_name_length, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ); #if defined( WINAPI ) && ( WINVER <= 0x0500 ) BOOL libcpath_CreateDirectoryW( LPCWSTR path, SECURITY_ATTRIBUTES *security_attributes ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ LIBCPATH_EXTERN \ int libcpath_path_make_directory_wide( const wchar_t *directory_name, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCPATH_PATH_H ) */ libewf-20140807/libcpath/Makefile.in0000664000175000017500000010142213443455347021200 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcpath ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcpath_la_LIBADD = am__libcpath_la_SOURCES_DIST = libcpath_definitions.h libcpath_error.c \ libcpath_error.h libcpath_extern.h libcpath_path.c \ libcpath_path.h libcpath_libcerror.h libcpath_libclocale.h \ libcpath_libcsplit.h libcpath_libuna.h libcpath_support.c \ libcpath_support.h libcpath_system_string.c \ libcpath_system_string.h libcpath_unused.h @HAVE_LOCAL_LIBCPATH_TRUE@am_libcpath_la_OBJECTS = libcpath_error.lo \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_path.lo libcpath_support.lo \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_system_string.lo libcpath_la_OBJECTS = $(am_libcpath_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCPATH_TRUE@am_libcpath_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcpath_error.Plo \ ./$(DEPDIR)/libcpath_path.Plo ./$(DEPDIR)/libcpath_support.Plo \ ./$(DEPDIR)/libcpath_system_string.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcpath_la_SOURCES) DIST_SOURCES = $(am__libcpath_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCPATH_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCPATH_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCPATH_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCPATH_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBCPATH_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBCPATH_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_LOCAL_LIBCPATH_TRUE@ @LIBUNA_CPPFLAGS@ @HAVE_LOCAL_LIBCPATH_TRUE@noinst_LTLIBRARIES = libcpath.la @HAVE_LOCAL_LIBCPATH_TRUE@libcpath_la_SOURCES = \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_definitions.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_error.c libcpath_error.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_extern.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_path.c libcpath_path.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_libcerror.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_libclocale.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_libcsplit.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_libuna.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_support.c libcpath_support.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_system_string.c libcpath_system_string.h \ @HAVE_LOCAL_LIBCPATH_TRUE@ libcpath_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcpath/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcpath/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcpath.la: $(libcpath_la_OBJECTS) $(libcpath_la_DEPENDENCIES) $(EXTRA_libcpath_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcpath_la_rpath) $(libcpath_la_OBJECTS) $(libcpath_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpath_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpath_path.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpath_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpath_system_string.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcpath_error.Plo -rm -f ./$(DEPDIR)/libcpath_path.Plo -rm -f ./$(DEPDIR)/libcpath_support.Plo -rm -f ./$(DEPDIR)/libcpath_system_string.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcpath ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcpath_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcpath/libcpath_definitions.h0000664000175000017500000000371013443450040023447 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2008-2018, 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( LIBCPATH_INTERNAL_DEFINITIONS_H ) #define LIBCPATH_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath */ #if !defined( HAVE_LOCAL_LIBCPATH ) #include /* The definitions in are copied here * for local use of libcpath */ #else #define LIBCPATH_VERSION 20181228 /* The libcpath version string */ #define LIBCPATH_VERSION_STRING "20181228" #if defined( WINAPI ) #define LIBCPATH_SEPARATOR '\\' #else #define LIBCPATH_SEPARATOR '/' #endif /* defined( WINAPI ) */ #endif /* !defined( HAVE_LOCAL_LIBCPATH ) */ #if defined( WINAPI ) #define LIBCPATH_ESCAPE_CHARACTER '^' #else #define LIBCPATH_ESCAPE_CHARACTER '\\' #endif /* defined( WINAPI ) */ #if defined( WINAPI ) enum LIBCPATH_TYPES { LIBCPATH_TYPE_ABSOLUTE, LIBCPATH_TYPE_DEVICE, LIBCPATH_TYPE_EXTENDED_LENGTH, LIBCPATH_TYPE_EXTENDED_LENGTH_UNC, LIBCPATH_TYPE_RELATIVE, LIBCPATH_TYPE_UNC }; #else enum LIBCPATH_TYPES { LIBCPATH_TYPE_ABSOLUTE, LIBCPATH_TYPE_RELATIVE }; #endif /* defined( WINAPI ) */ #endif /* !defined( LIBCPATH_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libcpath/libcpath_libcerror.h0000664000175000017500000000264013443450040023120 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2008-2018, 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( _LIBCPATH_LIBCERROR_H ) #define _LIBCPATH_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCPATH_LIBCERROR_H ) */ libewf-20140807/libcpath/libcpath_extern.h0000664000175000017500000000240613443450040022442 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2008-2018, 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( _LIBCPATH_INTERNAL_EXTERN_H ) #define _LIBCPATH_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath */ #if !defined( HAVE_LOCAL_LIBCPATH ) #include #define LIBCPATH_EXTERN_VARIABLE LIBCPATH_EXTERN #else #define LIBCPATH_EXTERN /* extern */ #define LIBCPATH_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCPATH ) */ #endif /* !defined( _LIBCPATH_INTERNAL_EXTERN_H ) */ libewf-20140807/libcpath/libcpath_path.c0000664000175000017500000053004513443450040022071 0ustar00lordyestalordyesta00000000000000/* * Path functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #include #include #if defined( WINAPI ) && ( WINVER <= 0x0500 ) #include #endif #if defined( HAVE_ERRNO_H ) #include #endif #if defined( HAVE_SYS_STAT_H ) #include #endif #if defined( HAVE_LIMITS_H ) || defined( WINAPI ) /* Include for PATH_MAX */ #include #endif #if defined( HAVE_UNISTD_H ) #include #endif #include "libcpath_definitions.h" #include "libcpath_libcerror.h" #include "libcpath_libcsplit.h" #include "libcpath_path.h" #include "libcpath_system_string.h" #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of CloseHandle * Returns TRUE if successful or FALSE on error */ BOOL libcpath_CloseHandle( HANDLE file_handle ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( file_handle == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "CloseHandle" ); if( function != NULL ) { result = function( file_handle ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { result = FALSE; } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of SetCurrentDirectoryA * Returns TRUE if successful or FALSE on error */ BOOL libcpath_SetCurrentDirectoryA( LPCSTR path ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( path == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "SetCurrentDirectoryA" ); if( function != NULL ) { result = function( path ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcpath_CloseHandle( library_handle ); return( FALSE ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Changes the directory * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcpath_path_change_directory( const char *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_change_directory"; DWORD error_code = 0; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) if( libcpath_SetCurrentDirectoryA( directory_name ) == 0 ) #else if( SetCurrentDirectoryA( directory_name ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, error_code, "%s: unable to change directory.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_CHDIR ) /* Changes the directory * This function uses the POSIX chdir function or equivalent * Returns 1 if successful or -1 on error */ int libcpath_path_change_directory( const char *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_change_directory"; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } if( chdir( directory_name ) != 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, errno, "%s: unable to change directory.", function ); return( -1 ); } return( 1 ); } #else #error Missing change directory function #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetCurrentDirectoryA * Returns the number of characters in the current directory string or 0 on error */ DWORD libcpath_GetCurrentDirectoryA( DWORD buffer_size, LPCSTR buffer ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD result = 0; library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "GetCurrentDirectoryA" ); if( function != NULL ) { result = function( buffer_size, buffer ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcpath_CloseHandle( library_handle ); return( 0 ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Retrieves the current working directory * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcpath_path_get_current_working_directory( char **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_current_working_directory"; DWORD safe_current_working_directory_size = 0; DWORD error_code = 0; if( current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory.", function ); return( -1 ); } if( *current_working_directory != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid current working directory value already set.", function ); return( -1 ); } if( current_working_directory_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory size.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) safe_current_working_directory_size = libcpath_GetCurrentDirectoryA( 0, NULL ); #else safe_current_working_directory_size = GetCurrentDirectoryA( 0, NULL ); #endif if( safe_current_working_directory_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory size.", function ); goto on_error; } if( (size_t) safe_current_working_directory_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current working directory size value out of bounds.", function ); goto on_error; } *current_working_directory_size = (size_t) safe_current_working_directory_size; *current_working_directory = narrow_string_allocate( *current_working_directory_size ); if( *current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create current working directory.", function ); goto on_error; } if( memory_set( *current_working_directory, 0, sizeof( char ) * *current_working_directory_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear current working directory.", function ); goto on_error; } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) if( libcpath_GetCurrentDirectoryA( safe_current_working_directory_size, *current_working_directory ) != ( safe_current_working_directory_size - 1 ) ) #else if( GetCurrentDirectoryA( safe_current_working_directory_size, *current_working_directory ) != ( safe_current_working_directory_size - 1 ) ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve current working directory.", function ); goto on_error; } return( 1 ); on_error: if( *current_working_directory != NULL ) { memory_free( *current_working_directory ); *current_working_directory = NULL; } *current_working_directory_size = 0; return( -1 ); } #elif defined( HAVE_GETCWD ) /* Retrieves the current working directory * This function uses the POSIX getcwd function or equivalent * Returns 1 if successful or -1 on error */ int libcpath_path_get_current_working_directory( char **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_current_working_directory"; if( current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory.", function ); return( -1 ); } if( *current_working_directory != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid current working directory value already set.", function ); return( -1 ); } if( current_working_directory_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory size.", function ); return( -1 ); } *current_working_directory_size = (size_t) PATH_MAX; *current_working_directory = narrow_string_allocate( *current_working_directory_size ); if( *current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create current working directory.", function ); goto on_error; } if( memory_set( *current_working_directory, 0, sizeof( char ) * *current_working_directory_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear current working directory.", function ); goto on_error; } if( getcwd( *current_working_directory, *current_working_directory_size ) == NULL ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve current working directory.", function ); goto on_error; } return( 1 ); on_error: if( *current_working_directory != NULL ) { memory_free( *current_working_directory ); *current_working_directory = NULL; } *current_working_directory_size = 0; return( -1 ); } #else #error Missing get current working directory function #endif #if defined( WINAPI ) /* Determines the path type * Returns 1 if succesful or -1 on error */ int libcpath_path_get_path_type( const char *path, size_t path_length, uint8_t *path_type, libcerror_error_t **error ) { static char *function = "libcpath_path_get_path_type"; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( path_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path type.", function ); return( -1 ); } *path_type = LIBCPATH_TYPE_RELATIVE; /* Determine if the path is a special path * device path prefix: \\.\ * extended-length path prefix: \\?\ */ if( ( path_length >= 4 ) && ( path[ 0 ] == '\\' ) && ( path[ 1 ] == '\\' ) && ( ( path[ 2 ] == '.' ) || ( path[ 2 ] == '?' ) ) && ( path[ 3 ] == '\\' ) ) { if( path[ 2 ] == '.' ) { *path_type = LIBCPATH_TYPE_DEVICE; } /* Determine if the path in an extended-length UNC path * \\?\UNC\server\share */ else if( ( path_length >= 8 ) && ( path[ 4 ] == 'U' ) && ( path[ 5 ] == 'N' ) && ( path[ 6 ] == 'C' ) && ( path[ 7 ] == '\\' ) ) { *path_type = LIBCPATH_TYPE_EXTENDED_LENGTH_UNC; } else { *path_type = LIBCPATH_TYPE_EXTENDED_LENGTH; } } /* Determine if the path is an UNC path * \\server\share */ else if( ( path_length >= 2 ) && ( path[ 0 ] == '\\' ) && ( path[ 1 ] == '\\' ) ) { *path_type = LIBCPATH_TYPE_UNC; } else if( path[ 0 ] == '\\' ) { *path_type = LIBCPATH_TYPE_ABSOLUTE; } else if( ( path_length >= 3 ) && ( path[ 1 ] == ':' ) && ( path[ 2 ] == '\\' ) && ( ( ( path[ 0 ] >= 'A' ) && ( path[ 0 ] <= 'Z' ) ) || ( ( path[ 0 ] >= 'a' ) && ( path[ 0 ] <= 'z' ) ) ) ) { *path_type = LIBCPATH_TYPE_ABSOLUTE; } return( 1 ); } /* Determines the volume name * Returns 1 if succesful or -1 on error */ int libcpath_path_get_volume_name( const char *path, size_t path_length, char **volume_name, size_t *volume_name_length, size_t *directory_name_index, libcerror_error_t **error ) { static char *function = "libcpath_path_get_volume_name"; size_t path_index = 0; size_t share_name_index = 0; size_t volume_name_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( volume_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid volume name.", function ); return( -1 ); } if( volume_name_length == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid volume name length.", function ); return( -1 ); } if( directory_name_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name index.", function ); return( -1 ); } *volume_name = NULL; *volume_name_length = 0; *directory_name_index = 0; /* Determine if the path is a special path * device path prefix: \\.\ * extended-length path prefix: \\?\ */ if( ( path_length >= 4 ) && ( path[ 0 ] == '\\' ) && ( path[ 1 ] == '\\' ) && ( ( path[ 2 ] == '.' ) || ( path[ 2 ] == '?' ) ) && ( path[ 3 ] == '\\' ) ) { if( path[ 2 ] == '.' ) { volume_name_index = 4; } /* Determine if the path in an extended-length UNC path * \\?\UNC\server\share */ else if( ( path_length >= 8 ) && ( path[ 4 ] == 'U' ) && ( path[ 5 ] == 'N' ) && ( path[ 6 ] == 'C' ) && ( path[ 7 ] == '\\' ) ) { volume_name_index = 8; } else { volume_name_index = 4; } } /* Determine if the path is an UNC path * \\server\share */ else if( ( path_length >= 2 ) && ( path[ 0 ] == '\\' ) && ( path[ 1 ] == '\\' ) ) { volume_name_index = 2; } /* Check if the path contains a volume letter */ if( ( path_length >= 2 ) && ( volume_name_index <= ( path_length - 2 ) ) && ( path[ volume_name_index + 1 ] == ':' ) && ( ( ( path[ volume_name_index ] >= 'A' ) && ( path[ volume_name_index ] <= 'Z' ) ) || ( ( path[ volume_name_index ] >= 'a' ) && ( path[ volume_name_index ] <= 'z' ) ) ) ) { path_index = volume_name_index + 2; if( ( path_index < path_length ) && ( path[ path_index ] == '\\' ) ) { path_index++; } *volume_name = (char *) &( path[ volume_name_index ] ); *volume_name_length = path_index - volume_name_index; if( path[ path_index - 1 ] == '\\' ) { *volume_name_length -= 1; } *directory_name_index = path_index; } else if( volume_name_index == 4 ) { for( path_index = volume_name_index; path_index < path_length; path_index++ ) { if( path[ path_index ] == '\\' ) { path_index++; break; } } *volume_name = (char *) &( path[ 4 ] ); *volume_name_length = path_index - 4; if( path[ path_index - 1 ] == '\\' ) { *volume_name_length -= 1; } *directory_name_index = path_index; } else if( ( volume_name_index == 2 ) || ( volume_name_index == 8 ) ) { for( share_name_index = volume_name_index; share_name_index < path_length; share_name_index++ ) { if( path[ share_name_index ] == '\\' ) { share_name_index++; break; } } if( share_name_index > path_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid path - missing share name.", function ); return( -1 ); } for( path_index = share_name_index; path_index < path_length; path_index++ ) { if( path[ path_index ] == '\\' ) { path_index++; break; } } *volume_name = (char *) &( path[ volume_name_index ] ); *volume_name_length = path_index - volume_name_index; if( path[ path_index - 1 ] == '\\' ) { *volume_name_length -= 1; } *directory_name_index = path_index; } return( 1 ); } /* Retrieves the current working directory of a specific volume * Returns 1 if successful or -1 on error */ int libcpath_path_get_current_working_directory_by_volume( char *volume_name, size_t volume_name_length, char **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ) { char *change_volume_name = NULL; char *current_volume_working_directory = NULL; static char *function = "libcpath_path_get_current_working_directory_by_volume"; size_t current_volume_working_directory_size = 0; int result = 1; if( current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory.", function ); return( -1 ); } if( current_working_directory_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory size.", function ); return( -1 ); } /* If the path contains a volume name switch to that * volume to determine the current directory */ if( volume_name != NULL ) { if( volume_name_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid volume name length value exceeds maximum.", function ); goto on_error; } if( libcpath_path_get_current_working_directory( ¤t_volume_working_directory, ¤t_volume_working_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current volume working directory.", function ); goto on_error; } change_volume_name = narrow_string_allocate( volume_name_length + 1 ); if( change_volume_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create change volume name.", function ); goto on_error; } if( narrow_string_copy( change_volume_name, volume_name, volume_name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set change volume name.", function ); goto on_error; } change_volume_name[ volume_name_length ] = 0; if( libcpath_path_change_directory( change_volume_name, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to change current working directory.", function ); goto on_error; } memory_free( change_volume_name ); change_volume_name = NULL; } if( libcpath_path_get_current_working_directory( current_working_directory, current_working_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current directory.", function ); /* Make sure the current working directory has been changed * back to its original value */ result = -1; } if( current_volume_working_directory != NULL ) { if( libcpath_path_change_directory( current_volume_working_directory, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to change current working directory.", function ); goto on_error; } memory_free( current_volume_working_directory ); current_volume_working_directory = NULL; } return( result ); on_error: if( change_volume_name != NULL ) { memory_free( change_volume_name ); } if( current_volume_working_directory != NULL ) { memory_free( current_volume_working_directory ); } if( *current_working_directory != NULL ) { memory_free( *current_working_directory ); *current_working_directory = NULL; } *current_working_directory_size = 0; return( -1 ); } /* Determines the full path of the Windows path specified * The function uses the extended-length path format * (path with \\?\ prefix) * * Multiple successive \ not at the start of the path are combined into one * * Scenario's that are considered full paths: * Device path: \\.\PhysicalDrive0 * Extended-length path: \\?\C:\directory\file.txt * Extended-length UNC path: \\?\UNC\server\share\directory\file.txt * * Scenario's that are not considered full paths: * Local 'absolute' path: \directory\file.txt * \directory\\file.txt * Local 'relative' path: ..\directory\file.txt * Local 'relative' path: .\directory\file.txt * Volume 'absolute' path: C:\directory\file.txt * C:\..\directory\file.txt * Volume 'relative' path: C:directory\file.txt * UNC path: \\server\share\directory\file.txt * * TODO handle: * Volume device path: \\.\C: * Volume file system path: \\.\C:\ * * Returns 1 if succesful or -1 on error */ int libcpath_path_get_full_path( const char *path, size_t path_length, char **full_path, size_t *full_path_size, libcerror_error_t **error ) { libcsplit_narrow_split_string_t *current_directory_split_string = NULL; libcsplit_narrow_split_string_t *path_split_string = NULL; char *current_directory = NULL; char *current_directory_string_segment = NULL; char *full_path_prefix = NULL; char *last_used_path_string_segment = NULL; char *path_string_segment = NULL; char *volume_name = NULL; static char *function = "libcpath_path_get_full_path"; size_t current_directory_length = 0; size_t current_directory_name_index = 0; size_t current_directory_size = 0; size_t current_directory_string_segment_size = 0; size_t full_path_index = 0; size_t full_path_prefix_length = 0; size_t last_used_path_string_segment_size = 0; size_t path_directory_name_index = 0; size_t path_string_segment_size = 0; size_t safe_full_path_size = 0; size_t volume_name_length = 0; uint8_t path_type = LIBCPATH_TYPE_RELATIVE; int current_directory_number_of_segments = 0; int current_directory_segment_index = 0; int last_used_path_segment_index = -1; int path_number_of_segments = 0; int path_segment_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path.", function ); return( -1 ); } if( *full_path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid full path value already set.", function ); return( -1 ); } if( full_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path size.", function ); return( -1 ); } if( libcpath_path_get_path_type( path, path_length, &path_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine path type.", function ); goto on_error; } if( libcpath_path_get_volume_name( path, path_length, &volume_name, &volume_name_length, &path_directory_name_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine volume name.", function ); goto on_error; } /* If the path is a device path, an extended-length path or an UNC * do not bother to lookup the current working directory */ if( ( path_type != LIBCPATH_TYPE_DEVICE ) && ( path_type != LIBCPATH_TYPE_EXTENDED_LENGTH ) && ( path_type != LIBCPATH_TYPE_EXTENDED_LENGTH_UNC ) && ( path_type != LIBCPATH_TYPE_UNC ) ) { if( libcpath_path_get_current_working_directory_by_volume( volume_name, volume_name_length, ¤t_directory, ¤t_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory by volume.", function ); goto on_error; } /* Determine the volume name using the current working directory if necessary */ if( libcpath_path_get_volume_name( current_directory, current_directory_size - 1, &volume_name, &volume_name_length, ¤t_directory_name_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine volume name from current working directory.", function ); goto on_error; } } if( ( current_directory != NULL ) && ( current_directory_name_index < current_directory_size ) ) { current_directory_length = narrow_string_length( &( current_directory[ current_directory_name_index ] ) ); if( libcsplit_narrow_string_split( &( current_directory[ current_directory_name_index ] ), current_directory_length + 1, '\\', ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split current working directory.", function ); goto on_error; } } if( libcsplit_narrow_string_split( &( path[ path_directory_name_index ] ), path_length - path_directory_name_index + 1, '\\', &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split path.", function ); goto on_error; } /* The size of the full path consists of: * the size of the prefix (\\?\ or \\.\) */ safe_full_path_size = 4; /* If the path contains a volume name * the length of the volume name * a directory separator */ if( volume_name != NULL ) { safe_full_path_size += volume_name_length + 1; } /* If the path contains an UNC path * add the size of the UNC\ prefix */ if( ( path_type == LIBCPATH_TYPE_EXTENDED_LENGTH_UNC ) || ( path_type == LIBCPATH_TYPE_UNC ) ) { safe_full_path_size += 4; } /* If the path is relative * add the size of the current working directory * a directory separator, if necessary */ if( ( path_type == LIBCPATH_TYPE_RELATIVE ) && ( current_directory_name_index < current_directory_size ) ) { safe_full_path_size += ( current_directory_size - ( current_directory_name_index + 1 ) ); if( ( current_directory_size >= 2 ) && ( current_directory[ current_directory_size - 2 ] != '\\' ) ) { safe_full_path_size += 1; } } if( current_directory_split_string != NULL ) { if( libcsplit_narrow_split_string_get_number_of_segments( current_directory_split_string, ¤t_directory_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of current working directory string segments.", function ); goto on_error; } current_directory_segment_index = current_directory_number_of_segments - 1; } if( libcsplit_narrow_split_string_get_number_of_segments( path_split_string, &path_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of path string segments.", function ); goto on_error; } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } /* If the path is .. reverse the current path by one directory */ if( ( path_string_segment_size == 3 ) && ( path_string_segment[ 0 ] == '.' ) && ( path_string_segment[ 1 ] == '.' ) ) { if( ( current_directory_split_string != NULL ) && ( last_used_path_segment_index == -1 ) ) { if( libcsplit_narrow_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= current_directory_string_segment_size; if( libcsplit_narrow_split_string_set_segment_by_index( current_directory_split_string, current_directory_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } current_directory_segment_index--; } else if( last_used_path_segment_index >= 0 ) { if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used path string string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= last_used_path_string_segment_size; if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, last_used_path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Find the previous path split value that contains a name */ while( last_used_path_segment_index > 0 ) { last_used_path_segment_index--; if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment_size != 0 ) { break; } } } if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is . ignore the entry */ else if( ( path_string_segment_size == 2 ) && ( path_string_segment[ 0 ] == '.' ) ) { if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is empty ignore the entry */ else if( path_string_segment_size <= 1 ) { if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } else { /* Add the size of the directory or file name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size += path_string_segment_size; last_used_path_segment_index = path_segment_index; } } /* Note that the last path separator serves as the end of string */ full_path_index = 0; *full_path = narrow_string_allocate( safe_full_path_size ); if( *full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create full path.", function ); goto on_error; } if( memory_set( *full_path, 0, sizeof( char ) * safe_full_path_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear full path.", function ); goto on_error; } *full_path_size = safe_full_path_size; if( path_type == LIBCPATH_TYPE_DEVICE ) { full_path_prefix = "\\\\.\\"; full_path_prefix_length = 4; } else { full_path_prefix = "\\\\?\\"; full_path_prefix_length = 4; } if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), full_path_prefix, full_path_prefix_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set prefix in full path.", function ); goto on_error; } full_path_index += full_path_prefix_length; /* If there is a share name the path is an UNC path */ if( ( path_type == LIBCPATH_TYPE_EXTENDED_LENGTH_UNC ) || ( path_type == LIBCPATH_TYPE_UNC ) ) { if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), "UNC\\", 4 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set UNC\\ prefix in full path.", function ); goto on_error; } full_path_index += 4; } if( volume_name != NULL ) { if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), volume_name, volume_name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set volume name in full path.", function ); goto on_error; } full_path_index += volume_name_length; ( *full_path )[ full_path_index ] = '\\'; full_path_index += 1; } /* If the path is relative * add the current working directory elements */ if( ( path_type == LIBCPATH_TYPE_RELATIVE ) && ( current_directory_split_string != NULL ) ) { for( current_directory_segment_index = 0; current_directory_segment_index < current_directory_number_of_segments; current_directory_segment_index++ ) { if( libcsplit_narrow_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment_size != 0 ) { if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), current_directory_string_segment, current_directory_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory split value: %d in full path.", function, current_directory_segment_index ); goto on_error; } full_path_index += current_directory_string_segment_size - 1; ( *full_path )[ full_path_index ] = '\\'; full_path_index += 1; } } } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment_size != 0 ) { if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), path_string_segment, path_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path split value: %d in full path.", function, path_segment_index ); goto on_error; } full_path_index += path_string_segment_size - 1; ( *full_path )[ full_path_index ] = '\\'; full_path_index += 1; } } ( *full_path )[ full_path_index - 1 ] = 0; if( libcsplit_narrow_split_string_free( &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free path split string.", function ); goto on_error; } if( current_directory_split_string != NULL ) { if( libcsplit_narrow_split_string_free( ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free current working directory split string.", function ); goto on_error; } } if( current_directory != NULL ) { memory_free( current_directory ); } return( 1 ); on_error: if( *full_path != NULL ) { memory_free( *full_path ); *full_path = NULL; } *full_path_size = 0; if( path_split_string != NULL ) { libcsplit_narrow_split_string_free( &path_split_string, NULL ); } if( current_directory_split_string != NULL ) { libcsplit_narrow_split_string_free( ¤t_directory_split_string, NULL ); } if( current_directory != NULL ) { memory_free( current_directory ); } return( -1 ); } #else /* Determines the full path of the POSIX path specified * Multiple successive / are combined into one * * Scenarios: * /home/user/file.txt * /home/user//file.txt * /home/user/../user/file.txt * /../home/user/file.txt * user/../user/file.txt * * Returns 1 if succesful or -1 on error */ int libcpath_path_get_full_path( const char *path, size_t path_length, char **full_path, size_t *full_path_size, libcerror_error_t **error ) { libcsplit_narrow_split_string_t *current_directory_split_string = NULL; libcsplit_narrow_split_string_t *path_split_string = NULL; char *current_directory = NULL; char *current_directory_string_segment = NULL; char *last_used_path_string_segment = NULL; char *path_string_segment = NULL; static char *function = "libcpath_path_get_full_path"; size_t current_directory_length = 0; size_t current_directory_size = 0; size_t current_directory_string_segment_size = 0; size_t full_path_index = 0; size_t last_used_path_string_segment_size = 0; size_t path_string_segment_size = 0; size_t safe_full_path_size = 0; uint8_t path_type = LIBCPATH_TYPE_RELATIVE; int current_directory_number_of_segments = 0; int current_directory_segment_index = 0; int last_used_path_segment_index = -1; int path_number_of_segments = 0; int path_segment_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path.", function ); return( -1 ); } if( *full_path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid full path value already set.", function ); return( -1 ); } if( full_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path size.", function ); return( -1 ); } if( path[ 0 ] == '/' ) { path_type = LIBCPATH_TYPE_ABSOLUTE; } else { if( libcpath_path_get_current_working_directory( ¤t_directory, ¤t_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory.", function ); goto on_error; } } if( current_directory != NULL ) { current_directory_length = narrow_string_length( current_directory ); if( libcsplit_narrow_string_split( current_directory, current_directory_length + 1, '/', ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split current working directory.", function ); goto on_error; } } if( libcsplit_narrow_string_split( path, path_length + 1, '/', &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split path.", function ); goto on_error; } /* Determine the full path size */ /* If the path is absolute * a directory separator */ if( path_type == LIBCPATH_TYPE_ABSOLUTE ) { safe_full_path_size = 1; } /* If the path is relative * add the size of the current working directory * a directory separator, if necessary */ else if( path_type == LIBCPATH_TYPE_RELATIVE ) { if( current_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory.", function ); goto on_error; } /* We need to use the length here since current_directory_size will be PATH_MAX */ safe_full_path_size = current_directory_length; if( ( current_directory_length >= 1 ) && ( current_directory[ current_directory_length - 1 ] != '/' ) ) { safe_full_path_size++; } } if( current_directory_split_string != NULL ) { if( libcsplit_narrow_split_string_get_number_of_segments( current_directory_split_string, ¤t_directory_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of current working directory string segments.", function ); goto on_error; } current_directory_segment_index = current_directory_number_of_segments - 1; } if( libcsplit_narrow_split_string_get_number_of_segments( path_split_string, &path_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of path string segments.", function ); goto on_error; } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } /* If the path is .. reverse the current path by one directory */ if( ( path_string_segment_size == 3 ) && ( path_string_segment[ 0 ] == '.' ) && ( path_string_segment[ 1 ] == '.' ) ) { if( ( current_directory_split_string != NULL ) && ( last_used_path_segment_index == -1 ) ) { if( libcsplit_narrow_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= current_directory_string_segment_size; if( libcsplit_narrow_split_string_set_segment_by_index( current_directory_split_string, current_directory_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } current_directory_segment_index--; } else if( last_used_path_segment_index >= 0 ) { if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used path string string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= last_used_path_string_segment_size; if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, last_used_path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Find the previous path split value that contains a name */ while( last_used_path_segment_index > 0 ) { last_used_path_segment_index--; if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment_size != 0 ) { break; } } } if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is . ignore the entry */ else if( ( path_string_segment_size == 2 ) && ( path_string_segment[ 0 ] == '.' ) ) { if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is empty ignore the entry */ else if( path_string_segment_size <= 1 ) { if( libcsplit_narrow_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } else { /* Add the size of the directory or file name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size += path_string_segment_size; last_used_path_segment_index = path_segment_index; } } /* Note that the last path separator serves as the end of string */ full_path_index = 0; *full_path = narrow_string_allocate( safe_full_path_size ); if( *full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create full path.", function ); goto on_error; } if( memory_set( *full_path, 0, sizeof( char ) * safe_full_path_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear full path.", function ); goto on_error; } *full_path_size = safe_full_path_size; if( path_type == LIBCPATH_TYPE_ABSOLUTE ) { ( *full_path )[ full_path_index ] = '/'; full_path_index += 1; } /* If the path is relative * add the current working directory elements */ if( ( path_type == LIBCPATH_TYPE_RELATIVE ) && ( current_directory_split_string != NULL ) ) { for( current_directory_segment_index = 0; current_directory_segment_index < current_directory_number_of_segments; current_directory_segment_index++ ) { if( libcsplit_narrow_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment_size != 0 ) { if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), current_directory_string_segment, current_directory_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory split value: %d in full path.", function, current_directory_segment_index ); goto on_error; } full_path_index += current_directory_string_segment_size - 1; ( *full_path )[ full_path_index ] = '/'; full_path_index += 1; } } } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_narrow_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment_size != 0 ) { if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } if( narrow_string_copy( &( ( *full_path )[ full_path_index ] ), path_string_segment, path_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path split value: %d in full path.", function, path_segment_index ); goto on_error; } full_path_index += path_string_segment_size - 1; ( *full_path )[ full_path_index ] = '/'; full_path_index += 1; } } ( *full_path )[ full_path_index - 1 ] = 0; if( libcsplit_narrow_split_string_free( &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free path split string.", function ); goto on_error; } if( current_directory_split_string != NULL ) { if( libcsplit_narrow_split_string_free( ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free current working directory split string.", function ); goto on_error; } } if( current_directory != NULL ) { memory_free( current_directory ); } return( 1 ); on_error: if( *full_path != NULL ) { memory_free( *full_path ); *full_path = NULL; } *full_path_size = 0; if( path_split_string != NULL ) { libcsplit_narrow_split_string_free( &path_split_string, NULL ); } if( current_directory_split_string != NULL ) { libcsplit_narrow_split_string_free( ¤t_directory_split_string, NULL ); } if( current_directory != NULL ) { memory_free( current_directory ); } return( -1 ); } #endif /* defined( WINAPI ) */ /* Retrieves the size of a sanitized version of the path character * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_character_size( char character, size_t *sanitized_character_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_character_size"; if( sanitized_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized character size.", function ); return( -1 ); } if( ( character >= 0x00 ) && ( character <= 0x1f ) ) { *sanitized_character_size = 4; } else if( character == LIBCPATH_ESCAPE_CHARACTER ) { *sanitized_character_size = 2; } #if defined( WINAPI ) else if( character == '/' ) { *sanitized_character_size = 4; } #endif else if( ( character == '!' ) || ( character == '$' ) || ( character == '%' ) || ( character == '&' ) || ( character == '*' ) || ( character == '+' ) || ( character == ':' ) || ( character == ';' ) || ( character == '<' ) || ( character == '>' ) || ( character == '?' ) || ( character == '|' ) || ( character == 0x7f ) ) { *sanitized_character_size = 4; } else { *sanitized_character_size = 1; } return( 1 ); } /* Retrieves a sanitized version of the path character * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_character( char character, size_t sanitized_character_size, char *sanitized_path, size_t sanitized_path_size, size_t *sanitized_path_index, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_character"; size_t safe_sanitized_path_index = 0; char lower_nibble = 0; char upper_nibble = 0; if( ( sanitized_character_size != 1 ) && ( sanitized_character_size != 2 ) && ( sanitized_character_size != 4 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sanitized character size value out of bounds.", function ); return( -1 ); } if( sanitized_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path.", function ); return( -1 ); } if( sanitized_path_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sanitized path size value exceeds maximum.", function ); return( -1 ); } if( sanitized_path_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path index.", function ); return( -1 ); } safe_sanitized_path_index = *sanitized_path_index; if( safe_sanitized_path_index > sanitized_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sanitized path index value out of bounds.", function ); return( -1 ); } if( ( sanitized_character_size > sanitized_path_size ) || ( safe_sanitized_path_index > ( sanitized_path_size - sanitized_character_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid sanitized path size value too small.", function ); return( -1 ); } if( sanitized_character_size == 1 ) { sanitized_path[ safe_sanitized_path_index++ ] = character; } else if( sanitized_character_size == 2 ) { sanitized_path[ safe_sanitized_path_index++ ] = LIBCPATH_ESCAPE_CHARACTER; sanitized_path[ safe_sanitized_path_index++ ] = LIBCPATH_ESCAPE_CHARACTER; } else if( sanitized_character_size == 4 ) { lower_nibble = character & 0x0f; upper_nibble = ( character >> 4 ) & 0x0f; if( lower_nibble > 10 ) { lower_nibble += 'a' - 10; } else { lower_nibble += '0'; } if( upper_nibble > 10 ) { upper_nibble += 'a' - 10; } else { upper_nibble += '0'; } sanitized_path[ safe_sanitized_path_index++ ] = LIBCPATH_ESCAPE_CHARACTER; sanitized_path[ safe_sanitized_path_index++ ] = 'x'; sanitized_path[ safe_sanitized_path_index++ ] = upper_nibble; sanitized_path[ safe_sanitized_path_index++ ] = lower_nibble; } *sanitized_path_index = safe_sanitized_path_index; return( 1 ); } /* Retrieves a sanitized version of the filename * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_filename( const char *filename, size_t filename_length, char **sanitized_filename, size_t *sanitized_filename_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_filename"; char *safe_sanitized_filename = NULL; size_t filename_index = 0; size_t sanitized_character_size = 0; size_t safe_sanitized_filename_size = 0; size_t sanitized_filename_index = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid filename length is zero.", function ); return( -1 ); } if( filename_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename length value exceeds maximum.", function ); return( -1 ); } if( sanitized_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized filename.", function ); return( -1 ); } if( *sanitized_filename != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sanitized filename value already set.", function ); return( -1 ); } if( sanitized_filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized filename size.", function ); return( -1 ); } safe_sanitized_filename_size = 1; for( filename_index = 0; filename_index < filename_length; filename_index++ ) { if( filename[ filename_index ] == LIBCPATH_SEPARATOR ) { sanitized_character_size = 4; } else if( libcpath_path_get_sanitized_character_size( filename[ filename_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } safe_sanitized_filename_size += sanitized_character_size; } if( safe_sanitized_filename_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sanitized filename size value exceeds maximum.", function ); goto on_error; } safe_sanitized_filename = narrow_string_allocate( safe_sanitized_filename_size ); if( safe_sanitized_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sanitized filename.", function ); goto on_error; } for( filename_index = 0; filename_index < filename_length; filename_index++ ) { if( filename[ filename_index ] == LIBCPATH_SEPARATOR ) { sanitized_character_size = 4; } else if( libcpath_path_get_sanitized_character_size( filename[ filename_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } if( libcpath_path_get_sanitized_character( filename[ filename_index ], sanitized_character_size, safe_sanitized_filename, safe_sanitized_filename_size, &sanitized_filename_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } } safe_sanitized_filename[ sanitized_filename_index ] = 0; *sanitized_filename = safe_sanitized_filename; *sanitized_filename_size = safe_sanitized_filename_size; return( 1 ); on_error: if( safe_sanitized_filename != NULL ) { memory_free( safe_sanitized_filename ); } return( -1 ); } /* Retrieves a sanitized version of the path * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_path( const char *path, size_t path_length, char **sanitized_path, size_t *sanitized_path_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_path"; char *safe_sanitized_path = NULL; size_t path_index = 0; size_t safe_sanitized_path_size = 0; size_t sanitized_character_size = 0; size_t sanitized_path_index = 0; #if defined( WINAPI ) size_t last_path_segment_seperator_index = 0; #endif if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( sanitized_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path.", function ); return( -1 ); } if( *sanitized_path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sanitized path value already set.", function ); return( -1 ); } if( sanitized_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path size.", function ); return( -1 ); } safe_sanitized_path_size = 1; for( path_index = 0; path_index < path_length; path_index++ ) { if( libcpath_path_get_sanitized_character_size( path[ path_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } safe_sanitized_path_size += sanitized_character_size; #if defined( WINAPI ) if( path[ path_index ] == LIBCPATH_SEPARATOR ) { last_path_segment_seperator_index = path_index; } #endif } if( safe_sanitized_path_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sanitized path size value exceeds maximum.", function ); goto on_error; } #if defined( WINAPI ) if( last_path_segment_seperator_index > 32767 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: last path segment separator value out of bounds.", function ); goto on_error; } if( safe_sanitized_path_size > 32767 ) { safe_sanitized_path_size = 32767; } #endif safe_sanitized_path = narrow_string_allocate( safe_sanitized_path_size ); if( safe_sanitized_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sanitized path.", function ); goto on_error; } for( path_index = 0; path_index < path_length; path_index++ ) { if( libcpath_path_get_sanitized_character_size( path[ path_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } if( libcpath_path_get_sanitized_character( path[ path_index ], sanitized_character_size, safe_sanitized_path, safe_sanitized_path_size, &sanitized_path_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } } safe_sanitized_path[ sanitized_path_index ] = 0; *sanitized_path = safe_sanitized_path; *sanitized_path_size = safe_sanitized_path_size; return( 1 ); on_error: if( safe_sanitized_path != NULL ) { memory_free( safe_sanitized_path ); } return( -1 ); } /* Combines the directory name and filename into a path * Returns 1 if successful or -1 on error */ int libcpath_path_join( char **path, size_t *path_size, const char *directory_name, size_t directory_name_length, const char *filename, size_t filename_length, libcerror_error_t **error ) { static char *function = "libcpath_path_join"; size_t filename_index = 0; size_t path_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( *path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid path value already set.", function ); return( -1 ); } if( path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path size.", function ); return( -1 ); } if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } if( directory_name_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid directory name length value exceeds maximum.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename length value exceeds maximum.", function ); return( -1 ); } /* TODO strip other patterns like /./ */ while( directory_name_length > 0 ) { if( directory_name[ directory_name_length - 1 ] != (char) LIBCPATH_SEPARATOR ) { break; } directory_name_length--; } while( filename_length > 0 ) { if( filename[ filename_index ] != (char) LIBCPATH_SEPARATOR ) { break; } filename_index++; filename_length--; } *path_size = directory_name_length + filename_length + 2; *path = narrow_string_allocate( *path_size ); if( *path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create path.", function ); goto on_error; } if( narrow_string_copy( *path, directory_name, directory_name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy directory name to path.", function ); goto on_error; } path_index = directory_name_length; ( *path )[ path_index++ ] = (char) LIBCPATH_SEPARATOR; if( narrow_string_copy( &( ( *path )[ path_index ] ), &( filename[ filename_index ] ), filename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy filename to path.", function ); goto on_error; } path_index += filename_length; ( *path )[ path_index ] = 0; return( 1 ); on_error: if( *path != NULL ) { memory_free( path ); *path = NULL; } *path_size = 0; return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of CreateDirectoryA * Returns TRUE if successful or FALSE on error */ BOOL libcpath_CreateDirectoryA( LPCSTR path, SECURITY_ATTRIBUTES *security_attributes ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( path == NULL ) { return( 0 ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "CreateDirectoryA" ); if( function != NULL ) { result = function( path, security_attributes ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcpath_CloseHandle( library_handle ); return( 0 ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Makes the directory * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcpath_path_make_directory( const char *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_make_directory"; DWORD error_code = 0; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) if( libcpath_CreateDirectoryA( directory_name, NULL ) == 0 ) #else if( CreateDirectoryA( directory_name, NULL ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, error_code, "%s: unable to make directory.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_MKDIR ) /* Makes the directory * This function uses the POSIX mkdir function or equivalent * Returns 1 if successful or -1 on error */ int libcpath_path_make_directory( const char *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_make_directory"; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } if( mkdir( directory_name, 0755 ) != 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, errno, "%s: unable to make directory.", function ); return( -1 ); } return( 1 ); } #else #error Missing make directory function #endif #if defined( HAVE_WIDE_CHARACTER_TYPE ) #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of SetCurrentDirectoryW * Returns TRUE if successful or FALSE on error */ BOOL libcpath_SetCurrentDirectoryW( LPCWSTR path ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( path == NULL ) { return( FALSE ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( FALSE ); } function = GetProcAddress( library_handle, (LPCSTR) "SetCurrentDirectoryW" ); if( function != NULL ) { result = function( path ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcpath_CloseHandle( library_handle ); return( FALSE ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Changes the directory * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcpath_path_change_directory_wide( const wchar_t *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_change_directory_wide"; DWORD error_code = 0; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) if( libcpath_SetCurrentDirectoryW( directory_name ) == 0 ) #else if( SetCurrentDirectoryW( directory_name ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, error_code, "%s: unable to change directory.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_CHDIR ) /* Changes the directory * This function uses the POSIX chdir function or equivalent * Returns 1 if successful or -1 on error */ int libcpath_path_change_directory_wide( const wchar_t *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_change_directory_wide"; char *narrow_directory_name = 0; size_t directory_name_length = 0; size_t narrow_directory_name_size = 0; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } directory_name_length = wide_string_length( directory_name ); if( libcpath_system_string_size_from_wide_string( directory_name, directory_name_length + 1, &narrow_directory_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow directory name size.", function ); goto on_error; } if( ( narrow_directory_name_size > (size_t) SSIZE_MAX ) || ( ( sizeof( char ) * narrow_directory_name_size ) > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow directory name size value exceeds maximum.", function ); goto on_error; } narrow_directory_name = narrow_string_allocate( narrow_directory_name_size ); if( narrow_directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create narrow directory name.", function ); goto on_error; } if( libcpath_system_string_copy_from_wide_string( narrow_directory_name, narrow_directory_name_size, directory_name, directory_name_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); goto on_error; } if( chdir( narrow_directory_name ) != 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, errno, "%s: unable to change directory.", function ); return( -1 ); } memory_free( narrow_directory_name ); return( 1 ); on_error: if( narrow_directory_name != NULL ) { memory_free( narrow_directory_name ); } return( -1 ); } #else #error Missing change directory function #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of GetCurrentDirectoryW * Returns the number of characters in the current directory string or 0 on error */ DWORD libcpath_GetCurrentDirectoryW( DWORD buffer_size, LPCWSTR buffer ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD result = 0; library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "GetCurrentDirectoryW" ); if( function != NULL ) { result = function( buffer_size, buffer ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcpath_CloseHandle( library_handle ); return( 0 ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Retrieves the current working directory * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcpath_path_get_current_working_directory_wide( wchar_t **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_current_working_directory_wide"; DWORD safe_current_working_directory_size = 0; DWORD error_code = 0; if( current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory.", function ); return( -1 ); } if( *current_working_directory != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid current working directory value already set.", function ); return( -1 ); } if( current_working_directory_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory size.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) safe_current_working_directory_size = libcpath_GetCurrentDirectoryW( 0, NULL ); #else safe_current_working_directory_size = GetCurrentDirectoryW( 0, NULL ); #endif if( safe_current_working_directory_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory size.", function ); goto on_error; } if( (size_t) safe_current_working_directory_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: current working directory size value out of bounds.", function ); goto on_error; } *current_working_directory_size = (size_t) safe_current_working_directory_size; *current_working_directory = wide_string_allocate( *current_working_directory_size ); if( *current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create current working directory.", function ); goto on_error; } if( memory_set( *current_working_directory, 0, sizeof( wchar_t ) * *current_working_directory_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear current working directory.", function ); goto on_error; } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) if( libcpath_GetCurrentDirectoryW( safe_current_working_directory_size, *current_working_directory ) != ( safe_current_working_directory_size - 1 ) ) #else if( GetCurrentDirectoryW( safe_current_working_directory_size, *current_working_directory ) != ( safe_current_working_directory_size - 1 ) ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve current working directory.", function ); goto on_error; } return( 1 ); on_error: if( *current_working_directory != NULL ) { memory_free( *current_working_directory ); *current_working_directory = NULL; } *current_working_directory_size = 0; return( -1 ); } #elif defined( HAVE_GETCWD ) /* Retrieves the current working directory * This function uses the POSIX getcwd function or equivalent * Returns 1 if successful or -1 on error */ int libcpath_path_get_current_working_directory_wide( wchar_t **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_current_working_directory_wide"; char *narrow_current_working_directory = 0; size_t narrow_current_working_directory_length = 0; if( current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory.", function ); return( -1 ); } if( *current_working_directory != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid current working directory value already set.", function ); return( -1 ); } if( current_working_directory_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory size.", function ); return( -1 ); } narrow_current_working_directory = narrow_string_allocate( PATH_MAX ); if( narrow_current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create narrow current working directory.", function ); goto on_error; } if( getcwd( narrow_current_working_directory, PATH_MAX ) == NULL ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, errno, "%s: unable to retrieve current working directory.", function ); goto on_error; } narrow_current_working_directory_length = narrow_string_length( narrow_current_working_directory ); /* Convert the current working directory to a wide string * if the platform has no wide character open function */ if( libcpath_system_string_size_from_narrow_string( narrow_current_working_directory, narrow_current_working_directory_length + 1, current_working_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide character current working directory size.", function ); return( -1 ); } *current_working_directory = wide_string_allocate( *current_working_directory_size ); if( *current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create current working directory.", function ); goto on_error; } if( memory_set( *current_working_directory, 0, sizeof( wchar_t ) * *current_working_directory_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear current working directory.", function ); goto on_error; } if( libcpath_system_string_copy_to_wide_string( narrow_current_working_directory, narrow_current_working_directory_length + 1, *current_working_directory, *current_working_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set current working directory.", function ); goto on_error; } memory_free( narrow_current_working_directory ); return( 1 ); on_error: if( narrow_current_working_directory != NULL ) { memory_free( narrow_current_working_directory ); } if( *current_working_directory != NULL ) { memory_free( *current_working_directory ); *current_working_directory = NULL; } *current_working_directory_size = 0; return( -1 ); } #else #error Missing get current working directory function #endif #if defined( WINAPI ) /* Determines the path type * Returns 1 if succesful or -1 on error */ int libcpath_path_get_path_type_wide( const wchar_t *path, size_t path_length, uint8_t *path_type, libcerror_error_t **error ) { static char *function = "libcpath_path_get_path_type_wide"; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( path_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path type.", function ); return( -1 ); } *path_type = LIBCPATH_TYPE_RELATIVE; /* Determine if the path is a special path * device path prefix: \\.\ * extended-length path prefix: \\?\ */ if( ( path_length >= 4 ) && ( path[ 0 ] == (wchar_t) '\\' ) && ( path[ 1 ] == (wchar_t) '\\' ) && ( ( path[ 2 ] == (wchar_t) '.' ) || ( path[ 2 ] == (wchar_t) '?' ) ) && ( path[ 3 ] == (wchar_t) '\\' ) ) { if( path[ 2 ] == (wchar_t) '.' ) { *path_type = LIBCPATH_TYPE_DEVICE; } /* Determine if the path in an extended-length UNC path * \\?\UNC\server\share */ else if( ( path_length >= 8 ) && ( path[ 4 ] == (wchar_t) 'U' ) && ( path[ 5 ] == (wchar_t) 'N' ) && ( path[ 6 ] == (wchar_t) 'C' ) && ( path[ 7 ] == (wchar_t) '\\' ) ) { *path_type = LIBCPATH_TYPE_EXTENDED_LENGTH_UNC; } else { *path_type = LIBCPATH_TYPE_EXTENDED_LENGTH; } } /* Determine if the path is an UNC path * \\server\share */ else if( ( path_length >= 2 ) && ( path[ 0 ] == (wchar_t) '\\' ) && ( path[ 1 ] == (wchar_t) '\\' ) ) { *path_type = LIBCPATH_TYPE_UNC; } else if( path[ 0 ] == (wchar_t) '\\' ) { *path_type = LIBCPATH_TYPE_ABSOLUTE; } else if( ( path_length >= 3 ) && ( path[ 1 ] == (wchar_t) ':' ) && ( path[ 2 ] == (wchar_t) '\\' ) && ( ( ( path[ 0 ] >= (wchar_t) 'A' ) && ( path[ 0 ] <= (wchar_t) 'Z' ) ) || ( ( path[ 0 ] >= (wchar_t) 'a' ) && ( path[ 0 ] <= (wchar_t) 'z' ) ) ) ) { *path_type = LIBCPATH_TYPE_ABSOLUTE; } return( 1 ); } /* Determines the volume name * Returns 1 if succesful or -1 on error */ int libcpath_path_get_volume_name_wide( const wchar_t *path, size_t path_length, wchar_t **volume_name, size_t *volume_name_length, size_t *directory_name_index, libcerror_error_t **error ) { static char *function = "libcpath_path_get_volume_name_wide"; size_t path_index = 0; size_t share_name_index = 0; size_t volume_name_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( volume_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid volume name.", function ); return( -1 ); } if( volume_name_length == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid volume name length.", function ); return( -1 ); } if( directory_name_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name index.", function ); return( -1 ); } *volume_name = NULL; *volume_name_length = 0; *directory_name_index = 0; /* Determine if the path is a special path * device path prefix: \\.\ * extended-length path prefix: \\?\ */ if( ( path_length >= 4 ) && ( path[ 0 ] == (wchar_t) '\\' ) && ( path[ 1 ] == (wchar_t) '\\' ) && ( ( path[ 2 ] == (wchar_t) '.' ) || ( path[ 2 ] == (wchar_t) '?' ) ) && ( path[ 3 ] == (wchar_t) '\\' ) ) { if( path[ 2 ] == (wchar_t) '.' ) { volume_name_index = 4; } /* Determine if the path in an extended-length UNC path * \\?\UNC\server\share */ else if( ( path_length >= 8 ) && ( path[ 4 ] == (wchar_t) 'U' ) && ( path[ 5 ] == (wchar_t) 'N' ) && ( path[ 6 ] == (wchar_t) 'C' ) && ( path[ 7 ] == (wchar_t) '\\' ) ) { volume_name_index = 8; } else { volume_name_index = 4; } } /* Determine if the path is an UNC path * \\server\share */ else if( ( path_length >= 2 ) && ( path[ 0 ] == (wchar_t) '\\' ) && ( path[ 1 ] == (wchar_t) '\\' ) ) { volume_name_index = 2; } /* Check if the path contains a volume letter */ if( ( path_length >= 2 ) && ( volume_name_index <= ( path_length - 2 ) ) && ( path[ volume_name_index + 1 ] == (wchar_t) ':' ) && ( ( ( path[ volume_name_index ] >= (wchar_t) 'A' ) && ( path[ volume_name_index ] <= (wchar_t) 'Z' ) ) || ( ( path[ volume_name_index ] >= (wchar_t) 'a' ) && ( path[ volume_name_index ] <= (wchar_t) 'z' ) ) ) ) { path_index = volume_name_index + 2; if( ( path_index < path_length ) && ( path[ path_index ] == (wchar_t) '\\' ) ) { path_index++; } *volume_name = (wchar_t *) &( path[ volume_name_index ] ); *volume_name_length = path_index - volume_name_index; if( path[ path_index - 1 ] == (wchar_t) '\\' ) { *volume_name_length -= 1; } *directory_name_index = path_index; } else if( volume_name_index == 4 ) { for( path_index = volume_name_index; path_index < path_length; path_index++ ) { if( path[ path_index ] == (wchar_t) '\\' ) { path_index++; break; } } *volume_name = (wchar_t *) &( path[ 4 ] ); *volume_name_length = path_index - 4; if( path[ path_index - 1 ] == (wchar_t) '\\' ) { *volume_name_length -= 1; } *directory_name_index = path_index; } else if( ( volume_name_index == 2 ) || ( volume_name_index == 8 ) ) { for( share_name_index = volume_name_index; share_name_index < path_length; share_name_index++ ) { if( path[ share_name_index ] == (wchar_t) '\\' ) { share_name_index++; break; } } if( share_name_index > path_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid path - missing share name.", function ); return( -1 ); } for( path_index = share_name_index; path_index < path_length; path_index++ ) { if( path[ path_index ] == (wchar_t) '\\' ) { path_index++; break; } } *volume_name = (wchar_t *) &( path[ volume_name_index ] ); *volume_name_length = path_index - volume_name_index; if( path[ path_index - 1 ] == (wchar_t) '\\' ) { *volume_name_length -= 1; } *directory_name_index = path_index; } return( 1 ); } /* Retrieves the current working directory of a specific volume * Returns 1 if successful or -1 on error */ int libcpath_path_get_current_working_directory_by_volume_wide( wchar_t *volume_name, size_t volume_name_length, wchar_t **current_working_directory, size_t *current_working_directory_size, libcerror_error_t **error ) { wchar_t *change_volume_name = NULL; wchar_t *current_volume_working_directory = NULL; static char *function = "libcpath_path_get_current_working_directory_by_volume_wide"; size_t current_volume_working_directory_size = 0; int result = 1; if( current_working_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory.", function ); return( -1 ); } if( current_working_directory_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid current working directory size.", function ); return( -1 ); } /* If the path contains a volume name switch to that * volume to determine the current directory */ if( volume_name != NULL ) { if( volume_name_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid volume name length value exceeds maximum.", function ); goto on_error; } if( libcpath_path_get_current_working_directory_wide( ¤t_volume_working_directory, ¤t_volume_working_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current volume working directory.", function ); goto on_error; } change_volume_name = wide_string_allocate( volume_name_length + 1 ); if( change_volume_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create change volume name.", function ); goto on_error; } if( wide_string_copy( change_volume_name, volume_name, volume_name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set change volume name.", function ); goto on_error; } change_volume_name[ volume_name_length ] = 0; if( libcpath_path_change_directory_wide( change_volume_name, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to change current working directory.", function ); goto on_error; } memory_free( change_volume_name ); change_volume_name = NULL; } if( libcpath_path_get_current_working_directory_wide( current_working_directory, current_working_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current directory.", function ); /* Make sure the current working directory has been changed * back to its original value */ result = -1; } if( current_volume_working_directory != NULL ) { if( libcpath_path_change_directory_wide( current_volume_working_directory, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to change current working directory.", function ); goto on_error; } memory_free( current_volume_working_directory ); current_volume_working_directory = NULL; } return( result ); on_error: if( change_volume_name != NULL ) { memory_free( change_volume_name ); } if( current_volume_working_directory != NULL ) { memory_free( current_volume_working_directory ); } if( *current_working_directory != NULL ) { memory_free( *current_working_directory ); *current_working_directory = NULL; } *current_working_directory_size = 0; return( -1 ); } /* Determines the full path of the Windows path specified * The function uses the extended-length path format * (path with \\?\ prefix) * * Multiple successive \ not at the start of the path are combined into one * * Scenario's that are considered full paths: * Device path: \\.\PhysicalDrive0 * Extended-length path: \\?\C:\directory\file.txt * Extended-length UNC path: \\?\UNC\server\share\directory\file.txt * * Scenario's that are not considered full paths: * Local 'absolute' path: \directory\file.txt * Local 'relative' path: ..\directory\file.txt * Local 'relative' path: .\directory\file.txt * Volume 'absolute' path: C:\directory\file.txt * C:\..\directory\file.txt * Volume 'relative' path: C:directory\file.txt * UNC path: \\server\share\directory\file.txt * * Returns 1 if succesful or -1 on error */ int libcpath_path_get_full_path_wide( const wchar_t *path, size_t path_length, wchar_t **full_path, size_t *full_path_size, libcerror_error_t **error ) { libcsplit_wide_split_string_t *current_directory_split_string = NULL; libcsplit_wide_split_string_t *path_split_string = NULL; wchar_t *current_directory = NULL; wchar_t *current_directory_string_segment = NULL; wchar_t *full_path_prefix = NULL; wchar_t *last_used_path_string_segment = NULL; wchar_t *path_string_segment = NULL; wchar_t *volume_name = NULL; static char *function = "libcpath_path_get_full_path_wide"; size_t current_directory_length = 0; size_t current_directory_name_index = 0; size_t current_directory_size = 0; size_t current_directory_string_segment_size = 0; size_t full_path_index = 0; size_t full_path_prefix_length = 0; size_t last_used_path_string_segment_size = 0; size_t path_directory_name_index = 0; size_t path_string_segment_size = 0; size_t safe_full_path_size = 0; size_t volume_name_length = 0; uint8_t path_type = LIBCPATH_TYPE_RELATIVE; int current_directory_number_of_segments = 0; int current_directory_segment_index = 0; int last_used_path_segment_index = -1; int path_number_of_segments = 0; int path_segment_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path.", function ); return( -1 ); } if( *full_path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid full path value already set.", function ); return( -1 ); } if( full_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path size.", function ); return( -1 ); } if( libcpath_path_get_path_type_wide( path, path_length, &path_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine path type.", function ); goto on_error; } if( libcpath_path_get_volume_name_wide( path, path_length, &volume_name, &volume_name_length, &path_directory_name_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine volume name.", function ); goto on_error; } /* If the path is a device path, an extended-length path or an UNC * do not bother to lookup the current working directory */ if( ( path_type != LIBCPATH_TYPE_DEVICE ) && ( path_type != LIBCPATH_TYPE_EXTENDED_LENGTH ) && ( path_type != LIBCPATH_TYPE_EXTENDED_LENGTH_UNC ) && ( path_type != LIBCPATH_TYPE_UNC ) ) { if( libcpath_path_get_current_working_directory_by_volume_wide( volume_name, volume_name_length, ¤t_directory, ¤t_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory by volume.", function ); goto on_error; } /* Determine the volume name using the current working directory if necessary */ if( libcpath_path_get_volume_name_wide( current_directory, current_directory_size - 1, &volume_name, &volume_name_length, ¤t_directory_name_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine volume name from current working directory.", function ); goto on_error; } } if( ( current_directory != NULL ) && ( current_directory_name_index < current_directory_size ) ) { current_directory_length = wide_string_length( &( current_directory[ current_directory_name_index ] ) ); if( libcsplit_wide_string_split( &( current_directory[ current_directory_name_index ] ), current_directory_length + 1, (wchar_t) '\\', ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split current working directory.", function ); goto on_error; } } if( libcsplit_wide_string_split( &( path[ path_directory_name_index ] ), path_length - path_directory_name_index + 1, (wchar_t) '\\', &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split path.", function ); goto on_error; } /* The size of the full path consists of: * the size of the prefix (\\?\ or \\.\) * the length of the volume name * a directory separator */ safe_full_path_size = 4; /* If the path contains a volume name * the length of the volume name * a directory separator */ if( volume_name != NULL ) { safe_full_path_size += volume_name_length + 1; } /* If the path contains an UNC path * add the size of the UNC\ prefix */ if( ( path_type == LIBCPATH_TYPE_EXTENDED_LENGTH_UNC ) || ( path_type == LIBCPATH_TYPE_UNC ) ) { safe_full_path_size += 4; } /* If the path is relative * add the size of the current working directory * a directory separator, if necessary */ if( ( path_type == LIBCPATH_TYPE_RELATIVE ) && ( current_directory_name_index < current_directory_size ) ) { safe_full_path_size += ( current_directory_size - ( current_directory_name_index + 1 ) ); if( ( current_directory_size >= 2 ) && ( current_directory[ current_directory_size - 2 ] != (wchar_t) '\\' ) ) { safe_full_path_size += 1; } } if( current_directory_split_string != NULL ) { if( libcsplit_wide_split_string_get_number_of_segments( current_directory_split_string, ¤t_directory_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of current working directory string segments.", function ); goto on_error; } current_directory_segment_index = current_directory_number_of_segments - 1; } if( libcsplit_wide_split_string_get_number_of_segments( path_split_string, &path_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of path string segments.", function ); goto on_error; } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } /* If the path is .. reverse the current path by one directory */ if( ( path_string_segment_size == 3 ) && ( path_string_segment[ 0 ] == (wchar_t) '.' ) && ( path_string_segment[ 1 ] == (wchar_t) '.' ) ) { if( ( current_directory_split_string != NULL ) && ( last_used_path_segment_index == -1 ) ) { if( libcsplit_wide_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= current_directory_string_segment_size; if( libcsplit_wide_split_string_set_segment_by_index( current_directory_split_string, current_directory_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } current_directory_segment_index--; } else if( last_used_path_segment_index >= 0 ) { if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used path string string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= last_used_path_string_segment_size; if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, last_used_path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Find the previous path split value that contains a name */ while( last_used_path_segment_index > 0 ) { last_used_path_segment_index--; if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment_size != 0 ) { break; } } } if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is . ignore the entry */ else if( ( path_string_segment_size == 2 ) && ( path_string_segment[ 0 ] == (wchar_t) '.' ) ) { if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is empty ignore the entry */ else if( path_string_segment_size <= 1 ) { if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } else { /* Add the size of the directory or file name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size += path_string_segment_size; last_used_path_segment_index = path_segment_index; } } /* Note that the last path separator serves as the end of string */ full_path_index = 0; *full_path = wide_string_allocate( safe_full_path_size ); if( *full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create full path.", function ); goto on_error; } if( memory_set( *full_path, 0, sizeof( wchar_t ) * safe_full_path_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear full path.", function ); goto on_error; } *full_path_size = safe_full_path_size; if( path_type == LIBCPATH_TYPE_DEVICE ) { full_path_prefix = L"\\\\.\\"; full_path_prefix_length = 4; } else { full_path_prefix = L"\\\\?\\"; full_path_prefix_length = 4; } if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), full_path_prefix, full_path_prefix_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set prefix in full path.", function ); goto on_error; } full_path_index += full_path_prefix_length; /* If there is a share name the path is an UNC path */ if( ( path_type == LIBCPATH_TYPE_EXTENDED_LENGTH_UNC ) || ( path_type == LIBCPATH_TYPE_UNC ) ) { if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), L"UNC\\", 4 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set UNC\\ prefix in full path.", function ); goto on_error; } full_path_index += 4; } if( volume_name != NULL ) { if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), volume_name, volume_name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set volume name in full path.", function ); goto on_error; } full_path_index += volume_name_length; ( *full_path )[ full_path_index ] = (wchar_t) '\\'; full_path_index += 1; } /* If the path is relative * add the current working directory elements */ if( ( path_type == LIBCPATH_TYPE_RELATIVE ) && ( current_directory_split_string != NULL ) ) { for( current_directory_segment_index = 0; current_directory_segment_index < current_directory_number_of_segments; current_directory_segment_index++ ) { if( libcsplit_wide_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment_size != 0 ) { if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), current_directory_string_segment, current_directory_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory split value: %d in full path.", function, current_directory_segment_index ); goto on_error; } full_path_index += current_directory_string_segment_size - 1; ( *full_path )[ full_path_index ] = (wchar_t) '\\'; full_path_index += 1; } } } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment_size != 0 ) { if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), path_string_segment, path_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path split value: %d in full path.", function, path_segment_index ); goto on_error; } full_path_index += path_string_segment_size - 1; ( *full_path )[ full_path_index ] = (wchar_t) '\\'; full_path_index += 1; } } ( *full_path )[ full_path_index - 1 ] = 0; if( libcsplit_wide_split_string_free( &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free path split string.", function ); goto on_error; } if( current_directory_split_string != NULL ) { if( libcsplit_wide_split_string_free( ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free current working directory split string.", function ); goto on_error; } } if( current_directory != NULL ) { memory_free( current_directory ); } return( 1 ); on_error: if( *full_path != NULL ) { memory_free( *full_path ); *full_path = NULL; } *full_path_size = 0; if( path_split_string != NULL ) { libcsplit_wide_split_string_free( &path_split_string, NULL ); } if( current_directory_split_string != NULL ) { libcsplit_wide_split_string_free( ¤t_directory_split_string, NULL ); } if( current_directory != NULL ) { memory_free( current_directory ); } return( -1 ); } #else /* Determines the full path of the POSIX path specified * Multiple successive / are combined into one * * Scenarios: * /home/user/file.txt * /home/user//file.txt * /home/user/../user/file.txt * /../home/user/file.txt * user/../user/file.txt * * Returns 1 if succesful or -1 on error */ int libcpath_path_get_full_path_wide( const wchar_t *path, size_t path_length, wchar_t **full_path, size_t *full_path_size, libcerror_error_t **error ) { libcsplit_wide_split_string_t *current_directory_split_string = NULL; libcsplit_wide_split_string_t *path_split_string = NULL; wchar_t *current_directory = NULL; wchar_t *current_directory_string_segment = NULL; wchar_t *last_used_path_string_segment = NULL; wchar_t *path_string_segment = NULL; static char *function = "libcpath_path_get_full_path_wide"; size_t current_directory_length = 0; size_t current_directory_size = 0; size_t current_directory_string_segment_size = 0; size_t full_path_index = 0; size_t last_used_path_string_segment_size = 0; size_t path_string_segment_size = 0; size_t safe_full_path_size = 0; uint8_t path_type = LIBCPATH_TYPE_RELATIVE; int current_directory_number_of_segments = 0; int current_directory_segment_index = 0; int last_used_path_segment_index = -1; int path_number_of_segments = 0; int path_segment_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path.", function ); return( -1 ); } if( *full_path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid full path value already set.", function ); return( -1 ); } if( full_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid full path size.", function ); return( -1 ); } if( path[ 0 ] == (wchar_t) '/' ) { path_type = LIBCPATH_TYPE_ABSOLUTE; } else { if( libcpath_path_get_current_working_directory_wide( ¤t_directory, ¤t_directory_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory.", function ); goto on_error; } } if( current_directory != NULL ) { current_directory_length = wide_string_length( current_directory ); if( libcsplit_wide_string_split( current_directory, current_directory_length + 1, (wchar_t) '/', ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split current working directory.", function ); goto on_error; } } if( libcsplit_wide_string_split( path, path_length + 1, (wchar_t) '/', &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split path.", function ); goto on_error; } /* Determine the full path size */ /* If the path is absolute * a directory separator */ if( path_type == LIBCPATH_TYPE_ABSOLUTE ) { safe_full_path_size = 1; } /* If the path is relative * add the size of the current working directory * a directory separator, if necessary */ else if( path_type == LIBCPATH_TYPE_RELATIVE ) { if( current_directory == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory.", function ); goto on_error; } /* We need to use the length here since current_directory_size will be PATH_MAX */ safe_full_path_size = current_directory_length; if( ( current_directory_length >= 1 ) && ( current_directory[ current_directory_length - 1 ] != (wchar_t) '/' ) ) { safe_full_path_size++; } } if( current_directory_split_string != NULL ) { if( libcsplit_wide_split_string_get_number_of_segments( current_directory_split_string, ¤t_directory_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of current working directory string segments.", function ); goto on_error; } current_directory_segment_index = current_directory_number_of_segments - 1; } if( libcsplit_wide_split_string_get_number_of_segments( path_split_string, &path_number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of path string segments.", function ); goto on_error; } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } /* If the path is .. reverse the current path by one directory */ if( ( path_string_segment_size == 3 ) && ( path_string_segment[ 0 ] == (wchar_t) '.' ) && ( path_string_segment[ 1 ] == (wchar_t) '.' ) ) { if( ( current_directory_split_string != NULL ) && ( last_used_path_segment_index == -1 ) ) { if( libcsplit_wide_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= current_directory_string_segment_size; if( libcsplit_wide_split_string_set_segment_by_index( current_directory_split_string, current_directory_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } current_directory_segment_index--; } else if( last_used_path_segment_index >= 0 ) { if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing last used path string string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Remove the size of the parent directory name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size -= last_used_path_string_segment_size; if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, last_used_path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } /* Find the previous path split value that contains a name */ while( last_used_path_segment_index > 0 ) { last_used_path_segment_index--; if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, last_used_path_segment_index, &last_used_path_string_segment, &last_used_path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last used path string segment: %d.", function, last_used_path_segment_index ); goto on_error; } if( last_used_path_string_segment_size != 0 ) { break; } } } if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is . ignore the entry */ else if( ( path_string_segment_size == 2 ) && ( path_string_segment[ 0 ] == (wchar_t) '.' ) ) { if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } /* If the path is empty ignore the entry */ else if( path_string_segment_size <= 1 ) { if( libcsplit_wide_split_string_set_segment_by_index( path_split_string, path_segment_index, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path string segment: %d.", function, path_segment_index ); goto on_error; } } else { /* Add the size of the directory or file name and a directory separator * Note that the size includes the end of string character */ safe_full_path_size += path_string_segment_size; last_used_path_segment_index = path_segment_index; } } /* Note that the last path separator serves as the end of string */ full_path_index = 0; *full_path = wide_string_allocate( safe_full_path_size ); if( *full_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create full path.", function ); goto on_error; } if( memory_set( *full_path, 0, sizeof( wchar_t ) * safe_full_path_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear full path.", function ); goto on_error; } *full_path_size = safe_full_path_size; if( path_type == LIBCPATH_TYPE_ABSOLUTE ) { ( *full_path )[ full_path_index ] = (wchar_t) '/'; full_path_index += 1; } /* If the path is relative * add the current working directory elements */ if( ( path_type == LIBCPATH_TYPE_RELATIVE ) && ( current_directory_split_string != NULL ) ) { for( current_directory_segment_index = 0; current_directory_segment_index < current_directory_number_of_segments; current_directory_segment_index++ ) { if( libcsplit_wide_split_string_get_segment_by_index( current_directory_split_string, current_directory_segment_index, ¤t_directory_string_segment, ¤t_directory_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( current_directory_string_segment_size != 0 ) { if( current_directory_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing current working directory string segment: %d.", function, current_directory_segment_index ); goto on_error; } if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), current_directory_string_segment, current_directory_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current working directory split value: %d in full path.", function, current_directory_segment_index ); goto on_error; } full_path_index += current_directory_string_segment_size - 1; ( *full_path )[ full_path_index ] = (wchar_t) '/'; full_path_index += 1; } } } for( path_segment_index = 0; path_segment_index < path_number_of_segments; path_segment_index++ ) { if( libcsplit_wide_split_string_get_segment_by_index( path_split_string, path_segment_index, &path_string_segment, &path_string_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path string segment: %d.", function, path_segment_index ); goto on_error; } if( path_string_segment_size != 0 ) { if( path_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path string segment: %d.", function, path_segment_index ); goto on_error; } if( wide_string_copy( &( ( *full_path )[ full_path_index ] ), path_string_segment, path_string_segment_size - 1 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path split value: %d in full path.", function, path_segment_index ); goto on_error; } full_path_index += path_string_segment_size - 1; ( *full_path )[ full_path_index ] = (wchar_t) '/'; full_path_index += 1; } } ( *full_path )[ full_path_index - 1 ] = 0; if( libcsplit_wide_split_string_free( &path_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free path split string.", function ); goto on_error; } if( current_directory_split_string != NULL ) { if( libcsplit_wide_split_string_free( ¤t_directory_split_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free current working directory split string.", function ); goto on_error; } } if( current_directory != NULL ) { memory_free( current_directory ); } return( 1 ); on_error: if( *full_path != NULL ) { memory_free( *full_path ); *full_path = NULL; } *full_path_size = 0; if( path_split_string != NULL ) { libcsplit_wide_split_string_free( &path_split_string, NULL ); } if( current_directory_split_string != NULL ) { libcsplit_wide_split_string_free( ¤t_directory_split_string, NULL ); } if( current_directory != NULL ) { memory_free( current_directory ); } return( -1 ); } #endif /* defined( WINAPI ) */ /* Retrieves the size of a sanitized version of the path character * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_character_size_wide( wchar_t character, size_t *sanitized_character_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_character_size_wide"; if( sanitized_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized character size.", function ); return( -1 ); } if( ( character >= 0x00 ) && ( character <= 0x1f ) ) { *sanitized_character_size = 4; } else if( character == (wchar_t) LIBCPATH_ESCAPE_CHARACTER ) { *sanitized_character_size = 2; } #if defined( WINAPI ) else if( character == (wchar_t) '/' ) { *sanitized_character_size = 4; } #endif else if( ( character == (wchar_t) '!' ) || ( character == (wchar_t) '$' ) || ( character == (wchar_t) '%' ) || ( character == (wchar_t) '&' ) || ( character == (wchar_t) '*' ) || ( character == (wchar_t) '+' ) || ( character == (wchar_t) ':' ) || ( character == (wchar_t) ';' ) || ( character == (wchar_t) '<' ) || ( character == (wchar_t) '>' ) || ( character == (wchar_t) '?' ) || ( character == (wchar_t) '|' ) || ( character == 0x7f ) ) { *sanitized_character_size = 4; } else { *sanitized_character_size = 1; } return( 1 ); } /* Retrieves a sanitized version of the path character * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_character_wide( wchar_t character, size_t sanitized_character_size, wchar_t *sanitized_path, size_t sanitized_path_size, size_t *sanitized_path_index, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_character_wide"; size_t safe_sanitized_path_index = 0; wchar_t lower_nibble = 0; wchar_t upper_nibble = 0; if( ( sanitized_character_size != 1 ) && ( sanitized_character_size != 2 ) && ( sanitized_character_size != 4 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sanitized character size value out of bounds.", function ); return( -1 ); } if( sanitized_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path.", function ); return( -1 ); } if( sanitized_path_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sanitized path size value exceeds maximum.", function ); return( -1 ); } if( sanitized_path_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path index.", function ); return( -1 ); } safe_sanitized_path_index = *sanitized_path_index; if( safe_sanitized_path_index > sanitized_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sanitized path index value out of bounds.", function ); return( -1 ); } if( ( sanitized_character_size > sanitized_path_size ) || ( safe_sanitized_path_index > ( sanitized_path_size - sanitized_character_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid sanitized path size value too small.", function ); return( -1 ); } if( sanitized_character_size == 1 ) { sanitized_path[ safe_sanitized_path_index++ ] = character; } else if( sanitized_character_size == 2 ) { sanitized_path[ safe_sanitized_path_index++ ] = (wchar_t) LIBCPATH_ESCAPE_CHARACTER; sanitized_path[ safe_sanitized_path_index++ ] = (wchar_t) LIBCPATH_ESCAPE_CHARACTER; } else if( sanitized_character_size == 4 ) { lower_nibble = character & 0x0f; upper_nibble = ( character >> 4 ) & 0x0f; if( lower_nibble > 10 ) { lower_nibble += (wchar_t) 'a' - 10; } else { lower_nibble += '0'; } if( upper_nibble > 10 ) { upper_nibble += (wchar_t) 'a' - 10; } else { upper_nibble += '0'; } sanitized_path[ safe_sanitized_path_index++ ] = (wchar_t) LIBCPATH_ESCAPE_CHARACTER; sanitized_path[ safe_sanitized_path_index++ ] = (wchar_t) 'x'; sanitized_path[ safe_sanitized_path_index++ ] = upper_nibble; sanitized_path[ safe_sanitized_path_index++ ] = lower_nibble; } *sanitized_path_index = safe_sanitized_path_index; return( 1 ); } /* Retrieves a sanitized version of the filename * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_filename_wide( const wchar_t *filename, size_t filename_length, wchar_t **sanitized_filename, size_t *sanitized_filename_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_filename_wide"; wchar_t *safe_sanitized_filename = NULL; size_t filename_index = 0; size_t sanitized_character_size = 0; size_t safe_sanitized_filename_size = 0; size_t sanitized_filename_index = 0; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid filename length is zero.", function ); return( -1 ); } if( filename_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename length value exceeds maximum.", function ); return( -1 ); } if( sanitized_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized filename.", function ); return( -1 ); } if( *sanitized_filename != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sanitized filename value already set.", function ); return( -1 ); } if( sanitized_filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized filename size.", function ); return( -1 ); } safe_sanitized_filename_size = 1; for( filename_index = 0; filename_index < filename_length; filename_index++ ) { if( filename[ filename_index ] == LIBCPATH_SEPARATOR ) { sanitized_character_size = 4; } else if( libcpath_path_get_sanitized_character_size_wide( filename[ filename_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } safe_sanitized_filename_size += sanitized_character_size; } if( safe_sanitized_filename_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sanitized filename size value exceeds maximum.", function ); goto on_error; } safe_sanitized_filename = wide_string_allocate( safe_sanitized_filename_size ); if( safe_sanitized_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sanitized filename.", function ); goto on_error; } for( filename_index = 0; filename_index < filename_length; filename_index++ ) { if( filename[ filename_index ] == LIBCPATH_SEPARATOR ) { sanitized_character_size = 4; } else if( libcpath_path_get_sanitized_character_size_wide( filename[ filename_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } if( libcpath_path_get_sanitized_character_wide( filename[ filename_index ], sanitized_character_size, safe_sanitized_filename, safe_sanitized_filename_size, &sanitized_filename_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } } safe_sanitized_filename[ sanitized_filename_index ] = 0; *sanitized_filename = safe_sanitized_filename; *sanitized_filename_size = safe_sanitized_filename_size; return( 1 ); on_error: if( safe_sanitized_filename != NULL ) { memory_free( safe_sanitized_filename ); } return( -1 ); } /* Retrieves a sanitized version of the path * Returns 1 if successful or -1 on error */ int libcpath_path_get_sanitized_path_wide( const wchar_t *path, size_t path_length, wchar_t **sanitized_path, size_t *sanitized_path_size, libcerror_error_t **error ) { static char *function = "libcpath_path_get_sanitized_path_wide"; wchar_t *safe_sanitized_path = NULL; size_t path_index = 0; size_t safe_sanitized_path_size = 0; size_t sanitized_character_size = 0; size_t sanitized_path_index = 0; #if defined( WINAPI ) size_t last_path_segment_seperator_index = 0; #endif if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid path length is zero.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( sanitized_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path.", function ); return( -1 ); } if( *sanitized_path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sanitized path value already set.", function ); return( -1 ); } if( sanitized_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sanitized path size.", function ); return( -1 ); } safe_sanitized_path_size = 1; for( path_index = 0; path_index < path_length; path_index++ ) { if( libcpath_path_get_sanitized_character_size_wide( path[ path_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } safe_sanitized_path_size += sanitized_character_size; #if defined( WINAPI ) if( path[ path_index ] == LIBCPATH_SEPARATOR ) { last_path_segment_seperator_index = path_index; } #endif } if( safe_sanitized_path_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid sanitized path size value exceeds maximum.", function ); goto on_error; } #if defined( WINAPI ) if( last_path_segment_seperator_index > 32767 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: last path segment separator value out of bounds.", function ); goto on_error; } if( safe_sanitized_path_size > 32767 ) { safe_sanitized_path_size = 32767; } #endif safe_sanitized_path = wide_string_allocate( safe_sanitized_path_size ); if( safe_sanitized_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sanitized path.", function ); goto on_error; } for( path_index = 0; path_index < path_length; path_index++ ) { if( libcpath_path_get_sanitized_character_size_wide( path[ path_index ], &sanitized_character_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } if( libcpath_path_get_sanitized_character_wide( path[ path_index ], sanitized_character_size, safe_sanitized_path, safe_sanitized_path_size, &sanitized_path_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sanitize character size.", function ); goto on_error; } } safe_sanitized_path[ sanitized_path_index ] = 0; *sanitized_path = safe_sanitized_path; *sanitized_path_size = safe_sanitized_path_size; return( 1 ); on_error: if( safe_sanitized_path != NULL ) { memory_free( safe_sanitized_path ); } return( -1 ); } /* Combines the directory name and filename into a path * Returns 1 if successful or -1 on error */ int libcpath_path_join_wide( wchar_t **path, size_t *path_size, const wchar_t *directory_name, size_t directory_name_length, const wchar_t *filename, size_t filename_length, libcerror_error_t **error ) { static char *function = "libcpath_path_join_wide"; size_t filename_index = 0; size_t path_index = 0; if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( *path != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid path value already set.", function ); return( -1 ); } if( path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path size.", function ); return( -1 ); } if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } if( directory_name_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid directory name length value exceeds maximum.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename length value exceeds maximum.", function ); return( -1 ); } /* TODO strip other patterns like /./ */ while( directory_name_length > 0 ) { if( directory_name[ directory_name_length - 1 ] != (wchar_t) LIBCPATH_SEPARATOR ) { break; } directory_name_length--; } while( filename_length > 0 ) { if( filename[ filename_index ] != (wchar_t) LIBCPATH_SEPARATOR ) { break; } filename_index++; filename_length--; } *path_size = directory_name_length + filename_length + 2; *path = wide_string_allocate( *path_size ); if( *path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create path.", function ); goto on_error; } if( wide_string_copy( *path, directory_name, directory_name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy directory name to path.", function ); goto on_error; } path_index = directory_name_length; ( *path )[ path_index++ ] = (wchar_t) LIBCPATH_SEPARATOR; if( wide_string_copy( &( ( *path )[ path_index ] ), &( filename[ filename_index ] ), filename_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy filename to path.", function ); goto on_error; } path_index += filename_length; ( *path )[ path_index ] = 0; return( 1 ); on_error: if( *path != NULL ) { memory_free( path ); *path = NULL; } *path_size = 0; return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of CreateDirectoryW * Returns TRUE if successful or FALSE on error */ BOOL libcpath_CreateDirectoryW( LPCWSTR path, SECURITY_ATTRIBUTES *security_attributes ) { FARPROC function = NULL; HMODULE library_handle = NULL; BOOL result = FALSE; if( path == NULL ) { return( 0 ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "CreateDirectoryW" ); if( function != NULL ) { result = function( path, security_attributes ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { libcpath_CloseHandle( library_handle ); return( 0 ); } return( result ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) /* Makes the directory * This function uses the WINAPI function for Windows XP (0x0501) or later * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ int libcpath_path_make_directory_wide( const wchar_t *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_make_directory_wide"; DWORD error_code = 0; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } #if defined( WINAPI ) && ( WINVER <= 0x0500 ) if( libcpath_CreateDirectoryW( directory_name, NULL ) == 0 ) #else if( CreateDirectoryW( directory_name, NULL ) == 0 ) #endif { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, error_code, "%s: unable to make directory.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_MKDIR ) /* Makes the directory * This function uses the POSIX mkdir function or equivalent * Returns 1 if successful or -1 on error */ int libcpath_path_make_directory_wide( const wchar_t *directory_name, libcerror_error_t **error ) { static char *function = "libcpath_path_make_directory_wide"; char *narrow_directory_name = 0; size_t directory_name_length = 0; size_t narrow_directory_name_size = 0; if( directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid directory name.", function ); return( -1 ); } directory_name_length = wide_string_length( directory_name ); if( libcpath_system_string_size_from_wide_string( directory_name, directory_name_length + 1, &narrow_directory_name_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow directory name size.", function ); goto on_error; } if( ( narrow_directory_name_size > (size_t) SSIZE_MAX ) || ( ( sizeof( char ) * narrow_directory_name_size ) > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow directory name size value exceeds maximum.", function ); goto on_error; } narrow_directory_name = narrow_string_allocate( narrow_directory_name_size ); if( narrow_directory_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create narrow directory name.", function ); goto on_error; } if( libcpath_system_string_copy_from_wide_string( narrow_directory_name, narrow_directory_name_size, directory_name, directory_name_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set name.", function ); goto on_error; } if( mkdir( narrow_directory_name, 0755 ) != 0 ) { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, errno, "%s: unable to make directory.", function ); goto on_error; } memory_free( narrow_directory_name ); return( 1 ); on_error: if( narrow_directory_name != NULL ) { memory_free( narrow_directory_name ); } return( -1 ); } #else #error Missing make directory function #endif #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libcpath/libcpath_system_string.c0000664000175000017500000006173213443450040024051 0ustar00lordyestalordyesta00000000000000/* * System string functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #include #include #include #include "libcpath_libcerror.h" #include "libcpath_libclocale.h" #include "libcpath_libuna.h" #include "libcpath_system_string.h" #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 #error Unsupported size of wchar_t #endif /* Determines the size of a narrow string from a system string * Returns 1 if successful or -1 on error */ int libcpath_system_string_size_to_narrow_string( const system_character_t *system_string, size_t system_string_size, size_t *narrow_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_size_to_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) system_string, system_string_size, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) system_string, system_string_size, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) system_string, system_string_size, libclocale_codepage, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) system_string, system_string_size, libclocale_codepage, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine narrow string size.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string size.", function ); return( -1 ); } *narrow_string_size = system_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string to a narrow string * Returns 1 if successful or -1 on error */ int libcpath_system_string_copy_to_narrow_string( const system_character_t *system_string, size_t system_string_size, char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_copy_to_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) narrow_string, narrow_string_size, (libuna_utf32_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) narrow_string, narrow_string_size, (libuna_utf16_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, (libuna_utf32_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, (libuna_utf16_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set narrow string.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string_size < system_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid narrow string size value too small.", function ); return( -1 ); } if( system_string_copy( narrow_string, system_string, system_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set narrow string.", function ); return( -1 ); } narrow_string[ system_string_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Determines the size of a system string from a narrow string * Returns 1 if successful or -1 on error */ int libcpath_system_string_size_from_narrow_string( const char *narrow_string, size_t narrow_string_size, size_t *system_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_size_from_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) narrow_string, narrow_string_size, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) narrow_string, narrow_string_size, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine system string size.", function ); return( -1 ); } #else if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string size.", function ); return( -1 ); } *system_string_size = narrow_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string from a narrow string * Returns 1 if successful or -1 on error */ int libcpath_system_string_copy_from_narrow_string( system_character_t *system_string, size_t system_string_size, const char *narrow_string, size_t narrow_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_copy_from_narrow_string"; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) system_string, system_string_size, (libuna_utf8_character_t *) narrow_string, narrow_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) system_string, system_string_size, (libuna_utf8_character_t *) narrow_string, narrow_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) system_string, system_string_size, (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) system_string, system_string_size, (uint8_t *) narrow_string, narrow_string_size, libclocale_codepage, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set system string.", function ); return( -1 ); } #else if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( narrow_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid narrow string.", function ); return( -1 ); } if( narrow_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid narrow string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size < narrow_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid system string size value too small.", function ); return( -1 ); } if( system_string_copy( system_string, narrow_string, narrow_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set narrow string.", function ); return( -1 ); } system_string[ narrow_string_size - 1 ] = 0; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Determines the size of a wide string from a system string * Returns 1 if successful or -1 on error */ int libcpath_system_string_size_to_wide_string( const system_character_t *system_string, size_t system_string_size, size_t *wide_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_size_to_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string size.", function ); return( -1 ); } *wide_string_size = system_string_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_utf8( (libuna_utf8_character_t *) system_string, system_string_size, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_utf8( (libuna_utf8_character_t *) system_string, system_string_size, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_size_from_byte_stream( (uint8_t *) system_string, system_string_size, libclocale_codepage, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_size_from_byte_stream( (uint8_t *) system_string, system_string_size, libclocale_codepage, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide string size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string to a wide string * Returns 1 if successful or -1 on error */ int libcpath_system_string_copy_to_wide_string( const system_character_t *system_string, size_t system_string_size, wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_copy_to_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( wide_string_size < system_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid wide string size value too small.", function ); return( -1 ); } if( system_string_copy( wide_string, system_string, system_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set wide string.", function ); return( -1 ); } wide_string[ system_string_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) wide_string, wide_string_size, (libuna_utf8_character_t *) system_string, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) wide_string, wide_string_size, (libuna_utf8_character_t *) system_string, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_utf32_string_copy_from_byte_stream( (libuna_utf32_character_t *) wide_string, wide_string_size, (uint8_t *) system_string, system_string_size, libclocale_codepage, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf16_string_copy_from_byte_stream( (libuna_utf16_character_t *) wide_string, wide_string_size, (uint8_t *) system_string, system_string_size, libclocale_codepage, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set wide string.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Determines the size of a system string from a wide string * Returns 1 if successful or -1 on error */ int libcpath_system_string_size_from_wide_string( const wchar_t *wide_string, size_t wide_string_size, size_t *system_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_size_from_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string size.", function ); return( -1 ); } *system_string_size = wide_string_size; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) wide_string, wide_string_size, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) wide_string, wide_string_size, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_size_from_utf32( (libuna_utf32_character_t *) wide_string, wide_string_size, libclocale_codepage, system_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_size_from_utf16( (libuna_utf16_character_t *) wide_string, wide_string_size, libclocale_codepage, system_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine wide string size.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } /* Copies a system string from a wide string * Returns 1 if successful or -1 on error */ int libcpath_system_string_copy_from_wide_string( system_character_t *system_string, size_t system_string_size, const wchar_t *wide_string, size_t wide_string_size, libcerror_error_t **error ) { static char *function = "libcpath_system_string_copy_from_wide_string"; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid system string.", function ); return( -1 ); } if( system_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid system string size value exceeds maximum.", function ); return( -1 ); } if( wide_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid wide string.", function ); return( -1 ); } if( wide_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid wide string size value exceeds maximum.", function ); return( -1 ); } if( system_string_size < wide_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid system string size value too small.", function ); return( -1 ); } if( system_string_copy( system_string, wide_string, wide_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set wide string.", function ); return( -1 ); } system_string[ wide_string_size - 1 ] = 0; #else if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 result = libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) system_string, system_string_size, (libuna_utf32_character_t *) wide_string, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) system_string, system_string_size, (libuna_utf16_character_t *) wide_string, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } else { #if SIZEOF_WCHAR_T == 4 result = libuna_byte_stream_copy_from_utf32( (uint8_t *) system_string, system_string_size, libclocale_codepage, (libuna_utf32_character_t *) wide_string, wide_string_size, error ); #elif SIZEOF_WCHAR_T == 2 result = libuna_byte_stream_copy_from_utf16( (uint8_t *) system_string, system_string_size, libclocale_codepage, (libuna_utf16_character_t *) wide_string, wide_string_size, error ); #endif /* SIZEOF_WCHAR_T */ } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set wide string.", function ); return( -1 ); } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libcpath/libcpath_support.h0000664000175000017500000000266713443450040022662 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2018, 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( _LIBCPATH_SUPPORT_H ) #define _LIBCPATH_SUPPORT_H #include #include #include "libcpath_extern.h" #include "libcpath_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCPATH ) LIBCPATH_EXTERN \ const char *libcpath_get_version( void ); LIBCPATH_EXTERN \ int libcpath_get_codepage( int *codepage, libcerror_error_t **error ); LIBCPATH_EXTERN \ int libcpath_set_codepage( int codepage, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBCPATH ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCPATH_SUPPORT_H ) */ libewf-20140807/libcpath/libcpath_libuna.h0000664000175000017500000000331213443450040022404 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2008-2018, 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( _LIBCPATH_LIBUNA_H ) #define _LIBCPATH_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBCPATH_LIBUNA_H ) */ libewf-20140807/manuals/0000775000175000017500000000000013443455447017006 5ustar00lordyestalordyesta00000000000000libewf-20140807/manuals/ewfacquirestream.10000644000175000017500000001344213440662656022440 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfacquirestream .Os libewf .Sh NAME .Nm ewfacquirestream .Nd acquires data in the EWF format from stdin .Sh SYNOPSIS .Nm ewfacquirestream .Op Fl A Ar codepage .Op Fl b Ar number_of_sectors .Op Fl B Ar number_of_bytes .Op Fl c Ar compression_values .Op Fl C Ar case_number .Op Fl d Ar digest_type .Op Fl D Ar description .Op Fl e Ar examiner_name .Op Fl E Ar evidence_number .Op Fl f Ar format .Op Fl l Ar log_filename .Op Fl m Ar media_type .Op Fl M Ar media_flags .Op Fl N Ar notes .Op Fl o Ar offset .Op Fl p Ar process_buffer_size .Op Fl P Ar bytes_per_sector .Op Fl S Ar segment_file_size .Op Fl t Ar target .Op Fl 2 Ar secondary_target .Op Fl hqsvVx .Sh DESCRIPTION .Nm ewfacquirestream is a utility to acquire media data from stdin and store it in EWF format (Expert Witness Format). .Nm ewfacquirestream acquires media data in a format equivalent to EnCase and FTK imager, including meta data. Under Linux, FreeBSD, NetBSD, OpenBSD, MacOS\-X/Darwin .Pp .Nm ewfacquirestream is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp The options are as follows: .Bl -tag -width Ds .It Fl A Ar codepage the codepage of header section, options: ascii (default), windows-874, windows-932, windows-936, windows-949, windows-950, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257 or windows-1258 .It Fl b Ar number_of_sectors the number of sectors to read at once (per chunk), options: 16, 32, 64 (default), 128, 256, 512, 1024, 2048, 4096, 8192, 16384 or 32768 .It Fl B Ar number_of_bytes the number of bytes to acquire .It Fl c Ar compression_values specify the compression values as: level or method:level compression method options: deflate (default), bzip2 (bzip2 is only supported by EWF2 formats) compression level options: none (default), empty-block, fast or best .It Fl C Ar case_number the case number (default is case_number) .It Fl d Ar digest_type calculate additional digest (hash) types besides md5, options: sha1, sha256 .It Fl D Ar description the description (default is description) .It Fl e Ar examiner_name the examiner name (default is examiner_name) .It Fl E Ar evidence_number the evidence number (default is evidence_number) .It Fl f Ar format the EWF file format to write to, options: ftk, encase2, encase3, encase4, encase5, encase6 (default), encase7, linen5, linen6, linen7, ewfx. .Nm libewf does not support streamed writes for other EWF formats. .It Fl h shows this help .It Fl l Ar log_filename logs acquiry errors and the digest (hash) to the log filename .It Fl m Ar media_type the media type, options: fixed (default), removable, optical, memory .It Fl M Ar media_flags the media flags, options: logical, physical (default) .It Fl N Ar notes the notes (default is notes) .It Fl o Ar offset the offset to start to acquire (default is 0) .It Fl p Ar process_buffer_size the process buffer size (default is the chunk size) .It Fl P Ar bytes_per_sector the number of bytes per sector (default is 512) .It Fl q quiet shows minimal status information .It Fl s swap byte pairs of the media data (from AB to BA) (use this for big to little endian conversion and vice versa) .It Fl S Ar segment_file_size the segment file size in bytes (default is 1.4 GiB) (minimum is 1.0 MiB, maximum is 7.9 EiB for encase6 and encase7 format and 1.9 GiB for other formats) .It Fl t Ar target the target file (without extension) to write to (default is image) .It Fl v verbose output to stderr .It Fl V print version .It Fl x use the chunk data instead of the buffered read and write functions. .It Fl 2 Ar secondary_target the secondary target file (without extension) to write to .El .Pp .Nm ewfacquirestream will read from stding until it encounters a read error. On read error it will stop no error information is stored in the EWF file(s). .Pp Empty block compression detects blocks of sectors with entirely the same byte data and compresses them using the default compression level. .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Bd -literal # ewfacquirestream \-C 1 \-D Floppy \-E 1.1 \-e 'John D.' \-N 'Just a floppy in my system' \-m removable \-M logical \-t floppy or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR These man pages were written by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquire 1 , .Xr ewfexport 1 , .Xr ewfinfo 1 , .Xr ewfmount 1 , .Xr ewfrecover 1 , .Xr ewfverify 1 libewf-20140807/manuals/Makefile.am0000644000175000017500000000053612654056261021036 0ustar00lordyestalordyesta00000000000000man_MANS = \ ewfacquire.1 \ ewfacquirestream.1 \ ewfexport.1 \ ewfinfo.1 \ ewfmount.1 \ ewfrecover.1 \ ewfverify.1 \ libewf.3 EXTRA_DIST = \ ewfacquire.1 \ ewfacquirestream.1 \ ewfexport.1 \ ewfinfo.1 \ ewfmount.1 \ ewfrecover.1 \ ewfverify.1 \ libewf.3 MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/manuals/ewfrecover.10000644000175000017500000000475113440662656021243 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfrecover .Os libewf .Sh NAME .Nm ewfrecover .Nd exports media data stored in EWF files .Sh SYNOPSIS .Nm ewfrecover .Op Fl A Ar codepage .Op Fl l Ar log_filename .Op Fl p Ar process_buffer_size .Op Fl t Ar target .Op Fl hquvVx .Ar ewf_files .Sh DESCRIPTION .Nm ewfrecover is a utility to recover corrupt EWF files. .Pp .Nm ewfrecover is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp .Ar ewf_files the first or the entire set of EWF segment files .Pp The options are as follows: .Bl -tag -width Ds .It Fl A Ar codepage the codepage of header section, options: ascii (default), windows-874, windows-932, windows-936, windows-949, windows-950, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257 or windows-1258 .It Fl h shows this help .It Fl l Ar log_filename logs recover errors and the digest (hash) to the log filename .It Fl p Ar process_buffer_size the process buffer size (default is the chunk size) .It Fl t Ar target the target file to recover to (default is recover) .It Fl v verbose output to stderr .It Fl V print version .It Fl x use the chunk data instead of the buffered read and write functions. .El .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Nm ewfrecover will ask the information it needs. .Ss Recovering a corrupted image .Bd -literal ewfrecover corrupt.E01 ewfrecover 20120805 Export started at: Mon Aug 6 07:09:34 2012 This could take a while. .Dl ... Export completed at: Mon Aug 6 07:09:34 2012 MD5 hash calculated over data: d41d8cd98f00b204e9800998ecf8427e ewfrecover: SUCCESS .Ed .Ss Trying to recover a non-corrupted image .Bd -literal ewfrecover notcorrupt.E01 ewfrecover 20120805 EWF file(s) are not corrupted. .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. Verbose and debug output are only printed when enabled at compilation. .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR .Pp These man pages were written by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquire 1 , .Xr ewfacquirestream 1 , .Xr ewfexport 1 , .Xr ewfinfo 1 , .Xr ewfmount 1 , .Xr ewfverify 1 libewf-20140807/manuals/ewfverify.10000644000175000017500000000700013440662656021070 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfverify .Os libewf .Sh NAME .Nm ewfverify .Nd verifies media data stored in EWF files .Sh SYNOPSIS .Nm ewfverify .Op Fl A Ar codepage .Op Fl d Ar digest_type .Op Fl f Ar format .Op Fl l Ar log_filename .Op Fl p Ar process_buffer_size .Op Fl hqvVwx .Ar ewf_files .Sh DESCRIPTION .Nm ewfverify is a utility to verify media data stored in EWF files. .Pp .Nm ewfverify is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp .Ar ewf_files the first or the entire set of EWF segment files .Pp The options are as follows: .Bl -tag -width Ds .It Fl A Ar codepage the codepage of header section, options: ascii (default), windows-874, windows-932, windows-936, windows-949, windows-950, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257 or windows-1258 .It Fl d Ar digest_type calculate additional digest (hash) types besides md5, options: sha1, sha256 .It Fl f Ar format specify the input format, options: raw (default), files (restricted to logical volume files) .It Fl h shows this help .It Fl l Ar log_filename logs verification errors and the digest (hash) to the log filename .It Fl p Ar process_buffer_size the process buffer size (default is the chunk size) .It Fl q quiet shows minimal status information .It Fl v verbose output to stderr .It Fl V print version .It Fl w zero sectors on checksum error (mimic EnCase like behavior) .It Fl x use the chunk data instead of the buffered read and write functions. .El .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Nm ewfverify can either verify the raw storage media data or logical file data stored in EWF file(s). .Ss To verify the raw storage media data: .Bd -literal # ewfverify floppy.E01 ewfverify 20110801 Verify started at: Tue Jan 11 19:21:51 2011 This could take a while. Status: at 2%. verified 32 kB (32768 bytes) of total 1.4 MiB (1474560 bytes). .Dl ... Status: at 100%. verified 1.4 MiB (1474560 bytes) of total 1.4 MiB (1474560 bytes). completion in 1 second(s) with 1 MiB/s (1474560 bytes/second). Verify completed at: Tue Jan 11 19:21:52 2011 Read: 1.4 MiB (1474560 bytes) in 1 second(s) with 1 MiB/s (1474560 bytes/second). MD5 hash stored in file: ae1ce8f5ac079d3ee93f97fe3792bda3 MD5 hash calculated over data: ae1ce8f5ac079d3ee93f97fe3792bda3 ewfverify: SUCCESS .Ed .Ss To verify logical file data: .Bd -literal # ewfverify -f files logical.E01 ewfverify 20110111 Verify started at: Tue Jan 11 19:21:51 2011 Single file: file1.txt MD5 hash stored in file: 6fef2a64afbf070a264366183698bb5e MD5 hash calculated over data: 6fef2a64afbf070a264366183698bb5e .Dl ... Verify completed at: Tue Jan 11 19:21:52 2011 ewfverify: SUCCESS .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. Verbose and debug output are only printed when enabled at compilation. .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR .Pp These man pages were written by Kees Mastwijk. .Pp Alterations for distribution have been made by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquire 1 , .Xr ewfacquirestream 1 , .Xr ewfexport 1 , .Xr ewfinfo 1 , .Xr ewfmount 1 , .Xr ewfrecover 1 libewf-20140807/manuals/ewfacquire.10000644000175000017500000002253413440662656021226 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfacquire .Os libewf .Sh NAME .Nm ewfacquire .Nd acquires data in the EWF format .Sh SYNOPSIS .Nm ewfacquire .Op Fl A Ar codepage .Op Fl b Ar number_of_sectors .Op Fl B Ar number_of_bytes .Op Fl c Ar compression_values .Op Fl C Ar case_number .Op Fl d Ar digest_type .Op Fl D Ar description .Op Fl e Ar examiner_name .Op Fl E Ar evidence_number .Op Fl f Ar format .Op Fl g Ar number_of_sectors .Op Fl l Ar log_filename .Op Fl m Ar media_type .Op Fl M Ar media_flags .Op Fl N Ar notes .Op Fl o Ar offset .Op Fl p Ar process_buffer_size .Op Fl P Ar bytes_per_sector .Op Fl r Ar read_error_retries .Op Fl S Ar segment_file_size .Op Fl t Ar target .Op Fl T Ar toc_file .Op Fl 2 Ar secondary_target .Op Fl hqRsuvVwx .Ar source .Sh DESCRIPTION .Nm ewfacquire is a utility to acquire media data from a .Ar source and store it in EWF format (Expert Witness Compression Format). .Nm ewfacquire acquires media data in a format equivalent to EnCase and FTK imager, including meta data. Under Linux, FreeBSD, NetBSD, OpenBSD, MacOS\-X/Darwin .Nm ewfacquire supports reading directly from device files. On other platforms .Nm ewfacquire can convert a raw (dd) image into the EWF format. .Pp .Nm ewfacquire is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp .Ar source the source file(s) or device .Pp The options are as follows: .Bl -tag -width Ds .It Fl A Ar codepage the codepage of header section, options: ascii (default), windows-874, windows-932, windows-936, windows-949, windows-950, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257 or windows-1258 .It Fl b Ar number_of_sectors the number of sectors to read at once (per chunk), options: 16, 32, 64 (default), 128, 256, 512, 1024, 2048, 4096, 8192, 16384 or 32768 .It Fl B Ar number_of_bytes the number of bytes to acquire .It Fl c Ar compression_values specify the compression values as: level or method:level compression method options: deflate (default), bzip2 (bzip2 is only supported by EWF2 formats) compression level options: none (default), empty-block, fast or best .It Fl C Ar case_number the case number (default is case_number) .It Fl d Ar digest_type calculate additional digest (hash) types besides md5, options: sha1, sha256 .It Fl D Ar description the description (default is description) .It Fl e Ar examiner_name the examiner name (default is examiner_name) .It Fl E Ar evidence_number the evidence number (default is evidence_number) .It Fl f Ar format the EWF file format to write to, options: ewf, smart, ftk, encase1, encase2, encase3, encase4, encase5, encase6 (default), encase7, linen5, linen6, linen7, ewfx. .It Fl g Ar number_of_sectors the number of sectors to be used as error granularity .It Fl h shows this help .It Fl l Ar log_filename logs acquiry errors and the digest (hash) to the log filename .It Fl m Ar media_type the media type, options: fixed (default), removable, optical, memory .It Fl M Ar media_flags the media flags, options: logical, physical (default) .It Fl N Ar notes the notes (default is notes) .It Fl o Ar offset the offset to start to acquire (default is 0) .It Fl p Ar process_buffer_size the process buffer size (default is the chunk size) .It Fl P Ar bytes_per_sector the number of bytes per sector (default is 512) (use this to override the automatic bytes per sector detection) .It Fl q quiet shows minimal status information .It Fl r Ar read_error_retries the number of retries when a read error occurs (default is 2) .It Fl R resume acquiry at a safe point .It Fl s swap byte pairs of the media data (from AB to BA) (use this for big to little endian conversion and vice versa) .It Fl S Ar segment_file_size the segment file size in bytes (default is 1.4 GiB) (minimum is 1.0 MiB, maximum is 7.9 EiB for encase6 and encase7 format and 1.9 GiB for other formats) .It Fl t Ar target the target file (without extension) to write to (default is image) .It Fl T Ar toc_file specify the file containing the table of contents (TOC) of an optical disc. The TOC file must be in the CUE format. .It Fl u unattended mode (disables user interaction) .It Fl v verbose output to stderr .It Fl V print version .It Fl w zero sectors on read error (mimic EnCase like behavior) .It Fl x use the chunk data instead of the buffered read and write functions. .It Fl 2 Ar secondary_target the secondary target file (without extension) to write to .El .Pp .Nm ewfacquire will read from a file or device until it encounters a read error. On read error it will retry the number of retries specified. If .Nm ewfacquire still is unable to read and, if specified, it will zero (wipe) the the remainder of the number of sectors specified as error granularity. If .Nm ewfacquire should mimic EnCase it will zero all of sectors specified as error granularity. .Pp Empty block compression detects blocks of sectors with entirely the same byte data and compresses them using the default compression level. .Pp The encase6 and encase7 format allows for segment files greater than 2 GiB (2147483648 bytes). .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Nm ewfacquire can either image devices, (split) RAW image file(s) or optical disc (split) RAW image files. .Nm ewfacquire will try to detect device information, but results may vary per platform. In attended mode (default) .Nm ewfacquire will ask for the information it requires. .Ss To image a floppy: .Bd -literal # ewfacquire /dev/fd0 ewfacquire 20120805 Device information: Bus type: Vendor: Y-E DATA Model: USB-FDU Serial: Storage media information: Type: Device Media size: 1.4 MB (1474560 bytes) Bytes per sector: 512 Information about acquiry required, please provide the necessary input Image path and filename without extension: floppy Case number: 1 Description: Floppy Evidence number: 1.1 Examiner name: John D. Notes: Just a floppy in my system Media type (fixed, removable, optical, memory) [fixed]: removable Media characteristics (logical, physical) [logical]: Use EWF file format (smart, ftk, encase1, encase2, encase3, encase4, encase5, encase6, encase7, linen5, linen6, linen7, ewfx) [encase6]: encase5 Compression method (deflate) [deflate]: Compression level (none, empty-block, fast, best) [none]: Start to acquire at offset (0 <= value <= 1474560) [0]: The number of bytes to acquire (0 <= value <= 1474560) [1474560]: Evidence segment file size in bytes (1.0 MiB <= value <= 1.9 GiB) [1.4 GiB]: The number of bytes per sector (1 <= value <= 4294967295) [512]: The number of sectors to read at once (16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768) [64]: The number of sectors to be used as error granularity (1 <= value <= 64) [64]: The number of retries when a read error occurs (0 <= value <= 255) [2]: Zero sectors on read error (mimic EnCase like behavior) (yes, no) [no]: The following information was provided: Image path and filename: floppy.E01 Case number: 1 Description: Floppy Evidence number: 1.1 Examiner name: John D. Notes: Just a floppy in my system Media type: removable Is physical: no EWF file format: Encase 5 (.E01) Compression method: deflate Compression level: none Acquiry start offset: 0 Number of bytes to acquire: 1.4 MiB (1474560 bytes) Evidence segment file size: 1.4 GiB (1572864000 bytes) Bytes per sector: 512 Block size: 64 sectors Error granularity: 64 sectors Retries on read error: 2 Zero sectors on read error: no Continue acquiry with these values (yes, no) [yes]: Acquiry started at: Sun Aug 5 11:32:41 2012 This could take a while. Status: at 2%. acquired 32 kB (32768 bytes) of total 1.4 MiB (1474560 bytes). .Dl ... Status: at 100%. acquired 1.4 MiB (1474560 bytes) of total 1.4 MiB (1474560 bytes). completion in 1 second(s) with 1 MiB/s (1474560 bytes/second). Acquiry completed at: Sun Aug 5 11:32:42 2012 Written: 1.4 MiB (1474560 bytes) in 1 second(s) with 1 MiB/s (1474560 bytes/second). MD5 hash calculated over data: ae1ce8f5ac079d3ee93f97fe3792bda3 .Ed .Ss To convert a split RAW image into an EWF image: .Bd -literal # ewfacquire usb256.raw.0?? ewfacquire 20120805 Storage media information: Type: RAW image Media size: 262 MB (262144000 bytes) Bytes per sector: 512 .Dl ... .Ed .Ss To convert an optical disc RAW image with a table of contents file into an EWF image: .Bd -literal # ewfacquire -T cdrom.cue cdrom.iso ewfacquire 20120805 Storage media information: Type: Optical disc RAW image Media size: 42 MB (42885120 bytes) Bytes per sector: 2048 Sessions: total number: 2 at sector(s): 0 - 20619 number: 20620 at sector(s): 20620 - 20939 number: 320 .Dl ... .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. Verbose and debug output are only printed when enabled at compilation. .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR .Pp These man pages were written by Kees Mastwijk. .Pp Alterations for distribution have been made by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquirestream 1 , .Xr ewfexport 1 , .Xr ewfinfo 1 , .Xr ewfmount 1 , .Xr ewfrecover 1 , .Xr ewfverify 1 libewf-20140807/manuals/libewf.30000664000175000017500000007740013440673250020341 0ustar00lordyestalordyesta00000000000000.Dd March 9, 2019 .Dt libewf 3 .Os libewf .Sh NAME .Nm libewf.h .Nd Library to access the Expert Witness Compression Format (EWF) format .Sh SYNOPSIS .In libewf.h .Pp Support functions .Ft const char * .Fn libewf_get_version "void" .Ft int .Fn libewf_get_access_flags_read .Ft int .Fn libewf_get_access_flags_read_write .Ft int .Fn libewf_get_access_flags_write .Ft int .Fn libewf_get_access_flags_write_resume .Ft int .Fn libewf_get_codepage "int *codepage" "libewf_error_t **error" .Ft int .Fn libewf_set_codepage "int codepage" "libewf_error_t **error" .Ft int .Fn libewf_check_file_signature "const char *filename" "libewf_error_t **error" .Ft int .Fn libewf_glob "const char *filename" "size_t filename_length" "uint8_t format" "char **filenames[]" "int *number_of_filenames" "libewf_error_t **error" .Ft int .Fn libewf_glob_free "char *filenames[]" "int number_of_filenames" "libewf_error_t **error" .Pp Available when compiled with wide character string support: .Ft int .Fn libewf_check_file_signature_wide "const wchar_t *filename" "libewf_error_t **error" .Ft int .Fn libewf_glob_wide "const wchar_t *filename" "size_t filename_length" "uint8_t format" "wchar_t **filenames[]" "int *number_of_filenames" "libewf_error_t **error" .Ft int .Fn libewf_glob_wide_free "wchar_t *filenames[]" "int number_of_filenames" "libewf_error_t **error" .Pp Available when compiled with libbfio support: .Ft int .Fn libewf_check_file_signature_file_io_handle "libbfio_handle_t *file_io_handle" "libewf_error_t **error" .Pp Notify functions .Ft void .Fn libewf_notify_set_verbose "int verbose" .Ft int .Fn libewf_notify_set_stream "FILE *stream" "libewf_error_t **error" .Ft int .Fn libewf_notify_stream_open "const char *filename" "libewf_error_t **error" .Ft int .Fn libewf_notify_stream_close "libewf_error_t **error" .Pp Error functions .Ft void .Fn libewf_error_free "libewf_error_t **error" .Ft int .Fn libewf_error_fprint "libewf_error_t *error" "FILE *stream" .Ft int .Fn libewf_error_sprint "libewf_error_t *error" "char *string" "size_t size" .Ft int .Fn libewf_error_backtrace_fprint "libewf_error_t *error" "FILE *stream" .Ft int .Fn libewf_error_backtrace_sprint "libewf_error_t *error" "char *string" "size_t size" .Pp File/Handle functions .Ft int .Fn libewf_handle_initialize "libewf_handle_t **handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_free "libewf_handle_t **handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_signal_abort "libewf_handle_t *handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_clone "libewf_handle_t **destination_handle" "libewf_handle_t *source_handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_open "libewf_handle_t *handle" "char * const filenames[]" "int number_of_filenames" "int access_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_close "libewf_handle_t *handle" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_prepare_read_chunk "libewf_handle_t *handle" "void *chunk_buffer" "size_t chunk_buffer_size" "void *uncompressed_chunk_buffer" "size_t *uncompressed_chunk_buffer_size" "int8_t is_compressed" "uint32_t chunk_checksum" "int8_t chunk_io_flags" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_read_chunk "libewf_handle_t *handle" "void *chunk_buffer" "size_t chunk_buffer_size" "int8_t *is_compressed" "void *checksum_buffer" "uint32_t *chunk_checksum" "int8_t *chunk_io_flags" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_read_buffer "libewf_handle_t *handle" "void *buffer" "size_t buffer_size" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_read_random "libewf_handle_t *handle" "void *buffer" "size_t buffer_size" "off64_t offset" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_prepare_write_chunk "libewf_handle_t *handle" "void *chunk_buffer" "size_t chunk_buffer_size" "void *compressed_chunk_buffer" "size_t *compressed_chunk_buffer_size" "int8_t *is_compressed" "uint32_t *chunk_checksum" "int8_t *chunk_io_flags" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_write_chunk "libewf_handle_t *handle" "void *chunk_buffer" "size_t chunk_buffer_size" "size_t data_size" "int8_t is_compressed" "const void *checksum_buffer" "uint32_t chunk_checksum" "int8_t chunk_io_flags" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_write_buffer "libewf_handle_t *handle" "const void *buffer" "size_t buffer_size" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_write_random "libewf_handle_t *handle" "const void *buffer" "size_t buffer_size" "off64_t offset" "libewf_error_t **error" .Ft ssize_t .Fn libewf_handle_write_finalize "libewf_handle_t *handle" "libewf_error_t **error" .Ft off64_t .Fn libewf_handle_seek_offset "libewf_handle_t *handle" "off64_t offset" "int whence" "libewf_error_t **error" .Ft off64_t .Fn libewf_handle_get_offset "libewf_handle_t *handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_maximum_number_of_open_handles "libewf_handle_t *handle" "int maximum_number_of_open_handles" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_segment_filename_size "libewf_handle_t *handle" "size_t *filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_segment_filename "libewf_handle_t *handle" "char *filename" "size_t filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_segment_filename "libewf_handle_t *handle" "const char *filename" "size_t filename_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_maximum_segment_size "libewf_handle_t *handle" "size64_t *maximum_segment_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_maximum_segment_size "libewf_handle_t *handle" "size64_t maximum_segment_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_delta_segment_filename_size "libewf_handle_t *handle" "size_t *filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_delta_segment_filename "libewf_handle_t *handle" "char *filename" "size_t filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_delta_segment_filename "libewf_handle_t *handle" "const char *filename" "size_t filename_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_maximum_delta_segment_size "libewf_handle_t *handle" "size64_t *maximum_delta_segment_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_maximum_delta_segment_size "libewf_handle_t *handle" "size64_t maximum_delta_segment_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_segment_files_corrupted "libewf_handle_t *handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_segment_files_encrypted "libewf_handle_t *handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_filename_size "libewf_handle_t *handle" "size_t *filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_filename "libewf_handle_t *handle" "char *filename" "size_t filename_size" "libewf_error_t **error" .Pp Available when compiled with wide character string support: .Ft int .Fn libewf_handle_open_wide "libewf_handle_t *handle" "wchar_t * const filenames[]" "int number_of_filenames" "int access_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_segment_filename_size_wide "libewf_handle_t *handle" "size_t *filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_segment_filename_wide "libewf_handle_t *handle" "wchar_t *filename" "size_t filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_segment_filename_wide "libewf_handle_t *handle" "const wchar_t *filename" "size_t filename_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_delta_segment_filename_size_wide "libewf_handle_t *handle" "size_t *filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_delta_segment_filename_wide "libewf_handle_t *handle" "wchar_t *filename" "size_t filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_delta_segment_filename_wide "libewf_handle_t *handle" "const wchar_t *filename" "size_t filename_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_filename_size_wide "libewf_handle_t *handle" "size_t *filename_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_filename_wide "libewf_handle_t *handle" "wchar_t *filename" "size_t filename_size" "libewf_error_t **error" .Pp Available when compiled with libbfio support: .Ft int .Fn libewf_handle_open_file_io_pool "libewf_handle_t *handle" "libbfio_pool_t *file_io_pool" "int access_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_file_io_handle "libewf_handle_t *handle" "libbfio_handle_t **file_io_handle" "libewf_error_t **error" .Pp Meta data functions .Ft int .Fn libewf_handle_get_sectors_per_chunk "libewf_handle_t *handle" "uint32_t *sectors_per_chunk" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_sectors_per_chunk "libewf_handle_t *handle" "uint32_t sectors_per_chunk" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_bytes_per_sector "libewf_handle_t *handle" "uint32_t *bytes_per_sector" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_bytes_per_sector "libewf_handle_t *handle" "uint32_t bytes_per_sector" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_sectors "libewf_handle_t *handle" "uint64_t *number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_chunk_size "libewf_handle_t *handle" "size32_t *chunk_size" "libewf_error_t **error" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_error_granularity "libewf_handle_t *handle" "uint32_t *error_granularity" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_error_granularity "libewf_handle_t *handle" "uint32_t error_granularity" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_compression_method "libewf_handle_t *handle" "uint16_t *compression_method" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_compression_method "libewf_handle_t *handle" "uint16_t compression_method" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_compression_values "libewf_handle_t *handle" "int8_t *compression_level" "uint8_t *compression_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_compression_values "libewf_handle_t *handle" "int8_t compression_level" "uint8_t compression_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_media_size "libewf_handle_t *handle" "size64_t *media_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_media_size "libewf_handle_t *handle" "size64_t media_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_media_type "libewf_handle_t *handle" "uint8_t *media_type" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_media_type "libewf_handle_t *handle" "uint8_t media_type" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_media_flags "libewf_handle_t *handle" "uint8_t *media_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_media_flags "libewf_handle_t *handle" "uint8_t media_flags" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_format "libewf_handle_t *handle" "uint8_t* format" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_format "libewf_handle_t *handle" "uint8_t format" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_segment_file_version "libewf_handle_t *handle" "uint8_t *major_version" "uint8_t *minor_version" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_segment_file_set_identifier "libewf_handle_t *handle" "uint8_t *set_identifier" "size_t size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_segment_file_set_identifier "libewf_handle_t *handle" "uint8_t *set_identifier" "size_t size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_md5_hash "libewf_handle_t *handle" "uint8_t *md5_hash" "size_t size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_md5_hash "libewf_handle_t *handle" "const uint8_t *md5_hash" "size_t size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_sha1_hash "libewf_handle_t *handle" "uint8_t *sha1_hash" "size_t size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_sha1_hash "libewf_handle_t *handle" "const uint8_t *sha1_hash" "size_t size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_read_zero_chunk_on_error "libewf_handle_t *handle" "uint8_t zero_on_error" "libewf_error_t **error" .Ft int .Fn libewf_handle_copy_media_values "libewf_handle_t *destination_handle" "libewf_handle_t *source_handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_acquiry_errors "libewf_handle_t *handle" "uint32_t *number_of_errors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_acquiry_error "libewf_handle_t *handle" "uint32_t index" "uint64_t *start_sector" "uint64_t *number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_append_acquiry_error "libewf_handle_t *handle" "uint64_t start_sector" "uint64_t number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_checksum_errors "libewf_handle_t *handle" "uint32_t *number_of_errors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_checksum_error "libewf_handle_t *handle" "uint32_t index" "uint64_t *start_sector" "uint64_t *number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_append_checksum_error "libewf_handle_t *handle" "uint64_t start_sector" "uint64_t number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_sessions "libewf_handle_t *handle" "uint32_t *number_of_sessions" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_session "libewf_handle_t *handle" "uint32_t index" "uint64_t *start_sector" "uint64_t *number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_append_session "libewf_handle_t *handle" "uint64_t start_sector" "uint64_t number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_tracks "libewf_handle_t *handle" "uint32_t *number_of_tracks" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_track "libewf_handle_t *handle" "uint32_t index" "uint64_t *start_sector" "uint64_t *number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_append_track "libewf_handle_t *handle" "uint64_t start_sector" "uint64_t number_of_sectors" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_header_codepage "libewf_handle_t *handle" "int *codepage" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_header_codepage "libewf_handle_t *handle" "int codepage" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_header_values_data_format "libewf_handle_t *handle" "int date_format" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_header_values_data_format "libewf_handle_t *handle" "int date_format" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_header_values "libewf_handle_t *handle" "uint32_t *number_of_values" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_header_value_identifier_size "libewf_handle_t *handle" "uint32_t index" "size_t *identifier_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_header_value_identifier "libewf_handle_t *handle" "uint32_t index" "uint8_t *identifier" "size_t identifier_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_size "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "size_t *utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "uint8_t *utf8_string" "size_t utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_case_number "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_description "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_examiner_name "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_evidence_number "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_notes "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_acquiry_date "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_system_date "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_acquiry_operating_system "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_acquiry_software_version "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_password "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_header_value_compression_level "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value "libewf_handle_t *handle" "const uint8_t *identifier" "const uint8_t *utf8_string" "size_t utf8_string_length" .Ft int .Fn libewf_handle_set_utf8_header_value_case_number "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_description "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_examiner_name "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_evidence_number "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_notes "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_acquiry_date "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_system_date "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_acquiry_operating_system "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_acquiry_software_version "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_password "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_compression_level "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_model "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_header_value_serial_number "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf16_header_value_size "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "size_t *utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf16_header_value "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "uint16_t *utf16_string" "size_t utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf16_header_value "libewf_handle_t *handle" "const uint8_t *identifier" "const uint16_t *utf16_string" "size_t utf16_string_length" .Ft int .Fn libewf_handle_copy_header_values "libewf_handle_t *destination_handle" "libewf_handle_t *source_handle" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_number_of_hash_values "libewf_handle_t *handle" "uint32_t *number_of_values" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_hash_value_identifier_size "libewf_handle_t *handle" "uint32_t index" "size_t *identifier_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_hash_value_identifier "libewf_handle_t *handle" "uint32_t index" "uint8_t *identifier" "size_t identifier_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_hash_value_size "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "size_t *utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_hash_value "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "uint8_t *utf8_string" "size_t utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_hash_value_md5 "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf8_hash_value_sha1 "libewf_handle_t *handle" "uint8_t *value" "size_t value_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_hash_value "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "const uint8_t *utf8_string" "size_t utf8_string_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_hash_value_md5 "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf8_hash_value_sha1 "libewf_handle_t *handle" "const uint8_t *value" "size_t value_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf16_hash_value_size "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "size_t *utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_utf16_hash_value "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "uint16_t *utf16_string" "size_t utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_handle_set_utf16_hash_value "libewf_handle_t *handle" "const uint8_t *identifier" "size_t identifier_length" "const uint16_t *utf16_string" "size_t utf16_string_length" "libewf_error_t **error" .Ft int .Fn libewf_handle_get_root_file_entry "libewf_handle_t *handle" "libewf_file_entry_t **root_file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_get_file_entry_by_utf8_path "libewf_handle_t *handle" "const uint8_t *utf8_string" "size_t utf8_string_length" "libewf_file_entry_t **file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_get_file_entry_by_utf16_path "libewf_handle_t *handle" "const uint16_t *utf16_string" "size_t utf16_string_length" "libewf_file_entry_t **file_entry" "libewf_error_t **error" .Pp Single file entry functions .Ft int .Fn libewf_file_entry_free "libewf_file_entry_t **file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_type "libewf_file_entry_t *file_entry" "uint8_t *type" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_flags "libewf_file_entry_t *file_entry" "uint32_t *flags" "libewf_error_t **error" .Fn int .Ft libewf_file_entry_get_media_data_offset "libewf_file_entry_t *file_entry" "off64_t *media_data_offset" "libewf_error_t **error" .Fn int .Ft libewf_file_entry_get_media_data_size "libewf_file_entry_t *file_entry" "size64_t *media_data_size" "libewf_error_t **error" .Fn int .Ft libewf_file_entry_get_duplicate_media_data_offset "libewf_file_entry_t *file_entry" "off64_t *duplicate_media_data_offset" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf8_name_size "libewf_file_entry_t *file_entry" "size_t *utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf8_name "libewf_file_entry_t *file_entry" "uint8_t *utf8_string" "size_t utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf16_name_size "libewf_file_entry_t *file_entry" "size_t *utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf16_name "libewf_file_entry_t *file_entry" "uint16_t *utf16_string" "size_t utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_size "libewf_file_entry_t *file_entry" "size64_t *size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_creation_time "libewf_file_entry_t *file_entry" "uint32_t *creation_time" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_modification_time "libewf_file_entry_t *file_entry" "uint32_t *modification_time" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_access_time "libewf_file_entry_t *file_entry" "uint32_t *access_time" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_entry_modification_time "libewf_file_entry_t *file_entry" "uint32_t *entry_modification_time" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf8_hash_value_md5 "libewf_file_entry_t *file_entry" "uint8_t *utf8_string" "size_t utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf16_hash_value_md5 "libewf_file_entry_t *file_entry" "uint8_t *utf16_string" "size_t utf16_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf8_hash_value_sha1 "libewf_file_entry_t *file_entry" "uint8_t *utf8_string" "size_t utf8_string_size" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_utf16_hash_value_sha1 "libewf_file_entry_t *file_entry" "uint8_t *utf16_string" "size_t utf16_string_size" "libewf_error_t **error" .Ft ssize_t .Fn libewf_file_entry_read_buffer "libewf_file_entry_t *file_entry" "void *buffer" "size_t buffer_size" "libewf_error_t **error" .Ft ssize_t .Fn libewf_file_entry_read_random "libewf_file_entry_t *file_entry" "void *buffer" "size_t buffer_size" "off64_t offset" "libewf_error_t **error" .Ft off64_t .Fn libewf_file_entry_seek_offset "libewf_file_entry_t *file_entry" "off64_t offset" "int whence" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_offset "libewf_file_entry_t *file_entry" "off64_t *offset" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_number_of_sub_file_entries "libewf_file_entry_t *file_entry" "int *number_of_sub_file_entries" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_sub_file_entry "libewf_file_entry_t *file_entry" "int sub_file_entry_index" "libewf_file_entry_t **sub_file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_sub_file_entry_by_utf8_name "libewf_file_entry_t *file_entry" "const uint8_t *utf8_string" "size_t utf8_string_length" "libewf_file_entry_t **sub_file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_sub_file_entry_by_utf8_path "libewf_file_entry_t *file_entry" "const uint8_t *utf8_string" "size_t utf8_string_length" "libewf_file_entry_t **sub_file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_sub_file_entry_by_utf16_name "libewf_file_entry_t *file_entry" "const uint16_t *utf16_string" "size_t utf16_string_length" "libewf_file_entry_t **sub_file_entry" "libewf_error_t **error" .Ft int .Fn libewf_file_entry_get_sub_file_entry_by_utf16_path "libewf_file_entry_t *file_entry" "const uint16_t *utf16_string" "size_t utf16_string_length" "libewf_file_entry_t **sub_file_entry" "libewf_error_t **error" .Sh DESCRIPTION The .Fn libewf_get_version function is used to retrieve the library version. .Pp The .Fn libewf_get_flags_* functions are used to get the values of the flags for read and/or write. .Pp The .Fn libewf_check_file_signature and .Fn libewf_check_file_signature_wide functions are used to test if the EWF file signature is present within a certain .Ar filename. .Pp The .Fn libewf_glob and .Fn libewf_glob_wide functions glob .Ar filenames using the .Ar filename and the .Ar format according to the EWF segment file naming schema. If the .Ar format is known the filename should contain the base of the filename otherwise the function will try to determine the format based on the extension. .Pp The .Fn libewf_handle_signal_abort function signals the handle to aborts it current activity. .Pp The .Fn libewf_handle_open , .Fn libewf_handle_open_wide , .Fn libewf_handle_close , .Fn libewf_handle_read_buffer , .Fn libewf_handle_read_random , .Fn libewf_handle_write_buffer , .Fn libewf_handle_write_random , .Fn libewf_handle_seek_offset functions can be used to open, seek in, read from, write to and close a set of EWF files. .Pp The .Fn libewf_handle_write_finalize function needs to be called after writing a set of EWF files without knowing the input size upfront, e.g. reading from a pipe. .Fn libewf_handle_write_finalize will the necessary correction to the set of EWF files. .Pp The .Fn libewf_handle_prepare_read_chunk , .Fn libewf_handle_read_chunk functions can be used to read chunks to a set of EWF files. .Pp The .Fn libewf_handle_prepare_write_chunk , .Fn libewf_handle_write_chunk functions can be used to write chunks to a set of EWF files. .Pp The .Fn libewf_handle_get_* functions can be used to retrieve information from the .Ar handle. This information is read from a set of EWF files when .Fn libewf_handle_open or .Fn libewf_handle_open_wide is used. .Pp The .Fn libewf_handle_set_* functions can be used to set information in the .Ar handle. This information is written to a set of EWF files when .Fn libewf_handle_write_buffer is used. .Pp The .Fn libewf_handle_append_acquiry_error function can be used to append an acquiry error (a read error during acquiry) to be written into a set of EWF files. .Pp The .Fn libewf_handle_append_checksum_error function can be used to append an Adler-32 checksum error (a validation error in a chunk in a set of EWF files) to be set in the handle. .Pp The .Fn libewf_handle_append_session function can be used to append a sesssion to be written into a set of EWF files. Note that the only the start offset is stored in a set of EWF files. Libewf ignores the number of sectors on write and determines the session sizes using the available session and media information on read. .Pp The .Fn libewf_handle_copy_* functions copy information from the .Ar source_handle to the .Ar destination_handle. .Pp The .Fn libewf_notify_set_verbose , .Fn libewf_notify_set_stream functions can be used to direct the warning, verbose and debug output from the library. .Sh RETURN VALUES .Pp Most of the functions return NULL or \-1 on error, dependent on the return type. For the actual return values refer to libewf.h .Pp To determine the cause of an error pass a reference to libewf_error_t *error = NULL. libewf will create an error object that must be freed with the libewf_error_free function. If the error reference is NULL libewf will not create an error object. .Sh ENVIRONMENT None .Sh FILES None .Sh NOTES libewf supports both UTF-8 and UTF-16 encoded strings except for filenames. Some platforms like WINAPI require wide character support for Unicode filenames. To compile libewf with wide character support use .Ar ./configure --enable-wide-character-type=yes or pass the definition .Ar _UNICODE or .Ar UNICODE to the compiler (i.e. in case of Microsoft Visual Studio (MSVS) C++). .sp To have other code to determine if libewf was compiled with wide character support it defines .Ar LIBEWF_HAVE_WIDE_CHARACTER_TYPE in libewf/features.h. .sp The header in a set of EWF files contains an extended ASCII string using the codepage of the system it was created on. The function .Ar libewf_handle_set_header_codepage allows to set the required codepage for reading and writing. The default codepage is ASCII and replaces all extended characters to the Unicode replacement character (U+fffd) when reading and the ASCII substitude character (0x1a) when writing. .sp The header2 contains UTF-16 little endian stream and the xheader and xhash contain a UTF-8 stream without or with byte order mark (as of version 20080903). .sp libewf allows to be compiled with chained IO support using libbfio. libewf will automatically detect if a compatible version of libbfio is available. .sp To have other code to determine if libewf was compiled with libbfio support it defines .Ar LIBEWF_HAVE_BFIO in libewf/features.h. .sp .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR These man pages were written by Joachim Metz. .Sh COPYRIGHT Copyright 2006-2019, Joachim Metz . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO the libewf.h include file libewf-20140807/manuals/ewfinfo.10000644000175000017500000000602013440662656020520 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfinfo .Os libewf .Sh NAME .Nm ewfinfo .Nd show meta data stored in EWF files .Sh SYNOPSIS .Nm ewfinfo .Op Fl A Ar codepage .Op Fl d Ar date_format .Op Fl f Ar format .Op Fl ehimvV .Ar ewf_files .Sh DESCRIPTION .Nm ewfinfo is a utility to show meta data stored in EWF files. .Pp .Nm ewfinfo is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp .Ar ewf_files the first or the entire set of EWF segment files .Pp The options are as follows: .Bl -tag -width Ds .It Fl A Ar codepage the codepage of header section, options: ascii (default), windows-874, windows-932, windows-936, windows-949, windows-950, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257 or windows-1258 .It Fl d Ar date_format the date format, options: ctime (default), dm (day/month), md (month/day), iso8601 .It Fl e only show EWF read error information .It Fl f Ar format specify the output format, options: text (default), dfxml .It Fl h shows this help .It Fl i only show EWF acquiry information .It Fl m only show EWF media information .It Fl v verbose output to stderr .It Fl V print version .El .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Bd -literal # ewfinfo \-d dm floppy.E01 ewfinfo 20120805 Acquiry information Case number: 1 Description: Floppy Examiner name: John D. Evidence number: 1.1 Notes: Just a floppy in my system Acquiry date: 09/12/2006 10:00:12 System date: 09/12/2006 10:00:12 Operating system used: Linux Software version used: 20061209 Password: N/A EWF information File format: EnCase 5 Sectors per chunk: 64 Error granularity: 64 Compression method: deflate Compression level: no compression Set identifier: 869910fc-e143-4908-9328-afedf4a7be1e Media information Media type: removable disk Is physical: no Bytes per sector: 512 Number of sectors: 2880 Media size: 1.4 MiB (1474560 bytes) Digest hash information MD5: ae1ce8f5ac079d3ee93f97fe3792bda3 .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. Verbose and debug output are only printed when enabled at compilation. .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR .Pp These man pages were written by Kees Mastwijk. .Pp Alterations for distribution have been made by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquire 1 , .Xr ewfacquirestream 1 , .Xr ewfexport 1 , .Xr ewfmount 1 , .Xr ewfrecover 1 , .Xr ewfverify 1 libewf-20140807/manuals/ewfexport.10000644000175000017500000001136213440662656021113 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfexport .Os libewf .Sh NAME .Nm ewfexport .Nd exports media data stored in EWF files .Sh SYNOPSIS .Nm ewfexport .Op Fl A Ar codepage .Op Fl b Ar number_of_sectors .Op Fl B Ar number_of_bytes .Op Fl c Ar compression_values .Op Fl d Ar digest_type .Op Fl f Ar format .Op Fl l Ar log_filename .Op Fl o Ar offset .Op Fl p Ar process_buffer_size .Op Fl S Ar segment_file_size .Op Fl t Ar target .Op Fl hqsuvVwx .Ar ewf_files .Sh DESCRIPTION .Nm ewfexport is a utility to export media data stored in EWF files. .Pp .Nm ewfexport is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp .Ar ewf_files the first or the entire set of EWF segment files .Pp The options are as follows: .Bl -tag -width Ds .It Fl A Ar codepage the codepage of header section, options: ascii (default), windows-874, windows-932, windows-936, windows-949, windows-950, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257 or windows-1258 .It Fl b Ar number_of_sectors the number of sectors to read at once (per chunk), options: 16, 32, 64 (default), 128, 256, 512, 1024, 2048, 4096, 8192, 16384 or 32768 .It Fl B Ar number_of_bytes the number of bytes to export .It Fl c Ar compression_values specify the compression values as: level or method:level compression method options: deflate (default), bzip2 (bzip2 is only supported by EWF2 formats) compression level options: none (default), empty-block, fast or best .It Fl d Ar digest_type calculate additional digest (hash) types besides md5, options: sha1 (not used for raw and files formats) .It Fl f Ar format the output format to write to, options: raw (default), files (restricted to logical volume files), ewf, smart, ftk, encase1, encase2, encase3, encase4, encase5, encase6, encase7, encase7-v2, linen5, linen6, linen7, ewfx. .It Fl h shows this help .It Fl l Ar log_filename logs export errors and the digest (hash) to the log filename .It Fl o Ar offset the offset to start the export (default is 0) .It Fl p Ar process_buffer_size the process buffer size (default is the chunk size) .It Fl s swap byte pairs of the media data (from AB to BA) (use this for big to little endian conversion and vice versa) .It Fl S Ar segment_file_size the segment file size in bytes (default is 1.4 GiB) (minimum is 1.0 MiB, maximum is 7.9 EiB for raw, encase6 and encase7 format and 1.9 GiB for other formats) (not used for files format) .It Fl t Ar target the target file to export to, use \- for stdout (default is export) stdout is only supported for the raw format .It Fl u unattended mode (disables user interaction) .It Fl v verbose output to stderr .It Fl V print version .It Fl w zero sectors on checksum error (mimic EnCase like behavior) .It Fl x use the chunk data instead of the buffered read and write functions. .El .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Nm ewfexport will ask the information it needs. .Bd -literal # ewfexport floppy.E01 ewfexport 20120805 Information for export required, please provide the necessary input Export to format (raw, files, ewf, smart, ftk, encase1, encase2, encase3, encase4, encase5, encase6, encase7, encase7-v2, linen5, linen6, linen7, ewfx) [raw]: Target path and filename without extension or \- for stdout: floppy Evidence segment file size in bytes (1.0 MiB <= value <= 7.9 EiB) [1.4 GiB]: Start export at offset (0 <= value <= 1474560) [0]: Number of bytes to export (0 <= value <= 1474560) [1474560]: Export started at: Sun Aug 5 19:19:40 2012 This could take a while. Status: at 2%. exported 32 kB (32768 bytes) of total 1.4 MiB (1474560 bytes). .Dl ... Status: at 100%. exported 1.4 MiB (1474560 bytes) of total 1.4 MiB (1474560 bytes). completion in 1 second(s) with 1 MiB/s (1474560 bytes/second). Export completed at: Sun Aug 5 19:19:41 2012 Written: 1.4 MiB (1474560 bytes) in 1 second(s) with 1 MiB/s (1474560 bytes/second). MD5 hash calculated over data: ae1ce8f5ac079d3ee93f97fe3792bda3 .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. Verbose and debug output are only printed when enabled at compilation. .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR .Pp These man pages were written by Kees Mastwijk. .Pp Alterations for distribution have been made by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquire 1 , .Xr ewfacquirestream 1 , .Xr ewfinfo 1 , .Xr ewfmount 1 , .Xr ewfrecover 1 , .Xr ewfverify 1 libewf-20140807/manuals/Makefile.in0000664000175000017500000007372613443455350021063 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = manuals ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" man3dir = $(mandir)/man3 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ man_MANS = \ ewfacquire.1 \ ewfacquirestream.1 \ ewfexport.1 \ ewfinfo.1 \ ewfmount.1 \ ewfrecover.1 \ ewfverify.1 \ libewf.3 EXTRA_DIST = \ ewfacquire.1 \ ewfacquirestream.1 \ ewfexport.1 \ ewfinfo.1 \ ewfmount.1 \ ewfrecover.1 \ ewfverify.1 \ libewf.3 MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu manuals/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu manuals/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man3 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man3 install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man3 .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/manuals/ewfmount.10000644000175000017500000000323013440662656020727 0ustar00lordyestalordyesta00000000000000.Dd January 19, 2014 .Dt ewfmount .Os libewf .Sh NAME .Nm ewfmount .Nd mount data stored in EWF files .Sh SYNOPSIS .Nm ewfmount .Op Fl f Ar format .Op Fl X Ar extended_options .Op Fl hvV .Ar ewf_files .Sh DESCRIPTION .Nm ewfmount is a utility to mount data stored in EWF files. .Pp .Nm ewfmount is part of the .Nm libewf package. .Nm libewf is a library to access the Expert Witness Compression Format (EWF). .Pp .Ar ewf_files the first or the entire set of EWF segment files .Ar mount_point the directory to serve as mount point .Pp The options are as follows: .Bl -tag -width Ds .It Fl f Ar format specify the input format, options: raw (default), files (restricted to logical volume files) .It Fl h shows this help .It Fl v verbose output to stderr .It Fl V print version .It Fl X Ar extended_options extended options to pass to sub system .El .Sh ENVIRONMENT None .Sh FILES None .Sh EXAMPLES .Bd -literal # ewfmount floppy.E01 floppy/ ewfmount 20110918 .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. Verbose and debug output are only printed when enabled at compilation. .Sh BUGS Please report bugs of any kind to or on the project website: http://code.google.com/p/libewf/ .Sh AUTHOR .Pp These man pages were written by Joachim Metz. .Sh COPYRIGHT .Pp Copyright 2006-2014, Joachim Metz . .Pp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr ewfacquire 1 , .Xr ewfacquirestream 1 , .Xr ewfexport 1 , .Xr ewfinfo 1 , .Xr ewfrecover 1 , .Xr ewfverify 1 libewf-20140807/ABOUT-NLS0000644000175000017500000026713311705465021016573 0ustar00lordyestalordyesta000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. libewf-20140807/msvscpp/0000775000175000017500000000000013443455447017041 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf.net/0000775000175000017500000000000013443455447020407 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf.net/ewf.net.vcproj0000664000175000017500000001206513440662746023205 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_truncate/0000775000175000017500000000000013443455447022566 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_truncate/ewf_test_truncate.vcproj0000664000175000017500000001146513440663047027541 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libfcache/0000775000175000017500000000000013443455447020741 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libfcache/libfcache.vcproj0000664000175000017500000001216513440662746024072 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/pyewf/0000775000175000017500000000000013443455447020173 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/pyewf/pyewf.vcproj0000664000175000017500000001544313440662746022560 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_read_write/0000775000175000017500000000000013443455447023066 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_read_write/ewf_test_read_write.vcproj0000664000175000017500000001205313440663047030333 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libmfdata/0000775000175000017500000000000013443455447020764 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libmfdata/libmfdata.vcproj0000664000175000017500000001567413440662746024150 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libsmraw/0000775000175000017500000000000013443455447020661 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libsmraw/libsmraw.vcproj0000664000175000017500000001530613440662746023732 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libfguid/0000775000175000017500000000000013443455447020626 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libfguid/libfguid.vcproj0000664000175000017500000001102713440662746023640 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfinfo/0000775000175000017500000000000013443455447020476 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfinfo/ewfinfo.vcproj0000664000175000017500000002060013440662746023355 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libclocale/0000775000175000017500000000000013443455447021132 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libclocale/libclocale.vcproj0000664000175000017500000001125213440662746024450 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/Makefile.am0000664000175000017500000000263113440663047021071 0ustar00lordyestalordyesta00000000000000MSVSCPP_FILES = \ ewf.net/ewf.net.vcproj \ ewf_test_glob/ewf_test_glob.vcproj \ ewf_test_read/ewf_test_read.vcproj \ ewf_test_read_write/ewf_test_read_write.vcproj \ ewf_test_read_write_delta/ewf_test_read_write_delta.vcproj \ ewf_test_seek/ewf_test_seek.vcproj \ ewf_test_truncate/ewf_test_truncate.vcproj \ ewf_test_write/ewf_test_write.vcproj \ ewf_test_write_chunk/ewf_test_write_chunk.vcproj \ ewfacquire/ewfacquire.vcproj \ ewfacquirestream/ewfacquirestream.vcproj \ ewfdebug/ewfdebug.vcproj \ ewfexport/ewfexport.vcproj \ ewfinfo/ewfinfo.vcproj \ ewfmount/ewfmount.vcproj \ ewfrecover/ewfrecover.vcproj \ ewfverify/ewfverify.vcproj \ libbfio/libbfio.vcproj \ libcdata/libcdata.vcproj \ libcdatetime/libcdatetime.vcproj \ libcerror/libcerror.vcproj \ libcfile/libcfile.vcproj \ libclocale/libclocale.vcproj \ libcnotify/libcnotify.vcproj \ libcpath/libcpath.vcproj \ libcsplit/libcsplit.vcproj \ libcthreads/libcthreads.vcproj \ libewf/libewf.vcproj \ libfcache/libfcache.vcproj \ libfdata/libfdata.vcproj \ libfguid/libfguid.vcproj \ libfvalue/libfvalue.vcproj \ libhmac/libhmac.vcproj \ libmfdata/libmfdata.vcproj \ libodraw/libodraw.vcproj \ libsmdev/libsmdev.vcproj \ libsmraw/libsmraw.vcproj \ libuna/libuna.vcproj \ pyewf/pyewf.vcproj \ zlib/zlib.vcproj \ libewf.sln EXTRA_DIST = \ $(MSVSCPP_FILES) MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/msvscpp/libsmdev/0000775000175000017500000000000013443455447020646 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libsmdev/libsmdev.vcproj0000664000175000017500000001562513440662746023710 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libbfio/0000775000175000017500000000000013443455447020447 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libbfio/libbfio.vcproj0000664000175000017500000001621213440662746023303 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_seek/0000775000175000017500000000000013443455447021670 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_seek/ewf_test_seek.vcproj0000664000175000017500000001132413440663047025737 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfmount/0000775000175000017500000000000013443455447020705 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfmount/ewfmount.vcproj0000664000175000017500000002241713440662746024003 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libewf/0000775000175000017500000000000013443455447020311 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libewf/libewf.vcproj0000664000175000017500000003145213440662746023012 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_read/0000775000175000017500000000000013443455447021654 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_read/ewf_test_read.vcproj0000664000175000017500000001145013440663047025707 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfverify/0000775000175000017500000000000013443455447021047 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfverify/ewfverify.vcproj0000664000175000017500000002113113440662746024277 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcdatetime/0000775000175000017500000000000013443455447021467 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcdatetime/libcdatetime.vcproj0000664000175000017500000001146513440662746025350 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libodraw/0000775000175000017500000000000013443455447020644 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libodraw/libodraw.vcproj0000664000175000017500000001624113440662746023677 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfrecover/0000775000175000017500000000000013443455447021210 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfrecover/ewfrecover.vcproj0000664000175000017500000002215613440662746024611 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_write/0000775000175000017500000000000013443455447022073 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_write/ewf_test_write.vcproj0000664000175000017500000001203413440663047026344 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcfile/0000775000175000017500000000000013443455447020612 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcfile/libcfile.vcproj0000664000175000017500000001247113440662746023614 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_write_chunk/0000775000175000017500000000000013443455447023263 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_write_chunk/ewf_test_write_chunk.vcproj0000664000175000017500000001205613440663047030730 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcthreads/0000775000175000017500000000000013443455447021325 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcthreads/libcthreads.vcproj0000664000175000017500000001404113440662746025035 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcpath/0000775000175000017500000000000013443455447020627 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcpath/libcpath.vcproj0000664000175000017500000001207713440662746023650 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfexport/0000775000175000017500000000000013443455447021064 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfexport/ewfexport.vcproj0000664000175000017500000002230013440662746024330 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfdebug/0000775000175000017500000000000013443455447020631 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfdebug/ewfdebug.vcproj0000664000175000017500000001720013440662746023645 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libhmac/0000775000175000017500000000000013443455447020440 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libhmac/libhmac.vcproj0000664000175000017500000001230013440662746023257 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_read_write_delta/0000775000175000017500000000000013443455447024237 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_read_write_delta/ewf_test_read_write_delta.vcproj0000664000175000017500000001207513440663047032661 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libuna/0000775000175000017500000000000013443455447020313 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libuna/libuna.vcproj0000664000175000017500000002722113440662746023015 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libfvalue/0000775000175000017500000000000013443455447021012 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libfvalue/libfvalue.vcproj0000664000175000017500000001725613440662746024222 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewf_test_glob/0000775000175000017500000000000013443455447021664 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewf_test_glob/ewf_test_glob.vcproj0000664000175000017500000001120213440663047025722 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/Makefile.in0000664000175000017500000006444513443455350021114 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = msvscpp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ MSVSCPP_FILES = \ ewf.net/ewf.net.vcproj \ ewf_test_glob/ewf_test_glob.vcproj \ ewf_test_read/ewf_test_read.vcproj \ ewf_test_read_write/ewf_test_read_write.vcproj \ ewf_test_read_write_delta/ewf_test_read_write_delta.vcproj \ ewf_test_seek/ewf_test_seek.vcproj \ ewf_test_truncate/ewf_test_truncate.vcproj \ ewf_test_write/ewf_test_write.vcproj \ ewf_test_write_chunk/ewf_test_write_chunk.vcproj \ ewfacquire/ewfacquire.vcproj \ ewfacquirestream/ewfacquirestream.vcproj \ ewfdebug/ewfdebug.vcproj \ ewfexport/ewfexport.vcproj \ ewfinfo/ewfinfo.vcproj \ ewfmount/ewfmount.vcproj \ ewfrecover/ewfrecover.vcproj \ ewfverify/ewfverify.vcproj \ libbfio/libbfio.vcproj \ libcdata/libcdata.vcproj \ libcdatetime/libcdatetime.vcproj \ libcerror/libcerror.vcproj \ libcfile/libcfile.vcproj \ libclocale/libclocale.vcproj \ libcnotify/libcnotify.vcproj \ libcpath/libcpath.vcproj \ libcsplit/libcsplit.vcproj \ libcthreads/libcthreads.vcproj \ libewf/libewf.vcproj \ libfcache/libfcache.vcproj \ libfdata/libfdata.vcproj \ libfguid/libfguid.vcproj \ libfvalue/libfvalue.vcproj \ libhmac/libhmac.vcproj \ libmfdata/libmfdata.vcproj \ libodraw/libodraw.vcproj \ libsmdev/libsmdev.vcproj \ libsmraw/libsmraw.vcproj \ libuna/libuna.vcproj \ pyewf/pyewf.vcproj \ zlib/zlib.vcproj \ libewf.sln EXTRA_DIST = \ $(MSVSCPP_FILES) MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu msvscpp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu msvscpp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/msvscpp/libcerror/0000775000175000017500000000000013443455447021024 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcerror/libcerror.vcproj0000664000175000017500000001061013440662746024231 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcnotify/0000775000175000017500000000000013443455447021203 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcnotify/libcnotify.vcproj0000664000175000017500000001123413440662746024572 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfacquirestream/0000775000175000017500000000000013443455447022410 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfacquirestream/ewfacquirestream.vcproj0000664000175000017500000002162313440662746027207 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libfdata/0000775000175000017500000000000013443455447020607 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libfdata/libfdata.vcproj0000664000175000017500000001714213440662746023606 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcdata/0000775000175000017500000000000013443455447020604 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcdata/libcdata.vcproj0000664000175000017500000001403413440662746023575 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/zlib/0000775000175000017500000000000013443455447020001 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/zlib/zlib.vcproj0000664000175000017500000001366413440662746022177 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/ewfacquire/0000775000175000017500000000000013443455447021174 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/ewfacquire/ewfacquire.vcproj0000664000175000017500000002204113440662746024552 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libcsplit/0000775000175000017500000000000013443455447021026 5ustar00lordyestalordyesta00000000000000libewf-20140807/msvscpp/libcsplit/libcsplit.vcproj0000664000175000017500000001215113440662746024237 0ustar00lordyestalordyesta00000000000000 libewf-20140807/msvscpp/libewf.sln0000664000175000017500000011522713440663047021031 0ustar00lordyestalordyesta00000000000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf.net", "ewf.net\ewf.net.vcproj", "{21BAC443-67A7-426B-891B-050C8F2C54CE}" ProjectSection(ProjectDependencies) = postProject {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfcache", "libfcache\libfcache.vcproj", "{6F22A324-0330-4984-BA8A-7F87E5A2F5AE}" ProjectSection(ProjectDependencies) = postProject {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyewf", "pyewf\pyewf.vcproj", "{6BB1CCE5-4FF5-4306-B3EB-1A3818FC3AC7}" ProjectSection(ProjectDependencies) = postProject {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} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmfdata", "libmfdata\libmfdata.vcproj", "{78A3701B-F395-4C5C-BDA9-B66A6E637B6F}" ProjectSection(ProjectDependencies) = postProject {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} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} = {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsmraw", "libsmraw\libsmraw.vcproj", "{B906876C-E5E5-403D-834F-632836BDC036}" ProjectSection(ProjectDependencies) = postProject {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} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} = {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} {2CA07FF7-1F1C-4165-A7EC-C5155F697166} = {2CA07FF7-1F1C-4165-A7EC-C5155F697166} {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} = {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfguid", "libfguid\libfguid.vcproj", "{D02DB48A-214C-4C9C-92B4-951461115B0C}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection 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} 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} 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} 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} 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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_truncate", "ewf_test_truncate\ewf_test_truncate.vcproj", "{7ACE2E3A-17CB-4970-B215-FC723B2E60DE}" ProjectSection(ProjectDependencies) = postProject {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {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} 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} 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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libclocale", "libclocale\libclocale.vcproj", "{F8917954-3C5E-4791-A769-2EAC495108BA}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsmdev", "libsmdev\libsmdev.vcproj", "{054977C3-9164-43AF-A112-DD5C502F597F}" ProjectSection(ProjectDependencies) = postProject {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} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbfio", "libbfio\libbfio.vcproj", "{07322EB7-EEF0-4E98-9D88-CF200310CD32}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} = {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libewf", "libewf\libewf.vcproj", "{610F33E3-5FBB-4749-9C3F-6D4BC90BEA70}" ProjectSection(ProjectDependencies) = postProject {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} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} = {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} {2CA07FF7-1F1C-4165-A7EC-C5155F697166} = {2CA07FF7-1F1C-4165-A7EC-C5155F697166} {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} = {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} {78A3701B-F395-4C5C-BDA9-B66A6E637B6F} = {78A3701B-F395-4C5C-BDA9-B66A6E637B6F} {8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E} = {8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcdatetime", "libcdatetime\libcdatetime.vcproj", "{7F95BCEE-926E-4B32-8077-1A739876B19D}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodraw", "libodraw\libodraw.vcproj", "{F2BC50AC-F7F7-4518-AE16-63E3E0A1174D}" ProjectSection(ProjectDependencies) = postProject {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} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcfile", "libcfile\libcfile.vcproj", "{9013CBEB-5BC5-40F1-A74B-9BF6F117334E}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcthreads", "libcthreads\libcthreads.vcproj", "{7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcpath", "libcpath\libcpath.vcproj", "{69B09A29-8901-48A6-9524-23AA2B8A5E6E}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhmac", "libhmac\libhmac.vcproj", "{53DD6B32-CAF2-4360-B6C1-3BE4A20535BD}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection 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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfvalue", "libfvalue\libfvalue.vcproj", "{6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5}" ProjectSection(ProjectDependencies) = postProject {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} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcerror", "libcerror\libcerror.vcproj", "{EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcnotify", "libcnotify\libcnotify.vcproj", "{94445D9A-BF51-4280-B577-69A0279E4873}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfacquire", "ewfacquire\ewfacquire.vcproj", "{F1034D34-7C7E-467B-9853-2F287A365874}" ProjectSection(ProjectDependencies) = postProject {F2BC50AC-F7F7-4518-AE16-63E3E0A1174D} = {F2BC50AC-F7F7-4518-AE16-63E3E0A1174D} {054977C3-9164-43AF-A112-DD5C502F597F} = {054977C3-9164-43AF-A112-DD5C502F597F} {B906876C-E5E5-403D-834F-632836BDC036} = {B906876C-E5E5-403D-834F-632836BDC036} {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} = {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} = {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} {2CA07FF7-1F1C-4165-A7EC-C5155F697166} = {2CA07FF7-1F1C-4165-A7EC-C5155F697166} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {7F95BCEE-926E-4B32-8077-1A739876B19D} = {7F95BCEE-926E-4B32-8077-1A739876B19D} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfacquirestream", "ewfacquirestream\ewfacquirestream.vcproj", "{C1C4F39C-2972-4FF7-BD41-8CCAF855E820}" ProjectSection(ProjectDependencies) = postProject {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} = {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {7F95BCEE-926E-4B32-8077-1A739876B19D} = {7F95BCEE-926E-4B32-8077-1A739876B19D} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfdebug", "ewfdebug\ewfdebug.vcproj", "{EEDECB53-5052-4431-A8D4-289701D5483C}" ProjectSection(ProjectDependencies) = postProject {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfexport", "ewfexport\ewfexport.vcproj", "{8578D675-38BC-423B-82B4-848ED17A3F6A}" ProjectSection(ProjectDependencies) = postProject {B906876C-E5E5-403D-834F-632836BDC036} = {B906876C-E5E5-403D-834F-632836BDC036} {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} = {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} = {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} {2CA07FF7-1F1C-4165-A7EC-C5155F697166} = {2CA07FF7-1F1C-4165-A7EC-C5155F697166} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {7F95BCEE-926E-4B32-8077-1A739876B19D} = {7F95BCEE-926E-4B32-8077-1A739876B19D} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfinfo", "ewfinfo\ewfinfo.vcproj", "{B56C4FFE-B106-46DC-9E29-4CC8B1FFB7BB}" ProjectSection(ProjectDependencies) = postProject {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfmount", "ewfmount\ewfmount.vcproj", "{2291E484-B893-4F6E-A7B7-55CAF36A4687}" ProjectSection(ProjectDependencies) = postProject {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} = {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfrecover", "ewfrecover\ewfrecover.vcproj", "{87353223-00FB-453F-8385-0166EA95D533}" ProjectSection(ProjectDependencies) = postProject {B906876C-E5E5-403D-834F-632836BDC036} = {B906876C-E5E5-403D-834F-632836BDC036} {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} = {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} = {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5} {2CA07FF7-1F1C-4165-A7EC-C5155F697166} = {2CA07FF7-1F1C-4165-A7EC-C5155F697166} {07322EB7-EEF0-4E98-9D88-CF200310CD32} = {07322EB7-EEF0-4E98-9D88-CF200310CD32} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} = {9013CBEB-5BC5-40F1-A74B-9BF6F117334E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {7F95BCEE-926E-4B32-8077-1A739876B19D} = {7F95BCEE-926E-4B32-8077-1A739876B19D} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfverify", "ewfverify\ewfverify.vcproj", "{B221A1F2-155B-450A-9929-EB0FBA906432}" ProjectSection(ProjectDependencies) = postProject {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} = {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD} {69B09A29-8901-48A6-9524-23AA2B8A5E6E} = {69B09A29-8901-48A6-9524-23AA2B8A5E6E} {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} = {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72} {AEFF5B28-157B-4632-8B82-E67C2171BC96} = {AEFF5B28-157B-4632-8B82-E67C2171BC96} {7F95BCEE-926E-4B32-8077-1A739876B19D} = {7F95BCEE-926E-4B32-8077-1A739876B19D} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {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} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfdata", "libfdata\libfdata.vcproj", "{2CA07FF7-1F1C-4165-A7EC-C5155F697166}" ProjectSection(ProjectDependencies) = postProject {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} {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} = {6F22A324-0330-4984-BA8A-7F87E5A2F5AE} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcdata", "libcdata\libcdata.vcproj", "{B444F82C-2C73-469F-A6D4-B097B5EA3ADE}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} = {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcsplit", "libcsplit\libcsplit.vcproj", "{AEFF5B28-157B-4632-8B82-E67C2171BC96}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcproj", "{8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|Win32 = Release|Win32 VSDebug|Win32 = VSDebug|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {21BAC443-67A7-426B-891B-050C8F2C54CE}.Release|Win32.ActiveCfg = Release|Win32 {21BAC443-67A7-426B-891B-050C8F2C54CE}.Release|Win32.Build.0 = Release|Win32 {21BAC443-67A7-426B-891B-050C8F2C54CE}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {21BAC443-67A7-426B-891B-050C8F2C54CE}.VSDebug|Win32.Build.0 = VSDebug|Win32 {6F22A324-0330-4984-BA8A-7F87E5A2F5AE}.Release|Win32.ActiveCfg = Release|Win32 {6F22A324-0330-4984-BA8A-7F87E5A2F5AE}.Release|Win32.Build.0 = Release|Win32 {6F22A324-0330-4984-BA8A-7F87E5A2F5AE}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {6F22A324-0330-4984-BA8A-7F87E5A2F5AE}.VSDebug|Win32.Build.0 = VSDebug|Win32 {6BB1CCE5-4FF5-4306-B3EB-1A3818FC3AC7}.Release|Win32.ActiveCfg = Release|Win32 {6BB1CCE5-4FF5-4306-B3EB-1A3818FC3AC7}.Release|Win32.Build.0 = Release|Win32 {6BB1CCE5-4FF5-4306-B3EB-1A3818FC3AC7}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {6BB1CCE5-4FF5-4306-B3EB-1A3818FC3AC7}.VSDebug|Win32.Build.0 = VSDebug|Win32 {78A3701B-F395-4C5C-BDA9-B66A6E637B6F}.Release|Win32.ActiveCfg = Release|Win32 {78A3701B-F395-4C5C-BDA9-B66A6E637B6F}.Release|Win32.Build.0 = Release|Win32 {78A3701B-F395-4C5C-BDA9-B66A6E637B6F}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {78A3701B-F395-4C5C-BDA9-B66A6E637B6F}.VSDebug|Win32.Build.0 = VSDebug|Win32 {B906876C-E5E5-403D-834F-632836BDC036}.Release|Win32.ActiveCfg = Release|Win32 {B906876C-E5E5-403D-834F-632836BDC036}.Release|Win32.Build.0 = Release|Win32 {B906876C-E5E5-403D-834F-632836BDC036}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {B906876C-E5E5-403D-834F-632836BDC036}.VSDebug|Win32.Build.0 = VSDebug|Win32 {D02DB48A-214C-4C9C-92B4-951461115B0C}.Release|Win32.ActiveCfg = Release|Win32 {D02DB48A-214C-4C9C-92B4-951461115B0C}.Release|Win32.Build.0 = Release|Win32 {D02DB48A-214C-4C9C-92B4-951461115B0C}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {D02DB48A-214C-4C9C-92B4-951461115B0C}.VSDebug|Win32.Build.0 = VSDebug|Win32 {3F4557A3-9155-418D-BD0F-0DF116A303C7}.Release|Win32.ActiveCfg = Release|Win32 {3F4557A3-9155-418D-BD0F-0DF116A303C7}.Release|Win32.Build.0 = Release|Win32 {3F4557A3-9155-418D-BD0F-0DF116A303C7}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {3F4557A3-9155-418D-BD0F-0DF116A303C7}.VSDebug|Win32.Build.0 = VSDebug|Win32 {257A065A-FDA2-49D4-964C-BAF641FA6DD4}.Release|Win32.ActiveCfg = Release|Win32 {257A065A-FDA2-49D4-964C-BAF641FA6DD4}.Release|Win32.Build.0 = Release|Win32 {257A065A-FDA2-49D4-964C-BAF641FA6DD4}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {257A065A-FDA2-49D4-964C-BAF641FA6DD4}.VSDebug|Win32.Build.0 = VSDebug|Win32 {298FAA87-9F70-4B2A-ABF1-07D91AB677B6}.Release|Win32.ActiveCfg = Release|Win32 {298FAA87-9F70-4B2A-ABF1-07D91AB677B6}.Release|Win32.Build.0 = Release|Win32 {298FAA87-9F70-4B2A-ABF1-07D91AB677B6}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {298FAA87-9F70-4B2A-ABF1-07D91AB677B6}.VSDebug|Win32.Build.0 = VSDebug|Win32 {82454223-CBF2-44DE-8BE0-307B020107A6}.Release|Win32.ActiveCfg = Release|Win32 {82454223-CBF2-44DE-8BE0-307B020107A6}.Release|Win32.Build.0 = Release|Win32 {82454223-CBF2-44DE-8BE0-307B020107A6}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {82454223-CBF2-44DE-8BE0-307B020107A6}.VSDebug|Win32.Build.0 = VSDebug|Win32 {830695C8-09B5-4A38-BC6D-5936FFE941F6}.Release|Win32.ActiveCfg = Release|Win32 {830695C8-09B5-4A38-BC6D-5936FFE941F6}.Release|Win32.Build.0 = Release|Win32 {830695C8-09B5-4A38-BC6D-5936FFE941F6}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {830695C8-09B5-4A38-BC6D-5936FFE941F6}.VSDebug|Win32.Build.0 = VSDebug|Win32 {7ACE2E3A-17CB-4970-B215-FC723B2E60DE}.Release|Win32.ActiveCfg = Release|Win32 {7ACE2E3A-17CB-4970-B215-FC723B2E60DE}.Release|Win32.Build.0 = Release|Win32 {7ACE2E3A-17CB-4970-B215-FC723B2E60DE}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {7ACE2E3A-17CB-4970-B215-FC723B2E60DE}.VSDebug|Win32.Build.0 = VSDebug|Win32 {261BF89F-4760-4473-828D-5F6EDCB80459}.Release|Win32.ActiveCfg = Release|Win32 {261BF89F-4760-4473-828D-5F6EDCB80459}.Release|Win32.Build.0 = Release|Win32 {261BF89F-4760-4473-828D-5F6EDCB80459}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {261BF89F-4760-4473-828D-5F6EDCB80459}.VSDebug|Win32.Build.0 = VSDebug|Win32 {5F3A8BCC-9792-4B26-87D8-0E1179575D24}.Release|Win32.ActiveCfg = Release|Win32 {5F3A8BCC-9792-4B26-87D8-0E1179575D24}.Release|Win32.Build.0 = Release|Win32 {5F3A8BCC-9792-4B26-87D8-0E1179575D24}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {5F3A8BCC-9792-4B26-87D8-0E1179575D24}.VSDebug|Win32.Build.0 = VSDebug|Win32 {F8917954-3C5E-4791-A769-2EAC495108BA}.Release|Win32.ActiveCfg = Release|Win32 {F8917954-3C5E-4791-A769-2EAC495108BA}.Release|Win32.Build.0 = Release|Win32 {F8917954-3C5E-4791-A769-2EAC495108BA}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {F8917954-3C5E-4791-A769-2EAC495108BA}.VSDebug|Win32.Build.0 = VSDebug|Win32 {054977C3-9164-43AF-A112-DD5C502F597F}.Release|Win32.ActiveCfg = Release|Win32 {054977C3-9164-43AF-A112-DD5C502F597F}.Release|Win32.Build.0 = Release|Win32 {054977C3-9164-43AF-A112-DD5C502F597F}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {054977C3-9164-43AF-A112-DD5C502F597F}.VSDebug|Win32.Build.0 = VSDebug|Win32 {07322EB7-EEF0-4E98-9D88-CF200310CD32}.Release|Win32.ActiveCfg = Release|Win32 {07322EB7-EEF0-4E98-9D88-CF200310CD32}.Release|Win32.Build.0 = Release|Win32 {07322EB7-EEF0-4E98-9D88-CF200310CD32}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {07322EB7-EEF0-4E98-9D88-CF200310CD32}.VSDebug|Win32.Build.0 = VSDebug|Win32 {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70}.Release|Win32.ActiveCfg = Release|Win32 {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70}.Release|Win32.Build.0 = Release|Win32 {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70}.VSDebug|Win32.Build.0 = VSDebug|Win32 {7F95BCEE-926E-4B32-8077-1A739876B19D}.Release|Win32.ActiveCfg = Release|Win32 {7F95BCEE-926E-4B32-8077-1A739876B19D}.Release|Win32.Build.0 = Release|Win32 {7F95BCEE-926E-4B32-8077-1A739876B19D}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {7F95BCEE-926E-4B32-8077-1A739876B19D}.VSDebug|Win32.Build.0 = VSDebug|Win32 {F2BC50AC-F7F7-4518-AE16-63E3E0A1174D}.Release|Win32.ActiveCfg = Release|Win32 {F2BC50AC-F7F7-4518-AE16-63E3E0A1174D}.Release|Win32.Build.0 = Release|Win32 {F2BC50AC-F7F7-4518-AE16-63E3E0A1174D}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {F2BC50AC-F7F7-4518-AE16-63E3E0A1174D}.VSDebug|Win32.Build.0 = VSDebug|Win32 {9013CBEB-5BC5-40F1-A74B-9BF6F117334E}.Release|Win32.ActiveCfg = Release|Win32 {9013CBEB-5BC5-40F1-A74B-9BF6F117334E}.Release|Win32.Build.0 = Release|Win32 {9013CBEB-5BC5-40F1-A74B-9BF6F117334E}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {9013CBEB-5BC5-40F1-A74B-9BF6F117334E}.VSDebug|Win32.Build.0 = VSDebug|Win32 {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E}.Release|Win32.ActiveCfg = Release|Win32 {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E}.Release|Win32.Build.0 = Release|Win32 {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E}.VSDebug|Win32.Build.0 = VSDebug|Win32 {69B09A29-8901-48A6-9524-23AA2B8A5E6E}.Release|Win32.ActiveCfg = Release|Win32 {69B09A29-8901-48A6-9524-23AA2B8A5E6E}.Release|Win32.Build.0 = Release|Win32 {69B09A29-8901-48A6-9524-23AA2B8A5E6E}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {69B09A29-8901-48A6-9524-23AA2B8A5E6E}.VSDebug|Win32.Build.0 = VSDebug|Win32 {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD}.Release|Win32.ActiveCfg = Release|Win32 {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 {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 {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72}.VSDebug|Win32.Build.0 = VSDebug|Win32 {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5}.Release|Win32.ActiveCfg = Release|Win32 {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5}.Release|Win32.Build.0 = Release|Win32 {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {6D2B2F13-4A4C-4515-AA8C-181C7B0CDDD5}.VSDebug|Win32.Build.0 = VSDebug|Win32 {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92}.Release|Win32.ActiveCfg = Release|Win32 {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92}.Release|Win32.Build.0 = Release|Win32 {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92}.VSDebug|Win32.Build.0 = VSDebug|Win32 {94445D9A-BF51-4280-B577-69A0279E4873}.Release|Win32.ActiveCfg = Release|Win32 {94445D9A-BF51-4280-B577-69A0279E4873}.Release|Win32.Build.0 = Release|Win32 {94445D9A-BF51-4280-B577-69A0279E4873}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {94445D9A-BF51-4280-B577-69A0279E4873}.VSDebug|Win32.Build.0 = VSDebug|Win32 {F1034D34-7C7E-467B-9853-2F287A365874}.Release|Win32.ActiveCfg = Release|Win32 {F1034D34-7C7E-467B-9853-2F287A365874}.Release|Win32.Build.0 = Release|Win32 {F1034D34-7C7E-467B-9853-2F287A365874}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {F1034D34-7C7E-467B-9853-2F287A365874}.VSDebug|Win32.Build.0 = VSDebug|Win32 {C1C4F39C-2972-4FF7-BD41-8CCAF855E820}.Release|Win32.ActiveCfg = Release|Win32 {C1C4F39C-2972-4FF7-BD41-8CCAF855E820}.Release|Win32.Build.0 = Release|Win32 {C1C4F39C-2972-4FF7-BD41-8CCAF855E820}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {C1C4F39C-2972-4FF7-BD41-8CCAF855E820}.VSDebug|Win32.Build.0 = VSDebug|Win32 {EEDECB53-5052-4431-A8D4-289701D5483C}.Release|Win32.ActiveCfg = Release|Win32 {EEDECB53-5052-4431-A8D4-289701D5483C}.Release|Win32.Build.0 = Release|Win32 {EEDECB53-5052-4431-A8D4-289701D5483C}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {EEDECB53-5052-4431-A8D4-289701D5483C}.VSDebug|Win32.Build.0 = VSDebug|Win32 {8578D675-38BC-423B-82B4-848ED17A3F6A}.Release|Win32.ActiveCfg = Release|Win32 {8578D675-38BC-423B-82B4-848ED17A3F6A}.Release|Win32.Build.0 = Release|Win32 {8578D675-38BC-423B-82B4-848ED17A3F6A}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {8578D675-38BC-423B-82B4-848ED17A3F6A}.VSDebug|Win32.Build.0 = VSDebug|Win32 {B56C4FFE-B106-46DC-9E29-4CC8B1FFB7BB}.Release|Win32.ActiveCfg = Release|Win32 {B56C4FFE-B106-46DC-9E29-4CC8B1FFB7BB}.Release|Win32.Build.0 = Release|Win32 {B56C4FFE-B106-46DC-9E29-4CC8B1FFB7BB}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {B56C4FFE-B106-46DC-9E29-4CC8B1FFB7BB}.VSDebug|Win32.Build.0 = VSDebug|Win32 {2291E484-B893-4F6E-A7B7-55CAF36A4687}.Release|Win32.ActiveCfg = Release|Win32 {2291E484-B893-4F6E-A7B7-55CAF36A4687}.Release|Win32.Build.0 = Release|Win32 {2291E484-B893-4F6E-A7B7-55CAF36A4687}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {2291E484-B893-4F6E-A7B7-55CAF36A4687}.VSDebug|Win32.Build.0 = VSDebug|Win32 {87353223-00FB-453F-8385-0166EA95D533}.Release|Win32.ActiveCfg = Release|Win32 {87353223-00FB-453F-8385-0166EA95D533}.Release|Win32.Build.0 = Release|Win32 {87353223-00FB-453F-8385-0166EA95D533}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {87353223-00FB-453F-8385-0166EA95D533}.VSDebug|Win32.Build.0 = VSDebug|Win32 {B221A1F2-155B-450A-9929-EB0FBA906432}.Release|Win32.ActiveCfg = Release|Win32 {B221A1F2-155B-450A-9929-EB0FBA906432}.Release|Win32.Build.0 = Release|Win32 {B221A1F2-155B-450A-9929-EB0FBA906432}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {B221A1F2-155B-450A-9929-EB0FBA906432}.VSDebug|Win32.Build.0 = VSDebug|Win32 {2CA07FF7-1F1C-4165-A7EC-C5155F697166}.Release|Win32.ActiveCfg = Release|Win32 {2CA07FF7-1F1C-4165-A7EC-C5155F697166}.Release|Win32.Build.0 = Release|Win32 {2CA07FF7-1F1C-4165-A7EC-C5155F697166}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {2CA07FF7-1F1C-4165-A7EC-C5155F697166}.VSDebug|Win32.Build.0 = VSDebug|Win32 {B444F82C-2C73-469F-A6D4-B097B5EA3ADE}.Release|Win32.ActiveCfg = Release|Win32 {B444F82C-2C73-469F-A6D4-B097B5EA3ADE}.Release|Win32.Build.0 = Release|Win32 {B444F82C-2C73-469F-A6D4-B097B5EA3ADE}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {B444F82C-2C73-469F-A6D4-B097B5EA3ADE}.VSDebug|Win32.Build.0 = VSDebug|Win32 {AEFF5B28-157B-4632-8B82-E67C2171BC96}.Release|Win32.ActiveCfg = Release|Win32 {AEFF5B28-157B-4632-8B82-E67C2171BC96}.Release|Win32.Build.0 = Release|Win32 {AEFF5B28-157B-4632-8B82-E67C2171BC96}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {AEFF5B28-157B-4632-8B82-E67C2171BC96}.VSDebug|Win32.Build.0 = VSDebug|Win32 {8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E}.Release|Win32.ActiveCfg = Release|Win32 {8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E}.Release|Win32.Build.0 = Release|Win32 {8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {8E47AE5E-89B0-4984-B6C2-CF5B0C6DD05E}.VSDebug|Win32.Build.0 = VSDebug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal libewf-20140807/libhmac/0000775000175000017500000000000013443455446016744 5ustar00lordyestalordyesta00000000000000libewf-20140807/libhmac/libhmac_md5.h0000664000175000017500000001002213443450057021245 0ustar00lordyestalordyesta00000000000000/* * MD5 functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_MD5_H ) #define _LIBHMAC_MD5_H #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #endif #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) #define LIBHMAC_HAVE_MD5_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) #define LIBHMAC_HAVE_MD5_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) #define LIBHMAC_HAVE_MD5_SUPPORT #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ #if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) #define LIBHMAC_MD5_BLOCK_SIZE 64 #endif typedef struct libhmac_internal_md5_context libhmac_internal_md5_context_t; struct libhmac_internal_md5_context { #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) /* The crypto provider handle */ HCRYPTPROV crypt_provider; /* The crypto hash handle */ HCRYPTHASH hash; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) /* The MD5 context */ MD5_CTX md5_context; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) /* The EVP message digest context */ #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX internal_evp_md_context; #endif EVP_MD_CTX *evp_md_context; #else /* The number of bytes hashed */ uint64_t hash_count; /* The hash values */ uint32_t hash_values[ 4 ]; /* The block offset */ size_t block_offset; /* The (data) block */ uint8_t block[ 128 ]; #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ }; #if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) ssize_t libhmac_md5_transform( libhmac_internal_md5_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); #endif /* !defined( LIBHMAC_HAVE_MD5_SUPPORT ) */ LIBHMAC_EXTERN \ int libhmac_md5_initialize( libhmac_md5_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_md5_free( libhmac_md5_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_md5_update( libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_md5_finalize( libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_md5_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_md5_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_MD5_H ) */ libewf-20140807/libhmac/libhmac_sha1.c0000664000175000017500000017222513443450057021425 0ustar00lordyestalordyesta00000000000000/* * SHA1 functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #include #endif #include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha1.h" #if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) /* RFC 3174/FIPS 180-1 based SHA-1 functions */ /* TODO decription what these values are based on */ uint32_t libhmac_sha1_fixed_constants[ 5 ] = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL }; #define libhmac_sha1_transform_extend_32bit_value( values_32bit, value_32bit_index ) \ values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 3 ] \ ^ values_32bit[ value_32bit_index - 8 ] \ ^ values_32bit[ value_32bit_index - 14 ] \ ^ values_32bit[ value_32bit_index - 16 ]; \ values_32bit[ value_32bit_index ] = byte_stream_bit_rotate_left_32bit( \ values_32bit[ value_32bit_index ], \ 1 ); #define libhmac_sha1_transform_unfolded_extend_32bit_values( values_32bit ) \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 16 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 17 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 18 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 19 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 20 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 21 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 22 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 23 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 24 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 25 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 26 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 27 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 28 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 29 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 30 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 31 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 32 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 33 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 34 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 35 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 36 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 37 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 38 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 39 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 40 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 41 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 42 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 43 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 44 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 45 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 46 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 47 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 48 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 49 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 50 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 51 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 52 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 53 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 54 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 55 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 56 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 57 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 58 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 59 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 60 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 61 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 62 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 63 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 64 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 65 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 66 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 67 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 68 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 69 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 70 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 71 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 72 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 73 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 74 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 75 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 76 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 77 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 78 ); \ libhmac_sha1_transform_extend_32bit_value( values_32bit, 79 ); #define libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ hash_values[ hash_value_index4 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ | ( ~( hash_values[ hash_value_index1 ] ) & hash_values[ hash_value_index3 ] ); \ hash_values[ hash_value_index4 ] += 0x5a827999UL; \ hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ 5 ); \ hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ \ hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index1 ], \ 30 ); #define libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ hash_values[ hash_value_index4 ] += hash_values[ hash_value_index1 ] \ ^ hash_values[ hash_value_index2 ] \ ^ hash_values[ hash_value_index3 ]; \ hash_values[ hash_value_index4 ] += 0x6ed9eba1UL; \ hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ 5 ); \ hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ \ hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index1 ], \ 30 ); #define libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ hash_values[ hash_value_index4 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ | ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index3 ] ) \ | ( hash_values[ hash_value_index2 ] & hash_values[ hash_value_index3 ] ); \ hash_values[ hash_value_index4 ] += 0x8f1bbcdcUL; \ hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ 5 ); \ hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ \ hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index1 ], \ 30 ); #define libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ hash_values[ hash_value_index4 ] += hash_values[ hash_value_index1 ] \ ^ hash_values[ hash_value_index2 ] \ ^ hash_values[ hash_value_index3 ]; \ hash_values[ hash_value_index4 ] += 0xca62c1d6UL; \ hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ 5 ); \ hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ \ hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index1 ], \ 30 ); #define libhmac_sha1_transform_unfolded_calculate_hash_values( values_32bit, hash_values ) \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 0, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 1, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 2, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 3, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 4, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 5, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 6, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 7, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 8, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 9, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 10, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 11, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 12, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 13, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 14, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 15, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 16, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 17, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 18, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 19, hash_values, 1, 2, 3, 4, 0 ); \ \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 20, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 21, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 22, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 23, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 24, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 25, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 26, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 27, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 28, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 29, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 30, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 31, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 32, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 33, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 34, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 35, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 36, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 37, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 38, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 39, hash_values, 1, 2, 3, 4, 0 ); \ \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 40, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 41, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 42, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 43, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 44, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 45, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 46, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 47, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 48, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 49, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 50, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 51, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 52, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 53, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 54, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 55, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 56, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 57, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 58, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 59, hash_values, 1, 2, 3, 4, 0 ); \ \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 60, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 61, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 62, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 63, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 64, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 65, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 66, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 67, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 68, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 69, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 70, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 71, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 72, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 73, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 74, hash_values, 1, 2, 3, 4, 0 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 75, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 76, hash_values, 4, 0, 1, 2, 3 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 77, hash_values, 3 ,4, 0, 1, 2 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 78, hash_values, 2, 3, 4, 0, 1 ); \ libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 79, hash_values, 1, 2, 3, 4, 0 ); /* Calculates the SHA1 of 64 byte sized blocks of data in a buffer * Returns the number of bytes used if successful or -1 on error */ ssize_t libhmac_sha1_transform( libhmac_internal_sha1_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { uint32_t hash_values[ 5 ]; uint32_t values_32bit[ 80 ]; static char *function = "libhmac_sha1_transform"; size_t buffer_offset = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) uint32_t hash_value = 0; uint8_t hash_values_index = 0; uint8_t value_32bit_index = 0; #endif if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid internal context.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } while( size >= LIBHMAC_SHA1_BLOCK_SIZE ) { if( memory_copy( hash_values, internal_context->hash_values, sizeof( uint32_t ) * 5 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy hash values.", function ); goto on_error; } #if defined( LIBHMAC_UNFOLLED_LOOPS ) /* Break the block into 16 x 32-bit values */ libhmac_byte_stream_copy_to_16x_uint32_big_endian( &( buffer[ buffer_offset ] ), values_32bit ); buffer_offset += LIBHMAC_SHA1_BLOCK_SIZE; /* Extend to 80 x 32-bit values */ libhmac_sha1_transform_unfolded_extend_32bit_values( values_32bit ); /* Calculate the hash values for the 32-bit values */ libhmac_sha1_transform_unfolded_calculate_hash_values( values_32bit, hash_values ); /* Update the hash values in the context */ internal_context->hash_values[ 0 ] += hash_values[ 0 ]; internal_context->hash_values[ 1 ] += hash_values[ 1 ]; internal_context->hash_values[ 2 ] += hash_values[ 2 ]; internal_context->hash_values[ 3 ] += hash_values[ 3 ]; internal_context->hash_values[ 4 ] += hash_values[ 4 ]; #else /* Break the block into 16 x 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 16; value_32bit_index++ ) { byte_stream_copy_to_uint32_big_endian( &( buffer[ buffer_offset ] ), values_32bit[ value_32bit_index ] ); buffer_offset += sizeof( uint32_t ); } /* Extend to 80 x 32-bit values */ for( value_32bit_index = 16; value_32bit_index < 80; value_32bit_index++ ) { libhmac_sha1_transform_extend_32bit_value( values_32bit, value_32bit_index ); } /* Calculate the hash values for the 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 80; value_32bit_index++ ) { if( value_32bit_index < 20 ) { hash_values[ 4 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) | ( ~( hash_values[ 1 ] ) & hash_values[ 3 ] ); hash_values[ 4 ] += 0x5a827999UL; } else if( value_32bit_index < 40 ) { hash_values[ 4 ] += hash_values[ 1 ] ^ hash_values[ 2 ] ^ hash_values[ 3 ]; hash_values[ 4 ] += 0x6ed9eba1UL; } else if( value_32bit_index < 60 ) { hash_values[ 4 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) | ( hash_values[ 1 ] & hash_values[ 3 ] ) | ( hash_values[ 2 ] & hash_values[ 3 ] ); hash_values[ 4 ] += 0x8f1bbcdcUL; } else { hash_values[ 4 ] += hash_values[ 1 ] ^ hash_values[ 2 ] ^ hash_values[ 3 ]; hash_values[ 4 ] += 0xca62c1d6UL; } hash_values[ 4 ] += byte_stream_bit_rotate_left_32bit( hash_values[ 0 ], 5 ); hash_values[ 4 ] += values_32bit[ value_32bit_index ]; hash_value = hash_values[ 4 ]; hash_values[ 4 ] = hash_values[ 3 ]; hash_values[ 3 ] = hash_values[ 2 ]; hash_values[ 2 ] = byte_stream_bit_rotate_left_32bit( hash_values[ 1 ], 30 ); hash_values[ 1 ] = hash_values[ 0 ]; hash_values[ 0 ] = hash_value; } /* Update the hash values in the context */ for( hash_values_index = 0; hash_values_index < 5; hash_values_index++ ) { internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; } #endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ size -= LIBHMAC_SHA1_BLOCK_SIZE; } /* Prevent sensitive data from leaking */ if( memory_set( hash_values, 0, sizeof( uint32_t ) * 5 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash values.", function ); goto on_error; } if( memory_set( values_32bit, 0, sizeof( uint32_t ) * 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear 32-bit values.", function ); goto on_error; } return( (ssize_t) buffer_offset ); on_error: memory_set( values_32bit, 0, sizeof( uint32_t ) * 64 ); memory_set( hash_values, 0, sizeof( uint32_t ) * 5 ); return( -1 ); } #endif /* !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) */ /* Creates a SHA1 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libhmac_sha1_initialize( libhmac_sha1_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_initialize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid context value already set.", function ); return( -1 ); } internal_context = memory_allocate_structure( libhmac_internal_sha1_context_t ); if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create context.", function ); goto on_error; } if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha1_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); memory_free( internal_context ); return( -1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT ) == 0 ) { if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create AES or RSA crypt provider.", function ); goto on_error; } } if( internal_context->crypt_provider == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: unable to create crypt provider.", function ); goto on_error; } if( CryptCreateHash( internal_context->crypt_provider, CALG_SHA1, 0, 0, &( internal_context->hash ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash object.", function ); CryptReleaseContext( internal_context->crypt_provider, 0 ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) if( SHA1_Init( &( internal_context->sha1_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX_init( &( internal_context->internal_evp_md_context ) ); internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); #else internal_context->evp_md_context = EVP_MD_CTX_new(); if( internal_context->evp_md_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create EVP message digest context.", function ); goto on_error; } #endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ if( EVP_DigestInit_ex( internal_context->evp_md_context, EVP_sha1(), NULL ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); #if defined( HAVE_EVP_MD_CTX_CLEANUP ) EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ); ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif internal_context->evp_md_context = NULL; goto on_error; } #else if( memory_copy( internal_context->hash_values, libhmac_sha1_fixed_constants, sizeof( uint32_t ) * 5 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy fixed constants to hash values.", function ); goto on_error; } #endif *context = (libhmac_sha1_context_t *) internal_context; return( 1 ); on_error: if( internal_context != NULL ) { memory_free( internal_context ); } return( -1 ); } /* Frees a SHA1 context * Returns 1 if successful or -1 on error */ int libhmac_sha1_free( libhmac_sha1_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_free"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { internal_context = (libhmac_internal_sha1_context_t *) *context; *context = NULL; #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( internal_context->crypt_provider, 0 ); } if( internal_context->hash != 0 ) { CryptDestroyHash( internal_context->hash ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) /* No additional clean up necessary */ #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) #if defined( HAVE_EVP_MD_CTX_CLEANUP ) if( EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clean up EVP message digest context.", function ); } /* Make sure the error state is removed otherwise OpenSSL will leak memory */ ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ internal_context->evp_md_context = NULL; #else /* No additional clean up necessary */ #endif memory_free( internal_context ); } return( 1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) /* Updates the SHA1 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha1_update( libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #endif if( size == 0 ) { return( 1 ); } if( CryptHashData( internal_context->hash, (BYTE *) buffer, (DWORD) size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) /* Updates the SHA1 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha1_update( libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_update"; unsigned long safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_LONG < SIZEOF_SIZE_T ) if( size > (size_t) ULONG_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } safe_hash_size = (unsigned long) size; if( SHA1_Update( &( internal_context->sha1_context ), (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) /* Updates the SHA1 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha1_update( libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( EVP_DigestUpdate( internal_context->evp_md_context, (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #else /* Updates the SHA1 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha1_update( libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_update"; size_t buffer_offset = 0; size_t remaining_block_size = 0; ssize_t process_count = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( internal_context->block_offset > 0 ) { remaining_block_size = LIBHMAC_SHA1_BLOCK_SIZE - internal_context->block_offset; if( remaining_block_size > size ) { remaining_block_size = size; } if( memory_copy( &( internal_context->block[ internal_context->block_offset ] ), buffer, remaining_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data to context block.", function ); return( -1 ); } internal_context->block_offset += remaining_block_size; if( internal_context->block_offset < LIBHMAC_SHA1_BLOCK_SIZE ) { return( 1 ); } buffer_offset += remaining_block_size; size -= remaining_block_size; process_count = libhmac_sha1_transform( internal_context, internal_context->block, LIBHMAC_SHA1_BLOCK_SIZE, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } internal_context->hash_count += process_count; internal_context->block_offset = 0; } if( size > 0 ) { process_count = libhmac_sha1_transform( internal_context, &( buffer[ buffer_offset ] ), size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform buffer.", function ); return( -1 ); } internal_context->hash_count += process_count; buffer_offset += process_count; size -= process_count; } if( size > 0 ) { if( size >= LIBHMAC_SHA1_BLOCK_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( memory_copy( internal_context->block, &( buffer[ buffer_offset ] ), size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy remaining data to context block.", function ); return( -1 ); } internal_context->block_offset = size; } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) /* Finalizes the SHA1 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha1_finalize( libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_finalize"; DWORD safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } #endif if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } safe_hash_size = (DWORD) hash_size; if( CryptGetHashParam( internal_context->hash, HP_HASHVAL, (BYTE *) hash, &safe_hash_size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) /* Finalizes the SHA1 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha1_finalize( libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_finalize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } if( SHA1_Final( hash, &( internal_context->sha1_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) /* Finalizes the SHA1 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha1_finalize( libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_finalize"; unsigned int safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) UINT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } safe_hash_size = (unsigned int) hash_size; if( EVP_DigestFinal_ex( internal_context->evp_md_context, (unsigned char *) hash, &safe_hash_size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #else /* Finalizes the SHA1 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha1_finalize( libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_finalize"; size_t block_size = 0; size_t number_of_blocks = 0; ssize_t process_count = 0; uint64_t bit_size = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) size_t hash_index = 0; int hash_values_index = 0; #endif if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha1_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } /* Add padding with a size of 56 mod 64 */ number_of_blocks = 1; if( internal_context->block_offset > 55 ) { number_of_blocks += 1; } block_size = number_of_blocks * LIBHMAC_SHA1_BLOCK_SIZE; if( memory_set( &( internal_context->block[ internal_context->block_offset ] ), 0, block_size - internal_context->block_offset ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context block.", function ); return( -1 ); } /* The first byte of the padding contains 0x80 */ internal_context->block[ internal_context->block_offset ] = 0x80; bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; byte_stream_copy_from_uint64_big_endian( &( internal_context->block[ block_size - 8 ] ), bit_size ); process_count = libhmac_sha1_transform( internal_context, internal_context->block, block_size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } #if !defined( LIBHMAC_UNFOLLED_LOOPS ) for( hash_values_index = 0; hash_values_index < 5; hash_values_index++ ) { byte_stream_copy_from_uint32_big_endian( &( hash[ hash_index ] ), internal_context->hash_values[ hash_values_index ] ); hash_index += sizeof( uint32_t ); } #else byte_stream_copy_from_uint32_big_endian( &( hash[ 0 ] ), internal_context->hash_values[ 0 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 4 ] ), internal_context->hash_values[ 1 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 8 ] ), internal_context->hash_values[ 2 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 12 ] ), internal_context->hash_values[ 3 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 16 ] ), internal_context->hash_values[ 4 ] ); #endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ /* Prevent sensitive data from leaking */ if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha1_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ /* Calculates the SHA1 of the buffer * Returns 1 if successful or -1 on error */ int libhmac_sha1_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_sha1_context_t *context = NULL; static char *function = "libhmac_sha1_calculate"; if( libhmac_sha1_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha1_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha1_finalize( context, hash, hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha1_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } return( 1 ); on_error: if( context != NULL ) { libhmac_sha1_free( &context, NULL ); } return( -1 ); } /* Calculates the SHA1 HMAC of the buffer * HMAC is defined in RFC 2104 * Returns 1 if successful or -1 on error */ int libhmac_sha1_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ) { uint8_t key_hash[ LIBHMAC_SHA1_HASH_SIZE ]; libhmac_sha1_context_t *context = NULL; uint8_t *key_data = NULL; uint8_t *inner_padding = NULL; uint8_t *outer_padding = NULL; static char *function = "libhmac_sha1_calculate_hmac"; size_t block_index = 0; size_t block_size = 64; if( key == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid key.", function ); return( -1 ); } if( key_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid key size value exceeds maximum.", function ); return( -1 ); } if( hmac_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid HMAC size value too small.", function ); return( -1 ); } key_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( key_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create key data.", function ); goto on_error; } if( key_size <= block_size ) { if( memory_copy( key_data, key, key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key data.", function ); goto on_error; } if( memory_set( &( key_data[ key_size ] ), 0, block_size - key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key remaining data.", function ); goto on_error; } } else { if( libhmac_sha1_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha1_update( context, key, key_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha1_finalize( context, key_hash, LIBHMAC_SHA1_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha1_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( block_size > LIBHMAC_SHA1_HASH_SIZE ) { if( memory_set( &( key_data[ LIBHMAC_SHA1_HASH_SIZE ] ), 0, block_size - LIBHMAC_SHA1_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear remaining key data.", function ); goto on_error; } } if( memory_copy( key_data, key_hash, LIBHMAC_SHA1_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key hash data.", function ); goto on_error; } } inner_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( inner_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create inner padding.", function ); goto on_error; } if( memory_set( inner_padding, 0x36, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set inner padding.", function ); goto on_error; } outer_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( outer_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create outer padding.", function ); goto on_error; } if( memory_set( outer_padding, 0x5c, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set outer padding.", function ); goto on_error; } for( block_index = 0; block_index < block_size; block_index++ ) { inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } if( libhmac_sha1_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha1_update( context, inner_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha1_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha1_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha1_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( libhmac_sha1_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha1_update( context, outer_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha1_update( context, hmac, LIBHMAC_SHA1_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha1_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha1_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( memory_set( outer_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear outer padding.", function ); goto on_error; } memory_free( outer_padding ); outer_padding = NULL; if( memory_set( inner_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear inner padding.", function ); goto on_error; } memory_free( inner_padding ); inner_padding = NULL; if( memory_set( key_data, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key data.", function ); goto on_error; } memory_free( key_data ); key_data = NULL; return( 1 ); on_error: if( context != NULL ) { libhmac_sha1_free( &context, NULL ); } if( outer_padding != NULL ) { memory_set( outer_padding, 0, block_size ); memory_free( outer_padding ); } if( inner_padding != NULL ) { memory_set( inner_padding, 0, block_size ); memory_free( inner_padding ); } if( key_data != NULL ) { memory_set( key_data, 0, block_size ); memory_free( key_data ); } return( -1 ); } libewf-20140807/libhmac/libhmac_support.c0000664000175000017500000000212713443450057022276 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include "libhmac_definitions.h" #include "libhmac_support.h" #if !defined( HAVE_LOCAL_LIBHMAC ) /* Returns the library version as a string */ const char *libhmac_get_version( void ) { return( (const char *) LIBHMAC_VERSION_STRING ); } #endif libewf-20140807/libhmac/libhmac_definitions.h0000664000175000017500000000334213443450057023102 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2011-2018, 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( LIBHMAC_INTERNAL_DEFINITIONS_H ) #define LIBHMAC_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBHMAC for local use of libhmac */ #if !defined( HAVE_LOCAL_LIBHMAC ) #include /* The definitions in are copied here * for local use of libhmac */ #else #define LIBHMAC_VERSION 20180731 /* The libhmac version string */ #define LIBHMAC_VERSION_STRING "20180731" /* The digest hash sizes */ #define LIBHMAC_MD5_HASH_SIZE 16 #define LIBHMAC_SHA1_HASH_SIZE 20 #define LIBHMAC_SHA224_HASH_SIZE 28 #define LIBHMAC_SHA256_HASH_SIZE 32 #define LIBHMAC_SHA512_HASH_SIZE 64 #endif #if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #if !defined( PROV_RSA_AES ) #define PROV_RSA_AES 24 #endif #endif /* defined( WINAPI ) && defined( HAVE_WINCRYPT ) */ #define LIBHMAC_UNFOLLED_LOOPS #endif /* !defined( LIBHMAC_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libhmac/Makefile.am0000664000175000017500000000142113443450057020767 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBHMAC AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libhmac.la libhmac_la_SOURCES = \ libhmac_byte_stream.h \ libhmac_definitions.h \ libhmac_extern.h \ libhmac_error.c libhmac_error.h \ libhmac_libcerror.h \ libhmac_md5.c libhmac_md5.h \ libhmac_sha1.c libhmac_sha1.h \ libhmac_sha224.c libhmac_sha224.h \ libhmac_sha256.c libhmac_sha256.h \ libhmac_sha512.c libhmac_sha512.h \ libhmac_support.c libhmac_support.h \ libhmac_types.h \ libhmac_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libhmac ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libhmac_la_SOURCES) libewf-20140807/libhmac/libhmac_error.c0000664000175000017500000000552213443450057021715 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include #include "libhmac_error.h" #include "libhmac_libcerror.h" #if !defined( HAVE_LOCAL_LIBHMAC ) /* Free an error and its elements */ void libhmac_error_free( libhmac_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libhmac_error_fprint( libhmac_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libhmac_error_sprint( libhmac_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libhmac_error_backtrace_fprint( libhmac_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libhmac_error_backtrace_sprint( libhmac_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBHMAC ) */ libewf-20140807/libhmac/libhmac_sha256.c0000664000175000017500000016644513443450057021610 0ustar00lordyestalordyesta00000000000000/* * SHA-256 functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #include #endif #include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha256.h" #if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) /* FIPS 180-2 based SHA-256 functions */ /* The first 32-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] */ uint32_t libhmac_sha256_prime_square_roots[ 8 ] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }; /* The first 32-bits of the fractional parts of the cube roots of the first 64 primes [ 2, 311 ] */ uint32_t libhmac_sha256_prime_cube_roots[ 64 ] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; #define libhmac_sha256_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ) \ s0 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 7 ) \ ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 18 ) \ ^ ( values_32bit[ value_32bit_index - 15 ] >> 3 ); \ s1 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 17 ) \ ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 19 ) \ ^ ( values_32bit[ value_32bit_index - 2 ] >> 10 ); \ \ values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 16 ] \ + s0 \ + values_32bit[ value_32bit_index - 7 ] \ + s1 #define libhmac_sha256_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ) \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 16, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 17, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 18, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 19, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 20, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 21, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 22, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 23, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 24, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 25, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 26, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 27, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 28, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 29, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 30, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 31, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 32, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 33, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 34, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 35, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 36, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 37, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 38, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 39, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 40, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 41, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 42, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 43, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 44, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 45, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 46, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 47, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 48, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 49, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 50, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 51, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 52, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 53, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 54, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 55, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 56, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 57, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 58, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 59, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 60, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 61, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 62, s0, s1 ); \ libhmac_sha256_transform_extend_32bit_value( values_32bit, 63, s0, s1 ); #define libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ s0 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 2 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 13 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 22 ); \ s1 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 6 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 11 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 25 ); \ \ t1 = hash_values[ hash_value_index7 ]; \ t1 += s1; \ t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ t1 += libhmac_sha256_prime_cube_roots[ value_32bit_index ]; \ t1 += values_32bit[ value_32bit_index ]; \ t2 = s0; \ t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ \ hash_values[ hash_value_index3 ] += t1; \ hash_values[ hash_value_index7 ] = t1 + t2; #define libhmac_sha256_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) /* Calculates the SHA-256 of 64 byte sized blocks of data in a buffer * Returns the number of bytes used if successful or -1 on error */ ssize_t libhmac_sha256_transform( libhmac_internal_sha256_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { uint32_t hash_values[ 8 ]; uint32_t values_32bit[ 64 ]; static char *function = "libhmac_sha256_transform"; size_t buffer_offset = 0; uint32_t s0 = 0; uint32_t s1 = 0; uint32_t t1 = 0; uint32_t t2 = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) uint8_t hash_values_index = 0; uint8_t value_32bit_index = 0; #endif if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid internal context.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } while( size >= LIBHMAC_SHA256_BLOCK_SIZE ) { if( memory_copy( hash_values, internal_context->hash_values, sizeof( uint32_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy hash values.", function ); goto on_error; } #if defined( LIBHMAC_UNFOLLED_LOOPS ) /* Break the block into 16 x 32-bit values */ libhmac_byte_stream_copy_to_16x_uint32_big_endian( &( buffer[ buffer_offset ] ), values_32bit ); buffer_offset += LIBHMAC_SHA256_BLOCK_SIZE; /* Extend to 64 x 32-bit values */ libhmac_sha256_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ); /* Calculate the hash values for the 32-bit values */ libhmac_sha256_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ); /* Update the hash values in the context */ internal_context->hash_values[ 0 ] += hash_values[ 0 ]; internal_context->hash_values[ 1 ] += hash_values[ 1 ]; internal_context->hash_values[ 2 ] += hash_values[ 2 ]; internal_context->hash_values[ 3 ] += hash_values[ 3 ]; internal_context->hash_values[ 4 ] += hash_values[ 4 ]; internal_context->hash_values[ 5 ] += hash_values[ 5 ]; internal_context->hash_values[ 6 ] += hash_values[ 6 ]; internal_context->hash_values[ 7 ] += hash_values[ 7 ]; #else /* Break the block into 16 x 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 16; value_32bit_index++ ) { byte_stream_copy_to_uint32_big_endian( &( buffer[ buffer_offset ] ), values_32bit[ value_32bit_index ] ); buffer_offset += sizeof( uint32_t ); } /* Extend to 64 x 32-bit values */ for( value_32bit_index = 16; value_32bit_index < 64; value_32bit_index++ ) { libhmac_sha256_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ); } /* Calculate the hash values for the 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 64; value_32bit_index++ ) { s0 = byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 2 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 13 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 22 ); s1 = byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 6 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 11 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 25 ); t1 = hash_values[ 7 ]; t1 += s1; t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); t1 += libhmac_sha256_prime_cube_roots[ value_32bit_index ]; t1 += values_32bit[ value_32bit_index ]; t2 = s0; t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); hash_values[ 7 ] = hash_values[ 6 ]; hash_values[ 6 ] = hash_values[ 5 ]; hash_values[ 5 ] = hash_values[ 4 ]; hash_values[ 4 ] = hash_values[ 3 ] + t1; hash_values[ 3 ] = hash_values[ 2 ]; hash_values[ 2 ] = hash_values[ 1 ]; hash_values[ 1 ] = hash_values[ 0 ]; hash_values[ 0 ] = t1 + t2; } /* Update the hash values in the context */ for( hash_values_index = 0; hash_values_index < 8; hash_values_index++ ) { internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; } #endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ size -= LIBHMAC_SHA256_BLOCK_SIZE; } /* Prevent sensitive data from leaking */ if( memory_set( hash_values, 0, sizeof( uint32_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash values.", function ); goto on_error; } if( memory_set( values_32bit, 0, sizeof( uint32_t ) * 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear 32-bit values.", function ); goto on_error; } return( (ssize_t) buffer_offset ); on_error: memory_set( values_32bit, 0, sizeof( uint32_t ) * 64 ); memory_set( hash_values, 0, sizeof( uint32_t ) * 8 ); return( -1 ); } #endif /* !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) */ /* Creates a SHA-256 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libhmac_sha256_initialize( libhmac_sha256_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_initialize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid context value already set.", function ); return( -1 ); } internal_context = memory_allocate_structure( libhmac_internal_sha256_context_t ); if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create context.", function ); goto on_error; } if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha256_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); memory_free( internal_context ); return( -1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT ) == 0 ) { if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create AES or RSA crypt provider.", function ); goto on_error; } } if( internal_context->crypt_provider == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: unable to create crypt provider.", function ); goto on_error; } if( CryptCreateHash( internal_context->crypt_provider, CALG_SHA_256, 0, 0, &( internal_context->hash ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash object.", function ); CryptReleaseContext( internal_context->crypt_provider, 0 ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) if( SHA256_Init( &( internal_context->sha256_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX_init( &( internal_context->internal_evp_md_context ) ); internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); #else internal_context->evp_md_context = EVP_MD_CTX_new(); if( internal_context->evp_md_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create EVP message digest context.", function ); goto on_error; } #endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ if( EVP_DigestInit_ex( internal_context->evp_md_context, EVP_sha256(), NULL ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); #if defined( HAVE_EVP_MD_CTX_CLEANUP ) EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ); ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif internal_context->evp_md_context = NULL; goto on_error; } #else if( memory_copy( internal_context->hash_values, libhmac_sha256_prime_square_roots, sizeof( uint32_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy initial hash values.", function ); return( -1 ); } #endif *context = (libhmac_sha256_context_t *) internal_context; return( 1 ); on_error: if( internal_context != NULL ) { memory_free( internal_context ); } return( -1 ); } /* Frees a SHA-256 context * Returns 1 if successful or -1 on error */ int libhmac_sha256_free( libhmac_sha256_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_free"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { internal_context = (libhmac_internal_sha256_context_t *) *context; *context = NULL; #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( internal_context->crypt_provider, 0 ); } if( internal_context->hash != 0 ) { CryptDestroyHash( internal_context->hash ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) /* No additional clean up necessary */ #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) #if defined( HAVE_EVP_MD_CTX_CLEANUP ) if( EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clean up EVP message digest context.", function ); } /* Make sure the error state is removed otherwise OpenSSL will leak memory */ ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ internal_context->evp_md_context = NULL; #else /* No additional clean up necessary */ #endif memory_free( internal_context ); } return( 1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) /* Updates the SHA-256 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha256_update( libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #endif if( size == 0 ) { return( 1 ); } if( CryptHashData( internal_context->hash, (BYTE *) buffer, (DWORD) size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) /* Updates the SHA-256 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha256_update( libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_update"; unsigned long safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_LONG < SIZEOF_SIZE_T ) if( size > (size_t) ULONG_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } safe_hash_size = (unsigned long) size; if( SHA256_Update( &( internal_context->sha256_context ), (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) /* Updates the SHA-256 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha256_update( libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( EVP_DigestUpdate( internal_context->evp_md_context, (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #else /* Updates the SHA-256 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha256_update( libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_update"; size_t buffer_offset = 0; size_t remaining_block_size = 0; ssize_t process_count = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( internal_context->block_offset > 0 ) { remaining_block_size = LIBHMAC_SHA256_BLOCK_SIZE - internal_context->block_offset; if( remaining_block_size > size ) { remaining_block_size = size; } if( memory_copy( &( internal_context->block[ internal_context->block_offset ] ), buffer, remaining_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data to context block.", function ); return( -1 ); } internal_context->block_offset += remaining_block_size; if( internal_context->block_offset < LIBHMAC_SHA256_BLOCK_SIZE ) { return( 1 ); } buffer_offset += remaining_block_size; size -= remaining_block_size; process_count = libhmac_sha256_transform( internal_context, internal_context->block, LIBHMAC_SHA256_BLOCK_SIZE, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } internal_context->hash_count += process_count; internal_context->block_offset = 0; } if( size > 0 ) { process_count = libhmac_sha256_transform( internal_context, &( buffer[ buffer_offset ] ), size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform buffer.", function ); return( -1 ); } internal_context->hash_count += process_count; buffer_offset += process_count; size -= process_count; } if( size > 0 ) { if( size >= LIBHMAC_SHA256_BLOCK_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( memory_copy( internal_context->block, &( buffer[ buffer_offset ] ), size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy remaining data to context block.", function ); return( -1 ); } internal_context->block_offset = size; } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) /* Finalizes the SHA-256 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha256_finalize( libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_finalize"; DWORD safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } #endif if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } safe_hash_size = (DWORD) hash_size; if( CryptGetHashParam( internal_context->hash, HP_HASHVAL, (BYTE *) hash, &safe_hash_size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) /* Finalizes the SHA-256 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha256_finalize( libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_finalize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } if( SHA256_Final( hash, &( internal_context->sha256_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) /* Finalizes the SHA-256 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha256_finalize( libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_finalize"; unsigned int safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) UINT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } safe_hash_size = (unsigned int) hash_size; if( EVP_DigestFinal_ex( internal_context->evp_md_context, (unsigned char *) hash, &safe_hash_size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #else /* Finalizes the SHA-256 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha256_finalize( libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_finalize"; size_t block_size = 0; size_t number_of_blocks = 0; ssize_t process_count = 0; uint64_t bit_size = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) size_t hash_index = 0; int hash_values_index = 0; #endif if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha256_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } /* Add padding with a size of 56 mod 64 */ number_of_blocks = 1; if( internal_context->block_offset > 55 ) { number_of_blocks += 1; } block_size = number_of_blocks * LIBHMAC_SHA256_BLOCK_SIZE; if( memory_set( &( internal_context->block[ internal_context->block_offset ] ), 0, block_size - internal_context->block_offset ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context block.", function ); return( -1 ); } /* The first byte of the padding contains 0x80 */ internal_context->block[ internal_context->block_offset ] = 0x80; bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; byte_stream_copy_from_uint64_big_endian( &( internal_context->block[ block_size - 8 ] ), bit_size ); process_count = libhmac_sha256_transform( internal_context, internal_context->block, block_size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } #if !defined( LIBHMAC_UNFOLLED_LOOPS ) for( hash_values_index = 0; hash_values_index < 8; hash_values_index++ ) { byte_stream_copy_from_uint32_big_endian( &( hash[ hash_index ] ), internal_context->hash_values[ hash_values_index ] ); hash_index += sizeof( uint32_t ); } #else byte_stream_copy_from_uint32_big_endian( &( hash[ 0 ] ), internal_context->hash_values[ 0 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 4 ] ), internal_context->hash_values[ 1 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 8 ] ), internal_context->hash_values[ 2 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 12 ] ), internal_context->hash_values[ 3 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 16 ] ), internal_context->hash_values[ 4 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 20 ] ), internal_context->hash_values[ 5 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 24 ] ), internal_context->hash_values[ 6 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 28 ] ), internal_context->hash_values[ 7 ] ); #endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ /* Prevent sensitive data from leaking */ if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha256_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) */ /* Calculates the SHA-256 of the buffer * Returns 1 if successful or -1 on error */ int libhmac_sha256_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_sha256_context_t *context = NULL; static char *function = "libhmac_sha256_calculate"; if( libhmac_sha256_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha256_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha256_finalize( context, hash, hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha256_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } return( 1 ); on_error: if( context != NULL ) { libhmac_sha256_free( &context, NULL ); } return( -1 ); } /* Calculates the SHA-256 HMAC of the buffer * HMAC is defined in RFC 2104 * Returns 1 if successful or -1 on error */ int libhmac_sha256_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ) { uint8_t key_hash[ LIBHMAC_SHA256_HASH_SIZE ]; libhmac_sha256_context_t *context = NULL; uint8_t *key_data = NULL; uint8_t *inner_padding = NULL; uint8_t *outer_padding = NULL; static char *function = "libhmac_sha256_calculate_hmac"; size_t block_index = 0; size_t block_size = 64; if( key == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid key.", function ); return( -1 ); } if( key_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid key size value exceeds maximum.", function ); return( -1 ); } if( hmac_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid HMAC size value too small.", function ); return( -1 ); } key_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( key_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create key data.", function ); goto on_error; } if( key_size <= block_size ) { if( memory_copy( key_data, key, key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key data.", function ); goto on_error; } if( memory_set( &( key_data[ key_size ] ), 0, block_size - key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key remaining data.", function ); goto on_error; } } else { if( libhmac_sha256_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha256_update( context, key, key_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha256_finalize( context, key_hash, LIBHMAC_SHA256_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha256_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( block_size > LIBHMAC_SHA256_HASH_SIZE ) { if( memory_set( &( key_data[ LIBHMAC_SHA256_HASH_SIZE ] ), 0, block_size - LIBHMAC_SHA256_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear remaining key data.", function ); goto on_error; } } if( memory_copy( key_data, key_hash, LIBHMAC_SHA256_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key hash data.", function ); goto on_error; } } inner_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( inner_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create inner padding.", function ); goto on_error; } if( memory_set( inner_padding, 0x36, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set inner padding.", function ); goto on_error; } outer_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( outer_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create outer padding.", function ); goto on_error; } if( memory_set( outer_padding, 0x5c, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set outer padding.", function ); goto on_error; } for( block_index = 0; block_index < block_size; block_index++ ) { inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } if( libhmac_sha256_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha256_update( context, inner_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha256_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha256_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha256_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( libhmac_sha256_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha256_update( context, outer_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha256_update( context, hmac, LIBHMAC_SHA256_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha256_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha256_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( memory_set( outer_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear outer padding.", function ); goto on_error; } memory_free( outer_padding ); outer_padding = NULL; if( memory_set( inner_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear inner padding.", function ); goto on_error; } memory_free( inner_padding ); inner_padding = NULL; if( memory_set( key_data, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key data.", function ); goto on_error; } memory_free( key_data ); key_data = NULL; return( 1 ); on_error: if( context != NULL ) { libhmac_sha256_free( &context, NULL ); } if( outer_padding != NULL ) { memory_set( outer_padding, 0, block_size ); memory_free( outer_padding ); } if( inner_padding != NULL ) { memory_set( inner_padding, 0, block_size ); memory_free( inner_padding ); } if( key_data != NULL ) { memory_set( key_data, 0, block_size ); memory_free( key_data ); } return( -1 ); } libewf-20140807/libhmac/libhmac_sha512.c0000664000175000017500000017647713443450057021611 0ustar00lordyestalordyesta00000000000000/* * SHA-512 functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #include #endif #include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha512.h" #if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) /* FIPS 180-2 based SHA-512 functions */ /* The first 64-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] */ uint64_t libhmac_sha512_prime_square_roots[ 8 ] = { 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179 }; /* The first 64-bits of the fractional parts of the cube roots of the first 80 primes [ 2, 409 ] */ uint64_t libhmac_sha512_prime_cube_roots[ 80 ] = { 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, 0x3956c25bf348b538, 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242, 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df, 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218, 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, 0xca273eceea26619c, 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b, 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 }; #define libhmac_sha512_transform_extend_64bit_value( values_64bit, value_64bit_index, s0, s1 ) \ s0 = byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 15 ], 1 ) \ ^ byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 15 ], 8 ) \ ^ ( values_64bit[ value_64bit_index - 15 ] >> 7 ); \ s1 = byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 2 ], 19 ) \ ^ byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 2 ], 61 ) \ ^ ( values_64bit[ value_64bit_index - 2 ] >> 6 ); \ \ values_64bit[ value_64bit_index ] = values_64bit[ value_64bit_index - 16 ] \ + s0 \ + values_64bit[ value_64bit_index - 7 ] \ + s1 #define libhmac_sha512_transform_unfolded_extend_64bit_values( values_64bit, s0, s1 ) \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 16, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 17, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 18, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 19, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 20, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 21, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 22, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 23, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 24, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 25, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 26, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 27, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 28, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 29, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 30, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 31, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 32, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 33, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 34, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 35, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 36, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 37, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 38, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 39, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 40, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 41, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 42, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 43, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 44, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 45, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 46, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 47, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 48, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 49, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 50, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 51, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 52, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 53, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 54, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 55, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 56, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 57, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 58, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 59, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 60, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 61, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 62, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 63, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 64, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 65, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 66, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 67, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 68, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 69, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 70, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 71, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 72, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 73, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 74, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 75, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 76, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 77, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 78, s0, s1 ); \ libhmac_sha512_transform_extend_64bit_value( values_64bit, 79, s0, s1 ); #define libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, value_64bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ s0 = byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 28 ) \ ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 34 ) \ ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 39 ); \ s1 = byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 14 ) \ ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 18 ) \ ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 41 ); \ \ t1 = hash_values[ hash_value_index7 ]; \ t1 += s1; \ t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ t1 += libhmac_sha512_prime_cube_roots[ value_64bit_index ]; \ t1 += values_64bit[ value_64bit_index ]; \ t2 = s0; \ t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ \ hash_values[ hash_value_index3 ] += t1; \ hash_values[ hash_value_index7 ] = t1 + t2; #define libhmac_sha512_transform_unfolded_calculate_hash_values( values_64bit, hash_values, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 64, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 65, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 66, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 67, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 68, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 69, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 70, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 71, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 72, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 73, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 74, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 75, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 76, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 77, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 78, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 79, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) /* Calculates the SHA-512 of 128 byte sized blocks of data in a buffer * Returns the number of bytes used if successful or -1 on error */ ssize_t libhmac_sha512_transform( libhmac_internal_sha512_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { uint64_t hash_values[ 8 ]; uint64_t values_64bit[ 80 ]; static char *function = "libhmac_sha512_transform"; uint64_t s0 = 0; uint64_t s1 = 0; uint64_t t1 = 0; uint64_t t2 = 0; size_t buffer_offset = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) uint8_t hash_values_index = 0; uint8_t value_64bit_index = 0; #endif if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid internal context.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } while( size >= LIBHMAC_SHA512_BLOCK_SIZE ) { if( memory_copy( hash_values, internal_context->hash_values, sizeof( uint64_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy hash values.", function ); goto on_error; } #if defined( LIBHMAC_UNFOLLED_LOOPS ) /* Break the block into 16 x 64-bit values */ libhmac_byte_stream_copy_to_16x_uint64_big_endian( &( buffer[ buffer_offset ] ), values_64bit ); buffer_offset += LIBHMAC_SHA512_BLOCK_SIZE; /* Extend to 80 x 64-bit values */ libhmac_sha512_transform_unfolded_extend_64bit_values( values_64bit, s0, s1 ); /* Calculate the hash values for the 64-bit values */ libhmac_sha512_transform_unfolded_calculate_hash_values( values_64bit, hash_values, s0, s1, t1, t2 ); /* Update the hash values in the context */ internal_context->hash_values[ 0 ] += hash_values[ 0 ]; internal_context->hash_values[ 1 ] += hash_values[ 1 ]; internal_context->hash_values[ 2 ] += hash_values[ 2 ]; internal_context->hash_values[ 3 ] += hash_values[ 3 ]; internal_context->hash_values[ 4 ] += hash_values[ 4 ]; internal_context->hash_values[ 5 ] += hash_values[ 5 ]; internal_context->hash_values[ 6 ] += hash_values[ 6 ]; internal_context->hash_values[ 7 ] += hash_values[ 7 ]; #else /* Break the block into 16 x 64-bit values */ for( value_64bit_index = 0; value_64bit_index < 16; value_64bit_index++ ) { byte_stream_copy_to_uint64_big_endian( &( buffer[ buffer_offset ] ), values_64bit[ value_64bit_index ] ); buffer_offset += sizeof( uint64_t ); } /* Extend to 80 x 64-bit values */ for( value_64bit_index = 16; value_64bit_index < 80; value_64bit_index++ ) { libhmac_sha512_transform_extend_64bit_value( values_64bit, value_64bit_index, s0, s1 ); } /* Calculate the hash values for the 64-bit values */ for( value_64bit_index = 0; value_64bit_index < 80; value_64bit_index++ ) { s0 = byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 28 ) ^ byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 34 ) ^ byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 39 ); s1 = byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 14 ) ^ byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 18 ) ^ byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 41 ); t1 = hash_values[ 7 ]; t1 += s1; t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); t1 += libhmac_sha512_prime_cube_roots[ value_64bit_index ]; t1 += values_64bit[ value_64bit_index ]; t2 = s0; t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); hash_values[ 7 ] = hash_values[ 6 ]; hash_values[ 6 ] = hash_values[ 5 ]; hash_values[ 5 ] = hash_values[ 4 ]; hash_values[ 4 ] = hash_values[ 3 ] + t1; hash_values[ 3 ] = hash_values[ 2 ]; hash_values[ 2 ] = hash_values[ 1 ]; hash_values[ 1 ] = hash_values[ 0 ]; hash_values[ 0 ] = t1 + t2; } /* Update the hash values in the context */ for( hash_values_index = 0; hash_values_index < 8; hash_values_index++ ) { internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; } #endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ size -= LIBHMAC_SHA512_BLOCK_SIZE; } /* Prevent sensitive data from leaking */ if( memory_set( hash_values, 0, sizeof( uint64_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash values.", function ); goto on_error; } if( memory_set( values_64bit, 0, sizeof( uint64_t ) * 80 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear 64-bit values.", function ); goto on_error; } return( (ssize_t) buffer_offset ); on_error: memory_set( values_64bit, 0, sizeof( uint64_t ) * 80 ); memory_set( hash_values, 0, sizeof( uint64_t ) * 8 ); return( -1 ); } #endif /* !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) */ /* Creates a SHA-512 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libhmac_sha512_initialize( libhmac_sha512_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_initialize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid context value already set.", function ); return( -1 ); } internal_context = memory_allocate_structure( libhmac_internal_sha512_context_t ); if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create context.", function ); goto on_error; } if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha512_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); memory_free( internal_context ); return( -1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT ) == 0 ) { if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create AES or RSA crypt provider.", function ); goto on_error; } } if( internal_context->crypt_provider == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: unable to create crypt provider.", function ); goto on_error; } if( CryptCreateHash( internal_context->crypt_provider, CALG_SHA_512, 0, 0, &( internal_context->hash ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash object.", function ); CryptReleaseContext( internal_context->crypt_provider, 0 ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) if( SHA512_Init( &( internal_context->sha512_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX_init( &( internal_context->internal_evp_md_context ) ); internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); #else internal_context->evp_md_context = EVP_MD_CTX_new(); if( internal_context->evp_md_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create EVP message digest context.", function ); goto on_error; } #endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ if( EVP_DigestInit_ex( internal_context->evp_md_context, EVP_sha512(), NULL ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); #if defined( HAVE_EVP_MD_CTX_CLEANUP ) EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ); ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif internal_context->evp_md_context = NULL; goto on_error; } #else if( memory_copy( internal_context->hash_values, libhmac_sha512_prime_square_roots, sizeof( uint64_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy initial hash values.", function ); return( -1 ); } #endif *context = (libhmac_sha512_context_t *) internal_context; return( 1 ); on_error: if( internal_context != NULL ) { memory_free( internal_context ); } return( -1 ); } /* Frees a SHA-512 context * Returns 1 if successful or -1 on error */ int libhmac_sha512_free( libhmac_sha512_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_free"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { internal_context = (libhmac_internal_sha512_context_t *) *context; *context = NULL; #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( internal_context->crypt_provider, 0 ); } if( internal_context->hash != 0 ) { CryptDestroyHash( internal_context->hash ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) /* No additional clean up necessary */ #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) #if defined( HAVE_EVP_MD_CTX_CLEANUP ) if( EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clean up EVP message digest context.", function ); } /* Make sure the error state is removed otherwise OpenSSL will leak memory */ ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ internal_context->evp_md_context = NULL; #else /* No additional clean up necessary */ #endif memory_free( internal_context ); } return( 1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) /* Updates the SHA-512 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha512_update( libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #endif if( size == 0 ) { return( 1 ); } if( CryptHashData( internal_context->hash, (BYTE *) buffer, (DWORD) size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) /* Updates the SHA-512 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha512_update( libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_update"; unsigned long safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_LONG < SIZEOF_SIZE_T ) if( size > (size_t) ULONG_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } safe_hash_size = (unsigned long) size; if( SHA512_Update( &( internal_context->sha512_context ), (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) /* Updates the SHA-512 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha512_update( libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( EVP_DigestUpdate( internal_context->evp_md_context, (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #else /* Updates the SHA-512 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha512_update( libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_update"; size_t buffer_offset = 0; size_t remaining_block_size = 0; ssize_t process_count = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( internal_context->block_offset > 0 ) { remaining_block_size = LIBHMAC_SHA512_BLOCK_SIZE - internal_context->block_offset; if( remaining_block_size > size ) { remaining_block_size = size; } if( memory_copy( &( internal_context->block[ internal_context->block_offset ] ), buffer, remaining_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data to context block.", function ); return( -1 ); } internal_context->block_offset += remaining_block_size; if( internal_context->block_offset < LIBHMAC_SHA512_BLOCK_SIZE ) { return( 1 ); } buffer_offset += remaining_block_size; size -= remaining_block_size; process_count = libhmac_sha512_transform( internal_context, internal_context->block, LIBHMAC_SHA512_BLOCK_SIZE, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } internal_context->hash_count += process_count; internal_context->block_offset = 0; } if( size > 0 ) { process_count = libhmac_sha512_transform( internal_context, &( buffer[ buffer_offset ] ), size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform buffer.", function ); return( -1 ); } internal_context->hash_count += process_count; buffer_offset += process_count; size -= process_count; } if( size > 0 ) { if( size >= LIBHMAC_SHA512_BLOCK_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( memory_copy( internal_context->block, &( buffer[ buffer_offset ] ), size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy remaining data to context block.", function ); return( -1 ); } internal_context->block_offset = size; } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) /* Finalizes the SHA-512 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha512_finalize( libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_finalize"; DWORD safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } #endif if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } safe_hash_size = (DWORD) hash_size; if( CryptGetHashParam( internal_context->hash, HP_HASHVAL, (BYTE *) hash, &safe_hash_size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) /* Finalizes the SHA-512 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha512_finalize( libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_finalize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } if( SHA512_Final( hash, &( internal_context->sha512_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) /* Finalizes the SHA-512 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha512_finalize( libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_finalize"; unsigned int safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) UINT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } safe_hash_size = (unsigned int) hash_size; if( EVP_DigestFinal_ex( internal_context->evp_md_context, (unsigned char *) hash, &safe_hash_size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #else /* Finalizes the SHA-512 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha512_finalize( libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_finalize"; size_t block_size = 0; size_t number_of_blocks = 0; ssize_t process_count = 0; uint64_t bit_size = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) size_t hash_index = 0; int hash_values_index = 0; #endif if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha512_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } /* Add padding with a size of 120 mod 128 */ number_of_blocks = 1; if( internal_context->block_offset > 119 ) { number_of_blocks += 1; } block_size = number_of_blocks * LIBHMAC_SHA512_BLOCK_SIZE; if( memory_set( &( internal_context->block[ internal_context->block_offset ] ), 0, block_size - internal_context->block_offset ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context block.", function ); return( -1 ); } /* The first byte of the padding contains 0x80 */ internal_context->block[ internal_context->block_offset ] = 0x80; bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; byte_stream_copy_from_uint64_big_endian( &( internal_context->block[ block_size - 8 ] ), bit_size ); process_count = libhmac_sha512_transform( internal_context, internal_context->block, block_size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } #if !defined( LIBHMAC_UNFOLLED_LOOPS ) for( hash_values_index = 0; hash_values_index < 8; hash_values_index++ ) { byte_stream_copy_from_uint64_big_endian( &( hash[ hash_index ] ), internal_context->hash_values[ hash_values_index ] ); hash_index += sizeof( uint64_t ); } #else byte_stream_copy_from_uint64_big_endian( &( hash[ 0 ] ), internal_context->hash_values[ 0 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 8 ] ), internal_context->hash_values[ 1 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 16 ] ), internal_context->hash_values[ 2 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 24 ] ), internal_context->hash_values[ 3 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 32 ] ), internal_context->hash_values[ 4 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 40 ] ), internal_context->hash_values[ 5 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 48 ] ), internal_context->hash_values[ 6 ] ); byte_stream_copy_from_uint64_big_endian( &( hash[ 56 ] ), internal_context->hash_values[ 7 ] ); #endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ /* Prevent sensitive data from leaking */ if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha512_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) */ /* Calculates the SHA-512 of the buffer * Returns 1 if successful or -1 on error */ int libhmac_sha512_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_sha512_context_t *context = NULL; static char *function = "libhmac_sha512_calculate"; if( libhmac_sha512_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha512_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha512_finalize( context, hash, hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha512_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } return( 1 ); on_error: if( context != NULL ) { libhmac_sha512_free( &context, NULL ); } return( -1 ); } /* Calculates the SHA-512 HMAC of the buffer * HMAC is defined in RFC 2104 * Returns 1 if successful or -1 on error */ int libhmac_sha512_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ) { uint8_t key_hash[ LIBHMAC_SHA512_HASH_SIZE ]; libhmac_sha512_context_t *context = NULL; uint8_t *key_data = NULL; uint8_t *inner_padding = NULL; uint8_t *outer_padding = NULL; static char *function = "libhmac_sha512_calculate_hmac"; size_t block_index = 0; size_t block_size = 64; if( key == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid key.", function ); return( -1 ); } if( key_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid key size value exceeds maximum.", function ); return( -1 ); } if( hmac_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid HMAC size value too small.", function ); return( -1 ); } key_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( key_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create key data.", function ); goto on_error; } if( key_size <= block_size ) { if( memory_copy( key_data, key, key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key data.", function ); goto on_error; } if( memory_set( &( key_data[ key_size ] ), 0, block_size - key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key remaining data.", function ); goto on_error; } } else { if( libhmac_sha512_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha512_update( context, key, key_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha512_finalize( context, key_hash, LIBHMAC_SHA512_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha512_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( block_size > LIBHMAC_SHA512_HASH_SIZE ) { if( memory_set( &( key_data[ LIBHMAC_SHA512_HASH_SIZE ] ), 0, block_size - LIBHMAC_SHA512_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear remaining key data.", function ); goto on_error; } } if( memory_copy( key_data, key_hash, LIBHMAC_SHA512_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key hash data.", function ); goto on_error; } } inner_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( inner_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create inner padding.", function ); goto on_error; } if( memory_set( inner_padding, 0x36, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set inner padding.", function ); goto on_error; } outer_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( outer_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create outer padding.", function ); goto on_error; } if( memory_set( outer_padding, 0x5c, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set outer padding.", function ); goto on_error; } for( block_index = 0; block_index < block_size; block_index++ ) { inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } if( libhmac_sha512_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha512_update( context, inner_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha512_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha512_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha512_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( libhmac_sha512_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha512_update( context, outer_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha512_update( context, hmac, LIBHMAC_SHA512_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha512_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha512_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( memory_set( outer_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear outer padding.", function ); goto on_error; } memory_free( outer_padding ); outer_padding = NULL; if( memory_set( inner_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear inner padding.", function ); goto on_error; } memory_free( inner_padding ); inner_padding = NULL; if( memory_set( key_data, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key data.", function ); goto on_error; } memory_free( key_data ); key_data = NULL; return( 1 ); on_error: if( context != NULL ) { libhmac_sha512_free( &context, NULL ); } if( outer_padding != NULL ) { memory_set( outer_padding, 0, block_size ); memory_free( outer_padding ); } if( inner_padding != NULL ) { memory_set( inner_padding, 0, block_size ); memory_free( inner_padding ); } if( key_data != NULL ) { memory_set( key_data, 0, block_size ); memory_free( key_data ); } return( -1 ); } libewf-20140807/libhmac/libhmac_sha256.h0000664000175000017500000001023213443450057021573 0ustar00lordyestalordyesta00000000000000/* * SHA-256 functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_SHA256_H ) #define _LIBHMAC_SHA256_H #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #endif #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" #if defined( __cplusplus ) extern "C" { #endif /* Make sure the WINAPI version is Vista or later otherwise * a cross compilation will contain broken SHA-256 support */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) #define LIBHMAC_HAVE_SHA256_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) #define LIBHMAC_HAVE_SHA256_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) #define LIBHMAC_HAVE_SHA256_SUPPORT #endif #if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) #define LIBHMAC_SHA256_BLOCK_SIZE 64 #endif typedef struct libhmac_internal_sha256_context libhmac_internal_sha256_context_t; struct libhmac_internal_sha256_context { #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) /* The crypto provider handle */ HCRYPTPROV crypt_provider; /* The crypto hash handle */ HCRYPTHASH hash; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) /* The SHA-256 context */ SHA256_CTX sha256_context; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) /* The EVP message digest context */ #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX internal_evp_md_context; #endif EVP_MD_CTX *evp_md_context; #else /* The number of bytes hashed */ uint64_t hash_count; /* The 32-bit hash values */ uint32_t hash_values[ 8 ]; /* The block offset */ size_t block_offset; /* The (data) block */ uint8_t block[ 128 ]; #endif }; #if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) ssize_t libhmac_sha256_transform( libhmac_internal_sha256_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); #endif /* !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) */ LIBHMAC_EXTERN \ int libhmac_sha256_initialize( libhmac_sha256_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha256_free( libhmac_sha256_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha256_update( libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha256_finalize( libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha256_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha256_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_SHA256_H ) */ libewf-20140807/libhmac/libhmac_support.h0000664000175000017500000000224313443450057022302 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_SUPPORT_H ) #define _LIBHMAC_SUPPORT_H #include #include #include "libhmac_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBHMAC ) LIBHMAC_EXTERN \ const char *libhmac_get_version( void ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_SUPPORT_H ) */ libewf-20140807/libhmac/libhmac_md5.c0000664000175000017500000015511213443450057021252 0ustar00lordyestalordyesta00000000000000/* * MD5 functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #include #endif #include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_md5.h" #if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) /* RFC 1321 based MD5 functions */ /* TODO decription what these values are based on */ uint32_t libhmac_md5_fixed_constants[ 4 ] = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL }; /* The first 32-bits of the sines (in radians) of the first 64 integers [ 0, 63 ] */ uint32_t libhmac_md5_sines[ 64 ] = { 0xd76aa478UL, 0xe8c7b756UL, 0x242070dbUL, 0xc1bdceeeUL, 0xf57c0fafUL, 0x4787c62aUL, 0xa8304613UL, 0xfd469501UL, 0x698098d8UL, 0x8b44f7afUL, 0xffff5bb1UL, 0x895cd7beUL, 0x6b901122UL, 0xfd987193UL, 0xa679438eUL, 0x49b40821UL, 0xf61e2562UL, 0xc040b340UL, 0x265e5a51UL, 0xe9b6c7aaUL, 0xd62f105dUL, 0x02441453UL, 0xd8a1e681UL, 0xe7d3fbc8UL, 0x21e1cde6UL, 0xc33707d6UL, 0xf4d50d87UL, 0x455a14edUL, 0xa9e3e905UL, 0xfcefa3f8UL, 0x676f02d9UL, 0x8d2a4c8aUL, 0xfffa3942UL, 0x8771f681UL, 0x6d9d6122UL, 0xfde5380cUL, 0xa4beea44UL, 0x4bdecfa9UL, 0xf6bb4b60UL, 0xbebfbc70UL, 0x289b7ec6UL, 0xeaa127faUL, 0xd4ef3085UL, 0x04881d05UL, 0xd9d4d039UL, 0xe6db99e5UL, 0x1fa27cf8UL, 0xc4ac5665UL, 0xf4292244UL, 0x432aff97UL, 0xab9423a7UL, 0xfc93a039UL, 0x655b59c3UL, 0x8f0ccc92UL, 0xffeff47dUL, 0x85845dd1UL, 0x6fa87e4fUL, 0xfe2ce6e0UL, 0xa3014314UL, 0x4e0811a1UL, 0xf7537e82UL, 0xbd3af235UL, 0x2ad7d2bbUL, 0xeb86d391UL }; /* The bit shifts */ uint8_t libhmac_md5_bit_shifts[ 64 ] = { 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 }; /* The 32-bit values indexes * [ 0, 15 ] => index * [ 16, 31 ] => ( ( 5 x index ) + 1 ) mod 16 * [ 32, 47 ] => ( ( 3 x index ) + 5 ) mod 16 * [ 48, 63 ] => ( 7 x index ) mod 16 */ uint8_t libhmac_md5_values_32bit_index[ 64 ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 }; #define libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ hash_values[ hash_value_index0 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ | ( ~( hash_values[ hash_value_index1 ] ) & hash_values[ hash_value_index3 ] ); \ hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ \ hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ libhmac_md5_bit_shifts[ block_index ] ); \ \ hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; #define libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ hash_values[ hash_value_index0 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index3 ] ) \ | ( hash_values[ hash_value_index2 ] & ~( hash_values[ hash_value_index3 ] ) ); \ hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ \ hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ libhmac_md5_bit_shifts[ block_index ] ); \ \ hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; #define libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ] \ ^ hash_values[ hash_value_index2 ] \ ^ hash_values[ hash_value_index3 ]; \ hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ \ hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ libhmac_md5_bit_shifts[ block_index ] ); \ \ hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; #define libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ hash_values[ hash_value_index0 ] += hash_values[ hash_value_index2 ] \ ^ ( hash_values[ hash_value_index1 ] | ~( hash_values[ hash_value_index3 ] ) ); \ hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ \ hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ hash_values[ hash_value_index0 ], \ libhmac_md5_bit_shifts[ block_index ] ); \ \ hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; #define libhmac_md5_transform_unfolded_calculate_hash_values( values_32bit, hash_values ) \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 0, hash_values, 0, 1, 2, 3, 0 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 1, hash_values, 3, 0, 1, 2, 1 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 2, hash_values, 2, 3, 0, 1, 2 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 3, hash_values, 1, 2, 3, 0, 3 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 4, hash_values, 0, 1, 2, 3, 4 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 5, hash_values, 3, 0, 1, 2, 5 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 6, hash_values, 2, 3, 0, 1, 6 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 7, hash_values, 1, 2, 3, 0, 7 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 8, hash_values, 0, 1, 2, 3, 8 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 9, hash_values, 3, 0, 1, 2, 9 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 10, hash_values, 2, 3, 0, 1, 10 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 11, hash_values, 1, 2, 3, 0, 11 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 12, hash_values, 0, 1, 2, 3, 12 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 13, hash_values, 3, 0, 1, 2, 13 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 14, hash_values, 2, 3, 0, 1, 14 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 15, hash_values, 1, 2, 3, 0, 15 ); \ \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 1, hash_values, 0, 1, 2, 3, 16 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 6, hash_values, 3, 0, 1, 2, 17 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 11, hash_values, 2, 3, 0, 1, 18 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 0, hash_values, 1, 2, 3, 0, 19 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 5, hash_values, 0, 1, 2, 3, 20 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 10, hash_values, 3, 0, 1, 2, 21 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 15, hash_values, 2, 3, 0, 1, 22 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 4, hash_values, 1, 2, 3, 0, 23 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 9, hash_values, 0, 1, 2, 3, 24 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 14, hash_values, 3, 0, 1, 2, 25 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 3, hash_values, 2, 3, 0, 1, 26 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 8, hash_values, 1, 2, 3, 0, 27 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 13, hash_values, 0, 1, 2, 3, 28 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 2, hash_values, 3, 0, 1, 2, 29 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 7, hash_values, 2, 3, 0, 1, 30 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 12, hash_values, 1, 2, 3, 0, 31 ); \ \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 5, hash_values, 0, 1, 2, 3, 32 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 8, hash_values, 3, 0, 1, 2, 33 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 11, hash_values, 2, 3, 0, 1, 34 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 14, hash_values, 1, 2, 3, 0, 35 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 1, hash_values, 0, 1, 2, 3, 36 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 4, hash_values, 3, 0, 1, 2, 37 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 7, hash_values, 2, 3, 0, 1, 38 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 10, hash_values, 1, 2, 3, 0, 39 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 13, hash_values, 0, 1, 2, 3, 40 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 0, hash_values, 3, 0, 1, 2, 41 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 3, hash_values, 2, 3, 0, 1, 42 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 6, hash_values, 1, 2, 3, 0, 43 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 9, hash_values, 0, 1, 2, 3, 44 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 12, hash_values, 3, 0, 1, 2, 45 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 15, hash_values, 2, 3, 0, 1, 46 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 2, hash_values, 1, 2, 3, 0, 47 ); \ \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 0, hash_values, 0, 1, 2, 3, 48 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 7, hash_values, 3, 0, 1, 2, 49 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 14, hash_values, 2, 3, 0, 1, 50 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 5, hash_values, 1, 2, 3, 0, 51 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 12, hash_values, 0, 1, 2, 3, 52 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 3, hash_values, 3, 0, 1, 2, 53 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 10, hash_values, 2, 3, 0, 1, 54 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 1, hash_values, 1, 2, 3, 0, 55 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 8, hash_values, 0, 1, 2, 3, 56 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 15, hash_values, 3, 0, 1, 2, 57 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 6, hash_values, 2, 3, 0, 1, 58 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 13, hash_values, 1, 2, 3, 0, 59 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 4, hash_values, 0, 1, 2, 3, 60 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 11, hash_values, 3, 0, 1, 2, 61 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 2, hash_values, 2, 3, 0, 1, 62 ); \ libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 9, hash_values, 1, 2, 3, 0, 63 ); /* Calculates the MD5 of 64 byte sized blocks of data in a buffer * Returns the number of bytes used if successful or -1 on error */ ssize_t libhmac_md5_transform( libhmac_internal_md5_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { uint32_t hash_values[ 4 ]; uint32_t values_32bit[ 16 ]; static char *function = "libhmac_md5_transform"; size_t buffer_offset = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) uint32_t hash_value = 0; uint8_t block_index = 0; uint8_t hash_values_index = 0; uint8_t value_32bit_index = 0; #endif if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid internal context.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } while( size >= LIBHMAC_MD5_BLOCK_SIZE ) { if( memory_copy( hash_values, internal_context->hash_values, sizeof( uint32_t ) * 4 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy hash values.", function ); goto on_error; } #if defined( LIBHMAC_UNFOLLED_LOOPS ) /* Break the block into 16 x 32-bit values */ libhmac_byte_stream_copy_to_16x_uint32_little_endian( &( buffer[ buffer_offset ] ), values_32bit ); buffer_offset += LIBHMAC_MD5_BLOCK_SIZE; /* Calculate the hash values for the 32-bit values */ libhmac_md5_transform_unfolded_calculate_hash_values( values_32bit, hash_values ); /* Update the hash values in the context */ internal_context->hash_values[ 0 ] += hash_values[ 0 ]; internal_context->hash_values[ 1 ] += hash_values[ 1 ]; internal_context->hash_values[ 2 ] += hash_values[ 2 ]; internal_context->hash_values[ 3 ] += hash_values[ 3 ]; #else /* Break the block into 16 x 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 16; value_32bit_index++ ) { byte_stream_copy_to_uint32_little_endian( &( buffer[ buffer_offset ] ), values_32bit[ value_32bit_index ] ); buffer_offset += sizeof( uint32_t ); } /* Calculate the hash values for the 32-bit values */ for( block_index = 0; block_index < 64; block_index++ ) { if( block_index < 16 ) { hash_values[ 0 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) | ( ~( hash_values[ 1 ] ) & hash_values[ 3 ] ); } else if( block_index < 32 ) { hash_values[ 0 ] += ( hash_values[ 1 ] & hash_values[ 3 ] ) | ( hash_values[ 2 ] & ~( hash_values[ 3 ] ) ); } else if( block_index < 48 ) { hash_values[ 0 ] += hash_values[ 1 ] ^ hash_values[ 2 ] ^ hash_values[ 3 ]; } else { hash_values[ 0 ] += hash_values[ 2 ] ^ ( hash_values[ 1 ] | ~( hash_values[ 3 ] ) ); } value_32bit_index = libhmac_md5_values_32bit_index[ block_index ]; hash_values[ 0 ] += values_32bit[ value_32bit_index ]; hash_values[ 0 ] += libhmac_md5_sines[ block_index ]; hash_values[ 0 ] = byte_stream_bit_rotate_left_32bit( hash_values[ 0 ], libhmac_md5_bit_shifts[ block_index ] ); hash_value = hash_values[ 3 ]; hash_values[ 3 ] = hash_values[ 2 ]; hash_values[ 2 ] = hash_values[ 1 ]; hash_values[ 1 ] += hash_values[ 0 ]; hash_values[ 0 ] = hash_value; } /* Update the hash values in the context */ for( hash_values_index = 0; hash_values_index < 4; hash_values_index++ ) { internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; } #endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ size -= LIBHMAC_MD5_BLOCK_SIZE; } /* Prevent sensitive data from leaking */ if( memory_set( hash_values, 0, sizeof( uint32_t ) * 4 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash values.", function ); goto on_error; } if( memory_set( values_32bit, 0, sizeof( uint32_t ) * 16 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear 32-bit values.", function ); goto on_error; } return( (ssize_t) buffer_offset ); on_error: memory_set( values_32bit, 0, sizeof( uint32_t ) * 16 ); memory_set( hash_values, 0, sizeof( uint32_t ) * 4 ); return( -1 ); } #endif /* !defined( LIBHMAC_HAVE_MD5_SUPPORT ) */ /* Creates a MD5 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libhmac_md5_initialize( libhmac_md5_context_t **context, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_initialize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid context value already set.", function ); return( -1 ); } internal_context = memory_allocate_structure( libhmac_internal_md5_context_t ); if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create context.", function ); goto on_error; } if( memory_set( internal_context, 0, sizeof( libhmac_internal_md5_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); memory_free( internal_context ); return( -1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT ) == 0 ) { if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create AES or RSA crypt provider.", function ); goto on_error; } } if( internal_context->crypt_provider == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: unable to create crypt provider.", function ); goto on_error; } if( CryptCreateHash( internal_context->crypt_provider, CALG_MD5, 0, 0, &( internal_context->hash ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash object.", function ); CryptReleaseContext( internal_context->crypt_provider, 0 ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) if( MD5_Init( &( internal_context->md5_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX_init( &( internal_context->internal_evp_md_context ) ); internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); #else internal_context->evp_md_context = EVP_MD_CTX_new(); if( internal_context->evp_md_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create EVP message digest context.", function ); goto on_error; } #endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ if( EVP_DigestInit_ex( internal_context->evp_md_context, EVP_md5(), NULL ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize EVP message digest context.", function ); #if defined( HAVE_EVP_MD_CTX_CLEANUP ) EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ); ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif internal_context->evp_md_context = NULL; goto on_error; } #else if( memory_copy( internal_context->hash_values, libhmac_md5_fixed_constants, sizeof( uint32_t ) * 4 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy fixed constants to hash values.", function ); goto on_error; } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ *context = (libhmac_md5_context_t *) internal_context; return( 1 ); on_error: if( internal_context != NULL ) { memory_free( internal_context ); } return( -1 ); } /* Frees a MD5 context * Returns 1 if successful or -1 on error */ int libhmac_md5_free( libhmac_md5_context_t **context, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_free"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { internal_context = (libhmac_internal_md5_context_t *) *context; *context = NULL; #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( internal_context->crypt_provider, 0 ); } if( internal_context->hash != 0 ) { CryptDestroyHash( internal_context->hash ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) /* No additional clean up necessary */ #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) #if defined( HAVE_EVP_MD_CTX_CLEANUP ) if( EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clean up EVP message digest context.", function ); } /* Make sure the error state is removed otherwise OpenSSL will leak memory */ ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ internal_context->evp_md_context = NULL; #else /* No additional clean up necessary */ #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ memory_free( internal_context ); } return( 1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) /* Updates the MD5 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_md5_update( libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #endif if( size == 0 ) { return( 1 ); } if( CryptHashData( internal_context->hash, (BYTE *) buffer, (DWORD) size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) /* Updates the MD5 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_md5_update( libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_update"; unsigned long safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_LONG < SIZEOF_SIZE_T ) if( size > (size_t) ULONG_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } safe_hash_size = (unsigned long) size; if( MD5_Update( &( internal_context->md5_context ), (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) /* Updates the MD5 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_md5_update( libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( EVP_DigestUpdate( internal_context->evp_md_context, (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #else /* Updates the MD5 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_md5_update( libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_update"; size_t buffer_offset = 0; size_t remaining_block_size = 0; ssize_t process_count = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( internal_context->block_offset > 0 ) { remaining_block_size = LIBHMAC_MD5_BLOCK_SIZE - internal_context->block_offset; if( remaining_block_size > size ) { remaining_block_size = size; } if( memory_copy( &( internal_context->block[ internal_context->block_offset ] ), buffer, remaining_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data to context block.", function ); return( -1 ); } internal_context->block_offset += remaining_block_size; if( internal_context->block_offset < LIBHMAC_MD5_BLOCK_SIZE ) { return( 1 ); } buffer_offset += remaining_block_size; size -= remaining_block_size; process_count = libhmac_md5_transform( internal_context, internal_context->block, LIBHMAC_MD5_BLOCK_SIZE, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } internal_context->hash_count += process_count; internal_context->block_offset = 0; } if( size > 0 ) { process_count = libhmac_md5_transform( internal_context, &( buffer[ buffer_offset ] ), size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform buffer.", function ); return( -1 ); } internal_context->hash_count += process_count; buffer_offset += process_count; size -= process_count; } if( size > 0 ) { if( size >= LIBHMAC_MD5_BLOCK_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( memory_copy( internal_context->block, &( buffer[ buffer_offset ] ), size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy remaining data to context block.", function ); return( -1 ); } internal_context->block_offset = size; } return( 1 ); } #endif /* if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) /* Finalizes the MD5 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_md5_finalize( libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_finalize"; DWORD safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } #endif if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } safe_hash_size = (DWORD) hash_size; if( CryptGetHashParam( internal_context->hash, HP_HASHVAL, (BYTE *) hash, &safe_hash_size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) /* Finalizes the MD5 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_md5_finalize( libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_finalize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } if( MD5_Final( hash, &( internal_context->md5_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) /* Finalizes the MD5 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_md5_finalize( libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_finalize"; unsigned int safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) UINT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } safe_hash_size = (unsigned int) hash_size; if( EVP_DigestFinal_ex( internal_context->evp_md_context, (unsigned char *) hash, &safe_hash_size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #else /* Finalizes the MD5 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_md5_finalize( libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_finalize"; size_t block_size = 0; size_t number_of_blocks = 0; ssize_t process_count = 0; uint64_t bit_size = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) size_t hash_index = 0; int hash_values_index = 0; #endif if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_md5_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } /* Add padding with a size of 56 mod 64 */ number_of_blocks = 1; if( internal_context->block_offset > 55 ) { number_of_blocks += 1; } block_size = number_of_blocks * LIBHMAC_MD5_BLOCK_SIZE; if( memory_set( &( internal_context->block[ internal_context->block_offset ] ), 0, block_size - internal_context->block_offset ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context block.", function ); return( -1 ); } /* The first byte of the padding contains 0x80 */ internal_context->block[ internal_context->block_offset ] = 0x80; bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; byte_stream_copy_from_uint64_little_endian( &( internal_context->block[ block_size - 8 ] ), bit_size ); process_count = libhmac_md5_transform( internal_context, internal_context->block, block_size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } #if !defined( LIBHMAC_UNFOLLED_LOOPS ) for( hash_values_index = 0; hash_values_index < 4; hash_values_index++ ) { byte_stream_copy_from_uint32_little_endian( &( hash[ hash_index ] ), internal_context->hash_values[ hash_values_index ] ); hash_index += sizeof( uint32_t ); } #else byte_stream_copy_from_uint32_little_endian( &( hash[ 0 ] ), internal_context->hash_values[ 0 ] ); byte_stream_copy_from_uint32_little_endian( &( hash[ 4 ] ), internal_context->hash_values[ 1 ] ); byte_stream_copy_from_uint32_little_endian( &( hash[ 8 ] ), internal_context->hash_values[ 2 ] ); byte_stream_copy_from_uint32_little_endian( &( hash[ 12 ] ), internal_context->hash_values[ 3 ] ); #endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ /* Prevent sensitive data from leaking */ if( memory_set( internal_context, 0, sizeof( libhmac_internal_md5_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); return( -1 ); } return( 1 ); } #endif /* if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ /* Calculates the MD5 of the buffer * Returns 1 if successful or -1 on error */ int libhmac_md5_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_md5_context_t *context = NULL; static char *function = "libhmac_md5_calculate"; if( libhmac_md5_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_md5_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_md5_finalize( context, hash, hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_md5_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } return( 1 ); on_error: if( context != NULL ) { libhmac_md5_free( &context, NULL ); } return( -1 ); } /* Calculates the MD5 HMAC of the buffer * HMAC is defined in RFC 2104 * Returns 1 if successful or -1 on error */ int libhmac_md5_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ) { uint8_t key_hash[ LIBHMAC_MD5_HASH_SIZE ]; libhmac_md5_context_t *context = NULL; uint8_t *key_data = NULL; uint8_t *inner_padding = NULL; uint8_t *outer_padding = NULL; static char *function = "libhmac_md5_calculate_hmac"; size_t block_index = 0; size_t block_size = 64; if( key == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid key.", function ); return( -1 ); } if( key_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid key size value exceeds maximum.", function ); return( -1 ); } if( hmac_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid HMAC size value too small.", function ); return( -1 ); } key_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( key_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create key data.", function ); goto on_error; } if( key_size <= block_size ) { if( memory_copy( key_data, key, key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key data.", function ); goto on_error; } if( memory_set( &( key_data[ key_size ] ), 0, block_size - key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key remaining data.", function ); goto on_error; } } else { if( libhmac_md5_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_md5_update( context, key, key_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_md5_finalize( context, key_hash, LIBHMAC_MD5_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_md5_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( block_size > LIBHMAC_MD5_HASH_SIZE ) { if( memory_set( &( key_data[ LIBHMAC_MD5_HASH_SIZE ] ), 0, block_size - LIBHMAC_MD5_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear remaining key data.", function ); goto on_error; } } if( memory_copy( key_data, key_hash, LIBHMAC_MD5_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key hash data.", function ); goto on_error; } } inner_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( inner_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create inner padding.", function ); goto on_error; } if( memory_set( inner_padding, 0x36, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set inner padding.", function ); goto on_error; } outer_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( outer_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create outer padding.", function ); goto on_error; } if( memory_set( outer_padding, 0x5c, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set outer padding.", function ); goto on_error; } for( block_index = 0; block_index < block_size; block_index++ ) { inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } if( libhmac_md5_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_md5_update( context, inner_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_md5_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_md5_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_md5_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( libhmac_md5_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_md5_update( context, outer_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_md5_update( context, hmac, LIBHMAC_MD5_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_md5_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_md5_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( memory_set( outer_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear outer padding.", function ); goto on_error; } memory_free( outer_padding ); outer_padding = NULL; if( memory_set( inner_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear inner padding.", function ); goto on_error; } memory_free( inner_padding ); inner_padding = NULL; if( memory_set( key_data, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key data.", function ); goto on_error; } memory_free( key_data ); key_data = NULL; return( 1 ); on_error: if( context != NULL ) { libhmac_md5_free( &context, NULL ); } if( outer_padding != NULL ) { memory_set( outer_padding, 0, block_size ); memory_free( outer_padding ); } if( inner_padding != NULL ) { memory_set( inner_padding, 0, block_size ); memory_free( inner_padding ); } if( key_data != NULL ) { memory_set( key_data, 0, block_size ); memory_free( key_data ); } return( -1 ); } libewf-20140807/libhmac/libhmac_libcerror.h0000664000175000017500000000263513443450057022556 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2011-2018, 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( _LIBHMAC_LIBCERROR_H ) #define _LIBHMAC_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBHMAC_LIBCERROR_H ) */ libewf-20140807/libhmac/libhmac_extern.h0000664000175000017500000000237213443450057022076 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2011-2018, 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( _LIBHMAC_INTERNAL_EXTERN_H ) #define _LIBHMAC_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBHMAC for local use of libhmac */ #if !defined( HAVE_LOCAL_LIBHMAC ) #include #define LIBHMAC_EXTERN_VARIABLE LIBHMAC_EXTERN #else #define LIBHMAC_EXTERN /* extern */ #define LIBHMAC_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBHMAC ) */ #endif /* !defined( _LIBHMAC_INTERNAL_EXTERN_H ) */ libewf-20140807/libhmac/libhmac_sha224.c0000664000175000017500000016637213443450057021602 0ustar00lordyestalordyesta00000000000000/* * SHA-224 functions * * Copyright (C) 2011-2018, 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 . */ #include #include #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #include #endif #include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha224.h" #if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) /* FIPS 180-2 based SHA-224 functions */ /* The first 32-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] */ uint32_t libhmac_sha224_prime_square_roots[ 8 ] = { 0xc1059ed8UL, 0x367cd507UL, 0x3070dd17UL, 0xf70e5939UL, 0xffc00b31UL, 0x68581511UL, 0x64f98fa7UL, 0xbefa4fa4UL }; /* The first 32-bits of the fractional parts of the cube roots of the first 64 primes [ 2, 311 ] */ uint32_t libhmac_sha224_prime_cube_roots[ 64 ] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; #define libhmac_sha224_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ) \ s0 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 7 ) \ ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 18 ) \ ^ ( values_32bit[ value_32bit_index - 15 ] >> 3 ); \ s1 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 17 ) \ ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 19 ) \ ^ ( values_32bit[ value_32bit_index - 2 ] >> 10 ); \ \ values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 16 ] \ + s0 \ + values_32bit[ value_32bit_index - 7 ] \ + s1 #define libhmac_sha224_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ) \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 16, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 17, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 18, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 19, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 20, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 21, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 22, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 23, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 24, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 25, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 26, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 27, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 28, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 29, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 30, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 31, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 32, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 33, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 34, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 35, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 36, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 37, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 38, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 39, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 40, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 41, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 42, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 43, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 44, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 45, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 46, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 47, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 48, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 49, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 50, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 51, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 52, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 53, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 54, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 55, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 56, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 57, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 58, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 59, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 60, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 61, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 62, s0, s1 ); \ libhmac_sha224_transform_extend_32bit_value( values_32bit, 63, s0, s1 ); #define libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ s0 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 2 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 13 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 22 ); \ s1 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 6 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 11 ) \ ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 25 ); \ \ t1 = hash_values[ hash_value_index7 ]; \ t1 += s1; \ t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ t1 += libhmac_sha224_prime_cube_roots[ value_32bit_index ]; \ t1 += values_32bit[ value_32bit_index ]; \ t2 = s0; \ t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ \ hash_values[ hash_value_index3 ] += t1; \ hash_values[ hash_value_index7 ] = t1 + t2; #define libhmac_sha224_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) /* Calculates the SHA-224 of 64 byte sized blocks of data in a buffer * Returns the number of bytes used if successful or -1 on error */ ssize_t libhmac_sha224_transform( libhmac_internal_sha224_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { uint32_t hash_values[ 8 ]; uint32_t values_32bit[ 64 ]; static char *function = "libhmac_sha224_transform"; uint32_t s0 = 0; uint32_t s1 = 0; uint32_t t1 = 0; uint32_t t2 = 0; size_t buffer_offset = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) uint8_t hash_values_index = 0; uint8_t value_32bit_index = 0; #endif if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid internal context.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } while( size >= LIBHMAC_SHA224_BLOCK_SIZE ) { if( memory_copy( hash_values, internal_context->hash_values, sizeof( uint32_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy hash values.", function ); goto on_error; } #if defined( LIBHMAC_UNFOLLED_LOOPS ) /* Break the block into 16 x 32-bit values */ libhmac_byte_stream_copy_to_16x_uint32_big_endian( &( buffer[ buffer_offset ] ), values_32bit ); buffer_offset += LIBHMAC_SHA224_BLOCK_SIZE; /* Extend to 64 x 32-bit values */ libhmac_sha224_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ); /* Calculate the hash values for the 32-bit values */ libhmac_sha224_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ); /* Update the hash values in the context */ internal_context->hash_values[ 0 ] += hash_values[ 0 ]; internal_context->hash_values[ 1 ] += hash_values[ 1 ]; internal_context->hash_values[ 2 ] += hash_values[ 2 ]; internal_context->hash_values[ 3 ] += hash_values[ 3 ]; internal_context->hash_values[ 4 ] += hash_values[ 4 ]; internal_context->hash_values[ 5 ] += hash_values[ 5 ]; internal_context->hash_values[ 6 ] += hash_values[ 6 ]; internal_context->hash_values[ 7 ] += hash_values[ 7 ]; #else /* Break the block into 16 x 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 16; value_32bit_index++ ) { byte_stream_copy_to_uint32_big_endian( &( buffer[ buffer_offset ] ), values_32bit[ value_32bit_index ] ); buffer_offset += sizeof( uint32_t ); } /* Extend to 64 x 32-bit values */ for( value_32bit_index = 16; value_32bit_index < 64; value_32bit_index++ ) { libhmac_sha224_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ); } /* Calculate the hash values for the 32-bit values */ for( value_32bit_index = 0; value_32bit_index < 64; value_32bit_index++ ) { s0 = byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 2 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 13 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 22 ); s1 = byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 6 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 11 ) ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 25 ); t1 = hash_values[ 7 ]; t1 += s1; t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); t1 += libhmac_sha224_prime_cube_roots[ value_32bit_index ]; t1 += values_32bit[ value_32bit_index ]; t2 = s0; t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); hash_values[ 7 ] = hash_values[ 6 ]; hash_values[ 6 ] = hash_values[ 5 ]; hash_values[ 5 ] = hash_values[ 4 ]; hash_values[ 4 ] = hash_values[ 3 ] + t1; hash_values[ 3 ] = hash_values[ 2 ]; hash_values[ 2 ] = hash_values[ 1 ]; hash_values[ 1 ] = hash_values[ 0 ]; hash_values[ 0 ] = t1 + t2; } /* Update the hash values in the context */ for( hash_values_index = 0; hash_values_index < 8; hash_values_index++ ) { internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; } #endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ size -= LIBHMAC_SHA224_BLOCK_SIZE; } /* Prevent sensitive data from leaking */ if( memory_set( hash_values, 0, sizeof( uint32_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear hash values.", function ); goto on_error; } if( memory_set( values_32bit, 0, sizeof( uint32_t ) * 64 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear 32-bit values.", function ); goto on_error; } return( (ssize_t) buffer_offset ); on_error: memory_set( values_32bit, 0, sizeof( uint32_t ) * 64 ); memory_set( hash_values, 0, sizeof( uint32_t ) * 8 ); return( -1 ); } #endif /* !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) */ /* Creates a SHA-224 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libhmac_sha224_initialize( libhmac_sha224_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_initialize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid context value already set.", function ); return( -1 ); } internal_context = memory_allocate_structure( libhmac_internal_sha224_context_t ); if( internal_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create context.", function ); goto on_error; } if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha224_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); memory_free( internal_context ); return( -1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT ) == 0 ) { if( CryptAcquireContext( &( internal_context->crypt_provider ), NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create AES or RSA crypt provider.", function ); goto on_error; } } if( internal_context->crypt_provider == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: unable to create crypt provider.", function ); goto on_error; } if( CryptCreateHash( internal_context->crypt_provider, CALG_SHA_224, 0, 0, &( internal_context->hash ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create hash object.", function ); CryptReleaseContext( internal_context->crypt_provider, 0 ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) if( SHA224_Init( &( internal_context->sha224_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX_init( &( internal_context->internal_evp_md_context ) ); internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); #else internal_context->evp_md_context = EVP_MD_CTX_new(); if( internal_context->evp_md_context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create EVP message digest context.", function ); goto on_error; } #endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ if( EVP_DigestInit_ex( internal_context->evp_md_context, EVP_sha224(), NULL ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); #if defined( HAVE_EVP_MD_CTX_CLEANUP ) EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ); ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif internal_context->evp_md_context = NULL; goto on_error; } #else if( memory_copy( internal_context->hash_values, libhmac_sha224_prime_square_roots, sizeof( uint32_t ) * 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy initial hash values.", function ); return( -1 ); } #endif *context = (libhmac_sha224_context_t *) internal_context; return( 1 ); on_error: if( internal_context != NULL ) { memory_free( internal_context ); } return( -1 ); } /* Frees a SHA-224 context * Returns 1 if successful or -1 on error */ int libhmac_sha224_free( libhmac_sha224_context_t **context, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_free"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } if( *context != NULL ) { internal_context = (libhmac_internal_sha224_context_t *) *context; *context = NULL; #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( internal_context->crypt_provider, 0 ); } if( internal_context->hash != 0 ) { CryptDestroyHash( internal_context->hash ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) /* No additional clean up necessary */ #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) #if defined( HAVE_EVP_MD_CTX_CLEANUP ) if( EVP_MD_CTX_cleanup( &( internal_context->internal_evp_md_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clean up EVP message digest context.", function ); } /* Make sure the error state is removed otherwise OpenSSL will leak memory */ ERR_remove_thread_state( NULL ); #else EVP_MD_CTX_free( internal_context->evp_md_context ); #endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ internal_context->evp_md_context = NULL; #else /* No additional clean up necessary */ #endif memory_free( internal_context ); } return( 1 ); } #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) /* Updates the SHA-224 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha224_update( libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #endif if( size == 0 ) { return( 1 ); } if( CryptHashData( internal_context->hash, (BYTE *) buffer, (DWORD) size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) /* Updates the SHA-224 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha224_update( libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_update"; unsigned long safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } #if ( SIZEOF_LONG < SIZEOF_SIZE_T ) if( size > (size_t) ULONG_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } safe_hash_size = (unsigned long) size; if( SHA256_Update( &( internal_context->sha224_context ), (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) /* Updates the SHA-224 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha224_update( libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_update"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( EVP_DigestUpdate( internal_context->evp_md_context, (const void *) buffer, size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); return( -1 ); } return( 1 ); } #else /* Updates the SHA-224 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha224_update( libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_update"; size_t buffer_offset = 0; size_t remaining_block_size = 0; ssize_t process_count = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( size == 0 ) { return( 1 ); } if( internal_context->block_offset > 0 ) { remaining_block_size = LIBHMAC_SHA224_BLOCK_SIZE - internal_context->block_offset; if( remaining_block_size > size ) { remaining_block_size = size; } if( memory_copy( &( internal_context->block[ internal_context->block_offset ] ), buffer, remaining_block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data to context block.", function ); return( -1 ); } internal_context->block_offset += remaining_block_size; if( internal_context->block_offset < LIBHMAC_SHA224_BLOCK_SIZE ) { return( 1 ); } buffer_offset += remaining_block_size; size -= remaining_block_size; process_count = libhmac_sha224_transform( internal_context, internal_context->block, LIBHMAC_SHA224_BLOCK_SIZE, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } internal_context->hash_count += process_count; internal_context->block_offset = 0; } if( size > 0 ) { process_count = libhmac_sha224_transform( internal_context, &( buffer[ buffer_offset ] ), size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform buffer.", function ); return( -1 ); } internal_context->hash_count += process_count; buffer_offset += process_count; size -= process_count; } if( size > 0 ) { if( size >= LIBHMAC_SHA224_BLOCK_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( memory_copy( internal_context->block, &( buffer[ buffer_offset ] ), size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy remaining data to context block.", function ); return( -1 ); } internal_context->block_offset = size; } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) /* Finalizes the SHA-224 context using the Windows Crypto API * Returns 1 if successful or -1 on error */ int libhmac_sha224_finalize( libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_finalize"; DWORD safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( internal_context->hash == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid context - missing hash.", function ); return( -1 ); } if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } #endif if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } safe_hash_size = (DWORD) hash_size; if( CryptGetHashParam( internal_context->hash, HP_HASHVAL, (BYTE *) hash, &safe_hash_size, 0 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize hash.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) /* Finalizes the SHA-224 context using OpenSSL * Returns 1 if successful or -1 on error */ int libhmac_sha224_finalize( libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_finalize"; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } if( SHA256_Final( hash, &( internal_context->sha224_context ) ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) /* Finalizes the SHA-224 context using OpenSSL EVP * Returns 1 if successful or -1 on error */ int libhmac_sha224_finalize( libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_finalize"; unsigned int safe_hash_size = 0; if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size > (size_t) UINT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } safe_hash_size = (unsigned int) hash_size; if( EVP_DigestFinal_ex( internal_context->evp_md_context, (unsigned char *) hash, &safe_hash_size ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); return( -1 ); } return( 1 ); } #else /* Finalizes the SHA-224 context using fallback implementation * Returns 1 if successful or -1 on error */ int libhmac_sha224_finalize( libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_finalize"; size_t block_size = 0; size_t number_of_blocks = 0; ssize_t process_count = 0; uint64_t bit_size = 0; #if !defined( LIBHMAC_UNFOLLED_LOOPS ) size_t hash_index = 0; int hash_values_index = 0; #endif if( context == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid context.", function ); return( -1 ); } internal_context = (libhmac_internal_sha224_context_t *) context; if( hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid hash.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash value too small.", function ); return( -1 ); } if( hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid hash size value exceeds maximum.", function ); return( -1 ); } if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid hash size value too small.", function ); return( -1 ); } /* Add padding with a size of 56 mod 64 */ number_of_blocks = 1; if( internal_context->block_offset > 55 ) { number_of_blocks += 1; } block_size = number_of_blocks * LIBHMAC_SHA224_BLOCK_SIZE; if( memory_set( &( internal_context->block[ internal_context->block_offset ] ), 0, block_size - internal_context->block_offset ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context block.", function ); return( -1 ); } /* The first byte of the padding contains 0x80 */ internal_context->block[ internal_context->block_offset ] = 0x80; bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; byte_stream_copy_from_uint64_big_endian( &( internal_context->block[ block_size - 8 ] ), bit_size ); process_count = libhmac_sha224_transform( internal_context, internal_context->block, block_size, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to transform context block.", function ); return( -1 ); } /* Note that hash_values[ 7 ] is omitted from the hash */ #if !defined( LIBHMAC_UNFOLLED_LOOPS ) for( hash_values_index = 0; hash_values_index < 7; hash_values_index++ ) { byte_stream_copy_from_uint32_big_endian( &( hash[ hash_index ] ), internal_context->hash_values[ hash_values_index ] ); hash_index += sizeof( uint32_t ); } #else byte_stream_copy_from_uint32_big_endian( &( hash[ 0 ] ), internal_context->hash_values[ 0 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 4 ] ), internal_context->hash_values[ 1 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 8 ] ), internal_context->hash_values[ 2 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 12 ] ), internal_context->hash_values[ 3 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 16 ] ), internal_context->hash_values[ 4 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 20 ] ), internal_context->hash_values[ 5 ] ); byte_stream_copy_from_uint32_big_endian( &( hash[ 24 ] ), internal_context->hash_values[ 6 ] ); #endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ /* Prevent sensitive data from leaking */ if( memory_set( internal_context, 0, sizeof( libhmac_internal_sha224_context_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear context.", function ); return( -1 ); } return( 1 ); } #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) */ /* Calculates the SHA-224 of the buffer * Returns 1 if successful or -1 on error */ int libhmac_sha224_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ) { libhmac_sha224_context_t *context = NULL; static char *function = "libhmac_sha224_calculate"; if( libhmac_sha224_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha224_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha224_finalize( context, hash, hash_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha224_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } return( 1 ); on_error: if( context != NULL ) { libhmac_sha224_free( &context, NULL ); } return( -1 ); } /* Calculates the SHA-224 HMAC of the buffer * HMAC is defined in RFC 2104 * Returns 1 if successful or -1 on error */ int libhmac_sha224_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ) { uint8_t key_hash[ LIBHMAC_SHA224_HASH_SIZE ]; libhmac_sha224_context_t *context = NULL; uint8_t *key_data = NULL; uint8_t *inner_padding = NULL; uint8_t *outer_padding = NULL; static char *function = "libhmac_sha224_calculate_hmac"; size_t block_index = 0; size_t block_size = 64; if( key == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid key.", function ); return( -1 ); } if( key_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid key size value exceeds maximum.", function ); return( -1 ); } if( hmac_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid HMAC size value too small.", function ); return( -1 ); } key_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( key_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create key data.", function ); goto on_error; } if( key_size <= block_size ) { if( memory_copy( key_data, key, key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key data.", function ); goto on_error; } if( memory_set( &( key_data[ key_size ] ), 0, block_size - key_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key remaining data.", function ); goto on_error; } } else { if( libhmac_sha224_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha224_update( context, key, key_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha224_finalize( context, key_hash, LIBHMAC_SHA224_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha224_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( block_size > LIBHMAC_SHA224_HASH_SIZE ) { if( memory_set( &( key_data[ LIBHMAC_SHA224_HASH_SIZE ] ), 0, block_size - LIBHMAC_SHA224_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear remaining key data.", function ); goto on_error; } } if( memory_copy( key_data, key_hash, LIBHMAC_SHA224_HASH_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy key hash data.", function ); goto on_error; } } inner_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( inner_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create inner padding.", function ); goto on_error; } if( memory_set( inner_padding, 0x36, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set inner padding.", function ); goto on_error; } outer_padding = (uint8_t *) memory_allocate( sizeof( uint8_t ) * block_size ); if( outer_padding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create outer padding.", function ); goto on_error; } if( memory_set( outer_padding, 0x5c, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set outer padding.", function ); goto on_error; } for( block_index = 0; block_index < block_size; block_index++ ) { inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } if( libhmac_sha224_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha224_update( context, inner_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha224_update( context, buffer, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha224_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha224_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( libhmac_sha224_initialize( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize context.", function ); goto on_error; } if( libhmac_sha224_update( context, outer_padding, block_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha224_update( context, hmac, LIBHMAC_SHA224_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update context.", function ); goto on_error; } if( libhmac_sha224_finalize( context, hmac, hmac_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize context.", function ); goto on_error; } if( libhmac_sha224_free( &context, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free context.", function ); goto on_error; } if( memory_set( outer_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear outer padding.", function ); goto on_error; } memory_free( outer_padding ); outer_padding = NULL; if( memory_set( inner_padding, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear inner padding.", function ); goto on_error; } memory_free( inner_padding ); inner_padding = NULL; if( memory_set( key_data, 0, block_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear key data.", function ); goto on_error; } memory_free( key_data ); key_data = NULL; return( 1 ); on_error: if( context != NULL ) { libhmac_sha224_free( &context, NULL ); } if( outer_padding != NULL ) { memory_set( outer_padding, 0, block_size ); memory_free( outer_padding ); } if( inner_padding != NULL ) { memory_set( inner_padding, 0, block_size ); memory_free( inner_padding ); } if( key_data != NULL ) { memory_set( key_data, 0, block_size ); memory_free( key_data ); } return( -1 ); } libewf-20140807/libhmac/Makefile.in0000664000175000017500000010240713443455350021007 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libhmac ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libhmac_la_LIBADD = am__libhmac_la_SOURCES_DIST = libhmac_byte_stream.h \ libhmac_definitions.h libhmac_extern.h libhmac_error.c \ libhmac_error.h libhmac_libcerror.h libhmac_md5.c \ libhmac_md5.h libhmac_sha1.c libhmac_sha1.h libhmac_sha224.c \ libhmac_sha224.h libhmac_sha256.c libhmac_sha256.h \ libhmac_sha512.c libhmac_sha512.h libhmac_support.c \ libhmac_support.h libhmac_types.h libhmac_unused.h @HAVE_LOCAL_LIBHMAC_TRUE@am_libhmac_la_OBJECTS = libhmac_error.lo \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_md5.lo libhmac_sha1.lo \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224.lo libhmac_sha256.lo \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512.lo libhmac_support.lo libhmac_la_OBJECTS = $(am_libhmac_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBHMAC_TRUE@am_libhmac_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libhmac_error.Plo \ ./$(DEPDIR)/libhmac_md5.Plo ./$(DEPDIR)/libhmac_sha1.Plo \ ./$(DEPDIR)/libhmac_sha224.Plo ./$(DEPDIR)/libhmac_sha256.Plo \ ./$(DEPDIR)/libhmac_sha512.Plo ./$(DEPDIR)/libhmac_support.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libhmac_la_SOURCES) DIST_SOURCES = $(am__libhmac_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBHMAC_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBHMAC_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBHMAC_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBHMAC_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBHMAC_TRUE@noinst_LTLIBRARIES = libhmac.la @HAVE_LOCAL_LIBHMAC_TRUE@libhmac_la_SOURCES = \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_byte_stream.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_definitions.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_extern.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_error.c libhmac_error.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_libcerror.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_md5.c libhmac_md5.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha1.c libhmac_sha1.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224.c libhmac_sha224.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha256.c libhmac_sha256.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512.c libhmac_sha512.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_support.c libhmac_support.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_types.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libhmac/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libhmac/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libhmac.la: $(libhmac_la_OBJECTS) $(libhmac_la_DEPENDENCIES) $(EXTRA_libhmac_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libhmac_la_rpath) $(libhmac_la_OBJECTS) $(libhmac_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_md5.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha224.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha256.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha512.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_support.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libhmac_error.Plo -rm -f ./$(DEPDIR)/libhmac_md5.Plo -rm -f ./$(DEPDIR)/libhmac_sha1.Plo -rm -f ./$(DEPDIR)/libhmac_sha224.Plo -rm -f ./$(DEPDIR)/libhmac_sha256.Plo -rm -f ./$(DEPDIR)/libhmac_sha512.Plo -rm -f ./$(DEPDIR)/libhmac_support.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libhmac ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libhmac_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libhmac/libhmac_types.h0000664000175000017500000000363013443450057021733 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2011-2018, 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( _LIBHMAC_INTERNAL_TYPES_H ) #define _LIBHMAC_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBHMAC for local use of libhmac * The definitions in are copied here * for local use of libhmac */ #if defined( HAVE_LOCAL_LIBHMAC ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libhmac_md5_context {} libhmac_md5_context_t; typedef struct libhmac_sha1_context {} libhmac_sha1_context_t; typedef struct libhmac_sha224_context {} libhmac_sha224_context_t; typedef struct libhmac_sha256_context {} libhmac_sha256_context_t; typedef struct libhmac_sha512_context {} libhmac_sha512_context_t; #else typedef intptr_t libhmac_md5_context_t; typedef intptr_t libhmac_sha1_context_t; typedef intptr_t libhmac_sha224_context_t; typedef intptr_t libhmac_sha256_context_t; typedef intptr_t libhmac_sha512_context_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBHMAC ) */ #endif /* !defined( _LIBHMAC_INTERNAL_TYPES_H ) */ libewf-20140807/libhmac/libhmac_sha512.h0000664000175000017500000001023313443450057021567 0ustar00lordyestalordyesta00000000000000/* * SHA-512 functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_SHA512_H ) #define _LIBHMAC_SHA512_H #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #endif #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" #if defined( __cplusplus ) extern "C" { #endif /* Make sure the WINAPI version is Vista or later otherwise * a cross compilation will contain broken SHA-512 support */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) #define LIBHMAC_HAVE_SHA512_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) #define LIBHMAC_HAVE_SHA512_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) #define LIBHMAC_HAVE_SHA512_SUPPORT #endif #if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) #define LIBHMAC_SHA512_BLOCK_SIZE 128 #endif typedef struct libhmac_internal_sha512_context libhmac_internal_sha512_context_t; struct libhmac_internal_sha512_context { #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) /* The crypto provider handle */ HCRYPTPROV crypt_provider; /* The crypto hash handle */ HCRYPTHASH hash; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) /* The SHA-512 context */ SHA512_CTX sha512_context; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) /* The EVP message digest context */ #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX internal_evp_md_context; #endif EVP_MD_CTX *evp_md_context; #else /* The number of bytes hashed */ uint64_t hash_count; /* The 64-bit hash values */ uint64_t hash_values[ 8 ]; /* The block offset */ size_t block_offset; /* The (data) block */ uint8_t block[ 128 ]; #endif }; #if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) ssize_t libhmac_sha512_transform( libhmac_internal_sha512_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); #endif /* !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) */ LIBHMAC_EXTERN \ int libhmac_sha512_initialize( libhmac_sha512_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha512_free( libhmac_sha512_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha512_update( libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha512_finalize( libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha512_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha512_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_SHA512_H ) */ libewf-20140807/libhmac/libhmac_unused.h0000664000175000017500000000253613443450057022076 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2011-2018, 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( _LIBHMAC_INTERNAL_UNUSED_H ) #define _LIBHMAC_INTERNAL_UNUSED_H #include #if !defined( LIBHMAC_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBHMAC_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBHMAC_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBHMAC_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBHMAC_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBHMAC_INTERNAL_UNUSED_H ) */ libewf-20140807/libhmac/libhmac_sha224.h0000664000175000017500000001026413443450057021573 0ustar00lordyestalordyesta00000000000000/* * SHA-224 functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_SHA224_H ) #define _LIBHMAC_SHA224_H #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #endif #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" #if defined( __cplusplus ) extern "C" { #endif /* Make sure the WINAPI version is Vista or later otherwise * a cross compilation will contain broken SHA-224 support */ #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) #define LIBHMAC_HAVE_SHA224_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) #define LIBHMAC_HAVE_SHA224_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) #define LIBHMAC_HAVE_SHA224_SUPPORT #endif #if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) #define LIBHMAC_SHA224_BLOCK_SIZE 64 #endif typedef struct libhmac_internal_sha224_context libhmac_internal_sha224_context_t; struct libhmac_internal_sha224_context { #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) /* The crypto provider handle */ HCRYPTPROV crypt_provider; /* The crypto hash handle */ HCRYPTHASH hash; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) /* The SHA-224 functions use the SHA-256 context */ SHA256_CTX sha224_context; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) /* The EVP message digest context */ #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX internal_evp_md_context; #endif EVP_MD_CTX *evp_md_context; #else /* The number of bytes hashed */ uint64_t hash_count; /* The 32-bit hash values */ uint32_t hash_values[ 8 ]; /* The block offset */ size_t block_offset; /* The (data) block */ uint8_t block[ 128 ]; #endif }; #if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) ssize_t libhmac_sha224_transform( libhmac_internal_sha224_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); #endif /* !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) */ LIBHMAC_EXTERN \ int libhmac_sha224_initialize( libhmac_sha224_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha224_free( libhmac_sha224_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha224_update( libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha224_finalize( libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha224_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha224_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_SHA224_H ) */ libewf-20140807/libhmac/libhmac_sha1.h0000664000175000017500000001006413443450057021422 0ustar00lordyestalordyesta00000000000000/* * SHA1 functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_SHA1_H ) #define _LIBHMAC_SHA1_H #include #include #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) #include #endif #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) #define LIBHMAC_HAVE_SHA1_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) #define LIBHMAC_HAVE_SHA1_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) #define LIBHMAC_HAVE_SHA1_SUPPORT #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ #if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) #define LIBHMAC_SHA1_BLOCK_SIZE 64 #endif typedef struct libhmac_internal_sha1_context libhmac_internal_sha1_context_t; struct libhmac_internal_sha1_context { #if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) /* The crypto provider handle */ HCRYPTPROV crypt_provider; /* The crypto hash handle */ HCRYPTHASH hash; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) /* The SHA1 context */ SHA_CTX sha1_context; #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) /* The EVP message digest context */ #if defined( HAVE_EVP_MD_CTX_INIT ) EVP_MD_CTX internal_evp_md_context; #endif EVP_MD_CTX *evp_md_context; #else /* The number of bytes hashed */ uint64_t hash_count; /* The hash values */ uint32_t hash_values[ 5 ]; /* The block offset */ size_t block_offset; /* The (data) block */ uint8_t block[ 128 ]; #endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ }; #if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) ssize_t libhmac_sha1_transform( libhmac_internal_sha1_context_t *internal_context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); #endif /* !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) */ LIBHMAC_EXTERN \ int libhmac_sha1_initialize( libhmac_sha1_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha1_free( libhmac_sha1_context_t **context, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha1_update( libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha1_finalize( libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha1_calculate( const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libcerror_error_t **error ); LIBHMAC_EXTERN \ int libhmac_sha1_calculate_hmac( const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_SHA1_H ) */ libewf-20140807/libhmac/libhmac_error.h0000664000175000017500000000335613443450057021725 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_INTERNAL_ERROR_H ) #define _LIBHMAC_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBHMAC ) #include #endif #include "libhmac_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBHMAC ) LIBHMAC_EXTERN \ void libhmac_error_free( libhmac_error_t **error ); LIBHMAC_EXTERN \ int libhmac_error_fprint( libhmac_error_t *error, FILE *stream ); LIBHMAC_EXTERN \ int libhmac_error_sprint( libhmac_error_t *error, char *string, size_t size ); LIBHMAC_EXTERN \ int libhmac_error_backtrace_fprint( libhmac_error_t *error, FILE *stream ); LIBHMAC_EXTERN \ int libhmac_error_backtrace_sprint( libhmac_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBHMAC ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_INTERNAL_ERROR_H ) */ libewf-20140807/libhmac/libhmac_byte_stream.h0000664000175000017500000002222413443450057023105 0ustar00lordyestalordyesta00000000000000/* * Byte stream functions * * Copyright (C) 2011-2018, 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( _LIBHMAC_BYTE_STREAM_H ) #define _LIBHMAC_BYTE_STREAM_H #include #include #if defined( __cplusplus ) extern "C" { #endif #define libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, values_index ) \ values[ values_index ] = ( byte_stream )[ ( values_index << 2 ) ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 2 ) + 1 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 2 ) + 2 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 2 ) + 3 ]; #define libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, values_index ) \ values[ values_index ] = ( byte_stream )[ ( values_index << 2 ) + 3 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 2 ) + 2 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 2 ) + 1 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 2 ) ]; #define libhmac_byte_stream_copy_to_16x_uint32_big_endian( byte_stream, values ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 0 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 1 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 2 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 3 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 4 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 5 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 6 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 7 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 8 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 9 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 10 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 11 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 12 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 13 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 14 ) \ libhmac_byte_stream_copy_to_1x_uint32_big_endian( byte_stream, values, 15 ) #define libhmac_byte_stream_copy_to_16x_uint32_little_endian( byte_stream, values ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 0 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 1 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 2 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 3 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 4 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 5 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 6 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 7 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 8 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 9 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 10 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 11 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 12 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 13 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 14 ) \ libhmac_byte_stream_copy_to_1x_uint32_little_endian( byte_stream, values, 15 ) #define libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, values_index ) \ values[ values_index ] = ( byte_stream )[ ( values_index << 3 ) ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 1 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 2 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 3 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 4 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 5 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 6 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 7 ]; #define libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, values_index ) \ values[ values_index ] = ( byte_stream )[ ( values_index << 3 ) + 7 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 6 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 5 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 4 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] = ( byte_stream )[ ( values_index << 3 ) + 3 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 2 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) + 1 ]; \ values[ values_index ] <<= 8; \ values[ values_index ] |= ( byte_stream )[ ( values_index << 3 ) ]; #define libhmac_byte_stream_copy_to_16x_uint64_big_endian( byte_stream, values ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 0 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 1 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 2 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 3 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 4 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 5 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 6 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 7 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 8 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 9 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 10 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 11 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 12 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 13 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 14 ) \ libhmac_byte_stream_copy_to_1x_uint64_big_endian( byte_stream, values, 15 ) #define libhmac_byte_stream_copy_to_16x_uint64_little_endian( byte_stream, values ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 0 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 1 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 2 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 3 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 4 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 5 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 6 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 7 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 8 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 9 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 10 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 11 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 12 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 13 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 14 ) \ libhmac_byte_stream_copy_to_1x_uint64_little_endian( byte_stream, values, 15 ) #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBHMAC_BYTE_STREAM_H ) */ libewf-20140807/setup.py0000775000175000017500000002443313440662745017067 0ustar00lordyestalordyesta00000000000000#!/usr/bin/env python # # Script to build and install Python-bindings. # Version: 20181117 from __future__ import print_function import glob import gzip import platform import os import shlex import shutil import subprocess import sys import tarfile from distutils import dist from distutils import sysconfig from distutils.ccompiler import new_compiler from distutils.command.build_ext import build_ext from distutils.command.bdist import bdist from distutils.command.sdist import sdist from distutils.core import Extension, setup try: from distutils.command.bdist_msi import bdist_msi except ImportError: bdist_msi = None if not bdist_msi: custom_bdist_msi = None else: class custom_bdist_msi(bdist_msi): """Custom handler for the bdist_msi command.""" def run(self): """Builds an MSI.""" # bdist_msi does not support the library version so we add ".1" # as a work around. self.distribution.metadata.version = "{0:s}.1".format( self.distribution.metadata.version) bdist_msi.run(self) class custom_bdist_rpm(bdist): """Custom handler for the bdist_rpm command.""" def run(self): """Builds a RPM.""" print("'setup.py bdist_rpm' command not supported use 'rpmbuild' instead.") sys.exit(1) class custom_build_ext(build_ext): """Custom handler for the build_ext command.""" def _RunCommand(self, command): """Runs the command.""" arguments = shlex.split(command) process = subprocess.Popen( arguments, stderr=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) if not process: raise RuntimeError("Running: {0:s} failed.".format(command)) output, error = process.communicate() if process.returncode != 0: error = "\n".join(error.split("\n")[-5:]) raise RuntimeError("Running: {0:s} failed with error:\n{1:s}.".format( command, error)) return output def build_extensions(self): """Set up the build extensions.""" # TODO: move build customization here? build_ext.build_extensions(self) def run(self): """Runs the build extension.""" compiler = new_compiler(compiler=self.compiler) if compiler.compiler_type == "msvc": self.define = [ ("UNICODE", ""), ] else: command = "sh configure --disable-shared-libs" output = self._RunCommand(command) print_line = False for line in output.split("\n"): line = line.rstrip() if line == "configure:": print_line = True if print_line: print(line) self.define = [ ("HAVE_CONFIG_H", ""), ("LOCALEDIR", "\"/usr/share/locale\""), ] build_ext.run(self) class custom_sdist(sdist): """Custom handler for the sdist command.""" def run(self): """Builds a source distribution (sdist) package.""" if self.formats != ["gztar"]: print("'setup.py sdist' unsupported format.") sys.exit(1) if glob.glob("*.tar.gz"): print("'setup.py sdist' remove existing *.tar.gz files from " "source directory.") sys.exit(1) command = "make dist" exit_code = subprocess.call(command, shell=True) if exit_code != 0: raise RuntimeError("Running: {0:s} failed.".format(command)) if not os.path.exists("dist"): os.mkdir("dist") source_package_file = glob.glob("*.tar.gz")[0] source_package_prefix, _, source_package_suffix = ( source_package_file.partition("-")) sdist_package_file = "{0:s}-python-{1:s}".format( source_package_prefix, source_package_suffix) sdist_package_file = os.path.join("dist", sdist_package_file) os.rename(source_package_file, sdist_package_file) # Create and add the PKG-INFO file to the source package. with gzip.open(sdist_package_file, 'rb') as input_file: with open(sdist_package_file[:-3], 'wb') as output_file: shutil.copyfileobj(input_file, output_file) os.remove(sdist_package_file) self.distribution.metadata.write_pkg_info(".") pkg_info_path = "{0:s}-{1:s}/PKG-INFO".format( source_package_prefix, source_package_suffix[:-7]) with tarfile.open(sdist_package_file[:-3], "a:") as tar_file: tar_file.add("PKG-INFO", arcname=pkg_info_path) os.remove("PKG-INFO") with open(sdist_package_file[:-3], 'rb') as input_file: with gzip.open(sdist_package_file, 'wb') as output_file: shutil.copyfileobj(input_file, output_file) os.remove(sdist_package_file[:-3]) # Inform distutils what files were created. dist_files = getattr(self.distribution, "dist_files", []) dist_files.append(("sdist", "", sdist_package_file)) class ProjectInformation(object): """Project information.""" def __init__(self): """Initializes project information.""" super(ProjectInformation, self).__init__() self.include_directories = [] self.library_name = None self.library_names = [] self.library_version = None self._ReadConfigureAc() self._ReadMakefileAm() @property def module_name(self): """The Python module name.""" return "py{0:s}".format(self.library_name[3:]) @property def package_name(self): """The package name.""" return "{0:s}-python".format(self.library_name) @property def package_description(self): """The package description.""" return "Python bindings module for {0:s}".format(self.library_name) @property def project_url(self): """The project URL.""" return "https://github.com/libyal/{0:s}/".format(self.library_name) def _ReadConfigureAc(self): """Reads configure.ac to initialize the project information.""" file_object = open("configure.ac", "rb") if not file_object: raise IOError("Unable to open: configure.ac") found_ac_init = False found_library_name = False for line in file_object.readlines(): line = line.strip() if found_library_name: library_version = line[1:-2] if sys.version_info[0] >= 3: library_version = library_version.decode("ascii") self.library_version = library_version break elif found_ac_init: library_name = line[1:-2] if sys.version_info[0] >= 3: library_name = library_name.decode("ascii") self.library_name = library_name found_library_name = True elif line.startswith(b"AC_INIT"): found_ac_init = True file_object.close() if not self.library_name or not self.library_version: raise RuntimeError( "Unable to find library name and version in: configure.ac") def _ReadMakefileAm(self): """Reads Makefile.am to initialize the project information.""" if not self.library_name: raise RuntimeError("Missing library name") file_object = open("Makefile.am", "rb") if not file_object: raise IOError("Unable to open: Makefile.am") found_subdirs = False for line in file_object.readlines(): line = line.strip() if found_subdirs: library_name, _, _ = line.partition(b" ") if sys.version_info[0] >= 3: library_name = library_name.decode("ascii") self.include_directories.append(library_name) if library_name.startswith("lib"): self.library_names.append(library_name) if library_name == self.library_name: break elif line.startswith(b"SUBDIRS"): found_subdirs = True file_object.close() if not self.include_directories or not self.library_names: raise RuntimeError( "Unable to find include directories and library names in: " "Makefile.am") def GetPythonLibraryDirectoryPath(): """Retrieves the Python library directory path.""" path = sysconfig.get_python_lib(True) _, _, path = path.rpartition(sysconfig.PREFIX) if path.startswith(os.sep): path = path[1:] return path project_information = ProjectInformation() PYTHON_LIBRARY_DIRECTORY = GetPythonLibraryDirectoryPath() SOURCES = [] # TODO: replace by detection of MSC DEFINE_MACROS = [] if platform.system() == "Windows": DEFINE_MACROS.append(("WINVER", "0x0501")) # TODO: determine how to handle third party DLLs. for library_name in project_information.library_names: if library_name != project_information.library_name: definition = "HAVE_LOCAL_{0:s}".format(library_name.upper()) DEFINE_MACROS.append((definition, "")) # Put everything inside the Python module to prevent issues with finding # shared libaries since pip does not integrate well with the system package # management. for library_name in project_information.library_names: for source_file in glob.glob(os.path.join(library_name, "*.[ly]")): generated_source_file = "{0:s}.c".format(source_file[:-2]) if not os.path.exists(generated_source_file): raise RuntimeError("Missing generated source file: {0:s}".format( generated_source_file)) source_files = glob.glob(os.path.join(library_name, "*.c")) SOURCES.extend(source_files) source_files = glob.glob(os.path.join(project_information.module_name, "*.c")) SOURCES.extend(source_files) # Add the LICENSE file to the distribution. copying_file = os.path.join("COPYING") license_file = "LICENSE.{0:s}".format(project_information.module_name) shutil.copyfile(copying_file, license_file) LIBRARY_DATA_FILES = [license_file] # TODO: find a way to detect missing python.h # e.g. on Ubuntu python-dev is not installed by python-pip # TODO: what about description and platform in egg file setup( name=project_information.package_name, url=project_information.project_url, version=project_information.library_version, description=project_information.package_description, long_description=project_information.package_description, author="Joachim Metz", author_email="joachim.metz@gmail.com", license="GNU Lesser General Public License v3 or later (LGPLv3+)", cmdclass={ "build_ext": custom_build_ext, "bdist_msi": custom_bdist_msi, "bdist_rpm": custom_bdist_rpm, "sdist": custom_sdist, }, ext_modules=[ Extension( project_information.module_name, define_macros=DEFINE_MACROS, include_dirs=project_information.include_directories, libraries=[], library_dirs=[], sources=SOURCES, ), ], data_files=[(PYTHON_LIBRARY_DIRECTORY, LIBRARY_DATA_FILES)], ) os.remove(license_file) libewf-20140807/config.guess0000755000175000017500000012620613443455347017672 0ustar00lordyestalordyesta00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libewf-20140807/documents/0000775000175000017500000000000013443455447017347 5ustar00lordyestalordyesta00000000000000libewf-20140807/documents/header.txt0000644000175000017500000003107111277474755021346 0ustar00lordyestalordyesta00000000000000The header section The header section consists of an ASCII string as long as necessary. The character data is compressed by zlib. ( spaces were added for readability ) Header defitiont found in http://www.arsdata.com/SMART/whitepaper.html 1 \n main \n c \t n \t a \t e \t t \t m \t u \t p \t r \n case number \t evidence number \t unique description \t examiner name \t notes \t acquired date \t system date \t pwhash \t char \n case number, evidence number, unique description, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form "2002 3 4 10 19 59", which is March 4, 2002 10:19:59 pwhash the password hash should be the character '0' for no password char contains one of the following letters b => best compression f => fastest compression n => no compression Header definition found in FTK Imager 2.3 A fifth line is present which is empty 1 \n main \n c \t n \t a \t e \t t \t av \t ov \t m \t u \t p \t r \n case number \t evidence number \t unique description \t examiner name \t notes \t version \t platform \t acquired date \t system date \t pwhash \t char \n \n case number, evidence number, unique description, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form "2002 3 4 10 19 59", which is March 4, 2002 10:19:59 version is the Encase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be the character '0' for no password char contains one of the following letters b => best compression f => fastest compression n => no compression Header definition found in Encase 1 A fifth line is present which is empty 1 \r\n main \r\n c \t n \t a \t e \t t \t m \t u \t p \t r \r\n case number \t evidence number \t unique description \t examiner name \t notes \t acquired date \t system date \t pwhash \t char \r\n \r\n case number, evidence number, unique description, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form "2002 3 4 10 19 59", which is March 4, 2002 10:19:59 pwhash the password hash should be the character '0' for no password char contains one of the following letters b => best compression f => fastest compression n => no compression Header definition found in Encase 2, 3 A fifth line is present which is empty 1 \r\n main \r\n c \t n \t a \t e \t t \t av \t ov \t m \t u \t p \t r \r\n case number \t evidence number \t unique description \t examiner name \t notes \t version \t platform \t acquired date \t system date \t pwhash \t char \r\n \r\n case number, evidence number, unique description, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form "2002 3 4 10 19 59", which is March 4, 2002 10:19:59 version is the Encase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be the character '0' for no password char contains one of the following letters b => best compression f => fastest compression n => no compression Header definition found in Encase 4 and 5 A fifth line is present which is empty 1 \r\n main \r\n c \t n \t a \t e \t t \t av \t ov \t m \t u \t p \r\n case number \t evidence number \t unique description \t examiner name \t notes \t version \t platform \t acquired date \t system date \t pwhash \r\n \r\n case number, evidence number, unique description, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form "2002 3 4 10 19 59", which is March 4, 2002 10:19:59 version is the Encase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be the character '0' for no password Header found in linen 5 3 \n main \n a \t c \t n \t e \t t \t av \t ov \t m \t u \t p \n unique description \t case number \t evidence number \t examiner name \t notes \t version \t platform \t acquired date \t system date \t pwhash \n \n srce \n 0 1 \n p n id ev tb lo po ah gu aq \n 0 0 \n -1 -1 \n \n sub \n 0 1 \n p n id nu co gu \n 0 0 \n 1 \n \n unique description, case number, evidence number, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form unix time stamp "1142163845", which is March 12 2006, 11:44:05 version is the Encase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be empty for no password TODO the remaining values are currently unknown Header found in linen 6 3 \n main \n a \t c \t n \t e \t t \t md \t sn \t av \t ov \t m \t u \t p \t dc \n unique description \t case number \t evidence number \t examiner name \t notes \t model \t serial number \t version \t platform \t acquired date \t system date \t pwhash \t ? \n \n srce \n 0 1 \n p n id ev tb lo po ah gu aq \n 0 0 \n -1 -1 \n \n sub \n 0 1 \n p n id nu co gu \n 0 0 \n 1 \n \n unique description, case number, evidence number, examiner name, notes, model, and serial number are free form strings (except for \t and \n) acquired date, and system date are in the form unix time stamp "1142163845", which is March 12 2006, 11:44:05 version is the EnCase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be empty for no password TODO the remaining values are currently unknown libewf-20140807/documents/Makefile.am0000644000175000017500000000021412654056261021370 0ustar00lordyestalordyesta00000000000000EXTRA_DIST = \ header.txt \ header2.txt \ programming.txt MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile libewf-20140807/documents/programming.txt0000644000175000017500000000367511367220533022430 0ustar00lordyestalordyesta00000000000000Getting started with programming libewf: Define a handle object and make sure to set it to NULL, like: libewf_handle_t *handle = NULL; Initialize the handle: libewf_error_t *error = NULL; if( libewf_handle_initialize( &handle, &error ) != 1 ) { } The &error argument can also be NULL. Libewf created an error object on error (return value -1). The information in the error object can be accessed with the corresponding 'libewf_error_' functions. After use 'free' the error object using 'libewf_error_free'. After initializing the handle object it can be used to open a set of EWF files. E.g. to open a set of EWF files for reading. if( libewf_handle_open( handle, filename, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) { } You'll need to pass all the filenames part of the set. If you only have the first filename of the set use the 'libewf_glob' function to determine the others. After the handle object has been opened the storage media data can be read from the EWF files using 'libewf_handle_read_buffer' or 'libewf_handle_read_random'. If done reading or writing close the handle object. if( libewf_handle_close( handle, &error ) != 0 ) { } Note that the return value corresponds to that of the 'close' function. After use 'free' the handle object using: if( libewf_handle_free( &handle, &error ) != 1 ) { } Multi-threading and low-level IO: Libewf is not tread-safe but offers several functions to perform 'low-level IO'. These are: * libewf_handle_prepare_read_chunk * libewf_handle_read_chunk * libewf_handle_prepare_write_chunk * libewf_handle_write_chunk The 'libewf_handle_read_chunk' function read a chunk of data as stored in the EWF files, The 'libewf_handle_prepare_read_chunk' prepares the chunk of data for processing, i.e. if the chunk is compressed the function will decompress the data. The prepare functions can be used by multiple threads. libewf-20140807/documents/Makefile.in0000664000175000017500000006203613443455347021422 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = documents ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ EXTRA_DIST = \ header.txt \ header2.txt \ programming.txt MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu documents/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu documents/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/documents/header2.txt0000644000175000017500000001744111277474755021435 0ustar00lordyestalordyesta00000000000000The header2 section The header2 section consists of a UTF16 string as long as necessary. The character data is compressed by zlib. ( spaces added for readability ) Header2 found in EnCase4 1 \n main \n a c \t n \t e \t t \t av \t ov \t m \t u \t p \n unique description \t case number \t evidence number \t examiner name \t notes \t version \t platform \t acquired date \t system date \t pwhash \n \n unique description, case number, evidence number, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form unix time stamp "1142163845", which is March 12 2006, 11:44:05 version is the EnCase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be empty for no password Header2 found in EnCase5 3 \n main \n a \t c \t n \t e \t t \t av \t ov \t m \t u \t p \t dc \n unique description \t case number \t evidence number \t examiner name \t notes \t version \t platform \t acquired date \t system date \t pwhash \t ? \n \n srce \n 0 1 \n p n id ev tb lo po ah gu aq \n 0 0 \n -1 -1 \n \n sub \n 0 1 \n p n id nu co gu \n 0 0 \n 1 \n \n unique description, case number, evidence number, examiner name, and notes are free form strings (except for \t and \n) acquired date, and system date are in the form unix time stamp "1142163845", which is March 12 2006, 11:44:05 version is the EnCase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be empty for no password TODO the remaining values are currently unknown Header2 found in EnCase6 3 \n main \n a \t c \t n \t e \t t \t md \t sn \t av \t ov \t m \t u \t p \t dc \n unique description \t case number \t evidence number \t examiner name \t notes \t model \t serial number \t version \t platform \t acquired date \t system date \t pwhash \t ? \n \n srce \n 0 1 \n p n id ev tb lo po ah gu aq \n 0 0 \n -1 -1 \n \n sub \n 0 1 \n p n id nu co gu \n 0 0 \n 1 \n \n unique description, case number, evidence number, examiner name, notes, model, and serial number are free form strings (except for \t and \n) acquired date, and system date are in the form unix time stamp "1142163845", which is March 12 2006, 11:44:05 version is the EnCase version used to acquire the image platform is the operating system used to acquire the image pwhash the password hash should be empty for no password TODO the remaining values are currently unknown libewf-20140807/NEWS0000664000175000017500000000000013440662652016026 0ustar00lordyestalordyesta00000000000000libewf-20140807/test-driver0000755000175000017500000001104213443455350017531 0ustar00lordyestalordyesta00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libewf-20140807/configure0000774000175000017500000771431113443455345017267 0ustar00lordyestalordyesta00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libewf 20140807. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: joachim.metz@gmail.com about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libewf' PACKAGE_TARNAME='libewf' PACKAGE_VERSION='20140807' PACKAGE_STRING='libewf 20140807' PACKAGE_BUGREPORT='joachim.metz@gmail.com' PACKAGE_URL='' ac_unique_file="include/libewf.h.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS SPEC_DATE DPKG_DATE libewf_spec_tools_build_requires libewf_spec_requires HAVE_DLLMAIN LIBEWF_DLL_IMPORT STATIC_LDFLAGS ax_libfuse_spec_build_requires ax_libfuse_spec_requires ax_libfuse_pc_libs_private LIBFUSE_LIBADD LIBFUSE_CPPFLAGS HAVE_LIBFUSE fuse_LIBS fuse_CFLAGS ax_libsmraw_spec_build_requires ax_libsmraw_spec_requires ax_libsmraw_pc_libs_private LIBSMRAW_LIBADD LIBSMRAW_CPPFLAGS HAVE_LOCAL_LIBSMRAW_FALSE HAVE_LOCAL_LIBSMRAW_TRUE HAVE_LOCAL_LIBSMRAW HAVE_LIBSMRAW libsmraw_LIBS libsmraw_CFLAGS ax_libsmdev_spec_build_requires ax_libsmdev_spec_requires ax_libsmdev_pc_libs_private LIBSMDEV_LIBADD LIBSMDEV_CPPFLAGS HAVE_LOCAL_LIBSMDEV_FALSE HAVE_LOCAL_LIBSMDEV_TRUE HAVE_LOCAL_LIBSMDEV HAVE_LIBSMDEV libsmdev_LIBS libsmdev_CFLAGS ax_libodraw_spec_build_requires ax_libodraw_spec_requires ax_libodraw_pc_libs_private LIBODRAW_LIBADD LIBODRAW_CPPFLAGS HAVE_LOCAL_LIBODRAW_FALSE HAVE_LOCAL_LIBODRAW_TRUE HAVE_LOCAL_LIBODRAW YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX HAVE_LIBODRAW libodraw_LIBS libodraw_CFLAGS ax_libuuid_spec_build_requires ax_libuuid_spec_requires ax_libuuid_pc_libs_private LIBUUID_LIBADD LIBUUID_CPPFLAGS HAVE_LIBUUID uuid_LIBS uuid_CFLAGS HAVE_PYTHON_TESTS_FALSE HAVE_PYTHON_TESTS_TRUE HAVE_PYTHON3_FALSE HAVE_PYTHON3_TRUE HAVE_PYTHON2_FALSE HAVE_PYTHON2_TRUE HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE PYTHON3_PACKAGE_DIR PYTHON3_LIBRARY_DIR pyexecdir3 pythondir3 PYTHON3_EXEC_PREFIX PYTHON3_PREFIX PYTHON3_LDFLAGS PYTHON3_CPPFLAGS PYTHON3_CONFIG PYTHON3_PLATFORM PYTHON3_VERSION PYTHON3 PYTHON2_PACKAGE_DIR PYTHON2_LIBRARY_DIR pyexecdir2 pythondir2 PYTHON2_EXEC_PREFIX PYTHON2_PREFIX PYTHON2_LDFLAGS PYTHON2_CPPFLAGS PYTHON2_CONFIG PYTHON2_PLATFORM PYTHON2_VERSION PYTHON2 PYTHON_PACKAGE_DIR PYTHON_LIBRARY_DIR pyexecdir pythondir PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_LDFLAGS PYTHON_CPPFLAGS PYTHON_CONFIG PYTHON_PLATFORM PYTHON_VERSION PYTHON HAVE_V1_API_FALSE HAVE_V1_API_TRUE HAVE_V1_API ax_libhmac_spec_build_requires ax_libhmac_spec_requires ax_libhmac_pc_libs_private LIBHMAC_LIBADD LIBHMAC_CPPFLAGS HAVE_LOCAL_LIBHMAC_FALSE HAVE_LOCAL_LIBHMAC_TRUE HAVE_LOCAL_LIBHMAC ax_libcrypto_spec_build_requires ax_libcrypto_spec_requires ax_libcrypto_pc_libs_private LIBCRYPTO_LIBADD LIBCRYPTO_CPPFLAGS LIBDL_LIBADD HAVE_OPENSSL_EVP_H openssl_LIBS openssl_CFLAGS HAVE_LIBHMAC libhmac_LIBS libhmac_CFLAGS ax_zlib_static_spec_build_requires ax_zlib_static_spec_requires ax_zlib_spec_build_requires ax_zlib_spec_requires ax_zlib_pc_libs_private ZLIB_LIBADD ZLIB_CPPFLAGS HAVE_ZLIB zlib_LIBS zlib_CFLAGS ax_libmfdata_spec_build_requires ax_libmfdata_spec_requires ax_libmfdata_pc_libs_private LIBMFDATA_LIBADD LIBMFDATA_CPPFLAGS HAVE_LOCAL_LIBMFDATA_FALSE HAVE_LOCAL_LIBMFDATA_TRUE HAVE_LOCAL_LIBMFDATA HAVE_LIBMFDATA libmfdata_LIBS libmfdata_CFLAGS ax_libfvalue_spec_build_requires ax_libfvalue_spec_requires ax_libfvalue_pc_libs_private LIBFVALUE_LIBADD LIBFVALUE_CPPFLAGS HAVE_LOCAL_LIBFVALUE_FALSE HAVE_LOCAL_LIBFVALUE_TRUE HAVE_LOCAL_LIBFVALUE HAVE_LIBFVALUE libfvalue_LIBS libfvalue_CFLAGS ax_libfdata_spec_build_requires ax_libfdata_spec_requires ax_libfdata_pc_libs_private LIBFDATA_LIBADD LIBFDATA_CPPFLAGS HAVE_LOCAL_LIBFDATA_FALSE HAVE_LOCAL_LIBFDATA_TRUE HAVE_LOCAL_LIBFDATA HAVE_LIBFDATA libfdata_LIBS libfdata_CFLAGS ax_libfcache_spec_build_requires ax_libfcache_spec_requires ax_libfcache_pc_libs_private LIBFCACHE_LIBADD LIBFCACHE_CPPFLAGS HAVE_LOCAL_LIBFCACHE_FALSE HAVE_LOCAL_LIBFCACHE_TRUE HAVE_LOCAL_LIBFCACHE HAVE_LIBFCACHE libfcache_LIBS libfcache_CFLAGS ax_libbfio_spec_build_requires ax_libbfio_spec_requires ax_libbfio_pc_libs_private LIBBFIO_LIBADD LIBBFIO_CPPFLAGS HAVE_LOCAL_LIBBFIO_FALSE HAVE_LOCAL_LIBBFIO_TRUE HAVE_LOCAL_LIBBFIO HAVE_LIBBFIO libbfio_LIBS libbfio_CFLAGS ax_libcpath_spec_build_requires ax_libcpath_spec_requires ax_libcpath_pc_libs_private LIBCPATH_LIBADD LIBCPATH_CPPFLAGS HAVE_LOCAL_LIBCPATH_FALSE HAVE_LOCAL_LIBCPATH_TRUE HAVE_LOCAL_LIBCPATH HAVE_LIBCPATH libcpath_LIBS libcpath_CFLAGS ax_libcfile_spec_build_requires ax_libcfile_spec_requires ax_libcfile_pc_libs_private LIBCFILE_LIBADD LIBCFILE_CPPFLAGS HAVE_LOCAL_LIBCFILE_FALSE HAVE_LOCAL_LIBCFILE_TRUE HAVE_LOCAL_LIBCFILE HAVE_LIBCFILE libcfile_LIBS libcfile_CFLAGS ax_libuna_spec_build_requires ax_libuna_spec_requires ax_libuna_pc_libs_private LIBUNA_LIBADD LIBUNA_CPPFLAGS HAVE_LOCAL_LIBUNA_FALSE HAVE_LOCAL_LIBUNA_TRUE HAVE_LOCAL_LIBUNA HAVE_LIBUNA libuna_LIBS libuna_CFLAGS ax_libcsplit_spec_build_requires ax_libcsplit_spec_requires ax_libcsplit_pc_libs_private LIBCSPLIT_LIBADD LIBCSPLIT_CPPFLAGS HAVE_LOCAL_LIBCSPLIT_FALSE HAVE_LOCAL_LIBCSPLIT_TRUE HAVE_LOCAL_LIBCSPLIT HAVE_LIBCSPLIT libcsplit_LIBS libcsplit_CFLAGS ax_libcnotify_spec_build_requires ax_libcnotify_spec_requires ax_libcnotify_pc_libs_private LIBCNOTIFY_LIBADD LIBCNOTIFY_CPPFLAGS HAVE_LOCAL_LIBCNOTIFY_FALSE HAVE_LOCAL_LIBCNOTIFY_TRUE HAVE_LOCAL_LIBCNOTIFY HAVE_LIBCNOTIFY libcnotify_LIBS libcnotify_CFLAGS ax_libclocale_spec_build_requires ax_libclocale_spec_requires ax_libclocale_pc_libs_private LIBCLOCALE_LIBADD LIBCLOCALE_CPPFLAGS HAVE_LOCAL_LIBCLOCALE_FALSE HAVE_LOCAL_LIBCLOCALE_TRUE HAVE_LOCAL_LIBCLOCALE HAVE_LIBCLOCALE libclocale_LIBS libclocale_CFLAGS ax_libcdatetime_spec_build_requires ax_libcdatetime_spec_requires ax_libcdatetime_pc_libs_private LIBCDATETIME_LIBADD LIBCDATETIME_CPPFLAGS HAVE_LOCAL_LIBCDATETIME_FALSE HAVE_LOCAL_LIBCDATETIME_TRUE HAVE_LOCAL_LIBCDATETIME HAVE_LIBCDATETIME libcdatetime_LIBS libcdatetime_CFLAGS ax_libcdata_spec_build_requires ax_libcdata_spec_requires ax_libcdata_pc_libs_private LIBCDATA_LIBADD LIBCDATA_CPPFLAGS HAVE_LOCAL_LIBCDATA_FALSE HAVE_LOCAL_LIBCDATA_TRUE HAVE_LOCAL_LIBCDATA HAVE_LIBCDATA libcdata_LIBS libcdata_CFLAGS ax_libcthreads_spec_build_requires ax_libcthreads_spec_requires ax_libcthreads_pc_libs_private HAVE_MULTI_THREAD_SUPPORT LIBCTHREADS_LIBADD LIBCTHREADS_CPPFLAGS HAVE_LOCAL_LIBCTHREADS_FALSE HAVE_LOCAL_LIBCTHREADS_TRUE HAVE_LOCAL_LIBCTHREADS ax_pthread_pc_libs_private PTHREAD_LIBADD PTHREAD_CPPFLAGS HAVE_PTHREAD HAVE_LIBCTHREADS libcthreads_LIBS libcthreads_CFLAGS ax_libcerror_spec_build_requires ax_libcerror_spec_requires ax_libcerror_pc_libs_private LIBCERROR_LIBADD LIBCERROR_CPPFLAGS HAVE_LOCAL_LIBCERROR_FALSE HAVE_LOCAL_LIBCERROR_TRUE HAVE_LOCAL_LIBCERROR HAVE_LIBCERROR libcerror_LIBS libcerror_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG HAVE_OFF64_T HAVE_SSIZE64_T HAVE_SIZE64_T HAVE_SSIZE32_T HAVE_SIZE32_T HAVE_WCHAR_H HAVE_STDINT_H HAVE_INTTYPES_H HAVE_SYS_TYPES_H HAVE_WIDE_CHARACTER_TYPE POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS PKGCONFIG LIBTOOL_DEPS LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL HAVE_CXX11_FALSE HAVE_CXX11_TRUE HAVE_CXX11 CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC OBJDUMP DLLTOOL AS host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_nls enable_rpath with_libiconv_prefix with_libintl_prefix enable_largefile enable_shared_libs enable_winapi enable_wide_character_type enable_verbose_output enable_debug_output with_libcerror enable_multi_threading_support with_libcthreads with_pthread with_libcdata with_libcdatetime with_libclocale with_libcnotify with_libcsplit with_libuna with_libcfile with_libcpath with_libbfio with_libfcache with_libfdata with_libfvalue with_libmfdata with_zlib with_adler32 with_libhmac with_openssl enable_openssl_evp_cipher enable_openssl_evp_md enable_v1_api with_pyprefix enable_python with_pythondir enable_python2 with_pythondir2 enable_python3 with_pythondir3 with_libuuid with_libodraw with_libsmdev with_libsmraw with_libfuse enable_static_executables ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP LT_SYS_LIBRARY_PATH PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR libcerror_CFLAGS libcerror_LIBS libcthreads_CFLAGS libcthreads_LIBS libcdata_CFLAGS libcdata_LIBS libcdatetime_CFLAGS libcdatetime_LIBS libclocale_CFLAGS libclocale_LIBS libcnotify_CFLAGS libcnotify_LIBS libcsplit_CFLAGS libcsplit_LIBS libuna_CFLAGS libuna_LIBS libcfile_CFLAGS libcfile_LIBS libcpath_CFLAGS libcpath_LIBS libbfio_CFLAGS libbfio_LIBS libfcache_CFLAGS libfcache_LIBS libfdata_CFLAGS libfdata_LIBS libfvalue_CFLAGS libfvalue_LIBS libmfdata_CFLAGS libmfdata_LIBS zlib_CFLAGS zlib_LIBS libhmac_CFLAGS libhmac_LIBS openssl_CFLAGS openssl_LIBS uuid_CFLAGS uuid_LIBS libodraw_CFLAGS libodraw_LIBS YACC YFLAGS libsmdev_CFLAGS libsmdev_LIBS libsmraw_CFLAGS libsmraw_LIBS fuse_CFLAGS fuse_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libewf 20140807 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libewf] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libewf 20140807:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --disable-largefile omit support for large files --disable-shared-libs disable shared library support --enable-winapi enable WINAPI support for cross-compilation [default=auto-detect] --enable-wide-character-type enable wide character type support [default=no] --enable-verbose-output enable verbose output [default=no] --enable-debug-output enable debug output [default=no] --enable-multi-threading-support enable multi-threading support [default=yes] --enable-openssl-evp-cipher enable OpenSSL EVP CIPHER support, or no to disable [default=auto-detect] --enable-openssl-evp-md enable OpenSSL EVP MD support, or no to disable [default=auto-detect] --enable-v1-api enable version 1 API [default=no] --enable-python build Python bindings [default=no] --enable-python2 build Python 2 bindings [default=no] --enable-python3 build Python 3 bindings [default=no] --enable-static-executables build static executables (binaries) [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-libcerror[=DIR] search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libcthreads[=DIR] search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-pthread[=DIR] search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread [default=auto-detect] --with-libcdata[=DIR] search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libcdatetime[=DIR] search for libcdatetime in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libclocale[=DIR] search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libcnotify[=DIR] search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libcsplit[=DIR] search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libuna[=DIR] search for libuna in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libcfile[=DIR] search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libcpath[=DIR] search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libbfio[=DIR] search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libfcache[=DIR] search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libfdata[=DIR] search for libfdata in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libfvalue[=DIR] search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libmfdata[=DIR] search for libmfdata in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-zlib[=DIR] search for zlib in includedir and libdir or in the specified DIR, or no if not to use zlib [default=auto-detect] --with-adler32[=auto-detect] specify which alder32 implementation to use, options: 'auto-detect', 'zlib' or 'local' [default=auto-detect] --with-libhmac[=DIR] search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-openssl[=DIR] search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL [default=auto-detect] --with-pyprefix[=no] use `python-config --prefix' to determine the prefix of pythondir instead of --prefix [default=no] --with-pythondir[=no] use to specify the Python directory (pythondir) [default=no] --with-pythondir2[=no] use to specify the Python 2 directory (pythondir2) [default=no] --with-pythondir3[=no] use to specify the Python 3 directory (pythondir3) [default=no] --with-libuuid[=DIR] search for libuuid in includedir and libdir or in the specified DIR, or no if not to use libuuid [default=auto-detect] --with-libodraw[=DIR] search for libodraw in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libsmdev[=DIR] search for libsmdev in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libsmraw[=DIR] search for libsmraw in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] --with-libfuse[=DIR] search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse [default=auto-detect] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path libcerror_CFLAGS C compiler flags for libcerror, overriding pkg-config libcerror_LIBS linker flags for libcerror, overriding pkg-config libcthreads_CFLAGS C compiler flags for libcthreads, overriding pkg-config libcthreads_LIBS linker flags for libcthreads, overriding pkg-config libcdata_CFLAGS C compiler flags for libcdata, overriding pkg-config libcdata_LIBS linker flags for libcdata, overriding pkg-config libcdatetime_CFLAGS C compiler flags for libcdatetime, overriding pkg-config libcdatetime_LIBS linker flags for libcdatetime, overriding pkg-config libclocale_CFLAGS C compiler flags for libclocale, overriding pkg-config libclocale_LIBS linker flags for libclocale, overriding pkg-config libcnotify_CFLAGS C compiler flags for libcnotify, overriding pkg-config libcnotify_LIBS linker flags for libcnotify, overriding pkg-config libcsplit_CFLAGS C compiler flags for libcsplit, overriding pkg-config libcsplit_LIBS linker flags for libcsplit, overriding pkg-config libuna_CFLAGS C compiler flags for libuna, overriding pkg-config libuna_LIBS linker flags for libuna, overriding pkg-config libcfile_CFLAGS C compiler flags for libcfile, overriding pkg-config libcfile_LIBS linker flags for libcfile, overriding pkg-config libcpath_CFLAGS C compiler flags for libcpath, overriding pkg-config libcpath_LIBS linker flags for libcpath, overriding pkg-config libbfio_CFLAGS C compiler flags for libbfio, overriding pkg-config libbfio_LIBS linker flags for libbfio, overriding pkg-config libfcache_CFLAGS C compiler flags for libfcache, overriding pkg-config libfcache_LIBS linker flags for libfcache, overriding pkg-config libfdata_CFLAGS C compiler flags for libfdata, overriding pkg-config libfdata_LIBS linker flags for libfdata, overriding pkg-config libfvalue_CFLAGS C compiler flags for libfvalue, overriding pkg-config libfvalue_LIBS linker flags for libfvalue, overriding pkg-config libmfdata_CFLAGS C compiler flags for libmfdata, overriding pkg-config libmfdata_LIBS linker flags for libmfdata, overriding pkg-config zlib_CFLAGS C compiler flags for zlib, overriding pkg-config zlib_LIBS linker flags for zlib, overriding pkg-config libhmac_CFLAGS C compiler flags for libhmac, overriding pkg-config libhmac_LIBS linker flags for libhmac, overriding pkg-config openssl_CFLAGS C compiler flags for openssl, overriding pkg-config openssl_LIBS linker flags for openssl, overriding pkg-config uuid_CFLAGS C compiler flags for uuid, overriding pkg-config uuid_LIBS linker flags for uuid, overriding pkg-config libodraw_CFLAGS C compiler flags for libodraw, overriding pkg-config libodraw_LIBS linker flags for libodraw, overriding pkg-config YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. libsmdev_CFLAGS C compiler flags for libsmdev, overriding pkg-config libsmdev_LIBS linker flags for libsmdev, overriding pkg-config libsmraw_CFLAGS C compiler flags for libsmraw, overriding pkg-config libsmraw_LIBS linker flags for libsmraw, overriding pkg-config fuse_CFLAGS C compiler flags for fuse, overriding pkg-config fuse_LIBS linker flags for fuse, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libewf configure 20140807 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------- ## ## Report this to joachim.metz@gmail.com ## ## ------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libewf $as_me 20140807, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libewf' VERSION='20140807' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' # The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 $as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 $as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ax_cxx_compile_cxx11_required=falsednl ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } if ${ax_cv_cxx_compile_cxx11+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_cxx_compile_cxx11=yes else ax_cv_cxx_compile_cxx11=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x; do cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$ac_save_CXXFLAGS" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi else if test x$ac_success = xno; then HAVE_CXX11=0 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi if 0; then HAVE_CXX11_TRUE= HAVE_CXX11_FALSE='#' else HAVE_CXX11_TRUE='#' HAVE_CXX11_FALSE= fi fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi # Check whether --enable-shared-libs was given. if test "${enable_shared_libs+set}" = set; then : enableval=$enable_shared_libs; ac_cv_enable_shared_libs=$enableval else ac_cv_enable_shared_libs="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable disable shared library support" >&5 $as_echo_n "checking whether to disable disable shared library support... " >&6; } if ${ac_cv_enable_shared_libs+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_shared_libs="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_shared_libs" >&5 $as_echo "$ac_cv_enable_shared_libs" >&6; } # Check whether --enable-winapi was given. if test "${enable_winapi+set}" = set; then : enableval=$enable_winapi; ac_cv_enable_winapi=$enableval else ac_cv_enable_winapi=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable WINAPI support for cross-compilation" >&5 $as_echo_n "checking whether to enable enable WINAPI support for cross-compilation... " >&6; } if ${ac_cv_enable_winapi+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_winapi=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_winapi" >&5 $as_echo "$ac_cv_enable_winapi" >&6; } if test "x$ac_cv_enable_winapi" = xauto-detect; then : ac_common_check_winapi_target_string="$target" if test "x$ac_common_check_winapi_target_string" = x; then : ac_common_check_winapi_target_string="$host" fi case $ac_common_check_winapi_target_string in #( *mingw*) : { $as_echo "$as_me:${as_lineno-$LINENO}: detected MinGW enabling WINAPI support for cross-compilation" >&5 $as_echo "$as_me: detected MinGW enabling WINAPI support for cross-compilation" >&6;} ac_cv_enable_winapi=yes ;; #( *msys*) : { $as_echo "$as_me:${as_lineno-$LINENO}: detected MSYS enabling WINAPI support for cross-compilation" >&5 $as_echo "$as_me: detected MSYS enabling WINAPI support for cross-compilation" >&6;} ac_cv_enable_winapi=yes ;; #( *) : ac_cv_enable_winapi=no ;; #( *) : ;; esac fi # Check whether --enable-wide-character-type was given. if test "${enable_wide_character_type+set}" = set; then : enableval=$enable_wide_character_type; ac_cv_enable_wide_character_type=$enableval else ac_cv_enable_wide_character_type=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable wide character type support" >&5 $as_echo_n "checking whether to enable enable wide character type support... " >&6; } if ${ac_cv_enable_wide_character_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_wide_character_type=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_wide_character_type" >&5 $as_echo "$ac_cv_enable_wide_character_type" >&6; } # Check whether --enable-verbose-output was given. if test "${enable_verbose_output+set}" = set; then : enableval=$enable_verbose_output; ac_cv_enable_verbose_output=$enableval else ac_cv_enable_verbose_output=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable verbose output" >&5 $as_echo_n "checking whether to enable enable verbose output... " >&6; } if ${ac_cv_enable_verbose_output+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_verbose_output=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_verbose_output" >&5 $as_echo "$ac_cv_enable_verbose_output" >&6; } if test "x$ac_cv_enable_verbose_output" != xno ; then : $as_echo "#define HAVE_VERBOSE_OUTPUT 1" >>confdefs.h ac_cv_enable_verbose_output=yes fi # Check whether --enable-debug-output was given. if test "${enable_debug_output+set}" = set; then : enableval=$enable_debug_output; ac_cv_enable_debug_output=$enableval else ac_cv_enable_debug_output=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable debug output" >&5 $as_echo_n "checking whether to enable enable debug output... " >&6; } if ${ac_cv_enable_debug_output+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_debug_output=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_debug_output" >&5 $as_echo "$ac_cv_enable_debug_output" >&6; } if test "x$ac_cv_enable_debug_output" != xno ; then : $as_echo "#define HAVE_DEBUG_OUTPUT 1" >>confdefs.h ac_cv_enable_debug_output=yes fi if test "x$ac_cv_enable_winapi" = xyes; then : ac_cv_enable_wide_character_type=yes fi if test "x$ac_cv_enable_wide_character_type" = xyes; then : $as_echo "#define HAVE_WIDE_CHARACTER_TYPE 1" >>confdefs.h HAVE_WIDE_CHARACTER_TYPE=1 else HAVE_WIDE_CHARACTER_TYPE=0 fi for ac_header in sys/types.h inttypes.h stdint.h wchar.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_sys_types_h" = xyes; then : HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi if test "x$ac_cv_header_inttypes_h" = xyes; then : HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi if test "x$ac_cv_header_stdint_h" = xyes; then : HAVE_STDINT_H=1 else HAVE_STDINT_H=0 fi if test "x$ac_cv_header_wchar_h" = xyes; then : HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "size32_t" "ac_cv_type_size32_t" "$ac_includes_default" if test "x$ac_cv_type_size32_t" = xyes; then : HAVE_SIZE32_T=1 else HAVE_SIZE32_T=0 fi ac_fn_c_check_type "$LINENO" "ssize32_t" "ac_cv_type_ssize32_t" "$ac_includes_default" if test "x$ac_cv_type_ssize32_t" = xyes; then : HAVE_SSIZE32_T=1 else HAVE_SSIZE32_T=0 fi ac_fn_c_check_type "$LINENO" "size64_t" "ac_cv_type_size64_t" "$ac_includes_default" if test "x$ac_cv_type_size64_t" = xyes; then : HAVE_SIZE64_T=1 else HAVE_SIZE64_T=0 fi ac_fn_c_check_type "$LINENO" "ssize64_t" "ac_cv_type_ssize64_t" "$ac_includes_default" if test "x$ac_cv_type_ssize64_t" = xyes; then : HAVE_SSIZE64_T=1 else HAVE_SSIZE64_T=0 fi ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default" if test "x$ac_cv_type_off64_t" = xyes; then : HAVE_OFF64_T=1 else HAVE_OFF64_T=0 fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : fi ac_fn_c_check_type "$LINENO" "u64" "ac_cv_type_u64" "$ac_includes_default" if test "x$ac_cv_type_u64" = xyes; then : fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF if test "x$ac_cv_header_wchar_h" = xyes; then : # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 $as_echo_n "checking size of wchar_t... " >&6; } if ${ac_cv_sizeof_wchar_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default"; then : else if test "$ac_cv_type_wchar_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_wchar_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 $as_echo "$ac_cv_sizeof_wchar_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t _ACEOF fi if test "x$ac_cv_enable_winapi" = xyes; then : for ac_header in windows.h do : ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" if test "x$ac_cv_header_windows_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF fi done if test "x$ac_cv_header_windows_h" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing header: windows.h header is required to compile with winapi support See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_enable_winapi" = xno; then : for ac_header in libintl.h do : ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL_H 1 _ACEOF fi done fi for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIMITS_H 1 _ACEOF fi done for ac_header in stdlib.h string.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h wctype.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fclose feof fgets fopen fread fseeko fseeko64 fwrite vfprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fclose" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fclose See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_feof" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: feof See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_fgets" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fgets See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_fopen" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fopen See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_fread" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fread See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_fseeko" != xyes && test "x$ac_cv_func_fseeko64" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fseeko and fseeko64 See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_fwrite" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fwrite See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_vfprintf" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: vfprintf See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_enable_wide_character_type" != xno; then : for ac_func in fgetws do : ac_fn_c_check_func "$LINENO" "fgetws" "ac_cv_func_fgetws" if test "x$ac_cv_func_fgetws" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FGETWS 1 _ACEOF fi done if test "x$ac_cv_func_fgetws" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fgetws See \`config.log' for more details" "$LINENO" 5; } fi fi for ac_func in free malloc memcmp memcpy memset realloc do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_free" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: free See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_malloc" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: malloc See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_memcmp" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: memcmp See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_memcpy" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: memcpy See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_memset" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: memset See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_realloc" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: realloc See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in memchr memrchr snprintf sscanf strcasecmp strchr strlen strncasecmp strncmp strncpy strnicmp strrchr strstr vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_memchr" != xyes && test "x$ac_cv_func_strchr" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: memchr and strchr See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_memcmp" != xyes && test "x$ac_cv_func_strncmp" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: memcmp and strncmp See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_memcpy" != xyes && test "x$ac_cv_func_strncpy" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: memcpy and strncpy See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_memrchr" = xyes; then : ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" if test "x$ac_cv_have_decl_memrchr" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MEMRCHR $ac_have_decl _ACEOF if test "x$ac_cv_decl_memrchr" != xyes; then : ac_cv_func_memrchr=no fi fi if test "x$ac_cv_func_memrchr" != xyes && test "x$ac_cv_func_strrchr" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strrchr and memrchr See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_snprintf" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: snprintf See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_sscanf" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: sscanf See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_strlen" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: strlen See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_strcasecmp" != xyes && test "x$ac_cv_func_strncasecmp" != xyes && test "x$ac_cv_func_strnicmp" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strncasecmp, strcasecmp and strnicmp See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_strstr" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: strstr See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_vsnprintf" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: vsnprintf See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_enable_wide_character_type" != xno; then : for ac_func in swprintf towlower wcscasecmp wcschr wcslen wcsncasecmp wcsncmp wcsncpy wcsnicmp wcsrchr wcsstr wmemchr wmemcmp wmemcpy wmemrchr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_swprintf" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: swprintf See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_wmemchr" != xyes && test "x$ac_cv_func_wcschr" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemchr and wcschr See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_wmemcmp" != xyes && test "x$ac_cv_func_wcsncmp" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemcmp and wcsncmp See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_wmemcpy" != xyes && test "x$ac_cv_func_wcsncpy" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemcpy and wcsncpy See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_wmemrchr" != xyes && test "x$ac_cv_func_wcsrchr" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemrchr and wcsrchr See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_wcslen" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: wcslen See \`config.log' for more details" "$LINENO" 5; } fi 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; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wcsncasecmp, wcscasecmp, wcsnicmp and towlower See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_wcsstr" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: wcsstr See \`config.log' for more details" "$LINENO" 5; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the conversion specifier \"%jd\"" >&5 $as_echo_n "checking whether printf supports the conversion specifier \"%jd\"... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printf( "%jd" ); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_cv_have_printf_jd=no else ac_cv_cv_have_printf_jd=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_cv_have_printf_jd" = xyes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { printf( "%jd", (off_t) 10 ); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_cv_have_printf_jd=yes else ac_cv_cv_have_printf_jd=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$ac_cv_cv_have_printf_jd" = xyes; then : if test "$cross_compiling" = yes; then : ac_cv_cv_have_printf_jd=undetermined else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { char string[ 3 ]; if( snprintf( string, 3, "%jd", (off_t) 10 ) < 0 ) return( 1 ); if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_cv_have_printf_jd=yes else ac_cv_cv_have_printf_jd=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$SAVE_CFLAGS" if test "x$ac_cv_cv_have_printf_jd" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_PRINTF_JD 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_have_printf_jd" >&5 $as_echo "$ac_cv_cv_have_printf_jd" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the conversion specifier \"%zd\"" >&5 $as_echo_n "checking whether printf supports the conversion specifier \"%zd\"... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printf( "%zd" ); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_cv_have_printf_zd=no else ac_cv_cv_have_printf_zd=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_cv_have_printf_zd" = xyes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { printf( "%zd", (size_t) 10 ); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_cv_have_printf_zd=yes else ac_cv_cv_have_printf_zd=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$ac_cv_cv_have_printf_zd" = xyes; then : if test "$cross_compiling" = yes; then : ac_cv_cv_have_printf_zd=undetermined else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { char string[ 3 ]; if( snprintf( string, 3, "%zd", (size_t) 10 ) < 0 ) return( 1 ); if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_cv_have_printf_zd=yes else ac_cv_cv_have_printf_zd=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$SAVE_CFLAGS" if test "x$ac_cv_cv_have_printf_zd" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_PRINTF_ZD 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_have_printf_zd" >&5 $as_echo "$ac_cv_cv_have_printf_zd" >&6; } fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Check whether --with-libcerror was given. if test "${with_libcerror+set}" = set; then : withval=$with_libcerror; ac_cv_with_libcerror=$withval else ac_cv_with_libcerror=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcerror=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcerror" >&5 $as_echo "$ac_cv_with_libcerror" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcerror" = xno; then : ac_cv_libcerror=no else ac_cv_libcerror=check if test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect; then : if test -d "$ac_cv_with_libcerror"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcerror}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcerror}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcerror See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror" >&5 $as_echo_n "checking for libcerror... " >&6; } if test -n "$libcerror_CFLAGS"; then pkg_cv_libcerror_CFLAGS="$libcerror_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcerror >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcerror >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcerror_CFLAGS=`$PKG_CONFIG --cflags "libcerror >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcerror_LIBS"; then pkg_cv_libcerror_LIBS="$libcerror_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcerror >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcerror >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcerror_LIBS=`$PKG_CONFIG --libs "libcerror >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcerror_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcerror >= 20120425" 2>&1` else libcerror_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcerror >= 20120425" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcerror_PKG_ERRORS" >&5 ac_cv_libcerror=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcerror=check else libcerror_CFLAGS=$pkg_cv_libcerror_CFLAGS libcerror_LIBS=$pkg_cv_libcerror_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcerror=yes fi fi if test "x$ac_cv_libcerror" = xyes; then : ac_cv_libcerror_CPPFLAGS="$pkg_cv_libcerror_CFLAGS" ac_cv_libcerror_LIBADD="$pkg_cv_libcerror_LIBS" fi fi if test "x$ac_cv_libcerror" = xcheck; then : for ac_header in libcerror.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcerror.h" "ac_cv_header_libcerror_h" "$ac_includes_default" if test "x$ac_cv_header_libcerror_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCERROR_H 1 _ACEOF fi done if test "x$ac_cv_header_libcerror_h" = xno; then : ac_cv_libcerror=no else ac_cv_libcerror=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_get_version in -lcerror" >&5 $as_echo_n "checking for libcerror_get_version in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_get_version (); int main () { return libcerror_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_get_version=yes else ac_cv_lib_cerror_libcerror_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_get_version" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_get_version" >&6; } if test "x$ac_cv_lib_cerror_libcerror_get_version" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_free in -lcerror" >&5 $as_echo_n "checking for libcerror_error_free in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_free (); int main () { return libcerror_error_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_free=yes else ac_cv_lib_cerror_libcerror_error_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_free" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_free" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_free" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_set in -lcerror" >&5 $as_echo_n "checking for libcerror_error_set in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_set+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_set (); int main () { return libcerror_error_set (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_set=yes else ac_cv_lib_cerror_libcerror_error_set=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_set" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_set" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_set" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_matches in -lcerror" >&5 $as_echo_n "checking for libcerror_error_matches in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_matches+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_matches (); int main () { return libcerror_error_matches (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_matches=yes else ac_cv_lib_cerror_libcerror_error_matches=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_matches" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_matches" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_matches" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_fprint in -lcerror" >&5 $as_echo_n "checking for libcerror_error_fprint in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_fprint+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_fprint (); int main () { return libcerror_error_fprint (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_fprint=yes else ac_cv_lib_cerror_libcerror_error_fprint=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_fprint" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_fprint" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_fprint" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_sprint in -lcerror" >&5 $as_echo_n "checking for libcerror_error_sprint in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_sprint+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_sprint (); int main () { return libcerror_error_sprint (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_sprint=yes else ac_cv_lib_cerror_libcerror_error_sprint=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_sprint" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_sprint" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_sprint" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_backtrace_fprint in -lcerror" >&5 $as_echo_n "checking for libcerror_error_backtrace_fprint in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_backtrace_fprint+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_backtrace_fprint (); int main () { return libcerror_error_backtrace_fprint (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_backtrace_fprint=yes else ac_cv_lib_cerror_libcerror_error_backtrace_fprint=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_backtrace_fprint" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_backtrace_fprint" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_backtrace_fprint" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_backtrace_sprint in -lcerror" >&5 $as_echo_n "checking for libcerror_error_backtrace_sprint in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_error_backtrace_sprint+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_error_backtrace_sprint (); int main () { return libcerror_error_backtrace_sprint (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_error_backtrace_sprint=yes else ac_cv_lib_cerror_libcerror_error_backtrace_sprint=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_backtrace_sprint" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_error_backtrace_sprint" >&6; } if test "x$ac_cv_lib_cerror_libcerror_error_backtrace_sprint" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_system_set_error in -lcerror" >&5 $as_echo_n "checking for libcerror_system_set_error in -lcerror... " >&6; } if ${ac_cv_lib_cerror_libcerror_system_set_error+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcerror_system_set_error (); int main () { return libcerror_system_set_error (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cerror_libcerror_system_set_error=yes else ac_cv_lib_cerror_libcerror_system_set_error=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_system_set_error" >&5 $as_echo "$ac_cv_lib_cerror_libcerror_system_set_error" >&6; } if test "x$ac_cv_lib_cerror_libcerror_system_set_error" = xyes; then : ac_cv_libcerror_dummy=yes else ac_cv_libcerror=no fi ac_cv_libcerror_LIBADD="-lcerror" fi fi if test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_libcerror" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcerror in directory: $ac_cv_with_libcerror See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcerror" = xyes; then : $as_echo "#define HAVE_LIBCERROR 1" >>confdefs.h fi if test "x$ac_cv_libcerror" = xyes; then : HAVE_LIBCERROR=1 else HAVE_LIBCERROR=0 fi if test "x$ac_cv_libcerror" != xyes; then : for ac_header in stdarg.h varargs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_enable_wide_character_type" != xno; then : for ac_func in wcstombs do : ac_fn_c_check_func "$LINENO" "wcstombs" "ac_cv_func_wcstombs" if test "x$ac_cv_func_wcstombs" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WCSTOMBS 1 _ACEOF fi done if test "x$ac_cv_func_wcstombs" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: wcstombs See \`config.log' for more details" "$LINENO" 5; } fi fi ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF for ac_func in strerror_r do : ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" if test "x$ac_cv_func_strerror_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi if test "x$ac_cv_have_decl_strerror_r" != xyes; then : for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done if test "x$ac_cv_func_strerror" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strerror_r and strerror See \`config.log' for more details" "$LINENO" 5; } fi fi ac_cv_libcerror_CPPFLAGS="-I../libcerror"; ac_cv_libcerror_LIBADD="../libcerror/libcerror.la"; ac_cv_libcerror=local $as_echo "#define HAVE_LOCAL_LIBCERROR 1" >>confdefs.h HAVE_LOCAL_LIBCERROR=1 fi if test "x$ac_cv_libcerror" = xlocal; then HAVE_LOCAL_LIBCERROR_TRUE= HAVE_LOCAL_LIBCERROR_FALSE='#' else HAVE_LOCAL_LIBCERROR_TRUE='#' HAVE_LOCAL_LIBCERROR_FALSE= fi if test "x$ac_cv_libcerror_CPPFLAGS" != "x"; then : LIBCERROR_CPPFLAGS=$ac_cv_libcerror_CPPFLAGS fi if test "x$ac_cv_libcerror_LIBADD" != "x"; then : LIBCERROR_LIBADD=$ac_cv_libcerror_LIBADD fi if test "x$ac_cv_libcerror" = xyes; then : ax_libcerror_pc_libs_private=-lcerror fi if test "x$ac_cv_libcerror" = xyes; then : ax_libcerror_spec_requires=libcerror ax_libcerror_spec_build_requires=libcerror-devel fi # Check whether --enable-multi-threading-support was given. if test "${enable_multi_threading_support+set}" = set; then : enableval=$enable_multi_threading_support; ac_cv_enable_multi_threading_support=$enableval else ac_cv_enable_multi_threading_support=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable multi-threading support" >&5 $as_echo_n "checking whether to enable enable multi-threading support... " >&6; } if ${ac_cv_enable_multi_threading_support+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_multi_threading_support=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_multi_threading_support" >&5 $as_echo "$ac_cv_enable_multi_threading_support" >&6; } # Check whether --with-libcthreads was given. if test "${with_libcthreads+set}" = set; then : withval=$with_libcthreads; ac_cv_with_libcthreads=$withval else ac_cv_with_libcthreads=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcthreads+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcthreads=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcthreads" >&5 $as_echo "$ac_cv_with_libcthreads" >&6; } if test "x$ac_cv_enable_multi_threading_support" = xno; then : ac_cv_libcthreads="no" ac_cv_libcthreads_multi_threading="no" else if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcthreads" = xno; then : ac_cv_libcthreads=no else ac_cv_libcthreads=check if test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect; then : if test -d "$ac_cv_with_libcthreads"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcthreads}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcthreads}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcthreads See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads" >&5 $as_echo_n "checking for libcthreads... " >&6; } if test -n "$libcthreads_CFLAGS"; then pkg_cv_libcthreads_CFLAGS="$libcthreads_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcthreads >= 20160404\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcthreads >= 20160404") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcthreads_CFLAGS=`$PKG_CONFIG --cflags "libcthreads >= 20160404" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcthreads_LIBS"; then pkg_cv_libcthreads_LIBS="$libcthreads_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcthreads >= 20160404\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcthreads >= 20160404") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcthreads_LIBS=`$PKG_CONFIG --libs "libcthreads >= 20160404" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcthreads_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcthreads >= 20160404" 2>&1` else libcthreads_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcthreads >= 20160404" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcthreads_PKG_ERRORS" >&5 ac_cv_libcthreads=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcthreads=check else libcthreads_CFLAGS=$pkg_cv_libcthreads_CFLAGS libcthreads_LIBS=$pkg_cv_libcthreads_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcthreads=yes fi fi if test "x$ac_cv_libcthreads" = xyes; then : ac_cv_libcthreads_CPPFLAGS="$pkg_cv_libcthreads_CFLAGS" ac_cv_libcthreads_LIBADD="$pkg_cv_libcthreads_LIBS" fi fi if test "x$ac_cv_libcthreads" = xcheck; then : for ac_header in libcthreads.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcthreads.h" "ac_cv_header_libcthreads_h" "$ac_includes_default" if test "x$ac_cv_header_libcthreads_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCTHREADS_H 1 _ACEOF fi done if test "x$ac_cv_header_libcthreads_h" = xno; then : ac_cv_libcthreads=no else ac_cv_libcthreads=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_get_version in -lcthreads" >&5 $as_echo_n "checking for libcthreads_get_version in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_get_version (); int main () { return libcthreads_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_get_version=yes else ac_cv_lib_cthreads_libcthreads_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_get_version" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_get_version" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_get_version" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_create in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_create in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_create (); int main () { return libcthreads_thread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_create=yes else ac_cv_lib_cthreads_libcthreads_thread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_create" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_create" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_create" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_join in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_join in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_join+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_join (); int main () { return libcthreads_thread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_join=yes else ac_cv_lib_cthreads_libcthreads_thread_join=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_join" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_join" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_join" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_attributes_initialize in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_attributes_initialize in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_attributes_initialize (); int main () { return libcthreads_thread_attributes_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize=yes else ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_attributes_free in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_attributes_free in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_attributes_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_attributes_free (); int main () { return libcthreads_thread_attributes_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_attributes_free=yes else ac_cv_lib_cthreads_libcthreads_thread_attributes_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_attributes_free" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_attributes_free" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_attributes_free" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_initialize in -lcthreads" >&5 $as_echo_n "checking for libcthreads_condition_initialize in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_condition_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_condition_initialize (); int main () { return libcthreads_condition_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_condition_initialize=yes else ac_cv_lib_cthreads_libcthreads_condition_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_initialize" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_condition_initialize" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_condition_initialize" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_free in -lcthreads" >&5 $as_echo_n "checking for libcthreads_condition_free in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_condition_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_condition_free (); int main () { return libcthreads_condition_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_condition_free=yes else ac_cv_lib_cthreads_libcthreads_condition_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_free" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_condition_free" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_condition_free" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_broadcast in -lcthreads" >&5 $as_echo_n "checking for libcthreads_condition_broadcast in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_condition_broadcast+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_condition_broadcast (); int main () { return libcthreads_condition_broadcast (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_condition_broadcast=yes else ac_cv_lib_cthreads_libcthreads_condition_broadcast=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_broadcast" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_condition_broadcast" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_condition_broadcast" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_signal in -lcthreads" >&5 $as_echo_n "checking for libcthreads_condition_signal in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_condition_signal+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_condition_signal (); int main () { return libcthreads_condition_signal (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_condition_signal=yes else ac_cv_lib_cthreads_libcthreads_condition_signal=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_signal" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_condition_signal" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_condition_signal" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_wait in -lcthreads" >&5 $as_echo_n "checking for libcthreads_condition_wait in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_condition_wait+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_condition_wait (); int main () { return libcthreads_condition_wait (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_condition_wait=yes else ac_cv_lib_cthreads_libcthreads_condition_wait=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_wait" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_condition_wait" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_condition_wait" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_initialize in -lcthreads" >&5 $as_echo_n "checking for libcthreads_lock_initialize in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_lock_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_lock_initialize (); int main () { return libcthreads_lock_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_lock_initialize=yes else ac_cv_lib_cthreads_libcthreads_lock_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_initialize" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_lock_initialize" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_lock_initialize" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_free in -lcthreads" >&5 $as_echo_n "checking for libcthreads_lock_free in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_lock_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_lock_free (); int main () { return libcthreads_lock_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_lock_free=yes else ac_cv_lib_cthreads_libcthreads_lock_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_free" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_lock_free" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_lock_free" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_grab in -lcthreads" >&5 $as_echo_n "checking for libcthreads_lock_grab in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_lock_grab+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_lock_grab (); int main () { return libcthreads_lock_grab (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_lock_grab=yes else ac_cv_lib_cthreads_libcthreads_lock_grab=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_grab" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_lock_grab" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_lock_grab" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_release in -lcthreads" >&5 $as_echo_n "checking for libcthreads_lock_release in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_lock_release+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_lock_release (); int main () { return libcthreads_lock_release (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_lock_release=yes else ac_cv_lib_cthreads_libcthreads_lock_release=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_release" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_lock_release" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_lock_release" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_initialize in -lcthreads" >&5 $as_echo_n "checking for libcthreads_mutex_initialize in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_mutex_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_mutex_initialize (); int main () { return libcthreads_mutex_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_mutex_initialize=yes else ac_cv_lib_cthreads_libcthreads_mutex_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_initialize" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_initialize" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_mutex_initialize" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_free in -lcthreads" >&5 $as_echo_n "checking for libcthreads_mutex_free in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_mutex_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_mutex_free (); int main () { return libcthreads_mutex_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_mutex_free=yes else ac_cv_lib_cthreads_libcthreads_mutex_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_free" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_free" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_mutex_free" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_grab in -lcthreads" >&5 $as_echo_n "checking for libcthreads_mutex_grab in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_mutex_grab+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_mutex_grab (); int main () { return libcthreads_mutex_grab (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_mutex_grab=yes else ac_cv_lib_cthreads_libcthreads_mutex_grab=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_grab" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_grab" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_mutex_grab" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_try_grab in -lcthreads" >&5 $as_echo_n "checking for libcthreads_mutex_try_grab in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_mutex_try_grab+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_mutex_try_grab (); int main () { return libcthreads_mutex_try_grab (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_mutex_try_grab=yes else ac_cv_lib_cthreads_libcthreads_mutex_try_grab=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_try_grab" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_try_grab" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_mutex_try_grab" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_release in -lcthreads" >&5 $as_echo_n "checking for libcthreads_mutex_release in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_mutex_release+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_mutex_release (); int main () { return libcthreads_mutex_release (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_mutex_release=yes else ac_cv_lib_cthreads_libcthreads_mutex_release=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_release" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_release" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_mutex_release" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_initialize in -lcthreads" >&5 $as_echo_n "checking for libcthreads_read_write_lock_initialize in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_read_write_lock_initialize (); int main () { return libcthreads_read_write_lock_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize=yes else ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_free in -lcthreads" >&5 $as_echo_n "checking for libcthreads_read_write_lock_free in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_read_write_lock_free (); int main () { return libcthreads_read_write_lock_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_read_write_lock_free=yes else ac_cv_lib_cthreads_libcthreads_read_write_lock_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_free" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_free" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_free" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_grab_for_read in -lcthreads" >&5 $as_echo_n "checking for libcthreads_read_write_lock_grab_for_read in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_read_write_lock_grab_for_read (); int main () { return libcthreads_read_write_lock_grab_for_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read=yes else ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_grab_for_write in -lcthreads" >&5 $as_echo_n "checking for libcthreads_read_write_lock_grab_for_write in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_read_write_lock_grab_for_write (); int main () { return libcthreads_read_write_lock_grab_for_write (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write=yes else ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_release_for_read in -lcthreads" >&5 $as_echo_n "checking for libcthreads_read_write_lock_release_for_read in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_read_write_lock_release_for_read (); int main () { return libcthreads_read_write_lock_release_for_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read=yes else ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_release_for_write in -lcthreads" >&5 $as_echo_n "checking for libcthreads_read_write_lock_release_for_write in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_read_write_lock_release_for_write (); int main () { return libcthreads_read_write_lock_release_for_write (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write=yes else ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_initialize in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_initialize in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_initialize (); int main () { return libcthreads_queue_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_initialize=yes else ac_cv_lib_cthreads_libcthreads_queue_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_initialize" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_initialize" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_initialize" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_free in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_free in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_free (); int main () { return libcthreads_queue_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_free=yes else ac_cv_lib_cthreads_libcthreads_queue_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_free" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_free" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_free" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_type_pop in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_type_pop in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_type_pop+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_type_pop (); int main () { return libcthreads_queue_type_pop (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_type_pop=yes else ac_cv_lib_cthreads_libcthreads_queue_type_pop=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_type_pop" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_type_pop" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_type_pop" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_pop in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_pop in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_pop+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_pop (); int main () { return libcthreads_queue_pop (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_pop=yes else ac_cv_lib_cthreads_libcthreads_queue_pop=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_pop" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_pop" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_pop" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_try_push in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_try_push in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_try_push+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_try_push (); int main () { return libcthreads_queue_try_push (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_try_push=yes else ac_cv_lib_cthreads_libcthreads_queue_try_push=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_try_push" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_try_push" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_try_push" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_push in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_push in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_push+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_push (); int main () { return libcthreads_queue_push (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_push=yes else ac_cv_lib_cthreads_libcthreads_queue_push=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_push" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_push" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_push" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_push_sorted in -lcthreads" >&5 $as_echo_n "checking for libcthreads_queue_push_sorted in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_queue_push_sorted+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_queue_push_sorted (); int main () { return libcthreads_queue_push_sorted (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_queue_push_sorted=yes else ac_cv_lib_cthreads_libcthreads_queue_push_sorted=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_push_sorted" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_queue_push_sorted" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_queue_push_sorted" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_create in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_pool_create in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_pool_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_pool_create (); int main () { return libcthreads_thread_pool_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_pool_create=yes else ac_cv_lib_cthreads_libcthreads_thread_pool_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_create" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_create" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_create" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_push in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_pool_push in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_pool_push+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_pool_push (); int main () { return libcthreads_thread_pool_push (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_pool_push=yes else ac_cv_lib_cthreads_libcthreads_thread_pool_push=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_push" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_push" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_push" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_push_sorted in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_pool_push_sorted in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_pool_push_sorted (); int main () { return libcthreads_thread_pool_push_sorted (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted=yes else ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_join in -lcthreads" >&5 $as_echo_n "checking for libcthreads_thread_pool_join in -lcthreads... " >&6; } if ${ac_cv_lib_cthreads_libcthreads_thread_pool_join+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcthreads_thread_pool_join (); int main () { return libcthreads_thread_pool_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cthreads_libcthreads_thread_pool_join=yes else ac_cv_lib_cthreads_libcthreads_thread_pool_join=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_join" >&5 $as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_join" >&6; } if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_join" = xyes; then : ac_cv_libcthreads_dummy=yes else ac_cv_libcthreads=no fi ac_cv_libcthreads_LIBADD="-lcthreads" fi fi if test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_libcthreads" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcthreads in directory: $ac_cv_with_libcthreads See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcthreads" = xyes; then : $as_echo "#define HAVE_LIBCTHREADS 1" >>confdefs.h fi if test "x$ac_cv_libcthreads" = xyes; then : ac_cv_libcthreads_multi_threading=libcthreads else ac_cv_libcthreads_multi_threading=no fi if test "x$ac_cv_libcthreads" = xyes; then : HAVE_LIBCTHREADS=1 else HAVE_LIBCTHREADS=0 fi if test "x$ac_cv_libcthreads" != xyes; then : if test "x$ac_cv_enable_winapi" = xno; then : # Check whether --with-pthread was given. if test "${with_pthread+set}" = set; then : withval=$with_pthread; ac_cv_with_pthread=$withval else ac_cv_with_pthread=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread" >&5 $as_echo_n "checking whether to use search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread... " >&6; } if ${ac_cv_with_pthread+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_pthread=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pthread" >&5 $as_echo "$ac_cv_with_pthread" >&6; } if test "x$ac_cv_with_pthread" != x && test "x$ac_cv_with_pthread" != xno && test "x$ac_cv_with_pthread" != xauto-detect; then : if test -d "$ac_cv_with_pthread"; then : CFLAGS="$CFLAGS -I${ac_cv_with_pthread}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_pthread}/lib" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_pthread" >&5 $as_echo "$as_me: WARNING: no such directory: $ac_cv_with_pthread" >&2;} fi fi if test "x$ac_cv_with_pthread" = xno; then : ac_cv_pthread=no else for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF fi done if test "x$ac_cv_header_pthread_h" = xno; then : ac_cv_pthread=no else ac_cv_pthread=pthread { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_exit in -lpthread" >&5 $as_echo_n "checking for pthread_exit in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_exit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_exit (); int main () { return pthread_exit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_exit=yes else ac_cv_lib_pthread_pthread_exit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_exit" >&5 $as_echo "$ac_cv_lib_pthread_pthread_exit" >&6; } if test "x$ac_cv_lib_pthread_pthread_exit" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 $as_echo_n "checking for pthread_join in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_join+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_join=yes else ac_cv_lib_pthread_pthread_join=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 $as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_init in -lpthread" >&5 $as_echo_n "checking for pthread_cond_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_cond_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_cond_init (); int main () { return pthread_cond_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_cond_init=yes else ac_cv_lib_pthread_pthread_cond_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_cond_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_cond_init" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_destroy in -lpthread" >&5 $as_echo_n "checking for pthread_cond_destroy in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_cond_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_cond_destroy (); int main () { return pthread_cond_destroy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_cond_destroy=yes else ac_cv_lib_pthread_pthread_cond_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_destroy" >&5 $as_echo "$ac_cv_lib_pthread_pthread_cond_destroy" >&6; } if test "x$ac_cv_lib_pthread_pthread_cond_destroy" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_broadcast in -lpthread" >&5 $as_echo_n "checking for pthread_cond_broadcast in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_cond_broadcast+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_cond_broadcast (); int main () { return pthread_cond_broadcast (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_cond_broadcast=yes else ac_cv_lib_pthread_pthread_cond_broadcast=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_broadcast" >&5 $as_echo "$ac_cv_lib_pthread_pthread_cond_broadcast" >&6; } if test "x$ac_cv_lib_pthread_pthread_cond_broadcast" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_signal in -lpthread" >&5 $as_echo_n "checking for pthread_cond_signal in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_cond_signal+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_cond_signal (); int main () { return pthread_cond_signal (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_cond_signal=yes else ac_cv_lib_pthread_pthread_cond_signal=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_signal" >&5 $as_echo "$ac_cv_lib_pthread_pthread_cond_signal" >&6; } if test "x$ac_cv_lib_pthread_pthread_cond_signal" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_wait in -lpthread" >&5 $as_echo_n "checking for pthread_cond_wait in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_cond_wait+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_cond_wait (); int main () { return pthread_cond_wait (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_cond_wait=yes else ac_cv_lib_pthread_pthread_cond_wait=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_wait" >&5 $as_echo "$ac_cv_lib_pthread_pthread_cond_wait" >&6; } if test "x$ac_cv_lib_pthread_pthread_cond_wait" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes else ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_destroy in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_destroy in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_destroy (); int main () { return pthread_mutex_destroy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_destroy=yes else ac_cv_lib_pthread_pthread_mutex_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_destroy" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_destroy" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_destroy" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_lock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_lock (); int main () { return pthread_mutex_lock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_lock=yes else ac_cv_lib_pthread_pthread_mutex_lock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_lock" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_lock" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_lock" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_trylock in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_trylock in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_trylock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_trylock (); int main () { return pthread_mutex_trylock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_trylock=yes else ac_cv_lib_pthread_pthread_mutex_trylock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_trylock" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_trylock" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_trylock" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_unlock in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_unlock in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_unlock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_unlock (); int main () { return pthread_mutex_unlock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_unlock=yes else ac_cv_lib_pthread_pthread_mutex_unlock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_unlock" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_unlock" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_unlock" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_init in -lpthread" >&5 $as_echo_n "checking for pthread_rwlock_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_rwlock_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_rwlock_init (); int main () { return pthread_rwlock_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_rwlock_init=yes else ac_cv_lib_pthread_pthread_rwlock_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_rwlock_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_rwlock_init" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy in -lpthread" >&5 $as_echo_n "checking for pthread_rwlock_destroy in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_rwlock_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_rwlock_destroy (); int main () { return pthread_rwlock_destroy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_rwlock_destroy=yes else ac_cv_lib_pthread_pthread_rwlock_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_destroy" >&5 $as_echo "$ac_cv_lib_pthread_pthread_rwlock_destroy" >&6; } if test "x$ac_cv_lib_pthread_pthread_rwlock_destroy" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_rdlock in -lpthread" >&5 $as_echo_n "checking for pthread_rwlock_rdlock in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_rwlock_rdlock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_rwlock_rdlock (); int main () { return pthread_rwlock_rdlock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_rwlock_rdlock=yes else ac_cv_lib_pthread_pthread_rwlock_rdlock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_rdlock" >&5 $as_echo "$ac_cv_lib_pthread_pthread_rwlock_rdlock" >&6; } if test "x$ac_cv_lib_pthread_pthread_rwlock_rdlock" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_wrlock in -lpthread" >&5 $as_echo_n "checking for pthread_rwlock_wrlock in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_rwlock_wrlock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_rwlock_wrlock (); int main () { return pthread_rwlock_wrlock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_rwlock_wrlock=yes else ac_cv_lib_pthread_pthread_rwlock_wrlock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_wrlock" >&5 $as_echo "$ac_cv_lib_pthread_pthread_rwlock_wrlock" >&6; } if test "x$ac_cv_lib_pthread_pthread_rwlock_wrlock" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_unlock in -lpthread" >&5 $as_echo_n "checking for pthread_rwlock_unlock in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_rwlock_unlock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_rwlock_unlock (); int main () { return pthread_rwlock_unlock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_rwlock_unlock=yes else ac_cv_lib_pthread_pthread_rwlock_unlock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_unlock" >&5 $as_echo "$ac_cv_lib_pthread_pthread_rwlock_unlock" >&6; } if test "x$ac_cv_lib_pthread_pthread_rwlock_unlock" = xyes; then : ac_pthread_dummy=yes else ac_cv_pthread=no fi ac_cv_pthread_LIBADD="-lpthread"; fi fi if test "x$ac_cv_pthread" = xpthread; then : $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h fi if test "x$ac_cv_pthread" != xno; then : HAVE_PTHREAD=1 else HAVE_PTHREAD=0 fi if test "x$ac_cv_pthread_CPPFLAGS" != "x"; then : PTHREAD_CPPFLAGS=$ac_cv_pthread_CPPFLAGS fi if test "x$ac_cv_pthread_LIBADD" != "x"; then : PTHREAD_LIBADD=$ac_cv_pthread_LIBADD fi if test "x$ac_cv_pthread" = xpthread; then : ax_pthread_pc_libs_private=-lpthread fi ac_cv_libcthreads_multi_threading=$ac_cv_pthread else ac_cv_libcthreads_multi_threading="winapi" fi if test "x$ac_cv_libcthreads_multi_threading" != xno; then : ac_cv_libcthreads_CPPFLAGS="-I../libcthreads"; ac_cv_libcthreads_LIBADD="../libcthreads/libcthreads.la"; ac_cv_libcthreads=local else ac_cv_libcthreads=no fi $as_echo "#define HAVE_LOCAL_LIBCTHREADS 1" >>confdefs.h HAVE_LOCAL_LIBCTHREADS=1 fi fi if test "x$ac_cv_libcthreads" = xlocal; then HAVE_LOCAL_LIBCTHREADS_TRUE= HAVE_LOCAL_LIBCTHREADS_FALSE='#' else HAVE_LOCAL_LIBCTHREADS_TRUE='#' HAVE_LOCAL_LIBCTHREADS_FALSE= fi if test "x$ac_cv_libcthreads_CPPFLAGS" != "x"; then : LIBCTHREADS_CPPFLAGS=$ac_cv_libcthreads_CPPFLAGS fi if test "x$ac_cv_libcthreads_LIBADD" != "x"; then : LIBCTHREADS_LIBADD=$ac_cv_libcthreads_LIBADD fi if test "x$ac_cv_libcthreads" != xno; then : $as_echo "#define HAVE_MULTI_THREAD_SUPPORT 1" >>confdefs.h HAVE_MULTI_THREAD_SUPPORT=1 else HAVE_MULTI_THREAD_SUPPORT=0 fi if test "x$ac_cv_libcthreads" = xyes; then : ax_libcthreads_pc_libs_private=-lcthreads fi if test "x$ac_cv_libcthreads" = xyes; then : ax_libcthreads_spec_requires=libcthreads ax_libcthreads_spec_build_requires=libcthreads-devel fi # Check whether --with-libcdata was given. if test "${with_libcdata+set}" = set; then : withval=$with_libcdata; ac_cv_with_libcdata=$withval else ac_cv_with_libcdata=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcdata+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcdata=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcdata" >&5 $as_echo "$ac_cv_with_libcdata" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdata" = xno; then : ac_cv_libcdata=no else ac_cv_libcdata=check if test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect; then : if test -d "$ac_cv_with_libcdata"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdata}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcdata See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata" >&5 $as_echo_n "checking for libcdata... " >&6; } if test -n "$libcdata_CFLAGS"; then pkg_cv_libcdata_CFLAGS="$libcdata_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdata >= 20190112\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcdata >= 20190112") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcdata_CFLAGS=`$PKG_CONFIG --cflags "libcdata >= 20190112" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcdata_LIBS"; then pkg_cv_libcdata_LIBS="$libcdata_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdata >= 20190112\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcdata >= 20190112") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcdata_LIBS=`$PKG_CONFIG --libs "libcdata >= 20190112" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcdata_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcdata >= 20190112" 2>&1` else libcdata_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcdata >= 20190112" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcdata_PKG_ERRORS" >&5 ac_cv_libcdata=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcdata=check else libcdata_CFLAGS=$pkg_cv_libcdata_CFLAGS libcdata_LIBS=$pkg_cv_libcdata_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcdata=yes fi fi if test "x$ac_cv_libcdata" = xyes; then : ac_cv_libcdata_CPPFLAGS="$pkg_cv_libcdata_CFLAGS" ac_cv_libcdata_LIBADD="$pkg_cv_libcdata_LIBS" fi fi if test "x$ac_cv_libcdata" = xcheck; then : for ac_header in libcdata.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcdata.h" "ac_cv_header_libcdata_h" "$ac_includes_default" if test "x$ac_cv_header_libcdata_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCDATA_H 1 _ACEOF fi done if test "x$ac_cv_header_libcdata_h" = xno; then : ac_cv_libcdata=no else ac_cv_libcdata=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_get_version in -lcdata" >&5 $as_echo_n "checking for libcdata_get_version in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_get_version (); int main () { return libcdata_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_get_version=yes else ac_cv_lib_cdata_libcdata_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_get_version" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_get_version" >&6; } if test "x$ac_cv_lib_cdata_libcdata_get_version" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_initialize in -lcdata" >&5 $as_echo_n "checking for libcdata_array_initialize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_initialize (); int main () { return libcdata_array_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_initialize=yes else ac_cv_lib_cdata_libcdata_array_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_initialize" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_initialize" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_initialize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_free in -lcdata" >&5 $as_echo_n "checking for libcdata_array_free in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_free (); int main () { return libcdata_array_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_free=yes else ac_cv_lib_cdata_libcdata_array_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_free" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_free" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_free" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_empty in -lcdata" >&5 $as_echo_n "checking for libcdata_array_empty in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_empty (); int main () { return libcdata_array_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_empty=yes else ac_cv_lib_cdata_libcdata_array_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_empty" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_empty" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_empty" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_clone in -lcdata" >&5 $as_echo_n "checking for libcdata_array_clone in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_clone (); int main () { return libcdata_array_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_clone=yes else ac_cv_lib_cdata_libcdata_array_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_clone" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_clone" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_clone" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_resize in -lcdata" >&5 $as_echo_n "checking for libcdata_array_resize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_resize (); int main () { return libcdata_array_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_resize=yes else ac_cv_lib_cdata_libcdata_array_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_resize" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_resize" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_resize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_reverse in -lcdata" >&5 $as_echo_n "checking for libcdata_array_reverse in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_reverse+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_reverse (); int main () { return libcdata_array_reverse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_reverse=yes else ac_cv_lib_cdata_libcdata_array_reverse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_reverse" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_reverse" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_reverse" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_number_of_entries in -lcdata" >&5 $as_echo_n "checking for libcdata_array_get_number_of_entries in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_get_number_of_entries+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_get_number_of_entries (); int main () { return libcdata_array_get_number_of_entries (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_get_number_of_entries=yes else ac_cv_lib_cdata_libcdata_array_get_number_of_entries=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_number_of_entries" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_get_number_of_entries" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_get_number_of_entries" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_entry_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_array_get_entry_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_get_entry_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_get_entry_by_index (); int main () { return libcdata_array_get_entry_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_get_entry_by_index=yes else ac_cv_lib_cdata_libcdata_array_get_entry_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_entry_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_get_entry_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_get_entry_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_entry_by_value in -lcdata" >&5 $as_echo_n "checking for libcdata_array_get_entry_by_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_get_entry_by_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_get_entry_by_value (); int main () { return libcdata_array_get_entry_by_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_get_entry_by_value=yes else ac_cv_lib_cdata_libcdata_array_get_entry_by_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_entry_by_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_get_entry_by_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_get_entry_by_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_set_entry_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_array_set_entry_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_set_entry_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_set_entry_by_index (); int main () { return libcdata_array_set_entry_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_set_entry_by_index=yes else ac_cv_lib_cdata_libcdata_array_set_entry_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_set_entry_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_set_entry_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_set_entry_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_prepend_entry in -lcdata" >&5 $as_echo_n "checking for libcdata_array_prepend_entry in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_prepend_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_prepend_entry (); int main () { return libcdata_array_prepend_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_prepend_entry=yes else ac_cv_lib_cdata_libcdata_array_prepend_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_prepend_entry" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_prepend_entry" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_prepend_entry" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_append_entry in -lcdata" >&5 $as_echo_n "checking for libcdata_array_append_entry in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_append_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_append_entry (); int main () { return libcdata_array_append_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_append_entry=yes else ac_cv_lib_cdata_libcdata_array_append_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_append_entry" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_append_entry" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_append_entry" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_insert_entry in -lcdata" >&5 $as_echo_n "checking for libcdata_array_insert_entry in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_insert_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_insert_entry (); int main () { return libcdata_array_insert_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_insert_entry=yes else ac_cv_lib_cdata_libcdata_array_insert_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_insert_entry" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_insert_entry" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_insert_entry" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_remove_entry in -lcdata" >&5 $as_echo_n "checking for libcdata_array_remove_entry in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_array_remove_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_array_remove_entry (); int main () { return libcdata_array_remove_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_array_remove_entry=yes else ac_cv_lib_cdata_libcdata_array_remove_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_remove_entry" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_array_remove_entry" >&6; } if test "x$ac_cv_lib_cdata_libcdata_array_remove_entry" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_btree_initialize in -lcdata" >&5 $as_echo_n "checking for libfdata_btree_initialize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libfdata_btree_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_btree_initialize (); int main () { return libfdata_btree_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libfdata_btree_initialize=yes else ac_cv_lib_cdata_libfdata_btree_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libfdata_btree_initialize" >&5 $as_echo "$ac_cv_lib_cdata_libfdata_btree_initialize" >&6; } if test "x$ac_cv_lib_cdata_libfdata_btree_initialize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_free in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_free in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_free (); int main () { return libcdata_btree_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_free=yes else ac_cv_lib_cdata_libcdata_btree_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_free" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_free" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_free" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_number_of_values in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_get_number_of_values in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_get_number_of_values+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_get_number_of_values (); int main () { return libcdata_btree_get_number_of_values (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_get_number_of_values=yes else ac_cv_lib_cdata_libcdata_btree_get_number_of_values=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_number_of_values" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_get_number_of_values" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_get_number_of_values" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_value_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_get_value_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_get_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_get_value_by_index (); int main () { return libcdata_btree_get_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_get_value_by_index=yes else ac_cv_lib_cdata_libcdata_btree_get_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_value_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_get_value_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_get_value_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_value_by_value in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_get_value_by_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_get_value_by_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_get_value_by_value (); int main () { return libcdata_btree_get_value_by_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_get_value_by_value=yes else ac_cv_lib_cdata_libcdata_btree_get_value_by_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_value_by_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_get_value_by_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_get_value_by_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_insert_value in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_insert_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_insert_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_insert_value (); int main () { return libcdata_btree_insert_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_insert_value=yes else ac_cv_lib_cdata_libcdata_btree_insert_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_insert_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_insert_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_insert_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_replace_value in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_replace_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_replace_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_replace_value (); int main () { return libcdata_btree_replace_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_replace_value=yes else ac_cv_lib_cdata_libcdata_btree_replace_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_replace_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_replace_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_replace_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_remove_value in -lcdata" >&5 $as_echo_n "checking for libcdata_btree_remove_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_btree_remove_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_btree_remove_value (); int main () { return libcdata_btree_remove_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_btree_remove_value=yes else ac_cv_lib_cdata_libcdata_btree_remove_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_remove_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_btree_remove_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_btree_remove_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_initialize in -lcdata" >&5 $as_echo_n "checking for libcdata_list_initialize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_initialize (); int main () { return libcdata_list_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_initialize=yes else ac_cv_lib_cdata_libcdata_list_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_initialize" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_initialize" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_initialize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_free in -lcdata" >&5 $as_echo_n "checking for libcdata_list_free in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_free (); int main () { return libcdata_list_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_free=yes else ac_cv_lib_cdata_libcdata_list_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_free" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_free" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_free" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_empty in -lcdata" >&5 $as_echo_n "checking for libcdata_list_empty in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_empty (); int main () { return libcdata_list_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_empty=yes else ac_cv_lib_cdata_libcdata_list_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_empty" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_empty" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_empty" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_clone in -lcdata" >&5 $as_echo_n "checking for libcdata_list_clone in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_clone (); int main () { return libcdata_list_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_clone=yes else ac_cv_lib_cdata_libcdata_list_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_clone" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_clone" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_clone" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_number_of_elements in -lcdata" >&5 $as_echo_n "checking for libcdata_list_get_number_of_elements in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_get_number_of_elements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_get_number_of_elements (); int main () { return libcdata_list_get_number_of_elements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_get_number_of_elements=yes else ac_cv_lib_cdata_libcdata_list_get_number_of_elements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_number_of_elements" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_get_number_of_elements" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_get_number_of_elements" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_first_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_get_first_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_get_first_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_get_first_element (); int main () { return libcdata_list_get_first_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_get_first_element=yes else ac_cv_lib_cdata_libcdata_list_get_first_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_first_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_get_first_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_get_first_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_last_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_get_last_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_get_last_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_get_last_element (); int main () { return libcdata_list_get_last_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_get_last_element=yes else ac_cv_lib_cdata_libcdata_list_get_last_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_last_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_get_last_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_get_last_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_element_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_list_get_element_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_get_element_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_get_element_by_index (); int main () { return libcdata_list_get_element_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_get_element_by_index=yes else ac_cv_lib_cdata_libcdata_list_get_element_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_element_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_get_element_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_get_element_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_value_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_list_get_value_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_get_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_get_value_by_index (); int main () { return libcdata_list_get_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_get_value_by_index=yes else ac_cv_lib_cdata_libcdata_list_get_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_value_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_get_value_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_get_value_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_prepend_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_prepend_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_prepend_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_prepend_element (); int main () { return libcdata_list_prepend_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_prepend_element=yes else ac_cv_lib_cdata_libcdata_list_prepend_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_prepend_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_prepend_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_prepend_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_prepend_value in -lcdata" >&5 $as_echo_n "checking for libcdata_list_prepend_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_prepend_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_prepend_value (); int main () { return libcdata_list_prepend_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_prepend_value=yes else ac_cv_lib_cdata_libcdata_list_prepend_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_prepend_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_prepend_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_prepend_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_append_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_append_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_append_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_append_element (); int main () { return libcdata_list_append_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_append_element=yes else ac_cv_lib_cdata_libcdata_list_append_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_append_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_append_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_append_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_append_value in -lcdata" >&5 $as_echo_n "checking for libcdata_list_append_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_append_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_append_value (); int main () { return libcdata_list_append_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_append_value=yes else ac_cv_lib_cdata_libcdata_list_append_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_append_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_append_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_append_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_insert_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_insert_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_insert_element (); int main () { return libcdata_list_insert_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_insert_element=yes else ac_cv_lib_cdata_libcdata_list_insert_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_insert_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_insert_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_value in -lcdata" >&5 $as_echo_n "checking for libcdata_list_insert_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_insert_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_insert_value (); int main () { return libcdata_list_insert_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_insert_value=yes else ac_cv_lib_cdata_libcdata_list_insert_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_insert_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_insert_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_remove_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_remove_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_remove_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_remove_element (); int main () { return libcdata_list_remove_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_remove_element=yes else ac_cv_lib_cdata_libcdata_list_remove_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_remove_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_remove_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_remove_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_initialize in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_initialize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_initialize (); int main () { return libcdata_list_element_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_initialize=yes else ac_cv_lib_cdata_libcdata_list_element_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_initialize" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_initialize" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_initialize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_free in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_free in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_free (); int main () { return libcdata_list_element_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_free=yes else ac_cv_lib_cdata_libcdata_list_element_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_free" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_free" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_free" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_value in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_get_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_get_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_get_value (); int main () { return libcdata_list_element_get_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_get_value=yes else ac_cv_lib_cdata_libcdata_list_element_get_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_get_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_value in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_set_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_set_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_set_value (); int main () { return libcdata_list_element_set_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_set_value=yes else ac_cv_lib_cdata_libcdata_list_element_set_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_set_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_previous_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_get_previous_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_get_previous_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_get_previous_element (); int main () { return libcdata_list_element_get_previous_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_get_previous_element=yes else ac_cv_lib_cdata_libcdata_list_element_get_previous_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_previous_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_previous_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_get_previous_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_previous_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_set_previous_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_set_previous_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_set_previous_element (); int main () { return libcdata_list_element_set_previous_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_set_previous_element=yes else ac_cv_lib_cdata_libcdata_list_element_set_previous_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_previous_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_previous_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_set_previous_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_next_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_get_next_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_get_next_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_get_next_element (); int main () { return libcdata_list_element_get_next_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_get_next_element=yes else ac_cv_lib_cdata_libcdata_list_element_get_next_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_next_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_next_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_get_next_element" = xyes; then : ac_cv_libcdata_dummy=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_next_element in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_set_next_element in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_set_next_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_set_next_element (); int main () { return libcdata_list_element_set_next_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_set_next_element=yes else ac_cv_lib_cdata_libcdata_list_element_set_next_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_next_element" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_next_element" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_set_next_element" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_elements in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_get_elements in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_get_elements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_get_elements (); int main () { return libcdata_list_element_get_elements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_get_elements=yes else ac_cv_lib_cdata_libcdata_list_element_get_elements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_elements" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_elements" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_get_elements" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_elements in -lcdata" >&5 $as_echo_n "checking for libcdata_list_element_set_elements in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_list_element_set_elements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_list_element_set_elements (); int main () { return libcdata_list_element_set_elements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_list_element_set_elements=yes else ac_cv_lib_cdata_libcdata_list_element_set_elements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_elements" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_elements" >&6; } if test "x$ac_cv_lib_cdata_libcdata_list_element_set_elements" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_initialize in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_initialize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_initialize (); int main () { return libcdata_range_list_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_initialize=yes else ac_cv_lib_cdata_libcdata_range_list_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_initialize" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_initialize" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_initialize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_free in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_free in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_free (); int main () { return libcdata_range_list_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_free=yes else ac_cv_lib_cdata_libcdata_range_list_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_free" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_free" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_free" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_empty in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_empty in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_empty (); int main () { return libcdata_range_list_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_empty=yes else ac_cv_lib_cdata_libcdata_range_list_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_empty" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_empty" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_empty" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_clone in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_clone in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_clone (); int main () { return libcdata_range_list_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_clone=yes else ac_cv_lib_cdata_libcdata_range_list_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_clone" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_clone" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_clone" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_number_of_elements in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_get_number_of_elements in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_get_number_of_elements (); int main () { return libcdata_range_list_get_number_of_elements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements=yes else ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_insert_range in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_insert_range in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_insert_range+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_insert_range (); int main () { return libcdata_range_list_insert_range (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_insert_range=yes else ac_cv_lib_cdata_libcdata_range_list_insert_range=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_insert_range" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_insert_range" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_insert_range" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_insert_range_list in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_insert_range_list in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_insert_range_list+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_insert_range_list (); int main () { return libcdata_range_list_insert_range_list (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_insert_range_list=yes else ac_cv_lib_cdata_libcdata_range_list_insert_range_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_insert_range_list" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_insert_range_list" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_insert_range_list" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_remove_range in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_remove_range in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_remove_range+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_remove_range (); int main () { return libcdata_range_list_remove_range (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_remove_range=yes else ac_cv_lib_cdata_libcdata_range_list_remove_range=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_remove_range" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_remove_range" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_remove_range" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_range_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_get_range_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_get_range_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_get_range_by_index (); int main () { return libcdata_range_list_get_range_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_get_range_by_index=yes else ac_cv_lib_cdata_libcdata_range_list_get_range_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_range_at_offset in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_get_range_at_offset in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_get_range_at_offset (); int main () { return libcdata_range_list_get_range_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset=yes else ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_range_is_present in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_range_is_present in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_range_is_present+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_range_is_present (); int main () { return libcdata_range_list_range_is_present (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_range_is_present=yes else ac_cv_lib_cdata_libcdata_range_list_range_is_present=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_range_is_present" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_range_is_present" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_range_is_present" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_spanning_range in -lcdata" >&5 $as_echo_n "checking for libcdata_range_list_get_spanning_range in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_range_list_get_spanning_range+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_range_list_get_spanning_range (); int main () { return libcdata_range_list_get_spanning_range (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_range_list_get_spanning_range=yes else ac_cv_lib_cdata_libcdata_range_list_get_spanning_range=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" >&6; } if test "x$ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_initialize in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_initialize in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_initialize (); int main () { return libcdata_tree_node_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_initialize=yes else ac_cv_lib_cdata_libcdata_tree_node_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_initialize" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_initialize" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_initialize" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_free in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_free in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_free (); int main () { return libcdata_tree_node_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_free=yes else ac_cv_lib_cdata_libcdata_tree_node_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_free" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_free" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_free" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_empty in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_empty in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_empty (); int main () { return libcdata_tree_node_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_empty=yes else ac_cv_lib_cdata_libcdata_tree_node_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_empty" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_empty" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_empty" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_clone in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_clone in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_clone (); int main () { return libcdata_tree_node_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_clone=yes else ac_cv_lib_cdata_libcdata_tree_node_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_clone" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_clone" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_clone" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_value in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_value (); int main () { return libcdata_tree_node_get_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_value=yes else ac_cv_lib_cdata_libcdata_tree_node_get_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_value in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_set_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_set_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_set_value (); int main () { return libcdata_tree_node_set_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_set_value=yes else ac_cv_lib_cdata_libcdata_tree_node_set_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_parent_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_parent_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_parent_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_parent_node (); int main () { return libcdata_tree_node_get_parent_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_parent_node=yes else ac_cv_lib_cdata_libcdata_tree_node_get_parent_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_parent_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_set_parent_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_set_parent_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_set_parent_node (); int main () { return libcdata_tree_node_set_parent_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_set_parent_node=yes else ac_cv_lib_cdata_libcdata_tree_node_set_parent_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_previous_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_previous_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_previous_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_previous_node (); int main () { return libcdata_tree_node_get_previous_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_previous_node=yes else ac_cv_lib_cdata_libcdata_tree_node_get_previous_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_previous_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_set_previous_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_set_previous_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_set_previous_node (); int main () { return libcdata_tree_node_set_previous_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_set_previous_node=yes else ac_cv_lib_cdata_libcdata_tree_node_set_previous_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_next_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_next_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_next_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_next_node (); int main () { return libcdata_tree_node_get_next_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_next_node=yes else ac_cv_lib_cdata_libcdata_tree_node_get_next_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_next_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_next_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_next_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_next_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_set_next_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_set_next_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_set_next_node (); int main () { return libcdata_tree_node_set_next_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_set_next_node=yes else ac_cv_lib_cdata_libcdata_tree_node_set_next_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_next_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_next_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_next_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_nodes in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_nodes in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_nodes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_nodes (); int main () { return libcdata_tree_node_get_nodes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_nodes=yes else ac_cv_lib_cdata_libcdata_tree_node_get_nodes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_nodes" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_nodes" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_nodes" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_nodes in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_set_nodes in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_set_nodes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_set_nodes (); int main () { return libcdata_tree_node_set_nodes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_set_nodes=yes else ac_cv_lib_cdata_libcdata_tree_node_set_nodes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_nodes" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_nodes" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_nodes" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_append_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_append_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_append_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_append_node (); int main () { return libcdata_tree_node_append_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_append_node=yes else ac_cv_lib_cdata_libcdata_tree_node_append_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_append_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_append_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_append_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_append_value in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_append_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_append_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_append_value (); int main () { return libcdata_tree_node_append_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_append_value=yes else ac_cv_lib_cdata_libcdata_tree_node_append_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_append_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_append_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_append_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_insert_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_insert_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_insert_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_insert_node (); int main () { return libcdata_tree_node_insert_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_insert_node=yes else ac_cv_lib_cdata_libcdata_tree_node_insert_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_insert_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_insert_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_insert_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_insert_value in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_insert_value in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_insert_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_insert_value (); int main () { return libcdata_tree_node_insert_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_insert_value=yes else ac_cv_lib_cdata_libcdata_tree_node_insert_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_insert_value" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_insert_value" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_insert_value" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_replace_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_replace_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_replace_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_replace_node (); int main () { return libcdata_tree_node_replace_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_replace_node=yes else ac_cv_lib_cdata_libcdata_tree_node_replace_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_replace_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_replace_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_replace_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_remove_node in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_remove_node in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_remove_node+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_remove_node (); int main () { return libcdata_tree_node_remove_node (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_remove_node=yes else ac_cv_lib_cdata_libcdata_tree_node_remove_node=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_remove_node" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_remove_node" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_remove_node" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_number_of_sub_nodes in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_number_of_sub_nodes in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_number_of_sub_nodes (); int main () { return libcdata_tree_node_get_number_of_sub_nodes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes=yes else ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_sub_node_by_index in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_sub_node_by_index in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_sub_node_by_index (); int main () { return libcdata_tree_node_get_sub_node_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index=yes else ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_leaf_node_list in -lcdata" >&5 $as_echo_n "checking for libcdata_tree_node_get_leaf_node_list in -lcdata... " >&6; } if ${ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdata_tree_node_get_leaf_node_list (); int main () { return libcdata_tree_node_get_leaf_node_list (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list=yes else ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" >&5 $as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" >&6; } if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" = xyes; then : ac_cv_libcdata_dummy=yes else ac_cv_libcdata=no fi ac_cv_libcdata_LIBADD="-lcdata" fi fi if test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_libcdata" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcdata in directory: $ac_cv_with_libcdata See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcdata" = xyes; then : $as_echo "#define HAVE_LIBCDATA 1" >>confdefs.h fi if test "x$ac_cv_libcdata" = xyes; then : HAVE_LIBCDATA=1 else HAVE_LIBCDATA=0 fi if test "x$ac_cv_libcdata" != xyes; then : ac_cv_libcdata_CPPFLAGS="-I../libcdata"; ac_cv_libcdata_LIBADD="../libcdata/libcdata.la"; ac_cv_libcdata=local $as_echo "#define HAVE_LOCAL_LIBCDATA 1" >>confdefs.h HAVE_LOCAL_LIBCDATA=1 fi if test "x$ac_cv_libcdata" = xlocal; then HAVE_LOCAL_LIBCDATA_TRUE= HAVE_LOCAL_LIBCDATA_FALSE='#' else HAVE_LOCAL_LIBCDATA_TRUE='#' HAVE_LOCAL_LIBCDATA_FALSE= fi if test "x$ac_cv_libcdata_CPPFLAGS" != "x"; then : LIBCDATA_CPPFLAGS=$ac_cv_libcdata_CPPFLAGS fi if test "x$ac_cv_libcdata_LIBADD" != "x"; then : LIBCDATA_LIBADD=$ac_cv_libcdata_LIBADD fi if test "x$ac_cv_libcdata" = xyes; then : ax_libcdata_pc_libs_private=-lcdata fi if test "x$ac_cv_libcdata" = xyes; then : ax_libcdata_spec_requires=libcdata ax_libcdata_spec_build_requires=libcdata-devel fi # Check whether --with-libcdatetime was given. if test "${with_libcdatetime+set}" = set; then : withval=$with_libcdatetime; ac_cv_with_libcdatetime=$withval else ac_cv_with_libcdatetime=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcdatetime in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcdatetime in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcdatetime+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcdatetime=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcdatetime" >&5 $as_echo "$ac_cv_with_libcdatetime" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdatetime" = xno; then : ac_cv_libcdatetime=no else ac_cv_libcdatetime=check if test "x$ac_cv_with_libcdatetime" != x && test "x$ac_cv_with_libcdatetime" != xauto-detect; then : if test -d "$ac_cv_with_libcdatetime"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcdatetime}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdatetime}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcdatetime See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime" >&5 $as_echo_n "checking for libcdatetime... " >&6; } if test -n "$libcdatetime_CFLAGS"; then pkg_cv_libcdatetime_CFLAGS="$libcdatetime_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdatetime >= 20141018\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcdatetime >= 20141018") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcdatetime_CFLAGS=`$PKG_CONFIG --cflags "libcdatetime >= 20141018" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcdatetime_LIBS"; then pkg_cv_libcdatetime_LIBS="$libcdatetime_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdatetime >= 20141018\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcdatetime >= 20141018") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcdatetime_LIBS=`$PKG_CONFIG --libs "libcdatetime >= 20141018" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcdatetime_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcdatetime >= 20141018" 2>&1` else libcdatetime_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcdatetime >= 20141018" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcdatetime_PKG_ERRORS" >&5 ac_cv_libcdatetime=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcdatetime=check else libcdatetime_CFLAGS=$pkg_cv_libcdatetime_CFLAGS libcdatetime_LIBS=$pkg_cv_libcdatetime_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcdatetime=yes fi fi if test "x$ac_cv_libcdatetime" = xyes; then : ac_cv_libcdatetime_CPPFLAGS="$pkg_cv_libcdatetime_CFLAGS" ac_cv_libcdatetime_LIBADD="$pkg_cv_libcdatetime_LIBS" fi fi if test "x$ac_cv_libcdatetime" = xcheck; then : for ac_header in libcdatetime.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcdatetime.h" "ac_cv_header_libcdatetime_h" "$ac_includes_default" if test "x$ac_cv_header_libcdatetime_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCDATETIME_H 1 _ACEOF fi done if test "x$ac_cv_header_libcdatetime_h" = xno; then : ac_cv_libcdatetime=no else ac_cv_libcdatetime=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_get_version in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_get_version in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_get_version (); int main () { return libcdatetime_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_get_version=yes else ac_cv_lib_cdatetime_libcdatetime_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_get_version" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_get_version" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_get_version" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_initialize in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_initialize in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_initialize (); int main () { return libcdatetime_elements_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_initialize=yes else ac_cv_lib_cdatetime_libcdatetime_elements_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_initialize" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_initialize" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_initialize" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_free in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_free in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_free (); int main () { return libcdatetime_elements_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_free=yes else ac_cv_lib_cdatetime_libcdatetime_elements_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_free" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_free" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_free" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_copy in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_copy in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_copy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_copy (); int main () { return libcdatetime_elements_copy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_copy=yes else ac_cv_lib_cdatetime_libcdatetime_elements_copy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_copy" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_copy" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_copy" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_year in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_year in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_year+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_year (); int main () { return libcdatetime_elements_get_year (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_year=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_year=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_year" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_year" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_year" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_day_of_year in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_day_of_year in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_year+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_day_of_year (); int main () { return libcdatetime_elements_get_day_of_year (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_year=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_year=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_year" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_year" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_year" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_month in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_month in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_month+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_month (); int main () { return libcdatetime_elements_get_month (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_month=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_month=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_month" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_month" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_month" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_day_of_month in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_day_of_month in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_month+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_day_of_month (); int main () { return libcdatetime_elements_get_day_of_month (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_month=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_month=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_month" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_month" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_day_of_month" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_date_values in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_date_values in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_date_values+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_date_values (); int main () { return libcdatetime_elements_get_date_values (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_date_values=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_date_values=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_date_values" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_date_values" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_date_values" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_hours in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_hours in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_hours+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_hours (); int main () { return libcdatetime_elements_get_hours (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_hours=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_hours=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_hours" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_hours" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_hours" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_minutes in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_minutes in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_minutes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_minutes (); int main () { return libcdatetime_elements_get_minutes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_minutes=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_minutes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_minutes" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_minutes" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_minutes" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_seconds (); int main () { return libcdatetime_elements_get_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_milli_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_milli_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_milli_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_milli_seconds (); int main () { return libcdatetime_elements_get_milli_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_milli_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_milli_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_milli_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_milli_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_milli_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_micro_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_micro_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_micro_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_micro_seconds (); int main () { return libcdatetime_elements_get_micro_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_micro_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_micro_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_micro_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_micro_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_micro_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_nano_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_nano_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_nano_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_nano_seconds (); int main () { return libcdatetime_elements_get_nano_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_nano_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_nano_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_nano_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_nano_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_nano_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_time_values in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_time_values in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_time_values+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_time_values (); int main () { return libcdatetime_elements_get_time_values (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_time_values=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_time_values=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_time_values" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_time_values" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_time_values" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_set_current_time_utc in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_set_current_time_utc in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_utc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_set_current_time_utc (); int main () { return libcdatetime_elements_set_current_time_utc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_utc=yes else ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_utc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_utc" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_utc" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_utc" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_set_current_time_localtime in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_set_current_time_localtime in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_localtime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_set_current_time_localtime (); int main () { return libcdatetime_elements_set_current_time_localtime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_localtime=yes else ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_localtime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_localtime" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_localtime" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_set_current_time_localtime" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_delta_in_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_delta_in_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_delta_in_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_delta_in_seconds (); int main () { return libcdatetime_elements_get_delta_in_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_delta_in_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_delta_in_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_delta_in_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_delta_in_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_delta_in_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_set_from_delta_in_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_set_from_delta_in_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_set_from_delta_in_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_set_from_delta_in_seconds (); int main () { return libcdatetime_elements_set_from_delta_in_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_set_from_delta_in_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_elements_set_from_delta_in_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_set_from_delta_in_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_set_from_delta_in_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_set_from_delta_in_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_get_string_size in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_get_string_size in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_get_string_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_get_string_size (); int main () { return libcdatetime_elements_get_string_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_get_string_size=yes else ac_cv_lib_cdatetime_libcdatetime_elements_get_string_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_get_string_size" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_get_string_size" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_get_string_size" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_copy_to_string in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_copy_to_string in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_copy_to_string (); int main () { return libcdatetime_elements_copy_to_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string=yes else ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_elements_copy_to_string_with_index in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_elements_copy_to_string_with_index in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string_with_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_elements_copy_to_string_with_index (); int main () { return libcdatetime_elements_copy_to_string_with_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string_with_index=yes else ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string_with_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string_with_index" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string_with_index" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_elements_copy_to_string_with_index" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_initialize in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_initialize in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_initialize (); int main () { return libcdatetime_timestamp_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_initialize=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_initialize" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_initialize" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_initialize" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_free in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_free in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_free (); int main () { return libcdatetime_timestamp_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_free=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_free" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_free" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_free" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_copy in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_copy in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_copy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_copy (); int main () { return libcdatetime_timestamp_copy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_copy=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_copy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_copy" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_copy" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_copy" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_set_current_time in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_set_current_time in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_set_current_time+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_set_current_time (); int main () { return libcdatetime_timestamp_set_current_time (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_set_current_time=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_set_current_time=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_set_current_time" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_set_current_time" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_set_current_time" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_get_delta_in_seconds in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_get_delta_in_seconds in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_get_delta_in_seconds+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_get_delta_in_seconds (); int main () { return libcdatetime_timestamp_get_delta_in_seconds (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_get_delta_in_seconds=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_get_delta_in_seconds=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_get_delta_in_seconds" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_get_delta_in_seconds" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_get_delta_in_seconds" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_get_string_size in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_get_string_size in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_get_string_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_get_string_size (); int main () { return libcdatetime_timestamp_get_string_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_get_string_size=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_get_string_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_get_string_size" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_get_string_size" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_get_string_size" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_copy_to_string in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_copy_to_string in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_copy_to_string (); int main () { return libcdatetime_timestamp_copy_to_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdatetime_timestamp_copy_to_string_with_index in -lcdatetime" >&5 $as_echo_n "checking for libcdatetime_timestamp_copy_to_string_with_index in -lcdatetime... " >&6; } if ${ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string_with_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcdatetime_timestamp_copy_to_string_with_index (); int main () { return libcdatetime_timestamp_copy_to_string_with_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string_with_index=yes else ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string_with_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string_with_index" >&5 $as_echo "$ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string_with_index" >&6; } if test "x$ac_cv_lib_cdatetime_libcdatetime_timestamp_copy_to_string_with_index" = xyes; then : ac_cv_libcdatetime_dummy=yes else ac_cv_libcdatetime=no fi ac_cv_libcdatetime_LIBADD="-lcdatetime" fi fi if test "x$ac_cv_with_libcdatetime" != x && test "x$ac_cv_with_libcdatetime" != xauto-detect && test "x$ac_cv_libcdatetime" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcdatetime in directory: $ac_cv_with_libcdatetime See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcdatetime" = xyes; then : $as_echo "#define HAVE_LIBCDATETIME 1" >>confdefs.h fi if test "x$ac_cv_libcdatetime" = xyes; then : HAVE_LIBCDATETIME=1 else HAVE_LIBCDATETIME=0 fi if test "x$ac_cv_libcdatetime" != xyes; then : for ac_header in errno.h do : ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERRNO_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi for ac_func in mktime do : ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" if test "x$ac_cv_func_mktime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MKTIME 1 _ACEOF fi done if test "x$ac_cv_func_mktime" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: mktime See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in ctime_r do : ac_fn_c_check_func "$LINENO" "ctime_r" "ac_cv_func_ctime_r" if test "x$ac_cv_func_ctime_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CTIME_R 1 _ACEOF fi done if test "x$ac_cv_func_ctime_r" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to use ctime_r" >&5 $as_echo_n "checking how to use ctime_r... " >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ctime_r( NULL, NULL, 0 ) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: with additional size argument" >&5 $as_echo "with additional size argument" >&6; } ac_cv_cv_ctime_r_size=yes else ac_cv_cv_ctime_r_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_cv_ctime_r_size" = xno; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ctime_r( NULL, NULL ) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: with two arguments" >&5 $as_echo "with two arguments" >&6; } ac_cv_cv_ctime_r_posix=yes else ac_cv_cv_ctime_r_posix=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$ac_cv_cv_ctime_r_posix" = xno; then : CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ctime_r( NULL, NULL ) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: with two arguments and definition _POSIX_PTHREAD_SEMANTICS" >&5 $as_echo "with two arguments and definition _POSIX_PTHREAD_SEMANTICS" >&6; } ac_cv_cv_ctime_r_posix=yes else ac_cv_cv_ctime_r_posix=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$ac_cv_cv_ctime_r_size" = xno && test "x$ac_cv_cv_ctime_r_posix" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown" >&5 $as_echo "$as_me: WARNING: unknown" >&2;} ac_cv_func_ctime_r=no fi if test "x$ac_cv_func_ctime_r" = xyes; then : $as_echo "#define HAVE_CTIME_R 1" >>confdefs.h fi if test "x$ac_cv_cv_ctime_r_size" = xyes; then : $as_echo "#define HAVE_CTIME_R_SIZE 1" >>confdefs.h fi fi if test "x$ac_cv_func_ctime_r" = xno; then : for ac_func in ctime do : ac_fn_c_check_func "$LINENO" "ctime" "ac_cv_func_ctime" if test "x$ac_cv_func_ctime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CTIME 1 _ACEOF fi done if test "x$ac_cv_func_ctime" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: ctime_r and ctime See \`config.log' for more details" "$LINENO" 5; } fi fi for ac_func in gmtime gmtime_r localtime localtime_r mktime time do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_gmtime" != xyes && test "x$ac_cv_func_gmtime_r" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: gmtime_r and gmtime See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_localtime" != xyes && test "x$ac_cv_func_localtime_r" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: localtime_r and localtime See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_mktime" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: mktime See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_time" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: time See \`config.log' for more details" "$LINENO" 5; } fi ac_cv_libcdatetime_CPPFLAGS="-I../libcdatetime"; ac_cv_libcdatetime_LIBADD="../libcdatetime/libcdatetime.la"; ac_cv_libcdatetime=local $as_echo "#define HAVE_LOCAL_LIBCDATETIME 1" >>confdefs.h HAVE_LOCAL_LIBCDATETIME=1 fi if test "x$ac_cv_libcdatetime" = xlocal; then HAVE_LOCAL_LIBCDATETIME_TRUE= HAVE_LOCAL_LIBCDATETIME_FALSE='#' else HAVE_LOCAL_LIBCDATETIME_TRUE='#' HAVE_LOCAL_LIBCDATETIME_FALSE= fi if test "x$ac_cv_libcdatetime_CPPFLAGS" != "x"; then : LIBCDATETIME_CPPFLAGS=$ac_cv_libcdatetime_CPPFLAGS fi if test "x$ac_cv_libcdatetime_LIBADD" != "x"; then : LIBCDATETIME_LIBADD=$ac_cv_libcdatetime_LIBADD fi if test "x$ac_cv_libcdatetime" = xyes; then : ax_libcdatetime_pc_libs_private=-lcdatetime fi if test "x$ac_cv_libcdatetime" = xyes; then : ax_libcdatetime_spec_requires=libcdatetime ax_libcdatetime_spec_build_requires=libcdatetime-devel fi # Check whether --with-libclocale was given. if test "${with_libclocale+set}" = set; then : withval=$with_libclocale; ac_cv_with_libclocale=$withval else ac_cv_with_libclocale=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libclocale+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libclocale=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libclocale" >&5 $as_echo "$ac_cv_with_libclocale" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libclocale" = xno; then : ac_cv_libclocale=no else ac_cv_libclocale=check if test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect; then : if test -d "$ac_cv_with_libclocale"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libclocale}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libclocale}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libclocale See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale" >&5 $as_echo_n "checking for libclocale... " >&6; } if test -n "$libclocale_CFLAGS"; then pkg_cv_libclocale_CFLAGS="$libclocale_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libclocale >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libclocale >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libclocale_CFLAGS=`$PKG_CONFIG --cflags "libclocale >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libclocale_LIBS"; then pkg_cv_libclocale_LIBS="$libclocale_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libclocale >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libclocale >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libclocale_LIBS=`$PKG_CONFIG --libs "libclocale >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libclocale_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libclocale >= 20120425" 2>&1` else libclocale_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libclocale >= 20120425" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libclocale_PKG_ERRORS" >&5 ac_cv_libclocale=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libclocale=check else libclocale_CFLAGS=$pkg_cv_libclocale_CFLAGS libclocale_LIBS=$pkg_cv_libclocale_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libclocale=yes fi fi if test "x$ac_cv_libclocale" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 $as_echo_n "checking whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } if ${ac_cv_header_libclocale_features_h_have_wide_character_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if !defined( LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE not defined #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_libclocale_features_h_have_wide_character_type=yes else ac_cv_header_libclocale_features_h_have_wide_character_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libclocale_features_h_have_wide_character_type" >&5 $as_echo "$ac_cv_header_libclocale_features_h_have_wide_character_type" >&6; } if test "x$ac_cv_header_libclocale_features_h_have_wide_character_type" = xno; then : ac_cv_libclocale=no fi fi if test "x$ac_cv_libclocale" = xyes; then : ac_cv_libclocale_CPPFLAGS="$pkg_cv_libclocale_CFLAGS" ac_cv_libclocale_LIBADD="$pkg_cv_libclocale_LIBS" fi fi if test "x$ac_cv_libclocale" = xcheck; then : for ac_header in libclocale.h do : ac_fn_c_check_header_mongrel "$LINENO" "libclocale.h" "ac_cv_header_libclocale_h" "$ac_includes_default" if test "x$ac_cv_header_libclocale_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCLOCALE_H 1 _ACEOF fi done if test "x$ac_cv_header_libclocale_h" = xno; then : ac_cv_libclocale=no else ac_cv_libclocale=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_get_version in -lclocale" >&5 $as_echo_n "checking for libclocale_get_version in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_get_version (); int main () { return libclocale_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_get_version=yes else ac_cv_lib_clocale_libclocale_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_get_version" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_get_version" >&6; } if test "x$ac_cv_lib_clocale_libclocale_get_version" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage in -lclocale" >&5 $as_echo_n "checking for libclocale_codepage in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_codepage+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_codepage (); int main () { return libclocale_codepage (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_codepage=yes else ac_cv_lib_clocale_libclocale_codepage=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_codepage" >&6; } if test "x$ac_cv_lib_clocale_libclocale_codepage" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_get in -lclocale" >&5 $as_echo_n "checking for libclocale_codepage_get in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_codepage_get+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_codepage_get (); int main () { return libclocale_codepage_get (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_codepage_get=yes else ac_cv_lib_clocale_libclocale_codepage_get=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_get" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_codepage_get" >&6; } if test "x$ac_cv_lib_clocale_libclocale_codepage_get" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_set in -lclocale" >&5 $as_echo_n "checking for libclocale_codepage_set in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_codepage_set+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_codepage_set (); int main () { return libclocale_codepage_set (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_codepage_set=yes else ac_cv_lib_clocale_libclocale_codepage_set=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_set" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_codepage_set" >&6; } if test "x$ac_cv_lib_clocale_libclocale_codepage_set" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_copy_from_string in -lclocale" >&5 $as_echo_n "checking for libclocale_codepage_copy_from_string in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_codepage_copy_from_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_codepage_copy_from_string (); int main () { return libclocale_codepage_copy_from_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_codepage_copy_from_string=yes else ac_cv_lib_clocale_libclocale_codepage_copy_from_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_copy_from_string" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_codepage_copy_from_string" >&6; } if test "x$ac_cv_lib_clocale_libclocale_codepage_copy_from_string" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_copy_from_string_wide in -lclocale" >&5 $as_echo_n "checking for libclocale_codepage_copy_from_string_wide in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_codepage_copy_from_string_wide (); int main () { return libclocale_codepage_copy_from_string_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide=yes else ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" >&6; } if test "x$ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_locale_get_codepage in -lclocale" >&5 $as_echo_n "checking for libclocale_locale_get_codepage in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_locale_get_codepage+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_locale_get_codepage (); int main () { return libclocale_locale_get_codepage (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_locale_get_codepage=yes else ac_cv_lib_clocale_libclocale_locale_get_codepage=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_locale_get_codepage" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_locale_get_codepage" >&6; } if test "x$ac_cv_lib_clocale_libclocale_locale_get_codepage" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_locale_get_decimal_point in -lclocale" >&5 $as_echo_n "checking for libclocale_locale_get_decimal_point in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_locale_get_decimal_point+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_locale_get_decimal_point (); int main () { return libclocale_locale_get_decimal_point (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_locale_get_decimal_point=yes else ac_cv_lib_clocale_libclocale_locale_get_decimal_point=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_locale_get_decimal_point" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_locale_get_decimal_point" >&6; } if test "x$ac_cv_lib_clocale_libclocale_locale_get_decimal_point" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_initialize in -lclocale" >&5 $as_echo_n "checking for libclocale_initialize in -lclocale... " >&6; } if ${ac_cv_lib_clocale_libclocale_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libclocale_initialize (); int main () { return libclocale_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_clocale_libclocale_initialize=yes else ac_cv_lib_clocale_libclocale_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_initialize" >&5 $as_echo "$ac_cv_lib_clocale_libclocale_initialize" >&6; } if test "x$ac_cv_lib_clocale_libclocale_initialize" = xyes; then : ac_cv_libclocale_dummy=yes else ac_cv_libclocale=no fi ac_cv_libclocale_LIBADD="-lclocale" fi fi if test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_libclocale" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libclocale in directory: $ac_cv_with_libclocale See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libclocale" = xyes; then : $as_echo "#define HAVE_LIBCLOCALE 1" >>confdefs.h fi if test "x$ac_cv_libclocale" = xyes; then : HAVE_LIBCLOCALE=1 else HAVE_LIBCLOCALE=0 fi if test "x$ac_cv_libclocale" != xyes; then : for ac_header in langinfo.h locale.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getenv do : ac_fn_c_check_func "$LINENO" "getenv" "ac_cv_func_getenv" if test "x$ac_cv_func_getenv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETENV 1 _ACEOF fi done if test "x$ac_cv_func_getenv" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: getenv See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_enable_winapi" = xno; then : for ac_func in localeconv do : ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv" if test "x$ac_cv_func_localeconv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALECONV 1 _ACEOF fi done if test "x$ac_cv_func_localeconv" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: localeconv See \`config.log' for more details" "$LINENO" 5; } fi fi for ac_func in setlocale do : ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" if test "x$ac_cv_func_setlocale" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETLOCALE 1 _ACEOF fi done if test "x$ac_cv_func_setlocale" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: setlocale See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in nl_langinfo do : ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" if test "x$ac_cv_func_nl_langinfo" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NL_LANGINFO 1 _ACEOF fi done if test "x$ac_cv_func_nl_langinfo" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo CODESET support" >&5 $as_echo_n "checking for nl_langinfo CODESET support... " >&6; } if ${ac_cv_cv_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char* charset = nl_langinfo( CODESET ); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_cv_langinfo_codeset=yes else ac_cv_cv_langinfo_codeset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_langinfo_codeset" >&5 $as_echo "$ac_cv_cv_langinfo_codeset" >&6; } else ac_cv_cv_langinfo_codeset=no fi if test "x$ac_cv_cv_langinfo_codeset" = xyes; then : $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h fi ac_cv_libclocale_CPPFLAGS="-I../libclocale"; ac_cv_libclocale_LIBADD="../libclocale/libclocale.la"; ac_cv_libclocale=local $as_echo "#define HAVE_LOCAL_LIBCLOCALE 1" >>confdefs.h HAVE_LOCAL_LIBCLOCALE=1 fi if test "x$ac_cv_libclocale" = xlocal; then HAVE_LOCAL_LIBCLOCALE_TRUE= HAVE_LOCAL_LIBCLOCALE_FALSE='#' else HAVE_LOCAL_LIBCLOCALE_TRUE='#' HAVE_LOCAL_LIBCLOCALE_FALSE= fi if test "x$ac_cv_libclocale_CPPFLAGS" != "x"; then : LIBCLOCALE_CPPFLAGS=$ac_cv_libclocale_CPPFLAGS fi if test "x$ac_cv_libclocale_LIBADD" != "x"; then : LIBCLOCALE_LIBADD=$ac_cv_libclocale_LIBADD fi if test "x$ac_cv_libclocale" = xyes; then : ax_libclocale_pc_libs_private=-lclocale fi if test "x$ac_cv_libclocale" = xyes; then : ax_libclocale_spec_requires=libclocale ax_libclocale_spec_build_requires=libclocale-devel fi # Check whether --with-libcnotify was given. if test "${with_libcnotify+set}" = set; then : withval=$with_libcnotify; ac_cv_with_libcnotify=$withval else ac_cv_with_libcnotify=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcnotify+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcnotify=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcnotify" >&5 $as_echo "$ac_cv_with_libcnotify" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcnotify" = xno; then : ac_cv_libcnotify=no else ac_cv_libcnotify=check if test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect; then : if test -d "$ac_cv_with_libcnotify"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcnotify}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcnotify}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcnotify See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify" >&5 $as_echo_n "checking for libcnotify... " >&6; } if test -n "$libcnotify_CFLAGS"; then pkg_cv_libcnotify_CFLAGS="$libcnotify_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcnotify >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcnotify >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcnotify_CFLAGS=`$PKG_CONFIG --cflags "libcnotify >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcnotify_LIBS"; then pkg_cv_libcnotify_LIBS="$libcnotify_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcnotify >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcnotify >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcnotify_LIBS=`$PKG_CONFIG --libs "libcnotify >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcnotify_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcnotify >= 20120425" 2>&1` else libcnotify_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcnotify >= 20120425" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcnotify_PKG_ERRORS" >&5 ac_cv_libcnotify=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcnotify=check else libcnotify_CFLAGS=$pkg_cv_libcnotify_CFLAGS libcnotify_LIBS=$pkg_cv_libcnotify_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcnotify=yes fi fi if test "x$ac_cv_libcnotify" = xyes; then : ac_cv_libcnotify_CPPFLAGS="$pkg_cv_libcnotify_CFLAGS" ac_cv_libcnotify_LIBADD="$pkg_cv_libcnotify_LIBS" fi fi if test "x$ac_cv_libcnotify" = xcheck; then : for ac_header in libcnotify.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcnotify.h" "ac_cv_header_libcnotify_h" "$ac_includes_default" if test "x$ac_cv_header_libcnotify_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCNOTIFY_H 1 _ACEOF fi done if test "x$ac_cv_header_libcnotify_h" = xno; then : ac_cv_libcnotify=no else ac_cv_libcnotify=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_get_version in -lcnotify" >&5 $as_echo_n "checking for libcnotify_get_version in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_get_version (); int main () { return libcnotify_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_get_version=yes else ac_cv_lib_cnotify_libcnotify_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_get_version" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_get_version" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_get_version" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_printf in -lcnotify" >&5 $as_echo_n "checking for libcnotify_printf in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_printf+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_printf (); int main () { return libcnotify_printf (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_printf=yes else ac_cv_lib_cnotify_libcnotify_printf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_printf" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_printf" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_printf" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_print_data in -lcnotify" >&5 $as_echo_n "checking for libcnotify_print_data in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_print_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_print_data (); int main () { return libcnotify_print_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_print_data=yes else ac_cv_lib_cnotify_libcnotify_print_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_print_data" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_print_data" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_print_data" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_print_error_backtrace in -lcnotify" >&5 $as_echo_n "checking for libcnotify_print_error_backtrace in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_print_error_backtrace+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_print_error_backtrace (); int main () { return libcnotify_print_error_backtrace (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_print_error_backtrace=yes else ac_cv_lib_cnotify_libcnotify_print_error_backtrace=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_print_error_backtrace" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_print_error_backtrace" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_print_error_backtrace" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_set in -lcnotify" >&5 $as_echo_n "checking for libcnotify_stream_set in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_stream_set+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_stream_set (); int main () { return libcnotify_stream_set (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_stream_set=yes else ac_cv_lib_cnotify_libcnotify_stream_set=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_set" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_stream_set" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_stream_set" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_open in -lcnotify" >&5 $as_echo_n "checking for libcnotify_stream_open in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_stream_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_stream_open (); int main () { return libcnotify_stream_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_stream_open=yes else ac_cv_lib_cnotify_libcnotify_stream_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_open" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_stream_open" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_stream_open" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_close in -lcnotify" >&5 $as_echo_n "checking for libcnotify_stream_close in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_stream_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_stream_close (); int main () { return libcnotify_stream_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_stream_close=yes else ac_cv_lib_cnotify_libcnotify_stream_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_close" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_stream_close" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_stream_close" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_verbose_set in -lcnotify" >&5 $as_echo_n "checking for libcnotify_verbose_set in -lcnotify... " >&6; } if ${ac_cv_lib_cnotify_libcnotify_verbose_set+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcnotify_verbose_set (); int main () { return libcnotify_verbose_set (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cnotify_libcnotify_verbose_set=yes else ac_cv_lib_cnotify_libcnotify_verbose_set=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_verbose_set" >&5 $as_echo "$ac_cv_lib_cnotify_libcnotify_verbose_set" >&6; } if test "x$ac_cv_lib_cnotify_libcnotify_verbose_set" = xyes; then : ac_cv_libcnotify_dummy=yes else ac_cv_libcnotify=no fi ac_cv_libcnotify_LIBADD="-lcnotify" fi fi if test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_libcnotify" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcnotify in directory: $ac_cv_with_libcnotify See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcnotify" = xyes; then : $as_echo "#define HAVE_LIBCNOTIFY 1" >>confdefs.h fi if test "x$ac_cv_libcnotify" = xyes; then : HAVE_LIBCNOTIFY=1 else HAVE_LIBCNOTIFY=0 fi if test "x$ac_cv_libcnotify" != xyes; then : for ac_header in stdarg.h varargs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } fi for ac_header in errno.h do : ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERRNO_H 1 _ACEOF fi done ac_cv_libcnotify_CPPFLAGS="-I../libcnotify"; ac_cv_libcnotify_LIBADD="../libcnotify/libcnotify.la"; ac_cv_libcnotify=local $as_echo "#define HAVE_LOCAL_LIBCNOTIFY 1" >>confdefs.h HAVE_LOCAL_LIBCNOTIFY=1 fi if test "x$ac_cv_libcnotify" = xlocal; then HAVE_LOCAL_LIBCNOTIFY_TRUE= HAVE_LOCAL_LIBCNOTIFY_FALSE='#' else HAVE_LOCAL_LIBCNOTIFY_TRUE='#' HAVE_LOCAL_LIBCNOTIFY_FALSE= fi if test "x$ac_cv_libcnotify_CPPFLAGS" != "x"; then : LIBCNOTIFY_CPPFLAGS=$ac_cv_libcnotify_CPPFLAGS fi if test "x$ac_cv_libcnotify_LIBADD" != "x"; then : LIBCNOTIFY_LIBADD=$ac_cv_libcnotify_LIBADD fi if test "x$ac_cv_libcnotify" = xyes; then : ax_libcnotify_pc_libs_private=-lcnotify fi if test "x$ac_cv_libcnotify" = xyes; then : ax_libcnotify_spec_requires=libcnotify ax_libcnotify_spec_build_requires=libcnotify-devel fi # Check whether --with-libcsplit was given. if test "${with_libcsplit+set}" = set; then : withval=$with_libcsplit; ac_cv_with_libcsplit=$withval else ac_cv_with_libcsplit=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcsplit+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcsplit=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcsplit" >&5 $as_echo "$ac_cv_with_libcsplit" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcsplit" = xno; then : ac_cv_libcsplit=no else ac_cv_libcsplit=check if test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect; then : if test -d "$ac_cv_with_libcsplit"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcsplit}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcsplit}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcsplit See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit" >&5 $as_echo_n "checking for libcsplit... " >&6; } if test -n "$libcsplit_CFLAGS"; then pkg_cv_libcsplit_CFLAGS="$libcsplit_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcsplit >= 20120701\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcsplit >= 20120701") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcsplit_CFLAGS=`$PKG_CONFIG --cflags "libcsplit >= 20120701" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcsplit_LIBS"; then pkg_cv_libcsplit_LIBS="$libcsplit_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcsplit >= 20120701\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcsplit >= 20120701") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcsplit_LIBS=`$PKG_CONFIG --libs "libcsplit >= 20120701" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcsplit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcsplit >= 20120701" 2>&1` else libcsplit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcsplit >= 20120701" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcsplit_PKG_ERRORS" >&5 ac_cv_libcsplit=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcsplit=check else libcsplit_CFLAGS=$pkg_cv_libcsplit_CFLAGS libcsplit_LIBS=$pkg_cv_libcsplit_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcsplit=yes fi fi if test "x$ac_cv_libcsplit" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 $as_echo_n "checking whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } if ${ac_cv_header_libcsplit_features_h_have_wide_character_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if !defined( LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE not defined #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_libcsplit_features_h_have_wide_character_type=yes else ac_cv_header_libcsplit_features_h_have_wide_character_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcsplit_features_h_have_wide_character_type" >&5 $as_echo "$ac_cv_header_libcsplit_features_h_have_wide_character_type" >&6; } if test "x$ac_cv_header_libcsplit_features_h_have_wide_character_type" = xno; then : ac_cv_libcsplit=no fi fi if test "x$ac_cv_libcsplit" = xyes; then : ac_cv_libcsplit_CPPFLAGS="$pkg_cv_libcsplit_CFLAGS" ac_cv_libcsplit_LIBADD="$pkg_cv_libcsplit_LIBS" fi fi if test "x$ac_cv_libcsplit" = xcheck; then : for ac_header in libcsplit.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcsplit.h" "ac_cv_header_libcsplit_h" "$ac_includes_default" if test "x$ac_cv_header_libcsplit_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCSPLIT_H 1 _ACEOF fi done if test "x$ac_cv_header_libcsplit_h" = xno; then : ac_cv_libcsplit=no else ac_cv_libcsplit=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_get_version in -lcsplit" >&5 $as_echo_n "checking for libcsplit_get_version in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_get_version (); int main () { return libcsplit_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_get_version=yes else ac_cv_lib_csplit_libcsplit_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_get_version" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_get_version" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_get_version" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_string_split in -lcsplit" >&5 $as_echo_n "checking for libcsplit_narrow_string_split in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_narrow_string_split+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_narrow_string_split (); int main () { return libcsplit_narrow_string_split (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_narrow_string_split=yes else ac_cv_lib_csplit_libcsplit_narrow_string_split=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_string_split" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_narrow_string_split" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_narrow_string_split" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_free in -lcsplit" >&5 $as_echo_n "checking for libcsplit_narrow_split_string_free in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_narrow_split_string_free (); int main () { return libcsplit_narrow_split_string_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_narrow_split_string_free=yes else ac_cv_lib_csplit_libcsplit_narrow_split_string_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_free" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_free" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_free" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_string in -lcsplit" >&5 $as_echo_n "checking for libcsplit_narrow_split_string_get_string in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_narrow_split_string_get_string (); int main () { return libcsplit_narrow_split_string_get_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string=yes else ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_number_of_segments in -lcsplit" >&5 $as_echo_n "checking for libcsplit_narrow_split_string_get_number_of_segments in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_narrow_split_string_get_number_of_segments (); int main () { return libcsplit_narrow_split_string_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments=yes else ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_segment_by_index in -lcsplit" >&5 $as_echo_n "checking for libcsplit_narrow_split_string_get_segment_by_index in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_narrow_split_string_get_segment_by_index (); int main () { return libcsplit_narrow_split_string_get_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index=yes else ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_set_segment_by_index in -lcsplit" >&5 $as_echo_n "checking for libcsplit_narrow_split_string_set_segment_by_index in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_narrow_split_string_set_segment_by_index (); int main () { return libcsplit_narrow_split_string_set_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index=yes else ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_string_split in -lcsplit" >&5 $as_echo_n "checking for libcsplit_wide_string_split in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_wide_string_split+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_wide_string_split (); int main () { return libcsplit_wide_string_split (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_wide_string_split=yes else ac_cv_lib_csplit_libcsplit_wide_string_split=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_string_split" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_wide_string_split" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_wide_string_split" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_free in -lcsplit" >&5 $as_echo_n "checking for libcsplit_wide_split_string_free in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_wide_split_string_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_wide_split_string_free (); int main () { return libcsplit_wide_split_string_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_wide_split_string_free=yes else ac_cv_lib_csplit_libcsplit_wide_split_string_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_free" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_free" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_free" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_string in -lcsplit" >&5 $as_echo_n "checking for libcsplit_wide_split_string_get_string in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_wide_split_string_get_string (); int main () { return libcsplit_wide_split_string_get_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_wide_split_string_get_string=yes else ac_cv_lib_csplit_libcsplit_wide_split_string_get_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_number_of_segments in -lcsplit" >&5 $as_echo_n "checking for libcsplit_wide_split_string_get_number_of_segments in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_wide_split_string_get_number_of_segments (); int main () { return libcsplit_wide_split_string_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments=yes else ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_segment_by_index in -lcsplit" >&5 $as_echo_n "checking for libcsplit_wide_split_string_get_segment_by_index in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_wide_split_string_get_segment_by_index (); int main () { return libcsplit_wide_split_string_get_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index=yes else ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_set_segment_by_index in -lcsplit" >&5 $as_echo_n "checking for libcsplit_wide_split_string_set_segment_by_index in -lcsplit... " >&6; } if ${ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcsplit_wide_split_string_set_segment_by_index (); int main () { return libcsplit_wide_split_string_set_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index=yes else ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" >&5 $as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" >&6; } if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" = xyes; then : ac_cv_libcsplit_dummy=yes else ac_cv_libcsplit=no fi fi ac_cv_libcsplit_LIBADD="-lcsplit" fi fi if test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_libcsplit" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcsplit in directory: $ac_cv_with_libcsplit See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcsplit" = xyes; then : $as_echo "#define HAVE_LIBCSPLIT 1" >>confdefs.h fi if test "x$ac_cv_libcsplit" = xyes; then : HAVE_LIBCSPLIT=1 else HAVE_LIBCSPLIT=0 fi if test "x$ac_cv_libcsplit" != xyes; then : ac_cv_libcsplit_CPPFLAGS="-I../libcsplit"; ac_cv_libcsplit_LIBADD="../libcsplit/libcsplit.la"; ac_cv_libcsplit=local $as_echo "#define HAVE_LOCAL_LIBCSPLIT 1" >>confdefs.h HAVE_LOCAL_LIBCSPLIT=1 fi if test "x$ac_cv_libcsplit" = xlocal; then HAVE_LOCAL_LIBCSPLIT_TRUE= HAVE_LOCAL_LIBCSPLIT_FALSE='#' else HAVE_LOCAL_LIBCSPLIT_TRUE='#' HAVE_LOCAL_LIBCSPLIT_FALSE= fi if test "x$ac_cv_libcsplit_CPPFLAGS" != "x"; then : LIBCSPLIT_CPPFLAGS=$ac_cv_libcsplit_CPPFLAGS fi if test "x$ac_cv_libcsplit_LIBADD" != "x"; then : LIBCSPLIT_LIBADD=$ac_cv_libcsplit_LIBADD fi if test "x$ac_cv_libcsplit" = xyes; then : ax_libcsplit_pc_libs_private=-lcsplit fi if test "x$ac_cv_libcsplit" = xyes; then : ax_libcsplit_spec_requires=libcsplit ax_libcsplit_spec_build_requires=libcsplit-devel fi # Check whether --with-libuna was given. if test "${with_libuna+set}" = set; then : withval=$with_libuna; ac_cv_with_libuna=$withval else ac_cv_with_libuna=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libuna in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libuna in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libuna+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libuna=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libuna" >&5 $as_echo "$ac_cv_with_libuna" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuna" = xno; then : ac_cv_libuna=no else ac_cv_libuna=check if test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect; then : if test -d "$ac_cv_with_libuna"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libuna}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libuna}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libuna See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna" >&5 $as_echo_n "checking for libuna... " >&6; } if test -n "$libuna_CFLAGS"; then pkg_cv_libuna_CFLAGS="$libuna_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuna >= 20181006\""; } >&5 ($PKG_CONFIG --exists --print-errors "libuna >= 20181006") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libuna_CFLAGS=`$PKG_CONFIG --cflags "libuna >= 20181006" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libuna_LIBS"; then pkg_cv_libuna_LIBS="$libuna_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuna >= 20181006\""; } >&5 ($PKG_CONFIG --exists --print-errors "libuna >= 20181006") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libuna_LIBS=`$PKG_CONFIG --libs "libuna >= 20181006" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libuna_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuna >= 20181006" 2>&1` else libuna_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuna >= 20181006" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libuna_PKG_ERRORS" >&5 ac_cv_libuna=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libuna=check else libuna_CFLAGS=$pkg_cv_libuna_CFLAGS libuna_LIBS=$pkg_cv_libuna_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libuna=yes fi fi if test "x$ac_cv_libuna" = xyes; then : ac_cv_libuna_CPPFLAGS="$pkg_cv_libuna_CFLAGS" ac_cv_libuna_LIBADD="$pkg_cv_libuna_LIBS" fi fi if test "x$ac_cv_libuna" = xcheck; then : for ac_header in libuna.h do : ac_fn_c_check_header_mongrel "$LINENO" "libuna.h" "ac_cv_header_libuna_h" "$ac_includes_default" if test "x$ac_cv_header_libuna_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBUNA_H 1 _ACEOF fi done if test "x$ac_cv_header_libuna_h" = xno; then : ac_cv_libuna=no else ac_cv_libuna=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_get_version in -luna" >&5 $as_echo_n "checking for libuna_get_version in -luna... " >&6; } if ${ac_cv_lib_una_libuna_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_get_version (); int main () { return libuna_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_get_version=yes else ac_cv_lib_una_libuna_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_get_version" >&5 $as_echo "$ac_cv_lib_una_libuna_get_version" >&6; } if test "x$ac_cv_lib_una_libuna_get_version" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_size_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base16_stream_size_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base16_stream_size_to_byte_stream (); int main () { return libuna_base16_stream_size_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream=yes else ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_copy_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base16_stream_copy_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base16_stream_copy_to_byte_stream (); int main () { return libuna_base16_stream_copy_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream=yes else ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_size_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base16_stream_size_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base16_stream_size_from_byte_stream (); int main () { return libuna_base16_stream_size_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream=yes else ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base16_stream_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base16_stream_copy_from_byte_stream (); int main () { return libuna_base16_stream_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_with_index_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base16_stream_with_index_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base16_stream_with_index_copy_from_byte_stream (); int main () { return libuna_base16_stream_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_from_base32_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_quintuplet_copy_from_base32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_quintuplet_copy_from_base32_stream (); int main () { return libuna_base32_quintuplet_copy_from_base32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream=yes else ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_to_base32_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_quintuplet_copy_to_base32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_quintuplet_copy_to_base32_stream (); int main () { return libuna_base32_quintuplet_copy_to_base32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream=yes else ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_quintuplet_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_quintuplet_copy_from_byte_stream (); int main () { return libuna_base32_quintuplet_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_quintuplet_copy_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_quintuplet_copy_to_byte_stream (); int main () { return libuna_base32_quintuplet_copy_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream=yes else ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_size_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_stream_size_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_stream_size_to_byte_stream (); int main () { return libuna_base32_stream_size_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream=yes else ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_copy_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_stream_copy_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_stream_copy_to_byte_stream (); int main () { return libuna_base32_stream_copy_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream=yes else ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_size_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_stream_size_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_stream_size_from_byte_stream (); int main () { return libuna_base32_stream_size_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream=yes else ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_stream_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_stream_copy_from_byte_stream (); int main () { return libuna_base32_stream_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_with_index_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base32_stream_with_index_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base32_stream_with_index_copy_from_byte_stream (); int main () { return libuna_base32_stream_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_from_base64_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_triplet_copy_from_base64_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_triplet_copy_from_base64_stream (); int main () { return libuna_base64_triplet_copy_from_base64_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream=yes else ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_to_base64_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_triplet_copy_to_base64_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_triplet_copy_to_base64_stream (); int main () { return libuna_base64_triplet_copy_to_base64_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream=yes else ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_triplet_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_triplet_copy_from_byte_stream (); int main () { return libuna_base64_triplet_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_triplet_copy_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_triplet_copy_to_byte_stream (); int main () { return libuna_base64_triplet_copy_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream=yes else ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_size_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_stream_size_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_stream_size_to_byte_stream (); int main () { return libuna_base64_stream_size_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream=yes else ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_copy_to_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_stream_copy_to_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_stream_copy_to_byte_stream (); int main () { return libuna_base64_stream_copy_to_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream=yes else ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_size_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_stream_size_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_stream_size_from_byte_stream (); int main () { return libuna_base64_stream_size_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream=yes else ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_stream_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_stream_copy_from_byte_stream (); int main () { return libuna_base64_stream_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_with_index_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_base64_stream_with_index_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_base64_stream_with_index_copy_from_byte_stream (); int main () { return libuna_base64_stream_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_byte_stream_size_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_byte_stream_size_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_byte_stream_size_from_utf8 (); int main () { return libuna_byte_stream_size_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_byte_stream_size_from_utf8=yes else ac_cv_lib_una_libuna_byte_stream_size_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_byte_stream_size_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_byte_stream_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_byte_stream_copy_from_utf8 (); int main () { return libuna_byte_stream_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_byte_stream_copy_from_utf8=yes else ac_cv_lib_una_libuna_byte_stream_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_byte_stream_size_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_byte_stream_size_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_byte_stream_size_from_utf16 (); int main () { return libuna_byte_stream_size_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_byte_stream_size_from_utf16=yes else ac_cv_lib_una_libuna_byte_stream_size_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_byte_stream_size_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_byte_stream_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_byte_stream_copy_from_utf16 (); int main () { return libuna_byte_stream_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_byte_stream_copy_from_utf16=yes else ac_cv_lib_una_libuna_byte_stream_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_byte_stream_size_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_byte_stream_size_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_byte_stream_size_from_utf32 (); int main () { return libuna_byte_stream_size_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_byte_stream_size_from_utf32=yes else ac_cv_lib_una_libuna_byte_stream_size_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_byte_stream_size_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_byte_stream_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_byte_stream_copy_from_utf32 (); int main () { return libuna_byte_stream_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_byte_stream_copy_from_utf32=yes else ac_cv_lib_una_libuna_byte_stream_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf8_stream_size_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_stream_size_from_utf8 (); int main () { return libuna_utf8_stream_size_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_stream_size_from_utf8=yes else ac_cv_lib_una_libuna_utf8_stream_size_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf8_stream_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_stream_copy_from_utf8 (); int main () { return libuna_utf8_stream_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8=yes else ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf8_stream_size_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_stream_size_from_utf16 (); int main () { return libuna_utf8_stream_size_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_stream_size_from_utf16=yes else ac_cv_lib_una_libuna_utf8_stream_size_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf8_stream_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_stream_copy_from_utf16 (); int main () { return libuna_utf8_stream_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf8_stream_size_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_stream_size_from_utf32 (); int main () { return libuna_utf8_stream_size_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_stream_size_from_utf32=yes else ac_cv_lib_una_libuna_utf8_stream_size_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf8_stream_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_stream_copy_from_utf32 (); int main () { return libuna_utf8_stream_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf16_stream_size_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_stream_size_from_utf8 (); int main () { return libuna_utf16_stream_size_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_stream_size_from_utf8=yes else ac_cv_lib_una_libuna_utf16_stream_size_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf16_stream_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_stream_copy_from_utf8 (); int main () { return libuna_utf16_stream_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8=yes else ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf16_stream_size_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_stream_size_from_utf16 (); int main () { return libuna_utf16_stream_size_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_stream_size_from_utf16=yes else ac_cv_lib_una_libuna_utf16_stream_size_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf16_stream_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_stream_copy_from_utf16 (); int main () { return libuna_utf16_stream_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf16_stream_size_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_stream_size_from_utf32 (); int main () { return libuna_utf16_stream_size_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_stream_size_from_utf32=yes else ac_cv_lib_una_libuna_utf16_stream_size_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf16_stream_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_stream_copy_from_utf32 (); int main () { return libuna_utf16_stream_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf32_stream_size_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_stream_size_from_utf8 (); int main () { return libuna_utf32_stream_size_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_stream_size_from_utf8=yes else ac_cv_lib_una_libuna_utf32_stream_size_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf32_stream_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_stream_copy_from_utf8 (); int main () { return libuna_utf32_stream_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8=yes else ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf32_stream_size_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_stream_size_from_utf16 (); int main () { return libuna_utf32_stream_size_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_stream_size_from_utf16=yes else ac_cv_lib_una_libuna_utf32_stream_size_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf32_stream_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_stream_copy_from_utf16 (); int main () { return libuna_utf32_stream_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf32_stream_size_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_stream_size_from_utf32 (); int main () { return libuna_utf32_stream_size_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_stream_size_from_utf32=yes else ac_cv_lib_una_libuna_utf32_stream_size_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf32_stream_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_stream_copy_from_utf32 (); int main () { return libuna_utf32_stream_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_byte_stream (); int main () { return libuna_utf8_string_size_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream=yes else ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_byte_stream (); int main () { return libuna_utf8_string_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_byte_stream (); int main () { return libuna_utf8_string_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_utf7_stream (); int main () { return libuna_utf8_string_size_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_utf7_stream (); int main () { return libuna_utf8_string_copy_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_utf7_stream (); int main () { return libuna_utf8_string_with_index_copy_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_utf8_stream (); int main () { return libuna_utf8_string_size_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_utf8_stream (); int main () { return libuna_utf8_string_copy_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_utf8_stream (); int main () { return libuna_utf8_string_with_index_copy_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_utf16_stream (); int main () { return libuna_utf8_string_size_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_utf16_stream (); int main () { return libuna_utf8_string_copy_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_utf16_stream (); int main () { return libuna_utf8_string_with_index_copy_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_utf32_stream (); int main () { return libuna_utf8_string_size_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_utf32_stream (); int main () { return libuna_utf8_string_copy_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_utf32_stream (); int main () { return libuna_utf8_string_with_index_copy_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_utf16 (); int main () { return libuna_utf8_string_size_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_utf16=yes else ac_cv_lib_una_libuna_utf8_string_size_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_utf16 (); int main () { return libuna_utf8_string_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_utf16 (); int main () { return libuna_utf8_string_with_index_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_size_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_size_from_utf32 (); int main () { return libuna_utf8_string_size_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_size_from_utf32=yes else ac_cv_lib_una_libuna_utf8_string_size_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_copy_from_utf32 (); int main () { return libuna_utf8_string_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf8_string_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf8_string_with_index_copy_from_utf32 (); int main () { return libuna_utf8_string_with_index_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_byte_stream (); int main () { return libuna_utf16_string_size_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream=yes else ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_byte_stream (); int main () { return libuna_utf16_string_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_byte_stream (); int main () { return libuna_utf16_string_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_utf7_stream (); int main () { return libuna_utf16_string_size_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_utf7_stream (); int main () { return libuna_utf16_string_copy_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_utf7_stream (); int main () { return libuna_utf16_string_with_index_copy_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_utf8_stream (); int main () { return libuna_utf16_string_size_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_utf8_stream (); int main () { return libuna_utf16_string_copy_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_utf8_stream (); int main () { return libuna_utf16_string_with_index_copy_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_utf16_stream (); int main () { return libuna_utf16_string_size_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_utf16_stream (); int main () { return libuna_utf16_string_copy_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_utf16_stream (); int main () { return libuna_utf16_string_with_index_copy_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_utf32_stream (); int main () { return libuna_utf16_string_size_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_utf32_stream (); int main () { return libuna_utf16_string_copy_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_utf32_stream (); int main () { return libuna_utf16_string_with_index_copy_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_utf8 (); int main () { return libuna_utf16_string_size_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_utf8=yes else ac_cv_lib_una_libuna_utf16_string_size_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_utf8 (); int main () { return libuna_utf16_string_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf8=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_utf8 (); int main () { return libuna_utf16_string_with_index_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_size_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_size_from_utf32 (); int main () { return libuna_utf16_string_size_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_size_from_utf32=yes else ac_cv_lib_una_libuna_utf16_string_size_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_copy_from_utf32 (); int main () { return libuna_utf16_string_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf16_string_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf32 in -luna" >&5 $as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf32 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf16_string_with_index_copy_from_utf32 (); int main () { return libuna_utf16_string_with_index_copy_from_utf32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32=yes else ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" >&5 $as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" >&6; } if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_byte_stream (); int main () { return libuna_utf32_string_size_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream=yes else ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_byte_stream (); int main () { return libuna_utf32_string_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_byte_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_with_index_copy_from_byte_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_with_index_copy_from_byte_stream (); int main () { return libuna_utf32_string_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream=yes else ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_utf7_stream (); int main () { return libuna_utf32_string_size_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_utf7_stream (); int main () { return libuna_utf32_string_copy_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf7_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf7_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_with_index_copy_from_utf7_stream (); int main () { return libuna_utf32_string_with_index_copy_from_utf7_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream=yes else ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_utf8_stream (); int main () { return libuna_utf32_string_size_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_utf8_stream (); int main () { return libuna_utf32_string_copy_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf8_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf8_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_with_index_copy_from_utf8_stream (); int main () { return libuna_utf32_string_with_index_copy_from_utf8_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream=yes else ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_utf16_stream (); int main () { return libuna_utf32_string_size_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_utf16_stream (); int main () { return libuna_utf32_string_copy_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf16_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf16_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_with_index_copy_from_utf16_stream (); int main () { return libuna_utf32_string_with_index_copy_from_utf16_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream=yes else ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_utf32_stream (); int main () { return libuna_utf32_string_size_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_utf32_stream (); int main () { return libuna_utf32_string_copy_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf32_stream in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf32_stream in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_with_index_copy_from_utf32_stream (); int main () { return libuna_utf32_string_with_index_copy_from_utf32_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream=yes else ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_utf8 (); int main () { return libuna_utf32_string_size_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_utf8=yes else ac_cv_lib_una_libuna_utf32_string_size_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf8 in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_utf8 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_utf8 (); int main () { return libuna_utf32_string_copy_from_utf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf8=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_utf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ac_cv_libuna_dummy=yes in -llibuna_utf32_string_with_index_copy_from_utf8" >&5 $as_echo_n "checking for ac_cv_libuna_dummy=yes in -llibuna_utf32_string_with_index_copy_from_utf8... " >&6; } if ${ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llibuna_utf32_string_with_index_copy_from_utf8 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ac_cv_libuna_dummy=yes (); int main () { return ac_cv_libuna_dummy=yes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes=yes else ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" >&5 $as_echo "$ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" >&6; } if test "x$ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" = xyes; then : ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_size_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_size_from_utf16 (); int main () { return libuna_utf32_string_size_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_size_from_utf16=yes else ac_cv_lib_una_libuna_utf32_string_size_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_copy_from_utf16 (); int main () { return libuna_utf32_string_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf32_string_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf16 in -luna" >&5 $as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf16 in -luna... " >&6; } if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libuna_utf32_string_with_index_copy_from_utf16 (); int main () { return libuna_utf32_string_with_index_copy_from_utf16 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16=yes else ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" >&5 $as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" >&6; } if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" = xyes; then : ac_cv_libuna_dummy=yes else ac_cv_libuna=no fi ac_cv_libuna_LIBADD="-luna" fi fi if test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_libuna" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libuna in directory: $ac_cv_with_libuna See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libuna" = xyes; then : $as_echo "#define HAVE_LIBUNA 1" >>confdefs.h fi if test "x$ac_cv_libuna" = xyes; then : HAVE_LIBUNA=1 else HAVE_LIBUNA=0 fi if test "x$ac_cv_libuna" != xyes; then : ac_cv_libuna_CPPFLAGS="-I../libuna"; ac_cv_libuna_LIBADD="../libuna/libuna.la"; ac_cv_libuna=local $as_echo "#define HAVE_LOCAL_LIBUNA 1" >>confdefs.h HAVE_LOCAL_LIBUNA=1 fi if test "x$ac_cv_libuna" = xlocal; then HAVE_LOCAL_LIBUNA_TRUE= HAVE_LOCAL_LIBUNA_FALSE='#' else HAVE_LOCAL_LIBUNA_TRUE='#' HAVE_LOCAL_LIBUNA_FALSE= fi if test "x$ac_cv_libuna_CPPFLAGS" != "x"; then : LIBUNA_CPPFLAGS=$ac_cv_libuna_CPPFLAGS fi if test "x$ac_cv_libuna_LIBADD" != "x"; then : LIBUNA_LIBADD=$ac_cv_libuna_LIBADD fi if test "x$ac_cv_libuna" = xyes; then : ax_libuna_pc_libs_private=-luna fi if test "x$ac_cv_libuna" = xyes; then : ax_libuna_spec_requires=libuna ax_libuna_spec_build_requires=libuna-devel fi # Check whether --with-libcfile was given. if test "${with_libcfile+set}" = set; then : withval=$with_libcfile; ac_cv_with_libcfile=$withval else ac_cv_with_libcfile=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcfile+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcfile=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcfile" >&5 $as_echo "$ac_cv_with_libcfile" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcfile" = xno; then : ac_cv_libcfile=no else ac_cv_libcfile=check if test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect; then : if test -d "$ac_cv_with_libcfile"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcfile}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcfile}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcfile See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile" >&5 $as_echo_n "checking for libcfile... " >&6; } if test -n "$libcfile_CFLAGS"; then pkg_cv_libcfile_CFLAGS="$libcfile_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcfile >= 20160409\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcfile >= 20160409") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcfile_CFLAGS=`$PKG_CONFIG --cflags "libcfile >= 20160409" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcfile_LIBS"; then pkg_cv_libcfile_LIBS="$libcfile_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcfile >= 20160409\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcfile >= 20160409") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcfile_LIBS=`$PKG_CONFIG --libs "libcfile >= 20160409" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcfile_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcfile >= 20160409" 2>&1` else libcfile_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcfile >= 20160409" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcfile_PKG_ERRORS" >&5 ac_cv_libcfile=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcfile=check else libcfile_CFLAGS=$pkg_cv_libcfile_CFLAGS libcfile_LIBS=$pkg_cv_libcfile_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcfile=yes fi fi if test "x$ac_cv_libcfile" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 $as_echo_n "checking whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } if ${ac_cv_header_libcfile_features_h_have_wide_character_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if !defined( LIBCFILE_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCFILE_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCFILE_HAVE_WIDE_CHARACTER_TYPE not defined #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_libcfile_features_h_have_wide_character_type=yes else ac_cv_header_libcfile_features_h_have_wide_character_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcfile_features_h_have_wide_character_type" >&5 $as_echo "$ac_cv_header_libcfile_features_h_have_wide_character_type" >&6; } if test "x$ac_cv_header_libcfile_features_h_have_wide_character_type" = xno; then : ac_cv_libcfile=no fi fi if test "x$ac_cv_libcfile" = xyes; then : ac_cv_libcfile_CPPFLAGS="$pkg_cv_libcfile_CFLAGS" ac_cv_libcfile_LIBADD="$pkg_cv_libcfile_LIBS" fi fi if test "x$ac_cv_libcfile" = xcheck; then : for ac_header in libcfile.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcfile.h" "ac_cv_header_libcfile_h" "$ac_includes_default" if test "x$ac_cv_header_libcfile_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCFILE_H 1 _ACEOF fi done if test "x$ac_cv_header_libcfile_h" = xno; then : ac_cv_libcfile=no else ac_cv_libcfile=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_get_version in -lcfile" >&5 $as_echo_n "checking for libcfile_get_version in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_get_version (); int main () { return libcfile_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_get_version=yes else ac_cv_lib_cfile_libcfile_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_get_version" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_get_version" >&6; } if test "x$ac_cv_lib_cfile_libcfile_get_version" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_initialize in -lcfile" >&5 $as_echo_n "checking for libcfile_file_initialize in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_initialize (); int main () { return libcfile_file_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_initialize=yes else ac_cv_lib_cfile_libcfile_file_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_initialize" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_initialize" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_initialize" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_free in -lcfile" >&5 $as_echo_n "checking for libcfile_file_free in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_free (); int main () { return libcfile_file_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_free=yes else ac_cv_lib_cfile_libcfile_file_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_free" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_free" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_free" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open in -lcfile" >&5 $as_echo_n "checking for libcfile_file_open in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_open (); int main () { return libcfile_file_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_open=yes else ac_cv_lib_cfile_libcfile_file_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_open" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_open" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_with_error_code in -lcfile" >&5 $as_echo_n "checking for libcfile_file_open_with_error_code in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_open_with_error_code+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_open_with_error_code (); int main () { return libcfile_file_open_with_error_code (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_open_with_error_code=yes else ac_cv_lib_cfile_libcfile_file_open_with_error_code=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_with_error_code" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_open_with_error_code" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_open_with_error_code" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_close in -lcfile" >&5 $as_echo_n "checking for libcfile_file_close in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_close (); int main () { return libcfile_file_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_close=yes else ac_cv_lib_cfile_libcfile_file_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_close" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_close" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_close" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_read_buffer in -lcfile" >&5 $as_echo_n "checking for libcfile_file_read_buffer in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_read_buffer (); int main () { return libcfile_file_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_read_buffer=yes else ac_cv_lib_cfile_libcfile_file_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_read_buffer" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_read_buffer" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_read_buffer" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_read_buffer_with_error_code in -lcfile" >&5 $as_echo_n "checking for libcfile_file_read_buffer_with_error_code in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_read_buffer_with_error_code (); int main () { return libcfile_file_read_buffer_with_error_code (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code=yes else ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_write_buffer in -lcfile" >&5 $as_echo_n "checking for libcfile_file_write_buffer in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_write_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_write_buffer (); int main () { return libcfile_file_write_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_write_buffer=yes else ac_cv_lib_cfile_libcfile_file_write_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_write_buffer" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_write_buffer" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_write_buffer" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_write_buffer_with_error_code in -lcfile" >&5 $as_echo_n "checking for libcfile_file_write_buffer_with_error_code in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_write_buffer_with_error_code (); int main () { return libcfile_file_write_buffer_with_error_code (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code=yes else ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_seek_offset in -lcfile" >&5 $as_echo_n "checking for libcfile_file_seek_offset in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_seek_offset (); int main () { return libcfile_file_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_seek_offset=yes else ac_cv_lib_cfile_libcfile_file_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_seek_offset" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_seek_offset" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_seek_offset" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_resize in -lcfile" >&5 $as_echo_n "checking for libcfile_file_resize in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_resize (); int main () { return libcfile_file_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_resize=yes else ac_cv_lib_cfile_libcfile_file_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_resize" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_resize" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_resize" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_is_open in -lcfile" >&5 $as_echo_n "checking for libcfile_file_is_open in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_is_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_is_open (); int main () { return libcfile_file_is_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_is_open=yes else ac_cv_lib_cfile_libcfile_file_is_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_is_open" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_is_open" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_is_open" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_get_offset in -lcfile" >&5 $as_echo_n "checking for libcfile_file_get_offset in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_get_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_get_offset (); int main () { return libcfile_file_get_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_get_offset=yes else ac_cv_lib_cfile_libcfile_file_get_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_get_offset" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_get_offset" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_get_offset" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_get_size in -lcfile" >&5 $as_echo_n "checking for libcfile_file_get_size in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_get_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_get_size (); int main () { return libcfile_file_get_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_get_size=yes else ac_cv_lib_cfile_libcfile_file_get_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_get_size" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_get_size" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_get_size" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_is_device in -lcfile" >&5 $as_echo_n "checking for libcfile_file_is_device in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_is_device+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_is_device (); int main () { return libcfile_file_is_device (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_is_device=yes else ac_cv_lib_cfile_libcfile_file_is_device=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_is_device" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_is_device" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_is_device" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_io_control_read in -lcfile" >&5 $as_echo_n "checking for libcfile_file_io_control_read in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_io_control_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_io_control_read (); int main () { return libcfile_file_io_control_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_io_control_read=yes else ac_cv_lib_cfile_libcfile_file_io_control_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_io_control_read" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_io_control_read" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_io_control_read" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_io_control_read_with_error_code in -lcfile" >&5 $as_echo_n "checking for libcfile_file_io_control_read_with_error_code in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_io_control_read_with_error_code (); int main () { return libcfile_file_io_control_read_with_error_code (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code=yes else ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_wide in -lcfile" >&5 $as_echo_n "checking for libcfile_file_open_wide in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_open_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_open_wide (); int main () { return libcfile_file_open_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_open_wide=yes else ac_cv_lib_cfile_libcfile_file_open_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_wide" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_open_wide" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_open_wide" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_wide_with_error_code in -lcfile" >&5 $as_echo_n "checking for libcfile_file_open_wide_with_error_code in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_open_wide_with_error_code (); int main () { return libcfile_file_open_wide_with_error_code (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code=yes else ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_exists in -lcfile" >&5 $as_echo_n "checking for libcfile_file_exists in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_exists+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_exists (); int main () { return libcfile_file_exists (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_exists=yes else ac_cv_lib_cfile_libcfile_file_exists=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_exists" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_exists" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_exists" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_remove in -lcfile" >&5 $as_echo_n "checking for libcfile_file_remove in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_remove (); int main () { return libcfile_file_remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_remove=yes else ac_cv_lib_cfile_libcfile_file_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_remove" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_remove" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_remove" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_exists_wide in -lcfile" >&5 $as_echo_n "checking for libcfile_file_exists_wide in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_exists_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_exists_wide (); int main () { return libcfile_file_exists_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_exists_wide=yes else ac_cv_lib_cfile_libcfile_file_exists_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_exists_wide" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_exists_wide" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_exists_wide" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_remove_wide in -lcfile" >&5 $as_echo_n "checking for libcfile_file_remove_wide in -lcfile... " >&6; } if ${ac_cv_lib_cfile_libcfile_file_remove_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcfile_file_remove_wide (); int main () { return libcfile_file_remove_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfile_libcfile_file_remove_wide=yes else ac_cv_lib_cfile_libcfile_file_remove_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_remove_wide" >&5 $as_echo "$ac_cv_lib_cfile_libcfile_file_remove_wide" >&6; } if test "x$ac_cv_lib_cfile_libcfile_file_remove_wide" = xyes; then : ac_cv_libcfile_dummy=yes else ac_cv_libcfile=no fi fi ac_cv_libcfile_LIBADD="-lcfile" fi fi if test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_libcfile" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcfile in directory: $ac_cv_with_libcfile See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcfile" = xyes; then : $as_echo "#define HAVE_LIBCFILE 1" >>confdefs.h fi if test "x$ac_cv_libcfile" = xyes; then : HAVE_LIBCFILE=1 else HAVE_LIBCFILE=0 fi if test "x$ac_cv_libcfile" != xyes; then : for ac_header in errno.h stdio.h sys/stat.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in cygwin/fs.h fcntl.h linux/fs.h sys/disk.h sys/disklabel.h sys/ioctl.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in close fstat ftruncate ioctl lseek open read write do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_close" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: close See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in posix_fadvise do : ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" if test "x$ac_cv_func_posix_fadvise" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POSIX_FADVISE 1 _ACEOF fi done if test "x$ac_cv_func_posix_fadvise" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_fadvise can be linked" >&5 $as_echo_n "checking whether posix_fadvise can be linked... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if !defined( POSIX_FADV_SEQUENTIAL ) #define POSIX_FADV_SEQUENTIAL 2 #endif posix_fadvise( 0, 0, 0, POSIX_FADV_SEQUENTIAL ) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_posix_fadvise=yes else ac_cv_func_posix_fadvise=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$SAVE_CFLAGS" if test "x$ac_cv_func_posix_fadvise" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_FADVISE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$ac_cv_func_fstat" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fstat See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_ftruncate" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: ftruncate See \`config.log' for more details" "$LINENO" 5; } fi if test x"$ac_cv_enable_winapi" = xno; then : if test "x$ac_cv_func_ioctl" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: ioctl See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_func_lseek" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: lseek See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_open" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: open See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_read" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: read See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_write" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: write See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in stat unlink do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_stat" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: stat See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_unlink" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: unlink See \`config.log' for more details" "$LINENO" 5; } fi ac_cv_libcfile_CPPFLAGS="-I../libcfile"; ac_cv_libcfile_LIBADD="../libcfile/libcfile.la"; ac_cv_libcfile=local $as_echo "#define HAVE_LOCAL_LIBCFILE 1" >>confdefs.h HAVE_LOCAL_LIBCFILE=1 fi if test "x$ac_cv_libcfile" = xlocal; then HAVE_LOCAL_LIBCFILE_TRUE= HAVE_LOCAL_LIBCFILE_FALSE='#' else HAVE_LOCAL_LIBCFILE_TRUE='#' HAVE_LOCAL_LIBCFILE_FALSE= fi if test "x$ac_cv_libcfile_CPPFLAGS" != "x"; then : LIBCFILE_CPPFLAGS=$ac_cv_libcfile_CPPFLAGS fi if test "x$ac_cv_libcfile_LIBADD" != "x"; then : LIBCFILE_LIBADD=$ac_cv_libcfile_LIBADD fi if test "x$ac_cv_libcfile" = xyes; then : ax_libcfile_pc_libs_private=-lcfile fi if test "x$ac_cv_libcfile" = xyes; then : ax_libcfile_spec_requires=libcfile ax_libcfile_spec_build_requires=libcfile-devel fi # Check whether --with-libcpath was given. if test "${with_libcpath+set}" = set; then : withval=$with_libcpath; ac_cv_with_libcpath=$withval else ac_cv_with_libcpath=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libcpath+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libcpath=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcpath" >&5 $as_echo "$ac_cv_with_libcpath" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcpath" = xno; then : ac_cv_libcpath=no else ac_cv_libcpath=check if test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect; then : if test -d "$ac_cv_with_libcpath"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libcpath}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcpath}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcpath See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath" >&5 $as_echo_n "checking for libcpath... " >&6; } if test -n "$libcpath_CFLAGS"; then pkg_cv_libcpath_CFLAGS="$libcpath_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcpath >= 20180716\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcpath >= 20180716") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcpath_CFLAGS=`$PKG_CONFIG --cflags "libcpath >= 20180716" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcpath_LIBS"; then pkg_cv_libcpath_LIBS="$libcpath_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcpath >= 20180716\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcpath >= 20180716") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcpath_LIBS=`$PKG_CONFIG --libs "libcpath >= 20180716" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcpath_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcpath >= 20180716" 2>&1` else libcpath_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcpath >= 20180716" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcpath_PKG_ERRORS" >&5 ac_cv_libcpath=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcpath=check else libcpath_CFLAGS=$pkg_cv_libcpath_CFLAGS libcpath_LIBS=$pkg_cv_libcpath_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcpath=yes fi fi if test "x$ac_cv_libcpath" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 $as_echo_n "checking whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } if ${ac_cv_header_libcpath_features_h_have_wide_character_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if !defined( LIBCPATH_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCPATH_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCPATH_HAVE_WIDE_CHARACTER_TYPE not defined #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_libcpath_features_h_have_wide_character_type=yes else ac_cv_header_libcpath_features_h_have_wide_character_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcpath_features_h_have_wide_character_type" >&5 $as_echo "$ac_cv_header_libcpath_features_h_have_wide_character_type" >&6; } if test "x$ac_cv_header_libcpath_features_h_have_wide_character_type" = xno; then : ac_cv_libcpath=no fi fi if test "x$ac_cv_libcpath" = xyes; then : ac_cv_libcpath_CPPFLAGS="$pkg_cv_libcpath_CFLAGS" ac_cv_libcpath_LIBADD="$pkg_cv_libcpath_LIBS" fi fi if test "x$ac_cv_libcpath" = xcheck; then : for ac_header in libcpath.h do : ac_fn_c_check_header_mongrel "$LINENO" "libcpath.h" "ac_cv_header_libcpath_h" "$ac_includes_default" if test "x$ac_cv_header_libcpath_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCPATH_H 1 _ACEOF fi done if test "x$ac_cv_header_libcpath_h" = xno; then : ac_cv_libcpath=no else ac_cv_libcpath=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_get_version in -lcpath" >&5 $as_echo_n "checking for libcpath_get_version in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_get_version (); int main () { return libcpath_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_get_version=yes else ac_cv_lib_cpath_libcpath_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_get_version" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_get_version" >&6; } if test "x$ac_cv_lib_cpath_libcpath_get_version" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_change_directory in -lcpath" >&5 $as_echo_n "checking for libcpath_path_change_directory in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_change_directory+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_change_directory (); int main () { return libcpath_path_change_directory (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_change_directory=yes else ac_cv_lib_cpath_libcpath_path_change_directory=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_change_directory" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_change_directory" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_change_directory" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_current_working_directory in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_current_working_directory in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_current_working_directory+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_current_working_directory (); int main () { return libcpath_path_get_current_working_directory (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_current_working_directory=yes else ac_cv_lib_cpath_libcpath_path_get_current_working_directory=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_current_working_directory" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_current_working_directory" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_current_working_directory" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_full_path in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_full_path in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_full_path+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_full_path (); int main () { return libcpath_path_get_full_path (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_full_path=yes else ac_cv_lib_cpath_libcpath_path_get_full_path=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_full_path" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_full_path" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_full_path" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_filename in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_sanitized_filename in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_filename+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_sanitized_filename (); int main () { return libcpath_path_get_sanitized_filename (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_sanitized_filename=yes else ac_cv_lib_cpath_libcpath_path_get_sanitized_filename=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_path in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_sanitized_path in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_path+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_sanitized_path (); int main () { return libcpath_path_get_sanitized_path (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_sanitized_path=yes else ac_cv_lib_cpath_libcpath_path_get_sanitized_path=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_path" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_path" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_path" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_join in -lcpath" >&5 $as_echo_n "checking for libcpath_path_join in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_join+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_join (); int main () { return libcpath_path_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_join=yes else ac_cv_lib_cpath_libcpath_path_join=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_join" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_join" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_join" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_make_directory in -lcpath" >&5 $as_echo_n "checking for libcpath_path_make_directory in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_make_directory+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_make_directory (); int main () { return libcpath_path_make_directory (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_make_directory=yes else ac_cv_lib_cpath_libcpath_path_make_directory=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_make_directory" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_make_directory" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_make_directory" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_change_directory_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_change_directory_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_change_directory_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_change_directory_wide (); int main () { return libcpath_path_change_directory_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_change_directory_wide=yes else ac_cv_lib_cpath_libcpath_path_change_directory_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_change_directory_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_change_directory_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_change_directory_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_current_working_directory_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_current_working_directory_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_current_working_directory_wide (); int main () { return libcpath_path_get_current_working_directory_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide=yes else ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_full_path_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_full_path_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_full_path_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_full_path_wide (); int main () { return libcpath_path_get_full_path_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_full_path_wide=yes else ac_cv_lib_cpath_libcpath_path_get_full_path_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_full_path_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_full_path_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_full_path_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_filename_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_sanitized_filename_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_sanitized_filename_wide (); int main () { return libcpath_path_get_sanitized_filename_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide=yes else ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_path_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_get_sanitized_path_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_get_sanitized_path_wide (); int main () { return libcpath_path_get_sanitized_path_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide=yes else ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_join_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_join_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_join_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_join_wide (); int main () { return libcpath_path_join_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_join_wide=yes else ac_cv_lib_cpath_libcpath_path_join_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_join_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_join_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_join_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_make_directory_wide in -lcpath" >&5 $as_echo_n "checking for libcpath_path_make_directory_wide in -lcpath... " >&6; } if ${ac_cv_lib_cpath_libcpath_path_make_directory_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libcpath_path_make_directory_wide (); int main () { return libcpath_path_make_directory_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cpath_libcpath_path_make_directory_wide=yes else ac_cv_lib_cpath_libcpath_path_make_directory_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_make_directory_wide" >&5 $as_echo "$ac_cv_lib_cpath_libcpath_path_make_directory_wide" >&6; } if test "x$ac_cv_lib_cpath_libcpath_path_make_directory_wide" = xyes; then : ac_cv_libcpath_dummy=yes else ac_cv_libcpath=no fi fi ac_cv_libcpath_LIBADD="-lcpath" fi fi if test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_libcpath" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcpath in directory: $ac_cv_with_libcpath See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libcpath" = xyes; then : $as_echo "#define HAVE_LIBCPATH 1" >>confdefs.h fi if test "x$ac_cv_libcpath" = xyes; then : HAVE_LIBCPATH=1 else HAVE_LIBCPATH=0 fi if test "x$ac_cv_libcpath" != xyes; then : for ac_header in errno.h sys/stat.h sys/syslimits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in chdir getcwd do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_chdir" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: chdir See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_getcwd" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: getcwd See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in mkdir do : ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MKDIR 1 _ACEOF fi done if test "x$ac_cv_func_mkdir" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to use mkdir" >&5 $as_echo_n "checking how to use mkdir... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { mkdir( "", 0 ) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: with additional mode argument" >&5 $as_echo "with additional mode argument" >&6; } ac_cv_cv_mkdir_mode=yes else ac_cv_cv_mkdir_mode=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_cv_mkdir_mode" = xno; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { mkdir( "" ) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: with single argument" >&5 $as_echo "with single argument" >&6; } ac_cv_cv_mkdir=yes else ac_cv_cv_mkdir=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$SAVE_CFLAGS" if test "x$ac_cv_cv_mkdir_mode" = xno && test "x$ac_cv_cv_mkdir" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown" >&5 $as_echo "$as_me: WARNING: unknown" >&2;} ac_cv_func_mkdir=no fi if test "x$ac_cv_func_mkdir" = xyes; then : $as_echo "#define HAVE_MKDIR 1" >>confdefs.h fi if test "x$ac_cv_cv_mkdir_mode" = xyes; then : $as_echo "#define HAVE_MKDIR_MODE 1" >>confdefs.h fi fi if test "x$ac_cv_func_mkdir" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: mkdir See \`config.log' for more details" "$LINENO" 5; } fi ac_cv_libcpath_CPPFLAGS="-I../libcpath"; ac_cv_libcpath_LIBADD="../libcpath/libcpath.la"; ac_cv_libcpath=local $as_echo "#define HAVE_LOCAL_LIBCPATH 1" >>confdefs.h HAVE_LOCAL_LIBCPATH=1 fi if test "x$ac_cv_libcpath" = xlocal; then HAVE_LOCAL_LIBCPATH_TRUE= HAVE_LOCAL_LIBCPATH_FALSE='#' else HAVE_LOCAL_LIBCPATH_TRUE='#' HAVE_LOCAL_LIBCPATH_FALSE= fi if test "x$ac_cv_libcpath_CPPFLAGS" != "x"; then : LIBCPATH_CPPFLAGS=$ac_cv_libcpath_CPPFLAGS fi if test "x$ac_cv_libcpath_LIBADD" != "x"; then : LIBCPATH_LIBADD=$ac_cv_libcpath_LIBADD fi if test "x$ac_cv_libcpath" = xyes; then : ax_libcpath_pc_libs_private=-lcpath fi if test "x$ac_cv_libcpath" = xyes; then : ax_libcpath_spec_requires=libcpath ax_libcpath_spec_build_requires=libcpath-devel fi # Check whether --with-libbfio was given. if test "${with_libbfio+set}" = set; then : withval=$with_libbfio; ac_cv_with_libbfio=$withval else ac_cv_with_libbfio=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libbfio+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libbfio=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libbfio" >&5 $as_echo "$ac_cv_with_libbfio" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libbfio" = xno; then : ac_cv_libbfio=no else ac_cv_libbfio=check if test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect; then : if test -d "$ac_cv_with_libbfio"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libbfio}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libbfio}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libbfio See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio" >&5 $as_echo_n "checking for libbfio... " >&6; } if test -n "$libbfio_CFLAGS"; then pkg_cv_libbfio_CFLAGS="$libbfio_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbfio >= 20160108\""; } >&5 ($PKG_CONFIG --exists --print-errors "libbfio >= 20160108") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libbfio_CFLAGS=`$PKG_CONFIG --cflags "libbfio >= 20160108" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libbfio_LIBS"; then pkg_cv_libbfio_LIBS="$libbfio_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbfio >= 20160108\""; } >&5 ($PKG_CONFIG --exists --print-errors "libbfio >= 20160108") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libbfio_LIBS=`$PKG_CONFIG --libs "libbfio >= 20160108" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libbfio_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libbfio >= 20160108" 2>&1` else libbfio_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libbfio >= 20160108" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libbfio_PKG_ERRORS" >&5 ac_cv_libbfio=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libbfio=check else libbfio_CFLAGS=$pkg_cv_libbfio_CFLAGS libbfio_LIBS=$pkg_cv_libbfio_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libbfio=yes fi fi if test "x$ac_cv_libbfio" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 $as_echo_n "checking whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } if ${ac_cv_header_libbfio_features_h_have_wide_character_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if !defined( LIBBFIO_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBBFIO_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBBFIO_HAVE_WIDE_CHARACTER_TYPE not defined #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_libbfio_features_h_have_wide_character_type=yes else ac_cv_header_libbfio_features_h_have_wide_character_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libbfio_features_h_have_wide_character_type" >&5 $as_echo "$ac_cv_header_libbfio_features_h_have_wide_character_type" >&6; } if test "x$ac_cv_header_libbfio_features_h_have_wide_character_type" = xno; then : ac_cv_libbfio=no fi fi if test "x$ac_cv_libbfio" = xyes; then : ac_cv_libbfio_CPPFLAGS="$pkg_cv_libbfio_CFLAGS" ac_cv_libbfio_LIBADD="$pkg_cv_libbfio_LIBS" fi fi if test "x$ac_cv_libbfio" = xcheck; then : for ac_header in libbfio.h do : ac_fn_c_check_header_mongrel "$LINENO" "libbfio.h" "ac_cv_header_libbfio_h" "$ac_includes_default" if test "x$ac_cv_header_libbfio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBBFIO_H 1 _ACEOF fi done if test "x$ac_cv_header_libbfio_h" = xno; then : ac_cv_libbfio=no else ac_cv_libbfio=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_get_version in -lbfio" >&5 $as_echo_n "checking for libbfio_get_version in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_get_version (); int main () { return libbfio_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_get_version=yes else ac_cv_lib_bfio_libbfio_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_get_version" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_get_version" >&6; } if test "x$ac_cv_lib_bfio_libbfio_get_version" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_free in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_free in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_free (); int main () { return libbfio_handle_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_free=yes else ac_cv_lib_bfio_libbfio_handle_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_free" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_free" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_free" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_open in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_open in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_open (); int main () { return libbfio_handle_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_open=yes else ac_cv_lib_bfio_libbfio_handle_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_open" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_open" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_open" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_close in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_close in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_close (); int main () { return libbfio_handle_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_close=yes else ac_cv_lib_bfio_libbfio_handle_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_close" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_close" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_close" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_exists in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_exists in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_exists+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_exists (); int main () { return libbfio_handle_exists (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_exists=yes else ac_cv_lib_bfio_libbfio_handle_exists=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_exists" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_exists" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_exists" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_read_buffer in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_read_buffer in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_read_buffer (); int main () { return libbfio_handle_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_read_buffer=yes else ac_cv_lib_bfio_libbfio_handle_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_read_buffer" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_read_buffer" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_read_buffer" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_write_buffer in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_write_buffer in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_write_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_write_buffer (); int main () { return libbfio_handle_write_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_write_buffer=yes else ac_cv_lib_bfio_libbfio_handle_write_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_write_buffer" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_write_buffer" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_write_buffer" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_seek_offset in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_seek_offset in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_seek_offset (); int main () { return libbfio_handle_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_seek_offset=yes else ac_cv_lib_bfio_libbfio_handle_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_seek_offset" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_seek_offset" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_seek_offset" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_is_open in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_is_open in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_is_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_is_open (); int main () { return libbfio_handle_is_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_is_open=yes else ac_cv_lib_bfio_libbfio_handle_is_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_is_open" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_is_open" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_is_open" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_offset in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_get_offset in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_get_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_get_offset (); int main () { return libbfio_handle_get_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_get_offset=yes else ac_cv_lib_bfio_libbfio_handle_get_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_offset" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_get_offset" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_get_offset" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_size in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_get_size in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_get_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_get_size (); int main () { return libbfio_handle_get_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_get_size=yes else ac_cv_lib_bfio_libbfio_handle_get_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_size" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_get_size" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_get_size" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_set_track_offsets_read in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_set_track_offsets_read in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_set_track_offsets_read (); int main () { return libbfio_handle_set_track_offsets_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read=yes else ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_number_of_offsets_read in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_get_number_of_offsets_read in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_get_number_of_offsets_read (); int main () { return libbfio_handle_get_number_of_offsets_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read=yes else ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_offset_read in -lbfio" >&5 $as_echo_n "checking for libbfio_handle_get_offset_read in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_handle_get_offset_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_handle_get_offset_read (); int main () { return libbfio_handle_get_offset_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_handle_get_offset_read=yes else ac_cv_lib_bfio_libbfio_handle_get_offset_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_offset_read" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_handle_get_offset_read" >&6; } if test "x$ac_cv_lib_bfio_libbfio_handle_get_offset_read" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_initialize in -lbfio" >&5 $as_echo_n "checking for libbfio_file_initialize in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_initialize (); int main () { return libbfio_file_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_initialize=yes else ac_cv_lib_bfio_libbfio_file_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_initialize" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_initialize" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_initialize" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_size in -lbfio" >&5 $as_echo_n "checking for libbfio_file_get_name_size in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_get_name_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_get_name_size (); int main () { return libbfio_file_get_name_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_get_name_size=yes else ac_cv_lib_bfio_libbfio_file_get_name_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_size" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_get_name_size" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_get_name_size" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name in -lbfio" >&5 $as_echo_n "checking for libbfio_file_get_name in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_get_name+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_get_name (); int main () { return libbfio_file_get_name (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_get_name=yes else ac_cv_lib_bfio_libbfio_file_get_name=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_get_name" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_get_name" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_set_name in -lbfio" >&5 $as_echo_n "checking for libbfio_file_set_name in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_set_name+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_set_name (); int main () { return libbfio_file_set_name (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_set_name=yes else ac_cv_lib_bfio_libbfio_file_set_name=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_set_name" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_set_name" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_set_name" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_size_wide in -lbfio" >&5 $as_echo_n "checking for libbfio_file_get_name_size_wide in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_get_name_size_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_get_name_size_wide (); int main () { return libbfio_file_get_name_size_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_get_name_size_wide=yes else ac_cv_lib_bfio_libbfio_file_get_name_size_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_size_wide" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_get_name_size_wide" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_get_name_size_wide" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_wide in -lbfio" >&5 $as_echo_n "checking for libbfio_file_get_name_wide in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_get_name_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_get_name_wide (); int main () { return libbfio_file_get_name_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_get_name_wide=yes else ac_cv_lib_bfio_libbfio_file_get_name_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_wide" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_get_name_wide" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_get_name_wide" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_set_name_wide in -lbfio" >&5 $as_echo_n "checking for libbfio_file_set_name_wide in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_file_set_name_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_file_set_name_wide (); int main () { return libbfio_file_set_name_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_file_set_name_wide=yes else ac_cv_lib_bfio_libbfio_file_set_name_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_set_name_wide" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_file_set_name_wide" >&6; } if test "x$ac_cv_lib_bfio_libbfio_file_set_name_wide" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_initialize in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_initialize in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_initialize (); int main () { return libbfio_pool_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_initialize=yes else ac_cv_lib_bfio_libbfio_pool_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_initialize" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_initialize" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_initialize" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_free in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_free in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_free (); int main () { return libbfio_pool_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_free=yes else ac_cv_lib_bfio_libbfio_pool_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_free" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_free" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_free" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_clone in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_clone in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_clone (); int main () { return libbfio_pool_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_clone=yes else ac_cv_lib_bfio_libbfio_pool_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_clone" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_clone" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_clone" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_number_of_handles in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_get_number_of_handles in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_get_number_of_handles+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_get_number_of_handles (); int main () { return libbfio_pool_get_number_of_handles (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_get_number_of_handles=yes else ac_cv_lib_bfio_libbfio_pool_get_number_of_handles=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_handle in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_get_handle in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_get_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_get_handle (); int main () { return libbfio_pool_get_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_get_handle=yes else ac_cv_lib_bfio_libbfio_pool_get_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_handle" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_get_handle" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_get_handle" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_set_handle in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_set_handle in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_set_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_set_handle (); int main () { return libbfio_pool_set_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_set_handle=yes else ac_cv_lib_bfio_libbfio_pool_set_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_set_handle" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_set_handle" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_set_handle" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_append_handle in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_append_handle in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_append_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_append_handle (); int main () { return libbfio_pool_append_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_append_handle=yes else ac_cv_lib_bfio_libbfio_pool_append_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_append_handle" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_append_handle" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_append_handle" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_remove_handle in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_remove_handle in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_remove_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_remove_handle (); int main () { return libbfio_pool_remove_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_remove_handle=yes else ac_cv_lib_bfio_libbfio_pool_remove_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_remove_handle" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_remove_handle" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_remove_handle" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_maximum_number_of_open_handles in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_get_maximum_number_of_open_handles in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_get_maximum_number_of_open_handles (); int main () { return libbfio_pool_get_maximum_number_of_open_handles (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles=yes else ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_set_maximum_number_of_open_handles in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_set_maximum_number_of_open_handles in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_set_maximum_number_of_open_handles (); int main () { return libbfio_pool_set_maximum_number_of_open_handles (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles=yes else ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_open in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_open in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_open (); int main () { return libbfio_pool_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_open=yes else ac_cv_lib_bfio_libbfio_pool_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_open" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_open" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_open" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_reopen in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_reopen in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_reopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_reopen (); int main () { return libbfio_pool_reopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_reopen=yes else ac_cv_lib_bfio_libbfio_pool_reopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_reopen" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_reopen" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_reopen" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_close in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_close in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_close (); int main () { return libbfio_pool_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_close=yes else ac_cv_lib_bfio_libbfio_pool_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_close" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_close" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_close" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_close_all in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_close_all in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_close_all+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_close_all (); int main () { return libbfio_pool_close_all (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_close_all=yes else ac_cv_lib_bfio_libbfio_pool_close_all=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_close_all" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_close_all" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_close_all" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_read_buffer in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_read_buffer in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_read_buffer (); int main () { return libbfio_pool_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_read_buffer=yes else ac_cv_lib_bfio_libbfio_pool_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_read_buffer" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_read_buffer" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_read_buffer" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_write_buffer in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_write_buffer in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_write_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_write_buffer (); int main () { return libbfio_pool_write_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_write_buffer=yes else ac_cv_lib_bfio_libbfio_pool_write_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_write_buffer" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_write_buffer" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_write_buffer" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_seek_offset in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_seek_offset in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_seek_offset (); int main () { return libbfio_pool_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_seek_offset=yes else ac_cv_lib_bfio_libbfio_pool_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_seek_offset" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_seek_offset" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_seek_offset" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_offset in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_get_offset in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_get_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_get_offset (); int main () { return libbfio_pool_get_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_get_offset=yes else ac_cv_lib_bfio_libbfio_pool_get_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_offset" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_get_offset" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_get_offset" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_size in -lbfio" >&5 $as_echo_n "checking for libbfio_pool_get_size in -lbfio... " >&6; } if ${ac_cv_lib_bfio_libbfio_pool_get_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libbfio_pool_get_size (); int main () { return libbfio_pool_get_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bfio_libbfio_pool_get_size=yes else ac_cv_lib_bfio_libbfio_pool_get_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_size" >&5 $as_echo "$ac_cv_lib_bfio_libbfio_pool_get_size" >&6; } if test "x$ac_cv_lib_bfio_libbfio_pool_get_size" = xyes; then : ac_cv_libbfio_dummy=yes else ac_cv_libbfio=no fi ac_cv_libbfio_LIBADD="-lbfio" fi fi if test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_libbfio" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libbfio in directory: $ac_cv_with_libbfio See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libbfio" = xyes; then : $as_echo "#define HAVE_LIBBFIO 1" >>confdefs.h fi if test "x$ac_cv_libbfio" = xyes; then : HAVE_LIBBFIO=1 else HAVE_LIBBFIO=0 fi if test "x$ac_cv_libbfio" != xyes; then : ac_cv_libbfio_CPPFLAGS="-I../libbfio"; ac_cv_libbfio_LIBADD="../libbfio/libbfio.la"; ac_cv_libbfio=local $as_echo "#define HAVE_LOCAL_LIBBFIO 1" >>confdefs.h HAVE_LOCAL_LIBBFIO=1 fi if test "x$ac_cv_libbfio" = xlocal; then HAVE_LOCAL_LIBBFIO_TRUE= HAVE_LOCAL_LIBBFIO_FALSE='#' else HAVE_LOCAL_LIBBFIO_TRUE='#' HAVE_LOCAL_LIBBFIO_FALSE= fi if test "x$ac_cv_libbfio_CPPFLAGS" != "x"; then : LIBBFIO_CPPFLAGS=$ac_cv_libbfio_CPPFLAGS fi if test "x$ac_cv_libbfio_LIBADD" != "x"; then : LIBBFIO_LIBADD=$ac_cv_libbfio_LIBADD fi if test "x$ac_cv_libbfio" = xyes; then : ax_libbfio_pc_libs_private=-lbfio fi if test "x$ac_cv_libbfio" = xyes; then : ax_libbfio_spec_requires=libbfio ax_libbfio_spec_build_requires=libbfio-devel fi # Check whether --with-libfcache was given. if test "${with_libfcache+set}" = set; then : withval=$with_libfcache; ac_cv_with_libfcache=$withval else ac_cv_with_libfcache=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libfcache+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libfcache=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfcache" >&5 $as_echo "$ac_cv_with_libfcache" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfcache" = xno; then : ac_cv_libfcache=no else ac_cv_libfcache=check if test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect; then : if test -d "$ac_cv_with_libfcache"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libfcache}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfcache}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libfcache See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache" >&5 $as_echo_n "checking for libfcache... " >&6; } if test -n "$libfcache_CFLAGS"; then pkg_cv_libfcache_CFLAGS="$libfcache_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfcache >= 20181010\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfcache >= 20181010") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfcache_CFLAGS=`$PKG_CONFIG --cflags "libfcache >= 20181010" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libfcache_LIBS"; then pkg_cv_libfcache_LIBS="$libfcache_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfcache >= 20181010\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfcache >= 20181010") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfcache_LIBS=`$PKG_CONFIG --libs "libfcache >= 20181010" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libfcache_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfcache >= 20181010" 2>&1` else libfcache_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfcache >= 20181010" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libfcache_PKG_ERRORS" >&5 ac_cv_libfcache=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libfcache=check else libfcache_CFLAGS=$pkg_cv_libfcache_CFLAGS libfcache_LIBS=$pkg_cv_libfcache_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libfcache=yes fi fi if test "x$ac_cv_libfcache" = xyes; then : ac_cv_libfcache_CPPFLAGS="$pkg_cv_libfcache_CFLAGS" ac_cv_libfcache_LIBADD="$pkg_cv_libfcache_LIBS" fi fi if test "x$ac_cv_libfcache" = xcheck; then : for ac_header in libfcache.h do : ac_fn_c_check_header_mongrel "$LINENO" "libfcache.h" "ac_cv_header_libfcache_h" "$ac_includes_default" if test "x$ac_cv_header_libfcache_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFCACHE_H 1 _ACEOF fi done if test "x$ac_cv_header_libfcache_h" = xno; then : ac_cv_libfcache=no else ac_cv_libfcache=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_get_version in -lfcache" >&5 $as_echo_n "checking for libfcache_get_version in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_get_version (); int main () { return libfcache_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_get_version=yes else ac_cv_lib_fcache_libfcache_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_get_version" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_get_version" >&6; } if test "x$ac_cv_lib_fcache_libfcache_get_version" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_initialize in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_initialize in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_initialize (); int main () { return libfcache_cache_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_initialize=yes else ac_cv_lib_fcache_libfcache_cache_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_initialize" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_initialize" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_initialize" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_free in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_free in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_free (); int main () { return libfcache_cache_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_free=yes else ac_cv_lib_fcache_libfcache_cache_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_free" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_free" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_free" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clone in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_clone in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_clone (); int main () { return libfcache_cache_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_clone=yes else ac_cv_lib_fcache_libfcache_cache_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clone" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_clone" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_clone" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clear in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_clear in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_clear+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_clear (); int main () { return libfcache_cache_clear (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_clear=yes else ac_cv_lib_fcache_libfcache_cache_clear=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clear" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_clear" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_clear" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_number_of_entries in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_get_number_of_entries in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_get_number_of_entries+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_get_number_of_entries (); int main () { return libfcache_cache_get_number_of_entries (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_get_number_of_entries=yes else ac_cv_lib_fcache_libfcache_cache_get_number_of_entries=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_number_of_cache_values in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_get_number_of_cache_values in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_get_number_of_cache_values (); int main () { return libfcache_cache_get_number_of_cache_values (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values=yes else ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_value_by_identifier in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_get_value_by_identifier in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_get_value_by_identifier (); int main () { return libfcache_cache_get_value_by_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier=yes else ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_value_by_index in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_get_value_by_index in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_get_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_get_value_by_index (); int main () { return libfcache_cache_get_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_get_value_by_index=yes else ac_cv_lib_fcache_libfcache_cache_get_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_value_by_index" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_get_value_by_index" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_get_value_by_index" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_set_value_by_identifier in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_set_value_by_identifier in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_set_value_by_identifier (); int main () { return libfcache_cache_set_value_by_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier=yes else ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_set_value_by_index in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_set_value_by_index in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_set_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_set_value_by_index (); int main () { return libfcache_cache_set_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_set_value_by_index=yes else ac_cv_lib_fcache_libfcache_cache_set_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_set_value_by_index" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_set_value_by_index" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_set_value_by_index" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_clear in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_value_clear in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_value_clear+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_value_clear (); int main () { return libfcache_cache_value_clear (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_value_clear=yes else ac_cv_lib_fcache_libfcache_cache_value_clear=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_clear" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_value_clear" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_value_clear" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_get_identifier in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_value_get_identifier in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_value_get_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_value_get_identifier (); int main () { return libfcache_cache_value_get_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_value_get_identifier=yes else ac_cv_lib_fcache_libfcache_cache_value_get_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_get_identifier" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_value_get_identifier" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_value_get_identifier" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_set_identifier in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_value_set_identifier in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_value_set_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_value_set_identifier (); int main () { return libfcache_cache_value_set_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_value_set_identifier=yes else ac_cv_lib_fcache_libfcache_cache_value_set_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_set_identifier" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_value_set_identifier" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_value_set_identifier" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_get_value in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_value_get_value in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_value_get_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_value_get_value (); int main () { return libfcache_cache_value_get_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_value_get_value=yes else ac_cv_lib_fcache_libfcache_cache_value_get_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_get_value" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_value_get_value" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_value_get_value" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_set_value in -lfcache" >&5 $as_echo_n "checking for libfcache_cache_value_set_value in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_cache_value_set_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_cache_value_set_value (); int main () { return libfcache_cache_value_set_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_cache_value_set_value=yes else ac_cv_lib_fcache_libfcache_cache_value_set_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_set_value" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_cache_value_set_value" >&6; } if test "x$ac_cv_lib_fcache_libfcache_cache_value_set_value" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_date_time_get_timestamp in -lfcache" >&5 $as_echo_n "checking for libfcache_date_time_get_timestamp in -lfcache... " >&6; } if ${ac_cv_lib_fcache_libfcache_date_time_get_timestamp+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfcache_date_time_get_timestamp (); int main () { return libfcache_date_time_get_timestamp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fcache_libfcache_date_time_get_timestamp=yes else ac_cv_lib_fcache_libfcache_date_time_get_timestamp=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_date_time_get_timestamp" >&5 $as_echo "$ac_cv_lib_fcache_libfcache_date_time_get_timestamp" >&6; } if test "x$ac_cv_lib_fcache_libfcache_date_time_get_timestamp" = xyes; then : ac_cv_libfcache_dummy=yes else ac_cv_libfcache=no fi ac_cv_libfcache_LIBADD="-lfcache" fi fi if test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect && test "x$ac_cv_libfcache" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libfcache in directory: $ac_cv_with_libfcache See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libfcache" = xyes; then : $as_echo "#define HAVE_LIBFCACHE 1" >>confdefs.h fi if test "x$ac_cv_libfcache" = xyes; then : HAVE_LIBFCACHE=1 else HAVE_LIBFCACHE=0 fi if test "x$ac_cv_libfcache" != xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_func in clock_gettime time do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_time" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: time See \`config.log' for more details" "$LINENO" 5; } fi ac_cv_libfcache_CPPFLAGS="-I../libfcache"; ac_cv_libfcache_LIBADD="../libfcache/libfcache.la"; ac_cv_libfcache=local $as_echo "#define HAVE_LOCAL_LIBFCACHE 1" >>confdefs.h HAVE_LOCAL_LIBFCACHE=1 fi if test "x$ac_cv_libfcache" = xlocal; then HAVE_LOCAL_LIBFCACHE_TRUE= HAVE_LOCAL_LIBFCACHE_FALSE='#' else HAVE_LOCAL_LIBFCACHE_TRUE='#' HAVE_LOCAL_LIBFCACHE_FALSE= fi if test "x$ac_cv_libfcache_CPPFLAGS" != "x"; then : LIBFCACHE_CPPFLAGS=$ac_cv_libfcache_CPPFLAGS fi if test "x$ac_cv_libfcache_LIBADD" != "x"; then : LIBFCACHE_LIBADD=$ac_cv_libfcache_LIBADD fi if test "x$ac_cv_libfcache" = xyes; then : ax_libfcache_pc_libs_private=-lfcache fi if test "x$ac_cv_libfcache" = xyes; then : ax_libfcache_spec_requires=libfcache ax_libfcache_spec_build_requires=libfcache-devel fi # Check whether --with-libfdata was given. if test "${with_libfdata+set}" = set; then : withval=$with_libfdata; ac_cv_with_libfdata=$withval else ac_cv_with_libfdata=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfdata in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libfdata in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libfdata+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libfdata=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfdata" >&5 $as_echo "$ac_cv_with_libfdata" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdata" = xno; then : ac_cv_libfdata=no else ac_cv_libfdata=check if test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect; then : if test -d "$ac_cv_with_libfdata"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libfdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdata}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libfdata See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata" >&5 $as_echo_n "checking for libfdata... " >&6; } if test -n "$libfdata_CFLAGS"; then pkg_cv_libfdata_CFLAGS="$libfdata_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdata >= 20181009\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfdata >= 20181009") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfdata_CFLAGS=`$PKG_CONFIG --cflags "libfdata >= 20181009" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libfdata_LIBS"; then pkg_cv_libfdata_LIBS="$libfdata_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdata >= 20181009\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfdata >= 20181009") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfdata_LIBS=`$PKG_CONFIG --libs "libfdata >= 20181009" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libfdata_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfdata >= 20181009" 2>&1` else libfdata_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfdata >= 20181009" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libfdata_PKG_ERRORS" >&5 ac_cv_libfdata=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libfdata=check else libfdata_CFLAGS=$pkg_cv_libfdata_CFLAGS libfdata_LIBS=$pkg_cv_libfdata_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libfdata=yes fi fi if test "x$ac_cv_libfdata" = xyes; then : ac_cv_libfdata_CPPFLAGS="$pkg_cv_libfdata_CFLAGS" ac_cv_libfdata_LIBADD="$pkg_cv_libfdata_LIBS" fi fi if test "x$ac_cv_libfdata" = xcheck; then : for ac_header in libfdata.h do : ac_fn_c_check_header_mongrel "$LINENO" "libfdata.h" "ac_cv_header_libfdata_h" "$ac_includes_default" if test "x$ac_cv_header_libfdata_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFDATA_H 1 _ACEOF fi done if test "x$ac_cv_header_libfdata_h" = xno; then : ac_cv_libfdata=no else ac_cv_libfdata=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_get_version in -lfdata" >&5 $as_echo_n "checking for libfdata_get_version in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_get_version (); int main () { return libfdata_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_get_version=yes else ac_cv_lib_fdata_libfdata_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_get_version" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_get_version" >&6; } if test "x$ac_cv_lib_fdata_libfdata_get_version" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_initialize in -lfdata" >&5 $as_echo_n "checking for libfdata_area_initialize in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_initialize (); int main () { return libfdata_area_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_initialize=yes else ac_cv_lib_fdata_libfdata_area_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_initialize" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_initialize" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_initialize" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_free in -lfdata" >&5 $as_echo_n "checking for libfdata_area_free in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_free (); int main () { return libfdata_area_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_free=yes else ac_cv_lib_fdata_libfdata_area_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_free" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_free" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_free" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_clone in -lfdata" >&5 $as_echo_n "checking for libfdata_area_clone in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_clone (); int main () { return libfdata_area_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_clone=yes else ac_cv_lib_fdata_libfdata_area_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_clone" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_clone" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_clone" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_empty in -lfdata" >&5 $as_echo_n "checking for libfdata_area_empty in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_empty (); int main () { return libfdata_area_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_empty=yes else ac_cv_lib_fdata_libfdata_area_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_empty" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_empty" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_empty" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_resize in -lfdata" >&5 $as_echo_n "checking for libfdata_area_resize in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_resize (); int main () { return libfdata_area_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_resize=yes else ac_cv_lib_fdata_libfdata_area_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_resize" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_resize" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_resize" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_number_of_segments in -lfdata" >&5 $as_echo_n "checking for libfdata_area_get_number_of_segments in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_get_number_of_segments (); int main () { return libfdata_area_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_get_number_of_segments=yes else ac_cv_lib_fdata_libfdata_area_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_get_number_of_segments" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_get_number_of_segments" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_segment_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_area_get_segment_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_get_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_get_segment_by_index (); int main () { return libfdata_area_get_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_get_segment_by_index=yes else ac_cv_lib_fdata_libfdata_area_get_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_segment_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_get_segment_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_get_segment_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_set_segment_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_area_set_segment_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_set_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_set_segment_by_index (); int main () { return libfdata_area_set_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_set_segment_by_index=yes else ac_cv_lib_fdata_libfdata_area_set_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_set_segment_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_set_segment_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_set_segment_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_prepend_segment in -lfdata" >&5 $as_echo_n "checking for libfdata_area_prepend_segment in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_prepend_segment+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_prepend_segment (); int main () { return libfdata_area_prepend_segment (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_prepend_segment=yes else ac_cv_lib_fdata_libfdata_area_prepend_segment=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_prepend_segment" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_prepend_segment" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_prepend_segment" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_append_segment in -lfdata" >&5 $as_echo_n "checking for libfdata_area_append_segment in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_append_segment+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_append_segment (); int main () { return libfdata_area_append_segment (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_append_segment=yes else ac_cv_lib_fdata_libfdata_area_append_segment=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_append_segment" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_append_segment" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_append_segment" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_element_data_size in -lfdata" >&5 $as_echo_n "checking for libfdata_area_get_element_data_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_get_element_data_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_get_element_data_size (); int main () { return libfdata_area_get_element_data_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_get_element_data_size=yes else ac_cv_lib_fdata_libfdata_area_get_element_data_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_element_data_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_get_element_data_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_get_element_data_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_element_value_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_area_get_element_value_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_get_element_value_at_offset (); int main () { return libfdata_area_get_element_value_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset=yes else ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_set_element_value_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_area_set_element_value_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_set_element_value_at_offset (); int main () { return libfdata_area_set_element_value_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset=yes else ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_size in -lfdata" >&5 $as_echo_n "checking for libfdata_area_get_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_area_get_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_area_get_size (); int main () { return libfdata_area_get_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_area_get_size=yes else ac_cv_lib_fdata_libfdata_area_get_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_area_get_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_area_get_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_initialize in -lfdata" >&5 $as_echo_n "checking for libfdata_list_initialize in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_initialize (); int main () { return libfdata_list_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_initialize=yes else ac_cv_lib_fdata_libfdata_list_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_initialize" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_initialize" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_initialize" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_free in -lfdata" >&5 $as_echo_n "checking for libfdata_list_free in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_free (); int main () { return libfdata_list_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_free=yes else ac_cv_lib_fdata_libfdata_list_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_free" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_free" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_free" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_clone in -lfdata" >&5 $as_echo_n "checking for libfdata_list_clone in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_clone (); int main () { return libfdata_list_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_clone=yes else ac_cv_lib_fdata_libfdata_list_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_clone" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_clone" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_clone" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_empty in -lfdata" >&5 $as_echo_n "checking for libfdata_list_empty in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_empty (); int main () { return libfdata_list_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_empty=yes else ac_cv_lib_fdata_libfdata_list_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_empty" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_empty" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_empty" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_resize in -lfdata" >&5 $as_echo_n "checking for libfdata_list_resize in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_resize (); int main () { return libfdata_list_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_resize=yes else ac_cv_lib_fdata_libfdata_list_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_resize" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_resize" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_resize" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_reverse in -lfdata" >&5 $as_echo_n "checking for libfdata_list_reverse in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_reverse+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_reverse (); int main () { return libfdata_list_reverse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_reverse=yes else ac_cv_lib_fdata_libfdata_list_reverse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_reverse" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_reverse" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_reverse" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_number_of_elements in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_number_of_elements in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_number_of_elements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_number_of_elements (); int main () { return libfdata_list_get_number_of_elements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_number_of_elements=yes else ac_cv_lib_fdata_libfdata_list_get_number_of_elements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_number_of_elements" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_number_of_elements" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_number_of_elements" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_list_element_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_list_element_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_list_element_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_list_element_by_index (); int main () { return libfdata_list_get_list_element_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_list_element_by_index=yes else ac_cv_lib_fdata_libfdata_list_get_list_element_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_list_element_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_list_element_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_list_element_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_element_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_element_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_element_by_index (); int main () { return libfdata_list_get_element_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_element_by_index=yes else ac_cv_lib_fdata_libfdata_list_get_element_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_element_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_set_element_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_set_element_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_set_element_by_index (); int main () { return libfdata_list_set_element_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_set_element_by_index=yes else ac_cv_lib_fdata_libfdata_list_set_element_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_set_element_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_prepend_element in -lfdata" >&5 $as_echo_n "checking for libfdata_list_prepend_element in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_prepend_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_prepend_element (); int main () { return libfdata_list_prepend_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_prepend_element=yes else ac_cv_lib_fdata_libfdata_list_prepend_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_prepend_element" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_prepend_element" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_prepend_element" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_append_element in -lfdata" >&5 $as_echo_n "checking for libfdata_list_append_element in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_append_element+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_append_element (); int main () { return libfdata_list_append_element (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_append_element=yes else ac_cv_lib_fdata_libfdata_list_append_element=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_append_element" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_append_element" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_append_element" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_append_list in -lfdata" >&5 $as_echo_n "checking for libfdata_list_append_list in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_append_list+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_append_list (); int main () { return libfdata_list_append_list (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_append_list=yes else ac_cv_lib_fdata_libfdata_list_append_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_append_list" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_append_list" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_append_list" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_is_element_set in -lfdata" >&5 $as_echo_n "checking for libfdata_list_is_element_set in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_is_element_set+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_is_element_set (); int main () { return libfdata_list_is_element_set (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_is_element_set=yes else ac_cv_lib_fdata_libfdata_list_is_element_set=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_is_element_set" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_is_element_set" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_is_element_set" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_mapped_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_mapped_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_mapped_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_mapped_offset (); int main () { return libfdata_list_get_mapped_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_mapped_offset=yes else ac_cv_lib_fdata_libfdata_list_get_mapped_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_mapped_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_mapped_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_mapped_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_mapped_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_set_mapped_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_set_mapped_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_set_mapped_offset (); int main () { return libfdata_list_set_mapped_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_set_mapped_offset=yes else ac_cv_lib_fdata_libfdata_list_set_mapped_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_mapped_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_set_mapped_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_set_mapped_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_mapped_size_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_mapped_size_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_mapped_size_by_index (); int main () { return libfdata_list_get_mapped_size_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index=yes else ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_mapped_size_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_set_mapped_size_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_set_mapped_size_by_index (); int main () { return libfdata_list_set_mapped_size_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index=yes else ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_by_index_with_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_element_by_index_with_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_element_by_index_with_mapped_size (); int main () { return libfdata_list_get_element_by_index_with_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_by_index_with_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_set_element_by_index_with_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_set_element_by_index_with_mapped_size (); int main () { return libfdata_list_set_element_by_index_with_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_append_element_with_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_append_element_with_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_append_element_with_mapped_size (); int main () { return libfdata_list_append_element_with_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_index_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_element_index_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_element_index_at_offset (); int main () { return libfdata_list_get_element_index_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset=yes else ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_list_element_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_list_element_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_list_element_at_offset (); int main () { return libfdata_list_get_list_element_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset=yes else ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_element_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_element_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_element_at_offset (); int main () { return libfdata_list_get_element_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_element_at_offset=yes else ac_cv_lib_fdata_libfdata_list_get_element_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_element_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_cache_element_value in -lfdata" >&5 $as_echo_n "checking for libfdata_list_cache_element_value in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_cache_element_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_cache_element_value (); int main () { return libfdata_list_cache_element_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_cache_element_value=yes else ac_cv_lib_fdata_libfdata_list_cache_element_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_cache_element_value" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_cache_element_value" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_cache_element_value" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_value_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_element_value_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_element_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_element_value_by_index (); int main () { return libfdata_list_get_element_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_element_value_by_index=yes else ac_cv_lib_fdata_libfdata_list_get_element_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_value_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_value_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_element_value_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_value_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_element_value_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_element_value_at_offset (); int main () { return libfdata_list_get_element_value_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset=yes else ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_value_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_list_set_element_value_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_set_element_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_set_element_value_by_index (); int main () { return libfdata_list_set_element_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_set_element_value_by_index=yes else ac_cv_lib_fdata_libfdata_list_set_element_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_value_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_value_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_set_element_value_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_value_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_list_set_element_value_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_set_element_value_at_offset (); int main () { return libfdata_list_set_element_value_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset=yes else ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_get_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_get_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_get_size (); int main () { return libfdata_list_get_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_get_size=yes else ac_cv_lib_fdata_libfdata_list_get_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_get_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_get_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_get_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_get_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_get_mapped_size (); int main () { return libfdata_list_element_get_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_set_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_set_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_set_mapped_size (); int main () { return libfdata_list_element_set_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_element_value in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_get_element_value in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_get_element_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_get_element_value (); int main () { return libfdata_list_element_get_element_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_get_element_value=yes else ac_cv_lib_fdata_libfdata_list_element_get_element_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_get_element_value" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_element_value in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_set_element_value in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_set_element_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_set_element_value (); int main () { return libfdata_list_element_set_element_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_set_element_value=yes else ac_cv_lib_fdata_libfdata_list_element_set_element_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_set_element_value" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_get_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_get_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_get_mapped_size (); int main () { return libfdata_list_element_get_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_set_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_set_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_set_mapped_size (); int main () { return libfdata_list_element_set_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=yes else ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_element_value in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_get_element_value in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_get_element_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_get_element_value (); int main () { return libfdata_list_element_get_element_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_get_element_value=yes else ac_cv_lib_fdata_libfdata_list_element_get_element_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_get_element_value" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_element_value in -lfdata" >&5 $as_echo_n "checking for libfdata_list_element_set_element_value in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_list_element_set_element_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_list_element_set_element_value (); int main () { return libfdata_list_element_set_element_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_list_element_set_element_value=yes else ac_cv_lib_fdata_libfdata_list_element_set_element_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&6; } if test "x$ac_cv_lib_fdata_libfdata_list_element_set_element_value" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_initialize in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_initialize in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_initialize (); int main () { return libfdata_stream_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_initialize=yes else ac_cv_lib_fdata_libfdata_stream_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_initialize" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_initialize" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_initialize" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_free in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_free in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_free (); int main () { return libfdata_stream_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_free=yes else ac_cv_lib_fdata_libfdata_stream_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_free" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_free" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_free" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_clone in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_clone in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_clone (); int main () { return libfdata_stream_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_clone=yes else ac_cv_lib_fdata_libfdata_stream_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_clone" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_clone" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_clone" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_empty in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_empty in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_empty (); int main () { return libfdata_stream_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_empty=yes else ac_cv_lib_fdata_libfdata_stream_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_empty" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_empty" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_empty" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_resize in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_resize in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_resize (); int main () { return libfdata_stream_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_resize=yes else ac_cv_lib_fdata_libfdata_stream_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_resize" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_resize" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_resize" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_reverse in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_reverse in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_reverse+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_reverse (); int main () { return libfdata_stream_reverse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_reverse=yes else ac_cv_lib_fdata_libfdata_stream_reverse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_reverse" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_reverse" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_reverse" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_number_of_segments in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_number_of_segments in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_number_of_segments (); int main () { return libfdata_stream_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_number_of_segments=yes else ac_cv_lib_fdata_libfdata_stream_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_number_of_segments" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_number_of_segments" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_segment_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_segment_by_index (); int main () { return libfdata_stream_get_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_segment_by_index=yes else ac_cv_lib_fdata_libfdata_stream_get_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_set_segment_by_index in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_set_segment_by_index in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_set_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_set_segment_by_index (); int main () { return libfdata_stream_set_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_set_segment_by_index=yes else ac_cv_lib_fdata_libfdata_stream_set_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_set_segment_by_index" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_set_segment_by_index" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_set_segment_by_index" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_prepend_segment in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_prepend_segment in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_prepend_segment+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_prepend_segment (); int main () { return libfdata_stream_prepend_segment (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_prepend_segment=yes else ac_cv_lib_fdata_libfdata_stream_prepend_segment=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_prepend_segment" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_prepend_segment" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_prepend_segment" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_append_segment in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_append_segment in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_append_segment+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_append_segment (); int main () { return libfdata_stream_append_segment (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_append_segment=yes else ac_cv_lib_fdata_libfdata_stream_append_segment=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_append_segment" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_append_segment" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_append_segment" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_set_mapped_size in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_set_mapped_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_set_mapped_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_set_mapped_size (); int main () { return libfdata_stream_set_mapped_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_set_mapped_size=yes else ac_cv_lib_fdata_libfdata_stream_set_mapped_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_set_mapped_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_set_mapped_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_set_mapped_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_mapped_range in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_segment_mapped_range in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_segment_mapped_range (); int main () { return libfdata_stream_get_segment_mapped_range (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range=yes else ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_index_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_segment_index_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_segment_index_at_offset (); int main () { return libfdata_stream_get_segment_index_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset=yes else ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_segment_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_segment_at_offset (); int main () { return libfdata_stream_get_segment_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset=yes else ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_read_buffer in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_read_buffer in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_read_buffer (); int main () { return libfdata_stream_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_read_buffer=yes else ac_cv_lib_fdata_libfdata_stream_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_read_buffer" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_read_buffer" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_read_buffer" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_read_buffer_at_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_read_buffer_at_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_read_buffer_at_offset (); int main () { return libfdata_stream_read_buffer_at_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset=yes else ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_write_buffer in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_write_buffer in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_write_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_write_buffer (); int main () { return libfdata_stream_write_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_write_buffer=yes else ac_cv_lib_fdata_libfdata_stream_write_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_write_buffer" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_write_buffer" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_write_buffer" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_seek_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_seek_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_seek_offset (); int main () { return libfdata_stream_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_seek_offset=yes else ac_cv_lib_fdata_libfdata_stream_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_seek_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_seek_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_seek_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_offset in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_offset in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_offset (); int main () { return libfdata_stream_get_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_offset=yes else ac_cv_lib_fdata_libfdata_stream_get_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_offset" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_offset" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_offset" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_size in -lfdata" >&5 $as_echo_n "checking for libfdata_stream_get_size in -lfdata... " >&6; } if ${ac_cv_lib_fdata_libfdata_stream_get_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfdata_stream_get_size (); int main () { return libfdata_stream_get_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fdata_libfdata_stream_get_size=yes else ac_cv_lib_fdata_libfdata_stream_get_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_size" >&5 $as_echo "$ac_cv_lib_fdata_libfdata_stream_get_size" >&6; } if test "x$ac_cv_lib_fdata_libfdata_stream_get_size" = xyes; then : ac_cv_libfdata_dummy=yes else ac_cv_libfdata=no fi ac_cv_libfdata_LIBADD="-lfdata" fi fi if test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect && test "x$ac_cv_libfdata" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libfdata in directory: $ac_cv_with_libfdata See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libfdata" = xyes; then : $as_echo "#define HAVE_LIBFDATA 1" >>confdefs.h fi if test "x$ac_cv_libfdata" = xyes; then : HAVE_LIBFDATA=1 else HAVE_LIBFDATA=0 fi if test "x$ac_cv_libfdata" != xyes; then : ac_cv_libfdata_CPPFLAGS="-I../libfdata"; ac_cv_libfdata_LIBADD="../libfdata/libfdata.la"; ac_cv_libfdata=local $as_echo "#define HAVE_LOCAL_LIBFDATA 1" >>confdefs.h HAVE_LOCAL_LIBFDATA=1 fi if test "x$ac_cv_libfdata" = xlocal; then HAVE_LOCAL_LIBFDATA_TRUE= HAVE_LOCAL_LIBFDATA_FALSE='#' else HAVE_LOCAL_LIBFDATA_TRUE='#' HAVE_LOCAL_LIBFDATA_FALSE= fi if test "x$ac_cv_libfdata_CPPFLAGS" != "x"; then : LIBFDATA_CPPFLAGS=$ac_cv_libfdata_CPPFLAGS fi if test "x$ac_cv_libfdata_LIBADD" != "x"; then : LIBFDATA_LIBADD=$ac_cv_libfdata_LIBADD fi if test "x$ac_cv_libfdata" = xyes; then : ax_libfdata_pc_libs_private=-lfdata fi if test "x$ac_cv_libfdata" = xyes; then : ax_libfdata_spec_requires=libfdata ax_libfdata_spec_build_requires=libfdata-devel fi # Check whether --with-libfvalue was given. if test "${with_libfvalue+set}" = set; then : withval=$with_libfvalue; ac_cv_with_libfvalue=$withval else ac_cv_with_libfvalue=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libfvalue+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libfvalue=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfvalue" >&5 $as_echo "$ac_cv_with_libfvalue" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfvalue" = xno; then : ac_cv_libfvalue=no else ac_cv_libfvalue=check if test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect; then : if test -d "$ac_cv_with_libfvalue"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libfvalue}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfvalue}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libfvalue See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue" >&5 $as_echo_n "checking for libfvalue... " >&6; } if test -n "$libfvalue_CFLAGS"; then pkg_cv_libfvalue_CFLAGS="$libfvalue_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfvalue >= 20160131\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfvalue >= 20160131") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfvalue_CFLAGS=`$PKG_CONFIG --cflags "libfvalue >= 20160131" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libfvalue_LIBS"; then pkg_cv_libfvalue_LIBS="$libfvalue_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfvalue >= 20160131\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfvalue >= 20160131") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfvalue_LIBS=`$PKG_CONFIG --libs "libfvalue >= 20160131" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libfvalue_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfvalue >= 20160131" 2>&1` else libfvalue_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfvalue >= 20160131" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libfvalue_PKG_ERRORS" >&5 ac_cv_libfvalue=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libfvalue=check else libfvalue_CFLAGS=$pkg_cv_libfvalue_CFLAGS libfvalue_LIBS=$pkg_cv_libfvalue_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libfvalue=yes fi fi if test "x$ac_cv_libfvalue" = xyes; then : ac_cv_libfvalue_CPPFLAGS="$pkg_cv_libfvalue_CFLAGS" ac_cv_libfvalue_LIBADD="$pkg_cv_libfvalue_LIBS" fi fi if test "x$ac_cv_libfvalue" = xcheck; then : for ac_header in libfvalue.h do : ac_fn_c_check_header_mongrel "$LINENO" "libfvalue.h" "ac_cv_header_libfvalue_h" "$ac_includes_default" if test "x$ac_cv_header_libfvalue_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFVALUE_H 1 _ACEOF fi done if test "x$ac_cv_header_libfvalue_h" = xno; then : ac_cv_libfvalue=no else ac_cv_libfvalue=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_get_version in -lfvalue" >&5 $as_echo_n "checking for libfvalue_get_version in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_get_version (); int main () { return libfvalue_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_get_version=yes else ac_cv_lib_fvalue_libfvalue_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_get_version" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_get_version" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_get_version" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_initialize in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_initialize in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_initialize (); int main () { return libfvalue_data_handle_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_initialize=yes else ac_cv_lib_fvalue_libfvalue_data_handle_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_initialize" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_initialize" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_initialize" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_free in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_free in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_free (); int main () { return libfvalue_data_handle_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_free=yes else ac_cv_lib_fvalue_libfvalue_data_handle_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_free" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_free" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_free" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_clone in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_clone in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_clone (); int main () { return libfvalue_data_handle_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_clone=yes else ac_cv_lib_fvalue_libfvalue_data_handle_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_clone" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_clone" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_clone" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_clear in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_clear in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_clear+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_clear (); int main () { return libfvalue_data_handle_clear (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_clear=yes else ac_cv_lib_fvalue_libfvalue_data_handle_clear=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_clear" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_clear" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_clear" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_data in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_get_data in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_get_data (); int main () { return libfvalue_data_handle_get_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_get_data=yes else ac_cv_lib_fvalue_libfvalue_data_handle_get_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_data" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_data" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_data" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_data in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_set_data in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_set_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_set_data (); int main () { return libfvalue_data_handle_set_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_set_data=yes else ac_cv_lib_fvalue_libfvalue_data_handle_set_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_data" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_set_data" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_data" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_data_flags in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_get_data_flags in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_get_data_flags (); int main () { return libfvalue_data_handle_get_data_flags (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags=yes else ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_data_flags in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_set_data_flags in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_set_data_flags (); int main () { return libfvalue_data_handle_set_data_flags (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags=yes else ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_number_of_value_entries in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_get_number_of_value_entries in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_get_number_of_value_entries (); int main () { return libfvalue_data_handle_get_number_of_value_entries (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries=yes else ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_value_entry in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_get_value_entry in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_get_value_entry (); int main () { return libfvalue_data_handle_get_value_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry=yes else ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_value_entry in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_set_value_entry in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_set_value_entry (); int main () { return libfvalue_data_handle_set_value_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry=yes else ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_append_value_entry in -lfvalue" >&5 $as_echo_n "checking for libfvalue_data_handle_append_value_entry in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_data_handle_append_value_entry (); int main () { return libfvalue_data_handle_append_value_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry=yes else ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_string_size_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_string_size_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_string_size_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_string_size_from_integer (); int main () { return libfvalue_string_size_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_string_size_from_integer=yes else ac_cv_lib_fvalue_libfvalue_string_size_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_string_size_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_string_size_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_string_size_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_copy_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf8_string_copy_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf8_string_copy_from_integer (); int main () { return libfvalue_utf8_string_copy_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer=yes else ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_with_index_copy_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf8_string_with_index_copy_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf8_string_with_index_copy_from_integer (); int main () { return libfvalue_utf8_string_with_index_copy_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer=yes else ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_copy_to_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf8_string_copy_to_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf8_string_copy_to_integer (); int main () { return libfvalue_utf8_string_copy_to_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer=yes else ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_with_index_copy_to_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf8_string_with_index_copy_to_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf8_string_with_index_copy_to_integer (); int main () { return libfvalue_utf8_string_with_index_copy_to_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer=yes else ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_copy_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf16_string_copy_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf16_string_copy_from_integer (); int main () { return libfvalue_utf16_string_copy_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer=yes else ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_with_index_copy_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf16_string_with_index_copy_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf16_string_with_index_copy_from_integer (); int main () { return libfvalue_utf16_string_with_index_copy_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer=yes else ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_copy_to_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf16_string_copy_to_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf16_string_copy_to_integer (); int main () { return libfvalue_utf16_string_copy_to_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer=yes else ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_with_index_copy_to_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf16_string_with_index_copy_to_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf16_string_with_index_copy_to_integer (); int main () { return libfvalue_utf16_string_with_index_copy_to_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer=yes else ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_copy_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf32_string_copy_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf32_string_copy_from_integer (); int main () { return libfvalue_utf32_string_copy_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer=yes else ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_with_index_copy_from_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf32_string_with_index_copy_from_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf32_string_with_index_copy_from_integer (); int main () { return libfvalue_utf32_string_with_index_copy_from_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer=yes else ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_copy_to_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf32_string_copy_to_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf32_string_copy_to_integer (); int main () { return libfvalue_utf32_string_copy_to_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer=yes else ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_with_index_copy_to_integer in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf32_string_with_index_copy_to_integer in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf32_string_with_index_copy_to_integer (); int main () { return libfvalue_utf32_string_with_index_copy_to_integer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer=yes else ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_split in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf8_string_split in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf8_string_split+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf8_string_split (); int main () { return libfvalue_utf8_string_split (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf8_string_split=yes else ac_cv_lib_fvalue_libfvalue_utf8_string_split=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_split" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_split" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_split" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_split in -lfvalue" >&5 $as_echo_n "checking for libfvalue_utf16_string_split in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_utf16_string_split+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_utf16_string_split (); int main () { return libfvalue_utf16_string_split (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_utf16_string_split=yes else ac_cv_lib_fvalue_libfvalue_utf16_string_split=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_split" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_split" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_split" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_free in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf8_string_free in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf8_string_free (); int main () { return libfvalue_split_utf8_string_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_free=yes else ac_cv_lib_fvalue_libfvalue_split_utf8_string_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf8_string_get_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf8_string_get_string (); int main () { return libfvalue_split_utf8_string_get_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string=yes else ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_number_of_segments in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf8_string_get_number_of_segments in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf8_string_get_number_of_segments (); int main () { return libfvalue_split_utf8_string_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments=yes else ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_segment_by_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf8_string_get_segment_by_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf8_string_get_segment_by_index (); int main () { return libfvalue_split_utf8_string_get_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index=yes else ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_free in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf16_string_free in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf16_string_free (); int main () { return libfvalue_split_utf16_string_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_free=yes else ac_cv_lib_fvalue_libfvalue_split_utf16_string_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf16_string_get_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf16_string_get_string (); int main () { return libfvalue_split_utf16_string_get_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string=yes else ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_number_of_segments in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf16_string_get_number_of_segments in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf16_string_get_number_of_segments (); int main () { return libfvalue_split_utf16_string_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments=yes else ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_segment_by_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_split_utf16_string_get_segment_by_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_split_utf16_string_get_segment_by_index (); int main () { return libfvalue_split_utf16_string_get_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index=yes else ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_initialize in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_initialize in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_initialize (); int main () { return libfvalue_table_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_initialize=yes else ac_cv_lib_fvalue_libfvalue_table_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_initialize" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_initialize" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_initialize" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_free in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_free in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_free (); int main () { return libfvalue_table_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_free=yes else ac_cv_lib_fvalue_libfvalue_table_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_free" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_free" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_free" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_resize in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_resize in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_resize (); int main () { return libfvalue_table_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_resize=yes else ac_cv_lib_fvalue_libfvalue_table_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_resize" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_resize" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_resize" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_clone in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_clone in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_clone (); int main () { return libfvalue_table_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_clone=yes else ac_cv_lib_fvalue_libfvalue_table_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_clone" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_clone" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_clone" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_number_of_values in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_get_number_of_values in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_get_number_of_values+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_get_number_of_values (); int main () { return libfvalue_table_get_number_of_values (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_get_number_of_values=yes else ac_cv_lib_fvalue_libfvalue_table_get_number_of_values=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_index_by_identifier in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_get_index_by_identifier in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_get_index_by_identifier (); int main () { return libfvalue_table_get_index_by_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier=yes else ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_value_by_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_get_value_by_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_get_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_get_value_by_index (); int main () { return libfvalue_table_get_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_get_value_by_index=yes else ac_cv_lib_fvalue_libfvalue_table_get_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_value_by_identifier in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_get_value_by_identifier in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_get_value_by_identifier (); int main () { return libfvalue_table_get_value_by_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier=yes else ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_set_value_by_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_set_value_by_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_set_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_set_value_by_index (); int main () { return libfvalue_table_set_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_set_value_by_index=yes else ac_cv_lib_fvalue_libfvalue_table_set_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_set_value in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_set_value in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_set_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_set_value (); int main () { return libfvalue_table_set_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_set_value=yes else ac_cv_lib_fvalue_libfvalue_table_set_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_set_value" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_set_value" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_set_value" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_copy_from_utf8_xml_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_table_copy_from_utf8_xml_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_table_copy_from_utf8_xml_string (); int main () { return libfvalue_table_copy_from_utf8_xml_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string=yes else ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_initialize in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_initialize in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_initialize (); int main () { return libfvalue_value_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_initialize=yes else ac_cv_lib_fvalue_libfvalue_value_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_initialize" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_initialize" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_initialize" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_free in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_free in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_free (); int main () { return libfvalue_value_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_free=yes else ac_cv_lib_fvalue_libfvalue_value_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_free" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_free" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_free" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_clone in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_clone in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_clone (); int main () { return libfvalue_value_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_clone=yes else ac_cv_lib_fvalue_libfvalue_value_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_clone" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_clone" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_clone" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_clear in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_clear in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_clear+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_clear (); int main () { return libfvalue_value_clear (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_clear=yes else ac_cv_lib_fvalue_libfvalue_value_clear=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_clear" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_clear" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_clear" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_type in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_type in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_type (); int main () { return libfvalue_value_get_type (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_type=yes else ac_cv_lib_fvalue_libfvalue_value_get_type=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_type" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_type" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_type" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_identifier in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_identifier in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_identifier (); int main () { return libfvalue_value_get_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_identifier=yes else ac_cv_lib_fvalue_libfvalue_value_get_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_identifier" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_identifier" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_identifier" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_identifier in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_set_identifier in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_set_identifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_set_identifier (); int main () { return libfvalue_value_set_identifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_set_identifier=yes else ac_cv_lib_fvalue_libfvalue_value_set_identifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_identifier" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_identifier" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_set_identifier" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data_handle in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_data_handle in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_data_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_data_handle (); int main () { return libfvalue_value_get_data_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_data_handle=yes else ac_cv_lib_fvalue_libfvalue_value_get_data_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data_handle" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_data_handle" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data_handle" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_has_data in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_has_data in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_has_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_has_data (); int main () { return libfvalue_value_has_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_has_data=yes else ac_cv_lib_fvalue_libfvalue_value_has_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_has_data" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_has_data" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_has_data" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data_size in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_data_size in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_data_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_data_size (); int main () { return libfvalue_value_get_data_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_data_size=yes else ac_cv_lib_fvalue_libfvalue_value_get_data_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data_size" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_data_size" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data_size" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_data in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_data (); int main () { return libfvalue_value_get_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_data=yes else ac_cv_lib_fvalue_libfvalue_value_get_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_data" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_data in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_set_data in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_set_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_set_data (); int main () { return libfvalue_value_set_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_set_data=yes else ac_cv_lib_fvalue_libfvalue_value_set_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_data" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_data" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_set_data" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_data in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_data in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_data (); int main () { return libfvalue_value_copy_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_data=yes else ac_cv_lib_fvalue_libfvalue_value_copy_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_data" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_data" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_data" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_format_flags in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_format_flags in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_format_flags+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_format_flags (); int main () { return libfvalue_value_get_format_flags (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_format_flags=yes else ac_cv_lib_fvalue_libfvalue_value_get_format_flags=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_format_flags" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_format_flags" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_format_flags" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_format_flags in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_set_format_flags in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_set_format_flags+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_set_format_flags (); int main () { return libfvalue_value_set_format_flags (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_set_format_flags=yes else ac_cv_lib_fvalue_libfvalue_value_set_format_flags=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_format_flags" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_format_flags" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_set_format_flags" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_number_of_value_entries in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_number_of_value_entries in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_number_of_value_entries (); int main () { return libfvalue_value_get_number_of_value_entries (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries=yes else ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_value_entry in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_value_entry in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_value_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_value_entry (); int main () { return libfvalue_value_get_value_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_value_entry=yes else ac_cv_lib_fvalue_libfvalue_value_get_value_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_value_entry" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_value_entry" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_value_entry" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_value_entry in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_set_value_entry in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_set_value_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_set_value_entry (); int main () { return libfvalue_value_set_value_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_set_value_entry=yes else ac_cv_lib_fvalue_libfvalue_value_set_value_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_value_entry" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_value_entry" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_set_value_entry" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_append_value_entry in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_append_value_entry in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_append_value_entry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_append_value_entry (); int main () { return libfvalue_value_append_value_entry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_append_value_entry=yes else ac_cv_lib_fvalue_libfvalue_value_append_value_entry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_append_value_entry" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_append_value_entry" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_append_value_entry" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_boolean in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_boolean in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_boolean (); int main () { return libfvalue_value_copy_from_boolean (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_boolean in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_boolean in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_boolean (); int main () { return libfvalue_value_copy_to_boolean (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_8bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_8bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_8bit (); int main () { return libfvalue_value_copy_from_8bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_8bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_8bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_8bit (); int main () { return libfvalue_value_copy_to_8bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_16bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_16bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_16bit (); int main () { return libfvalue_value_copy_from_16bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_16bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_16bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_16bit (); int main () { return libfvalue_value_copy_to_16bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_32bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_32bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_32bit (); int main () { return libfvalue_value_copy_from_32bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_32bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_32bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_32bit (); int main () { return libfvalue_value_copy_to_32bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_64bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_64bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_64bit (); int main () { return libfvalue_value_copy_from_64bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_64bit in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_64bit in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_64bit (); int main () { return libfvalue_value_copy_to_64bit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_float in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_float in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_float+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_float (); int main () { return libfvalue_value_copy_from_float (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_float=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_float=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_float" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_float" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_float" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_float in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_float in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_float+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_float (); int main () { return libfvalue_value_copy_to_float (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_float=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_float=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_float" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_float" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_float" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_double in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_double in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_double+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_double (); int main () { return libfvalue_value_copy_from_double (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_double=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_double=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_double" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_double" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_double" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_double in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_double in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_double+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_double (); int main () { return libfvalue_value_copy_to_double (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_double=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_double=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_double" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_double" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_double" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf8_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_utf8_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_utf8_string (); int main () { return libfvalue_value_copy_from_utf8_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf8_string_size in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_utf8_string_size in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_utf8_string_size (); int main () { return libfvalue_value_get_utf8_string_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size=yes else ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf8_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_utf8_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_utf8_string (); int main () { return libfvalue_value_copy_to_utf8_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf8_string_with_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_utf8_string_with_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_utf8_string_with_index (); int main () { return libfvalue_value_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf16_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_utf16_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_utf16_string (); int main () { return libfvalue_value_copy_from_utf16_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf16_string_size in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_utf16_string_size in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_utf16_string_size (); int main () { return libfvalue_value_get_utf16_string_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size=yes else ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf16_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_utf16_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_utf16_string (); int main () { return libfvalue_value_copy_to_utf16_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf16_string_with_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_utf16_string_with_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_utf16_string_with_index (); int main () { return libfvalue_value_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf32_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_from_utf32_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_from_utf32_string (); int main () { return libfvalue_value_copy_from_utf32_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string=yes else ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf32_string_size in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_get_utf32_string_size in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_get_utf32_string_size (); int main () { return libfvalue_value_get_utf32_string_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size=yes else ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf32_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_utf32_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_utf32_string (); int main () { return libfvalue_value_copy_to_utf32_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf32_string_with_index in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_copy_to_utf32_string_with_index in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_copy_to_utf32_string_with_index (); int main () { return libfvalue_value_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index=yes else ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_read_from_file_stream in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_read_from_file_stream in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_read_from_file_stream (); int main () { return libfvalue_value_read_from_file_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream=yes else ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_write_to_file_stream in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_write_to_file_stream in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_write_to_file_stream (); int main () { return libfvalue_value_write_to_file_stream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream=yes else ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_initialize in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_type_initialize in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_type_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_type_initialize (); int main () { return libfvalue_value_type_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_type_initialize=yes else ac_cv_lib_fvalue_libfvalue_value_type_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_initialize" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_initialize" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_type_initialize" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_initialize_with_data_handle in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_type_initialize_with_data_handle in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_type_initialize_with_data_handle (); int main () { return libfvalue_value_type_initialize_with_data_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle=yes else ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_set_data_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_type_set_data_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_type_set_data_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_type_set_data_string (); int main () { return libfvalue_value_type_set_data_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_type_set_data_string=yes else ac_cv_lib_fvalue_libfvalue_value_type_set_data_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_append_data_string in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_type_append_data_string in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_type_append_data_string+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_type_append_data_string (); int main () { return libfvalue_value_type_append_data_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_type_append_data_string=yes else ac_cv_lib_fvalue_libfvalue_value_type_append_data_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_set_data_strings_array in -lfvalue" >&5 $as_echo_n "checking for libfvalue_value_type_set_data_strings_array in -lfvalue... " >&6; } if ${ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libfvalue_value_type_set_data_strings_array (); int main () { return libfvalue_value_type_set_data_strings_array (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array=yes else ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" >&5 $as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" >&6; } if test "x$ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" = xyes; then : ac_cv_libfvalue_dummy=yes else ac_cv_libfvalue=no fi ac_cv_libfvalue_LIBADD="-lfvalue" fi fi if test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect && test "x$ac_cv_libfvalue" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libfvalue in directory: $ac_cv_with_libfvalue See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libfvalue" = xyes; then : $as_echo "#define HAVE_LIBFVALUE 1" >>confdefs.h fi if test "x$ac_cv_libfvalue" = xyes; then : HAVE_LIBFVALUE=1 else HAVE_LIBFVALUE=0 fi if test "x$ac_cv_libfvalue" != xyes; then : ac_cv_libfvalue_CPPFLAGS="-I../libfvalue"; ac_cv_libfvalue_LIBADD="../libfvalue/libfvalue.la"; ac_cv_libfvalue=local $as_echo "#define HAVE_LOCAL_LIBFVALUE 1" >>confdefs.h HAVE_LOCAL_LIBFVALUE=1 fi if test "x$ac_cv_libfvalue" = xlocal; then HAVE_LOCAL_LIBFVALUE_TRUE= HAVE_LOCAL_LIBFVALUE_FALSE='#' else HAVE_LOCAL_LIBFVALUE_TRUE='#' HAVE_LOCAL_LIBFVALUE_FALSE= fi if test "x$ac_cv_libfvalue_CPPFLAGS" != "x"; then : LIBFVALUE_CPPFLAGS=$ac_cv_libfvalue_CPPFLAGS fi if test "x$ac_cv_libfvalue_LIBADD" != "x"; then : LIBFVALUE_LIBADD=$ac_cv_libfvalue_LIBADD fi if test "x$ac_cv_libfvalue" = xyes; then : ax_libfvalue_pc_libs_private=-lfvalue fi if test "x$ac_cv_libfvalue" = xyes; then : ax_libfvalue_spec_requires=libfvalue ax_libfvalue_spec_build_requires=libfvalue-devel fi # Check whether --with-libmfdata was given. if test "${with_libmfdata+set}" = set; then : withval=$with_libmfdata; ac_cv_with_libmfdata=$withval else ac_cv_with_libmfdata=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libmfdata in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libmfdata in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libmfdata+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libmfdata=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libmfdata" >&5 $as_echo "$ac_cv_with_libmfdata" >&6; } if test "x$ac_cv_with_libmfdata" != x && test "x$ac_cv_with_libmfdata" != xno && test "x$ac_cv_with_libmfdata" != xauto-detect; then : if test -d "$ac_cv_with_libmfdata"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libmfdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libmfdata}/lib" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_libmfdata" >&5 $as_echo "$as_me: WARNING: no such directory: $ac_cv_with_libmfdata" >&2;} fi fi if test "x$ac_cv_with_libmfdata" = xno; then : ac_cv_libmfdata=no else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata" >&5 $as_echo_n "checking for libmfdata... " >&6; } if test -n "$libmfdata_CFLAGS"; then pkg_cv_libmfdata_CFLAGS="$libmfdata_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmfdata >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libmfdata >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libmfdata_CFLAGS=`$PKG_CONFIG --cflags "libmfdata >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libmfdata_LIBS"; then pkg_cv_libmfdata_LIBS="$libmfdata_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmfdata >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libmfdata >= 20120425") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libmfdata_LIBS=`$PKG_CONFIG --libs "libmfdata >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libmfdata_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmfdata >= 20120425" 2>&1` else libmfdata_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmfdata >= 20120425" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libmfdata_PKG_ERRORS" >&5 ac_cv_libmfdata=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libmfdata=no else libmfdata_CFLAGS=$pkg_cv_libmfdata_CFLAGS libmfdata_LIBS=$pkg_cv_libmfdata_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libmfdata=yes fi fi if test "x$ac_cv_libmfdata" = xyes; then : ac_cv_libmfdata_CPPFLAGS="$pkg_cv_libmfdata_CFLAGS" ac_cv_libmfdata_LIBADD="$pkg_cv_libmfdata_LIBS" else for ac_header in libmfdata.h do : ac_fn_c_check_header_mongrel "$LINENO" "libmfdata.h" "ac_cv_header_libmfdata_h" "$ac_includes_default" if test "x$ac_cv_header_libmfdata_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMFDATA_H 1 _ACEOF fi done if test "x$ac_cv_header_libmfdata_h" = xno; then : ac_cv_libmfdata=no else ac_cv_libmfdata=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_get_version in -lmfdata" >&5 $as_echo_n "checking for libmfdata_get_version in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_get_version (); int main () { return libmfdata_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_get_version=yes else ac_cv_lib_mfdata_libmfdata_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_get_version" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_get_version" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_get_version" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_cache_initialize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_cache_initialize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_cache_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_cache_initialize (); int main () { return libmfdata_cache_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_cache_initialize=yes else ac_cv_lib_mfdata_libmfdata_cache_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_cache_initialize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_cache_initialize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_cache_initialize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_cache_free in -lmfdata" >&5 $as_echo_n "checking for libmfdata_cache_free in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_cache_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_cache_free (); int main () { return libmfdata_cache_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_cache_free=yes else ac_cv_lib_mfdata_libmfdata_cache_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_cache_free" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_cache_free" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_cache_free" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_cache_clone in -lmfdata" >&5 $as_echo_n "checking for libmfdata_cache_clone in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_cache_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_cache_clone (); int main () { return libmfdata_cache_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_cache_clone=yes else ac_cv_lib_mfdata_libmfdata_cache_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_cache_clone" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_cache_clone" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_cache_clone" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_set_file_value in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_set_file_value in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_set_file_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_set_file_value (); int main () { return libmfdata_file_set_file_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_set_file_value=yes else ac_cv_lib_mfdata_libmfdata_file_set_file_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_set_file_value" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_set_file_value" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_set_file_value" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_initialize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_initialize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_initialize (); int main () { return libmfdata_file_list_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_initialize=yes else ac_cv_lib_mfdata_libmfdata_file_list_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_initialize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_initialize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_initialize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_free in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_free in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_free (); int main () { return libmfdata_file_list_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_free=yes else ac_cv_lib_mfdata_libmfdata_file_list_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_free" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_free" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_free" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_resize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_resize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_resize (); int main () { return libmfdata_file_list_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_resize=yes else ac_cv_lib_mfdata_libmfdata_file_list_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_resize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_resize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_resize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_clone in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_clone in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_clone (); int main () { return libmfdata_file_list_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_clone=yes else ac_cv_lib_mfdata_libmfdata_file_list_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_clone" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_clone" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_clone" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_get_number_of_files in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_get_number_of_files in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_get_number_of_files+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_get_number_of_files (); int main () { return libmfdata_file_list_get_number_of_files (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_get_number_of_files=yes else ac_cv_lib_mfdata_libmfdata_file_list_get_number_of_files=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_get_number_of_files" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_get_number_of_files" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_get_number_of_files" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_get_file_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_get_file_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_get_file_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_get_file_by_index (); int main () { return libmfdata_file_list_get_file_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_get_file_by_index=yes else ac_cv_lib_mfdata_libmfdata_file_list_get_file_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_get_file_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_get_file_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_get_file_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_get_file_value_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_get_file_value_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_get_file_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_get_file_value_by_index (); int main () { return libmfdata_file_list_get_file_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_get_file_value_by_index=yes else ac_cv_lib_mfdata_libmfdata_file_list_get_file_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_get_file_value_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_get_file_value_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_get_file_value_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_set_file_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_set_file_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_set_file_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_set_file_by_index (); int main () { return libmfdata_file_list_set_file_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_set_file_by_index=yes else ac_cv_lib_mfdata_libmfdata_file_list_set_file_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_set_file_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_set_file_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_set_file_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_set_file_value_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_set_file_value_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_set_file_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_set_file_value_by_index (); int main () { return libmfdata_file_list_set_file_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_set_file_value_by_index=yes else ac_cv_lib_mfdata_libmfdata_file_list_set_file_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_set_file_value_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_set_file_value_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_set_file_value_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_file_list_append_file in -lmfdata" >&5 $as_echo_n "checking for libmfdata_file_list_append_file in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_file_list_append_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_file_list_append_file (); int main () { return libmfdata_file_list_append_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_file_list_append_file=yes else ac_cv_lib_mfdata_libmfdata_file_list_append_file=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_file_list_append_file" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_file_list_append_file" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_file_list_append_file" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_initialize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_initialize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_initialize (); int main () { return libmfdata_list_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_initialize=yes else ac_cv_lib_mfdata_libmfdata_list_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_initialize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_initialize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_initialize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_free in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_free in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_free (); int main () { return libmfdata_list_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_free=yes else ac_cv_lib_mfdata_libmfdata_list_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_free" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_free" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_free" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_resize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_resize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_resize (); int main () { return libmfdata_list_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_resize=yes else ac_cv_lib_mfdata_libmfdata_list_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_resize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_resize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_resize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_clone in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_clone in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_clone+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_clone (); int main () { return libmfdata_list_clone (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_clone=yes else ac_cv_lib_mfdata_libmfdata_list_clone=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_clone" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_clone" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_clone" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_is_group in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_is_group in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_is_group+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_is_group (); int main () { return libmfdata_list_is_group (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_is_group=yes else ac_cv_lib_mfdata_libmfdata_list_is_group=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_is_group" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_is_group" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_is_group" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_is_set in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_is_set in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_is_set+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_is_set (); int main () { return libmfdata_list_is_set (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_is_set=yes else ac_cv_lib_mfdata_libmfdata_list_is_set=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_is_set" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_is_set" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_is_set" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_get_number_of_elements in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_get_number_of_elements in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_get_number_of_elements+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_get_number_of_elements (); int main () { return libmfdata_list_get_number_of_elements (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_get_number_of_elements=yes else ac_cv_lib_mfdata_libmfdata_list_get_number_of_elements=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_get_number_of_elements" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_get_number_of_elements" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_get_number_of_elements" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_get_data_range_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_get_data_range_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_get_data_range_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_get_data_range_by_index (); int main () { return libmfdata_list_get_data_range_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_get_data_range_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_get_data_range_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_get_data_range_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_get_data_range_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_get_data_range_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_get_element_value_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_get_element_value_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_get_element_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_get_element_value_by_index (); int main () { return libmfdata_list_get_element_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_get_element_value_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_get_element_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_get_element_value_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_get_element_value_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_get_element_value_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_get_group_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_get_group_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_get_group_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_get_group_by_index (); int main () { return libmfdata_list_get_group_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_get_group_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_get_group_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_get_group_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_get_group_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_get_group_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_set_data_range_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_set_data_range_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_set_data_range_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_set_data_range_by_index (); int main () { return libmfdata_list_set_data_range_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_set_data_range_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_set_data_range_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_set_data_range_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_set_data_range_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_set_data_range_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_set_backup_data_range_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_set_backup_data_range_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_set_backup_data_range_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_set_backup_data_range_by_index (); int main () { return libmfdata_list_set_backup_data_range_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_set_backup_data_range_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_set_backup_data_range_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_set_backup_data_range_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_set_backup_data_range_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_set_backup_data_range_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_set_element_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_set_element_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_set_element_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_set_element_by_index (); int main () { return libmfdata_list_set_element_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_set_element_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_set_element_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_set_element_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_set_element_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_set_element_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_set_element_value_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_set_element_value_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_set_element_value_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_set_element_value_by_index (); int main () { return libmfdata_list_set_element_value_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_set_element_value_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_set_element_value_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_set_element_value_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_set_element_value_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_set_element_value_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_set_group_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_set_group_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_set_group_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_set_group_by_index (); int main () { return libmfdata_list_set_group_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_set_group_by_index=yes else ac_cv_lib_mfdata_libmfdata_list_set_group_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_set_group_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_set_group_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_set_group_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_append_group in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_append_group in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_append_group+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_append_group (); int main () { return libmfdata_list_append_group (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_append_group=yes else ac_cv_lib_mfdata_libmfdata_list_append_group=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_append_group" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_append_group" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_append_group" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_element_get_element_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_element_get_element_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_element_get_element_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_element_get_element_index (); int main () { return libmfdata_list_element_get_element_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_element_get_element_index=yes else ac_cv_lib_mfdata_libmfdata_list_element_get_element_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_element_get_element_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_element_get_element_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_element_get_element_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_list_element_set_element_value in -lmfdata" >&5 $as_echo_n "checking for libmfdata_list_element_set_element_value in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_list_element_set_element_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_list_element_set_element_value (); int main () { return libmfdata_list_element_set_element_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_list_element_set_element_value=yes else ac_cv_lib_mfdata_libmfdata_list_element_set_element_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_list_element_set_element_value" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_list_element_set_element_value" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_list_element_set_element_value" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_initialize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_initialize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_initialize (); int main () { return libmfdata_segment_table_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_initialize=yes else ac_cv_lib_mfdata_libmfdata_segment_table_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_initialize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_initialize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_initialize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_free in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_free in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_free (); int main () { return libmfdata_segment_table_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_free=yes else ac_cv_lib_mfdata_libmfdata_segment_table_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_free" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_free" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_free" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_empty in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_empty in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_empty+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_empty (); int main () { return libmfdata_segment_table_empty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_empty=yes else ac_cv_lib_mfdata_libmfdata_segment_table_empty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_empty" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_empty" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_empty" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_resize in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_resize in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_resize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_resize (); int main () { return libmfdata_segment_table_resize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_resize=yes else ac_cv_lib_mfdata_libmfdata_segment_table_resize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_resize" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_resize" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_resize" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_read_buffer in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_read_buffer in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_read_buffer (); int main () { return libmfdata_segment_table_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_read_buffer=yes else ac_cv_lib_mfdata_libmfdata_segment_table_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_read_buffer" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_read_buffer" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_read_buffer" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_seek_offset in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_seek_offset in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_seek_offset (); int main () { return libmfdata_segment_table_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_seek_offset=yes else ac_cv_lib_mfdata_libmfdata_segment_table_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_seek_offset" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_seek_offset" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_seek_offset" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_write_buffer in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_write_buffer in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_write_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_write_buffer (); int main () { return libmfdata_segment_table_write_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_write_buffer=yes else ac_cv_lib_mfdata_libmfdata_segment_table_write_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_write_buffer" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_write_buffer" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_write_buffer" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_get_file_io_handle in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_get_file_io_handle in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_get_file_io_handle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_get_file_io_handle (); int main () { return libmfdata_segment_table_get_file_io_handle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_get_file_io_handle=yes else ac_cv_lib_mfdata_libmfdata_segment_table_get_file_io_handle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_get_file_io_handle" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_get_file_io_handle" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_get_file_io_handle" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_get_maximum_segment_size in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_get_maximum_segment_size in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_get_maximum_segment_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_get_maximum_segment_size (); int main () { return libmfdata_segment_table_get_maximum_segment_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_get_maximum_segment_size=yes else ac_cv_lib_mfdata_libmfdata_segment_table_get_maximum_segment_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_get_maximum_segment_size" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_get_maximum_segment_size" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_get_maximum_segment_size" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_get_number_of_segments in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_get_number_of_segments in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_get_number_of_segments+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_get_number_of_segments (); int main () { return libmfdata_segment_table_get_number_of_segments (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_get_number_of_segments=yes else ac_cv_lib_mfdata_libmfdata_segment_table_get_number_of_segments=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_get_number_of_segments" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_get_number_of_segments" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_get_number_of_segments" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_get_value_offset in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_get_value_offset in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_get_value_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_get_value_offset (); int main () { return libmfdata_segment_table_get_value_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_get_value_offset=yes else ac_cv_lib_mfdata_libmfdata_segment_table_get_value_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_get_value_offset" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_get_value_offset" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_get_value_offset" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_get_value_size in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_get_value_size in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_get_value_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_get_value_size (); int main () { return libmfdata_segment_table_get_value_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_get_value_size=yes else ac_cv_lib_mfdata_libmfdata_segment_table_get_value_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_get_value_size" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_get_value_size" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_get_value_size" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_set_maximum_segment_size in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_set_maximum_segment_size in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_set_maximum_segment_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_set_maximum_segment_size (); int main () { return libmfdata_segment_table_set_maximum_segment_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_set_maximum_segment_size=yes else ac_cv_lib_mfdata_libmfdata_segment_table_set_maximum_segment_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_set_maximum_segment_size" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_set_maximum_segment_size" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_set_maximum_segment_size" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmfdata_segment_table_set_segment_by_index in -lmfdata" >&5 $as_echo_n "checking for libmfdata_segment_table_set_segment_by_index in -lmfdata... " >&6; } if ${ac_cv_lib_mfdata_libmfdata_segment_table_set_segment_by_index+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmfdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libmfdata_segment_table_set_segment_by_index (); int main () { return libmfdata_segment_table_set_segment_by_index (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mfdata_libmfdata_segment_table_set_segment_by_index=yes else ac_cv_lib_mfdata_libmfdata_segment_table_set_segment_by_index=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mfdata_libmfdata_segment_table_set_segment_by_index" >&5 $as_echo "$ac_cv_lib_mfdata_libmfdata_segment_table_set_segment_by_index" >&6; } if test "x$ac_cv_lib_mfdata_libmfdata_segment_table_set_segment_by_index" = xyes; then : ac_cv_libmfdata_dummy=yes else ac_cv_libmfdata=no fi ac_cv_libmfdata_LIBADD="-lmfdata" fi fi fi if test "x$ac_cv_libmfdata" = xyes; then : $as_echo "#define HAVE_LIBMFDATA 1" >>confdefs.h fi if test "x$ac_cv_libmfdata" = xyes; then : HAVE_LIBMFDATA=1 else HAVE_LIBMFDATA=0 fi if test "x$ac_cv_libmfdata" != xyes; then : $as_echo "#define HAVE_LOCAL_LIBMFDATA 1" >>confdefs.h HAVE_LOCAL_LIBMFDATA=1 ac_cv_libmfdata_CPPFLAGS="-I../libmfdata"; ac_cv_libmfdata_LIBADD="../libmfdata/libmfdata.la"; ac_cv_libmfdata=local fi if test "x$ac_cv_libmfdata" = xlocal; then HAVE_LOCAL_LIBMFDATA_TRUE= HAVE_LOCAL_LIBMFDATA_FALSE='#' else HAVE_LOCAL_LIBMFDATA_TRUE='#' HAVE_LOCAL_LIBMFDATA_FALSE= fi if test "x$ac_cv_libmfdata_CPPFLAGS" != "x"; then : LIBMFDATA_CPPFLAGS=$ac_cv_libmfdata_CPPFLAGS fi if test "x$ac_cv_libmfdata_LIBADD" != "x"; then : LIBMFDATA_LIBADD=$ac_cv_libmfdata_LIBADD fi if test "x$ac_cv_libmfdata" = xyes; then : ax_libmfdata_pc_libs_private=-lmfdata fi if test "x$ac_cv_libmfdata" = xyes; then : ax_libmfdata_spec_requires=libmfdata ax_libmfdata_spec_build_requires=libmfdata-devel fi # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; ac_cv_with_zlib=$withval else ac_cv_with_zlib=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for zlib in includedir and libdir or in the specified DIR, or no if not to use zlib" >&5 $as_echo_n "checking whether to use search for zlib in includedir and libdir or in the specified DIR, or no if not to use zlib... " >&6; } if ${ac_cv_with_zlib+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_zlib=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_zlib" >&5 $as_echo "$ac_cv_with_zlib" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_zlib" = xno; then : ac_cv_zlib=no else ac_cv_zlib=check if test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xauto-detect; then : if test -d "$ac_cv_with_zlib"; then : CFLAGS="$CFLAGS -I${ac_cv_with_zlib}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_zlib}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_zlib See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5 $as_echo_n "checking for zlib... " >&6; } if test -n "$zlib_CFLAGS"; then pkg_cv_zlib_CFLAGS="$zlib_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib >= 1.2.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_zlib_CFLAGS=`$PKG_CONFIG --cflags "zlib >= 1.2.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$zlib_LIBS"; then pkg_cv_zlib_LIBS="$zlib_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib >= 1.2.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_zlib_LIBS=`$PKG_CONFIG --libs "zlib >= 1.2.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then zlib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib >= 1.2.5" 2>&1` else zlib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib >= 1.2.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$zlib_PKG_ERRORS" >&5 ac_cv_zlib=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_zlib=check else zlib_CFLAGS=$pkg_cv_zlib_CFLAGS zlib_LIBS=$pkg_cv_zlib_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_zlib=zlib fi fi if test "x$ac_cv_zlib" = xzlib; then : ac_cv_zlib_CPPFLAGS="$pkg_cv_zlib_CFLAGS" ac_cv_zlib_LIBADD="$pkg_cv_zlib_LIBS" fi fi if test "x$ac_cv_zlib" = xcheck; then : for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ZLIB_H 1 _ACEOF fi done if test "x$ac_cv_header_zlib_h" = xno; then : ac_cv_zlib=no else ac_cv_zlib=zlib { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 $as_echo_n "checking for zlibVersion in -lz... " >&6; } if ${ac_cv_lib_z_zlibVersion+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char zlibVersion (); int main () { return zlibVersion (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_zlibVersion=yes else ac_cv_lib_z_zlibVersion=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 $as_echo "$ac_cv_lib_z_zlibVersion" >&6; } if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else ac_cv_zlib=no fi if test "x$ac_cv_lib_z_zlibVersion" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: zlibVersion in library: zlib. See \`config.log' for more details" "$LINENO" 5; } fi ac_cv_zlib_LIBADD="-lz"; fi fi fi if test "x$ac_cv_zlib" = xzlib; then : $as_echo "#define HAVE_ZLIB 1" >>confdefs.h fi if test "x$ac_cv_zlib" != xno; then : HAVE_ZLIB=1 else HAVE_ZLIB=0 fi if test "x$ac_cv_zlib_CPPFLAGS" != "x"; then : ZLIB_CPPFLAGS=$ac_cv_zlib_CPPFLAGS fi if test "x$ac_cv_zlib_LIBADD" != "x"; then : ZLIB_LIBADD=$ac_cv_zlib_LIBADD fi if test "x$ac_cv_zlib" = xzlib; then : ax_zlib_pc_libs_private=-lz fi if test "x$ac_cv_zlib" = xzlib; then : ax_zlib_spec_requires=zlib ax_zlib_spec_build_requires=zlib-devel ax_zlib_static_spec_requires=zlib-static ax_zlib_static_spec_build_requires=zlib-static fi # Check whether --with-adler32 was given. if test "${with_adler32+set}" = set; then : withval=$with_adler32; ac_cv_with_adler32=$withval else ac_cv_with_adler32=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use specify which alder32 implementation to use, options: 'auto-detect', 'zlib' or 'local'" >&5 $as_echo_n "checking whether to use specify which alder32 implementation to use, options: 'auto-detect', 'zlib' or 'local'... " >&6; } if ${ac_cv_with_adler32+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_adler32=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_adler32" >&5 $as_echo "$ac_cv_with_adler32" >&6; } if test "x$ac_cv_zlib" != xzlib; then : ac_cv_adler32=local else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for adler32 in -lz" >&5 $as_echo_n "checking for adler32 in -lz... " >&6; } if ${ac_cv_lib_z_adler32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char adler32 (); int main () { return adler32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_adler32=yes else ac_cv_lib_z_adler32=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_adler32" >&5 $as_echo "$ac_cv_lib_z_adler32" >&6; } if test "x$ac_cv_lib_z_adler32" = xyes; then : ac_zlib_dummy=yes fi if test "x$ac_cv_lib_z_adler32" = xyes; then : if test "x$ac_cv_with_adler32" != xzlib && test "x$ac_cv_with_adler32" != xauto-detect; then : ac_cv_adler32=local else $as_echo "#define HAVE_ZLIB_ADLER32 1" >>confdefs.h ac_cv_adler32=zlib fi else if test "x$ac_cv_with_adler32" = xzlib; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: adler32 in library: zlib. See \`config.log' for more details" "$LINENO" 5; } fi ac_cv_adler32=local fi fi if test "x$ac_cv_zlib" = xzlib; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 $as_echo_n "checking for compress2 in -lz... " >&6; } if ${ac_cv_lib_z_compress2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress2 (); int main () { return compress2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_compress2=yes else ac_cv_lib_z_compress2=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress2" >&5 $as_echo "$ac_cv_lib_z_compress2" >&6; } if test "x$ac_cv_lib_z_compress2" = xyes; then : ac_zlib_dummy=yes fi if test "x$ac_cv_lib_z_compress2" = xyes; then : $as_echo "#define HAVE_ZLIB_COMPRESS2 1" >>confdefs.h fi fi if test "x$ac_cv_zlib" = xzlib; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressBound in -lz" >&5 $as_echo_n "checking for compressBound in -lz... " >&6; } if ${ac_cv_lib_z_compressBound+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compressBound (); int main () { return compressBound (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_compressBound=yes else ac_cv_lib_z_compressBound=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compressBound" >&5 $as_echo "$ac_cv_lib_z_compressBound" >&6; } if test "x$ac_cv_lib_z_compressBound" = xyes; then : ac_zlib_dummy=yes fi if test "x$ac_cv_lib_z_compressBound" = xyes; then : $as_echo "#define HAVE_ZLIB_COMPRESSBOUND 1" >>confdefs.h fi fi if test "x$ac_cv_zlib" != xzlib; then : ac_cv_uncompress=local else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uncompress in -lz" >&5 $as_echo_n "checking for uncompress in -lz... " >&6; } if ${ac_cv_lib_z_uncompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uncompress (); int main () { return uncompress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_uncompress=yes else ac_cv_lib_z_uncompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_uncompress" >&5 $as_echo "$ac_cv_lib_z_uncompress" >&6; } if test "x$ac_cv_lib_z_uncompress" = xyes; then : ac_cv_uncompress=zlib else ac_cv_uncompress=local fi if test "x$ac_cv_uncompress" = xzlib; then : $as_echo "#define HAVE_ZLIB_UNCOMPRESS 1" >>confdefs.h fi fi # Check whether --with-libhmac was given. if test "${with_libhmac+set}" = set; then : withval=$with_libhmac; ac_cv_with_libhmac=$withval else ac_cv_with_libhmac=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libhmac+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libhmac=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libhmac" >&5 $as_echo "$ac_cv_with_libhmac" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libhmac" = xno; then : ac_cv_libhmac=no else ac_cv_libhmac=check if test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect; then : if test -d "$ac_cv_with_libhmac"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libhmac}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libhmac}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libhmac See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac" >&5 $as_echo_n "checking for libhmac... " >&6; } if test -n "$libhmac_CFLAGS"; then pkg_cv_libhmac_CFLAGS="$libhmac_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libhmac >= 20160802\""; } >&5 ($PKG_CONFIG --exists --print-errors "libhmac >= 20160802") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libhmac_CFLAGS=`$PKG_CONFIG --cflags "libhmac >= 20160802" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libhmac_LIBS"; then pkg_cv_libhmac_LIBS="$libhmac_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libhmac >= 20160802\""; } >&5 ($PKG_CONFIG --exists --print-errors "libhmac >= 20160802") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libhmac_LIBS=`$PKG_CONFIG --libs "libhmac >= 20160802" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libhmac_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libhmac >= 20160802" 2>&1` else libhmac_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libhmac >= 20160802" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libhmac_PKG_ERRORS" >&5 ac_cv_libhmac=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libhmac=check else libhmac_CFLAGS=$pkg_cv_libhmac_CFLAGS libhmac_LIBS=$pkg_cv_libhmac_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libhmac=yes fi fi if test "x$ac_cv_libhmac" = xyes; then : ac_cv_libhmac_CPPFLAGS="$pkg_cv_libhmac_CFLAGS" ac_cv_libhmac_LIBADD="$pkg_cv_libhmac_LIBS" fi fi if test "x$ac_cv_libhmac" = xcheck; then : for ac_header in libhmac.h do : ac_fn_c_check_header_mongrel "$LINENO" "libhmac.h" "ac_cv_header_libhmac_h" "$ac_includes_default" if test "x$ac_cv_header_libhmac_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBHMAC_H 1 _ACEOF fi done if test "x$ac_cv_header_libhmac_h" = xno; then : ac_cv_libhmac=no else ac_cv_libhmac=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_get_version in -lhmac" >&5 $as_echo_n "checking for libhmac_get_version in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_get_version (); int main () { return libhmac_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_get_version=yes else ac_cv_lib_hmac_libhmac_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_get_version" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_get_version" >&6; } if test "x$ac_cv_lib_hmac_libhmac_get_version" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_initialize in -lhmac" >&5 $as_echo_n "checking for libhmac_md5_initialize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_md5_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_md5_initialize (); int main () { return libhmac_md5_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_md5_initialize=yes else ac_cv_lib_hmac_libhmac_md5_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_initialize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_md5_initialize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_md5_initialize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_update in -lhmac" >&5 $as_echo_n "checking for libhmac_md5_update in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_md5_update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_md5_update (); int main () { return libhmac_md5_update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_md5_update=yes else ac_cv_lib_hmac_libhmac_md5_update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_update" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_md5_update" >&6; } if test "x$ac_cv_lib_hmac_libhmac_md5_update" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_finalize in -lhmac" >&5 $as_echo_n "checking for libhmac_md5_finalize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_md5_finalize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_md5_finalize (); int main () { return libhmac_md5_finalize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_md5_finalize=yes else ac_cv_lib_hmac_libhmac_md5_finalize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_finalize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_md5_finalize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_md5_finalize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_free in -lhmac" >&5 $as_echo_n "checking for libhmac_md5_free in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_md5_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_md5_free (); int main () { return libhmac_md5_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_md5_free=yes else ac_cv_lib_hmac_libhmac_md5_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_free" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_md5_free" >&6; } if test "x$ac_cv_lib_hmac_libhmac_md5_free" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_initialize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha1_initialize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha1_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha1_initialize (); int main () { return libhmac_sha1_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha1_initialize=yes else ac_cv_lib_hmac_libhmac_sha1_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_initialize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha1_initialize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha1_initialize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_update in -lhmac" >&5 $as_echo_n "checking for libhmac_sha1_update in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha1_update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha1_update (); int main () { return libhmac_sha1_update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha1_update=yes else ac_cv_lib_hmac_libhmac_sha1_update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_update" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha1_update" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha1_update" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_finalize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha1_finalize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha1_finalize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha1_finalize (); int main () { return libhmac_sha1_finalize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha1_finalize=yes else ac_cv_lib_hmac_libhmac_sha1_finalize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_finalize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha1_finalize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha1_finalize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_free in -lhmac" >&5 $as_echo_n "checking for libhmac_sha1_free in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha1_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha1_free (); int main () { return libhmac_sha1_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha1_free=yes else ac_cv_lib_hmac_libhmac_sha1_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_free" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha1_free" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha1_free" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_initialize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha224_initialize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha224_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha224_initialize (); int main () { return libhmac_sha224_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha224_initialize=yes else ac_cv_lib_hmac_libhmac_sha224_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_initialize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha224_initialize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha224_initialize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_update in -lhmac" >&5 $as_echo_n "checking for libhmac_sha224_update in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha224_update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha224_update (); int main () { return libhmac_sha224_update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha224_update=yes else ac_cv_lib_hmac_libhmac_sha224_update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_update" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha224_update" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha224_update" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_finalize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha224_finalize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha224_finalize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha224_finalize (); int main () { return libhmac_sha224_finalize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha224_finalize=yes else ac_cv_lib_hmac_libhmac_sha224_finalize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_finalize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha224_finalize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha224_finalize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_free in -lhmac" >&5 $as_echo_n "checking for libhmac_sha224_free in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha224_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha224_free (); int main () { return libhmac_sha224_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha224_free=yes else ac_cv_lib_hmac_libhmac_sha224_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_free" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha224_free" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha224_free" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_initialize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha256_initialize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha256_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha256_initialize (); int main () { return libhmac_sha256_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha256_initialize=yes else ac_cv_lib_hmac_libhmac_sha256_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_initialize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha256_initialize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha256_initialize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_update in -lhmac" >&5 $as_echo_n "checking for libhmac_sha256_update in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha256_update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha256_update (); int main () { return libhmac_sha256_update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha256_update=yes else ac_cv_lib_hmac_libhmac_sha256_update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_update" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha256_update" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha256_update" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_finalize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha256_finalize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha256_finalize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha256_finalize (); int main () { return libhmac_sha256_finalize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha256_finalize=yes else ac_cv_lib_hmac_libhmac_sha256_finalize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_finalize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha256_finalize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha256_finalize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_free in -lhmac" >&5 $as_echo_n "checking for libhmac_sha256_free in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha256_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha256_free (); int main () { return libhmac_sha256_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha256_free=yes else ac_cv_lib_hmac_libhmac_sha256_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_free" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha256_free" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha256_free" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_initialize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha512_initialize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha512_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha512_initialize (); int main () { return libhmac_sha512_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha512_initialize=yes else ac_cv_lib_hmac_libhmac_sha512_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_initialize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha512_initialize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha512_initialize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_update in -lhmac" >&5 $as_echo_n "checking for libhmac_sha512_update in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha512_update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha512_update (); int main () { return libhmac_sha512_update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha512_update=yes else ac_cv_lib_hmac_libhmac_sha512_update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_update" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha512_update" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha512_update" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_finalize in -lhmac" >&5 $as_echo_n "checking for libhmac_sha512_finalize in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha512_finalize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha512_finalize (); int main () { return libhmac_sha512_finalize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha512_finalize=yes else ac_cv_lib_hmac_libhmac_sha512_finalize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_finalize" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha512_finalize" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha512_finalize" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_free in -lhmac" >&5 $as_echo_n "checking for libhmac_sha512_free in -lhmac... " >&6; } if ${ac_cv_lib_hmac_libhmac_sha512_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libhmac_sha512_free (); int main () { return libhmac_sha512_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hmac_libhmac_sha512_free=yes else ac_cv_lib_hmac_libhmac_sha512_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_free" >&5 $as_echo "$ac_cv_lib_hmac_libhmac_sha512_free" >&6; } if test "x$ac_cv_lib_hmac_libhmac_sha512_free" = xyes; then : ac_cv_libhmac_dummy=yes else ac_cv_libhmac=no fi ac_cv_libhmac_LIBADD="-lhmac" fi fi if test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect && test "x$ac_cv_libhmac" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libhmac in directory: $ac_cv_with_libhmac See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libhmac" = xyes; then : $as_echo "#define HAVE_LIBHMAC 1" >>confdefs.h fi if test "x$ac_cv_libhmac" = xyes; then : ac_cv_libhmac_md5=libhmac ac_cv_libhmac_sha1=libhmac ac_cv_libhmac_sha224=libhmac ac_cv_libhmac_sha256=libhmac ac_cv_libhmac_sha512=libhmac else ac_cv_libhmac_md5=no ac_cv_libhmac_sha1=no ac_cv_libhmac_sha224=no ac_cv_libhmac_sha256=no ac_cv_libhmac_sha512=no fi if test "x$ac_cv_libhmac" = xyes; then : HAVE_LIBHMAC=1 else HAVE_LIBHMAC=0 fi if test "x$ac_cv_libhmac" != xyes; then : # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; ac_cv_with_openssl=$withval else ac_cv_with_openssl=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL" >&5 $as_echo_n "checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL... " >&6; } if ${ac_cv_with_openssl+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_openssl=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_openssl" >&5 $as_echo "$ac_cv_with_openssl" >&6; } # Check whether --enable-openssl-evp-cipher was given. if test "${enable_openssl_evp_cipher+set}" = set; then : enableval=$enable_openssl_evp_cipher; ac_cv_enable_openssl_evp_cipher=$enableval else ac_cv_enable_openssl_evp_cipher=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable" >&5 $as_echo_n "checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable... " >&6; } if ${ac_cv_enable_openssl_evp_cipher+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_openssl_evp_cipher=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_cipher" >&5 $as_echo "$ac_cv_enable_openssl_evp_cipher" >&6; } # Check whether --enable-openssl-evp-md was given. if test "${enable_openssl_evp_md+set}" = set; then : enableval=$enable_openssl_evp_md; ac_cv_enable_openssl_evp_md=$enableval else ac_cv_enable_openssl_evp_md=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP MD support, or no to disable" >&5 $as_echo_n "checking whether to enable enable OpenSSL EVP MD support, or no to disable... " >&6; } if ${ac_cv_enable_openssl_evp_md+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_openssl_evp_md=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_md" >&5 $as_echo "$ac_cv_enable_openssl_evp_md" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_openssl" = xno; then : ac_cv_libcrypto=no else if test "x$ac_cv_with_openssl" != x && test "x$ac_cv_with_openssl" != xauto-detect; then : if test -d "$ac_cv_with_openssl"; then : CFLAGS="$CFLAGS -I${ac_cv_with_openssl}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_openssl}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_openssl See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl" >&5 $as_echo_n "checking for openssl... " >&6; } if test -n "$openssl_CFLAGS"; then pkg_cv_openssl_CFLAGS="$openssl_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_openssl_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$openssl_LIBS"; then pkg_cv_openssl_LIBS="$openssl_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_openssl_LIBS=`$PKG_CONFIG --libs "openssl >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.0" 2>&1` else openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$openssl_PKG_ERRORS" >&5 ac_cv_libcrypto=no ac_cv_libcrypto_evp=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libcrypto=no ac_cv_libcrypto_evp=no else openssl_CFLAGS=$pkg_cv_openssl_CFLAGS openssl_LIBS=$pkg_cv_openssl_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes fi fi if test "x$ac_cv_libcrypto" = xyes; then : ac_cv_libcrypto_CPPFLAGS="$pkg_cv_openssl_CFLAGS" ac_cv_libcrypto_LIBADD="$pkg_cv_openssl_LIBS" fi fi if test "x$ac_cv_libcrypto" != xyes; then : for ac_header in openssl/opensslv.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/opensslv.h" "ac_cv_header_openssl_opensslv_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_opensslv_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_OPENSSLV_H 1 _ACEOF fi done for ac_header in openssl/evp.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_evp_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_EVP_H 1 _ACEOF fi done if test "x$ac_cv_header_openssl_evp_h" = xno; then : ac_cv_libcrypto=no ac_cv_libcrypto_evp=no else { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openssl/evp.h can be used in combination with zlib.h" >&5 $as_echo_n "checking if openssl/evp.h can be used in combination with zlib.h... " >&6; } if ${ac_cv_openssl_evp_zlib_compatible+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_openssl_evp_zlib_compatible=yes else ac_cv_openssl_evp_zlib_compatible=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_openssl_evp_zlib_compatible" >&5 $as_echo "$ac_cv_openssl_evp_zlib_compatible" >&6; } if test "x$ac_cv_openssl_evp_zlib_compatible" = xyes; then : ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes else ac_cv_libcrypto=no ac_cv_libcrypto_evp=no fi fi if test "x$ac_cv_libcrypto_evp" != xyes && test "$ac_cv_header_openssl_opensslv" = xyes; then : ac_cv_libcrypto=yes fi fi if test "x$ac_cv_libcrypto" = xyes && test "x$ac_cv_libcrypto_evp" = xyes; then : $as_echo "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h HAVE_OPENSSL_EVP_H=1 else HAVE_OPENSSL_EVP_H=0 fi if test "x$ac_cv_libcrypto" != xno; then : $as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h ac_cv_libcrypto_LIBADD="-lcrypto" case $host in #( *cygwin*) : ac_cv_libcrypto_LIBADD="-lcrypto -lz" ;; #( *) : ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : LIBDL_LIBADD="-ldl" fi fi fi if test "x$ac_cv_libcrypto_CPPFLAGS" != "x"; then : LIBCRYPTO_CPPFLAGS=$ac_cv_libcrypto_CPPFLAGS fi if test "x$ac_cv_libcrypto_LIBADD" != "x"; then : LIBCRYPTO_LIBADD=$ac_cv_libcrypto_LIBADD fi if test "x$ac_cv_libcrypto" != xno; then : ax_libcrypto_pc_libs_private=-lcrypto fi if test "x$ac_cv_libcrypto" != xno; then : ax_libcrypto_spec_requires=openssl ax_libcrypto_spec_build_requires=openssl-devel fi if test "x$ac_cv_libcrypto" != xno; then : ac_cv_libcrypto_md5=no if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_libcrypto_evp_md" != xyes; then : ac_cv_libcrypto_evp_md=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_new (); int main () { return EVP_MD_CTX_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes else ac_cv_lib_crypto_EVP_MD_CTX_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_dummy=no fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_free (); int main () { return EVP_MD_CTX_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes else ac_cv_lib_crypto_EVP_MD_CTX_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_init (); int main () { return EVP_MD_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes else ac_cv_lib_crypto_EVP_MD_CTX_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_cleanup (); int main () { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes else ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 $as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ERR_remove_thread_state (); int main () { return ERR_remove_thread_state (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_ERR_remove_thread_state=yes else ac_cv_lib_crypto_ERR_remove_thread_state=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 $as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestInit_ex (); int main () { return EVP_DigestInit_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes else ac_cv_lib_crypto_EVP_DigestInit_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestUpdate (); int main () { return EVP_DigestUpdate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestUpdate=yes else ac_cv_lib_crypto_EVP_DigestUpdate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestFinal_ex (); int main () { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes else ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_evp_md" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_md5 in -lcrypto" >&5 $as_echo_n "checking for EVP_md5 in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_md5+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_md5 (); int main () { return EVP_md5 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_md5=yes else ac_cv_lib_crypto_EVP_md5=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_md5" >&5 $as_echo "$ac_cv_lib_crypto_EVP_md5" >&6; } if test "x$ac_cv_lib_crypto_EVP_md5" = xyes; then : ac_cv_libcrypto_md5=libcrypto_evp else ac_cv_libcrypto_md5=no fi if test "x$ac_cv_libcrypto_md5" = xlibcrypto_evp; then : $as_echo "#define HAVE_EVP_MD5 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_md5" = xno; then : for ac_header in openssl/md5.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_md5_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_MD5_H 1 _ACEOF fi done if test "x$ac_cv_header_openssl_md5_h" = xno; then : ac_cv_libcrypto_md5=no else ac_cv_libcrypto_md5=libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Init in -lcrypto" >&5 $as_echo_n "checking for MD5_Init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_MD5_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MD5_Init (); int main () { return MD5_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_MD5_Init=yes else ac_cv_lib_crypto_MD5_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Init" >&5 $as_echo "$ac_cv_lib_crypto_MD5_Init" >&6; } if test "x$ac_cv_lib_crypto_MD5_Init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_md5=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5 $as_echo_n "checking for MD5_Update in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_MD5_Update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MD5_Update (); int main () { return MD5_Update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_MD5_Update=yes else ac_cv_lib_crypto_MD5_Update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5 $as_echo "$ac_cv_lib_crypto_MD5_Update" >&6; } if test "x$ac_cv_lib_crypto_MD5_Update" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_md5=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Final in -lcrypto" >&5 $as_echo_n "checking for MD5_Final in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_MD5_Final+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MD5_Final (); int main () { return MD5_Final (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_MD5_Final=yes else ac_cv_lib_crypto_MD5_Final=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Final" >&5 $as_echo "$ac_cv_lib_crypto_MD5_Final" >&6; } if test "x$ac_cv_lib_crypto_MD5_Final" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_md5=no fi fi if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_md5" = xlibcrypto; then : ac_cv_libcrypto=yes fi fi ac_cv_libcrypto_sha1=no if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : ac_cv_libcrypto_evp_md=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_new (); int main () { return EVP_MD_CTX_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes else ac_cv_lib_crypto_EVP_MD_CTX_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_dummy=no fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_free (); int main () { return EVP_MD_CTX_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes else ac_cv_lib_crypto_EVP_MD_CTX_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_init (); int main () { return EVP_MD_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes else ac_cv_lib_crypto_EVP_MD_CTX_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_cleanup (); int main () { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes else ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 $as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ERR_remove_thread_state (); int main () { return ERR_remove_thread_state (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_ERR_remove_thread_state=yes else ac_cv_lib_crypto_ERR_remove_thread_state=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 $as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestInit_ex (); int main () { return EVP_DigestInit_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes else ac_cv_lib_crypto_EVP_DigestInit_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestUpdate (); int main () { return EVP_DigestUpdate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestUpdate=yes else ac_cv_lib_crypto_EVP_DigestUpdate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestFinal_ex (); int main () { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes else ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_evp_md" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha1 in -lcrypto" >&5 $as_echo_n "checking for EVP_sha1 in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_sha1+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_sha1 (); int main () { return EVP_sha1 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_sha1=yes else ac_cv_lib_crypto_EVP_sha1=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha1" >&5 $as_echo "$ac_cv_lib_crypto_EVP_sha1" >&6; } if test "x$ac_cv_lib_crypto_EVP_sha1" = xyes; then : ac_cv_libcrypto_sha1=libcrypto_evp else ac_cv_libcrypto_sha1=no fi if test "x$ac_cv_libcrypto_sha1" = xlibcrypto_evp; then : $as_echo "#define HAVE_EVP_SHA1 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_sha1" = xno; then : for ac_header in openssl/sha.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_SHA_H 1 _ACEOF fi done if test "x$ac_cv_header_openssl_sha_h" = xno; then : ac_cv_libcrypto_sha1=no else ac_cv_libcrypto_sha1=libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Init in -lcrypto" >&5 $as_echo_n "checking for SHA1_Init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA1_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA1_Init (); int main () { return SHA1_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA1_Init=yes else ac_cv_lib_crypto_SHA1_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Init" >&5 $as_echo "$ac_cv_lib_crypto_SHA1_Init" >&6; } if test "x$ac_cv_lib_crypto_SHA1_Init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha1=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Update in -lcrypto" >&5 $as_echo_n "checking for SHA1_Update in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA1_Update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA1_Update (); int main () { return SHA1_Update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA1_Update=yes else ac_cv_lib_crypto_SHA1_Update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Update" >&5 $as_echo "$ac_cv_lib_crypto_SHA1_Update" >&6; } if test "x$ac_cv_lib_crypto_SHA1_Update" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha1=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Final in -lcrypto" >&5 $as_echo_n "checking for SHA1_Final in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA1_Final+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA1_Final (); int main () { return SHA1_Final (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA1_Final=yes else ac_cv_lib_crypto_SHA1_Final=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Final" >&5 $as_echo "$ac_cv_lib_crypto_SHA1_Final" >&6; } if test "x$ac_cv_lib_crypto_SHA1_Final" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha1=no fi fi if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha1" = xlibcrypto; then : ac_cv_libcrypto=yes fi fi ac_cv_libcrypto_sha224=no if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : ac_cv_libcrypto_evp_md=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_new (); int main () { return EVP_MD_CTX_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes else ac_cv_lib_crypto_EVP_MD_CTX_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_dummy=no fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_free (); int main () { return EVP_MD_CTX_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes else ac_cv_lib_crypto_EVP_MD_CTX_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_init (); int main () { return EVP_MD_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes else ac_cv_lib_crypto_EVP_MD_CTX_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_cleanup (); int main () { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes else ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 $as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ERR_remove_thread_state (); int main () { return ERR_remove_thread_state (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_ERR_remove_thread_state=yes else ac_cv_lib_crypto_ERR_remove_thread_state=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 $as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestInit_ex (); int main () { return EVP_DigestInit_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes else ac_cv_lib_crypto_EVP_DigestInit_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestUpdate (); int main () { return EVP_DigestUpdate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestUpdate=yes else ac_cv_lib_crypto_EVP_DigestUpdate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestFinal_ex (); int main () { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes else ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_evp_md" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha224 in -lcrypto" >&5 $as_echo_n "checking for EVP_sha224 in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_sha224+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_sha224 (); int main () { return EVP_sha224 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_sha224=yes else ac_cv_lib_crypto_EVP_sha224=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha224" >&5 $as_echo "$ac_cv_lib_crypto_EVP_sha224" >&6; } if test "x$ac_cv_lib_crypto_EVP_sha224" = xyes; then : ac_cv_libcrypto_sha224=libcrypto_evp else ac_cv_libcrypto_sha224=no fi if test "x$ac_cv_libcrypto_sha224" = xlibcrypto_evp; then : $as_echo "#define HAVE_EVP_SHA224 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_sha224" = xno; then : for ac_header in openssl/sha.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_SHA_H 1 _ACEOF fi done if test "x$ac_cv_header_openssl_sha_h" = xno; then : ac_cv_libcrypto_sha224=no else ac_cv_libcrypto_sha224=libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5 $as_echo_n "checking for SHA224_Init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA224_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA224_Init (); int main () { return SHA224_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA224_Init=yes else ac_cv_lib_crypto_SHA224_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5 $as_echo "$ac_cv_lib_crypto_SHA224_Init" >&6; } if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha224=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Update in -lcrypto" >&5 $as_echo_n "checking for SHA224_Update in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA224_Update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA224_Update (); int main () { return SHA224_Update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA224_Update=yes else ac_cv_lib_crypto_SHA224_Update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Update" >&5 $as_echo "$ac_cv_lib_crypto_SHA224_Update" >&6; } if test "x$ac_cv_lib_crypto_SHA224_Update" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha224=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Final in -lcrypto" >&5 $as_echo_n "checking for SHA224_Final in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA224_Final+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA224_Final (); int main () { return SHA224_Final (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA224_Final=yes else ac_cv_lib_crypto_SHA224_Final=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Final" >&5 $as_echo "$ac_cv_lib_crypto_SHA224_Final" >&6; } if test "x$ac_cv_lib_crypto_SHA224_Final" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha224=no fi fi if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha224" = xlibcrypto; then : ac_cv_libcrypto=yes fi fi ac_cv_libcrypto_sha256=no if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : ac_cv_libcrypto_evp_md=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_new (); int main () { return EVP_MD_CTX_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes else ac_cv_lib_crypto_EVP_MD_CTX_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_dummy=no fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_free (); int main () { return EVP_MD_CTX_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes else ac_cv_lib_crypto_EVP_MD_CTX_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_init (); int main () { return EVP_MD_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes else ac_cv_lib_crypto_EVP_MD_CTX_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_cleanup (); int main () { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes else ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 $as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ERR_remove_thread_state (); int main () { return ERR_remove_thread_state (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_ERR_remove_thread_state=yes else ac_cv_lib_crypto_ERR_remove_thread_state=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 $as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestInit_ex (); int main () { return EVP_DigestInit_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes else ac_cv_lib_crypto_EVP_DigestInit_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestUpdate (); int main () { return EVP_DigestUpdate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestUpdate=yes else ac_cv_lib_crypto_EVP_DigestUpdate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestFinal_ex (); int main () { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes else ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_evp_md" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 $as_echo_n "checking for EVP_sha256 in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_sha256+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_sha256 (); int main () { return EVP_sha256 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_sha256=yes else ac_cv_lib_crypto_EVP_sha256=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha256" >&5 $as_echo "$ac_cv_lib_crypto_EVP_sha256" >&6; } if test "x$ac_cv_lib_crypto_EVP_sha256" = xyes; then : ac_cv_libcrypto_sha256=libcrypto_evp else ac_cv_libcrypto_sha256=no fi if test "x$ac_cv_libcrypto_sha256" = xlibcrypto_evp; then : $as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_sha256" = xno; then : for ac_header in openssl/sha.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_SHA_H 1 _ACEOF fi done if test "x$ac_cv_header_openssl_sha_h" = xno; then : ac_cv_libcrypto_sha256=no else ac_cv_libcrypto_sha256=libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5 $as_echo_n "checking for SHA256_Init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA256_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA256_Init (); int main () { return SHA256_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA256_Init=yes else ac_cv_lib_crypto_SHA256_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5 $as_echo "$ac_cv_lib_crypto_SHA256_Init" >&6; } if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha256=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Update in -lcrypto" >&5 $as_echo_n "checking for SHA256_Update in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA256_Update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA256_Update (); int main () { return SHA256_Update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA256_Update=yes else ac_cv_lib_crypto_SHA256_Update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Update" >&5 $as_echo "$ac_cv_lib_crypto_SHA256_Update" >&6; } if test "x$ac_cv_lib_crypto_SHA256_Update" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha256=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Final in -lcrypto" >&5 $as_echo_n "checking for SHA256_Final in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA256_Final+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA256_Final (); int main () { return SHA256_Final (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA256_Final=yes else ac_cv_lib_crypto_SHA256_Final=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Final" >&5 $as_echo "$ac_cv_lib_crypto_SHA256_Final" >&6; } if test "x$ac_cv_lib_crypto_SHA256_Final" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha256=no fi fi if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha256" = xlibcrypto; then : ac_cv_libcrypto=yes fi fi ac_cv_libcrypto_sha512=no if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : ac_cv_libcrypto_evp_md=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_new (); int main () { return EVP_MD_CTX_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes else ac_cv_lib_crypto_EVP_MD_CTX_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_dummy=no fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_free (); int main () { return EVP_MD_CTX_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes else ac_cv_lib_crypto_EVP_MD_CTX_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_init (); int main () { return EVP_MD_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes else ac_cv_lib_crypto_EVP_MD_CTX_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 $as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_MD_CTX_cleanup (); int main () { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes else ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 $as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 $as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ERR_remove_thread_state (); int main () { return ERR_remove_thread_state (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_ERR_remove_thread_state=yes else ac_cv_lib_crypto_ERR_remove_thread_state=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 $as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestInit_ex (); int main () { return EVP_DigestInit_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes else ac_cv_lib_crypto_EVP_DigestInit_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestUpdate (); int main () { return EVP_DigestUpdate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestUpdate=yes else ac_cv_lib_crypto_EVP_DigestUpdate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 $as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_DigestFinal_ex (); int main () { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes else ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 $as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_evp_md=no fi if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h fi if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : $as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_evp_md" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha512 in -lcrypto" >&5 $as_echo_n "checking for EVP_sha512 in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_EVP_sha512+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EVP_sha512 (); int main () { return EVP_sha512 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_EVP_sha512=yes else ac_cv_lib_crypto_EVP_sha512=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha512" >&5 $as_echo "$ac_cv_lib_crypto_EVP_sha512" >&6; } if test "x$ac_cv_lib_crypto_EVP_sha512" = xyes; then : ac_cv_libcrypto_sha512=libcrypto_evp else ac_cv_libcrypto_sha512=no fi if test "x$ac_cv_libcrypto_sha512" = xlibcrypto_evp; then : $as_echo "#define HAVE_EVP_SHA512 1" >>confdefs.h fi fi if test "x$ac_cv_libcrypto_sha512" = xno; then : for ac_header in openssl/sha.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_SHA_H 1 _ACEOF fi done if test "x$ac_cv_header_openssl_sha_h" = xno; then : ac_cv_libcrypto_sha512=no else ac_cv_libcrypto_sha512=libcrypto { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5 $as_echo_n "checking for SHA512_Init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA512_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA512_Init (); int main () { return SHA512_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA512_Init=yes else ac_cv_lib_crypto_SHA512_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5 $as_echo "$ac_cv_lib_crypto_SHA512_Init" >&6; } if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha512=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Update in -lcrypto" >&5 $as_echo_n "checking for SHA512_Update in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA512_Update+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA512_Update (); int main () { return SHA512_Update (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA512_Update=yes else ac_cv_lib_crypto_SHA512_Update=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Update" >&5 $as_echo "$ac_cv_lib_crypto_SHA512_Update" >&6; } if test "x$ac_cv_lib_crypto_SHA512_Update" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha512=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Final in -lcrypto" >&5 $as_echo_n "checking for SHA512_Final in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SHA512_Final+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SHA512_Final (); int main () { return SHA512_Final (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SHA512_Final=yes else ac_cv_lib_crypto_SHA512_Final=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Final" >&5 $as_echo "$ac_cv_lib_crypto_SHA512_Final" >&6; } if test "x$ac_cv_lib_crypto_SHA512_Final" = xyes; then : ac_cv_libcrypto_dummy=yes else ac_cv_libcrypto_sha512=no fi fi if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha512" = xlibcrypto; then : ac_cv_libcrypto=yes fi fi fi if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_md5" = xno; then : ac_cv_libhmac_md5=local else ac_cv_libhmac_md5=$ac_cv_libcrypto_md5 fi if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha1" = xno; then : ac_cv_libhmac_sha1=local else ac_cv_libhmac_sha1=$ac_cv_libcrypto_sha1 fi if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha224" = xno; then : ac_cv_libhmac_sha224=local else ac_cv_libhmac_sha224=$ac_cv_libcrypto_sha224 fi if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha256" = xno; then : ac_cv_libhmac_sha256=local else ac_cv_libhmac_sha256=$ac_cv_libcrypto_sha256 fi if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha512" = xno; then : ac_cv_libhmac_sha512=local else ac_cv_libhmac_sha512=$ac_cv_libcrypto_sha512 fi ac_cv_libhmac_CPPFLAGS="-I../libhmac"; ac_cv_libhmac_LIBADD="../libhmac/libhmac.la"; ac_cv_libhmac=local $as_echo "#define HAVE_LOCAL_LIBHMAC 1" >>confdefs.h HAVE_LOCAL_LIBHMAC=1 fi if test "x$ac_cv_libhmac" = xlocal; then HAVE_LOCAL_LIBHMAC_TRUE= HAVE_LOCAL_LIBHMAC_FALSE='#' else HAVE_LOCAL_LIBHMAC_TRUE='#' HAVE_LOCAL_LIBHMAC_FALSE= fi if test "x$ac_cv_libhmac_CPPFLAGS" != "x"; then : LIBHMAC_CPPFLAGS=$ac_cv_libhmac_CPPFLAGS fi if test "x$ac_cv_libhmac_LIBADD" != "x"; then : LIBHMAC_LIBADD=$ac_cv_libhmac_LIBADD fi if test "x$ac_cv_libhmac" = xyes; then : ax_libhmac_pc_libs_private=-lhmac fi if test "x$ac_cv_libhmac" = xyes; then : ax_libhmac_spec_requires=libhmac ax_libhmac_spec_build_requires=libhmac-devel fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_func in localtime localtime_r mktime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_localtime" != xyes && test "x$ac_cv_func_localtime_r" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: localtime and localtime_r See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_mktime" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: mktime See \`config.log' for more details" "$LINENO" 5; } fi for ac_func in bindtextdomain do : ac_fn_c_check_func "$LINENO" "bindtextdomain" "ac_cv_func_bindtextdomain" if test "x$ac_cv_func_bindtextdomain" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BINDTEXTDOMAIN 1 _ACEOF fi done # Check whether --enable-v1-api was given. if test "${enable_v1_api+set}" = set; then : enableval=$enable_v1_api; ac_cv_enable_v1_api=$enableval else ac_cv_enable_v1_api=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable version 1 API" >&5 $as_echo_n "checking whether to enable enable version 1 API... " >&6; } if ${ac_cv_enable_v1_api+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_v1_api=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_v1_api" >&5 $as_echo "$ac_cv_enable_v1_api" >&6; } if test "x$ac_cv_enable_v1_api" != xno; then : $as_echo "#define HAVE_V1_API 1" >>confdefs.h HAVE_V1_API=1 ac_cv_enable_v1_api=yes else HAVE_V1_API=0 fi if test "x$ac_cv_enable_v1_api" != xno; then HAVE_V1_API_TRUE= HAVE_V1_API_FALSE='#' else HAVE_V1_API_TRUE='#' HAVE_V1_API_FALSE= fi # Check whether --with-pyprefix was given. if test "${with_pyprefix+set}" = set; then : withval=$with_pyprefix; ac_cv_with_pyprefix=$withval else ac_cv_with_pyprefix=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use \`python-config --prefix' to determine the prefix of pythondir instead of --prefix" >&5 $as_echo_n "checking whether to use use \`python-config --prefix' to determine the prefix of pythondir instead of --prefix... " >&6; } if ${ac_cv_with_pyprefix+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_pyprefix=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pyprefix" >&5 $as_echo "$ac_cv_with_pyprefix" >&6; } # Check whether --enable-python was given. if test "${enable_python+set}" = set; then : enableval=$enable_python; ac_cv_enable_python=$enableval else ac_cv_enable_python=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python bindings" >&5 $as_echo_n "checking whether to enable build Python bindings... " >&6; } if ${ac_cv_enable_python+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_python=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python" >&5 $as_echo "$ac_cv_enable_python" >&6; } # Check whether --with-pythondir was given. if test "${with_pythondir+set}" = set; then : withval=$with_pythondir; ac_cv_with_pythondir=$withval else ac_cv_with_pythondir=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python directory (pythondir)" >&5 $as_echo_n "checking whether to use use to specify the Python directory (pythondir)... " >&6; } if ${ac_cv_with_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_pythondir=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir" >&5 $as_echo "$ac_cv_with_pythondir" >&6; } # Check whether --enable-python2 was given. if test "${enable_python2+set}" = set; then : enableval=$enable_python2; ac_cv_enable_python2=$enableval else ac_cv_enable_python2=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python 2 bindings" >&5 $as_echo_n "checking whether to enable build Python 2 bindings... " >&6; } if ${ac_cv_enable_python2+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_python2=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python2" >&5 $as_echo "$ac_cv_enable_python2" >&6; } # Check whether --with-pythondir2 was given. if test "${with_pythondir2+set}" = set; then : withval=$with_pythondir2; ac_cv_with_pythondir2=$withval else ac_cv_with_pythondir2=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python 2 directory (pythondir2)" >&5 $as_echo_n "checking whether to use use to specify the Python 2 directory (pythondir2)... " >&6; } if ${ac_cv_with_pythondir2+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_pythondir2=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir2" >&5 $as_echo "$ac_cv_with_pythondir2" >&6; } # Check whether --enable-python3 was given. if test "${enable_python3+set}" = set; then : enableval=$enable_python3; ac_cv_enable_python3=$enableval else ac_cv_enable_python3=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python 3 bindings" >&5 $as_echo_n "checking whether to enable build Python 3 bindings... " >&6; } if ${ac_cv_enable_python3+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_python3=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python3" >&5 $as_echo "$ac_cv_enable_python3" >&6; } # Check whether --with-pythondir3 was given. if test "${with_pythondir3+set}" = set; then : withval=$with_pythondir3; ac_cv_with_pythondir3=$withval else ac_cv_with_pythondir3=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python 3 directory (pythondir3)" >&5 $as_echo_n "checking whether to use use to specify the Python 3 directory (pythondir3)... " >&6; } if ${ac_cv_with_pythondir3+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_pythondir3=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir3" >&5 $as_echo "$ac_cv_with_pythondir3" >&6; } if test "x${ac_cv_enable_python}" != xno; then : if test "x${PYTHON_VERSION}" != x; then : ax_python_progs="python${PYTHON_VERSION}" else ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0" fi for ac_prog in $ax_python_progs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON"; then ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON=$ac_cv_prog_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON" && break done if test "x${PYTHON}" != x; then : ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write(sys.version[:3])" 2>/dev/null`; PYTHON_VERSION=$ax_prog_python_version ax_prog_python_platform=`${PYTHON} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; PYTHON_PLATFORM=$ax_prog_python_platform else as_fn_error $? "Unable to find python" "$LINENO" 5 fi PYTHON=$PYTHON if test "x${PYTHON}" != x; then : for ac_prog in python${PYTHON_VERSION}-config python-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON_CONFIG"; then ac_cv_prog_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON_CONFIG=$ac_cv_prog_PYTHON_CONFIG if test -n "$PYTHON_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5 $as_echo "$PYTHON_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON_CONFIG" && break done fi if test "x${PYTHON_CONFIG}" = x; then : as_fn_error $? "Unable to find python-config" "$LINENO" 5 fi PYTHON_CONFIG=$PYTHON_CONFIG if test "x${PYTHON_CONFIG}" != x; then : PYTHON_INCLUDES=`${PYTHON_CONFIG} --includes 2>/dev/null`; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python includes" >&5 $as_echo_n "checking for Python includes... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_INCLUDES" >&5 $as_echo "$PYTHON_INCLUDES" >&6; } PYTHON_LDFLAGS=`${PYTHON_CONFIG} --ldflags 2>/dev/null`; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python libraries" >&5 $as_echo_n "checking for Python libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 $as_echo "$PYTHON_LDFLAGS" >&6; } case $host_os in #( cygwin*) : PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined" ;; #( *) : ;; #( *) : ;; esac BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON_INCLUDES}" for ac_header in Python.h do : ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" if test "x$ac_cv_header_Python_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PYTHON_H 1 _ACEOF ac_cv_header_python_h=yes else ac_cv_header_python_h=no fi done CPPFLAGS="${BACKUP_CPPFLAGS}" fi if test "x${ac_cv_header_python_h}" != xyes; then : ac_cv_enable_python=no else ac_cv_enable_python=$PYTHON_VERSION PYTHON_CPPFLAGS=$PYTHON_INCLUDES PYTHON_LDFLAGS=$PYTHON_LDFLAGS if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python_prefix="\${prefix}" else ax_python_prefix=`${PYTHON_CONFIG} --prefix 2>/dev/null` fi PYTHON_PREFIX=$ax_python_prefix if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python_exec_prefix="\${exec_prefix}" else ax_python_exec_prefix=`${PYTHON_CONFIG} --exec-prefix 2>/dev/null` fi PYTHON_EXEC_PREFIX=$ax_python_exec_prefix ax_python_pythondir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; if test "x${ac_cv_with_pythondir}" = x || test "x${ac_cv_with_pythondir}" = xno; then : if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python_pythondir="${ax_python_prefix}/${ax_python_pythondir_suffix}" else ax_python_pythondir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null` fi else ax_python_pythondir=$ac_cv_with_pythondir fi pythondir=$ax_python_pythondir ax_python_pyexecdir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; ax_python_library_dir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python_pyexecdir="${ax_python_exec_prefix}/${ax_python_pyexecdir_suffix}" else ax_python_pyexecdir=$ax_python_library_dir fi pyexecdir=$ax_python_pyexecdir PYTHON_LIBRARY_DIR=$ax_python_pyexecdir_suffix PYTHON_PACKAGE_DIR=$ax_python_library_dir fi fi if test "x${ac_cv_enable_python2}" != xno; then : ax_python2_progs="python2 python2.7 python2.6 python2.5" for ac_prog in $ax_python2_progs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON2+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON2"; then ac_cv_prog_PYTHON2="$PYTHON2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON2="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON2=$ac_cv_prog_PYTHON2 if test -n "$PYTHON2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2" >&5 $as_echo "$PYTHON2" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON2" && break done if test "x${PYTHON2}" != x; then : ax_prog_python2_version=`${PYTHON2} -c "import sys; sys.stdout.write(sys.version[:3])" 2>/dev/null`; PYTHON2_VERSION=$ax_prog_python2_version ax_prog_python2_platform=`${PYTHON2} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; PYTHON2_PLATFORM=$ax_prog_python2_platform else as_fn_error $? "Unable to find python2" "$LINENO" 5 fi PYTHON2=$PYTHON2 if test "x${PYTHON2}" != x; then : for ac_prog in python2-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON2_CONFIG"; then ac_cv_prog_PYTHON2_CONFIG="$PYTHON2_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON2_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON2_CONFIG=$ac_cv_prog_PYTHON2_CONFIG if test -n "$PYTHON2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_CONFIG" >&5 $as_echo "$PYTHON2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON2_CONFIG" && break done fi if test "x${PYTHON2_CONFIG}" = x; then : as_fn_error $? "Unable to find python2-config" "$LINENO" 5 fi PYTHON2_CONFIG=$PYTHON2_CONFIG if test "x${PYTHON2_CONFIG}" != x; then : PYTHON2_INCLUDES=`${PYTHON2_CONFIG} --includes 2>/dev/null`; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python verison 2 includes" >&5 $as_echo_n "checking for Python verison 2 includes... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_INCLUDES" >&5 $as_echo "$PYTHON2_INCLUDES" >&6; } PYTHON2_LDFLAGS=`${PYTHON2_CONFIG} --ldflags 2>/dev/null`; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 2 libraries" >&5 $as_echo_n "checking for Python 2 libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_LDFLAGS" >&5 $as_echo "$PYTHON2_LDFLAGS" >&6; } case $host_os in #( cygwin*) : PYTHON2_LDFLAGS="${PYTHON2_LDFLAGS} -no-undefined" ;; #( *) : ;; #( *) : ;; esac BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON2_INCLUDES}" for ac_header in Python.h do : ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" if test "x$ac_cv_header_Python_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PYTHON_H 1 _ACEOF ac_cv_header_python2_h=yes else ac_cv_header_python2_h=no fi done CPPFLAGS="${BACKUP_CPPFLAGS}" fi if test "x${ac_cv_header_python2_h}" != xyes; then : ac_cv_enable_python2=no else ac_cv_enable_python2=$PYTHON2_VERSION PYTHON2_CPPFLAGS=$PYTHON2_INCLUDES PYTHON2_LDFLAGS=$PYTHON2_LDFLAGS if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python2_prefix="\${prefix}" else ax_python2_prefix=`${PYTHON2_CONFIG} --prefix 2>/dev/null` fi PYTHON2_PREFIX=$ax_python2_prefix if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python2_exec_prefix="\${exec_prefix}" else ax_python2_exec_prefix=`${PYTHON2_CONFIG} --exec-prefix 2>/dev/null` fi PYTHON2_EXEC_PREFIX=$ax_python2_exec_prefix ax_python2_pythondir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; if test "x${ac_cv_with_pythondir2}" = x || test "x${ac_cv_with_pythondir2}" = xno; then : if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python2_pythondir="${ax_python_prefix}/${ax_python2_pythondir_suffix}" else ax_python2_pythondir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null` fi else ax_python2_pythondir=$ac_cv_with_pythondir2 fi pythondir2=$ax_python2_pythondir ax_python2_pyexecdir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; ax_python2_library_dir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python2_pyexecdir="${ax_python2_exec_prefix}/${ax_python2_pyexecdir_suffix}" else ax_python2_pyexecdir=$ax_python2_library_dir fi pyexecdir2=$ax_python2_pyexecdir PYTHON2_LIBRARY_DIR=$ax_python2_pyexecdir_suffix PYTHON2_PACKAGE_DIR=$ax_python2_library_dir fi fi if test "x${ac_cv_enable_python3}" != xno; then : ax_python3_progs="python3 python3.4 python3.3 python3.2 python3.1 python3.0" for ac_prog in $ax_python3_progs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON3+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON3"; then ac_cv_prog_PYTHON3="$PYTHON3" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON3="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON3=$ac_cv_prog_PYTHON3 if test -n "$PYTHON3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5 $as_echo "$PYTHON3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON3" && break done if test "x${PYTHON3}" != x; then : ax_prog_python3_version=`${PYTHON3} -c "import sys; sys.stdout.write(sys.version[:3])" 2>/dev/null`; PYTHON3_VERSION=$ax_prog_python3_version ax_prog_python3_platform=`${PYTHON3} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; PYTHON3_PLATFORM=$ax_prog_python3_platform else as_fn_error $? "Unable to find python3" "$LINENO" 5 fi PYTHON3=$PYTHON3 if test "x${PYTHON3}" != x; then : for ac_prog in python3-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON3_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON3_CONFIG"; then ac_cv_prog_PYTHON3_CONFIG="$PYTHON3_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON3_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON3_CONFIG=$ac_cv_prog_PYTHON3_CONFIG if test -n "$PYTHON3_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3_CONFIG" >&5 $as_echo "$PYTHON3_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON3_CONFIG" && break done fi if test "x${PYTHON3_CONFIG}" = x; then : as_fn_error $? "Unable to find python3-config" "$LINENO" 5 fi PYTHON3_CONFIG=$PYTHON3_CONFIG if test "x${PYTHON3_CONFIG}" != x; then : PYTHON3_INCLUDES=`${PYTHON3_CONFIG} --includes 2>/dev/null`; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python verison 3 includes" >&5 $as_echo_n "checking for Python verison 3 includes... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3_INCLUDES" >&5 $as_echo "$PYTHON3_INCLUDES" >&6; } PYTHON3_LDFLAGS=`${PYTHON3_CONFIG} --ldflags 2>/dev/null`; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3 libraries" >&5 $as_echo_n "checking for Python 3 libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3_LDFLAGS" >&5 $as_echo "$PYTHON3_LDFLAGS" >&6; } case $host_os in #( cygwin*) : PYTHON3_LDFLAGS="${PYTHON3_LDFLAGS} -no-undefined" ;; #( *) : ;; #( *) : ;; esac BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON3_INCLUDES}" for ac_header in Python.h do : ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" if test "x$ac_cv_header_Python_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PYTHON_H 1 _ACEOF ac_cv_header_python3_h=yes else ac_cv_header_python3_h=no fi done CPPFLAGS="${BACKUP_CPPFLAGS}" fi if test "x${ac_cv_header_python3_h}" != xyes; then : ac_cv_enable_python3=no else ac_cv_enable_python3=$PYTHON3_VERSION PYTHON3_CPPFLAGS=$PYTHON3_INCLUDES PYTHON3_LDFLAGS=$PYTHON3_LDFLAGS if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python3_prefix="\${prefix}" else ax_python3_prefix=`${PYTHON3_CONFIG} --prefix 2>/dev/null` fi PYTHON3_PREFIX=$ax_python3_prefix if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python3_exec_prefix="\${exec_prefix}" else ax_python3_exec_prefix=`${PYTHON3_CONFIG} --exec-prefix 2>/dev/null` fi PYTHON3_EXEC_PREFIX=$ax_python3_exec_prefix ax_python3_pythondir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; if test "x${ac_cv_with_pythondir3}" = x || test "x${ac_cv_with_pythondir3}" = xno; then : if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python3_pythondir="${ax_python_prefix}/${ax_python3_pythondir_suffix}" else ax_python3_pythondir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null` fi else ax_python3_pythondir=$ac_cv_with_pythondir3 fi pythondir3=$ax_python3_pythondir ax_python3_pyexecdir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; ax_python3_library_dir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : ax_python3_pyexecdir="${ax_python3_exec_prefix}/${ax_python3_pyexecdir_suffix}" else ax_python3_pyexecdir=$ax_python3_library_dir fi pyexecdir3=$ax_python3_pyexecdir PYTHON3_LIBRARY_DIR=$ax_python3_pyexecdir_suffix PYTHON3_PACKAGE_DIR=$ax_python3_library_dir fi fi if test "x${ac_cv_enable_python}" != xno; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' else HAVE_PYTHON_TRUE='#' HAVE_PYTHON_FALSE= fi if test "x${ac_cv_enable_python2}" != xno; then HAVE_PYTHON2_TRUE= HAVE_PYTHON2_FALSE='#' else HAVE_PYTHON2_TRUE='#' HAVE_PYTHON2_FALSE= fi if test "x${ac_cv_enable_python3}" != xno; then HAVE_PYTHON3_TRUE= HAVE_PYTHON3_FALSE='#' else HAVE_PYTHON3_TRUE='#' HAVE_PYTHON3_FALSE= fi if test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno; then HAVE_PYTHON_TESTS_TRUE= HAVE_PYTHON_TESTS_FALSE='#' else HAVE_PYTHON_TESTS_TRUE='#' HAVE_PYTHON_TESTS_FALSE= fi if test "x${ac_cv_enable_python}" = xno; then : if test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno; then : if test "x${ac_cv_enable_python2}" != xno; then : ac_cv_enable_python=${ac_cv_enable_python2} else ac_cv_enable_python="" fi if test "x${ac_cv_enable_python3}" != xno; then : if test "x${ac_cv_enable_python}" != x; then : ac_cv_enable_python="${ac_cv_enable_python}, " fi ac_cv_enable_python="${ac_cv_enable_python}${ac_cv_enable_python3}" fi fi fi if test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno; then : for ac_header in stdarg.h varargs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } fi fi # Check whether --with-libuuid was given. if test "${with_libuuid+set}" = set; then : withval=$with_libuuid; ac_cv_with_libuuid=$withval else ac_cv_with_libuuid=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libuuid in includedir and libdir or in the specified DIR, or no if not to use libuuid" >&5 $as_echo_n "checking whether to use search for libuuid in includedir and libdir or in the specified DIR, or no if not to use libuuid... " >&6; } if ${ac_cv_with_libuuid+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libuuid=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libuuid" >&5 $as_echo "$ac_cv_with_libuuid" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuuid" = xno; then : ac_cv_libuuid=no else ac_cv_libuuid=check if test "x$ac_cv_with_libuuid" != x && test "x$ac_cv_with_libuuid" != xauto-detect; then : if test -d "$ac_cv_with_libuuid"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libuuid}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libuuid}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libuuid See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$ac_cv_enable_winapi" = xyes; then : ac_cv_libuuid=librpcrt4 ac_cv_libuuid_LIBADD=-lrpcrt4 else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid" >&5 $as_echo_n "checking for uuid... " >&6; } if test -n "$uuid_CFLAGS"; then pkg_cv_uuid_CFLAGS="$uuid_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid >= 2.20\""; } >&5 ($PKG_CONFIG --exists --print-errors "uuid >= 2.20") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_uuid_CFLAGS=`$PKG_CONFIG --cflags "uuid >= 2.20" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$uuid_LIBS"; then pkg_cv_uuid_LIBS="$uuid_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid >= 2.20\""; } >&5 ($PKG_CONFIG --exists --print-errors "uuid >= 2.20") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_uuid_LIBS=`$PKG_CONFIG --libs "uuid >= 2.20" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then uuid_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "uuid >= 2.20" 2>&1` else uuid_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "uuid >= 2.20" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$uuid_PKG_ERRORS" >&5 ac_cv_libuuid=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libuuid=check else uuid_CFLAGS=$pkg_cv_uuid_CFLAGS uuid_LIBS=$pkg_cv_uuid_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libuuid=libuuid fi fi if test "x$ac_cv_libuuid" = xlibuuid; then : ac_cv_libuuid_CPPFLAGS="$pkg_cv_libuuid_CFLAGS" ac_cv_libuuid_LIBADD="$pkg_cv_libuuid_LIBS" fi fi fi if test "x$ac_cv_libuuid" = xcheck; then : if test "x$ac_cv_libuuid" = xuuid; then : ac_cv_libuuid_CPPFLAGS="$pkg_cv_uuid_CFLAGS" ac_cv_libuuid_LIBADD="$pkg_cv_uuid_LIBS" else for ac_header in uuid/uuid.h do : ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" if test "x$ac_cv_header_uuid_uuid_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UUID_UUID_H 1 _ACEOF fi done if test "x$ac_cv_header_uuid_uuid_h" != xno; then : ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate" if test "x$ac_cv_func_uuid_generate" = xyes; then : ac_cv_libuuid=native else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 $as_echo_n "checking for uuid_generate in -luuid... " >&6; } if ${ac_cv_lib_uuid_uuid_generate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uuid_generate (); int main () { return uuid_generate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_uuid_uuid_generate=yes else ac_cv_lib_uuid_uuid_generate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then : ac_cv_libuuid=libuuid ac_cv_libuuid_LIBADD="-luuid" else ac_cv_libuuid=no fi fi fi fi if test "x$ac_cv_libuuid" != xno; then : $as_echo "#define HAVE_GUID_SUPPORT 1" >>confdefs.h fi if test "x$ac_cv_libuuid" = xnative; then : ac_fn_c_check_func "$LINENO" "uuid_generate_random" "ac_cv_func_uuid_generate_random" if test "x$ac_cv_func_uuid_generate_random" = xyes; then : $as_echo "#define HAVE_UUID_GENERATE_RANDOM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "uuid_generate_time" "ac_cv_func_uuid_generate_time" if test "x$ac_cv_func_uuid_generate_time" = xyes; then : $as_echo "#define HAVE_UUID_GENERATE_TIME 1" >>confdefs.h fi fi if test "x$ac_cv_libuuid" = xlibuuid; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -luuid" >&5 $as_echo_n "checking for uuid_generate_random in -luuid... " >&6; } if ${ac_cv_lib_uuid_uuid_generate_random+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uuid_generate_random (); int main () { return uuid_generate_random (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_uuid_uuid_generate_random=yes else ac_cv_lib_uuid_uuid_generate_random=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_random" >&5 $as_echo "$ac_cv_lib_uuid_uuid_generate_random" >&6; } if test "x$ac_cv_lib_uuid_uuid_generate_random" = xyes; then : $as_echo "#define HAVE_UUID_GENERATE_RANDOM 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time in -luuid" >&5 $as_echo_n "checking for uuid_generate_time in -luuid... " >&6; } if ${ac_cv_lib_uuid_uuid_generate_time+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uuid_generate_time (); int main () { return uuid_generate_time (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_uuid_uuid_generate_time=yes else ac_cv_lib_uuid_uuid_generate_time=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_time" >&5 $as_echo "$ac_cv_lib_uuid_uuid_generate_time" >&6; } if test "x$ac_cv_lib_uuid_uuid_generate_time" = xyes; then : $as_echo "#define HAVE_UUID_GENERATE_TIME 1" >>confdefs.h fi fi fi fi if test "x$ac_cv_libuuid" = xlibrpcrt4; then : $as_echo "#define HAVE_LIBUUID 1" >>confdefs.h fi if test "x$ac_cv_libuuid" = xlibuuid; then : $as_echo "#define HAVE_LIBUUID 1" >>confdefs.h fi if test "x$ac_cv_libuuid" != xno; then : HAVE_LIBUUID=1 else HAVE_LIBUUID=0 fi if test "x$ac_cv_libuuid_CPPFLAGS" != "x"; then : LIBUUID_CPPFLAGS=$ac_cv_libuuid_CPPFLAGS fi if test "x$ac_cv_libuuid_LIBADD" != "x"; then : LIBUUID_LIBADD=$ac_cv_libuuid_LIBADD fi if test "x$ac_cv_libuuid" = xlibuuid; then : ax_libuuid_pc_libs_private=-luuid fi if test "x$ac_cv_libuuid" = xlibuuid; then : ax_libuuid_spec_requires=libuuid ax_libuuid_spec_build_requires=libuuid-devel fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi # Check whether --with-libodraw was given. if test "${with_libodraw+set}" = set; then : withval=$with_libodraw; ac_cv_with_libodraw=$withval else ac_cv_with_libodraw=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libodraw in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libodraw in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libodraw+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libodraw=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libodraw" >&5 $as_echo "$ac_cv_with_libodraw" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libodraw" = xno; then : ac_cv_libodraw=no else ac_cv_libodraw=check if test "x$ac_cv_with_libodraw" != x && test "x$ac_cv_with_libodraw" != xauto-detect; then : if test -d "$ac_cv_with_libodraw"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libodraw}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libodraw}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libodraw See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw" >&5 $as_echo_n "checking for libodraw... " >&6; } if test -n "$libodraw_CFLAGS"; then pkg_cv_libodraw_CFLAGS="$libodraw_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libodraw >= 20120630\""; } >&5 ($PKG_CONFIG --exists --print-errors "libodraw >= 20120630") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libodraw_CFLAGS=`$PKG_CONFIG --cflags "libodraw >= 20120630" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libodraw_LIBS"; then pkg_cv_libodraw_LIBS="$libodraw_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libodraw >= 20120630\""; } >&5 ($PKG_CONFIG --exists --print-errors "libodraw >= 20120630") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libodraw_LIBS=`$PKG_CONFIG --libs "libodraw >= 20120630" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libodraw_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libodraw >= 20120630" 2>&1` else libodraw_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libodraw >= 20120630" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libodraw_PKG_ERRORS" >&5 ac_cv_libodraw=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libodraw=check else libodraw_CFLAGS=$pkg_cv_libodraw_CFLAGS libodraw_LIBS=$pkg_cv_libodraw_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libodraw=yes fi fi if test "x$ac_cv_libodraw" = xyes; then : ac_cv_libodraw_CPPFLAGS="$pkg_cv_libodraw_CFLAGS" ac_cv_libodraw_LIBADD="$pkg_cv_libodraw_LIBS" fi fi if test "x$ac_cv_libodraw" = xcheck; then : for ac_header in libodraw.h do : ac_fn_c_check_header_mongrel "$LINENO" "libodraw.h" "ac_cv_header_libodraw_h" "$ac_includes_default" if test "x$ac_cv_header_libodraw_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBODRAW_H 1 _ACEOF fi done if test "x$ac_cv_header_libodraw_h" = xno; then : ac_cv_libodraw=no else ac_cv_libodraw=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_get_version in -lodraw" >&5 $as_echo_n "checking for libodraw_get_version in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_get_version (); int main () { return libodraw_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_get_version=yes else ac_cv_lib_odraw_libodraw_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_get_version" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_get_version" >&6; } if test "x$ac_cv_lib_odraw_libodraw_get_version" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_initialize in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_initialize in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_initialize (); int main () { return libodraw_handle_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_initialize=yes else ac_cv_lib_odraw_libodraw_handle_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_initialize" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_initialize" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_initialize" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_free in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_free in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_free (); int main () { return libodraw_handle_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_free=yes else ac_cv_lib_odraw_libodraw_handle_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_free" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_free" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_free" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_signal_abort in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_signal_abort in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_signal_abort+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_signal_abort (); int main () { return libodraw_handle_signal_abort (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_signal_abort=yes else ac_cv_lib_odraw_libodraw_handle_signal_abort=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_signal_abort" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_signal_abort" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_signal_abort" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_open in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_open in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_open (); int main () { return libodraw_handle_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_open=yes else ac_cv_lib_odraw_libodraw_handle_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_open" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_open" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_open" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_open_data_files in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_open_data_files in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_open_data_files+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_open_data_files (); int main () { return libodraw_handle_open_data_files (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_open_data_files=yes else ac_cv_lib_odraw_libodraw_handle_open_data_files=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_open_data_files" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_open_data_files" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_open_data_files" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_close in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_close in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_close (); int main () { return libodraw_handle_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_close=yes else ac_cv_lib_odraw_libodraw_handle_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_close" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_close" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_close" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_read_buffer in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_read_buffer in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_read_buffer (); int main () { return libodraw_handle_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_read_buffer=yes else ac_cv_lib_odraw_libodraw_handle_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_read_buffer" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_read_buffer" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_read_buffer" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_seek_offset in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_seek_offset in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_seek_offset (); int main () { return libodraw_handle_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_seek_offset=yes else ac_cv_lib_odraw_libodraw_handle_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_seek_offset" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_seek_offset" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_seek_offset" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_open_wide in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_open_wide in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_open_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_open_wide (); int main () { return libodraw_handle_open_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_open_wide=yes else ac_cv_lib_odraw_libodraw_handle_open_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_open_wide" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_open_wide" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_open_wide" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_bytes_per_sector in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_bytes_per_sector in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_bytes_per_sector+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_bytes_per_sector (); int main () { return libodraw_handle_get_bytes_per_sector (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_bytes_per_sector=yes else ac_cv_lib_odraw_libodraw_handle_get_bytes_per_sector=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_bytes_per_sector" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_bytes_per_sector" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_bytes_per_sector" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_data_file in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_data_file in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_data_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_data_file (); int main () { return libodraw_handle_get_data_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_data_file=yes else ac_cv_lib_odraw_libodraw_handle_get_data_file=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_data_file" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_data_file" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_data_file" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_media_size in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_media_size in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_media_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_media_size (); int main () { return libodraw_handle_get_media_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_media_size=yes else ac_cv_lib_odraw_libodraw_handle_get_media_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_media_size" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_media_size" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_media_size" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_number_of_data_files in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_number_of_data_files in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_number_of_data_files+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_number_of_data_files (); int main () { return libodraw_handle_get_number_of_data_files (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_number_of_data_files=yes else ac_cv_lib_odraw_libodraw_handle_get_number_of_data_files=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_number_of_data_files" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_number_of_data_files" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_number_of_data_files" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_number_of_sessions in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_number_of_sessions in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_number_of_sessions+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_number_of_sessions (); int main () { return libodraw_handle_get_number_of_sessions (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_number_of_sessions=yes else ac_cv_lib_odraw_libodraw_handle_get_number_of_sessions=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_number_of_sessions" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_number_of_sessions" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_number_of_sessions" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_session in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_session in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_session+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_session (); int main () { return libodraw_handle_get_session (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_session=yes else ac_cv_lib_odraw_libodraw_handle_get_session=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_session" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_session" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_session" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_number_of_tracks in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_number_of_tracks in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_number_of_tracks+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_number_of_tracks (); int main () { return libodraw_handle_get_number_of_tracks (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_number_of_tracks=yes else ac_cv_lib_odraw_libodraw_handle_get_number_of_tracks=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_number_of_tracks" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_number_of_tracks" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_number_of_tracks" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_handle_get_track in -lodraw" >&5 $as_echo_n "checking for libodraw_handle_get_track in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_handle_get_track+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_handle_get_track (); int main () { return libodraw_handle_get_track (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_handle_get_track=yes else ac_cv_lib_odraw_libodraw_handle_get_track=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_handle_get_track" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_handle_get_track" >&6; } if test "x$ac_cv_lib_odraw_libodraw_handle_get_track" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_data_file_free in -lodraw" >&5 $as_echo_n "checking for libodraw_data_file_free in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_data_file_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_data_file_free (); int main () { return libodraw_data_file_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_data_file_free=yes else ac_cv_lib_odraw_libodraw_data_file_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_data_file_free" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_data_file_free" >&6; } if test "x$ac_cv_lib_odraw_libodraw_data_file_free" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_data_file_set_filename in -lodraw" >&5 $as_echo_n "checking for libodraw_data_file_set_filename in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_data_file_set_filename+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_data_file_set_filename (); int main () { return libodraw_data_file_set_filename (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_data_file_set_filename=yes else ac_cv_lib_odraw_libodraw_data_file_set_filename=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_data_file_set_filename" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_data_file_set_filename" >&6; } if test "x$ac_cv_lib_odraw_libodraw_data_file_set_filename" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libodraw_data_file_set_filename_wide in -lodraw" >&5 $as_echo_n "checking for libodraw_data_file_set_filename_wide in -lodraw... " >&6; } if ${ac_cv_lib_odraw_libodraw_data_file_set_filename_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libodraw_data_file_set_filename_wide (); int main () { return libodraw_data_file_set_filename_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odraw_libodraw_data_file_set_filename_wide=yes else ac_cv_lib_odraw_libodraw_data_file_set_filename_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odraw_libodraw_data_file_set_filename_wide" >&5 $as_echo "$ac_cv_lib_odraw_libodraw_data_file_set_filename_wide" >&6; } if test "x$ac_cv_lib_odraw_libodraw_data_file_set_filename_wide" = xyes; then : ac_cv_libodraw_dummy=yes else ac_cv_libodraw=no fi fi ac_cv_libodraw_LIBADD="-lodraw" fi fi if test "x$ac_cv_with_libodraw" != x && test "x$ac_cv_with_libodraw" != xauto-detect && test "x$ac_cv_libodraw" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libodraw in directory: $ac_cv_with_libodraw See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libodraw" = xyes; then : $as_echo "#define HAVE_LIBODRAW 1" >>confdefs.h fi if test "x$ac_cv_libodraw" = xyes; then : HAVE_LIBODRAW=1 else HAVE_LIBODRAW=0 fi if test "x$ac_cv_libodraw" != xyes; then : if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ac_cv_libodraw_CPPFLAGS="-I../libodraw"; ac_cv_libodraw_LIBADD="../libodraw/libodraw.la"; ac_cv_libodraw=local $as_echo "#define HAVE_LOCAL_LIBODRAW 1" >>confdefs.h HAVE_LOCAL_LIBODRAW=1 fi if test "x$ac_cv_libodraw" = xlocal; then HAVE_LOCAL_LIBODRAW_TRUE= HAVE_LOCAL_LIBODRAW_FALSE='#' else HAVE_LOCAL_LIBODRAW_TRUE='#' HAVE_LOCAL_LIBODRAW_FALSE= fi if test "x$ac_cv_libodraw_CPPFLAGS" != "x"; then : LIBODRAW_CPPFLAGS=$ac_cv_libodraw_CPPFLAGS fi if test "x$ac_cv_libodraw_LIBADD" != "x"; then : LIBODRAW_LIBADD=$ac_cv_libodraw_LIBADD fi if test "x$ac_cv_libodraw" = xyes; then : ax_libodraw_pc_libs_private=-lodraw fi if test "x$ac_cv_libodraw" = xyes; then : ax_libodraw_spec_requires=libodraw ax_libodraw_spec_build_requires=libodraw-devel fi # Check whether --with-libsmdev was given. if test "${with_libsmdev+set}" = set; then : withval=$with_libsmdev; ac_cv_with_libsmdev=$withval else ac_cv_with_libsmdev=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libsmdev in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libsmdev in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libsmdev+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libsmdev=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libsmdev" >&5 $as_echo "$ac_cv_with_libsmdev" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libsmdev" = xno; then : ac_cv_libsmdev=no else ac_cv_libsmdev=check if test "x$ac_cv_with_libsmdev" != x && test "x$ac_cv_with_libsmdev" != xauto-detect; then : if test -d "$ac_cv_with_libsmdev"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libsmdev}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libsmdev}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libsmdev See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev" >&5 $as_echo_n "checking for libsmdev... " >&6; } if test -n "$libsmdev_CFLAGS"; then pkg_cv_libsmdev_CFLAGS="$libsmdev_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsmdev >= 20140406\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsmdev >= 20140406") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libsmdev_CFLAGS=`$PKG_CONFIG --cflags "libsmdev >= 20140406" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libsmdev_LIBS"; then pkg_cv_libsmdev_LIBS="$libsmdev_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsmdev >= 20140406\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsmdev >= 20140406") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libsmdev_LIBS=`$PKG_CONFIG --libs "libsmdev >= 20140406" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libsmdev_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsmdev >= 20140406" 2>&1` else libsmdev_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsmdev >= 20140406" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libsmdev_PKG_ERRORS" >&5 ac_cv_libsmdev=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libsmdev=check else libsmdev_CFLAGS=$pkg_cv_libsmdev_CFLAGS libsmdev_LIBS=$pkg_cv_libsmdev_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libsmdev=yes fi fi if test "x$ac_cv_libsmdev" = xyes; then : ac_cv_libsmdev_CPPFLAGS="$pkg_cv_libsmdev_CFLAGS" ac_cv_libsmdev_LIBADD="$pkg_cv_libsmdev_LIBS" fi fi if test "x$ac_cv_libsmdev" = xcheck; then : for ac_header in libsmdev.h do : ac_fn_c_check_header_mongrel "$LINENO" "libsmdev.h" "ac_cv_header_libsmdev_h" "$ac_includes_default" if test "x$ac_cv_header_libsmdev_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSMDEV_H 1 _ACEOF fi done if test "x$ac_cv_header_libsmdev_h" = xno; then : ac_cv_libsmdev=no else ac_cv_libsmdev=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_get_version in -lsmdev" >&5 $as_echo_n "checking for libsmdev_get_version in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_get_version (); int main () { return libsmdev_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_get_version=yes else ac_cv_lib_smdev_libsmdev_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_get_version" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_get_version" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_get_version" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_check_device in -lsmdev" >&5 $as_echo_n "checking for libsmdev_check_device in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_check_device+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_check_device (); int main () { return libsmdev_check_device (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_check_device=yes else ac_cv_lib_smdev_libsmdev_check_device=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_check_device" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_check_device" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_check_device" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_check_device_wide in -lsmdev" >&5 $as_echo_n "checking for libsmdev_check_device_wide in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_check_device_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_check_device_wide (); int main () { return libsmdev_check_device_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_check_device_wide=yes else ac_cv_lib_smdev_libsmdev_check_device_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_check_device_wide" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_check_device_wide" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_check_device_wide" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_initialize in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_initialize in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_initialize (); int main () { return libsmdev_handle_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_initialize=yes else ac_cv_lib_smdev_libsmdev_handle_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_initialize" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_initialize" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_initialize" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_free in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_free in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_free (); int main () { return libsmdev_handle_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_free=yes else ac_cv_lib_smdev_libsmdev_handle_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_free" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_free" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_free" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_signal_abort in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_signal_abort in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_signal_abort+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_signal_abort (); int main () { return libsmdev_handle_signal_abort (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_signal_abort=yes else ac_cv_lib_smdev_libsmdev_handle_signal_abort=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_signal_abort" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_signal_abort" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_signal_abort" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_open in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_open in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_open (); int main () { return libsmdev_handle_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_open=yes else ac_cv_lib_smdev_libsmdev_handle_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_open" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_open" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_open" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_close in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_close in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_close (); int main () { return libsmdev_handle_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_close=yes else ac_cv_lib_smdev_libsmdev_handle_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_close" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_close" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_close" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_read_buffer in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_read_buffer in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_read_buffer (); int main () { return libsmdev_handle_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_read_buffer=yes else ac_cv_lib_smdev_libsmdev_handle_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_read_buffer" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_read_buffer" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_read_buffer" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_seek_offset in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_seek_offset in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_seek_offset (); int main () { return libsmdev_handle_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_seek_offset=yes else ac_cv_lib_smdev_libsmdev_handle_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_seek_offset" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_seek_offset" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_seek_offset" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_open_wide in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_open_wide in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_open_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_open_wide (); int main () { return libsmdev_handle_open_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_open_wide=yes else ac_cv_lib_smdev_libsmdev_handle_open_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_open_wide" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_open_wide" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_open_wide" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_bus_type in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_bus_type in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_bus_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_bus_type (); int main () { return libsmdev_handle_get_bus_type (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_bus_type=yes else ac_cv_lib_smdev_libsmdev_handle_get_bus_type=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_bus_type" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_bus_type" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_bus_type" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_bytes_per_sector in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_bytes_per_sector in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_bytes_per_sector+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_bytes_per_sector (); int main () { return libsmdev_handle_get_bytes_per_sector (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_bytes_per_sector=yes else ac_cv_lib_smdev_libsmdev_handle_get_bytes_per_sector=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_bytes_per_sector" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_bytes_per_sector" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_bytes_per_sector" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_error in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_error in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_error+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_error (); int main () { return libsmdev_handle_get_error (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_error=yes else ac_cv_lib_smdev_libsmdev_handle_get_error=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_error" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_error" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_error" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_utf8_information_value in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_utf8_information_value in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_utf8_information_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_utf8_information_value (); int main () { return libsmdev_handle_get_utf8_information_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_utf8_information_value=yes else ac_cv_lib_smdev_libsmdev_handle_get_utf8_information_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_utf8_information_value" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_utf8_information_value" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_utf8_information_value" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_utf16_information_value in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_utf16_information_value in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_utf16_information_value+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_utf16_information_value (); int main () { return libsmdev_handle_get_utf16_information_value (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_utf16_information_value=yes else ac_cv_lib_smdev_libsmdev_handle_get_utf16_information_value=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_utf16_information_value" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_utf16_information_value" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_utf16_information_value" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_media_size in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_media_size in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_media_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_media_size (); int main () { return libsmdev_handle_get_media_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_media_size=yes else ac_cv_lib_smdev_libsmdev_handle_get_media_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_media_size" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_media_size" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_media_size" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_media_type in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_media_type in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_media_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_media_type (); int main () { return libsmdev_handle_get_media_type (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_media_type=yes else ac_cv_lib_smdev_libsmdev_handle_get_media_type=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_media_type" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_media_type" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_media_type" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_number_of_errors in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_number_of_errors in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_number_of_errors+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_number_of_errors (); int main () { return libsmdev_handle_get_number_of_errors (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_number_of_errors=yes else ac_cv_lib_smdev_libsmdev_handle_get_number_of_errors=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_number_of_errors" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_number_of_errors" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_number_of_errors" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_number_of_sessions in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_number_of_sessions in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_number_of_sessions+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_number_of_sessions (); int main () { return libsmdev_handle_get_number_of_sessions (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_number_of_sessions=yes else ac_cv_lib_smdev_libsmdev_handle_get_number_of_sessions=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_number_of_sessions" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_number_of_sessions" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_number_of_sessions" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_session in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_session in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_session+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_session (); int main () { return libsmdev_handle_get_session (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_session=yes else ac_cv_lib_smdev_libsmdev_handle_get_session=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_session" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_session" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_session" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_number_of_tracks in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_number_of_tracks in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_number_of_tracks+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_number_of_tracks (); int main () { return libsmdev_handle_get_number_of_tracks (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_number_of_tracks=yes else ac_cv_lib_smdev_libsmdev_handle_get_number_of_tracks=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_number_of_tracks" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_number_of_tracks" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_number_of_tracks" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_get_track in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_get_track in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_get_track+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_get_track (); int main () { return libsmdev_handle_get_track (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_get_track=yes else ac_cv_lib_smdev_libsmdev_handle_get_track=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_get_track" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_get_track" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_get_track" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_set_error_flags in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_set_error_flags in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_set_error_flags+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_set_error_flags (); int main () { return libsmdev_handle_set_error_flags (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_set_error_flags=yes else ac_cv_lib_smdev_libsmdev_handle_set_error_flags=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_set_error_flags" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_set_error_flags" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_set_error_flags" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_set_error_granularity in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_set_error_granularity in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_set_error_granularity+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_set_error_granularity (); int main () { return libsmdev_handle_set_error_granularity (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_set_error_granularity=yes else ac_cv_lib_smdev_libsmdev_handle_set_error_granularity=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_set_error_granularity" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_set_error_granularity" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_set_error_granularity" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmdev_handle_set_number_of_error_retries in -lsmdev" >&5 $as_echo_n "checking for libsmdev_handle_set_number_of_error_retries in -lsmdev... " >&6; } if ${ac_cv_lib_smdev_libsmdev_handle_set_number_of_error_retries+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmdev $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmdev_handle_set_number_of_error_retries (); int main () { return libsmdev_handle_set_number_of_error_retries (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smdev_libsmdev_handle_set_number_of_error_retries=yes else ac_cv_lib_smdev_libsmdev_handle_set_number_of_error_retries=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smdev_libsmdev_handle_set_number_of_error_retries" >&5 $as_echo "$ac_cv_lib_smdev_libsmdev_handle_set_number_of_error_retries" >&6; } if test "x$ac_cv_lib_smdev_libsmdev_handle_set_number_of_error_retries" = xyes; then : ac_cv_libsmdev_dummy=yes else ac_cv_libsmdev=no fi ac_cv_libsmdev_LIBADD="-lsmdev" fi fi if test "x$ac_cv_with_libsmdev" != x && test "x$ac_cv_with_libsmdev" != xauto-detect && test "x$ac_cv_libsmdev" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libsmdev in directory: $ac_cv_with_libsmdev See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libsmdev" = xyes; then : $as_echo "#define HAVE_LIBSMDEV 1" >>confdefs.h fi if test "x$ac_cv_libsmdev" = xyes; then : HAVE_LIBSMDEV=1 else HAVE_LIBSMDEV=0 fi if test "x$ac_cv_libsmdev" != xyes; then : for ac_header in errno.h fcntl.h sys/stat.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_enable_winapi" = xno; then : for ac_header in cygwin/fs.h linux/fs.h sys/disk.h sys/disklabel.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi if test "x$ac_cv_enable_winapi" = xno; then : for ac_header in cygwin/hdreg.h linux/hdreg.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi if test "x$ac_cv_enable_winapi" = xno; then : for ac_header in scsi/scsi.h scsi/scsi_ioctl.h scsi/sg.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi if test "x$ac_cv_enable_winapi" = xno; then : for ac_header in linux/cdrom.h do : ac_fn_c_check_header_mongrel "$LINENO" "linux/cdrom.h" "ac_cv_header_linux_cdrom_h" "$ac_includes_default" if test "x$ac_cv_header_linux_cdrom_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_CDROM_H 1 _ACEOF fi done fi if test "x$ac_cv_enable_winapi" = xno; then : for ac_header in linux/usbdevice_fs.h linux/usb/ch9.h sys/ioctl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi for ac_func in close fstat ftruncate lseek open read stat write do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_close" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: close See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_fstat" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fstat See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_ftruncate" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: ftruncate See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_lseek" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: lseek See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_open" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: open See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_read" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: read See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_stat" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: stat See \`config.log' for more details" "$LINENO" 5; } fi if test "x$ac_cv_func_write" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: write See \`config.log' for more details" "$LINENO" 5; } fi ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF for ac_func in strerror_r do : ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" if test "x$ac_cv_func_strerror_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi if test "x$ac_cv_have_decl_strerror_r" = xno; then : for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done if test "x$ac_cv_func_strerror" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strerror and strerror_r See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_enable_winapi" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether winioctl.h defines STORAGE_BUS_TYPE" >&5 $as_echo_n "checking whether winioctl.h defines STORAGE_BUS_TYPE... " >&6; } if ${ac_cv_header_winioctl_h_storage_bus_type+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { STORAGE_BUS_TYPE storage_bus_type; storage_bus_type = BusTypeUnknown; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winioctl_h_storage_bus_type=yes else ac_cv_header_winioctl_h_storage_bus_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winioctl_h_storage_bus_type" >&5 $as_echo "$ac_cv_header_winioctl_h_storage_bus_type" >&6; } if test "x$ac_cv_header_winioctl_h_storage_bus_type" = xyes; then : $as_echo "#define HAVE_WINIOCTL_H_STORAGE_BUS_TYPE 1" >>confdefs.h fi fi ac_cv_libsmdev_CPPFLAGS="-I../libsmdev"; ac_cv_libsmdev_LIBADD="../libsmdev/libsmdev.la"; ac_cv_libsmdev=local $as_echo "#define HAVE_LOCAL_LIBSMDEV 1" >>confdefs.h HAVE_LOCAL_LIBSMDEV=1 fi if test "x$ac_cv_libsmdev" = xlocal; then HAVE_LOCAL_LIBSMDEV_TRUE= HAVE_LOCAL_LIBSMDEV_FALSE='#' else HAVE_LOCAL_LIBSMDEV_TRUE='#' HAVE_LOCAL_LIBSMDEV_FALSE= fi if test "x$ac_cv_libsmdev_CPPFLAGS" != "x"; then : LIBSMDEV_CPPFLAGS=$ac_cv_libsmdev_CPPFLAGS fi if test "x$ac_cv_libsmdev_LIBADD" != "x"; then : LIBSMDEV_LIBADD=$ac_cv_libsmdev_LIBADD fi if test "x$ac_cv_libsmdev" = xyes; then : ax_libsmdev_pc_libs_private=-lsmdev fi if test "x$ac_cv_libsmdev" = xyes; then : ax_libsmdev_spec_requires=libsmdev ax_libsmdev_spec_build_requires=libsmdev-devel fi # Check whether --with-libsmraw was given. if test "${with_libsmraw+set}" = set; then : withval=$with_libsmraw; ac_cv_with_libsmraw=$withval else ac_cv_with_libsmraw=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libsmraw in includedir and libdir or in the specified DIR, or no if to use local version" >&5 $as_echo_n "checking whether to use search for libsmraw in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } if ${ac_cv_with_libsmraw+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libsmraw=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libsmraw" >&5 $as_echo "$ac_cv_with_libsmraw" >&6; } if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libsmraw" = xno; then : ac_cv_libsmraw=no else ac_cv_libsmraw=check if test "x$ac_cv_with_libsmraw" != x && test "x$ac_cv_with_libsmraw" != xauto-detect; then : if test -d "$ac_cv_with_libsmraw"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libsmraw}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libsmraw}/lib" else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libsmraw See \`config.log' for more details" "$LINENO" 5; } fi else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw" >&5 $as_echo_n "checking for libsmraw... " >&6; } if test -n "$libsmraw_CFLAGS"; then pkg_cv_libsmraw_CFLAGS="$libsmraw_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsmraw >= 20120630\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsmraw >= 20120630") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libsmraw_CFLAGS=`$PKG_CONFIG --cflags "libsmraw >= 20120630" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libsmraw_LIBS"; then pkg_cv_libsmraw_LIBS="$libsmraw_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsmraw >= 20120630\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsmraw >= 20120630") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libsmraw_LIBS=`$PKG_CONFIG --libs "libsmraw >= 20120630" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libsmraw_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsmraw >= 20120630" 2>&1` else libsmraw_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsmraw >= 20120630" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libsmraw_PKG_ERRORS" >&5 ac_cv_libsmraw=check elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libsmraw=check else libsmraw_CFLAGS=$pkg_cv_libsmraw_CFLAGS libsmraw_LIBS=$pkg_cv_libsmraw_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libsmraw=yes fi fi if test "x$ac_cv_libsmraw" = xyes; then : ac_cv_libsmraw_CPPFLAGS="$pkg_cv_libsmraw_CFLAGS" ac_cv_libsmraw_LIBADD="$pkg_cv_libsmraw_LIBS" fi fi if test "x$ac_cv_libsmraw" = xcheck; then : for ac_header in libsmraw.h do : ac_fn_c_check_header_mongrel "$LINENO" "libsmraw.h" "ac_cv_header_libsmraw_h" "$ac_includes_default" if test "x$ac_cv_header_libsmraw_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSMRAW_H 1 _ACEOF fi done if test "x$ac_cv_header_libsmraw_h" = xno; then : ac_cv_libsmraw=no else ac_cv_libsmraw=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_get_version in -lsmraw" >&5 $as_echo_n "checking for libsmraw_get_version in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_get_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_get_version (); int main () { return libsmraw_get_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_get_version=yes else ac_cv_lib_smraw_libsmraw_get_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_get_version" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_get_version" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_get_version" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_initialize in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_initialize in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_initialize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_initialize (); int main () { return libsmraw_handle_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_initialize=yes else ac_cv_lib_smraw_libsmraw_handle_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_initialize" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_initialize" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_initialize" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_free in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_free in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_free (); int main () { return libsmraw_handle_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_free=yes else ac_cv_lib_smraw_libsmraw_handle_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_free" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_free" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_free" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_signal_abort in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_signal_abort in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_signal_abort+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_signal_abort (); int main () { return libsmraw_handle_signal_abort (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_signal_abort=yes else ac_cv_lib_smraw_libsmraw_handle_signal_abort=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_signal_abort" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_signal_abort" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_signal_abort" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_open in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_open in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_open (); int main () { return libsmraw_handle_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_open=yes else ac_cv_lib_smraw_libsmraw_handle_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_open" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_open" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_open" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_close in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_close in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_close+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_close (); int main () { return libsmraw_handle_close (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_close=yes else ac_cv_lib_smraw_libsmraw_handle_close=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_close" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_close" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_close" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_read_buffer in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_read_buffer in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_read_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_read_buffer (); int main () { return libsmraw_handle_read_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_read_buffer=yes else ac_cv_lib_smraw_libsmraw_handle_read_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_read_buffer" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_read_buffer" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_read_buffer" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_seek_offset in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_seek_offset in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_seek_offset+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_seek_offset (); int main () { return libsmraw_handle_seek_offset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_seek_offset=yes else ac_cv_lib_smraw_libsmraw_handle_seek_offset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_seek_offset" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_seek_offset" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_seek_offset" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_write_buffer in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_write_buffer in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_write_buffer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_write_buffer (); int main () { return libsmraw_handle_write_buffer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_write_buffer=yes else ac_cv_lib_smraw_libsmraw_handle_write_buffer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_write_buffer" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_write_buffer" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_write_buffer" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi if test "x$ac_cv_enable_wide_character_type" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_open_wide in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_open_wide in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_open_wide+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_open_wide (); int main () { return libsmraw_handle_open_wide (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_open_wide=yes else ac_cv_lib_smraw_libsmraw_handle_open_wide=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_open_wide" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_open_wide" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_open_wide" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_get_media_size in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_get_media_size in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_get_media_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_get_media_size (); int main () { return libsmraw_handle_get_media_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_get_media_size=yes else ac_cv_lib_smraw_libsmraw_handle_get_media_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_get_media_size" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_get_media_size" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_get_media_size" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_get_bytes_per_sector in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_get_bytes_per_sector in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_get_bytes_per_sector+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_get_bytes_per_sector (); int main () { return libsmraw_handle_get_bytes_per_sector (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_get_bytes_per_sector=yes else ac_cv_lib_smraw_libsmraw_handle_get_bytes_per_sector=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_get_bytes_per_sector" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_get_bytes_per_sector" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_get_bytes_per_sector" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_get_utf8_information_value ac_cv_libsmraw_dummy=yes in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_get_utf8_information_value ac_cv_libsmraw_dummy=yes in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_get_utf8_information_value___________ac_cv_libsmraw_dummy_yes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_get_utf8_information_value ac_cv_libsmraw_dummy=yes (); int main () { return libsmraw_handle_get_utf8_information_value ac_cv_libsmraw_dummy=yes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_get_utf8_information_value___________ac_cv_libsmraw_dummy_yes=yes else ac_cv_lib_smraw_libsmraw_handle_get_utf8_information_value___________ac_cv_libsmraw_dummy_yes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_get_utf8_information_value___________ac_cv_libsmraw_dummy_yes" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_get_utf8_information_value___________ac_cv_libsmraw_dummy_yes" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_get_utf8_information_value___________ac_cv_libsmraw_dummy_yes" = xyes; then : ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_get_utf16_information_value ac_cv_libsmraw_dummy=yes in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_get_utf16_information_value ac_cv_libsmraw_dummy=yes in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_get_utf16_information_value___________ac_cv_libsmraw_dummy_yes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_get_utf16_information_value ac_cv_libsmraw_dummy=yes (); int main () { return libsmraw_handle_get_utf16_information_value ac_cv_libsmraw_dummy=yes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_get_utf16_information_value___________ac_cv_libsmraw_dummy_yes=yes else ac_cv_lib_smraw_libsmraw_handle_get_utf16_information_value___________ac_cv_libsmraw_dummy_yes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_get_utf16_information_value___________ac_cv_libsmraw_dummy_yes" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_get_utf16_information_value___________ac_cv_libsmraw_dummy_yes" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_get_utf16_information_value___________ac_cv_libsmraw_dummy_yes" = xyes; then : ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_set_maximum_segment_size in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_set_maximum_segment_size in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_set_maximum_segment_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_set_maximum_segment_size (); int main () { return libsmraw_handle_set_maximum_segment_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_set_maximum_segment_size=yes else ac_cv_lib_smraw_libsmraw_handle_set_maximum_segment_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_set_maximum_segment_size" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_set_maximum_segment_size" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_set_maximum_segment_size" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_set_media_size in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_set_media_size in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_set_media_size+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_set_media_size (); int main () { return libsmraw_handle_set_media_size (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_set_media_size=yes else ac_cv_lib_smraw_libsmraw_handle_set_media_size=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_set_media_size" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_set_media_size" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_set_media_size" = xyes; then : ac_cv_libsmraw_dummy=yes else ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_set_utf8_integrity_hash_value ac_cv_libsmraw_dummy=yes in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_set_utf8_integrity_hash_value ac_cv_libsmraw_dummy=yes in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_set_utf8_integrity_hash_value___________ac_cv_libsmraw_dummy_yes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_set_utf8_integrity_hash_value ac_cv_libsmraw_dummy=yes (); int main () { return libsmraw_handle_set_utf8_integrity_hash_value ac_cv_libsmraw_dummy=yes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_set_utf8_integrity_hash_value___________ac_cv_libsmraw_dummy_yes=yes else ac_cv_lib_smraw_libsmraw_handle_set_utf8_integrity_hash_value___________ac_cv_libsmraw_dummy_yes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_set_utf8_integrity_hash_value___________ac_cv_libsmraw_dummy_yes" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_set_utf8_integrity_hash_value___________ac_cv_libsmraw_dummy_yes" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_set_utf8_integrity_hash_value___________ac_cv_libsmraw_dummy_yes" = xyes; then : ac_cv_libsmraw=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsmraw_handle_set_utf16_integrity_hash_value ac_cv_libsmraw_dummy=yes in -lsmraw" >&5 $as_echo_n "checking for libsmraw_handle_set_utf16_integrity_hash_value ac_cv_libsmraw_dummy=yes in -lsmraw... " >&6; } if ${ac_cv_lib_smraw_libsmraw_handle_set_utf16_integrity_hash_value___________ac_cv_libsmraw_dummy_yes+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmraw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libsmraw_handle_set_utf16_integrity_hash_value ac_cv_libsmraw_dummy=yes (); int main () { return libsmraw_handle_set_utf16_integrity_hash_value ac_cv_libsmraw_dummy=yes (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_smraw_libsmraw_handle_set_utf16_integrity_hash_value___________ac_cv_libsmraw_dummy_yes=yes else ac_cv_lib_smraw_libsmraw_handle_set_utf16_integrity_hash_value___________ac_cv_libsmraw_dummy_yes=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smraw_libsmraw_handle_set_utf16_integrity_hash_value___________ac_cv_libsmraw_dummy_yes" >&5 $as_echo "$ac_cv_lib_smraw_libsmraw_handle_set_utf16_integrity_hash_value___________ac_cv_libsmraw_dummy_yes" >&6; } if test "x$ac_cv_lib_smraw_libsmraw_handle_set_utf16_integrity_hash_value___________ac_cv_libsmraw_dummy_yes" = xyes; then : ac_cv_libsmraw=no fi ac_cv_libsmraw_LIBADD="-lsmraw" fi fi if test "x$ac_cv_with_libsmraw" != x && test "x$ac_cv_with_libsmraw" != xauto-detect && test "x$ac_cv_libsmraw" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libsmraw in directory: $ac_cv_with_libsmraw See \`config.log' for more details" "$LINENO" 5; } fi fi if test "x$ac_cv_libsmraw" = xyes; then : $as_echo "#define HAVE_LIBSMRAW 1" >>confdefs.h fi if test "x$ac_cv_libsmraw" = xyes; then : HAVE_LIBSMRAW=1 else HAVE_LIBSMRAW=0 fi if test "x$ac_cv_libsmraw" != xyes; then : $as_echo "#define HAVE_LOCAL_LIBSMRAW 1" >>confdefs.h HAVE_LOCAL_LIBSMRAW=1 ac_cv_libsmraw_CPPFLAGS="-I../libsmraw"; ac_cv_libsmraw_LIBADD="../libsmraw/libsmraw.la"; ac_cv_libsmraw=local fi if test "x$ac_cv_libsmraw" = xlocal; then HAVE_LOCAL_LIBSMRAW_TRUE= HAVE_LOCAL_LIBSMRAW_FALSE='#' else HAVE_LOCAL_LIBSMRAW_TRUE='#' HAVE_LOCAL_LIBSMRAW_FALSE= fi if test "x$ac_cv_libsmraw_CPPFLAGS" != "x"; then : LIBSMRAW_CPPFLAGS=$ac_cv_libsmraw_CPPFLAGS fi if test "x$ac_cv_libsmraw_LIBADD" != "x"; then : LIBSMRAW_LIBADD=$ac_cv_libsmraw_LIBADD fi if test "x$ac_cv_libsmraw" = xyes; then : ax_libsmraw_pc_libs_private=-lsmraw fi if test "x$ac_cv_libsmraw" = xyes; then : ax_libsmraw_spec_requires=libsmraw ax_libsmraw_spec_build_requires=libsmraw-devel fi # Check whether --with-libfuse was given. if test "${with_libfuse+set}" = set; then : withval=$with_libfuse; ac_cv_with_libfuse=$withval else ac_cv_with_libfuse=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse" >&5 $as_echo_n "checking whether to use search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse... " >&6; } if ${ac_cv_with_libfuse+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_with_libfuse=auto-detect fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfuse" >&5 $as_echo "$ac_cv_with_libfuse" >&6; } if test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect; then : if test -d "$ac_cv_with_libfuse"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libfuse}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_libfuse" >&5 $as_echo "$as_me: WARNING: no such directory: $ac_cv_with_libfuse" >&2;} fi fi if test "x$ac_cv_with_libfuse" = xno; then : ac_cv_libfuse=no else if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse" >&5 $as_echo_n "checking for fuse... " >&6; } if test -n "$fuse_CFLAGS"; then pkg_cv_fuse_CFLAGS="$fuse_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "fuse >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_fuse_CFLAGS=`$PKG_CONFIG --cflags "fuse >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$fuse_LIBS"; then pkg_cv_fuse_LIBS="$fuse_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "fuse >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_fuse_LIBS=`$PKG_CONFIG --libs "fuse >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then fuse_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fuse >= 2.6" 2>&1` else fuse_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fuse >= 2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$fuse_PKG_ERRORS" >&5 ac_cv_libfuse=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_libfuse=no else fuse_CFLAGS=$pkg_cv_fuse_CFLAGS fuse_LIBS=$pkg_cv_fuse_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_libfuse=libfuse fi fi if test "x$ac_cv_libfuse" = xlibfuse; then : ac_cv_libfuse_CPPFLAGS="$pkg_cv_fuse_CFLAGS" ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS" else for ac_header in fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_fuse_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FUSE_H 1 _ACEOF ac_cv_header_fuse_h=yes else ac_cv_header_fuse_h=no fi done if test "x$ac_cv_header_fuse_h" = xno; then : { ac_cv_header_fuse_h=; unset ac_cv_header_fuse_h;} CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" for ac_header in fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_fuse_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FUSE_H 1 _ACEOF fi done fi if test "x$ac_cv_header_fuse_h" = xno; then : ac_cv_libfuse=no else ac_cv_libfuse=libfuse { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -lfuse" >&5 $as_echo_n "checking for fuse_daemonize in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_daemonize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_daemonize (); int main () { return fuse_daemonize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fuse_fuse_daemonize=yes else ac_cv_lib_fuse_fuse_daemonize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_daemonize" >&5 $as_echo "$ac_cv_lib_fuse_fuse_daemonize" >&6; } if test "x$ac_cv_lib_fuse_fuse_daemonize" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -lfuse" >&5 $as_echo_n "checking for fuse_destroy in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_destroy (); int main () { return fuse_destroy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fuse_fuse_destroy=yes else ac_cv_lib_fuse_fuse_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_destroy" >&5 $as_echo "$ac_cv_lib_fuse_fuse_destroy" >&6; } if test "x$ac_cv_lib_fuse_fuse_destroy" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -lfuse" >&5 $as_echo_n "checking for fuse_mount in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_mount+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_mount (); int main () { return fuse_mount (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fuse_fuse_mount=yes else ac_cv_lib_fuse_fuse_mount=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_mount" >&5 $as_echo "$ac_cv_lib_fuse_fuse_mount" >&6; } if test "x$ac_cv_lib_fuse_fuse_mount" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -lfuse" >&5 $as_echo_n "checking for fuse_new in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_new (); int main () { return fuse_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fuse_fuse_new=yes else ac_cv_lib_fuse_fuse_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_new" >&5 $as_echo "$ac_cv_lib_fuse_fuse_new" >&6; } if test "x$ac_cv_lib_fuse_fuse_new" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi ac_cv_libfuse_LIBADD="-lfuse"; fi fi if test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno; then : CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" for ac_header in osxfuse/fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_osxfuse_fuse_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OSXFUSE_FUSE_H 1 _ACEOF fi done if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : { ac_cv_header_osxfuse_fuse_h=; unset ac_cv_header_osxfuse_fuse_h;} CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" for ac_header in osxfuse/fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_osxfuse_fuse_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OSXFUSE_FUSE_H 1 _ACEOF fi done fi if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : ac_cv_libfuse=no else ac_cv_libfuse=libosxfuse { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -losxfuse" >&5 $as_echo_n "checking for fuse_daemonize in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_daemonize+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_daemonize (); int main () { return fuse_daemonize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_osxfuse_fuse_daemonize=yes else ac_cv_lib_osxfuse_fuse_daemonize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_daemonize" >&5 $as_echo "$ac_cv_lib_osxfuse_fuse_daemonize" >&6; } if test "x$ac_cv_lib_osxfuse_fuse_daemonize" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -losxfuse" >&5 $as_echo_n "checking for fuse_destroy in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_destroy (); int main () { return fuse_destroy (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_osxfuse_fuse_destroy=yes else ac_cv_lib_osxfuse_fuse_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_destroy" >&5 $as_echo "$ac_cv_lib_osxfuse_fuse_destroy" >&6; } if test "x$ac_cv_lib_osxfuse_fuse_destroy" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -losxfuse" >&5 $as_echo_n "checking for fuse_mount in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_mount+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_mount (); int main () { return fuse_mount (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_osxfuse_fuse_mount=yes else ac_cv_lib_osxfuse_fuse_mount=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_mount" >&5 $as_echo "$ac_cv_lib_osxfuse_fuse_mount" >&6; } if test "x$ac_cv_lib_osxfuse_fuse_mount" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -losxfuse" >&5 $as_echo_n "checking for fuse_new in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fuse_new (); int main () { return fuse_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_osxfuse_fuse_new=yes else ac_cv_lib_osxfuse_fuse_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_new" >&5 $as_echo "$ac_cv_lib_osxfuse_fuse_new" >&6; } if test "x$ac_cv_lib_osxfuse_fuse_new" = xyes; then : ac_cv_libfuse_dummy=yes else ac_cv_libfuse=no fi ac_cv_libfuse_LIBADD="-losxfuse"; fi fi fi if test "x$ac_cv_libfuse" = xlibfuse; then : $as_echo "#define HAVE_LIBFUSE 1" >>confdefs.h fi if test "x$ac_cv_libfuse" = xlibosxfuse; then : $as_echo "#define HAVE_LIBOSXFUSE 1" >>confdefs.h fi if test "x$ac_cv_libfuse" != xno; then : HAVE_LIBFUSE=1 else HAVE_LIBFUSE=0 fi if test "x$ac_cv_libfuse_CPPFLAGS" != "x"; then : LIBFUSE_CPPFLAGS=$ac_cv_libfuse_CPPFLAGS fi if test "x$ac_cv_libfuse_LIBADD" != "x"; then : LIBFUSE_LIBADD=$ac_cv_libfuse_LIBADD fi if test "x$ac_cv_libfuse" = xlibfuse; then : ax_libfuse_pc_libs_private=-lfuse fi if test "x$ac_cv_libfuse" = xlibosxfuse; then : ax_libfuse_pc_libs_private=-losxfuse fi if test "x$ac_cv_libfuse" = xlibfuse; then : ax_libfuse_spec_requires=fuse-libs ax_libfuse_spec_build_requires=fuse-devel fi for ac_header in signal.h sys/signal.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in close getopt setvbuf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_close" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: close See \`config.log' for more details" "$LINENO" 5; } fi ac_libewf_determine_operating_system_target_string="$target"; if test "x$ac_libewf_determine_operating_system_target_string" = x; then : ac_libewf_determine_operating_system_target_string="$host" fi if test "x$ac_libewf_determine_operating_system_target_string" = x; then : ac_libewf_determine_operating_system_target_string="$build" fi case $ac_libewf_determine_operating_system_target_string in #( *cygwin*) : ac_libewf_operating_system="Cygwin"; ;; #( *darwin*) : ac_libewf_operating_system="Darwin"; ;; #( *freebsd*) : ac_libewf_operating_system="FreeBSD"; ;; #( *netbsd*) : ac_libewf_operating_system="NetBSD"; ;; #( *openbsd*) : ac_libewf_operating_system="OpenBSD"; ;; #( *linux*) : ac_libewf_operating_system="Linux"; ;; #( *mingw*) : ac_libewf_operating_system="MingW"; ;; #( *solaris*) : ac_libewf_operating_system="SunOS"; ;; #( *) : ac_libewf_operating_system="Unknown"; ;; #( *) : ;; esac cat >>confdefs.h <<_ACEOF #define LIBEWF_OPERATING_SYSTEM "$ac_libewf_operating_system" _ACEOF for ac_header in errno.h glob.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_glob_h" = xno; then : for ac_header in io.h do : ac_fn_c_check_header_mongrel "$LINENO" "io.h" "ac_cv_header_io_h" "$ac_includes_default" if test "x$ac_cv_header_io_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IO_H 1 _ACEOF fi done fi for ac_header in stdarg.h varargs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } fi # Check whether --enable-static-executables was given. if test "${enable_static_executables+set}" = set; then : enableval=$enable_static_executables; ac_cv_enable_static_executables=$enableval else ac_cv_enable_static_executables=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build static executables (binaries)" >&5 $as_echo_n "checking whether to enable build static executables (binaries)... " >&6; } if ${ac_cv_enable_static_executables+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_enable_static_executables=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_static_executables" >&5 $as_echo "$ac_cv_enable_static_executables" >&6; } if test "x$ac_cv_enable_static_executables" != xno; then : STATIC_LDFLAGS="-all-static"; ac_cv_enable_static_executables=yes enable_shared=no fi if test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno; then : case $host in #( *cygwin* | *mingw*) : LIBEWF_DLL_IMPORT="-DLIBEWF_DLL_IMPORT" ;; #( *) : ;; esac fi if test "x$enable_shared" = xyes; then : case $host in #( *cygwin* | *mingw* | *msys*) : $as_echo "#define HAVE_DLLMAIN 1" >>confdefs.h HAVE_DLLMAIN=1 if test "x$ac_cv_enable_static_executables" = xno; then : LIBEWF_DLL_IMPORT="-DLIBEWF_DLL_IMPORT" fi ;; #( *) : ;; esac fi CFLAGS="$CFLAGS -Wall"; if 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; then : libewf_spec_requires=Requires: fi if test "x$ac_cv_libodraw" = xyes || test "x$ac_cv_libsmdev" = xyes || test "x$ac_cv_libsmraw" = xyes || test "x$ac_cv_libfuse" != xno; then : libewf_spec_tools_build_requires=BuildRequires: fi DPKG_DATE=`date -R 2> /dev/null` SPEC_DATE=`date +"%a %b %e %Y" 2> /dev/null` ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files include/Makefile" ac_config_files="$ac_config_files common/Makefile" ac_config_files="$ac_config_files libcerror/Makefile" ac_config_files="$ac_config_files libcthreads/Makefile" ac_config_files="$ac_config_files libcdata/Makefile" ac_config_files="$ac_config_files libcdatetime/Makefile" ac_config_files="$ac_config_files libclocale/Makefile" ac_config_files="$ac_config_files libcnotify/Makefile" ac_config_files="$ac_config_files libcsplit/Makefile" ac_config_files="$ac_config_files libuna/Makefile" ac_config_files="$ac_config_files libcfile/Makefile" ac_config_files="$ac_config_files libcpath/Makefile" ac_config_files="$ac_config_files libbfio/Makefile" ac_config_files="$ac_config_files libfcache/Makefile" ac_config_files="$ac_config_files libfdata/Makefile" ac_config_files="$ac_config_files libfvalue/Makefile" ac_config_files="$ac_config_files libmfdata/Makefile" ac_config_files="$ac_config_files libhmac/Makefile" ac_config_files="$ac_config_files libewf/Makefile" ac_config_files="$ac_config_files libodraw/Makefile" ac_config_files="$ac_config_files libsmdev/Makefile" ac_config_files="$ac_config_files libsmraw/Makefile" ac_config_files="$ac_config_files ewftools/Makefile" ac_config_files="$ac_config_files ewf.net/Makefile" ac_config_files="$ac_config_files pyewf/Makefile" ac_config_files="$ac_config_files pyewf-python2/Makefile" ac_config_files="$ac_config_files pyewf-python3/Makefile" ac_config_files="$ac_config_files po/Makefile.in" ac_config_files="$ac_config_files po/Makevars" ac_config_files="$ac_config_files documents/Makefile" ac_config_files="$ac_config_files manuals/Makefile" ac_config_files="$ac_config_files tests/Makefile" ac_config_files="$ac_config_files examples/Makefile" ac_config_files="$ac_config_files msvscpp/Makefile" ac_config_files="$ac_config_files include/libewf.h" ac_config_files="$ac_config_files include/libewf/definitions.h" ac_config_files="$ac_config_files include/libewf/features.h" ac_config_files="$ac_config_files include/libewf/types.h" ac_config_files="$ac_config_files libewf/libewf_definitions.h" ac_config_files="$ac_config_files common/types.h" ac_config_files="$ac_config_files dpkg/changelog" ac_config_files="$ac_config_files ewf.net/ewf.net.rc" ac_config_files="$ac_config_files libewf/libewf.rc" ac_config_files="$ac_config_files libewf.pc" ac_config_files="$ac_config_files libewf.spec" ac_config_headers="$ac_config_headers common/config.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX11_TRUE}" && test -z "${HAVE_CXX11_FALSE}"; then as_fn_error $? "conditional \"HAVE_CXX11\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCERROR_TRUE}" && test -z "${HAVE_LOCAL_LIBCERROR_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCERROR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCTHREADS_TRUE}" && test -z "${HAVE_LOCAL_LIBCTHREADS_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCTHREADS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCDATA_TRUE}" && test -z "${HAVE_LOCAL_LIBCDATA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCDATA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCDATETIME_TRUE}" && test -z "${HAVE_LOCAL_LIBCDATETIME_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCDATETIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCLOCALE_TRUE}" && test -z "${HAVE_LOCAL_LIBCLOCALE_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCLOCALE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCNOTIFY_TRUE}" && test -z "${HAVE_LOCAL_LIBCNOTIFY_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCNOTIFY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCSPLIT_TRUE}" && test -z "${HAVE_LOCAL_LIBCSPLIT_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCSPLIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBUNA_TRUE}" && test -z "${HAVE_LOCAL_LIBUNA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBUNA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCFILE_TRUE}" && test -z "${HAVE_LOCAL_LIBCFILE_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCFILE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBCPATH_TRUE}" && test -z "${HAVE_LOCAL_LIBCPATH_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCPATH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBBFIO_TRUE}" && test -z "${HAVE_LOCAL_LIBBFIO_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBBFIO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBFCACHE_TRUE}" && test -z "${HAVE_LOCAL_LIBFCACHE_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBFCACHE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBFDATA_TRUE}" && test -z "${HAVE_LOCAL_LIBFDATA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBFDATA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBFVALUE_TRUE}" && test -z "${HAVE_LOCAL_LIBFVALUE_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBFVALUE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBMFDATA_TRUE}" && test -z "${HAVE_LOCAL_LIBMFDATA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBMFDATA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBHMAC_TRUE}" && test -z "${HAVE_LOCAL_LIBHMAC_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBHMAC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_V1_API_TRUE}" && test -z "${HAVE_V1_API_FALSE}"; then as_fn_error $? "conditional \"HAVE_V1_API\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON2_TRUE}" && test -z "${HAVE_PYTHON2_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON3_TRUE}" && test -z "${HAVE_PYTHON3_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON_TESTS_TRUE}" && test -z "${HAVE_PYTHON_TESTS_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBODRAW_TRUE}" && test -z "${HAVE_LOCAL_LIBODRAW_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBODRAW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBSMDEV_TRUE}" && test -z "${HAVE_LOCAL_LIBSMDEV_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBSMDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LOCAL_LIBSMRAW_TRUE}" && test -z "${HAVE_LOCAL_LIBSMRAW_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBSMRAW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libewf $as_me 20140807, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libewf config.status 20140807 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "libcerror/Makefile") CONFIG_FILES="$CONFIG_FILES libcerror/Makefile" ;; "libcthreads/Makefile") CONFIG_FILES="$CONFIG_FILES libcthreads/Makefile" ;; "libcdata/Makefile") CONFIG_FILES="$CONFIG_FILES libcdata/Makefile" ;; "libcdatetime/Makefile") CONFIG_FILES="$CONFIG_FILES libcdatetime/Makefile" ;; "libclocale/Makefile") CONFIG_FILES="$CONFIG_FILES libclocale/Makefile" ;; "libcnotify/Makefile") CONFIG_FILES="$CONFIG_FILES libcnotify/Makefile" ;; "libcsplit/Makefile") CONFIG_FILES="$CONFIG_FILES libcsplit/Makefile" ;; "libuna/Makefile") CONFIG_FILES="$CONFIG_FILES libuna/Makefile" ;; "libcfile/Makefile") CONFIG_FILES="$CONFIG_FILES libcfile/Makefile" ;; "libcpath/Makefile") CONFIG_FILES="$CONFIG_FILES libcpath/Makefile" ;; "libbfio/Makefile") CONFIG_FILES="$CONFIG_FILES libbfio/Makefile" ;; "libfcache/Makefile") CONFIG_FILES="$CONFIG_FILES libfcache/Makefile" ;; "libfdata/Makefile") CONFIG_FILES="$CONFIG_FILES libfdata/Makefile" ;; "libfvalue/Makefile") CONFIG_FILES="$CONFIG_FILES libfvalue/Makefile" ;; "libmfdata/Makefile") CONFIG_FILES="$CONFIG_FILES libmfdata/Makefile" ;; "libhmac/Makefile") CONFIG_FILES="$CONFIG_FILES libhmac/Makefile" ;; "libewf/Makefile") CONFIG_FILES="$CONFIG_FILES libewf/Makefile" ;; "libodraw/Makefile") CONFIG_FILES="$CONFIG_FILES libodraw/Makefile" ;; "libsmdev/Makefile") CONFIG_FILES="$CONFIG_FILES libsmdev/Makefile" ;; "libsmraw/Makefile") CONFIG_FILES="$CONFIG_FILES libsmraw/Makefile" ;; "ewftools/Makefile") CONFIG_FILES="$CONFIG_FILES ewftools/Makefile" ;; "ewf.net/Makefile") CONFIG_FILES="$CONFIG_FILES ewf.net/Makefile" ;; "pyewf/Makefile") CONFIG_FILES="$CONFIG_FILES pyewf/Makefile" ;; "pyewf-python2/Makefile") CONFIG_FILES="$CONFIG_FILES pyewf-python2/Makefile" ;; "pyewf-python3/Makefile") CONFIG_FILES="$CONFIG_FILES pyewf-python3/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po/Makevars") CONFIG_FILES="$CONFIG_FILES po/Makevars" ;; "documents/Makefile") CONFIG_FILES="$CONFIG_FILES documents/Makefile" ;; "manuals/Makefile") CONFIG_FILES="$CONFIG_FILES manuals/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "msvscpp/Makefile") CONFIG_FILES="$CONFIG_FILES msvscpp/Makefile" ;; "include/libewf.h") CONFIG_FILES="$CONFIG_FILES include/libewf.h" ;; "include/libewf/definitions.h") CONFIG_FILES="$CONFIG_FILES include/libewf/definitions.h" ;; "include/libewf/features.h") CONFIG_FILES="$CONFIG_FILES include/libewf/features.h" ;; "include/libewf/types.h") CONFIG_FILES="$CONFIG_FILES include/libewf/types.h" ;; "libewf/libewf_definitions.h") CONFIG_FILES="$CONFIG_FILES libewf/libewf_definitions.h" ;; "common/types.h") CONFIG_FILES="$CONFIG_FILES common/types.h" ;; "dpkg/changelog") CONFIG_FILES="$CONFIG_FILES dpkg/changelog" ;; "ewf.net/ewf.net.rc") CONFIG_FILES="$CONFIG_FILES ewf.net/ewf.net.rc" ;; "libewf/libewf.rc") CONFIG_FILES="$CONFIG_FILES libewf/libewf.rc" ;; "libewf.pc") CONFIG_FILES="$CONFIG_FILES libewf.pc" ;; "libewf.spec") CONFIG_FILES="$CONFIG_FILES libewf.spec" ;; "common/config.h") CONFIG_HEADERS="$CONFIG_HEADERS common/config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: Building: libcerror support: $ac_cv_libcerror libcthreads support: $ac_cv_libcthreads libcdata support: $ac_cv_libcdata libcdatetime support: $ac_cv_libcdatetime libclocale support: $ac_cv_libclocale libcnotify support: $ac_cv_libcnotify libcsplit support: $ac_cv_libcsplit libuna support: $ac_cv_libuna libcfile support: $ac_cv_libcfile libcpath support: $ac_cv_libcpath libbfio support: $ac_cv_libbfio libfcache support: $ac_cv_libfcache libfdata support: $ac_cv_libfdata libfvalue support: $ac_cv_libfvalue libmfdata support: $ac_cv_libmfdata ADLER32 checksum support: $ac_cv_adler32 DEFLATE compression support: $ac_cv_uncompress libhmac support: $ac_cv_libhmac MD5 support: $ac_cv_libhmac_md5 SHA1 support: $ac_cv_libhmac_sha1 SHA256 support: $ac_cv_libhmac_sha256 libodraw support: $ac_cv_libodraw libsmdev support: $ac_cv_libsmdev libsmraw support: $ac_cv_libsmraw GUID/UUID support: $ac_cv_libuuid FUSE support: $ac_cv_libfuse Features: Multi-threading support: $ac_cv_libcthreads_multi_threading Wide character type support: $ac_cv_enable_wide_character_type ewftools are build as static executables: $ac_cv_enable_static_executables Python (pyewf) support: $ac_cv_enable_python Verbose output: $ac_cv_enable_verbose_output Debug output: $ac_cv_enable_debug_output Version 1 API compatibility: $ac_cv_enable_v1_api " >&5 $as_echo "$as_me: Building: libcerror support: $ac_cv_libcerror libcthreads support: $ac_cv_libcthreads libcdata support: $ac_cv_libcdata libcdatetime support: $ac_cv_libcdatetime libclocale support: $ac_cv_libclocale libcnotify support: $ac_cv_libcnotify libcsplit support: $ac_cv_libcsplit libuna support: $ac_cv_libuna libcfile support: $ac_cv_libcfile libcpath support: $ac_cv_libcpath libbfio support: $ac_cv_libbfio libfcache support: $ac_cv_libfcache libfdata support: $ac_cv_libfdata libfvalue support: $ac_cv_libfvalue libmfdata support: $ac_cv_libmfdata ADLER32 checksum support: $ac_cv_adler32 DEFLATE compression support: $ac_cv_uncompress libhmac support: $ac_cv_libhmac MD5 support: $ac_cv_libhmac_md5 SHA1 support: $ac_cv_libhmac_sha1 SHA256 support: $ac_cv_libhmac_sha256 libodraw support: $ac_cv_libodraw libsmdev support: $ac_cv_libsmdev libsmraw support: $ac_cv_libsmraw GUID/UUID support: $ac_cv_libuuid FUSE support: $ac_cv_libfuse Features: Multi-threading support: $ac_cv_libcthreads_multi_threading Wide character type support: $ac_cv_enable_wide_character_type ewftools are build as static executables: $ac_cv_enable_static_executables Python (pyewf) support: $ac_cv_enable_python Verbose output: $ac_cv_enable_verbose_output Debug output: $ac_cv_enable_debug_output Version 1 API compatibility: $ac_cv_enable_v1_api " >&6;}; libewf-20140807/libuna/0000775000175000017500000000000013443455445016616 5ustar00lordyestalordyesta00000000000000libewf-20140807/libuna/libuna_url_stream.c0000664000175000017500000003625613443450072022474 0ustar00lordyestalordyesta00000000000000/* * Percent or URL encoded stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_url_stream.h" /* Determines the size of a url stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_url_stream_size_from_byte_stream( uint8_t *byte_stream, size_t byte_stream_size, size_t *url_stream_size, libcerror_error_t **error ) { static char *function = "libuna_url_stream_size_from_byte_stream"; size_t byte_stream_index = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( url_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid url stream size.", function ); return( -1 ); } /* TODO what about end of string character */ *url_stream_size = 0; /* Check if the byte stream contains * reserved or non-allowed characters that need to be decoded */ while( byte_stream_index < byte_stream_size ) { /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'A' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'I' ) ) { *url_stream_size += 1; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'J' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'R' ) ) { *url_stream_size += 1; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'S' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'Z' ) ) { *url_stream_size += 1; } /* a-z is not a continous range on an EBCDIC based system * it consists of the ranges: a-i, j-r, s-z */ else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'a' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'i' ) ) { *url_stream_size += 1; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'j' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'r' ) ) { *url_stream_size += 1; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 's' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'z' ) ) { *url_stream_size += 1; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) '0' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) '9' ) ) { *url_stream_size += 1; } else if( ( byte_stream[ byte_stream_index ] == (uint8_t) '-' ) || ( byte_stream[ byte_stream_index ] == (uint8_t) '_' ) || ( byte_stream[ byte_stream_index ] == (uint8_t) '.' ) || ( byte_stream[ byte_stream_index ] == (uint8_t) '`' ) ) { *url_stream_size += 1; } else { *url_stream_size += 3; } byte_stream_index++; } return( 1 ); } /* Copies a url stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_url_stream_copy_from_byte_stream( uint8_t *url_stream, size_t url_stream_size, uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ) { static char *function = "libuna_url_stream_copy_from_byte_stream"; size_t url_stream_index = 0; size_t byte_stream_index = 0; uint8_t byte_value = 0; if( url_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid url stream.", function ); return( -1 ); } if( url_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid url stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } /* TODO what about end of string character */ /* Check if the byte stream contains * reserved or non-allowed characters that need to be decoded */ while( byte_stream_index < byte_stream_size ) { if( url_stream_index >= url_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: url stream is too small.", function ); return( -1 ); } /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'A' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'I' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'J' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'R' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'S' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'Z' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } /* a-z is not a continous range on an EBCDIC based system * it consists of the ranges: a-i, j-r, s-z */ else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'a' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'i' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 'j' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'r' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) 's' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) 'z' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else if( ( byte_stream[ byte_stream_index ] >= (uint8_t) '0' ) && ( byte_stream[ byte_stream_index ] <= (uint8_t) '9' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else if( ( byte_stream[ byte_stream_index ] == (uint8_t) '-' ) || ( byte_stream[ byte_stream_index ] == (uint8_t) '_' ) || ( byte_stream[ byte_stream_index ] == (uint8_t) '.' ) || ( byte_stream[ byte_stream_index ] == (uint8_t) '`' ) ) { url_stream[ url_stream_index++ ] = byte_stream[ byte_stream_index ]; } else { if( ( url_stream_index + 3 ) > url_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: url stream is too small.", function ); return( -1 ); } url_stream[ url_stream_index++ ] = (uint8_t) '%'; byte_value = byte_stream[ byte_stream_index ] >> 4; if( byte_value <= 9 ) { url_stream[ url_stream_index++ ] = (uint8_t) '0' + byte_value; } else { url_stream[ url_stream_index++ ] = (uint8_t) 'A' + byte_value; } byte_value = byte_stream[ byte_stream_index ] & 0x0f; if( byte_value < 9 ) { url_stream[ url_stream_index++ ] = (uint8_t) '0' + byte_value; } else { url_stream[ url_stream_index++ ] = (uint8_t) 'A' + byte_value; } } byte_stream_index++; } return( 1 ); } /* Determines the size of a byte stream from a url stream * Returns 1 if successful or -1 on error */ int libuna_url_stream_size_to_byte_stream( uint8_t *url_stream, size_t url_stream_size, size_t *byte_stream_size, libcerror_error_t **error ) { static char *function = "libuna_url_stream_size_to_byte_stream"; size_t url_stream_index = 0; if( url_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid url stream.", function ); return( -1 ); } if( url_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid url stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } *byte_stream_size = 0; while( url_stream_index < url_stream_size ) { if( url_stream[ url_stream_index ] == (uint8_t) '%' ) { url_stream_index++; if( ( url_stream_index + 2 ) > url_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: url stream is too small.", function ); return( -1 ); } if( ( url_stream[ url_stream_index ] >= (uint8_t) 'A' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'F' ) ) { } else if( ( url_stream[ url_stream_index ] >= (uint8_t) 'a' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'f' ) ) { } else if( ( url_stream[ url_stream_index ] >= (uint8_t) '0' ) && ( url_stream[ url_stream_index ] <= (uint8_t) '9' ) ) { } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid URL encoded character.", function ); return( -1 ); } url_stream_index++; if( ( url_stream[ url_stream_index ] >= (uint8_t) 'A' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'F' ) ) { } else if( ( url_stream[ url_stream_index ] >= (uint8_t) 'a' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'f' ) ) { } else if( ( url_stream[ url_stream_index ] >= (uint8_t) '0' ) && ( url_stream[ url_stream_index ] <= (uint8_t) '9' ) ) { } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid URL encoded character.", function ); return( -1 ); } url_stream_index++; } else { url_stream_index++; } *byte_stream_size += 1; } return( 1 ); } /* Copies a byte stream from a url stream * Returns 1 if successful or -1 on error */ int libuna_url_stream_copy_to_byte_stream( uint8_t *url_stream, size_t url_stream_size, uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ) { static char *function = "libuna_url_stream_copy_to_byte_stream"; size_t url_stream_index = 0; size_t byte_stream_index = 0; uint8_t byte_value = 0; if( url_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid url stream.", function ); return( -1 ); } if( url_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid url stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } while( url_stream_index < url_stream_size ) { if( byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream is too small.", function ); return( -1 ); } if( url_stream[ url_stream_index ] == (uint8_t) '%' ) { url_stream_index++; if( ( url_stream_index + 2 ) > url_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: url stream is too small.", function ); return( -1 ); } if( ( url_stream[ url_stream_index ] >= (uint8_t) 'A' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'F' ) ) { byte_value = url_stream[ url_stream_index ] - (uint8_t) 'A'; } else if( ( url_stream[ url_stream_index ] >= (uint8_t) 'a' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'f' ) ) { byte_value = url_stream[ url_stream_index ] - (uint8_t) 'a'; } else if( ( url_stream[ url_stream_index ] >= (uint8_t) '0' ) && ( url_stream[ url_stream_index ] <= (uint8_t) '9' ) ) { byte_value = url_stream[ url_stream_index ] - (uint8_t) '0'; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid URL encoded character.", function ); return( -1 ); } byte_value <<= 4; url_stream_index++; if( ( url_stream[ url_stream_index ] >= (uint8_t) 'A' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'F' ) ) { byte_value += url_stream[ url_stream_index ] - (uint8_t) 'A'; } else if( ( url_stream[ url_stream_index ] >= (uint8_t) 'a' ) && ( url_stream[ url_stream_index ] <= (uint8_t) 'f' ) ) { byte_value += url_stream[ url_stream_index ] - (uint8_t) 'a'; } else if( ( url_stream[ url_stream_index ] >= (uint8_t) '0' ) && ( url_stream[ url_stream_index ] <= (uint8_t) '9' ) ) { byte_value += url_stream[ url_stream_index ] - (uint8_t) '0'; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid URL encoded character.", function ); return( -1 ); } url_stream_index++; byte_stream[ byte_stream_index++ ] = byte_value; } else { byte_stream[ byte_stream_index++ ] = url_stream[ url_stream_index++ ]; } } return( 1 ); } libewf-20140807/libuna/libuna_support.c0000664000175000017500000000216613443450072022024 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_support.h" #if !defined( HAVE_LOCAL_LIBUNA ) /* Returns the library version as a string */ const char *libuna_get_version( void ) { return( (const char *) LIBUNA_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_5.c0000664000175000017500000000526413443450072023654 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-5 codepage (Cyrillic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_5.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-5 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f }; /* Unicode to ASCII character lookup table for ISO 8859-5 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ 96 ] = { 0x1a, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x1a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x1a, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a, 0xfe, 0xff }; libewf-20140807/libuna/libuna_codepage_iso_8859_2.c0000664000175000017500000000703413443450072023646 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-2 codepage (Central European) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_2.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-2 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 }; /* Unicode to ASCII character lookup table for ISO 8859-2 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ 128 ] = { 0xa0, 0x1a, 0x1a, 0x1a, 0xa4, 0x1a, 0x1a, 0xa7, 0xa8, 0x1a, 0x1a, 0x1a, 0x1a, 0xad, 0x1a, 0x1a, 0xb0, 0x1a, 0x1a, 0x1a, 0xb4, 0x1a, 0x1a, 0x1a, 0xb8, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc1, 0xc2, 0x1a, 0xc4, 0x1a, 0x1a, 0xc7, 0x1a, 0xc9, 0x1a, 0xcb, 0x1a, 0xcd, 0xce, 0x1a, 0x1a, 0x1a, 0x1a, 0xd3, 0xd4, 0x1a, 0xd6, 0xd7, 0x1a, 0x1a, 0xda, 0x1a, 0xdc, 0xdd, 0x1a, 0xdf, 0x1a, 0xe1, 0xe2, 0x1a, 0xe4, 0x1a, 0x1a, 0xe7, 0x1a, 0xe9, 0x1a, 0xeb, 0x1a, 0xed, 0xee, 0x1a, 0x1a, 0x1a, 0x1a, 0xf3, 0xf4, 0x1a, 0xf6, 0xf7, 0x1a, 0x1a, 0xfa, 0x1a, 0xfc, 0xfd, 0x1a, 0x1a, 0x1a, 0x1a, 0xc3, 0xe3, 0xa1, 0xb1, 0xc6, 0xe6, 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0xcf, 0xef, 0xd0, 0xf0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xca, 0xea, 0xcc, 0xec, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ 72 ] = { 0x1a, 0xc5, 0xe5, 0x1a, 0x1a, 0xa5, 0xb5, 0x1a, 0x1a, 0xa3, 0xb3, 0xd1, 0xf1, 0x1a, 0x1a, 0xd2, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd5, 0xf5, 0x1a, 0x1a, 0xc0, 0xe0, 0x1a, 0x1a, 0xd8, 0xf8, 0xa6, 0xb6, 0x1a, 0x1a, 0xaa, 0xba, 0xa9, 0xb9, 0xde, 0xfe, 0xab, 0xbb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd9, 0xf9, 0xdb, 0xfb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xac, 0xbc, 0xaf, 0xbf, 0xae, 0xbe, 0x1a }; const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ 8 ] = { 0xa2, 0xff, 0x1a, 0xb2, 0x1a, 0xbd, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_codepage_windows_1253.c0000664000175000017500000000656013443450072024305 0ustar00lordyestalordyesta00000000000000/* * Windows 1253 codepage (Greek) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1253.h" /* Extended ASCII to Unicode character lookup table for Windows 1253 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0xfffd, 0x2030, 0xfffd, 0x2039, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0xfffd, 0x2122, 0xfffd, 0x203a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x00a0, 0x0385, 0x0386, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0xfffd, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x2015, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x00b5, 0x00b6, 0x00b7, 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0xfffd, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0xfffd }; /* Unicode to ASCII character lookup table for Windows 1253 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0x1a, 0x1a, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0x1a, 0xb0, 0xb1, 0xb2, 0xb3, 0x1a, 0xb5, 0xb6, 0xb7, 0x1a, 0x1a, 0x1a, 0xbb, 0x1a, 0xbd, 0x1a, 0x1a, }; const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x0380[ 80 ] = { 0x1a, 0x1a, 0x1a, 0x1a, 0xb4, 0xa1, 0xa2, 0x1a, 0xb8, 0xb9, 0xba, 0x1a, 0xbc, 0x1a, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0x1a, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x1a, }; const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0xaf, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_codepage_koi8_u.h0000664000175000017500000000263313443450072023341 0ustar00lordyestalordyesta00000000000000/* * KOI8-U codepage (Ukrainian Cyrillic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_KOI8_U_H ) #define _LIBUNA_CODEPAGE_KOI8_U_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ 64 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x2550[ 32 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_KOI8_U_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1252.c0000664000175000017500000000342013443450072024274 0ustar00lordyestalordyesta00000000000000/* * Windows 1252 codepage (Western European/Latin 1) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1252.h" /* Extended ASCII to Unicode character lookup table for Windows 1252 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ 32 ] = { 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0xfffd, 0x017d, 0xfffd, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0xfffd, 0x017e, 0x0178 }; /* Unicode to ASCII character lookup table for Windows 1252 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_utf32_stream.c0000664000175000017500000004652413443450072022634 0ustar00lordyestalordyesta00000000000000/* * UTF-32 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf32_stream.h" /* Copies an UTF-32 stream byte order mark (BOM) * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_copy_byte_order_mark( uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_stream_index, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_copy_byte_order_mark"; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream index.", function ); return( -1 ); } if( ( *utf32_stream_index + 4 ) > utf32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 stream too small.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( byte_order == LIBUNA_ENDIAN_BIG ) { utf32_stream[ *utf32_stream_index ] = 0x00; utf32_stream[ *utf32_stream_index + 1 ] = 0x00; utf32_stream[ *utf32_stream_index + 2 ] = 0xfe; utf32_stream[ *utf32_stream_index + 3 ] = 0xff; } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf32_stream[ *utf32_stream_index ] = 0xff; utf32_stream[ *utf32_stream_index + 1 ] = 0xfe; utf32_stream[ *utf32_stream_index + 2 ] = 0x00; utf32_stream[ *utf32_stream_index + 3 ] = 0x00; } *utf32_stream_index += 4; return( 1 ); } /* Determines the size of an UTF-32 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf32_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_size_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf8_string_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf32_stream_size = 1; while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Convert the number of characters into bytes */ *utf32_stream_size *= 4; return( 1 ); } /* Copies an UTF-32 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_copy_from_utf8( uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_copy_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf32_stream_index = 0; size_t utf8_string_index = 0; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf32_stream_copy_byte_order_mark( utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-32 byte order mark.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 stream bytes */ if( libuna_unicode_character_copy_to_utf32_stream( unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-32 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf32_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_size_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf32_stream_size = 1; while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Convert the number of characters into bytes */ *utf32_stream_size *= 4; return( 1 ); } /* Copies an UTF-32 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_copy_from_utf16( uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_copy_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; size_t utf32_stream_index = 0; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf32_stream_copy_byte_order_mark( utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-32 byte order mark.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 stream bytes */ if( libuna_unicode_character_copy_to_utf32_stream( unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-32 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_size_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_string_index = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf32_stream_size = 1; while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Convert the number of characters into bytes */ *utf32_stream_size *= 4; return( 1 ); } /* Copies an UTF-32 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf32_stream_copy_from_utf32( uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_stream_copy_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_stream_index = 0; size_t utf32_string_index = 0; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf32_stream_copy_byte_order_mark( utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-32 byte order mark.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 stream bytes */ if( libuna_unicode_character_copy_to_utf32_stream( unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } libewf-20140807/libuna/libuna_codepage_windows_1257.h0000664000175000017500000000267213443450072024316 0ustar00lordyestalordyesta00000000000000/* * Windows 1257 codepage (Baltic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1257_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1257_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ 224 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1257_H ) */ libewf-20140807/libuna/libuna_utf32_string.c0000664000175000017500000021713013443450072022640 0ustar00lordyestalordyesta00000000000000/* * UTF-32 string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf32_string.h" /* Determines the size of an UTF-32 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, int codepage, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_byte_stream"; size_t byte_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( byte_stream_size == 0 ) { return( 1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } /* Determine how many UTF-32 character byte double words are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_byte_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_byte_stream"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_byte_stream( utf32_string, utf32_string_size, &utf32_string_index, byte_stream, byte_stream_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_byte_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_byte_stream"; size_t byte_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing byte stream value.", function ); return( -1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character byte double words */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Compares an UTF-32 string with a byte stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf32_string_compare_with_byte_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_compare_with_byte_stream"; size_t byte_stream_index = 0; size_t utf32_string_index = 0; libuna_unicode_character_t utf32_unicode_character = 0; libuna_unicode_character_t byte_stream_unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing byte stream value.", function ); return( -1 ); } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } /* Check if the byte stream is terminated with zero bytes */ if( byte_stream[ byte_stream_size - 1 ] == 0 ) { byte_stream_size -= 1; } while( ( utf32_string_index < utf32_string_size ) && ( byte_stream_index < byte_stream_size ) ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &byte_stream_unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } if( utf32_unicode_character < byte_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf32_unicode_character > byte_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( byte_stream_index < byte_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-32 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_utf7_stream( const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf7_stream"; size_t utf7_stream_index = 0; libuna_unicode_character_t unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( utf7_stream_size == 0 ) { return( 1 ); } while( utf7_stream_index < utf7_stream_size ) { /* Convert the UTF-7 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_utf7_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_utf7_stream"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_utf7_stream( utf32_string, utf32_string_size, &utf32_string_index, utf7_stream, utf7_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to UTF-7 stream to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_utf7_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf7_stream"; size_t utf7_stream_index = 0; libuna_unicode_character_t unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-7 stream value.", function ); return( -1 ); } while( utf7_stream_index < utf7_stream_size ) { /* Convert the UTF-7 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character bytes */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Compares an UTF-32 string with an UTF-7 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf32_string_compare_with_utf7_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_compare_with_utf7_stream"; size_t utf32_string_index = 0; size_t utf7_stream_index = 0; libuna_unicode_character_t utf32_unicode_character = 0; libuna_unicode_character_t utf7_stream_unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-7 stream value.", function ); return( -1 ); } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } /* Check if the UTF-7 stream is terminated with zero bytes */ if( utf7_stream[ utf7_stream_size - 1 ] == 0 ) { utf7_stream_size -= 1; } while( ( utf32_string_index < utf32_string_size ) && ( utf7_stream_index < utf7_stream_size ) ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the UTF-7 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &utf7_stream_unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } if( utf32_unicode_character < utf7_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf32_unicode_character > utf7_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf7_stream_index < utf7_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-32 string from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf8"; size_t utf8_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( utf8_string_size == 0 ) { return( 1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_utf8( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_utf8"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_utf8( utf32_string, utf32_string_size, &utf32_string_index, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 string to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_utf8( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf8"; size_t utf8_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 string value.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character bytes */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Determines the size of an UTF-32 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_utf8_stream( const uint8_t *utf8_stream, size_t utf8_stream_size, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf8_stream"; size_t utf8_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( utf8_stream_size == 0 ) { return( 1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } while( utf8_stream_index < utf8_stream_size ) { /* Convert the UTF-8 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_utf8_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_utf8_stream"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_utf8_stream( utf32_string, utf32_string_size, &utf32_string_index, utf8_stream, utf8_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to UTF-8 stream to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_utf8_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf8_stream"; size_t utf8_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 stream value.", function ); return( -1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } while( utf8_stream_index < utf8_stream_size ) { /* Convert the UTF-8 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character bytes */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Compares an UTF-32 string with an UTF-8 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf32_string_compare_with_utf8_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_compare_with_utf8_stream"; size_t utf32_string_index = 0; size_t utf8_stream_index = 0; libuna_unicode_character_t utf32_unicode_character = 0; libuna_unicode_character_t utf8_stream_unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 stream value.", function ); return( -1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } /* Check if the UTF-8 stream is terminated with zero bytes */ if( utf8_stream[ utf8_stream_size - 1 ] == 0 ) { utf8_stream_size -= 1; } while( ( utf32_string_index < utf32_string_size ) && ( utf8_stream_index < utf8_stream_size ) ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_stream_unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } if( utf32_unicode_character < utf8_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf32_unicode_character > utf8_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf8_stream_index < utf8_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-32 string from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf16"; size_t utf16_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( utf16_string_size == 0 ) { return( 1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_utf16( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_utf16"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_utf16( utf32_string, utf32_string_size, &utf32_string_index, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 string to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_utf16( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf16"; size_t utf16_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-16 string value.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character bytes */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Determines the size of an UTF-32 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_utf16_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf16_stream"; size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size % 2 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( utf16_stream_size == 0 ) { return( 1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0x0ff ) && ( utf16_stream[ 1 ] == 0x0fe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0x0fe ) && ( utf16_stream[ 1 ] == 0x0ff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_utf16_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_utf16_stream"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_utf16_stream( utf32_string, utf32_string_size, &utf32_string_index, utf16_stream, utf16_stream_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_utf16_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf16_stream"; size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size == 0 ) || ( ( utf16_stream_size % 2 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0x0ff ) && ( utf16_stream[ 1 ] == 0x0fe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0x0fe ) && ( utf16_stream[ 1 ] == 0x0ff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character bytes */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Compares an UTF-32 string with an UTF-16 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf32_string_compare_with_utf16_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_compare_with_utf16_stream"; size_t utf16_stream_index = 0; size_t utf32_string_index = 0; libuna_unicode_character_t utf32_unicode_character = 0; libuna_unicode_character_t utf16_stream_unicode_character = 0; int read_byte_order = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size == 0 ) || ( ( utf16_stream_size % 2 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0xfe ) && ( utf16_stream[ 1 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0xff ) && ( utf16_stream[ 1 ] == 0xfe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } /* Check if the UTF-16 stream is terminated with zero bytes */ if( ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) && ( utf16_stream[ utf16_stream_size - 1 ] == 0 ) ) { utf16_stream_size -= 2; } while( ( utf32_string_index < utf32_string_size ) && ( utf16_stream_index < utf16_stream_size ) ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &utf16_stream_unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } if( utf32_unicode_character < utf16_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf32_unicode_character > utf16_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf16_stream_index < utf16_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-32 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_size_from_utf32_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, size_t *utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf32_stream"; size_t utf32_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size % 4 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( utf32_stream_size == 0 ) { return( 1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf32_stream_index + 1 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } /* Determine how many UTF-32 character bytes are required */ if( libuna_unicode_character_size_to_utf32( unicode_character, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf32_string_size += 1; } return( 1 ); } /* Copies an UTF-32 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_copy_from_utf32_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_copy_from_utf32_stream"; size_t utf32_string_index = 0; if( libuna_utf32_string_with_index_copy_from_utf32_stream( utf32_string, utf32_string_size, &utf32_string_index, utf32_stream, utf32_stream_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf32_string_with_index_copy_from_utf32_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf32_stream"; size_t utf32_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size == 0 ) || ( ( utf32_stream_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf32_stream_index + 1 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-32 character bytes */ if( libuna_unicode_character_copy_to_utf32( unicode_character, utf32_string, utf32_string_size, utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-32.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } return( 1 ); } /* Compares an UTF-32 string with an UTF-32 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf32_string_compare_with_utf32_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf32_string_compare_with_utf32_stream"; size_t utf32_stream_index = 0; size_t utf32_string_index = 0; libuna_unicode_character_t utf32_unicode_character = 0; libuna_unicode_character_t utf32_stream_unicode_character = 0; int read_byte_order = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size == 0 ) || ( ( utf32_stream_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } /* Check if the UTF-32 stream is terminated with zero bytes */ if( ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 3 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 2 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 1 ] == 0 ) ) { utf32_stream_size -= 1; } while( ( utf32_string_index < utf32_string_size ) && ( utf32_stream_index < utf32_stream_size ) ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &utf32_stream_unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } if( utf32_unicode_character < utf32_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf32_unicode_character > utf32_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf32_stream_index < utf32_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } libewf-20140807/libuna/libuna_codepage_windows_874.c0000664000175000017500000000610613443450072024231 0ustar00lordyestalordyesta00000000000000/* * Windows 874 codepage (Thai) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_874.h" /* Extended ASCII to Unicode character lookup table for Windows 874 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2026, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, 0x0e38, 0x0e39, 0x0e3a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x0e3f, 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; /* Unicode to ASCII character lookup table for Windows 874 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ 96 ] = { 0x1a, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0x1a, 0x1a, 0x1a, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x2018[ 8 ] = { 0x91, 0x92, 0x1a, 0x1a, 0x93, 0x94, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_codepage_windows_1251.h0000664000175000017500000000305213443450072024301 0ustar00lordyestalordyesta00000000000000/* * Windows 1251 codepage (Cyrillic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1251_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1251_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x0400[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1251_H ) */ libewf-20140807/libuna/libuna_libcerror.h0000664000175000017500000000263213443450072022276 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2008-2019, 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( _LIBUNA_LIBCERROR_H ) #define _LIBUNA_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBUNA_LIBCERROR_H ) */ libewf-20140807/libuna/libuna_codepage_windows_949.c0000664000175000017500000166253613443450072024254 0ustar00lordyestalordyesta00000000000000/* * Windows 949 codepage (Korean) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_949.h" #include "libuna_libcerror.h" #include "libuna_types.h" /* Extended ASCII to Unicode character lookup table for Windows 949 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8140[ 192 ] = { 0xfffd, 0xac02, 0xac03, 0xac05, 0xac06, 0xac0b, 0xac0c, 0xac0d, 0xac0e, 0xac0f, 0xac18, 0xac1e, 0xac1f, 0xac21, 0xac22, 0xac23, 0xac25, 0xac26, 0xac27, 0xac28, 0xac29, 0xac2a, 0xac2b, 0xac2e, 0xac32, 0xac33, 0xac34, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xac35, 0xac36, 0xac37, 0xac3a, 0xac3b, 0xac3d, 0xac3e, 0xac3f, 0xac41, 0xac42, 0xac43, 0xac44, 0xac45, 0xac46, 0xac47, 0xac48, 0xac49, 0xac4a, 0xac4c, 0xac4e, 0xac4f, 0xac50, 0xac51, 0xac52, 0xac53, 0xac55, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xac56, 0xac57, 0xac59, 0xac5a, 0xac5b, 0xac5d, 0xac5e, 0xac5f, 0xac60, 0xac61, 0xac62, 0xac63, 0xac64, 0xac65, 0xac66, 0xac67, 0xac68, 0xac69, 0xac6a, 0xac6b, 0xac6c, 0xac6d, 0xac6e, 0xac6f, 0xac72, 0xac73, 0xac75, 0xac76, 0xac79, 0xac7b, 0xac7c, 0xac7d, 0xac7e, 0xac7f, 0xac82, 0xac87, 0xac88, 0xac8d, 0xac8e, 0xac8f, 0xac91, 0xac92, 0xac93, 0xac95, 0xac96, 0xac97, 0xac98, 0xac99, 0xac9a, 0xac9b, 0xac9e, 0xaca2, 0xaca3, 0xaca4, 0xaca5, 0xaca6, 0xaca7, 0xacab, 0xacad, 0xacae, 0xacb1, 0xacb2, 0xacb3, 0xacb4, 0xacb5, 0xacb6, 0xacb7, 0xacba, 0xacbe, 0xacbf, 0xacc0, 0xacc2, 0xacc3, 0xacc5, 0xacc6, 0xacc7, 0xacc9, 0xacca, 0xaccb, 0xaccd, 0xacce, 0xaccf, 0xacd0, 0xacd1, 0xacd2, 0xacd3, 0xacd4, 0xacd6, 0xacd8, 0xacd9, 0xacda, 0xacdb, 0xacdc, 0xacdd, 0xacde, 0xacdf, 0xace2, 0xace3, 0xace5, 0xace6, 0xace9, 0xaceb, 0xaced, 0xacee, 0xacf2, 0xacf4, 0xacf7, 0xacf8, 0xacf9, 0xacfa, 0xacfb, 0xacfe, 0xacff, 0xad01, 0xad02, 0xad03, 0xad05, 0xad07, 0xad08, 0xad09, 0xad0a, 0xad0b, 0xad0e, 0xad10, 0xad12, 0xad13, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8240[ 192 ] = { 0xfffd, 0xad14, 0xad15, 0xad16, 0xad17, 0xad19, 0xad1a, 0xad1b, 0xad1d, 0xad1e, 0xad1f, 0xad21, 0xad22, 0xad23, 0xad24, 0xad25, 0xad26, 0xad27, 0xad28, 0xad2a, 0xad2b, 0xad2e, 0xad2f, 0xad30, 0xad31, 0xad32, 0xad33, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xad36, 0xad37, 0xad39, 0xad3a, 0xad3b, 0xad3d, 0xad3e, 0xad3f, 0xad40, 0xad41, 0xad42, 0xad43, 0xad46, 0xad48, 0xad4a, 0xad4b, 0xad4c, 0xad4d, 0xad4e, 0xad4f, 0xad51, 0xad52, 0xad53, 0xad55, 0xad56, 0xad57, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xad59, 0xad5a, 0xad5b, 0xad5c, 0xad5d, 0xad5e, 0xad5f, 0xad60, 0xad62, 0xad64, 0xad65, 0xad66, 0xad67, 0xad68, 0xad69, 0xad6a, 0xad6b, 0xad6e, 0xad6f, 0xad71, 0xad72, 0xad77, 0xad78, 0xad79, 0xad7a, 0xad7e, 0xad80, 0xad83, 0xad84, 0xad85, 0xad86, 0xad87, 0xad8a, 0xad8b, 0xad8d, 0xad8e, 0xad8f, 0xad91, 0xad92, 0xad93, 0xad94, 0xad95, 0xad96, 0xad97, 0xad98, 0xad99, 0xad9a, 0xad9b, 0xad9e, 0xad9f, 0xada0, 0xada1, 0xada2, 0xada3, 0xada5, 0xada6, 0xada7, 0xada8, 0xada9, 0xadaa, 0xadab, 0xadac, 0xadad, 0xadae, 0xadaf, 0xadb0, 0xadb1, 0xadb2, 0xadb3, 0xadb4, 0xadb5, 0xadb6, 0xadb8, 0xadb9, 0xadba, 0xadbb, 0xadbc, 0xadbd, 0xadbe, 0xadbf, 0xadc2, 0xadc3, 0xadc5, 0xadc6, 0xadc7, 0xadc9, 0xadca, 0xadcb, 0xadcc, 0xadcd, 0xadce, 0xadcf, 0xadd2, 0xadd4, 0xadd5, 0xadd6, 0xadd7, 0xadd8, 0xadd9, 0xadda, 0xaddb, 0xaddd, 0xadde, 0xaddf, 0xade1, 0xade2, 0xade3, 0xade5, 0xade6, 0xade7, 0xade8, 0xade9, 0xadea, 0xadeb, 0xadec, 0xaded, 0xadee, 0xadef, 0xadf0, 0xadf1, 0xadf2, 0xadf3, 0xadf4, 0xadf5, 0xadf6, 0xadf7, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8340[ 192 ] = { 0xfffd, 0xadfa, 0xadfb, 0xadfd, 0xadfe, 0xae02, 0xae03, 0xae04, 0xae05, 0xae06, 0xae07, 0xae0a, 0xae0c, 0xae0e, 0xae0f, 0xae10, 0xae11, 0xae12, 0xae13, 0xae15, 0xae16, 0xae17, 0xae18, 0xae19, 0xae1a, 0xae1b, 0xae1c, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xae1d, 0xae1e, 0xae1f, 0xae20, 0xae21, 0xae22, 0xae23, 0xae24, 0xae25, 0xae26, 0xae27, 0xae28, 0xae29, 0xae2a, 0xae2b, 0xae2c, 0xae2d, 0xae2e, 0xae2f, 0xae32, 0xae33, 0xae35, 0xae36, 0xae39, 0xae3b, 0xae3c, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xae3d, 0xae3e, 0xae3f, 0xae42, 0xae44, 0xae47, 0xae48, 0xae49, 0xae4b, 0xae4f, 0xae51, 0xae52, 0xae53, 0xae55, 0xae57, 0xae58, 0xae59, 0xae5a, 0xae5b, 0xae5e, 0xae62, 0xae63, 0xae64, 0xae66, 0xae67, 0xae6a, 0xae6b, 0xae6d, 0xae6e, 0xae6f, 0xae71, 0xae72, 0xae73, 0xae74, 0xae75, 0xae76, 0xae77, 0xae7a, 0xae7e, 0xae7f, 0xae80, 0xae81, 0xae82, 0xae83, 0xae86, 0xae87, 0xae88, 0xae89, 0xae8a, 0xae8b, 0xae8d, 0xae8e, 0xae8f, 0xae90, 0xae91, 0xae92, 0xae93, 0xae94, 0xae95, 0xae96, 0xae97, 0xae98, 0xae99, 0xae9a, 0xae9b, 0xae9c, 0xae9d, 0xae9e, 0xae9f, 0xaea0, 0xaea1, 0xaea2, 0xaea3, 0xaea4, 0xaea5, 0xaea6, 0xaea7, 0xaea8, 0xaea9, 0xaeaa, 0xaeab, 0xaeac, 0xaead, 0xaeae, 0xaeaf, 0xaeb0, 0xaeb1, 0xaeb2, 0xaeb3, 0xaeb4, 0xaeb5, 0xaeb6, 0xaeb7, 0xaeb8, 0xaeb9, 0xaeba, 0xaebb, 0xaebf, 0xaec1, 0xaec2, 0xaec3, 0xaec5, 0xaec6, 0xaec7, 0xaec8, 0xaec9, 0xaeca, 0xaecb, 0xaece, 0xaed2, 0xaed3, 0xaed4, 0xaed5, 0xaed6, 0xaed7, 0xaeda, 0xaedb, 0xaedd, 0xaede, 0xaedf, 0xaee0, 0xaee1, 0xaee2, 0xaee3, 0xaee4, 0xaee5, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8440[ 192 ] = { 0xfffd, 0xaee6, 0xaee7, 0xaee9, 0xaeea, 0xaeec, 0xaeee, 0xaeef, 0xaef0, 0xaef1, 0xaef2, 0xaef3, 0xaef5, 0xaef6, 0xaef7, 0xaef9, 0xaefa, 0xaefb, 0xaefd, 0xaefe, 0xaeff, 0xaf00, 0xaf01, 0xaf02, 0xaf03, 0xaf04, 0xaf05, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xaf06, 0xaf09, 0xaf0a, 0xaf0b, 0xaf0c, 0xaf0e, 0xaf0f, 0xaf11, 0xaf12, 0xaf13, 0xaf14, 0xaf15, 0xaf16, 0xaf17, 0xaf18, 0xaf19, 0xaf1a, 0xaf1b, 0xaf1c, 0xaf1d, 0xaf1e, 0xaf1f, 0xaf20, 0xaf21, 0xaf22, 0xaf23, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xaf24, 0xaf25, 0xaf26, 0xaf27, 0xaf28, 0xaf29, 0xaf2a, 0xaf2b, 0xaf2e, 0xaf2f, 0xaf31, 0xaf33, 0xaf35, 0xaf36, 0xaf37, 0xaf38, 0xaf39, 0xaf3a, 0xaf3b, 0xaf3e, 0xaf40, 0xaf44, 0xaf45, 0xaf46, 0xaf47, 0xaf4a, 0xaf4b, 0xaf4c, 0xaf4d, 0xaf4e, 0xaf4f, 0xaf51, 0xaf52, 0xaf53, 0xaf54, 0xaf55, 0xaf56, 0xaf57, 0xaf58, 0xaf59, 0xaf5a, 0xaf5b, 0xaf5e, 0xaf5f, 0xaf60, 0xaf61, 0xaf62, 0xaf63, 0xaf66, 0xaf67, 0xaf68, 0xaf69, 0xaf6a, 0xaf6b, 0xaf6c, 0xaf6d, 0xaf6e, 0xaf6f, 0xaf70, 0xaf71, 0xaf72, 0xaf73, 0xaf74, 0xaf75, 0xaf76, 0xaf77, 0xaf78, 0xaf7a, 0xaf7b, 0xaf7c, 0xaf7d, 0xaf7e, 0xaf7f, 0xaf81, 0xaf82, 0xaf83, 0xaf85, 0xaf86, 0xaf87, 0xaf89, 0xaf8a, 0xaf8b, 0xaf8c, 0xaf8d, 0xaf8e, 0xaf8f, 0xaf92, 0xaf93, 0xaf94, 0xaf96, 0xaf97, 0xaf98, 0xaf99, 0xaf9a, 0xaf9b, 0xaf9d, 0xaf9e, 0xaf9f, 0xafa0, 0xafa1, 0xafa2, 0xafa3, 0xafa4, 0xafa5, 0xafa6, 0xafa7, 0xafa8, 0xafa9, 0xafaa, 0xafab, 0xafac, 0xafad, 0xafae, 0xafaf, 0xafb0, 0xafb1, 0xafb2, 0xafb3, 0xafb4, 0xafb5, 0xafb6, 0xafb7, 0xafba, 0xafbb, 0xafbd, 0xafbe, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8540[ 192 ] = { 0xfffd, 0xafbf, 0xafc1, 0xafc2, 0xafc3, 0xafc4, 0xafc5, 0xafc6, 0xafca, 0xafcc, 0xafcf, 0xafd0, 0xafd1, 0xafd2, 0xafd3, 0xafd5, 0xafd6, 0xafd7, 0xafd8, 0xafd9, 0xafda, 0xafdb, 0xafdd, 0xafde, 0xafdf, 0xafe0, 0xafe1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xafe2, 0xafe3, 0xafe4, 0xafe5, 0xafe6, 0xafe7, 0xafea, 0xafeb, 0xafec, 0xafed, 0xafee, 0xafef, 0xaff2, 0xaff3, 0xaff5, 0xaff6, 0xaff7, 0xaff9, 0xaffa, 0xaffb, 0xaffc, 0xaffd, 0xaffe, 0xafff, 0xb002, 0xb003, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb005, 0xb006, 0xb007, 0xb008, 0xb009, 0xb00a, 0xb00b, 0xb00d, 0xb00e, 0xb00f, 0xb011, 0xb012, 0xb013, 0xb015, 0xb016, 0xb017, 0xb018, 0xb019, 0xb01a, 0xb01b, 0xb01e, 0xb01f, 0xb020, 0xb021, 0xb022, 0xb023, 0xb024, 0xb025, 0xb026, 0xb027, 0xb029, 0xb02a, 0xb02b, 0xb02c, 0xb02d, 0xb02e, 0xb02f, 0xb030, 0xb031, 0xb032, 0xb033, 0xb034, 0xb035, 0xb036, 0xb037, 0xb038, 0xb039, 0xb03a, 0xb03b, 0xb03c, 0xb03d, 0xb03e, 0xb03f, 0xb040, 0xb041, 0xb042, 0xb043, 0xb046, 0xb047, 0xb049, 0xb04b, 0xb04d, 0xb04f, 0xb050, 0xb051, 0xb052, 0xb056, 0xb058, 0xb05a, 0xb05b, 0xb05c, 0xb05e, 0xb05f, 0xb060, 0xb061, 0xb062, 0xb063, 0xb064, 0xb065, 0xb066, 0xb067, 0xb068, 0xb069, 0xb06a, 0xb06b, 0xb06c, 0xb06d, 0xb06e, 0xb06f, 0xb070, 0xb071, 0xb072, 0xb073, 0xb074, 0xb075, 0xb076, 0xb077, 0xb078, 0xb079, 0xb07a, 0xb07b, 0xb07e, 0xb07f, 0xb081, 0xb082, 0xb083, 0xb085, 0xb086, 0xb087, 0xb088, 0xb089, 0xb08a, 0xb08b, 0xb08e, 0xb090, 0xb092, 0xb093, 0xb094, 0xb095, 0xb096, 0xb097, 0xb09b, 0xb09d, 0xb09e, 0xb0a3, 0xb0a4, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8640[ 192 ] = { 0xfffd, 0xb0a5, 0xb0a6, 0xb0a7, 0xb0aa, 0xb0b0, 0xb0b2, 0xb0b6, 0xb0b7, 0xb0b9, 0xb0ba, 0xb0bb, 0xb0bd, 0xb0be, 0xb0bf, 0xb0c0, 0xb0c1, 0xb0c2, 0xb0c3, 0xb0c6, 0xb0ca, 0xb0cb, 0xb0cc, 0xb0cd, 0xb0ce, 0xb0cf, 0xb0d2, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb0d3, 0xb0d5, 0xb0d6, 0xb0d7, 0xb0d9, 0xb0da, 0xb0db, 0xb0dc, 0xb0dd, 0xb0de, 0xb0df, 0xb0e1, 0xb0e2, 0xb0e3, 0xb0e4, 0xb0e6, 0xb0e7, 0xb0e8, 0xb0e9, 0xb0ea, 0xb0eb, 0xb0ec, 0xb0ed, 0xb0ee, 0xb0ef, 0xb0f0, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb0f1, 0xb0f2, 0xb0f3, 0xb0f4, 0xb0f5, 0xb0f6, 0xb0f7, 0xb0f8, 0xb0f9, 0xb0fa, 0xb0fb, 0xb0fc, 0xb0fd, 0xb0fe, 0xb0ff, 0xb100, 0xb101, 0xb102, 0xb103, 0xb104, 0xb105, 0xb106, 0xb107, 0xb10a, 0xb10d, 0xb10e, 0xb10f, 0xb111, 0xb114, 0xb115, 0xb116, 0xb117, 0xb11a, 0xb11e, 0xb11f, 0xb120, 0xb121, 0xb122, 0xb126, 0xb127, 0xb129, 0xb12a, 0xb12b, 0xb12d, 0xb12e, 0xb12f, 0xb130, 0xb131, 0xb132, 0xb133, 0xb136, 0xb13a, 0xb13b, 0xb13c, 0xb13d, 0xb13e, 0xb13f, 0xb142, 0xb143, 0xb145, 0xb146, 0xb147, 0xb149, 0xb14a, 0xb14b, 0xb14c, 0xb14d, 0xb14e, 0xb14f, 0xb152, 0xb153, 0xb156, 0xb157, 0xb159, 0xb15a, 0xb15b, 0xb15d, 0xb15e, 0xb15f, 0xb161, 0xb162, 0xb163, 0xb164, 0xb165, 0xb166, 0xb167, 0xb168, 0xb169, 0xb16a, 0xb16b, 0xb16c, 0xb16d, 0xb16e, 0xb16f, 0xb170, 0xb171, 0xb172, 0xb173, 0xb174, 0xb175, 0xb176, 0xb177, 0xb17a, 0xb17b, 0xb17d, 0xb17e, 0xb17f, 0xb181, 0xb183, 0xb184, 0xb185, 0xb186, 0xb187, 0xb18a, 0xb18c, 0xb18e, 0xb18f, 0xb190, 0xb191, 0xb195, 0xb196, 0xb197, 0xb199, 0xb19a, 0xb19b, 0xb19d, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8740[ 192 ] = { 0xfffd, 0xb19e, 0xb19f, 0xb1a0, 0xb1a1, 0xb1a2, 0xb1a3, 0xb1a4, 0xb1a5, 0xb1a6, 0xb1a7, 0xb1a9, 0xb1aa, 0xb1ab, 0xb1ac, 0xb1ad, 0xb1ae, 0xb1af, 0xb1b0, 0xb1b1, 0xb1b2, 0xb1b3, 0xb1b4, 0xb1b5, 0xb1b6, 0xb1b7, 0xb1b8, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb1b9, 0xb1ba, 0xb1bb, 0xb1bc, 0xb1bd, 0xb1be, 0xb1bf, 0xb1c0, 0xb1c1, 0xb1c2, 0xb1c3, 0xb1c4, 0xb1c5, 0xb1c6, 0xb1c7, 0xb1c8, 0xb1c9, 0xb1ca, 0xb1cb, 0xb1cd, 0xb1ce, 0xb1cf, 0xb1d1, 0xb1d2, 0xb1d3, 0xb1d5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb1d6, 0xb1d7, 0xb1d8, 0xb1d9, 0xb1da, 0xb1db, 0xb1de, 0xb1e0, 0xb1e1, 0xb1e2, 0xb1e3, 0xb1e4, 0xb1e5, 0xb1e6, 0xb1e7, 0xb1ea, 0xb1eb, 0xb1ed, 0xb1ee, 0xb1ef, 0xb1f1, 0xb1f2, 0xb1f3, 0xb1f4, 0xb1f5, 0xb1f6, 0xb1f7, 0xb1f8, 0xb1fa, 0xb1fc, 0xb1fe, 0xb1ff, 0xb200, 0xb201, 0xb202, 0xb203, 0xb206, 0xb207, 0xb209, 0xb20a, 0xb20d, 0xb20e, 0xb20f, 0xb210, 0xb211, 0xb212, 0xb213, 0xb216, 0xb218, 0xb21a, 0xb21b, 0xb21c, 0xb21d, 0xb21e, 0xb21f, 0xb221, 0xb222, 0xb223, 0xb224, 0xb225, 0xb226, 0xb227, 0xb228, 0xb229, 0xb22a, 0xb22b, 0xb22c, 0xb22d, 0xb22e, 0xb22f, 0xb230, 0xb231, 0xb232, 0xb233, 0xb235, 0xb236, 0xb237, 0xb238, 0xb239, 0xb23a, 0xb23b, 0xb23d, 0xb23e, 0xb23f, 0xb240, 0xb241, 0xb242, 0xb243, 0xb244, 0xb245, 0xb246, 0xb247, 0xb248, 0xb249, 0xb24a, 0xb24b, 0xb24c, 0xb24d, 0xb24e, 0xb24f, 0xb250, 0xb251, 0xb252, 0xb253, 0xb254, 0xb255, 0xb256, 0xb257, 0xb259, 0xb25a, 0xb25b, 0xb25d, 0xb25e, 0xb25f, 0xb261, 0xb262, 0xb263, 0xb264, 0xb265, 0xb266, 0xb267, 0xb26a, 0xb26b, 0xb26c, 0xb26d, 0xb26e, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8840[ 192 ] = { 0xfffd, 0xb26f, 0xb270, 0xb271, 0xb272, 0xb273, 0xb276, 0xb277, 0xb278, 0xb279, 0xb27a, 0xb27b, 0xb27d, 0xb27e, 0xb27f, 0xb280, 0xb281, 0xb282, 0xb283, 0xb286, 0xb287, 0xb288, 0xb28a, 0xb28b, 0xb28c, 0xb28d, 0xb28e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb28f, 0xb292, 0xb293, 0xb295, 0xb296, 0xb297, 0xb29b, 0xb29c, 0xb29d, 0xb29e, 0xb29f, 0xb2a2, 0xb2a4, 0xb2a7, 0xb2a8, 0xb2a9, 0xb2ab, 0xb2ad, 0xb2ae, 0xb2af, 0xb2b1, 0xb2b2, 0xb2b3, 0xb2b5, 0xb2b6, 0xb2b7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb2b8, 0xb2b9, 0xb2ba, 0xb2bb, 0xb2bc, 0xb2bd, 0xb2be, 0xb2bf, 0xb2c0, 0xb2c1, 0xb2c2, 0xb2c3, 0xb2c4, 0xb2c5, 0xb2c6, 0xb2c7, 0xb2ca, 0xb2cb, 0xb2cd, 0xb2ce, 0xb2cf, 0xb2d1, 0xb2d3, 0xb2d4, 0xb2d5, 0xb2d6, 0xb2d7, 0xb2da, 0xb2dc, 0xb2de, 0xb2df, 0xb2e0, 0xb2e1, 0xb2e3, 0xb2e7, 0xb2e9, 0xb2ea, 0xb2f0, 0xb2f1, 0xb2f2, 0xb2f6, 0xb2fc, 0xb2fd, 0xb2fe, 0xb302, 0xb303, 0xb305, 0xb306, 0xb307, 0xb309, 0xb30a, 0xb30b, 0xb30c, 0xb30d, 0xb30e, 0xb30f, 0xb312, 0xb316, 0xb317, 0xb318, 0xb319, 0xb31a, 0xb31b, 0xb31d, 0xb31e, 0xb31f, 0xb320, 0xb321, 0xb322, 0xb323, 0xb324, 0xb325, 0xb326, 0xb327, 0xb328, 0xb329, 0xb32a, 0xb32b, 0xb32c, 0xb32d, 0xb32e, 0xb32f, 0xb330, 0xb331, 0xb332, 0xb333, 0xb334, 0xb335, 0xb336, 0xb337, 0xb338, 0xb339, 0xb33a, 0xb33b, 0xb33c, 0xb33d, 0xb33e, 0xb33f, 0xb340, 0xb341, 0xb342, 0xb343, 0xb344, 0xb345, 0xb346, 0xb347, 0xb348, 0xb349, 0xb34a, 0xb34b, 0xb34c, 0xb34d, 0xb34e, 0xb34f, 0xb350, 0xb351, 0xb352, 0xb353, 0xb357, 0xb359, 0xb35a, 0xb35d, 0xb360, 0xb361, 0xb362, 0xb363, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8940[ 192 ] = { 0xfffd, 0xb366, 0xb368, 0xb36a, 0xb36c, 0xb36d, 0xb36f, 0xb372, 0xb373, 0xb375, 0xb376, 0xb377, 0xb379, 0xb37a, 0xb37b, 0xb37c, 0xb37d, 0xb37e, 0xb37f, 0xb382, 0xb386, 0xb387, 0xb388, 0xb389, 0xb38a, 0xb38b, 0xb38d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb38e, 0xb38f, 0xb391, 0xb392, 0xb393, 0xb395, 0xb396, 0xb397, 0xb398, 0xb399, 0xb39a, 0xb39b, 0xb39c, 0xb39d, 0xb39e, 0xb39f, 0xb3a2, 0xb3a3, 0xb3a4, 0xb3a5, 0xb3a6, 0xb3a7, 0xb3a9, 0xb3aa, 0xb3ab, 0xb3ad, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb3ae, 0xb3af, 0xb3b0, 0xb3b1, 0xb3b2, 0xb3b3, 0xb3b4, 0xb3b5, 0xb3b6, 0xb3b7, 0xb3b8, 0xb3b9, 0xb3ba, 0xb3bb, 0xb3bc, 0xb3bd, 0xb3be, 0xb3bf, 0xb3c0, 0xb3c1, 0xb3c2, 0xb3c3, 0xb3c6, 0xb3c7, 0xb3c9, 0xb3ca, 0xb3cd, 0xb3cf, 0xb3d1, 0xb3d2, 0xb3d3, 0xb3d6, 0xb3d8, 0xb3da, 0xb3dc, 0xb3de, 0xb3df, 0xb3e1, 0xb3e2, 0xb3e3, 0xb3e5, 0xb3e6, 0xb3e7, 0xb3e9, 0xb3ea, 0xb3eb, 0xb3ec, 0xb3ed, 0xb3ee, 0xb3ef, 0xb3f0, 0xb3f1, 0xb3f2, 0xb3f3, 0xb3f4, 0xb3f5, 0xb3f6, 0xb3f7, 0xb3f8, 0xb3f9, 0xb3fa, 0xb3fb, 0xb3fd, 0xb3fe, 0xb3ff, 0xb400, 0xb401, 0xb402, 0xb403, 0xb404, 0xb405, 0xb406, 0xb407, 0xb408, 0xb409, 0xb40a, 0xb40b, 0xb40c, 0xb40d, 0xb40e, 0xb40f, 0xb411, 0xb412, 0xb413, 0xb414, 0xb415, 0xb416, 0xb417, 0xb419, 0xb41a, 0xb41b, 0xb41d, 0xb41e, 0xb41f, 0xb421, 0xb422, 0xb423, 0xb424, 0xb425, 0xb426, 0xb427, 0xb42a, 0xb42c, 0xb42d, 0xb42e, 0xb42f, 0xb430, 0xb431, 0xb432, 0xb433, 0xb435, 0xb436, 0xb437, 0xb438, 0xb439, 0xb43a, 0xb43b, 0xb43c, 0xb43d, 0xb43e, 0xb43f, 0xb440, 0xb441, 0xb442, 0xb443, 0xb444, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8a40[ 192 ] = { 0xfffd, 0xb445, 0xb446, 0xb447, 0xb448, 0xb449, 0xb44a, 0xb44b, 0xb44c, 0xb44d, 0xb44e, 0xb44f, 0xb452, 0xb453, 0xb455, 0xb456, 0xb457, 0xb459, 0xb45a, 0xb45b, 0xb45c, 0xb45d, 0xb45e, 0xb45f, 0xb462, 0xb464, 0xb466, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb467, 0xb468, 0xb469, 0xb46a, 0xb46b, 0xb46d, 0xb46e, 0xb46f, 0xb470, 0xb471, 0xb472, 0xb473, 0xb474, 0xb475, 0xb476, 0xb477, 0xb478, 0xb479, 0xb47a, 0xb47b, 0xb47c, 0xb47d, 0xb47e, 0xb47f, 0xb481, 0xb482, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb483, 0xb484, 0xb485, 0xb486, 0xb487, 0xb489, 0xb48a, 0xb48b, 0xb48c, 0xb48d, 0xb48e, 0xb48f, 0xb490, 0xb491, 0xb492, 0xb493, 0xb494, 0xb495, 0xb496, 0xb497, 0xb498, 0xb499, 0xb49a, 0xb49b, 0xb49c, 0xb49e, 0xb49f, 0xb4a0, 0xb4a1, 0xb4a2, 0xb4a3, 0xb4a5, 0xb4a6, 0xb4a7, 0xb4a9, 0xb4aa, 0xb4ab, 0xb4ad, 0xb4ae, 0xb4af, 0xb4b0, 0xb4b1, 0xb4b2, 0xb4b3, 0xb4b4, 0xb4b6, 0xb4b8, 0xb4ba, 0xb4bb, 0xb4bc, 0xb4bd, 0xb4be, 0xb4bf, 0xb4c1, 0xb4c2, 0xb4c3, 0xb4c5, 0xb4c6, 0xb4c7, 0xb4c9, 0xb4ca, 0xb4cb, 0xb4cc, 0xb4cd, 0xb4ce, 0xb4cf, 0xb4d1, 0xb4d2, 0xb4d3, 0xb4d4, 0xb4d6, 0xb4d7, 0xb4d8, 0xb4d9, 0xb4da, 0xb4db, 0xb4de, 0xb4df, 0xb4e1, 0xb4e2, 0xb4e5, 0xb4e7, 0xb4e8, 0xb4e9, 0xb4ea, 0xb4eb, 0xb4ee, 0xb4f0, 0xb4f2, 0xb4f3, 0xb4f4, 0xb4f5, 0xb4f6, 0xb4f7, 0xb4f9, 0xb4fa, 0xb4fb, 0xb4fc, 0xb4fd, 0xb4fe, 0xb4ff, 0xb500, 0xb501, 0xb502, 0xb503, 0xb504, 0xb505, 0xb506, 0xb507, 0xb508, 0xb509, 0xb50a, 0xb50b, 0xb50c, 0xb50d, 0xb50e, 0xb50f, 0xb510, 0xb511, 0xb512, 0xb513, 0xb516, 0xb517, 0xb519, 0xb51a, 0xb51d, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8b40[ 192 ] = { 0xfffd, 0xb51e, 0xb51f, 0xb520, 0xb521, 0xb522, 0xb523, 0xb526, 0xb52b, 0xb52c, 0xb52d, 0xb52e, 0xb52f, 0xb532, 0xb533, 0xb535, 0xb536, 0xb537, 0xb539, 0xb53a, 0xb53b, 0xb53c, 0xb53d, 0xb53e, 0xb53f, 0xb542, 0xb546, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb547, 0xb548, 0xb549, 0xb54a, 0xb54e, 0xb54f, 0xb551, 0xb552, 0xb553, 0xb555, 0xb556, 0xb557, 0xb558, 0xb559, 0xb55a, 0xb55b, 0xb55e, 0xb562, 0xb563, 0xb564, 0xb565, 0xb566, 0xb567, 0xb568, 0xb569, 0xb56a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb56b, 0xb56c, 0xb56d, 0xb56e, 0xb56f, 0xb570, 0xb571, 0xb572, 0xb573, 0xb574, 0xb575, 0xb576, 0xb577, 0xb578, 0xb579, 0xb57a, 0xb57b, 0xb57c, 0xb57d, 0xb57e, 0xb57f, 0xb580, 0xb581, 0xb582, 0xb583, 0xb584, 0xb585, 0xb586, 0xb587, 0xb588, 0xb589, 0xb58a, 0xb58b, 0xb58c, 0xb58d, 0xb58e, 0xb58f, 0xb590, 0xb591, 0xb592, 0xb593, 0xb594, 0xb595, 0xb596, 0xb597, 0xb598, 0xb599, 0xb59a, 0xb59b, 0xb59c, 0xb59d, 0xb59e, 0xb59f, 0xb5a2, 0xb5a3, 0xb5a5, 0xb5a6, 0xb5a7, 0xb5a9, 0xb5ac, 0xb5ad, 0xb5ae, 0xb5af, 0xb5b2, 0xb5b6, 0xb5b7, 0xb5b8, 0xb5b9, 0xb5ba, 0xb5be, 0xb5bf, 0xb5c1, 0xb5c2, 0xb5c3, 0xb5c5, 0xb5c6, 0xb5c7, 0xb5c8, 0xb5c9, 0xb5ca, 0xb5cb, 0xb5ce, 0xb5d2, 0xb5d3, 0xb5d4, 0xb5d5, 0xb5d6, 0xb5d7, 0xb5d9, 0xb5da, 0xb5db, 0xb5dc, 0xb5dd, 0xb5de, 0xb5df, 0xb5e0, 0xb5e1, 0xb5e2, 0xb5e3, 0xb5e4, 0xb5e5, 0xb5e6, 0xb5e7, 0xb5e8, 0xb5e9, 0xb5ea, 0xb5eb, 0xb5ed, 0xb5ee, 0xb5ef, 0xb5f0, 0xb5f1, 0xb5f2, 0xb5f3, 0xb5f4, 0xb5f5, 0xb5f6, 0xb5f7, 0xb5f8, 0xb5f9, 0xb5fa, 0xb5fb, 0xb5fc, 0xb5fd, 0xb5fe, 0xb5ff, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8c40[ 192 ] = { 0xfffd, 0xb600, 0xb601, 0xb602, 0xb603, 0xb604, 0xb605, 0xb606, 0xb607, 0xb608, 0xb609, 0xb60a, 0xb60b, 0xb60c, 0xb60d, 0xb60e, 0xb60f, 0xb612, 0xb613, 0xb615, 0xb616, 0xb617, 0xb619, 0xb61a, 0xb61b, 0xb61c, 0xb61d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb61e, 0xb61f, 0xb620, 0xb621, 0xb622, 0xb623, 0xb624, 0xb626, 0xb627, 0xb628, 0xb629, 0xb62a, 0xb62b, 0xb62d, 0xb62e, 0xb62f, 0xb630, 0xb631, 0xb632, 0xb633, 0xb635, 0xb636, 0xb637, 0xb638, 0xb639, 0xb63a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb63b, 0xb63c, 0xb63d, 0xb63e, 0xb63f, 0xb640, 0xb641, 0xb642, 0xb643, 0xb644, 0xb645, 0xb646, 0xb647, 0xb649, 0xb64a, 0xb64b, 0xb64c, 0xb64d, 0xb64e, 0xb64f, 0xb650, 0xb651, 0xb652, 0xb653, 0xb654, 0xb655, 0xb656, 0xb657, 0xb658, 0xb659, 0xb65a, 0xb65b, 0xb65c, 0xb65d, 0xb65e, 0xb65f, 0xb660, 0xb661, 0xb662, 0xb663, 0xb665, 0xb666, 0xb667, 0xb669, 0xb66a, 0xb66b, 0xb66c, 0xb66d, 0xb66e, 0xb66f, 0xb670, 0xb671, 0xb672, 0xb673, 0xb674, 0xb675, 0xb676, 0xb677, 0xb678, 0xb679, 0xb67a, 0xb67b, 0xb67c, 0xb67d, 0xb67e, 0xb67f, 0xb680, 0xb681, 0xb682, 0xb683, 0xb684, 0xb685, 0xb686, 0xb687, 0xb688, 0xb689, 0xb68a, 0xb68b, 0xb68c, 0xb68d, 0xb68e, 0xb68f, 0xb690, 0xb691, 0xb692, 0xb693, 0xb694, 0xb695, 0xb696, 0xb697, 0xb698, 0xb699, 0xb69a, 0xb69b, 0xb69e, 0xb69f, 0xb6a1, 0xb6a2, 0xb6a3, 0xb6a5, 0xb6a6, 0xb6a7, 0xb6a8, 0xb6a9, 0xb6aa, 0xb6ad, 0xb6ae, 0xb6af, 0xb6b0, 0xb6b2, 0xb6b3, 0xb6b4, 0xb6b5, 0xb6b6, 0xb6b7, 0xb6b8, 0xb6b9, 0xb6ba, 0xb6bb, 0xb6bc, 0xb6bd, 0xb6be, 0xb6bf, 0xb6c0, 0xb6c1, 0xb6c2, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8d40[ 192 ] = { 0xfffd, 0xb6c3, 0xb6c4, 0xb6c5, 0xb6c6, 0xb6c7, 0xb6c8, 0xb6c9, 0xb6ca, 0xb6cb, 0xb6cc, 0xb6cd, 0xb6ce, 0xb6cf, 0xb6d0, 0xb6d1, 0xb6d2, 0xb6d3, 0xb6d5, 0xb6d6, 0xb6d7, 0xb6d8, 0xb6d9, 0xb6da, 0xb6db, 0xb6dc, 0xb6dd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb6de, 0xb6df, 0xb6e0, 0xb6e1, 0xb6e2, 0xb6e3, 0xb6e4, 0xb6e5, 0xb6e6, 0xb6e7, 0xb6e8, 0xb6e9, 0xb6ea, 0xb6eb, 0xb6ec, 0xb6ed, 0xb6ee, 0xb6ef, 0xb6f1, 0xb6f2, 0xb6f3, 0xb6f5, 0xb6f6, 0xb6f7, 0xb6f9, 0xb6fa, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb6fb, 0xb6fc, 0xb6fd, 0xb6fe, 0xb6ff, 0xb702, 0xb703, 0xb704, 0xb706, 0xb707, 0xb708, 0xb709, 0xb70a, 0xb70b, 0xb70c, 0xb70d, 0xb70e, 0xb70f, 0xb710, 0xb711, 0xb712, 0xb713, 0xb714, 0xb715, 0xb716, 0xb717, 0xb718, 0xb719, 0xb71a, 0xb71b, 0xb71c, 0xb71d, 0xb71e, 0xb71f, 0xb720, 0xb721, 0xb722, 0xb723, 0xb724, 0xb725, 0xb726, 0xb727, 0xb72a, 0xb72b, 0xb72d, 0xb72e, 0xb731, 0xb732, 0xb733, 0xb734, 0xb735, 0xb736, 0xb737, 0xb73a, 0xb73c, 0xb73d, 0xb73e, 0xb73f, 0xb740, 0xb741, 0xb742, 0xb743, 0xb745, 0xb746, 0xb747, 0xb749, 0xb74a, 0xb74b, 0xb74d, 0xb74e, 0xb74f, 0xb750, 0xb751, 0xb752, 0xb753, 0xb756, 0xb757, 0xb758, 0xb759, 0xb75a, 0xb75b, 0xb75c, 0xb75d, 0xb75e, 0xb75f, 0xb761, 0xb762, 0xb763, 0xb765, 0xb766, 0xb767, 0xb769, 0xb76a, 0xb76b, 0xb76c, 0xb76d, 0xb76e, 0xb76f, 0xb772, 0xb774, 0xb776, 0xb777, 0xb778, 0xb779, 0xb77a, 0xb77b, 0xb77e, 0xb77f, 0xb781, 0xb782, 0xb783, 0xb785, 0xb786, 0xb787, 0xb788, 0xb789, 0xb78a, 0xb78b, 0xb78e, 0xb793, 0xb794, 0xb795, 0xb79a, 0xb79b, 0xb79d, 0xb79e, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8e40[ 192 ] = { 0xfffd, 0xb79f, 0xb7a1, 0xb7a2, 0xb7a3, 0xb7a4, 0xb7a5, 0xb7a6, 0xb7a7, 0xb7aa, 0xb7ae, 0xb7af, 0xb7b0, 0xb7b1, 0xb7b2, 0xb7b3, 0xb7b6, 0xb7b7, 0xb7b9, 0xb7ba, 0xb7bb, 0xb7bc, 0xb7bd, 0xb7be, 0xb7bf, 0xb7c0, 0xb7c1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb7c2, 0xb7c3, 0xb7c4, 0xb7c5, 0xb7c6, 0xb7c8, 0xb7ca, 0xb7cb, 0xb7cc, 0xb7cd, 0xb7ce, 0xb7cf, 0xb7d0, 0xb7d1, 0xb7d2, 0xb7d3, 0xb7d4, 0xb7d5, 0xb7d6, 0xb7d7, 0xb7d8, 0xb7d9, 0xb7da, 0xb7db, 0xb7dc, 0xb7dd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb7de, 0xb7df, 0xb7e0, 0xb7e1, 0xb7e2, 0xb7e3, 0xb7e4, 0xb7e5, 0xb7e6, 0xb7e7, 0xb7e8, 0xb7e9, 0xb7ea, 0xb7eb, 0xb7ee, 0xb7ef, 0xb7f1, 0xb7f2, 0xb7f3, 0xb7f5, 0xb7f6, 0xb7f7, 0xb7f8, 0xb7f9, 0xb7fa, 0xb7fb, 0xb7fe, 0xb802, 0xb803, 0xb804, 0xb805, 0xb806, 0xb80a, 0xb80b, 0xb80d, 0xb80e, 0xb80f, 0xb811, 0xb812, 0xb813, 0xb814, 0xb815, 0xb816, 0xb817, 0xb81a, 0xb81c, 0xb81e, 0xb81f, 0xb820, 0xb821, 0xb822, 0xb823, 0xb826, 0xb827, 0xb829, 0xb82a, 0xb82b, 0xb82d, 0xb82e, 0xb82f, 0xb830, 0xb831, 0xb832, 0xb833, 0xb836, 0xb83a, 0xb83b, 0xb83c, 0xb83d, 0xb83e, 0xb83f, 0xb841, 0xb842, 0xb843, 0xb845, 0xb846, 0xb847, 0xb848, 0xb849, 0xb84a, 0xb84b, 0xb84c, 0xb84d, 0xb84e, 0xb84f, 0xb850, 0xb852, 0xb854, 0xb855, 0xb856, 0xb857, 0xb858, 0xb859, 0xb85a, 0xb85b, 0xb85e, 0xb85f, 0xb861, 0xb862, 0xb863, 0xb865, 0xb866, 0xb867, 0xb868, 0xb869, 0xb86a, 0xb86b, 0xb86e, 0xb870, 0xb872, 0xb873, 0xb874, 0xb875, 0xb876, 0xb877, 0xb879, 0xb87a, 0xb87b, 0xb87d, 0xb87e, 0xb87f, 0xb880, 0xb881, 0xb882, 0xb883, 0xb884, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8f40[ 192 ] = { 0xfffd, 0xb885, 0xb886, 0xb887, 0xb888, 0xb889, 0xb88a, 0xb88b, 0xb88c, 0xb88e, 0xb88f, 0xb890, 0xb891, 0xb892, 0xb893, 0xb894, 0xb895, 0xb896, 0xb897, 0xb898, 0xb899, 0xb89a, 0xb89b, 0xb89c, 0xb89d, 0xb89e, 0xb89f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb8a0, 0xb8a1, 0xb8a2, 0xb8a3, 0xb8a4, 0xb8a5, 0xb8a6, 0xb8a7, 0xb8a9, 0xb8aa, 0xb8ab, 0xb8ac, 0xb8ad, 0xb8ae, 0xb8af, 0xb8b1, 0xb8b2, 0xb8b3, 0xb8b5, 0xb8b6, 0xb8b7, 0xb8b9, 0xb8ba, 0xb8bb, 0xb8bc, 0xb8bd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb8be, 0xb8bf, 0xb8c2, 0xb8c4, 0xb8c6, 0xb8c7, 0xb8c8, 0xb8c9, 0xb8ca, 0xb8cb, 0xb8cd, 0xb8ce, 0xb8cf, 0xb8d1, 0xb8d2, 0xb8d3, 0xb8d5, 0xb8d6, 0xb8d7, 0xb8d8, 0xb8d9, 0xb8da, 0xb8db, 0xb8dc, 0xb8de, 0xb8e0, 0xb8e2, 0xb8e3, 0xb8e4, 0xb8e5, 0xb8e6, 0xb8e7, 0xb8ea, 0xb8eb, 0xb8ed, 0xb8ee, 0xb8ef, 0xb8f1, 0xb8f2, 0xb8f3, 0xb8f4, 0xb8f5, 0xb8f6, 0xb8f7, 0xb8fa, 0xb8fc, 0xb8fe, 0xb8ff, 0xb900, 0xb901, 0xb902, 0xb903, 0xb905, 0xb906, 0xb907, 0xb908, 0xb909, 0xb90a, 0xb90b, 0xb90c, 0xb90d, 0xb90e, 0xb90f, 0xb910, 0xb911, 0xb912, 0xb913, 0xb914, 0xb915, 0xb916, 0xb917, 0xb919, 0xb91a, 0xb91b, 0xb91c, 0xb91d, 0xb91e, 0xb91f, 0xb921, 0xb922, 0xb923, 0xb924, 0xb925, 0xb926, 0xb927, 0xb928, 0xb929, 0xb92a, 0xb92b, 0xb92c, 0xb92d, 0xb92e, 0xb92f, 0xb930, 0xb931, 0xb932, 0xb933, 0xb934, 0xb935, 0xb936, 0xb937, 0xb938, 0xb939, 0xb93a, 0xb93b, 0xb93e, 0xb93f, 0xb941, 0xb942, 0xb943, 0xb945, 0xb946, 0xb947, 0xb948, 0xb949, 0xb94a, 0xb94b, 0xb94d, 0xb94e, 0xb950, 0xb952, 0xb953, 0xb954, 0xb955, 0xb956, 0xb957, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9040[ 192 ] = { 0xfffd, 0xb95a, 0xb95b, 0xb95d, 0xb95e, 0xb95f, 0xb961, 0xb962, 0xb963, 0xb964, 0xb965, 0xb966, 0xb967, 0xb96a, 0xb96c, 0xb96e, 0xb96f, 0xb970, 0xb971, 0xb972, 0xb973, 0xb976, 0xb977, 0xb979, 0xb97a, 0xb97b, 0xb97d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb97e, 0xb97f, 0xb980, 0xb981, 0xb982, 0xb983, 0xb986, 0xb988, 0xb98b, 0xb98c, 0xb98f, 0xb990, 0xb991, 0xb992, 0xb993, 0xb994, 0xb995, 0xb996, 0xb997, 0xb998, 0xb999, 0xb99a, 0xb99b, 0xb99c, 0xb99d, 0xb99e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb99f, 0xb9a0, 0xb9a1, 0xb9a2, 0xb9a3, 0xb9a4, 0xb9a5, 0xb9a6, 0xb9a7, 0xb9a8, 0xb9a9, 0xb9aa, 0xb9ab, 0xb9ae, 0xb9af, 0xb9b1, 0xb9b2, 0xb9b3, 0xb9b5, 0xb9b6, 0xb9b7, 0xb9b8, 0xb9b9, 0xb9ba, 0xb9bb, 0xb9be, 0xb9c0, 0xb9c2, 0xb9c3, 0xb9c4, 0xb9c5, 0xb9c6, 0xb9c7, 0xb9ca, 0xb9cb, 0xb9cd, 0xb9d3, 0xb9d4, 0xb9d5, 0xb9d6, 0xb9d7, 0xb9da, 0xb9dc, 0xb9df, 0xb9e0, 0xb9e2, 0xb9e6, 0xb9e7, 0xb9e9, 0xb9ea, 0xb9eb, 0xb9ed, 0xb9ee, 0xb9ef, 0xb9f0, 0xb9f1, 0xb9f2, 0xb9f3, 0xb9f6, 0xb9fb, 0xb9fc, 0xb9fd, 0xb9fe, 0xb9ff, 0xba02, 0xba03, 0xba04, 0xba05, 0xba06, 0xba07, 0xba09, 0xba0a, 0xba0b, 0xba0c, 0xba0d, 0xba0e, 0xba0f, 0xba10, 0xba11, 0xba12, 0xba13, 0xba14, 0xba16, 0xba17, 0xba18, 0xba19, 0xba1a, 0xba1b, 0xba1c, 0xba1d, 0xba1e, 0xba1f, 0xba20, 0xba21, 0xba22, 0xba23, 0xba24, 0xba25, 0xba26, 0xba27, 0xba28, 0xba29, 0xba2a, 0xba2b, 0xba2c, 0xba2d, 0xba2e, 0xba2f, 0xba30, 0xba31, 0xba32, 0xba33, 0xba34, 0xba35, 0xba36, 0xba37, 0xba3a, 0xba3b, 0xba3d, 0xba3e, 0xba3f, 0xba41, 0xba43, 0xba44, 0xba45, 0xba46, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9140[ 192 ] = { 0xfffd, 0xba47, 0xba4a, 0xba4c, 0xba4f, 0xba50, 0xba51, 0xba52, 0xba56, 0xba57, 0xba59, 0xba5a, 0xba5b, 0xba5d, 0xba5e, 0xba5f, 0xba60, 0xba61, 0xba62, 0xba63, 0xba66, 0xba6a, 0xba6b, 0xba6c, 0xba6d, 0xba6e, 0xba6f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xba72, 0xba73, 0xba75, 0xba76, 0xba77, 0xba79, 0xba7a, 0xba7b, 0xba7c, 0xba7d, 0xba7e, 0xba7f, 0xba80, 0xba81, 0xba82, 0xba86, 0xba88, 0xba89, 0xba8a, 0xba8b, 0xba8d, 0xba8e, 0xba8f, 0xba90, 0xba91, 0xba92, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xba93, 0xba94, 0xba95, 0xba96, 0xba97, 0xba98, 0xba99, 0xba9a, 0xba9b, 0xba9c, 0xba9d, 0xba9e, 0xba9f, 0xbaa0, 0xbaa1, 0xbaa2, 0xbaa3, 0xbaa4, 0xbaa5, 0xbaa6, 0xbaa7, 0xbaaa, 0xbaad, 0xbaae, 0xbaaf, 0xbab1, 0xbab3, 0xbab4, 0xbab5, 0xbab6, 0xbab7, 0xbaba, 0xbabc, 0xbabe, 0xbabf, 0xbac0, 0xbac1, 0xbac2, 0xbac3, 0xbac5, 0xbac6, 0xbac7, 0xbac9, 0xbaca, 0xbacb, 0xbacc, 0xbacd, 0xbace, 0xbacf, 0xbad0, 0xbad1, 0xbad2, 0xbad3, 0xbad4, 0xbad5, 0xbad6, 0xbad7, 0xbada, 0xbadb, 0xbadc, 0xbadd, 0xbade, 0xbadf, 0xbae0, 0xbae1, 0xbae2, 0xbae3, 0xbae4, 0xbae5, 0xbae6, 0xbae7, 0xbae8, 0xbae9, 0xbaea, 0xbaeb, 0xbaec, 0xbaed, 0xbaee, 0xbaef, 0xbaf0, 0xbaf1, 0xbaf2, 0xbaf3, 0xbaf4, 0xbaf5, 0xbaf6, 0xbaf7, 0xbaf8, 0xbaf9, 0xbafa, 0xbafb, 0xbafd, 0xbafe, 0xbaff, 0xbb01, 0xbb02, 0xbb03, 0xbb05, 0xbb06, 0xbb07, 0xbb08, 0xbb09, 0xbb0a, 0xbb0b, 0xbb0c, 0xbb0e, 0xbb10, 0xbb12, 0xbb13, 0xbb14, 0xbb15, 0xbb16, 0xbb17, 0xbb19, 0xbb1a, 0xbb1b, 0xbb1d, 0xbb1e, 0xbb1f, 0xbb21, 0xbb22, 0xbb23, 0xbb24, 0xbb25, 0xbb26, 0xbb27, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9240[ 192 ] = { 0xfffd, 0xbb28, 0xbb2a, 0xbb2c, 0xbb2d, 0xbb2e, 0xbb2f, 0xbb30, 0xbb31, 0xbb32, 0xbb33, 0xbb37, 0xbb39, 0xbb3a, 0xbb3f, 0xbb40, 0xbb41, 0xbb42, 0xbb43, 0xbb46, 0xbb48, 0xbb4a, 0xbb4b, 0xbb4c, 0xbb4e, 0xbb51, 0xbb52, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbb53, 0xbb55, 0xbb56, 0xbb57, 0xbb59, 0xbb5a, 0xbb5b, 0xbb5c, 0xbb5d, 0xbb5e, 0xbb5f, 0xbb60, 0xbb62, 0xbb64, 0xbb65, 0xbb66, 0xbb67, 0xbb68, 0xbb69, 0xbb6a, 0xbb6b, 0xbb6d, 0xbb6e, 0xbb6f, 0xbb70, 0xbb71, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbb72, 0xbb73, 0xbb74, 0xbb75, 0xbb76, 0xbb77, 0xbb78, 0xbb79, 0xbb7a, 0xbb7b, 0xbb7c, 0xbb7d, 0xbb7e, 0xbb7f, 0xbb80, 0xbb81, 0xbb82, 0xbb83, 0xbb84, 0xbb85, 0xbb86, 0xbb87, 0xbb89, 0xbb8a, 0xbb8b, 0xbb8d, 0xbb8e, 0xbb8f, 0xbb91, 0xbb92, 0xbb93, 0xbb94, 0xbb95, 0xbb96, 0xbb97, 0xbb98, 0xbb99, 0xbb9a, 0xbb9b, 0xbb9c, 0xbb9d, 0xbb9e, 0xbb9f, 0xbba0, 0xbba1, 0xbba2, 0xbba3, 0xbba5, 0xbba6, 0xbba7, 0xbba9, 0xbbaa, 0xbbab, 0xbbad, 0xbbae, 0xbbaf, 0xbbb0, 0xbbb1, 0xbbb2, 0xbbb3, 0xbbb5, 0xbbb6, 0xbbb8, 0xbbb9, 0xbbba, 0xbbbb, 0xbbbc, 0xbbbd, 0xbbbe, 0xbbbf, 0xbbc1, 0xbbc2, 0xbbc3, 0xbbc5, 0xbbc6, 0xbbc7, 0xbbc9, 0xbbca, 0xbbcb, 0xbbcc, 0xbbcd, 0xbbce, 0xbbcf, 0xbbd1, 0xbbd2, 0xbbd4, 0xbbd5, 0xbbd6, 0xbbd7, 0xbbd8, 0xbbd9, 0xbbda, 0xbbdb, 0xbbdc, 0xbbdd, 0xbbde, 0xbbdf, 0xbbe0, 0xbbe1, 0xbbe2, 0xbbe3, 0xbbe4, 0xbbe5, 0xbbe6, 0xbbe7, 0xbbe8, 0xbbe9, 0xbbea, 0xbbeb, 0xbbec, 0xbbed, 0xbbee, 0xbbef, 0xbbf0, 0xbbf1, 0xbbf2, 0xbbf3, 0xbbf4, 0xbbf5, 0xbbf6, 0xbbf7, 0xbbfa, 0xbbfb, 0xbbfd, 0xbbfe, 0xbc01, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9340[ 192 ] = { 0xfffd, 0xbc03, 0xbc04, 0xbc05, 0xbc06, 0xbc07, 0xbc0a, 0xbc0e, 0xbc10, 0xbc12, 0xbc13, 0xbc19, 0xbc1a, 0xbc20, 0xbc21, 0xbc22, 0xbc23, 0xbc26, 0xbc28, 0xbc2a, 0xbc2b, 0xbc2c, 0xbc2e, 0xbc2f, 0xbc32, 0xbc33, 0xbc35, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbc36, 0xbc37, 0xbc39, 0xbc3a, 0xbc3b, 0xbc3c, 0xbc3d, 0xbc3e, 0xbc3f, 0xbc42, 0xbc46, 0xbc47, 0xbc48, 0xbc4a, 0xbc4b, 0xbc4e, 0xbc4f, 0xbc51, 0xbc52, 0xbc53, 0xbc54, 0xbc55, 0xbc56, 0xbc57, 0xbc58, 0xbc59, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbc5a, 0xbc5b, 0xbc5c, 0xbc5e, 0xbc5f, 0xbc60, 0xbc61, 0xbc62, 0xbc63, 0xbc64, 0xbc65, 0xbc66, 0xbc67, 0xbc68, 0xbc69, 0xbc6a, 0xbc6b, 0xbc6c, 0xbc6d, 0xbc6e, 0xbc6f, 0xbc70, 0xbc71, 0xbc72, 0xbc73, 0xbc74, 0xbc75, 0xbc76, 0xbc77, 0xbc78, 0xbc79, 0xbc7a, 0xbc7b, 0xbc7c, 0xbc7d, 0xbc7e, 0xbc7f, 0xbc80, 0xbc81, 0xbc82, 0xbc83, 0xbc86, 0xbc87, 0xbc89, 0xbc8a, 0xbc8d, 0xbc8f, 0xbc90, 0xbc91, 0xbc92, 0xbc93, 0xbc96, 0xbc98, 0xbc9b, 0xbc9c, 0xbc9d, 0xbc9e, 0xbc9f, 0xbca2, 0xbca3, 0xbca5, 0xbca6, 0xbca9, 0xbcaa, 0xbcab, 0xbcac, 0xbcad, 0xbcae, 0xbcaf, 0xbcb2, 0xbcb6, 0xbcb7, 0xbcb8, 0xbcb9, 0xbcba, 0xbcbb, 0xbcbe, 0xbcbf, 0xbcc1, 0xbcc2, 0xbcc3, 0xbcc5, 0xbcc6, 0xbcc7, 0xbcc8, 0xbcc9, 0xbcca, 0xbccb, 0xbccc, 0xbcce, 0xbcd2, 0xbcd3, 0xbcd4, 0xbcd6, 0xbcd7, 0xbcd9, 0xbcda, 0xbcdb, 0xbcdd, 0xbcde, 0xbcdf, 0xbce0, 0xbce1, 0xbce2, 0xbce3, 0xbce4, 0xbce5, 0xbce6, 0xbce7, 0xbce8, 0xbce9, 0xbcea, 0xbceb, 0xbcec, 0xbced, 0xbcee, 0xbcef, 0xbcf0, 0xbcf1, 0xbcf2, 0xbcf3, 0xbcf7, 0xbcf9, 0xbcfa, 0xbcfb, 0xbcfd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9440[ 192 ] = { 0xfffd, 0xbcfe, 0xbcff, 0xbd00, 0xbd01, 0xbd02, 0xbd03, 0xbd06, 0xbd08, 0xbd0a, 0xbd0b, 0xbd0c, 0xbd0d, 0xbd0e, 0xbd0f, 0xbd11, 0xbd12, 0xbd13, 0xbd15, 0xbd16, 0xbd17, 0xbd18, 0xbd19, 0xbd1a, 0xbd1b, 0xbd1c, 0xbd1d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbd1e, 0xbd1f, 0xbd20, 0xbd21, 0xbd22, 0xbd23, 0xbd25, 0xbd26, 0xbd27, 0xbd28, 0xbd29, 0xbd2a, 0xbd2b, 0xbd2d, 0xbd2e, 0xbd2f, 0xbd30, 0xbd31, 0xbd32, 0xbd33, 0xbd34, 0xbd35, 0xbd36, 0xbd37, 0xbd38, 0xbd39, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbd3a, 0xbd3b, 0xbd3c, 0xbd3d, 0xbd3e, 0xbd3f, 0xbd41, 0xbd42, 0xbd43, 0xbd44, 0xbd45, 0xbd46, 0xbd47, 0xbd4a, 0xbd4b, 0xbd4d, 0xbd4e, 0xbd4f, 0xbd51, 0xbd52, 0xbd53, 0xbd54, 0xbd55, 0xbd56, 0xbd57, 0xbd5a, 0xbd5b, 0xbd5c, 0xbd5d, 0xbd5e, 0xbd5f, 0xbd60, 0xbd61, 0xbd62, 0xbd63, 0xbd65, 0xbd66, 0xbd67, 0xbd69, 0xbd6a, 0xbd6b, 0xbd6c, 0xbd6d, 0xbd6e, 0xbd6f, 0xbd70, 0xbd71, 0xbd72, 0xbd73, 0xbd74, 0xbd75, 0xbd76, 0xbd77, 0xbd78, 0xbd79, 0xbd7a, 0xbd7b, 0xbd7c, 0xbd7d, 0xbd7e, 0xbd7f, 0xbd82, 0xbd83, 0xbd85, 0xbd86, 0xbd8b, 0xbd8c, 0xbd8d, 0xbd8e, 0xbd8f, 0xbd92, 0xbd94, 0xbd96, 0xbd97, 0xbd98, 0xbd9b, 0xbd9d, 0xbd9e, 0xbd9f, 0xbda0, 0xbda1, 0xbda2, 0xbda3, 0xbda5, 0xbda6, 0xbda7, 0xbda8, 0xbda9, 0xbdaa, 0xbdab, 0xbdac, 0xbdad, 0xbdae, 0xbdaf, 0xbdb1, 0xbdb2, 0xbdb3, 0xbdb4, 0xbdb5, 0xbdb6, 0xbdb7, 0xbdb9, 0xbdba, 0xbdbb, 0xbdbc, 0xbdbd, 0xbdbe, 0xbdbf, 0xbdc0, 0xbdc1, 0xbdc2, 0xbdc3, 0xbdc4, 0xbdc5, 0xbdc6, 0xbdc7, 0xbdc8, 0xbdc9, 0xbdca, 0xbdcb, 0xbdcc, 0xbdcd, 0xbdce, 0xbdcf, 0xbdd0, 0xbdd1, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9540[ 192 ] = { 0xfffd, 0xbdd2, 0xbdd3, 0xbdd6, 0xbdd7, 0xbdd9, 0xbdda, 0xbddb, 0xbddd, 0xbdde, 0xbddf, 0xbde0, 0xbde1, 0xbde2, 0xbde3, 0xbde4, 0xbde5, 0xbde6, 0xbde7, 0xbde8, 0xbdea, 0xbdeb, 0xbdec, 0xbded, 0xbdee, 0xbdef, 0xbdf1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbdf2, 0xbdf3, 0xbdf5, 0xbdf6, 0xbdf7, 0xbdf9, 0xbdfa, 0xbdfb, 0xbdfc, 0xbdfd, 0xbdfe, 0xbdff, 0xbe01, 0xbe02, 0xbe04, 0xbe06, 0xbe07, 0xbe08, 0xbe09, 0xbe0a, 0xbe0b, 0xbe0e, 0xbe0f, 0xbe11, 0xbe12, 0xbe13, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbe15, 0xbe16, 0xbe17, 0xbe18, 0xbe19, 0xbe1a, 0xbe1b, 0xbe1e, 0xbe20, 0xbe21, 0xbe22, 0xbe23, 0xbe24, 0xbe25, 0xbe26, 0xbe27, 0xbe28, 0xbe29, 0xbe2a, 0xbe2b, 0xbe2c, 0xbe2d, 0xbe2e, 0xbe2f, 0xbe30, 0xbe31, 0xbe32, 0xbe33, 0xbe34, 0xbe35, 0xbe36, 0xbe37, 0xbe38, 0xbe39, 0xbe3a, 0xbe3b, 0xbe3c, 0xbe3d, 0xbe3e, 0xbe3f, 0xbe40, 0xbe41, 0xbe42, 0xbe43, 0xbe46, 0xbe47, 0xbe49, 0xbe4a, 0xbe4b, 0xbe4d, 0xbe4f, 0xbe50, 0xbe51, 0xbe52, 0xbe53, 0xbe56, 0xbe58, 0xbe5c, 0xbe5d, 0xbe5e, 0xbe5f, 0xbe62, 0xbe63, 0xbe65, 0xbe66, 0xbe67, 0xbe69, 0xbe6b, 0xbe6c, 0xbe6d, 0xbe6e, 0xbe6f, 0xbe72, 0xbe76, 0xbe77, 0xbe78, 0xbe79, 0xbe7a, 0xbe7e, 0xbe7f, 0xbe81, 0xbe82, 0xbe83, 0xbe85, 0xbe86, 0xbe87, 0xbe88, 0xbe89, 0xbe8a, 0xbe8b, 0xbe8e, 0xbe92, 0xbe93, 0xbe94, 0xbe95, 0xbe96, 0xbe97, 0xbe9a, 0xbe9b, 0xbe9c, 0xbe9d, 0xbe9e, 0xbe9f, 0xbea0, 0xbea1, 0xbea2, 0xbea3, 0xbea4, 0xbea5, 0xbea6, 0xbea7, 0xbea9, 0xbeaa, 0xbeab, 0xbeac, 0xbead, 0xbeae, 0xbeaf, 0xbeb0, 0xbeb1, 0xbeb2, 0xbeb3, 0xbeb4, 0xbeb5, 0xbeb6, 0xbeb7, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9640[ 192 ] = { 0xfffd, 0xbeb8, 0xbeb9, 0xbeba, 0xbebb, 0xbebc, 0xbebd, 0xbebe, 0xbebf, 0xbec0, 0xbec1, 0xbec2, 0xbec3, 0xbec4, 0xbec5, 0xbec6, 0xbec7, 0xbec8, 0xbec9, 0xbeca, 0xbecb, 0xbecc, 0xbecd, 0xbece, 0xbecf, 0xbed2, 0xbed3, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbed5, 0xbed6, 0xbed9, 0xbeda, 0xbedb, 0xbedc, 0xbedd, 0xbede, 0xbedf, 0xbee1, 0xbee2, 0xbee6, 0xbee7, 0xbee8, 0xbee9, 0xbeea, 0xbeeb, 0xbeed, 0xbeee, 0xbeef, 0xbef0, 0xbef1, 0xbef2, 0xbef3, 0xbef4, 0xbef5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbef6, 0xbef7, 0xbef8, 0xbef9, 0xbefa, 0xbefb, 0xbefc, 0xbefd, 0xbefe, 0xbeff, 0xbf00, 0xbf02, 0xbf03, 0xbf04, 0xbf05, 0xbf06, 0xbf07, 0xbf0a, 0xbf0b, 0xbf0c, 0xbf0d, 0xbf0e, 0xbf0f, 0xbf10, 0xbf11, 0xbf12, 0xbf13, 0xbf14, 0xbf15, 0xbf16, 0xbf17, 0xbf1a, 0xbf1e, 0xbf1f, 0xbf20, 0xbf21, 0xbf22, 0xbf23, 0xbf24, 0xbf25, 0xbf26, 0xbf27, 0xbf28, 0xbf29, 0xbf2a, 0xbf2b, 0xbf2c, 0xbf2d, 0xbf2e, 0xbf2f, 0xbf30, 0xbf31, 0xbf32, 0xbf33, 0xbf34, 0xbf35, 0xbf36, 0xbf37, 0xbf38, 0xbf39, 0xbf3a, 0xbf3b, 0xbf3c, 0xbf3d, 0xbf3e, 0xbf3f, 0xbf42, 0xbf43, 0xbf45, 0xbf46, 0xbf47, 0xbf49, 0xbf4a, 0xbf4b, 0xbf4c, 0xbf4d, 0xbf4e, 0xbf4f, 0xbf52, 0xbf53, 0xbf54, 0xbf56, 0xbf57, 0xbf58, 0xbf59, 0xbf5a, 0xbf5b, 0xbf5c, 0xbf5d, 0xbf5e, 0xbf5f, 0xbf60, 0xbf61, 0xbf62, 0xbf63, 0xbf64, 0xbf65, 0xbf66, 0xbf67, 0xbf68, 0xbf69, 0xbf6a, 0xbf6b, 0xbf6c, 0xbf6d, 0xbf6e, 0xbf6f, 0xbf70, 0xbf71, 0xbf72, 0xbf73, 0xbf74, 0xbf75, 0xbf76, 0xbf77, 0xbf78, 0xbf79, 0xbf7a, 0xbf7b, 0xbf7c, 0xbf7d, 0xbf7e, 0xbf7f, 0xbf80, 0xbf81, 0xbf82, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9740[ 192 ] = { 0xfffd, 0xbf83, 0xbf84, 0xbf85, 0xbf86, 0xbf87, 0xbf88, 0xbf89, 0xbf8a, 0xbf8b, 0xbf8c, 0xbf8d, 0xbf8e, 0xbf8f, 0xbf90, 0xbf91, 0xbf92, 0xbf93, 0xbf95, 0xbf96, 0xbf97, 0xbf98, 0xbf99, 0xbf9a, 0xbf9b, 0xbf9c, 0xbf9d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbf9e, 0xbf9f, 0xbfa0, 0xbfa1, 0xbfa2, 0xbfa3, 0xbfa4, 0xbfa5, 0xbfa6, 0xbfa7, 0xbfa8, 0xbfa9, 0xbfaa, 0xbfab, 0xbfac, 0xbfad, 0xbfae, 0xbfaf, 0xbfb1, 0xbfb2, 0xbfb3, 0xbfb4, 0xbfb5, 0xbfb6, 0xbfb7, 0xbfb8, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbfb9, 0xbfba, 0xbfbb, 0xbfbc, 0xbfbd, 0xbfbe, 0xbfbf, 0xbfc0, 0xbfc1, 0xbfc2, 0xbfc3, 0xbfc4, 0xbfc6, 0xbfc7, 0xbfc8, 0xbfc9, 0xbfca, 0xbfcb, 0xbfce, 0xbfcf, 0xbfd1, 0xbfd2, 0xbfd3, 0xbfd5, 0xbfd6, 0xbfd7, 0xbfd8, 0xbfd9, 0xbfda, 0xbfdb, 0xbfdd, 0xbfde, 0xbfe0, 0xbfe2, 0xbfe3, 0xbfe4, 0xbfe5, 0xbfe6, 0xbfe7, 0xbfe8, 0xbfe9, 0xbfea, 0xbfeb, 0xbfec, 0xbfed, 0xbfee, 0xbfef, 0xbff0, 0xbff1, 0xbff2, 0xbff3, 0xbff4, 0xbff5, 0xbff6, 0xbff7, 0xbff8, 0xbff9, 0xbffa, 0xbffb, 0xbffc, 0xbffd, 0xbffe, 0xbfff, 0xc000, 0xc001, 0xc002, 0xc003, 0xc004, 0xc005, 0xc006, 0xc007, 0xc008, 0xc009, 0xc00a, 0xc00b, 0xc00c, 0xc00d, 0xc00e, 0xc00f, 0xc010, 0xc011, 0xc012, 0xc013, 0xc014, 0xc015, 0xc016, 0xc017, 0xc018, 0xc019, 0xc01a, 0xc01b, 0xc01c, 0xc01d, 0xc01e, 0xc01f, 0xc020, 0xc021, 0xc022, 0xc023, 0xc024, 0xc025, 0xc026, 0xc027, 0xc028, 0xc029, 0xc02a, 0xc02b, 0xc02c, 0xc02d, 0xc02e, 0xc02f, 0xc030, 0xc031, 0xc032, 0xc033, 0xc034, 0xc035, 0xc036, 0xc037, 0xc038, 0xc039, 0xc03a, 0xc03b, 0xc03d, 0xc03e, 0xc03f, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9840[ 192 ] = { 0xfffd, 0xc040, 0xc041, 0xc042, 0xc043, 0xc044, 0xc045, 0xc046, 0xc047, 0xc048, 0xc049, 0xc04a, 0xc04b, 0xc04c, 0xc04d, 0xc04e, 0xc04f, 0xc050, 0xc052, 0xc053, 0xc054, 0xc055, 0xc056, 0xc057, 0xc059, 0xc05a, 0xc05b, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc05d, 0xc05e, 0xc05f, 0xc061, 0xc062, 0xc063, 0xc064, 0xc065, 0xc066, 0xc067, 0xc06a, 0xc06b, 0xc06c, 0xc06d, 0xc06e, 0xc06f, 0xc070, 0xc071, 0xc072, 0xc073, 0xc074, 0xc075, 0xc076, 0xc077, 0xc078, 0xc079, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc07a, 0xc07b, 0xc07c, 0xc07d, 0xc07e, 0xc07f, 0xc080, 0xc081, 0xc082, 0xc083, 0xc084, 0xc085, 0xc086, 0xc087, 0xc088, 0xc089, 0xc08a, 0xc08b, 0xc08c, 0xc08d, 0xc08e, 0xc08f, 0xc092, 0xc093, 0xc095, 0xc096, 0xc097, 0xc099, 0xc09a, 0xc09b, 0xc09c, 0xc09d, 0xc09e, 0xc09f, 0xc0a2, 0xc0a4, 0xc0a6, 0xc0a7, 0xc0a8, 0xc0a9, 0xc0aa, 0xc0ab, 0xc0ae, 0xc0b1, 0xc0b2, 0xc0b7, 0xc0b8, 0xc0b9, 0xc0ba, 0xc0bb, 0xc0be, 0xc0c2, 0xc0c3, 0xc0c4, 0xc0c6, 0xc0c7, 0xc0ca, 0xc0cb, 0xc0cd, 0xc0ce, 0xc0cf, 0xc0d1, 0xc0d2, 0xc0d3, 0xc0d4, 0xc0d5, 0xc0d6, 0xc0d7, 0xc0da, 0xc0de, 0xc0df, 0xc0e0, 0xc0e1, 0xc0e2, 0xc0e3, 0xc0e6, 0xc0e7, 0xc0e9, 0xc0ea, 0xc0eb, 0xc0ed, 0xc0ee, 0xc0ef, 0xc0f0, 0xc0f1, 0xc0f2, 0xc0f3, 0xc0f6, 0xc0f8, 0xc0fa, 0xc0fb, 0xc0fc, 0xc0fd, 0xc0fe, 0xc0ff, 0xc101, 0xc102, 0xc103, 0xc105, 0xc106, 0xc107, 0xc109, 0xc10a, 0xc10b, 0xc10c, 0xc10d, 0xc10e, 0xc10f, 0xc111, 0xc112, 0xc113, 0xc114, 0xc116, 0xc117, 0xc118, 0xc119, 0xc11a, 0xc11b, 0xc121, 0xc122, 0xc125, 0xc128, 0xc129, 0xc12a, 0xc12b, 0xc12e, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9940[ 192 ] = { 0xfffd, 0xc132, 0xc133, 0xc134, 0xc135, 0xc137, 0xc13a, 0xc13b, 0xc13d, 0xc13e, 0xc13f, 0xc141, 0xc142, 0xc143, 0xc144, 0xc145, 0xc146, 0xc147, 0xc14a, 0xc14e, 0xc14f, 0xc150, 0xc151, 0xc152, 0xc153, 0xc156, 0xc157, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc159, 0xc15a, 0xc15b, 0xc15d, 0xc15e, 0xc15f, 0xc160, 0xc161, 0xc162, 0xc163, 0xc166, 0xc16a, 0xc16b, 0xc16c, 0xc16d, 0xc16e, 0xc16f, 0xc171, 0xc172, 0xc173, 0xc175, 0xc176, 0xc177, 0xc179, 0xc17a, 0xc17b, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc17c, 0xc17d, 0xc17e, 0xc17f, 0xc180, 0xc181, 0xc182, 0xc183, 0xc184, 0xc186, 0xc187, 0xc188, 0xc189, 0xc18a, 0xc18b, 0xc18f, 0xc191, 0xc192, 0xc193, 0xc195, 0xc197, 0xc198, 0xc199, 0xc19a, 0xc19b, 0xc19e, 0xc1a0, 0xc1a2, 0xc1a3, 0xc1a4, 0xc1a6, 0xc1a7, 0xc1aa, 0xc1ab, 0xc1ad, 0xc1ae, 0xc1af, 0xc1b1, 0xc1b2, 0xc1b3, 0xc1b4, 0xc1b5, 0xc1b6, 0xc1b7, 0xc1b8, 0xc1b9, 0xc1ba, 0xc1bb, 0xc1bc, 0xc1be, 0xc1bf, 0xc1c0, 0xc1c1, 0xc1c2, 0xc1c3, 0xc1c5, 0xc1c6, 0xc1c7, 0xc1c9, 0xc1ca, 0xc1cb, 0xc1cd, 0xc1ce, 0xc1cf, 0xc1d0, 0xc1d1, 0xc1d2, 0xc1d3, 0xc1d5, 0xc1d6, 0xc1d9, 0xc1da, 0xc1db, 0xc1dc, 0xc1dd, 0xc1de, 0xc1df, 0xc1e1, 0xc1e2, 0xc1e3, 0xc1e5, 0xc1e6, 0xc1e7, 0xc1e9, 0xc1ea, 0xc1eb, 0xc1ec, 0xc1ed, 0xc1ee, 0xc1ef, 0xc1f2, 0xc1f4, 0xc1f5, 0xc1f6, 0xc1f7, 0xc1f8, 0xc1f9, 0xc1fa, 0xc1fb, 0xc1fe, 0xc1ff, 0xc201, 0xc202, 0xc203, 0xc205, 0xc206, 0xc207, 0xc208, 0xc209, 0xc20a, 0xc20b, 0xc20e, 0xc210, 0xc212, 0xc213, 0xc214, 0xc215, 0xc216, 0xc217, 0xc21a, 0xc21b, 0xc21d, 0xc21e, 0xc221, 0xc222, 0xc223, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9a40[ 192 ] = { 0xfffd, 0xc224, 0xc225, 0xc226, 0xc227, 0xc22a, 0xc22c, 0xc22e, 0xc230, 0xc233, 0xc235, 0xc236, 0xc237, 0xc238, 0xc239, 0xc23a, 0xc23b, 0xc23c, 0xc23d, 0xc23e, 0xc23f, 0xc240, 0xc241, 0xc242, 0xc243, 0xc244, 0xc245, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc246, 0xc247, 0xc249, 0xc24a, 0xc24b, 0xc24c, 0xc24d, 0xc24e, 0xc24f, 0xc252, 0xc253, 0xc255, 0xc256, 0xc257, 0xc259, 0xc25a, 0xc25b, 0xc25c, 0xc25d, 0xc25e, 0xc25f, 0xc261, 0xc262, 0xc263, 0xc264, 0xc266, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc267, 0xc268, 0xc269, 0xc26a, 0xc26b, 0xc26e, 0xc26f, 0xc271, 0xc272, 0xc273, 0xc275, 0xc276, 0xc277, 0xc278, 0xc279, 0xc27a, 0xc27b, 0xc27e, 0xc280, 0xc282, 0xc283, 0xc284, 0xc285, 0xc286, 0xc287, 0xc28a, 0xc28b, 0xc28c, 0xc28d, 0xc28e, 0xc28f, 0xc291, 0xc292, 0xc293, 0xc294, 0xc295, 0xc296, 0xc297, 0xc299, 0xc29a, 0xc29c, 0xc29e, 0xc29f, 0xc2a0, 0xc2a1, 0xc2a2, 0xc2a3, 0xc2a6, 0xc2a7, 0xc2a9, 0xc2aa, 0xc2ab, 0xc2ae, 0xc2af, 0xc2b0, 0xc2b1, 0xc2b2, 0xc2b3, 0xc2b6, 0xc2b8, 0xc2ba, 0xc2bb, 0xc2bc, 0xc2bd, 0xc2be, 0xc2bf, 0xc2c0, 0xc2c1, 0xc2c2, 0xc2c3, 0xc2c4, 0xc2c5, 0xc2c6, 0xc2c7, 0xc2c8, 0xc2c9, 0xc2ca, 0xc2cb, 0xc2cc, 0xc2cd, 0xc2ce, 0xc2cf, 0xc2d0, 0xc2d1, 0xc2d2, 0xc2d3, 0xc2d4, 0xc2d5, 0xc2d6, 0xc2d7, 0xc2d8, 0xc2d9, 0xc2da, 0xc2db, 0xc2de, 0xc2df, 0xc2e1, 0xc2e2, 0xc2e5, 0xc2e6, 0xc2e7, 0xc2e8, 0xc2e9, 0xc2ea, 0xc2ee, 0xc2f0, 0xc2f2, 0xc2f3, 0xc2f4, 0xc2f5, 0xc2f7, 0xc2fa, 0xc2fd, 0xc2fe, 0xc2ff, 0xc301, 0xc302, 0xc303, 0xc304, 0xc305, 0xc306, 0xc307, 0xc30a, 0xc30b, 0xc30e, 0xc30f, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9b40[ 192 ] = { 0xfffd, 0xc310, 0xc311, 0xc312, 0xc316, 0xc317, 0xc319, 0xc31a, 0xc31b, 0xc31d, 0xc31e, 0xc31f, 0xc320, 0xc321, 0xc322, 0xc323, 0xc326, 0xc327, 0xc32a, 0xc32b, 0xc32c, 0xc32d, 0xc32e, 0xc32f, 0xc330, 0xc331, 0xc332, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc333, 0xc334, 0xc335, 0xc336, 0xc337, 0xc338, 0xc339, 0xc33a, 0xc33b, 0xc33c, 0xc33d, 0xc33e, 0xc33f, 0xc340, 0xc341, 0xc342, 0xc343, 0xc344, 0xc346, 0xc347, 0xc348, 0xc349, 0xc34a, 0xc34b, 0xc34c, 0xc34d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc34e, 0xc34f, 0xc350, 0xc351, 0xc352, 0xc353, 0xc354, 0xc355, 0xc356, 0xc357, 0xc358, 0xc359, 0xc35a, 0xc35b, 0xc35c, 0xc35d, 0xc35e, 0xc35f, 0xc360, 0xc361, 0xc362, 0xc363, 0xc364, 0xc365, 0xc366, 0xc367, 0xc36a, 0xc36b, 0xc36d, 0xc36e, 0xc36f, 0xc371, 0xc373, 0xc374, 0xc375, 0xc376, 0xc377, 0xc37a, 0xc37b, 0xc37e, 0xc37f, 0xc380, 0xc381, 0xc382, 0xc383, 0xc385, 0xc386, 0xc387, 0xc389, 0xc38a, 0xc38b, 0xc38d, 0xc38e, 0xc38f, 0xc390, 0xc391, 0xc392, 0xc393, 0xc394, 0xc395, 0xc396, 0xc397, 0xc398, 0xc399, 0xc39a, 0xc39b, 0xc39c, 0xc39d, 0xc39e, 0xc39f, 0xc3a0, 0xc3a1, 0xc3a2, 0xc3a3, 0xc3a4, 0xc3a5, 0xc3a6, 0xc3a7, 0xc3a8, 0xc3a9, 0xc3aa, 0xc3ab, 0xc3ac, 0xc3ad, 0xc3ae, 0xc3af, 0xc3b0, 0xc3b1, 0xc3b2, 0xc3b3, 0xc3b4, 0xc3b5, 0xc3b6, 0xc3b7, 0xc3b8, 0xc3b9, 0xc3ba, 0xc3bb, 0xc3bc, 0xc3bd, 0xc3be, 0xc3bf, 0xc3c1, 0xc3c2, 0xc3c3, 0xc3c4, 0xc3c5, 0xc3c6, 0xc3c7, 0xc3c8, 0xc3c9, 0xc3ca, 0xc3cb, 0xc3cc, 0xc3cd, 0xc3ce, 0xc3cf, 0xc3d0, 0xc3d1, 0xc3d2, 0xc3d3, 0xc3d4, 0xc3d5, 0xc3d6, 0xc3d7, 0xc3da, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9c40[ 192 ] = { 0xfffd, 0xc3db, 0xc3dd, 0xc3de, 0xc3e1, 0xc3e3, 0xc3e4, 0xc3e5, 0xc3e6, 0xc3e7, 0xc3ea, 0xc3eb, 0xc3ec, 0xc3ee, 0xc3ef, 0xc3f0, 0xc3f1, 0xc3f2, 0xc3f3, 0xc3f6, 0xc3f7, 0xc3f9, 0xc3fa, 0xc3fb, 0xc3fc, 0xc3fd, 0xc3fe, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc3ff, 0xc400, 0xc401, 0xc402, 0xc403, 0xc404, 0xc405, 0xc406, 0xc407, 0xc409, 0xc40a, 0xc40b, 0xc40c, 0xc40d, 0xc40e, 0xc40f, 0xc411, 0xc412, 0xc413, 0xc414, 0xc415, 0xc416, 0xc417, 0xc418, 0xc419, 0xc41a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc41b, 0xc41c, 0xc41d, 0xc41e, 0xc41f, 0xc420, 0xc421, 0xc422, 0xc423, 0xc425, 0xc426, 0xc427, 0xc428, 0xc429, 0xc42a, 0xc42b, 0xc42d, 0xc42e, 0xc42f, 0xc431, 0xc432, 0xc433, 0xc435, 0xc436, 0xc437, 0xc438, 0xc439, 0xc43a, 0xc43b, 0xc43e, 0xc43f, 0xc440, 0xc441, 0xc442, 0xc443, 0xc444, 0xc445, 0xc446, 0xc447, 0xc449, 0xc44a, 0xc44b, 0xc44c, 0xc44d, 0xc44e, 0xc44f, 0xc450, 0xc451, 0xc452, 0xc453, 0xc454, 0xc455, 0xc456, 0xc457, 0xc458, 0xc459, 0xc45a, 0xc45b, 0xc45c, 0xc45d, 0xc45e, 0xc45f, 0xc460, 0xc461, 0xc462, 0xc463, 0xc466, 0xc467, 0xc469, 0xc46a, 0xc46b, 0xc46d, 0xc46e, 0xc46f, 0xc470, 0xc471, 0xc472, 0xc473, 0xc476, 0xc477, 0xc478, 0xc47a, 0xc47b, 0xc47c, 0xc47d, 0xc47e, 0xc47f, 0xc481, 0xc482, 0xc483, 0xc484, 0xc485, 0xc486, 0xc487, 0xc488, 0xc489, 0xc48a, 0xc48b, 0xc48c, 0xc48d, 0xc48e, 0xc48f, 0xc490, 0xc491, 0xc492, 0xc493, 0xc495, 0xc496, 0xc497, 0xc498, 0xc499, 0xc49a, 0xc49b, 0xc49d, 0xc49e, 0xc49f, 0xc4a0, 0xc4a1, 0xc4a2, 0xc4a3, 0xc4a4, 0xc4a5, 0xc4a6, 0xc4a7, 0xc4a8, 0xc4a9, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9d40[ 192 ] = { 0xfffd, 0xc4aa, 0xc4ab, 0xc4ac, 0xc4ad, 0xc4ae, 0xc4af, 0xc4b0, 0xc4b1, 0xc4b2, 0xc4b3, 0xc4b4, 0xc4b5, 0xc4b6, 0xc4b7, 0xc4b9, 0xc4ba, 0xc4bb, 0xc4bd, 0xc4be, 0xc4bf, 0xc4c0, 0xc4c1, 0xc4c2, 0xc4c3, 0xc4c4, 0xc4c5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc4c6, 0xc4c7, 0xc4c8, 0xc4c9, 0xc4ca, 0xc4cb, 0xc4cc, 0xc4cd, 0xc4ce, 0xc4cf, 0xc4d0, 0xc4d1, 0xc4d2, 0xc4d3, 0xc4d4, 0xc4d5, 0xc4d6, 0xc4d7, 0xc4d8, 0xc4d9, 0xc4da, 0xc4db, 0xc4dc, 0xc4dd, 0xc4de, 0xc4df, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc4e0, 0xc4e1, 0xc4e2, 0xc4e3, 0xc4e4, 0xc4e5, 0xc4e6, 0xc4e7, 0xc4e8, 0xc4ea, 0xc4eb, 0xc4ec, 0xc4ed, 0xc4ee, 0xc4ef, 0xc4f2, 0xc4f3, 0xc4f5, 0xc4f6, 0xc4f7, 0xc4f9, 0xc4fb, 0xc4fc, 0xc4fd, 0xc4fe, 0xc502, 0xc503, 0xc504, 0xc505, 0xc506, 0xc507, 0xc508, 0xc509, 0xc50a, 0xc50b, 0xc50d, 0xc50e, 0xc50f, 0xc511, 0xc512, 0xc513, 0xc515, 0xc516, 0xc517, 0xc518, 0xc519, 0xc51a, 0xc51b, 0xc51d, 0xc51e, 0xc51f, 0xc520, 0xc521, 0xc522, 0xc523, 0xc524, 0xc525, 0xc526, 0xc527, 0xc52a, 0xc52b, 0xc52d, 0xc52e, 0xc52f, 0xc531, 0xc532, 0xc533, 0xc534, 0xc535, 0xc536, 0xc537, 0xc53a, 0xc53c, 0xc53e, 0xc53f, 0xc540, 0xc541, 0xc542, 0xc543, 0xc546, 0xc547, 0xc54b, 0xc54f, 0xc550, 0xc551, 0xc552, 0xc556, 0xc55a, 0xc55b, 0xc55c, 0xc55f, 0xc562, 0xc563, 0xc565, 0xc566, 0xc567, 0xc569, 0xc56a, 0xc56b, 0xc56c, 0xc56d, 0xc56e, 0xc56f, 0xc572, 0xc576, 0xc577, 0xc578, 0xc579, 0xc57a, 0xc57b, 0xc57e, 0xc57f, 0xc581, 0xc582, 0xc583, 0xc585, 0xc586, 0xc588, 0xc589, 0xc58a, 0xc58b, 0xc58e, 0xc590, 0xc592, 0xc593, 0xc594, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9e40[ 192 ] = { 0xfffd, 0xc596, 0xc599, 0xc59a, 0xc59b, 0xc59d, 0xc59e, 0xc59f, 0xc5a1, 0xc5a2, 0xc5a3, 0xc5a4, 0xc5a5, 0xc5a6, 0xc5a7, 0xc5a8, 0xc5aa, 0xc5ab, 0xc5ac, 0xc5ad, 0xc5ae, 0xc5af, 0xc5b0, 0xc5b1, 0xc5b2, 0xc5b3, 0xc5b6, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc5b7, 0xc5ba, 0xc5bf, 0xc5c0, 0xc5c1, 0xc5c2, 0xc5c3, 0xc5cb, 0xc5cd, 0xc5cf, 0xc5d2, 0xc5d3, 0xc5d5, 0xc5d6, 0xc5d7, 0xc5d9, 0xc5da, 0xc5db, 0xc5dc, 0xc5dd, 0xc5de, 0xc5df, 0xc5e2, 0xc5e4, 0xc5e6, 0xc5e7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc5e8, 0xc5e9, 0xc5ea, 0xc5eb, 0xc5ef, 0xc5f1, 0xc5f2, 0xc5f3, 0xc5f5, 0xc5f8, 0xc5f9, 0xc5fa, 0xc5fb, 0xc602, 0xc603, 0xc604, 0xc609, 0xc60a, 0xc60b, 0xc60d, 0xc60e, 0xc60f, 0xc611, 0xc612, 0xc613, 0xc614, 0xc615, 0xc616, 0xc617, 0xc61a, 0xc61d, 0xc61e, 0xc61f, 0xc620, 0xc621, 0xc622, 0xc623, 0xc626, 0xc627, 0xc629, 0xc62a, 0xc62b, 0xc62f, 0xc631, 0xc632, 0xc636, 0xc638, 0xc63a, 0xc63c, 0xc63d, 0xc63e, 0xc63f, 0xc642, 0xc643, 0xc645, 0xc646, 0xc647, 0xc649, 0xc64a, 0xc64b, 0xc64c, 0xc64d, 0xc64e, 0xc64f, 0xc652, 0xc656, 0xc657, 0xc658, 0xc659, 0xc65a, 0xc65b, 0xc65e, 0xc65f, 0xc661, 0xc662, 0xc663, 0xc664, 0xc665, 0xc666, 0xc667, 0xc668, 0xc669, 0xc66a, 0xc66b, 0xc66d, 0xc66e, 0xc670, 0xc672, 0xc673, 0xc674, 0xc675, 0xc676, 0xc677, 0xc67a, 0xc67b, 0xc67d, 0xc67e, 0xc67f, 0xc681, 0xc682, 0xc683, 0xc684, 0xc685, 0xc686, 0xc687, 0xc68a, 0xc68c, 0xc68e, 0xc68f, 0xc690, 0xc691, 0xc692, 0xc693, 0xc696, 0xc697, 0xc699, 0xc69a, 0xc69b, 0xc69d, 0xc69e, 0xc69f, 0xc6a0, 0xc6a1, 0xc6a2, 0xc6a3, 0xc6a6, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9f40[ 192 ] = { 0xfffd, 0xc6a8, 0xc6aa, 0xc6ab, 0xc6ac, 0xc6ad, 0xc6ae, 0xc6af, 0xc6b2, 0xc6b3, 0xc6b5, 0xc6b6, 0xc6b7, 0xc6bb, 0xc6bc, 0xc6bd, 0xc6be, 0xc6bf, 0xc6c2, 0xc6c4, 0xc6c6, 0xc6c7, 0xc6c8, 0xc6c9, 0xc6ca, 0xc6cb, 0xc6ce, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc6cf, 0xc6d1, 0xc6d2, 0xc6d3, 0xc6d5, 0xc6d6, 0xc6d7, 0xc6d8, 0xc6d9, 0xc6da, 0xc6db, 0xc6de, 0xc6df, 0xc6e2, 0xc6e3, 0xc6e4, 0xc6e5, 0xc6e6, 0xc6e7, 0xc6ea, 0xc6eb, 0xc6ed, 0xc6ee, 0xc6ef, 0xc6f1, 0xc6f2, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc6f3, 0xc6f4, 0xc6f5, 0xc6f6, 0xc6f7, 0xc6fa, 0xc6fb, 0xc6fc, 0xc6fe, 0xc6ff, 0xc700, 0xc701, 0xc702, 0xc703, 0xc706, 0xc707, 0xc709, 0xc70a, 0xc70b, 0xc70d, 0xc70e, 0xc70f, 0xc710, 0xc711, 0xc712, 0xc713, 0xc716, 0xc718, 0xc71a, 0xc71b, 0xc71c, 0xc71d, 0xc71e, 0xc71f, 0xc722, 0xc723, 0xc725, 0xc726, 0xc727, 0xc729, 0xc72a, 0xc72b, 0xc72c, 0xc72d, 0xc72e, 0xc72f, 0xc732, 0xc734, 0xc736, 0xc738, 0xc739, 0xc73a, 0xc73b, 0xc73e, 0xc73f, 0xc741, 0xc742, 0xc743, 0xc745, 0xc746, 0xc747, 0xc748, 0xc749, 0xc74b, 0xc74e, 0xc750, 0xc759, 0xc75a, 0xc75b, 0xc75d, 0xc75e, 0xc75f, 0xc761, 0xc762, 0xc763, 0xc764, 0xc765, 0xc766, 0xc767, 0xc769, 0xc76a, 0xc76c, 0xc76d, 0xc76e, 0xc76f, 0xc770, 0xc771, 0xc772, 0xc773, 0xc776, 0xc777, 0xc779, 0xc77a, 0xc77b, 0xc77f, 0xc780, 0xc781, 0xc782, 0xc786, 0xc78b, 0xc78c, 0xc78d, 0xc78f, 0xc792, 0xc793, 0xc795, 0xc799, 0xc79b, 0xc79c, 0xc79d, 0xc79e, 0xc79f, 0xc7a2, 0xc7a7, 0xc7a8, 0xc7a9, 0xc7aa, 0xc7ab, 0xc7ae, 0xc7af, 0xc7b1, 0xc7b2, 0xc7b3, 0xc7b5, 0xc7b6, 0xc7b7, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa040[ 192 ] = { 0xfffd, 0xc7b8, 0xc7b9, 0xc7ba, 0xc7bb, 0xc7be, 0xc7c2, 0xc7c3, 0xc7c4, 0xc7c5, 0xc7c6, 0xc7c7, 0xc7ca, 0xc7cb, 0xc7cd, 0xc7cf, 0xc7d1, 0xc7d2, 0xc7d3, 0xc7d4, 0xc7d5, 0xc7d6, 0xc7d7, 0xc7d9, 0xc7da, 0xc7db, 0xc7dc, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc7de, 0xc7df, 0xc7e0, 0xc7e1, 0xc7e2, 0xc7e3, 0xc7e5, 0xc7e6, 0xc7e7, 0xc7e9, 0xc7ea, 0xc7eb, 0xc7ed, 0xc7ee, 0xc7ef, 0xc7f0, 0xc7f1, 0xc7f2, 0xc7f3, 0xc7f4, 0xc7f5, 0xc7f6, 0xc7f7, 0xc7f8, 0xc7f9, 0xc7fa, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc7fb, 0xc7fc, 0xc7fd, 0xc7fe, 0xc7ff, 0xc802, 0xc803, 0xc805, 0xc806, 0xc807, 0xc809, 0xc80b, 0xc80c, 0xc80d, 0xc80e, 0xc80f, 0xc812, 0xc814, 0xc817, 0xc818, 0xc819, 0xc81a, 0xc81b, 0xc81e, 0xc81f, 0xc821, 0xc822, 0xc823, 0xc825, 0xc826, 0xc827, 0xc828, 0xc829, 0xc82a, 0xc82b, 0xc82e, 0xc830, 0xc832, 0xc833, 0xc834, 0xc835, 0xc836, 0xc837, 0xc839, 0xc83a, 0xc83b, 0xc83d, 0xc83e, 0xc83f, 0xc841, 0xc842, 0xc843, 0xc844, 0xc845, 0xc846, 0xc847, 0xc84a, 0xc84b, 0xc84e, 0xc84f, 0xc850, 0xc851, 0xc852, 0xc853, 0xc855, 0xc856, 0xc857, 0xc858, 0xc859, 0xc85a, 0xc85b, 0xc85c, 0xc85d, 0xc85e, 0xc85f, 0xc860, 0xc861, 0xc862, 0xc863, 0xc864, 0xc865, 0xc866, 0xc867, 0xc868, 0xc869, 0xc86a, 0xc86b, 0xc86c, 0xc86d, 0xc86e, 0xc86f, 0xc872, 0xc873, 0xc875, 0xc876, 0xc877, 0xc879, 0xc87b, 0xc87c, 0xc87d, 0xc87e, 0xc87f, 0xc882, 0xc884, 0xc888, 0xc889, 0xc88a, 0xc88e, 0xc88f, 0xc890, 0xc891, 0xc892, 0xc893, 0xc895, 0xc896, 0xc897, 0xc898, 0xc899, 0xc89a, 0xc89b, 0xc89c, 0xc89e, 0xc8a0, 0xc8a2, 0xc8a3, 0xc8a4, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa140[ 192 ] = { 0xfffd, 0xc8a5, 0xc8a6, 0xc8a7, 0xc8a9, 0xc8aa, 0xc8ab, 0xc8ac, 0xc8ad, 0xc8ae, 0xc8af, 0xc8b0, 0xc8b1, 0xc8b2, 0xc8b3, 0xc8b4, 0xc8b5, 0xc8b6, 0xc8b7, 0xc8b8, 0xc8b9, 0xc8ba, 0xc8bb, 0xc8be, 0xc8bf, 0xc8c0, 0xc8c1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc8c2, 0xc8c3, 0xc8c5, 0xc8c6, 0xc8c7, 0xc8c9, 0xc8ca, 0xc8cb, 0xc8cd, 0xc8ce, 0xc8cf, 0xc8d0, 0xc8d1, 0xc8d2, 0xc8d3, 0xc8d6, 0xc8d8, 0xc8da, 0xc8db, 0xc8dc, 0xc8dd, 0xc8de, 0xc8df, 0xc8e2, 0xc8e3, 0xc8e5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc8e6, 0xc8e7, 0xc8e8, 0xc8e9, 0xc8ea, 0xc8eb, 0xc8ec, 0xc8ed, 0xc8ee, 0xc8ef, 0xc8f0, 0xc8f1, 0xc8f2, 0xc8f3, 0xc8f4, 0xc8f6, 0xc8f7, 0xc8f8, 0xc8f9, 0xc8fa, 0xc8fb, 0xc8fe, 0xc8ff, 0xc901, 0xc902, 0xc903, 0xc907, 0xc908, 0xc909, 0xc90a, 0xc90b, 0xc90e, 0x3000, 0x3001, 0x3002, 0x00b7, 0x2025, 0x2026, 0x00a8, 0x3003, 0x00ad, 0x2015, 0x2225, 0xff3c, 0x223c, 0x2018, 0x2019, 0x201c, 0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3010, 0x3011, 0x00b1, 0x00d7, 0x00f7, 0x2260, 0x2264, 0x2265, 0x221e, 0x2234, 0x00b0, 0x2032, 0x2033, 0x2103, 0x212b, 0xffe0, 0xffe1, 0xffe5, 0x2642, 0x2640, 0x2220, 0x22a5, 0x2312, 0x2202, 0x2207, 0x2261, 0x2252, 0x00a7, 0x203b, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x25bd, 0x25bc, 0x2192, 0x2190, 0x2191, 0x2193, 0x2194, 0x3013, 0x226a, 0x226b, 0x221a, 0x223d, 0x221d, 0x2235, 0x222b, 0x222c, 0x2208, 0x220b, 0x2286, 0x2287, 0x2282, 0x2283, 0x222a, 0x2229, 0x2227, 0x2228, 0xffe2, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa240[ 168 ] = { 0xfffd, 0xc910, 0xc912, 0xc913, 0xc914, 0xc915, 0xc916, 0xc917, 0xc919, 0xc91a, 0xc91b, 0xc91c, 0xc91d, 0xc91e, 0xc91f, 0xc920, 0xc921, 0xc922, 0xc923, 0xc924, 0xc925, 0xc926, 0xc927, 0xc928, 0xc929, 0xc92a, 0xc92b, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc92d, 0xc92e, 0xc92f, 0xc930, 0xc931, 0xc932, 0xc933, 0xc935, 0xc936, 0xc937, 0xc938, 0xc939, 0xc93a, 0xc93b, 0xc93c, 0xc93d, 0xc93e, 0xc93f, 0xc940, 0xc941, 0xc942, 0xc943, 0xc944, 0xc945, 0xc946, 0xc947, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc948, 0xc949, 0xc94a, 0xc94b, 0xc94c, 0xc94d, 0xc94e, 0xc94f, 0xc952, 0xc953, 0xc955, 0xc956, 0xc957, 0xc959, 0xc95a, 0xc95b, 0xc95c, 0xc95d, 0xc95e, 0xc95f, 0xc962, 0xc964, 0xc965, 0xc966, 0xc967, 0xc968, 0xc969, 0xc96a, 0xc96b, 0xc96d, 0xc96e, 0xc96f, 0x21d2, 0x21d4, 0x2200, 0x2203, 0x00b4, 0xff5e, 0x02c7, 0x02d8, 0x02dd, 0x02da, 0x02d9, 0x00b8, 0x02db, 0x00a1, 0x00bf, 0x02d0, 0x222e, 0x2211, 0x220f, 0x00a4, 0x2109, 0x2030, 0x25c1, 0x25c0, 0x25b7, 0x25b6, 0x2664, 0x2660, 0x2661, 0x2665, 0x2667, 0x2663, 0x2299, 0x25c8, 0x25a3, 0x25d0, 0x25d1, 0x2592, 0x25a4, 0x25a5, 0x25a8, 0x25a7, 0x25a6, 0x25a9, 0x2668, 0x260f, 0x260e, 0x261c, 0x261e, 0x00b6, 0x2020, 0x2021, 0x2195, 0x2197, 0x2199, 0x2196, 0x2198, 0x266d, 0x2669, 0x266a, 0x266c, 0x327f, 0x321c, 0x2116, 0x33c7, 0x2122, 0x33c2, 0x33d8, 0x2121, 0x20ac, 0x00ae }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa340[ 192 ] = { 0xfffd, 0xc971, 0xc972, 0xc973, 0xc975, 0xc976, 0xc977, 0xc978, 0xc979, 0xc97a, 0xc97b, 0xc97d, 0xc97e, 0xc97f, 0xc980, 0xc981, 0xc982, 0xc983, 0xc984, 0xc985, 0xc986, 0xc987, 0xc98a, 0xc98b, 0xc98d, 0xc98e, 0xc98f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc991, 0xc992, 0xc993, 0xc994, 0xc995, 0xc996, 0xc997, 0xc99a, 0xc99c, 0xc99e, 0xc99f, 0xc9a0, 0xc9a1, 0xc9a2, 0xc9a3, 0xc9a4, 0xc9a5, 0xc9a6, 0xc9a7, 0xc9a8, 0xc9a9, 0xc9aa, 0xc9ab, 0xc9ac, 0xc9ad, 0xc9ae, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc9af, 0xc9b0, 0xc9b1, 0xc9b2, 0xc9b3, 0xc9b4, 0xc9b5, 0xc9b6, 0xc9b7, 0xc9b8, 0xc9b9, 0xc9ba, 0xc9bb, 0xc9bc, 0xc9bd, 0xc9be, 0xc9bf, 0xc9c2, 0xc9c3, 0xc9c5, 0xc9c6, 0xc9c9, 0xc9cb, 0xc9cc, 0xc9cd, 0xc9ce, 0xc9cf, 0xc9d2, 0xc9d4, 0xc9d7, 0xc9d8, 0xc9db, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07, 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f, 0xff20, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a, 0xff3b, 0xffe6, 0xff3d, 0xff3e, 0xff3f, 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xffe3, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa440[ 192 ] = { 0xfffd, 0xc9de, 0xc9df, 0xc9e1, 0xc9e3, 0xc9e5, 0xc9e6, 0xc9e8, 0xc9e9, 0xc9ea, 0xc9eb, 0xc9ee, 0xc9f2, 0xc9f3, 0xc9f4, 0xc9f5, 0xc9f6, 0xc9f7, 0xc9fa, 0xc9fb, 0xc9fd, 0xc9fe, 0xc9ff, 0xca01, 0xca02, 0xca03, 0xca04, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xca05, 0xca06, 0xca07, 0xca0a, 0xca0e, 0xca0f, 0xca10, 0xca11, 0xca12, 0xca13, 0xca15, 0xca16, 0xca17, 0xca19, 0xca1a, 0xca1b, 0xca1c, 0xca1d, 0xca1e, 0xca1f, 0xca20, 0xca21, 0xca22, 0xca23, 0xca24, 0xca25, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xca26, 0xca27, 0xca28, 0xca2a, 0xca2b, 0xca2c, 0xca2d, 0xca2e, 0xca2f, 0xca30, 0xca31, 0xca32, 0xca33, 0xca34, 0xca35, 0xca36, 0xca37, 0xca38, 0xca39, 0xca3a, 0xca3b, 0xca3c, 0xca3d, 0xca3e, 0xca3f, 0xca40, 0xca41, 0xca42, 0xca43, 0xca44, 0xca45, 0xca46, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f, 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f, 0x3160, 0x3161, 0x3162, 0x3163, 0x3164, 0x3165, 0x3166, 0x3167, 0x3168, 0x3169, 0x316a, 0x316b, 0x316c, 0x316d, 0x316e, 0x316f, 0x3170, 0x3171, 0x3172, 0x3173, 0x3174, 0x3175, 0x3176, 0x3177, 0x3178, 0x3179, 0x317a, 0x317b, 0x317c, 0x317d, 0x317e, 0x317f, 0x3180, 0x3181, 0x3182, 0x3183, 0x3184, 0x3185, 0x3186, 0x3187, 0x3188, 0x3189, 0x318a, 0x318b, 0x318c, 0x318d, 0x318e, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa540[ 192 ] = { 0xfffd, 0xca47, 0xca48, 0xca49, 0xca4a, 0xca4b, 0xca4e, 0xca4f, 0xca51, 0xca52, 0xca53, 0xca55, 0xca56, 0xca57, 0xca58, 0xca59, 0xca5a, 0xca5b, 0xca5e, 0xca62, 0xca63, 0xca64, 0xca65, 0xca66, 0xca67, 0xca69, 0xca6a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xca6b, 0xca6c, 0xca6d, 0xca6e, 0xca6f, 0xca70, 0xca71, 0xca72, 0xca73, 0xca74, 0xca75, 0xca76, 0xca77, 0xca78, 0xca79, 0xca7a, 0xca7b, 0xca7c, 0xca7e, 0xca7f, 0xca80, 0xca81, 0xca82, 0xca83, 0xca85, 0xca86, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xca87, 0xca88, 0xca89, 0xca8a, 0xca8b, 0xca8c, 0xca8d, 0xca8e, 0xca8f, 0xca90, 0xca91, 0xca92, 0xca93, 0xca94, 0xca95, 0xca96, 0xca97, 0xca99, 0xca9a, 0xca9b, 0xca9c, 0xca9d, 0xca9e, 0xca9f, 0xcaa0, 0xcaa1, 0xcaa2, 0xcaa3, 0xcaa4, 0xcaa5, 0xcaa6, 0xcaa7, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa640[ 168 ] = { 0xfffd, 0xcaa8, 0xcaa9, 0xcaaa, 0xcaab, 0xcaac, 0xcaad, 0xcaae, 0xcaaf, 0xcab0, 0xcab1, 0xcab2, 0xcab3, 0xcab4, 0xcab5, 0xcab6, 0xcab7, 0xcab8, 0xcab9, 0xcaba, 0xcabb, 0xcabe, 0xcabf, 0xcac1, 0xcac2, 0xcac3, 0xcac5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcac6, 0xcac7, 0xcac8, 0xcac9, 0xcaca, 0xcacb, 0xcace, 0xcad0, 0xcad2, 0xcad4, 0xcad5, 0xcad6, 0xcad7, 0xcada, 0xcadb, 0xcadc, 0xcadd, 0xcade, 0xcadf, 0xcae1, 0xcae2, 0xcae3, 0xcae4, 0xcae5, 0xcae6, 0xcae7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcae8, 0xcae9, 0xcaea, 0xcaeb, 0xcaed, 0xcaee, 0xcaef, 0xcaf0, 0xcaf1, 0xcaf2, 0xcaf3, 0xcaf5, 0xcaf6, 0xcaf7, 0xcaf8, 0xcaf9, 0xcafa, 0xcafb, 0xcafc, 0xcafd, 0xcafe, 0xcaff, 0xcb00, 0xcb01, 0xcb02, 0xcb03, 0xcb04, 0xcb05, 0xcb06, 0xcb07, 0xcb09, 0xcb0a, 0x2500, 0x2502, 0x250c, 0x2510, 0x2518, 0x2514, 0x251c, 0x252c, 0x2524, 0x2534, 0x253c, 0x2501, 0x2503, 0x250f, 0x2513, 0x251b, 0x2517, 0x2523, 0x2533, 0x252b, 0x253b, 0x254b, 0x2520, 0x252f, 0x2528, 0x2537, 0x253f, 0x251d, 0x2530, 0x2525, 0x2538, 0x2542, 0x2512, 0x2511, 0x251a, 0x2519, 0x2516, 0x2515, 0x250e, 0x250d, 0x251e, 0x251f, 0x2521, 0x2522, 0x2526, 0x2527, 0x2529, 0x252a, 0x252d, 0x252e, 0x2531, 0x2532, 0x2535, 0x2536, 0x2539, 0x253a, 0x253d, 0x253e, 0x2540, 0x2541, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa740[ 176 ] = { 0xfffd, 0xcb0b, 0xcb0c, 0xcb0d, 0xcb0e, 0xcb0f, 0xcb11, 0xcb12, 0xcb13, 0xcb15, 0xcb16, 0xcb17, 0xcb19, 0xcb1a, 0xcb1b, 0xcb1c, 0xcb1d, 0xcb1e, 0xcb1f, 0xcb22, 0xcb23, 0xcb24, 0xcb25, 0xcb26, 0xcb27, 0xcb28, 0xcb29, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcb2a, 0xcb2b, 0xcb2c, 0xcb2d, 0xcb2e, 0xcb2f, 0xcb30, 0xcb31, 0xcb32, 0xcb33, 0xcb34, 0xcb35, 0xcb36, 0xcb37, 0xcb38, 0xcb39, 0xcb3a, 0xcb3b, 0xcb3c, 0xcb3d, 0xcb3e, 0xcb3f, 0xcb40, 0xcb42, 0xcb43, 0xcb44, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcb45, 0xcb46, 0xcb47, 0xcb4a, 0xcb4b, 0xcb4d, 0xcb4e, 0xcb4f, 0xcb51, 0xcb52, 0xcb53, 0xcb54, 0xcb55, 0xcb56, 0xcb57, 0xcb5a, 0xcb5b, 0xcb5c, 0xcb5e, 0xcb5f, 0xcb60, 0xcb61, 0xcb62, 0xcb63, 0xcb65, 0xcb66, 0xcb67, 0xcb68, 0xcb69, 0xcb6a, 0xcb6b, 0xcb6c, 0x3395, 0x3396, 0x3397, 0x2113, 0x3398, 0x33c4, 0x33a3, 0x33a4, 0x33a5, 0x33a6, 0x3399, 0x339a, 0x339b, 0x339c, 0x339d, 0x339e, 0x339f, 0x33a0, 0x33a1, 0x33a2, 0x33ca, 0x338d, 0x338e, 0x338f, 0x33cf, 0x3388, 0x3389, 0x33c8, 0x33a7, 0x33a8, 0x33b0, 0x33b1, 0x33b2, 0x33b3, 0x33b4, 0x33b5, 0x33b6, 0x33b7, 0x33b8, 0x33b9, 0x3380, 0x3381, 0x3382, 0x3383, 0x3384, 0x33ba, 0x33bb, 0x33bc, 0x33bd, 0x33be, 0x33bf, 0x3390, 0x3391, 0x3392, 0x3393, 0x3394, 0x2126, 0x33c0, 0x33c1, 0x338a, 0x338b, 0x338c, 0x33d6, 0x33c5, 0x33ad, 0x33ae, 0x33af, 0x33db, 0x33a9, 0x33aa, 0x33ab, 0x33ac, 0x33dd, 0x33d0, 0x33d3, 0x33c3, 0x33c9, 0x33dc, 0x33c6 }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa840[ 192 ] = { 0xfffd, 0xcb6d, 0xcb6e, 0xcb6f, 0xcb70, 0xcb71, 0xcb72, 0xcb73, 0xcb74, 0xcb75, 0xcb76, 0xcb77, 0xcb7a, 0xcb7b, 0xcb7c, 0xcb7d, 0xcb7e, 0xcb7f, 0xcb80, 0xcb81, 0xcb82, 0xcb83, 0xcb84, 0xcb85, 0xcb86, 0xcb87, 0xcb88, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcb89, 0xcb8a, 0xcb8b, 0xcb8c, 0xcb8d, 0xcb8e, 0xcb8f, 0xcb90, 0xcb91, 0xcb92, 0xcb93, 0xcb94, 0xcb95, 0xcb96, 0xcb97, 0xcb98, 0xcb99, 0xcb9a, 0xcb9b, 0xcb9d, 0xcb9e, 0xcb9f, 0xcba0, 0xcba1, 0xcba2, 0xcba3, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcba4, 0xcba5, 0xcba6, 0xcba7, 0xcba8, 0xcba9, 0xcbaa, 0xcbab, 0xcbac, 0xcbad, 0xcbae, 0xcbaf, 0xcbb0, 0xcbb1, 0xcbb2, 0xcbb3, 0xcbb4, 0xcbb5, 0xcbb6, 0xcbb7, 0xcbb9, 0xcbba, 0xcbbb, 0xcbbc, 0xcbbd, 0xcbbe, 0xcbbf, 0xcbc0, 0xcbc1, 0xcbc2, 0xcbc3, 0xcbc4, 0x00c6, 0x00d0, 0x00aa, 0x0126, 0xfffd, 0x0132, 0xfffd, 0x013f, 0x0141, 0x00d8, 0x0152, 0x00ba, 0x00de, 0x0166, 0x014a, 0xfffd, 0x3260, 0x3261, 0x3262, 0x3263, 0x3264, 0x3265, 0x3266, 0x3267, 0x3268, 0x3269, 0x326a, 0x326b, 0x326c, 0x326d, 0x326e, 0x326f, 0x3270, 0x3271, 0x3272, 0x3273, 0x3274, 0x3275, 0x3276, 0x3277, 0x3278, 0x3279, 0x327a, 0x327b, 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x00bd, 0x2153, 0x2154, 0x00bc, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa940[ 192 ] = { 0xfffd, 0xcbc5, 0xcbc6, 0xcbc7, 0xcbc8, 0xcbc9, 0xcbca, 0xcbcb, 0xcbcc, 0xcbcd, 0xcbce, 0xcbcf, 0xcbd0, 0xcbd1, 0xcbd2, 0xcbd3, 0xcbd5, 0xcbd6, 0xcbd7, 0xcbd8, 0xcbd9, 0xcbda, 0xcbdb, 0xcbdc, 0xcbdd, 0xcbde, 0xcbdf, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcbe0, 0xcbe1, 0xcbe2, 0xcbe3, 0xcbe5, 0xcbe6, 0xcbe8, 0xcbea, 0xcbeb, 0xcbec, 0xcbed, 0xcbee, 0xcbef, 0xcbf0, 0xcbf1, 0xcbf2, 0xcbf3, 0xcbf4, 0xcbf5, 0xcbf6, 0xcbf7, 0xcbf8, 0xcbf9, 0xcbfa, 0xcbfb, 0xcbfc, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcbfd, 0xcbfe, 0xcbff, 0xcc00, 0xcc01, 0xcc02, 0xcc03, 0xcc04, 0xcc05, 0xcc06, 0xcc07, 0xcc08, 0xcc09, 0xcc0a, 0xcc0b, 0xcc0e, 0xcc0f, 0xcc11, 0xcc12, 0xcc13, 0xcc15, 0xcc16, 0xcc17, 0xcc18, 0xcc19, 0xcc1a, 0xcc1b, 0xcc1e, 0xcc1f, 0xcc20, 0xcc23, 0xcc24, 0x00e6, 0x0111, 0x00f0, 0x0127, 0x0131, 0x0133, 0x0138, 0x0140, 0x0142, 0x00f8, 0x0153, 0x00df, 0x00fe, 0x0167, 0x014b, 0x0149, 0x3200, 0x3201, 0x3202, 0x3203, 0x3204, 0x3205, 0x3206, 0x3207, 0x3208, 0x3209, 0x320a, 0x320b, 0x320c, 0x320d, 0x320e, 0x320f, 0x3210, 0x3211, 0x3212, 0x3213, 0x3214, 0x3215, 0x3216, 0x3217, 0x3218, 0x3219, 0x321a, 0x321b, 0x249c, 0x249d, 0x249e, 0x249f, 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7, 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af, 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x2474, 0x2475, 0x2476, 0x2477, 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, 0x2480, 0x2481, 0x2482, 0x00b9, 0x00b2, 0x00b3, 0x2074, 0x207f, 0x2081, 0x2082, 0x2083, 0x2084, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaa40[ 184 ] = { 0xfffd, 0xcc25, 0xcc26, 0xcc2a, 0xcc2b, 0xcc2d, 0xcc2f, 0xcc31, 0xcc32, 0xcc33, 0xcc34, 0xcc35, 0xcc36, 0xcc37, 0xcc3a, 0xcc3f, 0xcc40, 0xcc41, 0xcc42, 0xcc43, 0xcc46, 0xcc47, 0xcc49, 0xcc4a, 0xcc4b, 0xcc4d, 0xcc4e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcc4f, 0xcc50, 0xcc51, 0xcc52, 0xcc53, 0xcc56, 0xcc5a, 0xcc5b, 0xcc5c, 0xcc5d, 0xcc5e, 0xcc5f, 0xcc61, 0xcc62, 0xcc63, 0xcc65, 0xcc67, 0xcc69, 0xcc6a, 0xcc6b, 0xcc6c, 0xcc6d, 0xcc6e, 0xcc6f, 0xcc71, 0xcc72, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcc73, 0xcc74, 0xcc76, 0xcc77, 0xcc78, 0xcc79, 0xcc7a, 0xcc7b, 0xcc7c, 0xcc7d, 0xcc7e, 0xcc7f, 0xcc80, 0xcc81, 0xcc82, 0xcc83, 0xcc84, 0xcc85, 0xcc86, 0xcc87, 0xcc88, 0xcc89, 0xcc8a, 0xcc8b, 0xcc8c, 0xcc8d, 0xcc8e, 0xcc8f, 0xcc90, 0xcc91, 0xcc92, 0xcc93, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f, 0x3090, 0x3091, 0x3092, 0x3093, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xab40[ 184 ] = { 0xfffd, 0xcc94, 0xcc95, 0xcc96, 0xcc97, 0xcc9a, 0xcc9b, 0xcc9d, 0xcc9e, 0xcc9f, 0xcca1, 0xcca2, 0xcca3, 0xcca4, 0xcca5, 0xcca6, 0xcca7, 0xccaa, 0xccae, 0xccaf, 0xccb0, 0xccb1, 0xccb2, 0xccb3, 0xccb6, 0xccb7, 0xccb9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xccba, 0xccbb, 0xccbd, 0xccbe, 0xccbf, 0xccc0, 0xccc1, 0xccc2, 0xccc3, 0xccc6, 0xccc8, 0xccca, 0xcccb, 0xcccc, 0xcccd, 0xccce, 0xcccf, 0xccd1, 0xccd2, 0xccd3, 0xccd5, 0xccd6, 0xccd7, 0xccd8, 0xccd9, 0xccda, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xccdb, 0xccdc, 0xccdd, 0xccde, 0xccdf, 0xcce0, 0xcce1, 0xcce2, 0xcce3, 0xcce5, 0xcce6, 0xcce7, 0xcce8, 0xcce9, 0xccea, 0xcceb, 0xcced, 0xccee, 0xccef, 0xccf1, 0xccf2, 0xccf3, 0xccf4, 0xccf5, 0xccf6, 0xccf7, 0xccf8, 0xccf9, 0xccfa, 0xccfb, 0xccfc, 0xccfd, 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7, 0x30a8, 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af, 0x30b0, 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7, 0x30b8, 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf, 0x30c0, 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7, 0x30c8, 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d0, 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7, 0x30d8, 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef, 0x30f0, 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xac40[ 136 ] = { 0xfffd, 0xccfe, 0xccff, 0xcd00, 0xcd02, 0xcd03, 0xcd04, 0xcd05, 0xcd06, 0xcd07, 0xcd0a, 0xcd0b, 0xcd0d, 0xcd0e, 0xcd0f, 0xcd11, 0xcd12, 0xcd13, 0xcd14, 0xcd15, 0xcd16, 0xcd17, 0xcd1a, 0xcd1c, 0xcd1e, 0xcd1f, 0xcd20, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcd21, 0xcd22, 0xcd23, 0xcd25, 0xcd26, 0xcd27, 0xcd29, 0xcd2a, 0xcd2b, 0xcd2d, 0xcd2e, 0xcd2f, 0xcd30, 0xcd31, 0xcd32, 0xcd33, 0xcd34, 0xcd35, 0xcd36, 0xcd37, 0xcd38, 0xcd3a, 0xcd3b, 0xcd3c, 0xcd3d, 0xcd3e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcd3f, 0xcd40, 0xcd41, 0xcd42, 0xcd43, 0xcd44, 0xcd45, 0xcd46, 0xcd47, 0xcd48, 0xcd49, 0xcd4a, 0xcd4b, 0xcd4c, 0xcd4d, 0xcd4e, 0xcd4f, 0xcd50, 0xcd51, 0xcd52, 0xcd53, 0xcd54, 0xcd55, 0xcd56, 0xcd57, 0xcd58, 0xcd59, 0xcd5a, 0xcd5b, 0xcd5d, 0xcd5e, 0xcd5f, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xacd0[ 40 ] = { 0xfffd, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xad40[ 96 ] = { 0xfffd, 0xcd61, 0xcd62, 0xcd63, 0xcd65, 0xcd66, 0xcd67, 0xcd68, 0xcd69, 0xcd6a, 0xcd6b, 0xcd6e, 0xcd70, 0xcd72, 0xcd73, 0xcd74, 0xcd75, 0xcd76, 0xcd77, 0xcd79, 0xcd7a, 0xcd7b, 0xcd7c, 0xcd7d, 0xcd7e, 0xcd7f, 0xcd80, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcd81, 0xcd82, 0xcd83, 0xcd84, 0xcd85, 0xcd86, 0xcd87, 0xcd89, 0xcd8a, 0xcd8b, 0xcd8c, 0xcd8d, 0xcd8e, 0xcd8f, 0xcd90, 0xcd91, 0xcd92, 0xcd93, 0xcd96, 0xcd97, 0xcd99, 0xcd9a, 0xcd9b, 0xcd9d, 0xcd9e, 0xcd9f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcda0, 0xcda1, 0xcda2, 0xcda3, 0xcda6, 0xcda8, 0xcdaa, 0xcdab, 0xcdac, 0xcdad, 0xcdae, 0xcdaf, 0xcdb1, 0xcdb2, 0xcdb3, 0xcdb4, 0xcdb5, 0xcdb6, 0xcdb7, 0xcdb8, 0xcdb9, 0xcdba, 0xcdbb, 0xcdbc, 0xcdbd, 0xcdbe, 0xcdbf, 0xcdc0, 0xcdc1, 0xcdc2, 0xcdc3 }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xae40[ 96 ] = { 0xfffd, 0xcdc6, 0xcdc7, 0xcdc8, 0xcdc9, 0xcdca, 0xcdcb, 0xcdcd, 0xcdce, 0xcdcf, 0xcdd1, 0xcdd2, 0xcdd3, 0xcdd4, 0xcdd5, 0xcdd6, 0xcdd7, 0xcdd8, 0xcdd9, 0xcdda, 0xcddb, 0xcddc, 0xcddd, 0xcdde, 0xcddf, 0xcde0, 0xcde1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcde2, 0xcde3, 0xcde4, 0xcde5, 0xcde6, 0xcde7, 0xcde9, 0xcdea, 0xcdeb, 0xcded, 0xcdee, 0xcdef, 0xcdf1, 0xcdf2, 0xcdf3, 0xcdf4, 0xcdf5, 0xcdf6, 0xcdf7, 0xcdfa, 0xcdfc, 0xcdfe, 0xcdff, 0xce00, 0xce01, 0xce02, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xce03, 0xce05, 0xce06, 0xce07, 0xce09, 0xce0a, 0xce0b, 0xce0d, 0xce0e, 0xce0f, 0xce10, 0xce11, 0xce12, 0xce13, 0xce15, 0xce16, 0xce17, 0xce18, 0xce1a, 0xce1b, 0xce1c, 0xce1d, 0xce1e, 0xce1f, 0xce22, 0xce23, 0xce25, 0xce26, 0xce27, 0xce29, 0xce2a }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaf40[ 96 ] = { 0xfffd, 0xce2c, 0xce2d, 0xce2e, 0xce2f, 0xce32, 0xce34, 0xce36, 0xce37, 0xce38, 0xce39, 0xce3a, 0xce3b, 0xce3c, 0xce3d, 0xce3e, 0xce3f, 0xce40, 0xce41, 0xce42, 0xce43, 0xce44, 0xce45, 0xce46, 0xce47, 0xce48, 0xce49, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xce4a, 0xce4b, 0xce4c, 0xce4d, 0xce4e, 0xce4f, 0xce50, 0xce51, 0xce52, 0xce53, 0xce54, 0xce55, 0xce56, 0xce57, 0xce5a, 0xce5b, 0xce5d, 0xce5e, 0xce62, 0xce63, 0xce64, 0xce65, 0xce66, 0xce67, 0xce6a, 0xce6c, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xce6e, 0xce6f, 0xce70, 0xce71, 0xce72, 0xce73, 0xce76, 0xce77, 0xce79, 0xce7a, 0xce7b, 0xce7d, 0xce7e, 0xce7f, 0xce80, 0xce81, 0xce82, 0xce83, 0xce86, 0xce88, 0xce8a, 0xce8b, 0xce8c, 0xce8d, 0xce8e, 0xce8f, 0xce92, 0xce93, 0xce95, 0xce96, 0xce97 }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb040[ 192 ] = { 0xfffd, 0xce9a, 0xce9b, 0xce9c, 0xce9d, 0xce9e, 0xce9f, 0xcea2, 0xcea6, 0xcea7, 0xcea8, 0xcea9, 0xceaa, 0xceab, 0xceae, 0xceaf, 0xceb0, 0xceb1, 0xceb2, 0xceb3, 0xceb4, 0xceb5, 0xceb6, 0xceb7, 0xceb8, 0xceb9, 0xceba, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcebb, 0xcebc, 0xcebd, 0xcebe, 0xcebf, 0xcec0, 0xcec2, 0xcec3, 0xcec4, 0xcec5, 0xcec6, 0xcec7, 0xcec8, 0xcec9, 0xceca, 0xcecb, 0xcecc, 0xcecd, 0xcece, 0xcecf, 0xced0, 0xced1, 0xced2, 0xced3, 0xced4, 0xced5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xced6, 0xced7, 0xced8, 0xced9, 0xceda, 0xcedb, 0xcedc, 0xcedd, 0xcede, 0xcedf, 0xcee0, 0xcee1, 0xcee2, 0xcee3, 0xcee6, 0xcee7, 0xcee9, 0xceea, 0xceed, 0xceee, 0xceef, 0xcef0, 0xcef1, 0xcef2, 0xcef3, 0xcef6, 0xcefa, 0xcefb, 0xcefc, 0xcefd, 0xcefe, 0xceff, 0xac00, 0xac01, 0xac04, 0xac07, 0xac08, 0xac09, 0xac0a, 0xac10, 0xac11, 0xac12, 0xac13, 0xac14, 0xac15, 0xac16, 0xac17, 0xac19, 0xac1a, 0xac1b, 0xac1c, 0xac1d, 0xac20, 0xac24, 0xac2c, 0xac2d, 0xac2f, 0xac30, 0xac31, 0xac38, 0xac39, 0xac3c, 0xac40, 0xac4b, 0xac4d, 0xac54, 0xac58, 0xac5c, 0xac70, 0xac71, 0xac74, 0xac77, 0xac78, 0xac7a, 0xac80, 0xac81, 0xac83, 0xac84, 0xac85, 0xac86, 0xac89, 0xac8a, 0xac8b, 0xac8c, 0xac90, 0xac94, 0xac9c, 0xac9d, 0xac9f, 0xaca0, 0xaca1, 0xaca8, 0xaca9, 0xacaa, 0xacac, 0xacaf, 0xacb0, 0xacb8, 0xacb9, 0xacbb, 0xacbc, 0xacbd, 0xacc1, 0xacc4, 0xacc8, 0xaccc, 0xacd5, 0xacd7, 0xace0, 0xace1, 0xace4, 0xace7, 0xace8, 0xacea, 0xacec, 0xacef, 0xacf0, 0xacf1, 0xacf3, 0xacf5, 0xacf6, 0xacfc, 0xacfd, 0xad00, 0xad04, 0xad06, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb140[ 192 ] = { 0xfffd, 0xcf02, 0xcf03, 0xcf05, 0xcf06, 0xcf07, 0xcf09, 0xcf0a, 0xcf0b, 0xcf0c, 0xcf0d, 0xcf0e, 0xcf0f, 0xcf12, 0xcf14, 0xcf16, 0xcf17, 0xcf18, 0xcf19, 0xcf1a, 0xcf1b, 0xcf1d, 0xcf1e, 0xcf1f, 0xcf21, 0xcf22, 0xcf23, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcf25, 0xcf26, 0xcf27, 0xcf28, 0xcf29, 0xcf2a, 0xcf2b, 0xcf2e, 0xcf32, 0xcf33, 0xcf34, 0xcf35, 0xcf36, 0xcf37, 0xcf39, 0xcf3a, 0xcf3b, 0xcf3c, 0xcf3d, 0xcf3e, 0xcf3f, 0xcf40, 0xcf41, 0xcf42, 0xcf43, 0xcf44, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcf45, 0xcf46, 0xcf47, 0xcf48, 0xcf49, 0xcf4a, 0xcf4b, 0xcf4c, 0xcf4d, 0xcf4e, 0xcf4f, 0xcf50, 0xcf51, 0xcf52, 0xcf53, 0xcf56, 0xcf57, 0xcf59, 0xcf5a, 0xcf5b, 0xcf5d, 0xcf5e, 0xcf5f, 0xcf60, 0xcf61, 0xcf62, 0xcf63, 0xcf66, 0xcf68, 0xcf6a, 0xcf6b, 0xcf6c, 0xad0c, 0xad0d, 0xad0f, 0xad11, 0xad18, 0xad1c, 0xad20, 0xad29, 0xad2c, 0xad2d, 0xad34, 0xad35, 0xad38, 0xad3c, 0xad44, 0xad45, 0xad47, 0xad49, 0xad50, 0xad54, 0xad58, 0xad61, 0xad63, 0xad6c, 0xad6d, 0xad70, 0xad73, 0xad74, 0xad75, 0xad76, 0xad7b, 0xad7c, 0xad7d, 0xad7f, 0xad81, 0xad82, 0xad88, 0xad89, 0xad8c, 0xad90, 0xad9c, 0xad9d, 0xada4, 0xadb7, 0xadc0, 0xadc1, 0xadc4, 0xadc8, 0xadd0, 0xadd1, 0xadd3, 0xaddc, 0xade0, 0xade4, 0xadf8, 0xadf9, 0xadfc, 0xadff, 0xae00, 0xae01, 0xae08, 0xae09, 0xae0b, 0xae0d, 0xae14, 0xae30, 0xae31, 0xae34, 0xae37, 0xae38, 0xae3a, 0xae40, 0xae41, 0xae43, 0xae45, 0xae46, 0xae4a, 0xae4c, 0xae4d, 0xae4e, 0xae50, 0xae54, 0xae56, 0xae5c, 0xae5d, 0xae5f, 0xae60, 0xae61, 0xae65, 0xae68, 0xae69, 0xae6c, 0xae70, 0xae78, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb240[ 192 ] = { 0xfffd, 0xcf6d, 0xcf6e, 0xcf6f, 0xcf72, 0xcf73, 0xcf75, 0xcf76, 0xcf77, 0xcf79, 0xcf7a, 0xcf7b, 0xcf7c, 0xcf7d, 0xcf7e, 0xcf7f, 0xcf81, 0xcf82, 0xcf83, 0xcf84, 0xcf86, 0xcf87, 0xcf88, 0xcf89, 0xcf8a, 0xcf8b, 0xcf8d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcf8e, 0xcf8f, 0xcf90, 0xcf91, 0xcf92, 0xcf93, 0xcf94, 0xcf95, 0xcf96, 0xcf97, 0xcf98, 0xcf99, 0xcf9a, 0xcf9b, 0xcf9c, 0xcf9d, 0xcf9e, 0xcf9f, 0xcfa0, 0xcfa2, 0xcfa3, 0xcfa4, 0xcfa5, 0xcfa6, 0xcfa7, 0xcfa9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcfaa, 0xcfab, 0xcfac, 0xcfad, 0xcfae, 0xcfaf, 0xcfb1, 0xcfb2, 0xcfb3, 0xcfb4, 0xcfb5, 0xcfb6, 0xcfb7, 0xcfb8, 0xcfb9, 0xcfba, 0xcfbb, 0xcfbc, 0xcfbd, 0xcfbe, 0xcfbf, 0xcfc0, 0xcfc1, 0xcfc2, 0xcfc3, 0xcfc5, 0xcfc6, 0xcfc7, 0xcfc8, 0xcfc9, 0xcfca, 0xcfcb, 0xae79, 0xae7b, 0xae7c, 0xae7d, 0xae84, 0xae85, 0xae8c, 0xaebc, 0xaebd, 0xaebe, 0xaec0, 0xaec4, 0xaecc, 0xaecd, 0xaecf, 0xaed0, 0xaed1, 0xaed8, 0xaed9, 0xaedc, 0xaee8, 0xaeeb, 0xaeed, 0xaef4, 0xaef8, 0xaefc, 0xaf07, 0xaf08, 0xaf0d, 0xaf10, 0xaf2c, 0xaf2d, 0xaf30, 0xaf32, 0xaf34, 0xaf3c, 0xaf3d, 0xaf3f, 0xaf41, 0xaf42, 0xaf43, 0xaf48, 0xaf49, 0xaf50, 0xaf5c, 0xaf5d, 0xaf64, 0xaf65, 0xaf79, 0xaf80, 0xaf84, 0xaf88, 0xaf90, 0xaf91, 0xaf95, 0xaf9c, 0xafb8, 0xafb9, 0xafbc, 0xafc0, 0xafc7, 0xafc8, 0xafc9, 0xafcb, 0xafcd, 0xafce, 0xafd4, 0xafdc, 0xafe8, 0xafe9, 0xaff0, 0xaff1, 0xaff4, 0xaff8, 0xb000, 0xb001, 0xb004, 0xb00c, 0xb010, 0xb014, 0xb01c, 0xb01d, 0xb028, 0xb044, 0xb045, 0xb048, 0xb04a, 0xb04c, 0xb04e, 0xb053, 0xb054, 0xb055, 0xb057, 0xb059, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb340[ 192 ] = { 0xfffd, 0xcfcc, 0xcfcd, 0xcfce, 0xcfcf, 0xcfd0, 0xcfd1, 0xcfd2, 0xcfd3, 0xcfd4, 0xcfd5, 0xcfd6, 0xcfd7, 0xcfd8, 0xcfd9, 0xcfda, 0xcfdb, 0xcfdc, 0xcfdd, 0xcfde, 0xcfdf, 0xcfe2, 0xcfe3, 0xcfe5, 0xcfe6, 0xcfe7, 0xcfe9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xcfea, 0xcfeb, 0xcfec, 0xcfed, 0xcfee, 0xcfef, 0xcff2, 0xcff4, 0xcff6, 0xcff7, 0xcff8, 0xcff9, 0xcffa, 0xcffb, 0xcffd, 0xcffe, 0xcfff, 0xd001, 0xd002, 0xd003, 0xd005, 0xd006, 0xd007, 0xd008, 0xd009, 0xd00a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd00b, 0xd00c, 0xd00d, 0xd00e, 0xd00f, 0xd010, 0xd012, 0xd013, 0xd014, 0xd015, 0xd016, 0xd017, 0xd019, 0xd01a, 0xd01b, 0xd01c, 0xd01d, 0xd01e, 0xd01f, 0xd020, 0xd021, 0xd022, 0xd023, 0xd024, 0xd025, 0xd026, 0xd027, 0xd028, 0xd029, 0xd02a, 0xd02b, 0xd02c, 0xb05d, 0xb07c, 0xb07d, 0xb080, 0xb084, 0xb08c, 0xb08d, 0xb08f, 0xb091, 0xb098, 0xb099, 0xb09a, 0xb09c, 0xb09f, 0xb0a0, 0xb0a1, 0xb0a2, 0xb0a8, 0xb0a9, 0xb0ab, 0xb0ac, 0xb0ad, 0xb0ae, 0xb0af, 0xb0b1, 0xb0b3, 0xb0b4, 0xb0b5, 0xb0b8, 0xb0bc, 0xb0c4, 0xb0c5, 0xb0c7, 0xb0c8, 0xb0c9, 0xb0d0, 0xb0d1, 0xb0d4, 0xb0d8, 0xb0e0, 0xb0e5, 0xb108, 0xb109, 0xb10b, 0xb10c, 0xb110, 0xb112, 0xb113, 0xb118, 0xb119, 0xb11b, 0xb11c, 0xb11d, 0xb123, 0xb124, 0xb125, 0xb128, 0xb12c, 0xb134, 0xb135, 0xb137, 0xb138, 0xb139, 0xb140, 0xb141, 0xb144, 0xb148, 0xb150, 0xb151, 0xb154, 0xb155, 0xb158, 0xb15c, 0xb160, 0xb178, 0xb179, 0xb17c, 0xb180, 0xb182, 0xb188, 0xb189, 0xb18b, 0xb18d, 0xb192, 0xb193, 0xb194, 0xb198, 0xb19c, 0xb1a8, 0xb1cc, 0xb1d0, 0xb1d4, 0xb1dc, 0xb1dd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb440[ 192 ] = { 0xfffd, 0xd02e, 0xd02f, 0xd030, 0xd031, 0xd032, 0xd033, 0xd036, 0xd037, 0xd039, 0xd03a, 0xd03b, 0xd03d, 0xd03e, 0xd03f, 0xd040, 0xd041, 0xd042, 0xd043, 0xd046, 0xd048, 0xd04a, 0xd04b, 0xd04c, 0xd04d, 0xd04e, 0xd04f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd051, 0xd052, 0xd053, 0xd055, 0xd056, 0xd057, 0xd059, 0xd05a, 0xd05b, 0xd05c, 0xd05d, 0xd05e, 0xd05f, 0xd061, 0xd062, 0xd063, 0xd064, 0xd065, 0xd066, 0xd067, 0xd068, 0xd069, 0xd06a, 0xd06b, 0xd06e, 0xd06f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd071, 0xd072, 0xd073, 0xd075, 0xd076, 0xd077, 0xd078, 0xd079, 0xd07a, 0xd07b, 0xd07e, 0xd07f, 0xd080, 0xd082, 0xd083, 0xd084, 0xd085, 0xd086, 0xd087, 0xd088, 0xd089, 0xd08a, 0xd08b, 0xd08c, 0xd08d, 0xd08e, 0xd08f, 0xd090, 0xd091, 0xd092, 0xd093, 0xd094, 0xb1df, 0xb1e8, 0xb1e9, 0xb1ec, 0xb1f0, 0xb1f9, 0xb1fb, 0xb1fd, 0xb204, 0xb205, 0xb208, 0xb20b, 0xb20c, 0xb214, 0xb215, 0xb217, 0xb219, 0xb220, 0xb234, 0xb23c, 0xb258, 0xb25c, 0xb260, 0xb268, 0xb269, 0xb274, 0xb275, 0xb27c, 0xb284, 0xb285, 0xb289, 0xb290, 0xb291, 0xb294, 0xb298, 0xb299, 0xb29a, 0xb2a0, 0xb2a1, 0xb2a3, 0xb2a5, 0xb2a6, 0xb2aa, 0xb2ac, 0xb2b0, 0xb2b4, 0xb2c8, 0xb2c9, 0xb2cc, 0xb2d0, 0xb2d2, 0xb2d8, 0xb2d9, 0xb2db, 0xb2dd, 0xb2e2, 0xb2e4, 0xb2e5, 0xb2e6, 0xb2e8, 0xb2eb, 0xb2ec, 0xb2ed, 0xb2ee, 0xb2ef, 0xb2f3, 0xb2f4, 0xb2f5, 0xb2f7, 0xb2f8, 0xb2f9, 0xb2fa, 0xb2fb, 0xb2ff, 0xb300, 0xb301, 0xb304, 0xb308, 0xb310, 0xb311, 0xb313, 0xb314, 0xb315, 0xb31c, 0xb354, 0xb355, 0xb356, 0xb358, 0xb35b, 0xb35c, 0xb35e, 0xb35f, 0xb364, 0xb365, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb540[ 192 ] = { 0xfffd, 0xd095, 0xd096, 0xd097, 0xd098, 0xd099, 0xd09a, 0xd09b, 0xd09c, 0xd09d, 0xd09e, 0xd09f, 0xd0a0, 0xd0a1, 0xd0a2, 0xd0a3, 0xd0a6, 0xd0a7, 0xd0a9, 0xd0aa, 0xd0ab, 0xd0ad, 0xd0ae, 0xd0af, 0xd0b0, 0xd0b1, 0xd0b2, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd0b3, 0xd0b6, 0xd0b8, 0xd0ba, 0xd0bb, 0xd0bc, 0xd0bd, 0xd0be, 0xd0bf, 0xd0c2, 0xd0c3, 0xd0c5, 0xd0c6, 0xd0c7, 0xd0ca, 0xd0cb, 0xd0cc, 0xd0cd, 0xd0ce, 0xd0cf, 0xd0d2, 0xd0d6, 0xd0d7, 0xd0d8, 0xd0d9, 0xd0da, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd0db, 0xd0de, 0xd0df, 0xd0e1, 0xd0e2, 0xd0e3, 0xd0e5, 0xd0e6, 0xd0e7, 0xd0e8, 0xd0e9, 0xd0ea, 0xd0eb, 0xd0ee, 0xd0f2, 0xd0f3, 0xd0f4, 0xd0f5, 0xd0f6, 0xd0f7, 0xd0f9, 0xd0fa, 0xd0fb, 0xd0fc, 0xd0fd, 0xd0fe, 0xd0ff, 0xd100, 0xd101, 0xd102, 0xd103, 0xd104, 0xb367, 0xb369, 0xb36b, 0xb36e, 0xb370, 0xb371, 0xb374, 0xb378, 0xb380, 0xb381, 0xb383, 0xb384, 0xb385, 0xb38c, 0xb390, 0xb394, 0xb3a0, 0xb3a1, 0xb3a8, 0xb3ac, 0xb3c4, 0xb3c5, 0xb3c8, 0xb3cb, 0xb3cc, 0xb3ce, 0xb3d0, 0xb3d4, 0xb3d5, 0xb3d7, 0xb3d9, 0xb3db, 0xb3dd, 0xb3e0, 0xb3e4, 0xb3e8, 0xb3fc, 0xb410, 0xb418, 0xb41c, 0xb420, 0xb428, 0xb429, 0xb42b, 0xb434, 0xb450, 0xb451, 0xb454, 0xb458, 0xb460, 0xb461, 0xb463, 0xb465, 0xb46c, 0xb480, 0xb488, 0xb49d, 0xb4a4, 0xb4a8, 0xb4ac, 0xb4b5, 0xb4b7, 0xb4b9, 0xb4c0, 0xb4c4, 0xb4c8, 0xb4d0, 0xb4d5, 0xb4dc, 0xb4dd, 0xb4e0, 0xb4e3, 0xb4e4, 0xb4e6, 0xb4ec, 0xb4ed, 0xb4ef, 0xb4f1, 0xb4f8, 0xb514, 0xb515, 0xb518, 0xb51b, 0xb51c, 0xb524, 0xb525, 0xb527, 0xb528, 0xb529, 0xb52a, 0xb530, 0xb531, 0xb534, 0xb538, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb640[ 192 ] = { 0xfffd, 0xd105, 0xd106, 0xd107, 0xd108, 0xd109, 0xd10a, 0xd10b, 0xd10c, 0xd10e, 0xd10f, 0xd110, 0xd111, 0xd112, 0xd113, 0xd114, 0xd115, 0xd116, 0xd117, 0xd118, 0xd119, 0xd11a, 0xd11b, 0xd11c, 0xd11d, 0xd11e, 0xd11f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd120, 0xd121, 0xd122, 0xd123, 0xd124, 0xd125, 0xd126, 0xd127, 0xd128, 0xd129, 0xd12a, 0xd12b, 0xd12c, 0xd12d, 0xd12e, 0xd12f, 0xd132, 0xd133, 0xd135, 0xd136, 0xd137, 0xd139, 0xd13b, 0xd13c, 0xd13d, 0xd13e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd13f, 0xd142, 0xd146, 0xd147, 0xd148, 0xd149, 0xd14a, 0xd14b, 0xd14e, 0xd14f, 0xd151, 0xd152, 0xd153, 0xd155, 0xd156, 0xd157, 0xd158, 0xd159, 0xd15a, 0xd15b, 0xd15e, 0xd160, 0xd162, 0xd163, 0xd164, 0xd165, 0xd166, 0xd167, 0xd169, 0xd16a, 0xd16b, 0xd16d, 0xb540, 0xb541, 0xb543, 0xb544, 0xb545, 0xb54b, 0xb54c, 0xb54d, 0xb550, 0xb554, 0xb55c, 0xb55d, 0xb55f, 0xb560, 0xb561, 0xb5a0, 0xb5a1, 0xb5a4, 0xb5a8, 0xb5aa, 0xb5ab, 0xb5b0, 0xb5b1, 0xb5b3, 0xb5b4, 0xb5b5, 0xb5bb, 0xb5bc, 0xb5bd, 0xb5c0, 0xb5c4, 0xb5cc, 0xb5cd, 0xb5cf, 0xb5d0, 0xb5d1, 0xb5d8, 0xb5ec, 0xb610, 0xb611, 0xb614, 0xb618, 0xb625, 0xb62c, 0xb634, 0xb648, 0xb664, 0xb668, 0xb69c, 0xb69d, 0xb6a0, 0xb6a4, 0xb6ab, 0xb6ac, 0xb6b1, 0xb6d4, 0xb6f0, 0xb6f4, 0xb6f8, 0xb700, 0xb701, 0xb705, 0xb728, 0xb729, 0xb72c, 0xb72f, 0xb730, 0xb738, 0xb739, 0xb73b, 0xb744, 0xb748, 0xb74c, 0xb754, 0xb755, 0xb760, 0xb764, 0xb768, 0xb770, 0xb771, 0xb773, 0xb775, 0xb77c, 0xb77d, 0xb780, 0xb784, 0xb78c, 0xb78d, 0xb78f, 0xb790, 0xb791, 0xb792, 0xb796, 0xb797, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb740[ 192 ] = { 0xfffd, 0xd16e, 0xd16f, 0xd170, 0xd171, 0xd172, 0xd173, 0xd174, 0xd175, 0xd176, 0xd177, 0xd178, 0xd179, 0xd17a, 0xd17b, 0xd17d, 0xd17e, 0xd17f, 0xd180, 0xd181, 0xd182, 0xd183, 0xd185, 0xd186, 0xd187, 0xd189, 0xd18a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd18b, 0xd18c, 0xd18d, 0xd18e, 0xd18f, 0xd190, 0xd191, 0xd192, 0xd193, 0xd194, 0xd195, 0xd196, 0xd197, 0xd198, 0xd199, 0xd19a, 0xd19b, 0xd19c, 0xd19d, 0xd19e, 0xd19f, 0xd1a2, 0xd1a3, 0xd1a5, 0xd1a6, 0xd1a7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd1a9, 0xd1aa, 0xd1ab, 0xd1ac, 0xd1ad, 0xd1ae, 0xd1af, 0xd1b2, 0xd1b4, 0xd1b6, 0xd1b7, 0xd1b8, 0xd1b9, 0xd1bb, 0xd1bd, 0xd1be, 0xd1bf, 0xd1c1, 0xd1c2, 0xd1c3, 0xd1c4, 0xd1c5, 0xd1c6, 0xd1c7, 0xd1c8, 0xd1c9, 0xd1ca, 0xd1cb, 0xd1cc, 0xd1cd, 0xd1ce, 0xd1cf, 0xb798, 0xb799, 0xb79c, 0xb7a0, 0xb7a8, 0xb7a9, 0xb7ab, 0xb7ac, 0xb7ad, 0xb7b4, 0xb7b5, 0xb7b8, 0xb7c7, 0xb7c9, 0xb7ec, 0xb7ed, 0xb7f0, 0xb7f4, 0xb7fc, 0xb7fd, 0xb7ff, 0xb800, 0xb801, 0xb807, 0xb808, 0xb809, 0xb80c, 0xb810, 0xb818, 0xb819, 0xb81b, 0xb81d, 0xb824, 0xb825, 0xb828, 0xb82c, 0xb834, 0xb835, 0xb837, 0xb838, 0xb839, 0xb840, 0xb844, 0xb851, 0xb853, 0xb85c, 0xb85d, 0xb860, 0xb864, 0xb86c, 0xb86d, 0xb86f, 0xb871, 0xb878, 0xb87c, 0xb88d, 0xb8a8, 0xb8b0, 0xb8b4, 0xb8b8, 0xb8c0, 0xb8c1, 0xb8c3, 0xb8c5, 0xb8cc, 0xb8d0, 0xb8d4, 0xb8dd, 0xb8df, 0xb8e1, 0xb8e8, 0xb8e9, 0xb8ec, 0xb8f0, 0xb8f8, 0xb8f9, 0xb8fb, 0xb8fd, 0xb904, 0xb918, 0xb920, 0xb93c, 0xb93d, 0xb940, 0xb944, 0xb94c, 0xb94f, 0xb951, 0xb958, 0xb959, 0xb95c, 0xb960, 0xb968, 0xb969, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb840[ 192 ] = { 0xfffd, 0xd1d0, 0xd1d1, 0xd1d2, 0xd1d3, 0xd1d4, 0xd1d5, 0xd1d6, 0xd1d7, 0xd1d9, 0xd1da, 0xd1db, 0xd1dc, 0xd1dd, 0xd1de, 0xd1df, 0xd1e0, 0xd1e1, 0xd1e2, 0xd1e3, 0xd1e4, 0xd1e5, 0xd1e6, 0xd1e7, 0xd1e8, 0xd1e9, 0xd1ea, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd1eb, 0xd1ec, 0xd1ed, 0xd1ee, 0xd1ef, 0xd1f0, 0xd1f1, 0xd1f2, 0xd1f3, 0xd1f5, 0xd1f6, 0xd1f7, 0xd1f9, 0xd1fa, 0xd1fb, 0xd1fc, 0xd1fd, 0xd1fe, 0xd1ff, 0xd200, 0xd201, 0xd202, 0xd203, 0xd204, 0xd205, 0xd206, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd208, 0xd20a, 0xd20b, 0xd20c, 0xd20d, 0xd20e, 0xd20f, 0xd211, 0xd212, 0xd213, 0xd214, 0xd215, 0xd216, 0xd217, 0xd218, 0xd219, 0xd21a, 0xd21b, 0xd21c, 0xd21d, 0xd21e, 0xd21f, 0xd220, 0xd221, 0xd222, 0xd223, 0xd224, 0xd225, 0xd226, 0xd227, 0xd228, 0xd229, 0xb96b, 0xb96d, 0xb974, 0xb975, 0xb978, 0xb97c, 0xb984, 0xb985, 0xb987, 0xb989, 0xb98a, 0xb98d, 0xb98e, 0xb9ac, 0xb9ad, 0xb9b0, 0xb9b4, 0xb9bc, 0xb9bd, 0xb9bf, 0xb9c1, 0xb9c8, 0xb9c9, 0xb9cc, 0xb9ce, 0xb9cf, 0xb9d0, 0xb9d1, 0xb9d2, 0xb9d8, 0xb9d9, 0xb9db, 0xb9dd, 0xb9de, 0xb9e1, 0xb9e3, 0xb9e4, 0xb9e5, 0xb9e8, 0xb9ec, 0xb9f4, 0xb9f5, 0xb9f7, 0xb9f8, 0xb9f9, 0xb9fa, 0xba00, 0xba01, 0xba08, 0xba15, 0xba38, 0xba39, 0xba3c, 0xba40, 0xba42, 0xba48, 0xba49, 0xba4b, 0xba4d, 0xba4e, 0xba53, 0xba54, 0xba55, 0xba58, 0xba5c, 0xba64, 0xba65, 0xba67, 0xba68, 0xba69, 0xba70, 0xba71, 0xba74, 0xba78, 0xba83, 0xba84, 0xba85, 0xba87, 0xba8c, 0xbaa8, 0xbaa9, 0xbaab, 0xbaac, 0xbab0, 0xbab2, 0xbab8, 0xbab9, 0xbabb, 0xbabd, 0xbac4, 0xbac8, 0xbad8, 0xbad9, 0xbafc, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb940[ 192 ] = { 0xfffd, 0xd22a, 0xd22b, 0xd22e, 0xd22f, 0xd231, 0xd232, 0xd233, 0xd235, 0xd236, 0xd237, 0xd238, 0xd239, 0xd23a, 0xd23b, 0xd23e, 0xd240, 0xd242, 0xd243, 0xd244, 0xd245, 0xd246, 0xd247, 0xd249, 0xd24a, 0xd24b, 0xd24c, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd24d, 0xd24e, 0xd24f, 0xd250, 0xd251, 0xd252, 0xd253, 0xd254, 0xd255, 0xd256, 0xd257, 0xd258, 0xd259, 0xd25a, 0xd25b, 0xd25d, 0xd25e, 0xd25f, 0xd260, 0xd261, 0xd262, 0xd263, 0xd265, 0xd266, 0xd267, 0xd268, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd269, 0xd26a, 0xd26b, 0xd26c, 0xd26d, 0xd26e, 0xd26f, 0xd270, 0xd271, 0xd272, 0xd273, 0xd274, 0xd275, 0xd276, 0xd277, 0xd278, 0xd279, 0xd27a, 0xd27b, 0xd27c, 0xd27d, 0xd27e, 0xd27f, 0xd282, 0xd283, 0xd285, 0xd286, 0xd287, 0xd289, 0xd28a, 0xd28b, 0xd28c, 0xbb00, 0xbb04, 0xbb0d, 0xbb0f, 0xbb11, 0xbb18, 0xbb1c, 0xbb20, 0xbb29, 0xbb2b, 0xbb34, 0xbb35, 0xbb36, 0xbb38, 0xbb3b, 0xbb3c, 0xbb3d, 0xbb3e, 0xbb44, 0xbb45, 0xbb47, 0xbb49, 0xbb4d, 0xbb4f, 0xbb50, 0xbb54, 0xbb58, 0xbb61, 0xbb63, 0xbb6c, 0xbb88, 0xbb8c, 0xbb90, 0xbba4, 0xbba8, 0xbbac, 0xbbb4, 0xbbb7, 0xbbc0, 0xbbc4, 0xbbc8, 0xbbd0, 0xbbd3, 0xbbf8, 0xbbf9, 0xbbfc, 0xbbff, 0xbc00, 0xbc02, 0xbc08, 0xbc09, 0xbc0b, 0xbc0c, 0xbc0d, 0xbc0f, 0xbc11, 0xbc14, 0xbc15, 0xbc16, 0xbc17, 0xbc18, 0xbc1b, 0xbc1c, 0xbc1d, 0xbc1e, 0xbc1f, 0xbc24, 0xbc25, 0xbc27, 0xbc29, 0xbc2d, 0xbc30, 0xbc31, 0xbc34, 0xbc38, 0xbc40, 0xbc41, 0xbc43, 0xbc44, 0xbc45, 0xbc49, 0xbc4c, 0xbc4d, 0xbc50, 0xbc5d, 0xbc84, 0xbc85, 0xbc88, 0xbc8b, 0xbc8c, 0xbc8e, 0xbc94, 0xbc95, 0xbc97, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xba40[ 192 ] = { 0xfffd, 0xd28d, 0xd28e, 0xd28f, 0xd292, 0xd293, 0xd294, 0xd296, 0xd297, 0xd298, 0xd299, 0xd29a, 0xd29b, 0xd29d, 0xd29e, 0xd29f, 0xd2a1, 0xd2a2, 0xd2a3, 0xd2a5, 0xd2a6, 0xd2a7, 0xd2a8, 0xd2a9, 0xd2aa, 0xd2ab, 0xd2ad, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd2ae, 0xd2af, 0xd2b0, 0xd2b2, 0xd2b3, 0xd2b4, 0xd2b5, 0xd2b6, 0xd2b7, 0xd2ba, 0xd2bb, 0xd2bd, 0xd2be, 0xd2c1, 0xd2c3, 0xd2c4, 0xd2c5, 0xd2c6, 0xd2c7, 0xd2ca, 0xd2cc, 0xd2cd, 0xd2ce, 0xd2cf, 0xd2d0, 0xd2d1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd2d2, 0xd2d3, 0xd2d5, 0xd2d6, 0xd2d7, 0xd2d9, 0xd2da, 0xd2db, 0xd2dd, 0xd2de, 0xd2df, 0xd2e0, 0xd2e1, 0xd2e2, 0xd2e3, 0xd2e6, 0xd2e7, 0xd2e8, 0xd2e9, 0xd2ea, 0xd2eb, 0xd2ec, 0xd2ed, 0xd2ee, 0xd2ef, 0xd2f2, 0xd2f3, 0xd2f5, 0xd2f6, 0xd2f7, 0xd2f9, 0xd2fa, 0xbc99, 0xbc9a, 0xbca0, 0xbca1, 0xbca4, 0xbca7, 0xbca8, 0xbcb0, 0xbcb1, 0xbcb3, 0xbcb4, 0xbcb5, 0xbcbc, 0xbcbd, 0xbcc0, 0xbcc4, 0xbccd, 0xbccf, 0xbcd0, 0xbcd1, 0xbcd5, 0xbcd8, 0xbcdc, 0xbcf4, 0xbcf5, 0xbcf6, 0xbcf8, 0xbcfc, 0xbd04, 0xbd05, 0xbd07, 0xbd09, 0xbd10, 0xbd14, 0xbd24, 0xbd2c, 0xbd40, 0xbd48, 0xbd49, 0xbd4c, 0xbd50, 0xbd58, 0xbd59, 0xbd64, 0xbd68, 0xbd80, 0xbd81, 0xbd84, 0xbd87, 0xbd88, 0xbd89, 0xbd8a, 0xbd90, 0xbd91, 0xbd93, 0xbd95, 0xbd99, 0xbd9a, 0xbd9c, 0xbda4, 0xbdb0, 0xbdb8, 0xbdd4, 0xbdd5, 0xbdd8, 0xbddc, 0xbde9, 0xbdf0, 0xbdf4, 0xbdf8, 0xbe00, 0xbe03, 0xbe05, 0xbe0c, 0xbe0d, 0xbe10, 0xbe14, 0xbe1c, 0xbe1d, 0xbe1f, 0xbe44, 0xbe45, 0xbe48, 0xbe4c, 0xbe4e, 0xbe54, 0xbe55, 0xbe57, 0xbe59, 0xbe5a, 0xbe5b, 0xbe60, 0xbe61, 0xbe64, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbb40[ 192 ] = { 0xfffd, 0xd2fb, 0xd2fc, 0xd2fd, 0xd2fe, 0xd2ff, 0xd302, 0xd304, 0xd306, 0xd307, 0xd308, 0xd309, 0xd30a, 0xd30b, 0xd30f, 0xd311, 0xd312, 0xd313, 0xd315, 0xd317, 0xd318, 0xd319, 0xd31a, 0xd31b, 0xd31e, 0xd322, 0xd323, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd324, 0xd326, 0xd327, 0xd32a, 0xd32b, 0xd32d, 0xd32e, 0xd32f, 0xd331, 0xd332, 0xd333, 0xd334, 0xd335, 0xd336, 0xd337, 0xd33a, 0xd33e, 0xd33f, 0xd340, 0xd341, 0xd342, 0xd343, 0xd346, 0xd347, 0xd348, 0xd349, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd34a, 0xd34b, 0xd34c, 0xd34d, 0xd34e, 0xd34f, 0xd350, 0xd351, 0xd352, 0xd353, 0xd354, 0xd355, 0xd356, 0xd357, 0xd358, 0xd359, 0xd35a, 0xd35b, 0xd35c, 0xd35d, 0xd35e, 0xd35f, 0xd360, 0xd361, 0xd362, 0xd363, 0xd364, 0xd365, 0xd366, 0xd367, 0xd368, 0xd369, 0xbe68, 0xbe6a, 0xbe70, 0xbe71, 0xbe73, 0xbe74, 0xbe75, 0xbe7b, 0xbe7c, 0xbe7d, 0xbe80, 0xbe84, 0xbe8c, 0xbe8d, 0xbe8f, 0xbe90, 0xbe91, 0xbe98, 0xbe99, 0xbea8, 0xbed0, 0xbed1, 0xbed4, 0xbed7, 0xbed8, 0xbee0, 0xbee3, 0xbee4, 0xbee5, 0xbeec, 0xbf01, 0xbf08, 0xbf09, 0xbf18, 0xbf19, 0xbf1b, 0xbf1c, 0xbf1d, 0xbf40, 0xbf41, 0xbf44, 0xbf48, 0xbf50, 0xbf51, 0xbf55, 0xbf94, 0xbfb0, 0xbfc5, 0xbfcc, 0xbfcd, 0xbfd0, 0xbfd4, 0xbfdc, 0xbfdf, 0xbfe1, 0xc03c, 0xc051, 0xc058, 0xc05c, 0xc060, 0xc068, 0xc069, 0xc090, 0xc091, 0xc094, 0xc098, 0xc0a0, 0xc0a1, 0xc0a3, 0xc0a5, 0xc0ac, 0xc0ad, 0xc0af, 0xc0b0, 0xc0b3, 0xc0b4, 0xc0b5, 0xc0b6, 0xc0bc, 0xc0bd, 0xc0bf, 0xc0c0, 0xc0c1, 0xc0c5, 0xc0c8, 0xc0c9, 0xc0cc, 0xc0d0, 0xc0d8, 0xc0d9, 0xc0db, 0xc0dc, 0xc0dd, 0xc0e4, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbc40[ 192 ] = { 0xfffd, 0xd36a, 0xd36b, 0xd36c, 0xd36d, 0xd36e, 0xd36f, 0xd370, 0xd371, 0xd372, 0xd373, 0xd374, 0xd375, 0xd376, 0xd377, 0xd378, 0xd379, 0xd37a, 0xd37b, 0xd37e, 0xd37f, 0xd381, 0xd382, 0xd383, 0xd385, 0xd386, 0xd387, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd388, 0xd389, 0xd38a, 0xd38b, 0xd38e, 0xd392, 0xd393, 0xd394, 0xd395, 0xd396, 0xd397, 0xd39a, 0xd39b, 0xd39d, 0xd39e, 0xd39f, 0xd3a1, 0xd3a2, 0xd3a3, 0xd3a4, 0xd3a5, 0xd3a6, 0xd3a7, 0xd3aa, 0xd3ac, 0xd3ae, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd3af, 0xd3b0, 0xd3b1, 0xd3b2, 0xd3b3, 0xd3b5, 0xd3b6, 0xd3b7, 0xd3b9, 0xd3ba, 0xd3bb, 0xd3bd, 0xd3be, 0xd3bf, 0xd3c0, 0xd3c1, 0xd3c2, 0xd3c3, 0xd3c6, 0xd3c7, 0xd3ca, 0xd3cb, 0xd3cc, 0xd3cd, 0xd3ce, 0xd3cf, 0xd3d1, 0xd3d2, 0xd3d3, 0xd3d4, 0xd3d5, 0xd3d6, 0xc0e5, 0xc0e8, 0xc0ec, 0xc0f4, 0xc0f5, 0xc0f7, 0xc0f9, 0xc100, 0xc104, 0xc108, 0xc110, 0xc115, 0xc11c, 0xc11d, 0xc11e, 0xc11f, 0xc120, 0xc123, 0xc124, 0xc126, 0xc127, 0xc12c, 0xc12d, 0xc12f, 0xc130, 0xc131, 0xc136, 0xc138, 0xc139, 0xc13c, 0xc140, 0xc148, 0xc149, 0xc14b, 0xc14c, 0xc14d, 0xc154, 0xc155, 0xc158, 0xc15c, 0xc164, 0xc165, 0xc167, 0xc168, 0xc169, 0xc170, 0xc174, 0xc178, 0xc185, 0xc18c, 0xc18d, 0xc18e, 0xc190, 0xc194, 0xc196, 0xc19c, 0xc19d, 0xc19f, 0xc1a1, 0xc1a5, 0xc1a8, 0xc1a9, 0xc1ac, 0xc1b0, 0xc1bd, 0xc1c4, 0xc1c8, 0xc1cc, 0xc1d4, 0xc1d7, 0xc1d8, 0xc1e0, 0xc1e4, 0xc1e8, 0xc1f0, 0xc1f1, 0xc1f3, 0xc1fc, 0xc1fd, 0xc200, 0xc204, 0xc20c, 0xc20d, 0xc20f, 0xc211, 0xc218, 0xc219, 0xc21c, 0xc21f, 0xc220, 0xc228, 0xc229, 0xc22b, 0xc22d, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbd40[ 192 ] = { 0xfffd, 0xd3d7, 0xd3d9, 0xd3da, 0xd3db, 0xd3dc, 0xd3dd, 0xd3de, 0xd3df, 0xd3e0, 0xd3e2, 0xd3e4, 0xd3e5, 0xd3e6, 0xd3e7, 0xd3e8, 0xd3e9, 0xd3ea, 0xd3eb, 0xd3ee, 0xd3ef, 0xd3f1, 0xd3f2, 0xd3f3, 0xd3f5, 0xd3f6, 0xd3f7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd3f8, 0xd3f9, 0xd3fa, 0xd3fb, 0xd3fe, 0xd400, 0xd402, 0xd403, 0xd404, 0xd405, 0xd406, 0xd407, 0xd409, 0xd40a, 0xd40b, 0xd40c, 0xd40d, 0xd40e, 0xd40f, 0xd410, 0xd411, 0xd412, 0xd413, 0xd414, 0xd415, 0xd416, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd417, 0xd418, 0xd419, 0xd41a, 0xd41b, 0xd41c, 0xd41e, 0xd41f, 0xd420, 0xd421, 0xd422, 0xd423, 0xd424, 0xd425, 0xd426, 0xd427, 0xd428, 0xd429, 0xd42a, 0xd42b, 0xd42c, 0xd42d, 0xd42e, 0xd42f, 0xd430, 0xd431, 0xd432, 0xd433, 0xd434, 0xd435, 0xd436, 0xd437, 0xc22f, 0xc231, 0xc232, 0xc234, 0xc248, 0xc250, 0xc251, 0xc254, 0xc258, 0xc260, 0xc265, 0xc26c, 0xc26d, 0xc270, 0xc274, 0xc27c, 0xc27d, 0xc27f, 0xc281, 0xc288, 0xc289, 0xc290, 0xc298, 0xc29b, 0xc29d, 0xc2a4, 0xc2a5, 0xc2a8, 0xc2ac, 0xc2ad, 0xc2b4, 0xc2b5, 0xc2b7, 0xc2b9, 0xc2dc, 0xc2dd, 0xc2e0, 0xc2e3, 0xc2e4, 0xc2eb, 0xc2ec, 0xc2ed, 0xc2ef, 0xc2f1, 0xc2f6, 0xc2f8, 0xc2f9, 0xc2fb, 0xc2fc, 0xc300, 0xc308, 0xc309, 0xc30c, 0xc30d, 0xc313, 0xc314, 0xc315, 0xc318, 0xc31c, 0xc324, 0xc325, 0xc328, 0xc329, 0xc345, 0xc368, 0xc369, 0xc36c, 0xc370, 0xc372, 0xc378, 0xc379, 0xc37c, 0xc37d, 0xc384, 0xc388, 0xc38c, 0xc3c0, 0xc3d8, 0xc3d9, 0xc3dc, 0xc3df, 0xc3e0, 0xc3e2, 0xc3e8, 0xc3e9, 0xc3ed, 0xc3f4, 0xc3f5, 0xc3f8, 0xc408, 0xc410, 0xc424, 0xc42c, 0xc430, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbe40[ 192 ] = { 0xfffd, 0xd438, 0xd439, 0xd43a, 0xd43b, 0xd43c, 0xd43d, 0xd43e, 0xd43f, 0xd441, 0xd442, 0xd443, 0xd445, 0xd446, 0xd447, 0xd448, 0xd449, 0xd44a, 0xd44b, 0xd44c, 0xd44d, 0xd44e, 0xd44f, 0xd450, 0xd451, 0xd452, 0xd453, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd454, 0xd455, 0xd456, 0xd457, 0xd458, 0xd459, 0xd45a, 0xd45b, 0xd45d, 0xd45e, 0xd45f, 0xd461, 0xd462, 0xd463, 0xd465, 0xd466, 0xd467, 0xd468, 0xd469, 0xd46a, 0xd46b, 0xd46c, 0xd46e, 0xd470, 0xd471, 0xd472, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd473, 0xd474, 0xd475, 0xd476, 0xd477, 0xd47a, 0xd47b, 0xd47d, 0xd47e, 0xd481, 0xd483, 0xd484, 0xd485, 0xd486, 0xd487, 0xd48a, 0xd48c, 0xd48e, 0xd48f, 0xd490, 0xd491, 0xd492, 0xd493, 0xd495, 0xd496, 0xd497, 0xd498, 0xd499, 0xd49a, 0xd49b, 0xd49c, 0xd49d, 0xc434, 0xc43c, 0xc43d, 0xc448, 0xc464, 0xc465, 0xc468, 0xc46c, 0xc474, 0xc475, 0xc479, 0xc480, 0xc494, 0xc49c, 0xc4b8, 0xc4bc, 0xc4e9, 0xc4f0, 0xc4f1, 0xc4f4, 0xc4f8, 0xc4fa, 0xc4ff, 0xc500, 0xc501, 0xc50c, 0xc510, 0xc514, 0xc51c, 0xc528, 0xc529, 0xc52c, 0xc530, 0xc538, 0xc539, 0xc53b, 0xc53d, 0xc544, 0xc545, 0xc548, 0xc549, 0xc54a, 0xc54c, 0xc54d, 0xc54e, 0xc553, 0xc554, 0xc555, 0xc557, 0xc558, 0xc559, 0xc55d, 0xc55e, 0xc560, 0xc561, 0xc564, 0xc568, 0xc570, 0xc571, 0xc573, 0xc574, 0xc575, 0xc57c, 0xc57d, 0xc580, 0xc584, 0xc587, 0xc58c, 0xc58d, 0xc58f, 0xc591, 0xc595, 0xc597, 0xc598, 0xc59c, 0xc5a0, 0xc5a9, 0xc5b4, 0xc5b5, 0xc5b8, 0xc5b9, 0xc5bb, 0xc5bc, 0xc5bd, 0xc5be, 0xc5c4, 0xc5c5, 0xc5c6, 0xc5c7, 0xc5c8, 0xc5c9, 0xc5ca, 0xc5cc, 0xc5ce, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbf40[ 192 ] = { 0xfffd, 0xd49e, 0xd49f, 0xd4a0, 0xd4a1, 0xd4a2, 0xd4a3, 0xd4a4, 0xd4a5, 0xd4a6, 0xd4a7, 0xd4a8, 0xd4aa, 0xd4ab, 0xd4ac, 0xd4ad, 0xd4ae, 0xd4af, 0xd4b0, 0xd4b1, 0xd4b2, 0xd4b3, 0xd4b4, 0xd4b5, 0xd4b6, 0xd4b7, 0xd4b8, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd4b9, 0xd4ba, 0xd4bb, 0xd4bc, 0xd4bd, 0xd4be, 0xd4bf, 0xd4c0, 0xd4c1, 0xd4c2, 0xd4c3, 0xd4c4, 0xd4c5, 0xd4c6, 0xd4c7, 0xd4c8, 0xd4c9, 0xd4ca, 0xd4cb, 0xd4cd, 0xd4ce, 0xd4cf, 0xd4d1, 0xd4d2, 0xd4d3, 0xd4d5, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd4d6, 0xd4d7, 0xd4d8, 0xd4d9, 0xd4da, 0xd4db, 0xd4dd, 0xd4de, 0xd4e0, 0xd4e1, 0xd4e2, 0xd4e3, 0xd4e4, 0xd4e5, 0xd4e6, 0xd4e7, 0xd4e9, 0xd4ea, 0xd4eb, 0xd4ed, 0xd4ee, 0xd4ef, 0xd4f1, 0xd4f2, 0xd4f3, 0xd4f4, 0xd4f5, 0xd4f6, 0xd4f7, 0xd4f9, 0xd4fa, 0xd4fc, 0xc5d0, 0xc5d1, 0xc5d4, 0xc5d8, 0xc5e0, 0xc5e1, 0xc5e3, 0xc5e5, 0xc5ec, 0xc5ed, 0xc5ee, 0xc5f0, 0xc5f4, 0xc5f6, 0xc5f7, 0xc5fc, 0xc5fd, 0xc5fe, 0xc5ff, 0xc600, 0xc601, 0xc605, 0xc606, 0xc607, 0xc608, 0xc60c, 0xc610, 0xc618, 0xc619, 0xc61b, 0xc61c, 0xc624, 0xc625, 0xc628, 0xc62c, 0xc62d, 0xc62e, 0xc630, 0xc633, 0xc634, 0xc635, 0xc637, 0xc639, 0xc63b, 0xc640, 0xc641, 0xc644, 0xc648, 0xc650, 0xc651, 0xc653, 0xc654, 0xc655, 0xc65c, 0xc65d, 0xc660, 0xc66c, 0xc66f, 0xc671, 0xc678, 0xc679, 0xc67c, 0xc680, 0xc688, 0xc689, 0xc68b, 0xc68d, 0xc694, 0xc695, 0xc698, 0xc69c, 0xc6a4, 0xc6a5, 0xc6a7, 0xc6a9, 0xc6b0, 0xc6b1, 0xc6b4, 0xc6b8, 0xc6b9, 0xc6ba, 0xc6c0, 0xc6c1, 0xc6c3, 0xc6c5, 0xc6cc, 0xc6cd, 0xc6d0, 0xc6d4, 0xc6dc, 0xc6dd, 0xc6e0, 0xc6e1, 0xc6e8, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc040[ 192 ] = { 0xfffd, 0xd4fe, 0xd4ff, 0xd500, 0xd501, 0xd502, 0xd503, 0xd505, 0xd506, 0xd507, 0xd509, 0xd50a, 0xd50b, 0xd50d, 0xd50e, 0xd50f, 0xd510, 0xd511, 0xd512, 0xd513, 0xd516, 0xd518, 0xd519, 0xd51a, 0xd51b, 0xd51c, 0xd51d, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd51e, 0xd51f, 0xd520, 0xd521, 0xd522, 0xd523, 0xd524, 0xd525, 0xd526, 0xd527, 0xd528, 0xd529, 0xd52a, 0xd52b, 0xd52c, 0xd52d, 0xd52e, 0xd52f, 0xd530, 0xd531, 0xd532, 0xd533, 0xd534, 0xd535, 0xd536, 0xd537, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd538, 0xd539, 0xd53a, 0xd53b, 0xd53e, 0xd53f, 0xd541, 0xd542, 0xd543, 0xd545, 0xd546, 0xd547, 0xd548, 0xd549, 0xd54a, 0xd54b, 0xd54e, 0xd550, 0xd552, 0xd553, 0xd554, 0xd555, 0xd556, 0xd557, 0xd55a, 0xd55b, 0xd55d, 0xd55e, 0xd55f, 0xd561, 0xd562, 0xd563, 0xc6e9, 0xc6ec, 0xc6f0, 0xc6f8, 0xc6f9, 0xc6fd, 0xc704, 0xc705, 0xc708, 0xc70c, 0xc714, 0xc715, 0xc717, 0xc719, 0xc720, 0xc721, 0xc724, 0xc728, 0xc730, 0xc731, 0xc733, 0xc735, 0xc737, 0xc73c, 0xc73d, 0xc740, 0xc744, 0xc74a, 0xc74c, 0xc74d, 0xc74f, 0xc751, 0xc752, 0xc753, 0xc754, 0xc755, 0xc756, 0xc757, 0xc758, 0xc75c, 0xc760, 0xc768, 0xc76b, 0xc774, 0xc775, 0xc778, 0xc77c, 0xc77d, 0xc77e, 0xc783, 0xc784, 0xc785, 0xc787, 0xc788, 0xc789, 0xc78a, 0xc78e, 0xc790, 0xc791, 0xc794, 0xc796, 0xc797, 0xc798, 0xc79a, 0xc7a0, 0xc7a1, 0xc7a3, 0xc7a4, 0xc7a5, 0xc7a6, 0xc7ac, 0xc7ad, 0xc7b0, 0xc7b4, 0xc7bc, 0xc7bd, 0xc7bf, 0xc7c0, 0xc7c1, 0xc7c8, 0xc7c9, 0xc7cc, 0xc7ce, 0xc7d0, 0xc7d8, 0xc7dd, 0xc7e4, 0xc7e8, 0xc7ec, 0xc800, 0xc801, 0xc804, 0xc808, 0xc80a, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc140[ 192 ] = { 0xfffd, 0xd564, 0xd566, 0xd567, 0xd56a, 0xd56c, 0xd56e, 0xd56f, 0xd570, 0xd571, 0xd572, 0xd573, 0xd576, 0xd577, 0xd579, 0xd57a, 0xd57b, 0xd57d, 0xd57e, 0xd57f, 0xd580, 0xd581, 0xd582, 0xd583, 0xd586, 0xd58a, 0xd58b, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd58c, 0xd58d, 0xd58e, 0xd58f, 0xd591, 0xd592, 0xd593, 0xd594, 0xd595, 0xd596, 0xd597, 0xd598, 0xd599, 0xd59a, 0xd59b, 0xd59c, 0xd59d, 0xd59e, 0xd59f, 0xd5a0, 0xd5a1, 0xd5a2, 0xd5a3, 0xd5a4, 0xd5a6, 0xd5a7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd5a8, 0xd5a9, 0xd5aa, 0xd5ab, 0xd5ac, 0xd5ad, 0xd5ae, 0xd5af, 0xd5b0, 0xd5b1, 0xd5b2, 0xd5b3, 0xd5b4, 0xd5b5, 0xd5b6, 0xd5b7, 0xd5b8, 0xd5b9, 0xd5ba, 0xd5bb, 0xd5bc, 0xd5bd, 0xd5be, 0xd5bf, 0xd5c0, 0xd5c1, 0xd5c2, 0xd5c3, 0xd5c4, 0xd5c5, 0xd5c6, 0xd5c7, 0xc810, 0xc811, 0xc813, 0xc815, 0xc816, 0xc81c, 0xc81d, 0xc820, 0xc824, 0xc82c, 0xc82d, 0xc82f, 0xc831, 0xc838, 0xc83c, 0xc840, 0xc848, 0xc849, 0xc84c, 0xc84d, 0xc854, 0xc870, 0xc871, 0xc874, 0xc878, 0xc87a, 0xc880, 0xc881, 0xc883, 0xc885, 0xc886, 0xc887, 0xc88b, 0xc88c, 0xc88d, 0xc894, 0xc89d, 0xc89f, 0xc8a1, 0xc8a8, 0xc8bc, 0xc8bd, 0xc8c4, 0xc8c8, 0xc8cc, 0xc8d4, 0xc8d5, 0xc8d7, 0xc8d9, 0xc8e0, 0xc8e1, 0xc8e4, 0xc8f5, 0xc8fc, 0xc8fd, 0xc900, 0xc904, 0xc905, 0xc906, 0xc90c, 0xc90d, 0xc90f, 0xc911, 0xc918, 0xc92c, 0xc934, 0xc950, 0xc951, 0xc954, 0xc958, 0xc960, 0xc961, 0xc963, 0xc96c, 0xc970, 0xc974, 0xc97c, 0xc988, 0xc989, 0xc98c, 0xc990, 0xc998, 0xc999, 0xc99b, 0xc99d, 0xc9c0, 0xc9c1, 0xc9c4, 0xc9c7, 0xc9c8, 0xc9ca, 0xc9d0, 0xc9d1, 0xc9d3, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc240[ 192 ] = { 0xfffd, 0xd5ca, 0xd5cb, 0xd5cd, 0xd5ce, 0xd5cf, 0xd5d1, 0xd5d3, 0xd5d4, 0xd5d5, 0xd5d6, 0xd5d7, 0xd5da, 0xd5dc, 0xd5de, 0xd5df, 0xd5e0, 0xd5e1, 0xd5e2, 0xd5e3, 0xd5e6, 0xd5e7, 0xd5e9, 0xd5ea, 0xd5eb, 0xd5ed, 0xd5ee, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd5ef, 0xd5f0, 0xd5f1, 0xd5f2, 0xd5f3, 0xd5f6, 0xd5f8, 0xd5fa, 0xd5fb, 0xd5fc, 0xd5fd, 0xd5fe, 0xd5ff, 0xd602, 0xd603, 0xd605, 0xd606, 0xd607, 0xd609, 0xd60a, 0xd60b, 0xd60c, 0xd60d, 0xd60e, 0xd60f, 0xd612, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd616, 0xd617, 0xd618, 0xd619, 0xd61a, 0xd61b, 0xd61d, 0xd61e, 0xd61f, 0xd621, 0xd622, 0xd623, 0xd625, 0xd626, 0xd627, 0xd628, 0xd629, 0xd62a, 0xd62b, 0xd62c, 0xd62e, 0xd62f, 0xd630, 0xd631, 0xd632, 0xd633, 0xd634, 0xd635, 0xd636, 0xd637, 0xd63a, 0xd63b, 0xc9d5, 0xc9d6, 0xc9d9, 0xc9da, 0xc9dc, 0xc9dd, 0xc9e0, 0xc9e2, 0xc9e4, 0xc9e7, 0xc9ec, 0xc9ed, 0xc9ef, 0xc9f0, 0xc9f1, 0xc9f8, 0xc9f9, 0xc9fc, 0xca00, 0xca08, 0xca09, 0xca0b, 0xca0c, 0xca0d, 0xca14, 0xca18, 0xca29, 0xca4c, 0xca4d, 0xca50, 0xca54, 0xca5c, 0xca5d, 0xca5f, 0xca60, 0xca61, 0xca68, 0xca7d, 0xca84, 0xca98, 0xcabc, 0xcabd, 0xcac0, 0xcac4, 0xcacc, 0xcacd, 0xcacf, 0xcad1, 0xcad3, 0xcad8, 0xcad9, 0xcae0, 0xcaec, 0xcaf4, 0xcb08, 0xcb10, 0xcb14, 0xcb18, 0xcb20, 0xcb21, 0xcb41, 0xcb48, 0xcb49, 0xcb4c, 0xcb50, 0xcb58, 0xcb59, 0xcb5d, 0xcb64, 0xcb78, 0xcb79, 0xcb9c, 0xcbb8, 0xcbd4, 0xcbe4, 0xcbe7, 0xcbe9, 0xcc0c, 0xcc0d, 0xcc10, 0xcc14, 0xcc1c, 0xcc1d, 0xcc21, 0xcc22, 0xcc27, 0xcc28, 0xcc29, 0xcc2c, 0xcc2e, 0xcc30, 0xcc38, 0xcc39, 0xcc3b, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc340[ 192 ] = { 0xfffd, 0xd63d, 0xd63e, 0xd63f, 0xd641, 0xd642, 0xd643, 0xd644, 0xd646, 0xd647, 0xd64a, 0xd64c, 0xd64e, 0xd64f, 0xd650, 0xd652, 0xd653, 0xd656, 0xd657, 0xd659, 0xd65a, 0xd65b, 0xd65d, 0xd65e, 0xd65f, 0xd660, 0xd661, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd662, 0xd663, 0xd664, 0xd665, 0xd666, 0xd668, 0xd66a, 0xd66b, 0xd66c, 0xd66d, 0xd66e, 0xd66f, 0xd672, 0xd673, 0xd675, 0xd676, 0xd677, 0xd678, 0xd679, 0xd67a, 0xd67b, 0xd67c, 0xd67d, 0xd67e, 0xd67f, 0xd680, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd681, 0xd682, 0xd684, 0xd686, 0xd687, 0xd688, 0xd689, 0xd68a, 0xd68b, 0xd68e, 0xd68f, 0xd691, 0xd692, 0xd693, 0xd695, 0xd696, 0xd697, 0xd698, 0xd699, 0xd69a, 0xd69b, 0xd69c, 0xd69e, 0xd6a0, 0xd6a2, 0xd6a3, 0xd6a4, 0xd6a5, 0xd6a6, 0xd6a7, 0xd6a9, 0xd6aa, 0xcc3c, 0xcc3d, 0xcc3e, 0xcc44, 0xcc45, 0xcc48, 0xcc4c, 0xcc54, 0xcc55, 0xcc57, 0xcc58, 0xcc59, 0xcc60, 0xcc64, 0xcc66, 0xcc68, 0xcc70, 0xcc75, 0xcc98, 0xcc99, 0xcc9c, 0xcca0, 0xcca8, 0xcca9, 0xccab, 0xccac, 0xccad, 0xccb4, 0xccb5, 0xccb8, 0xccbc, 0xccc4, 0xccc5, 0xccc7, 0xccc9, 0xccd0, 0xccd4, 0xcce4, 0xccec, 0xccf0, 0xcd01, 0xcd08, 0xcd09, 0xcd0c, 0xcd10, 0xcd18, 0xcd19, 0xcd1b, 0xcd1d, 0xcd24, 0xcd28, 0xcd2c, 0xcd39, 0xcd5c, 0xcd60, 0xcd64, 0xcd6c, 0xcd6d, 0xcd6f, 0xcd71, 0xcd78, 0xcd88, 0xcd94, 0xcd95, 0xcd98, 0xcd9c, 0xcda4, 0xcda5, 0xcda7, 0xcda9, 0xcdb0, 0xcdc4, 0xcdcc, 0xcdd0, 0xcde8, 0xcdec, 0xcdf0, 0xcdf8, 0xcdf9, 0xcdfb, 0xcdfd, 0xce04, 0xce08, 0xce0c, 0xce14, 0xce19, 0xce20, 0xce21, 0xce24, 0xce28, 0xce30, 0xce31, 0xce33, 0xce35, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc440[ 192 ] = { 0xfffd, 0xd6ab, 0xd6ad, 0xd6ae, 0xd6af, 0xd6b1, 0xd6b2, 0xd6b3, 0xd6b4, 0xd6b5, 0xd6b6, 0xd6b7, 0xd6b8, 0xd6ba, 0xd6bc, 0xd6bd, 0xd6be, 0xd6bf, 0xd6c0, 0xd6c1, 0xd6c2, 0xd6c3, 0xd6c6, 0xd6c7, 0xd6c9, 0xd6ca, 0xd6cb, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd6cd, 0xd6ce, 0xd6cf, 0xd6d0, 0xd6d2, 0xd6d3, 0xd6d5, 0xd6d6, 0xd6d8, 0xd6da, 0xd6db, 0xd6dc, 0xd6dd, 0xd6de, 0xd6df, 0xd6e1, 0xd6e2, 0xd6e3, 0xd6e5, 0xd6e6, 0xd6e7, 0xd6e9, 0xd6ea, 0xd6eb, 0xd6ec, 0xd6ed, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd6ee, 0xd6ef, 0xd6f1, 0xd6f2, 0xd6f3, 0xd6f4, 0xd6f6, 0xd6f7, 0xd6f8, 0xd6f9, 0xd6fa, 0xd6fb, 0xd6fe, 0xd6ff, 0xd701, 0xd702, 0xd703, 0xd705, 0xd706, 0xd707, 0xd708, 0xd709, 0xd70a, 0xd70b, 0xd70c, 0xd70d, 0xd70e, 0xd70f, 0xd710, 0xd712, 0xd713, 0xd714, 0xce58, 0xce59, 0xce5c, 0xce5f, 0xce60, 0xce61, 0xce68, 0xce69, 0xce6b, 0xce6d, 0xce74, 0xce75, 0xce78, 0xce7c, 0xce84, 0xce85, 0xce87, 0xce89, 0xce90, 0xce91, 0xce94, 0xce98, 0xcea0, 0xcea1, 0xcea3, 0xcea4, 0xcea5, 0xceac, 0xcead, 0xcec1, 0xcee4, 0xcee5, 0xcee8, 0xceeb, 0xceec, 0xcef4, 0xcef5, 0xcef7, 0xcef8, 0xcef9, 0xcf00, 0xcf01, 0xcf04, 0xcf08, 0xcf10, 0xcf11, 0xcf13, 0xcf15, 0xcf1c, 0xcf20, 0xcf24, 0xcf2c, 0xcf2d, 0xcf2f, 0xcf30, 0xcf31, 0xcf38, 0xcf54, 0xcf55, 0xcf58, 0xcf5c, 0xcf64, 0xcf65, 0xcf67, 0xcf69, 0xcf70, 0xcf71, 0xcf74, 0xcf78, 0xcf80, 0xcf85, 0xcf8c, 0xcfa1, 0xcfa8, 0xcfb0, 0xcfc4, 0xcfe0, 0xcfe1, 0xcfe4, 0xcfe8, 0xcff0, 0xcff1, 0xcff3, 0xcff5, 0xcffc, 0xd000, 0xd004, 0xd011, 0xd018, 0xd02d, 0xd034, 0xd035, 0xd038, 0xd03c, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc540[ 192 ] = { 0xfffd, 0xd715, 0xd716, 0xd717, 0xd71a, 0xd71b, 0xd71d, 0xd71e, 0xd71f, 0xd721, 0xd722, 0xd723, 0xd724, 0xd725, 0xd726, 0xd727, 0xd72a, 0xd72c, 0xd72e, 0xd72f, 0xd730, 0xd731, 0xd732, 0xd733, 0xd736, 0xd737, 0xd739, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd73a, 0xd73b, 0xd73d, 0xd73e, 0xd73f, 0xd740, 0xd741, 0xd742, 0xd743, 0xd745, 0xd746, 0xd748, 0xd74a, 0xd74b, 0xd74c, 0xd74d, 0xd74e, 0xd74f, 0xd752, 0xd753, 0xd755, 0xd75a, 0xd75b, 0xd75c, 0xd75d, 0xd75e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd75f, 0xd762, 0xd764, 0xd766, 0xd767, 0xd768, 0xd76a, 0xd76b, 0xd76d, 0xd76e, 0xd76f, 0xd771, 0xd772, 0xd773, 0xd775, 0xd776, 0xd777, 0xd778, 0xd779, 0xd77a, 0xd77b, 0xd77e, 0xd77f, 0xd780, 0xd782, 0xd783, 0xd784, 0xd785, 0xd786, 0xd787, 0xd78a, 0xd78b, 0xd044, 0xd045, 0xd047, 0xd049, 0xd050, 0xd054, 0xd058, 0xd060, 0xd06c, 0xd06d, 0xd070, 0xd074, 0xd07c, 0xd07d, 0xd081, 0xd0a4, 0xd0a5, 0xd0a8, 0xd0ac, 0xd0b4, 0xd0b5, 0xd0b7, 0xd0b9, 0xd0c0, 0xd0c1, 0xd0c4, 0xd0c8, 0xd0c9, 0xd0d0, 0xd0d1, 0xd0d3, 0xd0d4, 0xd0d5, 0xd0dc, 0xd0dd, 0xd0e0, 0xd0e4, 0xd0ec, 0xd0ed, 0xd0ef, 0xd0f0, 0xd0f1, 0xd0f8, 0xd10d, 0xd130, 0xd131, 0xd134, 0xd138, 0xd13a, 0xd140, 0xd141, 0xd143, 0xd144, 0xd145, 0xd14c, 0xd14d, 0xd150, 0xd154, 0xd15c, 0xd15d, 0xd15f, 0xd161, 0xd168, 0xd16c, 0xd17c, 0xd184, 0xd188, 0xd1a0, 0xd1a1, 0xd1a4, 0xd1a8, 0xd1b0, 0xd1b1, 0xd1b3, 0xd1b5, 0xd1ba, 0xd1bc, 0xd1c0, 0xd1d8, 0xd1f4, 0xd1f8, 0xd207, 0xd209, 0xd210, 0xd22c, 0xd22d, 0xd230, 0xd234, 0xd23c, 0xd23d, 0xd23f, 0xd241, 0xd248, 0xd25c, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc640[ 24 ] = { 0xfffd, 0xd78d, 0xd78e, 0xd78f, 0xd791, 0xd792, 0xd793, 0xd794, 0xd795, 0xd796, 0xd797, 0xd79a, 0xd79c, 0xd79e, 0xd79f, 0xd7a0, 0xd7a1, 0xd7a2, 0xd7a3, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc6a0[ 96 ] = { 0xfffd, 0xd264, 0xd280, 0xd281, 0xd284, 0xd288, 0xd290, 0xd291, 0xd295, 0xd29c, 0xd2a0, 0xd2a4, 0xd2ac, 0xd2b1, 0xd2b8, 0xd2b9, 0xd2bc, 0xd2bf, 0xd2c0, 0xd2c2, 0xd2c8, 0xd2c9, 0xd2cb, 0xd2d4, 0xd2d8, 0xd2dc, 0xd2e4, 0xd2e5, 0xd2f0, 0xd2f1, 0xd2f4, 0xd2f8, 0xd300, 0xd301, 0xd303, 0xd305, 0xd30c, 0xd30d, 0xd30e, 0xd310, 0xd314, 0xd316, 0xd31c, 0xd31d, 0xd31f, 0xd320, 0xd321, 0xd325, 0xd328, 0xd329, 0xd32c, 0xd330, 0xd338, 0xd339, 0xd33b, 0xd33c, 0xd33d, 0xd344, 0xd345, 0xd37c, 0xd37d, 0xd380, 0xd384, 0xd38c, 0xd38d, 0xd38f, 0xd390, 0xd391, 0xd398, 0xd399, 0xd39c, 0xd3a0, 0xd3a8, 0xd3a9, 0xd3ab, 0xd3ad, 0xd3b4, 0xd3b8, 0xd3bc, 0xd3c4, 0xd3c5, 0xd3c8, 0xd3c9, 0xd3d0, 0xd3d8, 0xd3e1, 0xd3e3, 0xd3ec, 0xd3ed, 0xd3f0, 0xd3f4, 0xd3fc, 0xd3fd, 0xd3ff, 0xd401, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc7a0[ 96 ] = { 0xfffd, 0xd408, 0xd41d, 0xd440, 0xd444, 0xd45c, 0xd460, 0xd464, 0xd46d, 0xd46f, 0xd478, 0xd479, 0xd47c, 0xd47f, 0xd480, 0xd482, 0xd488, 0xd489, 0xd48b, 0xd48d, 0xd494, 0xd4a9, 0xd4cc, 0xd4d0, 0xd4d4, 0xd4dc, 0xd4df, 0xd4e8, 0xd4ec, 0xd4f0, 0xd4f8, 0xd4fb, 0xd4fd, 0xd504, 0xd508, 0xd50c, 0xd514, 0xd515, 0xd517, 0xd53c, 0xd53d, 0xd540, 0xd544, 0xd54c, 0xd54d, 0xd54f, 0xd551, 0xd558, 0xd559, 0xd55c, 0xd560, 0xd565, 0xd568, 0xd569, 0xd56b, 0xd56d, 0xd574, 0xd575, 0xd578, 0xd57c, 0xd584, 0xd585, 0xd587, 0xd588, 0xd589, 0xd590, 0xd5a5, 0xd5c8, 0xd5c9, 0xd5cc, 0xd5d0, 0xd5d2, 0xd5d8, 0xd5d9, 0xd5db, 0xd5dd, 0xd5e4, 0xd5e5, 0xd5e8, 0xd5ec, 0xd5f4, 0xd5f5, 0xd5f7, 0xd5f9, 0xd600, 0xd601, 0xd604, 0xd608, 0xd610, 0xd611, 0xd613, 0xd614, 0xd615, 0xd61c, 0xd620, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc8a0[ 96 ] = { 0xfffd, 0xd624, 0xd62d, 0xd638, 0xd639, 0xd63c, 0xd640, 0xd645, 0xd648, 0xd649, 0xd64b, 0xd64d, 0xd651, 0xd654, 0xd655, 0xd658, 0xd65c, 0xd667, 0xd669, 0xd670, 0xd671, 0xd674, 0xd683, 0xd685, 0xd68c, 0xd68d, 0xd690, 0xd694, 0xd69d, 0xd69f, 0xd6a1, 0xd6a8, 0xd6ac, 0xd6b0, 0xd6b9, 0xd6bb, 0xd6c4, 0xd6c5, 0xd6c8, 0xd6cc, 0xd6d1, 0xd6d4, 0xd6d7, 0xd6d9, 0xd6e0, 0xd6e4, 0xd6e8, 0xd6f0, 0xd6f5, 0xd6fc, 0xd6fd, 0xd700, 0xd704, 0xd711, 0xd718, 0xd719, 0xd71c, 0xd720, 0xd728, 0xd729, 0xd72b, 0xd72d, 0xd734, 0xd735, 0xd738, 0xd73c, 0xd744, 0xd747, 0xd749, 0xd750, 0xd751, 0xd754, 0xd756, 0xd757, 0xd758, 0xd759, 0xd760, 0xd761, 0xd763, 0xd765, 0xd769, 0xd76c, 0xd770, 0xd774, 0xd77c, 0xd77d, 0xd781, 0xd788, 0xd789, 0xd78c, 0xd790, 0xd798, 0xd799, 0xd79b, 0xd79d, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcaa0[ 96 ] = { 0xfffd, 0x4f3d, 0x4f73, 0x5047, 0x50f9, 0x52a0, 0x53ef, 0x5475, 0x54e5, 0x5609, 0x5ac1, 0x5bb6, 0x6687, 0x67b6, 0x67b7, 0x67ef, 0x6b4c, 0x73c2, 0x75c2, 0x7a3c, 0x82db, 0x8304, 0x8857, 0x8888, 0x8a36, 0x8cc8, 0x8dcf, 0x8efb, 0x8fe6, 0x99d5, 0x523b, 0x5374, 0x5404, 0x606a, 0x6164, 0x6bbc, 0x73cf, 0x811a, 0x89ba, 0x89d2, 0x95a3, 0x4f83, 0x520a, 0x58be, 0x5978, 0x59e6, 0x5e72, 0x5e79, 0x61c7, 0x63c0, 0x6746, 0x67ec, 0x687f, 0x6f97, 0x764e, 0x770b, 0x78f5, 0x7a08, 0x7aff, 0x7c21, 0x809d, 0x826e, 0x8271, 0x8aeb, 0x9593, 0x4e6b, 0x559d, 0x66f7, 0x6e34, 0x78a3, 0x7aed, 0x845b, 0x8910, 0x874e, 0x97a8, 0x52d8, 0x574e, 0x582a, 0x5d4c, 0x611f, 0x61be, 0x6221, 0x6562, 0x67d1, 0x6a44, 0x6e1b, 0x7518, 0x75b3, 0x76e3, 0x77b0, 0x7d3a, 0x90af, 0x9451, 0x9452, 0x9f95, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcba0[ 96 ] = { 0xfffd, 0x5323, 0x5cac, 0x7532, 0x80db, 0x9240, 0x9598, 0x525b, 0x5808, 0x59dc, 0x5ca1, 0x5d17, 0x5eb7, 0x5f3a, 0x5f4a, 0x6177, 0x6c5f, 0x757a, 0x7586, 0x7ce0, 0x7d73, 0x7db1, 0x7f8c, 0x8154, 0x8221, 0x8591, 0x8941, 0x8b1b, 0x92fc, 0x964d, 0x9c47, 0x4ecb, 0x4ef7, 0x500b, 0x51f1, 0x584f, 0x6137, 0x613e, 0x6168, 0x6539, 0x69ea, 0x6f11, 0x75a5, 0x7686, 0x76d6, 0x7b87, 0x82a5, 0x84cb, 0xf900, 0x93a7, 0x958b, 0x5580, 0x5ba2, 0x5751, 0xf901, 0x7cb3, 0x7fb9, 0x91b5, 0x5028, 0x53bb, 0x5c45, 0x5de8, 0x62d2, 0x636e, 0x64da, 0x64e7, 0x6e20, 0x70ac, 0x795b, 0x8ddd, 0x8e1e, 0xf902, 0x907d, 0x9245, 0x92f8, 0x4e7e, 0x4ef6, 0x5065, 0x5dfe, 0x5efa, 0x6106, 0x6957, 0x8171, 0x8654, 0x8e47, 0x9375, 0x9a2b, 0x4e5e, 0x5091, 0x6770, 0x6840, 0x5109, 0x528d, 0x5292, 0x6aa2, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcca0[ 96 ] = { 0xfffd, 0x77bc, 0x9210, 0x9ed4, 0x52ab, 0x602f, 0x8ff2, 0x5048, 0x61a9, 0x63ed, 0x64ca, 0x683c, 0x6a84, 0x6fc0, 0x8188, 0x89a1, 0x9694, 0x5805, 0x727d, 0x72ac, 0x7504, 0x7d79, 0x7e6d, 0x80a9, 0x898b, 0x8b74, 0x9063, 0x9d51, 0x6289, 0x6c7a, 0x6f54, 0x7d50, 0x7f3a, 0x8a23, 0x517c, 0x614a, 0x7b9d, 0x8b19, 0x9257, 0x938c, 0x4eac, 0x4fd3, 0x501e, 0x50be, 0x5106, 0x52c1, 0x52cd, 0x537f, 0x5770, 0x5883, 0x5e9a, 0x5f91, 0x6176, 0x61ac, 0x64ce, 0x656c, 0x666f, 0x66bb, 0x66f4, 0x6897, 0x6d87, 0x7085, 0x70f1, 0x749f, 0x74a5, 0x74ca, 0x75d9, 0x786c, 0x78ec, 0x7adf, 0x7af6, 0x7d45, 0x7d93, 0x8015, 0x803f, 0x811b, 0x8396, 0x8b66, 0x8f15, 0x9015, 0x93e1, 0x9803, 0x9838, 0x9a5a, 0x9be8, 0x4fc2, 0x5553, 0x583a, 0x5951, 0x5b63, 0x5c46, 0x60b8, 0x6212, 0x6842, 0x68b0, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcda0[ 96 ] = { 0xfffd, 0x68e8, 0x6eaa, 0x754c, 0x7678, 0x78ce, 0x7a3d, 0x7cfb, 0x7e6b, 0x7e7c, 0x8a08, 0x8aa1, 0x8c3f, 0x968e, 0x9dc4, 0x53e4, 0x53e9, 0x544a, 0x5471, 0x56fa, 0x59d1, 0x5b64, 0x5c3b, 0x5eab, 0x62f7, 0x6537, 0x6545, 0x6572, 0x66a0, 0x67af, 0x69c1, 0x6cbd, 0x75fc, 0x7690, 0x777e, 0x7a3f, 0x7f94, 0x8003, 0x80a1, 0x818f, 0x82e6, 0x82fd, 0x83f0, 0x85c1, 0x8831, 0x88b4, 0x8aa5, 0xf903, 0x8f9c, 0x932e, 0x96c7, 0x9867, 0x9ad8, 0x9f13, 0x54ed, 0x659b, 0x66f2, 0x688f, 0x7a40, 0x8c37, 0x9d60, 0x56f0, 0x5764, 0x5d11, 0x6606, 0x68b1, 0x68cd, 0x6efe, 0x7428, 0x889e, 0x9be4, 0x6c68, 0xf904, 0x9aa8, 0x4f9b, 0x516c, 0x5171, 0x529f, 0x5b54, 0x5de5, 0x6050, 0x606d, 0x62f1, 0x63a7, 0x653b, 0x73d9, 0x7a7a, 0x86a3, 0x8ca2, 0x978f, 0x4e32, 0x5be1, 0x6208, 0x679c, 0x74dc, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcea0[ 96 ] = { 0xfffd, 0x79d1, 0x83d3, 0x8a87, 0x8ab2, 0x8de8, 0x904e, 0x934b, 0x9846, 0x5ed3, 0x69e8, 0x85ff, 0x90ed, 0xf905, 0x51a0, 0x5b98, 0x5bec, 0x6163, 0x68fa, 0x6b3e, 0x704c, 0x742f, 0x74d8, 0x7ba1, 0x7f50, 0x83c5, 0x89c0, 0x8cab, 0x95dc, 0x9928, 0x522e, 0x605d, 0x62ec, 0x9002, 0x4f8a, 0x5149, 0x5321, 0x58d9, 0x5ee3, 0x66e0, 0x6d38, 0x709a, 0x72c2, 0x73d6, 0x7b50, 0x80f1, 0x945b, 0x5366, 0x639b, 0x7f6b, 0x4e56, 0x5080, 0x584a, 0x58de, 0x602a, 0x6127, 0x62d0, 0x69d0, 0x9b41, 0x5b8f, 0x7d18, 0x80b1, 0x8f5f, 0x4ea4, 0x50d1, 0x54ac, 0x55ac, 0x5b0c, 0x5da0, 0x5de7, 0x652a, 0x654e, 0x6821, 0x6a4b, 0x72e1, 0x768e, 0x77ef, 0x7d5e, 0x7ff9, 0x81a0, 0x854e, 0x86df, 0x8f03, 0x8f4e, 0x90ca, 0x9903, 0x9a55, 0x9bab, 0x4e18, 0x4e45, 0x4e5d, 0x4ec7, 0x4ff1, 0x5177, 0x52fe, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcfa0[ 96 ] = { 0xfffd, 0x5340, 0x53e3, 0x53e5, 0x548e, 0x5614, 0x5775, 0x57a2, 0x5bc7, 0x5d87, 0x5ed0, 0x61fc, 0x62d8, 0x6551, 0x67b8, 0x67e9, 0x69cb, 0x6b50, 0x6bc6, 0x6bec, 0x6c42, 0x6e9d, 0x7078, 0x72d7, 0x7396, 0x7403, 0x77bf, 0x77e9, 0x7a76, 0x7d7f, 0x8009, 0x81fc, 0x8205, 0x820a, 0x82df, 0x8862, 0x8b33, 0x8cfc, 0x8ec0, 0x9011, 0x90b1, 0x9264, 0x92b6, 0x99d2, 0x9a45, 0x9ce9, 0x9dd7, 0x9f9c, 0x570b, 0x5c40, 0x83ca, 0x97a0, 0x97ab, 0x9eb4, 0x541b, 0x7a98, 0x7fa4, 0x88d9, 0x8ecd, 0x90e1, 0x5800, 0x5c48, 0x6398, 0x7a9f, 0x5bae, 0x5f13, 0x7a79, 0x7aae, 0x828e, 0x8eac, 0x5026, 0x5238, 0x52f8, 0x5377, 0x5708, 0x62f3, 0x6372, 0x6b0a, 0x6dc3, 0x7737, 0x53a5, 0x7357, 0x8568, 0x8e76, 0x95d5, 0x673a, 0x6ac3, 0x6f70, 0x8a6d, 0x8ecc, 0x994b, 0xf906, 0x6677, 0x6b78, 0x8cb4, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd0a0[ 96 ] = { 0xfffd, 0x9b3c, 0xf907, 0x53eb, 0x572d, 0x594e, 0x63c6, 0x69fb, 0x73ea, 0x7845, 0x7aba, 0x7ac5, 0x7cfe, 0x8475, 0x898f, 0x8d73, 0x9035, 0x95a8, 0x52fb, 0x5747, 0x7547, 0x7b60, 0x83cc, 0x921e, 0xf908, 0x6a58, 0x514b, 0x524b, 0x5287, 0x621f, 0x68d8, 0x6975, 0x9699, 0x50c5, 0x52a4, 0x52e4, 0x61c3, 0x65a4, 0x6839, 0x69ff, 0x747e, 0x7b4b, 0x82b9, 0x83eb, 0x89b2, 0x8b39, 0x8fd1, 0x9949, 0xf909, 0x4eca, 0x5997, 0x64d2, 0x6611, 0x6a8e, 0x7434, 0x7981, 0x79bd, 0x82a9, 0x887e, 0x887f, 0x895f, 0xf90a, 0x9326, 0x4f0b, 0x53ca, 0x6025, 0x6271, 0x6c72, 0x7d1a, 0x7d66, 0x4e98, 0x5162, 0x77dc, 0x80af, 0x4f01, 0x4f0e, 0x5176, 0x5180, 0x55dc, 0x5668, 0x573b, 0x57fa, 0x57fc, 0x5914, 0x5947, 0x5993, 0x5bc4, 0x5c90, 0x5d0e, 0x5df1, 0x5e7e, 0x5fcc, 0x6280, 0x65d7, 0x65e3, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd1a0[ 96 ] = { 0xfffd, 0x671e, 0x671f, 0x675e, 0x68cb, 0x68c4, 0x6a5f, 0x6b3a, 0x6c23, 0x6c7d, 0x6c82, 0x6dc7, 0x7398, 0x7426, 0x742a, 0x7482, 0x74a3, 0x7578, 0x757f, 0x7881, 0x78ef, 0x7941, 0x7947, 0x7948, 0x797a, 0x7b95, 0x7d00, 0x7dba, 0x7f88, 0x8006, 0x802d, 0x808c, 0x8a18, 0x8b4f, 0x8c48, 0x8d77, 0x9321, 0x9324, 0x98e2, 0x9951, 0x9a0e, 0x9a0f, 0x9a65, 0x9e92, 0x7dca, 0x4f76, 0x5409, 0x62ee, 0x6854, 0x91d1, 0x55ab, 0x513a, 0xf90b, 0xf90c, 0x5a1c, 0x61e6, 0xf90d, 0x62cf, 0x62ff, 0xf90e, 0xf90f, 0xf910, 0xf911, 0xf912, 0xf913, 0x90a3, 0xf914, 0xf915, 0xf916, 0xf917, 0xf918, 0x8afe, 0xf919, 0xf91a, 0xf91b, 0xf91c, 0x6696, 0xf91d, 0x7156, 0xf91e, 0xf91f, 0x96e3, 0xf920, 0x634f, 0x637a, 0x5357, 0xf921, 0x678f, 0x6960, 0x6e73, 0xf922, 0x7537, 0xf923, 0xf924, 0xf925, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd2a0[ 96 ] = { 0xfffd, 0x7d0d, 0xf926, 0xf927, 0x8872, 0x56ca, 0x5a18, 0xf928, 0xf929, 0xf92a, 0xf92b, 0xf92c, 0x4e43, 0xf92d, 0x5167, 0x5948, 0x67f0, 0x8010, 0xf92e, 0x5973, 0x5e74, 0x649a, 0x79ca, 0x5ff5, 0x606c, 0x62c8, 0x637b, 0x5be7, 0x5bd7, 0x52aa, 0xf92f, 0x5974, 0x5f29, 0x6012, 0xf930, 0xf931, 0xf932, 0x7459, 0xf933, 0xf934, 0xf935, 0xf936, 0xf937, 0xf938, 0x99d1, 0xf939, 0xf93a, 0xf93b, 0xf93c, 0xf93d, 0xf93e, 0xf93f, 0xf940, 0xf941, 0xf942, 0xf943, 0x6fc3, 0xf944, 0xf945, 0x81bf, 0x8fb2, 0x60f1, 0xf946, 0xf947, 0x8166, 0xf948, 0xf949, 0x5c3f, 0xf94a, 0xf94b, 0xf94c, 0xf94d, 0xf94e, 0xf94f, 0xf950, 0xf951, 0x5ae9, 0x8a25, 0x677b, 0x7d10, 0xf952, 0xf953, 0xf954, 0xf955, 0xf956, 0xf957, 0x80fd, 0xf958, 0xf959, 0x5c3c, 0x6ce5, 0x533f, 0x6eba, 0x591a, 0x8336, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd3a0[ 96 ] = { 0xfffd, 0x4e39, 0x4eb6, 0x4f46, 0x55ae, 0x5718, 0x58c7, 0x5f56, 0x65b7, 0x65e6, 0x6a80, 0x6bb5, 0x6e4d, 0x77ed, 0x7aef, 0x7c1e, 0x7dde, 0x86cb, 0x8892, 0x9132, 0x935b, 0x64bb, 0x6fbe, 0x737a, 0x75b8, 0x9054, 0x5556, 0x574d, 0x61ba, 0x64d4, 0x66c7, 0x6de1, 0x6e5b, 0x6f6d, 0x6fb9, 0x75f0, 0x8043, 0x81bd, 0x8541, 0x8983, 0x8ac7, 0x8b5a, 0x931f, 0x6c93, 0x7553, 0x7b54, 0x8e0f, 0x905d, 0x5510, 0x5802, 0x5858, 0x5e62, 0x6207, 0x649e, 0x68e0, 0x7576, 0x7cd6, 0x87b3, 0x9ee8, 0x4ee3, 0x5788, 0x576e, 0x5927, 0x5c0d, 0x5cb1, 0x5e36, 0x5f85, 0x6234, 0x64e1, 0x73b3, 0x81fa, 0x888b, 0x8cb8, 0x968a, 0x9edb, 0x5b85, 0x5fb7, 0x60b3, 0x5012, 0x5200, 0x5230, 0x5716, 0x5835, 0x5857, 0x5c0e, 0x5c60, 0x5cf6, 0x5d8b, 0x5ea6, 0x5f92, 0x60bc, 0x6311, 0x6389, 0x6417, 0x6843, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd4a0[ 96 ] = { 0xfffd, 0x68f9, 0x6ac2, 0x6dd8, 0x6e21, 0x6ed4, 0x6fe4, 0x71fe, 0x76dc, 0x7779, 0x79b1, 0x7a3b, 0x8404, 0x89a9, 0x8ced, 0x8df3, 0x8e48, 0x9003, 0x9014, 0x9053, 0x90fd, 0x934d, 0x9676, 0x97dc, 0x6bd2, 0x7006, 0x7258, 0x72a2, 0x7368, 0x7763, 0x79bf, 0x7be4, 0x7e9b, 0x8b80, 0x58a9, 0x60c7, 0x6566, 0x65fd, 0x66be, 0x6c8c, 0x711e, 0x71c9, 0x8c5a, 0x9813, 0x4e6d, 0x7a81, 0x4edd, 0x51ac, 0x51cd, 0x52d5, 0x540c, 0x61a7, 0x6771, 0x6850, 0x68df, 0x6d1e, 0x6f7c, 0x75bc, 0x77b3, 0x7ae5, 0x80f4, 0x8463, 0x9285, 0x515c, 0x6597, 0x675c, 0x6793, 0x75d8, 0x7ac7, 0x8373, 0xf95a, 0x8c46, 0x9017, 0x982d, 0x5c6f, 0x81c0, 0x829a, 0x9041, 0x906f, 0x920d, 0x5f97, 0x5d9d, 0x6a59, 0x71c8, 0x767b, 0x7b49, 0x85e4, 0x8b04, 0x9127, 0x9a30, 0x5587, 0x61f6, 0xf95b, 0x7669, 0x7f85, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd5a0[ 96 ] = { 0xfffd, 0x863f, 0x87ba, 0x88f8, 0x908f, 0xf95c, 0x6d1b, 0x70d9, 0x73de, 0x7d61, 0x843d, 0xf95d, 0x916a, 0x99f1, 0xf95e, 0x4e82, 0x5375, 0x6b04, 0x6b12, 0x703e, 0x721b, 0x862d, 0x9e1e, 0x524c, 0x8fa3, 0x5d50, 0x64e5, 0x652c, 0x6b16, 0x6feb, 0x7c43, 0x7e9c, 0x85cd, 0x8964, 0x89bd, 0x62c9, 0x81d8, 0x881f, 0x5eca, 0x6717, 0x6d6a, 0x72fc, 0x7405, 0x746f, 0x8782, 0x90de, 0x4f86, 0x5d0d, 0x5fa0, 0x840a, 0x51b7, 0x63a0, 0x7565, 0x4eae, 0x5006, 0x5169, 0x51c9, 0x6881, 0x6a11, 0x7cae, 0x7cb1, 0x7ce7, 0x826f, 0x8ad2, 0x8f1b, 0x91cf, 0x4fb6, 0x5137, 0x52f5, 0x5442, 0x5eec, 0x616e, 0x623e, 0x65c5, 0x6ada, 0x6ffe, 0x792a, 0x85dc, 0x8823, 0x95ad, 0x9a62, 0x9a6a, 0x9e97, 0x9ece, 0x529b, 0x66c6, 0x6b77, 0x701d, 0x792b, 0x8f62, 0x9742, 0x6190, 0x6200, 0x6523, 0x6f23, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd6a0[ 96 ] = { 0xfffd, 0x7149, 0x7489, 0x7df4, 0x806f, 0x84ee, 0x8f26, 0x9023, 0x934a, 0x51bd, 0x5217, 0x52a3, 0x6d0c, 0x70c8, 0x88c2, 0x5ec9, 0x6582, 0x6bae, 0x6fc2, 0x7c3e, 0x7375, 0x4ee4, 0x4f36, 0x56f9, 0xf95f, 0x5cba, 0x5dba, 0x601c, 0x73b2, 0x7b2d, 0x7f9a, 0x7fce, 0x8046, 0x901e, 0x9234, 0x96f6, 0x9748, 0x9818, 0x9f61, 0x4f8b, 0x6fa7, 0x79ae, 0x91b4, 0x96b7, 0x52de, 0xf960, 0x6488, 0x64c4, 0x6ad3, 0x6f5e, 0x7018, 0x7210, 0x76e7, 0x8001, 0x8606, 0x865c, 0x8def, 0x8f05, 0x9732, 0x9b6f, 0x9dfa, 0x9e75, 0x788c, 0x797f, 0x7da0, 0x83c9, 0x9304, 0x9e7f, 0x9e93, 0x8ad6, 0x58df, 0x5f04, 0x6727, 0x7027, 0x74cf, 0x7c60, 0x807e, 0x5121, 0x7028, 0x7262, 0x78ca, 0x8cc2, 0x8cda, 0x8cf4, 0x96f7, 0x4e86, 0x50da, 0x5bee, 0x5ed6, 0x6599, 0x71ce, 0x7642, 0x77ad, 0x804a, 0x84fc, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd7a0[ 96 ] = { 0xfffd, 0x907c, 0x9b27, 0x9f8d, 0x58d8, 0x5a41, 0x5c62, 0x6a13, 0x6dda, 0x6f0f, 0x763b, 0x7d2f, 0x7e37, 0x851e, 0x8938, 0x93e4, 0x964b, 0x5289, 0x65d2, 0x67f3, 0x69b4, 0x6d41, 0x6e9c, 0x700f, 0x7409, 0x7460, 0x7559, 0x7624, 0x786b, 0x8b2c, 0x985e, 0x516d, 0x622e, 0x9678, 0x4f96, 0x502b, 0x5d19, 0x6dea, 0x7db8, 0x8f2a, 0x5f8b, 0x6144, 0x6817, 0xf961, 0x9686, 0x52d2, 0x808b, 0x51dc, 0x51cc, 0x695e, 0x7a1c, 0x7dbe, 0x83f1, 0x9675, 0x4fda, 0x5229, 0x5398, 0x540f, 0x550e, 0x5c65, 0x60a7, 0x674e, 0x68a8, 0x6d6c, 0x7281, 0x72f8, 0x7406, 0x7483, 0xf962, 0x75e2, 0x7c6c, 0x7f79, 0x7fb8, 0x8389, 0x88cf, 0x88e1, 0x91cc, 0x91d0, 0x96e2, 0x9bc9, 0x541d, 0x6f7e, 0x71d0, 0x7498, 0x85fa, 0x8eaa, 0x96a3, 0x9c57, 0x9e9f, 0x6797, 0x6dcb, 0x7433, 0x81e8, 0x9716, 0x782c, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd8a0[ 96 ] = { 0xfffd, 0x7acb, 0x7b20, 0x7c92, 0x6469, 0x746a, 0x75f2, 0x78bc, 0x78e8, 0x99ac, 0x9b54, 0x9ebb, 0x5bde, 0x5e55, 0x6f20, 0x819c, 0x83ab, 0x9088, 0x4e07, 0x534d, 0x5a29, 0x5dd2, 0x5f4e, 0x6162, 0x633d, 0x6669, 0x66fc, 0x6eff, 0x6f2b, 0x7063, 0x779e, 0x842c, 0x8513, 0x883b, 0x8f13, 0x9945, 0x9c3b, 0x551c, 0x62b9, 0x672b, 0x6cab, 0x8309, 0x896a, 0x977a, 0x4ea1, 0x5984, 0x5fd8, 0x5fd9, 0x671b, 0x7db2, 0x7f54, 0x8292, 0x832b, 0x83bd, 0x8f1e, 0x9099, 0x57cb, 0x59b9, 0x5a92, 0x5bd0, 0x6627, 0x679a, 0x6885, 0x6bcf, 0x7164, 0x7f75, 0x8cb7, 0x8ce3, 0x9081, 0x9b45, 0x8108, 0x8c8a, 0x964c, 0x9a40, 0x9ea5, 0x5b5f, 0x6c13, 0x731b, 0x76f2, 0x76df, 0x840c, 0x51aa, 0x8993, 0x514d, 0x5195, 0x52c9, 0x68c9, 0x6c94, 0x7704, 0x7720, 0x7dbf, 0x7dec, 0x9762, 0x9eb5, 0x6ec5, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd9a0[ 96 ] = { 0xfffd, 0x8511, 0x51a5, 0x540d, 0x547d, 0x660e, 0x669d, 0x6927, 0x6e9f, 0x76bf, 0x7791, 0x8317, 0x84c2, 0x879f, 0x9169, 0x9298, 0x9cf4, 0x8882, 0x4fae, 0x5192, 0x52df, 0x59c6, 0x5e3d, 0x6155, 0x6478, 0x6479, 0x66ae, 0x67d0, 0x6a21, 0x6bcd, 0x6bdb, 0x725f, 0x7261, 0x7441, 0x7738, 0x77db, 0x8017, 0x82bc, 0x8305, 0x8b00, 0x8b28, 0x8c8c, 0x6728, 0x6c90, 0x7267, 0x76ee, 0x7766, 0x7a46, 0x9da9, 0x6b7f, 0x6c92, 0x5922, 0x6726, 0x8499, 0x536f, 0x5893, 0x5999, 0x5edf, 0x63cf, 0x6634, 0x6773, 0x6e3a, 0x732b, 0x7ad7, 0x82d7, 0x9328, 0x52d9, 0x5deb, 0x61ae, 0x61cb, 0x620a, 0x62c7, 0x64ab, 0x65e0, 0x6959, 0x6b66, 0x6bcb, 0x7121, 0x73f7, 0x755d, 0x7e46, 0x821e, 0x8302, 0x856a, 0x8aa3, 0x8cbf, 0x9727, 0x9d61, 0x58a8, 0x9ed8, 0x5011, 0x520e, 0x543b, 0x554f, 0x6587, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdaa0[ 96 ] = { 0xfffd, 0x6c76, 0x7d0a, 0x7d0b, 0x805e, 0x868a, 0x9580, 0x96ef, 0x52ff, 0x6c95, 0x7269, 0x5473, 0x5a9a, 0x5c3e, 0x5d4b, 0x5f4c, 0x5fae, 0x672a, 0x68b6, 0x6963, 0x6e3c, 0x6e44, 0x7709, 0x7c73, 0x7f8e, 0x8587, 0x8b0e, 0x8ff7, 0x9761, 0x9ef4, 0x5cb7, 0x60b6, 0x610d, 0x61ab, 0x654f, 0x65fb, 0x65fc, 0x6c11, 0x6cef, 0x739f, 0x73c9, 0x7de1, 0x9594, 0x5bc6, 0x871c, 0x8b10, 0x525d, 0x535a, 0x62cd, 0x640f, 0x64b2, 0x6734, 0x6a38, 0x6cca, 0x73c0, 0x749e, 0x7b94, 0x7c95, 0x7e1b, 0x818a, 0x8236, 0x8584, 0x8feb, 0x96f9, 0x99c1, 0x4f34, 0x534a, 0x53cd, 0x53db, 0x62cc, 0x642c, 0x6500, 0x6591, 0x69c3, 0x6cee, 0x6f58, 0x73ed, 0x7554, 0x7622, 0x76e4, 0x76fc, 0x78d0, 0x78fb, 0x792c, 0x7d46, 0x822c, 0x87e0, 0x8fd4, 0x9812, 0x98ef, 0x52c3, 0x62d4, 0x64a5, 0x6e24, 0x6f51, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdba0[ 96 ] = { 0xfffd, 0x767c, 0x8dcb, 0x91b1, 0x9262, 0x9aee, 0x9b43, 0x5023, 0x508d, 0x574a, 0x59a8, 0x5c28, 0x5e47, 0x5f77, 0x623f, 0x653e, 0x65b9, 0x65c1, 0x6609, 0x678b, 0x699c, 0x6ec2, 0x78c5, 0x7d21, 0x80aa, 0x8180, 0x822b, 0x82b3, 0x84a1, 0x868c, 0x8a2a, 0x8b17, 0x90a6, 0x9632, 0x9f90, 0x500d, 0x4ff3, 0xf963, 0x57f9, 0x5f98, 0x62dc, 0x6392, 0x676f, 0x6e43, 0x7119, 0x76c3, 0x80cc, 0x80da, 0x88f4, 0x88f5, 0x8919, 0x8ce0, 0x8f29, 0x914d, 0x966a, 0x4f2f, 0x4f70, 0x5e1b, 0x67cf, 0x6822, 0x767d, 0x767e, 0x9b44, 0x5e61, 0x6a0a, 0x7169, 0x71d4, 0x756a, 0xf964, 0x7e41, 0x8543, 0x85e9, 0x98dc, 0x4f10, 0x7b4f, 0x7f70, 0x95a5, 0x51e1, 0x5e06, 0x68b5, 0x6c3e, 0x6c4e, 0x6cdb, 0x72af, 0x7bc4, 0x8303, 0x6cd5, 0x743a, 0x50fb, 0x5288, 0x58c1, 0x64d8, 0x6a97, 0x74a7, 0x7656, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdca0[ 96 ] = { 0xfffd, 0x78a7, 0x8617, 0x95e2, 0x9739, 0xf965, 0x535e, 0x5f01, 0x8b8a, 0x8fa8, 0x8faf, 0x908a, 0x5225, 0x77a5, 0x9c49, 0x9f08, 0x4e19, 0x5002, 0x5175, 0x5c5b, 0x5e77, 0x661e, 0x663a, 0x67c4, 0x68c5, 0x70b3, 0x7501, 0x75c5, 0x79c9, 0x7add, 0x8f27, 0x9920, 0x9a08, 0x4fdd, 0x5821, 0x5831, 0x5bf6, 0x666e, 0x6b65, 0x6d11, 0x6e7a, 0x6f7d, 0x73e4, 0x752b, 0x83e9, 0x88dc, 0x8913, 0x8b5c, 0x8f14, 0x4f0f, 0x50d5, 0x5310, 0x535c, 0x5b93, 0x5fa9, 0x670d, 0x798f, 0x8179, 0x832f, 0x8514, 0x8907, 0x8986, 0x8f39, 0x8f3b, 0x99a5, 0x9c12, 0x672c, 0x4e76, 0x4ff8, 0x5949, 0x5c01, 0x5cef, 0x5cf0, 0x6367, 0x68d2, 0x70fd, 0x71a2, 0x742b, 0x7e2b, 0x84ec, 0x8702, 0x9022, 0x92d2, 0x9cf3, 0x4e0d, 0x4ed8, 0x4fef, 0x5085, 0x5256, 0x526f, 0x5426, 0x5490, 0x57e0, 0x592b, 0x5a66, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdda0[ 96 ] = { 0xfffd, 0x5b5a, 0x5b75, 0x5bcc, 0x5e9c, 0xf966, 0x6276, 0x6577, 0x65a7, 0x6d6e, 0x6ea5, 0x7236, 0x7b26, 0x7c3f, 0x7f36, 0x8150, 0x8151, 0x819a, 0x8240, 0x8299, 0x83a9, 0x8a03, 0x8ca0, 0x8ce6, 0x8cfb, 0x8d74, 0x8dba, 0x90e8, 0x91dc, 0x961c, 0x9644, 0x99d9, 0x9ce7, 0x5317, 0x5206, 0x5429, 0x5674, 0x58b3, 0x5954, 0x596e, 0x5fff, 0x61a4, 0x626e, 0x6610, 0x6c7e, 0x711a, 0x76c6, 0x7c89, 0x7cde, 0x7d1b, 0x82ac, 0x8cc1, 0x96f0, 0xf967, 0x4f5b, 0x5f17, 0x5f7f, 0x62c2, 0x5d29, 0x670b, 0x68da, 0x787c, 0x7e43, 0x9d6c, 0x4e15, 0x5099, 0x5315, 0x532a, 0x5351, 0x5983, 0x5a62, 0x5e87, 0x60b2, 0x618a, 0x6249, 0x6279, 0x6590, 0x6787, 0x69a7, 0x6bd4, 0x6bd6, 0x6bd7, 0x6bd8, 0x6cb8, 0xf968, 0x7435, 0x75fa, 0x7812, 0x7891, 0x79d5, 0x79d8, 0x7c83, 0x7dcb, 0x7fe1, 0x80a5, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdea0[ 96 ] = { 0xfffd, 0x813e, 0x81c2, 0x83f2, 0x871a, 0x88e8, 0x8ab9, 0x8b6c, 0x8cbb, 0x9119, 0x975e, 0x98db, 0x9f3b, 0x56ac, 0x5b2a, 0x5f6c, 0x658c, 0x6ab3, 0x6baf, 0x6d5c, 0x6ff1, 0x7015, 0x725d, 0x73ad, 0x8ca7, 0x8cd3, 0x983b, 0x6191, 0x6c37, 0x8058, 0x9a01, 0x4e4d, 0x4e8b, 0x4e9b, 0x4ed5, 0x4f3a, 0x4f3c, 0x4f7f, 0x4fdf, 0x50ff, 0x53f2, 0x53f8, 0x5506, 0x55e3, 0x56db, 0x58eb, 0x5962, 0x5a11, 0x5beb, 0x5bfa, 0x5c04, 0x5df3, 0x5e2b, 0x5f99, 0x601d, 0x6368, 0x659c, 0x65af, 0x67f6, 0x67fb, 0x68ad, 0x6b7b, 0x6c99, 0x6cd7, 0x6e23, 0x7009, 0x7345, 0x7802, 0x793e, 0x7940, 0x7960, 0x79c1, 0x7be9, 0x7d17, 0x7d72, 0x8086, 0x820d, 0x838e, 0x84d1, 0x86c7, 0x88df, 0x8a50, 0x8a5e, 0x8b1d, 0x8cdc, 0x8d66, 0x8fad, 0x90aa, 0x98fc, 0x99df, 0x9e9d, 0x524a, 0xf969, 0x6714, 0xf96a, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdfa0[ 96 ] = { 0xfffd, 0x5098, 0x522a, 0x5c71, 0x6563, 0x6c55, 0x73ca, 0x7523, 0x759d, 0x7b97, 0x849c, 0x9178, 0x9730, 0x4e77, 0x6492, 0x6bba, 0x715e, 0x85a9, 0x4e09, 0xf96b, 0x6749, 0x68ee, 0x6e17, 0x829f, 0x8518, 0x886b, 0x63f7, 0x6f81, 0x9212, 0x98af, 0x4e0a, 0x50b7, 0x50cf, 0x511f, 0x5546, 0x55aa, 0x5617, 0x5b40, 0x5c19, 0x5ce0, 0x5e38, 0x5e8a, 0x5ea0, 0x5ec2, 0x60f3, 0x6851, 0x6a61, 0x6e58, 0x723d, 0x7240, 0x72c0, 0x76f8, 0x7965, 0x7bb1, 0x7fd4, 0x88f3, 0x89f4, 0x8a73, 0x8c61, 0x8cde, 0x971c, 0x585e, 0x74bd, 0x8cfd, 0x55c7, 0xf96c, 0x7a61, 0x7d22, 0x8272, 0x7272, 0x751f, 0x7525, 0xf96d, 0x7b19, 0x5885, 0x58fb, 0x5dbc, 0x5e8f, 0x5eb6, 0x5f90, 0x6055, 0x6292, 0x637f, 0x654d, 0x6691, 0x66d9, 0x66f8, 0x6816, 0x68f2, 0x7280, 0x745e, 0x7b6e, 0x7d6e, 0x7dd6, 0x7f72, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe0a0[ 96 ] = { 0xfffd, 0x80e5, 0x8212, 0x85af, 0x897f, 0x8a93, 0x901d, 0x92e4, 0x9ecd, 0x9f20, 0x5915, 0x596d, 0x5e2d, 0x60dc, 0x6614, 0x6673, 0x6790, 0x6c50, 0x6dc5, 0x6f5f, 0x77f3, 0x78a9, 0x84c6, 0x91cb, 0x932b, 0x4ed9, 0x50ca, 0x5148, 0x5584, 0x5b0b, 0x5ba3, 0x6247, 0x657e, 0x65cb, 0x6e32, 0x717d, 0x7401, 0x7444, 0x7487, 0x74bf, 0x766c, 0x79aa, 0x7dda, 0x7e55, 0x7fa8, 0x817a, 0x81b3, 0x8239, 0x861a, 0x87ec, 0x8a75, 0x8de3, 0x9078, 0x9291, 0x9425, 0x994d, 0x9bae, 0x5368, 0x5c51, 0x6954, 0x6cc4, 0x6d29, 0x6e2b, 0x820c, 0x859b, 0x893b, 0x8a2d, 0x8aaa, 0x96ea, 0x9f67, 0x5261, 0x66b9, 0x6bb2, 0x7e96, 0x87fe, 0x8d0d, 0x9583, 0x965d, 0x651d, 0x6d89, 0x71ee, 0xf96e, 0x57ce, 0x59d3, 0x5bac, 0x6027, 0x60fa, 0x6210, 0x661f, 0x665f, 0x7329, 0x73f9, 0x76db, 0x7701, 0x7b6c, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe1a0[ 96 ] = { 0xfffd, 0x8056, 0x8072, 0x8165, 0x8aa0, 0x9192, 0x4e16, 0x52e2, 0x6b72, 0x6d17, 0x7a05, 0x7b39, 0x7d30, 0xf96f, 0x8cb0, 0x53ec, 0x562f, 0x5851, 0x5bb5, 0x5c0f, 0x5c11, 0x5de2, 0x6240, 0x6383, 0x6414, 0x662d, 0x68b3, 0x6cbc, 0x6d88, 0x6eaf, 0x701f, 0x70a4, 0x71d2, 0x7526, 0x758f, 0x758e, 0x7619, 0x7b11, 0x7be0, 0x7c2b, 0x7d20, 0x7d39, 0x852c, 0x856d, 0x8607, 0x8a34, 0x900d, 0x9061, 0x90b5, 0x92b7, 0x97f6, 0x9a37, 0x4fd7, 0x5c6c, 0x675f, 0x6d91, 0x7c9f, 0x7e8c, 0x8b16, 0x8d16, 0x901f, 0x5b6b, 0x5dfd, 0x640d, 0x84c0, 0x905c, 0x98e1, 0x7387, 0x5b8b, 0x609a, 0x677e, 0x6dde, 0x8a1f, 0x8aa6, 0x9001, 0x980c, 0x5237, 0xf970, 0x7051, 0x788e, 0x9396, 0x8870, 0x91d7, 0x4fee, 0x53d7, 0x55fd, 0x56da, 0x5782, 0x58fd, 0x5ac2, 0x5b88, 0x5cab, 0x5cc0, 0x5e25, 0x6101, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe2a0[ 96 ] = { 0xfffd, 0x620d, 0x624b, 0x6388, 0x641c, 0x6536, 0x6578, 0x6a39, 0x6b8a, 0x6c34, 0x6d19, 0x6f31, 0x71e7, 0x72e9, 0x7378, 0x7407, 0x74b2, 0x7626, 0x7761, 0x79c0, 0x7a57, 0x7aea, 0x7cb9, 0x7d8f, 0x7dac, 0x7e61, 0x7f9e, 0x8129, 0x8331, 0x8490, 0x84da, 0x85ea, 0x8896, 0x8ab0, 0x8b90, 0x8f38, 0x9042, 0x9083, 0x916c, 0x9296, 0x92b9, 0x968b, 0x96a7, 0x96a8, 0x96d6, 0x9700, 0x9808, 0x9996, 0x9ad3, 0x9b1a, 0x53d4, 0x587e, 0x5919, 0x5b70, 0x5bbf, 0x6dd1, 0x6f5a, 0x719f, 0x7421, 0x74b9, 0x8085, 0x83fd, 0x5de1, 0x5f87, 0x5faa, 0x6042, 0x65ec, 0x6812, 0x696f, 0x6a53, 0x6b89, 0x6d35, 0x6df3, 0x73e3, 0x76fe, 0x77ac, 0x7b4d, 0x7d14, 0x8123, 0x821c, 0x8340, 0x84f4, 0x8563, 0x8a62, 0x8ac4, 0x9187, 0x931e, 0x9806, 0x99b4, 0x620c, 0x8853, 0x8ff0, 0x9265, 0x5d07, 0x5d27, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe3a0[ 96 ] = { 0xfffd, 0x5d69, 0x745f, 0x819d, 0x8768, 0x6fd5, 0x62fe, 0x7fd2, 0x8936, 0x8972, 0x4e1e, 0x4e58, 0x50e7, 0x52dd, 0x5347, 0x627f, 0x6607, 0x7e69, 0x8805, 0x965e, 0x4f8d, 0x5319, 0x5636, 0x59cb, 0x5aa4, 0x5c38, 0x5c4e, 0x5c4d, 0x5e02, 0x5f11, 0x6043, 0x65bd, 0x662f, 0x6642, 0x67be, 0x67f4, 0x731c, 0x77e2, 0x793a, 0x7fc5, 0x8494, 0x84cd, 0x8996, 0x8a66, 0x8a69, 0x8ae1, 0x8c55, 0x8c7a, 0x57f4, 0x5bd4, 0x5f0f, 0x606f, 0x62ed, 0x690d, 0x6b96, 0x6e5c, 0x7184, 0x7bd2, 0x8755, 0x8b58, 0x8efe, 0x98df, 0x98fe, 0x4f38, 0x4f81, 0x4fe1, 0x547b, 0x5a20, 0x5bb8, 0x613c, 0x65b0, 0x6668, 0x71fc, 0x7533, 0x795e, 0x7d33, 0x814e, 0x81e3, 0x8398, 0x85aa, 0x85ce, 0x8703, 0x8a0a, 0x8eab, 0x8f9b, 0xf971, 0x8fc5, 0x5931, 0x5ba4, 0x5be6, 0x6089, 0x5be9, 0x5c0b, 0x5fc3, 0x6c81, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe4a0[ 96 ] = { 0xfffd, 0xf972, 0x6df1, 0x700b, 0x751a, 0x82af, 0x8af6, 0x4ec0, 0x5341, 0xf973, 0x96d9, 0x6c0f, 0x4e9e, 0x4fc4, 0x5152, 0x555e, 0x5a25, 0x5ce8, 0x6211, 0x7259, 0x82bd, 0x83aa, 0x86fe, 0x8859, 0x8a1d, 0x963f, 0x96c5, 0x9913, 0x9d09, 0x9d5d, 0x580a, 0x5cb3, 0x5dbd, 0x5e44, 0x60e1, 0x6115, 0x63e1, 0x6a02, 0x6e25, 0x9102, 0x9354, 0x984e, 0x9c10, 0x9f77, 0x5b89, 0x5cb8, 0x6309, 0x664f, 0x6848, 0x773c, 0x96c1, 0x978d, 0x9854, 0x9b9f, 0x65a1, 0x8b01, 0x8ecb, 0x95bc, 0x5535, 0x5ca9, 0x5dd6, 0x5eb5, 0x6697, 0x764c, 0x83f4, 0x95c7, 0x58d3, 0x62bc, 0x72ce, 0x9d28, 0x4ef0, 0x592e, 0x600f, 0x663b, 0x6b83, 0x79e7, 0x9d26, 0x5393, 0x54c0, 0x57c3, 0x5d16, 0x611b, 0x66d6, 0x6daf, 0x788d, 0x827e, 0x9698, 0x9744, 0x5384, 0x627c, 0x6396, 0x6db2, 0x7e0a, 0x814b, 0x984d, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe5a0[ 96 ] = { 0xfffd, 0x6afb, 0x7f4c, 0x9daf, 0x9e1a, 0x4e5f, 0x503b, 0x51b6, 0x591c, 0x60f9, 0x63f6, 0x6930, 0x723a, 0x8036, 0xf974, 0x91ce, 0x5f31, 0xf975, 0xf976, 0x7d04, 0x82e5, 0x846f, 0x84bb, 0x85e5, 0x8e8d, 0xf977, 0x4f6f, 0xf978, 0xf979, 0x58e4, 0x5b43, 0x6059, 0x63da, 0x6518, 0x656d, 0x6698, 0xf97a, 0x694a, 0x6a23, 0x6d0b, 0x7001, 0x716c, 0x75d2, 0x760d, 0x79b3, 0x7a70, 0xf97b, 0x7f8a, 0xf97c, 0x8944, 0xf97d, 0x8b93, 0x91c0, 0x967d, 0xf97e, 0x990a, 0x5704, 0x5fa1, 0x65bc, 0x6f01, 0x7600, 0x79a6, 0x8a9e, 0x99ad, 0x9b5a, 0x9f6c, 0x5104, 0x61b6, 0x6291, 0x6a8d, 0x81c6, 0x5043, 0x5830, 0x5f66, 0x7109, 0x8a00, 0x8afa, 0x5b7c, 0x8616, 0x4ffa, 0x513c, 0x56b4, 0x5944, 0x63a9, 0x6df9, 0x5daa, 0x696d, 0x5186, 0x4e88, 0x4f59, 0xf97f, 0xf980, 0xf981, 0x5982, 0xf982, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe6a0[ 96 ] = { 0xfffd, 0xf983, 0x6b5f, 0x6c5d, 0xf984, 0x74b5, 0x7916, 0xf985, 0x8207, 0x8245, 0x8339, 0x8f3f, 0x8f5d, 0xf986, 0x9918, 0xf987, 0xf988, 0xf989, 0x4ea6, 0xf98a, 0x57df, 0x5f79, 0x6613, 0xf98b, 0xf98c, 0x75ab, 0x7e79, 0x8b6f, 0xf98d, 0x9006, 0x9a5b, 0x56a5, 0x5827, 0x59f8, 0x5a1f, 0x5bb4, 0xf98e, 0x5ef6, 0xf98f, 0xf990, 0x6350, 0x633b, 0xf991, 0x693d, 0x6c87, 0x6cbf, 0x6d8e, 0x6d93, 0x6df5, 0x6f14, 0xf992, 0x70df, 0x7136, 0x7159, 0xf993, 0x71c3, 0x71d5, 0xf994, 0x784f, 0x786f, 0xf995, 0x7b75, 0x7de3, 0xf996, 0x7e2f, 0xf997, 0x884d, 0x8edf, 0xf998, 0xf999, 0xf99a, 0x925b, 0xf99b, 0x9cf6, 0xf99c, 0xf99d, 0xf99e, 0x6085, 0x6d85, 0xf99f, 0x71b1, 0xf9a0, 0xf9a1, 0x95b1, 0x53ad, 0xf9a2, 0xf9a3, 0xf9a4, 0x67d3, 0xf9a5, 0x708e, 0x7130, 0x7430, 0x8276, 0x82d2, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe7a0[ 96 ] = { 0xfffd, 0xf9a6, 0x95bb, 0x9ae5, 0x9e7d, 0x66c4, 0xf9a7, 0x71c1, 0x8449, 0xf9a8, 0xf9a9, 0x584b, 0xf9aa, 0xf9ab, 0x5db8, 0x5f71, 0xf9ac, 0x6620, 0x668e, 0x6979, 0x69ae, 0x6c38, 0x6cf3, 0x6e36, 0x6f41, 0x6fda, 0x701b, 0x702f, 0x7150, 0x71df, 0x7370, 0xf9ad, 0x745b, 0xf9ae, 0x74d4, 0x76c8, 0x7a4e, 0x7e93, 0xf9af, 0xf9b0, 0x82f1, 0x8a60, 0x8fce, 0xf9b1, 0x9348, 0xf9b2, 0x9719, 0xf9b3, 0xf9b4, 0x4e42, 0x502a, 0xf9b5, 0x5208, 0x53e1, 0x66f3, 0x6c6d, 0x6fca, 0x730a, 0x777f, 0x7a62, 0x82ae, 0x85dd, 0x8602, 0xf9b6, 0x88d4, 0x8a63, 0x8b7d, 0x8c6b, 0xf9b7, 0x92b3, 0xf9b8, 0x9713, 0x9810, 0x4e94, 0x4f0d, 0x4fc9, 0x50b2, 0x5348, 0x543e, 0x5433, 0x55da, 0x5862, 0x58ba, 0x5967, 0x5a1b, 0x5be4, 0x609f, 0xf9b9, 0x61ca, 0x6556, 0x65ff, 0x6664, 0x68a7, 0x6c5a, 0x6fb3, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe8a0[ 96 ] = { 0xfffd, 0x70cf, 0x71ac, 0x7352, 0x7b7d, 0x8708, 0x8aa4, 0x9c32, 0x9f07, 0x5c4b, 0x6c83, 0x7344, 0x7389, 0x923a, 0x6eab, 0x7465, 0x761f, 0x7a69, 0x7e15, 0x860a, 0x5140, 0x58c5, 0x64c1, 0x74ee, 0x7515, 0x7670, 0x7fc1, 0x9095, 0x96cd, 0x9954, 0x6e26, 0x74e6, 0x7aa9, 0x7aaa, 0x81e5, 0x86d9, 0x8778, 0x8a1b, 0x5a49, 0x5b8c, 0x5b9b, 0x68a1, 0x6900, 0x6d63, 0x73a9, 0x7413, 0x742c, 0x7897, 0x7de9, 0x7feb, 0x8118, 0x8155, 0x839e, 0x8c4c, 0x962e, 0x9811, 0x66f0, 0x5f80, 0x65fa, 0x6789, 0x6c6a, 0x738b, 0x502d, 0x5a03, 0x6b6a, 0x77ee, 0x5916, 0x5d6c, 0x5dcd, 0x7325, 0x754f, 0xf9ba, 0xf9bb, 0x50e5, 0x51f9, 0x582f, 0x592d, 0x5996, 0x59da, 0x5be5, 0xf9bc, 0xf9bd, 0x5da2, 0x62d7, 0x6416, 0x6493, 0x64fe, 0xf9be, 0x66dc, 0xf9bf, 0x6a48, 0xf9c0, 0x71ff, 0x7464, 0xf9c1, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe9a0[ 96 ] = { 0xfffd, 0x7a88, 0x7aaf, 0x7e47, 0x7e5e, 0x8000, 0x8170, 0xf9c2, 0x87ef, 0x8981, 0x8b20, 0x9059, 0xf9c3, 0x9080, 0x9952, 0x617e, 0x6b32, 0x6d74, 0x7e1f, 0x8925, 0x8fb1, 0x4fd1, 0x50ad, 0x5197, 0x52c7, 0x57c7, 0x5889, 0x5bb9, 0x5eb8, 0x6142, 0x6995, 0x6d8c, 0x6e67, 0x6eb6, 0x7194, 0x7462, 0x7528, 0x752c, 0x8073, 0x8338, 0x84c9, 0x8e0a, 0x9394, 0x93de, 0xf9c4, 0x4e8e, 0x4f51, 0x5076, 0x512a, 0x53c8, 0x53cb, 0x53f3, 0x5b87, 0x5bd3, 0x5c24, 0x611a, 0x6182, 0x65f4, 0x725b, 0x7397, 0x7440, 0x76c2, 0x7950, 0x7991, 0x79b9, 0x7d06, 0x7fbd, 0x828b, 0x85d5, 0x865e, 0x8fc2, 0x9047, 0x90f5, 0x91ea, 0x9685, 0x96e8, 0x96e9, 0x52d6, 0x5f67, 0x65ed, 0x6631, 0x682f, 0x715c, 0x7a36, 0x90c1, 0x980a, 0x4e91, 0xf9c5, 0x6a52, 0x6b9e, 0x6f90, 0x7189, 0x8018, 0x82b8, 0x8553, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeaa0[ 96 ] = { 0xfffd, 0x904b, 0x9695, 0x96f2, 0x97fb, 0x851a, 0x9b31, 0x4e90, 0x718a, 0x96c4, 0x5143, 0x539f, 0x54e1, 0x5713, 0x5712, 0x57a3, 0x5a9b, 0x5ac4, 0x5bc3, 0x6028, 0x613f, 0x63f4, 0x6c85, 0x6d39, 0x6e72, 0x6e90, 0x7230, 0x733f, 0x7457, 0x82d1, 0x8881, 0x8f45, 0x9060, 0xf9c6, 0x9662, 0x9858, 0x9d1b, 0x6708, 0x8d8a, 0x925e, 0x4f4d, 0x5049, 0x50de, 0x5371, 0x570d, 0x59d4, 0x5a01, 0x5c09, 0x6170, 0x6690, 0x6e2d, 0x7232, 0x744b, 0x7def, 0x80c3, 0x840e, 0x8466, 0x853f, 0x875f, 0x885b, 0x8918, 0x8b02, 0x9055, 0x97cb, 0x9b4f, 0x4e73, 0x4f91, 0x5112, 0x516a, 0xf9c7, 0x552f, 0x55a9, 0x5b7a, 0x5ba5, 0x5e7c, 0x5e7d, 0x5ebe, 0x60a0, 0x60df, 0x6108, 0x6109, 0x63c4, 0x6538, 0x6709, 0xf9c8, 0x67d4, 0x67da, 0xf9c9, 0x6961, 0x6962, 0x6cb9, 0x6d27, 0xf9ca, 0x6e38, 0xf9cb, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeba0[ 96 ] = { 0xfffd, 0x6fe1, 0x7336, 0x7337, 0xf9cc, 0x745c, 0x7531, 0xf9cd, 0x7652, 0xf9ce, 0xf9cf, 0x7dad, 0x81fe, 0x8438, 0x88d5, 0x8a98, 0x8adb, 0x8aed, 0x8e30, 0x8e42, 0x904a, 0x903e, 0x907a, 0x9149, 0x91c9, 0x936e, 0xf9d0, 0xf9d1, 0x5809, 0xf9d2, 0x6bd3, 0x8089, 0x80b2, 0xf9d3, 0xf9d4, 0x5141, 0x596b, 0x5c39, 0xf9d5, 0xf9d6, 0x6f64, 0x73a7, 0x80e4, 0x8d07, 0xf9d7, 0x9217, 0x958f, 0xf9d8, 0xf9d9, 0xf9da, 0xf9db, 0x807f, 0x620e, 0x701c, 0x7d68, 0x878d, 0xf9dc, 0x57a0, 0x6069, 0x6147, 0x6bb7, 0x8abe, 0x9280, 0x96b1, 0x4e59, 0x541f, 0x6deb, 0x852d, 0x9670, 0x97f3, 0x98ee, 0x63d6, 0x6ce3, 0x9091, 0x51dd, 0x61c9, 0x81ba, 0x9df9, 0x4f9d, 0x501a, 0x5100, 0x5b9c, 0x610f, 0x61ff, 0x64ec, 0x6905, 0x6bc5, 0x7591, 0x77e3, 0x7fa9, 0x8264, 0x858f, 0x87fb, 0x8863, 0x8abc, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeca0[ 96 ] = { 0xfffd, 0x8b70, 0x91ab, 0x4e8c, 0x4ee5, 0x4f0a, 0xf9dd, 0xf9de, 0x5937, 0x59e8, 0xf9df, 0x5df2, 0x5f1b, 0x5f5b, 0x6021, 0xf9e0, 0xf9e1, 0xf9e2, 0xf9e3, 0x723e, 0x73e5, 0xf9e4, 0x7570, 0x75cd, 0xf9e5, 0x79fb, 0xf9e6, 0x800c, 0x8033, 0x8084, 0x82e1, 0x8351, 0xf9e7, 0xf9e8, 0x8cbd, 0x8cb3, 0x9087, 0xf9e9, 0xf9ea, 0x98f4, 0x990c, 0xf9eb, 0xf9ec, 0x7037, 0x76ca, 0x7fca, 0x7fcc, 0x7ffc, 0x8b1a, 0x4eba, 0x4ec1, 0x5203, 0x5370, 0xf9ed, 0x54bd, 0x56e0, 0x59fb, 0x5bc5, 0x5f15, 0x5fcd, 0x6e6e, 0xf9ee, 0xf9ef, 0x7d6a, 0x8335, 0xf9f0, 0x8693, 0x8a8d, 0xf9f1, 0x976d, 0x9777, 0xf9f2, 0xf9f3, 0x4e00, 0x4f5a, 0x4f7e, 0x58f9, 0x65e5, 0x6ea2, 0x9038, 0x93b0, 0x99b9, 0x4efb, 0x58ec, 0x598a, 0x59d9, 0x6041, 0xf9f4, 0xf9f5, 0x7a14, 0xf9f6, 0x834f, 0x8cc3, 0x5165, 0x5344, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeda0[ 96 ] = { 0xfffd, 0xf9f7, 0xf9f8, 0xf9f9, 0x4ecd, 0x5269, 0x5b55, 0x82bf, 0x4ed4, 0x523a, 0x54a8, 0x59c9, 0x59ff, 0x5b50, 0x5b57, 0x5b5c, 0x6063, 0x6148, 0x6ecb, 0x7099, 0x716e, 0x7386, 0x74f7, 0x75b5, 0x78c1, 0x7d2b, 0x8005, 0x81ea, 0x8328, 0x8517, 0x85c9, 0x8aee, 0x8cc7, 0x96cc, 0x4f5c, 0x52fa, 0x56bc, 0x65ab, 0x6628, 0x707c, 0x70b8, 0x7235, 0x7dbd, 0x828d, 0x914c, 0x96c0, 0x9d72, 0x5b71, 0x68e7, 0x6b98, 0x6f7a, 0x76de, 0x5c91, 0x66ab, 0x6f5b, 0x7bb4, 0x7c2a, 0x8836, 0x96dc, 0x4e08, 0x4ed7, 0x5320, 0x5834, 0x58bb, 0x58ef, 0x596c, 0x5c07, 0x5e33, 0x5e84, 0x5f35, 0x638c, 0x66b2, 0x6756, 0x6a1f, 0x6aa3, 0x6b0c, 0x6f3f, 0x7246, 0xf9fa, 0x7350, 0x748b, 0x7ae0, 0x7ca7, 0x8178, 0x81df, 0x81e7, 0x838a, 0x846c, 0x8523, 0x8594, 0x85cf, 0x88dd, 0x8d13, 0x91ac, 0x9577, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeea0[ 96 ] = { 0xfffd, 0x969c, 0x518d, 0x54c9, 0x5728, 0x5bb0, 0x624d, 0x6750, 0x683d, 0x6893, 0x6e3d, 0x6ed3, 0x707d, 0x7e21, 0x88c1, 0x8ca1, 0x8f09, 0x9f4b, 0x9f4e, 0x722d, 0x7b8f, 0x8acd, 0x931a, 0x4f47, 0x4f4e, 0x5132, 0x5480, 0x59d0, 0x5e95, 0x62b5, 0x6775, 0x696e, 0x6a17, 0x6cae, 0x6e1a, 0x72d9, 0x732a, 0x75bd, 0x7bb8, 0x7d35, 0x82e7, 0x83f9, 0x8457, 0x85f7, 0x8a5b, 0x8caf, 0x8e87, 0x9019, 0x90b8, 0x96ce, 0x9f5f, 0x52e3, 0x540a, 0x5ae1, 0x5bc2, 0x6458, 0x6575, 0x6ef4, 0x72c4, 0xf9fb, 0x7684, 0x7a4d, 0x7b1b, 0x7c4d, 0x7e3e, 0x7fdf, 0x837b, 0x8b2b, 0x8cca, 0x8d64, 0x8de1, 0x8e5f, 0x8fea, 0x8ff9, 0x9069, 0x93d1, 0x4f43, 0x4f7a, 0x50b3, 0x5168, 0x5178, 0x524d, 0x526a, 0x5861, 0x587c, 0x5960, 0x5c08, 0x5c55, 0x5edb, 0x609b, 0x6230, 0x6813, 0x6bbf, 0x6c08, 0x6fb1, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xefa0[ 96 ] = { 0xfffd, 0x714e, 0x7420, 0x7530, 0x7538, 0x7551, 0x7672, 0x7b4c, 0x7b8b, 0x7bad, 0x7bc6, 0x7e8f, 0x8a6e, 0x8f3e, 0x8f49, 0x923f, 0x9293, 0x9322, 0x942b, 0x96fb, 0x985a, 0x986b, 0x991e, 0x5207, 0x622a, 0x6298, 0x6d59, 0x7664, 0x7aca, 0x7bc0, 0x7d76, 0x5360, 0x5cbe, 0x5e97, 0x6f38, 0x70b9, 0x7c98, 0x9711, 0x9b8e, 0x9ede, 0x63a5, 0x647a, 0x8776, 0x4e01, 0x4e95, 0x4ead, 0x505c, 0x5075, 0x5448, 0x59c3, 0x5b9a, 0x5e40, 0x5ead, 0x5ef7, 0x5f81, 0x60c5, 0x633a, 0x653f, 0x6574, 0x65cc, 0x6676, 0x6678, 0x67fe, 0x6968, 0x6a89, 0x6b63, 0x6c40, 0x6dc0, 0x6de8, 0x6e1f, 0x6e5e, 0x701e, 0x70a1, 0x738e, 0x73fd, 0x753a, 0x775b, 0x7887, 0x798e, 0x7a0b, 0x7a7d, 0x7cbe, 0x7d8e, 0x8247, 0x8a02, 0x8aea, 0x8c9e, 0x912d, 0x914a, 0x91d8, 0x9266, 0x92cc, 0x9320, 0x9706, 0x9756, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf0a0[ 96 ] = { 0xfffd, 0x975c, 0x9802, 0x9f0e, 0x5236, 0x5291, 0x557c, 0x5824, 0x5e1d, 0x5f1f, 0x608c, 0x63d0, 0x68af, 0x6fdf, 0x796d, 0x7b2c, 0x81cd, 0x85ba, 0x88fd, 0x8af8, 0x8e44, 0x918d, 0x9664, 0x969b, 0x973d, 0x984c, 0x9f4a, 0x4fce, 0x5146, 0x51cb, 0x52a9, 0x5632, 0x5f14, 0x5f6b, 0x63aa, 0x64cd, 0x65e9, 0x6641, 0x66fa, 0x66f9, 0x671d, 0x689d, 0x68d7, 0x69fd, 0x6f15, 0x6f6e, 0x7167, 0x71e5, 0x722a, 0x74aa, 0x773a, 0x7956, 0x795a, 0x79df, 0x7a20, 0x7a95, 0x7c97, 0x7cdf, 0x7d44, 0x7e70, 0x8087, 0x85fb, 0x86a4, 0x8a54, 0x8abf, 0x8d99, 0x8e81, 0x9020, 0x906d, 0x91e3, 0x963b, 0x96d5, 0x9ce5, 0x65cf, 0x7c07, 0x8db3, 0x93c3, 0x5b58, 0x5c0a, 0x5352, 0x62d9, 0x731d, 0x5027, 0x5b97, 0x5f9e, 0x60b0, 0x616b, 0x68d5, 0x6dd9, 0x742e, 0x7a2e, 0x7d42, 0x7d9c, 0x7e31, 0x816b, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf1a0[ 96 ] = { 0xfffd, 0x8e2a, 0x8e35, 0x937e, 0x9418, 0x4f50, 0x5750, 0x5de6, 0x5ea7, 0x632b, 0x7f6a, 0x4e3b, 0x4f4f, 0x4f8f, 0x505a, 0x59dd, 0x80c4, 0x546a, 0x5468, 0x55fe, 0x594f, 0x5b99, 0x5dde, 0x5eda, 0x665d, 0x6731, 0x67f1, 0x682a, 0x6ce8, 0x6d32, 0x6e4a, 0x6f8d, 0x70b7, 0x73e0, 0x7587, 0x7c4c, 0x7d02, 0x7d2c, 0x7da2, 0x821f, 0x86db, 0x8a3b, 0x8a85, 0x8d70, 0x8e8a, 0x8f33, 0x9031, 0x914e, 0x9152, 0x9444, 0x99d0, 0x7af9, 0x7ca5, 0x4fca, 0x5101, 0x51c6, 0x57c8, 0x5bef, 0x5cfb, 0x6659, 0x6a3d, 0x6d5a, 0x6e96, 0x6fec, 0x710c, 0x756f, 0x7ae3, 0x8822, 0x9021, 0x9075, 0x96cb, 0x99ff, 0x8301, 0x4e2d, 0x4ef2, 0x8846, 0x91cd, 0x537d, 0x6adb, 0x696b, 0x6c41, 0x847a, 0x589e, 0x618e, 0x66fe, 0x62ef, 0x70dd, 0x7511, 0x75c7, 0x7e52, 0x84b8, 0x8b49, 0x8d08, 0x4e4b, 0x53ea, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf2a0[ 96 ] = { 0xfffd, 0x54ab, 0x5730, 0x5740, 0x5fd7, 0x6301, 0x6307, 0x646f, 0x652f, 0x65e8, 0x667a, 0x679d, 0x67b3, 0x6b62, 0x6c60, 0x6c9a, 0x6f2c, 0x77e5, 0x7825, 0x7949, 0x7957, 0x7d19, 0x80a2, 0x8102, 0x81f3, 0x829d, 0x82b7, 0x8718, 0x8a8c, 0xf9fc, 0x8d04, 0x8dbe, 0x9072, 0x76f4, 0x7a19, 0x7a37, 0x7e54, 0x8077, 0x5507, 0x55d4, 0x5875, 0x632f, 0x6422, 0x6649, 0x664b, 0x686d, 0x699b, 0x6b84, 0x6d25, 0x6eb1, 0x73cd, 0x7468, 0x74a1, 0x755b, 0x75b9, 0x76e1, 0x771e, 0x778b, 0x79e6, 0x7e09, 0x7e1d, 0x81fb, 0x852f, 0x8897, 0x8a3a, 0x8cd1, 0x8eeb, 0x8fb0, 0x9032, 0x93ad, 0x9663, 0x9673, 0x9707, 0x4f84, 0x53f1, 0x59ea, 0x5ac9, 0x5e19, 0x684e, 0x74c6, 0x75be, 0x79e9, 0x7a92, 0x81a3, 0x86ed, 0x8cea, 0x8dcc, 0x8fed, 0x659f, 0x6715, 0xf9fd, 0x57f7, 0x6f57, 0x7ddd, 0x8f2f, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf3a0[ 96 ] = { 0xfffd, 0x93f6, 0x96c6, 0x5fb5, 0x61f2, 0x6f84, 0x4e14, 0x4f98, 0x501f, 0x53c9, 0x55df, 0x5d6f, 0x5dee, 0x6b21, 0x6b64, 0x78cb, 0x7b9a, 0xf9fe, 0x8e49, 0x8eca, 0x906e, 0x6349, 0x643e, 0x7740, 0x7a84, 0x932f, 0x947f, 0x9f6a, 0x64b0, 0x6faf, 0x71e6, 0x74a8, 0x74da, 0x7ac4, 0x7c12, 0x7e82, 0x7cb2, 0x7e98, 0x8b9a, 0x8d0a, 0x947d, 0x9910, 0x994c, 0x5239, 0x5bdf, 0x64e6, 0x672d, 0x7d2e, 0x50ed, 0x53c3, 0x5879, 0x6158, 0x6159, 0x61fa, 0x65ac, 0x7ad9, 0x8b92, 0x8b96, 0x5009, 0x5021, 0x5275, 0x5531, 0x5a3c, 0x5ee0, 0x5f70, 0x6134, 0x655e, 0x660c, 0x6636, 0x66a2, 0x69cd, 0x6ec4, 0x6f32, 0x7316, 0x7621, 0x7a93, 0x8139, 0x8259, 0x83d6, 0x84bc, 0x50b5, 0x57f0, 0x5bc0, 0x5be8, 0x5f69, 0x63a1, 0x7826, 0x7db5, 0x83dc, 0x8521, 0x91c7, 0x91f5, 0x518a, 0x67f5, 0x7b56, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf4a0[ 96 ] = { 0xfffd, 0x8cac, 0x51c4, 0x59bb, 0x60bd, 0x8655, 0x501c, 0xf9ff, 0x5254, 0x5c3a, 0x617d, 0x621a, 0x62d3, 0x64f2, 0x65a5, 0x6ecc, 0x7620, 0x810a, 0x8e60, 0x965f, 0x96bb, 0x4edf, 0x5343, 0x5598, 0x5929, 0x5ddd, 0x64c5, 0x6cc9, 0x6dfa, 0x7394, 0x7a7f, 0x821b, 0x85a6, 0x8ce4, 0x8e10, 0x9077, 0x91e7, 0x95e1, 0x9621, 0x97c6, 0x51f8, 0x54f2, 0x5586, 0x5fb9, 0x64a4, 0x6f88, 0x7db4, 0x8f1f, 0x8f4d, 0x9435, 0x50c9, 0x5c16, 0x6cbe, 0x6dfb, 0x751b, 0x77bb, 0x7c3d, 0x7c64, 0x8a79, 0x8ac2, 0x581e, 0x59be, 0x5e16, 0x6377, 0x7252, 0x758a, 0x776b, 0x8adc, 0x8cbc, 0x8f12, 0x5ef3, 0x6674, 0x6df8, 0x807d, 0x83c1, 0x8acb, 0x9751, 0x9bd6, 0xfa00, 0x5243, 0x66ff, 0x6d95, 0x6eef, 0x7de0, 0x8ae6, 0x902e, 0x905e, 0x9ad4, 0x521d, 0x527f, 0x54e8, 0x6194, 0x6284, 0x62db, 0x68a2, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf5a0[ 96 ] = { 0xfffd, 0x6912, 0x695a, 0x6a35, 0x7092, 0x7126, 0x785d, 0x7901, 0x790e, 0x79d2, 0x7a0d, 0x8096, 0x8278, 0x82d5, 0x8349, 0x8549, 0x8c82, 0x8d85, 0x9162, 0x918b, 0x91ae, 0x4fc3, 0x56d1, 0x71ed, 0x77d7, 0x8700, 0x89f8, 0x5bf8, 0x5fd6, 0x6751, 0x90a8, 0x53e2, 0x585a, 0x5bf5, 0x60a4, 0x6181, 0x6460, 0x7e3d, 0x8070, 0x8525, 0x9283, 0x64ae, 0x50ac, 0x5d14, 0x6700, 0x589c, 0x62bd, 0x63a8, 0x690e, 0x6978, 0x6a1e, 0x6e6b, 0x76ba, 0x79cb, 0x82bb, 0x8429, 0x8acf, 0x8da8, 0x8ffd, 0x9112, 0x914b, 0x919c, 0x9310, 0x9318, 0x939a, 0x96db, 0x9a36, 0x9c0d, 0x4e11, 0x755c, 0x795d, 0x7afa, 0x7b51, 0x7bc9, 0x7e2e, 0x84c4, 0x8e59, 0x8e74, 0x8ef8, 0x9010, 0x6625, 0x693f, 0x7443, 0x51fa, 0x672e, 0x9edc, 0x5145, 0x5fe0, 0x6c96, 0x87f2, 0x885d, 0x8877, 0x60b4, 0x81b5, 0x8403, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf6a0[ 96 ] = { 0xfffd, 0x8d05, 0x53d6, 0x5439, 0x5634, 0x5a36, 0x5c31, 0x708a, 0x7fe0, 0x805a, 0x8106, 0x81ed, 0x8da3, 0x9189, 0x9a5f, 0x9df2, 0x5074, 0x4ec4, 0x53a0, 0x60fb, 0x6e2c, 0x5c64, 0x4f88, 0x5024, 0x55e4, 0x5cd9, 0x5e5f, 0x6065, 0x6894, 0x6cbb, 0x6dc4, 0x71be, 0x75d4, 0x75f4, 0x7661, 0x7a1a, 0x7a49, 0x7dc7, 0x7dfb, 0x7f6e, 0x81f4, 0x86a9, 0x8f1c, 0x96c9, 0x99b3, 0x9f52, 0x5247, 0x52c5, 0x98ed, 0x89aa, 0x4e03, 0x67d2, 0x6f06, 0x4fb5, 0x5be2, 0x6795, 0x6c88, 0x6d78, 0x741b, 0x7827, 0x91dd, 0x937c, 0x87c4, 0x79e4, 0x7a31, 0x5feb, 0x4ed6, 0x54a4, 0x553e, 0x58ae, 0x59a5, 0x60f0, 0x6253, 0x62d6, 0x6736, 0x6955, 0x8235, 0x9640, 0x99b1, 0x99dd, 0x502c, 0x5353, 0x5544, 0x577c, 0xfa01, 0x6258, 0xfa02, 0x64e2, 0x666b, 0x67dd, 0x6fc1, 0x6fef, 0x7422, 0x7438, 0x8a17, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf7a0[ 96 ] = { 0xfffd, 0x9438, 0x5451, 0x5606, 0x5766, 0x5f48, 0x619a, 0x6b4e, 0x7058, 0x70ad, 0x7dbb, 0x8a95, 0x596a, 0x812b, 0x63a2, 0x7708, 0x803d, 0x8caa, 0x5854, 0x642d, 0x69bb, 0x5b95, 0x5e11, 0x6e6f, 0xfa03, 0x8569, 0x514c, 0x53f0, 0x592a, 0x6020, 0x614b, 0x6b86, 0x6c70, 0x6cf0, 0x7b1e, 0x80ce, 0x82d4, 0x8dc6, 0x90b0, 0x98b1, 0xfa04, 0x64c7, 0x6fa4, 0x6491, 0x6504, 0x514e, 0x5410, 0x571f, 0x8a0e, 0x615f, 0x6876, 0xfa05, 0x75db, 0x7b52, 0x7d71, 0x901a, 0x5806, 0x69cc, 0x817f, 0x892a, 0x9000, 0x9839, 0x5078, 0x5957, 0x59ac, 0x6295, 0x900f, 0x9b2a, 0x615d, 0x7279, 0x95d6, 0x5761, 0x5a46, 0x5df4, 0x628a, 0x64ad, 0x64fa, 0x6777, 0x6ce2, 0x6d3e, 0x722c, 0x7436, 0x7834, 0x7f77, 0x82ad, 0x8ddb, 0x9817, 0x5224, 0x5742, 0x677f, 0x7248, 0x74e3, 0x8ca9, 0x8fa6, 0x9211, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf8a0[ 96 ] = { 0xfffd, 0x962a, 0x516b, 0x53ed, 0x634c, 0x4f69, 0x5504, 0x6096, 0x6557, 0x6c9b, 0x6d7f, 0x724c, 0x72fd, 0x7a17, 0x8987, 0x8c9d, 0x5f6d, 0x6f8e, 0x70f9, 0x81a8, 0x610e, 0x4fbf, 0x504f, 0x6241, 0x7247, 0x7bc7, 0x7de8, 0x7fe9, 0x904d, 0x97ad, 0x9a19, 0x8cb6, 0x576a, 0x5e73, 0x67b0, 0x840d, 0x8a55, 0x5420, 0x5b16, 0x5e63, 0x5ee2, 0x5f0a, 0x6583, 0x80ba, 0x853d, 0x9589, 0x965b, 0x4f48, 0x5305, 0x530d, 0x530f, 0x5486, 0x54fa, 0x5703, 0x5e03, 0x6016, 0x629b, 0x62b1, 0x6355, 0xfa06, 0x6ce1, 0x6d66, 0x75b1, 0x7832, 0x80de, 0x812f, 0x82de, 0x8461, 0x84b2, 0x888d, 0x8912, 0x900b, 0x92ea, 0x98fd, 0x9b91, 0x5e45, 0x66b4, 0x66dd, 0x7011, 0x7206, 0xfa07, 0x4ff5, 0x527d, 0x5f6a, 0x6153, 0x6753, 0x6a19, 0x6f02, 0x74e2, 0x7968, 0x8868, 0x8c79, 0x98c7, 0x98c4, 0x9a43, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf9a0[ 96 ] = { 0xfffd, 0x54c1, 0x7a1f, 0x6953, 0x8af7, 0x8c4a, 0x98a8, 0x99ae, 0x5f7c, 0x62ab, 0x75b2, 0x76ae, 0x88ab, 0x907f, 0x9642, 0x5339, 0x5f3c, 0x5fc5, 0x6ccc, 0x73cc, 0x7562, 0x758b, 0x7b46, 0x82fe, 0x999d, 0x4e4f, 0x903c, 0x4e0b, 0x4f55, 0x53a6, 0x590f, 0x5ec8, 0x6630, 0x6cb3, 0x7455, 0x8377, 0x8766, 0x8cc0, 0x9050, 0x971e, 0x9c15, 0x58d1, 0x5b78, 0x8650, 0x8b14, 0x9db4, 0x5bd2, 0x6068, 0x608d, 0x65f1, 0x6c57, 0x6f22, 0x6fa3, 0x701a, 0x7f55, 0x7ff0, 0x9591, 0x9592, 0x9650, 0x97d3, 0x5272, 0x8f44, 0x51fd, 0x542b, 0x54b8, 0x5563, 0x558a, 0x6abb, 0x6db5, 0x7dd8, 0x8266, 0x929c, 0x9677, 0x9e79, 0x5408, 0x54c8, 0x76d2, 0x86e4, 0x95a4, 0x95d4, 0x965c, 0x4ea2, 0x4f09, 0x59ee, 0x5ae6, 0x5df7, 0x6052, 0x6297, 0x676d, 0x6841, 0x6c86, 0x6e2f, 0x7f38, 0x809b, 0x822a, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfaa0[ 96 ] = { 0xfffd, 0xfa08, 0xfa09, 0x9805, 0x4ea5, 0x5055, 0x54b3, 0x5793, 0x595a, 0x5b69, 0x5bb3, 0x61c8, 0x6977, 0x6d77, 0x7023, 0x87f9, 0x89e3, 0x8a72, 0x8ae7, 0x9082, 0x99ed, 0x9ab8, 0x52be, 0x6838, 0x5016, 0x5e78, 0x674f, 0x8347, 0x884c, 0x4eab, 0x5411, 0x56ae, 0x73e6, 0x9115, 0x97ff, 0x9909, 0x9957, 0x9999, 0x5653, 0x589f, 0x865b, 0x8a31, 0x61b2, 0x6af6, 0x737b, 0x8ed2, 0x6b47, 0x96aa, 0x9a57, 0x5955, 0x7200, 0x8d6b, 0x9769, 0x4fd4, 0x5cf4, 0x5f26, 0x61f8, 0x665b, 0x6ceb, 0x70ab, 0x7384, 0x73b9, 0x73fe, 0x7729, 0x774d, 0x7d43, 0x7d62, 0x7e23, 0x8237, 0x8852, 0xfa0a, 0x8ce2, 0x9249, 0x986f, 0x5b51, 0x7a74, 0x8840, 0x9801, 0x5acc, 0x4fe0, 0x5354, 0x593e, 0x5cfd, 0x633e, 0x6d79, 0x72f9, 0x8105, 0x8107, 0x83a2, 0x92cf, 0x9830, 0x4ea8, 0x5144, 0x5211, 0x578b, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfba0[ 96 ] = { 0xfffd, 0x5f62, 0x6cc2, 0x6ece, 0x7005, 0x7050, 0x70af, 0x7192, 0x73e9, 0x7469, 0x834a, 0x87a2, 0x8861, 0x9008, 0x90a2, 0x93a3, 0x99a8, 0x516e, 0x5f57, 0x60e0, 0x6167, 0x66b3, 0x8559, 0x8e4a, 0x91af, 0x978b, 0x4e4e, 0x4e92, 0x547c, 0x58d5, 0x58fa, 0x597d, 0x5cb5, 0x5f27, 0x6236, 0x6248, 0x660a, 0x6667, 0x6beb, 0x6d69, 0x6dcf, 0x6e56, 0x6ef8, 0x6f94, 0x6fe0, 0x6fe9, 0x705d, 0x72d0, 0x7425, 0x745a, 0x74e0, 0x7693, 0x795c, 0x7cca, 0x7e1e, 0x80e1, 0x82a6, 0x846b, 0x84bf, 0x864e, 0x865f, 0x8774, 0x8b77, 0x8c6a, 0x93ac, 0x9800, 0x9865, 0x60d1, 0x6216, 0x9177, 0x5a5a, 0x660f, 0x6df7, 0x6e3e, 0x743f, 0x9b42, 0x5ffd, 0x60da, 0x7b0f, 0x54c4, 0x5f18, 0x6c5e, 0x6cd3, 0x6d2a, 0x70d8, 0x7d05, 0x8679, 0x8a0c, 0x9d3b, 0x5316, 0x548c, 0x5b05, 0x6a3a, 0x706b, 0x7575, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfca0[ 96 ] = { 0xfffd, 0x798d, 0x79be, 0x82b1, 0x83ef, 0x8a71, 0x8b41, 0x8ca8, 0x9774, 0xfa0b, 0x64f4, 0x652b, 0x78ba, 0x78bb, 0x7a6b, 0x4e38, 0x559a, 0x5950, 0x5ba6, 0x5e7b, 0x60a3, 0x63db, 0x6b61, 0x6665, 0x6853, 0x6e19, 0x7165, 0x74b0, 0x7d08, 0x9084, 0x9a69, 0x9c25, 0x6d3b, 0x6ed1, 0x733e, 0x8c41, 0x95ca, 0x51f0, 0x5e4c, 0x5fa8, 0x604d, 0x60f6, 0x6130, 0x614c, 0x6643, 0x6644, 0x69a5, 0x6cc1, 0x6e5f, 0x6ec9, 0x6f62, 0x714c, 0x749c, 0x7687, 0x7bc1, 0x7c27, 0x8352, 0x8757, 0x9051, 0x968d, 0x9ec3, 0x532f, 0x56de, 0x5efb, 0x5f8a, 0x6062, 0x6094, 0x61f7, 0x6666, 0x6703, 0x6a9c, 0x6dee, 0x6fae, 0x7070, 0x736a, 0x7e6a, 0x81be, 0x8334, 0x86d4, 0x8aa8, 0x8cc4, 0x5283, 0x7372, 0x5b96, 0x6a6b, 0x9404, 0x54ee, 0x5686, 0x5b5d, 0x6548, 0x6585, 0x66c9, 0x689f, 0x6d8d, 0x6dc6, 0xfffd }; const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfda0[ 96 ] = { 0xfffd, 0x723b, 0x80b4, 0x9175, 0x9a4d, 0x4faf, 0x5019, 0x539a, 0x540e, 0x543c, 0x5589, 0x55c5, 0x5e3f, 0x5f8c, 0x673d, 0x7166, 0x73dd, 0x9005, 0x52db, 0x52f3, 0x5864, 0x58ce, 0x7104, 0x718f, 0x71fb, 0x85b0, 0x8a13, 0x6688, 0x85a8, 0x55a7, 0x6684, 0x714a, 0x8431, 0x5349, 0x5599, 0x6bc1, 0x5f59, 0x5fbd, 0x63ee, 0x6689, 0x7147, 0x8af1, 0x8f1d, 0x9ebe, 0x4f11, 0x643a, 0x70cb, 0x7566, 0x8667, 0x6064, 0x8b4e, 0x9df8, 0x5147, 0x51f6, 0x5308, 0x6d36, 0x80f8, 0x9ed1, 0x6615, 0x6b23, 0x7098, 0x75d5, 0x5403, 0x5c79, 0x7d07, 0x8a16, 0x6b20, 0x6b3d, 0x6b46, 0x5438, 0x6070, 0x6d3d, 0x7fd5, 0x8208, 0x50d6, 0x51de, 0x559c, 0x566b, 0x56cd, 0x59ec, 0x5b09, 0x5e0c, 0x6199, 0x6198, 0x6231, 0x665e, 0x66e6, 0x7199, 0x71b9, 0x71ba, 0x72a7, 0x79a7, 0x7a00, 0x7fb2, 0x8a70, 0xfffd }; /* Unicode to ASCII character lookup table for Windows 949 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0x0080[ 256 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaea2, 0x001a, 0x001a, 0xb4a2, 0x001a, 0x001a, 0xd7a1, 0xa7a1, 0x001a, 0xa3a8, 0x001a, 0x001a, 0xa9a1, 0xe7a2, 0x001a, 0xc6a1, 0xbea1, 0xf7a9, 0xf8a9, 0xa5a2, 0x001a, 0xd2a2, 0xa4a1, 0xaca2, 0xf6a9, 0xaca8, 0x001a, 0xf9a8, 0xf6a8, 0xfaa8, 0xafa2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfa1, 0xaaa8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xada8, 0xaca9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0a1, 0xaaa9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xada9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a8, 0xa4a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5a9, 0xa6a8, 0xa6a9, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8a8, 0xa8a9, 0xa9a8, 0xa9a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0a9, 0xafa8, 0xafa9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaba8, 0xaba9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaea8, 0xaea9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0x02c0[ 448 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8a2, 0xaba2, 0xaaa2, 0xada2, 0x001a, 0xa9a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1a5, 0xc2a5, 0xc3a5, 0xc4a5, 0xc5a5, 0xc6a5, 0xc7a5, 0xc8a5, 0xc9a5, 0xcaa5, 0xcba5, 0xcca5, 0xcda5, 0xcea5, 0xcfa5, 0xd0a5, 0xd1a5, 0x001a, 0xd2a5, 0xd3a5, 0xd4a5, 0xd5a5, 0xd6a5, 0xd7a5, 0xd8a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1a5, 0xe2a5, 0xe3a5, 0xe4a5, 0xe5a5, 0xe6a5, 0xe7a5, 0xe8a5, 0xe9a5, 0xeaa5, 0xeba5, 0xeca5, 0xeda5, 0xeea5, 0xefa5, 0xf0a5, 0xf1a5, 0x001a, 0xf2a5, 0xf3a5, 0xf4a5, 0xf5a5, 0xf6a5, 0xf7a5, 0xf8a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7ac, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1ac, 0xa2ac, 0xa3ac, 0xa4ac, 0xa5ac, 0xa6ac, 0xa8ac, 0xa9ac, 0xaaac, 0xabac, 0xacac, 0xadac, 0xaeac, 0xafac, 0xb0ac, 0xb1ac, 0xb2ac, 0xb3ac, 0xb4ac, 0xb5ac, 0xb6ac, 0xb7ac, 0xb8ac, 0xb9ac, 0xbaac, 0xbbac, 0xbcac, 0xbdac, 0xbeac, 0xbfac, 0xc0ac, 0xc1ac, 0xd1ac, 0xd2ac, 0xd3ac, 0xd4ac, 0xd5ac, 0xd6ac, 0xd8ac, 0xd9ac, 0xdaac, 0xdbac, 0xdcac, 0xddac, 0xdeac, 0xdfac, 0xe0ac, 0xe1ac, 0xe2ac, 0xe3ac, 0xe4ac, 0xe5ac, 0xe6ac, 0xe7ac, 0xe8ac, 0xe9ac, 0xeaac, 0xebac, 0xecac, 0xedac, 0xeeac, 0xefac, 0xf0ac, 0xf1ac, 0x001a, 0xd7ac, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0x2000[ 1664 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaa1, 0x001a, 0x001a, 0xaea1, 0xafa1, 0x001a, 0x001a, 0xb0a1, 0xb1a1, 0x001a, 0x001a, 0xd3a2, 0xd4a2, 0x001a, 0x001a, 0x001a, 0xa5a1, 0xa6a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6a2, 0x001a, 0xc7a1, 0xc8a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaa9, 0x001a, 0xfba9, 0xfca9, 0xfda9, 0xfea9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a7, 0x001a, 0x001a, 0xe0a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5a2, 0xe2a2, 0x001a, 0x001a, 0x001a, 0xd9a7, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaa1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7a8, 0xf8a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfba8, 0xfca8, 0xfda8, 0xfea8, 0x001a, 0xb0a5, 0xb1a5, 0xb2a5, 0xb3a5, 0xb4a5, 0xb5a5, 0xb6a5, 0xb7a5, 0xb8a5, 0xb9a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a5, 0xa2a5, 0xa3a5, 0xa4a5, 0xa5a5, 0xa6a5, 0xa7a5, 0xa8a5, 0xa9a5, 0xaaa5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7a1, 0xe8a1, 0xe6a1, 0xe9a1, 0xeaa1, 0xd5a2, 0xd8a2, 0xd6a2, 0xd9a2, 0xd7a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a2, 0x001a, 0xa2a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3a2, 0x001a, 0xd3a1, 0xa4a2, 0x001a, 0x001a, 0x001a, 0xd4a1, 0xf4a1, 0x001a, 0x001a, 0xf5a1, 0x001a, 0x001a, 0x001a, 0xb3a2, 0x001a, 0xb2a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeea1, 0x001a, 0x001a, 0xf0a1, 0xc4a1, 0x001a, 0xd0a1, 0x001a, 0x001a, 0x001a, 0x001a, 0xaba1, 0x001a, 0xfca1, 0xfda1, 0xfba1, 0xfaa1, 0xf2a1, 0xf3a1, 0x001a, 0xb1a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5a1, 0xf1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xada1, 0xefa1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1a1, 0xd5a1, 0x001a, 0x001a, 0xc2a1, 0xc3a1, 0x001a, 0x001a, 0x001a, 0x001a, 0xeca1, 0xeda1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8a1, 0xf9a1, 0x001a, 0x001a, 0xf6a1, 0xf7a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7a8, 0xe8a8, 0xe9a8, 0xeaa8, 0xeba8, 0xeca8, 0xeda8, 0xeea8, 0xefa8, 0xf0a8, 0xf1a8, 0xf2a8, 0xf3a8, 0xf4a8, 0xf5a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7a9, 0xe8a9, 0xe9a9, 0xeaa9, 0xeba9, 0xeca9, 0xeda9, 0xeea9, 0xefa9, 0xf0a9, 0xf1a9, 0xf2a9, 0xf3a9, 0xf4a9, 0xf5a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcda9, 0xcea9, 0xcfa9, 0xd0a9, 0xd1a9, 0xd2a9, 0xd3a9, 0xd4a9, 0xd5a9, 0xd6a9, 0xd7a9, 0xd8a9, 0xd9a9, 0xdaa9, 0xdba9, 0xdca9, 0xdda9, 0xdea9, 0xdfa9, 0xe0a9, 0xe1a9, 0xe2a9, 0xe3a9, 0xe4a9, 0xe5a9, 0xe6a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcda8, 0xcea8, 0xcfa8, 0xd0a8, 0xd1a8, 0xd2a8, 0xd3a8, 0xd4a8, 0xd5a8, 0xd6a8, 0xd7a8, 0xd8a8, 0xd9a8, 0xdaa8, 0xdba8, 0xdca8, 0xdda8, 0xdea8, 0xdfa8, 0xe0a8, 0xe1a8, 0xe2a8, 0xe3a8, 0xe4a8, 0xe5a8, 0xe6a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a6, 0xaca6, 0xa2a6, 0xada6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3a6, 0xc8a6, 0xc7a6, 0xaea6, 0xa4a6, 0xc2a6, 0xc1a6, 0xafa6, 0xa6a6, 0xc6a6, 0xc5a6, 0xb1a6, 0xa5a6, 0xc4a6, 0xc3a6, 0xb0a6, 0xa7a6, 0xbca6, 0xc9a6, 0xcaa6, 0xb7a6, 0xcba6, 0xcca6, 0xb2a6, 0xa9a6, 0xbea6, 0xcda6, 0xcea6, 0xb9a6, 0xcfa6, 0xd0a6, 0xb4a6, 0xa8a6, 0xd1a6, 0xd2a6, 0xb8a6, 0xbda6, 0xd3a6, 0xd4a6, 0xb3a6, 0xaaa6, 0xd5a6, 0xd6a6, 0xbaa6, 0xbfa6, 0xd7a6, 0xd8a6, 0xb5a6, 0xaba6, 0xd9a6, 0xdaa6, 0xbba6, 0xdba6, 0xdca6, 0xc0a6, 0xdda6, 0xdea6, 0xdfa6, 0xe0a6, 0xe1a6, 0xe2a6, 0xe3a6, 0xe4a6, 0xb6a6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1a1, 0xe0a1, 0x001a, 0xc3a2, 0xc7a2, 0xc8a2, 0xcba2, 0xcaa2, 0xc9a2, 0xcca2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3a1, 0xe2a1, 0x001a, 0x001a, 0xbaa2, 0xb9a2, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5a1, 0xe4a1, 0x001a, 0x001a, 0xb8a2, 0xb7a2, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfa1, 0xdea1, 0xc2a2, 0x001a, 0x001a, 0xdba1, 0x001a, 0x001a, 0xdda1, 0xdca1, 0xc4a2, 0xc5a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaa1, 0xd9a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfa2, 0xcea2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0a2, 0x001a, 0xd1a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfa1, 0x001a, 0xcea1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbca2, 0xbda2, 0x001a, 0xc0a2, 0xbba2, 0xbea2, 0x001a, 0xbfa2, 0xcda2, 0xdba2, 0xdca2, 0x001a, 0xdda2, 0xdaa2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0x3000[ 1024 ] = { 0xa1a1, 0xa2a1, 0xa3a1, 0xa8a1, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4a1, 0xb5a1, 0xb6a1, 0xb7a1, 0xb8a1, 0xb9a1, 0xbaa1, 0xbba1, 0xbca1, 0xbda1, 0x001a, 0xeba1, 0xb2a1, 0xb3a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1aa, 0xa2aa, 0xa3aa, 0xa4aa, 0xa5aa, 0xa6aa, 0xa7aa, 0xa8aa, 0xa9aa, 0xaaaa, 0xabaa, 0xacaa, 0xadaa, 0xaeaa, 0xafaa, 0xb0aa, 0xb1aa, 0xb2aa, 0xb3aa, 0xb4aa, 0xb5aa, 0xb6aa, 0xb7aa, 0xb8aa, 0xb9aa, 0xbaaa, 0xbbaa, 0xbcaa, 0xbdaa, 0xbeaa, 0xbfaa, 0xc0aa, 0xc1aa, 0xc2aa, 0xc3aa, 0xc4aa, 0xc5aa, 0xc6aa, 0xc7aa, 0xc8aa, 0xc9aa, 0xcaaa, 0xcbaa, 0xccaa, 0xcdaa, 0xceaa, 0xcfaa, 0xd0aa, 0xd1aa, 0xd2aa, 0xd3aa, 0xd4aa, 0xd5aa, 0xd6aa, 0xd7aa, 0xd8aa, 0xd9aa, 0xdaaa, 0xdbaa, 0xdcaa, 0xddaa, 0xdeaa, 0xdfaa, 0xe0aa, 0xe1aa, 0xe2aa, 0xe3aa, 0xe4aa, 0xe5aa, 0xe6aa, 0xe7aa, 0xe8aa, 0xe9aa, 0xeaaa, 0xebaa, 0xecaa, 0xedaa, 0xeeaa, 0xefaa, 0xf0aa, 0xf1aa, 0xf2aa, 0xf3aa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1ab, 0xa2ab, 0xa3ab, 0xa4ab, 0xa5ab, 0xa6ab, 0xa7ab, 0xa8ab, 0xa9ab, 0xaaab, 0xabab, 0xacab, 0xadab, 0xaeab, 0xafab, 0xb0ab, 0xb1ab, 0xb2ab, 0xb3ab, 0xb4ab, 0xb5ab, 0xb6ab, 0xb7ab, 0xb8ab, 0xb9ab, 0xbaab, 0xbbab, 0xbcab, 0xbdab, 0xbeab, 0xbfab, 0xc0ab, 0xc1ab, 0xc2ab, 0xc3ab, 0xc4ab, 0xc5ab, 0xc6ab, 0xc7ab, 0xc8ab, 0xc9ab, 0xcaab, 0xcbab, 0xccab, 0xcdab, 0xceab, 0xcfab, 0xd0ab, 0xd1ab, 0xd2ab, 0xd3ab, 0xd4ab, 0xd5ab, 0xd6ab, 0xd7ab, 0xd8ab, 0xd9ab, 0xdaab, 0xdbab, 0xdcab, 0xddab, 0xdeab, 0xdfab, 0xe0ab, 0xe1ab, 0xe2ab, 0xe3ab, 0xe4ab, 0xe5ab, 0xe6ab, 0xe7ab, 0xe8ab, 0xe9ab, 0xeaab, 0xebab, 0xecab, 0xedab, 0xeeab, 0xefab, 0xf0ab, 0xf1ab, 0xf2ab, 0xf3ab, 0xf4ab, 0xf5ab, 0xf6ab, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a4, 0xa2a4, 0xa3a4, 0xa4a4, 0xa5a4, 0xa6a4, 0xa7a4, 0xa8a4, 0xa9a4, 0xaaa4, 0xaba4, 0xaca4, 0xada4, 0xaea4, 0xafa4, 0xb0a4, 0xb1a4, 0xb2a4, 0xb3a4, 0xb4a4, 0xb5a4, 0xb6a4, 0xb7a4, 0xb8a4, 0xb9a4, 0xbaa4, 0xbba4, 0xbca4, 0xbda4, 0xbea4, 0xbfa4, 0xc0a4, 0xc1a4, 0xc2a4, 0xc3a4, 0xc4a4, 0xc5a4, 0xc6a4, 0xc7a4, 0xc8a4, 0xc9a4, 0xcaa4, 0xcba4, 0xcca4, 0xcda4, 0xcea4, 0xcfa4, 0xd0a4, 0xd1a4, 0xd2a4, 0xd3a4, 0xd4a4, 0xd5a4, 0xd6a4, 0xd7a4, 0xd8a4, 0xd9a4, 0xdaa4, 0xdba4, 0xdca4, 0xdda4, 0xdea4, 0xdfa4, 0xe0a4, 0xe1a4, 0xe2a4, 0xe3a4, 0xe4a4, 0xe5a4, 0xe6a4, 0xe7a4, 0xe8a4, 0xe9a4, 0xeaa4, 0xeba4, 0xeca4, 0xeda4, 0xeea4, 0xefa4, 0xf0a4, 0xf1a4, 0xf2a4, 0xf3a4, 0xf4a4, 0xf5a4, 0xf6a4, 0xf7a4, 0xf8a4, 0xf9a4, 0xfaa4, 0xfba4, 0xfca4, 0xfda4, 0xfea4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1a9, 0xb2a9, 0xb3a9, 0xb4a9, 0xb5a9, 0xb6a9, 0xb7a9, 0xb8a9, 0xb9a9, 0xbaa9, 0xbba9, 0xbca9, 0xbda9, 0xbea9, 0xbfa9, 0xc0a9, 0xc1a9, 0xc2a9, 0xc3a9, 0xc4a9, 0xc5a9, 0xc6a9, 0xc7a9, 0xc8a9, 0xc9a9, 0xcaa9, 0xcba9, 0xcca9, 0xdfa2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1a8, 0xb2a8, 0xb3a8, 0xb4a8, 0xb5a8, 0xb6a8, 0xb7a8, 0xb8a8, 0xb9a8, 0xbaa8, 0xbba8, 0xbca8, 0xbda8, 0xbea8, 0xbfa8, 0xc0a8, 0xc1a8, 0xc2a8, 0xc3a8, 0xc4a8, 0xc5a8, 0xc6a8, 0xc7a8, 0xc8a8, 0xc9a8, 0xcaa8, 0xcba8, 0xcca8, 0x001a, 0x001a, 0x001a, 0xdea2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9a7, 0xcaa7, 0xcba7, 0xcca7, 0xcda7, 0x001a, 0x001a, 0x001a, 0xbaa7, 0xbba7, 0xdca7, 0xdda7, 0xdea7, 0xb6a7, 0xb7a7, 0xb8a7, 0xd4a7, 0xd5a7, 0xd6a7, 0xd7a7, 0xd8a7, 0xa1a7, 0xa2a7, 0xa3a7, 0xa5a7, 0xaba7, 0xaca7, 0xada7, 0xaea7, 0xafa7, 0xb0a7, 0xb1a7, 0xb2a7, 0xb3a7, 0xb4a7, 0xa7a7, 0xa8a7, 0xa9a7, 0xaaa7, 0xbda7, 0xbea7, 0xe5a7, 0xe6a7, 0xe7a7, 0xe8a7, 0xe1a7, 0xe2a7, 0xe3a7, 0xbfa7, 0xc0a7, 0xc1a7, 0xc2a7, 0xc3a7, 0xc4a7, 0xc5a7, 0xc6a7, 0xc7a7, 0xc8a7, 0xcea7, 0xcfa7, 0xd0a7, 0xd1a7, 0xd2a7, 0xd3a7, 0xdaa7, 0xdba7, 0xe3a2, 0xeca7, 0xa6a7, 0xe0a7, 0xefa7, 0xe1a2, 0xbca7, 0xeda7, 0xb5a7, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9a7, 0xeaa7, 0x001a, 0x001a, 0xeba7, 0x001a, 0x001a, 0xdfa7, 0x001a, 0xe4a2, 0x001a, 0x001a, 0xe4a7, 0xeea7, 0xe9a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0x4e00[ 20928 ] = { 0xe9ec, 0xcbef, 0x001a, 0xd2f6, 0x001a, 0x001a, 0x001a, 0xb2d8, 0xdbed, 0xb2df, 0xbedf, 0xbbf9, 0x001a, 0xf4dc, 0x001a, 0x001a, 0x001a, 0xe4f5, 0x001a, 0x001a, 0xa6f3, 0xe0dd, 0xa6e1, 0x001a, 0xf8ce, 0xb0dc, 0x001a, 0x001a, 0x001a, 0x001a, 0xaae3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9f1, 0x001a, 0x001a, 0x001a, 0x001a, 0xfacd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaffc, 0xa1d3, 0x001a, 0xabf1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e7, 0xacd2, 0x001a, 0xf9ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdf1, 0x001a, 0xbfde, 0xbafb, 0xb9f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2ce, 0x001a, 0xabe3, 0xe0eb, 0x001a, 0x001a, 0x001a, 0xface, 0xf7cb, 0xa5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1ca, 0x001a, 0xccd4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1ea, 0x001a, 0x001a, 0xe3dc, 0xaddf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebcb, 0x001a, 0x001a, 0x001a, 0xafd5, 0x001a, 0x001a, 0x001a, 0xf5d6, 0x001a, 0xf8e5, 0x001a, 0x001a, 0xc0de, 0xa3ec, 0x001a, 0xcde9, 0x001a, 0xa7ea, 0xf6e9, 0xbbfb, 0x001a, 0xe9e7, 0xccef, 0x001a, 0x001a, 0xe6d0, 0x001a, 0x001a, 0xc1de, 0x001a, 0x001a, 0xace4, 0x001a, 0x001a, 0xccd8, 0xf1f9, 0x001a, 0xdfce, 0xa4fa, 0xb2e6, 0x001a, 0xfbfa, 0x001a, 0x001a, 0xbdfa, 0xc8cc, 0xcdef, 0xd5d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2d3, 0x001a, 0x001a, 0x001a, 0xd1ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7e4, 0xd2ec, 0x001a, 0x001a, 0xb1f6, 0x001a, 0x001a, 0xfbce, 0x001a, 0x001a, 0xd1d0, 0xbfcb, 0x001a, 0xa4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8ed, 0xc2de, 0xe2f6, 0xdced, 0xf5dc, 0xb9e0, 0x001a, 0x001a, 0x001a, 0xced4, 0x001a, 0xb5f4, 0x001a, 0x001a, 0x001a, 0xdbd3, 0xb5d6, 0xa4ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6e4, 0x001a, 0xeaf1, 0x001a, 0x001a, 0x001a, 0xeccb, 0xc0cb, 0x001a, 0x001a, 0x001a, 0xf2ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xead0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2f9, 0xa5ec, 0xdfd0, 0x001a, 0xeae7, 0xebd0, 0xd1dc, 0xe9db, 0xccfd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7db, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1da, 0x001a, 0xb6d6, 0x001a, 0xdfe3, 0x001a, 0xc3de, 0x001a, 0xc4de, 0xa1ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecee, 0x001a, 0x001a, 0xa3d3, 0xb7ee, 0xcff8, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ea, 0xb8ee, 0xacf1, 0xa5f1, 0xcee9, 0x001a, 0x001a, 0x001a, 0xbcf9, 0x001a, 0x001a, 0x001a, 0xf9e5, 0xeaec, 0xd6dd, 0xc2ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbae5, 0xd8db, 0x001a, 0x001a, 0xa2ca, 0x001a, 0x001a, 0xcdd1, 0x001a, 0x001a, 0x001a, 0xedee, 0x001a, 0x001a, 0x001a, 0xebec, 0xc5de, 0x001a, 0xe0e3, 0x001a, 0xc9ca, 0xe9f2, 0x001a, 0xced5, 0x001a, 0xb6f6, 0x001a, 0xc2ce, 0xc7d6, 0x001a, 0xb4e3, 0x001a, 0xadf1, 0x001a, 0xe2ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2d7, 0x001a, 0xa7f3, 0x001a, 0x001a, 0xeacd, 0x001a, 0xeeeb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2d9, 0xa5fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5f6, 0xe2d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5f8, 0x001a, 0x001a, 0xf5cc, 0xb5f5, 0xade4, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe7, 0xd5f1, 0x001a, 0x001a, 0x001a, 0xbbf0, 0x001a, 0x001a, 0xb5e9, 0x001a, 0xc9cc, 0xd5fa, 0x001a, 0x001a, 0xd4e1, 0x001a, 0x001a, 0xd6d7, 0x001a, 0x001a, 0xc1dc, 0x001a, 0xc6de, 0xeffa, 0xe1e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3e1, 0xf6dc, 0x001a, 0xfcce, 0x001a, 0xc4db, 0x001a, 0xf1f8, 0x001a, 0x001a, 0xe4dc, 0x001a, 0xefe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1dc, 0x001a, 0x001a, 0x001a, 0xd6d5, 0x001a, 0x001a, 0xdaf3, 0x001a, 0xc1cb, 0x001a, 0xc3db, 0x001a, 0x001a, 0x001a, 0xfad9, 0xeed3, 0x001a, 0x001a, 0x001a, 0xb8fa, 0x001a, 0x001a, 0xa6fd, 0xefeb, 0x001a, 0xa6f4, 0x001a, 0xcacc, 0xa8f3, 0x001a, 0xdbf3, 0x001a, 0xa7db, 0xb7f6, 0x001a, 0xe6cf, 0xf2f0, 0xdacb, 0x001a, 0xd2e7, 0xc3d7, 0xf0f6, 0xdee8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7e5, 0x001a, 0x001a, 0x001a, 0xa3ca, 0xa7cc, 0xc9ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5fa, 0x001a, 0x001a, 0x001a, 0x001a, 0xaef1, 0x001a, 0xceef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedcb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0f6, 0xcfef, 0xcfe9, 0x001a, 0xdef7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8db, 0x001a, 0x001a, 0x001a, 0xf8cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1df, 0xe1dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaf5, 0xb6e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xece7, 0xeeee, 0x001a, 0xf0f3, 0x001a, 0xbfdf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1d0, 0x001a, 0x001a, 0x001a, 0xd2f4, 0xbae0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0df, 0x001a, 0xe0ce, 0x001a, 0x001a, 0x001a, 0xd2dc, 0xeafd, 0x001a, 0x001a, 0x001a, 0xf6d6, 0x001a, 0x001a, 0x001a, 0xcaea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e8, 0x001a, 0xace3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4ca, 0x001a, 0xf8db, 0x001a, 0x001a, 0x001a, 0xc7de, 0xf0eb, 0xd6f1, 0x001a, 0x001a, 0xe2e5, 0x001a, 0xcccc, 0x001a, 0x001a, 0xfbcb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1df, 0x001a, 0xedd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3d5, 0x001a, 0x001a, 0xd3d1, 0x001a, 0xf0e5, 0x001a, 0x001a, 0x001a, 0xb4e8, 0xc3eb, 0x001a, 0xaaea, 0xfcfa, 0xf6f5, 0xbcf0, 0xd4fd, 0xbbe0, 0xc3ce, 0x001a, 0xbad0, 0xbaf7, 0xf3d8, 0xcdf7, 0x001a, 0x001a, 0x001a, 0xaee4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfd4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7d0, 0x001a, 0x001a, 0xfdec, 0x001a, 0xaed2, 0xefee, 0xd7d5, 0xe4ea, 0xa2f8, 0xebcd, 0xbfd7, 0xb1fb, 0x001a, 0x001a, 0xeccd, 0x001a, 0x001a, 0x001a, 0xb2dc, 0xecd0, 0xfdce, 0xf0ee, 0x001a, 0x001a, 0x001a, 0xc2cc, 0x001a, 0x001a, 0x001a, 0xedd0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e5, 0x001a, 0x001a, 0x001a, 0xfcf3, 0x001a, 0x001a, 0xa2ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3d9, 0x001a, 0x001a, 0xf4d8, 0x001a, 0xb7e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaece, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2d9, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1d8, 0x001a, 0xcfd4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7e5, 0xd2d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2f4, 0x001a, 0xd7f1, 0x001a, 0x001a, 0xd8d5, 0x001a, 0xbdf0, 0xd0d7, 0xd0d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfd7, 0xeaeb, 0xebfd, 0x001a, 0x001a, 0xeddb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5fc, 0xc2cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5fd, 0x001a, 0xc8f4, 0xeae8, 0xf3f5, 0x001a, 0x001a, 0xdef9, 0x001a, 0x001a, 0xefd3, 0x001a, 0x001a, 0xd3ec, 0x001a, 0x001a, 0xc2dd, 0xb7ef, 0xd4e7, 0x001a, 0xcaca, 0x001a, 0x001a, 0x001a, 0xfbd9, 0x001a, 0x001a, 0xfdfa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7f7, 0xacdc, 0x001a, 0x001a, 0x001a, 0xd7d7, 0xa2df, 0x001a, 0x001a, 0x001a, 0xbece, 0x001a, 0xf0d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4f0, 0xece1, 0xe7cf, 0xcbf3, 0xa9ed, 0xbeca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeff4, 0x001a, 0x001a, 0x001a, 0xcef6, 0x001a, 0x001a, 0xfbde, 0xbbd0, 0xb7d5, 0xf1ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8f4, 0x001a, 0xf8dc, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7cb, 0x001a, 0xceda, 0x001a, 0x001a, 0x001a, 0xe6e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5ed, 0xf2ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9dc, 0x001a, 0x001a, 0xdcf9, 0x001a, 0x001a, 0xdcf3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2f8, 0x001a, 0xf9f4, 0x001a, 0x001a, 0x001a, 0xf1fc, 0x001a, 0x001a, 0x001a, 0xbcd0, 0xf9db, 0xb1d7, 0x001a, 0x001a, 0x001a, 0xfccb, 0x001a, 0x001a, 0x001a, 0xa5f0, 0xfdcb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4d5, 0x001a, 0x001a, 0x001a, 0xedcd, 0xa5ca, 0x001a, 0x001a, 0xabd6, 0xc2d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xbef0, 0xbdd2, 0xa4cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6fa, 0x001a, 0x001a, 0xcdcc, 0x001a, 0xfada, 0x001a, 0xcff6, 0x001a, 0xb8e9, 0x001a, 0xf5d8, 0x001a, 0x001a, 0x001a, 0xcecc, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdd7, 0x001a, 0x001a, 0xd1d4, 0xede9, 0x001a, 0xebca, 0xe2d9, 0x001a, 0xb2fd, 0x001a, 0xade3, 0xccd6, 0xb4d9, 0x001a, 0x001a, 0xa7e1, 0xd3ee, 0xc3d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3fd, 0x001a, 0xe4d5, 0x001a, 0x001a, 0xe8cf, 0x001a, 0xc3ed, 0xb2d0, 0x001a, 0x001a, 0xfece, 0xa8da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0f8, 0x001a, 0x001a, 0xd6fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1f8, 0x001a, 0xd2f8, 0xd3dc, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2dd, 0xf9fb, 0xc1dd, 0x001a, 0xb5e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdded, 0xc4ce, 0x001a, 0xa1cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xddfc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaff9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbd2, 0xa1cf, 0xa8e4, 0x001a, 0xb6f4, 0xfeec, 0x001a, 0x001a, 0xaee3, 0xede7, 0xc1fd, 0xe2da, 0x001a, 0x001a, 0xb3d8, 0x001a, 0x001a, 0x001a, 0xe4dd, 0xeff0, 0xf1f6, 0xf0fa, 0x001a, 0x001a, 0xf5d1, 0x001a, 0x001a, 0xcfda, 0x001a, 0xd4dc, 0x001a, 0xa6dc, 0x001a, 0xbfef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfce, 0x001a, 0xd9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6d9, 0xd4ec, 0xcbea, 0x001a, 0x001a, 0xbfca, 0xb0d5, 0x001a, 0xe9cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedf1, 0x001a, 0xcfcc, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xede4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8d7, 0x001a, 0xa7fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xabea, 0xb2f6, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0cf, 0xbdf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbcb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1f3, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e9, 0xa9f3, 0xe0d0, 0xd2e9, 0x001a, 0xe3da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2e2, 0x001a, 0xa2f6, 0xf4e1, 0x001a, 0x001a, 0x001a, 0xe4da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e7, 0xbff5, 0xa2cf, 0xafcd, 0xa3cf, 0x001a, 0x001a, 0x001a, 0xb0cd, 0xfef1, 0xa3d0, 0xafe1, 0xa3f8, 0x001a, 0xa6ca, 0xbbf7, 0xeaf2, 0xc8de, 0xd3e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdefd, 0xc0ca, 0x001a, 0x001a, 0x001a, 0xeaf9, 0xced1, 0xd4ee, 0x001a, 0xd2d4, 0xa3d9, 0xa8fd, 0xd9d7, 0xcef7, 0xbefa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6cf, 0x001a, 0xf0d7, 0x001a, 0xe1eb, 0xc5f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfadc, 0x001a, 0x001a, 0xc3dd, 0x001a, 0xdff9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefe7, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5fd, 0xa3f6, 0x001a, 0xfcd9, 0xa9fd, 0x001a, 0xeee7, 0x001a, 0x001a, 0x001a, 0xe5d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0ef, 0x001a, 0xb1cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2f1, 0x001a, 0xb1f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2cd, 0x001a, 0xabda, 0x001a, 0xa7ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2e3, 0xbcfb, 0xa4d9, 0x001a, 0x001a, 0xbaee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfafb, 0x001a, 0xa4cf, 0x001a, 0xfbdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3f6, 0x001a, 0x001a, 0x001a, 0xaaed, 0x001a, 0x001a, 0xa1f2, 0xe1ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6fa, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0f9, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6ec, 0x001a, 0x001a, 0xeee4, 0xa1f9, 0x001a, 0x001a, 0xeffb, 0x001a, 0x001a, 0x001a, 0xebf9, 0xa3ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacea, 0x001a, 0x001a, 0x001a, 0xa8ca, 0x001a, 0x001a, 0xfaf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6cd, 0xf6fc, 0x001a, 0x001a, 0x001a, 0xc9f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f8, 0x001a, 0xcade, 0xc6f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdad7, 0x001a, 0xd0d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6ea, 0x001a, 0xddf3, 0x001a, 0x001a, 0x001a, 0xdae4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2f6, 0x001a, 0xc2df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdd9, 0x001a, 0x001a, 0x001a, 0xf6cc, 0x001a, 0x001a, 0xbad3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafe4, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f0, 0x001a, 0x001a, 0x001a, 0xd3cb, 0x001a, 0x001a, 0x001a, 0xbce0, 0x001a, 0xcaf4, 0xfad4, 0x001a, 0xaafd, 0xe2f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7f4, 0xc2fd, 0xb0fc, 0x001a, 0xecfd, 0xe2ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdfd, 0x001a, 0xe7ea, 0xc3df, 0xd2d1, 0xe2ce, 0x001a, 0xa4d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabfd, 0x001a, 0xe0df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0e7, 0x001a, 0xeed0, 0x001a, 0x001a, 0xaaf3, 0x001a, 0x001a, 0x001a, 0xcbde, 0xb8f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e1, 0xb3f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3f7, 0x001a, 0x001a, 0xa9ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5cf, 0x001a, 0x001a, 0xc4df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0e1, 0x001a, 0x001a, 0xbff0, 0x001a, 0xa4f6, 0x001a, 0xb6e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefd0, 0x001a, 0x001a, 0xedfd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfe6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadde, 0x001a, 0xbffa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5d2, 0x001a, 0x001a, 0xeefd, 0x001a, 0x001a, 0x001a, 0xb6f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6e1, 0xccde, 0x001a, 0x001a, 0xdefc, 0x001a, 0xd7ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddcd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7d6, 0xb3cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5f8, 0xd8e5, 0x001a, 0x001a, 0x001a, 0xeacf, 0x001a, 0x001a, 0xd0cf, 0x001a, 0xccea, 0x001a, 0x001a, 0x001a, 0x001a, 0xaeea, 0xadea, 0x001a, 0x001a, 0xf1d3, 0x001a, 0xa5d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcff7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4d0, 0x001a, 0x001a, 0xa2f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3f2, 0x001a, 0xf8f7, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3d0, 0x001a, 0x001a, 0xa9db, 0x001a, 0x001a, 0xbbd3, 0xecca, 0x001a, 0xa6f1, 0xd5cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7f7, 0x001a, 0x001a, 0xdecd, 0x001a, 0xa4f7, 0x001a, 0x001a, 0x001a, 0xc0f8, 0x001a, 0x001a, 0x001a, 0xddd3, 0x001a, 0xd0cc, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcd3, 0x001a, 0x001a, 0xfefa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9eb, 0x001a, 0xa7cf, 0xafea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefe4, 0x001a, 0x001a, 0x001a, 0xb9e9, 0xd8f1, 0x001a, 0x001a, 0xd8d8, 0x001a, 0x001a, 0xf2e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e6, 0xfcdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1f3, 0x001a, 0x001a, 0x001a, 0xd0e3, 0x001a, 0x001a, 0xfbf2, 0x001a, 0xc6db, 0xf1d0, 0x001a, 0xf2d0, 0x001a, 0x001a, 0x001a, 0xdccf, 0x001a, 0xd1d3, 0x001a, 0x001a, 0xb1cc, 0xd8f7, 0x001a, 0xa8cb, 0xbceb, 0xbee4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcf4, 0x001a, 0x001a, 0xc2dc, 0x001a, 0x001a, 0xa7f0, 0x001a, 0x001a, 0xc0e6, 0x001a, 0x001a, 0xedca, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe8, 0xe8e5, 0xc3dc, 0x001a, 0x001a, 0xdeed, 0xf2d3, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4ce, 0xabe7, 0x001a, 0x001a, 0x001a, 0xc3cb, 0x001a, 0xb1e1, 0x001a, 0x001a, 0xb2f7, 0x001a, 0x001a, 0xf3d3, 0xd2d3, 0x001a, 0xc0f5, 0x001a, 0x001a, 0x001a, 0xdddf, 0x001a, 0x001a, 0xf3ee, 0xf1e7, 0x001a, 0xb4fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8f2, 0x001a, 0x001a, 0x001a, 0xd2f3, 0x001a, 0x001a, 0xf4ee, 0x001a, 0xd3e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1cc, 0x001a, 0xeadf, 0x001a, 0x001a, 0x001a, 0xbae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdf5, 0x001a, 0xf2f1, 0xc7fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8d9, 0xc2d4, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5f6, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2e7, 0xdfed, 0x001a, 0x001a, 0xcbca, 0x001a, 0x001a, 0xfadb, 0x001a, 0x001a, 0x001a, 0xb5e8, 0x001a, 0xa6d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5fd, 0x001a, 0x001a, 0xc9f9, 0x001a, 0xe2e4, 0x001a, 0xbdfb, 0x001a, 0x001a, 0xa4d7, 0xc5ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5ce, 0xe6d6, 0x001a, 0x001a, 0x001a, 0x001a, 0xbde5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdde, 0xf3ec, 0x001a, 0x001a, 0xe0ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecec, 0xbefb, 0xebdf, 0x001a, 0xf8e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbef9, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3d0, 0xaae0, 0xe2e8, 0x001a, 0x001a, 0xd4e2, 0xfdd2, 0x001a, 0xa8e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3d9, 0x001a, 0x001a, 0x001a, 0x001a, 0xded3, 0x001a, 0xb8f4, 0xbcf7, 0xfddc, 0x001a, 0xece8, 0xe7e4, 0x001a, 0x001a, 0xf7e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2e5, 0x001a, 0x001a, 0xf4d0, 0xafd2, 0xe5dc, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5d0, 0xb4f1, 0xb1fc, 0xf8cc, 0x001a, 0x001a, 0xc6dd, 0xd1fa, 0x001a, 0xdff7, 0x001a, 0x001a, 0xa8fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5ee, 0x001a, 0xcede, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3e7, 0x001a, 0x001a, 0xacf7, 0xc4eb, 0xe1ed, 0xabe0, 0xc7dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3d2, 0xbfd2, 0x001a, 0x001a, 0x001a, 0xccca, 0x001a, 0x001a, 0x001a, 0x001a, 0xbffb, 0x001a, 0x001a, 0x001a, 0x001a, 0xfde5, 0xe5dd, 0xcdd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5d0, 0x001a, 0x001a, 0xede8, 0xd2d0, 0x001a, 0xd8d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6f6, 0x001a, 0x001a, 0xaadb, 0x001a, 0x001a, 0x001a, 0xe0f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9d8, 0x001a, 0xa3f4, 0x001a, 0x001a, 0xddf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1ef, 0x001a, 0x001a, 0xb5d9, 0x001a, 0x001a, 0xabed, 0x001a, 0xb7e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbee, 0xb4cd, 0x001a, 0xf3e0, 0xcdea, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5ec, 0xeee8, 0x001a, 0xa9cb, 0xaff1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdca, 0x001a, 0xa9ec, 0x001a, 0xebf2, 0x001a, 0xeffd, 0x001a, 0xf3f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e6, 0x001a, 0x001a, 0xd8ec, 0x001a, 0x001a, 0x001a, 0xaced, 0x001a, 0xceea, 0x001a, 0xdfe8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfde, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6d2, 0x001a, 0x001a, 0xf4e7, 0xd6d1, 0x001a, 0x001a, 0xc2e6, 0xe3e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0e4, 0x001a, 0x001a, 0x001a, 0xb4d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdef3, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5d7, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8f7, 0x001a, 0x001a, 0xc6e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6dd, 0x001a, 0x001a, 0x001a, 0xfedc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdad8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacda, 0xb0ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaca, 0xf9e1, 0x001a, 0xb1ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf2, 0x001a, 0x001a, 0xeefa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4f9, 0x001a, 0x001a, 0xecd2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbfb, 0x001a, 0x001a, 0x001a, 0xf0fd, 0x001a, 0xbde0, 0xe3ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaede, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5df, 0x001a, 0x001a, 0xbee5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaded, 0xeafa, 0x001a, 0x001a, 0xeecd, 0xa6ed, 0x001a, 0xaeed, 0xedf0, 0x001a, 0xa1dd, 0x001a, 0xafed, 0xf8fc, 0x001a, 0xebd8, 0x001a, 0x001a, 0x001a, 0xf9cc, 0xb5cd, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9fa, 0x001a, 0xdde1, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e2, 0xcfed, 0x001a, 0x001a, 0x001a, 0xa2dd, 0x001a, 0x001a, 0xcaf9, 0x001a, 0xe8ea, 0x001a, 0xede5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebd3, 0x001a, 0xd4e9, 0xfae1, 0xcce4, 0x001a, 0xe4e1, 0xc7e8, 0x001a, 0x001a, 0xdbce, 0x001a, 0x001a, 0x001a, 0xd5dc, 0x001a, 0xb5f7, 0xf3fc, 0xf3f0, 0xafce, 0xb5f1, 0xd2ef, 0xc8e8, 0xf1eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4cb, 0xbee0, 0xf8e3, 0xe9ea, 0xb2fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e0, 0x001a, 0xe0cf, 0x001a, 0xa5ee, 0x001a, 0x001a, 0xaafa, 0xc3e6, 0xb2e1, 0xabca, 0x001a, 0xe4e3, 0xbbe9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e2, 0xf2f3, 0x001a, 0xd6ee, 0xb2ea, 0xf6d0, 0xd9ec, 0xcbda, 0xa8cf, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3dd, 0x001a, 0x001a, 0x001a, 0xdbd8, 0x001a, 0xcef9, 0xd5e9, 0xd1e3, 0x001a, 0x001a, 0xbcd2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacd8, 0xccf3, 0x001a, 0xfbcd, 0xd6f6, 0x001a, 0xf5e7, 0xefe8, 0xf9e3, 0xbbd2, 0xf3f3, 0xfbe3, 0x001a, 0xd0de, 0xb0ce, 0x001a, 0xf7d6, 0xd9f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1f5, 0xc4dc, 0x001a, 0xbbf5, 0x001a, 0xd1de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6dc, 0x001a, 0x001a, 0xd2de, 0x001a, 0x001a, 0xe2ed, 0xf6ee, 0xcfea, 0xeef0, 0xfce3, 0x001a, 0xdfd3, 0xf4d3, 0xb3e1, 0x001a, 0xb4e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3f4, 0x001a, 0x001a, 0xc6df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e9, 0x001a, 0x001a, 0x001a, 0xabdb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9e3, 0xc5eb, 0xa9f4, 0xb6cd, 0xf9d2, 0x001a, 0xadda, 0xe3d2, 0xd1cf, 0x001a, 0x001a, 0x001a, 0x001a, 0xdccb, 0xfacc, 0x001a, 0xddcf, 0x001a, 0x001a, 0xa9e8, 0x001a, 0xbbe3, 0xbae3, 0x001a, 0x001a, 0xdae0, 0x001a, 0x001a, 0x001a, 0xf7ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3dc, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5d3, 0x001a, 0xa6d7, 0x001a, 0xb5f6, 0xdbd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e1, 0x001a, 0x001a, 0xead4, 0x001a, 0xa3df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdffd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7d0, 0xd4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaacb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbe4, 0x001a, 0xfbe1, 0xa2cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0d3, 0x001a, 0xbfe4, 0x001a, 0xc0fb, 0x001a, 0xbeda, 0xcde4, 0x001a, 0xb9d6, 0x001a, 0x001a, 0x001a, 0xc0ef, 0x001a, 0xfce1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7dc, 0xe8dc, 0x001a, 0x001a, 0x001a, 0xd6fa, 0x001a, 0xf6d3, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaf1, 0x001a, 0xf2fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfde2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfd5, 0xf8d0, 0x001a, 0x001a, 0xdfcd, 0x001a, 0x001a, 0xcbf5, 0x001a, 0xf0e4, 0xabcb, 0x001a, 0xc4d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfee2, 0x001a, 0xdadd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaeda, 0xeeca, 0x001a, 0x001a, 0x001a, 0xb9d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1e3, 0x001a, 0x001a, 0xe3e8, 0x001a, 0x001a, 0xabf3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9cf, 0x001a, 0x001a, 0x001a, 0xf7d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1d4, 0x001a, 0x001a, 0xe4ce, 0x001a, 0xf2e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaee7, 0x001a, 0xbad6, 0x001a, 0xecdf, 0xc0e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5d8, 0x001a, 0x001a, 0x001a, 0xdce4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9f4, 0xb6f1, 0x001a, 0x001a, 0xdee2, 0xb5e1, 0x001a, 0x001a, 0xefcd, 0xa7f1, 0xe5ce, 0xddcb, 0x001a, 0x001a, 0xe3d9, 0x001a, 0x001a, 0xacf3, 0x001a, 0x001a, 0xf9d0, 0xabec, 0xd3de, 0xe9f7, 0x001a, 0x001a, 0xf5f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee1, 0xeecb, 0x001a, 0x001a, 0x001a, 0xbce3, 0xd6f8, 0x001a, 0x001a, 0xeedb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6f7, 0x001a, 0x001a, 0x001a, 0x001a, 0xdef4, 0x001a, 0x001a, 0xedf2, 0x001a, 0xd9db, 0x001a, 0xa8f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfde1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4de, 0x001a, 0xace0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3ed, 0x001a, 0x001a, 0xe1d3, 0x001a, 0xc8df, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6d9, 0x001a, 0xacfd, 0xd3ef, 0x001a, 0x001a, 0x001a, 0xc1e4, 0xebf8, 0x001a, 0xacdb, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbaf6, 0x001a, 0xdfdb, 0xd3d3, 0xc7f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xceca, 0xc1f8, 0xb4d2, 0x001a, 0x001a, 0xb4dc, 0xb9fa, 0xcfca, 0x001a, 0xb3fc, 0xeaea, 0xebea, 0xfad0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4ed, 0x001a, 0x001a, 0xe7dd, 0x001a, 0x001a, 0xc9df, 0x001a, 0x001a, 0x001a, 0x001a, 0xeddf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcee, 0x001a, 0xc1ef, 0x001a, 0x001a, 0xd2cc, 0x001a, 0xa4dd, 0x001a, 0x001a, 0x001a, 0xcadf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8d3, 0xa8f1, 0x001a, 0x001a, 0x001a, 0xb7cd, 0x001a, 0xd4ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde4, 0xeedf, 0xaccb, 0xbce9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecea, 0x001a, 0x001a, 0x001a, 0xcbdf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbff9, 0xafd6, 0xc6d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaacf, 0x001a, 0x001a, 0xa9ce, 0x001a, 0x001a, 0xf8d6, 0x001a, 0x001a, 0x001a, 0xb7f1, 0xf8ee, 0x001a, 0x001a, 0x001a, 0xd9d9, 0xdff3, 0x001a, 0xc8f8, 0xc6ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6f4, 0x001a, 0x001a, 0xc5e6, 0xd5ef, 0x001a, 0x001a, 0xefcb, 0xdffc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7dc, 0x001a, 0x001a, 0xe7d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9f8, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2e3, 0x001a, 0xbde3, 0x001a, 0xe1cf, 0xc0f0, 0xdaec, 0x001a, 0xd7dd, 0xf0fb, 0x001a, 0x001a, 0xacec, 0x001a, 0x001a, 0x001a, 0xa9f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7fa, 0xc1fb, 0x001a, 0xc0d2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0e5, 0x001a, 0x001a, 0x001a, 0xe5ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xadcb, 0x001a, 0xb0f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5f7, 0x001a, 0xaecb, 0x001a, 0xafda, 0x001a, 0xb6d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7d3, 0xb2fb, 0x001a, 0xc4fd, 0x001a, 0xadec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1fb, 0x001a, 0x001a, 0x001a, 0xe9e5, 0xeee9, 0x001a, 0xf4f3, 0xf3f8, 0xc1f0, 0xafde, 0xb0f8, 0x001a, 0x001a, 0xe0f3, 0xafe7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaddb, 0x001a, 0xb5e6, 0x001a, 0x001a, 0xa8f9, 0x001a, 0x001a, 0xd8dd, 0xd9e8, 0xd6ef, 0x001a, 0x001a, 0x001a, 0xe2d3, 0x001a, 0xdfe2, 0x001a, 0x001a, 0xe0fc, 0xc8d7, 0xadfd, 0x001a, 0x001a, 0x001a, 0xefdf, 0xd3cc, 0xf9d3, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0d4, 0xc7db, 0xd5de, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4f0, 0x001a, 0xd0d5, 0xd9e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7fc, 0xd6dc, 0xe0e2, 0x001a, 0x001a, 0x001a, 0xb0da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3f3, 0x001a, 0xecd3, 0x001a, 0xcbf4, 0x001a, 0x001a, 0x001a, 0xc5fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfde3, 0x001a, 0xb1f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbd0, 0xdbec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcf5, 0xa4f2, 0xced8, 0xcfd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7d2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecfb, 0x001a, 0xc8dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8e4, 0x001a, 0x001a, 0xc1d2, 0x001a, 0x001a, 0x001a, 0xd7f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbd6, 0xd6de, 0x001a, 0x001a, 0xbdf7, 0xaeec, 0x001a, 0x001a, 0x001a, 0xe1d0, 0x001a, 0xf5e0, 0xb3ea, 0x001a, 0xd6ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6ec, 0xe1e2, 0xbee3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8fc, 0x001a, 0x001a, 0xf0cd, 0x001a, 0xf6f9, 0x001a, 0x001a, 0xf0df, 0x001a, 0x001a, 0x001a, 0xbfe5, 0x001a, 0x001a, 0x001a, 0xbfce, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1fc, 0xb0ed, 0xd1fd, 0xbbf6, 0x001a, 0x001a, 0xcff9, 0xdaeb, 0xc1ca, 0x001a, 0xb8d2, 0xf1cd, 0x001a, 0xd3e3, 0xe6fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xede6, 0x001a, 0x001a, 0x001a, 0xfae3, 0x001a, 0x001a, 0xaaf0, 0xd0f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2fc, 0x001a, 0xa7f8, 0x001a, 0x001a, 0x001a, 0xe5e1, 0xf9ee, 0x001a, 0x001a, 0x001a, 0xf6e7, 0xedea, 0x001a, 0x001a, 0xb4fc, 0xc2f5, 0x001a, 0x001a, 0xdcd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5f0, 0x001a, 0xe8dd, 0xedd3, 0xfcf5, 0x001a, 0xbfda, 0x001a, 0xfbcc, 0x001a, 0x001a, 0x001a, 0xfad3, 0xa4f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7ef, 0x001a, 0xc3d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedfb, 0x001a, 0xade0, 0x001a, 0x001a, 0xeeea, 0xb3fb, 0xc2e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7f6, 0xddd2, 0x001a, 0xccdf, 0x001a, 0x001a, 0xc9fc, 0x001a, 0x001a, 0xa9e5, 0xf6e0, 0xb3f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfee1, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0cb, 0x001a, 0xefea, 0xf0ea, 0x001a, 0x001a, 0x001a, 0xc0da, 0xb4f8, 0xf2eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7e9, 0xf1e4, 0x001a, 0x001a, 0x001a, 0xefca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcafc, 0x001a, 0x001a, 0x001a, 0xe1f3, 0x001a, 0x001a, 0xc4cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e3, 0x001a, 0xc5cb, 0xb4ea, 0x001a, 0x001a, 0xbde9, 0x001a, 0xc9d7, 0x001a, 0x001a, 0xdbeb, 0xb1ed, 0x001a, 0xc3cc, 0xbef7, 0xcbfc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4f8, 0x001a, 0xb7d9, 0x001a, 0x001a, 0xd3f3, 0xd4f3, 0x001a, 0x001a, 0x001a, 0xe4f7, 0x001a, 0xd1f7, 0x001a, 0x001a, 0xb7d8, 0xb1ce, 0xc2ca, 0x001a, 0x001a, 0xb4fb, 0xc6cb, 0x001a, 0x001a, 0xf6f0, 0x001a, 0x001a, 0xe7d5, 0x001a, 0xd0ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4cc, 0xafcb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaf4, 0xafe9, 0x001a, 0x001a, 0xc3f5, 0xd8e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9dd, 0x001a, 0x001a, 0x001a, 0xf3f1, 0x001a, 0xfbd5, 0xbbde, 0x001a, 0x001a, 0xfbf4, 0x001a, 0x001a, 0x001a, 0xf3fd, 0xf2fd, 0xa6f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9dd, 0x001a, 0x001a, 0xd3d4, 0x001a, 0xa8cc, 0x001a, 0xc1da, 0xd5cc, 0x001a, 0xe4d9, 0x001a, 0x001a, 0x001a, 0xcafa, 0x001a, 0x001a, 0x001a, 0xe3e5, 0x001a, 0x001a, 0x001a, 0xbcd3, 0x001a, 0x001a, 0x001a, 0xf0ca, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4d0, 0x001a, 0x001a, 0x001a, 0xd0ca, 0xabfa, 0xebeb, 0xf8e7, 0xe5d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4f3, 0x001a, 0x001a, 0x001a, 0xfbd4, 0xe3fc, 0xd8fa, 0x001a, 0xd5f3, 0x001a, 0xabcf, 0x001a, 0x001a, 0xf3eb, 0xfcd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4d3, 0xfccd, 0x001a, 0xe6d9, 0x001a, 0xf9e2, 0xa1e2, 0xd4eb, 0x001a, 0xf7e0, 0xb2e4, 0xfccc, 0x001a, 0x001a, 0x001a, 0xe4fb, 0x001a, 0x001a, 0x001a, 0xabf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdd0, 0x001a, 0xf1ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8ef, 0x001a, 0x001a, 0x001a, 0xc0d7, 0x001a, 0xfaee, 0xf4fd, 0x001a, 0x001a, 0xe3d3, 0x001a, 0xc2fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8d5, 0xaedb, 0xb6e1, 0xb7f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfe0, 0xc3fb, 0xeadd, 0x001a, 0xa2e2, 0x001a, 0xa6ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8f6, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcadd, 0x001a, 0x001a, 0xe2d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6dd, 0x001a, 0x001a, 0xebdd, 0x001a, 0x001a, 0xf9e4, 0x001a, 0x001a, 0xafe3, 0xfcd0, 0x001a, 0x001a, 0x001a, 0xfcf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xbccc, 0xeaf7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4e5, 0xf1df, 0x001a, 0x001a, 0xe1f7, 0x001a, 0xf7f9, 0xb9ef, 0x001a, 0x001a, 0xd8f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9f8, 0x001a, 0x001a, 0x001a, 0xbdee, 0x001a, 0x001a, 0x001a, 0xc6d8, 0x001a, 0x001a, 0xe3e4, 0xcef5, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7d9, 0xb9d2, 0xc3d5, 0x001a, 0x001a, 0xe5da, 0xd0da, 0x001a, 0xd9d1, 0xd8ce, 0x001a, 0xdecb, 0xacf4, 0xfbda, 0x001a, 0xe9f6, 0xf3e8, 0xaccf, 0xf0f0, 0x001a, 0xfdf4, 0xc8db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0ce, 0xd4e3, 0xcfd1, 0xf5f1, 0x001a, 0xf2cd, 0x001a, 0xebcf, 0x001a, 0x001a, 0x001a, 0xb8cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6e3, 0xdad1, 0x001a, 0xa5f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f2, 0x001a, 0xcee4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbd3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9f1, 0x001a, 0x001a, 0x001a, 0xc9f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8ef, 0xc9e6, 0x001a, 0xb8d8, 0xf3fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5f3, 0x001a, 0x001a, 0xa4f8, 0x001a, 0x001a, 0xf3d1, 0xc8e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9dc, 0xd7de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfcb, 0x001a, 0x001a, 0x001a, 0xeccf, 0x001a, 0x001a, 0x001a, 0x001a, 0xdff4, 0x001a, 0x001a, 0xf4d1, 0xbad2, 0x001a, 0x001a, 0x001a, 0xf2df, 0x001a, 0x001a, 0x001a, 0xb7e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e2, 0xfcd3, 0x001a, 0x001a, 0xe6ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9db, 0x001a, 0x001a, 0x001a, 0xfae4, 0x001a, 0xdecf, 0x001a, 0x001a, 0xd0ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3d5, 0xf5f3, 0xaef7, 0x001a, 0x001a, 0xc8ef, 0x001a, 0xf3cd, 0xcff5, 0xf3e5, 0xc2f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1ca, 0x001a, 0x001a, 0x001a, 0xf1ea, 0x001a, 0xa6d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdad9, 0xabf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7eb, 0x001a, 0x001a, 0x001a, 0xc0e5, 0xb5fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9cc, 0xc6fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5ea, 0x001a, 0xaae5, 0xbadf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfe1, 0x001a, 0xd1da, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8e1, 0x001a, 0xf4e8, 0xfdd3, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaf2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6da, 0xb3f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdfd, 0x001a, 0x001a, 0x001a, 0xb6f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8d9, 0xb9d9, 0xc9ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xced6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbf7, 0xaedf, 0xf5e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5d2, 0x001a, 0x001a, 0x001a, 0xd5d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccf4, 0xfcda, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8d9, 0x001a, 0xebf7, 0xc9f5, 0x001a, 0xbcf3, 0x001a, 0xd2da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e8, 0x001a, 0x001a, 0xcfd6, 0xbaf4, 0x001a, 0xc9f7, 0x001a, 0x001a, 0xaacc, 0x001a, 0x001a, 0xc3f0, 0xd6cc, 0x001a, 0x001a, 0x001a, 0xd3d0, 0x001a, 0xbdd3, 0x001a, 0x001a, 0x001a, 0xfbdb, 0x001a, 0xe0cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4d3, 0xf7f6, 0x001a, 0x001a, 0xbad5, 0xcdf3, 0xe1cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadf4, 0x001a, 0xaafc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf7, 0x001a, 0x001a, 0x001a, 0xf6e8, 0x001a, 0xe7da, 0x001a, 0x001a, 0x001a, 0xccf7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xeee0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6ce, 0xabfc, 0xbbd5, 0x001a, 0x001a, 0xa8f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5e2, 0xb9cd, 0xf2ea, 0xc7cb, 0x001a, 0xf4cd, 0x001a, 0x001a, 0xafdb, 0xd9ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbacd, 0x001a, 0x001a, 0xf9fc, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3df, 0xe7ce, 0xc2da, 0x001a, 0xadcf, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e7, 0xa8f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2f3, 0x001a, 0x001a, 0x001a, 0xf2ca, 0xa4df, 0x001a, 0x001a, 0xc4d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7cc, 0xc2e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbcd, 0x001a, 0xdaef, 0xd8ee, 0x001a, 0xa7dd, 0xa6e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0e0, 0x001a, 0x001a, 0x001a, 0xb0d6, 0xcaf8, 0x001a, 0xfafc, 0x001a, 0xfed9, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0de, 0x001a, 0x001a, 0x001a, 0xecdd, 0xe8da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0d4, 0x001a, 0xf9d6, 0x001a, 0xd7cd, 0xd8de, 0x001a, 0x001a, 0xf8f2, 0x001a, 0xd6e4, 0x001a, 0x001a, 0xc5d0, 0xaef4, 0x001a, 0xa8dd, 0x001a, 0x001a, 0x001a, 0xc5ed, 0xd6f3, 0x001a, 0x001a, 0xd9de, 0xe6e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8d3, 0x001a, 0xb0db, 0x001a, 0x001a, 0xdae5, 0xbfe3, 0x001a, 0x001a, 0x001a, 0xb1db, 0x001a, 0x001a, 0x001a, 0xe9d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e0, 0xdbef, 0x001a, 0x001a, 0xe9f0, 0x001a, 0x001a, 0xb2d7, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdd0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9d9, 0x001a, 0x001a, 0xfed0, 0x001a, 0xedec, 0xa9d3, 0x001a, 0xa9f2, 0xc4f0, 0x001a, 0x001a, 0xe2e2, 0xefe9, 0x001a, 0x001a, 0x001a, 0xd1f9, 0x001a, 0x001a, 0xd9e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdae8, 0xc3da, 0xc4da, 0xc5d4, 0x001a, 0xfae7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0cd, 0xb0e3, 0x001a, 0xb2db, 0xc4fb, 0x001a, 0xe3f3, 0x001a, 0xa5d9, 0xe7fb, 0xcbdd, 0xd4d0, 0x001a, 0xb6e6, 0xaee0, 0xdafd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5dc, 0xf8e0, 0xb1e7, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0f5, 0x001a, 0xdcd8, 0xc6ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9e1, 0x001a, 0xc0e3, 0xc0f9, 0xf0e9, 0x001a, 0x001a, 0xdbd9, 0x001a, 0xe4f3, 0x001a, 0x001a, 0x001a, 0xb6dc, 0xe9e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5f0, 0xc1e3, 0xccfc, 0xcdfc, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbf2, 0x001a, 0xccf2, 0x001a, 0x001a, 0x001a, 0xcfe4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbf1, 0x001a, 0xd9fa, 0x001a, 0xb8f1, 0xf5fd, 0xf9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe7, 0xb7fc, 0xe4fc, 0xc5fb, 0xe7e3, 0xb9d8, 0x001a, 0xf8f6, 0x001a, 0x001a, 0xc5dc, 0xd8cc, 0x001a, 0x001a, 0x001a, 0xafe0, 0xe7f4, 0x001a, 0xdcef, 0xfccf, 0xddef, 0x001a, 0xaaf2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbefd, 0x001a, 0x001a, 0xacca, 0xbbfd, 0xc7fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2e7, 0x001a, 0xd1ea, 0xf4df, 0x001a, 0x001a, 0x001a, 0x001a, 0xecd1, 0xdee4, 0xc3e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6d9, 0x001a, 0x001a, 0xbccd, 0x001a, 0xe5f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5ed, 0x001a, 0x001a, 0xbad9, 0x001a, 0x001a, 0x001a, 0xe7ed, 0xb5fb, 0xecf8, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7e0, 0x001a, 0xd9cc, 0x001a, 0x001a, 0xc6d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5e7, 0x001a, 0xf5d5, 0xbed3, 0x001a, 0xfbfc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2e4, 0x001a, 0x001a, 0xf5df, 0x001a, 0x001a, 0xf8e8, 0xedf8, 0x001a, 0x001a, 0xc7ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e8, 0x001a, 0xd8cd, 0xd6e7, 0xdacc, 0x001a, 0x001a, 0xe3ca, 0xf6df, 0xc7f0, 0xc6f0, 0x001a, 0xbad8, 0x001a, 0xf4f1, 0xf0f4, 0xccf5, 0x001a, 0x001a, 0xe5fc, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5ea, 0xf3ea, 0x001a, 0xdbdd, 0x001a, 0xd7dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdde, 0xf9f2, 0x001a, 0xc7d5, 0x001a, 0x001a, 0x001a, 0xd0d8, 0x001a, 0xc8f0, 0xa1d1, 0xa2d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4d9, 0xe8d6, 0xcad9, 0x001a, 0xb1da, 0xc7d8, 0xe2dc, 0xcef3, 0xf4f5, 0x001a, 0x001a, 0xb9f1, 0x001a, 0x001a, 0xd3da, 0x001a, 0xeaf6, 0x001a, 0x001a, 0x001a, 0xf5cf, 0x001a, 0x001a, 0xaefd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2ca, 0x001a, 0x001a, 0xb4df, 0x001a, 0x001a, 0x001a, 0x001a, 0xddd7, 0xbafa, 0xa7ee, 0xbdf5, 0x001a, 0xf5f8, 0x001a, 0x001a, 0xe8ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1d4, 0x001a, 0xa3d1, 0xd6e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8f9, 0x001a, 0xcadb, 0xf9cb, 0xd4d4, 0x001a, 0xdcd9, 0x001a, 0xbeee, 0x001a, 0xedf7, 0x001a, 0x001a, 0x001a, 0xeed2, 0x001a, 0x001a, 0xe6e1, 0xf9f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeddd, 0x001a, 0xdbe8, 0x001a, 0xb3db, 0x001a, 0x001a, 0x001a, 0xf7d1, 0xb0e0, 0x001a, 0x001a, 0xe2d4, 0x001a, 0xd7f6, 0x001a, 0xf9d7, 0x001a, 0x001a, 0xddd8, 0x001a, 0xfdcd, 0xabf2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdcd, 0xc2f8, 0x001a, 0x001a, 0xacf2, 0x001a, 0x001a, 0xadca, 0xaeca, 0xaecf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdadb, 0xbbd9, 0xf3ca, 0xd3f6, 0xf8e6, 0xf5ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6ea, 0x001a, 0x001a, 0xf9f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafcf, 0x001a, 0x001a, 0xd3ca, 0x001a, 0x001a, 0xafca, 0xb0d2, 0xbaf1, 0x001a, 0xb3d7, 0xc3e3, 0xfdf3, 0xdade, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbde, 0x001a, 0x001a, 0xdeef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3e2, 0xfbee, 0x001a, 0x001a, 0xf7df, 0xcad7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8ce, 0xdbdb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbf1, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7fa, 0xc6d0, 0x001a, 0x001a, 0xabcc, 0xa8ee, 0x001a, 0x001a, 0xfacb, 0xf9f9, 0xfdcc, 0xfed3, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeef2, 0x001a, 0xd5d4, 0xcddf, 0x001a, 0xb8fc, 0xd0d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdf2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4ca, 0x001a, 0xd9d5, 0x001a, 0x001a, 0x001a, 0xded8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9cd, 0x001a, 0x001a, 0x001a, 0xa9ee, 0xbcf6, 0x001a, 0x001a, 0xdbcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9f0, 0x001a, 0xfcfc, 0x001a, 0xc9e8, 0xfef4, 0x001a, 0x001a, 0x001a, 0x001a, 0xfce7, 0xded7, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcde, 0x001a, 0xacf0, 0xfecc, 0xe1cd, 0x001a, 0xbae1, 0x001a, 0xefdb, 0xb2da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5d1, 0xb8dc, 0x001a, 0x001a, 0x001a, 0xf6d8, 0x001a, 0xa4d1, 0x001a, 0xe2cd, 0x001a, 0x001a, 0x001a, 0x001a, 0xeadc, 0x001a, 0x001a, 0xf7f0, 0x001a, 0xcaf0, 0xbed0, 0x001a, 0xdcdd, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6d4, 0xd6d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0ed, 0xa1cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5df, 0x001a, 0x001a, 0x001a, 0xf8df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1d4, 0xb2ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcae8, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e3, 0xd0f5, 0x001a, 0x001a, 0x001a, 0xa1f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe6, 0x001a, 0xf1f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3f9, 0xdbe0, 0xebf6, 0x001a, 0xf1cb, 0x001a, 0xead9, 0xa2f5, 0x001a, 0x001a, 0x001a, 0xd1d7, 0x001a, 0xf8d1, 0xf8ea, 0xf9ea, 0xb3da, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfef, 0x001a, 0x001a, 0xeff1, 0x001a, 0xf6e5, 0xbfee, 0xe4e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfd0, 0x001a, 0xacfa, 0xd1f5, 0xb3e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcef2, 0xb4db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcefc, 0x001a, 0xeedd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbecd, 0x001a, 0xe9da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0cf, 0xd9f7, 0xe6f3, 0x001a, 0x001a, 0xd9ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaace, 0x001a, 0xc8cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7d0, 0x001a, 0xcbf0, 0x001a, 0xc7d0, 0x001a, 0x001a, 0xc5e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdad5, 0x001a, 0xa7d7, 0x001a, 0x001a, 0x001a, 0xc0ee, 0x001a, 0xf6f8, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2f5, 0xe9ed, 0x001a, 0xbcd9, 0x001a, 0xc6e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3f5, 0x001a, 0x001a, 0xd4da, 0xa7e2, 0xfcfb, 0x001a, 0x001a, 0xdcf1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4ca, 0x001a, 0x001a, 0x001a, 0xfae8, 0x001a, 0x001a, 0xe9ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8e9, 0xe5e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9d0, 0xf2d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6d1, 0x001a, 0xcedf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad3, 0x001a, 0x001a, 0x001a, 0xaccc, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0ef, 0x001a, 0x001a, 0x001a, 0xe5e5, 0xd5d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfcdb, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfecb, 0xeaed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2d4, 0xf6cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xead5, 0xeef1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbfa, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedcf, 0x001a, 0xebed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2d5, 0x001a, 0x001a, 0x001a, 0xbcd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2fd, 0xadf3, 0x001a, 0xdbfd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7d1, 0x001a, 0x001a, 0xe3fd, 0xb3ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4fd, 0xcefa, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0ca, 0x001a, 0xa7f7, 0x001a, 0xb1cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2e6, 0x001a, 0xb6fc, 0xadf2, 0xe1ef, 0xaef3, 0xc6dc, 0xebd9, 0x001a, 0x001a, 0x001a, 0xe0e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6d5, 0xfdcf, 0x001a, 0x001a, 0xddde, 0x001a, 0x001a, 0x001a, 0xd1d9, 0x001a, 0x001a, 0x001a, 0xeae4, 0xcff2, 0x001a, 0xbff7, 0x001a, 0x001a, 0xe6e2, 0xa8e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e3, 0x001a, 0xd1ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1d6, 0xb2de, 0x001a, 0x001a, 0xe8e0, 0x001a, 0x001a, 0xabd3, 0x001a, 0xdceb, 0x001a, 0x001a, 0xafdf, 0x001a, 0xc3ca, 0x001a, 0x001a, 0xfcee, 0x001a, 0xc3fd, 0x001a, 0x001a, 0x001a, 0xf6eb, 0xb2cf, 0x001a, 0x001a, 0x001a, 0x001a, 0xecd9, 0x001a, 0xbdd9, 0x001a, 0xdfd8, 0x001a, 0x001a, 0xb8d4, 0xbeeb, 0xefdd, 0x001a, 0xf0dd, 0xf1dd, 0xf2dd, 0x001a, 0x001a, 0xbed9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6fb, 0xb3cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabe4, 0x001a, 0xc5da, 0x001a, 0xecd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9e2, 0x001a, 0x001a, 0xbcde, 0xb5e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0db, 0x001a, 0xe2ef, 0xf0f1, 0xb4cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1db, 0x001a, 0xb1e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5df, 0x001a, 0xd2f9, 0x001a, 0x001a, 0xfde7, 0x001a, 0x001a, 0xa3e6, 0xf1fb, 0xb0cb, 0xaef2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7cd, 0x001a, 0xdce8, 0x001a, 0x001a, 0xd7e7, 0x001a, 0x001a, 0xc0f7, 0x001a, 0xe3d0, 0x001a, 0x001a, 0x001a, 0xa1da, 0x001a, 0x001a, 0x001a, 0xbdcc, 0x001a, 0x001a, 0xa9d1, 0xccdd, 0x001a, 0x001a, 0xfee3, 0xaad1, 0xaae8, 0x001a, 0xb6ea, 0xfaf9, 0xcce6, 0xd8f6, 0x001a, 0x001a, 0x001a, 0xc7d4, 0x001a, 0x001a, 0x001a, 0xcbd9, 0x001a, 0xd2d9, 0xcbd3, 0xf7d8, 0xa9da, 0xf8f5, 0x001a, 0x001a, 0xdede, 0xaff2, 0xa9f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8d8, 0x001a, 0x001a, 0xc1ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1f9, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3dd, 0xfaea, 0x001a, 0xbdf6, 0xbbe1, 0xbfcd, 0xd4f4, 0xcde6, 0x001a, 0xcffc, 0xa2fb, 0x001a, 0xdce0, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbf4, 0xd5da, 0x001a, 0xb2f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2fb, 0x001a, 0xf6db, 0x001a, 0xdfde, 0x001a, 0x001a, 0x001a, 0xf2db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcf8, 0xeef7, 0xe8eb, 0x001a, 0xfad2, 0x001a, 0x001a, 0xbcf1, 0x001a, 0x001a, 0xdafa, 0x001a, 0x001a, 0xeada, 0xc6da, 0xc1f7, 0x001a, 0x001a, 0xb6e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7e5, 0xacd6, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9e1, 0x001a, 0xaae2, 0x001a, 0xa6d5, 0x001a, 0x001a, 0xd7d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0f2, 0x001a, 0xfbea, 0x001a, 0xdde0, 0xf3fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdf1, 0x001a, 0x001a, 0xe7e2, 0xd7fd, 0x001a, 0xc8ce, 0xb7ea, 0x001a, 0xc0fc, 0x001a, 0xe7fd, 0xeff7, 0x001a, 0x001a, 0xb5d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbaef, 0xddf1, 0x001a, 0xb3de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe8, 0x001a, 0x001a, 0xddf8, 0x001a, 0x001a, 0xc7fb, 0xc8d5, 0x001a, 0xdfd7, 0x001a, 0xa9dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1e9, 0x001a, 0x001a, 0xadfa, 0xd9f6, 0xf4fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeee6, 0x001a, 0xdccc, 0xbce1, 0xefe0, 0x001a, 0x001a, 0xbfe9, 0xfdfc, 0xcee6, 0x001a, 0x001a, 0xd7e1, 0x001a, 0xcfe6, 0x001a, 0xf1f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3e4, 0x001a, 0x001a, 0xfbe4, 0x001a, 0x001a, 0xe4f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3ef, 0x001a, 0x001a, 0xeecf, 0xbef6, 0xb2e0, 0xfefc, 0xabd1, 0x001a, 0x001a, 0x001a, 0xfad7, 0x001a, 0x001a, 0x001a, 0xc8fb, 0x001a, 0xd7e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3d4, 0xf8f0, 0xa8d7, 0x001a, 0x001a, 0x001a, 0xe7e1, 0x001a, 0x001a, 0xbfd3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4ef, 0x001a, 0xc5d7, 0xe2eb, 0x001a, 0x001a, 0xe7fc, 0x001a, 0x001a, 0xa2e4, 0x001a, 0xe8e2, 0x001a, 0xd0e6, 0x001a, 0xe8fb, 0xe8f4, 0xf4e5, 0xbcf4, 0xd5f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6df, 0x001a, 0xb9fc, 0xc2ee, 0xf5ca, 0x001a, 0x001a, 0x001a, 0xe5ef, 0xe2cb, 0xa4d4, 0x001a, 0xe0de, 0xfdda, 0xc6e4, 0xbee8, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee0, 0xb4f6, 0xd2ea, 0x001a, 0xfbf9, 0x001a, 0x001a, 0xc2e0, 0x001a, 0xe4ca, 0x001a, 0xb7e7, 0x001a, 0xfdea, 0x001a, 0xddd9, 0x001a, 0xb4da, 0xaaee, 0xe9fb, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbdb, 0xb5da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbef1, 0x001a, 0x001a, 0xacd3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9fb, 0x001a, 0xcfdf, 0x001a, 0x001a, 0xc0d3, 0xd7e3, 0x001a, 0xe6ef, 0xd0fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0e9, 0x001a, 0x001a, 0x001a, 0xd3f5, 0x001a, 0x001a, 0xdcec, 0xb7f7, 0x001a, 0x001a, 0xb8ea, 0xf9d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdef1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6d7, 0xb5cf, 0x001a, 0xa8d9, 0x001a, 0x001a, 0xeeec, 0x001a, 0x001a, 0xaadd, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2cd, 0xaee8, 0x001a, 0x001a, 0x001a, 0xbde1, 0x001a, 0xd1f2, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e9, 0x001a, 0x001a, 0x001a, 0xfcd2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5db, 0x001a, 0xe7f3, 0xfed8, 0x001a, 0x001a, 0x001a, 0xd1fc, 0x001a, 0xb2ed, 0xaff4, 0x001a, 0xa3fb, 0x001a, 0x001a, 0xc1fc, 0x001a, 0xabee, 0xa5d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2f4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9ee, 0x001a, 0x001a, 0x001a, 0xcafb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3cd, 0xbbd8, 0x001a, 0xdbe5, 0xf7f8, 0x001a, 0x001a, 0x001a, 0xd4f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9d7, 0x001a, 0xc9cb, 0x001a, 0x001a, 0xd1e6, 0xccf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaed8, 0x001a, 0xd3f9, 0xfed5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcd8, 0xb0f2, 0x001a, 0x001a, 0x001a, 0x001a, 0xabe2, 0xe8f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeced, 0x001a, 0xb8e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfeda, 0x001a, 0x001a, 0xbecc, 0x001a, 0x001a, 0xfcf2, 0xebda, 0x001a, 0xd8e2, 0xd6ed, 0x001a, 0x001a, 0xd1d6, 0xb3e0, 0x001a, 0x001a, 0xd2fc, 0x001a, 0xc8eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1d3, 0xcdf0, 0x001a, 0xf7cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2ed, 0x001a, 0xd8d4, 0xc9dc, 0xf1d7, 0x001a, 0x001a, 0xbbdf, 0x001a, 0x001a, 0xa5f3, 0x001a, 0x001a, 0x001a, 0xcdf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xbff1, 0xb1f8, 0x001a, 0xfae9, 0x001a, 0x001a, 0x001a, 0xcbfb, 0x001a, 0x001a, 0xd5ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4f9, 0xcaf7, 0x001a, 0x001a, 0xc8d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8fc, 0xbdf3, 0x001a, 0xfeee, 0x001a, 0xfee7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2d3, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6d3, 0x001a, 0xadcc, 0xfaf6, 0xb2d6, 0xd8d2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9e7, 0x001a, 0x001a, 0x001a, 0x001a, 0xadf0, 0xccfb, 0xa1eb, 0x001a, 0x001a, 0xa6d4, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdfb, 0x001a, 0xbdd5, 0xdff1, 0x001a, 0x001a, 0xfbf6, 0x001a, 0xb4de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebd5, 0x001a, 0x001a, 0xc8e5, 0x001a, 0x001a, 0x001a, 0xa4fb, 0xb9d4, 0x001a, 0x001a, 0xe1de, 0x001a, 0xa3e4, 0x001a, 0x001a, 0x001a, 0xb7d7, 0x001a, 0xeef8, 0x001a, 0x001a, 0x001a, 0xb5de, 0x001a, 0x001a, 0xd2d6, 0x001a, 0xd5f9, 0xbae7, 0xd5eb, 0xf7d5, 0xe7ef, 0xbee1, 0x001a, 0x001a, 0x001a, 0xaefa, 0x001a, 0x001a, 0x001a, 0xe9d6, 0xeed6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbe7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4ce, 0x001a, 0x001a, 0x001a, 0xa5fb, 0xeee1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8f7, 0x001a, 0x001a, 0x001a, 0x001a, 0xcefb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdfb, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6cf, 0x001a, 0x001a, 0x001a, 0xc7ed, 0xacee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddcc, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7f6, 0x001a, 0x001a, 0x001a, 0xfae6, 0x001a, 0x001a, 0x001a, 0xa4f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcfd, 0xb3ed, 0xc9ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8ef, 0x001a, 0x001a, 0xbfe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbfa, 0xe3cb, 0xa9f7, 0x001a, 0xa6fb, 0x001a, 0x001a, 0x001a, 0xb9dc, 0x001a, 0x001a, 0x001a, 0xc0f1, 0xc8ed, 0xc3ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadd6, 0x001a, 0x001a, 0xcefd, 0x001a, 0x001a, 0x001a, 0xa1e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4fb, 0xa7d5, 0x001a, 0x001a, 0x001a, 0xf6f1, 0x001a, 0xd3e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdecc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2f8, 0x001a, 0x001a, 0x001a, 0xebdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xeae5, 0x001a, 0x001a, 0xe0f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccdb, 0xcddd, 0x001a, 0x001a, 0x001a, 0xc8d4, 0x001a, 0x001a, 0xedd9, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8fd, 0x001a, 0xa1d6, 0xbffd, 0x001a, 0xd3fc, 0x001a, 0xa1ef, 0x001a, 0xbce7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeed1, 0x001a, 0x001a, 0xd5e6, 0x001a, 0x001a, 0xf2e9, 0x001a, 0xb0df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0d8, 0xbafc, 0xaffd, 0xcef0, 0x001a, 0xe1db, 0x001a, 0x001a, 0xc9e5, 0x001a, 0xb4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe9, 0xa8ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7fd, 0x001a, 0x001a, 0xa7fb, 0x001a, 0xc2e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e2, 0x001a, 0x001a, 0xecdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8fd, 0xf9fd, 0x001a, 0x001a, 0x001a, 0xbff6, 0x001a, 0x001a, 0xa7e7, 0x001a, 0xd7e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3d4, 0xc9d4, 0x001a, 0x001a, 0x001a, 0x001a, 0xfad6, 0x001a, 0xf2d7, 0x001a, 0xc0e1, 0x001a, 0xe2db, 0xd8e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbde7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcff0, 0xbef3, 0xace2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7f5, 0xf0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8fd, 0xe8e3, 0x001a, 0xa7d4, 0xfce8, 0xd2fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeff8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0f0, 0x001a, 0xf0f7, 0xb3ee, 0x001a, 0x001a, 0xbaea, 0x001a, 0xd3ea, 0x001a, 0x001a, 0xc9ed, 0xabdd, 0x001a, 0x001a, 0x001a, 0xace5, 0xa1fd, 0x001a, 0xd0df, 0xb3ec, 0x001a, 0xd1df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeded, 0xb8f8, 0xfaf7, 0x001a, 0x001a, 0x001a, 0xabf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbad4, 0xb3e4, 0x001a, 0xdae9, 0x001a, 0xb6de, 0x001a, 0xbfd9, 0x001a, 0xc0d9, 0xefd6, 0x001a, 0x001a, 0x001a, 0x001a, 0xccd9, 0x001a, 0xaada, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5f7, 0x001a, 0x001a, 0x001a, 0xb2cc, 0x001a, 0x001a, 0xf9df, 0xe0d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbd4, 0x001a, 0x001a, 0x001a, 0x001a, 0xfafd, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3cc, 0x001a, 0x001a, 0xf3db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2df, 0x001a, 0xcace, 0x001a, 0xdaee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4e4, 0x001a, 0xcffb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7cf, 0x001a, 0xc3ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeace, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xade2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1d7, 0xf5fa, 0x001a, 0x001a, 0xc9d5, 0xacf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9f3, 0x001a, 0x001a, 0x001a, 0x001a, 0xedd8, 0xc4e3, 0xf1f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e8, 0x001a, 0x001a, 0x001a, 0xfae0, 0xc4ee, 0xded9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2eb, 0xa3eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2fc, 0xbbea, 0x001a, 0x001a, 0x001a, 0x001a, 0xabe8, 0xe2de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefed, 0x001a, 0xa3e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcd4, 0x001a, 0xeafc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee7, 0x001a, 0xf2fc, 0x001a, 0x001a, 0xb4d6, 0x001a, 0x001a, 0xaee2, 0x001a, 0xb7d3, 0xccfa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcfa, 0x001a, 0xb5ed, 0xe3e1, 0x001a, 0xace8, 0x001a, 0xdde8, 0x001a, 0x001a, 0xe9ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdf4, 0x001a, 0xb8cf, 0xdbe9, 0xacd1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9eb, 0x001a, 0xcce8, 0x001a, 0x001a, 0x001a, 0xb7de, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcd6, 0xe5d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddfa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6da, 0x001a, 0xb1ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8da, 0xa6df, 0x001a, 0xb3f9, 0xd2f2, 0x001a, 0xc4ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbce, 0x001a, 0x001a, 0xf5cd, 0x001a, 0x001a, 0x001a, 0xb0fd, 0xa8d5, 0x001a, 0xc1f1, 0x001a, 0x001a, 0xe9e2, 0xcadc, 0xb4ec, 0xc0fa, 0x001a, 0x001a, 0xa8fb, 0xa8d0, 0x001a, 0x001a, 0xecda, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeed9, 0x001a, 0xfbe0, 0x001a, 0x001a, 0x001a, 0xeaef, 0xdefa, 0x001a, 0x001a, 0xc4e0, 0x001a, 0xb9cf, 0x001a, 0xcad5, 0xe2d7, 0xafe2, 0x001a, 0xb8d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaf6, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2ef, 0xdae2, 0xfcf6, 0x001a, 0x001a, 0xd0fb, 0xadd1, 0x001a, 0xe4cd, 0x001a, 0xaed1, 0xeddc, 0xcee8, 0x001a, 0xf9f0, 0xb5ce, 0xfce6, 0x001a, 0x001a, 0xfbd7, 0xd6d0, 0xf5dd, 0xf1f7, 0x001a, 0xfdf6, 0x001a, 0xf7db, 0x001a, 0x001a, 0x001a, 0x001a, 0xeafb, 0xdce9, 0xc1d9, 0x001a, 0xf2f5, 0xc5e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2f9, 0x001a, 0xbcea, 0x001a, 0xc5d2, 0xd1fb, 0xc0e7, 0xa5eb, 0x001a, 0xfadf, 0xa2e3, 0xb9d7, 0x001a, 0xc3e9, 0x001a, 0xfde8, 0xafe8, 0x001a, 0x001a, 0xd3f2, 0xa9fb, 0xa5d8, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8d0, 0x001a, 0x001a, 0x001a, 0xafd1, 0xe3d7, 0x001a, 0x001a, 0x001a, 0xc6e0, 0x001a, 0xa2d6, 0x001a, 0xf0ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3d7, 0x001a, 0x001a, 0x001a, 0xd4fc, 0x001a, 0xd7da, 0xdfcc, 0x001a, 0xd4f2, 0x001a, 0xb0d1, 0x001a, 0xe0cc, 0x001a, 0xfddb, 0xbff3, 0x001a, 0xd1f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbfc, 0x001a, 0xb0e2, 0x001a, 0x001a, 0xa5e6, 0x001a, 0x001a, 0x001a, 0xdbe2, 0x001a, 0x001a, 0x001a, 0xdedf, 0x001a, 0xc7e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeff2, 0x001a, 0x001a, 0x001a, 0xe1cc, 0x001a, 0x001a, 0x001a, 0x001a, 0xead6, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e7, 0x001a, 0x001a, 0x001a, 0xb6ce, 0x001a, 0xc0f3, 0x001a, 0xfecd, 0x001a, 0x001a, 0x001a, 0xd2fb, 0x001a, 0xf8f8, 0xfbf7, 0x001a, 0x001a, 0xbfe8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbadc, 0x001a, 0x001a, 0xb4cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7f1, 0x001a, 0x001a, 0x001a, 0xb8e8, 0x001a, 0x001a, 0xf6ca, 0x001a, 0xa4e4, 0xd6f4, 0x001a, 0x001a, 0x001a, 0xe6df, 0x001a, 0x001a, 0x001a, 0xa7df, 0x001a, 0xe7df, 0xc1e1, 0x001a, 0xc4e9, 0x001a, 0x001a, 0xcbdc, 0xc5e9, 0x001a, 0x001a, 0x001a, 0xa3ef, 0xa6eb, 0xa3cb, 0xe9e3, 0x001a, 0x001a, 0x001a, 0xfbd1, 0xa4ef, 0x001a, 0xebef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3cd, 0x001a, 0x001a, 0xe6e8, 0x001a, 0xa5ef, 0x001a, 0xccd3, 0xedda, 0x001a, 0x001a, 0x001a, 0x001a, 0xbad7, 0x001a, 0xd5f2, 0xe5f5, 0xefd9, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4f9, 0x001a, 0x001a, 0xd4d5, 0xcffd, 0x001a, 0x001a, 0x001a, 0xe3db, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1f1, 0xb6ec, 0x001a, 0x001a, 0x001a, 0x001a, 0xfefb, 0xd7d3, 0x001a, 0xb1d1, 0x001a, 0xb1cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2cb, 0xc2f1, 0x001a, 0x001a, 0xe1f4, 0xb5f9, 0x001a, 0x001a, 0xc3e1, 0xc2e1, 0x001a, 0xf7eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcacb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdef8, 0xaaf9, 0xf7ca, 0x001a, 0xb7ed, 0x001a, 0x001a, 0xb8d3, 0xd6f2, 0x001a, 0x001a, 0xd9d4, 0xc5ee, 0xf0f2, 0x001a, 0x001a, 0x001a, 0xb2ca, 0x001a, 0x001a, 0xbbdc, 0x001a, 0xf8f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7ec, 0x001a, 0x001a, 0x001a, 0x001a, 0xcae5, 0x001a, 0xc0f6, 0xddfd, 0x001a, 0x001a, 0xe3d4, 0xe2cc, 0x001a, 0xd4f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3d3, 0x001a, 0xa6d8, 0x001a, 0xc1f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6dd, 0x001a, 0xc0cd, 0x001a, 0x001a, 0x001a, 0xdce5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0e8, 0xb0f4, 0xeaf3, 0xeeda, 0x001a, 0xbbd7, 0x001a, 0xb1e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfe4, 0x001a, 0xd6ca, 0x001a, 0x001a, 0x001a, 0xa8eb, 0x001a, 0x001a, 0x001a, 0xfedb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2f6, 0x001a, 0x001a, 0xbbef, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdd4, 0x001a, 0x001a, 0xc8e0, 0x001a, 0x001a, 0x001a, 0xb9e8, 0x001a, 0xa6ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4cd, 0x001a, 0x001a, 0xf4d4, 0xa1db, 0xdcdb, 0xdddb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcee, 0x001a, 0xcbcb, 0xd5fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebce, 0x001a, 0xc1cd, 0x001a, 0x001a, 0xd3fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4f5, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9d9, 0x001a, 0x001a, 0xdde9, 0xcddb, 0x001a, 0x001a, 0xcedd, 0x001a, 0xc3e7, 0x001a, 0xccec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf9, 0x001a, 0x001a, 0x001a, 0xcccb, 0x001a, 0x001a, 0x001a, 0x001a, 0xfce0, 0xa8d4, 0x001a, 0xd3ed, 0xefd8, 0x001a, 0xd7f2, 0x001a, 0xf8ca, 0xefda, 0x001a, 0x001a, 0xd4d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdd9, 0x001a, 0x001a, 0x001a, 0xeed8, 0x001a, 0xc1f2, 0x001a, 0x001a, 0x001a, 0xd3df, 0x001a, 0x001a, 0x001a, 0xf0da, 0x001a, 0xeae2, 0x001a, 0x001a, 0xfde0, 0x001a, 0x001a, 0xf8d8, 0x001a, 0x001a, 0x001a, 0xaff7, 0xb6da, 0x001a, 0xd7ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8f2, 0x001a, 0xf9d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdffa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefcf, 0xc2d9, 0x001a, 0xd2f0, 0x001a, 0xd1e4, 0x001a, 0x001a, 0x001a, 0xb7f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2e2, 0x001a, 0xbdd4, 0x001a, 0x001a, 0xced9, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9d4, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2cd, 0xdae7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbed8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaddc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe2, 0xfcd6, 0x001a, 0x001a, 0xf9ca, 0x001a, 0x001a, 0xdad4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7f4, 0xa1cc, 0x001a, 0x001a, 0xbacf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8f5, 0x001a, 0x001a, 0x001a, 0xc3d9, 0xe8d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5e3, 0xf8eb, 0x001a, 0xb1f2, 0x001a, 0x001a, 0x001a, 0xbbcf, 0x001a, 0x001a, 0x001a, 0xadd3, 0xe1e8, 0xecce, 0x001a, 0x001a, 0x001a, 0xb4e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2f2, 0xf6f3, 0xdbf6, 0x001a, 0x001a, 0x001a, 0x001a, 0xfed7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdff8, 0x001a, 0xf2f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdae6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcd7, 0xe3cc, 0x001a, 0x001a, 0xdbe6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdddd, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedef, 0x001a, 0x001a, 0x001a, 0x001a, 0xded6, 0xf4e4, 0xefe1, 0x001a, 0x001a, 0xf8dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5ca, 0x001a, 0x001a, 0x001a, 0xa1dc, 0x001a, 0xb5e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacfc, 0xadfc, 0xa7d8, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8ed, 0x001a, 0x001a, 0x001a, 0xb6db, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0d6, 0xaff3, 0x001a, 0x001a, 0xa5cd, 0x001a, 0xf1da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8d8, 0x001a, 0x001a, 0x001a, 0xe4cc, 0x001a, 0x001a, 0xb4d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecd5, 0xf8d5, 0xf3da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6e3, 0x001a, 0x001a, 0x001a, 0xe4de, 0x001a, 0xe5de, 0xb5d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6d1, 0xb7d1, 0xb3f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3f0, 0xb4f2, 0x001a, 0x001a, 0xd4f0, 0xe4cb, 0xd4fb, 0xe6f5, 0xeae3, 0x001a, 0xe6de, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4df, 0x001a, 0x001a, 0xf9f8, 0x001a, 0x001a, 0x001a, 0x001a, 0xaef0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8d1, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfd6, 0x001a, 0xd7d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1fc, 0xeeef, 0xd8dc, 0x001a, 0xdfe9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde5, 0xfbfd, 0x001a, 0x001a, 0xc9e0, 0x001a, 0x001a, 0x001a, 0xc9d6, 0x001a, 0x001a, 0xaad4, 0x001a, 0xcce5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0e9, 0x001a, 0x001a, 0x001a, 0xd8d0, 0xa2fc, 0xbed4, 0xb3e2, 0xe7de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcdc, 0xb6d2, 0xd5f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1ce, 0xa9f5, 0x001a, 0x001a, 0xf9dd, 0x001a, 0x001a, 0xfadd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5f0, 0x001a, 0x001a, 0x001a, 0x001a, 0xdff6, 0x001a, 0xdaf2, 0xebe4, 0x001a, 0xf1f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9ec, 0x001a, 0x001a, 0x001a, 0x001a, 0xfcfd, 0x001a, 0x001a, 0x001a, 0x001a, 0xaae1, 0x001a, 0x001a, 0xd9ca, 0x001a, 0x001a, 0xefef, 0x001a, 0xaaf5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9ec, 0x001a, 0x001a, 0xadf8, 0x001a, 0xc2f2, 0xc3f6, 0x001a, 0xd2d7, 0x001a, 0x001a, 0xa2f9, 0xd6f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaf0, 0x001a, 0x001a, 0xe0f6, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3e9, 0xc3f2, 0x001a, 0x001a, 0x001a, 0xabd4, 0xb3ca, 0xa6cd, 0x001a, 0xc3cd, 0xdacd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfd9, 0x001a, 0x001a, 0xc4f6, 0x001a, 0x001a, 0x001a, 0xddee, 0xc4e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2df, 0xdbe7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1e8, 0x001a, 0xaefc, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde5, 0x001a, 0x001a, 0x001a, 0xebfa, 0x001a, 0xbccf, 0x001a, 0x001a, 0xe2cf, 0xf6cd, 0x001a, 0x001a, 0xf0ef, 0x001a, 0xbef4, 0x001a, 0xcdd4, 0x001a, 0x001a, 0xb8f3, 0x001a, 0x001a, 0x001a, 0xa1e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2f2, 0xebf3, 0x001a, 0xd7f0, 0x001a, 0x001a, 0xd7cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfcf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0e8, 0xc1e8, 0x001a, 0x001a, 0x001a, 0xe3cf, 0xa2e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1f3, 0xabd0, 0x001a, 0xe4d4, 0x001a, 0x001a, 0xbcef, 0xa1d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfd9, 0x001a, 0xd7f3, 0x001a, 0x001a, 0x001a, 0xbddc, 0x001a, 0xe5cc, 0xf1ed, 0x001a, 0x001a, 0xe2f1, 0x001a, 0xdbd4, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5e2, 0x001a, 0x001a, 0xe6ca, 0x001a, 0xaed3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6cc, 0x001a, 0x001a, 0xd3f1, 0xe7f5, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeefb, 0x001a, 0xc5e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9df, 0x001a, 0xdeee, 0x001a, 0x001a, 0xc2f7, 0x001a, 0xa2d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacdd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaff0, 0xbdd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6f9, 0x001a, 0x001a, 0xf5d4, 0x001a, 0xc9d0, 0xa7ef, 0xece2, 0x001a, 0xeadb, 0xccce, 0xe8f5, 0xd5f7, 0x001a, 0xcdd3, 0x001a, 0xfef3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfee0, 0x001a, 0xfbdf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdcb, 0x001a, 0x001a, 0x001a, 0xa8ef, 0x001a, 0x001a, 0x001a, 0xb4ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8da, 0xb9d1, 0x001a, 0xa9df, 0x001a, 0x001a, 0xb0f3, 0x001a, 0x001a, 0xc4cc, 0x001a, 0x001a, 0x001a, 0xb7ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9ef, 0x001a, 0x001a, 0x001a, 0xd5df, 0x001a, 0x001a, 0xd7ed, 0x001a, 0x001a, 0x001a, 0xc6ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdef, 0xd6fc, 0x001a, 0x001a, 0xf4db, 0x001a, 0xaaef, 0xb9f8, 0x001a, 0xe9f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6e1, 0x001a, 0x001a, 0x001a, 0xbfd4, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeaf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafd3, 0x001a, 0x001a, 0xdbca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7fc, 0x001a, 0x001a, 0xd8ed, 0xc7e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8f4, 0xb3d6, 0xaddd, 0x001a, 0x001a, 0x001a, 0xbed5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3f1, 0xdfee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebd6, 0x001a, 0x001a, 0x001a, 0xd9f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbdd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfdd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3d8, 0x001a, 0x001a, 0xd9da, 0x001a, 0xd8f0, 0xc4ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4f1, 0x001a, 0xf2ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbd5, 0x001a, 0x001a, 0xdcd5, 0xc4f3, 0xd7cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0dd, 0xd9f0, 0xb3cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7cd, 0x001a, 0x001a, 0xacd0, 0x001a, 0xbad1, 0x001a, 0xc4f1, 0x001a, 0xb3e5, 0xf5fb, 0xe1e9, 0xe0fd, 0xbcfc, 0x001a, 0xa2da, 0xa3da, 0x001a, 0xa1d2, 0x001a, 0x001a, 0xefd2, 0x001a, 0x001a, 0x001a, 0xede2, 0x001a, 0x001a, 0xe9de, 0xdcce, 0xb5f2, 0xe4d0, 0xd1dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8e1, 0xb7db, 0xe3df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9ed, 0xc5f1, 0x001a, 0xcff3, 0xabd7, 0xace1, 0x001a, 0x001a, 0xebe3, 0x001a, 0xc7ee, 0x001a, 0x001a, 0x001a, 0xc9e1, 0xfaca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbf0, 0xe1fa, 0xdaf0, 0xe7cc, 0xf4da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedce, 0x001a, 0x001a, 0xa9d5, 0xe2fa, 0x001a, 0x001a, 0x001a, 0xe5d0, 0x001a, 0xd6eb, 0x001a, 0xdfec, 0x001a, 0x001a, 0x001a, 0xfcdf, 0x001a, 0x001a, 0xd6f7, 0xeade, 0xb4cb, 0x001a, 0x001a, 0xbeef, 0x001a, 0x001a, 0xb5cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdcf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2ef, 0xb7e2, 0x001a, 0x001a, 0x001a, 0xe8cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfcf0, 0x001a, 0x001a, 0x001a, 0xe0d6, 0x001a, 0xc6f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8e2, 0xabeb, 0x001a, 0x001a, 0x001a, 0xb5cb, 0xd1d8, 0x001a, 0xcef4, 0xf7f3, 0x001a, 0x001a, 0xc6d7, 0x001a, 0xbbd1, 0xaaf7, 0x001a, 0xcaed, 0xd3d7, 0xfad8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5f6, 0x001a, 0x001a, 0xccd1, 0xfcdd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfddf, 0x001a, 0xe5f9, 0x001a, 0xcae0, 0x001a, 0x001a, 0xfdf2, 0xb0d3, 0x001a, 0xf3f4, 0xc9da, 0x001a, 0xdee6, 0x001a, 0x001a, 0x001a, 0x001a, 0xbaf8, 0xd0e8, 0x001a, 0x001a, 0xfbd8, 0x001a, 0x001a, 0xd5ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbf2, 0xfce4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdada, 0x001a, 0xdcf2, 0xd6fb, 0xb2e9, 0x001a, 0xadee, 0x001a, 0xe3fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeedc, 0x001a, 0x001a, 0xeaf5, 0xe0e6, 0x001a, 0xfdf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5f5, 0xe0ee, 0x001a, 0x001a, 0xe5db, 0x001a, 0xdedd, 0x001a, 0x001a, 0xf0d9, 0xa3e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9f1, 0x001a, 0xc4f2, 0xcbe0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e9, 0x001a, 0x001a, 0xb9e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1e3, 0xebfc, 0xa8cd, 0x001a, 0xb6cc, 0x001a, 0x001a, 0xdbf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbae6, 0x001a, 0x001a, 0xa9cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e1, 0x001a, 0x001a, 0xabef, 0x001a, 0x001a, 0x001a, 0xc5e7, 0x001a, 0x001a, 0xe9e0, 0x001a, 0xc5f3, 0x001a, 0x001a, 0xc0d4, 0xbfd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaedd, 0x001a, 0xfcf9, 0x001a, 0xc0cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2e5, 0x001a, 0x001a, 0x001a, 0xb8ce, 0x001a, 0x001a, 0x001a, 0xd2d8, 0xd6f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaf1, 0xd1ce, 0x001a, 0x001a, 0xc7f6, 0x001a, 0xebdb, 0x001a, 0xfedf, 0x001a, 0x001a, 0xe1d8, 0x001a, 0xf3f7, 0x001a, 0xe7d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfed4, 0x001a, 0x001a, 0xbcd1, 0x001a, 0xcfe5, 0x001a, 0xb6cb, 0x001a, 0xb8da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbed6, 0x001a, 0x001a, 0x001a, 0xbae2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8cf, 0x001a, 0x001a, 0x001a, 0xcce0, 0xf9eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdfd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8d7, 0xd8cb, 0x001a, 0x001a, 0x001a, 0xe2e9, 0x001a, 0x001a, 0x001a, 0xbae8, 0x001a, 0x001a, 0x001a, 0xc7e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdec, 0x001a, 0xceec, 0x001a, 0xbfd6, 0x001a, 0x001a, 0x001a, 0xa7e3, 0x001a, 0xd6df, 0xe8fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1ee, 0xa8f6, 0xfddd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbf8, 0x001a, 0xd1e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeece, 0x001a, 0x001a, 0xcfec, 0x001a, 0x001a, 0x001a, 0xa5e9, 0xd5d6, 0x001a, 0xc5cd, 0x001a, 0xbaed, 0xbdd1, 0x001a, 0x001a, 0xbecf, 0x001a, 0x001a, 0xbbec, 0x001a, 0x001a, 0x001a, 0xb1d2, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9cc, 0x001a, 0xc4d9, 0xfce9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbed1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcec, 0x001a, 0x001a, 0xade5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0f7, 0x001a, 0xeacc, 0x001a, 0x001a, 0x001a, 0xc4d3, 0x001a, 0x001a, 0xc0d6, 0x001a, 0x001a, 0x001a, 0xfdd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1e1, 0x001a, 0xbdde, 0x001a, 0xa9f6, 0x001a, 0x001a, 0x001a, 0xa4da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4d6, 0xc6f5, 0x001a, 0xa2e1, 0xc6e9, 0x001a, 0x001a, 0x001a, 0xc5f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9f4, 0xecd6, 0xd3eb, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdec, 0xdce2, 0xebde, 0xdcf0, 0x001a, 0xbfeb, 0x001a, 0xced7, 0xbfd1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabf5, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdf9, 0x001a, 0xdcca, 0x001a, 0x001a, 0x001a, 0xc6cd, 0xb6f2, 0x001a, 0x001a, 0xfedd, 0x001a, 0x001a, 0x001a, 0xb7cc, 0xb8db, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9d0, 0x001a, 0xddce, 0xc0eb, 0x001a, 0xa2fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6ea, 0xb0f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcedb, 0x001a, 0xc3f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfdb, 0xa4cb, 0x001a, 0x001a, 0xe0f8, 0x001a, 0x001a, 0xd7fb, 0x001a, 0x001a, 0xcaeb, 0xa1e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdce, 0x001a, 0x001a, 0xdcd4, 0x001a, 0x001a, 0x001a, 0xd8fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6d2, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7f2, 0x001a, 0x001a, 0xf6fa, 0xaaf6, 0xf7fa, 0xe6d8, 0x001a, 0xb1f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2e8, 0x001a, 0xc5ca, 0xebcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeee2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbe2, 0x001a, 0xadf7, 0x001a, 0x001a, 0x001a, 0xe1f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf3, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfde4, 0x001a, 0x001a, 0xece3, 0x001a, 0xafdd, 0xb0dd, 0x001a, 0x001a, 0xb7cb, 0xd3e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e1, 0xe0d2, 0x001a, 0x001a, 0x001a, 0x001a, 0xfef0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6e9, 0xf2cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3ed, 0xd9dc, 0xcde0, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaf7, 0xb9db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaecc, 0x001a, 0xdbda, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1dd, 0x001a, 0xafd8, 0xa3e3, 0x001a, 0x001a, 0xefce, 0x001a, 0x001a, 0xf3f2, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcee0, 0x001a, 0xfdf5, 0x001a, 0x001a, 0x001a, 0x001a, 0xeceb, 0x001a, 0x001a, 0xc5d3, 0xecfc, 0xdbd2, 0xebd4, 0x001a, 0xa2de, 0x001a, 0x001a, 0x001a, 0xe6e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4ed, 0x001a, 0x001a, 0x001a, 0xede3, 0x001a, 0xc2e8, 0x001a, 0xf5ed, 0xfcd7, 0x001a, 0xbbed, 0x001a, 0x001a, 0xabf6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8f2, 0xc8f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6d3, 0xddf2, 0xbfcf, 0x001a, 0xaceb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0cf, 0x001a, 0xa8e6, 0xe9fd, 0x001a, 0xc1cf, 0x001a, 0xdfe0, 0xecde, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbff4, 0xefe2, 0x001a, 0xf1d9, 0xc7f1, 0x001a, 0xb8cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfef9, 0xbadb, 0xf5da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf6, 0xdcda, 0xe4fa, 0x001a, 0xcfe0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9e6, 0x001a, 0xf3ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedf3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaeb, 0x001a, 0xe6f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddca, 0xded5, 0x001a, 0xdeca, 0xe4df, 0x001a, 0x001a, 0x001a, 0xfde6, 0x001a, 0xacf5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3e9, 0x001a, 0xcbed, 0xe4cf, 0x001a, 0x001a, 0x001a, 0xd3d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3dd, 0xecd4, 0x001a, 0x001a, 0xb9f2, 0x001a, 0xb7df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcecb, 0xd8fb, 0x001a, 0x001a, 0xd9d0, 0x001a, 0x001a, 0xd2dd, 0xf4f7, 0xdce7, 0xa5e4, 0x001a, 0xa3fc, 0x001a, 0xbbdb, 0x001a, 0x001a, 0x001a, 0xbaf2, 0xfde9, 0xcad0, 0x001a, 0xd6f5, 0xc5d9, 0xb4e4, 0x001a, 0xa7ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdea, 0xfee6, 0x001a, 0xc4f7, 0xadf5, 0x001a, 0xe0d9, 0x001a, 0x001a, 0x001a, 0xb4ca, 0x001a, 0x001a, 0xe2f8, 0xc2cf, 0x001a, 0xbeec, 0x001a, 0x001a, 0x001a, 0xb4e5, 0xc8cd, 0xc8ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9cd, 0xb7f9, 0x001a, 0x001a, 0xe8f1, 0xf2d9, 0xf5db, 0xb5ca, 0xc6d9, 0x001a, 0x001a, 0x001a, 0xc9d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabd9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbced, 0x001a, 0x001a, 0xd4d8, 0x001a, 0x001a, 0x001a, 0xdadc, 0x001a, 0xbce2, 0x001a, 0x001a, 0xedfc, 0xe0ec, 0xfed2, 0x001a, 0xc7e9, 0xaae6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbfa, 0x001a, 0xaef5, 0xaafb, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbec, 0x001a, 0xbfec, 0xd8fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5d4, 0x001a, 0x001a, 0x001a, 0xc3f9, 0x001a, 0x001a, 0x001a, 0xe2ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9d7, 0xf6ed, 0x001a, 0x001a, 0x001a, 0xedde, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeccc, 0x001a, 0xeee3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e8, 0x001a, 0x001a, 0x001a, 0xf8fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4dd, 0xb5e4, 0xb0d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5d8, 0x001a, 0x001a, 0x001a, 0xeaf4, 0x001a, 0x001a, 0x001a, 0xb9ce, 0x001a, 0x001a, 0x001a, 0xe1d6, 0xd2cf, 0x001a, 0xb6d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2ce, 0x001a, 0x001a, 0xeef3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccdc, 0x001a, 0xcbd0, 0x001a, 0x001a, 0x001a, 0xa4fc, 0xcacd, 0xd4d7, 0xa3de, 0x001a, 0xe0e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9ee, 0x001a, 0x001a, 0x001a, 0xdde2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfef5, 0xacd4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1d5, 0x001a, 0xf0d8, 0xc3f8, 0xd7ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7f5, 0x001a, 0x001a, 0xbfd8, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadeb, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaee, 0x001a, 0x001a, 0x001a, 0xe7ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3f8, 0x001a, 0xddd4, 0x001a, 0x001a, 0xd8ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9fb, 0xf7ed, 0x001a, 0x001a, 0xb5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadd0, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbde2, 0x001a, 0x001a, 0x001a, 0xc8e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5d9, 0x001a, 0x001a, 0xaadf, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcdb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaf1, 0x001a, 0x001a, 0xb6e5, 0xeff3, 0x001a, 0x001a, 0xdafb, 0xe0e1, 0x001a, 0xacd9, 0x001a, 0xebf5, 0x001a, 0xb6e0, 0x001a, 0x001a, 0xc8e9, 0x001a, 0xcfcb, 0x001a, 0xc9e3, 0x001a, 0x001a, 0x001a, 0xeede, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefdc, 0x001a, 0xa5d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfed6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1d9, 0x001a, 0xc0d8, 0xdbdc, 0x001a, 0x001a, 0xbded, 0xb8df, 0x001a, 0xa5ea, 0x001a, 0x001a, 0x001a, 0xadd7, 0x001a, 0x001a, 0xf9f3, 0x001a, 0xf8ed, 0x001a, 0xc7f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcae1, 0xe3eb, 0x001a, 0xdef2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccf8, 0x001a, 0xd9ea, 0x001a, 0xc6d3, 0x001a, 0xe6db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaff5, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xfee9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2cf, 0xb9f7, 0xf3d9, 0x001a, 0x001a, 0xcbe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddda, 0x001a, 0x001a, 0xb9da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbeb, 0x001a, 0xb9cb, 0x001a, 0x001a, 0xf9ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0f4, 0x001a, 0xbcfd, 0xb1df, 0xefe3, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e0, 0xb9fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbcd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbeed, 0x001a, 0x001a, 0x001a, 0xc0d5, 0xf0e3, 0xfaed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedd5, 0xdde7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6d4, 0xb7e5, 0x001a, 0x001a, 0x001a, 0xe7db, 0xbfe2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbee, 0x001a, 0x001a, 0xf4d7, 0xddf0, 0x001a, 0x001a, 0x001a, 0xabce, 0x001a, 0x001a, 0xdee7, 0x001a, 0x001a, 0x001a, 0xd6d6, 0xcce1, 0x001a, 0x001a, 0xb3e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeee5, 0xa2dc, 0x001a, 0x001a, 0xd0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbfb, 0x001a, 0xcbf9, 0x001a, 0x001a, 0x001a, 0xf3cb, 0xa5f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8fa, 0xd7d6, 0x001a, 0xe5e9, 0xdcfb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5da, 0x001a, 0xbddb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7cd, 0xdef0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefde, 0x001a, 0x001a, 0x001a, 0xb1d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeefc, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3e8, 0x001a, 0xc8f1, 0x001a, 0x001a, 0x001a, 0xf1ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xedf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e4, 0x001a, 0xb9f5, 0x001a, 0xf0dc, 0xf1e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbf2, 0x001a, 0xa4de, 0x001a, 0xccda, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdae3, 0x001a, 0xd9fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4f9, 0x001a, 0xa4e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddfb, 0x001a, 0xcaef, 0x001a, 0xc4e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadd9, 0x001a, 0x001a, 0xabfb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdef6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e0, 0x001a, 0x001a, 0xa8e9, 0x001a, 0x001a, 0xf9f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaffa, 0x001a, 0xfceb, 0x001a, 0x001a, 0xeae0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5d5, 0x001a, 0x001a, 0xe3f1, 0xeed5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcccd, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1d8, 0x001a, 0x001a, 0x001a, 0x001a, 0xecfa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebf1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcfa, 0xe2e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5fa, 0xfae2, 0x001a, 0x001a, 0x001a, 0xb6ca, 0x001a, 0xb7e4, 0x001a, 0xdbea, 0x001a, 0xfaf5, 0x001a, 0x001a, 0x001a, 0xacfb, 0xc3cf, 0xfdeb, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaf8, 0x001a, 0x001a, 0xb9df, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e1, 0x001a, 0xa4d2, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbf5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdad0, 0xdbd0, 0x001a, 0xbeea, 0xb1d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7ca, 0x001a, 0x001a, 0xe7d3, 0x001a, 0xe5f8, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2d3, 0x001a, 0x001a, 0x001a, 0xc0e2, 0xdff2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdcd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaeee, 0xaed6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xead7, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0e7, 0xaeeb, 0x001a, 0x001a, 0x001a, 0xd9cf, 0x001a, 0x001a, 0xcddc, 0xfbed, 0x001a, 0xf0de, 0x001a, 0xebd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7df, 0xd0db, 0xd1db, 0x001a, 0x001a, 0xa3d5, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8ca, 0x001a, 0xe6f8, 0xcedc, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcea, 0xd2db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbf7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8e3, 0x001a, 0xaed7, 0x001a, 0x001a, 0xe1e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbacb, 0x001a, 0x001a, 0xd1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcd0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcad8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e0, 0x001a, 0xa9e9, 0x001a, 0xc7d3, 0x001a, 0x001a, 0xdddc, 0xaef8, 0x001a, 0x001a, 0x001a, 0xb8cc, 0x001a, 0x001a, 0x001a, 0xaed0, 0x001a, 0x001a, 0x001a, 0xf2d8, 0x001a, 0x001a, 0xcae3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadd4, 0xd1f6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccd0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6ca, 0x001a, 0x001a, 0xc2d5, 0x001a, 0x001a, 0xbace, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8df, 0x001a, 0x001a, 0x001a, 0xbaf5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe5, 0x001a, 0xf4ef, 0xb5dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xaacd, 0x001a, 0xf2e3, 0x001a, 0xf7fb, 0x001a, 0xd0f7, 0x001a, 0x001a, 0x001a, 0x001a, 0xbafd, 0x001a, 0x001a, 0xe1fd, 0xfef6, 0xc0d1, 0x001a, 0x001a, 0xc5e8, 0x001a, 0xb8e4, 0x001a, 0xe8e1, 0x001a, 0x001a, 0x001a, 0xc1cc, 0x001a, 0xedd2, 0x001a, 0x001a, 0x001a, 0x001a, 0xbedb, 0x001a, 0x001a, 0xe2e0, 0x001a, 0x001a, 0x001a, 0xc9fa, 0x001a, 0x001a, 0xcde1, 0x001a, 0xb8ca, 0x001a, 0x001a, 0x001a, 0xe0f2, 0xc9f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1de, 0x001a, 0x001a, 0x001a, 0xdff0, 0xc4f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xccee, 0x001a, 0x001a, 0xf2de, 0x001a, 0xc9e7, 0x001a, 0xf3e2, 0xe1e7, 0x001a, 0x001a, 0xcbe3, 0x001a, 0x001a, 0xcce3, 0x001a, 0x001a, 0x001a, 0xf8cf, 0xacef, 0x001a, 0xfefd, 0xa5fc, 0xb1fa, 0xd9df, 0x001a, 0xd2e0, 0x001a, 0x001a, 0x001a, 0xdaf4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaf1, 0x001a, 0xa3ce, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcf2, 0xe3ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5e0, 0x001a, 0xabf7, 0x001a, 0x001a, 0xafeb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee5, 0x001a, 0xa4e1, 0xabcd, 0x001a, 0xf4d9, 0xa6e8, 0xcecd, 0xe9e1, 0x001a, 0xeffc, 0x001a, 0xe3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e2, 0x001a, 0xa4ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6de, 0x001a, 0x001a, 0xfeeb, 0x001a, 0xddeb, 0xe0f0, 0x001a, 0x001a, 0xdbf4, 0x001a, 0xf4e2, 0x001a, 0x001a, 0xc8d3, 0x001a, 0x001a, 0x001a, 0xebf4, 0x001a, 0xb5ee, 0x001a, 0xd8f5, 0x001a, 0x001a, 0xdfd5, 0x001a, 0x001a, 0x001a, 0xe5d6, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0eb, 0xe3f4, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde3, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4f4, 0xb2fa, 0x001a, 0x001a, 0xf5ef, 0xdfca, 0x001a, 0xb1eb, 0xbfed, 0x001a, 0x001a, 0xc9fd, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6e4, 0xa4f9, 0xb3f0, 0x001a, 0xece5, 0x001a, 0x001a, 0x001a, 0xe7d1, 0x001a, 0xc7d9, 0xd7e4, 0xddea, 0x001a, 0xf7d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbada, 0x001a, 0xcdda, 0x001a, 0x001a, 0x001a, 0xccf9, 0x001a, 0xdae1, 0xbfdb, 0x001a, 0xc5cc, 0xd0ec, 0xbbcb, 0x001a, 0xf3de, 0x001a, 0x001a, 0xaae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8d9, 0x001a, 0x001a, 0xe3ee, 0xbdd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdd0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbf1, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2fd, 0xc1d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbe3, 0x001a, 0xc9d3, 0x001a, 0xcfdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7de, 0x001a, 0x001a, 0xbbe6, 0xa1ec, 0x001a, 0x001a, 0x001a, 0xb9cc, 0x001a, 0x001a, 0xdefb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2e7, 0x001a, 0x001a, 0xc1d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e2, 0x001a, 0xd8f3, 0xd3e5, 0x001a, 0x001a, 0xd9f3, 0x001a, 0x001a, 0x001a, 0xc6f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbcd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaccd, 0x001a, 0xc3fc, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7d4, 0x001a, 0xc2d1, 0x001a, 0xa5f9, 0x001a, 0xd5e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcee3, 0x001a, 0x001a, 0x001a, 0x001a, 0xcad4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdadf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdffb, 0xe3e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbf8, 0xcfe3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7d8, 0x001a, 0xc9d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaff8, 0xf6ef, 0x001a, 0xb6dd, 0xafee, 0xf8cd, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8de, 0xa7fc, 0xfcf7, 0xb1f7, 0xbbce, 0xa1f4, 0x001a, 0x001a, 0xcdee, 0xaee1, 0x001a, 0x001a, 0xc3ec, 0xfecf, 0x001a, 0xbff8, 0xe2d8, 0xe8d3, 0x001a, 0x001a, 0xa8de, 0xe4f4, 0xc2ec, 0x001a, 0xf5d9, 0xc5f9, 0xd3dd, 0xf1d6, 0xfcec, 0xf0fc, 0x001a, 0x001a, 0xc0ed, 0xb9ca, 0x001a, 0xe4ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1f2, 0x001a, 0xb9de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2d6, 0x001a, 0xf4de, 0x001a, 0xdbdf, 0x001a, 0xd3db, 0x001a, 0xe7fa, 0xe3d8, 0xc1f4, 0x001a, 0xb7dd, 0x001a, 0x001a, 0x001a, 0xf5f2, 0x001a, 0x001a, 0xaed4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8dd, 0xc5cf, 0xdfdf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbef2, 0xa1f6, 0x001a, 0xcbeb, 0xfcf1, 0x001a, 0xc7f3, 0x001a, 0x001a, 0xebe0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfced, 0x001a, 0x001a, 0xdbe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5ee, 0x001a, 0xf5de, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3fa, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbf1, 0x001a, 0x001a, 0xafd0, 0xb9dd, 0x001a, 0x001a, 0xc3d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1f5, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacf6, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbadd, 0x001a, 0x001a, 0x001a, 0xbff2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5f7, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2db, 0xf6f2, 0x001a, 0x001a, 0xbaca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5f7, 0x001a, 0xe5cb, 0x001a, 0x001a, 0x001a, 0xe6ee, 0x001a, 0xd3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8d6, 0x001a, 0x001a, 0x001a, 0xafd4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xced3, 0xc2f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2eb, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3eb, 0x001a, 0xb4f0, 0x001a, 0x001a, 0xf4cb, 0xb0d4, 0xb2f3, 0xb7fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7ee, 0xb2f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedf5, 0x001a, 0xf3cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xceee, 0x001a, 0x001a, 0xccf1, 0x001a, 0x001a, 0xb8e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5d7, 0xf3e3, 0xe5cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3f3, 0xd8e4, 0xf9cf, 0xdacf, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdfa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeef5, 0x001a, 0x001a, 0xbbca, 0x001a, 0x001a, 0xdce3, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2ce, 0x001a, 0xd9d6, 0x001a, 0x001a, 0x001a, 0xb0ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5f4, 0xc2d8, 0xd0dc, 0xeecc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0d5, 0xcaf6, 0xcafd, 0xd6d8, 0xcff4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6d6, 0xbedc, 0x001a, 0xd4db, 0xc7d7, 0x001a, 0x001a, 0x001a, 0x001a, 0xfef2, 0x001a, 0x001a, 0x001a, 0xcdf1, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3e2, 0xdedc, 0x001a, 0xdfdc, 0x001a, 0x001a, 0xadef, 0xabe6, 0x001a, 0x001a, 0x001a, 0x001a, 0xddf9, 0xbfea, 0x001a, 0x001a, 0x001a, 0xaeef, 0x001a, 0x001a, 0x001a, 0xd0f4, 0xf3ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xace6, 0x001a, 0xdece, 0x001a, 0x001a, 0xf9d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e3, 0xd0cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8d5, 0x001a, 0x001a, 0xfdf7, 0x001a, 0xa9dc, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6de, 0x001a, 0xaadc, 0xe3f2, 0xb4e9, 0xdcd2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6e9, 0x001a, 0x001a, 0xf6e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcae7, 0x001a, 0x001a, 0xced0, 0x001a, 0x001a, 0xf7da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcca, 0x001a, 0x001a, 0x001a, 0xe8ee, 0xdeda, 0x001a, 0xf7f2, 0x001a, 0x001a, 0xfbe2, 0x001a, 0xa6cc, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbda, 0x001a, 0xe9ee, 0x001a, 0x001a, 0x001a, 0xdaf5, 0x001a, 0x001a, 0xdcf7, 0xeae1, 0xc1ce, 0xb1d4, 0x001a, 0xb1fd, 0xbde6, 0x001a, 0xadfb, 0x001a, 0x001a, 0xe7f8, 0x001a, 0xcee1, 0x001a, 0xe2f7, 0xeff5, 0xc7cf, 0x001a, 0x001a, 0xb2d4, 0xefcc, 0x001a, 0xe8d4, 0x001a, 0xcfee, 0xd7f7, 0x001a, 0x001a, 0xa6e0, 0xc1d6, 0xdce1, 0xe3f0, 0xe4f1, 0xf1dc, 0xa7d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5f4, 0x001a, 0x001a, 0xcef1, 0xe4f2, 0x001a, 0x001a, 0xb0d0, 0x001a, 0x001a, 0xefec, 0x001a, 0x001a, 0x001a, 0xbaf9, 0x001a, 0xb5eb, 0x001a, 0x001a, 0xedd4, 0xc4e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7e9, 0x001a, 0x001a, 0xb4eb, 0xa1ea, 0x001a, 0xbcf8, 0xa6ce, 0x001a, 0xc6f9, 0xdafc, 0x001a, 0xb3d4, 0xb9d3, 0xdeea, 0x001a, 0x001a, 0x001a, 0xabe9, 0x001a, 0x001a, 0xe1e1, 0xcfd3, 0xf6f4, 0x001a, 0xc0ea, 0xcfe1, 0x001a, 0xbacc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeaee, 0x001a, 0x001a, 0x001a, 0xe4f0, 0xb4f3, 0xeed4, 0x001a, 0x001a, 0xc0f2, 0x001a, 0x001a, 0xe5f1, 0x001a, 0xc3f4, 0xd4e0, 0x001a, 0xb6eb, 0x001a, 0xa1d7, 0xe8cb, 0x001a, 0xadf9, 0xade9, 0xe4d8, 0xb3fa, 0xc5e2, 0xbdfc, 0x001a, 0x001a, 0xc4ec, 0xb1d8, 0x001a, 0xabdc, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4d5, 0x001a, 0xe9eb, 0x001a, 0x001a, 0x001a, 0xbbe8, 0x001a, 0x001a, 0x001a, 0xd7d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaefb, 0xe1d1, 0x001a, 0x001a, 0xc0db, 0x001a, 0xbef5, 0x001a, 0xf7de, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbca, 0xc6f7, 0xc8cf, 0x001a, 0x001a, 0x001a, 0xd0e1, 0x001a, 0x001a, 0xd0ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdd5, 0x001a, 0x001a, 0xdbcf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbdd, 0x001a, 0x001a, 0x001a, 0x001a, 0xacce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4d4, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbf5, 0x001a, 0x001a, 0xc1fa, 0x001a, 0x001a, 0x001a, 0xa9de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7ef, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7eb, 0xf8ef, 0xdcf5, 0xcced, 0xd5db, 0xcff1, 0x001a, 0x001a, 0x001a, 0xd0f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaed9, 0xacd5, 0x001a, 0xc6e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3fd, 0x001a, 0xe5fb, 0xabdf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e2, 0x001a, 0xadf6, 0x001a, 0xb3f5, 0x001a, 0xb5f0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddf5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2ec, 0xfded, 0x001a, 0xb4f5, 0xb8fb, 0x001a, 0xa3db, 0x001a, 0x001a, 0xcad6, 0xd9cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaf3, 0x001a, 0xb8eb, 0x001a, 0xb7e0, 0xecd7, 0xecf1, 0xafe5, 0xe1d5, 0xedd7, 0xd1d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2e1, 0xf9ef, 0x001a, 0x001a, 0x001a, 0xbcdd, 0xdcf6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5f0, 0x001a, 0x001a, 0x001a, 0xc4f4, 0x001a, 0x001a, 0xe9e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbf3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefd4, 0x001a, 0x001a, 0xa2cc, 0xfef7, 0xbcdf, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdeb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xade8, 0x001a, 0x001a, 0x001a, 0x001a, 0xafef, 0xa5cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9cb, 0x001a, 0x001a, 0x001a, 0xe8fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6cc, 0x001a, 0x001a, 0x001a, 0xe7e6, 0x001a, 0x001a, 0xc7ea, 0x001a, 0x001a, 0x001a, 0xa4db, 0x001a, 0xc9cf, 0xfce2, 0xfaef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdeeb, 0x001a, 0x001a, 0xc8f5, 0x001a, 0xded4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e0, 0x001a, 0xb0ef, 0x001a, 0x001a, 0xc7e2, 0x001a, 0xafd9, 0x001a, 0x001a, 0x001a, 0xe7f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e7, 0x001a, 0x001a, 0xcacf, 0xd1e1, 0x001a, 0xc8e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbef, 0x001a, 0x001a, 0xf9fa, 0x001a, 0x001a, 0xf2dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeacb, 0x001a, 0x001a, 0x001a, 0xbccb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdef5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdff5, 0x001a, 0xb6ee, 0x001a, 0x001a, 0x001a, 0xf6e2, 0xcad3, 0xfcef, 0xc4d1, 0xb1ef, 0x001a, 0xc5d1, 0x001a, 0xded0, 0x001a, 0xe1d9, 0x001a, 0x001a, 0xb8e0, 0x001a, 0x001a, 0xd1cd, 0xb9f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcce7, 0x001a, 0xa8d6, 0xa7ce, 0x001a, 0xb5d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddf6, 0x001a, 0xa3f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcae9, 0x001a, 0xf0e1, 0x001a, 0x001a, 0x001a, 0xe0f5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaffb, 0x001a, 0x001a, 0x001a, 0xd1cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0fb, 0xe5f2, 0x001a, 0x001a, 0xf0ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe9, 0x001a, 0x001a, 0xf0cc, 0x001a, 0x001a, 0xafd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1f4, 0x001a, 0x001a, 0xa1f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfcca, 0xfdca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcece, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8f3, 0x001a, 0xbaf3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfeed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6da, 0x001a, 0x001a, 0xece0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdf8, 0x001a, 0xd2cb, 0x001a, 0x001a, 0x001a, 0xceeb, 0x001a, 0xd8f9, 0xd9f9, 0xe0ca, 0xcada, 0x001a, 0x001a, 0x001a, 0xa6cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ca, 0xeef9, 0xecdb, 0x001a, 0x001a, 0xb1d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xefd5, 0x001a, 0x001a, 0x001a, 0xf3e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2e7, 0xd9e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1e4, 0x001a, 0x001a, 0xc4fc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeff9, 0xf4cf, 0xe6f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcce, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5f4, 0xa3dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbddd, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1f8, 0x001a, 0x001a, 0x001a, 0xd6e8, 0x001a, 0x001a, 0x001a, 0xc1db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6f0, 0x001a, 0x001a, 0x001a, 0xb9e4, 0xedf6, 0x001a, 0xaef9, 0x001a, 0xbedd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0d7, 0xe8d8, 0xbdcb, 0x001a, 0x001a, 0xdaf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcef8, 0xf0f9, 0xede0, 0xb3e3, 0xb3f4, 0x001a, 0x001a, 0xc2ea, 0xe6f2, 0xb6f0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4eb, 0x001a, 0x001a, 0xe7f2, 0x001a, 0xd5d7, 0xb6d4, 0xe8f9, 0xc1d7, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeae9, 0xccd7, 0x001a, 0x001a, 0x001a, 0xe9d3, 0xc9e2, 0x001a, 0xdbfc, 0xadcd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0cc, 0xa2ea, 0x001a, 0x001a, 0xf6e4, 0xc0d0, 0x001a, 0xb7f0, 0xa1ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6d7, 0x001a, 0x001a, 0x001a, 0xcae2, 0xcbe2, 0x001a, 0xcffa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfeb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbd6, 0x001a, 0x001a, 0x001a, 0xb4f4, 0x001a, 0x001a, 0x001a, 0x001a, 0xcded, 0xd2e4, 0x001a, 0x001a, 0xa9ea, 0xbae4, 0xa2f3, 0xd2cd, 0x001a, 0xcbf6, 0x001a, 0xe6f1, 0xc1ed, 0xbce8, 0xd1ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7f0, 0xcce2, 0x001a, 0x001a, 0xaae4, 0x001a, 0xe1f5, 0xdaed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeed7, 0xf1d1, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe9, 0xece9, 0xe4e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7da, 0xd4dd, 0x001a, 0xa3ea, 0x001a, 0x001a, 0x001a, 0xc3d6, 0xf4d6, 0x001a, 0xdfda, 0x001a, 0xb3ef, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdef, 0xe8f2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5ef, 0x001a, 0xe7e7, 0x001a, 0x001a, 0xfdd7, 0x001a, 0x001a, 0xcee7, 0x001a, 0x001a, 0xdcdf, 0x001a, 0xc7f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacdf, 0x001a, 0xdad6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4dc, 0x001a, 0x001a, 0x001a, 0xb8f0, 0x001a, 0x001a, 0x001a, 0x001a, 0xfad5, 0x001a, 0xf7e4, 0x001a, 0x001a, 0x001a, 0xc4d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xfeef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1f0, 0x001a, 0xaade, 0x001a, 0x001a, 0xbcda, 0xfcd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4fa, 0x001a, 0x001a, 0x001a, 0xe5ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8fc, 0x001a, 0x001a, 0xe6ec, 0x001a, 0x001a, 0xcbd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9fb, 0x001a, 0xd3e4, 0x001a, 0xf9cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeaca, 0x001a, 0x001a, 0xd4cf, 0x001a, 0xbdf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7f4, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5eb, 0x001a, 0x001a, 0xd2e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4ea, 0x001a, 0x001a, 0x001a, 0xc2fa, 0xe1fb, 0xedfa, 0xa2f0, 0xf1cc, 0x001a, 0xa3fa, 0xf7e2, 0x001a, 0xcee2, 0x001a, 0xf5e9, 0x001a, 0xebe1, 0x001a, 0x001a, 0x001a, 0xe8e7, 0xd7e8, 0xf8da, 0xcbd4, 0x001a, 0x001a, 0x001a, 0xf6f7, 0xc5d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9d4, 0x001a, 0x001a, 0xfafa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2cc, 0xddf7, 0x001a, 0xbade, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9f0, 0xfee4, 0xc9e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e4, 0x001a, 0x001a, 0x001a, 0xc3ea, 0x001a, 0xb4ef, 0x001a, 0x001a, 0x001a, 0xbed7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2fb, 0x001a, 0xd3cd, 0x001a, 0x001a, 0x001a, 0xb5ef, 0x001a, 0x001a, 0x001a, 0xe9fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbddf, 0x001a, 0xc7f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdf8, 0x001a, 0x001a, 0xfcf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabde, 0xe8db, 0x001a, 0x001a, 0xdde3, 0x001a, 0xe2e1, 0xc6d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0f6, 0xe6eb, 0xf9da, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8de, 0xe9f8, 0xdee3, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3fa, 0xd7e5, 0x001a, 0xc8ec, 0x001a, 0x001a, 0x001a, 0xc9f3, 0x001a, 0x001a, 0xbbe4, 0x001a, 0x001a, 0x001a, 0x001a, 0xaee6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6ef, 0x001a, 0xbfdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3d8, 0x001a, 0x001a, 0x001a, 0xcfd0, 0x001a, 0xfacf, 0xcaf3, 0xd7e0, 0x001a, 0x001a, 0x001a, 0xc7d1, 0xaee9, 0x001a, 0xbde8, 0x001a, 0x001a, 0xc4fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe2, 0x001a, 0x001a, 0xc5fa, 0x001a, 0x001a, 0x001a, 0xb8f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0dc, 0x001a, 0x001a, 0xb0fb, 0x001a, 0x001a, 0x001a, 0xa9d8, 0xdfe5, 0xa7f9, 0x001a, 0x001a, 0xeef6, 0x001a, 0xccf6, 0xf8e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2f1, 0xccd2, 0xcbcf, 0x001a, 0x001a, 0xbdca, 0x001a, 0x001a, 0x001a, 0xbfdd, 0x001a, 0x001a, 0x001a, 0xeff6, 0x001a, 0xf9de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4fa, 0x001a, 0x001a, 0x001a, 0xadd5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7f1, 0x001a, 0xbede, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8d1, 0xc9d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbef8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6cb, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2f5, 0xd3e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9d8, 0x001a, 0x001a, 0xfef8, 0x001a, 0xcccf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6ce, 0x001a, 0xd0fa, 0x001a, 0x001a, 0xf3cc, 0xbee6, 0x001a, 0x001a, 0x001a, 0xaef6, 0x001a, 0x001a, 0xf0d5, 0x001a, 0x001a, 0xcad1, 0x001a, 0x001a, 0x001a, 0xbefc, 0xf1d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5fa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0e2, 0xf7f4, 0x001a, 0x001a, 0x001a, 0xd4cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2d7, 0x001a, 0x001a, 0xe3f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xdace, 0xebfb, 0xa6db, 0xdedb, 0xe5d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xaad8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6ef, 0x001a, 0x001a, 0xeaf8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7ce, 0x001a, 0x001a, 0xd8e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefd7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedf4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6cd, 0x001a, 0x001a, 0x001a, 0xf4cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3f5, 0x001a, 0x001a, 0xcae4, 0x001a, 0xe1dc, 0x001a, 0x001a, 0xc8f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbffc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbecb, 0x001a, 0xaedc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8f0, 0x001a, 0xc0dd, 0x001a, 0xcdcf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3dc, 0xb0d9, 0x001a, 0xe9e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbce4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xece4, 0x001a, 0xe5e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8fb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbcc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbde4, 0x001a, 0x001a, 0xdccd, 0xf7d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfdd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xceed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaecd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcecf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaff6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3fd, 0xedeb, 0xdcd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e5, 0x001a, 0x001a, 0x001a, 0xb6d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xddd6, 0x001a, 0x001a, 0x001a, 0xe9f9, 0x001a, 0x001a, 0x001a, 0xa4e7, 0x001a, 0xe3d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbd1, 0xe4d6, 0x001a, 0x001a, 0x001a, 0xf2d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfade, 0x001a, 0xf8d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xead8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5cf, 0xfdd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabd8, 0x001a, 0x001a, 0xcbfd, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcfc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8e0, 0xf3d5, 0x001a, 0x001a, 0xd9fd, 0x001a, 0x001a, 0xa3cc, 0x001a, 0x001a, 0x001a, 0xf9d9, 0x001a, 0x001a, 0xead3, 0xf5f5, 0x001a, 0xc7ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdad3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdda, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8e8, 0xafdc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3f0, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacde, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbaf0, 0xb1ee, 0x001a, 0x001a, 0xb2ee, 0x001a, 0x001a, 0x001a, 0xcdf6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2ee, 0x001a, 0xc6d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e0, 0x001a, 0x001a, 0xbbf3, 0x001a, 0xe1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3d7, 0x001a, 0x001a, 0xc2db, 0x001a, 0x001a, 0x001a, 0x001a, 0xfeca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfcf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0xac00[ 11172 ] = { 0xa1b0, 0xa2b0, 0x4181, 0x4281, 0xa3b0, 0x4381, 0x4481, 0xa4b0, 0xa5b0, 0xa6b0, 0xa7b0, 0x4581, 0x4681, 0x4781, 0x4881, 0x4981, 0xa8b0, 0xa9b0, 0xaab0, 0xabb0, 0xacb0, 0xadb0, 0xaeb0, 0xafb0, 0x4a81, 0xb0b0, 0xb1b0, 0xb2b0, 0xb3b0, 0xb4b0, 0x4b81, 0x4c81, 0xb5b0, 0x4d81, 0x4e81, 0x4f81, 0xb6b0, 0x5081, 0x5181, 0x5281, 0x5381, 0x5481, 0x5581, 0x5681, 0xb7b0, 0xb8b0, 0x5781, 0xb9b0, 0xbab0, 0xbbb0, 0x5881, 0x5981, 0x5a81, 0x6181, 0x6281, 0x6381, 0xbcb0, 0xbdb0, 0x6481, 0x6581, 0xbeb0, 0x6681, 0x6781, 0x6881, 0xbfb0, 0x6981, 0x6a81, 0x6b81, 0x6c81, 0x6d81, 0x6e81, 0x6f81, 0x7081, 0x7181, 0x7281, 0xc0b0, 0x7381, 0xc1b0, 0x7481, 0x7581, 0x7681, 0x7781, 0x7881, 0x7981, 0xc2b0, 0x7a81, 0x8181, 0x8281, 0xc3b0, 0x8381, 0x8481, 0x8581, 0xc4b0, 0x8681, 0x8781, 0x8881, 0x8981, 0x8a81, 0x8b81, 0x8c81, 0x8d81, 0x8e81, 0x8f81, 0x9081, 0x9181, 0x9281, 0x9381, 0x9481, 0x9581, 0x9681, 0x9781, 0x9881, 0xc5b0, 0xc6b0, 0x9981, 0x9a81, 0xc7b0, 0x9b81, 0x9c81, 0xc8b0, 0xc9b0, 0x9d81, 0xcab0, 0x9e81, 0x9f81, 0xa081, 0xa181, 0xa281, 0xcbb0, 0xccb0, 0xa381, 0xcdb0, 0xceb0, 0xcfb0, 0xd0b0, 0xa481, 0xa581, 0xd1b0, 0xd2b0, 0xd3b0, 0xd4b0, 0xa681, 0xa781, 0xa881, 0xd5b0, 0xa981, 0xaa81, 0xab81, 0xd6b0, 0xac81, 0xad81, 0xae81, 0xaf81, 0xb081, 0xb181, 0xb281, 0xd7b0, 0xd8b0, 0xb381, 0xd9b0, 0xdab0, 0xdbb0, 0xb481, 0xb581, 0xb681, 0xb781, 0xb881, 0xb981, 0xdcb0, 0xddb0, 0xdeb0, 0xba81, 0xdfb0, 0xbb81, 0xbc81, 0xe0b0, 0xe1b0, 0xbd81, 0xbe81, 0xbf81, 0xc081, 0xc181, 0xc281, 0xc381, 0xe2b0, 0xe3b0, 0xc481, 0xe4b0, 0xe5b0, 0xe6b0, 0xc581, 0xc681, 0xc781, 0xe7b0, 0xc881, 0xc981, 0xe8b0, 0xca81, 0xcb81, 0xcc81, 0xe9b0, 0xcd81, 0xce81, 0xcf81, 0xeab0, 0xd081, 0xd181, 0xd281, 0xd381, 0xd481, 0xd581, 0xd681, 0xd781, 0xebb0, 0xd881, 0xecb0, 0xd981, 0xda81, 0xdb81, 0xdc81, 0xdd81, 0xde81, 0xdf81, 0xe081, 0xedb0, 0xeeb0, 0xe181, 0xe281, 0xefb0, 0xe381, 0xe481, 0xf0b0, 0xf1b0, 0xe581, 0xf2b0, 0xe681, 0xf3b0, 0xe781, 0xe881, 0xf4b0, 0xf5b0, 0xf6b0, 0xe981, 0xf7b0, 0xea81, 0xf8b0, 0xf9b0, 0xeb81, 0xec81, 0xed81, 0xee81, 0xef81, 0xfab0, 0xfbb0, 0xf081, 0xf181, 0xfcb0, 0xf281, 0xf381, 0xf481, 0xfdb0, 0xf581, 0xfeb0, 0xf681, 0xf781, 0xf881, 0xf981, 0xfa81, 0xa1b1, 0xa2b1, 0xfb81, 0xa3b1, 0xfc81, 0xa4b1, 0xfd81, 0xfe81, 0x4182, 0x4282, 0x4382, 0x4482, 0xa5b1, 0x4582, 0x4682, 0x4782, 0xa6b1, 0x4882, 0x4982, 0x4a82, 0xa7b1, 0x4b82, 0x4c82, 0x4d82, 0x4e82, 0x4f82, 0x5082, 0x5182, 0x5282, 0xa8b1, 0x5382, 0x5482, 0xa9b1, 0xaab1, 0x5582, 0x5682, 0x5782, 0x5882, 0x5982, 0x5a82, 0xabb1, 0xacb1, 0x6182, 0x6282, 0xadb1, 0x6382, 0x6482, 0x6582, 0xaeb1, 0x6682, 0x6782, 0x6882, 0x6982, 0x6a82, 0x6b82, 0x6c82, 0xafb1, 0xb0b1, 0x6d82, 0xb1b1, 0x6e82, 0xb2b1, 0x6f82, 0x7082, 0x7182, 0x7282, 0x7382, 0x7482, 0xb3b1, 0x7582, 0x7682, 0x7782, 0xb4b1, 0x7882, 0x7982, 0x7a82, 0xb5b1, 0x8182, 0x8282, 0x8382, 0x8482, 0x8582, 0x8682, 0x8782, 0x8882, 0xb6b1, 0x8982, 0xb7b1, 0x8a82, 0x8b82, 0x8c82, 0x8d82, 0x8e82, 0x8f82, 0x9082, 0x9182, 0xb8b1, 0xb9b1, 0x9282, 0x9382, 0xbab1, 0x9482, 0x9582, 0xbbb1, 0xbcb1, 0xbdb1, 0xbeb1, 0x9682, 0x9782, 0x9882, 0x9982, 0xbfb1, 0xc0b1, 0xc1b1, 0x9a82, 0xc2b1, 0x9b82, 0xc3b1, 0xc4b1, 0x9c82, 0x9d82, 0x9e82, 0x9f82, 0xa082, 0xc5b1, 0xc6b1, 0xa182, 0xa282, 0xc7b1, 0xa382, 0xa482, 0xa582, 0xc8b1, 0xa682, 0xa782, 0xa882, 0xa982, 0xaa82, 0xab82, 0xac82, 0xad82, 0xae82, 0xaf82, 0xb082, 0xc9b1, 0xcab1, 0xb182, 0xb282, 0xb382, 0xb482, 0xb582, 0xb682, 0xcbb1, 0xb782, 0xb882, 0xb982, 0xba82, 0xbb82, 0xbc82, 0xbd82, 0xbe82, 0xbf82, 0xc082, 0xc182, 0xc282, 0xc382, 0xc482, 0xc582, 0xc682, 0xc782, 0xc882, 0xccb1, 0xc982, 0xca82, 0xcb82, 0xcc82, 0xcd82, 0xce82, 0xcf82, 0xd082, 0xcdb1, 0xceb1, 0xd182, 0xd282, 0xcfb1, 0xd382, 0xd482, 0xd582, 0xd0b1, 0xd682, 0xd782, 0xd882, 0xd982, 0xda82, 0xdb82, 0xdc82, 0xd1b1, 0xd2b1, 0xdd82, 0xd3b1, 0xde82, 0xdf82, 0xe082, 0xe182, 0xe282, 0xe382, 0xe482, 0xe582, 0xd4b1, 0xe682, 0xe782, 0xe882, 0xd5b1, 0xe982, 0xea82, 0xeb82, 0xd6b1, 0xec82, 0xed82, 0xee82, 0xef82, 0xf082, 0xf182, 0xf282, 0xf382, 0xf482, 0xf582, 0xf682, 0xf782, 0xf882, 0xf982, 0xfa82, 0xfb82, 0xfc82, 0xfd82, 0xfe82, 0xd7b1, 0xd8b1, 0x4183, 0x4283, 0xd9b1, 0x4383, 0x4483, 0xdab1, 0xdbb1, 0xdcb1, 0x4583, 0x4683, 0x4783, 0x4883, 0x4983, 0x4a83, 0xddb1, 0xdeb1, 0x4b83, 0xdfb1, 0x4c83, 0xe0b1, 0x4d83, 0x4e83, 0x4f83, 0x5083, 0x5183, 0x5283, 0xe1b1, 0x5383, 0x5483, 0x5583, 0x5683, 0x5783, 0x5883, 0x5983, 0x5a83, 0x6183, 0x6283, 0x6383, 0x6483, 0x6583, 0x6683, 0x6783, 0x6883, 0x6983, 0x6a83, 0x6b83, 0x6c83, 0x6d83, 0x6e83, 0x6f83, 0x7083, 0x7183, 0x7283, 0x7383, 0xe2b1, 0xe3b1, 0x7483, 0x7583, 0xe4b1, 0x7683, 0x7783, 0xe5b1, 0xe6b1, 0x7883, 0xe7b1, 0x7983, 0x7a83, 0x8183, 0x8283, 0x8383, 0xe8b1, 0xe9b1, 0x8483, 0xeab1, 0x8583, 0xebb1, 0xecb1, 0x8683, 0x8783, 0x8883, 0xedb1, 0x8983, 0xeeb1, 0xefb1, 0xf0b1, 0x8a83, 0xf1b1, 0x8b83, 0x8c83, 0x8d83, 0xf2b1, 0x8e83, 0xf3b1, 0x8f83, 0x9083, 0x9183, 0x9283, 0x9383, 0xf4b1, 0xf5b1, 0x9483, 0xf6b1, 0xf7b1, 0xf8b1, 0x9583, 0x9683, 0x9783, 0xf9b1, 0x9883, 0x9983, 0xfab1, 0xfbb1, 0x9a83, 0x9b83, 0xfcb1, 0x9c83, 0x9d83, 0x9e83, 0xfdb1, 0x9f83, 0xa083, 0xa183, 0xa283, 0xa383, 0xa483, 0xa583, 0xfeb1, 0xa1b2, 0xa683, 0xa2b2, 0xa3b2, 0xa4b2, 0xa783, 0xa883, 0xa983, 0xaa83, 0xab83, 0xac83, 0xa5b2, 0xa6b2, 0xad83, 0xae83, 0xaf83, 0xb083, 0xb183, 0xb283, 0xa7b2, 0xb383, 0xb483, 0xb583, 0xb683, 0xb783, 0xb883, 0xb983, 0xba83, 0xbb83, 0xbc83, 0xbd83, 0xbe83, 0xbf83, 0xc083, 0xc183, 0xc283, 0xc383, 0xc483, 0xc583, 0xc683, 0xc783, 0xc883, 0xc983, 0xca83, 0xcb83, 0xcc83, 0xcd83, 0xce83, 0xcf83, 0xd083, 0xd183, 0xd283, 0xd383, 0xd483, 0xd583, 0xd683, 0xd783, 0xd883, 0xd983, 0xda83, 0xdb83, 0xdc83, 0xdd83, 0xde83, 0xdf83, 0xe083, 0xe183, 0xa8b2, 0xa9b2, 0xaab2, 0xe283, 0xabb2, 0xe383, 0xe483, 0xe583, 0xacb2, 0xe683, 0xe783, 0xe883, 0xe983, 0xea83, 0xeb83, 0xec83, 0xadb2, 0xaeb2, 0xed83, 0xafb2, 0xb0b2, 0xb1b2, 0xee83, 0xef83, 0xf083, 0xf183, 0xf283, 0xf383, 0xb2b2, 0xb3b2, 0xf483, 0xf583, 0xb4b2, 0xf683, 0xf783, 0xf883, 0xf983, 0xfa83, 0xfb83, 0xfc83, 0xfd83, 0xfe83, 0x4184, 0x4284, 0xb5b2, 0x4384, 0x4484, 0xb6b2, 0x4584, 0xb7b2, 0x4684, 0x4784, 0x4884, 0x4984, 0x4a84, 0x4b84, 0xb8b2, 0x4c84, 0x4d84, 0x4e84, 0xb9b2, 0x4f84, 0x5084, 0x5184, 0xbab2, 0x5284, 0x5384, 0x5484, 0x5584, 0x5684, 0x5784, 0x5884, 0x5984, 0x5a84, 0x6184, 0xbbb2, 0xbcb2, 0x6284, 0x6384, 0x6484, 0x6584, 0xbdb2, 0x6684, 0x6784, 0xbeb2, 0x6884, 0x6984, 0x6a84, 0x6b84, 0x6c84, 0x6d84, 0x6e84, 0x6f84, 0x7084, 0x7184, 0x7284, 0x7384, 0x7484, 0x7584, 0x7684, 0x7784, 0x7884, 0x7984, 0x7a84, 0x8184, 0x8284, 0x8384, 0x8484, 0x8584, 0x8684, 0x8784, 0x8884, 0xbfb2, 0xc0b2, 0x8984, 0x8a84, 0xc1b2, 0x8b84, 0xc2b2, 0x8c84, 0xc3b2, 0x8d84, 0x8e84, 0x8f84, 0x9084, 0x9184, 0x9284, 0x9384, 0xc4b2, 0xc5b2, 0x9484, 0xc6b2, 0x9584, 0xc7b2, 0xc8b2, 0xc9b2, 0x9684, 0x9784, 0x9884, 0x9984, 0xcab2, 0xcbb2, 0x9a84, 0x9b84, 0x9c84, 0x9d84, 0x9e84, 0x9f84, 0xccb2, 0xa084, 0xa184, 0xa284, 0xa384, 0xa484, 0xa584, 0xa684, 0xa784, 0xa884, 0xa984, 0xaa84, 0xcdb2, 0xceb2, 0xab84, 0xac84, 0xad84, 0xae84, 0xaf84, 0xb084, 0xcfb2, 0xd0b2, 0xb184, 0xb284, 0xb384, 0xb484, 0xb584, 0xb684, 0xb784, 0xb884, 0xb984, 0xba84, 0xbb84, 0xbc84, 0xbd84, 0xbe84, 0xbf84, 0xc084, 0xc184, 0xc284, 0xc384, 0xd1b2, 0xc484, 0xc584, 0xc684, 0xc784, 0xc884, 0xc984, 0xd2b2, 0xca84, 0xcb84, 0xcc84, 0xd3b2, 0xcd84, 0xce84, 0xcf84, 0xd4b2, 0xd084, 0xd184, 0xd284, 0xd384, 0xd484, 0xd584, 0xd684, 0xd5b2, 0xd6b2, 0xd784, 0xd884, 0xd984, 0xd7b2, 0xda84, 0xdb84, 0xdc84, 0xdd84, 0xde84, 0xdf84, 0xd8b2, 0xe084, 0xe184, 0xe284, 0xe384, 0xe484, 0xe584, 0xe684, 0xe784, 0xe884, 0xe984, 0xea84, 0xeb84, 0xec84, 0xed84, 0xee84, 0xef84, 0xf084, 0xf184, 0xf284, 0xf384, 0xf484, 0xf584, 0xf684, 0xf784, 0xf884, 0xf984, 0xfa84, 0xd9b2, 0xdab2, 0xfb84, 0xfc84, 0xdbb2, 0xfd84, 0xfe84, 0x4185, 0xdcb2, 0x4285, 0x4385, 0x4485, 0x4585, 0x4685, 0x4785, 0xddb2, 0xdeb2, 0xdfb2, 0x4885, 0xe0b2, 0x4985, 0xe1b2, 0xe2b2, 0x4a85, 0x4b85, 0x4c85, 0x4d85, 0x4e85, 0xe3b2, 0x4f85, 0x5085, 0x5185, 0x5285, 0x5385, 0x5485, 0x5585, 0xe4b2, 0x5685, 0x5785, 0x5885, 0x5985, 0x5a85, 0x6185, 0x6285, 0x6385, 0x6485, 0x6585, 0x6685, 0xe5b2, 0xe6b2, 0x6785, 0x6885, 0x6985, 0x6a85, 0x6b85, 0x6c85, 0xe7b2, 0xe8b2, 0x6d85, 0x6e85, 0xe9b2, 0x6f85, 0x7085, 0x7185, 0xeab2, 0x7285, 0x7385, 0x7485, 0x7585, 0x7685, 0x7785, 0x7885, 0xebb2, 0xecb2, 0x7985, 0x7a85, 0xedb2, 0x8185, 0x8285, 0x8385, 0x8485, 0x8585, 0x8685, 0x8785, 0xeeb2, 0x8885, 0x8985, 0x8a85, 0xefb2, 0x8b85, 0x8c85, 0x8d85, 0xf0b2, 0x8e85, 0x8f85, 0x9085, 0x9185, 0x9285, 0x9385, 0x9485, 0xf1b2, 0xf2b2, 0x9585, 0x9685, 0x9785, 0x9885, 0x9985, 0x9a85, 0x9b85, 0x9c85, 0x9d85, 0x9e85, 0xf3b2, 0x9f85, 0xa085, 0xa185, 0xa285, 0xa385, 0xa485, 0xa585, 0xa685, 0xa785, 0xa885, 0xa985, 0xaa85, 0xab85, 0xac85, 0xad85, 0xae85, 0xaf85, 0xb085, 0xb185, 0xb285, 0xb385, 0xb485, 0xb585, 0xb685, 0xb785, 0xb885, 0xb985, 0xf4b2, 0xf5b2, 0xba85, 0xbb85, 0xf6b2, 0xbc85, 0xf7b2, 0xbd85, 0xf8b2, 0xbe85, 0xf9b2, 0xbf85, 0xc085, 0xc185, 0xc285, 0xfab2, 0xfbb2, 0xfcb2, 0xc385, 0xfdb2, 0xc485, 0xfeb2, 0xc585, 0xc685, 0xc785, 0xa1b3, 0xc885, 0xc985, 0xca85, 0xcb85, 0xcc85, 0xcd85, 0xce85, 0xcf85, 0xd085, 0xd185, 0xd285, 0xd385, 0xd485, 0xd585, 0xd685, 0xd785, 0xd885, 0xd985, 0xda85, 0xdb85, 0xdc85, 0xdd85, 0xde85, 0xdf85, 0xe085, 0xe185, 0xe285, 0xe385, 0xe485, 0xe585, 0xa2b3, 0xa3b3, 0xe685, 0xe785, 0xa4b3, 0xe885, 0xe985, 0xea85, 0xa5b3, 0xeb85, 0xec85, 0xed85, 0xee85, 0xef85, 0xf085, 0xf185, 0xa6b3, 0xa7b3, 0xf285, 0xa8b3, 0xf385, 0xa9b3, 0xf485, 0xf585, 0xf685, 0xf785, 0xf885, 0xf985, 0xaab3, 0xabb3, 0xacb3, 0xfa85, 0xadb3, 0xfb85, 0xfc85, 0xaeb3, 0xafb3, 0xb0b3, 0xb1b3, 0xfd85, 0xfe85, 0x4186, 0x4286, 0x4386, 0xb2b3, 0xb3b3, 0x4486, 0xb4b3, 0xb5b3, 0xb6b3, 0xb7b3, 0xb8b3, 0x4586, 0xb9b3, 0x4686, 0xbab3, 0xbbb3, 0xbcb3, 0x4786, 0x4886, 0xbdb3, 0x4986, 0x4a86, 0x4b86, 0xbeb3, 0x4c86, 0x4d86, 0x4e86, 0x4f86, 0x5086, 0x5186, 0x5286, 0xbfb3, 0xc0b3, 0x5386, 0xc1b3, 0xc2b3, 0xc3b3, 0x5486, 0x5586, 0x5686, 0x5786, 0x5886, 0x5986, 0xc4b3, 0xc5b3, 0x5a86, 0x6186, 0xc6b3, 0x6286, 0x6386, 0x6486, 0xc7b3, 0x6586, 0x6686, 0x6786, 0x6886, 0x6986, 0x6a86, 0x6b86, 0xc8b3, 0x6c86, 0x6d86, 0x6e86, 0x6f86, 0xc9b3, 0x7086, 0x7186, 0x7286, 0x7386, 0x7486, 0x7586, 0x7686, 0x7786, 0x7886, 0x7986, 0x7a86, 0x8186, 0x8286, 0x8386, 0x8486, 0x8586, 0x8686, 0x8786, 0x8886, 0x8986, 0x8a86, 0x8b86, 0x8c86, 0x8d86, 0x8e86, 0x8f86, 0x9086, 0x9186, 0x9286, 0x9386, 0x9486, 0x9586, 0x9686, 0x9786, 0xcab3, 0xcbb3, 0x9886, 0xccb3, 0xcdb3, 0x9986, 0x9a86, 0x9b86, 0xceb3, 0x9c86, 0xcfb3, 0xd0b3, 0x9d86, 0x9e86, 0x9f86, 0xa086, 0xd1b3, 0xd2b3, 0xa186, 0xd3b3, 0xd4b3, 0xd5b3, 0xa286, 0xa386, 0xa486, 0xa586, 0xa686, 0xd6b3, 0xd7b3, 0xd8b3, 0xa786, 0xa886, 0xd9b3, 0xa986, 0xaa86, 0xab86, 0xdab3, 0xac86, 0xad86, 0xae86, 0xaf86, 0xb086, 0xb186, 0xb286, 0xdbb3, 0xdcb3, 0xb386, 0xddb3, 0xdeb3, 0xdfb3, 0xb486, 0xb586, 0xb686, 0xb786, 0xb886, 0xb986, 0xe0b3, 0xe1b3, 0xba86, 0xbb86, 0xe2b3, 0xbc86, 0xbd86, 0xbe86, 0xe3b3, 0xbf86, 0xc086, 0xc186, 0xc286, 0xc386, 0xc486, 0xc586, 0xe4b3, 0xe5b3, 0xc686, 0xc786, 0xe6b3, 0xe7b3, 0xc886, 0xc986, 0xe8b3, 0xca86, 0xcb86, 0xcc86, 0xe9b3, 0xcd86, 0xce86, 0xcf86, 0xeab3, 0xd086, 0xd186, 0xd286, 0xd386, 0xd486, 0xd586, 0xd686, 0xd786, 0xd886, 0xd986, 0xda86, 0xdb86, 0xdc86, 0xdd86, 0xde86, 0xdf86, 0xe086, 0xe186, 0xe286, 0xe386, 0xe486, 0xe586, 0xe686, 0xebb3, 0xecb3, 0xe786, 0xe886, 0xedb3, 0xe986, 0xea86, 0xeb86, 0xeeb3, 0xec86, 0xefb3, 0xed86, 0xee86, 0xef86, 0xf086, 0xf186, 0xf0b3, 0xf1b3, 0xf286, 0xf2b3, 0xf386, 0xf3b3, 0xf486, 0xf586, 0xf686, 0xf786, 0xf4b3, 0xf5b3, 0xf6b3, 0xf886, 0xf986, 0xfa86, 0xf7b3, 0xfb86, 0xfc86, 0xfd86, 0xf8b3, 0xfe86, 0x4187, 0x4287, 0x4387, 0x4487, 0x4587, 0x4687, 0x4787, 0x4887, 0x4987, 0x4a87, 0xf9b3, 0x4b87, 0x4c87, 0x4d87, 0x4e87, 0x4f87, 0x5087, 0x5187, 0x5287, 0x5387, 0x5487, 0x5587, 0x5687, 0x5787, 0x5887, 0x5987, 0x5a87, 0x6187, 0x6287, 0x6387, 0x6487, 0x6587, 0x6687, 0x6787, 0x6887, 0x6987, 0x6a87, 0x6b87, 0x6c87, 0x6d87, 0x6e87, 0x6f87, 0x7087, 0x7187, 0x7287, 0x7387, 0xfab3, 0x7487, 0x7587, 0x7687, 0xfbb3, 0x7787, 0x7887, 0x7987, 0xfcb3, 0x7a87, 0x8187, 0x8287, 0x8387, 0x8487, 0x8587, 0x8687, 0xfdb3, 0xfeb3, 0x8787, 0xa1b4, 0x8887, 0x8987, 0x8a87, 0x8b87, 0x8c87, 0x8d87, 0x8e87, 0x8f87, 0xa2b4, 0xa3b4, 0x9087, 0x9187, 0xa4b4, 0x9287, 0x9387, 0x9487, 0xa5b4, 0x9587, 0x9687, 0x9787, 0x9887, 0x9987, 0x9a87, 0x9b87, 0x9c87, 0xa6b4, 0x9d87, 0xa7b4, 0x9e87, 0xa8b4, 0x9f87, 0xa087, 0xa187, 0xa287, 0xa387, 0xa487, 0xa9b4, 0xaab4, 0xa587, 0xa687, 0xabb4, 0xa787, 0xa887, 0xacb4, 0xadb4, 0xa987, 0xaa87, 0xab87, 0xac87, 0xad87, 0xae87, 0xaf87, 0xaeb4, 0xafb4, 0xb087, 0xb0b4, 0xb187, 0xb1b4, 0xb287, 0xb387, 0xb487, 0xb587, 0xb687, 0xb787, 0xb2b4, 0xb887, 0xb987, 0xba87, 0xbb87, 0xbc87, 0xbd87, 0xbe87, 0xbf87, 0xc087, 0xc187, 0xc287, 0xc387, 0xc487, 0xc587, 0xc687, 0xc787, 0xc887, 0xc987, 0xca87, 0xb3b4, 0xcb87, 0xcc87, 0xcd87, 0xce87, 0xcf87, 0xd087, 0xd187, 0xb4b4, 0xd287, 0xd387, 0xd487, 0xd587, 0xd687, 0xd787, 0xd887, 0xd987, 0xda87, 0xdb87, 0xdc87, 0xdd87, 0xde87, 0xdf87, 0xe087, 0xe187, 0xe287, 0xe387, 0xe487, 0xe587, 0xe687, 0xe787, 0xe887, 0xe987, 0xea87, 0xeb87, 0xec87, 0xb5b4, 0xed87, 0xee87, 0xef87, 0xb6b4, 0xf087, 0xf187, 0xf287, 0xb7b4, 0xf387, 0xf487, 0xf587, 0xf687, 0xf787, 0xf887, 0xf987, 0xb8b4, 0xb9b4, 0xfa87, 0xfb87, 0xfc87, 0xfd87, 0xfe87, 0x4188, 0x4288, 0x4388, 0x4488, 0x4588, 0xbab4, 0xbbb4, 0x4688, 0x4788, 0x4888, 0x4988, 0x4a88, 0x4b88, 0xbcb4, 0x4c88, 0x4d88, 0x4e88, 0x4f88, 0x5088, 0x5188, 0x5288, 0xbdb4, 0xbeb4, 0x5388, 0x5488, 0x5588, 0xbfb4, 0x5688, 0x5788, 0x5888, 0x5988, 0x5a88, 0x6188, 0xc0b4, 0xc1b4, 0x6288, 0x6388, 0xc2b4, 0x6488, 0x6588, 0x6688, 0xc3b4, 0xc4b4, 0xc5b4, 0x6788, 0x6888, 0x6988, 0x6a88, 0x6b88, 0xc6b4, 0xc7b4, 0x6c88, 0xc8b4, 0x6d88, 0xc9b4, 0xcab4, 0x6e88, 0x6f88, 0x7088, 0xcbb4, 0x7188, 0xccb4, 0x7288, 0x7388, 0x7488, 0xcdb4, 0x7588, 0x7688, 0x7788, 0xceb4, 0x7888, 0x7988, 0x7a88, 0x8188, 0x8288, 0x8388, 0x8488, 0x8588, 0x8688, 0x8788, 0x8888, 0x8988, 0x8a88, 0x8b88, 0x8c88, 0x8d88, 0x8e88, 0x8f88, 0x9088, 0xcfb4, 0xd0b4, 0x9188, 0x9288, 0xd1b4, 0x9388, 0x9488, 0x9588, 0xd2b4, 0x9688, 0xd3b4, 0x9788, 0x9888, 0x9988, 0x9a88, 0x9b88, 0xd4b4, 0xd5b4, 0x9c88, 0xd6b4, 0x9d88, 0xd7b4, 0x9e88, 0x9f88, 0xa088, 0xa188, 0xd8b4, 0xa288, 0xd9b4, 0xdab4, 0xdbb4, 0xa388, 0xdcb4, 0xa488, 0xa588, 0xddb4, 0xdeb4, 0xdfb4, 0xe0b4, 0xe1b4, 0xa688, 0xa788, 0xa888, 0xe2b4, 0xe3b4, 0xe4b4, 0xa988, 0xe5b4, 0xe6b4, 0xe7b4, 0xe8b4, 0xe9b4, 0xaa88, 0xab88, 0xac88, 0xeab4, 0xebb4, 0xecb4, 0xad88, 0xae88, 0xedb4, 0xaf88, 0xb088, 0xb188, 0xeeb4, 0xb288, 0xb388, 0xb488, 0xb588, 0xb688, 0xb788, 0xb888, 0xefb4, 0xf0b4, 0xb988, 0xf1b4, 0xf2b4, 0xf3b4, 0xba88, 0xbb88, 0xbc88, 0xbd88, 0xbe88, 0xbf88, 0xf4b4, 0xc088, 0xc188, 0xc288, 0xc388, 0xc488, 0xc588, 0xc688, 0xc788, 0xc888, 0xc988, 0xca88, 0xcb88, 0xcc88, 0xcd88, 0xce88, 0xcf88, 0xd088, 0xd188, 0xd288, 0xd388, 0xd488, 0xd588, 0xd688, 0xd788, 0xd888, 0xd988, 0xda88, 0xdb88, 0xdc88, 0xdd88, 0xde88, 0xdf88, 0xe088, 0xe188, 0xe288, 0xe388, 0xe488, 0xe588, 0xe688, 0xe788, 0xe888, 0xe988, 0xea88, 0xeb88, 0xec88, 0xed88, 0xee88, 0xef88, 0xf088, 0xf188, 0xf288, 0xf388, 0xf488, 0xf588, 0xf688, 0xf5b4, 0xf6b4, 0xf7b4, 0xf788, 0xf8b4, 0xf888, 0xf988, 0xf9b4, 0xfab4, 0xfa88, 0xfbb4, 0xfcb4, 0xfb88, 0xfc88, 0xfd88, 0xfe88, 0xfdb4, 0xfeb4, 0x4189, 0xa1b5, 0x4289, 0xa2b5, 0x4389, 0xa3b5, 0x4489, 0x4589, 0xa4b5, 0x4689, 0xa5b5, 0xa6b5, 0x4789, 0x4889, 0xa7b5, 0x4989, 0x4a89, 0x4b89, 0xa8b5, 0x4c89, 0x4d89, 0x4e89, 0x4f89, 0x5089, 0x5189, 0x5289, 0xa9b5, 0xaab5, 0x5389, 0xabb5, 0xacb5, 0xadb5, 0x5489, 0x5589, 0x5689, 0x5789, 0x5889, 0x5989, 0xaeb5, 0x5a89, 0x6189, 0x6289, 0xafb5, 0x6389, 0x6489, 0x6589, 0xb0b5, 0x6689, 0x6789, 0x6889, 0x6989, 0x6a89, 0x6b89, 0x6c89, 0x6d89, 0x6e89, 0x6f89, 0x7089, 0xb1b5, 0xb2b5, 0x7189, 0x7289, 0x7389, 0x7489, 0x7589, 0x7689, 0xb3b5, 0x7789, 0x7889, 0x7989, 0xb4b5, 0x7a89, 0x8189, 0x8289, 0x8389, 0x8489, 0x8589, 0x8689, 0x8789, 0x8889, 0x8989, 0x8a89, 0x8b89, 0x8c89, 0x8d89, 0x8e89, 0x8f89, 0x9089, 0x9189, 0x9289, 0x9389, 0x9489, 0x9589, 0x9689, 0xb5b5, 0xb6b5, 0x9789, 0x9889, 0xb7b5, 0x9989, 0x9a89, 0xb8b5, 0xb9b5, 0x9b89, 0xbab5, 0x9c89, 0xbbb5, 0x9d89, 0x9e89, 0x9f89, 0xbcb5, 0xbdb5, 0xa089, 0xbeb5, 0xa189, 0xbfb5, 0xa289, 0xc0b5, 0xa389, 0xc1b5, 0xa489, 0xa589, 0xc2b5, 0xa689, 0xa789, 0xa889, 0xc3b5, 0xa989, 0xaa89, 0xab89, 0xc4b5, 0xac89, 0xad89, 0xae89, 0xaf89, 0xb089, 0xb189, 0xb289, 0xb389, 0xb489, 0xb589, 0xb689, 0xb789, 0xb889, 0xb989, 0xba89, 0xbb89, 0xbc89, 0xbd89, 0xbe89, 0xc5b5, 0xbf89, 0xc089, 0xc189, 0xc289, 0xc389, 0xc489, 0xc589, 0xc689, 0xc789, 0xc889, 0xc989, 0xca89, 0xcb89, 0xcc89, 0xcd89, 0xce89, 0xcf89, 0xd089, 0xd189, 0xc6b5, 0xd289, 0xd389, 0xd489, 0xd589, 0xd689, 0xd789, 0xd889, 0xc7b5, 0xd989, 0xda89, 0xdb89, 0xc8b5, 0xdc89, 0xdd89, 0xde89, 0xc9b5, 0xdf89, 0xe089, 0xe189, 0xe289, 0xe389, 0xe489, 0xe589, 0xcab5, 0xcbb5, 0xe689, 0xccb5, 0xe789, 0xe889, 0xe989, 0xea89, 0xeb89, 0xec89, 0xed89, 0xee89, 0xcdb5, 0xef89, 0xf089, 0xf189, 0xf289, 0xf389, 0xf489, 0xf589, 0xf689, 0xf789, 0xf889, 0xf989, 0xfa89, 0xfb89, 0xfc89, 0xfd89, 0xfe89, 0x418a, 0x428a, 0x438a, 0x448a, 0x458a, 0x468a, 0x478a, 0x488a, 0x498a, 0x4a8a, 0x4b8a, 0xceb5, 0xcfb5, 0x4c8a, 0x4d8a, 0xd0b5, 0x4e8a, 0x4f8a, 0x508a, 0xd1b5, 0x518a, 0x528a, 0x538a, 0x548a, 0x558a, 0x568a, 0x578a, 0xd2b5, 0xd3b5, 0x588a, 0xd4b5, 0x598a, 0xd5b5, 0x5a8a, 0x618a, 0x628a, 0x638a, 0x648a, 0x658a, 0xd6b5, 0x668a, 0x678a, 0x688a, 0x698a, 0x6a8a, 0x6b8a, 0x6c8a, 0x6d8a, 0x6e8a, 0x6f8a, 0x708a, 0x718a, 0x728a, 0x738a, 0x748a, 0x758a, 0x768a, 0x778a, 0x788a, 0xd7b5, 0x798a, 0x7a8a, 0x818a, 0x828a, 0x838a, 0x848a, 0x858a, 0xd8b5, 0x868a, 0x878a, 0x888a, 0x898a, 0x8a8a, 0x8b8a, 0x8c8a, 0x8d8a, 0x8e8a, 0x8f8a, 0x908a, 0x918a, 0x928a, 0x938a, 0x948a, 0x958a, 0x968a, 0x978a, 0x988a, 0x998a, 0xd9b5, 0x9a8a, 0x9b8a, 0x9c8a, 0x9d8a, 0x9e8a, 0x9f8a, 0xdab5, 0xa08a, 0xa18a, 0xa28a, 0xdbb5, 0xa38a, 0xa48a, 0xa58a, 0xdcb5, 0xa68a, 0xa78a, 0xa88a, 0xa98a, 0xaa8a, 0xab8a, 0xac8a, 0xad8a, 0xddb5, 0xae8a, 0xdeb5, 0xaf8a, 0xdfb5, 0xb08a, 0xb18a, 0xb28a, 0xb38a, 0xb48a, 0xb58a, 0xe0b5, 0xb68a, 0xb78a, 0xb88a, 0xe1b5, 0xb98a, 0xba8a, 0xbb8a, 0xe2b5, 0xbc8a, 0xbd8a, 0xbe8a, 0xbf8a, 0xc08a, 0xc18a, 0xc28a, 0xe3b5, 0xc38a, 0xc48a, 0xc58a, 0xc68a, 0xe4b5, 0xc78a, 0xc88a, 0xc98a, 0xca8a, 0xcb8a, 0xcc8a, 0xe5b5, 0xe6b5, 0xcd8a, 0xce8a, 0xe7b5, 0xcf8a, 0xd08a, 0xe8b5, 0xe9b5, 0xd18a, 0xeab5, 0xd28a, 0xd38a, 0xd48a, 0xd58a, 0xd68a, 0xebb5, 0xecb5, 0xd78a, 0xedb5, 0xd88a, 0xeeb5, 0xd98a, 0xda8a, 0xdb8a, 0xdc8a, 0xdd8a, 0xde8a, 0xefb5, 0xdf8a, 0xe08a, 0xe18a, 0xe28a, 0xe38a, 0xe48a, 0xe58a, 0xe68a, 0xe78a, 0xe88a, 0xe98a, 0xea8a, 0xeb8a, 0xec8a, 0xed8a, 0xee8a, 0xef8a, 0xf08a, 0xf18a, 0xf28a, 0xf38a, 0xf48a, 0xf58a, 0xf68a, 0xf78a, 0xf88a, 0xf98a, 0xf0b5, 0xf1b5, 0xfa8a, 0xfb8a, 0xf2b5, 0xfc8a, 0xfd8a, 0xf3b5, 0xf4b5, 0xfe8a, 0x418b, 0x428b, 0x438b, 0x448b, 0x458b, 0x468b, 0xf5b5, 0xf6b5, 0x478b, 0xf7b5, 0xf8b5, 0xf9b5, 0xfab5, 0x488b, 0x498b, 0x4a8b, 0x4b8b, 0x4c8b, 0xfbb5, 0xfcb5, 0x4d8b, 0x4e8b, 0xfdb5, 0x4f8b, 0x508b, 0x518b, 0xfeb5, 0x528b, 0x538b, 0x548b, 0x558b, 0x568b, 0x578b, 0x588b, 0xa1b6, 0xa2b6, 0x598b, 0xa3b6, 0xa4b6, 0xa5b6, 0x5a8b, 0x618b, 0x628b, 0x638b, 0x648b, 0xa6b6, 0xa7b6, 0xa8b6, 0x658b, 0x668b, 0xa9b6, 0x678b, 0x688b, 0x698b, 0xaab6, 0x6a8b, 0x6b8b, 0x6c8b, 0x6d8b, 0x6e8b, 0x6f8b, 0x708b, 0xabb6, 0xacb6, 0x718b, 0xadb6, 0xaeb6, 0xafb6, 0x728b, 0x738b, 0x748b, 0x758b, 0x768b, 0x778b, 0x788b, 0x798b, 0x7a8b, 0x818b, 0x828b, 0x838b, 0x848b, 0x858b, 0x868b, 0x878b, 0x888b, 0x898b, 0x8a8b, 0x8b8b, 0x8c8b, 0x8d8b, 0x8e8b, 0x8f8b, 0x908b, 0x918b, 0x928b, 0x938b, 0x948b, 0x958b, 0x968b, 0x978b, 0x988b, 0x998b, 0x9a8b, 0x9b8b, 0x9c8b, 0x9d8b, 0x9e8b, 0x9f8b, 0xa08b, 0xa18b, 0xa28b, 0xa38b, 0xa48b, 0xa58b, 0xa68b, 0xa78b, 0xa88b, 0xa98b, 0xaa8b, 0xab8b, 0xac8b, 0xad8b, 0xae8b, 0xaf8b, 0xb08b, 0xb18b, 0xb28b, 0xb38b, 0xb48b, 0xb58b, 0xb0b6, 0xb1b6, 0xb68b, 0xb78b, 0xb2b6, 0xb88b, 0xb98b, 0xba8b, 0xb3b6, 0xbb8b, 0xb4b6, 0xb5b6, 0xbc8b, 0xbd8b, 0xbe8b, 0xbf8b, 0xb6b6, 0xb7b6, 0xc08b, 0xb8b6, 0xb9b6, 0xbab6, 0xc18b, 0xc28b, 0xc38b, 0xc48b, 0xc58b, 0xbbb6, 0xbcb6, 0xbdb6, 0xc68b, 0xc78b, 0xbeb6, 0xc88b, 0xc98b, 0xca8b, 0xbfb6, 0xcb8b, 0xcc8b, 0xcd8b, 0xce8b, 0xcf8b, 0xd08b, 0xd18b, 0xc0b6, 0xc1b6, 0xd28b, 0xc2b6, 0xc3b6, 0xc4b6, 0xd38b, 0xd48b, 0xd58b, 0xd68b, 0xd78b, 0xd88b, 0xc5b6, 0xd98b, 0xda8b, 0xdb8b, 0xdc8b, 0xdd8b, 0xde8b, 0xdf8b, 0xe08b, 0xe18b, 0xe28b, 0xe38b, 0xe48b, 0xe58b, 0xe68b, 0xe78b, 0xe88b, 0xe98b, 0xea8b, 0xeb8b, 0xc6b6, 0xec8b, 0xed8b, 0xee8b, 0xef8b, 0xf08b, 0xf18b, 0xf28b, 0xf38b, 0xf48b, 0xf58b, 0xf68b, 0xf78b, 0xf88b, 0xf98b, 0xfa8b, 0xfb8b, 0xfc8b, 0xfd8b, 0xfe8b, 0x418c, 0x428c, 0x438c, 0x448c, 0x458c, 0x468c, 0x478c, 0x488c, 0x498c, 0x4a8c, 0x4b8c, 0x4c8c, 0x4d8c, 0x4e8c, 0x4f8c, 0x508c, 0xc7b6, 0xc8b6, 0x518c, 0x528c, 0xc9b6, 0x538c, 0x548c, 0x558c, 0xcab6, 0x568c, 0x578c, 0x588c, 0x598c, 0x5a8c, 0x618c, 0x628c, 0x638c, 0x648c, 0x658c, 0x668c, 0x678c, 0xcbb6, 0x688c, 0x698c, 0x6a8c, 0x6b8c, 0x6c8c, 0x6d8c, 0xccb6, 0x6e8c, 0x6f8c, 0x708c, 0x718c, 0x728c, 0x738c, 0x748c, 0xcdb6, 0x758c, 0x768c, 0x778c, 0x788c, 0x798c, 0x7a8c, 0x818c, 0x828c, 0x838c, 0x848c, 0x858c, 0x868c, 0x878c, 0x888c, 0x898c, 0x8a8c, 0x8b8c, 0x8c8c, 0x8d8c, 0xceb6, 0x8e8c, 0x8f8c, 0x908c, 0x918c, 0x928c, 0x938c, 0x948c, 0x958c, 0x968c, 0x978c, 0x988c, 0x998c, 0x9a8c, 0x9b8c, 0x9c8c, 0x9d8c, 0x9e8c, 0x9f8c, 0xa08c, 0xa18c, 0xa28c, 0xa38c, 0xa48c, 0xa58c, 0xa68c, 0xa78c, 0xa88c, 0xcfb6, 0xa98c, 0xaa8c, 0xab8c, 0xd0b6, 0xac8c, 0xad8c, 0xae8c, 0xaf8c, 0xb08c, 0xb18c, 0xb28c, 0xb38c, 0xb48c, 0xb58c, 0xb68c, 0xb78c, 0xb88c, 0xb98c, 0xba8c, 0xbb8c, 0xbc8c, 0xbd8c, 0xbe8c, 0xbf8c, 0xc08c, 0xc18c, 0xc28c, 0xc38c, 0xc48c, 0xc58c, 0xc68c, 0xc78c, 0xc88c, 0xc98c, 0xca8c, 0xcb8c, 0xcc8c, 0xcd8c, 0xce8c, 0xcf8c, 0xd08c, 0xd18c, 0xd28c, 0xd38c, 0xd48c, 0xd58c, 0xd68c, 0xd78c, 0xd88c, 0xd98c, 0xda8c, 0xdb8c, 0xdc8c, 0xdd8c, 0xde8c, 0xd1b6, 0xd2b6, 0xdf8c, 0xe08c, 0xd3b6, 0xe18c, 0xe28c, 0xe38c, 0xd4b6, 0xe48c, 0xe58c, 0xe68c, 0xe78c, 0xe88c, 0xe98c, 0xd5b6, 0xd6b6, 0xea8c, 0xeb8c, 0xec8c, 0xed8c, 0xd7b6, 0xee8c, 0xef8c, 0xf08c, 0xf18c, 0xf28c, 0xf38c, 0xf48c, 0xf58c, 0xf68c, 0xf78c, 0xf88c, 0xf98c, 0xfa8c, 0xfb8c, 0xfc8c, 0xfd8c, 0xfe8c, 0x418d, 0x428d, 0x438d, 0x448d, 0x458d, 0x468d, 0x478d, 0x488d, 0x498d, 0x4a8d, 0x4b8d, 0x4c8d, 0x4d8d, 0x4e8d, 0x4f8d, 0x508d, 0x518d, 0xd8b6, 0x528d, 0x538d, 0x548d, 0x558d, 0x568d, 0x578d, 0x588d, 0x598d, 0x5a8d, 0x618d, 0x628d, 0x638d, 0x648d, 0x658d, 0x668d, 0x678d, 0x688d, 0x698d, 0x6a8d, 0x6b8d, 0x6c8d, 0x6d8d, 0x6e8d, 0x6f8d, 0x708d, 0x718d, 0x728d, 0xd9b6, 0x738d, 0x748d, 0x758d, 0xdab6, 0x768d, 0x778d, 0x788d, 0xdbb6, 0x798d, 0x7a8d, 0x818d, 0x828d, 0x838d, 0x848d, 0x858d, 0xdcb6, 0xddb6, 0x868d, 0x878d, 0x888d, 0xdeb6, 0x898d, 0x8a8d, 0x8b8d, 0x8c8d, 0x8d8d, 0x8e8d, 0x8f8d, 0x908d, 0x918d, 0x928d, 0x938d, 0x948d, 0x958d, 0x968d, 0x978d, 0x988d, 0x998d, 0x9a8d, 0x9b8d, 0x9c8d, 0x9d8d, 0x9e8d, 0x9f8d, 0xa08d, 0xa18d, 0xa28d, 0xa38d, 0xa48d, 0xa58d, 0xa68d, 0xa78d, 0xa88d, 0xa98d, 0xaa8d, 0xdfb6, 0xe0b6, 0xab8d, 0xac8d, 0xe1b6, 0xad8d, 0xae8d, 0xe2b6, 0xe3b6, 0xaf8d, 0xb08d, 0xb18d, 0xb28d, 0xb38d, 0xb48d, 0xb58d, 0xe4b6, 0xe5b6, 0xb68d, 0xe6b6, 0xb78d, 0xb88d, 0xb98d, 0xba8d, 0xbb8d, 0xbc8d, 0xbd8d, 0xbe8d, 0xe7b6, 0xbf8d, 0xc08d, 0xc18d, 0xe8b6, 0xc28d, 0xc38d, 0xc48d, 0xe9b6, 0xc58d, 0xc68d, 0xc78d, 0xc88d, 0xc98d, 0xca8d, 0xcb8d, 0xeab6, 0xebb6, 0xcc8d, 0xcd8d, 0xce8d, 0xcf8d, 0xd08d, 0xd18d, 0xd28d, 0xd38d, 0xd48d, 0xd58d, 0xecb6, 0xd68d, 0xd78d, 0xd88d, 0xedb6, 0xd98d, 0xda8d, 0xdb8d, 0xeeb6, 0xdc8d, 0xdd8d, 0xde8d, 0xdf8d, 0xe08d, 0xe18d, 0xe28d, 0xefb6, 0xf0b6, 0xe38d, 0xf1b6, 0xe48d, 0xf2b6, 0xe58d, 0xe68d, 0xe78d, 0xe88d, 0xe98d, 0xea8d, 0xf3b6, 0xf4b6, 0xeb8d, 0xec8d, 0xf5b6, 0xed8d, 0xee8d, 0xef8d, 0xf6b6, 0xf08d, 0xf18d, 0xf28d, 0xf38d, 0xf48d, 0xf58d, 0xf68d, 0xf7b6, 0xf8b6, 0xf78d, 0xf9b6, 0xfab6, 0xfbb6, 0xfcb6, 0xf88d, 0xf98d, 0xfa8d, 0xfdb6, 0xfeb6, 0xa1b7, 0xa2b7, 0xfb8d, 0xfc8d, 0xa3b7, 0xfd8d, 0xfe8d, 0x418e, 0xa4b7, 0x428e, 0x438e, 0x448e, 0x458e, 0x468e, 0x478e, 0x488e, 0xa5b7, 0xa6b7, 0x498e, 0xa7b7, 0xa8b7, 0xa9b7, 0x4a8e, 0x4b8e, 0x4c8e, 0x4d8e, 0x4e8e, 0x4f8e, 0xaab7, 0xabb7, 0x508e, 0x518e, 0xacb7, 0x528e, 0x538e, 0x548e, 0x558e, 0x568e, 0x578e, 0x588e, 0x598e, 0x5a8e, 0x618e, 0x628e, 0x638e, 0x648e, 0x658e, 0xadb7, 0x668e, 0xaeb7, 0x678e, 0x688e, 0x698e, 0x6a8e, 0x6b8e, 0x6c8e, 0x6d8e, 0x6e8e, 0x6f8e, 0x708e, 0x718e, 0x728e, 0x738e, 0x748e, 0x758e, 0x768e, 0x778e, 0x788e, 0x798e, 0x7a8e, 0x818e, 0x828e, 0x838e, 0x848e, 0x858e, 0x868e, 0x878e, 0x888e, 0x898e, 0x8a8e, 0x8b8e, 0x8c8e, 0x8d8e, 0x8e8e, 0xafb7, 0xb0b7, 0x8f8e, 0x908e, 0xb1b7, 0x918e, 0x928e, 0x938e, 0xb2b7, 0x948e, 0x958e, 0x968e, 0x978e, 0x988e, 0x998e, 0x9a8e, 0xb3b7, 0xb4b7, 0x9b8e, 0xb5b7, 0xb6b7, 0xb7b7, 0x9c8e, 0x9d8e, 0x9e8e, 0x9f8e, 0xa08e, 0xb8b7, 0xb9b7, 0xbab7, 0xa18e, 0xa28e, 0xbbb7, 0xa38e, 0xa48e, 0xa58e, 0xbcb7, 0xa68e, 0xa78e, 0xa88e, 0xa98e, 0xaa8e, 0xab8e, 0xac8e, 0xbdb7, 0xbeb7, 0xad8e, 0xbfb7, 0xae8e, 0xc0b7, 0xaf8e, 0xb08e, 0xb18e, 0xb28e, 0xb38e, 0xb48e, 0xc1b7, 0xc2b7, 0xb58e, 0xb68e, 0xc3b7, 0xb78e, 0xb88e, 0xb98e, 0xc4b7, 0xba8e, 0xbb8e, 0xbc8e, 0xbd8e, 0xbe8e, 0xbf8e, 0xc08e, 0xc5b7, 0xc6b7, 0xc18e, 0xc7b7, 0xc8b7, 0xc9b7, 0xc28e, 0xc38e, 0xc48e, 0xc58e, 0xc68e, 0xc78e, 0xcab7, 0xc88e, 0xc98e, 0xca8e, 0xcbb7, 0xcb8e, 0xcc8e, 0xcd8e, 0xce8e, 0xcf8e, 0xd08e, 0xd18e, 0xd28e, 0xd38e, 0xd48e, 0xd58e, 0xd68e, 0xccb7, 0xd78e, 0xcdb7, 0xd88e, 0xd98e, 0xda8e, 0xdb8e, 0xdc8e, 0xdd8e, 0xde8e, 0xdf8e, 0xceb7, 0xcfb7, 0xe08e, 0xe18e, 0xd0b7, 0xe28e, 0xe38e, 0xe48e, 0xd1b7, 0xe58e, 0xe68e, 0xe78e, 0xe88e, 0xe98e, 0xea8e, 0xeb8e, 0xd2b7, 0xd3b7, 0xec8e, 0xd4b7, 0xed8e, 0xd5b7, 0xee8e, 0xef8e, 0xf08e, 0xf18e, 0xf28e, 0xf38e, 0xd6b7, 0xf48e, 0xf58e, 0xf68e, 0xd7b7, 0xf78e, 0xf88e, 0xf98e, 0xfa8e, 0xfb8e, 0xfc8e, 0xfd8e, 0xfe8e, 0x418f, 0x428f, 0x438f, 0x448f, 0x458f, 0x468f, 0x478f, 0x488f, 0xd8b7, 0x498f, 0x4a8f, 0x4b8f, 0x4c8f, 0x4d8f, 0x4e8f, 0x4f8f, 0x508f, 0x518f, 0x528f, 0x538f, 0x548f, 0x558f, 0x568f, 0x578f, 0x588f, 0x598f, 0x5a8f, 0x618f, 0x628f, 0x638f, 0x648f, 0x658f, 0x668f, 0x678f, 0x688f, 0xd9b7, 0x698f, 0x6a8f, 0x6b8f, 0x6c8f, 0x6d8f, 0x6e8f, 0x6f8f, 0xdab7, 0x708f, 0x718f, 0x728f, 0xdbb7, 0x738f, 0x748f, 0x758f, 0xdcb7, 0x768f, 0x778f, 0x788f, 0x798f, 0x7a8f, 0x818f, 0x828f, 0xddb7, 0xdeb7, 0x838f, 0xdfb7, 0x848f, 0xe0b7, 0x858f, 0x868f, 0x878f, 0x888f, 0x898f, 0x8a8f, 0xe1b7, 0x8b8f, 0x8c8f, 0x8d8f, 0xe2b7, 0x8e8f, 0x8f8f, 0x908f, 0xe3b7, 0x918f, 0x928f, 0x938f, 0x948f, 0x958f, 0x968f, 0x978f, 0x988f, 0xe4b7, 0x998f, 0xe5b7, 0x9a8f, 0xe6b7, 0x9b8f, 0x9c8f, 0x9d8f, 0x9e8f, 0x9f8f, 0xa08f, 0xe7b7, 0xe8b7, 0xa18f, 0xa28f, 0xe9b7, 0xa38f, 0xa48f, 0xa58f, 0xeab7, 0xa68f, 0xa78f, 0xa88f, 0xa98f, 0xaa8f, 0xab8f, 0xac8f, 0xebb7, 0xecb7, 0xad8f, 0xedb7, 0xae8f, 0xeeb7, 0xaf8f, 0xb08f, 0xb18f, 0xb28f, 0xb38f, 0xb48f, 0xefb7, 0xb58f, 0xb68f, 0xb78f, 0xb88f, 0xb98f, 0xba8f, 0xbb8f, 0xbc8f, 0xbd8f, 0xbe8f, 0xbf8f, 0xc08f, 0xc18f, 0xc28f, 0xc38f, 0xc48f, 0xc58f, 0xc68f, 0xc78f, 0xf0b7, 0xc88f, 0xc98f, 0xca8f, 0xcb8f, 0xcc8f, 0xcd8f, 0xce8f, 0xf1b7, 0xcf8f, 0xd08f, 0xd18f, 0xd28f, 0xd38f, 0xd48f, 0xd58f, 0xd68f, 0xd78f, 0xd88f, 0xd98f, 0xda8f, 0xdb8f, 0xdc8f, 0xdd8f, 0xde8f, 0xdf8f, 0xe08f, 0xe18f, 0xe28f, 0xe38f, 0xe48f, 0xe58f, 0xe68f, 0xe78f, 0xe88f, 0xe98f, 0xf2b7, 0xf3b7, 0xea8f, 0xeb8f, 0xf4b7, 0xec8f, 0xed8f, 0xee8f, 0xf5b7, 0xef8f, 0xf08f, 0xf18f, 0xf28f, 0xf38f, 0xf48f, 0xf58f, 0xf6b7, 0xf68f, 0xf78f, 0xf7b7, 0xf88f, 0xf8b7, 0xf98f, 0xfa8f, 0xfb8f, 0xfc8f, 0xfd8f, 0xfe8f, 0xf9b7, 0xfab7, 0x4190, 0x4290, 0xfbb7, 0x4390, 0x4490, 0x4590, 0xfcb7, 0x4690, 0x4790, 0x4890, 0x4990, 0x4a90, 0x4b90, 0x4c90, 0xfdb7, 0xfeb7, 0x4d90, 0xa1b8, 0x4e90, 0xa2b8, 0x4f90, 0x5090, 0x5190, 0x5290, 0x5390, 0x5490, 0xa3b8, 0xa4b8, 0x5590, 0x5690, 0xa5b8, 0x5790, 0x5890, 0x5990, 0xa6b8, 0x5a90, 0x6190, 0x6290, 0x6390, 0x6490, 0x6590, 0x6690, 0xa7b8, 0xa8b8, 0x6790, 0xa9b8, 0x6890, 0xaab8, 0xabb8, 0x6990, 0x6a90, 0xacb8, 0xadb8, 0x6b90, 0x6c90, 0x6d90, 0x6e90, 0x6f90, 0x7090, 0x7190, 0x7290, 0x7390, 0x7490, 0x7590, 0x7690, 0x7790, 0x7890, 0x7990, 0x7a90, 0x8190, 0x8290, 0x8390, 0x8490, 0x8590, 0x8690, 0x8790, 0x8890, 0x8990, 0x8a90, 0x8b90, 0x8c90, 0x8d90, 0xaeb8, 0xafb8, 0x8e90, 0x8f90, 0xb0b8, 0x9090, 0x9190, 0x9290, 0xb1b8, 0x9390, 0x9490, 0x9590, 0x9690, 0x9790, 0x9890, 0x9990, 0xb2b8, 0xb3b8, 0x9a90, 0xb4b8, 0x9b90, 0xb5b8, 0x9c90, 0x9d90, 0x9e90, 0x9f90, 0xa090, 0xa190, 0xb6b8, 0xb7b8, 0xa290, 0xa390, 0xb8b8, 0xa490, 0xb9b8, 0xbab8, 0xbbb8, 0xbcb8, 0xbdb8, 0xa590, 0xa690, 0xa790, 0xa890, 0xa990, 0xbeb8, 0xbfb8, 0xaa90, 0xc0b8, 0xab90, 0xc1b8, 0xc2b8, 0xac90, 0xad90, 0xc3b8, 0xae90, 0xc4b8, 0xc5b8, 0xc6b8, 0xaf90, 0xb090, 0xc7b8, 0xb190, 0xb290, 0xb390, 0xc8b8, 0xb490, 0xb590, 0xb690, 0xb790, 0xb890, 0xb990, 0xba90, 0xc9b8, 0xcab8, 0xbb90, 0xcbb8, 0xccb8, 0xcdb8, 0xceb8, 0xbc90, 0xbd90, 0xbe90, 0xbf90, 0xc090, 0xcfb8, 0xd0b8, 0xc190, 0xc290, 0xc390, 0xc490, 0xc590, 0xc690, 0xd1b8, 0xc790, 0xc890, 0xc990, 0xca90, 0xcb90, 0xcc90, 0xcd90, 0xce90, 0xcf90, 0xd090, 0xd190, 0xd290, 0xd2b8, 0xd390, 0xd490, 0xd590, 0xd690, 0xd790, 0xd890, 0xd990, 0xda90, 0xdb90, 0xdc90, 0xdd90, 0xde90, 0xdf90, 0xe090, 0xe190, 0xe290, 0xe390, 0xe490, 0xe590, 0xe690, 0xe790, 0xe890, 0xe990, 0xea90, 0xeb90, 0xec90, 0xed90, 0xee90, 0xef90, 0xf090, 0xf190, 0xf290, 0xf390, 0xf490, 0xd3b8, 0xd4b8, 0xf590, 0xf690, 0xd5b8, 0xf790, 0xf890, 0xf990, 0xd6b8, 0xfa90, 0xd7b8, 0xfb90, 0xfc90, 0xfd90, 0xfe90, 0x4191, 0xd8b8, 0xd9b8, 0x4291, 0xdab8, 0x4391, 0xdbb8, 0xdcb8, 0x4491, 0x4591, 0x4691, 0x4791, 0xddb8, 0xdeb8, 0xdfb8, 0x4891, 0x4991, 0xe0b8, 0x4a91, 0x4b91, 0x4c91, 0xe1b8, 0x4d91, 0x4e91, 0x4f91, 0x5091, 0x5191, 0x5291, 0x5391, 0xe2b8, 0xe3b8, 0x5491, 0xe4b8, 0xe5b8, 0xe6b8, 0x5591, 0x5691, 0x5791, 0x5891, 0x5991, 0x5a91, 0xe7b8, 0xe8b8, 0x6191, 0x6291, 0xe9b8, 0x6391, 0x6491, 0x6591, 0xeab8, 0x6691, 0x6791, 0x6891, 0x6991, 0x6a91, 0x6b91, 0x6c91, 0x6d91, 0x6e91, 0x6f91, 0xebb8, 0xecb8, 0xedb8, 0x7091, 0xeeb8, 0x7191, 0x7291, 0x7391, 0x7491, 0xefb8, 0x7591, 0x7691, 0x7791, 0x7891, 0x7991, 0x7a91, 0x8191, 0x8291, 0x8391, 0x8491, 0x8591, 0x8691, 0x8791, 0x8891, 0x8991, 0x8a91, 0x8b91, 0x8c91, 0x8d91, 0x8e91, 0x8f91, 0x9091, 0x9191, 0x9291, 0x9391, 0x9491, 0x9591, 0xf0b8, 0xf1b8, 0x9691, 0xf2b8, 0xf3b8, 0x9791, 0x9891, 0x9991, 0xf4b8, 0x9a91, 0xf5b8, 0x9b91, 0x9c91, 0x9d91, 0x9e91, 0x9f91, 0xf6b8, 0xf7b8, 0xa091, 0xf8b8, 0xa191, 0xf9b8, 0xa291, 0xa391, 0xa491, 0xa591, 0xa691, 0xa791, 0xfab8, 0xa891, 0xa991, 0xaa91, 0xfbb8, 0xab91, 0xac91, 0xad91, 0xae91, 0xaf91, 0xb091, 0xb191, 0xb291, 0xb391, 0xb491, 0xb591, 0xb691, 0xb791, 0xb891, 0xb991, 0xfcb8, 0xfdb8, 0xba91, 0xbb91, 0xbc91, 0xbd91, 0xbe91, 0xbf91, 0xc091, 0xc191, 0xc291, 0xc391, 0xc491, 0xc591, 0xc691, 0xc791, 0xc891, 0xc991, 0xca91, 0xcb91, 0xcc91, 0xcd91, 0xce91, 0xcf91, 0xd091, 0xd191, 0xd291, 0xd391, 0xd491, 0xd591, 0xd691, 0xd791, 0xd891, 0xd991, 0xda91, 0xdb91, 0xfeb8, 0xdc91, 0xdd91, 0xde91, 0xa1b9, 0xdf91, 0xe091, 0xe191, 0xa2b9, 0xe291, 0xe391, 0xe491, 0xe591, 0xe691, 0xe791, 0xe891, 0xe991, 0xa3b9, 0xea91, 0xa4b9, 0xeb91, 0xa5b9, 0xec91, 0xed91, 0xee91, 0xef91, 0xf091, 0xf191, 0xa6b9, 0xf291, 0xf391, 0xf491, 0xa7b9, 0xf591, 0xf691, 0xf791, 0xa8b9, 0xf891, 0xf991, 0xfa91, 0xfb91, 0xfc91, 0xfd91, 0xfe91, 0x4192, 0xa9b9, 0x4292, 0xaab9, 0x4392, 0x4492, 0x4592, 0x4692, 0x4792, 0x4892, 0x4992, 0x4a92, 0xabb9, 0xacb9, 0xadb9, 0x4b92, 0xaeb9, 0x4c92, 0x4d92, 0xafb9, 0xb0b9, 0xb1b9, 0xb2b9, 0x4e92, 0x4f92, 0x5092, 0x5192, 0x5292, 0xb3b9, 0xb4b9, 0x5392, 0xb5b9, 0x5492, 0xb6b9, 0x5592, 0x5692, 0x5792, 0xb7b9, 0x5892, 0xb8b9, 0xb9b9, 0x5992, 0x5a92, 0x6192, 0xbab9, 0x6292, 0x6392, 0x6492, 0xbbb9, 0x6592, 0x6692, 0x6792, 0x6892, 0x6992, 0x6a92, 0x6b92, 0x6c92, 0xbcb9, 0x6d92, 0xbdb9, 0x6e92, 0x6f92, 0x7092, 0x7192, 0x7292, 0x7392, 0x7492, 0x7592, 0xbeb9, 0x7692, 0x7792, 0x7892, 0x7992, 0x7a92, 0x8192, 0x8292, 0x8392, 0x8492, 0x8592, 0x8692, 0x8792, 0x8892, 0x8992, 0x8a92, 0x8b92, 0x8c92, 0x8d92, 0x8e92, 0x8f92, 0x9092, 0x9192, 0x9292, 0x9392, 0x9492, 0x9592, 0x9692, 0xbfb9, 0x9792, 0x9892, 0x9992, 0xc0b9, 0x9a92, 0x9b92, 0x9c92, 0xc1b9, 0x9d92, 0x9e92, 0x9f92, 0xa092, 0xa192, 0xa292, 0xa392, 0xa492, 0xa592, 0xa692, 0xa792, 0xa892, 0xa992, 0xaa92, 0xab92, 0xac92, 0xad92, 0xae92, 0xaf92, 0xc2b9, 0xb092, 0xb192, 0xb292, 0xc3b9, 0xb392, 0xb492, 0xb592, 0xc4b9, 0xb692, 0xb792, 0xb892, 0xb992, 0xba92, 0xbb92, 0xbc92, 0xc5b9, 0xbd92, 0xbe92, 0xc6b9, 0xbf92, 0xc092, 0xc192, 0xc292, 0xc392, 0xc492, 0xc592, 0xc692, 0xc7b9, 0xc792, 0xc892, 0xc992, 0xc8b9, 0xca92, 0xcb92, 0xcc92, 0xc9b9, 0xcd92, 0xce92, 0xcf92, 0xd092, 0xd192, 0xd292, 0xd392, 0xcab9, 0xd492, 0xd592, 0xcbb9, 0xd692, 0xd792, 0xd892, 0xd992, 0xda92, 0xdb92, 0xdc92, 0xdd92, 0xde92, 0xdf92, 0xe092, 0xe192, 0xe292, 0xe392, 0xe492, 0xe592, 0xe692, 0xe792, 0xe892, 0xe992, 0xea92, 0xeb92, 0xec92, 0xed92, 0xee92, 0xef92, 0xf092, 0xf192, 0xf292, 0xf392, 0xf492, 0xf592, 0xf692, 0xf792, 0xf892, 0xf992, 0xccb9, 0xcdb9, 0xfa92, 0xfb92, 0xceb9, 0xfc92, 0xfd92, 0xcfb9, 0xd0b9, 0xfe92, 0xd1b9, 0x4193, 0x4293, 0x4393, 0x4493, 0x4593, 0xd2b9, 0xd3b9, 0x4693, 0xd4b9, 0xd5b9, 0xd6b9, 0x4793, 0xd7b9, 0x4893, 0xd8b9, 0x4993, 0x4a93, 0xd9b9, 0xdab9, 0xdbb9, 0xdcb9, 0xddb9, 0x4b93, 0x4c93, 0xdeb9, 0xdfb9, 0xe0b9, 0xe1b9, 0xe2b9, 0x4d93, 0x4e93, 0x4f93, 0x5093, 0xe3b9, 0xe4b9, 0x5193, 0xe5b9, 0x5293, 0xe6b9, 0x5393, 0x5493, 0x5593, 0xe7b9, 0x5693, 0x5793, 0xe8b9, 0xe9b9, 0x5893, 0x5993, 0xeab9, 0x5a93, 0x6193, 0x6293, 0xebb9, 0x6393, 0x6493, 0x6593, 0x6693, 0x6793, 0x6893, 0x6993, 0xecb9, 0xedb9, 0x6a93, 0xeeb9, 0xefb9, 0xf0b9, 0x6b93, 0x6c93, 0x6d93, 0xf1b9, 0x6e93, 0x6f93, 0xf2b9, 0xf3b9, 0x7093, 0x7193, 0xf4b9, 0x7293, 0x7393, 0x7493, 0x7593, 0x7693, 0x7793, 0x7893, 0x7993, 0x7a93, 0x8193, 0x8293, 0x8393, 0xf5b9, 0x8493, 0x8593, 0x8693, 0x8793, 0x8893, 0x8993, 0x8a93, 0x8b93, 0x8c93, 0x8d93, 0x8e93, 0x8f93, 0x9093, 0x9193, 0x9293, 0x9393, 0x9493, 0x9593, 0x9693, 0x9793, 0x9893, 0x9993, 0x9a93, 0x9b93, 0x9c93, 0x9d93, 0x9e93, 0x9f93, 0xa093, 0xa193, 0xa293, 0xa393, 0xa493, 0xa593, 0xa693, 0xa793, 0xa893, 0xa993, 0xf6b9, 0xf7b9, 0xaa93, 0xab93, 0xf8b9, 0xac93, 0xad93, 0xf9b9, 0xfab9, 0xae93, 0xfbb9, 0xaf93, 0xb093, 0xb193, 0xb293, 0xb393, 0xfcb9, 0xfdb9, 0xb493, 0xfeb9, 0xb593, 0xa1ba, 0xa2ba, 0xb693, 0xb793, 0xb893, 0xb993, 0xba93, 0xa3ba, 0xa4ba, 0xbb93, 0xbc93, 0xa5ba, 0xbd93, 0xbe93, 0xa6ba, 0xa7ba, 0xbf93, 0xc093, 0xc193, 0xc293, 0xc393, 0xc493, 0xc593, 0xa8ba, 0xa9ba, 0xc693, 0xaaba, 0xabba, 0xacba, 0xc793, 0xc893, 0xc993, 0xca93, 0xcb93, 0xcc93, 0xadba, 0xaeba, 0xcd93, 0xce93, 0xafba, 0xcf93, 0xd093, 0xd193, 0xb0ba, 0xd293, 0xd393, 0xd493, 0xd593, 0xd693, 0xd793, 0xd893, 0xd993, 0xb1ba, 0xda93, 0xb2ba, 0xb3ba, 0xb4ba, 0xdb93, 0xdc93, 0xdd93, 0xb5ba, 0xde93, 0xdf93, 0xb6ba, 0xe093, 0xe193, 0xe293, 0xb7ba, 0xe393, 0xe493, 0xe593, 0xe693, 0xe793, 0xe893, 0xe993, 0xea93, 0xeb93, 0xec93, 0xed93, 0xee93, 0xef93, 0xf093, 0xf193, 0xf293, 0xf393, 0xf493, 0xf593, 0xf693, 0xf793, 0xf893, 0xf993, 0xb8ba, 0xb9ba, 0xbaba, 0xfa93, 0xbbba, 0xfb93, 0xfc93, 0xfd93, 0xbcba, 0xfe93, 0x4194, 0x4294, 0x4394, 0x4494, 0x4594, 0x4694, 0xbdba, 0xbeba, 0x4794, 0xbfba, 0x4894, 0xc0ba, 0x4994, 0x4a94, 0x4b94, 0x4c94, 0x4d94, 0x4e94, 0xc1ba, 0x4f94, 0x5094, 0x5194, 0xc2ba, 0x5294, 0x5394, 0x5494, 0x5594, 0x5694, 0x5794, 0x5894, 0x5994, 0x5a94, 0x6194, 0x6294, 0x6394, 0x6494, 0x6594, 0x6694, 0xc3ba, 0x6794, 0x6894, 0x6994, 0x6a94, 0x6b94, 0x6c94, 0x6d94, 0xc4ba, 0x6e94, 0x6f94, 0x7094, 0x7194, 0x7294, 0x7394, 0x7494, 0x7594, 0x7694, 0x7794, 0x7894, 0x7994, 0x7a94, 0x8194, 0x8294, 0x8394, 0x8494, 0x8594, 0x8694, 0xc5ba, 0x8794, 0x8894, 0x8994, 0x8a94, 0x8b94, 0x8c94, 0x8d94, 0xc6ba, 0xc7ba, 0x8e94, 0x8f94, 0xc8ba, 0x9094, 0x9194, 0x9294, 0xc9ba, 0x9394, 0x9494, 0x9594, 0x9694, 0x9794, 0x9894, 0x9994, 0xcaba, 0xcbba, 0x9a94, 0x9b94, 0x9c94, 0x9d94, 0x9e94, 0x9f94, 0xa094, 0xa194, 0xa294, 0xa394, 0xccba, 0xa494, 0xa594, 0xa694, 0xcdba, 0xa794, 0xa894, 0xa994, 0xaa94, 0xab94, 0xac94, 0xad94, 0xae94, 0xaf94, 0xb094, 0xb194, 0xb294, 0xb394, 0xb494, 0xb594, 0xb694, 0xb794, 0xb894, 0xb994, 0xba94, 0xbb94, 0xbc94, 0xbd94, 0xceba, 0xcfba, 0xbe94, 0xbf94, 0xd0ba, 0xc094, 0xc194, 0xd1ba, 0xd2ba, 0xd3ba, 0xd4ba, 0xc294, 0xc394, 0xc494, 0xc594, 0xc694, 0xd5ba, 0xd6ba, 0xc794, 0xd7ba, 0xc894, 0xd8ba, 0xc994, 0xca94, 0xcb94, 0xd9ba, 0xdaba, 0xcc94, 0xdbba, 0xcd94, 0xce94, 0xcf94, 0xd094, 0xd194, 0xd294, 0xd394, 0xdcba, 0xd494, 0xd594, 0xd694, 0xd794, 0xd894, 0xd994, 0xda94, 0xdb94, 0xdc94, 0xdd94, 0xde94, 0xddba, 0xdf94, 0xe094, 0xe194, 0xe294, 0xe394, 0xe494, 0xe594, 0xdeba, 0xe694, 0xe794, 0xe894, 0xe994, 0xea94, 0xeb94, 0xec94, 0xed94, 0xee94, 0xef94, 0xf094, 0xf194, 0xf294, 0xf394, 0xf494, 0xf594, 0xf694, 0xf794, 0xf894, 0xf994, 0xfa94, 0xfb94, 0xfc94, 0xfd94, 0xfe94, 0x4195, 0x4295, 0xdfba, 0xe0ba, 0x4395, 0x4495, 0xe1ba, 0x4595, 0x4695, 0x4795, 0xe2ba, 0x4895, 0x4995, 0x4a95, 0x4b95, 0x4c95, 0x4d95, 0x4e95, 0x4f95, 0x5095, 0x5195, 0x5295, 0x5395, 0xe3ba, 0x5495, 0x5595, 0x5695, 0x5795, 0x5895, 0x5995, 0xe4ba, 0x5a95, 0x6195, 0x6295, 0xe5ba, 0x6395, 0x6495, 0x6595, 0xe6ba, 0x6695, 0x6795, 0x6895, 0x6995, 0x6a95, 0x6b95, 0x6c95, 0xe7ba, 0x6d95, 0x6e95, 0xe8ba, 0x6f95, 0xe9ba, 0x7095, 0x7195, 0x7295, 0x7395, 0x7495, 0x7595, 0xeaba, 0xebba, 0x7695, 0x7795, 0xecba, 0x7895, 0x7995, 0x7a95, 0xedba, 0x8195, 0x8295, 0x8395, 0x8495, 0x8595, 0x8695, 0x8795, 0xeeba, 0xefba, 0x8895, 0xf0ba, 0x8995, 0x8a95, 0x8b95, 0x8c95, 0x8d95, 0x8e95, 0x8f95, 0x9095, 0x9195, 0x9295, 0x9395, 0x9495, 0x9595, 0x9695, 0x9795, 0x9895, 0x9995, 0x9a95, 0x9b95, 0x9c95, 0x9d95, 0x9e95, 0x9f95, 0xa095, 0xa195, 0xa295, 0xa395, 0xa495, 0xa595, 0xa695, 0xa795, 0xa895, 0xa995, 0xaa95, 0xab95, 0xac95, 0xf1ba, 0xf2ba, 0xad95, 0xae95, 0xf3ba, 0xaf95, 0xb095, 0xb195, 0xf4ba, 0xb295, 0xf5ba, 0xb395, 0xb495, 0xb595, 0xb695, 0xb795, 0xf6ba, 0xf7ba, 0xb895, 0xf8ba, 0xb995, 0xf9ba, 0xfaba, 0xfbba, 0xba95, 0xbb95, 0xbc95, 0xbd95, 0xfcba, 0xfdba, 0xbe95, 0xbf95, 0xfeba, 0xc095, 0xc195, 0xc295, 0xa1bb, 0xc395, 0xa2bb, 0xc495, 0xc595, 0xc695, 0xc795, 0xc895, 0xa3bb, 0xa4bb, 0xc995, 0xa5bb, 0xa6bb, 0xa7bb, 0xca95, 0xcb95, 0xcc95, 0xcd95, 0xce95, 0xa8bb, 0xa9bb, 0xaabb, 0xcf95, 0xd095, 0xabbb, 0xd195, 0xd295, 0xd395, 0xacbb, 0xd495, 0xd595, 0xd695, 0xd795, 0xd895, 0xd995, 0xda95, 0xadbb, 0xaebb, 0xdb95, 0xafbb, 0xb0bb, 0xb1bb, 0xdc95, 0xdd95, 0xde95, 0xdf95, 0xe095, 0xe195, 0xb2bb, 0xb3bb, 0xe295, 0xe395, 0xe495, 0xe595, 0xe695, 0xe795, 0xe895, 0xe995, 0xea95, 0xeb95, 0xec95, 0xed95, 0xee95, 0xef95, 0xb4bb, 0xf095, 0xf195, 0xf295, 0xf395, 0xf495, 0xf595, 0xf695, 0xf795, 0xf895, 0xf995, 0xfa95, 0xfb95, 0xfc95, 0xfd95, 0xfe95, 0x4196, 0x4296, 0x4396, 0x4496, 0x4596, 0x4696, 0x4796, 0x4896, 0x4996, 0x4a96, 0x4b96, 0x4c96, 0x4d96, 0x4e96, 0x4f96, 0x5096, 0x5196, 0x5296, 0x5396, 0x5496, 0x5596, 0x5696, 0x5796, 0x5896, 0xb5bb, 0xb6bb, 0x5996, 0x5a96, 0xb7bb, 0x6196, 0x6296, 0xb8bb, 0xb9bb, 0x6396, 0x6496, 0x6596, 0x6696, 0x6796, 0x6896, 0x6996, 0xbabb, 0x6a96, 0x6b96, 0xbbbb, 0xbcbb, 0xbdbb, 0x6c96, 0x6d96, 0x6e96, 0x6f96, 0x7096, 0x7196, 0xbebb, 0x7296, 0x7396, 0x7496, 0x7596, 0x7696, 0x7796, 0x7896, 0x7996, 0x7a96, 0x8196, 0x8296, 0x8396, 0x8496, 0x8596, 0x8696, 0x8796, 0x8896, 0x8996, 0x8a96, 0x8b96, 0xbfbb, 0x8c96, 0x8d96, 0x8e96, 0x8f96, 0x9096, 0x9196, 0xc0bb, 0xc1bb, 0x9296, 0x9396, 0x9496, 0x9596, 0x9696, 0x9796, 0x9896, 0x9996, 0x9a96, 0x9b96, 0x9c96, 0x9d96, 0x9e96, 0x9f96, 0xc2bb, 0xc3bb, 0xa096, 0xc4bb, 0xc5bb, 0xc6bb, 0xa196, 0xa296, 0xa396, 0xa496, 0xa596, 0xa696, 0xa796, 0xa896, 0xa996, 0xaa96, 0xab96, 0xac96, 0xad96, 0xae96, 0xaf96, 0xb096, 0xb196, 0xb296, 0xb396, 0xb496, 0xb596, 0xb696, 0xb796, 0xb896, 0xb996, 0xba96, 0xbb96, 0xbc96, 0xbd96, 0xbe96, 0xbf96, 0xc096, 0xc196, 0xc296, 0xc7bb, 0xc8bb, 0xc396, 0xc496, 0xc9bb, 0xc596, 0xc696, 0xc796, 0xcabb, 0xc896, 0xc996, 0xca96, 0xcb96, 0xcc96, 0xcd96, 0xce96, 0xcbbb, 0xccbb, 0xcf96, 0xd096, 0xd196, 0xcdbb, 0xd296, 0xd396, 0xd496, 0xd596, 0xd696, 0xd796, 0xd896, 0xd996, 0xda96, 0xdb96, 0xdc96, 0xdd96, 0xde96, 0xdf96, 0xe096, 0xe196, 0xe296, 0xe396, 0xe496, 0xe596, 0xe696, 0xe796, 0xe896, 0xe996, 0xea96, 0xeb96, 0xec96, 0xed96, 0xee96, 0xef96, 0xf096, 0xf196, 0xf296, 0xf396, 0xf496, 0xf596, 0xf696, 0xf796, 0xf896, 0xf996, 0xfa96, 0xfb96, 0xfc96, 0xfd96, 0xfe96, 0x4197, 0x4297, 0x4397, 0x4497, 0x4597, 0x4697, 0x4797, 0x4897, 0x4997, 0x4a97, 0x4b97, 0x4c97, 0x4d97, 0x4e97, 0x4f97, 0x5097, 0x5197, 0xcebb, 0x5297, 0x5397, 0x5497, 0x5597, 0x5697, 0x5797, 0x5897, 0x5997, 0x5a97, 0x6197, 0x6297, 0x6397, 0x6497, 0x6597, 0x6697, 0x6797, 0x6897, 0x6997, 0x6a97, 0x6b97, 0x6c97, 0x6d97, 0x6e97, 0x6f97, 0x7097, 0x7197, 0x7297, 0xcfbb, 0x7397, 0x7497, 0x7597, 0x7697, 0x7797, 0x7897, 0x7997, 0x7a97, 0x8197, 0x8297, 0x8397, 0x8497, 0x8597, 0x8697, 0x8797, 0x8897, 0x8997, 0x8a97, 0x8b97, 0x8c97, 0xd0bb, 0x8d97, 0x8e97, 0x8f97, 0x9097, 0x9197, 0x9297, 0xd1bb, 0xd2bb, 0x9397, 0x9497, 0xd3bb, 0x9597, 0x9697, 0x9797, 0xd4bb, 0x9897, 0x9997, 0x9a97, 0x9b97, 0x9c97, 0x9d97, 0x9e97, 0xd5bb, 0x9f97, 0xa097, 0xd6bb, 0xa197, 0xd7bb, 0xa297, 0xa397, 0xa497, 0xa597, 0xa697, 0xa797, 0xa897, 0xa997, 0xaa97, 0xab97, 0xac97, 0xad97, 0xae97, 0xaf97, 0xb097, 0xb197, 0xb297, 0xb397, 0xb497, 0xb597, 0xb697, 0xb797, 0xb897, 0xb997, 0xba97, 0xbb97, 0xbc97, 0xbd97, 0xbe97, 0xbf97, 0xc097, 0xc197, 0xc297, 0xc397, 0xc497, 0xc597, 0xc697, 0xc797, 0xc897, 0xc997, 0xca97, 0xcb97, 0xcc97, 0xcd97, 0xce97, 0xcf97, 0xd097, 0xd197, 0xd297, 0xd397, 0xd497, 0xd597, 0xd697, 0xd797, 0xd897, 0xd997, 0xda97, 0xdb97, 0xdc97, 0xdd97, 0xde97, 0xdf97, 0xe097, 0xe197, 0xe297, 0xe397, 0xe497, 0xe597, 0xe697, 0xe797, 0xe897, 0xe997, 0xea97, 0xeb97, 0xec97, 0xed97, 0xee97, 0xef97, 0xf097, 0xf197, 0xf297, 0xf397, 0xf497, 0xf597, 0xf697, 0xf797, 0xf897, 0xf997, 0xfa97, 0xfb97, 0xd8bb, 0xfc97, 0xfd97, 0xfe97, 0x4198, 0x4298, 0x4398, 0x4498, 0x4598, 0x4698, 0x4798, 0x4898, 0x4998, 0x4a98, 0x4b98, 0x4c98, 0x4d98, 0x4e98, 0x4f98, 0x5098, 0x5198, 0xd9bb, 0x5298, 0x5398, 0x5498, 0x5598, 0x5698, 0x5798, 0xdabb, 0x5898, 0x5998, 0x5a98, 0xdbbb, 0x6198, 0x6298, 0x6398, 0xdcbb, 0x6498, 0x6598, 0x6698, 0x6798, 0x6898, 0x6998, 0x6a98, 0xddbb, 0xdebb, 0x6b98, 0x6c98, 0x6d98, 0x6e98, 0x6f98, 0x7098, 0x7198, 0x7298, 0x7398, 0x7498, 0x7598, 0x7698, 0x7798, 0x7898, 0x7998, 0x7a98, 0x8198, 0x8298, 0x8398, 0x8498, 0x8598, 0x8698, 0x8798, 0x8898, 0x8998, 0x8a98, 0x8b98, 0x8c98, 0x8d98, 0x8e98, 0x8f98, 0x9098, 0x9198, 0x9298, 0x9398, 0x9498, 0x9598, 0x9698, 0xdfbb, 0xe0bb, 0x9798, 0x9898, 0xe1bb, 0x9998, 0x9a98, 0x9b98, 0xe2bb, 0x9c98, 0x9d98, 0x9e98, 0x9f98, 0xa098, 0xa198, 0xa298, 0xe3bb, 0xe4bb, 0xa398, 0xe5bb, 0xa498, 0xe6bb, 0xa598, 0xa698, 0xa798, 0xa898, 0xa998, 0xaa98, 0xe7bb, 0xe8bb, 0xab98, 0xe9bb, 0xeabb, 0xac98, 0xad98, 0xebbb, 0xecbb, 0xedbb, 0xeebb, 0xae98, 0xaf98, 0xb098, 0xb198, 0xb298, 0xefbb, 0xf0bb, 0xb398, 0xf1bb, 0xf2bb, 0xf3bb, 0xb498, 0xb598, 0xb698, 0xf4bb, 0xb798, 0xb898, 0xf5bb, 0xf6bb, 0xb998, 0xba98, 0xf7bb, 0xbb98, 0xbc98, 0xbd98, 0xf8bb, 0xbe98, 0xbf98, 0xc098, 0xc198, 0xc298, 0xc398, 0xc498, 0xf9bb, 0xfabb, 0xc598, 0xfbbb, 0xfcbb, 0xfdbb, 0xc698, 0xc798, 0xc898, 0xc998, 0xca98, 0xcb98, 0xfebb, 0xa1bc, 0xcc98, 0xcd98, 0xa2bc, 0xce98, 0xcf98, 0xd098, 0xa3bc, 0xd198, 0xd298, 0xd398, 0xd498, 0xd598, 0xd698, 0xd798, 0xa4bc, 0xa5bc, 0xd898, 0xa6bc, 0xd998, 0xa7bc, 0xda98, 0xdb98, 0xdc98, 0xdd98, 0xde98, 0xdf98, 0xa8bc, 0xe098, 0xe198, 0xe298, 0xa9bc, 0xe398, 0xe498, 0xe598, 0xaabc, 0xe698, 0xe798, 0xe898, 0xe998, 0xea98, 0xeb98, 0xec98, 0xabbc, 0xed98, 0xee98, 0xef98, 0xf098, 0xacbc, 0xf198, 0xf298, 0xf398, 0xf498, 0xf598, 0xf698, 0xadbc, 0xaebc, 0xafbc, 0xb0bc, 0xb1bc, 0xf798, 0xf898, 0xb2bc, 0xb3bc, 0xf998, 0xb4bc, 0xb5bc, 0xfa98, 0xfb98, 0xfc98, 0xfd98, 0xb6bc, 0xb7bc, 0xfe98, 0xb8bc, 0xb9bc, 0xbabc, 0x4199, 0x4299, 0x4399, 0x4499, 0xbbbc, 0x4599, 0xbcbc, 0xbdbc, 0x4699, 0x4799, 0xbebc, 0x4899, 0x4999, 0x4a99, 0xbfbc, 0x4b99, 0x4c99, 0x4d99, 0x4e99, 0x4f99, 0x5099, 0x5199, 0xc0bc, 0xc1bc, 0x5299, 0xc2bc, 0xc3bc, 0xc4bc, 0x5399, 0x5499, 0x5599, 0x5699, 0x5799, 0x5899, 0xc5bc, 0xc6bc, 0x5999, 0x5a99, 0xc7bc, 0x6199, 0x6299, 0x6399, 0xc8bc, 0x6499, 0x6599, 0x6699, 0x6799, 0x6899, 0x6999, 0x6a99, 0xc9bc, 0xcabc, 0x6b99, 0xcbbc, 0xccbc, 0xcdbc, 0x6c99, 0x6d99, 0x6e99, 0x6f99, 0x7099, 0x7199, 0xcebc, 0x7299, 0x7399, 0x7499, 0xcfbc, 0x7599, 0x7699, 0x7799, 0xd0bc, 0x7899, 0x7999, 0x7a99, 0x8199, 0x8299, 0x8399, 0x8499, 0x8599, 0x8699, 0x8799, 0x8899, 0x8999, 0xd1bc, 0x8a99, 0x8b99, 0x8c99, 0x8d99, 0x8e99, 0x8f99, 0xd2bc, 0xd3bc, 0xd4bc, 0x9099, 0xd5bc, 0x9199, 0x9299, 0x9399, 0xd6bc, 0x9499, 0xd7bc, 0x9599, 0x9699, 0x9799, 0x9899, 0x9999, 0xd8bc, 0xd9bc, 0x9a99, 0xdabc, 0x9b99, 0xdbbc, 0x9c99, 0x9d99, 0x9e99, 0xdcbc, 0x9f99, 0xa099, 0xddbc, 0xdebc, 0xa199, 0xa299, 0xdfbc, 0xa399, 0xa499, 0xa599, 0xe0bc, 0xa699, 0xa799, 0xa899, 0xa999, 0xaa99, 0xab99, 0xac99, 0xad99, 0xae99, 0xaf99, 0xb099, 0xb199, 0xe1bc, 0xb299, 0xb399, 0xb499, 0xb599, 0xb699, 0xb799, 0xe2bc, 0xb899, 0xb999, 0xba99, 0xe3bc, 0xbb99, 0xbc99, 0xbd99, 0xe4bc, 0xbe99, 0xbf99, 0xc099, 0xc199, 0xc299, 0xc399, 0xc499, 0xe5bc, 0xc599, 0xc699, 0xe6bc, 0xe7bc, 0xc799, 0xc899, 0xc999, 0xca99, 0xcb99, 0xcc99, 0xcd99, 0xe8bc, 0xce99, 0xcf99, 0xd099, 0xe9bc, 0xd199, 0xd299, 0xd399, 0xeabc, 0xd499, 0xd599, 0xd699, 0xd799, 0xd899, 0xd999, 0xda99, 0xebbc, 0xecbc, 0xdb99, 0xedbc, 0xdc99, 0xdd99, 0xde99, 0xdf99, 0xe099, 0xe199, 0xe299, 0xe399, 0xeebc, 0xefbc, 0xe499, 0xe599, 0xf0bc, 0xe699, 0xe799, 0xe899, 0xf1bc, 0xe999, 0xea99, 0xeb99, 0xec99, 0xed99, 0xee99, 0xef99, 0xf2bc, 0xf3bc, 0xf099, 0xf4bc, 0xf199, 0xf5bc, 0xf299, 0xf399, 0xf499, 0xf599, 0xf699, 0xf799, 0xf6bc, 0xf7bc, 0xf899, 0xf999, 0xf8bc, 0xfa99, 0xfb99, 0xf9bc, 0xfabc, 0xfc99, 0xfd99, 0xfe99, 0x419a, 0x429a, 0x439a, 0x449a, 0xfbbc, 0xfcbc, 0x459a, 0xfdbc, 0x469a, 0xfebc, 0x479a, 0xa1bd, 0x489a, 0xa2bd, 0xa3bd, 0x499a, 0xa4bd, 0x4a9a, 0x4b9a, 0x4c9a, 0x4d9a, 0x4e9a, 0x4f9a, 0x509a, 0x519a, 0x529a, 0x539a, 0x549a, 0x559a, 0x569a, 0x579a, 0x589a, 0x599a, 0x5a9a, 0x619a, 0x629a, 0xa5bd, 0x639a, 0x649a, 0x659a, 0x669a, 0x679a, 0x689a, 0x699a, 0xa6bd, 0xa7bd, 0x6a9a, 0x6b9a, 0xa8bd, 0x6c9a, 0x6d9a, 0x6e9a, 0xa9bd, 0x6f9a, 0x709a, 0x719a, 0x729a, 0x739a, 0x749a, 0x759a, 0xaabd, 0x769a, 0x779a, 0x789a, 0x799a, 0xabbd, 0x7a9a, 0x819a, 0x829a, 0x839a, 0x849a, 0x859a, 0xacbd, 0xadbd, 0x869a, 0x879a, 0xaebd, 0x889a, 0x899a, 0x8a9a, 0xafbd, 0x8b9a, 0x8c9a, 0x8d9a, 0x8e9a, 0x8f9a, 0x909a, 0x919a, 0xb0bd, 0xb1bd, 0x929a, 0xb2bd, 0x939a, 0xb3bd, 0x949a, 0x959a, 0x969a, 0x979a, 0x989a, 0x999a, 0xb4bd, 0xb5bd, 0x9a9a, 0x9b9a, 0x9c9a, 0x9d9a, 0x9e9a, 0x9f9a, 0xb6bd, 0xa09a, 0xa19a, 0xa29a, 0xa39a, 0xa49a, 0xa59a, 0xa69a, 0xb7bd, 0xa79a, 0xa89a, 0xb8bd, 0xa99a, 0xb9bd, 0xaa9a, 0xab9a, 0xac9a, 0xad9a, 0xae9a, 0xaf9a, 0xbabd, 0xbbbd, 0xb09a, 0xb19a, 0xbcbd, 0xb29a, 0xb39a, 0xb49a, 0xbdbd, 0xbebd, 0xb59a, 0xb69a, 0xb79a, 0xb89a, 0xb99a, 0xba9a, 0xbfbd, 0xc0bd, 0xbb9a, 0xc1bd, 0xbc9a, 0xc2bd, 0xbd9a, 0xbe9a, 0xbf9a, 0xc09a, 0xc19a, 0xc29a, 0xc39a, 0xc49a, 0xc59a, 0xc69a, 0xc79a, 0xc89a, 0xc99a, 0xca9a, 0xcb9a, 0xcc9a, 0xcd9a, 0xce9a, 0xcf9a, 0xd09a, 0xd19a, 0xd29a, 0xd39a, 0xd49a, 0xd59a, 0xd69a, 0xd79a, 0xd89a, 0xd99a, 0xda9a, 0xdb9a, 0xdc9a, 0xdd9a, 0xde9a, 0xc3bd, 0xc4bd, 0xdf9a, 0xe09a, 0xc5bd, 0xe19a, 0xe29a, 0xc6bd, 0xc7bd, 0xe39a, 0xe49a, 0xe59a, 0xe69a, 0xe79a, 0xe89a, 0xc8bd, 0xc9bd, 0xcabd, 0xe99a, 0xcbbd, 0xea9a, 0xccbd, 0xeb9a, 0xec9a, 0xed9a, 0xee9a, 0xcdbd, 0xef9a, 0xcebd, 0xcfbd, 0xf09a, 0xd0bd, 0xd1bd, 0xf19a, 0xf29a, 0xf39a, 0xd2bd, 0xf49a, 0xf59a, 0xf69a, 0xf79a, 0xf89a, 0xf99a, 0xfa9a, 0xd3bd, 0xd4bd, 0xfb9a, 0xfc9a, 0xd5bd, 0xd6bd, 0xfd9a, 0xfe9a, 0x419b, 0x429b, 0x439b, 0xd7bd, 0xd8bd, 0xd9bd, 0x449b, 0x459b, 0xdabd, 0x469b, 0x479b, 0x489b, 0xdbbd, 0x499b, 0x4a9b, 0x4b9b, 0x4c9b, 0x4d9b, 0x4e9b, 0x4f9b, 0xdcbd, 0xddbd, 0x509b, 0x519b, 0xdebd, 0xdfbd, 0x529b, 0x539b, 0x549b, 0x559b, 0x569b, 0x579b, 0x589b, 0x599b, 0x5a9b, 0x619b, 0x629b, 0x639b, 0x649b, 0x659b, 0x669b, 0x679b, 0x689b, 0x699b, 0x6a9b, 0x6b9b, 0x6c9b, 0x6d9b, 0x6e9b, 0x6f9b, 0x709b, 0x719b, 0x729b, 0xe0bd, 0x739b, 0x749b, 0x759b, 0x769b, 0x779b, 0x789b, 0x799b, 0x7a9b, 0x819b, 0x829b, 0x839b, 0x849b, 0x859b, 0x869b, 0x879b, 0x889b, 0x899b, 0x8a9b, 0x8b9b, 0x8c9b, 0x8d9b, 0x8e9b, 0x8f9b, 0x909b, 0x919b, 0x929b, 0x939b, 0x949b, 0x959b, 0x969b, 0x979b, 0x989b, 0x999b, 0x9a9b, 0xe1bd, 0xe2bd, 0x9b9b, 0x9c9b, 0xe3bd, 0x9d9b, 0x9e9b, 0x9f9b, 0xe4bd, 0xa09b, 0xe5bd, 0xa19b, 0xa29b, 0xa39b, 0xa49b, 0xa59b, 0xe6bd, 0xe7bd, 0xa69b, 0xa79b, 0xe8bd, 0xe9bd, 0xa89b, 0xa99b, 0xaa9b, 0xab9b, 0xac9b, 0xad9b, 0xeabd, 0xae9b, 0xaf9b, 0xb09b, 0xebbd, 0xb19b, 0xb29b, 0xb39b, 0xecbd, 0xb49b, 0xb59b, 0xb69b, 0xb79b, 0xb89b, 0xb99b, 0xba9b, 0xbb9b, 0xbc9b, 0xbd9b, 0xbe9b, 0xbf9b, 0xc09b, 0xc19b, 0xc29b, 0xc39b, 0xc49b, 0xc59b, 0xc69b, 0xc79b, 0xc89b, 0xc99b, 0xca9b, 0xcb9b, 0xcc9b, 0xcd9b, 0xce9b, 0xcf9b, 0xd09b, 0xd19b, 0xd29b, 0xd39b, 0xd49b, 0xd59b, 0xd69b, 0xd79b, 0xd89b, 0xd99b, 0xda9b, 0xdb9b, 0xdc9b, 0xdd9b, 0xde9b, 0xdf9b, 0xe09b, 0xe19b, 0xe29b, 0xe39b, 0xe49b, 0xe59b, 0xe69b, 0xedbd, 0xe79b, 0xe89b, 0xe99b, 0xea9b, 0xeb9b, 0xec9b, 0xed9b, 0xee9b, 0xef9b, 0xf09b, 0xf19b, 0xf29b, 0xf39b, 0xf49b, 0xf59b, 0xf69b, 0xf79b, 0xf89b, 0xf99b, 0xfa9b, 0xfb9b, 0xfc9b, 0xfd9b, 0xeebd, 0xefbd, 0xfe9b, 0x419c, 0xf0bd, 0x429c, 0x439c, 0xf1bd, 0xf2bd, 0x449c, 0xf3bd, 0x459c, 0x469c, 0x479c, 0x489c, 0x499c, 0xf4bd, 0xf5bd, 0x4a9c, 0x4b9c, 0x4c9c, 0xf6bd, 0x4d9c, 0x4e9c, 0x4f9c, 0x509c, 0x519c, 0x529c, 0xf7bd, 0xf8bd, 0x539c, 0x549c, 0xf9bd, 0x559c, 0x569c, 0x579c, 0x589c, 0x599c, 0x5a9c, 0x619c, 0x629c, 0x639c, 0x649c, 0x659c, 0x669c, 0x679c, 0x689c, 0x699c, 0xfabd, 0x6a9c, 0x6b9c, 0x6c9c, 0x6d9c, 0x6e9c, 0x6f9c, 0x709c, 0xfbbd, 0x719c, 0x729c, 0x739c, 0x749c, 0x759c, 0x769c, 0x779c, 0x789c, 0x799c, 0x7a9c, 0x819c, 0x829c, 0x839c, 0x849c, 0x859c, 0x869c, 0x879c, 0x889c, 0x899c, 0xfcbd, 0x8a9c, 0x8b9c, 0x8c9c, 0x8d9c, 0x8e9c, 0x8f9c, 0x909c, 0xfdbd, 0x919c, 0x929c, 0x939c, 0xfebd, 0x949c, 0x959c, 0x969c, 0xa1be, 0x979c, 0x989c, 0x999c, 0x9a9c, 0x9b9c, 0x9c9c, 0x9d9c, 0xa2be, 0xa3be, 0x9e9c, 0x9f9c, 0xa09c, 0xa19c, 0xa29c, 0xa39c, 0xa49c, 0xa59c, 0xa69c, 0xa79c, 0xa4be, 0xa89c, 0xa99c, 0xaa9c, 0xab9c, 0xac9c, 0xad9c, 0xae9c, 0xaf9c, 0xb09c, 0xb19c, 0xb29c, 0xb39c, 0xb49c, 0xb59c, 0xb69c, 0xb79c, 0xb89c, 0xb99c, 0xba9c, 0xbb9c, 0xbc9c, 0xbd9c, 0xbe9c, 0xbf9c, 0xc09c, 0xc19c, 0xc29c, 0xa5be, 0xa6be, 0xc39c, 0xc49c, 0xa7be, 0xc59c, 0xc69c, 0xc79c, 0xa8be, 0xc89c, 0xc99c, 0xca9c, 0xcb9c, 0xcc9c, 0xcd9c, 0xce9c, 0xa9be, 0xaabe, 0xcf9c, 0xd09c, 0xd19c, 0xabbe, 0xd29c, 0xd39c, 0xd49c, 0xd59c, 0xd69c, 0xd79c, 0xacbe, 0xd89c, 0xd99c, 0xda9c, 0xdb9c, 0xdc9c, 0xdd9c, 0xde9c, 0xdf9c, 0xe09c, 0xe19c, 0xe29c, 0xe39c, 0xe49c, 0xe59c, 0xe69c, 0xe79c, 0xe89c, 0xe99c, 0xea9c, 0xadbe, 0xeb9c, 0xec9c, 0xed9c, 0xee9c, 0xef9c, 0xf09c, 0xf19c, 0xaebe, 0xf29c, 0xf39c, 0xf49c, 0xf59c, 0xf69c, 0xf79c, 0xf89c, 0xf99c, 0xfa9c, 0xfb9c, 0xfc9c, 0xfd9c, 0xfe9c, 0x419d, 0x429d, 0x439d, 0x449d, 0x459d, 0x469d, 0x479d, 0x489d, 0x499d, 0x4a9d, 0x4b9d, 0x4c9d, 0x4d9d, 0x4e9d, 0xafbe, 0x4f9d, 0x509d, 0x519d, 0xb0be, 0x529d, 0x539d, 0x549d, 0x559d, 0x569d, 0x579d, 0x589d, 0x599d, 0x5a9d, 0x619d, 0x629d, 0x639d, 0x649d, 0x659d, 0x669d, 0x679d, 0x689d, 0x699d, 0x6a9d, 0x6b9d, 0x6c9d, 0x6d9d, 0x6e9d, 0x6f9d, 0x709d, 0x719d, 0x729d, 0x739d, 0x749d, 0x759d, 0x769d, 0x779d, 0x789d, 0x799d, 0x7a9d, 0x819d, 0x829d, 0x839d, 0x849d, 0x859d, 0x869d, 0x879d, 0x889d, 0x899d, 0xb1be, 0x8a9d, 0x8b9d, 0x8c9d, 0x8d9d, 0x8e9d, 0x8f9d, 0xb2be, 0xb3be, 0x909d, 0x919d, 0xb4be, 0x929d, 0x939d, 0x949d, 0xb5be, 0x959d, 0xb6be, 0x969d, 0x979d, 0x989d, 0x999d, 0xb7be, 0xb8be, 0xb9be, 0x9a9d, 0x9b9d, 0x9c9d, 0x9d9d, 0x9e9d, 0x9f9d, 0xa09d, 0xa19d, 0xa29d, 0xa39d, 0xbabe, 0xa49d, 0xa59d, 0xa69d, 0xbbbe, 0xa79d, 0xa89d, 0xa99d, 0xbcbe, 0xaa9d, 0xab9d, 0xac9d, 0xad9d, 0xae9d, 0xaf9d, 0xb09d, 0xbdbe, 0xb19d, 0xb29d, 0xb39d, 0xb49d, 0xb59d, 0xb69d, 0xb79d, 0xb89d, 0xb99d, 0xba9d, 0xbb9d, 0xbebe, 0xbfbe, 0xbc9d, 0xbd9d, 0xc0be, 0xbe9d, 0xbf9d, 0xc09d, 0xc1be, 0xc19d, 0xc29d, 0xc39d, 0xc49d, 0xc59d, 0xc69d, 0xc79d, 0xc2be, 0xc3be, 0xc89d, 0xc4be, 0xc99d, 0xc5be, 0xca9d, 0xcb9d, 0xcc9d, 0xcd9d, 0xce9d, 0xcf9d, 0xc6be, 0xc7be, 0xd09d, 0xd19d, 0xc8be, 0xc9be, 0xcabe, 0xd29d, 0xcbbe, 0xccbe, 0xcdbe, 0xd39d, 0xd49d, 0xd59d, 0xd69d, 0xcebe, 0xcfbe, 0xd0be, 0xd79d, 0xd1be, 0xd2be, 0xd3be, 0xd89d, 0xd99d, 0xda9d, 0xd4be, 0xd5be, 0xdb9d, 0xd6be, 0xd7be, 0xdc9d, 0xdd9d, 0xd8be, 0xde9d, 0xdf9d, 0xe09d, 0xd9be, 0xe19d, 0xe29d, 0xe39d, 0xe49d, 0xe59d, 0xe69d, 0xe79d, 0xdabe, 0xdbbe, 0xe89d, 0xdcbe, 0xddbe, 0xdebe, 0xe99d, 0xea9d, 0xeb9d, 0xec9d, 0xed9d, 0xee9d, 0xdfbe, 0xe0be, 0xef9d, 0xf09d, 0xe1be, 0xf19d, 0xf29d, 0xf39d, 0xe2be, 0xf49d, 0xf59d, 0xe3be, 0xf69d, 0xf79d, 0xf89d, 0xf99d, 0xe4be, 0xe5be, 0xfa9d, 0xe6be, 0xfb9d, 0xe7be, 0xfc9d, 0xfd9d, 0xfe9d, 0xe8be, 0x419e, 0xe9be, 0xeabe, 0x429e, 0x439e, 0x449e, 0xebbe, 0x459e, 0x469e, 0x479e, 0xecbe, 0x489e, 0x499e, 0x4a9e, 0x4b9e, 0x4c9e, 0x4d9e, 0x4e9e, 0x4f9e, 0xedbe, 0x509e, 0x519e, 0x529e, 0x539e, 0x549e, 0x559e, 0x569e, 0x579e, 0x589e, 0x599e, 0xeebe, 0xefbe, 0x5a9e, 0x619e, 0xf0be, 0xf1be, 0x629e, 0xf2be, 0xf3be, 0xf4be, 0xf5be, 0x639e, 0x649e, 0x659e, 0x669e, 0x679e, 0xf6be, 0xf7be, 0xf8be, 0xf9be, 0xfabe, 0xfbbe, 0xfcbe, 0x689e, 0xfdbe, 0x699e, 0xfebe, 0x6a9e, 0xa1bf, 0xa2bf, 0x6b9e, 0x6c9e, 0xa3bf, 0x6d9e, 0x6e9e, 0x6f9e, 0xa4bf, 0x709e, 0x719e, 0x729e, 0x739e, 0x749e, 0x759e, 0x769e, 0xa5bf, 0xa6bf, 0x779e, 0xa7bf, 0x789e, 0xa8bf, 0x799e, 0x7a9e, 0x819e, 0x829e, 0x839e, 0x849e, 0xa9bf, 0xaabf, 0xabbf, 0x859e, 0xacbf, 0x869e, 0x879e, 0x889e, 0xadbf, 0x899e, 0xaebf, 0xafbf, 0x8a9e, 0x8b9e, 0x8c9e, 0x8d9e, 0xb0bf, 0xb1bf, 0xb2bf, 0xb3bf, 0xb4bf, 0xb5bf, 0x8e9e, 0x8f9e, 0x909e, 0xb6bf, 0xb7bf, 0xb8bf, 0xb9bf, 0x919e, 0x929e, 0x939e, 0xbabf, 0x949e, 0x959e, 0x969e, 0xbbbf, 0x979e, 0x989e, 0x999e, 0x9a9e, 0x9b9e, 0x9c9e, 0x9d9e, 0xbcbf, 0xbdbf, 0x9e9e, 0xbebf, 0xbfbf, 0x9f9e, 0xa09e, 0xa19e, 0xa29e, 0xa39e, 0xa49e, 0xa59e, 0xc0bf, 0xc1bf, 0xa69e, 0xa79e, 0xc2bf, 0xa89e, 0xa99e, 0xaa9e, 0xc3bf, 0xc4bf, 0xc5bf, 0xab9e, 0xc6bf, 0xac9e, 0xad9e, 0xc7bf, 0xc8bf, 0xc9bf, 0xae9e, 0xcabf, 0xaf9e, 0xcbbf, 0xb09e, 0xccbf, 0xb19e, 0xb29e, 0xb39e, 0xb49e, 0xcdbf, 0xcebf, 0xb59e, 0xb69e, 0xcfbf, 0xb79e, 0xb89e, 0xb99e, 0xd0bf, 0xba9e, 0xbb9e, 0xbc9e, 0xbd9e, 0xbe9e, 0xbf9e, 0xc09e, 0xd1bf, 0xd2bf, 0xc19e, 0xd3bf, 0xd4bf, 0xd5bf, 0xc29e, 0xc39e, 0xc49e, 0xc59e, 0xc69e, 0xc79e, 0xd6bf, 0xd7bf, 0xc89e, 0xc99e, 0xd8bf, 0xca9e, 0xcb9e, 0xcc9e, 0xcd9e, 0xce9e, 0xcf9e, 0xd09e, 0xd19e, 0xd29e, 0xd39e, 0xd49e, 0xd9bf, 0xd59e, 0xd69e, 0xdabf, 0xd79e, 0xdbbf, 0xd89e, 0xd99e, 0xda9e, 0xdb9e, 0xdc9e, 0xdd9e, 0xdcbf, 0xddbf, 0xde9e, 0xdf9e, 0xdebf, 0xe09e, 0xe19e, 0xe29e, 0xdfbf, 0xe39e, 0xe49e, 0xe59e, 0xe69e, 0xe79e, 0xe89e, 0xe99e, 0xe0bf, 0xe1bf, 0xea9e, 0xe2bf, 0xeb9e, 0xe3bf, 0xec9e, 0xed9e, 0xee9e, 0xef9e, 0xf09e, 0xf19e, 0xe4bf, 0xe5bf, 0xf29e, 0xf39e, 0xe6bf, 0xf49e, 0xf59e, 0xf69e, 0xe7bf, 0xf79e, 0xf89e, 0xf99e, 0xfa9e, 0xfb9e, 0xfc9e, 0xfd9e, 0xe8bf, 0xe9bf, 0xfe9e, 0xeabf, 0x419f, 0xebbf, 0x429f, 0x439f, 0x449f, 0x459f, 0x469f, 0x479f, 0xecbf, 0xedbf, 0x489f, 0x499f, 0xeebf, 0x4a9f, 0x4b9f, 0x4c9f, 0xefbf, 0xf0bf, 0xf1bf, 0x4d9f, 0x4e9f, 0x4f9f, 0x509f, 0x519f, 0xf2bf, 0xf3bf, 0x529f, 0xf4bf, 0x539f, 0xf5bf, 0x549f, 0x559f, 0x569f, 0x579f, 0x589f, 0x599f, 0xf6bf, 0xf7bf, 0x5a9f, 0x619f, 0xf8bf, 0x629f, 0x639f, 0x649f, 0xf9bf, 0x659f, 0x669f, 0x679f, 0x689f, 0x699f, 0x6a9f, 0x6b9f, 0xfabf, 0xfbbf, 0x6c9f, 0x6d9f, 0xfcbf, 0xfdbf, 0x6e9f, 0x6f9f, 0x709f, 0x719f, 0x729f, 0x739f, 0xfebf, 0xa1c0, 0x749f, 0x759f, 0xa2c0, 0x769f, 0x779f, 0x789f, 0xa3c0, 0x799f, 0x7a9f, 0x819f, 0x829f, 0x839f, 0x849f, 0x859f, 0xa4c0, 0xa5c0, 0x869f, 0x879f, 0x889f, 0xa6c0, 0x899f, 0x8a9f, 0x8b9f, 0x8c9f, 0x8d9f, 0x8e9f, 0xa7c0, 0xa8c0, 0x8f9f, 0x909f, 0xa9c0, 0x919f, 0x929f, 0x939f, 0xaac0, 0x949f, 0x959f, 0x969f, 0x979f, 0x989f, 0x999f, 0x9a9f, 0xabc0, 0xacc0, 0x9b9f, 0xadc0, 0x9c9f, 0xaec0, 0x9d9f, 0x9e9f, 0x9f9f, 0xa09f, 0xa19f, 0xa29f, 0xafc0, 0xb0c0, 0xa39f, 0xa49f, 0xb1c0, 0xa59f, 0xa69f, 0xa79f, 0xb2c0, 0xa89f, 0xa99f, 0xaa9f, 0xab9f, 0xac9f, 0xad9f, 0xae9f, 0xb3c0, 0xb4c0, 0xaf9f, 0xb5c0, 0xb09f, 0xb6c0, 0xb19f, 0xb7c0, 0xb29f, 0xb39f, 0xb49f, 0xb59f, 0xb8c0, 0xb9c0, 0xb69f, 0xb79f, 0xbac0, 0xb89f, 0xb99f, 0xba9f, 0xbbc0, 0xbb9f, 0xbc9f, 0xbd9f, 0xbe9f, 0xbf9f, 0xbcc0, 0xc09f, 0xbdc0, 0xbec0, 0xc19f, 0xbfc0, 0xc29f, 0xc0c0, 0xc1c0, 0xc2c0, 0xc3c0, 0xc4c0, 0xc5c0, 0xc6c0, 0xc7c0, 0xc39f, 0xc49f, 0xc59f, 0xc8c0, 0xc69f, 0xc79f, 0xc89f, 0xc9c0, 0xc99f, 0xca9f, 0xcb9f, 0xcc9f, 0xcd9f, 0xce9f, 0xcf9f, 0xcac0, 0xd09f, 0xd19f, 0xcbc0, 0xd29f, 0xd39f, 0xd49f, 0xd59f, 0xd69f, 0xd79f, 0xd89f, 0xd99f, 0xccc0, 0xcdc0, 0xda9f, 0xdb9f, 0xcec0, 0xdc9f, 0xdd9f, 0xde9f, 0xcfc0, 0xd0c0, 0xd1c0, 0xdf9f, 0xe09f, 0xe19f, 0xe29f, 0xd2c0, 0xd3c0, 0xd4c0, 0xe39f, 0xd5c0, 0xd6c0, 0xd7c0, 0xd8c0, 0xe49f, 0xe59f, 0xe69f, 0xd9c0, 0xe79f, 0xdac0, 0xdbc0, 0xe89f, 0xe99f, 0xdcc0, 0xea9f, 0xddc0, 0xdec0, 0xdfc0, 0xeb9f, 0xe0c0, 0xec9f, 0xed9f, 0xee9f, 0xef9f, 0xf09f, 0xe1c0, 0xe2c0, 0xf19f, 0xe3c0, 0xe4c0, 0xe5c0, 0xe6c0, 0xf29f, 0xf39f, 0xf49f, 0xf59f, 0xf69f, 0xe7c0, 0xe8c0, 0xf79f, 0xf89f, 0xe9c0, 0xf99f, 0xfa9f, 0xfb9f, 0xeac0, 0xfc9f, 0xfd9f, 0xfe9f, 0x41a0, 0x42a0, 0x43a0, 0x44a0, 0xebc0, 0xecc0, 0x45a0, 0xedc0, 0xeec0, 0xefc0, 0x46a0, 0x47a0, 0x48a0, 0x49a0, 0x4aa0, 0x4ba0, 0xf0c0, 0xf1c0, 0x4ca0, 0x4da0, 0xf2c0, 0x4ea0, 0xf3c0, 0x4fa0, 0xf4c0, 0x50a0, 0x51a0, 0x52a0, 0x53a0, 0x54a0, 0x55a0, 0x56a0, 0xf5c0, 0x57a0, 0x58a0, 0x59a0, 0x5aa0, 0xf6c0, 0x61a0, 0x62a0, 0x63a0, 0x64a0, 0x65a0, 0x66a0, 0xf7c0, 0x67a0, 0x68a0, 0x69a0, 0xf8c0, 0x6aa0, 0x6ba0, 0x6ca0, 0xf9c0, 0x6da0, 0x6ea0, 0x6fa0, 0x70a0, 0x71a0, 0x72a0, 0x73a0, 0x74a0, 0x75a0, 0x76a0, 0x77a0, 0x78a0, 0x79a0, 0x7aa0, 0x81a0, 0x82a0, 0x83a0, 0x84a0, 0x85a0, 0xfac0, 0xfbc0, 0x86a0, 0x87a0, 0xfcc0, 0x88a0, 0x89a0, 0x8aa0, 0xfdc0, 0x8ba0, 0xfec0, 0x8ca0, 0x8da0, 0x8ea0, 0x8fa0, 0x90a0, 0xa1c1, 0xa2c1, 0x91a0, 0xa3c1, 0x92a0, 0xa4c1, 0xa5c1, 0x93a0, 0x94a0, 0x95a0, 0x96a0, 0x97a0, 0xa6c1, 0xa7c1, 0x98a0, 0x99a0, 0xa8c1, 0x9aa0, 0x9ba0, 0x9ca0, 0xa9c1, 0x9da0, 0x9ea0, 0x9fa0, 0xa0a0, 0xa1a0, 0xa2a0, 0xa3a0, 0xaac1, 0xabc1, 0xa4a0, 0xacc1, 0xa5a0, 0xadc1, 0xa6a0, 0xa7a0, 0xa8a0, 0xa9a0, 0xaaa0, 0xaba0, 0xaec1, 0xaca0, 0xada0, 0xaea0, 0xafc1, 0xafa0, 0xb0a0, 0xb1a0, 0xb0c1, 0xb2a0, 0xb3a0, 0xb4a0, 0xb5a0, 0xb6a0, 0xb7a0, 0xb8a0, 0xb1c1, 0xb2c1, 0xb9a0, 0xbaa0, 0xb3c1, 0xb4c1, 0xbba0, 0xbca0, 0xbda0, 0xbea0, 0xbfa0, 0xc0a0, 0xb5c1, 0xc1a0, 0xc2a0, 0xc3a0, 0xc4a0, 0xc5a0, 0xc6a0, 0xc7a0, 0xc8a0, 0xc9a0, 0xcaa0, 0xcba0, 0xcca0, 0xcda0, 0xcea0, 0xcfa0, 0xd0a0, 0xd1a0, 0xd2a0, 0xd3a0, 0xd4a0, 0xd5a0, 0xd6a0, 0xd7a0, 0xd8a0, 0xd9a0, 0xdaa0, 0xdba0, 0xb6c1, 0xb7c1, 0xdca0, 0xdda0, 0xb8c1, 0xdea0, 0xdfa0, 0xe0a0, 0xb9c1, 0xe1a0, 0xbac1, 0xe2a0, 0xe3a0, 0xe4a0, 0xe5a0, 0xe6a0, 0xbbc1, 0xbcc1, 0xe7a0, 0xbdc1, 0xe8a0, 0xbec1, 0xbfc1, 0xc0c1, 0xe9a0, 0xeaa0, 0xeba0, 0xc1c1, 0xc2c1, 0xc3c1, 0xeca0, 0xeda0, 0xeea0, 0xefa0, 0xf0a0, 0xf1a0, 0xc4c1, 0xf2a0, 0xf3a0, 0xf4a0, 0xf5a0, 0xf6a0, 0xf7a0, 0xf8a0, 0xf9a0, 0xc5c1, 0xfaa0, 0xc6c1, 0xfba0, 0xc7c1, 0xfca0, 0xfda0, 0xfea0, 0x41a1, 0x42a1, 0x43a1, 0xc8c1, 0x44a1, 0x45a1, 0x46a1, 0x47a1, 0x48a1, 0x49a1, 0x4aa1, 0x4ba1, 0x4ca1, 0x4da1, 0x4ea1, 0x4fa1, 0x50a1, 0x51a1, 0x52a1, 0x53a1, 0x54a1, 0x55a1, 0x56a1, 0xc9c1, 0xcac1, 0x57a1, 0x58a1, 0x59a1, 0x5aa1, 0x61a1, 0x62a1, 0xcbc1, 0x63a1, 0x64a1, 0x65a1, 0xccc1, 0x66a1, 0x67a1, 0x68a1, 0xcdc1, 0x69a1, 0x6aa1, 0x6ba1, 0x6ca1, 0x6da1, 0x6ea1, 0x6fa1, 0xcec1, 0xcfc1, 0x70a1, 0xd0c1, 0x71a1, 0xd1c1, 0x72a1, 0x73a1, 0x74a1, 0x75a1, 0x76a1, 0x77a1, 0xd2c1, 0xd3c1, 0x78a1, 0x79a1, 0xd4c1, 0x7aa1, 0x81a1, 0x82a1, 0x83a1, 0x84a1, 0x85a1, 0x86a1, 0x87a1, 0x88a1, 0x89a1, 0x8aa1, 0x8ba1, 0x8ca1, 0x8da1, 0x8ea1, 0x8fa1, 0xd5c1, 0x90a1, 0x91a1, 0x92a1, 0x93a1, 0x94a1, 0x95a1, 0xd6c1, 0xd7c1, 0x96a1, 0x97a1, 0xd8c1, 0x98a1, 0x99a1, 0x9aa1, 0xd9c1, 0xdac1, 0xdbc1, 0x9ba1, 0x9ca1, 0x9da1, 0x9ea1, 0x9fa1, 0xdcc1, 0xddc1, 0xa0a1, 0xdec1, 0x41a2, 0xdfc1, 0x42a2, 0x43a2, 0x44a2, 0x45a2, 0x46a2, 0x47a2, 0xe0c1, 0x48a2, 0x49a2, 0x4aa2, 0x4ba2, 0x4ca2, 0x4da2, 0x4ea2, 0x4fa2, 0x50a2, 0x51a2, 0x52a2, 0x53a2, 0x54a2, 0x55a2, 0x56a2, 0x57a2, 0x58a2, 0x59a2, 0x5aa2, 0xe1c1, 0x61a2, 0x62a2, 0x63a2, 0x64a2, 0x65a2, 0x66a2, 0x67a2, 0xe2c1, 0x68a2, 0x69a2, 0x6aa2, 0x6ba2, 0x6ca2, 0x6da2, 0x6ea2, 0x6fa2, 0x70a2, 0x71a2, 0x72a2, 0x73a2, 0x74a2, 0x75a2, 0x76a2, 0x77a2, 0x78a2, 0x79a2, 0x7aa2, 0x81a2, 0x82a2, 0x83a2, 0x84a2, 0x85a2, 0x86a2, 0x87a2, 0x88a2, 0xe3c1, 0xe4c1, 0x89a2, 0x8aa2, 0xe5c1, 0x8ba2, 0x8ca2, 0x8da2, 0xe6c1, 0x8ea2, 0x8fa2, 0x90a2, 0x91a2, 0x92a2, 0x93a2, 0x94a2, 0xe7c1, 0xe8c1, 0x95a2, 0xe9c1, 0x96a2, 0x97a2, 0x98a2, 0x99a2, 0x9aa2, 0x9ba2, 0x9ca2, 0x9da2, 0xeac1, 0x9ea2, 0x9fa2, 0xa0a2, 0xebc1, 0x41a3, 0x42a3, 0x43a3, 0xecc1, 0x44a3, 0x45a3, 0x46a3, 0x47a3, 0x48a3, 0x49a3, 0x4aa3, 0xedc1, 0x4ba3, 0x4ca3, 0x4da3, 0x4ea3, 0x4fa3, 0x50a3, 0x51a3, 0x52a3, 0x53a3, 0x54a3, 0x55a3, 0xeec1, 0xefc1, 0x56a3, 0x57a3, 0xf0c1, 0x58a3, 0x59a3, 0x5aa3, 0xf1c1, 0x61a3, 0x62a3, 0x63a3, 0x64a3, 0x65a3, 0x66a3, 0x67a3, 0xf2c1, 0xf3c1, 0x68a3, 0xf4c1, 0x69a3, 0xf5c1, 0x6aa3, 0x6ba3, 0x6ca3, 0x6da3, 0x6ea3, 0x6fa3, 0x70a3, 0x71a3, 0x72a3, 0x73a3, 0x74a3, 0x75a3, 0x76a3, 0x77a3, 0x78a3, 0x79a3, 0x7aa3, 0x81a3, 0x82a3, 0x83a3, 0x84a3, 0x85a3, 0x86a3, 0x87a3, 0x88a3, 0x89a3, 0x8aa3, 0x8ba3, 0x8ca3, 0x8da3, 0x8ea3, 0x8fa3, 0x90a3, 0x91a3, 0xf6c1, 0xf7c1, 0x92a3, 0x93a3, 0xf8c1, 0x94a3, 0x95a3, 0xf9c1, 0xfac1, 0x96a3, 0xfbc1, 0x97a3, 0x98a3, 0x99a3, 0x9aa3, 0x9ba3, 0xfcc1, 0xfdc1, 0x9ca3, 0xfec1, 0x9da3, 0xa1c2, 0xa2c2, 0x9ea3, 0x9fa3, 0xa3c2, 0xa4c2, 0xa0a3, 0xa5c2, 0xa6c2, 0x41a4, 0x42a4, 0xa7c2, 0x43a4, 0xa8c2, 0x44a4, 0xa9c2, 0x45a4, 0x46a4, 0xaac2, 0x47a4, 0x48a4, 0x49a4, 0x4aa4, 0xabc2, 0xacc2, 0x4ba4, 0xadc2, 0xaec2, 0xafc2, 0x4ca4, 0x4da4, 0x4ea4, 0x4fa4, 0x50a4, 0x51a4, 0xb0c2, 0xb1c2, 0x52a4, 0x53a4, 0xb2c2, 0x54a4, 0x55a4, 0x56a4, 0xb3c2, 0x57a4, 0x58a4, 0x59a4, 0x5aa4, 0x61a4, 0x62a4, 0x63a4, 0xb4c2, 0xb5c2, 0x64a4, 0xb6c2, 0xb7c2, 0xb8c2, 0x65a4, 0x66a4, 0x67a4, 0x68a4, 0x69a4, 0x6aa4, 0xb9c2, 0x6ba4, 0x6ca4, 0x6da4, 0xbac2, 0x6ea4, 0x6fa4, 0x70a4, 0x71a4, 0x72a4, 0x73a4, 0x74a4, 0x75a4, 0x76a4, 0x77a4, 0x78a4, 0x79a4, 0x7aa4, 0x81a4, 0x82a4, 0x83a4, 0xbbc2, 0x84a4, 0x85a4, 0x86a4, 0x87a4, 0x88a4, 0x89a4, 0x8aa4, 0x8ba4, 0x8ca4, 0x8da4, 0x8ea4, 0x8fa4, 0x90a4, 0x91a4, 0x92a4, 0x93a4, 0x94a4, 0x95a4, 0x96a4, 0x97a4, 0x98a4, 0x99a4, 0x9aa4, 0x9ba4, 0x9ca4, 0x9da4, 0x9ea4, 0x9fa4, 0xa0a4, 0x41a5, 0x42a5, 0x43a5, 0x44a5, 0x45a5, 0xbcc2, 0xbdc2, 0x46a5, 0x47a5, 0xbec2, 0x48a5, 0x49a5, 0x4aa5, 0xbfc2, 0x4ba5, 0x4ca5, 0x4da5, 0x4ea5, 0x4fa5, 0x50a5, 0x51a5, 0xc0c2, 0xc1c2, 0x52a5, 0xc2c2, 0xc3c2, 0xc4c2, 0x53a5, 0x54a5, 0x55a5, 0x56a5, 0x57a5, 0x58a5, 0xc5c2, 0x59a5, 0x5aa5, 0x61a5, 0x62a5, 0x63a5, 0x64a5, 0x65a5, 0x66a5, 0x67a5, 0x68a5, 0x69a5, 0x6aa5, 0x6ba5, 0x6ca5, 0x6da5, 0x6ea5, 0x6fa5, 0x70a5, 0x71a5, 0x72a5, 0xc6c2, 0x73a5, 0x74a5, 0x75a5, 0x76a5, 0x77a5, 0x78a5, 0xc7c2, 0x79a5, 0x7aa5, 0x81a5, 0x82a5, 0x83a5, 0x84a5, 0x85a5, 0x86a5, 0x87a5, 0x88a5, 0x89a5, 0x8aa5, 0x8ba5, 0x8ca5, 0x8da5, 0x8ea5, 0x8fa5, 0x90a5, 0x91a5, 0xc8c2, 0x92a5, 0x93a5, 0x94a5, 0x95a5, 0x96a5, 0x97a5, 0x98a5, 0x99a5, 0x9aa5, 0x9ba5, 0x9ca5, 0x9da5, 0x9ea5, 0x9fa5, 0xa0a5, 0x41a6, 0x42a6, 0x43a6, 0x44a6, 0x45a6, 0x46a6, 0x47a6, 0x48a6, 0x49a6, 0x4aa6, 0x4ba6, 0x4ca6, 0x4da6, 0x4ea6, 0x4fa6, 0x50a6, 0x51a6, 0x52a6, 0x53a6, 0x54a6, 0xc9c2, 0xcac2, 0x55a6, 0x56a6, 0xcbc2, 0x57a6, 0x58a6, 0x59a6, 0xccc2, 0x5aa6, 0x61a6, 0x62a6, 0x63a6, 0x64a6, 0x65a6, 0x66a6, 0xcdc2, 0xcec2, 0x67a6, 0xcfc2, 0x68a6, 0xd0c2, 0x69a6, 0xd1c2, 0x6aa6, 0x6ba6, 0x6ca6, 0x6da6, 0xd2c2, 0xd3c2, 0x6ea6, 0x6fa6, 0x70a6, 0x71a6, 0x72a6, 0x73a6, 0xd4c2, 0x74a6, 0x75a6, 0x76a6, 0x77a6, 0x78a6, 0x79a6, 0x7aa6, 0x81a6, 0x82a6, 0x83a6, 0x84a6, 0xd5c2, 0x85a6, 0x86a6, 0x87a6, 0x88a6, 0x89a6, 0x8aa6, 0x8ba6, 0xd6c2, 0x8ca6, 0x8da6, 0x8ea6, 0x8fa6, 0x90a6, 0x91a6, 0x92a6, 0x93a6, 0x94a6, 0x95a6, 0x96a6, 0x97a6, 0x98a6, 0x99a6, 0x9aa6, 0x9ba6, 0x9ca6, 0x9da6, 0x9ea6, 0xd7c2, 0x9fa6, 0xa0a6, 0x41a7, 0x42a7, 0x43a7, 0x44a7, 0x45a7, 0xd8c2, 0x46a7, 0x47a7, 0x48a7, 0xd9c2, 0x49a7, 0x4aa7, 0x4ba7, 0xdac2, 0x4ca7, 0x4da7, 0x4ea7, 0x4fa7, 0x50a7, 0x51a7, 0x52a7, 0xdbc2, 0xdcc2, 0x53a7, 0x54a7, 0x55a7, 0x56a7, 0x57a7, 0x58a7, 0x59a7, 0x5aa7, 0x61a7, 0x62a7, 0x63a7, 0x64a7, 0x65a7, 0x66a7, 0x67a7, 0x68a7, 0x69a7, 0x6aa7, 0x6ba7, 0x6ca7, 0x6da7, 0x6ea7, 0x6fa7, 0x70a7, 0x71a7, 0x72a7, 0x73a7, 0x74a7, 0x75a7, 0x76a7, 0x77a7, 0xddc2, 0x78a7, 0x79a7, 0x7aa7, 0x81a7, 0x82a7, 0x83a7, 0xdec2, 0xdfc2, 0x84a7, 0x85a7, 0xe0c2, 0x86a7, 0x87a7, 0x88a7, 0xe1c2, 0x89a7, 0x8aa7, 0x8ba7, 0x8ca7, 0x8da7, 0x8ea7, 0x8fa7, 0xe2c2, 0xe3c2, 0x90a7, 0x91a7, 0x92a7, 0xe4c2, 0x93a7, 0x94a7, 0x95a7, 0x96a7, 0x97a7, 0x98a7, 0xe5c2, 0x99a7, 0x9aa7, 0x9ba7, 0x9ca7, 0x9da7, 0x9ea7, 0x9fa7, 0xa0a7, 0x41a8, 0x42a8, 0x43a8, 0x44a8, 0x45a8, 0x46a8, 0x47a8, 0x48a8, 0x49a8, 0x4aa8, 0x4ba8, 0xe6c2, 0xe7c2, 0x4ca8, 0x4da8, 0x4ea8, 0x4fa8, 0x50a8, 0x51a8, 0x52a8, 0x53a8, 0x54a8, 0x55a8, 0x56a8, 0x57a8, 0x58a8, 0x59a8, 0x5aa8, 0x61a8, 0x62a8, 0x63a8, 0x64a8, 0x65a8, 0x66a8, 0x67a8, 0x68a8, 0x69a8, 0x6aa8, 0x6ba8, 0x6ca8, 0x6da8, 0x6ea8, 0x6fa8, 0x70a8, 0x71a8, 0x72a8, 0x73a8, 0xe8c2, 0x74a8, 0x75a8, 0x76a8, 0x77a8, 0x78a8, 0x79a8, 0x7aa8, 0x81a8, 0x82a8, 0x83a8, 0x84a8, 0x85a8, 0x86a8, 0x87a8, 0x88a8, 0x89a8, 0x8aa8, 0x8ba8, 0x8ca8, 0x8da8, 0x8ea8, 0x8fa8, 0x90a8, 0x91a8, 0x92a8, 0x93a8, 0x94a8, 0xe9c2, 0x95a8, 0x96a8, 0x97a8, 0x98a8, 0x99a8, 0x9aa8, 0x9ba8, 0x9ca8, 0x9da8, 0x9ea8, 0x9fa8, 0xa0a8, 0x41a9, 0x42a9, 0x43a9, 0x44a9, 0x45a9, 0x46a9, 0x47a9, 0x48a9, 0x49a9, 0x4aa9, 0x4ba9, 0x4ca9, 0x4da9, 0x4ea9, 0x4fa9, 0xeac2, 0x50a9, 0x51a9, 0x52a9, 0x53a9, 0x54a9, 0x55a9, 0x56a9, 0x57a9, 0x58a9, 0x59a9, 0x5aa9, 0x61a9, 0x62a9, 0x63a9, 0x64a9, 0xebc2, 0x65a9, 0x66a9, 0xecc2, 0x67a9, 0xedc2, 0x68a9, 0x69a9, 0x6aa9, 0x6ba9, 0x6ca9, 0x6da9, 0x6ea9, 0x6fa9, 0x70a9, 0x71a9, 0x72a9, 0x73a9, 0x74a9, 0x75a9, 0x76a9, 0x77a9, 0x78a9, 0x79a9, 0x7aa9, 0x81a9, 0x82a9, 0x83a9, 0x84a9, 0x85a9, 0x86a9, 0x87a9, 0x88a9, 0x89a9, 0x8aa9, 0x8ba9, 0x8ca9, 0x8da9, 0x8ea9, 0x8fa9, 0xeec2, 0xefc2, 0x90a9, 0x91a9, 0xf0c2, 0x92a9, 0x93a9, 0x94a9, 0xf1c2, 0x95a9, 0x96a9, 0x97a9, 0x98a9, 0x99a9, 0x9aa9, 0x9ba9, 0xf2c2, 0xf3c2, 0x9ca9, 0x9da9, 0x9ea9, 0xf4c2, 0xf5c2, 0x9fa9, 0xa0a9, 0x41aa, 0x42aa, 0xf6c2, 0xf7c2, 0xf8c2, 0x43aa, 0x44aa, 0xf9c2, 0x45aa, 0xfac2, 0x46aa, 0xfbc2, 0x47aa, 0x48aa, 0x49aa, 0x4aaa, 0x4baa, 0x4caa, 0x4daa, 0xfcc2, 0xfdc2, 0x4eaa, 0xfec2, 0xa1c3, 0xa2c3, 0xa3c3, 0x4faa, 0x50aa, 0x51aa, 0x52aa, 0x53aa, 0xa4c3, 0xa5c3, 0x54aa, 0x55aa, 0xa6c3, 0x56aa, 0x57aa, 0x58aa, 0xa7c3, 0x59aa, 0x5aaa, 0x61aa, 0x62aa, 0x63aa, 0x64aa, 0x65aa, 0xa8c3, 0xa9c3, 0x66aa, 0xaac3, 0xabc3, 0xacc3, 0x67aa, 0x68aa, 0x69aa, 0x6aaa, 0x6baa, 0x6caa, 0xadc3, 0x6daa, 0x6eaa, 0x6faa, 0xaec3, 0x70aa, 0xafc3, 0x71aa, 0xb0c3, 0x72aa, 0x73aa, 0x74aa, 0x75aa, 0x76aa, 0x77aa, 0x78aa, 0xb1c3, 0x79aa, 0x7aaa, 0x81aa, 0x82aa, 0xb2c3, 0x83aa, 0x84aa, 0x85aa, 0x86aa, 0x87aa, 0x88aa, 0x89aa, 0x8aaa, 0x8baa, 0x8caa, 0x8daa, 0x8eaa, 0x8faa, 0x90aa, 0x91aa, 0x92aa, 0x93aa, 0x94aa, 0x95aa, 0x96aa, 0x97aa, 0x98aa, 0x99aa, 0x9aaa, 0x9baa, 0x9caa, 0x9daa, 0x9eaa, 0x9faa, 0xa0aa, 0x41ab, 0x42ab, 0x43ab, 0x44ab, 0xb3c3, 0xb4c3, 0x45ab, 0x46ab, 0xb5c3, 0x47ab, 0x48ab, 0x49ab, 0xb6c3, 0x4aab, 0x4bab, 0x4cab, 0x4dab, 0x4eab, 0x4fab, 0x50ab, 0xb7c3, 0xb8c3, 0x51ab, 0xb9c3, 0xbac3, 0xbbc3, 0x52ab, 0x53ab, 0x54ab, 0x55ab, 0x56ab, 0x57ab, 0xbcc3, 0xbdc3, 0x58ab, 0x59ab, 0xbec3, 0x5aab, 0x61ab, 0x62ab, 0xbfc3, 0x63ab, 0x64ab, 0x65ab, 0x66ab, 0x67ab, 0x68ab, 0x69ab, 0xc0c3, 0xc1c3, 0x6aab, 0xc2c3, 0x6bab, 0xc3c3, 0x6cab, 0x6dab, 0x6eab, 0x6fab, 0x70ab, 0x71ab, 0xc4c3, 0x72ab, 0x73ab, 0x74ab, 0xc5c3, 0x75ab, 0x76ab, 0x77ab, 0x78ab, 0x79ab, 0x7aab, 0x81ab, 0x82ab, 0x83ab, 0x84ab, 0x85ab, 0x86ab, 0x87ab, 0x88ab, 0x89ab, 0xc6c3, 0x8aab, 0x8bab, 0x8cab, 0x8dab, 0x8eab, 0x8fab, 0x90ab, 0xc7c3, 0x91ab, 0x92ab, 0x93ab, 0xc8c3, 0x94ab, 0x95ab, 0x96ab, 0x97ab, 0x98ab, 0x99ab, 0x9aab, 0x9bab, 0x9cab, 0x9dab, 0x9eab, 0x9fab, 0xa0ab, 0x41ac, 0x42ac, 0x43ac, 0xc9c3, 0x44ac, 0x45ac, 0x46ac, 0x47ac, 0x48ac, 0x49ac, 0xcac3, 0xcbc3, 0x4aac, 0x4bac, 0xccc3, 0x4cac, 0x4dac, 0x4eac, 0xcdc3, 0x4fac, 0x50ac, 0x51ac, 0x52ac, 0x53ac, 0x54ac, 0x55ac, 0xcec3, 0xcfc3, 0x56ac, 0xd0c3, 0x57ac, 0xd1c3, 0x58ac, 0x59ac, 0x5aac, 0x61ac, 0x62ac, 0x63ac, 0xd2c3, 0x64ac, 0x65ac, 0x66ac, 0xd3c3, 0x67ac, 0x68ac, 0x69ac, 0xd4c3, 0x6aac, 0x6bac, 0x6cac, 0x6dac, 0x6eac, 0x6fac, 0x70ac, 0x71ac, 0x72ac, 0x73ac, 0x74ac, 0x75ac, 0xd5c3, 0x76ac, 0x77ac, 0x78ac, 0x79ac, 0x7aac, 0x81ac, 0x82ac, 0x83ac, 0x84ac, 0x85ac, 0x86ac, 0x87ac, 0x88ac, 0x89ac, 0x8aac, 0x8bac, 0x8cac, 0x8dac, 0x8eac, 0x8fac, 0x90ac, 0x91ac, 0x92ac, 0x93ac, 0x94ac, 0x95ac, 0x96ac, 0x97ac, 0x98ac, 0x99ac, 0x9aac, 0x9bac, 0x9cac, 0x9dac, 0xd6c3, 0x9eac, 0x9fac, 0xa0ac, 0xd7c3, 0x41ad, 0x42ad, 0x43ad, 0xd8c3, 0x44ad, 0x45ad, 0x46ad, 0x47ad, 0x48ad, 0x49ad, 0x4aad, 0xd9c3, 0xdac3, 0x4bad, 0xdbc3, 0x4cad, 0xdcc3, 0x4dad, 0x4ead, 0x4fad, 0x50ad, 0x51ad, 0x52ad, 0xddc3, 0x53ad, 0x54ad, 0x55ad, 0x56ad, 0x57ad, 0x58ad, 0x59ad, 0x5aad, 0x61ad, 0x62ad, 0x63ad, 0x64ad, 0x65ad, 0x66ad, 0x67ad, 0xdec3, 0x68ad, 0x69ad, 0x6aad, 0x6bad, 0x6cad, 0x6dad, 0x6ead, 0x6fad, 0x70ad, 0x71ad, 0x72ad, 0xdfc3, 0xe0c3, 0x73ad, 0x74ad, 0xe1c3, 0x75ad, 0x76ad, 0x77ad, 0xe2c3, 0x78ad, 0x79ad, 0x7aad, 0x81ad, 0x82ad, 0x83ad, 0x84ad, 0xe3c3, 0xe4c3, 0x85ad, 0xe5c3, 0x86ad, 0xe6c3, 0x87ad, 0x88ad, 0x89ad, 0x8aad, 0x8bad, 0x8cad, 0xe7c3, 0x8dad, 0x8ead, 0x8fad, 0x90ad, 0x91ad, 0x92ad, 0x93ad, 0x94ad, 0x95ad, 0x96ad, 0x97ad, 0x98ad, 0x99ad, 0x9aad, 0x9bad, 0x9cad, 0x9dad, 0x9ead, 0x9fad, 0xe8c3, 0xa0ad, 0x41ae, 0x42ae, 0x43ae, 0x44ae, 0x45ae, 0x46ae, 0xe9c3, 0x47ae, 0x48ae, 0x49ae, 0xeac3, 0x4aae, 0x4bae, 0x4cae, 0x4dae, 0x4eae, 0x4fae, 0x50ae, 0x51ae, 0x52ae, 0x53ae, 0x54ae, 0x55ae, 0x56ae, 0x57ae, 0x58ae, 0x59ae, 0x5aae, 0x61ae, 0x62ae, 0x63ae, 0x64ae, 0x65ae, 0x66ae, 0xebc3, 0x67ae, 0x68ae, 0x69ae, 0xecc3, 0x6aae, 0x6bae, 0x6cae, 0xedc3, 0x6dae, 0x6eae, 0x6fae, 0x70ae, 0x71ae, 0x72ae, 0x73ae, 0xeec3, 0xefc3, 0x74ae, 0xf0c3, 0x75ae, 0xf1c3, 0x76ae, 0x77ae, 0x78ae, 0x79ae, 0x7aae, 0x81ae, 0xf2c3, 0x82ae, 0x83ae, 0x84ae, 0xf3c3, 0x85ae, 0x86ae, 0x87ae, 0xf4c3, 0x88ae, 0x89ae, 0x8aae, 0x8bae, 0x8cae, 0x8dae, 0x8eae, 0xf5c3, 0x8fae, 0x90ae, 0x91ae, 0x92ae, 0xf6c3, 0x93ae, 0x94ae, 0x95ae, 0x96ae, 0x97ae, 0x98ae, 0xf7c3, 0xf8c3, 0x99ae, 0x9aae, 0xf9c3, 0x9bae, 0x9cae, 0x9dae, 0xfac3, 0x9eae, 0x9fae, 0xa0ae, 0x41af, 0x42af, 0x43af, 0x44af, 0xfbc3, 0xfcc3, 0x45af, 0xfdc3, 0x46af, 0xfec3, 0x47af, 0x48af, 0x49af, 0x4aaf, 0x4baf, 0x4caf, 0x4daf, 0x4eaf, 0x4faf, 0x50af, 0x51af, 0x52af, 0x53af, 0x54af, 0x55af, 0x56af, 0x57af, 0x58af, 0x59af, 0x5aaf, 0x61af, 0x62af, 0x63af, 0x64af, 0x65af, 0x66af, 0x67af, 0x68af, 0x69af, 0x6aaf, 0x6baf, 0x6caf, 0x6daf, 0x6eaf, 0xa1c4, 0xa2c4, 0x6faf, 0x70af, 0xa3c4, 0x71af, 0x72af, 0xa4c4, 0xa5c4, 0xa6c4, 0x73af, 0x74af, 0x75af, 0x76af, 0x77af, 0x78af, 0xa7c4, 0xa8c4, 0x79af, 0xa9c4, 0x7aaf, 0xaac4, 0x81af, 0x82af, 0x83af, 0x84af, 0x85af, 0x86af, 0xabc4, 0xacc4, 0x87af, 0x88af, 0xadc4, 0x89af, 0x8aaf, 0x8baf, 0xaec4, 0x8caf, 0x8daf, 0x8eaf, 0x8faf, 0x90af, 0x91af, 0x92af, 0xafc4, 0xb0c4, 0x93af, 0xb1c4, 0x94af, 0xb2c4, 0x95af, 0x96af, 0x97af, 0x98af, 0x99af, 0x9aaf, 0xb3c4, 0xb4c4, 0x9baf, 0x9caf, 0xb5c4, 0x9daf, 0x9eaf, 0x9faf, 0xb6c4, 0xa0af, 0x41b0, 0x42b0, 0x43b0, 0x44b0, 0x45b0, 0x46b0, 0xb7c4, 0xb8c4, 0x47b0, 0xb9c4, 0xbac4, 0xbbc4, 0x48b0, 0x49b0, 0x4ab0, 0x4bb0, 0x4cb0, 0x4db0, 0xbcc4, 0xbdc4, 0x4eb0, 0x4fb0, 0x50b0, 0x51b0, 0x52b0, 0x53b0, 0x54b0, 0x55b0, 0x56b0, 0x57b0, 0x58b0, 0x59b0, 0x5ab0, 0x61b0, 0x62b0, 0x63b0, 0x64b0, 0x65b0, 0x66b0, 0xbec4, 0x67b0, 0x68b0, 0x69b0, 0x6ab0, 0x6bb0, 0x6cb0, 0x6db0, 0x6eb0, 0x6fb0, 0x70b0, 0x71b0, 0x72b0, 0x73b0, 0x74b0, 0x75b0, 0x76b0, 0x77b0, 0x78b0, 0x79b0, 0x7ab0, 0x81b0, 0x82b0, 0x83b0, 0x84b0, 0x85b0, 0x86b0, 0x87b0, 0x88b0, 0x89b0, 0x8ab0, 0x8bb0, 0x8cb0, 0x8db0, 0x8eb0, 0xbfc4, 0xc0c4, 0x8fb0, 0x90b0, 0xc1c4, 0x91b0, 0x92b0, 0xc2c4, 0xc3c4, 0x93b0, 0x94b0, 0x95b0, 0x96b0, 0x97b0, 0x98b0, 0x99b0, 0xc4c4, 0xc5c4, 0x9ab0, 0xc6c4, 0xc7c4, 0xc8c4, 0x9bb0, 0x9cb0, 0x9db0, 0x9eb0, 0x9fb0, 0xa0b0, 0xc9c4, 0xcac4, 0x41b1, 0x42b1, 0xcbc4, 0x43b1, 0x44b1, 0x45b1, 0xccc4, 0x46b1, 0x47b1, 0x48b1, 0x49b1, 0x4ab1, 0x4bb1, 0x4cb1, 0xcdc4, 0xcec4, 0x4db1, 0xcfc4, 0x4eb1, 0xd0c4, 0x4fb1, 0x50b1, 0x51b1, 0x52b1, 0x53b1, 0x54b1, 0xd1c4, 0x55b1, 0x56b1, 0x57b1, 0xd2c4, 0x58b1, 0x59b1, 0x5ab1, 0xd3c4, 0x61b1, 0x62b1, 0x63b1, 0x64b1, 0x65b1, 0x66b1, 0x67b1, 0xd4c4, 0xd5c4, 0x68b1, 0xd6c4, 0xd7c4, 0xd8c4, 0x69b1, 0x6ab1, 0x6bb1, 0x6cb1, 0x6db1, 0x6eb1, 0xd9c4, 0x6fb1, 0x70b1, 0x71b1, 0x72b1, 0x73b1, 0x74b1, 0x75b1, 0x76b1, 0x77b1, 0x78b1, 0x79b1, 0x7ab1, 0x81b1, 0x82b1, 0x83b1, 0x84b1, 0x85b1, 0x86b1, 0x87b1, 0x88b1, 0x89b1, 0x8ab1, 0x8bb1, 0x8cb1, 0x8db1, 0x8eb1, 0x8fb1, 0xdac4, 0xdbc4, 0x90b1, 0x91b1, 0xdcc4, 0x92b1, 0x93b1, 0x94b1, 0xddc4, 0x95b1, 0x96b1, 0x97b1, 0x98b1, 0x99b1, 0x9ab1, 0x9bb1, 0xdec4, 0xdfc4, 0x9cb1, 0xe0c4, 0x9db1, 0xe1c4, 0x9eb1, 0x9fb1, 0xa0b1, 0x41b2, 0x42b2, 0x43b2, 0xe2c4, 0xe3c4, 0x44b2, 0x45b2, 0xe4c4, 0x46b2, 0x47b2, 0x48b2, 0xe5c4, 0x49b2, 0x4ab2, 0x4bb2, 0x4cb2, 0x4db2, 0x4eb2, 0x4fb2, 0xe6c4, 0x50b2, 0x51b2, 0x52b2, 0x53b2, 0xe7c4, 0x54b2, 0x55b2, 0x56b2, 0x57b2, 0x58b2, 0x59b2, 0xe8c4, 0x5ab2, 0x61b2, 0x62b2, 0x63b2, 0x64b2, 0x65b2, 0x66b2, 0x67b2, 0x68b2, 0x69b2, 0x6ab2, 0x6bb2, 0x6cb2, 0x6db2, 0x6eb2, 0x6fb2, 0x70b2, 0x71b2, 0x72b2, 0x73b2, 0xe9c4, 0x74b2, 0x75b2, 0x76b2, 0x77b2, 0x78b2, 0x79b2, 0xeac4, 0x7ab2, 0x81b2, 0x82b2, 0x83b2, 0x84b2, 0x85b2, 0x86b2, 0xebc4, 0x87b2, 0x88b2, 0x89b2, 0x8ab2, 0x8bb2, 0x8cb2, 0x8db2, 0x8eb2, 0x8fb2, 0x90b2, 0x91b2, 0x92b2, 0x93b2, 0x94b2, 0x95b2, 0x96b2, 0x97b2, 0x98b2, 0x99b2, 0xecc4, 0x9ab2, 0x9bb2, 0x9cb2, 0x9db2, 0x9eb2, 0x9fb2, 0xa0b2, 0x41b3, 0x42b3, 0x43b3, 0x44b3, 0x45b3, 0x46b3, 0x47b3, 0x48b3, 0x49b3, 0x4ab3, 0x4bb3, 0x4cb3, 0x4db3, 0x4eb3, 0x4fb3, 0x50b3, 0x51b3, 0x52b3, 0x53b3, 0x54b3, 0xedc4, 0xeec4, 0x55b3, 0x56b3, 0xefc4, 0x57b3, 0x58b3, 0x59b3, 0xf0c4, 0x5ab3, 0x61b3, 0x62b3, 0x63b3, 0x64b3, 0x65b3, 0x66b3, 0xf1c4, 0xf2c4, 0x67b3, 0xf3c4, 0x68b3, 0xf4c4, 0x69b3, 0x6ab3, 0x6bb3, 0x6cb3, 0x6db3, 0x6eb3, 0xf5c4, 0x6fb3, 0x70b3, 0x71b3, 0xf6c4, 0x72b3, 0x73b3, 0x74b3, 0xf7c4, 0x75b3, 0x76b3, 0x77b3, 0x78b3, 0x79b3, 0x7ab3, 0x81b3, 0x82b3, 0x83b3, 0x84b3, 0x85b3, 0x86b3, 0xf8c4, 0x87b3, 0x88b3, 0x89b3, 0x8ab3, 0x8bb3, 0x8cb3, 0xf9c4, 0x8db3, 0x8eb3, 0x8fb3, 0x90b3, 0x91b3, 0x92b3, 0x93b3, 0x94b3, 0x95b3, 0x96b3, 0x97b3, 0x98b3, 0x99b3, 0x9ab3, 0x9bb3, 0x9cb3, 0x9db3, 0x9eb3, 0x9fb3, 0xa0b3, 0xfac4, 0x41b4, 0x42b4, 0x43b4, 0x44b4, 0x45b4, 0x46b4, 0xfbc4, 0xfcc4, 0x47b4, 0x48b4, 0xfdc4, 0x49b4, 0x4ab4, 0x4bb4, 0xfec4, 0x4cb4, 0x4db4, 0x4eb4, 0x4fb4, 0x50b4, 0x51b4, 0x52b4, 0xa1c5, 0xa2c5, 0x53b4, 0xa3c5, 0x54b4, 0xa4c5, 0x55b4, 0x56b4, 0x57b4, 0x58b4, 0x59b4, 0x5ab4, 0xa5c5, 0x61b4, 0x62b4, 0x63b4, 0xa6c5, 0x64b4, 0x65b4, 0x66b4, 0xa7c5, 0x67b4, 0x68b4, 0x69b4, 0x6ab4, 0x6bb4, 0x6cb4, 0x6db4, 0xa8c5, 0x6eb4, 0x6fb4, 0x70b4, 0x71b4, 0x72b4, 0x73b4, 0x74b4, 0x75b4, 0x76b4, 0x77b4, 0x78b4, 0xa9c5, 0xaac5, 0x79b4, 0x7ab4, 0xabc5, 0x81b4, 0x82b4, 0x83b4, 0xacc5, 0x84b4, 0x85b4, 0x86b4, 0x87b4, 0x88b4, 0x89b4, 0x8ab4, 0xadc5, 0xaec5, 0x8bb4, 0x8cb4, 0x8db4, 0xafc5, 0x8eb4, 0x8fb4, 0x90b4, 0x91b4, 0x92b4, 0x93b4, 0x94b4, 0x95b4, 0x96b4, 0x97b4, 0x98b4, 0x99b4, 0x9ab4, 0x9bb4, 0x9cb4, 0x9db4, 0x9eb4, 0x9fb4, 0xa0b4, 0x41b5, 0x42b5, 0x43b5, 0x44b5, 0x45b5, 0x46b5, 0x47b5, 0x48b5, 0x49b5, 0x4ab5, 0x4bb5, 0x4cb5, 0x4db5, 0x4eb5, 0x4fb5, 0xb0c5, 0xb1c5, 0x50b5, 0x51b5, 0xb2c5, 0x52b5, 0x53b5, 0x54b5, 0xb3c5, 0x55b5, 0x56b5, 0x57b5, 0x58b5, 0x59b5, 0x5ab5, 0x61b5, 0xb4c5, 0xb5c5, 0x62b5, 0xb6c5, 0x63b5, 0xb7c5, 0x64b5, 0x65b5, 0x66b5, 0x67b5, 0x68b5, 0x69b5, 0xb8c5, 0xb9c5, 0x6ab5, 0x6bb5, 0xbac5, 0x6cb5, 0x6db5, 0x6eb5, 0xbbc5, 0xbcc5, 0x6fb5, 0x70b5, 0x71b5, 0x72b5, 0x73b5, 0x74b5, 0xbdc5, 0xbec5, 0x75b5, 0xbfc5, 0xc0c5, 0xc1c5, 0x76b5, 0x77b5, 0x78b5, 0x79b5, 0x7ab5, 0x81b5, 0xc2c5, 0xc3c5, 0x82b5, 0x83b5, 0xc4c5, 0x84b5, 0x85b5, 0x86b5, 0xc5c5, 0x87b5, 0x88b5, 0x89b5, 0x8ab5, 0x8bb5, 0x8cb5, 0x8db5, 0xc6c5, 0xc7c5, 0x8eb5, 0xc8c5, 0xc9c5, 0xcac5, 0x8fb5, 0x90b5, 0x91b5, 0x92b5, 0x93b5, 0x94b5, 0xcbc5, 0x95b5, 0x96b5, 0x97b5, 0x98b5, 0x99b5, 0x9ab5, 0x9bb5, 0x9cb5, 0x9db5, 0x9eb5, 0x9fb5, 0xa0b5, 0x41b6, 0x42b6, 0x43b6, 0x44b6, 0x45b6, 0x46b6, 0x47b6, 0x48b6, 0xccc5, 0x49b6, 0x4ab6, 0x4bb6, 0x4cb6, 0x4db6, 0x4eb6, 0x4fb6, 0x50b6, 0x51b6, 0x52b6, 0x53b6, 0x54b6, 0x55b6, 0x56b6, 0x57b6, 0x58b6, 0x59b6, 0x5ab6, 0x61b6, 0x62b6, 0x63b6, 0x64b6, 0x65b6, 0x66b6, 0x67b6, 0x68b6, 0x69b6, 0x6ab6, 0x6bb6, 0x6cb6, 0x6db6, 0x6eb6, 0x6fb6, 0x70b6, 0xcdc5, 0xcec5, 0x71b6, 0x72b6, 0xcfc5, 0x73b6, 0x74b6, 0x75b6, 0xd0c5, 0x76b6, 0xd1c5, 0x77b6, 0x78b6, 0x79b6, 0x7ab6, 0x81b6, 0xd2c5, 0xd3c5, 0x82b6, 0xd4c5, 0xd5c5, 0xd6c5, 0x83b6, 0x84b6, 0x85b6, 0x86b6, 0x87b6, 0x88b6, 0xd7c5, 0xd8c5, 0x89b6, 0x8ab6, 0xd9c5, 0x8bb6, 0x8cb6, 0x8db6, 0xdac5, 0x8eb6, 0x8fb6, 0x90b6, 0x91b6, 0x92b6, 0x93b6, 0x94b6, 0xdbc5, 0xdcc5, 0x95b6, 0xddc5, 0x96b6, 0xdec5, 0x97b6, 0x98b6, 0x99b6, 0x9ab6, 0x9bb6, 0x9cb6, 0xdfc5, 0x9db6, 0x9eb6, 0x9fb6, 0xe0c5, 0xa0b6, 0x41b7, 0x42b7, 0x43b7, 0x44b7, 0x45b7, 0x46b7, 0x47b7, 0x48b7, 0x49b7, 0x4ab7, 0x4bb7, 0x4cb7, 0x4db7, 0x4eb7, 0xe1c5, 0x4fb7, 0x50b7, 0x51b7, 0x52b7, 0x53b7, 0x54b7, 0x55b7, 0xe2c5, 0x56b7, 0x57b7, 0x58b7, 0xe3c5, 0x59b7, 0x5ab7, 0x61b7, 0x62b7, 0x63b7, 0x64b7, 0x65b7, 0x66b7, 0x67b7, 0x68b7, 0x69b7, 0x6ab7, 0x6bb7, 0x6cb7, 0x6db7, 0x6eb7, 0x6fb7, 0x70b7, 0x71b7, 0x72b7, 0x73b7, 0x74b7, 0x75b7, 0xe4c5, 0xe5c5, 0x76b7, 0x77b7, 0xe6c5, 0x78b7, 0x79b7, 0x7ab7, 0xe7c5, 0x81b7, 0x82b7, 0x83b7, 0x84b7, 0x85b7, 0x86b7, 0x87b7, 0xe8c5, 0xe9c5, 0x88b7, 0xeac5, 0x89b7, 0xebc5, 0x8ab7, 0x8bb7, 0x8cb7, 0x8db7, 0xecc5, 0x8eb7, 0xedc5, 0x8fb7, 0x90b7, 0x91b7, 0xeec5, 0x92b7, 0x93b7, 0x94b7, 0x95b7, 0x96b7, 0x97b7, 0x98b7, 0x99b7, 0x9ab7, 0x9bb7, 0x9cb7, 0x9db7, 0x9eb7, 0x9fb7, 0xa0b7, 0x41b8, 0x42b8, 0x43b8, 0x44b8, 0x45b8, 0x46b8, 0x47b8, 0x48b8, 0xefc5, 0x49b8, 0x4ab8, 0x4bb8, 0x4cb8, 0x4db8, 0x4eb8, 0x4fb8, 0x50b8, 0x51b8, 0x52b8, 0x53b8, 0x54b8, 0x55b8, 0x56b8, 0x57b8, 0x58b8, 0x59b8, 0x5ab8, 0x61b8, 0x62b8, 0x63b8, 0x64b8, 0x65b8, 0x66b8, 0x67b8, 0x68b8, 0x69b8, 0xf0c5, 0x6ab8, 0x6bb8, 0x6cb8, 0xf1c5, 0x6db8, 0x6eb8, 0x6fb8, 0x70b8, 0x71b8, 0x72b8, 0x73b8, 0x74b8, 0x75b8, 0x76b8, 0x77b8, 0x78b8, 0x79b8, 0x7ab8, 0xf2c5, 0x81b8, 0xf3c5, 0x82b8, 0x83b8, 0x84b8, 0x85b8, 0x86b8, 0x87b8, 0xf4c5, 0x88b8, 0x89b8, 0x8ab8, 0x8bb8, 0x8cb8, 0x8db8, 0x8eb8, 0x8fb8, 0x90b8, 0x91b8, 0x92b8, 0x93b8, 0x94b8, 0x95b8, 0x96b8, 0x97b8, 0x98b8, 0x99b8, 0x9ab8, 0x9bb8, 0x9cb8, 0x9db8, 0x9eb8, 0x9fb8, 0xa0b8, 0x41b9, 0x42b9, 0xf5c5, 0xf6c5, 0x43b9, 0x44b9, 0xf7c5, 0x45b9, 0x46b9, 0x47b9, 0xf8c5, 0x48b9, 0x49b9, 0x4ab9, 0x4bb9, 0x4cb9, 0x4db9, 0x4eb9, 0xf9c5, 0xfac5, 0x4fb9, 0xfbc5, 0x50b9, 0xfcc5, 0x51b9, 0x52b9, 0x53b9, 0x54b9, 0x55b9, 0x56b9, 0xfdc5, 0x57b9, 0x58b9, 0x59b9, 0x5ab9, 0x61b9, 0x62b9, 0x63b9, 0x64b9, 0x65b9, 0x66b9, 0x67b9, 0x68b9, 0x69b9, 0x6ab9, 0x6bb9, 0x6cb9, 0x6db9, 0x6eb9, 0x6fb9, 0xfec5, 0x70b9, 0x71b9, 0x72b9, 0x73b9, 0x74b9, 0x75b9, 0x76b9, 0xa1c6, 0x77b9, 0x78b9, 0x79b9, 0x7ab9, 0x81b9, 0x82b9, 0x83b9, 0x84b9, 0x85b9, 0x86b9, 0x87b9, 0x88b9, 0x89b9, 0x8ab9, 0x8bb9, 0x8cb9, 0x8db9, 0x8eb9, 0x8fb9, 0x90b9, 0x91b9, 0x92b9, 0x93b9, 0x94b9, 0x95b9, 0x96b9, 0x97b9, 0xa2c6, 0xa3c6, 0x98b9, 0x99b9, 0xa4c6, 0x9ab9, 0x9bb9, 0x9cb9, 0xa5c6, 0x9db9, 0x9eb9, 0x9fb9, 0xa0b9, 0x41ba, 0x42ba, 0x43ba, 0xa6c6, 0xa7c6, 0x44ba, 0x45ba, 0x46ba, 0xa8c6, 0x47ba, 0x48ba, 0x49ba, 0x4aba, 0x4bba, 0x4cba, 0xa9c6, 0x4dba, 0x4eba, 0x4fba, 0xaac6, 0x50ba, 0x51ba, 0x52ba, 0xabc6, 0x53ba, 0x54ba, 0x55ba, 0x56ba, 0x57ba, 0x58ba, 0x59ba, 0xacc6, 0x5aba, 0x61ba, 0x62ba, 0x63ba, 0xadc6, 0x64ba, 0x65ba, 0x66ba, 0x67ba, 0x68ba, 0x69ba, 0xaec6, 0xafc6, 0x6aba, 0x6bba, 0xb0c6, 0x6cba, 0x6dba, 0xb1c6, 0xb2c6, 0x6eba, 0xb3c6, 0x6fba, 0x70ba, 0x71ba, 0x72ba, 0x73ba, 0xb4c6, 0xb5c6, 0x74ba, 0xb6c6, 0x75ba, 0x76ba, 0x77ba, 0x78ba, 0x79ba, 0x7aba, 0x81ba, 0x82ba, 0xb7c6, 0x83ba, 0x84ba, 0x85ba, 0xb8c6, 0x86ba, 0x87ba, 0x88ba, 0xb9c6, 0x89ba, 0x8aba, 0x8bba, 0x8cba, 0x8dba, 0x8eba, 0x8fba, 0xbac6, 0xbbc6, 0x90ba, 0x91ba, 0x92ba, 0x93ba, 0x94ba, 0x95ba, 0x96ba, 0x97ba, 0x98ba, 0x99ba, 0xbcc6, 0xbdc6, 0x9aba, 0x9bba, 0xbec6, 0x9cba, 0x9dba, 0x9eba, 0xbfc6, 0x9fba, 0xa0ba, 0x41bb, 0x42bb, 0x43bb, 0x44bb, 0x45bb, 0xc0c6, 0xc1c6, 0x46bb, 0xc2c6, 0x47bb, 0xc3c6, 0x48bb, 0x49bb, 0x4abb, 0x4bbb, 0x4cbb, 0x4dbb, 0xc4c6, 0xc5c6, 0xc6c6, 0x4ebb, 0xc7c6, 0x4fbb, 0x50bb, 0x51bb, 0xc8c6, 0x52bb, 0xc9c6, 0x53bb, 0x54bb, 0x55bb, 0x56bb, 0x57bb, 0xcac6, 0xcbc6, 0x58bb, 0xccc6, 0xcdc6, 0xcec6, 0x59bb, 0x5abb, 0x61bb, 0xcfc6, 0x62bb, 0x63bb, 0xd0c6, 0xd1c6, 0x64bb, 0x65bb, 0xd2c6, 0x66bb, 0x67bb, 0x68bb, 0xd3c6, 0x69bb, 0x6abb, 0x6bbb, 0x6cbb, 0x6dbb, 0x6ebb, 0x6fbb, 0xd4c6, 0xd5c6, 0x70bb, 0xd6c6, 0xd7c6, 0xd8c6, 0x71bb, 0x72bb, 0x73bb, 0x74bb, 0x75bb, 0x76bb, 0xd9c6, 0xdac6, 0x77bb, 0x78bb, 0x79bb, 0x7abb, 0x81bb, 0x82bb, 0x83bb, 0x84bb, 0x85bb, 0x86bb, 0x87bb, 0x88bb, 0x89bb, 0x8abb, 0x8bbb, 0x8cbb, 0x8dbb, 0x8ebb, 0x8fbb, 0x90bb, 0x91bb, 0x92bb, 0x93bb, 0x94bb, 0x95bb, 0x96bb, 0x97bb, 0x98bb, 0x99bb, 0x9abb, 0x9bbb, 0x9cbb, 0x9dbb, 0x9ebb, 0x9fbb, 0xa0bb, 0x41bc, 0x42bc, 0x43bc, 0x44bc, 0x45bc, 0x46bc, 0x47bc, 0x48bc, 0x49bc, 0x4abc, 0x4bbc, 0x4cbc, 0x4dbc, 0x4ebc, 0x4fbc, 0x50bc, 0x51bc, 0x52bc, 0xdbc6, 0xdcc6, 0x53bc, 0x54bc, 0xddc6, 0x55bc, 0x56bc, 0x57bc, 0xdec6, 0x58bc, 0x59bc, 0x5abc, 0x61bc, 0x62bc, 0x63bc, 0x64bc, 0xdfc6, 0xe0c6, 0x65bc, 0xe1c6, 0xe2c6, 0xe3c6, 0x66bc, 0x67bc, 0x68bc, 0x69bc, 0x6abc, 0x6bbc, 0xe4c6, 0xe5c6, 0x6cbc, 0x6dbc, 0xe6c6, 0x6ebc, 0x6fbc, 0x70bc, 0xe7c6, 0x71bc, 0x72bc, 0x73bc, 0x74bc, 0x75bc, 0x76bc, 0x77bc, 0xe8c6, 0xe9c6, 0x78bc, 0xeac6, 0x79bc, 0xebc6, 0x7abc, 0x81bc, 0x82bc, 0x83bc, 0x84bc, 0x85bc, 0xecc6, 0x86bc, 0x87bc, 0x88bc, 0xedc6, 0x89bc, 0x8abc, 0x8bbc, 0xeec6, 0x8cbc, 0x8dbc, 0x8ebc, 0x8fbc, 0x90bc, 0x91bc, 0x92bc, 0xefc6, 0xf0c6, 0x93bc, 0x94bc, 0xf1c6, 0xf2c6, 0x95bc, 0x96bc, 0x97bc, 0x98bc, 0x99bc, 0x9abc, 0xf3c6, 0x9bbc, 0x9cbc, 0x9dbc, 0x9ebc, 0x9fbc, 0xa0bc, 0x41bd, 0xf4c6, 0x42bd, 0x43bd, 0x44bd, 0x45bd, 0x46bd, 0x47bd, 0x48bd, 0x49bd, 0xf5c6, 0x4abd, 0xf6c6, 0x4bbd, 0x4cbd, 0x4dbd, 0x4ebd, 0x4fbd, 0x50bd, 0x51bd, 0x52bd, 0xf7c6, 0xf8c6, 0x53bd, 0x54bd, 0xf9c6, 0x55bd, 0x56bd, 0x57bd, 0xfac6, 0x58bd, 0x59bd, 0x5abd, 0x61bd, 0x62bd, 0x63bd, 0x64bd, 0xfbc6, 0xfcc6, 0x65bd, 0xfdc6, 0x66bd, 0xfec6, 0x67bd, 0x68bd, 0x69bd, 0x6abd, 0x6bbd, 0x6cbd, 0xa1c7, 0x6dbd, 0x6ebd, 0x6fbd, 0x70bd, 0x71bd, 0x72bd, 0x73bd, 0x74bd, 0x75bd, 0x76bd, 0x77bd, 0x78bd, 0x79bd, 0x7abd, 0x81bd, 0x82bd, 0x83bd, 0x84bd, 0x85bd, 0x86bd, 0xa2c7, 0x87bd, 0x88bd, 0x89bd, 0x8abd, 0x8bbd, 0x8cbd, 0x8dbd, 0x8ebd, 0x8fbd, 0x90bd, 0x91bd, 0x92bd, 0x93bd, 0x94bd, 0x95bd, 0x96bd, 0x97bd, 0x98bd, 0x99bd, 0x9abd, 0x9bbd, 0x9cbd, 0x9dbd, 0x9ebd, 0x9fbd, 0xa0bd, 0x41be, 0x42be, 0x43be, 0x44be, 0x45be, 0x46be, 0x47be, 0x48be, 0xa3c7, 0x49be, 0x4abe, 0x4bbe, 0xa4c7, 0x4cbe, 0x4dbe, 0x4ebe, 0x4fbe, 0x50be, 0x51be, 0x52be, 0x53be, 0x54be, 0x55be, 0x56be, 0x57be, 0x58be, 0x59be, 0x5abe, 0x61be, 0x62be, 0x63be, 0x64be, 0x65be, 0x66be, 0x67be, 0x68be, 0xa5c7, 0x69be, 0x6abe, 0x6bbe, 0xa6c7, 0x6cbe, 0x6dbe, 0x6ebe, 0xa7c7, 0x6fbe, 0x70be, 0x71be, 0x72be, 0x73be, 0x74be, 0x75be, 0x76be, 0xa8c7, 0x77be, 0xa9c7, 0x78be, 0x79be, 0x7abe, 0x81be, 0x82be, 0x83be, 0x84be, 0x85be, 0xaac7, 0xabc7, 0x86be, 0x87be, 0xacc7, 0x88be, 0x89be, 0xadc7, 0xaec7, 0x8abe, 0xafc7, 0x8bbe, 0x8cbe, 0x8dbe, 0x8ebe, 0x8fbe, 0xb0c7, 0xb1c7, 0x90be, 0xb2c7, 0x91be, 0xb3c7, 0x92be, 0x93be, 0x94be, 0x95be, 0x96be, 0x97be, 0xb4c7, 0x98be, 0x99be, 0x9abe, 0x9bbe, 0x9cbe, 0x9dbe, 0x9ebe, 0x9fbe, 0xa0be, 0x41bf, 0x42bf, 0x43bf, 0x44bf, 0x45bf, 0x46bf, 0x47bf, 0x48bf, 0x49bf, 0x4abf, 0x4bbf, 0xb5c7, 0x4cbf, 0x4dbf, 0x4ebf, 0x4fbf, 0x50bf, 0x51bf, 0x52bf, 0x53bf, 0x54bf, 0x55bf, 0x56bf, 0x57bf, 0x58bf, 0x59bf, 0x5abf, 0x61bf, 0x62bf, 0x63bf, 0x64bf, 0x65bf, 0x66bf, 0x67bf, 0x68bf, 0x69bf, 0x6abf, 0x6bbf, 0x6cbf, 0x6dbf, 0x6ebf, 0x6fbf, 0x70bf, 0x71bf, 0x72bf, 0x73bf, 0xb6c7, 0x74bf, 0x75bf, 0x76bf, 0xb7c7, 0x77bf, 0x78bf, 0x79bf, 0xb8c7, 0x7abf, 0x81bf, 0x82bf, 0x83bf, 0x84bf, 0x85bf, 0x86bf, 0xb9c7, 0x87bf, 0x88bf, 0xbac7, 0x89bf, 0x8abf, 0x8bbf, 0x8cbf, 0x8dbf, 0x8ebf, 0x8fbf, 0x90bf, 0xbbc7, 0x91bf, 0x92bf, 0x93bf, 0xbcc7, 0x94bf, 0x95bf, 0x96bf, 0xbdc7, 0x97bf, 0x98bf, 0x99bf, 0x9abf, 0x9bbf, 0x9cbf, 0x9dbf, 0xbec7, 0x9ebf, 0x9fbf, 0xbfc7, 0xa0bf, 0xc0c7, 0x41c0, 0x42c0, 0x43c0, 0x44c0, 0x45c0, 0x46c0, 0xc1c7, 0x47c0, 0x48c0, 0x49c0, 0xc2c7, 0x4ac0, 0x4bc0, 0x4cc0, 0xc3c7, 0x4dc0, 0x4ec0, 0x4fc0, 0x50c0, 0x51c0, 0x52c0, 0x53c0, 0xc4c7, 0xc5c7, 0x54c0, 0xc6c7, 0x55c0, 0x56c0, 0x57c0, 0x58c0, 0x59c0, 0x5ac0, 0x61c0, 0x62c0, 0x63c0, 0x64c0, 0x65c0, 0x66c0, 0x67c0, 0x68c0, 0x69c0, 0x6ac0, 0x6bc0, 0x6cc0, 0x6dc0, 0x6ec0, 0x6fc0, 0x70c0, 0x71c0, 0x72c0, 0x73c0, 0x74c0, 0x75c0, 0x76c0, 0x77c0, 0x78c0, 0x79c0, 0x7ac0, 0x81c0, 0x82c0, 0x83c0, 0x84c0, 0xc7c7, 0xc8c7, 0x85c0, 0x86c0, 0xc9c7, 0x87c0, 0x88c0, 0x89c0, 0xcac7, 0x8ac0, 0x8bc0, 0x8cc0, 0x8dc0, 0x8ec0, 0x8fc0, 0x90c0, 0xcbc7, 0xccc7, 0x91c0, 0xcdc7, 0x92c0, 0xcec7, 0x93c0, 0x94c0, 0x95c0, 0x96c0, 0x97c0, 0x98c0, 0xcfc7, 0xd0c7, 0x99c0, 0x9ac0, 0xd1c7, 0x9bc0, 0x9cc0, 0x9dc0, 0xd2c7, 0x9ec0, 0x9fc0, 0xa0c0, 0x41c1, 0xd3c7, 0x42c1, 0x43c1, 0xd4c7, 0xd5c7, 0x44c1, 0xd6c7, 0x45c1, 0xd7c7, 0x46c1, 0x47c1, 0x48c1, 0x49c1, 0x4ac1, 0x4bc1, 0xd8c7, 0xd9c7, 0x4cc1, 0x4dc1, 0xdac7, 0x4ec1, 0x4fc1, 0x50c1, 0xdbc7, 0x51c1, 0x52c1, 0x53c1, 0x54c1, 0x55c1, 0x56c1, 0x57c1, 0xdcc7, 0xddc7, 0x58c1, 0xdec7, 0xdfc7, 0xe0c7, 0x59c1, 0x5ac1, 0x61c1, 0x62c1, 0x63c1, 0x64c1, 0xe1c7, 0x65c1, 0x66c1, 0x67c1, 0x68c1, 0x69c1, 0x6ac1, 0x6bc1, 0x6cc1, 0x6dc1, 0x6ec1, 0x6fc1, 0x70c1, 0x71c1, 0x72c1, 0x73c1, 0x74c1, 0x75c1, 0x76c1, 0x77c1, 0x78c1, 0xe2c7, 0x79c1, 0x7ac1, 0x81c1, 0x82c1, 0x83c1, 0x84c1, 0x85c1, 0x86c1, 0x87c1, 0x88c1, 0x89c1, 0x8ac1, 0x8bc1, 0x8cc1, 0x8dc1, 0x8ec1, 0x8fc1, 0x90c1, 0x91c1, 0x92c1, 0x93c1, 0x94c1, 0x95c1, 0x96c1, 0x97c1, 0x98c1, 0x99c1, 0x9ac1, 0x9bc1, 0x9cc1, 0x9dc1, 0x9ec1, 0x9fc1, 0xa0c1, 0xe3c7, 0xe4c7, 0x41c2, 0x42c2, 0xe5c7, 0x43c2, 0x44c2, 0x45c2, 0xe6c7, 0x46c2, 0xe7c7, 0x47c2, 0x48c2, 0x49c2, 0x4ac2, 0x4bc2, 0xe8c7, 0xe9c7, 0x4cc2, 0xeac7, 0x4dc2, 0xebc7, 0x4ec2, 0x4fc2, 0x50c2, 0x51c2, 0x52c2, 0x53c2, 0xecc7, 0xedc7, 0x54c2, 0x55c2, 0xeec7, 0x56c2, 0x57c2, 0x58c2, 0xefc7, 0x59c2, 0x5ac2, 0x61c2, 0x62c2, 0x63c2, 0x64c2, 0x65c2, 0xf0c7, 0xf1c7, 0x66c2, 0xf2c7, 0x67c2, 0xf3c7, 0x68c2, 0x69c2, 0x6ac2, 0x6bc2, 0x6cc2, 0x6dc2, 0xf4c7, 0xf5c7, 0x6ec2, 0x6fc2, 0xf6c7, 0x70c2, 0x71c2, 0x72c2, 0xf7c7, 0x73c2, 0x74c2, 0x75c2, 0x76c2, 0x77c2, 0x78c2, 0x79c2, 0xf8c7, 0xf9c7, 0x7ac2, 0xfac7, 0xfbc7, 0xfcc7, 0x81c2, 0x82c2, 0x83c2, 0x84c2, 0x85c2, 0x86c2, 0xfdc7, 0x87c2, 0x88c2, 0x89c2, 0xfec7, 0x8ac2, 0x8bc2, 0x8cc2, 0xa1c8, 0x8dc2, 0x8ec2, 0x8fc2, 0x90c2, 0x91c2, 0x92c2, 0x93c2, 0x94c2, 0xa2c8, 0x95c2, 0x96c2, 0x97c2, 0x98c2, 0x99c2, 0x9ac2, 0x9bc2, 0x9cc2, 0x9dc2, 0x9ec2, 0xa3c8, 0xa4c8, 0x9fc2, 0xa0c2, 0xa5c8, 0x41c3, 0x42c3, 0x43c3, 0xa6c8, 0x44c3, 0x45c3, 0x46c3, 0x47c3, 0xa7c8, 0x48c3, 0x49c3, 0xa8c8, 0xa9c8, 0x4ac3, 0xaac8, 0x4bc3, 0xabc8, 0x4cc3, 0x4dc3, 0x4ec3, 0xacc8, 0x4fc3, 0x50c3, 0xadc8, 0xaec8, 0x51c3, 0x52c3, 0xafc8, 0x53c3, 0x54c3, 0x55c3, 0xb0c8, 0x56c3, 0x57c3, 0x58c3, 0x59c3, 0x5ac3, 0x61c3, 0x62c3, 0x63c3, 0x64c3, 0x65c3, 0xb1c8, 0x66c3, 0xb2c8, 0x67c3, 0x68c3, 0x69c3, 0x6ac3, 0x6bc3, 0x6cc3, 0xb3c8, 0xb4c8, 0x6dc3, 0x6ec3, 0xb5c8, 0x6fc3, 0x70c3, 0x71c3, 0x72c3, 0x73c3, 0x74c3, 0x75c3, 0x76c3, 0x77c3, 0x78c3, 0x79c3, 0x7ac3, 0x81c3, 0x82c3, 0xb6c8, 0x83c3, 0xb7c8, 0x84c3, 0x85c3, 0x86c3, 0x87c3, 0x88c3, 0x89c3, 0xb8c8, 0xb9c8, 0x8ac3, 0x8bc3, 0xbac8, 0x8cc3, 0x8dc3, 0x8ec3, 0xbbc8, 0x8fc3, 0x90c3, 0x91c3, 0x92c3, 0x93c3, 0x94c3, 0x95c3, 0x96c3, 0xbcc8, 0x97c3, 0xbdc8, 0x98c3, 0xbec8, 0x99c3, 0x9ac3, 0x9bc3, 0x9cc3, 0x9dc3, 0x9ec3, 0xbfc8, 0x9fc3, 0xa0c3, 0x41c4, 0xc0c8, 0x42c4, 0x43c4, 0x44c4, 0xc1c8, 0x45c4, 0x46c4, 0x47c4, 0x48c4, 0x49c4, 0x4ac4, 0x4bc4, 0x4cc4, 0xc2c8, 0x4dc4, 0xc3c8, 0x4ec4, 0x4fc4, 0x50c4, 0x51c4, 0x52c4, 0x53c4, 0x54c4, 0x55c4, 0xc4c8, 0xc5c8, 0x56c4, 0x57c4, 0xc6c8, 0x58c4, 0x59c4, 0x5ac4, 0xc7c8, 0x61c4, 0x62c4, 0x63c4, 0x64c4, 0xc8c8, 0x65c4, 0x66c4, 0xc9c8, 0x67c4, 0x68c4, 0xcac8, 0x69c4, 0xcbc8, 0x6ac4, 0x6bc4, 0x6cc4, 0x6dc4, 0x6ec4, 0x6fc4, 0xccc8, 0x70c4, 0x71c4, 0x72c4, 0xcdc8, 0x73c4, 0x74c4, 0x75c4, 0xcec8, 0x76c4, 0x77c4, 0x78c4, 0x79c4, 0x7ac4, 0x81c4, 0x82c4, 0xcfc8, 0x83c4, 0x84c4, 0x85c4, 0x86c4, 0xd0c8, 0x87c4, 0x88c4, 0x89c4, 0x8ac4, 0x8bc4, 0x8cc4, 0xd1c8, 0xd2c8, 0x8dc4, 0x8ec4, 0xd3c8, 0x8fc4, 0x90c4, 0x91c4, 0xd4c8, 0x92c4, 0x93c4, 0x94c4, 0x95c4, 0x96c4, 0x97c4, 0x98c4, 0x99c4, 0x9ac4, 0x9bc4, 0x9cc4, 0x9dc4, 0xd5c8, 0x9ec4, 0x9fc4, 0xa0c4, 0x41c5, 0x42c5, 0x43c5, 0xd6c8, 0xd7c8, 0x44c5, 0x45c5, 0xd8c8, 0x46c5, 0x47c5, 0x48c5, 0xd9c8, 0x49c5, 0x4ac5, 0x4bc5, 0x4cc5, 0x4dc5, 0x4ec5, 0x4fc5, 0xdac8, 0xdbc8, 0x50c5, 0xdcc8, 0x51c5, 0xddc8, 0x52c5, 0x53c5, 0x54c5, 0x55c5, 0x56c5, 0x57c5, 0xdec8, 0xdfc8, 0x58c5, 0x59c5, 0xe0c8, 0x5ac5, 0x61c5, 0x62c5, 0xe1c8, 0x63c5, 0x64c5, 0x65c5, 0x66c5, 0x67c5, 0x68c5, 0x69c5, 0xe2c8, 0x6ac5, 0x6bc5, 0xe3c8, 0x6cc5, 0xe4c8, 0x6dc5, 0x6ec5, 0x6fc5, 0x70c5, 0x71c5, 0x72c5, 0xe5c8, 0xe6c8, 0x73c5, 0x74c5, 0xe7c8, 0x75c5, 0xe8c8, 0xe9c8, 0xeac8, 0xebc8, 0x76c5, 0x77c5, 0x78c5, 0x79c5, 0x7ac5, 0x81c5, 0xecc8, 0xedc8, 0x82c5, 0xeec8, 0x83c5, 0xefc8, 0x84c5, 0x85c5, 0x86c5, 0xf0c8, 0x87c5, 0x88c5, 0xf1c8, 0x89c5, 0x8ac5, 0x8bc5, 0xf2c8, 0x8cc5, 0x8dc5, 0x8ec5, 0xf3c8, 0x8fc5, 0x90c5, 0x91c5, 0x92c5, 0x93c5, 0x94c5, 0x95c5, 0xf4c8, 0xf5c8, 0x96c5, 0x97c5, 0x98c5, 0xf6c8, 0x99c5, 0x9ac5, 0x9bc5, 0x9cc5, 0x9dc5, 0x9ec5, 0xf7c8, 0xf8c8, 0x9fc5, 0xa0c5, 0xf9c8, 0x41c6, 0x42c6, 0x43c6, 0xfac8, 0x44c6, 0x45c6, 0x46c6, 0x47c6, 0x48c6, 0x49c6, 0x4ac6, 0xfbc8, 0xfcc8, 0x4bc6, 0xfdc8, 0x4cc6, 0xfec8, 0x4dc6, 0x4ec6, 0x4fc6, 0x50c6, 0x51c6, 0x52c6 }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0xf900[ 268 ] = { 0xd0cb, 0xd6cb, 0xe7cb, 0xcfcd, 0xe8cd, 0xadce, 0xfbcf, 0xa2d0, 0xb8d0, 0xd0d0, 0xddd0, 0xd4d1, 0xd5d1, 0xd8d1, 0xdbd1, 0xdcd1, 0xddd1, 0xded1, 0xdfd1, 0xe0d1, 0xe2d1, 0xe3d1, 0xe4d1, 0xe5d1, 0xe6d1, 0xe8d1, 0xe9d1, 0xead1, 0xebd1, 0xedd1, 0xefd1, 0xf0d1, 0xf2d1, 0xf6d1, 0xfad1, 0xfcd1, 0xfdd1, 0xfed1, 0xa2d2, 0xa3d2, 0xa7d2, 0xa8d2, 0xa9d2, 0xaad2, 0xabd2, 0xadd2, 0xb2d2, 0xbed2, 0xc2d2, 0xc3d2, 0xc4d2, 0xc6d2, 0xc7d2, 0xc8d2, 0xc9d2, 0xcad2, 0xcbd2, 0xcdd2, 0xced2, 0xcfd2, 0xd0d2, 0xd1d2, 0xd2d2, 0xd3d2, 0xd4d2, 0xd5d2, 0xd6d2, 0xd7d2, 0xd9d2, 0xdad2, 0xded2, 0xdfd2, 0xe1d2, 0xe2d2, 0xe4d2, 0xe5d2, 0xe6d2, 0xe7d2, 0xe8d2, 0xe9d2, 0xead2, 0xebd2, 0xf0d2, 0xf1d2, 0xf2d2, 0xf3d2, 0xf4d2, 0xf5d2, 0xf7d2, 0xf8d2, 0xe6d4, 0xfcd4, 0xa5d5, 0xabd5, 0xaed5, 0xb8d6, 0xcdd6, 0xcbd7, 0xe4d7, 0xc5db, 0xe4db, 0xa5dc, 0xa5dd, 0xd5dd, 0xf4dd, 0xfcde, 0xfede, 0xb3df, 0xe1df, 0xe8df, 0xf1e0, 0xade1, 0xede1, 0xf5e3, 0xa1e4, 0xa9e4, 0xaee5, 0xb1e5, 0xb2e5, 0xb9e5, 0xbbe5, 0xbce5, 0xc4e5, 0xcee5, 0xd0e5, 0xd2e5, 0xd6e5, 0xfae5, 0xfbe5, 0xfce5, 0xfee5, 0xa1e6, 0xa4e6, 0xa7e6, 0xade6, 0xafe6, 0xb0e6, 0xb1e6, 0xb3e6, 0xb7e6, 0xb8e6, 0xbce6, 0xc4e6, 0xc6e6, 0xc7e6, 0xcae6, 0xd2e6, 0xd6e6, 0xd9e6, 0xdce6, 0xdfe6, 0xe1e6, 0xe4e6, 0xe5e6, 0xe6e6, 0xe8e6, 0xeae6, 0xebe6, 0xece6, 0xefe6, 0xf1e6, 0xf2e6, 0xf5e6, 0xf6e6, 0xf7e6, 0xf9e6, 0xa1e7, 0xa6e7, 0xa9e7, 0xaae7, 0xace7, 0xade7, 0xb0e7, 0xbfe7, 0xc1e7, 0xc6e7, 0xc7e7, 0xcbe7, 0xcde7, 0xcfe7, 0xd0e7, 0xd3e7, 0xdfe7, 0xe4e7, 0xe6e7, 0xf7e7, 0xe7e8, 0xe8e8, 0xf0e8, 0xf1e8, 0xf7e8, 0xf9e8, 0xfbe8, 0xfee8, 0xa7e9, 0xace9, 0xcce9, 0xf7e9, 0xc1ea, 0xe5ea, 0xf4ea, 0xf7ea, 0xfcea, 0xfeea, 0xa4eb, 0xa7eb, 0xa9eb, 0xaaeb, 0xbaeb, 0xbbeb, 0xbdeb, 0xc1eb, 0xc2eb, 0xc6eb, 0xc7eb, 0xcceb, 0xcfeb, 0xd0eb, 0xd1eb, 0xd2eb, 0xd8eb, 0xa6ec, 0xa7ec, 0xaaec, 0xafec, 0xb0ec, 0xb1ec, 0xb2ec, 0xb5ec, 0xb8ec, 0xbaec, 0xc0ec, 0xc1ec, 0xc5ec, 0xc6ec, 0xc9ec, 0xcaec, 0xd5ec, 0xddec, 0xdeec, 0xe1ec, 0xe4ec, 0xe7ec, 0xe8ec, 0xf7ec, 0xf8ec, 0xfaec, 0xa1ed, 0xa2ed, 0xa3ed, 0xeeed, 0xdbee, 0xbdf2, 0xfaf2, 0xb1f3, 0xa7f4, 0xeef4, 0xf4f6, 0xf6f6, 0xb8f7, 0xc8f7, 0xd3f7, 0xdbf8, 0xf0f8, 0xa1fa, 0xa2fa, 0xe6fa, 0xa9fc }; const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0xff00[ 256 ] = { 0x001a, 0xa1a3, 0xa2a3, 0xa3a3, 0xa4a3, 0xa5a3, 0xa6a3, 0xa7a3, 0xa8a3, 0xa9a3, 0xaaa3, 0xaba3, 0xaca3, 0xada3, 0xaea3, 0xafa3, 0xb0a3, 0xb1a3, 0xb2a3, 0xb3a3, 0xb4a3, 0xb5a3, 0xb6a3, 0xb7a3, 0xb8a3, 0xb9a3, 0xbaa3, 0xbba3, 0xbca3, 0xbda3, 0xbea3, 0xbfa3, 0xc0a3, 0xc1a3, 0xc2a3, 0xc3a3, 0xc4a3, 0xc5a3, 0xc6a3, 0xc7a3, 0xc8a3, 0xc9a3, 0xcaa3, 0xcba3, 0xcca3, 0xcda3, 0xcea3, 0xcfa3, 0xd0a3, 0xd1a3, 0xd2a3, 0xd3a3, 0xd4a3, 0xd5a3, 0xd6a3, 0xd7a3, 0xd8a3, 0xd9a3, 0xdaa3, 0xdba3, 0xaca1, 0xdda3, 0xdea3, 0xdfa3, 0xe0a3, 0xe1a3, 0xe2a3, 0xe3a3, 0xe4a3, 0xe5a3, 0xe6a3, 0xe7a3, 0xe8a3, 0xe9a3, 0xeaa3, 0xeba3, 0xeca3, 0xeda3, 0xeea3, 0xefa3, 0xf0a3, 0xf1a3, 0xf2a3, 0xf3a3, 0xf4a3, 0xf5a3, 0xf6a3, 0xf7a3, 0xf8a3, 0xf9a3, 0xfaa3, 0xfba3, 0xfca3, 0xfda3, 0xa6a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcba1, 0xcca1, 0xfea1, 0xfea3, 0x001a, 0xcda1, 0xdca3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; /* Determines the size of a byte stream character from an Unicode character * Adds the size to the byte stream character size value * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_949_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_949_unicode_character_size_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream character size.", function ); return( -1 ); } if( unicode_character < 0x80 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x02c0 ) && ( unicode_character < 0x0480 ) ) { unicode_character -= 0x02c0; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x02c0[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fc0 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xac00 ) && ( unicode_character < 0xd7a4 ) ) { unicode_character -= 0xac00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xac00[ unicode_character ]; } else if( ( unicode_character >= 0xf900 ) && ( unicode_character < 0xfa0c ) ) { unicode_character -= 0xf900; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xf900[ unicode_character ]; } else if( ( unicode_character >= 0xff00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xff00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xff00[ unicode_character ]; } byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_character_size += 2; } else { *byte_stream_character_size += 1; } return( 1 ); } /* Copies an Unicode character from a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_949_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_949_copy_from_byte_stream"; uint8_t additional_character = 0; uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } byte_stream_character = byte_stream[ *byte_stream_index ]; if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) { *byte_stream_index += 1; additional_character = byte_stream[ *byte_stream_index ]; if( ( byte_stream_character >= 0x81 ) && ( byte_stream_character <= 0xa1 ) ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0x81: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8140[ additional_character ]; break; case 0x82: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8240[ additional_character ]; break; case 0x83: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8340[ additional_character ]; break; case 0x84: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8440[ additional_character ]; break; case 0x85: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8540[ additional_character ]; break; case 0x86: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8640[ additional_character ]; break; case 0x87: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8740[ additional_character ]; break; case 0x88: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8840[ additional_character ]; break; case 0x89: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8940[ additional_character ]; break; case 0x8a: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8a40[ additional_character ]; break; case 0x8b: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8b40[ additional_character ]; break; case 0x8c: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8c40[ additional_character ]; break; case 0x8d: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8d40[ additional_character ]; break; case 0x8e: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8e40[ additional_character ]; break; case 0x8f: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8f40[ additional_character ]; break; case 0x90: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9040[ additional_character ]; break; case 0x91: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9140[ additional_character ]; break; case 0x92: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9240[ additional_character ]; break; case 0x93: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9340[ additional_character ]; break; case 0x94: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9440[ additional_character ]; break; case 0x95: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9540[ additional_character ]; break; case 0x96: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9640[ additional_character ]; break; case 0x97: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9740[ additional_character ]; break; case 0x98: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9840[ additional_character ]; break; case 0x99: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9940[ additional_character ]; break; case 0x9a: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9a40[ additional_character ]; break; case 0x9b: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9b40[ additional_character ]; break; case 0x9c: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9c40[ additional_character ]; break; case 0x9d: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9d40[ additional_character ]; break; case 0x9e: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9e40[ additional_character ]; break; case 0x9f: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9f40[ additional_character ]; break; case 0xa0: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa040[ additional_character ]; break; case 0xa1: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa140[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa2 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xe8 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa240[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xa3 ) && ( byte_stream_character <= 0xa4 ) ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xa3: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa340[ additional_character ]; break; case 0xa4: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa440[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa5 ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa540[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa6 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xe8 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa640[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa7 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xf0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa740[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xa8 ) && ( byte_stream_character <= 0xa9 ) ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xa8: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa840[ additional_character ]; break; case 0xa9: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa940[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xaa ) && ( byte_stream_character <= 0xab ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xaa: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaa40[ additional_character ]; break; case 0xab: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xab40[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xac ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xc8 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xac40[ additional_character ]; } else if( ( additional_character >= 0xd0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xd0; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xacd0[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xad ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xad40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0xcdc5; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xae ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xae40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0xce2b; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xaf ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaf40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0xce99; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xb0 ) && ( byte_stream_character <= 0xc5 ) ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xb0: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb040[ additional_character ]; break; case 0xb1: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb140[ additional_character ]; break; case 0xb2: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb240[ additional_character ]; break; case 0xb3: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb340[ additional_character ]; break; case 0xb4: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb440[ additional_character ]; break; case 0xb5: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb540[ additional_character ]; break; case 0xb6: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb640[ additional_character ]; break; case 0xb7: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb740[ additional_character ]; break; case 0xb8: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb840[ additional_character ]; break; case 0xb9: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb940[ additional_character ]; break; case 0xba: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xba40[ additional_character ]; break; case 0xbb: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbb40[ additional_character ]; break; case 0xbc: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbc40[ additional_character ]; break; case 0xbd: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbd40[ additional_character ]; break; case 0xbe: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbe40[ additional_character ]; break; case 0xbf: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbf40[ additional_character ]; break; case 0xc0: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc040[ additional_character ]; break; case 0xc1: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc140[ additional_character ]; break; case 0xc2: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc240[ additional_character ]; break; case 0xc3: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc340[ additional_character ]; break; case 0xc4: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc440[ additional_character ]; break; case 0xc5: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc540[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xc6 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x58 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc640[ additional_character ]; } else if( additional_character >= 0xa0 ) { additional_character -= 0xa0; *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc6a0[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xc7 ) && ( byte_stream_character <= 0xc8 ) ) { if( additional_character >= 0xa0 ) { additional_character -= 0xa0; switch( byte_stream_character ) { case 0xc7: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc7a0[ additional_character ]; break; case 0xc8: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc8a0[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xca ) && ( byte_stream_character <= 0xfd ) ) { if( additional_character >= 0xa0 ) { additional_character -= 0xa0; switch( byte_stream_character ) { case 0xca: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcaa0[ additional_character ]; break; case 0xcb: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcba0[ additional_character ]; break; case 0xcc: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcca0[ additional_character ]; break; case 0xcd: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcda0[ additional_character ]; break; case 0xce: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcea0[ additional_character ]; break; case 0xcf: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcfa0[ additional_character ]; break; case 0xd0: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd0a0[ additional_character ]; break; case 0xd1: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd1a0[ additional_character ]; break; case 0xd2: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd2a0[ additional_character ]; break; case 0xd3: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd3a0[ additional_character ]; break; case 0xd4: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd4a0[ additional_character ]; break; case 0xd5: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd5a0[ additional_character ]; break; case 0xd6: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd6a0[ additional_character ]; break; case 0xd7: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd7a0[ additional_character ]; break; case 0xd8: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd8a0[ additional_character ]; break; case 0xd9: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd9a0[ additional_character ]; break; case 0xda: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdaa0[ additional_character ]; break; case 0xdb: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdba0[ additional_character ]; break; case 0xdc: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdca0[ additional_character ]; break; case 0xdd: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdda0[ additional_character ]; break; case 0xde: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdea0[ additional_character ]; break; case 0xdf: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdfa0[ additional_character ]; break; case 0xe0: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe0a0[ additional_character ]; break; case 0xe1: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe1a0[ additional_character ]; break; case 0xe2: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe2a0[ additional_character ]; break; case 0xe3: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe3a0[ additional_character ]; break; case 0xe4: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe4a0[ additional_character ]; break; case 0xe5: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe5a0[ additional_character ]; break; case 0xe6: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe6a0[ additional_character ]; break; case 0xe7: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe7a0[ additional_character ]; break; case 0xe8: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe8a0[ additional_character ]; break; case 0xe9: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe9a0[ additional_character ]; break; case 0xea: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeaa0[ additional_character ]; break; case 0xeb: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeba0[ additional_character ]; break; case 0xec: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeca0[ additional_character ]; break; case 0xed: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeda0[ additional_character ]; break; case 0xee: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeea0[ additional_character ]; break; case 0xef: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xefa0[ additional_character ]; break; case 0xf0: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf0a0[ additional_character ]; break; case 0xf1: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf1a0[ additional_character ]; break; case 0xf2: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf2a0[ additional_character ]; break; case 0xf3: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf3a0[ additional_character ]; break; case 0xf4: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf4a0[ additional_character ]; break; case 0xf5: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf5a0[ additional_character ]; break; case 0xf6: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf6a0[ additional_character ]; break; case 0xf7: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf7a0[ additional_character ]; break; case 0xf8: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf8a0[ additional_character ]; break; case 0xf9: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf9a0[ additional_character ]; break; case 0xfa: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfaa0[ additional_character ]; break; case 0xfb: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfba0[ additional_character ]; break; case 0xfc: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfca0[ additional_character ]; break; case 0xfd: *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfda0[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } *byte_stream_index += 1; return( 1 ); } /* Copies an Unicode character to a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_949_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_949_copy_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } if( unicode_character < 0x80 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x02c0 ) && ( unicode_character < 0x0480 ) ) { unicode_character -= 0x02c0; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x02c0[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fc0 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xac00 ) && ( unicode_character < 0xd7a4 ) ) { unicode_character -= 0xac00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xac00[ unicode_character ]; } else if( ( unicode_character >= 0xf900 ) && ( unicode_character < 0xfa0c ) ) { unicode_character -= 0xf900; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xf900[ unicode_character ]; } else if( ( unicode_character >= 0xff00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xff00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xff00[ unicode_character ]; } byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_index += 1; byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); } *byte_stream_index += 1; return( 1 ); } libewf-20140807/libuna/libuna_codepage_iso_8859_6.h0000664000175000017500000000247513443450072023663 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-6 codepage (Arabic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_6_H ) #define _LIBUNA_CODEPAGE_ISO_8859_6_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ 64 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_6_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1256.h0000664000175000017500000000322713443450072024312 0ustar00lordyestalordyesta00000000000000/* * Windows 1256 codepage (Arabic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1256_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1256_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00e0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x0618[ 64 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x2008[ 32 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1256_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_6.c0000664000175000017500000000475613443450072023662 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-6 codepage (Arabic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_6.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-6 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0xfffd, 0xfffd, 0xfffd, 0x00a4, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x060c, 0x00ad, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x061b, 0xfffd, 0xfffd, 0xfffd, 0x061f, 0xfffd, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; /* Unicode to ASCII character lookup table for ISO 8859-6 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ 64 ] = { 0x1a, 0x1a, 0x1a, 0xbb, 0x1a, 0x1a, 0x1a, 0xbf, 0x1a, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_codepage_windows_874.h0000664000175000017500000000265713443450072024245 0ustar00lordyestalordyesta00000000000000/* * Windows 874 codepage (Thai) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_874_H ) #define _LIBUNA_CODEPAGE_WINDOWS_874_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x2018[ 8 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_874_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1251.c0000664000175000017500000000672313443450072024304 0ustar00lordyestalordyesta00000000000000/* * Windows 1251 codepage (Cyrillic) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1251.h" /* Extended ASCII to Unicode character lookup table for Windows 1251 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f, 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0xfffd, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407, 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7, 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f }; /* Unicode to ASCII character lookup table for Windows 1251 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0x1a, 0x1a, 0x1a, 0xa4, 0x1a, 0xa6, 0xa7, 0x1a, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0x1a, 0xb0, 0xb1, 0x1a, 0x1a, 0x1a, 0xb5, 0xb6, 0xb7, 0x1a, 0x1a, 0x1a, 0xbb, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x0400[ 96 ] = { 0x1a, 0xa8, 0x80, 0x81, 0xaa, 0xbd, 0xb2, 0xaf, 0xa3, 0x8a, 0x8c, 0x8e, 0x8d, 0x1a, 0xa1, 0x8f, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x1a, 0xb8, 0x90, 0x83, 0xba, 0xbe, 0xb3, 0xbf, 0xbc, 0x9a, 0x9c, 0x9e, 0x9d, 0x1a, 0xa2, 0x9f }; const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_codepage_windows_1256.c0000664000175000017500000000713513443450072024307 0ustar00lordyestalordyesta00000000000000/* * Windows 1256 codepage (Arabic) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1256.h" /* Extended ASCII to Unicode character lookup table for Windows 1256 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0x067e, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, 0x06af, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x06a9, 0x2122, 0x0691, 0x203a, 0x0153, 0x200c, 0x200d, 0x06ba, 0x00a0, 0x060c, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x06be, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x061b, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x061f, 0x06c1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00d7, 0x0637, 0x0638, 0x0639, 0x063a, 0x0640, 0x0641, 0x0642, 0x0643, 0x00e0, 0x0644, 0x00e2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x0649, 0x064a, 0x00ee, 0x00ef, 0x064b, 0x064c, 0x064d, 0x064e, 0x00f4, 0x064f, 0x0650, 0x00f7, 0x0651, 0x00f9, 0x0652, 0x00fb, 0x00fc, 0x200e, 0x200f, 0x06d2 }; /* Unicode to ASCII character lookup table for Windows 1256 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0x1a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0x1a, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a }; const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00e0[ 32 ] = { 0xe0, 0x1a, 0xe2, 0x1a, 0x1a, 0x1a, 0x1a, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0x1a, 0x1a, 0xee, 0xef, 0x1a, 0x1a, 0x1a, 0x1a, 0xf4, 0x1a, 0x1a, 0xf7, 0x1a, 0xf9, 0x1a, 0xfb, 0xfc, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x0618[ 64 ] = { 0x1a, 0x1a, 0x1a, 0xba, 0x1a, 0x1a, 0x1a, 0xbf, 0x1a, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd8, 0xd9, 0xda, 0xdb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xdc, 0xdd, 0xde, 0xdf, 0xe1, 0xe3, 0xe4, 0xe5, 0xe6, 0xec, 0xed, 0xf0, 0xf1, 0xf2, 0xf3, 0xf5, 0xf6, 0xf8, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x2008[ 32 ] = { 0x1a, 0x1a, 0x1a, 0x1a, 0x9d, 0x9e, 0xfd, 0xfe, 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_base16_stream.h0000664000175000017500000000510113443450072022741 0ustar00lordyestalordyesta00000000000000/* * Base16 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_BASE16_STREAM_H ) #define _LIBUNA_BASE16_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif int libuna_base16_character_copy_from_base16_stream( uint32_t *base16_character, const uint8_t *base16_stream, uint32_t base16_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base16_stream_size_to_byte_stream( const uint8_t *base16_stream, size_t base16_stream_size, size_t *byte_stream_size, uint32_t base16_variant, uint8_t flags, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base16_stream_copy_to_byte_stream( const uint8_t *base16_stream, size_t base16_stream_size, uint8_t *byte_stream, size_t byte_stream_size, uint32_t base16_variant, uint8_t flags, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base16_stream_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, size_t *base16_stream_size, uint32_t base16_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base16_stream_copy_from_byte_stream( uint8_t *base16_stream, size_t base16_stream_size, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base16_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base16_stream_with_index_copy_from_byte_stream( uint8_t *base16_stream, size_t base16_stream_size, size_t *base16_stream_index, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base16_variant, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_BASE16_STREAM_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_2.h0000664000175000017500000000304113443450072023645 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-2 codepage (Central European) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_2_H ) #define _LIBUNA_CODEPAGE_ISO_8859_2_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ 72 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ 8 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_2_H ) */ libewf-20140807/libuna/Makefile.am0000664000175000017500000000566313443450072020653 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBUNA AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libuna.la libuna_la_SOURCES = \ libuna_base16_stream.c libuna_base16_stream.h \ libuna_base32_stream.c libuna_base32_stream.h \ libuna_base64_stream.c libuna_base64_stream.h \ libuna_byte_stream.c libuna_byte_stream.h \ libuna_codepage_iso_8859_2.c libuna_codepage_iso_8859_2.h \ libuna_codepage_iso_8859_3.c libuna_codepage_iso_8859_3.h \ libuna_codepage_iso_8859_4.c libuna_codepage_iso_8859_4.h \ libuna_codepage_iso_8859_5.c libuna_codepage_iso_8859_5.h \ libuna_codepage_iso_8859_6.c libuna_codepage_iso_8859_6.h \ libuna_codepage_iso_8859_7.c libuna_codepage_iso_8859_7.h \ libuna_codepage_iso_8859_8.c libuna_codepage_iso_8859_8.h \ libuna_codepage_iso_8859_9.c libuna_codepage_iso_8859_9.h \ libuna_codepage_iso_8859_10.c libuna_codepage_iso_8859_10.h \ libuna_codepage_iso_8859_13.c libuna_codepage_iso_8859_13.h \ libuna_codepage_iso_8859_14.c libuna_codepage_iso_8859_14.h \ libuna_codepage_iso_8859_15.c libuna_codepage_iso_8859_15.h \ libuna_codepage_iso_8859_16.c libuna_codepage_iso_8859_16.h \ libuna_codepage_koi8_r.c libuna_codepage_koi8_r.h \ libuna_codepage_koi8_u.c libuna_codepage_koi8_u.h \ libuna_codepage_windows_874.c libuna_codepage_windows_874.h \ libuna_codepage_windows_932.c libuna_codepage_windows_932.h \ libuna_codepage_windows_936.c libuna_codepage_windows_936.h \ libuna_codepage_windows_949.c libuna_codepage_windows_949.h \ libuna_codepage_windows_950.c libuna_codepage_windows_950.h \ libuna_codepage_windows_1250.c libuna_codepage_windows_1250.h \ libuna_codepage_windows_1251.c libuna_codepage_windows_1251.h \ libuna_codepage_windows_1252.c libuna_codepage_windows_1252.h \ libuna_codepage_windows_1253.c libuna_codepage_windows_1253.h \ libuna_codepage_windows_1254.c libuna_codepage_windows_1254.h \ libuna_codepage_windows_1255.c libuna_codepage_windows_1255.h \ libuna_codepage_windows_1256.c libuna_codepage_windows_1256.h \ libuna_codepage_windows_1257.c libuna_codepage_windows_1257.h \ libuna_codepage_windows_1258.c libuna_codepage_windows_1258.h \ libuna_definitions.h \ libuna_error.c libuna_error.h \ libuna_extern.h \ libuna_libcerror.h \ libuna_support.c libuna_support.h \ libuna_types.h \ libuna_unicode_character.c libuna_unicode_character.h \ libuna_unused.h \ libuna_url_stream.c libuna_url_stream.h \ libuna_utf16_stream.c libuna_utf16_stream.h \ libuna_utf16_string.c libuna_utf16_string.h \ libuna_utf32_stream.c libuna_utf32_stream.h \ libuna_utf32_string.c libuna_utf32_string.h \ libuna_utf7_stream.c libuna_utf7_stream.h \ libuna_utf8_stream.c libuna_utf8_stream.h \ libuna_utf8_string.c libuna_utf8_string.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libuna ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libuna_la_SOURCES) libewf-20140807/libuna/libuna_codepage_windows_1257.c0000664000175000017500000000770313443450072024311 0ustar00lordyestalordyesta00000000000000/* * Windows 1257 codepage (Baltic) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1257.h" /* Extended ASCII to Unicode character lookup table for Windows 1257 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0xfffd, 0x201a, 0xfffd, 0x201e, 0x2026, 0x2020, 0x2021, 0xfffd, 0x2030, 0xfffd, 0x2039, 0xfffd, 0x00a8, 0x02c7, 0x00b8, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0xfffd, 0x2122, 0xfffd, 0x203a, 0xfffd, 0x00af, 0x02db, 0xfffd, 0x00a0, 0xfffd, 0x00a2, 0x00a3, 0x00a4, 0xfffd, 0x00a6, 0x00a7, 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x02d9 }; /* Unicode to ASCII character lookup table for Windows 1257 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ 224 ] = { 0xa0, 0x1a, 0xa2, 0xa3, 0xa4, 0x1a, 0xa6, 0xa7, 0x8d, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0x9d, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0x8f, 0xb9, 0x1a, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc4, 0xc5, 0xaf, 0x1a, 0x1a, 0xc9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd3, 0x1a, 0xd5, 0xd6, 0xd7, 0xa8, 0x1a, 0x1a, 0x1a, 0xdc, 0x1a, 0x1a, 0xdf, 0x1a, 0x1a, 0x1a, 0x1a, 0xe4, 0xe5, 0xbf, 0x1a, 0x1a, 0xe9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf3, 0x1a, 0xf5, 0xf6, 0xf7, 0xb8, 0x1a, 0x1a, 0x1a, 0xfc, 0x1a, 0x1a, 0x1a, 0xc2, 0xe2, 0x1a, 0x1a, 0xc0, 0xe0, 0xc3, 0xe3, 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0x1a, 0x1a, 0x1a, 0x1a, 0xc7, 0xe7, 0x1a, 0x1a, 0xcb, 0xeb, 0xc6, 0xe6, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xcc, 0xec, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xce, 0xee, 0x1a, 0x1a, 0xc1, 0xe1, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xcd, 0xed, 0x1a, 0x1a, 0x1a, 0xcf, 0xef, 0x1a, 0x1a, 0x1a, 0x1a, 0xd9, 0xf9, 0xd1, 0xf1, 0xd2, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd4, 0xf4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xaa, 0xba, 0x1a, 0x1a, 0xda, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0xd0, 0xf0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xdb, 0xfb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd8, 0xf8, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xca, 0xea, 0xdd, 0xfd, 0xde, 0xfe, 0x1a }; const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_codepage_windows_1254.h0000664000175000017500000000322513443450072024306 0ustar00lordyestalordyesta00000000000000/* * Windows 1254 codepage (Turkish) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1254_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1254_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xd0[ 16 ]; LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xf0[ 16 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ 48 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1254_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1255.c0000664000175000017500000000655013443450072024306 0ustar00lordyestalordyesta00000000000000/* * Windows 1255 codepage (Hebrew) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1255.h" /* Extended ASCII to Unicode character lookup table for Windows 1255 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0xfffd, 0x2039, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0xfffd, 0x203a, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20aa, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, 0x05b8, 0x05b9, 0xfffd, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0xfffd, 0xfffd, 0x200e, 0x200f, 0xfffd }; /* Unicode to ASCII character lookup table for Windows 1255 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0xa1, 0xa2, 0xa3, 0x1a, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0x1a, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf }; const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05b0[ 24 ] = { 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0x1a, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05d0[ 40 ] = { 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_unused.h0000664000175000017500000000256213443450072021620 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2008-2019, 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( _LIBUNA_UNUSED_H ) #define _LIBUNA_UNUSED_H #include #if !defined( LIBUNA_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBUNA_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBUNA_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBUNA_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBUNA_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBUNA_UNUSED_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1253.h0000664000175000017500000000304713443450072024307 0ustar00lordyestalordyesta00000000000000/* * Windows 1253 codepage (Greek) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1253_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1253_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x0380[ 80 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1253_H ) */ libewf-20140807/libuna/libuna_unicode_character.h0000664000175000017500000001342613443450072023760 0ustar00lordyestalordyesta00000000000000/* * Unicode character functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UNICODE_CHARACTER_H ) #define _LIBUNA_UNICODE_CHARACTER_H #include #include #include "libuna_definitions.h" #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, int codepage, size_t *byte_stream_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_size_to_utf7_stream( libuna_unicode_character_t unicode_character, size_t *utf7_stream_character_size, uint32_t *utf7_stream_base64_data, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_utf7_stream( libuna_unicode_character_t *unicode_character, const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf7_stream_index, uint32_t *utf7_stream_base64_data, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_utf7_stream( libuna_unicode_character_t unicode_character, uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf7_stream_index, uint32_t *utf7_stream_base64_data, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_size_to_utf8( libuna_unicode_character_t unicode_character, size_t *utf8_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_utf8( libuna_unicode_character_t *unicode_character, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_utf8( libuna_unicode_character_t unicode_character, libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_size_to_utf16( libuna_unicode_character_t unicode_character, size_t *utf16_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_utf16( libuna_unicode_character_t *unicode_character, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_utf16( libuna_unicode_character_t unicode_character, libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_utf16_stream( libuna_unicode_character_t *unicode_character, const uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_stream_index, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_utf16_stream( libuna_unicode_character_t unicode_character, uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_stream_index, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_size_to_utf32( libuna_unicode_character_t unicode_character, size_t *utf32_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_utf32( libuna_unicode_character_t *unicode_character, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_utf32( libuna_unicode_character_t unicode_character, libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_from_utf32_stream( libuna_unicode_character_t *unicode_character, const uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_stream_index, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_unicode_character_copy_to_utf32_stream( libuna_unicode_character_t unicode_character, uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_stream_index, int byte_order, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UNICODE_CHARACTER_H ) */ libewf-20140807/libuna/libuna_byte_stream.c0000664000175000017500000003617713443450072022637 0ustar00lordyestalordyesta00000000000000/* * Byte stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_byte_stream.h" #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" /* Determines the size of a byte stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_byte_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, int codepage, size_t *byte_stream_size, libcerror_error_t **error ) { static char *function = "libuna_byte_stream_size_from_utf8"; size_t utf8_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } *byte_stream_size = 0; while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many byte stream character bytes are required */ if( libuna_unicode_character_size_to_byte_stream( unicode_character, codepage, byte_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to unable to determine size of Unicode character in byte stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies a byte stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_byte_stream_copy_from_utf8( uint8_t *byte_stream, size_t byte_stream_size, int codepage, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_byte_stream_copy_from_utf8"; size_t byte_stream_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 string.", function ); return( -1 ); } /* Convert the Unicode character into a byte stream */ if( libuna_unicode_character_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to byte stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of a byte stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_byte_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, int codepage, size_t *byte_stream_size, libcerror_error_t **error ) { static char *function = "libuna_byte_stream_size_from_utf16"; size_t utf16_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } *byte_stream_size = 0; while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many byte stream character bytes are required */ if( libuna_unicode_character_size_to_byte_stream( unicode_character, codepage, byte_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to unable to determine size of Unicode character in byte stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies a byte stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_byte_stream_copy_from_utf16( uint8_t *byte_stream, size_t byte_stream_size, int codepage, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_byte_stream_copy_from_utf16"; size_t byte_stream_index = 0; size_t utf16_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 string.", function ); return( -1 ); } /* Convert the Unicode character into a byte stream */ if( libuna_unicode_character_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to byte stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of a byte stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_byte_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, int codepage, size_t *byte_stream_size, libcerror_error_t **error ) { static char *function = "libuna_byte_stream_size_from_utf32"; size_t utf32_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } *byte_stream_size = 0; while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many byte stream character bytes are required */ if( libuna_unicode_character_size_to_byte_stream( unicode_character, codepage, byte_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to unable to determine size of Unicode character in byte stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies a byte stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_byte_stream_copy_from_utf32( uint8_t *byte_stream, size_t byte_stream_size, int codepage, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_byte_stream_copy_from_utf32"; size_t byte_stream_index = 0; size_t utf32_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 string.", function ); return( -1 ); } /* Convert the Unicode character into a byte stream */ if( libuna_unicode_character_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to byte stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } libewf-20140807/libuna/libuna_codepage_iso_8859_3.h0000664000175000017500000000335713443450072023660 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-3 codepage (Latin 3) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_3_H ) #define _LIBUNA_CODEPAGE_ISO_8859_3_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ 16 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ 8 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_3_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_15.h0000664000175000017500000000250413443450072023734 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-15 codepage (Latin 9) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_15_H ) #define _LIBUNA_CODEPAGE_ISO_8859_15_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ 32 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_15_H ) */ libewf-20140807/libuna/libuna_utf32_string.h0000664000175000017500000002116113443450072022642 0ustar00lordyestalordyesta00000000000000/* * UTF-32 string functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF32_STRING_H ) #define _LIBUNA_UTF32_STRING_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf32_string_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, int codepage, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_byte_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_byte_stream is implemented by * libuna_byte_stream_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_byte_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_compare_with_byte_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_size_from_utf7_stream( const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_utf7_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_utf7_stream is implemented by * libuna_utf7_stream_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_utf7_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_compare_with_utf7_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_utf8( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_utf8( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_compare_with_utf8 is implemented by * libuna_utf8_string_compare_with_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_size_from_utf8_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_utf8_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_utf8_stream is implemented by * libuna_utf8_stream_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_utf8_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_compare_with_utf8_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_utf16( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_utf16( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_compare_with_utf16 is implemented by * libuna_utf16_string_compare_with_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_size_from_utf16_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_utf16_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_utf16_stream is implemented by * libuna_utf16_stream_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_utf16_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_compare_with_utf16_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_size_from_utf32_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, size_t *utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_copy_from_utf32_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); /* The functionality for libuna_utf32_string_copy_to_utf32_stream is implemented by * libuna_utf32_stream_copy_from_utf32 */ LIBUNA_EXTERN \ int libuna_utf32_string_with_index_copy_from_utf32_stream( libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_string_compare_with_utf32_stream( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF32_STRING_H ) */ libewf-20140807/libuna/libuna_codepage_koi8_r.c0000664000175000017500000000577613443450072023344 0ustar00lordyestalordyesta00000000000000/* * KOI8-R codepage (Russian Cyrillic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_koi8_r.h" /* Extended ASCII to Unicode character lookup table for KOI8-R codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9, 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }; /* Unicode to ASCII character lookup table for KOI8-R codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ 64 ] = { 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1 }; const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x2550[ 32 ] = { 0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_codepage_windows_936.h0000664000175000017500000000356313443450072024241 0ustar00lordyestalordyesta00000000000000/* * Windows 936 codepage (Chinese Simplified) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_936_H ) #define _LIBUNA_CODEPAGE_WINDOWS_936_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_codepage_windows_936_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_936_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_936_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_936_H ) */ libewf-20140807/libuna/libuna_base64_stream.h0000664000175000017500000000714113443450072022752 0ustar00lordyestalordyesta00000000000000/* * Base64 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_BASE64_STREAM_H ) #define _LIBUNA_BASE64_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif int libuna_base64_character_copy_to_sixtet( uint32_t base64_character, uint8_t *base64_sixtet, uint32_t base64_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_triplet_copy_from_base64_stream( uint32_t *base64_triplet, const uint8_t *base64_stream, size_t base64_stream_size, size_t *base64_stream_index, uint8_t *padding_size, uint32_t base64_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_triplet_copy_to_base64_stream( uint32_t base64_triplet, uint8_t *base64_stream, size_t base64_stream_size, size_t *base64_stream_index, uint8_t padding_size, uint32_t base64_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_triplet_copy_from_byte_stream( uint32_t *base64_triplet, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t *padding_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_triplet_copy_to_byte_stream( uint32_t base64_triplet, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t padding_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_stream_size_to_byte_stream( const uint8_t *base64_stream, size_t base64_stream_size, size_t *byte_stream_size, uint32_t base64_variant, uint8_t flags, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_stream_copy_to_byte_stream( const uint8_t *base64_stream, size_t base64_stream_size, uint8_t *byte_stream, size_t byte_stream_size, uint32_t base64_variant, uint8_t flags, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_stream_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, size_t *base64_stream_size, uint32_t base64_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_stream_copy_from_byte_stream( uint8_t *base64_stream, size_t base64_stream_size, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base64_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base64_stream_with_index_copy_from_byte_stream( uint8_t *base64_stream, size_t base64_stream_size, size_t *base64_stream_index, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base64_variant, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_BASE64_STREAM_H ) */ libewf-20140807/libuna/libuna_codepage_windows_950.c0000664000175000017500000127674613443450072024250 0ustar00lordyestalordyesta00000000000000/* * Windows 950 codepage (Traditional Chinese) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_950.h" #include "libuna_libcerror.h" #include "libuna_types.h" /* Extended ASCII to Unicode character lookup table for Windows 950 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa140[ 63 ] = { 0x3000, 0xff0c, 0x3001, 0x3002, 0xff0e, 0x2027, 0xff1b, 0xff1a, 0xff1f, 0xff01, 0xfe30, 0x2026, 0x2025, 0xfe50, 0xfe51, 0xfe52, 0x00b7, 0xfe54, 0xfe55, 0xfe56, 0xfe57, 0xff5c, 0x2013, 0xfe31, 0x2014, 0xfe33, 0x2574, 0xfe34, 0xfe4f, 0xff08, 0xff09, 0xfe35, 0xfe36, 0xff5b, 0xff5d, 0xfe37, 0xfe38, 0x3014, 0x3015, 0xfe39, 0xfe3a, 0x3010, 0x3011, 0xfe3b, 0xfe3c, 0x300a, 0x300b, 0xfe3d, 0xfe3e, 0x3008, 0x3009, 0xfe3f, 0xfe40, 0x300c, 0x300d, 0xfe41, 0xfe42, 0x300e, 0x300f, 0xfe43, 0xfe44, 0xfe59, 0xfe5a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa1a1[ 94 ] = { 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0x2018, 0x2019, 0x201c, 0x201d, 0x301d, 0x301e, 0x2035, 0x2032, 0xff03, 0xff06, 0xff0a, 0x203b, 0x00a7, 0x3003, 0x25cb, 0x25cf, 0x25b3, 0x25b2, 0x25ce, 0x2606, 0x2605, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25bd, 0x25bc, 0x32a3, 0x2105, 0x00af, 0xffe3, 0xff3f, 0x02cd, 0xfe49, 0xfe4a, 0xfe4d, 0xfe4e, 0xfe4b, 0xfe4c, 0xfe5f, 0xfe60, 0xfe61, 0xff0b, 0xff0d, 0x00d7, 0x00f7, 0x00b1, 0x221a, 0xff1c, 0xff1e, 0xff1d, 0x2266, 0x2267, 0x2260, 0x221e, 0x2252, 0x2261, 0xfe62, 0xfe63, 0xfe64, 0xfe65, 0xfe66, 0xff5e, 0x2229, 0x222a, 0x22a5, 0x2220, 0x221f, 0x22bf, 0x33d2, 0x33d1, 0x222b, 0x222e, 0x2235, 0x2234, 0x2640, 0x2642, 0x2295, 0x2299, 0x2191, 0x2193, 0x2190, 0x2192, 0x2196, 0x2197, 0x2199, 0x2198, 0x2225, 0x2223, 0xff0f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa240[ 63 ] = { 0xff3c, 0x2215, 0xfe68, 0xff04, 0xffe5, 0x3012, 0xffe0, 0xffe1, 0xff05, 0xff20, 0x2103, 0x2109, 0xfe69, 0xfe6a, 0xfe6b, 0x33d5, 0x339c, 0x339d, 0x339e, 0x33ce, 0x33a1, 0x338e, 0x338f, 0x33c4, 0x00b0, 0x5159, 0x515b, 0x515e, 0x515d, 0x5161, 0x5163, 0x55e7, 0x74e9, 0x7cce, 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0x2588, 0x258f, 0x258e, 0x258d, 0x258c, 0x258b, 0x258a, 0x2589, 0x253c, 0x2534, 0x252c, 0x2524, 0x251c, 0x2594, 0x2500, 0x2502, 0x2595, 0x250c, 0x2510, 0x2514, 0x2518, 0x256d }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa2a1[ 94 ] = { 0x256e, 0x2570, 0x256f, 0x2550, 0x255e, 0x256a, 0x2561, 0x25e2, 0x25e3, 0x25e5, 0x25e4, 0x2571, 0x2572, 0x2573, 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, 0xff18, 0xff19, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027, 0x3028, 0x3029, 0x5341, 0x5344, 0x5345, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa340[ 63 ] = { 0xff57, 0xff58, 0xff59, 0xff5a, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x3105, 0x3106, 0x3107, 0x3108, 0x3109, 0x310a, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa3a1[ 31 ] = { 0x3110, 0x3111, 0x3112, 0x3113, 0x3114, 0x3115, 0x3116, 0x3117, 0x3118, 0x3119, 0x311a, 0x311b, 0x311c, 0x311d, 0x311e, 0x311f, 0x3120, 0x3121, 0x3122, 0x3123, 0x3124, 0x3125, 0x3126, 0x3127, 0x3128, 0x3129, 0x02d9, 0x02c9, 0x02ca, 0x02c7, 0x02cb }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa440[ 63 ] = { 0x4e00, 0x4e59, 0x4e01, 0x4e03, 0x4e43, 0x4e5d, 0x4e86, 0x4e8c, 0x4eba, 0x513f, 0x5165, 0x516b, 0x51e0, 0x5200, 0x5201, 0x529b, 0x5315, 0x5341, 0x535c, 0x53c8, 0x4e09, 0x4e0b, 0x4e08, 0x4e0a, 0x4e2b, 0x4e38, 0x51e1, 0x4e45, 0x4e48, 0x4e5f, 0x4e5e, 0x4e8e, 0x4ea1, 0x5140, 0x5203, 0x52fa, 0x5343, 0x53c9, 0x53e3, 0x571f, 0x58eb, 0x5915, 0x5927, 0x5973, 0x5b50, 0x5b51, 0x5b53, 0x5bf8, 0x5c0f, 0x5c22, 0x5c38, 0x5c71, 0x5ddd, 0x5de5, 0x5df1, 0x5df2, 0x5df3, 0x5dfe, 0x5e72, 0x5efe, 0x5f0b, 0x5f13, 0x624d }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa4a1[ 94 ] = { 0x4e11, 0x4e10, 0x4e0d, 0x4e2d, 0x4e30, 0x4e39, 0x4e4b, 0x5c39, 0x4e88, 0x4e91, 0x4e95, 0x4e92, 0x4e94, 0x4ea2, 0x4ec1, 0x4ec0, 0x4ec3, 0x4ec6, 0x4ec7, 0x4ecd, 0x4eca, 0x4ecb, 0x4ec4, 0x5143, 0x5141, 0x5167, 0x516d, 0x516e, 0x516c, 0x5197, 0x51f6, 0x5206, 0x5207, 0x5208, 0x52fb, 0x52fe, 0x52ff, 0x5316, 0x5339, 0x5348, 0x5347, 0x5345, 0x535e, 0x5384, 0x53cb, 0x53ca, 0x53cd, 0x58ec, 0x5929, 0x592b, 0x592a, 0x592d, 0x5b54, 0x5c11, 0x5c24, 0x5c3a, 0x5c6f, 0x5df4, 0x5e7b, 0x5eff, 0x5f14, 0x5f15, 0x5fc3, 0x6208, 0x6236, 0x624b, 0x624e, 0x652f, 0x6587, 0x6597, 0x65a4, 0x65b9, 0x65e5, 0x66f0, 0x6708, 0x6728, 0x6b20, 0x6b62, 0x6b79, 0x6bcb, 0x6bd4, 0x6bdb, 0x6c0f, 0x6c34, 0x706b, 0x722a, 0x7236, 0x723b, 0x7247, 0x7259, 0x725b, 0x72ac, 0x738b, 0x4e19 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa540[ 63 ] = { 0x4e16, 0x4e15, 0x4e14, 0x4e18, 0x4e3b, 0x4e4d, 0x4e4f, 0x4e4e, 0x4ee5, 0x4ed8, 0x4ed4, 0x4ed5, 0x4ed6, 0x4ed7, 0x4ee3, 0x4ee4, 0x4ed9, 0x4ede, 0x5145, 0x5144, 0x5189, 0x518a, 0x51ac, 0x51f9, 0x51fa, 0x51f8, 0x520a, 0x52a0, 0x529f, 0x5305, 0x5306, 0x5317, 0x531d, 0x4edf, 0x534a, 0x5349, 0x5361, 0x5360, 0x536f, 0x536e, 0x53bb, 0x53ef, 0x53e4, 0x53f3, 0x53ec, 0x53ee, 0x53e9, 0x53e8, 0x53fc, 0x53f8, 0x53f5, 0x53eb, 0x53e6, 0x53ea, 0x53f2, 0x53f1, 0x53f0, 0x53e5, 0x53ed, 0x53fb, 0x56db, 0x56da, 0x5916 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa5a1[ 94 ] = { 0x592e, 0x5931, 0x5974, 0x5976, 0x5b55, 0x5b83, 0x5c3c, 0x5de8, 0x5de7, 0x5de6, 0x5e02, 0x5e03, 0x5e73, 0x5e7c, 0x5f01, 0x5f18, 0x5f17, 0x5fc5, 0x620a, 0x6253, 0x6254, 0x6252, 0x6251, 0x65a5, 0x65e6, 0x672e, 0x672c, 0x672a, 0x672b, 0x672d, 0x6b63, 0x6bcd, 0x6c11, 0x6c10, 0x6c38, 0x6c41, 0x6c40, 0x6c3e, 0x72af, 0x7384, 0x7389, 0x74dc, 0x74e6, 0x7518, 0x751f, 0x7528, 0x7529, 0x7530, 0x7531, 0x7532, 0x7533, 0x758b, 0x767d, 0x76ae, 0x76bf, 0x76ee, 0x77db, 0x77e2, 0x77f3, 0x793a, 0x79be, 0x7a74, 0x7acb, 0x4e1e, 0x4e1f, 0x4e52, 0x4e53, 0x4e69, 0x4e99, 0x4ea4, 0x4ea6, 0x4ea5, 0x4eff, 0x4f09, 0x4f19, 0x4f0a, 0x4f15, 0x4f0d, 0x4f10, 0x4f11, 0x4f0f, 0x4ef2, 0x4ef6, 0x4efb, 0x4ef0, 0x4ef3, 0x4efd, 0x4f01, 0x4f0b, 0x5149, 0x5147, 0x5146, 0x5148, 0x5168 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa640[ 63 ] = { 0x5171, 0x518d, 0x51b0, 0x5217, 0x5211, 0x5212, 0x520e, 0x5216, 0x52a3, 0x5308, 0x5321, 0x5320, 0x5370, 0x5371, 0x5409, 0x540f, 0x540c, 0x540a, 0x5410, 0x5401, 0x540b, 0x5404, 0x5411, 0x540d, 0x5408, 0x5403, 0x540e, 0x5406, 0x5412, 0x56e0, 0x56de, 0x56dd, 0x5733, 0x5730, 0x5728, 0x572d, 0x572c, 0x572f, 0x5729, 0x5919, 0x591a, 0x5937, 0x5938, 0x5984, 0x5978, 0x5983, 0x597d, 0x5979, 0x5982, 0x5981, 0x5b57, 0x5b58, 0x5b87, 0x5b88, 0x5b85, 0x5b89, 0x5bfa, 0x5c16, 0x5c79, 0x5dde, 0x5e06, 0x5e76, 0x5e74 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa6a1[ 94 ] = { 0x5f0f, 0x5f1b, 0x5fd9, 0x5fd6, 0x620e, 0x620c, 0x620d, 0x6210, 0x6263, 0x625b, 0x6258, 0x6536, 0x65e9, 0x65e8, 0x65ec, 0x65ed, 0x66f2, 0x66f3, 0x6709, 0x673d, 0x6734, 0x6731, 0x6735, 0x6b21, 0x6b64, 0x6b7b, 0x6c16, 0x6c5d, 0x6c57, 0x6c59, 0x6c5f, 0x6c60, 0x6c50, 0x6c55, 0x6c61, 0x6c5b, 0x6c4d, 0x6c4e, 0x7070, 0x725f, 0x725d, 0x767e, 0x7af9, 0x7c73, 0x7cf8, 0x7f36, 0x7f8a, 0x7fbd, 0x8001, 0x8003, 0x800c, 0x8012, 0x8033, 0x807f, 0x8089, 0x808b, 0x808c, 0x81e3, 0x81ea, 0x81f3, 0x81fc, 0x820c, 0x821b, 0x821f, 0x826e, 0x8272, 0x827e, 0x866b, 0x8840, 0x884c, 0x8863, 0x897f, 0x9621, 0x4e32, 0x4ea8, 0x4f4d, 0x4f4f, 0x4f47, 0x4f57, 0x4f5e, 0x4f34, 0x4f5b, 0x4f55, 0x4f30, 0x4f50, 0x4f51, 0x4f3d, 0x4f3a, 0x4f38, 0x4f43, 0x4f54, 0x4f3c, 0x4f46, 0x4f63 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa740[ 63 ] = { 0x4f5c, 0x4f60, 0x4f2f, 0x4f4e, 0x4f36, 0x4f59, 0x4f5d, 0x4f48, 0x4f5a, 0x514c, 0x514b, 0x514d, 0x5175, 0x51b6, 0x51b7, 0x5225, 0x5224, 0x5229, 0x522a, 0x5228, 0x52ab, 0x52a9, 0x52aa, 0x52ac, 0x5323, 0x5373, 0x5375, 0x541d, 0x542d, 0x541e, 0x543e, 0x5426, 0x544e, 0x5427, 0x5446, 0x5443, 0x5433, 0x5448, 0x5442, 0x541b, 0x5429, 0x544a, 0x5439, 0x543b, 0x5438, 0x542e, 0x5435, 0x5436, 0x5420, 0x543c, 0x5440, 0x5431, 0x542b, 0x541f, 0x542c, 0x56ea, 0x56f0, 0x56e4, 0x56eb, 0x574a, 0x5751, 0x5740, 0x574d }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa7a1[ 94 ] = { 0x5747, 0x574e, 0x573e, 0x5750, 0x574f, 0x573b, 0x58ef, 0x593e, 0x599d, 0x5992, 0x59a8, 0x599e, 0x59a3, 0x5999, 0x5996, 0x598d, 0x59a4, 0x5993, 0x598a, 0x59a5, 0x5b5d, 0x5b5c, 0x5b5a, 0x5b5b, 0x5b8c, 0x5b8b, 0x5b8f, 0x5c2c, 0x5c40, 0x5c41, 0x5c3f, 0x5c3e, 0x5c90, 0x5c91, 0x5c94, 0x5c8c, 0x5deb, 0x5e0c, 0x5e8f, 0x5e87, 0x5e8a, 0x5ef7, 0x5f04, 0x5f1f, 0x5f64, 0x5f62, 0x5f77, 0x5f79, 0x5fd8, 0x5fcc, 0x5fd7, 0x5fcd, 0x5ff1, 0x5feb, 0x5ff8, 0x5fea, 0x6212, 0x6211, 0x6284, 0x6297, 0x6296, 0x6280, 0x6276, 0x6289, 0x626d, 0x628a, 0x627c, 0x627e, 0x6279, 0x6273, 0x6292, 0x626f, 0x6298, 0x626e, 0x6295, 0x6293, 0x6291, 0x6286, 0x6539, 0x653b, 0x6538, 0x65f1, 0x66f4, 0x675f, 0x674e, 0x674f, 0x6750, 0x6751, 0x675c, 0x6756, 0x675e, 0x6749, 0x6746, 0x6760 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa840[ 63 ] = { 0x6753, 0x6757, 0x6b65, 0x6bcf, 0x6c42, 0x6c5e, 0x6c99, 0x6c81, 0x6c88, 0x6c89, 0x6c85, 0x6c9b, 0x6c6a, 0x6c7a, 0x6c90, 0x6c70, 0x6c8c, 0x6c68, 0x6c96, 0x6c92, 0x6c7d, 0x6c83, 0x6c72, 0x6c7e, 0x6c74, 0x6c86, 0x6c76, 0x6c8d, 0x6c94, 0x6c98, 0x6c82, 0x7076, 0x707c, 0x707d, 0x7078, 0x7262, 0x7261, 0x7260, 0x72c4, 0x72c2, 0x7396, 0x752c, 0x752b, 0x7537, 0x7538, 0x7682, 0x76ef, 0x77e3, 0x79c1, 0x79c0, 0x79bf, 0x7a76, 0x7cfb, 0x7f55, 0x8096, 0x8093, 0x809d, 0x8098, 0x809b, 0x809a, 0x80b2, 0x826f, 0x8292 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa8a1[ 94 ] = { 0x828b, 0x828d, 0x898b, 0x89d2, 0x8a00, 0x8c37, 0x8c46, 0x8c55, 0x8c9d, 0x8d64, 0x8d70, 0x8db3, 0x8eab, 0x8eca, 0x8f9b, 0x8fb0, 0x8fc2, 0x8fc6, 0x8fc5, 0x8fc4, 0x5de1, 0x9091, 0x90a2, 0x90aa, 0x90a6, 0x90a3, 0x9149, 0x91c6, 0x91cc, 0x9632, 0x962e, 0x9631, 0x962a, 0x962c, 0x4e26, 0x4e56, 0x4e73, 0x4e8b, 0x4e9b, 0x4e9e, 0x4eab, 0x4eac, 0x4f6f, 0x4f9d, 0x4f8d, 0x4f73, 0x4f7f, 0x4f6c, 0x4f9b, 0x4f8b, 0x4f86, 0x4f83, 0x4f70, 0x4f75, 0x4f88, 0x4f69, 0x4f7b, 0x4f96, 0x4f7e, 0x4f8f, 0x4f91, 0x4f7a, 0x5154, 0x5152, 0x5155, 0x5169, 0x5177, 0x5176, 0x5178, 0x51bd, 0x51fd, 0x523b, 0x5238, 0x5237, 0x523a, 0x5230, 0x522e, 0x5236, 0x5241, 0x52be, 0x52bb, 0x5352, 0x5354, 0x5353, 0x5351, 0x5366, 0x5377, 0x5378, 0x5379, 0x53d6, 0x53d4, 0x53d7, 0x5473, 0x5475 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa940[ 63 ] = { 0x5496, 0x5478, 0x5495, 0x5480, 0x547b, 0x5477, 0x5484, 0x5492, 0x5486, 0x547c, 0x5490, 0x5471, 0x5476, 0x548c, 0x549a, 0x5462, 0x5468, 0x548b, 0x547d, 0x548e, 0x56fa, 0x5783, 0x5777, 0x576a, 0x5769, 0x5761, 0x5766, 0x5764, 0x577c, 0x591c, 0x5949, 0x5947, 0x5948, 0x5944, 0x5954, 0x59be, 0x59bb, 0x59d4, 0x59b9, 0x59ae, 0x59d1, 0x59c6, 0x59d0, 0x59cd, 0x59cb, 0x59d3, 0x59ca, 0x59af, 0x59b3, 0x59d2, 0x59c5, 0x5b5f, 0x5b64, 0x5b63, 0x5b97, 0x5b9a, 0x5b98, 0x5b9c, 0x5b99, 0x5b9b, 0x5c1a, 0x5c48, 0x5c45 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa9a1[ 94 ] = { 0x5c46, 0x5cb7, 0x5ca1, 0x5cb8, 0x5ca9, 0x5cab, 0x5cb1, 0x5cb3, 0x5e18, 0x5e1a, 0x5e16, 0x5e15, 0x5e1b, 0x5e11, 0x5e78, 0x5e9a, 0x5e97, 0x5e9c, 0x5e95, 0x5e96, 0x5ef6, 0x5f26, 0x5f27, 0x5f29, 0x5f80, 0x5f81, 0x5f7f, 0x5f7c, 0x5fdd, 0x5fe0, 0x5ffd, 0x5ff5, 0x5fff, 0x600f, 0x6014, 0x602f, 0x6035, 0x6016, 0x602a, 0x6015, 0x6021, 0x6027, 0x6029, 0x602b, 0x601b, 0x6216, 0x6215, 0x623f, 0x623e, 0x6240, 0x627f, 0x62c9, 0x62cc, 0x62c4, 0x62bf, 0x62c2, 0x62b9, 0x62d2, 0x62db, 0x62ab, 0x62d3, 0x62d4, 0x62cb, 0x62c8, 0x62a8, 0x62bd, 0x62bc, 0x62d0, 0x62d9, 0x62c7, 0x62cd, 0x62b5, 0x62da, 0x62b1, 0x62d8, 0x62d6, 0x62d7, 0x62c6, 0x62ac, 0x62ce, 0x653e, 0x65a7, 0x65bc, 0x65fa, 0x6614, 0x6613, 0x660c, 0x6606, 0x6602, 0x660e, 0x6600, 0x660f, 0x6615, 0x660a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaa40[ 63 ] = { 0x6607, 0x670d, 0x670b, 0x676d, 0x678b, 0x6795, 0x6771, 0x679c, 0x6773, 0x6777, 0x6787, 0x679d, 0x6797, 0x676f, 0x6770, 0x677f, 0x6789, 0x677e, 0x6790, 0x6775, 0x679a, 0x6793, 0x677c, 0x676a, 0x6772, 0x6b23, 0x6b66, 0x6b67, 0x6b7f, 0x6c13, 0x6c1b, 0x6ce3, 0x6ce8, 0x6cf3, 0x6cb1, 0x6ccc, 0x6ce5, 0x6cb3, 0x6cbd, 0x6cbe, 0x6cbc, 0x6ce2, 0x6cab, 0x6cd5, 0x6cd3, 0x6cb8, 0x6cc4, 0x6cb9, 0x6cc1, 0x6cae, 0x6cd7, 0x6cc5, 0x6cf1, 0x6cbf, 0x6cbb, 0x6ce1, 0x6cdb, 0x6cca, 0x6cac, 0x6cef, 0x6cdc, 0x6cd6, 0x6ce0 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaaa1[ 94 ] = { 0x7095, 0x708e, 0x7092, 0x708a, 0x7099, 0x722c, 0x722d, 0x7238, 0x7248, 0x7267, 0x7269, 0x72c0, 0x72ce, 0x72d9, 0x72d7, 0x72d0, 0x73a9, 0x73a8, 0x739f, 0x73ab, 0x73a5, 0x753d, 0x759d, 0x7599, 0x759a, 0x7684, 0x76c2, 0x76f2, 0x76f4, 0x77e5, 0x77fd, 0x793e, 0x7940, 0x7941, 0x79c9, 0x79c8, 0x7a7a, 0x7a79, 0x7afa, 0x7cfe, 0x7f54, 0x7f8c, 0x7f8b, 0x8005, 0x80ba, 0x80a5, 0x80a2, 0x80b1, 0x80a1, 0x80ab, 0x80a9, 0x80b4, 0x80aa, 0x80af, 0x81e5, 0x81fe, 0x820d, 0x82b3, 0x829d, 0x8299, 0x82ad, 0x82bd, 0x829f, 0x82b9, 0x82b1, 0x82ac, 0x82a5, 0x82af, 0x82b8, 0x82a3, 0x82b0, 0x82be, 0x82b7, 0x864e, 0x8671, 0x521d, 0x8868, 0x8ecb, 0x8fce, 0x8fd4, 0x8fd1, 0x90b5, 0x90b8, 0x90b1, 0x90b6, 0x91c7, 0x91d1, 0x9577, 0x9580, 0x961c, 0x9640, 0x963f, 0x963b, 0x9644 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xab40[ 63 ] = { 0x9642, 0x96b9, 0x96e8, 0x9752, 0x975e, 0x4e9f, 0x4ead, 0x4eae, 0x4fe1, 0x4fb5, 0x4faf, 0x4fbf, 0x4fe0, 0x4fd1, 0x4fcf, 0x4fdd, 0x4fc3, 0x4fb6, 0x4fd8, 0x4fdf, 0x4fca, 0x4fd7, 0x4fae, 0x4fd0, 0x4fc4, 0x4fc2, 0x4fda, 0x4fce, 0x4fde, 0x4fb7, 0x5157, 0x5192, 0x5191, 0x51a0, 0x524e, 0x5243, 0x524a, 0x524d, 0x524c, 0x524b, 0x5247, 0x52c7, 0x52c9, 0x52c3, 0x52c1, 0x530d, 0x5357, 0x537b, 0x539a, 0x53db, 0x54ac, 0x54c0, 0x54a8, 0x54ce, 0x54c9, 0x54b8, 0x54a6, 0x54b3, 0x54c7, 0x54c2, 0x54bd, 0x54aa, 0x54c1 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaba1[ 94 ] = { 0x54c4, 0x54c8, 0x54af, 0x54ab, 0x54b1, 0x54bb, 0x54a9, 0x54a7, 0x54bf, 0x56ff, 0x5782, 0x578b, 0x57a0, 0x57a3, 0x57a2, 0x57ce, 0x57ae, 0x5793, 0x5955, 0x5951, 0x594f, 0x594e, 0x5950, 0x59dc, 0x59d8, 0x59ff, 0x59e3, 0x59e8, 0x5a03, 0x59e5, 0x59ea, 0x59da, 0x59e6, 0x5a01, 0x59fb, 0x5b69, 0x5ba3, 0x5ba6, 0x5ba4, 0x5ba2, 0x5ba5, 0x5c01, 0x5c4e, 0x5c4f, 0x5c4d, 0x5c4b, 0x5cd9, 0x5cd2, 0x5df7, 0x5e1d, 0x5e25, 0x5e1f, 0x5e7d, 0x5ea0, 0x5ea6, 0x5efa, 0x5f08, 0x5f2d, 0x5f65, 0x5f88, 0x5f85, 0x5f8a, 0x5f8b, 0x5f87, 0x5f8c, 0x5f89, 0x6012, 0x601d, 0x6020, 0x6025, 0x600e, 0x6028, 0x604d, 0x6070, 0x6068, 0x6062, 0x6046, 0x6043, 0x606c, 0x606b, 0x606a, 0x6064, 0x6241, 0x62dc, 0x6316, 0x6309, 0x62fc, 0x62ed, 0x6301, 0x62ee, 0x62fd, 0x6307, 0x62f1, 0x62f7 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xac40[ 63 ] = { 0x62ef, 0x62ec, 0x62fe, 0x62f4, 0x6311, 0x6302, 0x653f, 0x6545, 0x65ab, 0x65bd, 0x65e2, 0x6625, 0x662d, 0x6620, 0x6627, 0x662f, 0x661f, 0x6628, 0x6631, 0x6624, 0x66f7, 0x67ff, 0x67d3, 0x67f1, 0x67d4, 0x67d0, 0x67ec, 0x67b6, 0x67af, 0x67f5, 0x67e9, 0x67ef, 0x67c4, 0x67d1, 0x67b4, 0x67da, 0x67e5, 0x67b8, 0x67cf, 0x67de, 0x67f3, 0x67b0, 0x67d9, 0x67e2, 0x67dd, 0x67d2, 0x6b6a, 0x6b83, 0x6b86, 0x6bb5, 0x6bd2, 0x6bd7, 0x6c1f, 0x6cc9, 0x6d0b, 0x6d32, 0x6d2a, 0x6d41, 0x6d25, 0x6d0c, 0x6d31, 0x6d1e, 0x6d17 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaca1[ 94 ] = { 0x6d3b, 0x6d3d, 0x6d3e, 0x6d36, 0x6d1b, 0x6cf5, 0x6d39, 0x6d27, 0x6d38, 0x6d29, 0x6d2e, 0x6d35, 0x6d0e, 0x6d2b, 0x70ab, 0x70ba, 0x70b3, 0x70ac, 0x70af, 0x70ad, 0x70b8, 0x70ae, 0x70a4, 0x7230, 0x7272, 0x726f, 0x7274, 0x72e9, 0x72e0, 0x72e1, 0x73b7, 0x73ca, 0x73bb, 0x73b2, 0x73cd, 0x73c0, 0x73b3, 0x751a, 0x752d, 0x754f, 0x754c, 0x754e, 0x754b, 0x75ab, 0x75a4, 0x75a5, 0x75a2, 0x75a3, 0x7678, 0x7686, 0x7687, 0x7688, 0x76c8, 0x76c6, 0x76c3, 0x76c5, 0x7701, 0x76f9, 0x76f8, 0x7709, 0x770b, 0x76fe, 0x76fc, 0x7707, 0x77dc, 0x7802, 0x7814, 0x780c, 0x780d, 0x7946, 0x7949, 0x7948, 0x7947, 0x79b9, 0x79ba, 0x79d1, 0x79d2, 0x79cb, 0x7a7f, 0x7a81, 0x7aff, 0x7afd, 0x7c7d, 0x7d02, 0x7d05, 0x7d00, 0x7d09, 0x7d07, 0x7d04, 0x7d06, 0x7f38, 0x7f8e, 0x7fbf, 0x8004 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xad40[ 63 ] = { 0x8010, 0x800d, 0x8011, 0x8036, 0x80d6, 0x80e5, 0x80da, 0x80c3, 0x80c4, 0x80cc, 0x80e1, 0x80db, 0x80ce, 0x80de, 0x80e4, 0x80dd, 0x81f4, 0x8222, 0x82e7, 0x8303, 0x8305, 0x82e3, 0x82db, 0x82e6, 0x8304, 0x82e5, 0x8302, 0x8309, 0x82d2, 0x82d7, 0x82f1, 0x8301, 0x82dc, 0x82d4, 0x82d1, 0x82de, 0x82d3, 0x82df, 0x82ef, 0x8306, 0x8650, 0x8679, 0x867b, 0x867a, 0x884d, 0x886b, 0x8981, 0x89d4, 0x8a08, 0x8a02, 0x8a03, 0x8c9e, 0x8ca0, 0x8d74, 0x8d73, 0x8db4, 0x8ecd, 0x8ecc, 0x8ff0, 0x8fe6, 0x8fe2, 0x8fea, 0x8fe5 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xada1[ 94 ] = { 0x8fed, 0x8feb, 0x8fe4, 0x8fe8, 0x90ca, 0x90ce, 0x90c1, 0x90c3, 0x914b, 0x914a, 0x91cd, 0x9582, 0x9650, 0x964b, 0x964c, 0x964d, 0x9762, 0x9769, 0x97cb, 0x97ed, 0x97f3, 0x9801, 0x98a8, 0x98db, 0x98df, 0x9996, 0x9999, 0x4e58, 0x4eb3, 0x500c, 0x500d, 0x5023, 0x4fef, 0x5026, 0x5025, 0x4ff8, 0x5029, 0x5016, 0x5006, 0x503c, 0x501f, 0x501a, 0x5012, 0x5011, 0x4ffa, 0x5000, 0x5014, 0x5028, 0x4ff1, 0x5021, 0x500b, 0x5019, 0x5018, 0x4ff3, 0x4fee, 0x502d, 0x502a, 0x4ffe, 0x502b, 0x5009, 0x517c, 0x51a4, 0x51a5, 0x51a2, 0x51cd, 0x51cc, 0x51c6, 0x51cb, 0x5256, 0x525c, 0x5254, 0x525b, 0x525d, 0x532a, 0x537f, 0x539f, 0x539d, 0x53df, 0x54e8, 0x5510, 0x5501, 0x5537, 0x54fc, 0x54e5, 0x54f2, 0x5506, 0x54fa, 0x5514, 0x54e9, 0x54ed, 0x54e1, 0x5509, 0x54ee, 0x54ea }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xae40[ 63 ] = { 0x54e6, 0x5527, 0x5507, 0x54fd, 0x550f, 0x5703, 0x5704, 0x57c2, 0x57d4, 0x57cb, 0x57c3, 0x5809, 0x590f, 0x5957, 0x5958, 0x595a, 0x5a11, 0x5a18, 0x5a1c, 0x5a1f, 0x5a1b, 0x5a13, 0x59ec, 0x5a20, 0x5a23, 0x5a29, 0x5a25, 0x5a0c, 0x5a09, 0x5b6b, 0x5c58, 0x5bb0, 0x5bb3, 0x5bb6, 0x5bb4, 0x5bae, 0x5bb5, 0x5bb9, 0x5bb8, 0x5c04, 0x5c51, 0x5c55, 0x5c50, 0x5ced, 0x5cfd, 0x5cfb, 0x5cea, 0x5ce8, 0x5cf0, 0x5cf6, 0x5d01, 0x5cf4, 0x5dee, 0x5e2d, 0x5e2b, 0x5eab, 0x5ead, 0x5ea7, 0x5f31, 0x5f92, 0x5f91, 0x5f90, 0x6059 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaea1[ 94 ] = { 0x6063, 0x6065, 0x6050, 0x6055, 0x606d, 0x6069, 0x606f, 0x6084, 0x609f, 0x609a, 0x608d, 0x6094, 0x608c, 0x6085, 0x6096, 0x6247, 0x62f3, 0x6308, 0x62ff, 0x634e, 0x633e, 0x632f, 0x6355, 0x6342, 0x6346, 0x634f, 0x6349, 0x633a, 0x6350, 0x633d, 0x632a, 0x632b, 0x6328, 0x634d, 0x634c, 0x6548, 0x6549, 0x6599, 0x65c1, 0x65c5, 0x6642, 0x6649, 0x664f, 0x6643, 0x6652, 0x664c, 0x6645, 0x6641, 0x66f8, 0x6714, 0x6715, 0x6717, 0x6821, 0x6838, 0x6848, 0x6846, 0x6853, 0x6839, 0x6842, 0x6854, 0x6829, 0x68b3, 0x6817, 0x684c, 0x6851, 0x683d, 0x67f4, 0x6850, 0x6840, 0x683c, 0x6843, 0x682a, 0x6845, 0x6813, 0x6818, 0x6841, 0x6b8a, 0x6b89, 0x6bb7, 0x6c23, 0x6c27, 0x6c28, 0x6c26, 0x6c24, 0x6cf0, 0x6d6a, 0x6d95, 0x6d88, 0x6d87, 0x6d66, 0x6d78, 0x6d77, 0x6d59, 0x6d93 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaf40[ 63 ] = { 0x6d6c, 0x6d89, 0x6d6e, 0x6d5a, 0x6d74, 0x6d69, 0x6d8c, 0x6d8a, 0x6d79, 0x6d85, 0x6d65, 0x6d94, 0x70ca, 0x70d8, 0x70e4, 0x70d9, 0x70c8, 0x70cf, 0x7239, 0x7279, 0x72fc, 0x72f9, 0x72fd, 0x72f8, 0x72f7, 0x7386, 0x73ed, 0x7409, 0x73ee, 0x73e0, 0x73ea, 0x73de, 0x7554, 0x755d, 0x755c, 0x755a, 0x7559, 0x75be, 0x75c5, 0x75c7, 0x75b2, 0x75b3, 0x75bd, 0x75bc, 0x75b9, 0x75c2, 0x75b8, 0x768b, 0x76b0, 0x76ca, 0x76cd, 0x76ce, 0x7729, 0x771f, 0x7720, 0x7728, 0x77e9, 0x7830, 0x7827, 0x7838, 0x781d, 0x7834, 0x7837 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xafa1[ 94 ] = { 0x7825, 0x782d, 0x7820, 0x781f, 0x7832, 0x7955, 0x7950, 0x7960, 0x795f, 0x7956, 0x795e, 0x795d, 0x7957, 0x795a, 0x79e4, 0x79e3, 0x79e7, 0x79df, 0x79e6, 0x79e9, 0x79d8, 0x7a84, 0x7a88, 0x7ad9, 0x7b06, 0x7b11, 0x7c89, 0x7d21, 0x7d17, 0x7d0b, 0x7d0a, 0x7d20, 0x7d22, 0x7d14, 0x7d10, 0x7d15, 0x7d1a, 0x7d1c, 0x7d0d, 0x7d19, 0x7d1b, 0x7f3a, 0x7f5f, 0x7f94, 0x7fc5, 0x7fc1, 0x8006, 0x8018, 0x8015, 0x8019, 0x8017, 0x803d, 0x803f, 0x80f1, 0x8102, 0x80f0, 0x8105, 0x80ed, 0x80f4, 0x8106, 0x80f8, 0x80f3, 0x8108, 0x80fd, 0x810a, 0x80fc, 0x80ef, 0x81ed, 0x81ec, 0x8200, 0x8210, 0x822a, 0x822b, 0x8228, 0x822c, 0x82bb, 0x832b, 0x8352, 0x8354, 0x834a, 0x8338, 0x8350, 0x8349, 0x8335, 0x8334, 0x834f, 0x8332, 0x8339, 0x8336, 0x8317, 0x8340, 0x8331, 0x8328, 0x8343 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb040[ 63 ] = { 0x8654, 0x868a, 0x86aa, 0x8693, 0x86a4, 0x86a9, 0x868c, 0x86a3, 0x869c, 0x8870, 0x8877, 0x8881, 0x8882, 0x887d, 0x8879, 0x8a18, 0x8a10, 0x8a0e, 0x8a0c, 0x8a15, 0x8a0a, 0x8a17, 0x8a13, 0x8a16, 0x8a0f, 0x8a11, 0x8c48, 0x8c7a, 0x8c79, 0x8ca1, 0x8ca2, 0x8d77, 0x8eac, 0x8ed2, 0x8ed4, 0x8ecf, 0x8fb1, 0x9001, 0x9006, 0x8ff7, 0x9000, 0x8ffa, 0x8ff4, 0x9003, 0x8ffd, 0x9005, 0x8ff8, 0x9095, 0x90e1, 0x90dd, 0x90e2, 0x9152, 0x914d, 0x914c, 0x91d8, 0x91dd, 0x91d7, 0x91dc, 0x91d9, 0x9583, 0x9662, 0x9663, 0x9661 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb0a1[ 94 ] = { 0x965b, 0x965d, 0x9664, 0x9658, 0x965e, 0x96bb, 0x98e2, 0x99ac, 0x9aa8, 0x9ad8, 0x9b25, 0x9b32, 0x9b3c, 0x4e7e, 0x507a, 0x507d, 0x505c, 0x5047, 0x5043, 0x504c, 0x505a, 0x5049, 0x5065, 0x5076, 0x504e, 0x5055, 0x5075, 0x5074, 0x5077, 0x504f, 0x500f, 0x506f, 0x506d, 0x515c, 0x5195, 0x51f0, 0x526a, 0x526f, 0x52d2, 0x52d9, 0x52d8, 0x52d5, 0x5310, 0x530f, 0x5319, 0x533f, 0x5340, 0x533e, 0x53c3, 0x66fc, 0x5546, 0x556a, 0x5566, 0x5544, 0x555e, 0x5561, 0x5543, 0x554a, 0x5531, 0x5556, 0x554f, 0x5555, 0x552f, 0x5564, 0x5538, 0x552e, 0x555c, 0x552c, 0x5563, 0x5533, 0x5541, 0x5557, 0x5708, 0x570b, 0x5709, 0x57df, 0x5805, 0x580a, 0x5806, 0x57e0, 0x57e4, 0x57fa, 0x5802, 0x5835, 0x57f7, 0x57f9, 0x5920, 0x5962, 0x5a36, 0x5a41, 0x5a49, 0x5a66, 0x5a6a, 0x5a40 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb140[ 63 ] = { 0x5a3c, 0x5a62, 0x5a5a, 0x5a46, 0x5a4a, 0x5b70, 0x5bc7, 0x5bc5, 0x5bc4, 0x5bc2, 0x5bbf, 0x5bc6, 0x5c09, 0x5c08, 0x5c07, 0x5c60, 0x5c5c, 0x5c5d, 0x5d07, 0x5d06, 0x5d0e, 0x5d1b, 0x5d16, 0x5d22, 0x5d11, 0x5d29, 0x5d14, 0x5d19, 0x5d24, 0x5d27, 0x5d17, 0x5de2, 0x5e38, 0x5e36, 0x5e33, 0x5e37, 0x5eb7, 0x5eb8, 0x5eb6, 0x5eb5, 0x5ebe, 0x5f35, 0x5f37, 0x5f57, 0x5f6c, 0x5f69, 0x5f6b, 0x5f97, 0x5f99, 0x5f9e, 0x5f98, 0x5fa1, 0x5fa0, 0x5f9c, 0x607f, 0x60a3, 0x6089, 0x60a0, 0x60a8, 0x60cb, 0x60b4, 0x60e6, 0x60bd }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb1a1[ 94 ] = { 0x60c5, 0x60bb, 0x60b5, 0x60dc, 0x60bc, 0x60d8, 0x60d5, 0x60c6, 0x60df, 0x60b8, 0x60da, 0x60c7, 0x621a, 0x621b, 0x6248, 0x63a0, 0x63a7, 0x6372, 0x6396, 0x63a2, 0x63a5, 0x6377, 0x6367, 0x6398, 0x63aa, 0x6371, 0x63a9, 0x6389, 0x6383, 0x639b, 0x636b, 0x63a8, 0x6384, 0x6388, 0x6399, 0x63a1, 0x63ac, 0x6392, 0x638f, 0x6380, 0x637b, 0x6369, 0x6368, 0x637a, 0x655d, 0x6556, 0x6551, 0x6559, 0x6557, 0x555f, 0x654f, 0x6558, 0x6555, 0x6554, 0x659c, 0x659b, 0x65ac, 0x65cf, 0x65cb, 0x65cc, 0x65ce, 0x665d, 0x665a, 0x6664, 0x6668, 0x6666, 0x665e, 0x66f9, 0x52d7, 0x671b, 0x6881, 0x68af, 0x68a2, 0x6893, 0x68b5, 0x687f, 0x6876, 0x68b1, 0x68a7, 0x6897, 0x68b0, 0x6883, 0x68c4, 0x68ad, 0x6886, 0x6885, 0x6894, 0x689d, 0x68a8, 0x689f, 0x68a1, 0x6882, 0x6b32, 0x6bba }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb240[ 63 ] = { 0x6beb, 0x6bec, 0x6c2b, 0x6d8e, 0x6dbc, 0x6df3, 0x6dd9, 0x6db2, 0x6de1, 0x6dcc, 0x6de4, 0x6dfb, 0x6dfa, 0x6e05, 0x6dc7, 0x6dcb, 0x6daf, 0x6dd1, 0x6dae, 0x6dde, 0x6df9, 0x6db8, 0x6df7, 0x6df5, 0x6dc5, 0x6dd2, 0x6e1a, 0x6db5, 0x6dda, 0x6deb, 0x6dd8, 0x6dea, 0x6df1, 0x6dee, 0x6de8, 0x6dc6, 0x6dc4, 0x6daa, 0x6dec, 0x6dbf, 0x6de6, 0x70f9, 0x7109, 0x710a, 0x70fd, 0x70ef, 0x723d, 0x727d, 0x7281, 0x731c, 0x731b, 0x7316, 0x7313, 0x7319, 0x7387, 0x7405, 0x740a, 0x7403, 0x7406, 0x73fe, 0x740d, 0x74e0, 0x74f6 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb2a1[ 94 ] = { 0x74f7, 0x751c, 0x7522, 0x7565, 0x7566, 0x7562, 0x7570, 0x758f, 0x75d4, 0x75d5, 0x75b5, 0x75ca, 0x75cd, 0x768e, 0x76d4, 0x76d2, 0x76db, 0x7737, 0x773e, 0x773c, 0x7736, 0x7738, 0x773a, 0x786b, 0x7843, 0x784e, 0x7965, 0x7968, 0x796d, 0x79fb, 0x7a92, 0x7a95, 0x7b20, 0x7b28, 0x7b1b, 0x7b2c, 0x7b26, 0x7b19, 0x7b1e, 0x7b2e, 0x7c92, 0x7c97, 0x7c95, 0x7d46, 0x7d43, 0x7d71, 0x7d2e, 0x7d39, 0x7d3c, 0x7d40, 0x7d30, 0x7d33, 0x7d44, 0x7d2f, 0x7d42, 0x7d32, 0x7d31, 0x7f3d, 0x7f9e, 0x7f9a, 0x7fcc, 0x7fce, 0x7fd2, 0x801c, 0x804a, 0x8046, 0x812f, 0x8116, 0x8123, 0x812b, 0x8129, 0x8130, 0x8124, 0x8202, 0x8235, 0x8237, 0x8236, 0x8239, 0x838e, 0x839e, 0x8398, 0x8378, 0x83a2, 0x8396, 0x83bd, 0x83ab, 0x8392, 0x838a, 0x8393, 0x8389, 0x83a0, 0x8377, 0x837b, 0x837c }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb340[ 63 ] = { 0x8386, 0x83a7, 0x8655, 0x5f6a, 0x86c7, 0x86c0, 0x86b6, 0x86c4, 0x86b5, 0x86c6, 0x86cb, 0x86b1, 0x86af, 0x86c9, 0x8853, 0x889e, 0x8888, 0x88ab, 0x8892, 0x8896, 0x888d, 0x888b, 0x8993, 0x898f, 0x8a2a, 0x8a1d, 0x8a23, 0x8a25, 0x8a31, 0x8a2d, 0x8a1f, 0x8a1b, 0x8a22, 0x8c49, 0x8c5a, 0x8ca9, 0x8cac, 0x8cab, 0x8ca8, 0x8caa, 0x8ca7, 0x8d67, 0x8d66, 0x8dbe, 0x8dba, 0x8edb, 0x8edf, 0x9019, 0x900d, 0x901a, 0x9017, 0x9023, 0x901f, 0x901d, 0x9010, 0x9015, 0x901e, 0x9020, 0x900f, 0x9022, 0x9016, 0x901b, 0x9014 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb3a1[ 94 ] = { 0x90e8, 0x90ed, 0x90fd, 0x9157, 0x91ce, 0x91f5, 0x91e6, 0x91e3, 0x91e7, 0x91ed, 0x91e9, 0x9589, 0x966a, 0x9675, 0x9673, 0x9678, 0x9670, 0x9674, 0x9676, 0x9677, 0x966c, 0x96c0, 0x96ea, 0x96e9, 0x7ae0, 0x7adf, 0x9802, 0x9803, 0x9b5a, 0x9ce5, 0x9e75, 0x9e7f, 0x9ea5, 0x9ebb, 0x50a2, 0x508d, 0x5085, 0x5099, 0x5091, 0x5080, 0x5096, 0x5098, 0x509a, 0x6700, 0x51f1, 0x5272, 0x5274, 0x5275, 0x5269, 0x52de, 0x52dd, 0x52db, 0x535a, 0x53a5, 0x557b, 0x5580, 0x55a7, 0x557c, 0x558a, 0x559d, 0x5598, 0x5582, 0x559c, 0x55aa, 0x5594, 0x5587, 0x558b, 0x5583, 0x55b3, 0x55ae, 0x559f, 0x553e, 0x55b2, 0x559a, 0x55bb, 0x55ac, 0x55b1, 0x557e, 0x5589, 0x55ab, 0x5599, 0x570d, 0x582f, 0x582a, 0x5834, 0x5824, 0x5830, 0x5831, 0x5821, 0x581d, 0x5820, 0x58f9, 0x58fa, 0x5960 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb440[ 63 ] = { 0x5a77, 0x5a9a, 0x5a7f, 0x5a92, 0x5a9b, 0x5aa7, 0x5b73, 0x5b71, 0x5bd2, 0x5bcc, 0x5bd3, 0x5bd0, 0x5c0a, 0x5c0b, 0x5c31, 0x5d4c, 0x5d50, 0x5d34, 0x5d47, 0x5dfd, 0x5e45, 0x5e3d, 0x5e40, 0x5e43, 0x5e7e, 0x5eca, 0x5ec1, 0x5ec2, 0x5ec4, 0x5f3c, 0x5f6d, 0x5fa9, 0x5faa, 0x5fa8, 0x60d1, 0x60e1, 0x60b2, 0x60b6, 0x60e0, 0x611c, 0x6123, 0x60fa, 0x6115, 0x60f0, 0x60fb, 0x60f4, 0x6168, 0x60f1, 0x610e, 0x60f6, 0x6109, 0x6100, 0x6112, 0x621f, 0x6249, 0x63a3, 0x638c, 0x63cf, 0x63c0, 0x63e9, 0x63c9, 0x63c6, 0x63cd }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb4a1[ 94 ] = { 0x63d2, 0x63e3, 0x63d0, 0x63e1, 0x63d6, 0x63ed, 0x63ee, 0x6376, 0x63f4, 0x63ea, 0x63db, 0x6452, 0x63da, 0x63f9, 0x655e, 0x6566, 0x6562, 0x6563, 0x6591, 0x6590, 0x65af, 0x666e, 0x6670, 0x6674, 0x6676, 0x666f, 0x6691, 0x667a, 0x667e, 0x6677, 0x66fe, 0x66ff, 0x671f, 0x671d, 0x68fa, 0x68d5, 0x68e0, 0x68d8, 0x68d7, 0x6905, 0x68df, 0x68f5, 0x68ee, 0x68e7, 0x68f9, 0x68d2, 0x68f2, 0x68e3, 0x68cb, 0x68cd, 0x690d, 0x6912, 0x690e, 0x68c9, 0x68da, 0x696e, 0x68fb, 0x6b3e, 0x6b3a, 0x6b3d, 0x6b98, 0x6b96, 0x6bbc, 0x6bef, 0x6c2e, 0x6c2f, 0x6c2c, 0x6e2f, 0x6e38, 0x6e54, 0x6e21, 0x6e32, 0x6e67, 0x6e4a, 0x6e20, 0x6e25, 0x6e23, 0x6e1b, 0x6e5b, 0x6e58, 0x6e24, 0x6e56, 0x6e6e, 0x6e2d, 0x6e26, 0x6e6f, 0x6e34, 0x6e4d, 0x6e3a, 0x6e2c, 0x6e43, 0x6e1d, 0x6e3e, 0x6ecb }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb540[ 63 ] = { 0x6e89, 0x6e19, 0x6e4e, 0x6e63, 0x6e44, 0x6e72, 0x6e69, 0x6e5f, 0x7119, 0x711a, 0x7126, 0x7130, 0x7121, 0x7136, 0x716e, 0x711c, 0x724c, 0x7284, 0x7280, 0x7336, 0x7325, 0x7334, 0x7329, 0x743a, 0x742a, 0x7433, 0x7422, 0x7425, 0x7435, 0x7436, 0x7434, 0x742f, 0x741b, 0x7426, 0x7428, 0x7525, 0x7526, 0x756b, 0x756a, 0x75e2, 0x75db, 0x75e3, 0x75d9, 0x75d8, 0x75de, 0x75e0, 0x767b, 0x767c, 0x7696, 0x7693, 0x76b4, 0x76dc, 0x774f, 0x77ed, 0x785d, 0x786c, 0x786f, 0x7a0d, 0x7a08, 0x7a0b, 0x7a05, 0x7a00, 0x7a98 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb5a1[ 94 ] = { 0x7a97, 0x7a96, 0x7ae5, 0x7ae3, 0x7b49, 0x7b56, 0x7b46, 0x7b50, 0x7b52, 0x7b54, 0x7b4d, 0x7b4b, 0x7b4f, 0x7b51, 0x7c9f, 0x7ca5, 0x7d5e, 0x7d50, 0x7d68, 0x7d55, 0x7d2b, 0x7d6e, 0x7d72, 0x7d61, 0x7d66, 0x7d62, 0x7d70, 0x7d73, 0x5584, 0x7fd4, 0x7fd5, 0x800b, 0x8052, 0x8085, 0x8155, 0x8154, 0x814b, 0x8151, 0x814e, 0x8139, 0x8146, 0x813e, 0x814c, 0x8153, 0x8174, 0x8212, 0x821c, 0x83e9, 0x8403, 0x83f8, 0x840d, 0x83e0, 0x83c5, 0x840b, 0x83c1, 0x83ef, 0x83f1, 0x83f4, 0x8457, 0x840a, 0x83f0, 0x840c, 0x83cc, 0x83fd, 0x83f2, 0x83ca, 0x8438, 0x840e, 0x8404, 0x83dc, 0x8407, 0x83d4, 0x83df, 0x865b, 0x86df, 0x86d9, 0x86ed, 0x86d4, 0x86db, 0x86e4, 0x86d0, 0x86de, 0x8857, 0x88c1, 0x88c2, 0x88b1, 0x8983, 0x8996, 0x8a3b, 0x8a60, 0x8a55, 0x8a5e, 0x8a3c, 0x8a41 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb640[ 63 ] = { 0x8a54, 0x8a5b, 0x8a50, 0x8a46, 0x8a34, 0x8a3a, 0x8a36, 0x8a56, 0x8c61, 0x8c82, 0x8caf, 0x8cbc, 0x8cb3, 0x8cbd, 0x8cc1, 0x8cbb, 0x8cc0, 0x8cb4, 0x8cb7, 0x8cb6, 0x8cbf, 0x8cb8, 0x8d8a, 0x8d85, 0x8d81, 0x8dce, 0x8ddd, 0x8dcb, 0x8dda, 0x8dd1, 0x8dcc, 0x8ddb, 0x8dc6, 0x8efb, 0x8ef8, 0x8efc, 0x8f9c, 0x902e, 0x9035, 0x9031, 0x9038, 0x9032, 0x9036, 0x9102, 0x90f5, 0x9109, 0x90fe, 0x9163, 0x9165, 0x91cf, 0x9214, 0x9215, 0x9223, 0x9209, 0x921e, 0x920d, 0x9210, 0x9207, 0x9211, 0x9594, 0x958f, 0x958b, 0x9591 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb6a1[ 94 ] = { 0x9593, 0x9592, 0x958e, 0x968a, 0x968e, 0x968b, 0x967d, 0x9685, 0x9686, 0x968d, 0x9672, 0x9684, 0x96c1, 0x96c5, 0x96c4, 0x96c6, 0x96c7, 0x96ef, 0x96f2, 0x97cc, 0x9805, 0x9806, 0x9808, 0x98e7, 0x98ea, 0x98ef, 0x98e9, 0x98f2, 0x98ed, 0x99ae, 0x99ad, 0x9ec3, 0x9ecd, 0x9ed1, 0x4e82, 0x50ad, 0x50b5, 0x50b2, 0x50b3, 0x50c5, 0x50be, 0x50ac, 0x50b7, 0x50bb, 0x50af, 0x50c7, 0x527f, 0x5277, 0x527d, 0x52df, 0x52e6, 0x52e4, 0x52e2, 0x52e3, 0x532f, 0x55df, 0x55e8, 0x55d3, 0x55e6, 0x55ce, 0x55dc, 0x55c7, 0x55d1, 0x55e3, 0x55e4, 0x55ef, 0x55da, 0x55e1, 0x55c5, 0x55c6, 0x55e5, 0x55c9, 0x5712, 0x5713, 0x585e, 0x5851, 0x5858, 0x5857, 0x585a, 0x5854, 0x586b, 0x584c, 0x586d, 0x584a, 0x5862, 0x5852, 0x584b, 0x5967, 0x5ac1, 0x5ac9, 0x5acc, 0x5abe, 0x5abd, 0x5abc }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb740[ 63 ] = { 0x5ab3, 0x5ac2, 0x5ab2, 0x5d69, 0x5d6f, 0x5e4c, 0x5e79, 0x5ec9, 0x5ec8, 0x5f12, 0x5f59, 0x5fac, 0x5fae, 0x611a, 0x610f, 0x6148, 0x611f, 0x60f3, 0x611b, 0x60f9, 0x6101, 0x6108, 0x614e, 0x614c, 0x6144, 0x614d, 0x613e, 0x6134, 0x6127, 0x610d, 0x6106, 0x6137, 0x6221, 0x6222, 0x6413, 0x643e, 0x641e, 0x642a, 0x642d, 0x643d, 0x642c, 0x640f, 0x641c, 0x6414, 0x640d, 0x6436, 0x6416, 0x6417, 0x6406, 0x656c, 0x659f, 0x65b0, 0x6697, 0x6689, 0x6687, 0x6688, 0x6696, 0x6684, 0x6698, 0x668d, 0x6703, 0x6994, 0x696d }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb7a1[ 94 ] = { 0x695a, 0x6977, 0x6960, 0x6954, 0x6975, 0x6930, 0x6982, 0x694a, 0x6968, 0x696b, 0x695e, 0x6953, 0x6979, 0x6986, 0x695d, 0x6963, 0x695b, 0x6b47, 0x6b72, 0x6bc0, 0x6bbf, 0x6bd3, 0x6bfd, 0x6ea2, 0x6eaf, 0x6ed3, 0x6eb6, 0x6ec2, 0x6e90, 0x6e9d, 0x6ec7, 0x6ec5, 0x6ea5, 0x6e98, 0x6ebc, 0x6eba, 0x6eab, 0x6ed1, 0x6e96, 0x6e9c, 0x6ec4, 0x6ed4, 0x6eaa, 0x6ea7, 0x6eb4, 0x714e, 0x7159, 0x7169, 0x7164, 0x7149, 0x7167, 0x715c, 0x716c, 0x7166, 0x714c, 0x7165, 0x715e, 0x7146, 0x7168, 0x7156, 0x723a, 0x7252, 0x7337, 0x7345, 0x733f, 0x733e, 0x746f, 0x745a, 0x7455, 0x745f, 0x745e, 0x7441, 0x743f, 0x7459, 0x745b, 0x745c, 0x7576, 0x7578, 0x7600, 0x75f0, 0x7601, 0x75f2, 0x75f1, 0x75fa, 0x75ff, 0x75f4, 0x75f3, 0x76de, 0x76df, 0x775b, 0x776b, 0x7766, 0x775e, 0x7763 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb840[ 63 ] = { 0x7779, 0x776a, 0x776c, 0x775c, 0x7765, 0x7768, 0x7762, 0x77ee, 0x788e, 0x78b0, 0x7897, 0x7898, 0x788c, 0x7889, 0x787c, 0x7891, 0x7893, 0x787f, 0x797a, 0x797f, 0x7981, 0x842c, 0x79bd, 0x7a1c, 0x7a1a, 0x7a20, 0x7a14, 0x7a1f, 0x7a1e, 0x7a9f, 0x7aa0, 0x7b77, 0x7bc0, 0x7b60, 0x7b6e, 0x7b67, 0x7cb1, 0x7cb3, 0x7cb5, 0x7d93, 0x7d79, 0x7d91, 0x7d81, 0x7d8f, 0x7d5b, 0x7f6e, 0x7f69, 0x7f6a, 0x7f72, 0x7fa9, 0x7fa8, 0x7fa4, 0x8056, 0x8058, 0x8086, 0x8084, 0x8171, 0x8170, 0x8178, 0x8165, 0x816e, 0x8173, 0x816b }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb8a1[ 94 ] = { 0x8179, 0x817a, 0x8166, 0x8205, 0x8247, 0x8482, 0x8477, 0x843d, 0x8431, 0x8475, 0x8466, 0x846b, 0x8449, 0x846c, 0x845b, 0x843c, 0x8435, 0x8461, 0x8463, 0x8469, 0x846d, 0x8446, 0x865e, 0x865c, 0x865f, 0x86f9, 0x8713, 0x8708, 0x8707, 0x8700, 0x86fe, 0x86fb, 0x8702, 0x8703, 0x8706, 0x870a, 0x8859, 0x88df, 0x88d4, 0x88d9, 0x88dc, 0x88d8, 0x88dd, 0x88e1, 0x88ca, 0x88d5, 0x88d2, 0x899c, 0x89e3, 0x8a6b, 0x8a72, 0x8a73, 0x8a66, 0x8a69, 0x8a70, 0x8a87, 0x8a7c, 0x8a63, 0x8aa0, 0x8a71, 0x8a85, 0x8a6d, 0x8a62, 0x8a6e, 0x8a6c, 0x8a79, 0x8a7b, 0x8a3e, 0x8a68, 0x8c62, 0x8c8a, 0x8c89, 0x8cca, 0x8cc7, 0x8cc8, 0x8cc4, 0x8cb2, 0x8cc3, 0x8cc2, 0x8cc5, 0x8de1, 0x8ddf, 0x8de8, 0x8def, 0x8df3, 0x8dfa, 0x8dea, 0x8de4, 0x8de6, 0x8eb2, 0x8f03, 0x8f09, 0x8efe, 0x8f0a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb940[ 63 ] = { 0x8f9f, 0x8fb2, 0x904b, 0x904a, 0x9053, 0x9042, 0x9054, 0x903c, 0x9055, 0x9050, 0x9047, 0x904f, 0x904e, 0x904d, 0x9051, 0x903e, 0x9041, 0x9112, 0x9117, 0x916c, 0x916a, 0x9169, 0x91c9, 0x9237, 0x9257, 0x9238, 0x923d, 0x9240, 0x923e, 0x925b, 0x924b, 0x9264, 0x9251, 0x9234, 0x9249, 0x924d, 0x9245, 0x9239, 0x923f, 0x925a, 0x9598, 0x9698, 0x9694, 0x9695, 0x96cd, 0x96cb, 0x96c9, 0x96ca, 0x96f7, 0x96fb, 0x96f9, 0x96f6, 0x9756, 0x9774, 0x9776, 0x9810, 0x9811, 0x9813, 0x980a, 0x9812, 0x980c, 0x98fc, 0x98f4 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb9a1[ 94 ] = { 0x98fd, 0x98fe, 0x99b3, 0x99b1, 0x99b4, 0x9ae1, 0x9ce9, 0x9e82, 0x9f0e, 0x9f13, 0x9f20, 0x50e7, 0x50ee, 0x50e5, 0x50d6, 0x50ed, 0x50da, 0x50d5, 0x50cf, 0x50d1, 0x50f1, 0x50ce, 0x50e9, 0x5162, 0x51f3, 0x5283, 0x5282, 0x5331, 0x53ad, 0x55fe, 0x5600, 0x561b, 0x5617, 0x55fd, 0x5614, 0x5606, 0x5609, 0x560d, 0x560e, 0x55f7, 0x5616, 0x561f, 0x5608, 0x5610, 0x55f6, 0x5718, 0x5716, 0x5875, 0x587e, 0x5883, 0x5893, 0x588a, 0x5879, 0x5885, 0x587d, 0x58fd, 0x5925, 0x5922, 0x5924, 0x596a, 0x5969, 0x5ae1, 0x5ae6, 0x5ae9, 0x5ad7, 0x5ad6, 0x5ad8, 0x5ae3, 0x5b75, 0x5bde, 0x5be7, 0x5be1, 0x5be5, 0x5be6, 0x5be8, 0x5be2, 0x5be4, 0x5bdf, 0x5c0d, 0x5c62, 0x5d84, 0x5d87, 0x5e5b, 0x5e63, 0x5e55, 0x5e57, 0x5e54, 0x5ed3, 0x5ed6, 0x5f0a, 0x5f46, 0x5f70, 0x5fb9, 0x6147 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xba40[ 63 ] = { 0x613f, 0x614b, 0x6177, 0x6162, 0x6163, 0x615f, 0x615a, 0x6158, 0x6175, 0x622a, 0x6487, 0x6458, 0x6454, 0x64a4, 0x6478, 0x645f, 0x647a, 0x6451, 0x6467, 0x6434, 0x646d, 0x647b, 0x6572, 0x65a1, 0x65d7, 0x65d6, 0x66a2, 0x66a8, 0x669d, 0x699c, 0x69a8, 0x6995, 0x69c1, 0x69ae, 0x69d3, 0x69cb, 0x699b, 0x69b7, 0x69bb, 0x69ab, 0x69b4, 0x69d0, 0x69cd, 0x69ad, 0x69cc, 0x69a6, 0x69c3, 0x69a3, 0x6b49, 0x6b4c, 0x6c33, 0x6f33, 0x6f14, 0x6efe, 0x6f13, 0x6ef4, 0x6f29, 0x6f3e, 0x6f20, 0x6f2c, 0x6f0f, 0x6f02, 0x6f22 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbaa1[ 94 ] = { 0x6eff, 0x6eef, 0x6f06, 0x6f31, 0x6f38, 0x6f32, 0x6f23, 0x6f15, 0x6f2b, 0x6f2f, 0x6f88, 0x6f2a, 0x6eec, 0x6f01, 0x6ef2, 0x6ecc, 0x6ef7, 0x7194, 0x7199, 0x717d, 0x718a, 0x7184, 0x7192, 0x723e, 0x7292, 0x7296, 0x7344, 0x7350, 0x7464, 0x7463, 0x746a, 0x7470, 0x746d, 0x7504, 0x7591, 0x7627, 0x760d, 0x760b, 0x7609, 0x7613, 0x76e1, 0x76e3, 0x7784, 0x777d, 0x777f, 0x7761, 0x78c1, 0x789f, 0x78a7, 0x78b3, 0x78a9, 0x78a3, 0x798e, 0x798f, 0x798d, 0x7a2e, 0x7a31, 0x7aaa, 0x7aa9, 0x7aed, 0x7aef, 0x7ba1, 0x7b95, 0x7b8b, 0x7b75, 0x7b97, 0x7b9d, 0x7b94, 0x7b8f, 0x7bb8, 0x7b87, 0x7b84, 0x7cb9, 0x7cbd, 0x7cbe, 0x7dbb, 0x7db0, 0x7d9c, 0x7dbd, 0x7dbe, 0x7da0, 0x7dca, 0x7db4, 0x7db2, 0x7db1, 0x7dba, 0x7da2, 0x7dbf, 0x7db5, 0x7db8, 0x7dad, 0x7dd2, 0x7dc7, 0x7dac }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbb40[ 63 ] = { 0x7f70, 0x7fe0, 0x7fe1, 0x7fdf, 0x805e, 0x805a, 0x8087, 0x8150, 0x8180, 0x818f, 0x8188, 0x818a, 0x817f, 0x8182, 0x81e7, 0x81fa, 0x8207, 0x8214, 0x821e, 0x824b, 0x84c9, 0x84bf, 0x84c6, 0x84c4, 0x8499, 0x849e, 0x84b2, 0x849c, 0x84cb, 0x84b8, 0x84c0, 0x84d3, 0x8490, 0x84bc, 0x84d1, 0x84ca, 0x873f, 0x871c, 0x873b, 0x8722, 0x8725, 0x8734, 0x8718, 0x8755, 0x8737, 0x8729, 0x88f3, 0x8902, 0x88f4, 0x88f9, 0x88f8, 0x88fd, 0x88e8, 0x891a, 0x88ef, 0x8aa6, 0x8a8c, 0x8a9e, 0x8aa3, 0x8a8d, 0x8aa1, 0x8a93, 0x8aa4 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbba1[ 94 ] = { 0x8aaa, 0x8aa5, 0x8aa8, 0x8a98, 0x8a91, 0x8a9a, 0x8aa7, 0x8c6a, 0x8c8d, 0x8c8c, 0x8cd3, 0x8cd1, 0x8cd2, 0x8d6b, 0x8d99, 0x8d95, 0x8dfc, 0x8f14, 0x8f12, 0x8f15, 0x8f13, 0x8fa3, 0x9060, 0x9058, 0x905c, 0x9063, 0x9059, 0x905e, 0x9062, 0x905d, 0x905b, 0x9119, 0x9118, 0x911e, 0x9175, 0x9178, 0x9177, 0x9174, 0x9278, 0x9280, 0x9285, 0x9298, 0x9296, 0x927b, 0x9293, 0x929c, 0x92a8, 0x927c, 0x9291, 0x95a1, 0x95a8, 0x95a9, 0x95a3, 0x95a5, 0x95a4, 0x9699, 0x969c, 0x969b, 0x96cc, 0x96d2, 0x9700, 0x977c, 0x9785, 0x97f6, 0x9817, 0x9818, 0x98af, 0x98b1, 0x9903, 0x9905, 0x990c, 0x9909, 0x99c1, 0x9aaf, 0x9ab0, 0x9ae6, 0x9b41, 0x9b42, 0x9cf4, 0x9cf6, 0x9cf3, 0x9ebc, 0x9f3b, 0x9f4a, 0x5104, 0x5100, 0x50fb, 0x50f5, 0x50f9, 0x5102, 0x5108, 0x5109, 0x5105, 0x51dc }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbc40[ 63 ] = { 0x5287, 0x5288, 0x5289, 0x528d, 0x528a, 0x52f0, 0x53b2, 0x562e, 0x563b, 0x5639, 0x5632, 0x563f, 0x5634, 0x5629, 0x5653, 0x564e, 0x5657, 0x5674, 0x5636, 0x562f, 0x5630, 0x5880, 0x589f, 0x589e, 0x58b3, 0x589c, 0x58ae, 0x58a9, 0x58a6, 0x596d, 0x5b09, 0x5afb, 0x5b0b, 0x5af5, 0x5b0c, 0x5b08, 0x5bee, 0x5bec, 0x5be9, 0x5beb, 0x5c64, 0x5c65, 0x5d9d, 0x5d94, 0x5e62, 0x5e5f, 0x5e61, 0x5ee2, 0x5eda, 0x5edf, 0x5edd, 0x5ee3, 0x5ee0, 0x5f48, 0x5f71, 0x5fb7, 0x5fb5, 0x6176, 0x6167, 0x616e, 0x615d, 0x6155, 0x6182 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbca1[ 94 ] = { 0x617c, 0x6170, 0x616b, 0x617e, 0x61a7, 0x6190, 0x61ab, 0x618e, 0x61ac, 0x619a, 0x61a4, 0x6194, 0x61ae, 0x622e, 0x6469, 0x646f, 0x6479, 0x649e, 0x64b2, 0x6488, 0x6490, 0x64b0, 0x64a5, 0x6493, 0x6495, 0x64a9, 0x6492, 0x64ae, 0x64ad, 0x64ab, 0x649a, 0x64ac, 0x6499, 0x64a2, 0x64b3, 0x6575, 0x6577, 0x6578, 0x66ae, 0x66ab, 0x66b4, 0x66b1, 0x6a23, 0x6a1f, 0x69e8, 0x6a01, 0x6a1e, 0x6a19, 0x69fd, 0x6a21, 0x6a13, 0x6a0a, 0x69f3, 0x6a02, 0x6a05, 0x69ed, 0x6a11, 0x6b50, 0x6b4e, 0x6ba4, 0x6bc5, 0x6bc6, 0x6f3f, 0x6f7c, 0x6f84, 0x6f51, 0x6f66, 0x6f54, 0x6f86, 0x6f6d, 0x6f5b, 0x6f78, 0x6f6e, 0x6f8e, 0x6f7a, 0x6f70, 0x6f64, 0x6f97, 0x6f58, 0x6ed5, 0x6f6f, 0x6f60, 0x6f5f, 0x719f, 0x71ac, 0x71b1, 0x71a8, 0x7256, 0x729b, 0x734e, 0x7357, 0x7469, 0x748b, 0x7483 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbd40[ 63 ] = { 0x747e, 0x7480, 0x757f, 0x7620, 0x7629, 0x761f, 0x7624, 0x7626, 0x7621, 0x7622, 0x769a, 0x76ba, 0x76e4, 0x778e, 0x7787, 0x778c, 0x7791, 0x778b, 0x78cb, 0x78c5, 0x78ba, 0x78ca, 0x78be, 0x78d5, 0x78bc, 0x78d0, 0x7a3f, 0x7a3c, 0x7a40, 0x7a3d, 0x7a37, 0x7a3b, 0x7aaf, 0x7aae, 0x7bad, 0x7bb1, 0x7bc4, 0x7bb4, 0x7bc6, 0x7bc7, 0x7bc1, 0x7ba0, 0x7bcc, 0x7cca, 0x7de0, 0x7df4, 0x7def, 0x7dfb, 0x7dd8, 0x7dec, 0x7ddd, 0x7de8, 0x7de3, 0x7dda, 0x7dde, 0x7de9, 0x7d9e, 0x7dd9, 0x7df2, 0x7df9, 0x7f75, 0x7f77, 0x7faf }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbda1[ 94 ] = { 0x7fe9, 0x8026, 0x819b, 0x819c, 0x819d, 0x81a0, 0x819a, 0x8198, 0x8517, 0x853d, 0x851a, 0x84ee, 0x852c, 0x852d, 0x8513, 0x8511, 0x8523, 0x8521, 0x8514, 0x84ec, 0x8525, 0x84ff, 0x8506, 0x8782, 0x8774, 0x8776, 0x8760, 0x8766, 0x8778, 0x8768, 0x8759, 0x8757, 0x874c, 0x8753, 0x885b, 0x885d, 0x8910, 0x8907, 0x8912, 0x8913, 0x8915, 0x890a, 0x8abc, 0x8ad2, 0x8ac7, 0x8ac4, 0x8a95, 0x8acb, 0x8af8, 0x8ab2, 0x8ac9, 0x8ac2, 0x8abf, 0x8ab0, 0x8ad6, 0x8acd, 0x8ab6, 0x8ab9, 0x8adb, 0x8c4c, 0x8c4e, 0x8c6c, 0x8ce0, 0x8cde, 0x8ce6, 0x8ce4, 0x8cec, 0x8ced, 0x8ce2, 0x8ce3, 0x8cdc, 0x8cea, 0x8ce1, 0x8d6d, 0x8d9f, 0x8da3, 0x8e2b, 0x8e10, 0x8e1d, 0x8e22, 0x8e0f, 0x8e29, 0x8e1f, 0x8e21, 0x8e1e, 0x8eba, 0x8f1d, 0x8f1b, 0x8f1f, 0x8f29, 0x8f26, 0x8f2a, 0x8f1c, 0x8f1e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbe40[ 63 ] = { 0x8f25, 0x9069, 0x906e, 0x9068, 0x906d, 0x9077, 0x9130, 0x912d, 0x9127, 0x9131, 0x9187, 0x9189, 0x918b, 0x9183, 0x92c5, 0x92bb, 0x92b7, 0x92ea, 0x92ac, 0x92e4, 0x92c1, 0x92b3, 0x92bc, 0x92d2, 0x92c7, 0x92f0, 0x92b2, 0x95ad, 0x95b1, 0x9704, 0x9706, 0x9707, 0x9709, 0x9760, 0x978d, 0x978b, 0x978f, 0x9821, 0x982b, 0x981c, 0x98b3, 0x990a, 0x9913, 0x9912, 0x9918, 0x99dd, 0x99d0, 0x99df, 0x99db, 0x99d1, 0x99d5, 0x99d2, 0x99d9, 0x9ab7, 0x9aee, 0x9aef, 0x9b27, 0x9b45, 0x9b44, 0x9b77, 0x9b6f, 0x9d06, 0x9d09 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbea1[ 94 ] = { 0x9d03, 0x9ea9, 0x9ebe, 0x9ece, 0x58a8, 0x9f52, 0x5112, 0x5118, 0x5114, 0x5110, 0x5115, 0x5180, 0x51aa, 0x51dd, 0x5291, 0x5293, 0x52f3, 0x5659, 0x566b, 0x5679, 0x5669, 0x5664, 0x5678, 0x566a, 0x5668, 0x5665, 0x5671, 0x566f, 0x566c, 0x5662, 0x5676, 0x58c1, 0x58be, 0x58c7, 0x58c5, 0x596e, 0x5b1d, 0x5b34, 0x5b78, 0x5bf0, 0x5c0e, 0x5f4a, 0x61b2, 0x6191, 0x61a9, 0x618a, 0x61cd, 0x61b6, 0x61be, 0x61ca, 0x61c8, 0x6230, 0x64c5, 0x64c1, 0x64cb, 0x64bb, 0x64bc, 0x64da, 0x64c4, 0x64c7, 0x64c2, 0x64cd, 0x64bf, 0x64d2, 0x64d4, 0x64be, 0x6574, 0x66c6, 0x66c9, 0x66b9, 0x66c4, 0x66c7, 0x66b8, 0x6a3d, 0x6a38, 0x6a3a, 0x6a59, 0x6a6b, 0x6a58, 0x6a39, 0x6a44, 0x6a62, 0x6a61, 0x6a4b, 0x6a47, 0x6a35, 0x6a5f, 0x6a48, 0x6b59, 0x6b77, 0x6c05, 0x6fc2, 0x6fb1, 0x6fa1 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbf40[ 63 ] = { 0x6fc3, 0x6fa4, 0x6fc1, 0x6fa7, 0x6fb3, 0x6fc0, 0x6fb9, 0x6fb6, 0x6fa6, 0x6fa0, 0x6fb4, 0x71be, 0x71c9, 0x71d0, 0x71d2, 0x71c8, 0x71d5, 0x71b9, 0x71ce, 0x71d9, 0x71dc, 0x71c3, 0x71c4, 0x7368, 0x749c, 0x74a3, 0x7498, 0x749f, 0x749e, 0x74e2, 0x750c, 0x750d, 0x7634, 0x7638, 0x763a, 0x76e7, 0x76e5, 0x77a0, 0x779e, 0x779f, 0x77a5, 0x78e8, 0x78da, 0x78ec, 0x78e7, 0x79a6, 0x7a4d, 0x7a4e, 0x7a46, 0x7a4c, 0x7a4b, 0x7aba, 0x7bd9, 0x7c11, 0x7bc9, 0x7be4, 0x7bdb, 0x7be1, 0x7be9, 0x7be6, 0x7cd5, 0x7cd6, 0x7e0a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbfa1[ 94 ] = { 0x7e11, 0x7e08, 0x7e1b, 0x7e23, 0x7e1e, 0x7e1d, 0x7e09, 0x7e10, 0x7f79, 0x7fb2, 0x7ff0, 0x7ff1, 0x7fee, 0x8028, 0x81b3, 0x81a9, 0x81a8, 0x81fb, 0x8208, 0x8258, 0x8259, 0x854a, 0x8559, 0x8548, 0x8568, 0x8569, 0x8543, 0x8549, 0x856d, 0x856a, 0x855e, 0x8783, 0x879f, 0x879e, 0x87a2, 0x878d, 0x8861, 0x892a, 0x8932, 0x8925, 0x892b, 0x8921, 0x89aa, 0x89a6, 0x8ae6, 0x8afa, 0x8aeb, 0x8af1, 0x8b00, 0x8adc, 0x8ae7, 0x8aee, 0x8afe, 0x8b01, 0x8b02, 0x8af7, 0x8aed, 0x8af3, 0x8af6, 0x8afc, 0x8c6b, 0x8c6d, 0x8c93, 0x8cf4, 0x8e44, 0x8e31, 0x8e34, 0x8e42, 0x8e39, 0x8e35, 0x8f3b, 0x8f2f, 0x8f38, 0x8f33, 0x8fa8, 0x8fa6, 0x9075, 0x9074, 0x9078, 0x9072, 0x907c, 0x907a, 0x9134, 0x9192, 0x9320, 0x9336, 0x92f8, 0x9333, 0x932f, 0x9322, 0x92fc, 0x932b, 0x9304, 0x931a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc040[ 63 ] = { 0x9310, 0x9326, 0x9321, 0x9315, 0x932e, 0x9319, 0x95bb, 0x96a7, 0x96a8, 0x96aa, 0x96d5, 0x970e, 0x9711, 0x9716, 0x970d, 0x9713, 0x970f, 0x975b, 0x975c, 0x9766, 0x9798, 0x9830, 0x9838, 0x983b, 0x9837, 0x982d, 0x9839, 0x9824, 0x9910, 0x9928, 0x991e, 0x991b, 0x9921, 0x991a, 0x99ed, 0x99e2, 0x99f1, 0x9ab8, 0x9abc, 0x9afb, 0x9aed, 0x9b28, 0x9b91, 0x9d15, 0x9d23, 0x9d26, 0x9d28, 0x9d12, 0x9d1b, 0x9ed8, 0x9ed4, 0x9f8d, 0x9f9c, 0x512a, 0x511f, 0x5121, 0x5132, 0x52f5, 0x568e, 0x5680, 0x5690, 0x5685, 0x5687 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc0a1[ 94 ] = { 0x568f, 0x58d5, 0x58d3, 0x58d1, 0x58ce, 0x5b30, 0x5b2a, 0x5b24, 0x5b7a, 0x5c37, 0x5c68, 0x5dbc, 0x5dba, 0x5dbd, 0x5db8, 0x5e6b, 0x5f4c, 0x5fbd, 0x61c9, 0x61c2, 0x61c7, 0x61e6, 0x61cb, 0x6232, 0x6234, 0x64ce, 0x64ca, 0x64d8, 0x64e0, 0x64f0, 0x64e6, 0x64ec, 0x64f1, 0x64e2, 0x64ed, 0x6582, 0x6583, 0x66d9, 0x66d6, 0x6a80, 0x6a94, 0x6a84, 0x6aa2, 0x6a9c, 0x6adb, 0x6aa3, 0x6a7e, 0x6a97, 0x6a90, 0x6aa0, 0x6b5c, 0x6bae, 0x6bda, 0x6c08, 0x6fd8, 0x6ff1, 0x6fdf, 0x6fe0, 0x6fdb, 0x6fe4, 0x6feb, 0x6fef, 0x6f80, 0x6fec, 0x6fe1, 0x6fe9, 0x6fd5, 0x6fee, 0x6ff0, 0x71e7, 0x71df, 0x71ee, 0x71e6, 0x71e5, 0x71ed, 0x71ec, 0x71f4, 0x71e0, 0x7235, 0x7246, 0x7370, 0x7372, 0x74a9, 0x74b0, 0x74a6, 0x74a8, 0x7646, 0x7642, 0x764c, 0x76ea, 0x77b3, 0x77aa, 0x77b0, 0x77ac }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc140[ 63 ] = { 0x77a7, 0x77ad, 0x77ef, 0x78f7, 0x78fa, 0x78f4, 0x78ef, 0x7901, 0x79a7, 0x79aa, 0x7a57, 0x7abf, 0x7c07, 0x7c0d, 0x7bfe, 0x7bf7, 0x7c0c, 0x7be0, 0x7ce0, 0x7cdc, 0x7cde, 0x7ce2, 0x7cdf, 0x7cd9, 0x7cdd, 0x7e2e, 0x7e3e, 0x7e46, 0x7e37, 0x7e32, 0x7e43, 0x7e2b, 0x7e3d, 0x7e31, 0x7e45, 0x7e41, 0x7e34, 0x7e39, 0x7e48, 0x7e35, 0x7e3f, 0x7e2f, 0x7f44, 0x7ff3, 0x7ffc, 0x8071, 0x8072, 0x8070, 0x806f, 0x8073, 0x81c6, 0x81c3, 0x81ba, 0x81c2, 0x81c0, 0x81bf, 0x81bd, 0x81c9, 0x81be, 0x81e8, 0x8209, 0x8271, 0x85aa }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc1a1[ 94 ] = { 0x8584, 0x857e, 0x859c, 0x8591, 0x8594, 0x85af, 0x859b, 0x8587, 0x85a8, 0x858a, 0x8667, 0x87c0, 0x87d1, 0x87b3, 0x87d2, 0x87c6, 0x87ab, 0x87bb, 0x87ba, 0x87c8, 0x87cb, 0x893b, 0x8936, 0x8944, 0x8938, 0x893d, 0x89ac, 0x8b0e, 0x8b17, 0x8b19, 0x8b1b, 0x8b0a, 0x8b20, 0x8b1d, 0x8b04, 0x8b10, 0x8c41, 0x8c3f, 0x8c73, 0x8cfa, 0x8cfd, 0x8cfc, 0x8cf8, 0x8cfb, 0x8da8, 0x8e49, 0x8e4b, 0x8e48, 0x8e4a, 0x8f44, 0x8f3e, 0x8f42, 0x8f45, 0x8f3f, 0x907f, 0x907d, 0x9084, 0x9081, 0x9082, 0x9080, 0x9139, 0x91a3, 0x919e, 0x919c, 0x934d, 0x9382, 0x9328, 0x9375, 0x934a, 0x9365, 0x934b, 0x9318, 0x937e, 0x936c, 0x935b, 0x9370, 0x935a, 0x9354, 0x95ca, 0x95cb, 0x95cc, 0x95c8, 0x95c6, 0x96b1, 0x96b8, 0x96d6, 0x971c, 0x971e, 0x97a0, 0x97d3, 0x9846, 0x98b6, 0x9935, 0x9a01 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc240[ 63 ] = { 0x99ff, 0x9bae, 0x9bab, 0x9baa, 0x9bad, 0x9d3b, 0x9d3f, 0x9e8b, 0x9ecf, 0x9ede, 0x9edc, 0x9edd, 0x9edb, 0x9f3e, 0x9f4b, 0x53e2, 0x5695, 0x56ae, 0x58d9, 0x58d8, 0x5b38, 0x5f5d, 0x61e3, 0x6233, 0x64f4, 0x64f2, 0x64fe, 0x6506, 0x64fa, 0x64fb, 0x64f7, 0x65b7, 0x66dc, 0x6726, 0x6ab3, 0x6aac, 0x6ac3, 0x6abb, 0x6ab8, 0x6ac2, 0x6aae, 0x6aaf, 0x6b5f, 0x6b78, 0x6baf, 0x7009, 0x700b, 0x6ffe, 0x7006, 0x6ffa, 0x7011, 0x700f, 0x71fb, 0x71fc, 0x71fe, 0x71f8, 0x7377, 0x7375, 0x74a7, 0x74bf, 0x7515, 0x7656, 0x7658 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc2a1[ 94 ] = { 0x7652, 0x77bd, 0x77bf, 0x77bb, 0x77bc, 0x790e, 0x79ae, 0x7a61, 0x7a62, 0x7a60, 0x7ac4, 0x7ac5, 0x7c2b, 0x7c27, 0x7c2a, 0x7c1e, 0x7c23, 0x7c21, 0x7ce7, 0x7e54, 0x7e55, 0x7e5e, 0x7e5a, 0x7e61, 0x7e52, 0x7e59, 0x7f48, 0x7ff9, 0x7ffb, 0x8077, 0x8076, 0x81cd, 0x81cf, 0x820a, 0x85cf, 0x85a9, 0x85cd, 0x85d0, 0x85c9, 0x85b0, 0x85ba, 0x85b9, 0x85a6, 0x87ef, 0x87ec, 0x87f2, 0x87e0, 0x8986, 0x89b2, 0x89f4, 0x8b28, 0x8b39, 0x8b2c, 0x8b2b, 0x8c50, 0x8d05, 0x8e59, 0x8e63, 0x8e66, 0x8e64, 0x8e5f, 0x8e55, 0x8ec0, 0x8f49, 0x8f4d, 0x9087, 0x9083, 0x9088, 0x91ab, 0x91ac, 0x91d0, 0x9394, 0x938a, 0x9396, 0x93a2, 0x93b3, 0x93ae, 0x93ac, 0x93b0, 0x9398, 0x939a, 0x9397, 0x95d4, 0x95d6, 0x95d0, 0x95d5, 0x96e2, 0x96dc, 0x96d9, 0x96db, 0x96de, 0x9724, 0x97a3, 0x97a6 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc340[ 63 ] = { 0x97ad, 0x97f9, 0x984d, 0x984f, 0x984c, 0x984e, 0x9853, 0x98ba, 0x993e, 0x993f, 0x993d, 0x992e, 0x99a5, 0x9a0e, 0x9ac1, 0x9b03, 0x9b06, 0x9b4f, 0x9b4e, 0x9b4d, 0x9bca, 0x9bc9, 0x9bfd, 0x9bc8, 0x9bc0, 0x9d51, 0x9d5d, 0x9d60, 0x9ee0, 0x9f15, 0x9f2c, 0x5133, 0x56a5, 0x58de, 0x58df, 0x58e2, 0x5bf5, 0x9f90, 0x5eec, 0x61f2, 0x61f7, 0x61f6, 0x61f5, 0x6500, 0x650f, 0x66e0, 0x66dd, 0x6ae5, 0x6add, 0x6ada, 0x6ad3, 0x701b, 0x701f, 0x7028, 0x701a, 0x701d, 0x7015, 0x7018, 0x7206, 0x720d, 0x7258, 0x72a2, 0x7378 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc3a1[ 94 ] = { 0x737a, 0x74bd, 0x74ca, 0x74e3, 0x7587, 0x7586, 0x765f, 0x7661, 0x77c7, 0x7919, 0x79b1, 0x7a6b, 0x7a69, 0x7c3e, 0x7c3f, 0x7c38, 0x7c3d, 0x7c37, 0x7c40, 0x7e6b, 0x7e6d, 0x7e79, 0x7e69, 0x7e6a, 0x7f85, 0x7e73, 0x7fb6, 0x7fb9, 0x7fb8, 0x81d8, 0x85e9, 0x85dd, 0x85ea, 0x85d5, 0x85e4, 0x85e5, 0x85f7, 0x87fb, 0x8805, 0x880d, 0x87f9, 0x87fe, 0x8960, 0x895f, 0x8956, 0x895e, 0x8b41, 0x8b5c, 0x8b58, 0x8b49, 0x8b5a, 0x8b4e, 0x8b4f, 0x8b46, 0x8b59, 0x8d08, 0x8d0a, 0x8e7c, 0x8e72, 0x8e87, 0x8e76, 0x8e6c, 0x8e7a, 0x8e74, 0x8f54, 0x8f4e, 0x8fad, 0x908a, 0x908b, 0x91b1, 0x91ae, 0x93e1, 0x93d1, 0x93df, 0x93c3, 0x93c8, 0x93dc, 0x93dd, 0x93d6, 0x93e2, 0x93cd, 0x93d8, 0x93e4, 0x93d7, 0x93e8, 0x95dc, 0x96b4, 0x96e3, 0x972a, 0x9727, 0x9761, 0x97dc, 0x97fb, 0x985e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc440[ 63 ] = { 0x9858, 0x985b, 0x98bc, 0x9945, 0x9949, 0x9a16, 0x9a19, 0x9b0d, 0x9be8, 0x9be7, 0x9bd6, 0x9bdb, 0x9d89, 0x9d61, 0x9d72, 0x9d6a, 0x9d6c, 0x9e92, 0x9e97, 0x9e93, 0x9eb4, 0x52f8, 0x56a8, 0x56b7, 0x56b6, 0x56b4, 0x56bc, 0x58e4, 0x5b40, 0x5b43, 0x5b7d, 0x5bf6, 0x5dc9, 0x61f8, 0x61fa, 0x6518, 0x6514, 0x6519, 0x66e6, 0x6727, 0x6aec, 0x703e, 0x7030, 0x7032, 0x7210, 0x737b, 0x74cf, 0x7662, 0x7665, 0x7926, 0x792a, 0x792c, 0x792b, 0x7ac7, 0x7af6, 0x7c4c, 0x7c43, 0x7c4d, 0x7cef, 0x7cf0, 0x8fae, 0x7e7d, 0x7e7c }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc4a1[ 94 ] = { 0x7e82, 0x7f4c, 0x8000, 0x81da, 0x8266, 0x85fb, 0x85f9, 0x8611, 0x85fa, 0x8606, 0x860b, 0x8607, 0x860a, 0x8814, 0x8815, 0x8964, 0x89ba, 0x89f8, 0x8b70, 0x8b6c, 0x8b66, 0x8b6f, 0x8b5f, 0x8b6b, 0x8d0f, 0x8d0d, 0x8e89, 0x8e81, 0x8e85, 0x8e82, 0x91b4, 0x91cb, 0x9418, 0x9403, 0x93fd, 0x95e1, 0x9730, 0x98c4, 0x9952, 0x9951, 0x99a8, 0x9a2b, 0x9a30, 0x9a37, 0x9a35, 0x9c13, 0x9c0d, 0x9e79, 0x9eb5, 0x9ee8, 0x9f2f, 0x9f5f, 0x9f63, 0x9f61, 0x5137, 0x5138, 0x56c1, 0x56c0, 0x56c2, 0x5914, 0x5c6c, 0x5dcd, 0x61fc, 0x61fe, 0x651d, 0x651c, 0x6595, 0x66e9, 0x6afb, 0x6b04, 0x6afa, 0x6bb2, 0x704c, 0x721b, 0x72a7, 0x74d6, 0x74d4, 0x7669, 0x77d3, 0x7c50, 0x7e8f, 0x7e8c, 0x7fbc, 0x8617, 0x862d, 0x861a, 0x8823, 0x8822, 0x8821, 0x881f, 0x896a, 0x896c, 0x89bd, 0x8b74 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc540[ 63 ] = { 0x8b77, 0x8b7d, 0x8d13, 0x8e8a, 0x8e8d, 0x8e8b, 0x8f5f, 0x8faf, 0x91ba, 0x942e, 0x9433, 0x9435, 0x943a, 0x9438, 0x9432, 0x942b, 0x95e2, 0x9738, 0x9739, 0x9732, 0x97ff, 0x9867, 0x9865, 0x9957, 0x9a45, 0x9a43, 0x9a40, 0x9a3e, 0x9acf, 0x9b54, 0x9b51, 0x9c2d, 0x9c25, 0x9daf, 0x9db4, 0x9dc2, 0x9db8, 0x9e9d, 0x9eef, 0x9f19, 0x9f5c, 0x9f66, 0x9f67, 0x513c, 0x513b, 0x56c8, 0x56ca, 0x56c9, 0x5b7f, 0x5dd4, 0x5dd2, 0x5f4e, 0x61ff, 0x6524, 0x6b0a, 0x6b61, 0x7051, 0x7058, 0x7380, 0x74e4, 0x758a, 0x766e, 0x766c }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc5a1[ 94 ] = { 0x79b3, 0x7c60, 0x7c5f, 0x807e, 0x807d, 0x81df, 0x8972, 0x896f, 0x89fc, 0x8b80, 0x8d16, 0x8d17, 0x8e91, 0x8e93, 0x8f61, 0x9148, 0x9444, 0x9451, 0x9452, 0x973d, 0x973e, 0x97c3, 0x97c1, 0x986b, 0x9955, 0x9a55, 0x9a4d, 0x9ad2, 0x9b1a, 0x9c49, 0x9c31, 0x9c3e, 0x9c3b, 0x9dd3, 0x9dd7, 0x9f34, 0x9f6c, 0x9f6a, 0x9f94, 0x56cc, 0x5dd6, 0x6200, 0x6523, 0x652b, 0x652a, 0x66ec, 0x6b10, 0x74da, 0x7aca, 0x7c64, 0x7c63, 0x7c65, 0x7e93, 0x7e96, 0x7e94, 0x81e2, 0x8638, 0x863f, 0x8831, 0x8b8a, 0x9090, 0x908f, 0x9463, 0x9460, 0x9464, 0x9768, 0x986f, 0x995c, 0x9a5a, 0x9a5b, 0x9a57, 0x9ad3, 0x9ad4, 0x9ad1, 0x9c54, 0x9c57, 0x9c56, 0x9de5, 0x9e9f, 0x9ef4, 0x56d1, 0x58e9, 0x652c, 0x705e, 0x7671, 0x7672, 0x77d7, 0x7f50, 0x7f88, 0x8836, 0x8839, 0x8862, 0x8b93, 0x8b92 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc640[ 63 ] = { 0x8b96, 0x8277, 0x8d1b, 0x91c0, 0x946a, 0x9742, 0x9748, 0x9744, 0x97c6, 0x9870, 0x9a5f, 0x9b22, 0x9b58, 0x9c5f, 0x9df9, 0x9dfa, 0x9e7c, 0x9e7d, 0x9f07, 0x9f77, 0x9f72, 0x5ef3, 0x6b16, 0x7063, 0x7c6c, 0x7c6e, 0x883b, 0x89c0, 0x8ea1, 0x91c1, 0x9472, 0x9470, 0x9871, 0x995e, 0x9ad6, 0x9b23, 0x9ecc, 0x7064, 0x77da, 0x8b9a, 0x9477, 0x97c9, 0x9a62, 0x9a65, 0x7e9c, 0x8b9c, 0x8eaa, 0x91c5, 0x947d, 0x947e, 0x947c, 0x9c77, 0x9c78, 0x9ef7, 0x8c54, 0x947f, 0x9e1a, 0x7228, 0x9a6a, 0x9b31, 0x9e1b, 0x9e1e, 0x7c72 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc940[ 63 ] = { 0x4e42, 0x4e5c, 0x51f5, 0x531a, 0x5382, 0x4e07, 0x4e0c, 0x4e47, 0x4e8d, 0x56d7, 0xfa0c, 0x5c6e, 0x5f73, 0x4e0f, 0x5187, 0x4e0e, 0x4e2e, 0x4e93, 0x4ec2, 0x4ec9, 0x4ec8, 0x5198, 0x52fc, 0x536c, 0x53b9, 0x5720, 0x5903, 0x592c, 0x5c10, 0x5dff, 0x65e1, 0x6bb3, 0x6bcc, 0x6c14, 0x723f, 0x4e31, 0x4e3c, 0x4ee8, 0x4edc, 0x4ee9, 0x4ee1, 0x4edd, 0x4eda, 0x520c, 0x531c, 0x534c, 0x5722, 0x5723, 0x5917, 0x592f, 0x5b81, 0x5b84, 0x5c12, 0x5c3b, 0x5c74, 0x5c73, 0x5e04, 0x5e80, 0x5e82, 0x5fc9, 0x6209, 0x6250, 0x6c15 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc9a1[ 94 ] = { 0x6c36, 0x6c43, 0x6c3f, 0x6c3b, 0x72ae, 0x72b0, 0x738a, 0x79b8, 0x808a, 0x961e, 0x4f0e, 0x4f18, 0x4f2c, 0x4ef5, 0x4f14, 0x4ef1, 0x4f00, 0x4ef7, 0x4f08, 0x4f1d, 0x4f02, 0x4f05, 0x4f22, 0x4f13, 0x4f04, 0x4ef4, 0x4f12, 0x51b1, 0x5213, 0x5209, 0x5210, 0x52a6, 0x5322, 0x531f, 0x534d, 0x538a, 0x5407, 0x56e1, 0x56df, 0x572e, 0x572a, 0x5734, 0x593c, 0x5980, 0x597c, 0x5985, 0x597b, 0x597e, 0x5977, 0x597f, 0x5b56, 0x5c15, 0x5c25, 0x5c7c, 0x5c7a, 0x5c7b, 0x5c7e, 0x5ddf, 0x5e75, 0x5e84, 0x5f02, 0x5f1a, 0x5f74, 0x5fd5, 0x5fd4, 0x5fcf, 0x625c, 0x625e, 0x6264, 0x6261, 0x6266, 0x6262, 0x6259, 0x6260, 0x625a, 0x6265, 0x65ef, 0x65ee, 0x673e, 0x6739, 0x6738, 0x673b, 0x673a, 0x673f, 0x673c, 0x6733, 0x6c18, 0x6c46, 0x6c52, 0x6c5c, 0x6c4f, 0x6c4a, 0x6c54, 0x6c4b }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xca40[ 63 ] = { 0x6c4c, 0x7071, 0x725e, 0x72b4, 0x72b5, 0x738e, 0x752a, 0x767f, 0x7a75, 0x7f51, 0x8278, 0x827c, 0x8280, 0x827d, 0x827f, 0x864d, 0x897e, 0x9099, 0x9097, 0x9098, 0x909b, 0x9094, 0x9622, 0x9624, 0x9620, 0x9623, 0x4f56, 0x4f3b, 0x4f62, 0x4f49, 0x4f53, 0x4f64, 0x4f3e, 0x4f67, 0x4f52, 0x4f5f, 0x4f41, 0x4f58, 0x4f2d, 0x4f33, 0x4f3f, 0x4f61, 0x518f, 0x51b9, 0x521c, 0x521e, 0x5221, 0x52ad, 0x52ae, 0x5309, 0x5363, 0x5372, 0x538e, 0x538f, 0x5430, 0x5437, 0x542a, 0x5454, 0x5445, 0x5419, 0x541c, 0x5425, 0x5418 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcaa1[ 94 ] = { 0x543d, 0x544f, 0x5441, 0x5428, 0x5424, 0x5447, 0x56ee, 0x56e7, 0x56e5, 0x5741, 0x5745, 0x574c, 0x5749, 0x574b, 0x5752, 0x5906, 0x5940, 0x59a6, 0x5998, 0x59a0, 0x5997, 0x598e, 0x59a2, 0x5990, 0x598f, 0x59a7, 0x59a1, 0x5b8e, 0x5b92, 0x5c28, 0x5c2a, 0x5c8d, 0x5c8f, 0x5c88, 0x5c8b, 0x5c89, 0x5c92, 0x5c8a, 0x5c86, 0x5c93, 0x5c95, 0x5de0, 0x5e0a, 0x5e0e, 0x5e8b, 0x5e89, 0x5e8c, 0x5e88, 0x5e8d, 0x5f05, 0x5f1d, 0x5f78, 0x5f76, 0x5fd2, 0x5fd1, 0x5fd0, 0x5fed, 0x5fe8, 0x5fee, 0x5ff3, 0x5fe1, 0x5fe4, 0x5fe3, 0x5ffa, 0x5fef, 0x5ff7, 0x5ffb, 0x6000, 0x5ff4, 0x623a, 0x6283, 0x628c, 0x628e, 0x628f, 0x6294, 0x6287, 0x6271, 0x627b, 0x627a, 0x6270, 0x6281, 0x6288, 0x6277, 0x627d, 0x6272, 0x6274, 0x6537, 0x65f0, 0x65f4, 0x65f3, 0x65f2, 0x65f5, 0x6745, 0x6747 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcb40[ 63 ] = { 0x6759, 0x6755, 0x674c, 0x6748, 0x675d, 0x674d, 0x675a, 0x674b, 0x6bd0, 0x6c19, 0x6c1a, 0x6c78, 0x6c67, 0x6c6b, 0x6c84, 0x6c8b, 0x6c8f, 0x6c71, 0x6c6f, 0x6c69, 0x6c9a, 0x6c6d, 0x6c87, 0x6c95, 0x6c9c, 0x6c66, 0x6c73, 0x6c65, 0x6c7b, 0x6c8e, 0x7074, 0x707a, 0x7263, 0x72bf, 0x72bd, 0x72c3, 0x72c6, 0x72c1, 0x72ba, 0x72c5, 0x7395, 0x7397, 0x7393, 0x7394, 0x7392, 0x753a, 0x7539, 0x7594, 0x7595, 0x7681, 0x793d, 0x8034, 0x8095, 0x8099, 0x8090, 0x8092, 0x809c, 0x8290, 0x828f, 0x8285, 0x828e, 0x8291, 0x8293 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcba1[ 94 ] = { 0x828a, 0x8283, 0x8284, 0x8c78, 0x8fc9, 0x8fbf, 0x909f, 0x90a1, 0x90a5, 0x909e, 0x90a7, 0x90a0, 0x9630, 0x9628, 0x962f, 0x962d, 0x4e33, 0x4f98, 0x4f7c, 0x4f85, 0x4f7d, 0x4f80, 0x4f87, 0x4f76, 0x4f74, 0x4f89, 0x4f84, 0x4f77, 0x4f4c, 0x4f97, 0x4f6a, 0x4f9a, 0x4f79, 0x4f81, 0x4f78, 0x4f90, 0x4f9c, 0x4f94, 0x4f9e, 0x4f92, 0x4f82, 0x4f95, 0x4f6b, 0x4f6e, 0x519e, 0x51bc, 0x51be, 0x5235, 0x5232, 0x5233, 0x5246, 0x5231, 0x52bc, 0x530a, 0x530b, 0x533c, 0x5392, 0x5394, 0x5487, 0x547f, 0x5481, 0x5491, 0x5482, 0x5488, 0x546b, 0x547a, 0x547e, 0x5465, 0x546c, 0x5474, 0x5466, 0x548d, 0x546f, 0x5461, 0x5460, 0x5498, 0x5463, 0x5467, 0x5464, 0x56f7, 0x56f9, 0x576f, 0x5772, 0x576d, 0x576b, 0x5771, 0x5770, 0x5776, 0x5780, 0x5775, 0x577b, 0x5773, 0x5774, 0x5762 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcc40[ 63 ] = { 0x5768, 0x577d, 0x590c, 0x5945, 0x59b5, 0x59ba, 0x59cf, 0x59ce, 0x59b2, 0x59cc, 0x59c1, 0x59b6, 0x59bc, 0x59c3, 0x59d6, 0x59b1, 0x59bd, 0x59c0, 0x59c8, 0x59b4, 0x59c7, 0x5b62, 0x5b65, 0x5b93, 0x5b95, 0x5c44, 0x5c47, 0x5cae, 0x5ca4, 0x5ca0, 0x5cb5, 0x5caf, 0x5ca8, 0x5cac, 0x5c9f, 0x5ca3, 0x5cad, 0x5ca2, 0x5caa, 0x5ca7, 0x5c9d, 0x5ca5, 0x5cb6, 0x5cb0, 0x5ca6, 0x5e17, 0x5e14, 0x5e19, 0x5f28, 0x5f22, 0x5f23, 0x5f24, 0x5f54, 0x5f82, 0x5f7e, 0x5f7d, 0x5fde, 0x5fe5, 0x602d, 0x6026, 0x6019, 0x6032, 0x600b }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcca1[ 94 ] = { 0x6034, 0x600a, 0x6017, 0x6033, 0x601a, 0x601e, 0x602c, 0x6022, 0x600d, 0x6010, 0x602e, 0x6013, 0x6011, 0x600c, 0x6009, 0x601c, 0x6214, 0x623d, 0x62ad, 0x62b4, 0x62d1, 0x62be, 0x62aa, 0x62b6, 0x62ca, 0x62ae, 0x62b3, 0x62af, 0x62bb, 0x62a9, 0x62b0, 0x62b8, 0x653d, 0x65a8, 0x65bb, 0x6609, 0x65fc, 0x6604, 0x6612, 0x6608, 0x65fb, 0x6603, 0x660b, 0x660d, 0x6605, 0x65fd, 0x6611, 0x6610, 0x66f6, 0x670a, 0x6785, 0x676c, 0x678e, 0x6792, 0x6776, 0x677b, 0x6798, 0x6786, 0x6784, 0x6774, 0x678d, 0x678c, 0x677a, 0x679f, 0x6791, 0x6799, 0x6783, 0x677d, 0x6781, 0x6778, 0x6779, 0x6794, 0x6b25, 0x6b80, 0x6b7e, 0x6bde, 0x6c1d, 0x6c93, 0x6cec, 0x6ceb, 0x6cee, 0x6cd9, 0x6cb6, 0x6cd4, 0x6cad, 0x6ce7, 0x6cb7, 0x6cd0, 0x6cc2, 0x6cba, 0x6cc3, 0x6cc6, 0x6ced, 0x6cf2 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcd40[ 63 ] = { 0x6cd2, 0x6cdd, 0x6cb4, 0x6c8a, 0x6c9d, 0x6c80, 0x6cde, 0x6cc0, 0x6d30, 0x6ccd, 0x6cc7, 0x6cb0, 0x6cf9, 0x6ccf, 0x6ce9, 0x6cd1, 0x7094, 0x7098, 0x7085, 0x7093, 0x7086, 0x7084, 0x7091, 0x7096, 0x7082, 0x709a, 0x7083, 0x726a, 0x72d6, 0x72cb, 0x72d8, 0x72c9, 0x72dc, 0x72d2, 0x72d4, 0x72da, 0x72cc, 0x72d1, 0x73a4, 0x73a1, 0x73ad, 0x73a6, 0x73a2, 0x73a0, 0x73ac, 0x739d, 0x74dd, 0x74e8, 0x753f, 0x7540, 0x753e, 0x758c, 0x7598, 0x76af, 0x76f3, 0x76f1, 0x76f0, 0x76f5, 0x77f8, 0x77fc, 0x77f9, 0x77fb, 0x77fa }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcda1[ 94 ] = { 0x77f7, 0x7942, 0x793f, 0x79c5, 0x7a78, 0x7a7b, 0x7afb, 0x7c75, 0x7cfd, 0x8035, 0x808f, 0x80ae, 0x80a3, 0x80b8, 0x80b5, 0x80ad, 0x8220, 0x82a0, 0x82c0, 0x82ab, 0x829a, 0x8298, 0x829b, 0x82b5, 0x82a7, 0x82ae, 0x82bc, 0x829e, 0x82ba, 0x82b4, 0x82a8, 0x82a1, 0x82a9, 0x82c2, 0x82a4, 0x82c3, 0x82b6, 0x82a2, 0x8670, 0x866f, 0x866d, 0x866e, 0x8c56, 0x8fd2, 0x8fcb, 0x8fd3, 0x8fcd, 0x8fd6, 0x8fd5, 0x8fd7, 0x90b2, 0x90b4, 0x90af, 0x90b3, 0x90b0, 0x9639, 0x963d, 0x963c, 0x963a, 0x9643, 0x4fcd, 0x4fc5, 0x4fd3, 0x4fb2, 0x4fc9, 0x4fcb, 0x4fc1, 0x4fd4, 0x4fdc, 0x4fd9, 0x4fbb, 0x4fb3, 0x4fdb, 0x4fc7, 0x4fd6, 0x4fba, 0x4fc0, 0x4fb9, 0x4fec, 0x5244, 0x5249, 0x52c0, 0x52c2, 0x533d, 0x537c, 0x5397, 0x5396, 0x5399, 0x5398, 0x54ba, 0x54a1, 0x54ad, 0x54a5, 0x54cf }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xce40[ 63 ] = { 0x54c3, 0x830d, 0x54b7, 0x54ae, 0x54d6, 0x54b6, 0x54c5, 0x54c6, 0x54a0, 0x5470, 0x54bc, 0x54a2, 0x54be, 0x5472, 0x54de, 0x54b0, 0x57b5, 0x579e, 0x579f, 0x57a4, 0x578c, 0x5797, 0x579d, 0x579b, 0x5794, 0x5798, 0x578f, 0x5799, 0x57a5, 0x579a, 0x5795, 0x58f4, 0x590d, 0x5953, 0x59e1, 0x59de, 0x59ee, 0x5a00, 0x59f1, 0x59dd, 0x59fa, 0x59fd, 0x59fc, 0x59f6, 0x59e4, 0x59f2, 0x59f7, 0x59db, 0x59e9, 0x59f3, 0x59f5, 0x59e0, 0x59fe, 0x59f4, 0x59ed, 0x5ba8, 0x5c4c, 0x5cd0, 0x5cd8, 0x5ccc, 0x5cd7, 0x5ccb, 0x5cdb }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcea1[ 94 ] = { 0x5cde, 0x5cda, 0x5cc9, 0x5cc7, 0x5cca, 0x5cd6, 0x5cd3, 0x5cd4, 0x5ccf, 0x5cc8, 0x5cc6, 0x5cce, 0x5cdf, 0x5cf8, 0x5df9, 0x5e21, 0x5e22, 0x5e23, 0x5e20, 0x5e24, 0x5eb0, 0x5ea4, 0x5ea2, 0x5e9b, 0x5ea3, 0x5ea5, 0x5f07, 0x5f2e, 0x5f56, 0x5f86, 0x6037, 0x6039, 0x6054, 0x6072, 0x605e, 0x6045, 0x6053, 0x6047, 0x6049, 0x605b, 0x604c, 0x6040, 0x6042, 0x605f, 0x6024, 0x6044, 0x6058, 0x6066, 0x606e, 0x6242, 0x6243, 0x62cf, 0x630d, 0x630b, 0x62f5, 0x630e, 0x6303, 0x62eb, 0x62f9, 0x630f, 0x630c, 0x62f8, 0x62f6, 0x6300, 0x6313, 0x6314, 0x62fa, 0x6315, 0x62fb, 0x62f0, 0x6541, 0x6543, 0x65aa, 0x65bf, 0x6636, 0x6621, 0x6632, 0x6635, 0x661c, 0x6626, 0x6622, 0x6633, 0x662b, 0x663a, 0x661d, 0x6634, 0x6639, 0x662e, 0x670f, 0x6710, 0x67c1, 0x67f2, 0x67c8, 0x67ba }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcf40[ 63 ] = { 0x67dc, 0x67bb, 0x67f8, 0x67d8, 0x67c0, 0x67b7, 0x67c5, 0x67eb, 0x67e4, 0x67df, 0x67b5, 0x67cd, 0x67b3, 0x67f7, 0x67f6, 0x67ee, 0x67e3, 0x67c2, 0x67b9, 0x67ce, 0x67e7, 0x67f0, 0x67b2, 0x67fc, 0x67c6, 0x67ed, 0x67cc, 0x67ae, 0x67e6, 0x67db, 0x67fa, 0x67c9, 0x67ca, 0x67c3, 0x67ea, 0x67cb, 0x6b28, 0x6b82, 0x6b84, 0x6bb6, 0x6bd6, 0x6bd8, 0x6be0, 0x6c20, 0x6c21, 0x6d28, 0x6d34, 0x6d2d, 0x6d1f, 0x6d3c, 0x6d3f, 0x6d12, 0x6d0a, 0x6cda, 0x6d33, 0x6d04, 0x6d19, 0x6d3a, 0x6d1a, 0x6d11, 0x6d00, 0x6d1d, 0x6d42 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcfa1[ 94 ] = { 0x6d01, 0x6d18, 0x6d37, 0x6d03, 0x6d0f, 0x6d40, 0x6d07, 0x6d20, 0x6d2c, 0x6d08, 0x6d22, 0x6d09, 0x6d10, 0x70b7, 0x709f, 0x70be, 0x70b1, 0x70b0, 0x70a1, 0x70b4, 0x70b5, 0x70a9, 0x7241, 0x7249, 0x724a, 0x726c, 0x7270, 0x7273, 0x726e, 0x72ca, 0x72e4, 0x72e8, 0x72eb, 0x72df, 0x72ea, 0x72e6, 0x72e3, 0x7385, 0x73cc, 0x73c2, 0x73c8, 0x73c5, 0x73b9, 0x73b6, 0x73b5, 0x73b4, 0x73eb, 0x73bf, 0x73c7, 0x73be, 0x73c3, 0x73c6, 0x73b8, 0x73cb, 0x74ec, 0x74ee, 0x752e, 0x7547, 0x7548, 0x75a7, 0x75aa, 0x7679, 0x76c4, 0x7708, 0x7703, 0x7704, 0x7705, 0x770a, 0x76f7, 0x76fb, 0x76fa, 0x77e7, 0x77e8, 0x7806, 0x7811, 0x7812, 0x7805, 0x7810, 0x780f, 0x780e, 0x7809, 0x7803, 0x7813, 0x794a, 0x794c, 0x794b, 0x7945, 0x7944, 0x79d5, 0x79cd, 0x79cf, 0x79d6, 0x79ce, 0x7a80 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd040[ 63 ] = { 0x7a7e, 0x7ad1, 0x7b00, 0x7b01, 0x7c7a, 0x7c78, 0x7c79, 0x7c7f, 0x7c80, 0x7c81, 0x7d03, 0x7d08, 0x7d01, 0x7f58, 0x7f91, 0x7f8d, 0x7fbe, 0x8007, 0x800e, 0x800f, 0x8014, 0x8037, 0x80d8, 0x80c7, 0x80e0, 0x80d1, 0x80c8, 0x80c2, 0x80d0, 0x80c5, 0x80e3, 0x80d9, 0x80dc, 0x80ca, 0x80d5, 0x80c9, 0x80cf, 0x80d7, 0x80e6, 0x80cd, 0x81ff, 0x8221, 0x8294, 0x82d9, 0x82fe, 0x82f9, 0x8307, 0x82e8, 0x8300, 0x82d5, 0x833a, 0x82eb, 0x82d6, 0x82f4, 0x82ec, 0x82e1, 0x82f2, 0x82f5, 0x830c, 0x82fb, 0x82f6, 0x82f0, 0x82ea }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd0a1[ 94 ] = { 0x82e4, 0x82e0, 0x82fa, 0x82f3, 0x82ed, 0x8677, 0x8674, 0x867c, 0x8673, 0x8841, 0x884e, 0x8867, 0x886a, 0x8869, 0x89d3, 0x8a04, 0x8a07, 0x8d72, 0x8fe3, 0x8fe1, 0x8fee, 0x8fe0, 0x90f1, 0x90bd, 0x90bf, 0x90d5, 0x90c5, 0x90be, 0x90c7, 0x90cb, 0x90c8, 0x91d4, 0x91d3, 0x9654, 0x964f, 0x9651, 0x9653, 0x964a, 0x964e, 0x501e, 0x5005, 0x5007, 0x5013, 0x5022, 0x5030, 0x501b, 0x4ff5, 0x4ff4, 0x5033, 0x5037, 0x502c, 0x4ff6, 0x4ff7, 0x5017, 0x501c, 0x5020, 0x5027, 0x5035, 0x502f, 0x5031, 0x500e, 0x515a, 0x5194, 0x5193, 0x51ca, 0x51c4, 0x51c5, 0x51c8, 0x51ce, 0x5261, 0x525a, 0x5252, 0x525e, 0x525f, 0x5255, 0x5262, 0x52cd, 0x530e, 0x539e, 0x5526, 0x54e2, 0x5517, 0x5512, 0x54e7, 0x54f3, 0x54e4, 0x551a, 0x54ff, 0x5504, 0x5508, 0x54eb, 0x5511, 0x5505, 0x54f1 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd140[ 63 ] = { 0x550a, 0x54fb, 0x54f7, 0x54f8, 0x54e0, 0x550e, 0x5503, 0x550b, 0x5701, 0x5702, 0x57cc, 0x5832, 0x57d5, 0x57d2, 0x57ba, 0x57c6, 0x57bd, 0x57bc, 0x57b8, 0x57b6, 0x57bf, 0x57c7, 0x57d0, 0x57b9, 0x57c1, 0x590e, 0x594a, 0x5a19, 0x5a16, 0x5a2d, 0x5a2e, 0x5a15, 0x5a0f, 0x5a17, 0x5a0a, 0x5a1e, 0x5a33, 0x5b6c, 0x5ba7, 0x5bad, 0x5bac, 0x5c03, 0x5c56, 0x5c54, 0x5cec, 0x5cff, 0x5cee, 0x5cf1, 0x5cf7, 0x5d00, 0x5cf9, 0x5e29, 0x5e28, 0x5ea8, 0x5eae, 0x5eaa, 0x5eac, 0x5f33, 0x5f30, 0x5f67, 0x605d, 0x605a, 0x6067 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd1a1[ 94 ] = { 0x6041, 0x60a2, 0x6088, 0x6080, 0x6092, 0x6081, 0x609d, 0x6083, 0x6095, 0x609b, 0x6097, 0x6087, 0x609c, 0x608e, 0x6219, 0x6246, 0x62f2, 0x6310, 0x6356, 0x632c, 0x6344, 0x6345, 0x6336, 0x6343, 0x63e4, 0x6339, 0x634b, 0x634a, 0x633c, 0x6329, 0x6341, 0x6334, 0x6358, 0x6354, 0x6359, 0x632d, 0x6347, 0x6333, 0x635a, 0x6351, 0x6338, 0x6357, 0x6340, 0x6348, 0x654a, 0x6546, 0x65c6, 0x65c3, 0x65c4, 0x65c2, 0x664a, 0x665f, 0x6647, 0x6651, 0x6712, 0x6713, 0x681f, 0x681a, 0x6849, 0x6832, 0x6833, 0x683b, 0x684b, 0x684f, 0x6816, 0x6831, 0x681c, 0x6835, 0x682b, 0x682d, 0x682f, 0x684e, 0x6844, 0x6834, 0x681d, 0x6812, 0x6814, 0x6826, 0x6828, 0x682e, 0x684d, 0x683a, 0x6825, 0x6820, 0x6b2c, 0x6b2f, 0x6b2d, 0x6b31, 0x6b34, 0x6b6d, 0x8082, 0x6b88, 0x6be6, 0x6be4 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd240[ 63 ] = { 0x6be8, 0x6be3, 0x6be2, 0x6be7, 0x6c25, 0x6d7a, 0x6d63, 0x6d64, 0x6d76, 0x6d0d, 0x6d61, 0x6d92, 0x6d58, 0x6d62, 0x6d6d, 0x6d6f, 0x6d91, 0x6d8d, 0x6def, 0x6d7f, 0x6d86, 0x6d5e, 0x6d67, 0x6d60, 0x6d97, 0x6d70, 0x6d7c, 0x6d5f, 0x6d82, 0x6d98, 0x6d2f, 0x6d68, 0x6d8b, 0x6d7e, 0x6d80, 0x6d84, 0x6d16, 0x6d83, 0x6d7b, 0x6d7d, 0x6d75, 0x6d90, 0x70dc, 0x70d3, 0x70d1, 0x70dd, 0x70cb, 0x7f39, 0x70e2, 0x70d7, 0x70d2, 0x70de, 0x70e0, 0x70d4, 0x70cd, 0x70c5, 0x70c6, 0x70c7, 0x70da, 0x70ce, 0x70e1, 0x7242, 0x7278 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd2a1[ 94 ] = { 0x7277, 0x7276, 0x7300, 0x72fa, 0x72f4, 0x72fe, 0x72f6, 0x72f3, 0x72fb, 0x7301, 0x73d3, 0x73d9, 0x73e5, 0x73d6, 0x73bc, 0x73e7, 0x73e3, 0x73e9, 0x73dc, 0x73d2, 0x73db, 0x73d4, 0x73dd, 0x73da, 0x73d7, 0x73d8, 0x73e8, 0x74de, 0x74df, 0x74f4, 0x74f5, 0x7521, 0x755b, 0x755f, 0x75b0, 0x75c1, 0x75bb, 0x75c4, 0x75c0, 0x75bf, 0x75b6, 0x75ba, 0x768a, 0x76c9, 0x771d, 0x771b, 0x7710, 0x7713, 0x7712, 0x7723, 0x7711, 0x7715, 0x7719, 0x771a, 0x7722, 0x7727, 0x7823, 0x782c, 0x7822, 0x7835, 0x782f, 0x7828, 0x782e, 0x782b, 0x7821, 0x7829, 0x7833, 0x782a, 0x7831, 0x7954, 0x795b, 0x794f, 0x795c, 0x7953, 0x7952, 0x7951, 0x79eb, 0x79ec, 0x79e0, 0x79ee, 0x79ed, 0x79ea, 0x79dc, 0x79de, 0x79dd, 0x7a86, 0x7a89, 0x7a85, 0x7a8b, 0x7a8c, 0x7a8a, 0x7a87, 0x7ad8, 0x7b10 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd340[ 63 ] = { 0x7b04, 0x7b13, 0x7b05, 0x7b0f, 0x7b08, 0x7b0a, 0x7b0e, 0x7b09, 0x7b12, 0x7c84, 0x7c91, 0x7c8a, 0x7c8c, 0x7c88, 0x7c8d, 0x7c85, 0x7d1e, 0x7d1d, 0x7d11, 0x7d0e, 0x7d18, 0x7d16, 0x7d13, 0x7d1f, 0x7d12, 0x7d0f, 0x7d0c, 0x7f5c, 0x7f61, 0x7f5e, 0x7f60, 0x7f5d, 0x7f5b, 0x7f96, 0x7f92, 0x7fc3, 0x7fc2, 0x7fc0, 0x8016, 0x803e, 0x8039, 0x80fa, 0x80f2, 0x80f9, 0x80f5, 0x8101, 0x80fb, 0x8100, 0x8201, 0x822f, 0x8225, 0x8333, 0x832d, 0x8344, 0x8319, 0x8351, 0x8325, 0x8356, 0x833f, 0x8341, 0x8326, 0x831c, 0x8322 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd3a1[ 94 ] = { 0x8342, 0x834e, 0x831b, 0x832a, 0x8308, 0x833c, 0x834d, 0x8316, 0x8324, 0x8320, 0x8337, 0x832f, 0x8329, 0x8347, 0x8345, 0x834c, 0x8353, 0x831e, 0x832c, 0x834b, 0x8327, 0x8348, 0x8653, 0x8652, 0x86a2, 0x86a8, 0x8696, 0x868d, 0x8691, 0x869e, 0x8687, 0x8697, 0x8686, 0x868b, 0x869a, 0x8685, 0x86a5, 0x8699, 0x86a1, 0x86a7, 0x8695, 0x8698, 0x868e, 0x869d, 0x8690, 0x8694, 0x8843, 0x8844, 0x886d, 0x8875, 0x8876, 0x8872, 0x8880, 0x8871, 0x887f, 0x886f, 0x8883, 0x887e, 0x8874, 0x887c, 0x8a12, 0x8c47, 0x8c57, 0x8c7b, 0x8ca4, 0x8ca3, 0x8d76, 0x8d78, 0x8db5, 0x8db7, 0x8db6, 0x8ed1, 0x8ed3, 0x8ffe, 0x8ff5, 0x9002, 0x8fff, 0x8ffb, 0x9004, 0x8ffc, 0x8ff6, 0x90d6, 0x90e0, 0x90d9, 0x90da, 0x90e3, 0x90df, 0x90e5, 0x90d8, 0x90db, 0x90d7, 0x90dc, 0x90e4, 0x9150 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd440[ 63 ] = { 0x914e, 0x914f, 0x91d5, 0x91e2, 0x91da, 0x965c, 0x965f, 0x96bc, 0x98e3, 0x9adf, 0x9b2f, 0x4e7f, 0x5070, 0x506a, 0x5061, 0x505e, 0x5060, 0x5053, 0x504b, 0x505d, 0x5072, 0x5048, 0x504d, 0x5041, 0x505b, 0x504a, 0x5062, 0x5015, 0x5045, 0x505f, 0x5069, 0x506b, 0x5063, 0x5064, 0x5046, 0x5040, 0x506e, 0x5073, 0x5057, 0x5051, 0x51d0, 0x526b, 0x526d, 0x526c, 0x526e, 0x52d6, 0x52d3, 0x532d, 0x539c, 0x5575, 0x5576, 0x553c, 0x554d, 0x5550, 0x5534, 0x552a, 0x5551, 0x5562, 0x5536, 0x5535, 0x5530, 0x5552, 0x5545 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd4a1[ 94 ] = { 0x550c, 0x5532, 0x5565, 0x554e, 0x5539, 0x5548, 0x552d, 0x553b, 0x5540, 0x554b, 0x570a, 0x5707, 0x57fb, 0x5814, 0x57e2, 0x57f6, 0x57dc, 0x57f4, 0x5800, 0x57ed, 0x57fd, 0x5808, 0x57f8, 0x580b, 0x57f3, 0x57cf, 0x5807, 0x57ee, 0x57e3, 0x57f2, 0x57e5, 0x57ec, 0x57e1, 0x580e, 0x57fc, 0x5810, 0x57e7, 0x5801, 0x580c, 0x57f1, 0x57e9, 0x57f0, 0x580d, 0x5804, 0x595c, 0x5a60, 0x5a58, 0x5a55, 0x5a67, 0x5a5e, 0x5a38, 0x5a35, 0x5a6d, 0x5a50, 0x5a5f, 0x5a65, 0x5a6c, 0x5a53, 0x5a64, 0x5a57, 0x5a43, 0x5a5d, 0x5a52, 0x5a44, 0x5a5b, 0x5a48, 0x5a8e, 0x5a3e, 0x5a4d, 0x5a39, 0x5a4c, 0x5a70, 0x5a69, 0x5a47, 0x5a51, 0x5a56, 0x5a42, 0x5a5c, 0x5b72, 0x5b6e, 0x5bc1, 0x5bc0, 0x5c59, 0x5d1e, 0x5d0b, 0x5d1d, 0x5d1a, 0x5d20, 0x5d0c, 0x5d28, 0x5d0d, 0x5d26, 0x5d25, 0x5d0f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd540[ 63 ] = { 0x5d30, 0x5d12, 0x5d23, 0x5d1f, 0x5d2e, 0x5e3e, 0x5e34, 0x5eb1, 0x5eb4, 0x5eb9, 0x5eb2, 0x5eb3, 0x5f36, 0x5f38, 0x5f9b, 0x5f96, 0x5f9f, 0x608a, 0x6090, 0x6086, 0x60be, 0x60b0, 0x60ba, 0x60d3, 0x60d4, 0x60cf, 0x60e4, 0x60d9, 0x60dd, 0x60c8, 0x60b1, 0x60db, 0x60b7, 0x60ca, 0x60bf, 0x60c3, 0x60cd, 0x60c0, 0x6332, 0x6365, 0x638a, 0x6382, 0x637d, 0x63bd, 0x639e, 0x63ad, 0x639d, 0x6397, 0x63ab, 0x638e, 0x636f, 0x6387, 0x6390, 0x636e, 0x63af, 0x6375, 0x639c, 0x636d, 0x63ae, 0x637c, 0x63a4, 0x633b, 0x639f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd5a1[ 94 ] = { 0x6378, 0x6385, 0x6381, 0x6391, 0x638d, 0x6370, 0x6553, 0x65cd, 0x6665, 0x6661, 0x665b, 0x6659, 0x665c, 0x6662, 0x6718, 0x6879, 0x6887, 0x6890, 0x689c, 0x686d, 0x686e, 0x68ae, 0x68ab, 0x6956, 0x686f, 0x68a3, 0x68ac, 0x68a9, 0x6875, 0x6874, 0x68b2, 0x688f, 0x6877, 0x6892, 0x687c, 0x686b, 0x6872, 0x68aa, 0x6880, 0x6871, 0x687e, 0x689b, 0x6896, 0x688b, 0x68a0, 0x6889, 0x68a4, 0x6878, 0x687b, 0x6891, 0x688c, 0x688a, 0x687d, 0x6b36, 0x6b33, 0x6b37, 0x6b38, 0x6b91, 0x6b8f, 0x6b8d, 0x6b8e, 0x6b8c, 0x6c2a, 0x6dc0, 0x6dab, 0x6db4, 0x6db3, 0x6e74, 0x6dac, 0x6de9, 0x6de2, 0x6db7, 0x6df6, 0x6dd4, 0x6e00, 0x6dc8, 0x6de0, 0x6ddf, 0x6dd6, 0x6dbe, 0x6de5, 0x6ddc, 0x6ddd, 0x6ddb, 0x6df4, 0x6dca, 0x6dbd, 0x6ded, 0x6df0, 0x6dba, 0x6dd5, 0x6dc2, 0x6dcf, 0x6dc9 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd640[ 63 ] = { 0x6dd0, 0x6df2, 0x6dd3, 0x6dfd, 0x6dd7, 0x6dcd, 0x6de3, 0x6dbb, 0x70fa, 0x710d, 0x70f7, 0x7117, 0x70f4, 0x710c, 0x70f0, 0x7104, 0x70f3, 0x7110, 0x70fc, 0x70ff, 0x7106, 0x7113, 0x7100, 0x70f8, 0x70f6, 0x710b, 0x7102, 0x710e, 0x727e, 0x727b, 0x727c, 0x727f, 0x731d, 0x7317, 0x7307, 0x7311, 0x7318, 0x730a, 0x7308, 0x72ff, 0x730f, 0x731e, 0x7388, 0x73f6, 0x73f8, 0x73f5, 0x7404, 0x7401, 0x73fd, 0x7407, 0x7400, 0x73fa, 0x73fc, 0x73ff, 0x740c, 0x740b, 0x73f4, 0x7408, 0x7564, 0x7563, 0x75ce, 0x75d2, 0x75cf }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd6a1[ 94 ] = { 0x75cb, 0x75cc, 0x75d1, 0x75d0, 0x768f, 0x7689, 0x76d3, 0x7739, 0x772f, 0x772d, 0x7731, 0x7732, 0x7734, 0x7733, 0x773d, 0x7725, 0x773b, 0x7735, 0x7848, 0x7852, 0x7849, 0x784d, 0x784a, 0x784c, 0x7826, 0x7845, 0x7850, 0x7964, 0x7967, 0x7969, 0x796a, 0x7963, 0x796b, 0x7961, 0x79bb, 0x79fa, 0x79f8, 0x79f6, 0x79f7, 0x7a8f, 0x7a94, 0x7a90, 0x7b35, 0x7b47, 0x7b34, 0x7b25, 0x7b30, 0x7b22, 0x7b24, 0x7b33, 0x7b18, 0x7b2a, 0x7b1d, 0x7b31, 0x7b2b, 0x7b2d, 0x7b2f, 0x7b32, 0x7b38, 0x7b1a, 0x7b23, 0x7c94, 0x7c98, 0x7c96, 0x7ca3, 0x7d35, 0x7d3d, 0x7d38, 0x7d36, 0x7d3a, 0x7d45, 0x7d2c, 0x7d29, 0x7d41, 0x7d47, 0x7d3e, 0x7d3f, 0x7d4a, 0x7d3b, 0x7d28, 0x7f63, 0x7f95, 0x7f9c, 0x7f9d, 0x7f9b, 0x7fca, 0x7fcb, 0x7fcd, 0x7fd0, 0x7fd1, 0x7fc7, 0x7fcf, 0x7fc9, 0x801f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd740[ 63 ] = { 0x801e, 0x801b, 0x8047, 0x8043, 0x8048, 0x8118, 0x8125, 0x8119, 0x811b, 0x812d, 0x811f, 0x812c, 0x811e, 0x8121, 0x8115, 0x8127, 0x811d, 0x8122, 0x8211, 0x8238, 0x8233, 0x823a, 0x8234, 0x8232, 0x8274, 0x8390, 0x83a3, 0x83a8, 0x838d, 0x837a, 0x8373, 0x83a4, 0x8374, 0x838f, 0x8381, 0x8395, 0x8399, 0x8375, 0x8394, 0x83a9, 0x837d, 0x8383, 0x838c, 0x839d, 0x839b, 0x83aa, 0x838b, 0x837e, 0x83a5, 0x83af, 0x8388, 0x8397, 0x83b0, 0x837f, 0x83a6, 0x8387, 0x83ae, 0x8376, 0x839a, 0x8659, 0x8656, 0x86bf, 0x86b7 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd7a1[ 94 ] = { 0x86c2, 0x86c1, 0x86c5, 0x86ba, 0x86b0, 0x86c8, 0x86b9, 0x86b3, 0x86b8, 0x86cc, 0x86b4, 0x86bb, 0x86bc, 0x86c3, 0x86bd, 0x86be, 0x8852, 0x8889, 0x8895, 0x88a8, 0x88a2, 0x88aa, 0x889a, 0x8891, 0x88a1, 0x889f, 0x8898, 0x88a7, 0x8899, 0x889b, 0x8897, 0x88a4, 0x88ac, 0x888c, 0x8893, 0x888e, 0x8982, 0x89d6, 0x89d9, 0x89d5, 0x8a30, 0x8a27, 0x8a2c, 0x8a1e, 0x8c39, 0x8c3b, 0x8c5c, 0x8c5d, 0x8c7d, 0x8ca5, 0x8d7d, 0x8d7b, 0x8d79, 0x8dbc, 0x8dc2, 0x8db9, 0x8dbf, 0x8dc1, 0x8ed8, 0x8ede, 0x8edd, 0x8edc, 0x8ed7, 0x8ee0, 0x8ee1, 0x9024, 0x900b, 0x9011, 0x901c, 0x900c, 0x9021, 0x90ef, 0x90ea, 0x90f0, 0x90f4, 0x90f2, 0x90f3, 0x90d4, 0x90eb, 0x90ec, 0x90e9, 0x9156, 0x9158, 0x915a, 0x9153, 0x9155, 0x91ec, 0x91f4, 0x91f1, 0x91f3, 0x91f8, 0x91e4, 0x91f9, 0x91ea }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd840[ 63 ] = { 0x91eb, 0x91f7, 0x91e8, 0x91ee, 0x957a, 0x9586, 0x9588, 0x967c, 0x966d, 0x966b, 0x9671, 0x966f, 0x96bf, 0x976a, 0x9804, 0x98e5, 0x9997, 0x509b, 0x5095, 0x5094, 0x509e, 0x508b, 0x50a3, 0x5083, 0x508c, 0x508e, 0x509d, 0x5068, 0x509c, 0x5092, 0x5082, 0x5087, 0x515f, 0x51d4, 0x5312, 0x5311, 0x53a4, 0x53a7, 0x5591, 0x55a8, 0x55a5, 0x55ad, 0x5577, 0x5645, 0x55a2, 0x5593, 0x5588, 0x558f, 0x55b5, 0x5581, 0x55a3, 0x5592, 0x55a4, 0x557d, 0x558c, 0x55a6, 0x557f, 0x5595, 0x55a1, 0x558e, 0x570c, 0x5829, 0x5837 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd8a1[ 94 ] = { 0x5819, 0x581e, 0x5827, 0x5823, 0x5828, 0x57f5, 0x5848, 0x5825, 0x581c, 0x581b, 0x5833, 0x583f, 0x5836, 0x582e, 0x5839, 0x5838, 0x582d, 0x582c, 0x583b, 0x5961, 0x5aaf, 0x5a94, 0x5a9f, 0x5a7a, 0x5aa2, 0x5a9e, 0x5a78, 0x5aa6, 0x5a7c, 0x5aa5, 0x5aac, 0x5a95, 0x5aae, 0x5a37, 0x5a84, 0x5a8a, 0x5a97, 0x5a83, 0x5a8b, 0x5aa9, 0x5a7b, 0x5a7d, 0x5a8c, 0x5a9c, 0x5a8f, 0x5a93, 0x5a9d, 0x5bea, 0x5bcd, 0x5bcb, 0x5bd4, 0x5bd1, 0x5bca, 0x5bce, 0x5c0c, 0x5c30, 0x5d37, 0x5d43, 0x5d6b, 0x5d41, 0x5d4b, 0x5d3f, 0x5d35, 0x5d51, 0x5d4e, 0x5d55, 0x5d33, 0x5d3a, 0x5d52, 0x5d3d, 0x5d31, 0x5d59, 0x5d42, 0x5d39, 0x5d49, 0x5d38, 0x5d3c, 0x5d32, 0x5d36, 0x5d40, 0x5d45, 0x5e44, 0x5e41, 0x5f58, 0x5fa6, 0x5fa5, 0x5fab, 0x60c9, 0x60b9, 0x60cc, 0x60e2, 0x60ce, 0x60c4, 0x6114 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd940[ 63 ] = { 0x60f2, 0x610a, 0x6116, 0x6105, 0x60f5, 0x6113, 0x60f8, 0x60fc, 0x60fe, 0x60c1, 0x6103, 0x6118, 0x611d, 0x6110, 0x60ff, 0x6104, 0x610b, 0x624a, 0x6394, 0x63b1, 0x63b0, 0x63ce, 0x63e5, 0x63e8, 0x63ef, 0x63c3, 0x649d, 0x63f3, 0x63ca, 0x63e0, 0x63f6, 0x63d5, 0x63f2, 0x63f5, 0x6461, 0x63df, 0x63be, 0x63dd, 0x63dc, 0x63c4, 0x63d8, 0x63d3, 0x63c2, 0x63c7, 0x63cc, 0x63cb, 0x63c8, 0x63f0, 0x63d7, 0x63d9, 0x6532, 0x6567, 0x656a, 0x6564, 0x655c, 0x6568, 0x6565, 0x658c, 0x659d, 0x659e, 0x65ae, 0x65d0, 0x65d2 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd9a1[ 94 ] = { 0x667c, 0x666c, 0x667b, 0x6680, 0x6671, 0x6679, 0x666a, 0x6672, 0x6701, 0x690c, 0x68d3, 0x6904, 0x68dc, 0x692a, 0x68ec, 0x68ea, 0x68f1, 0x690f, 0x68d6, 0x68f7, 0x68eb, 0x68e4, 0x68f6, 0x6913, 0x6910, 0x68f3, 0x68e1, 0x6907, 0x68cc, 0x6908, 0x6970, 0x68b4, 0x6911, 0x68ef, 0x68c6, 0x6914, 0x68f8, 0x68d0, 0x68fd, 0x68fc, 0x68e8, 0x690b, 0x690a, 0x6917, 0x68ce, 0x68c8, 0x68dd, 0x68de, 0x68e6, 0x68f4, 0x68d1, 0x6906, 0x68d4, 0x68e9, 0x6915, 0x6925, 0x68c7, 0x6b39, 0x6b3b, 0x6b3f, 0x6b3c, 0x6b94, 0x6b97, 0x6b99, 0x6b95, 0x6bbd, 0x6bf0, 0x6bf2, 0x6bf3, 0x6c30, 0x6dfc, 0x6e46, 0x6e47, 0x6e1f, 0x6e49, 0x6e88, 0x6e3c, 0x6e3d, 0x6e45, 0x6e62, 0x6e2b, 0x6e3f, 0x6e41, 0x6e5d, 0x6e73, 0x6e1c, 0x6e33, 0x6e4b, 0x6e40, 0x6e51, 0x6e3b, 0x6e03, 0x6e2e, 0x6e5e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xda40[ 63 ] = { 0x6e68, 0x6e5c, 0x6e61, 0x6e31, 0x6e28, 0x6e60, 0x6e71, 0x6e6b, 0x6e39, 0x6e22, 0x6e30, 0x6e53, 0x6e65, 0x6e27, 0x6e78, 0x6e64, 0x6e77, 0x6e55, 0x6e79, 0x6e52, 0x6e66, 0x6e35, 0x6e36, 0x6e5a, 0x7120, 0x711e, 0x712f, 0x70fb, 0x712e, 0x7131, 0x7123, 0x7125, 0x7122, 0x7132, 0x711f, 0x7128, 0x713a, 0x711b, 0x724b, 0x725a, 0x7288, 0x7289, 0x7286, 0x7285, 0x728b, 0x7312, 0x730b, 0x7330, 0x7322, 0x7331, 0x7333, 0x7327, 0x7332, 0x732d, 0x7326, 0x7323, 0x7335, 0x730c, 0x742e, 0x742c, 0x7430, 0x742b, 0x7416 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdaa1[ 94 ] = { 0x741a, 0x7421, 0x742d, 0x7431, 0x7424, 0x7423, 0x741d, 0x7429, 0x7420, 0x7432, 0x74fb, 0x752f, 0x756f, 0x756c, 0x75e7, 0x75da, 0x75e1, 0x75e6, 0x75dd, 0x75df, 0x75e4, 0x75d7, 0x7695, 0x7692, 0x76da, 0x7746, 0x7747, 0x7744, 0x774d, 0x7745, 0x774a, 0x774e, 0x774b, 0x774c, 0x77de, 0x77ec, 0x7860, 0x7864, 0x7865, 0x785c, 0x786d, 0x7871, 0x786a, 0x786e, 0x7870, 0x7869, 0x7868, 0x785e, 0x7862, 0x7974, 0x7973, 0x7972, 0x7970, 0x7a02, 0x7a0a, 0x7a03, 0x7a0c, 0x7a04, 0x7a99, 0x7ae6, 0x7ae4, 0x7b4a, 0x7b3b, 0x7b44, 0x7b48, 0x7b4c, 0x7b4e, 0x7b40, 0x7b58, 0x7b45, 0x7ca2, 0x7c9e, 0x7ca8, 0x7ca1, 0x7d58, 0x7d6f, 0x7d63, 0x7d53, 0x7d56, 0x7d67, 0x7d6a, 0x7d4f, 0x7d6d, 0x7d5c, 0x7d6b, 0x7d52, 0x7d54, 0x7d69, 0x7d51, 0x7d5f, 0x7d4e, 0x7f3e, 0x7f3f, 0x7f65 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdb40[ 63 ] = { 0x7f66, 0x7fa2, 0x7fa0, 0x7fa1, 0x7fd7, 0x8051, 0x804f, 0x8050, 0x80fe, 0x80d4, 0x8143, 0x814a, 0x8152, 0x814f, 0x8147, 0x813d, 0x814d, 0x813a, 0x81e6, 0x81ee, 0x81f7, 0x81f8, 0x81f9, 0x8204, 0x823c, 0x823d, 0x823f, 0x8275, 0x833b, 0x83cf, 0x83f9, 0x8423, 0x83c0, 0x83e8, 0x8412, 0x83e7, 0x83e4, 0x83fc, 0x83f6, 0x8410, 0x83c6, 0x83c8, 0x83eb, 0x83e3, 0x83bf, 0x8401, 0x83dd, 0x83e5, 0x83d8, 0x83ff, 0x83e1, 0x83cb, 0x83ce, 0x83d6, 0x83f5, 0x83c9, 0x8409, 0x840f, 0x83de, 0x8411, 0x8406, 0x83c2, 0x83f3 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdba1[ 94 ] = { 0x83d5, 0x83fa, 0x83c7, 0x83d1, 0x83ea, 0x8413, 0x83c3, 0x83ec, 0x83ee, 0x83c4, 0x83fb, 0x83d7, 0x83e2, 0x841b, 0x83db, 0x83fe, 0x86d8, 0x86e2, 0x86e6, 0x86d3, 0x86e3, 0x86da, 0x86ea, 0x86dd, 0x86eb, 0x86dc, 0x86ec, 0x86e9, 0x86d7, 0x86e8, 0x86d1, 0x8848, 0x8856, 0x8855, 0x88ba, 0x88d7, 0x88b9, 0x88b8, 0x88c0, 0x88be, 0x88b6, 0x88bc, 0x88b7, 0x88bd, 0x88b2, 0x8901, 0x88c9, 0x8995, 0x8998, 0x8997, 0x89dd, 0x89da, 0x89db, 0x8a4e, 0x8a4d, 0x8a39, 0x8a59, 0x8a40, 0x8a57, 0x8a58, 0x8a44, 0x8a45, 0x8a52, 0x8a48, 0x8a51, 0x8a4a, 0x8a4c, 0x8a4f, 0x8c5f, 0x8c81, 0x8c80, 0x8cba, 0x8cbe, 0x8cb0, 0x8cb9, 0x8cb5, 0x8d84, 0x8d80, 0x8d89, 0x8dd8, 0x8dd3, 0x8dcd, 0x8dc7, 0x8dd6, 0x8ddc, 0x8dcf, 0x8dd5, 0x8dd9, 0x8dc8, 0x8dd7, 0x8dc5, 0x8eef, 0x8ef7, 0x8efa }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdc40[ 63 ] = { 0x8ef9, 0x8ee6, 0x8eee, 0x8ee5, 0x8ef5, 0x8ee7, 0x8ee8, 0x8ef6, 0x8eeb, 0x8ef1, 0x8eec, 0x8ef4, 0x8ee9, 0x902d, 0x9034, 0x902f, 0x9106, 0x912c, 0x9104, 0x90ff, 0x90fc, 0x9108, 0x90f9, 0x90fb, 0x9101, 0x9100, 0x9107, 0x9105, 0x9103, 0x9161, 0x9164, 0x915f, 0x9162, 0x9160, 0x9201, 0x920a, 0x9225, 0x9203, 0x921a, 0x9226, 0x920f, 0x920c, 0x9200, 0x9212, 0x91ff, 0x91fd, 0x9206, 0x9204, 0x9227, 0x9202, 0x921c, 0x9224, 0x9219, 0x9217, 0x9205, 0x9216, 0x957b, 0x958d, 0x958c, 0x9590, 0x9687, 0x967e, 0x9688 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdca1[ 94 ] = { 0x9689, 0x9683, 0x9680, 0x96c2, 0x96c8, 0x96c3, 0x96f1, 0x96f0, 0x976c, 0x9770, 0x976e, 0x9807, 0x98a9, 0x98eb, 0x9ce6, 0x9ef9, 0x4e83, 0x4e84, 0x4eb6, 0x50bd, 0x50bf, 0x50c6, 0x50ae, 0x50c4, 0x50ca, 0x50b4, 0x50c8, 0x50c2, 0x50b0, 0x50c1, 0x50ba, 0x50b1, 0x50cb, 0x50c9, 0x50b6, 0x50b8, 0x51d7, 0x527a, 0x5278, 0x527b, 0x527c, 0x55c3, 0x55db, 0x55cc, 0x55d0, 0x55cb, 0x55ca, 0x55dd, 0x55c0, 0x55d4, 0x55c4, 0x55e9, 0x55bf, 0x55d2, 0x558d, 0x55cf, 0x55d5, 0x55e2, 0x55d6, 0x55c8, 0x55f2, 0x55cd, 0x55d9, 0x55c2, 0x5714, 0x5853, 0x5868, 0x5864, 0x584f, 0x584d, 0x5849, 0x586f, 0x5855, 0x584e, 0x585d, 0x5859, 0x5865, 0x585b, 0x583d, 0x5863, 0x5871, 0x58fc, 0x5ac7, 0x5ac4, 0x5acb, 0x5aba, 0x5ab8, 0x5ab1, 0x5ab5, 0x5ab0, 0x5abf, 0x5ac8, 0x5abb, 0x5ac6 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdd40[ 63 ] = { 0x5ab7, 0x5ac0, 0x5aca, 0x5ab4, 0x5ab6, 0x5acd, 0x5ab9, 0x5a90, 0x5bd6, 0x5bd8, 0x5bd9, 0x5c1f, 0x5c33, 0x5d71, 0x5d63, 0x5d4a, 0x5d65, 0x5d72, 0x5d6c, 0x5d5e, 0x5d68, 0x5d67, 0x5d62, 0x5df0, 0x5e4f, 0x5e4e, 0x5e4a, 0x5e4d, 0x5e4b, 0x5ec5, 0x5ecc, 0x5ec6, 0x5ecb, 0x5ec7, 0x5f40, 0x5faf, 0x5fad, 0x60f7, 0x6149, 0x614a, 0x612b, 0x6145, 0x6136, 0x6132, 0x612e, 0x6146, 0x612f, 0x614f, 0x6129, 0x6140, 0x6220, 0x9168, 0x6223, 0x6225, 0x6224, 0x63c5, 0x63f1, 0x63eb, 0x6410, 0x6412, 0x6409, 0x6420, 0x6424 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdda1[ 94 ] = { 0x6433, 0x6443, 0x641f, 0x6415, 0x6418, 0x6439, 0x6437, 0x6422, 0x6423, 0x640c, 0x6426, 0x6430, 0x6428, 0x6441, 0x6435, 0x642f, 0x640a, 0x641a, 0x6440, 0x6425, 0x6427, 0x640b, 0x63e7, 0x641b, 0x642e, 0x6421, 0x640e, 0x656f, 0x6592, 0x65d3, 0x6686, 0x668c, 0x6695, 0x6690, 0x668b, 0x668a, 0x6699, 0x6694, 0x6678, 0x6720, 0x6966, 0x695f, 0x6938, 0x694e, 0x6962, 0x6971, 0x693f, 0x6945, 0x696a, 0x6939, 0x6942, 0x6957, 0x6959, 0x697a, 0x6948, 0x6949, 0x6935, 0x696c, 0x6933, 0x693d, 0x6965, 0x68f0, 0x6978, 0x6934, 0x6969, 0x6940, 0x696f, 0x6944, 0x6976, 0x6958, 0x6941, 0x6974, 0x694c, 0x693b, 0x694b, 0x6937, 0x695c, 0x694f, 0x6951, 0x6932, 0x6952, 0x692f, 0x697b, 0x693c, 0x6b46, 0x6b45, 0x6b43, 0x6b42, 0x6b48, 0x6b41, 0x6b9b, 0xfa0d, 0x6bfb, 0x6bfc }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xde40[ 63 ] = { 0x6bf9, 0x6bf7, 0x6bf8, 0x6e9b, 0x6ed6, 0x6ec8, 0x6e8f, 0x6ec0, 0x6e9f, 0x6e93, 0x6e94, 0x6ea0, 0x6eb1, 0x6eb9, 0x6ec6, 0x6ed2, 0x6ebd, 0x6ec1, 0x6e9e, 0x6ec9, 0x6eb7, 0x6eb0, 0x6ecd, 0x6ea6, 0x6ecf, 0x6eb2, 0x6ebe, 0x6ec3, 0x6edc, 0x6ed8, 0x6e99, 0x6e92, 0x6e8e, 0x6e8d, 0x6ea4, 0x6ea1, 0x6ebf, 0x6eb3, 0x6ed0, 0x6eca, 0x6e97, 0x6eae, 0x6ea3, 0x7147, 0x7154, 0x7152, 0x7163, 0x7160, 0x7141, 0x715d, 0x7162, 0x7172, 0x7178, 0x716a, 0x7161, 0x7142, 0x7158, 0x7143, 0x714b, 0x7170, 0x715f, 0x7150, 0x7153 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdea1[ 94 ] = { 0x7144, 0x714d, 0x715a, 0x724f, 0x728d, 0x728c, 0x7291, 0x7290, 0x728e, 0x733c, 0x7342, 0x733b, 0x733a, 0x7340, 0x734a, 0x7349, 0x7444, 0x744a, 0x744b, 0x7452, 0x7451, 0x7457, 0x7440, 0x744f, 0x7450, 0x744e, 0x7442, 0x7446, 0x744d, 0x7454, 0x74e1, 0x74ff, 0x74fe, 0x74fd, 0x751d, 0x7579, 0x7577, 0x6983, 0x75ef, 0x760f, 0x7603, 0x75f7, 0x75fe, 0x75fc, 0x75f9, 0x75f8, 0x7610, 0x75fb, 0x75f6, 0x75ed, 0x75f5, 0x75fd, 0x7699, 0x76b5, 0x76dd, 0x7755, 0x775f, 0x7760, 0x7752, 0x7756, 0x775a, 0x7769, 0x7767, 0x7754, 0x7759, 0x776d, 0x77e0, 0x7887, 0x789a, 0x7894, 0x788f, 0x7884, 0x7895, 0x7885, 0x7886, 0x78a1, 0x7883, 0x7879, 0x7899, 0x7880, 0x7896, 0x787b, 0x797c, 0x7982, 0x797d, 0x7979, 0x7a11, 0x7a18, 0x7a19, 0x7a12, 0x7a17, 0x7a15, 0x7a22, 0x7a13 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdf40[ 63 ] = { 0x7a1b, 0x7a10, 0x7aa3, 0x7aa2, 0x7a9e, 0x7aeb, 0x7b66, 0x7b64, 0x7b6d, 0x7b74, 0x7b69, 0x7b72, 0x7b65, 0x7b73, 0x7b71, 0x7b70, 0x7b61, 0x7b78, 0x7b76, 0x7b63, 0x7cb2, 0x7cb4, 0x7caf, 0x7d88, 0x7d86, 0x7d80, 0x7d8d, 0x7d7f, 0x7d85, 0x7d7a, 0x7d8e, 0x7d7b, 0x7d83, 0x7d7c, 0x7d8c, 0x7d94, 0x7d84, 0x7d7d, 0x7d92, 0x7f6d, 0x7f6b, 0x7f67, 0x7f68, 0x7f6c, 0x7fa6, 0x7fa5, 0x7fa7, 0x7fdb, 0x7fdc, 0x8021, 0x8164, 0x8160, 0x8177, 0x815c, 0x8169, 0x815b, 0x8162, 0x8172, 0x6721, 0x815e, 0x8176, 0x8167, 0x816f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdfa1[ 94 ] = { 0x8144, 0x8161, 0x821d, 0x8249, 0x8244, 0x8240, 0x8242, 0x8245, 0x84f1, 0x843f, 0x8456, 0x8476, 0x8479, 0x848f, 0x848d, 0x8465, 0x8451, 0x8440, 0x8486, 0x8467, 0x8430, 0x844d, 0x847d, 0x845a, 0x8459, 0x8474, 0x8473, 0x845d, 0x8507, 0x845e, 0x8437, 0x843a, 0x8434, 0x847a, 0x8443, 0x8478, 0x8432, 0x8445, 0x8429, 0x83d9, 0x844b, 0x842f, 0x8442, 0x842d, 0x845f, 0x8470, 0x8439, 0x844e, 0x844c, 0x8452, 0x846f, 0x84c5, 0x848e, 0x843b, 0x8447, 0x8436, 0x8433, 0x8468, 0x847e, 0x8444, 0x842b, 0x8460, 0x8454, 0x846e, 0x8450, 0x870b, 0x8704, 0x86f7, 0x870c, 0x86fa, 0x86d6, 0x86f5, 0x874d, 0x86f8, 0x870e, 0x8709, 0x8701, 0x86f6, 0x870d, 0x8705, 0x88d6, 0x88cb, 0x88cd, 0x88ce, 0x88de, 0x88db, 0x88da, 0x88cc, 0x88d0, 0x8985, 0x899b, 0x89df, 0x89e5, 0x89e4 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe040[ 63 ] = { 0x89e1, 0x89e0, 0x89e2, 0x89dc, 0x89e6, 0x8a76, 0x8a86, 0x8a7f, 0x8a61, 0x8a3f, 0x8a77, 0x8a82, 0x8a84, 0x8a75, 0x8a83, 0x8a81, 0x8a74, 0x8a7a, 0x8c3c, 0x8c4b, 0x8c4a, 0x8c65, 0x8c64, 0x8c66, 0x8c86, 0x8c84, 0x8c85, 0x8ccc, 0x8d68, 0x8d69, 0x8d91, 0x8d8c, 0x8d8e, 0x8d8f, 0x8d8d, 0x8d93, 0x8d94, 0x8d90, 0x8d92, 0x8df0, 0x8de0, 0x8dec, 0x8df1, 0x8dee, 0x8dd0, 0x8de9, 0x8de3, 0x8de2, 0x8de7, 0x8df2, 0x8deb, 0x8df4, 0x8f06, 0x8eff, 0x8f01, 0x8f00, 0x8f05, 0x8f07, 0x8f08, 0x8f02, 0x8f0b, 0x9052, 0x903f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe0a1[ 94 ] = { 0x9044, 0x9049, 0x903d, 0x9110, 0x910d, 0x910f, 0x9111, 0x9116, 0x9114, 0x910b, 0x910e, 0x916e, 0x916f, 0x9248, 0x9252, 0x9230, 0x923a, 0x9266, 0x9233, 0x9265, 0x925e, 0x9283, 0x922e, 0x924a, 0x9246, 0x926d, 0x926c, 0x924f, 0x9260, 0x9267, 0x926f, 0x9236, 0x9261, 0x9270, 0x9231, 0x9254, 0x9263, 0x9250, 0x9272, 0x924e, 0x9253, 0x924c, 0x9256, 0x9232, 0x959f, 0x959c, 0x959e, 0x959b, 0x9692, 0x9693, 0x9691, 0x9697, 0x96ce, 0x96fa, 0x96fd, 0x96f8, 0x96f5, 0x9773, 0x9777, 0x9778, 0x9772, 0x980f, 0x980d, 0x980e, 0x98ac, 0x98f6, 0x98f9, 0x99af, 0x99b2, 0x99b0, 0x99b5, 0x9aad, 0x9aab, 0x9b5b, 0x9cea, 0x9ced, 0x9ce7, 0x9e80, 0x9efd, 0x50e6, 0x50d4, 0x50d7, 0x50e8, 0x50f3, 0x50db, 0x50ea, 0x50dd, 0x50e4, 0x50d3, 0x50ec, 0x50f0, 0x50ef, 0x50e3, 0x50e0 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe140[ 63 ] = { 0x51d8, 0x5280, 0x5281, 0x52e9, 0x52eb, 0x5330, 0x53ac, 0x5627, 0x5615, 0x560c, 0x5612, 0x55fc, 0x560f, 0x561c, 0x5601, 0x5613, 0x5602, 0x55fa, 0x561d, 0x5604, 0x55ff, 0x55f9, 0x5889, 0x587c, 0x5890, 0x5898, 0x5886, 0x5881, 0x587f, 0x5874, 0x588b, 0x587a, 0x5887, 0x5891, 0x588e, 0x5876, 0x5882, 0x5888, 0x587b, 0x5894, 0x588f, 0x58fe, 0x596b, 0x5adc, 0x5aee, 0x5ae5, 0x5ad5, 0x5aea, 0x5ada, 0x5aed, 0x5aeb, 0x5af3, 0x5ae2, 0x5ae0, 0x5adb, 0x5aec, 0x5ade, 0x5add, 0x5ad9, 0x5ae8, 0x5adf, 0x5b77, 0x5be0 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe1a1[ 94 ] = { 0x5be3, 0x5c63, 0x5d82, 0x5d80, 0x5d7d, 0x5d86, 0x5d7a, 0x5d81, 0x5d77, 0x5d8a, 0x5d89, 0x5d88, 0x5d7e, 0x5d7c, 0x5d8d, 0x5d79, 0x5d7f, 0x5e58, 0x5e59, 0x5e53, 0x5ed8, 0x5ed1, 0x5ed7, 0x5ece, 0x5edc, 0x5ed5, 0x5ed9, 0x5ed2, 0x5ed4, 0x5f44, 0x5f43, 0x5f6f, 0x5fb6, 0x612c, 0x6128, 0x6141, 0x615e, 0x6171, 0x6173, 0x6152, 0x6153, 0x6172, 0x616c, 0x6180, 0x6174, 0x6154, 0x617a, 0x615b, 0x6165, 0x613b, 0x616a, 0x6161, 0x6156, 0x6229, 0x6227, 0x622b, 0x642b, 0x644d, 0x645b, 0x645d, 0x6474, 0x6476, 0x6472, 0x6473, 0x647d, 0x6475, 0x6466, 0x64a6, 0x644e, 0x6482, 0x645e, 0x645c, 0x644b, 0x6453, 0x6460, 0x6450, 0x647f, 0x643f, 0x646c, 0x646b, 0x6459, 0x6465, 0x6477, 0x6573, 0x65a0, 0x66a1, 0x66a0, 0x669f, 0x6705, 0x6704, 0x6722, 0x69b1, 0x69b6, 0x69c9 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe240[ 63 ] = { 0x69a0, 0x69ce, 0x6996, 0x69b0, 0x69ac, 0x69bc, 0x6991, 0x6999, 0x698e, 0x69a7, 0x698d, 0x69a9, 0x69be, 0x69af, 0x69bf, 0x69c4, 0x69bd, 0x69a4, 0x69d4, 0x69b9, 0x69ca, 0x699a, 0x69cf, 0x69b3, 0x6993, 0x69aa, 0x69a1, 0x699e, 0x69d9, 0x6997, 0x6990, 0x69c2, 0x69b5, 0x69a5, 0x69c6, 0x6b4a, 0x6b4d, 0x6b4b, 0x6b9e, 0x6b9f, 0x6ba0, 0x6bc3, 0x6bc4, 0x6bfe, 0x6ece, 0x6ef5, 0x6ef1, 0x6f03, 0x6f25, 0x6ef8, 0x6f37, 0x6efb, 0x6f2e, 0x6f09, 0x6f4e, 0x6f19, 0x6f1a, 0x6f27, 0x6f18, 0x6f3b, 0x6f12, 0x6eed, 0x6f0a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe2a1[ 94 ] = { 0x6f36, 0x6f73, 0x6ef9, 0x6eee, 0x6f2d, 0x6f40, 0x6f30, 0x6f3c, 0x6f35, 0x6eeb, 0x6f07, 0x6f0e, 0x6f43, 0x6f05, 0x6efd, 0x6ef6, 0x6f39, 0x6f1c, 0x6efc, 0x6f3a, 0x6f1f, 0x6f0d, 0x6f1e, 0x6f08, 0x6f21, 0x7187, 0x7190, 0x7189, 0x7180, 0x7185, 0x7182, 0x718f, 0x717b, 0x7186, 0x7181, 0x7197, 0x7244, 0x7253, 0x7297, 0x7295, 0x7293, 0x7343, 0x734d, 0x7351, 0x734c, 0x7462, 0x7473, 0x7471, 0x7475, 0x7472, 0x7467, 0x746e, 0x7500, 0x7502, 0x7503, 0x757d, 0x7590, 0x7616, 0x7608, 0x760c, 0x7615, 0x7611, 0x760a, 0x7614, 0x76b8, 0x7781, 0x777c, 0x7785, 0x7782, 0x776e, 0x7780, 0x776f, 0x777e, 0x7783, 0x78b2, 0x78aa, 0x78b4, 0x78ad, 0x78a8, 0x787e, 0x78ab, 0x789e, 0x78a5, 0x78a0, 0x78ac, 0x78a2, 0x78a4, 0x7998, 0x798a, 0x798b, 0x7996, 0x7995, 0x7994, 0x7993 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe340[ 63 ] = { 0x7997, 0x7988, 0x7992, 0x7990, 0x7a2b, 0x7a4a, 0x7a30, 0x7a2f, 0x7a28, 0x7a26, 0x7aa8, 0x7aab, 0x7aac, 0x7aee, 0x7b88, 0x7b9c, 0x7b8a, 0x7b91, 0x7b90, 0x7b96, 0x7b8d, 0x7b8c, 0x7b9b, 0x7b8e, 0x7b85, 0x7b98, 0x5284, 0x7b99, 0x7ba4, 0x7b82, 0x7cbb, 0x7cbf, 0x7cbc, 0x7cba, 0x7da7, 0x7db7, 0x7dc2, 0x7da3, 0x7daa, 0x7dc1, 0x7dc0, 0x7dc5, 0x7d9d, 0x7dce, 0x7dc4, 0x7dc6, 0x7dcb, 0x7dcc, 0x7daf, 0x7db9, 0x7d96, 0x7dbc, 0x7d9f, 0x7da6, 0x7dae, 0x7da9, 0x7da1, 0x7dc9, 0x7f73, 0x7fe2, 0x7fe3, 0x7fe5, 0x7fde }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe3a1[ 94 ] = { 0x8024, 0x805d, 0x805c, 0x8189, 0x8186, 0x8183, 0x8187, 0x818d, 0x818c, 0x818b, 0x8215, 0x8497, 0x84a4, 0x84a1, 0x849f, 0x84ba, 0x84ce, 0x84c2, 0x84ac, 0x84ae, 0x84ab, 0x84b9, 0x84b4, 0x84c1, 0x84cd, 0x84aa, 0x849a, 0x84b1, 0x84d0, 0x849d, 0x84a7, 0x84bb, 0x84a2, 0x8494, 0x84c7, 0x84cc, 0x849b, 0x84a9, 0x84af, 0x84a8, 0x84d6, 0x8498, 0x84b6, 0x84cf, 0x84a0, 0x84d7, 0x84d4, 0x84d2, 0x84db, 0x84b0, 0x8491, 0x8661, 0x8733, 0x8723, 0x8728, 0x876b, 0x8740, 0x872e, 0x871e, 0x8721, 0x8719, 0x871b, 0x8743, 0x872c, 0x8741, 0x873e, 0x8746, 0x8720, 0x8732, 0x872a, 0x872d, 0x873c, 0x8712, 0x873a, 0x8731, 0x8735, 0x8742, 0x8726, 0x8727, 0x8738, 0x8724, 0x871a, 0x8730, 0x8711, 0x88f7, 0x88e7, 0x88f1, 0x88f2, 0x88fa, 0x88fe, 0x88ee, 0x88fc, 0x88f6, 0x88fb }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe440[ 63 ] = { 0x88f0, 0x88ec, 0x88eb, 0x899d, 0x89a1, 0x899f, 0x899e, 0x89e9, 0x89eb, 0x89e8, 0x8aab, 0x8a99, 0x8a8b, 0x8a92, 0x8a8f, 0x8a96, 0x8c3d, 0x8c68, 0x8c69, 0x8cd5, 0x8ccf, 0x8cd7, 0x8d96, 0x8e09, 0x8e02, 0x8dff, 0x8e0d, 0x8dfd, 0x8e0a, 0x8e03, 0x8e07, 0x8e06, 0x8e05, 0x8dfe, 0x8e00, 0x8e04, 0x8f10, 0x8f11, 0x8f0e, 0x8f0d, 0x9123, 0x911c, 0x9120, 0x9122, 0x911f, 0x911d, 0x911a, 0x9124, 0x9121, 0x911b, 0x917a, 0x9172, 0x9179, 0x9173, 0x92a5, 0x92a4, 0x9276, 0x929b, 0x927a, 0x92a0, 0x9294, 0x92aa, 0x928d }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe4a1[ 94 ] = { 0x92a6, 0x929a, 0x92ab, 0x9279, 0x9297, 0x927f, 0x92a3, 0x92ee, 0x928e, 0x9282, 0x9295, 0x92a2, 0x927d, 0x9288, 0x92a1, 0x928a, 0x9286, 0x928c, 0x9299, 0x92a7, 0x927e, 0x9287, 0x92a9, 0x929d, 0x928b, 0x922d, 0x969e, 0x96a1, 0x96ff, 0x9758, 0x977d, 0x977a, 0x977e, 0x9783, 0x9780, 0x9782, 0x977b, 0x9784, 0x9781, 0x977f, 0x97ce, 0x97cd, 0x9816, 0x98ad, 0x98ae, 0x9902, 0x9900, 0x9907, 0x999d, 0x999c, 0x99c3, 0x99b9, 0x99bb, 0x99ba, 0x99c2, 0x99bd, 0x99c7, 0x9ab1, 0x9ae3, 0x9ae7, 0x9b3e, 0x9b3f, 0x9b60, 0x9b61, 0x9b5f, 0x9cf1, 0x9cf2, 0x9cf5, 0x9ea7, 0x50ff, 0x5103, 0x5130, 0x50f8, 0x5106, 0x5107, 0x50f6, 0x50fe, 0x510b, 0x510c, 0x50fd, 0x510a, 0x528b, 0x528c, 0x52f1, 0x52ef, 0x5648, 0x5642, 0x564c, 0x5635, 0x5641, 0x564a, 0x5649, 0x5646, 0x5658 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe540[ 63 ] = { 0x565a, 0x5640, 0x5633, 0x563d, 0x562c, 0x563e, 0x5638, 0x562a, 0x563a, 0x571a, 0x58ab, 0x589d, 0x58b1, 0x58a0, 0x58a3, 0x58af, 0x58ac, 0x58a5, 0x58a1, 0x58ff, 0x5aff, 0x5af4, 0x5afd, 0x5af7, 0x5af6, 0x5b03, 0x5af8, 0x5b02, 0x5af9, 0x5b01, 0x5b07, 0x5b05, 0x5b0f, 0x5c67, 0x5d99, 0x5d97, 0x5d9f, 0x5d92, 0x5da2, 0x5d93, 0x5d95, 0x5da0, 0x5d9c, 0x5da1, 0x5d9a, 0x5d9e, 0x5e69, 0x5e5d, 0x5e60, 0x5e5c, 0x7df3, 0x5edb, 0x5ede, 0x5ee1, 0x5f49, 0x5fb2, 0x618b, 0x6183, 0x6179, 0x61b1, 0x61b0, 0x61a2, 0x6189 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe5a1[ 94 ] = { 0x619b, 0x6193, 0x61af, 0x61ad, 0x619f, 0x6192, 0x61aa, 0x61a1, 0x618d, 0x6166, 0x61b3, 0x622d, 0x646e, 0x6470, 0x6496, 0x64a0, 0x6485, 0x6497, 0x649c, 0x648f, 0x648b, 0x648a, 0x648c, 0x64a3, 0x649f, 0x6468, 0x64b1, 0x6498, 0x6576, 0x657a, 0x6579, 0x657b, 0x65b2, 0x65b3, 0x66b5, 0x66b0, 0x66a9, 0x66b2, 0x66b7, 0x66aa, 0x66af, 0x6a00, 0x6a06, 0x6a17, 0x69e5, 0x69f8, 0x6a15, 0x69f1, 0x69e4, 0x6a20, 0x69ff, 0x69ec, 0x69e2, 0x6a1b, 0x6a1d, 0x69fe, 0x6a27, 0x69f2, 0x69ee, 0x6a14, 0x69f7, 0x69e7, 0x6a40, 0x6a08, 0x69e6, 0x69fb, 0x6a0d, 0x69fc, 0x69eb, 0x6a09, 0x6a04, 0x6a18, 0x6a25, 0x6a0f, 0x69f6, 0x6a26, 0x6a07, 0x69f4, 0x6a16, 0x6b51, 0x6ba5, 0x6ba3, 0x6ba2, 0x6ba6, 0x6c01, 0x6c00, 0x6bff, 0x6c02, 0x6f41, 0x6f26, 0x6f7e, 0x6f87, 0x6fc6, 0x6f92 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe640[ 63 ] = { 0x6f8d, 0x6f89, 0x6f8c, 0x6f62, 0x6f4f, 0x6f85, 0x6f5a, 0x6f96, 0x6f76, 0x6f6c, 0x6f82, 0x6f55, 0x6f72, 0x6f52, 0x6f50, 0x6f57, 0x6f94, 0x6f93, 0x6f5d, 0x6f00, 0x6f61, 0x6f6b, 0x6f7d, 0x6f67, 0x6f90, 0x6f53, 0x6f8b, 0x6f69, 0x6f7f, 0x6f95, 0x6f63, 0x6f77, 0x6f6a, 0x6f7b, 0x71b2, 0x71af, 0x719b, 0x71b0, 0x71a0, 0x719a, 0x71a9, 0x71b5, 0x719d, 0x71a5, 0x719e, 0x71a4, 0x71a1, 0x71aa, 0x719c, 0x71a7, 0x71b3, 0x7298, 0x729a, 0x7358, 0x7352, 0x735e, 0x735f, 0x7360, 0x735d, 0x735b, 0x7361, 0x735a, 0x7359 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe6a1[ 94 ] = { 0x7362, 0x7487, 0x7489, 0x748a, 0x7486, 0x7481, 0x747d, 0x7485, 0x7488, 0x747c, 0x7479, 0x7508, 0x7507, 0x757e, 0x7625, 0x761e, 0x7619, 0x761d, 0x761c, 0x7623, 0x761a, 0x7628, 0x761b, 0x769c, 0x769d, 0x769e, 0x769b, 0x778d, 0x778f, 0x7789, 0x7788, 0x78cd, 0x78bb, 0x78cf, 0x78cc, 0x78d1, 0x78ce, 0x78d4, 0x78c8, 0x78c3, 0x78c4, 0x78c9, 0x799a, 0x79a1, 0x79a0, 0x799c, 0x79a2, 0x799b, 0x6b76, 0x7a39, 0x7ab2, 0x7ab4, 0x7ab3, 0x7bb7, 0x7bcb, 0x7bbe, 0x7bac, 0x7bce, 0x7baf, 0x7bb9, 0x7bca, 0x7bb5, 0x7cc5, 0x7cc8, 0x7ccc, 0x7ccb, 0x7df7, 0x7ddb, 0x7dea, 0x7de7, 0x7dd7, 0x7de1, 0x7e03, 0x7dfa, 0x7de6, 0x7df6, 0x7df1, 0x7df0, 0x7dee, 0x7ddf, 0x7f76, 0x7fac, 0x7fb0, 0x7fad, 0x7fed, 0x7feb, 0x7fea, 0x7fec, 0x7fe6, 0x7fe8, 0x8064, 0x8067, 0x81a3, 0x819f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe740[ 63 ] = { 0x819e, 0x8195, 0x81a2, 0x8199, 0x8197, 0x8216, 0x824f, 0x8253, 0x8252, 0x8250, 0x824e, 0x8251, 0x8524, 0x853b, 0x850f, 0x8500, 0x8529, 0x850e, 0x8509, 0x850d, 0x851f, 0x850a, 0x8527, 0x851c, 0x84fb, 0x852b, 0x84fa, 0x8508, 0x850c, 0x84f4, 0x852a, 0x84f2, 0x8515, 0x84f7, 0x84eb, 0x84f3, 0x84fc, 0x8512, 0x84ea, 0x84e9, 0x8516, 0x84fe, 0x8528, 0x851d, 0x852e, 0x8502, 0x84fd, 0x851e, 0x84f6, 0x8531, 0x8526, 0x84e7, 0x84e8, 0x84f0, 0x84ef, 0x84f9, 0x8518, 0x8520, 0x8530, 0x850b, 0x8519, 0x852f, 0x8662 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe7a1[ 94 ] = { 0x8756, 0x8763, 0x8764, 0x8777, 0x87e1, 0x8773, 0x8758, 0x8754, 0x875b, 0x8752, 0x8761, 0x875a, 0x8751, 0x875e, 0x876d, 0x876a, 0x8750, 0x874e, 0x875f, 0x875d, 0x876f, 0x876c, 0x877a, 0x876e, 0x875c, 0x8765, 0x874f, 0x877b, 0x8775, 0x8762, 0x8767, 0x8769, 0x885a, 0x8905, 0x890c, 0x8914, 0x890b, 0x8917, 0x8918, 0x8919, 0x8906, 0x8916, 0x8911, 0x890e, 0x8909, 0x89a2, 0x89a4, 0x89a3, 0x89ed, 0x89f0, 0x89ec, 0x8acf, 0x8ac6, 0x8ab8, 0x8ad3, 0x8ad1, 0x8ad4, 0x8ad5, 0x8abb, 0x8ad7, 0x8abe, 0x8ac0, 0x8ac5, 0x8ad8, 0x8ac3, 0x8aba, 0x8abd, 0x8ad9, 0x8c3e, 0x8c4d, 0x8c8f, 0x8ce5, 0x8cdf, 0x8cd9, 0x8ce8, 0x8cda, 0x8cdd, 0x8ce7, 0x8da0, 0x8d9c, 0x8da1, 0x8d9b, 0x8e20, 0x8e23, 0x8e25, 0x8e24, 0x8e2e, 0x8e15, 0x8e1b, 0x8e16, 0x8e11, 0x8e19, 0x8e26, 0x8e27 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe840[ 63 ] = { 0x8e14, 0x8e12, 0x8e18, 0x8e13, 0x8e1c, 0x8e17, 0x8e1a, 0x8f2c, 0x8f24, 0x8f18, 0x8f1a, 0x8f20, 0x8f23, 0x8f16, 0x8f17, 0x9073, 0x9070, 0x906f, 0x9067, 0x906b, 0x912f, 0x912b, 0x9129, 0x912a, 0x9132, 0x9126, 0x912e, 0x9185, 0x9186, 0x918a, 0x9181, 0x9182, 0x9184, 0x9180, 0x92d0, 0x92c3, 0x92c4, 0x92c0, 0x92d9, 0x92b6, 0x92cf, 0x92f1, 0x92df, 0x92d8, 0x92e9, 0x92d7, 0x92dd, 0x92cc, 0x92ef, 0x92c2, 0x92e8, 0x92ca, 0x92c8, 0x92ce, 0x92e6, 0x92cd, 0x92d5, 0x92c9, 0x92e0, 0x92de, 0x92e7, 0x92d1, 0x92d3 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe8a1[ 94 ] = { 0x92b5, 0x92e1, 0x92c6, 0x92b4, 0x957c, 0x95ac, 0x95ab, 0x95ae, 0x95b0, 0x96a4, 0x96a2, 0x96d3, 0x9705, 0x9708, 0x9702, 0x975a, 0x978a, 0x978e, 0x9788, 0x97d0, 0x97cf, 0x981e, 0x981d, 0x9826, 0x9829, 0x9828, 0x9820, 0x981b, 0x9827, 0x98b2, 0x9908, 0x98fa, 0x9911, 0x9914, 0x9916, 0x9917, 0x9915, 0x99dc, 0x99cd, 0x99cf, 0x99d3, 0x99d4, 0x99ce, 0x99c9, 0x99d6, 0x99d8, 0x99cb, 0x99d7, 0x99cc, 0x9ab3, 0x9aec, 0x9aeb, 0x9af3, 0x9af2, 0x9af1, 0x9b46, 0x9b43, 0x9b67, 0x9b74, 0x9b71, 0x9b66, 0x9b76, 0x9b75, 0x9b70, 0x9b68, 0x9b64, 0x9b6c, 0x9cfc, 0x9cfa, 0x9cfd, 0x9cff, 0x9cf7, 0x9d07, 0x9d00, 0x9cf9, 0x9cfb, 0x9d08, 0x9d05, 0x9d04, 0x9e83, 0x9ed3, 0x9f0f, 0x9f10, 0x511c, 0x5113, 0x5117, 0x511a, 0x5111, 0x51de, 0x5334, 0x53e1, 0x5670, 0x5660, 0x566e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe940[ 63 ] = { 0x5673, 0x5666, 0x5663, 0x566d, 0x5672, 0x565e, 0x5677, 0x571c, 0x571b, 0x58c8, 0x58bd, 0x58c9, 0x58bf, 0x58ba, 0x58c2, 0x58bc, 0x58c6, 0x5b17, 0x5b19, 0x5b1b, 0x5b21, 0x5b14, 0x5b13, 0x5b10, 0x5b16, 0x5b28, 0x5b1a, 0x5b20, 0x5b1e, 0x5bef, 0x5dac, 0x5db1, 0x5da9, 0x5da7, 0x5db5, 0x5db0, 0x5dae, 0x5daa, 0x5da8, 0x5db2, 0x5dad, 0x5daf, 0x5db4, 0x5e67, 0x5e68, 0x5e66, 0x5e6f, 0x5ee9, 0x5ee7, 0x5ee6, 0x5ee8, 0x5ee5, 0x5f4b, 0x5fbc, 0x619d, 0x61a8, 0x6196, 0x61c5, 0x61b4, 0x61c6, 0x61c1, 0x61cc, 0x61ba }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe9a1[ 94 ] = { 0x61bf, 0x61b8, 0x618c, 0x64d7, 0x64d6, 0x64d0, 0x64cf, 0x64c9, 0x64bd, 0x6489, 0x64c3, 0x64db, 0x64f3, 0x64d9, 0x6533, 0x657f, 0x657c, 0x65a2, 0x66c8, 0x66be, 0x66c0, 0x66ca, 0x66cb, 0x66cf, 0x66bd, 0x66bb, 0x66ba, 0x66cc, 0x6723, 0x6a34, 0x6a66, 0x6a49, 0x6a67, 0x6a32, 0x6a68, 0x6a3e, 0x6a5d, 0x6a6d, 0x6a76, 0x6a5b, 0x6a51, 0x6a28, 0x6a5a, 0x6a3b, 0x6a3f, 0x6a41, 0x6a6a, 0x6a64, 0x6a50, 0x6a4f, 0x6a54, 0x6a6f, 0x6a69, 0x6a60, 0x6a3c, 0x6a5e, 0x6a56, 0x6a55, 0x6a4d, 0x6a4e, 0x6a46, 0x6b55, 0x6b54, 0x6b56, 0x6ba7, 0x6baa, 0x6bab, 0x6bc8, 0x6bc7, 0x6c04, 0x6c03, 0x6c06, 0x6fad, 0x6fcb, 0x6fa3, 0x6fc7, 0x6fbc, 0x6fce, 0x6fc8, 0x6f5e, 0x6fc4, 0x6fbd, 0x6f9e, 0x6fca, 0x6fa8, 0x7004, 0x6fa5, 0x6fae, 0x6fba, 0x6fac, 0x6faa, 0x6fcf, 0x6fbf, 0x6fb8 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xea40[ 63 ] = { 0x6fa2, 0x6fc9, 0x6fab, 0x6fcd, 0x6faf, 0x6fb2, 0x6fb0, 0x71c5, 0x71c2, 0x71bf, 0x71b8, 0x71d6, 0x71c0, 0x71c1, 0x71cb, 0x71d4, 0x71ca, 0x71c7, 0x71cf, 0x71bd, 0x71d8, 0x71bc, 0x71c6, 0x71da, 0x71db, 0x729d, 0x729e, 0x7369, 0x7366, 0x7367, 0x736c, 0x7365, 0x736b, 0x736a, 0x747f, 0x749a, 0x74a0, 0x7494, 0x7492, 0x7495, 0x74a1, 0x750b, 0x7580, 0x762f, 0x762d, 0x7631, 0x763d, 0x7633, 0x763c, 0x7635, 0x7632, 0x7630, 0x76bb, 0x76e6, 0x779a, 0x779d, 0x77a1, 0x779c, 0x779b, 0x77a2, 0x77a3, 0x7795, 0x7799 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeaa1[ 94 ] = { 0x7797, 0x78dd, 0x78e9, 0x78e5, 0x78ea, 0x78de, 0x78e3, 0x78db, 0x78e1, 0x78e2, 0x78ed, 0x78df, 0x78e0, 0x79a4, 0x7a44, 0x7a48, 0x7a47, 0x7ab6, 0x7ab8, 0x7ab5, 0x7ab1, 0x7ab7, 0x7bde, 0x7be3, 0x7be7, 0x7bdd, 0x7bd5, 0x7be5, 0x7bda, 0x7be8, 0x7bf9, 0x7bd4, 0x7bea, 0x7be2, 0x7bdc, 0x7beb, 0x7bd8, 0x7bdf, 0x7cd2, 0x7cd4, 0x7cd7, 0x7cd0, 0x7cd1, 0x7e12, 0x7e21, 0x7e17, 0x7e0c, 0x7e1f, 0x7e20, 0x7e13, 0x7e0e, 0x7e1c, 0x7e15, 0x7e1a, 0x7e22, 0x7e0b, 0x7e0f, 0x7e16, 0x7e0d, 0x7e14, 0x7e25, 0x7e24, 0x7f43, 0x7f7b, 0x7f7c, 0x7f7a, 0x7fb1, 0x7fef, 0x802a, 0x8029, 0x806c, 0x81b1, 0x81a6, 0x81ae, 0x81b9, 0x81b5, 0x81ab, 0x81b0, 0x81ac, 0x81b4, 0x81b2, 0x81b7, 0x81a7, 0x81f2, 0x8255, 0x8256, 0x8257, 0x8556, 0x8545, 0x856b, 0x854d, 0x8553, 0x8561, 0x8558 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeb40[ 63 ] = { 0x8540, 0x8546, 0x8564, 0x8541, 0x8562, 0x8544, 0x8551, 0x8547, 0x8563, 0x853e, 0x855b, 0x8571, 0x854e, 0x856e, 0x8575, 0x8555, 0x8567, 0x8560, 0x858c, 0x8566, 0x855d, 0x8554, 0x8565, 0x856c, 0x8663, 0x8665, 0x8664, 0x879b, 0x878f, 0x8797, 0x8793, 0x8792, 0x8788, 0x8781, 0x8796, 0x8798, 0x8779, 0x8787, 0x87a3, 0x8785, 0x8790, 0x8791, 0x879d, 0x8784, 0x8794, 0x879c, 0x879a, 0x8789, 0x891e, 0x8926, 0x8930, 0x892d, 0x892e, 0x8927, 0x8931, 0x8922, 0x8929, 0x8923, 0x892f, 0x892c, 0x891f, 0x89f1, 0x8ae0 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeba1[ 94 ] = { 0x8ae2, 0x8af2, 0x8af4, 0x8af5, 0x8add, 0x8b14, 0x8ae4, 0x8adf, 0x8af0, 0x8ac8, 0x8ade, 0x8ae1, 0x8ae8, 0x8aff, 0x8aef, 0x8afb, 0x8c91, 0x8c92, 0x8c90, 0x8cf5, 0x8cee, 0x8cf1, 0x8cf0, 0x8cf3, 0x8d6c, 0x8d6e, 0x8da5, 0x8da7, 0x8e33, 0x8e3e, 0x8e38, 0x8e40, 0x8e45, 0x8e36, 0x8e3c, 0x8e3d, 0x8e41, 0x8e30, 0x8e3f, 0x8ebd, 0x8f36, 0x8f2e, 0x8f35, 0x8f32, 0x8f39, 0x8f37, 0x8f34, 0x9076, 0x9079, 0x907b, 0x9086, 0x90fa, 0x9133, 0x9135, 0x9136, 0x9193, 0x9190, 0x9191, 0x918d, 0x918f, 0x9327, 0x931e, 0x9308, 0x931f, 0x9306, 0x930f, 0x937a, 0x9338, 0x933c, 0x931b, 0x9323, 0x9312, 0x9301, 0x9346, 0x932d, 0x930e, 0x930d, 0x92cb, 0x931d, 0x92fa, 0x9325, 0x9313, 0x92f9, 0x92f7, 0x9334, 0x9302, 0x9324, 0x92ff, 0x9329, 0x9339, 0x9335, 0x932a, 0x9314, 0x930c }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xec40[ 63 ] = { 0x930b, 0x92fe, 0x9309, 0x9300, 0x92fb, 0x9316, 0x95bc, 0x95cd, 0x95be, 0x95b9, 0x95ba, 0x95b6, 0x95bf, 0x95b5, 0x95bd, 0x96a9, 0x96d4, 0x970b, 0x9712, 0x9710, 0x9799, 0x9797, 0x9794, 0x97f0, 0x97f8, 0x9835, 0x982f, 0x9832, 0x9924, 0x991f, 0x9927, 0x9929, 0x999e, 0x99ee, 0x99ec, 0x99e5, 0x99e4, 0x99f0, 0x99e3, 0x99ea, 0x99e9, 0x99e7, 0x9ab9, 0x9abf, 0x9ab4, 0x9abb, 0x9af6, 0x9afa, 0x9af9, 0x9af7, 0x9b33, 0x9b80, 0x9b85, 0x9b87, 0x9b7c, 0x9b7e, 0x9b7b, 0x9b82, 0x9b93, 0x9b92, 0x9b90, 0x9b7a, 0x9b95 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeca1[ 94 ] = { 0x9b7d, 0x9b88, 0x9d25, 0x9d17, 0x9d20, 0x9d1e, 0x9d14, 0x9d29, 0x9d1d, 0x9d18, 0x9d22, 0x9d10, 0x9d19, 0x9d1f, 0x9e88, 0x9e86, 0x9e87, 0x9eae, 0x9ead, 0x9ed5, 0x9ed6, 0x9efa, 0x9f12, 0x9f3d, 0x5126, 0x5125, 0x5122, 0x5124, 0x5120, 0x5129, 0x52f4, 0x5693, 0x568c, 0x568d, 0x5686, 0x5684, 0x5683, 0x567e, 0x5682, 0x567f, 0x5681, 0x58d6, 0x58d4, 0x58cf, 0x58d2, 0x5b2d, 0x5b25, 0x5b32, 0x5b23, 0x5b2c, 0x5b27, 0x5b26, 0x5b2f, 0x5b2e, 0x5b7b, 0x5bf1, 0x5bf2, 0x5db7, 0x5e6c, 0x5e6a, 0x5fbe, 0x5fbb, 0x61c3, 0x61b5, 0x61bc, 0x61e7, 0x61e0, 0x61e5, 0x61e4, 0x61e8, 0x61de, 0x64ef, 0x64e9, 0x64e3, 0x64eb, 0x64e4, 0x64e8, 0x6581, 0x6580, 0x65b6, 0x65da, 0x66d2, 0x6a8d, 0x6a96, 0x6a81, 0x6aa5, 0x6a89, 0x6a9f, 0x6a9b, 0x6aa1, 0x6a9e, 0x6a87, 0x6a93, 0x6a8e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xed40[ 63 ] = { 0x6a95, 0x6a83, 0x6aa8, 0x6aa4, 0x6a91, 0x6a7f, 0x6aa6, 0x6a9a, 0x6a85, 0x6a8c, 0x6a92, 0x6b5b, 0x6bad, 0x6c09, 0x6fcc, 0x6fa9, 0x6ff4, 0x6fd4, 0x6fe3, 0x6fdc, 0x6fed, 0x6fe7, 0x6fe6, 0x6fde, 0x6ff2, 0x6fdd, 0x6fe2, 0x6fe8, 0x71e1, 0x71f1, 0x71e8, 0x71f2, 0x71e4, 0x71f0, 0x71e2, 0x7373, 0x736e, 0x736f, 0x7497, 0x74b2, 0x74ab, 0x7490, 0x74aa, 0x74ad, 0x74b1, 0x74a5, 0x74af, 0x7510, 0x7511, 0x7512, 0x750f, 0x7584, 0x7643, 0x7648, 0x7649, 0x7647, 0x76a4, 0x76e9, 0x77b5, 0x77ab, 0x77b2, 0x77b7, 0x77b6 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeda1[ 94 ] = { 0x77b4, 0x77b1, 0x77a8, 0x77f0, 0x78f3, 0x78fd, 0x7902, 0x78fb, 0x78fc, 0x78f2, 0x7905, 0x78f9, 0x78fe, 0x7904, 0x79ab, 0x79a8, 0x7a5c, 0x7a5b, 0x7a56, 0x7a58, 0x7a54, 0x7a5a, 0x7abe, 0x7ac0, 0x7ac1, 0x7c05, 0x7c0f, 0x7bf2, 0x7c00, 0x7bff, 0x7bfb, 0x7c0e, 0x7bf4, 0x7c0b, 0x7bf3, 0x7c02, 0x7c09, 0x7c03, 0x7c01, 0x7bf8, 0x7bfd, 0x7c06, 0x7bf0, 0x7bf1, 0x7c10, 0x7c0a, 0x7ce8, 0x7e2d, 0x7e3c, 0x7e42, 0x7e33, 0x9848, 0x7e38, 0x7e2a, 0x7e49, 0x7e40, 0x7e47, 0x7e29, 0x7e4c, 0x7e30, 0x7e3b, 0x7e36, 0x7e44, 0x7e3a, 0x7f45, 0x7f7f, 0x7f7e, 0x7f7d, 0x7ff4, 0x7ff2, 0x802c, 0x81bb, 0x81c4, 0x81cc, 0x81ca, 0x81c5, 0x81c7, 0x81bc, 0x81e9, 0x825b, 0x825a, 0x825c, 0x8583, 0x8580, 0x858f, 0x85a7, 0x8595, 0x85a0, 0x858b, 0x85a3, 0x857b, 0x85a4, 0x859a, 0x859e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xee40[ 63 ] = { 0x8577, 0x857c, 0x8589, 0x85a1, 0x857a, 0x8578, 0x8557, 0x858e, 0x8596, 0x8586, 0x858d, 0x8599, 0x859d, 0x8581, 0x85a2, 0x8582, 0x8588, 0x8585, 0x8579, 0x8576, 0x8598, 0x8590, 0x859f, 0x8668, 0x87be, 0x87aa, 0x87ad, 0x87c5, 0x87b0, 0x87ac, 0x87b9, 0x87b5, 0x87bc, 0x87ae, 0x87c9, 0x87c3, 0x87c2, 0x87cc, 0x87b7, 0x87af, 0x87c4, 0x87ca, 0x87b4, 0x87b6, 0x87bf, 0x87b8, 0x87bd, 0x87de, 0x87b2, 0x8935, 0x8933, 0x893c, 0x893e, 0x8941, 0x8952, 0x8937, 0x8942, 0x89ad, 0x89af, 0x89ae, 0x89f2, 0x89f3, 0x8b1e }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeea1[ 94 ] = { 0x8b18, 0x8b16, 0x8b11, 0x8b05, 0x8b0b, 0x8b22, 0x8b0f, 0x8b12, 0x8b15, 0x8b07, 0x8b0d, 0x8b08, 0x8b06, 0x8b1c, 0x8b13, 0x8b1a, 0x8c4f, 0x8c70, 0x8c72, 0x8c71, 0x8c6f, 0x8c95, 0x8c94, 0x8cf9, 0x8d6f, 0x8e4e, 0x8e4d, 0x8e53, 0x8e50, 0x8e4c, 0x8e47, 0x8f43, 0x8f40, 0x9085, 0x907e, 0x9138, 0x919a, 0x91a2, 0x919b, 0x9199, 0x919f, 0x91a1, 0x919d, 0x91a0, 0x93a1, 0x9383, 0x93af, 0x9364, 0x9356, 0x9347, 0x937c, 0x9358, 0x935c, 0x9376, 0x9349, 0x9350, 0x9351, 0x9360, 0x936d, 0x938f, 0x934c, 0x936a, 0x9379, 0x9357, 0x9355, 0x9352, 0x934f, 0x9371, 0x9377, 0x937b, 0x9361, 0x935e, 0x9363, 0x9367, 0x9380, 0x934e, 0x9359, 0x95c7, 0x95c0, 0x95c9, 0x95c3, 0x95c5, 0x95b7, 0x96ae, 0x96b0, 0x96ac, 0x9720, 0x971f, 0x9718, 0x971d, 0x9719, 0x979a, 0x97a1, 0x979c }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xef40[ 63 ] = { 0x979e, 0x979d, 0x97d5, 0x97d4, 0x97f1, 0x9841, 0x9844, 0x984a, 0x9849, 0x9845, 0x9843, 0x9925, 0x992b, 0x992c, 0x992a, 0x9933, 0x9932, 0x992f, 0x992d, 0x9931, 0x9930, 0x9998, 0x99a3, 0x99a1, 0x9a02, 0x99fa, 0x99f4, 0x99f7, 0x99f9, 0x99f8, 0x99f6, 0x99fb, 0x99fd, 0x99fe, 0x99fc, 0x9a03, 0x9abe, 0x9afe, 0x9afd, 0x9b01, 0x9afc, 0x9b48, 0x9b9a, 0x9ba8, 0x9b9e, 0x9b9b, 0x9ba6, 0x9ba1, 0x9ba5, 0x9ba4, 0x9b86, 0x9ba2, 0x9ba0, 0x9baf, 0x9d33, 0x9d41, 0x9d67, 0x9d36, 0x9d2e, 0x9d2f, 0x9d31, 0x9d38, 0x9d30 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xefa1[ 94 ] = { 0x9d45, 0x9d42, 0x9d43, 0x9d3e, 0x9d37, 0x9d40, 0x9d3d, 0x7ff5, 0x9d2d, 0x9e8a, 0x9e89, 0x9e8d, 0x9eb0, 0x9ec8, 0x9eda, 0x9efb, 0x9eff, 0x9f24, 0x9f23, 0x9f22, 0x9f54, 0x9fa0, 0x5131, 0x512d, 0x512e, 0x5698, 0x569c, 0x5697, 0x569a, 0x569d, 0x5699, 0x5970, 0x5b3c, 0x5c69, 0x5c6a, 0x5dc0, 0x5e6d, 0x5e6e, 0x61d8, 0x61df, 0x61ed, 0x61ee, 0x61f1, 0x61ea, 0x61f0, 0x61eb, 0x61d6, 0x61e9, 0x64ff, 0x6504, 0x64fd, 0x64f8, 0x6501, 0x6503, 0x64fc, 0x6594, 0x65db, 0x66da, 0x66db, 0x66d8, 0x6ac5, 0x6ab9, 0x6abd, 0x6ae1, 0x6ac6, 0x6aba, 0x6ab6, 0x6ab7, 0x6ac7, 0x6ab4, 0x6aad, 0x6b5e, 0x6bc9, 0x6c0b, 0x7007, 0x700c, 0x700d, 0x7001, 0x7005, 0x7014, 0x700e, 0x6fff, 0x7000, 0x6ffb, 0x7026, 0x6ffc, 0x6ff7, 0x700a, 0x7201, 0x71ff, 0x71f9, 0x7203, 0x71fd, 0x7376 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf040[ 63 ] = { 0x74b8, 0x74c0, 0x74b5, 0x74c1, 0x74be, 0x74b6, 0x74bb, 0x74c2, 0x7514, 0x7513, 0x765c, 0x7664, 0x7659, 0x7650, 0x7653, 0x7657, 0x765a, 0x76a6, 0x76bd, 0x76ec, 0x77c2, 0x77ba, 0x78ff, 0x790c, 0x7913, 0x7914, 0x7909, 0x7910, 0x7912, 0x7911, 0x79ad, 0x79ac, 0x7a5f, 0x7c1c, 0x7c29, 0x7c19, 0x7c20, 0x7c1f, 0x7c2d, 0x7c1d, 0x7c26, 0x7c28, 0x7c22, 0x7c25, 0x7c30, 0x7e5c, 0x7e50, 0x7e56, 0x7e63, 0x7e58, 0x7e62, 0x7e5f, 0x7e51, 0x7e60, 0x7e57, 0x7e53, 0x7fb5, 0x7fb3, 0x7ff7, 0x7ff8, 0x8075, 0x81d1, 0x81d2 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf0a1[ 94 ] = { 0x81d0, 0x825f, 0x825e, 0x85b4, 0x85c6, 0x85c0, 0x85c3, 0x85c2, 0x85b3, 0x85b5, 0x85bd, 0x85c7, 0x85c4, 0x85bf, 0x85cb, 0x85ce, 0x85c8, 0x85c5, 0x85b1, 0x85b6, 0x85d2, 0x8624, 0x85b8, 0x85b7, 0x85be, 0x8669, 0x87e7, 0x87e6, 0x87e2, 0x87db, 0x87eb, 0x87ea, 0x87e5, 0x87df, 0x87f3, 0x87e4, 0x87d4, 0x87dc, 0x87d3, 0x87ed, 0x87d8, 0x87e3, 0x87a4, 0x87d7, 0x87d9, 0x8801, 0x87f4, 0x87e8, 0x87dd, 0x8953, 0x894b, 0x894f, 0x894c, 0x8946, 0x8950, 0x8951, 0x8949, 0x8b2a, 0x8b27, 0x8b23, 0x8b33, 0x8b30, 0x8b35, 0x8b47, 0x8b2f, 0x8b3c, 0x8b3e, 0x8b31, 0x8b25, 0x8b37, 0x8b26, 0x8b36, 0x8b2e, 0x8b24, 0x8b3b, 0x8b3d, 0x8b3a, 0x8c42, 0x8c75, 0x8c99, 0x8c98, 0x8c97, 0x8cfe, 0x8d04, 0x8d02, 0x8d00, 0x8e5c, 0x8e62, 0x8e60, 0x8e57, 0x8e56, 0x8e5e, 0x8e65, 0x8e67 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf140[ 63 ] = { 0x8e5b, 0x8e5a, 0x8e61, 0x8e5d, 0x8e69, 0x8e54, 0x8f46, 0x8f47, 0x8f48, 0x8f4b, 0x9128, 0x913a, 0x913b, 0x913e, 0x91a8, 0x91a5, 0x91a7, 0x91af, 0x91aa, 0x93b5, 0x938c, 0x9392, 0x93b7, 0x939b, 0x939d, 0x9389, 0x93a7, 0x938e, 0x93aa, 0x939e, 0x93a6, 0x9395, 0x9388, 0x9399, 0x939f, 0x938d, 0x93b1, 0x9391, 0x93b2, 0x93a4, 0x93a8, 0x93b4, 0x93a3, 0x93a5, 0x95d2, 0x95d3, 0x95d1, 0x96b3, 0x96d7, 0x96da, 0x5dc2, 0x96df, 0x96d8, 0x96dd, 0x9723, 0x9722, 0x9725, 0x97ac, 0x97ae, 0x97a8, 0x97ab, 0x97a4, 0x97aa }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf1a1[ 94 ] = { 0x97a2, 0x97a5, 0x97d7, 0x97d9, 0x97d6, 0x97d8, 0x97fa, 0x9850, 0x9851, 0x9852, 0x98b8, 0x9941, 0x993c, 0x993a, 0x9a0f, 0x9a0b, 0x9a09, 0x9a0d, 0x9a04, 0x9a11, 0x9a0a, 0x9a05, 0x9a07, 0x9a06, 0x9ac0, 0x9adc, 0x9b08, 0x9b04, 0x9b05, 0x9b29, 0x9b35, 0x9b4a, 0x9b4c, 0x9b4b, 0x9bc7, 0x9bc6, 0x9bc3, 0x9bbf, 0x9bc1, 0x9bb5, 0x9bb8, 0x9bd3, 0x9bb6, 0x9bc4, 0x9bb9, 0x9bbd, 0x9d5c, 0x9d53, 0x9d4f, 0x9d4a, 0x9d5b, 0x9d4b, 0x9d59, 0x9d56, 0x9d4c, 0x9d57, 0x9d52, 0x9d54, 0x9d5f, 0x9d58, 0x9d5a, 0x9e8e, 0x9e8c, 0x9edf, 0x9f01, 0x9f00, 0x9f16, 0x9f25, 0x9f2b, 0x9f2a, 0x9f29, 0x9f28, 0x9f4c, 0x9f55, 0x5134, 0x5135, 0x5296, 0x52f7, 0x53b4, 0x56ab, 0x56ad, 0x56a6, 0x56a7, 0x56aa, 0x56ac, 0x58da, 0x58dd, 0x58db, 0x5912, 0x5b3d, 0x5b3e, 0x5b3f, 0x5dc3, 0x5e70 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf240[ 63 ] = { 0x5fbf, 0x61fb, 0x6507, 0x6510, 0x650d, 0x6509, 0x650c, 0x650e, 0x6584, 0x65de, 0x65dd, 0x66de, 0x6ae7, 0x6ae0, 0x6acc, 0x6ad1, 0x6ad9, 0x6acb, 0x6adf, 0x6adc, 0x6ad0, 0x6aeb, 0x6acf, 0x6acd, 0x6ade, 0x6b60, 0x6bb0, 0x6c0c, 0x7019, 0x7027, 0x7020, 0x7016, 0x702b, 0x7021, 0x7022, 0x7023, 0x7029, 0x7017, 0x7024, 0x701c, 0x702a, 0x720c, 0x720a, 0x7207, 0x7202, 0x7205, 0x72a5, 0x72a6, 0x72a4, 0x72a3, 0x72a1, 0x74cb, 0x74c5, 0x74b7, 0x74c3, 0x7516, 0x7660, 0x77c9, 0x77ca, 0x77c4, 0x77f1, 0x791d, 0x791b }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf2a1[ 94 ] = { 0x7921, 0x791c, 0x7917, 0x791e, 0x79b0, 0x7a67, 0x7a68, 0x7c33, 0x7c3c, 0x7c39, 0x7c2c, 0x7c3b, 0x7cec, 0x7cea, 0x7e76, 0x7e75, 0x7e78, 0x7e70, 0x7e77, 0x7e6f, 0x7e7a, 0x7e72, 0x7e74, 0x7e68, 0x7f4b, 0x7f4a, 0x7f83, 0x7f86, 0x7fb7, 0x7ffd, 0x7ffe, 0x8078, 0x81d7, 0x81d5, 0x8264, 0x8261, 0x8263, 0x85eb, 0x85f1, 0x85ed, 0x85d9, 0x85e1, 0x85e8, 0x85da, 0x85d7, 0x85ec, 0x85f2, 0x85f8, 0x85d8, 0x85df, 0x85e3, 0x85dc, 0x85d1, 0x85f0, 0x85e6, 0x85ef, 0x85de, 0x85e2, 0x8800, 0x87fa, 0x8803, 0x87f6, 0x87f7, 0x8809, 0x880c, 0x880b, 0x8806, 0x87fc, 0x8808, 0x87ff, 0x880a, 0x8802, 0x8962, 0x895a, 0x895b, 0x8957, 0x8961, 0x895c, 0x8958, 0x895d, 0x8959, 0x8988, 0x89b7, 0x89b6, 0x89f6, 0x8b50, 0x8b48, 0x8b4a, 0x8b40, 0x8b53, 0x8b56, 0x8b54, 0x8b4b, 0x8b55 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf340[ 63 ] = { 0x8b51, 0x8b42, 0x8b52, 0x8b57, 0x8c43, 0x8c77, 0x8c76, 0x8c9a, 0x8d06, 0x8d07, 0x8d09, 0x8dac, 0x8daa, 0x8dad, 0x8dab, 0x8e6d, 0x8e78, 0x8e73, 0x8e6a, 0x8e6f, 0x8e7b, 0x8ec2, 0x8f52, 0x8f51, 0x8f4f, 0x8f50, 0x8f53, 0x8fb4, 0x9140, 0x913f, 0x91b0, 0x91ad, 0x93de, 0x93c7, 0x93cf, 0x93c2, 0x93da, 0x93d0, 0x93f9, 0x93ec, 0x93cc, 0x93d9, 0x93a9, 0x93e6, 0x93ca, 0x93d4, 0x93ee, 0x93e3, 0x93d5, 0x93c4, 0x93ce, 0x93c0, 0x93d2, 0x93e7, 0x957d, 0x95da, 0x95db, 0x96e1, 0x9729, 0x972b, 0x972c, 0x9728, 0x9726 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf3a1[ 94 ] = { 0x97b3, 0x97b7, 0x97b6, 0x97dd, 0x97de, 0x97df, 0x985c, 0x9859, 0x985d, 0x9857, 0x98bf, 0x98bd, 0x98bb, 0x98be, 0x9948, 0x9947, 0x9943, 0x99a6, 0x99a7, 0x9a1a, 0x9a15, 0x9a25, 0x9a1d, 0x9a24, 0x9a1b, 0x9a22, 0x9a20, 0x9a27, 0x9a23, 0x9a1e, 0x9a1c, 0x9a14, 0x9ac2, 0x9b0b, 0x9b0a, 0x9b0e, 0x9b0c, 0x9b37, 0x9bea, 0x9beb, 0x9be0, 0x9bde, 0x9be4, 0x9be6, 0x9be2, 0x9bf0, 0x9bd4, 0x9bd7, 0x9bec, 0x9bdc, 0x9bd9, 0x9be5, 0x9bd5, 0x9be1, 0x9bda, 0x9d77, 0x9d81, 0x9d8a, 0x9d84, 0x9d88, 0x9d71, 0x9d80, 0x9d78, 0x9d86, 0x9d8b, 0x9d8c, 0x9d7d, 0x9d6b, 0x9d74, 0x9d75, 0x9d70, 0x9d69, 0x9d85, 0x9d73, 0x9d7b, 0x9d82, 0x9d6f, 0x9d79, 0x9d7f, 0x9d87, 0x9d68, 0x9e94, 0x9e91, 0x9ec0, 0x9efc, 0x9f2d, 0x9f40, 0x9f41, 0x9f4d, 0x9f56, 0x9f57, 0x9f58, 0x5337, 0x56b2 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf440[ 63 ] = { 0x56b5, 0x56b3, 0x58e3, 0x5b45, 0x5dc6, 0x5dc7, 0x5eee, 0x5eef, 0x5fc0, 0x5fc1, 0x61f9, 0x6517, 0x6516, 0x6515, 0x6513, 0x65df, 0x66e8, 0x66e3, 0x66e4, 0x6af3, 0x6af0, 0x6aea, 0x6ae8, 0x6af9, 0x6af1, 0x6aee, 0x6aef, 0x703c, 0x7035, 0x702f, 0x7037, 0x7034, 0x7031, 0x7042, 0x7038, 0x703f, 0x703a, 0x7039, 0x7040, 0x703b, 0x7033, 0x7041, 0x7213, 0x7214, 0x72a8, 0x737d, 0x737c, 0x74ba, 0x76ab, 0x76aa, 0x76be, 0x76ed, 0x77cc, 0x77ce, 0x77cf, 0x77cd, 0x77f2, 0x7925, 0x7923, 0x7927, 0x7928, 0x7924, 0x7929 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf4a1[ 94 ] = { 0x79b2, 0x7a6e, 0x7a6c, 0x7a6d, 0x7af7, 0x7c49, 0x7c48, 0x7c4a, 0x7c47, 0x7c45, 0x7cee, 0x7e7b, 0x7e7e, 0x7e81, 0x7e80, 0x7fba, 0x7fff, 0x8079, 0x81db, 0x81d9, 0x820b, 0x8268, 0x8269, 0x8622, 0x85ff, 0x8601, 0x85fe, 0x861b, 0x8600, 0x85f6, 0x8604, 0x8609, 0x8605, 0x860c, 0x85fd, 0x8819, 0x8810, 0x8811, 0x8817, 0x8813, 0x8816, 0x8963, 0x8966, 0x89b9, 0x89f7, 0x8b60, 0x8b6a, 0x8b5d, 0x8b68, 0x8b63, 0x8b65, 0x8b67, 0x8b6d, 0x8dae, 0x8e86, 0x8e88, 0x8e84, 0x8f59, 0x8f56, 0x8f57, 0x8f55, 0x8f58, 0x8f5a, 0x908d, 0x9143, 0x9141, 0x91b7, 0x91b5, 0x91b2, 0x91b3, 0x940b, 0x9413, 0x93fb, 0x9420, 0x940f, 0x9414, 0x93fe, 0x9415, 0x9410, 0x9428, 0x9419, 0x940d, 0x93f5, 0x9400, 0x93f7, 0x9407, 0x940e, 0x9416, 0x9412, 0x93fa, 0x9409, 0x93f8, 0x940a, 0x93ff }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf540[ 63 ] = { 0x93fc, 0x940c, 0x93f6, 0x9411, 0x9406, 0x95de, 0x95e0, 0x95df, 0x972e, 0x972f, 0x97b9, 0x97bb, 0x97fd, 0x97fe, 0x9860, 0x9862, 0x9863, 0x985f, 0x98c1, 0x98c2, 0x9950, 0x994e, 0x9959, 0x994c, 0x994b, 0x9953, 0x9a32, 0x9a34, 0x9a31, 0x9a2c, 0x9a2a, 0x9a36, 0x9a29, 0x9a2e, 0x9a38, 0x9a2d, 0x9ac7, 0x9aca, 0x9ac6, 0x9b10, 0x9b12, 0x9b11, 0x9c0b, 0x9c08, 0x9bf7, 0x9c05, 0x9c12, 0x9bf8, 0x9c40, 0x9c07, 0x9c0e, 0x9c06, 0x9c17, 0x9c14, 0x9c09, 0x9d9f, 0x9d99, 0x9da4, 0x9d9d, 0x9d92, 0x9d98, 0x9d90, 0x9d9b }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf5a1[ 94 ] = { 0x9da0, 0x9d94, 0x9d9c, 0x9daa, 0x9d97, 0x9da1, 0x9d9a, 0x9da2, 0x9da8, 0x9d9e, 0x9da3, 0x9dbf, 0x9da9, 0x9d96, 0x9da6, 0x9da7, 0x9e99, 0x9e9b, 0x9e9a, 0x9ee5, 0x9ee4, 0x9ee7, 0x9ee6, 0x9f30, 0x9f2e, 0x9f5b, 0x9f60, 0x9f5e, 0x9f5d, 0x9f59, 0x9f91, 0x513a, 0x5139, 0x5298, 0x5297, 0x56c3, 0x56bd, 0x56be, 0x5b48, 0x5b47, 0x5dcb, 0x5dcf, 0x5ef1, 0x61fd, 0x651b, 0x6b02, 0x6afc, 0x6b03, 0x6af8, 0x6b00, 0x7043, 0x7044, 0x704a, 0x7048, 0x7049, 0x7045, 0x7046, 0x721d, 0x721a, 0x7219, 0x737e, 0x7517, 0x766a, 0x77d0, 0x792d, 0x7931, 0x792f, 0x7c54, 0x7c53, 0x7cf2, 0x7e8a, 0x7e87, 0x7e88, 0x7e8b, 0x7e86, 0x7e8d, 0x7f4d, 0x7fbb, 0x8030, 0x81dd, 0x8618, 0x862a, 0x8626, 0x861f, 0x8623, 0x861c, 0x8619, 0x8627, 0x862e, 0x8621, 0x8620, 0x8629, 0x861e, 0x8625 }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf640[ 63 ] = { 0x8829, 0x881d, 0x881b, 0x8820, 0x8824, 0x881c, 0x882b, 0x884a, 0x896d, 0x8969, 0x896e, 0x896b, 0x89fa, 0x8b79, 0x8b78, 0x8b45, 0x8b7a, 0x8b7b, 0x8d10, 0x8d14, 0x8daf, 0x8e8e, 0x8e8c, 0x8f5e, 0x8f5b, 0x8f5d, 0x9146, 0x9144, 0x9145, 0x91b9, 0x943f, 0x943b, 0x9436, 0x9429, 0x943d, 0x943c, 0x9430, 0x9439, 0x942a, 0x9437, 0x942c, 0x9440, 0x9431, 0x95e5, 0x95e4, 0x95e3, 0x9735, 0x973a, 0x97bf, 0x97e1, 0x9864, 0x98c9, 0x98c6, 0x98c0, 0x9958, 0x9956, 0x9a39, 0x9a3d, 0x9a46, 0x9a44, 0x9a42, 0x9a41, 0x9a3a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf6a1[ 94 ] = { 0x9a3f, 0x9acd, 0x9b15, 0x9b17, 0x9b18, 0x9b16, 0x9b3a, 0x9b52, 0x9c2b, 0x9c1d, 0x9c1c, 0x9c2c, 0x9c23, 0x9c28, 0x9c29, 0x9c24, 0x9c21, 0x9db7, 0x9db6, 0x9dbc, 0x9dc1, 0x9dc7, 0x9dca, 0x9dcf, 0x9dbe, 0x9dc5, 0x9dc3, 0x9dbb, 0x9db5, 0x9dce, 0x9db9, 0x9dba, 0x9dac, 0x9dc8, 0x9db1, 0x9dad, 0x9dcc, 0x9db3, 0x9dcd, 0x9db2, 0x9e7a, 0x9e9c, 0x9eeb, 0x9eee, 0x9eed, 0x9f1b, 0x9f18, 0x9f1a, 0x9f31, 0x9f4e, 0x9f65, 0x9f64, 0x9f92, 0x4eb9, 0x56c6, 0x56c5, 0x56cb, 0x5971, 0x5b4b, 0x5b4c, 0x5dd5, 0x5dd1, 0x5ef2, 0x6521, 0x6520, 0x6526, 0x6522, 0x6b0b, 0x6b08, 0x6b09, 0x6c0d, 0x7055, 0x7056, 0x7057, 0x7052, 0x721e, 0x721f, 0x72a9, 0x737f, 0x74d8, 0x74d5, 0x74d9, 0x74d7, 0x766d, 0x76ad, 0x7935, 0x79b4, 0x7a70, 0x7a71, 0x7c57, 0x7c5c, 0x7c59, 0x7c5b, 0x7c5a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf740[ 63 ] = { 0x7cf4, 0x7cf1, 0x7e91, 0x7f4f, 0x7f87, 0x81de, 0x826b, 0x8634, 0x8635, 0x8633, 0x862c, 0x8632, 0x8636, 0x882c, 0x8828, 0x8826, 0x882a, 0x8825, 0x8971, 0x89bf, 0x89be, 0x89fb, 0x8b7e, 0x8b84, 0x8b82, 0x8b86, 0x8b85, 0x8b7f, 0x8d15, 0x8e95, 0x8e94, 0x8e9a, 0x8e92, 0x8e90, 0x8e96, 0x8e97, 0x8f60, 0x8f62, 0x9147, 0x944c, 0x9450, 0x944a, 0x944b, 0x944f, 0x9447, 0x9445, 0x9448, 0x9449, 0x9446, 0x973f, 0x97e3, 0x986a, 0x9869, 0x98cb, 0x9954, 0x995b, 0x9a4e, 0x9a53, 0x9a54, 0x9a4c, 0x9a4f, 0x9a48, 0x9a4a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf7a1[ 94 ] = { 0x9a49, 0x9a52, 0x9a50, 0x9ad0, 0x9b19, 0x9b2b, 0x9b3b, 0x9b56, 0x9b55, 0x9c46, 0x9c48, 0x9c3f, 0x9c44, 0x9c39, 0x9c33, 0x9c41, 0x9c3c, 0x9c37, 0x9c34, 0x9c32, 0x9c3d, 0x9c36, 0x9ddb, 0x9dd2, 0x9dde, 0x9dda, 0x9dcb, 0x9dd0, 0x9ddc, 0x9dd1, 0x9ddf, 0x9de9, 0x9dd9, 0x9dd8, 0x9dd6, 0x9df5, 0x9dd5, 0x9ddd, 0x9eb6, 0x9ef0, 0x9f35, 0x9f33, 0x9f32, 0x9f42, 0x9f6b, 0x9f95, 0x9fa2, 0x513d, 0x5299, 0x58e8, 0x58e7, 0x5972, 0x5b4d, 0x5dd8, 0x882f, 0x5f4f, 0x6201, 0x6203, 0x6204, 0x6529, 0x6525, 0x6596, 0x66eb, 0x6b11, 0x6b12, 0x6b0f, 0x6bca, 0x705b, 0x705a, 0x7222, 0x7382, 0x7381, 0x7383, 0x7670, 0x77d4, 0x7c67, 0x7c66, 0x7e95, 0x826c, 0x863a, 0x8640, 0x8639, 0x863c, 0x8631, 0x863b, 0x863e, 0x8830, 0x8832, 0x882e, 0x8833, 0x8976, 0x8974, 0x8973, 0x89fe }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf840[ 63 ] = { 0x8b8c, 0x8b8e, 0x8b8b, 0x8b88, 0x8c45, 0x8d19, 0x8e98, 0x8f64, 0x8f63, 0x91bc, 0x9462, 0x9455, 0x945d, 0x9457, 0x945e, 0x97c4, 0x97c5, 0x9800, 0x9a56, 0x9a59, 0x9b1e, 0x9b1f, 0x9b20, 0x9c52, 0x9c58, 0x9c50, 0x9c4a, 0x9c4d, 0x9c4b, 0x9c55, 0x9c59, 0x9c4c, 0x9c4e, 0x9dfb, 0x9df7, 0x9def, 0x9de3, 0x9deb, 0x9df8, 0x9de4, 0x9df6, 0x9de1, 0x9dee, 0x9de6, 0x9df2, 0x9df0, 0x9de2, 0x9dec, 0x9df4, 0x9df3, 0x9de8, 0x9ded, 0x9ec2, 0x9ed0, 0x9ef2, 0x9ef3, 0x9f06, 0x9f1c, 0x9f38, 0x9f37, 0x9f36, 0x9f43, 0x9f4f }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf8a1[ 94 ] = { 0x9f71, 0x9f70, 0x9f6e, 0x9f6f, 0x56d3, 0x56cd, 0x5b4e, 0x5c6d, 0x652d, 0x66ed, 0x66ee, 0x6b13, 0x705f, 0x7061, 0x705d, 0x7060, 0x7223, 0x74db, 0x74e5, 0x77d5, 0x7938, 0x79b7, 0x79b6, 0x7c6a, 0x7e97, 0x7f89, 0x826d, 0x8643, 0x8838, 0x8837, 0x8835, 0x884b, 0x8b94, 0x8b95, 0x8e9e, 0x8e9f, 0x8ea0, 0x8e9d, 0x91be, 0x91bd, 0x91c2, 0x946b, 0x9468, 0x9469, 0x96e5, 0x9746, 0x9743, 0x9747, 0x97c7, 0x97e5, 0x9a5e, 0x9ad5, 0x9b59, 0x9c63, 0x9c67, 0x9c66, 0x9c62, 0x9c5e, 0x9c60, 0x9e02, 0x9dfe, 0x9e07, 0x9e03, 0x9e06, 0x9e05, 0x9e00, 0x9e01, 0x9e09, 0x9dff, 0x9dfd, 0x9e04, 0x9ea0, 0x9f1e, 0x9f46, 0x9f74, 0x9f75, 0x9f76, 0x56d4, 0x652e, 0x65b8, 0x6b18, 0x6b19, 0x6b17, 0x6b1a, 0x7062, 0x7226, 0x72aa, 0x77d8, 0x77d9, 0x7939, 0x7c69, 0x7c6b, 0x7cf6, 0x7e9a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf940[ 63 ] = { 0x7e98, 0x7e9b, 0x7e99, 0x81e0, 0x81e1, 0x8646, 0x8647, 0x8648, 0x8979, 0x897a, 0x897c, 0x897b, 0x89ff, 0x8b98, 0x8b99, 0x8ea5, 0x8ea4, 0x8ea3, 0x946e, 0x946d, 0x946f, 0x9471, 0x9473, 0x9749, 0x9872, 0x995f, 0x9c68, 0x9c6e, 0x9c6d, 0x9e0b, 0x9e0d, 0x9e10, 0x9e0f, 0x9e12, 0x9e11, 0x9ea1, 0x9ef5, 0x9f09, 0x9f47, 0x9f78, 0x9f7b, 0x9f7a, 0x9f79, 0x571e, 0x7066, 0x7c6f, 0x883c, 0x8db2, 0x8ea6, 0x91c3, 0x9474, 0x9478, 0x9476, 0x9475, 0x9a60, 0x9c74, 0x9c73, 0x9c71, 0x9c75, 0x9e14, 0x9e13, 0x9ef6, 0x9f0a }; const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf9a1[ 94 ] = { 0x9fa4, 0x7068, 0x7065, 0x7cf7, 0x866a, 0x883e, 0x883d, 0x883f, 0x8b9e, 0x8c9c, 0x8ea9, 0x8ec9, 0x974b, 0x9873, 0x9874, 0x98cc, 0x9961, 0x99ab, 0x9a64, 0x9a66, 0x9a67, 0x9b24, 0x9e15, 0x9e17, 0x9f48, 0x6207, 0x6b1e, 0x7227, 0x864c, 0x8ea8, 0x9482, 0x9480, 0x9481, 0x9a69, 0x9a68, 0x9b2e, 0x9e19, 0x7229, 0x864b, 0x8b9f, 0x9483, 0x9c79, 0x9eb7, 0x7675, 0x9a6b, 0x9c7a, 0x9e1d, 0x7069, 0x706a, 0x9ea4, 0x9f7e, 0x9f49, 0x9f98, 0x7881, 0x92b9, 0x88cf, 0x58bb, 0x6052, 0x7ca7, 0x5afa, 0x2554, 0x2566, 0x2557, 0x2560, 0x256c, 0x2563, 0x255a, 0x2569, 0x255d, 0x2552, 0x2564, 0x2555, 0x255e, 0x256a, 0x2561, 0x2558, 0x2567, 0x255b, 0x2553, 0x2565, 0x2556, 0x255f, 0x256b, 0x2562, 0x2559, 0x2568, 0x255c, 0x2551, 0x2550, 0x256d, 0x256e, 0x2570, 0x256f, 0x2593, }; /* Unicode to ASCII character lookup table for Windows 950 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x0080[ 128 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2a1, 0x58a2, 0xd3a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x02c0[ 320 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbea3, 0x001a, 0xbca3, 0xbda3, 0xbfa3, 0x001a, 0xc5a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbba3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x44a3, 0x45a3, 0x46a3, 0x47a3, 0x48a3, 0x49a3, 0x4aa3, 0x4ba3, 0x4ca3, 0x4da3, 0x4ea3, 0x4fa3, 0x50a3, 0x51a3, 0x52a3, 0x53a3, 0x54a3, 0x001a, 0x55a3, 0x56a3, 0x57a3, 0x58a3, 0x59a3, 0x5aa3, 0x5ba3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ca3, 0x5da3, 0x5ea3, 0x5fa3, 0x60a3, 0x61a3, 0x62a3, 0x63a3, 0x64a3, 0x65a3, 0x66a3, 0x67a3, 0x68a3, 0x69a3, 0x6aa3, 0x6ba3, 0x6ca3, 0x001a, 0x6da3, 0x6ea3, 0x6fa3, 0x70a3, 0x71a3, 0x72a3, 0x73a3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x2000[ 768 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56a1, 0x58a1, 0x001a, 0x001a, 0x001a, 0xa5a1, 0xa6a1, 0x001a, 0x001a, 0xa7a1, 0xa8a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ca1, 0x4ba1, 0x45a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaca1, 0x001a, 0x001a, 0xaba1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1a3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4aa2, 0x001a, 0xc1a1, 0x001a, 0x001a, 0x001a, 0x4ba2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9a2, 0xbaa2, 0xbba2, 0xbca2, 0xbda2, 0xbea2, 0xbfa2, 0xc0a2, 0xc1a2, 0xc2a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6a1, 0xf4a1, 0xf7a1, 0xf5a1, 0x001a, 0x001a, 0xf8a1, 0xf9a1, 0xfba1, 0xfaa1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41a2, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4a1, 0x001a, 0x001a, 0x001a, 0xdba1, 0xe8a1, 0xe7a1, 0x001a, 0x001a, 0xfda1, 0x001a, 0xfca1, 0x001a, 0x001a, 0x001a, 0xe4a1, 0xe5a1, 0xeca1, 0x001a, 0x001a, 0xeda1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefa1, 0xeea1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdca1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaa1, 0xdda1, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8a1, 0xd9a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2a1, 0x001a, 0x001a, 0x001a, 0xf3a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x2500[ 384 ] = { 0x77a2, 0x001a, 0x78a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7aa2, 0x001a, 0x001a, 0x001a, 0x7ba2, 0x001a, 0x001a, 0x001a, 0x7ca2, 0x001a, 0x001a, 0x001a, 0x7da2, 0x001a, 0x001a, 0x001a, 0x75a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x72a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x71a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a2, 0xf8f9, 0xe6f9, 0xeff9, 0xddf9, 0xe8f9, 0xf1f9, 0xdff9, 0xecf9, 0xf5f9, 0xe3f9, 0xeef9, 0xf7f9, 0xe5f9, 0xa5a2, 0xf2f9, 0xe0f9, 0xa7a2, 0xf4f9, 0xe2f9, 0xe7f9, 0xf0f9, 0xdef9, 0xedf9, 0xf6f9, 0xe4f9, 0xa6a2, 0xf3f9, 0xe1f9, 0x7ea2, 0xa1a2, 0xa3a2, 0xa2a2, 0xaca2, 0xada2, 0xaea2, 0x5aa1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62a2, 0x63a2, 0x64a2, 0x65a2, 0x66a2, 0x67a2, 0x68a2, 0x69a2, 0x70a2, 0x6fa2, 0x6ea2, 0x6da2, 0x6ca2, 0x6ba2, 0x6aa2, 0x001a, 0x001a, 0x001a, 0xfef9, 0x76a2, 0x79a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbda1, 0xbca1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6a1, 0xb5a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfa1, 0xbea1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbba1, 0xbaa1, 0x001a, 0x001a, 0x001a, 0xb3a1, 0x001a, 0x001a, 0xb7a1, 0xb4a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8a2, 0xa9a2, 0xaba2, 0xaaa2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9a1, 0xb8a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0a1, 0x001a, 0xf1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x3000[ 1024 ] = { 0x40a1, 0x42a1, 0x43a1, 0xb2a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x71a1, 0x72a1, 0x6da1, 0x6ea1, 0x75a1, 0x76a1, 0x79a1, 0x7aa1, 0x69a1, 0x6aa1, 0x45a2, 0x001a, 0x65a1, 0x66a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9a1, 0xaaa1, 0x001a, 0x001a, 0xc3a2, 0xc4a2, 0xc5a2, 0xc6a2, 0xc7a2, 0xc8a2, 0xc9a2, 0xcaa2, 0xcba2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74a3, 0x75a3, 0x76a3, 0x77a3, 0x78a3, 0x79a3, 0x7aa3, 0x7ba3, 0x7ca3, 0x7da3, 0x7ea3, 0xa1a3, 0xa2a3, 0xa3a3, 0xa4a3, 0xa5a3, 0xa6a3, 0xa7a3, 0xa8a3, 0xa9a3, 0xaaa3, 0xaba3, 0xaca3, 0xada3, 0xaea3, 0xafa3, 0xb0a3, 0xb1a3, 0xb2a3, 0xb3a3, 0xb4a3, 0xb5a3, 0xb6a3, 0xb7a3, 0xb8a3, 0xb9a3, 0xbaa3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x55a2, 0x56a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50a2, 0x51a2, 0x52a2, 0x001a, 0x001a, 0x54a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x57a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x53a2, 0x001a, 0x001a, 0xeba1, 0xeaa1, 0x001a, 0x001a, 0x4fa2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x4e00[ 20928 ] = { 0x40a4, 0x42a4, 0x001a, 0x43a4, 0x001a, 0x001a, 0x001a, 0x45c9, 0x56a4, 0x54a4, 0x57a4, 0x55a4, 0x46c9, 0xa3a4, 0x4fc9, 0x4dc9, 0xa2a4, 0xa1a4, 0x001a, 0x001a, 0x42a5, 0x41a5, 0x40a5, 0x001a, 0x43a5, 0xfea4, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0a5, 0xe1a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x58a4, 0x001a, 0xa4a4, 0x50c9, 0x001a, 0xa5a4, 0x63c9, 0xeaa6, 0xb1cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x59a4, 0xa6a4, 0x001a, 0x44a5, 0x64c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x40c9, 0x44a4, 0x001a, 0x5ba4, 0x001a, 0x47c9, 0x5ca4, 0x001a, 0x001a, 0xa7a4, 0x001a, 0x45a5, 0x47a5, 0x46a5, 0x001a, 0x001a, 0xe2a5, 0xe3a5, 0x001a, 0x001a, 0xc4a8, 0x001a, 0xbcad, 0x41a4, 0x001a, 0x001a, 0x41c9, 0x45a4, 0x5ea4, 0x5da4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaeb0, 0x4bd4, 0x001a, 0x001a, 0xc3b6, 0xb1dc, 0xb2dc, 0x001a, 0x46a4, 0x001a, 0xa9a4, 0x001a, 0x001a, 0xc6a8, 0x47a4, 0x48c9, 0x5fa4, 0x001a, 0x001a, 0xaaa4, 0xaca4, 0x51c9, 0xada4, 0xaba4, 0x001a, 0x001a, 0x001a, 0xe5a5, 0x001a, 0xc7a8, 0x001a, 0x001a, 0xc8a8, 0x45ab, 0x001a, 0x60a4, 0xaea4, 0x001a, 0xe6a5, 0xe8a5, 0xe7a5, 0x001a, 0xeba6, 0x001a, 0x001a, 0xc9a8, 0xcaa8, 0x46ab, 0x47ab, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdad, 0x001a, 0x001a, 0xb3dc, 0x001a, 0x001a, 0xd6f6, 0x48a4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0a4, 0xafa4, 0x52c9, 0xb1a4, 0xb7a4, 0x001a, 0xb2a4, 0xb3a4, 0x54c9, 0x53c9, 0xb5a4, 0xb6a4, 0x001a, 0xb4a4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4aa5, 0x4ba5, 0x4ca5, 0x4da5, 0x49a5, 0x50a5, 0x6ac9, 0x001a, 0x66c9, 0x69c9, 0x51a5, 0x61a5, 0x001a, 0x68c9, 0x001a, 0x4ea5, 0x4fa5, 0x48a5, 0x001a, 0x001a, 0x65c9, 0x67c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5a5, 0xb0c9, 0xf2a5, 0xf6a5, 0xbac9, 0xaec9, 0xf3a5, 0xb2c9, 0x001a, 0x001a, 0x001a, 0xf4a5, 0x001a, 0xf7a5, 0x001a, 0xe9a5, 0xb1c9, 0xf8a5, 0xb5c9, 0x001a, 0xb9c9, 0xb6c9, 0x001a, 0x001a, 0xb3c9, 0xeaa5, 0xeca5, 0xf9a5, 0x001a, 0xeea5, 0xabc9, 0xf1a5, 0xefa5, 0xf0a5, 0xbbc9, 0xb8c9, 0xafc9, 0xeda5, 0x001a, 0x001a, 0xacc9, 0xeba5, 0x001a, 0x001a, 0x001a, 0xb4c9, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadc9, 0x66ca, 0x001a, 0x42a7, 0xf4a6, 0x001a, 0x001a, 0x67ca, 0xf1a6, 0x001a, 0x44a7, 0x001a, 0xf9a6, 0x001a, 0xf8a6, 0x5bca, 0xfca6, 0xf7a6, 0x60ca, 0x68ca, 0x001a, 0x64ca, 0x001a, 0xfaa6, 0x001a, 0x001a, 0xfda6, 0xeea6, 0x47a7, 0x5dca, 0x001a, 0x001a, 0xbdcb, 0xeca6, 0x43a7, 0xeda6, 0xf5a6, 0xf6a6, 0x62ca, 0x5eca, 0xfba6, 0xf3a6, 0x5aca, 0xefa6, 0x65ca, 0x45a7, 0x48a7, 0xf2a6, 0x40a7, 0x46a7, 0xf0a6, 0x63ca, 0x41a7, 0x69ca, 0x5cca, 0xfea6, 0x5fca, 0x001a, 0x001a, 0x61ca, 0x001a, 0xd8a8, 0xbfcb, 0xcbcb, 0xd0a8, 0x001a, 0xcccb, 0xcba8, 0xd5a8, 0x001a, 0x001a, 0xcea8, 0xb9cb, 0xd6a8, 0xb8cb, 0xbccb, 0xc3cb, 0xc1cb, 0xdea8, 0xd9a8, 0xb3cb, 0xb5cb, 0xdba8, 0xcfa8, 0xb6cb, 0xc2cb, 0xc9cb, 0xd4a8, 0xbbcb, 0xb4cb, 0xd3a8, 0xb7cb, 0xd7a8, 0xbacb, 0x001a, 0xd2a8, 0x001a, 0xcda8, 0x001a, 0xdca8, 0xc4cb, 0xdda8, 0xc8cb, 0x001a, 0xc6cb, 0xcacb, 0xdaa8, 0xbecb, 0xb2cb, 0x001a, 0xc0cb, 0xd1a8, 0xc5cb, 0xcca8, 0xc7cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56ab, 0x4aab, 0x001a, 0x001a, 0xe0cd, 0xe8cd, 0x001a, 0x49ab, 0x51ab, 0x5dab, 0x001a, 0xeecd, 0xeccd, 0xe7cd, 0x001a, 0x001a, 0x001a, 0x4bab, 0xedcd, 0xe3cd, 0x59ab, 0x50ab, 0x58ab, 0xdecd, 0x001a, 0xeacd, 0x001a, 0xe1cd, 0x54ab, 0xe2cd, 0x001a, 0xddcd, 0x5bab, 0x4eab, 0x57ab, 0x4dab, 0x001a, 0xdfcd, 0xe4cd, 0x001a, 0xebcd, 0x55ab, 0x52ab, 0xe6cd, 0x5aab, 0xe9cd, 0xe5cd, 0x4fab, 0x5cab, 0x53ab, 0x4cab, 0x48ab, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefcd, 0x001a, 0xd7ad, 0xc1ad, 0x001a, 0xd1ad, 0x001a, 0xd6ad, 0xd0d0, 0xcfd0, 0xd4d0, 0xd5d0, 0xc4ad, 0x001a, 0xcdad, 0x001a, 0x001a, 0x001a, 0xdaad, 0x001a, 0xcead, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9d0, 0xc7ad, 0xcad0, 0x001a, 0xdcad, 0x001a, 0xd3ad, 0xbead, 0xbfad, 0xddd0, 0xbfb0, 0x001a, 0xccad, 0xcbad, 0xcbd0, 0xcfad, 0x5bd4, 0xc6ad, 0xd6d0, 0xd5ad, 0xd4ad, 0xcaad, 0xced0, 0xd7d0, 0x001a, 0xc8d0, 0xc9ad, 0xd8d0, 0xd2ad, 0xccd0, 0xc0ad, 0x001a, 0xc3ad, 0xc2ad, 0xd9d0, 0xd0ad, 0xc5ad, 0xd9ad, 0xdbad, 0xd3d0, 0xd8ad, 0x001a, 0xdbd0, 0xcdd0, 0xdcd0, 0x001a, 0xd1d0, 0x001a, 0xdad0, 0x001a, 0xd2d0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ad, 0x001a, 0x001a, 0x001a, 0x63d4, 0x57d4, 0x001a, 0xb3b0, 0x001a, 0x5cd4, 0x62d4, 0xb2b0, 0x55d4, 0xb6b0, 0x59d4, 0x52d4, 0xb4b0, 0x56d4, 0xb9b0, 0xbeb0, 0x001a, 0x67d4, 0x001a, 0x51d4, 0x001a, 0xbab0, 0x001a, 0x66d4, 0x001a, 0x001a, 0xb5b0, 0x58d4, 0xb1b0, 0x53d4, 0x4fd4, 0x5dd4, 0x50d4, 0x4ed4, 0x5ad4, 0x60d4, 0x61d4, 0xb7b0, 0x001a, 0x001a, 0x5bd8, 0x5ed4, 0x4dd4, 0x5fd4, 0x001a, 0xc1b0, 0x64d4, 0xc0b0, 0x4cd4, 0x001a, 0x54d4, 0x65d4, 0xbcb0, 0xbbb0, 0xb8b0, 0xbdb0, 0x001a, 0x001a, 0xafb0, 0x001a, 0x001a, 0xb0b0, 0x001a, 0x001a, 0xc8b3, 0x001a, 0x5ed8, 0x57d8, 0x001a, 0xc5b3, 0x001a, 0x5fd8, 0x001a, 0x001a, 0x001a, 0x55d8, 0x58d8, 0xc4b3, 0x59d8, 0x001a, 0x001a, 0xc7b3, 0x5dd8, 0x001a, 0x53d8, 0x52d8, 0xc9b3, 0x001a, 0xcab3, 0xc6b3, 0xcbb3, 0x51d8, 0x5cd8, 0x5ad8, 0x54d8, 0x001a, 0x001a, 0x001a, 0xc3b3, 0x56d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcab6, 0xc4b6, 0xb7dc, 0xcdb6, 0xbddc, 0xc0dc, 0xc6b6, 0xc7b6, 0xbadc, 0xc5b6, 0xc3dc, 0xcbb6, 0xc4dc, 0x001a, 0xbfdc, 0xccb6, 0x001a, 0xb4dc, 0xc9b6, 0xb5dc, 0x001a, 0xbedc, 0xbcdc, 0x001a, 0xb8dc, 0xc8b6, 0xb6dc, 0xceb6, 0xbbdc, 0xc2dc, 0xb9dc, 0xc1dc, 0x001a, 0x001a, 0xb6b9, 0xb3b9, 0x001a, 0xb4b9, 0x001a, 0xf9e0, 0xf1e0, 0xb2b9, 0xafb9, 0xf2e0, 0x001a, 0x001a, 0xb1b9, 0xf5e0, 0x001a, 0xf7e0, 0x001a, 0x001a, 0xfee0, 0x001a, 0x001a, 0xfde0, 0xf8e0, 0xaeb9, 0xf0e0, 0xacb9, 0xf3e0, 0xb7b9, 0xf6e0, 0x001a, 0xfae0, 0xb0b9, 0xadb9, 0xfce0, 0xfbe0, 0xb5b9, 0x001a, 0xf4e0, 0x001a, 0xf8bb, 0xece4, 0x001a, 0xe9e4, 0xf9bb, 0x001a, 0xf7bb, 0x001a, 0xf0e4, 0xede4, 0xe6e4, 0xf6bb, 0x001a, 0xfabb, 0xe7e4, 0xf5bb, 0xfdbb, 0xeae4, 0xebe4, 0xfbbb, 0xfcbb, 0xf1e4, 0xeee4, 0xefe4, 0x001a, 0x001a, 0x001a, 0xaabe, 0xf8e8, 0xa7be, 0xf5e8, 0xa9be, 0xabbe, 0x001a, 0xf6e8, 0xa8be, 0x001a, 0xf7e8, 0x001a, 0xf4e8, 0x001a, 0x001a, 0x76c0, 0xbdec, 0x77c0, 0xbbec, 0x001a, 0xbcec, 0xbaec, 0xb9ec, 0x001a, 0x001a, 0xbeec, 0x75c0, 0x001a, 0x001a, 0xb8ef, 0xb9ef, 0x001a, 0xe8e4, 0xb7ef, 0x78c0, 0x5fc3, 0xebf1, 0xecf1, 0x001a, 0xd7c4, 0xd8c4, 0xc1f5, 0xc0f5, 0x6cc5, 0x6bc5, 0xd0f7, 0x001a, 0x49a4, 0x61a4, 0xb9a4, 0x001a, 0xb8a4, 0x53a5, 0x52a5, 0xfca5, 0xfba5, 0xfda5, 0xfaa5, 0x001a, 0x4aa7, 0x49a7, 0x4ba7, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0a8, 0x001a, 0xdfa8, 0xe1a8, 0x001a, 0x5eab, 0x001a, 0x59a2, 0xded0, 0x5aa2, 0xc2b0, 0x5ca2, 0x5ba2, 0x60d8, 0x001a, 0x5da2, 0xb8b9, 0x5ea2, 0x001a, 0x4aa4, 0x001a, 0xbaa4, 0xfea5, 0xe2a8, 0x001a, 0x4ba4, 0xbda4, 0xbba4, 0xbca4, 0x001a, 0x001a, 0x40a6, 0x001a, 0x001a, 0x001a, 0x4ca7, 0xe4a8, 0xe3a8, 0xe5a8, 0x001a, 0x001a, 0x001a, 0xddad, 0x001a, 0x001a, 0x001a, 0xacbe, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ec9, 0x001a, 0x54a5, 0x55a5, 0x001a, 0x001a, 0x41a6, 0x001a, 0x6aca, 0x001a, 0x60ab, 0x5fab, 0xe0d0, 0xdfd0, 0xc3b0, 0x001a, 0xbea4, 0x55c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdcb, 0x001a, 0x61ab, 0x001a, 0xe0ad, 0x001a, 0xdead, 0xdfad, 0x001a, 0x001a, 0x001a, 0x001a, 0xadbe, 0x001a, 0x56a5, 0x001a, 0x001a, 0x001a, 0x42a6, 0xbcc9, 0x001a, 0x001a, 0x001a, 0x001a, 0x4da7, 0x4ea7, 0x001a, 0x6bca, 0x001a, 0x001a, 0xcecb, 0xe6a8, 0xcfcb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2d0, 0xe3d0, 0xe3ad, 0x001a, 0xe4d0, 0x001a, 0xe1d0, 0xe4ad, 0xe2ad, 0xe1ad, 0xe5d0, 0x001a, 0x68d4, 0x001a, 0x001a, 0x001a, 0x61d8, 0x001a, 0x001a, 0xc5dc, 0x40e1, 0x001a, 0x001a, 0x001a, 0xfebb, 0xaebe, 0xf9e8, 0x001a, 0x4ca4, 0x5aa4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4b0, 0xcdb3, 0x001a, 0xb9b9, 0x001a, 0x42c9, 0xbfa4, 0x001a, 0x59a5, 0x57a5, 0x58a5, 0x001a, 0x001a, 0xe7a8, 0x001a, 0x001a, 0x4da4, 0x4ea4, 0x001a, 0x62a4, 0x001a, 0x001a, 0xc0a4, 0xc1a4, 0xc2a4, 0xbec9, 0x5aa5, 0x001a, 0x6bc9, 0x001a, 0x46a6, 0x001a, 0xbfc9, 0x44a6, 0x45a6, 0xbdc9, 0x001a, 0x001a, 0x47a6, 0x43a6, 0x001a, 0x001a, 0x001a, 0x001a, 0x6cca, 0xecaa, 0x6dca, 0x001a, 0x001a, 0x6eca, 0x001a, 0x001a, 0x50a7, 0x4fa7, 0x001a, 0x001a, 0x53a7, 0x51a7, 0x52a7, 0x001a, 0x001a, 0x001a, 0xeda8, 0x001a, 0xeca8, 0xd4cb, 0xd1cb, 0xd2cb, 0x001a, 0xd0cb, 0xeea8, 0xeaa8, 0xe9a8, 0x001a, 0xeba8, 0xe8a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefa8, 0x001a, 0x63ab, 0xf0cd, 0x001a, 0xd3cb, 0x68ab, 0x001a, 0xf1cd, 0x64ab, 0x67ab, 0x66ab, 0x65ab, 0x62ab, 0x001a, 0x001a, 0x001a, 0xe8d0, 0x001a, 0xe7ad, 0xebd0, 0xe5ad, 0x001a, 0x001a, 0x001a, 0xe7d0, 0xe8ad, 0xe6ad, 0xe9ad, 0xe9d0, 0xead0, 0x001a, 0xe6d0, 0xecd0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1b3, 0xc5b0, 0x69d4, 0x6bd4, 0x6ad4, 0x6cd4, 0xc6b0, 0x001a, 0x001a, 0xceb3, 0x001a, 0xcfb3, 0xd0b3, 0x001a, 0xd0b6, 0xc7dc, 0x001a, 0xc6dc, 0xc8dc, 0xc9dc, 0xd1b6, 0x001a, 0xcfb6, 0x41e1, 0x42e1, 0xbbb9, 0xbab9, 0x5ae3, 0x001a, 0x001a, 0x40bc, 0x41bc, 0x42bc, 0x44bc, 0xf2e4, 0xf3e4, 0x43bc, 0x001a, 0x001a, 0x001a, 0xafbe, 0x001a, 0xb0be, 0x001a, 0x001a, 0xedf1, 0xc3f5, 0xc2f5, 0xd1f7, 0x001a, 0x4fa4, 0x001a, 0x001a, 0x001a, 0x5ca5, 0x5ba5, 0x001a, 0x001a, 0x48a6, 0x001a, 0x001a, 0xc0c9, 0x001a, 0x001a, 0x55a7, 0x56a7, 0x54a7, 0x57a7, 0x6fca, 0x70ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1a8, 0xd5cb, 0x001a, 0xf0a8, 0x001a, 0xf2cd, 0x6cab, 0xf3cd, 0x6bab, 0x001a, 0x001a, 0x001a, 0x69ab, 0x001a, 0x6aab, 0x001a, 0x001a, 0x001a, 0xedd0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7b0, 0x6ed4, 0x001a, 0xcab0, 0x6dd4, 0xe5b1, 0xc9b0, 0xc8b0, 0x001a, 0xd4b3, 0x001a, 0xd3b3, 0xd2b3, 0xd2b6, 0x001a, 0x001a, 0xd5b6, 0xd6b6, 0xd4b6, 0x001a, 0xd3b6, 0x001a, 0x001a, 0x43e1, 0x001a, 0x44e1, 0x001a, 0x001a, 0x001a, 0xf5e4, 0x45bc, 0xf4e4, 0x001a, 0xb1be, 0xbfec, 0x79c0, 0x001a, 0xeef1, 0x55c4, 0x001a, 0x63a4, 0xc3a4, 0x56c9, 0x001a, 0xc4a4, 0xc5a4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5da5, 0x5ea5, 0x001a, 0x49a6, 0x71ca, 0xd6cb, 0xd7cb, 0x001a, 0x6dab, 0xeed0, 0xccb0, 0xcbb0, 0x63d8, 0x62d8, 0x001a, 0x001a, 0x50a4, 0xc6a4, 0x5fa5, 0x001a, 0xcdb0, 0x43c9, 0x001a, 0x6cc9, 0x60a5, 0x001a, 0xc2c9, 0x4ba6, 0x4aa6, 0xc1c9, 0x58a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeaad, 0x001a, 0x001a, 0x6fd4, 0x001a, 0xd7b6, 0x45e1, 0xbcb9, 0x001a, 0x001a, 0xfae8, 0x001a, 0x001a, 0xfdf3, 0x001a, 0xc7a4, 0x001a, 0x001a, 0xd8cb, 0xf4cd, 0xd0b0, 0xceb0, 0xcfb0, 0xcca2, 0x001a, 0x64a4, 0xcda2, 0xcea2, 0x001a, 0xc9a4, 0xc8a4, 0x63a5, 0x62a5, 0x001a, 0x6dc9, 0xc3c9, 0x001a, 0x001a, 0x001a, 0xf5a8, 0xf2a8, 0xf4a8, 0xf3a8, 0x001a, 0x001a, 0x6eab, 0x001a, 0x001a, 0xd5b3, 0x001a, 0x52a4, 0x001a, 0xcba4, 0x001a, 0x65a5, 0x64a5, 0x001a, 0x72ca, 0x001a, 0x001a, 0xf6a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x57c9, 0x001a, 0x67a5, 0x66a5, 0x4ca6, 0x4da6, 0x73ca, 0x59a7, 0x001a, 0x5aa7, 0x001a, 0xf7a8, 0xf8a8, 0xf9a8, 0x001a, 0x6fab, 0xf5cd, 0x001a, 0x001a, 0xebad, 0x001a, 0x001a, 0x44c9, 0x001a, 0xcca4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4c9, 0x001a, 0x001a, 0x001a, 0x74ca, 0x75ca, 0x001a, 0x001a, 0xd9cb, 0x001a, 0xdacb, 0x001a, 0xf7cd, 0xf6cd, 0xf9cd, 0xf8cd, 0x70ab, 0x001a, 0x70d4, 0xedad, 0xefd0, 0xecad, 0x001a, 0x001a, 0x001a, 0x001a, 0x64d8, 0xd6b3, 0x001a, 0x65d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x46e1, 0xbdb9, 0x001a, 0x001a, 0x001a, 0x001a, 0x46bc, 0x001a, 0xeff1, 0x001a, 0x001a, 0x001a, 0x001a, 0x58c9, 0x001a, 0x68a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1b0, 0x001a, 0x001a, 0x001a, 0x001a, 0x53a4, 0x65a4, 0xcea4, 0xcda4, 0x001a, 0xcfa4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfba8, 0x001a, 0xfaa8, 0xfca8, 0x001a, 0x001a, 0x001a, 0x71ab, 0x001a, 0x001a, 0x001a, 0xeead, 0x001a, 0xfbe8, 0x4fc2, 0x66a4, 0x6aa5, 0x79a5, 0x74a5, 0x001a, 0x6fa5, 0x6ea5, 0x75a5, 0x73a5, 0x6ca5, 0x7aa5, 0x6da5, 0x69a5, 0x78a5, 0x77a5, 0x76a5, 0x6ba5, 0x001a, 0x72a5, 0x001a, 0x001a, 0x71a5, 0x001a, 0x001a, 0x7ba5, 0x70a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x53a6, 0x001a, 0x59a6, 0x55a6, 0x001a, 0x5ba6, 0xc5c9, 0x58a6, 0x4ea6, 0x51a6, 0x54a6, 0x50a6, 0x57a6, 0x5aa6, 0x4fa6, 0x52a6, 0x56a6, 0x5ca6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7eca, 0x7bca, 0x001a, 0x67a7, 0x7cca, 0x5ba7, 0x5da7, 0x75a7, 0x70a7, 0x001a, 0x001a, 0x001a, 0xa5ca, 0x7dca, 0x5fa7, 0x61a7, 0xa4ca, 0x68a7, 0x78ca, 0x74a7, 0x76a7, 0x5ca7, 0x6da7, 0x001a, 0x76ca, 0x73a7, 0x001a, 0x64a7, 0x001a, 0x6ea7, 0x6fa7, 0x77ca, 0x6ca7, 0x6aa7, 0x001a, 0x6ba7, 0x71a7, 0xa1ca, 0x5ea7, 0x001a, 0x72a7, 0xa3ca, 0x66a7, 0x63a7, 0x001a, 0x7aca, 0x62a7, 0xa6ca, 0x65a7, 0x001a, 0x69a7, 0x001a, 0x001a, 0x001a, 0x60a7, 0xa2ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x79ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebcb, 0xeacb, 0x4fa9, 0xedcb, 0xefcb, 0xe4cb, 0xe7cb, 0xeecb, 0x50a9, 0x001a, 0x001a, 0xe1cb, 0xe5cb, 0x001a, 0x001a, 0xe9cb, 0x49ce, 0x4ba9, 0x4dce, 0xfda8, 0xe6cb, 0xfea8, 0x4ca9, 0x45a9, 0x41a9, 0x001a, 0xe2cb, 0x44a9, 0x49a9, 0x52a9, 0xe3cb, 0xdccb, 0x43a9, 0xddcb, 0xdfcb, 0x001a, 0x46a9, 0x001a, 0x48a9, 0xdbcb, 0xe0cb, 0x001a, 0x001a, 0x51a9, 0x4da9, 0xe8cb, 0x53a9, 0x001a, 0x4aa9, 0xdecb, 0x47a9, 0x001a, 0x001a, 0x42a9, 0x40a9, 0x001a, 0xeccb, 0x001a, 0x4ea9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x48ce, 0xfbcd, 0x4bce, 0x001a, 0x001a, 0xfdcd, 0x78ab, 0xa8ab, 0x74ab, 0xa7ab, 0x7dab, 0xa4ab, 0x72ab, 0xfccd, 0x43ce, 0xa3ab, 0x4fce, 0xa5ab, 0x001a, 0x79ab, 0x001a, 0x001a, 0x45ce, 0x42ce, 0x77ab, 0x001a, 0xfacd, 0xa6ab, 0x4ace, 0x7cab, 0x4cce, 0xa9ab, 0x73ab, 0x7eab, 0x7bab, 0x40ce, 0xa1ab, 0x46ce, 0x47ce, 0x7aab, 0xa2ab, 0x76ab, 0x001a, 0x001a, 0x001a, 0x001a, 0x75ab, 0xfecd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x44ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ece, 0x001a, 0x44d1, 0xfbad, 0xf1d0, 0x001a, 0xf6d0, 0xf4ad, 0x40ae, 0xf4d0, 0xefad, 0xf9ad, 0xfead, 0xfbd0, 0x001a, 0xfaad, 0xfdad, 0x001a, 0x001a, 0xfed0, 0xf5ad, 0xf5d0, 0x001a, 0x001a, 0x001a, 0x42d1, 0x43d1, 0x001a, 0xf7ad, 0x41d1, 0xf3ad, 0x43ae, 0x001a, 0xf8d0, 0x001a, 0xf1ad, 0x001a, 0x46d1, 0xf9d0, 0xfdd0, 0xf6ad, 0x42ae, 0xfad0, 0xfcad, 0x40d1, 0x47d1, 0xa1d4, 0x001a, 0x45d1, 0x44ae, 0xf0ad, 0xfcd0, 0xf3d0, 0x001a, 0xf8ad, 0x001a, 0x001a, 0xf2d0, 0x001a, 0x001a, 0xf7d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0d0, 0x41ae, 0x001a, 0x001a, 0x77d4, 0x001a, 0xe4b0, 0xa7d4, 0xe2b0, 0xdfb0, 0x7cd4, 0xdbb0, 0xa2d4, 0xe6b0, 0x76d4, 0x7bd4, 0x7ad4, 0xf2ad, 0xe1b0, 0xa5d4, 0x001a, 0xa8d4, 0x73d4, 0x001a, 0xe8b3, 0x001a, 0xa9d4, 0xe7b0, 0x001a, 0xd9b0, 0xd6b0, 0x7ed4, 0xd3b0, 0x001a, 0xa6d4, 0x001a, 0xdab0, 0xaad4, 0x001a, 0x74d4, 0xa4d4, 0xddb0, 0x75d4, 0x78d4, 0x7dd4, 0x001a, 0x001a, 0xdeb0, 0xdcb0, 0xe8b0, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3b0, 0x001a, 0xd7b0, 0xd2b1, 0x001a, 0xd8b0, 0x79d4, 0xe5b0, 0xe0b0, 0xa3d4, 0xd5b0, 0x001a, 0x001a, 0x001a, 0xd4b0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x71d4, 0x72d4, 0x6ad8, 0x001a, 0x001a, 0x001a, 0xd7b3, 0xdab3, 0x75d8, 0xeeb3, 0x78d8, 0xd8b3, 0x71d8, 0xdeb3, 0xe4b3, 0xbdb5, 0x001a, 0x001a, 0xe2b3, 0x6ed8, 0xefb3, 0xdbb3, 0xe3b3, 0x76d8, 0xd7dc, 0x7bd8, 0x6fd8, 0x001a, 0x66d8, 0x73d8, 0x6dd8, 0xe1b3, 0x79d8, 0x001a, 0x001a, 0xddb3, 0xf1b3, 0xeab3, 0x001a, 0xdfb3, 0xdcb3, 0x001a, 0xe7b3, 0x001a, 0x7ad8, 0x6cd8, 0x72d8, 0x74d8, 0x68d8, 0x77d8, 0xd9b3, 0x67d8, 0x001a, 0xe0b3, 0xf0b3, 0xecb3, 0x69d8, 0xe6b3, 0x001a, 0x001a, 0xedb3, 0xe9b3, 0xe5b3, 0x001a, 0x70d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebb3, 0x001a, 0x001a, 0x001a, 0xd5dc, 0xd1dc, 0x001a, 0xe0dc, 0xcadc, 0xd3dc, 0xe5b6, 0xe6b6, 0xdeb6, 0xdcdc, 0xe8b6, 0xcfdc, 0xcedc, 0xccdc, 0xdedc, 0xdcb6, 0xd8dc, 0xcddc, 0xdfb6, 0xd6dc, 0xdab6, 0xd2dc, 0xd9dc, 0xdbdc, 0x001a, 0x001a, 0xdfdc, 0xe3b6, 0xcbdc, 0xddb6, 0xd0dc, 0x001a, 0xd8b6, 0x001a, 0xe4b6, 0xdadc, 0xe0b6, 0xe1b6, 0xe7b6, 0xdbb6, 0x5fa2, 0xd9b6, 0xd4dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2b6, 0x001a, 0x001a, 0xdddc, 0x001a, 0x001a, 0x001a, 0xcdb9, 0xc8b9, 0x001a, 0x55e1, 0x51e1, 0x001a, 0x4be1, 0xc2b9, 0xbeb9, 0x54e1, 0xbfb9, 0x4ee1, 0x50e1, 0x001a, 0x53e1, 0x001a, 0xc4b9, 0x001a, 0xcbb9, 0xc5b9, 0x001a, 0x001a, 0x49e1, 0xc6b9, 0xc7b9, 0x4ce1, 0xccb9, 0x001a, 0x4ae1, 0x4fe1, 0xc3b9, 0x48e1, 0xc9b9, 0xc1b9, 0x001a, 0x001a, 0x001a, 0xc0b9, 0x4de1, 0x52e1, 0x001a, 0xcab9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x47e1, 0x001a, 0x4dbc, 0x47e5, 0x001a, 0x44e5, 0x001a, 0x47bc, 0x53bc, 0x54bc, 0x001a, 0x4abc, 0x42e5, 0x4cbc, 0xf9e4, 0x52bc, 0x001a, 0x46e5, 0x49bc, 0x48e5, 0x48bc, 0x001a, 0x43e5, 0x45e5, 0x4bbc, 0x41e5, 0xfae4, 0xf7e4, 0x001a, 0x001a, 0x6bd8, 0xfde4, 0x001a, 0xf6e4, 0xfce4, 0xfbe4, 0x001a, 0xf8e4, 0x001a, 0x4fbc, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ebc, 0x001a, 0x001a, 0x001a, 0x50bc, 0xfee4, 0xb2be, 0x40e5, 0x001a, 0x001a, 0x001a, 0x45e9, 0x001a, 0xfde8, 0x001a, 0xbebe, 0x42e9, 0xb6be, 0xbabe, 0x41e9, 0x001a, 0xb9be, 0xb5be, 0xb8be, 0xb3be, 0xbdbe, 0x43e9, 0xfee8, 0xbcbe, 0xfce8, 0xbbbe, 0x44e9, 0x40e9, 0x51bc, 0x001a, 0xbfbe, 0x46e9, 0xb7be, 0xb4be, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6ec, 0xc8ec, 0x7bc0, 0xc9ec, 0xc7ec, 0xc5ec, 0xc4ec, 0x7dc0, 0xc3ec, 0x7ec0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1ec, 0xc2ec, 0x7ac0, 0xa1c0, 0x7cc0, 0x001a, 0x001a, 0xc0ec, 0x001a, 0x50c2, 0x001a, 0xbcef, 0xbaef, 0xbfef, 0xbdef, 0x001a, 0xbbef, 0xbeef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x60c3, 0xf2f1, 0xf3f1, 0x56c4, 0x001a, 0xf4f1, 0xf0f1, 0xf5f1, 0xf1f1, 0x51c2, 0x001a, 0x001a, 0x001a, 0xfef3, 0x41f4, 0x59c4, 0x40f4, 0x58c4, 0x57c4, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ac4, 0xc5f5, 0xc6f5, 0x001a, 0xdac4, 0xd9c4, 0xdbc4, 0xc4f5, 0x001a, 0xd8f6, 0xd7f6, 0x001a, 0x6dc5, 0x6fc5, 0x6ec5, 0xd9f6, 0xc8c5, 0xa6f8, 0x001a, 0x001a, 0x001a, 0xf1c5, 0x001a, 0xa5f8, 0xeef8, 0x001a, 0x001a, 0x49c9, 0x001a, 0x001a, 0x7da5, 0x7ca5, 0x001a, 0x5fa6, 0x5ea6, 0xc7c9, 0x5da6, 0xc6c9, 0x001a, 0x001a, 0x79a7, 0xa9ca, 0x001a, 0xa8ca, 0x001a, 0x001a, 0x77a7, 0x7aa7, 0x001a, 0x001a, 0xa7ca, 0x001a, 0x78a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0cb, 0x001a, 0xf1cb, 0x54a9, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaab, 0x001a, 0x48d1, 0x49d1, 0x45ae, 0x46ae, 0x001a, 0x001a, 0xacd4, 0xe9b0, 0xebb0, 0xabd4, 0xeab0, 0x7cd8, 0xf2b3, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9b6, 0xeab6, 0xe1dc, 0x001a, 0xcfb9, 0x001a, 0xceb9, 0x001a, 0x49e5, 0x48e9, 0x47e9, 0x001a, 0x6bf9, 0x67a4, 0x59c9, 0x001a, 0x6ec9, 0x6fc9, 0x001a, 0x001a, 0x001a, 0x001a, 0x62a6, 0x66a6, 0xc9c9, 0x001a, 0x64a6, 0x63a6, 0xc8c9, 0x65a6, 0x61a6, 0x001a, 0x001a, 0x60a6, 0xcac9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6a7, 0x001a, 0x001a, 0xa3a7, 0x001a, 0x7da7, 0xaaca, 0x001a, 0x001a, 0x001a, 0xabca, 0x001a, 0xa1a7, 0x001a, 0xadca, 0x7ba7, 0xaeca, 0xacca, 0x7ea7, 0xa2a7, 0xa5a7, 0xa4a7, 0x7ca7, 0xafca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x59a9, 0xfecb, 0x001a, 0x5ba9, 0x001a, 0x5aa9, 0x001a, 0x40cc, 0x58a9, 0x57a9, 0xf5cb, 0x001a, 0xf4cb, 0x001a, 0xf2cb, 0xf7cb, 0xf6cb, 0xf3cb, 0xfccb, 0xfdcb, 0xfacb, 0xf8cb, 0x56a9, 0x001a, 0x001a, 0x001a, 0xfbcb, 0x5ca9, 0x41cc, 0x001a, 0x001a, 0xf9cb, 0x001a, 0xabab, 0x55a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacab, 0x54ce, 0x001a, 0x001a, 0x5ace, 0x001a, 0x001a, 0x001a, 0xb2ab, 0x58ce, 0x5ece, 0x001a, 0x55ce, 0x59ce, 0x5bce, 0x5dce, 0x57ce, 0x001a, 0x56ce, 0x51ce, 0x52ce, 0xadab, 0x001a, 0xafab, 0xaeab, 0x53ce, 0x5cce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1ab, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50ce, 0x53d1, 0x001a, 0x52d1, 0x57d1, 0x4ed1, 0x001a, 0x51d1, 0x50d1, 0x001a, 0x54d1, 0x001a, 0x58d1, 0x47ae, 0x4aae, 0x001a, 0x001a, 0x4fd1, 0x55d1, 0x001a, 0x001a, 0x001a, 0x49ae, 0x4ad1, 0x001a, 0xb0ab, 0xbad4, 0x56d1, 0x001a, 0x4dd1, 0x001a, 0x48ae, 0x4cd1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1d4, 0x001a, 0x001a, 0xecb0, 0xf0b0, 0xc1d4, 0xafd4, 0xbdd4, 0xf1b0, 0xbfd4, 0x001a, 0xc5d4, 0x001a, 0xc9d4, 0x001a, 0x001a, 0xc0d4, 0xb4d4, 0xbcd4, 0x001a, 0xcad4, 0xc8d4, 0xbed4, 0xb9d4, 0xb2d4, 0xa6d8, 0xb0d4, 0xf5b0, 0xb7d4, 0xf6b0, 0xf2b0, 0xadd4, 0xc3d4, 0xb5d4, 0x001a, 0x001a, 0xb3d4, 0xc6d4, 0xf3b0, 0x001a, 0xccd4, 0xedb0, 0xefb0, 0xbbd4, 0xb6d4, 0x4bae, 0xeeb0, 0xb8d4, 0xc7d4, 0xcbd4, 0xc2d4, 0x001a, 0xc4d4, 0x001a, 0x001a, 0x001a, 0xaed4, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1d8, 0x001a, 0xaad8, 0xa9d8, 0xfab3, 0xa2d8, 0x001a, 0xfbb3, 0xf9b3, 0x001a, 0xa4d8, 0xf6b3, 0xa8d8, 0x001a, 0xa3d8, 0xa5d8, 0x7dd8, 0xf4b3, 0x001a, 0xb2d8, 0xb1d8, 0xaed8, 0xf3b3, 0xf7b3, 0xf8b3, 0x4bd1, 0xabd8, 0xf5b3, 0xf4b0, 0xadd8, 0x7ed8, 0xb0d8, 0xafd8, 0x001a, 0xb3d8, 0x001a, 0xefdc, 0x001a, 0xacd8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7d8, 0xe7dc, 0xf4b6, 0xf7b6, 0xf2b6, 0xe6dc, 0xeadc, 0xe5dc, 0x001a, 0xecb6, 0xf6b6, 0xe2dc, 0xf0b6, 0xe9dc, 0x001a, 0xeeb6, 0xedb6, 0xecdc, 0xefb6, 0xeedc, 0x001a, 0xebdc, 0xebb6, 0x001a, 0x001a, 0x001a, 0xf5b6, 0xf0dc, 0xe4dc, 0xeddc, 0x001a, 0x001a, 0xe3dc, 0x001a, 0x001a, 0xf1b6, 0x001a, 0xf3b6, 0x001a, 0xe8dc, 0x001a, 0xf1dc, 0x001a, 0x001a, 0x5de1, 0xd0b9, 0x63e1, 0x001a, 0x001a, 0xd5b9, 0x5fe1, 0x66e1, 0x57e1, 0xd7b9, 0xd1b9, 0x5ce1, 0x55bc, 0x5be1, 0x64e1, 0xd2b9, 0x001a, 0xd6b9, 0x5ae1, 0x60e1, 0x65e1, 0x56e1, 0xd4b9, 0x5ee1, 0x001a, 0x001a, 0x62e1, 0x68e1, 0x58e1, 0x61e1, 0x001a, 0xd3b9, 0x67e1, 0x001a, 0x001a, 0x001a, 0x59e1, 0x001a, 0x001a, 0x001a, 0x59bc, 0x4be5, 0x57bc, 0x56bc, 0x4de5, 0x52e5, 0x001a, 0x4ee5, 0x001a, 0x51e5, 0x5cbc, 0x001a, 0xa5be, 0x5bbc, 0x001a, 0x4ae5, 0x50e5, 0x001a, 0x5abc, 0x4fe5, 0x001a, 0x4ce5, 0x001a, 0x58bc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4de9, 0xd9f9, 0x4fe9, 0x4ae9, 0xc1be, 0x4ce9, 0x001a, 0xc0be, 0x4ee9, 0x001a, 0x001a, 0xc3be, 0x50e9, 0xc2be, 0x49e9, 0x4be9, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5c0, 0xccec, 0x001a, 0xa4c0, 0xcdec, 0xa3c0, 0xcbec, 0xa2c0, 0xcaec, 0x001a, 0x53c2, 0x52c2, 0xf6f1, 0xf8f1, 0x001a, 0xf7f1, 0x61c3, 0x62c3, 0x001a, 0x001a, 0x63c3, 0x42f4, 0x5bc4, 0x001a, 0x001a, 0xd3f7, 0xd2f7, 0xf2c5, 0x001a, 0x68a4, 0xd0a4, 0x001a, 0x001a, 0xa7a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x5fce, 0x001a, 0x001a, 0x001a, 0x001a, 0xfcb3, 0xfdb3, 0x001a, 0xf2dc, 0xd8b9, 0x69e1, 0x53e5, 0x001a, 0x001a, 0x001a, 0x5ac9, 0x001a, 0x001a, 0xb0ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x42cc, 0x60ce, 0x59d1, 0x4cae, 0x001a, 0x001a, 0xf9f1, 0x001a, 0xdcc4, 0x69a4, 0x7ea5, 0x70c9, 0x001a, 0x67a6, 0x68a6, 0x001a, 0x5da9, 0x001a, 0x001a, 0x001a, 0xf7b0, 0x001a, 0xdab9, 0x001a, 0xdbb9, 0xd9b9, 0x001a, 0x6aa4, 0x001a, 0xd1a4, 0xd3a4, 0xd2a4, 0x5bc9, 0xd4a4, 0xa1a5, 0x71c9, 0x001a, 0xa2a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x69a6, 0x6aa6, 0x001a, 0x001a, 0x001a, 0xcbc9, 0x001a, 0xa8a7, 0x001a, 0xb1ca, 0x001a, 0x001a, 0x001a, 0x61a9, 0x43cc, 0x001a, 0x5fa9, 0x60a9, 0x5ea9, 0x5ad1, 0x001a, 0x001a, 0x001a, 0xb6ab, 0xb5ab, 0xb7ab, 0xb4ab, 0x001a, 0x61ce, 0x62a9, 0xb3ab, 0x001a, 0x4dae, 0x4eae, 0x001a, 0x4fae, 0x001a, 0xcdd4, 0x001a, 0x001a, 0x001a, 0xfeb3, 0xb4d8, 0xf8b0, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8b6, 0x001a, 0xddb9, 0xdcb9, 0x6ae1, 0x001a, 0x5dbc, 0xc4be, 0x001a, 0xc0ef, 0xdaf6, 0xd4f7, 0x6ba4, 0xa3a5, 0x001a, 0xa4a5, 0xd1c9, 0x6ca6, 0x6fa6, 0x001a, 0xcfc9, 0xcdc9, 0x6ea6, 0xd0c9, 0xd2c9, 0xccc9, 0x71a6, 0x70a6, 0x6da6, 0x6ba6, 0xcec9, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3a7, 0x001a, 0x001a, 0xb0a7, 0xb6ca, 0xb9ca, 0xb8ca, 0x001a, 0xaaa7, 0xb2a7, 0x001a, 0x001a, 0xafa7, 0xb5ca, 0xb3ca, 0xaea7, 0x001a, 0x001a, 0x001a, 0xa9a7, 0xaca7, 0x001a, 0xb4ca, 0xbbca, 0xb7ca, 0xada7, 0xb1a7, 0xb4a7, 0xb2ca, 0xbaca, 0xaba7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x67a9, 0x6fa9, 0x001a, 0x4fcc, 0x48cc, 0x70a9, 0x53cc, 0x44cc, 0x4bcc, 0x001a, 0x001a, 0x66a9, 0x45cc, 0x64a9, 0x4ccc, 0x50cc, 0x63a9, 0x001a, 0x51cc, 0x4acc, 0x001a, 0x4dcc, 0x001a, 0x72a9, 0x69a9, 0x54cc, 0x52cc, 0x001a, 0x6ea9, 0x6ca9, 0x49cc, 0x6ba9, 0x47cc, 0x46cc, 0x6aa9, 0x68a9, 0x71a9, 0x6da9, 0x65a9, 0x001a, 0x4ecc, 0x001a, 0xb9ab, 0x001a, 0xc0ab, 0x6fce, 0xb8ab, 0x67ce, 0x63ce, 0x001a, 0x73ce, 0x62ce, 0x001a, 0xbbab, 0x6cce, 0xbeab, 0xc1ab, 0x001a, 0xbcab, 0x70ce, 0xbfab, 0x001a, 0x56ae, 0x76ce, 0x64ce, 0x001a, 0x001a, 0x66ce, 0x6dce, 0x71ce, 0x75ce, 0x72ce, 0x6bce, 0x6ece, 0x001a, 0x001a, 0x68ce, 0xc3ab, 0x6ace, 0x69ce, 0x74ce, 0xbaab, 0x65ce, 0xc2ab, 0x001a, 0xbdab, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5cae, 0x62d1, 0x001a, 0x5bae, 0x001a, 0x001a, 0x60d1, 0x001a, 0x50ae, 0x001a, 0x55ae, 0x001a, 0x5fd1, 0x5cd1, 0x61d1, 0x51ae, 0x5bd1, 0x001a, 0x54ae, 0x52ae, 0x001a, 0x63d1, 0x53ae, 0x57ae, 0x001a, 0x001a, 0x58ae, 0x001a, 0x5aae, 0x001a, 0x001a, 0x001a, 0x59ae, 0x001a, 0x001a, 0x001a, 0x5dd1, 0x5ed1, 0x001a, 0x001a, 0x001a, 0x001a, 0x64d1, 0x001a, 0xd4d4, 0xf9b0, 0xc2d8, 0xd3d4, 0xe6d4, 0x001a, 0x001a, 0x40b1, 0x001a, 0xe4d4, 0x001a, 0xfeb0, 0xfab0, 0xedd4, 0xddd4, 0xe0d4, 0x001a, 0x43b1, 0xead4, 0xe2d4, 0xfbb0, 0x44b1, 0x001a, 0xe7d4, 0xe5d4, 0x001a, 0x001a, 0xd6d4, 0xebd4, 0xdfd4, 0xdad4, 0x001a, 0xd0d4, 0xecd4, 0xdcd4, 0xcfd4, 0x001a, 0x42b1, 0xe1d4, 0xeed4, 0xded4, 0xd2d4, 0xd7d4, 0xced4, 0x001a, 0x41b1, 0x001a, 0xdbd4, 0xd8d4, 0xfcb0, 0xd1d4, 0x001a, 0xe9d4, 0xfdb0, 0x001a, 0xd9d4, 0xd5d4, 0x001a, 0x001a, 0xe8d4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x40b4, 0xbbd8, 0x001a, 0xb8d8, 0xc9d8, 0xbdd8, 0xcad8, 0x001a, 0x42b4, 0x001a, 0x001a, 0x001a, 0xc6d8, 0xc3d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4d8, 0xc7d8, 0xcbd8, 0x001a, 0xe3d4, 0xcdd8, 0x47dd, 0x001a, 0x43b4, 0xced8, 0xb6d8, 0xc0d8, 0x001a, 0xc5d8, 0x001a, 0x001a, 0x41b4, 0x44b4, 0xccd8, 0xcfd8, 0xbad8, 0xb7d8, 0x001a, 0x001a, 0xb9d8, 0x001a, 0x001a, 0xbed8, 0xbcd8, 0x45b4, 0x001a, 0xc8d8, 0x001a, 0x001a, 0xbfd8, 0x001a, 0xc1d8, 0xb5d8, 0xfadc, 0xf8dc, 0x42b7, 0x40b7, 0x43dd, 0xf9dc, 0x44dd, 0x40dd, 0xf7dc, 0x46dd, 0xf6dc, 0xfddc, 0xfeb6, 0xfdb6, 0xfcb6, 0xfbdc, 0x41dd, 0xf9b6, 0x41b7, 0x001a, 0xf4dc, 0x001a, 0xfedc, 0xf3dc, 0xfcdc, 0xfab6, 0x42dd, 0xf5dc, 0xfbb6, 0x45dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ee1, 0xe2b9, 0xe1b9, 0xe3b9, 0x7ae1, 0x70e1, 0x76e1, 0x6be1, 0x79e1, 0x78e1, 0x7ce1, 0x75e1, 0xdeb9, 0x74e1, 0xe4b9, 0x001a, 0x6de1, 0xdfb9, 0x001a, 0x7be1, 0xe0b9, 0x6fe1, 0x72e1, 0x77e1, 0x71e1, 0x6ce1, 0x001a, 0x001a, 0x001a, 0x001a, 0x73e1, 0x55e5, 0x61bc, 0x58e5, 0x57e5, 0x5ae5, 0x5ce5, 0xdcf9, 0x5fbc, 0x001a, 0x56e5, 0x001a, 0x54e5, 0x001a, 0x5de5, 0x5be5, 0x59e5, 0x001a, 0x5fe5, 0x001a, 0x5ee5, 0x63bc, 0x5ebc, 0x001a, 0x60bc, 0x62bc, 0x001a, 0x001a, 0x60e5, 0x57e9, 0x001a, 0x001a, 0x56e9, 0x55e9, 0x001a, 0x58e9, 0x51e9, 0x001a, 0x52e9, 0x5ae9, 0x53e9, 0x001a, 0xc5be, 0x5ce9, 0x001a, 0x5be9, 0x54e9, 0x001a, 0xd1ec, 0xa8c0, 0xcfec, 0xd4ec, 0xd3ec, 0x59e9, 0x001a, 0xa7c0, 0x001a, 0xd2ec, 0xceec, 0xd6ec, 0xd5ec, 0xa6c0, 0x001a, 0xd0ec, 0x001a, 0xc6be, 0x001a, 0x001a, 0x001a, 0x54c2, 0x001a, 0x001a, 0x001a, 0xc1ef, 0xfaf1, 0xfbf1, 0xfcf1, 0x5cc4, 0x001a, 0x001a, 0x5dc4, 0x001a, 0x43f4, 0x001a, 0xc8f5, 0xc7f5, 0x001a, 0x001a, 0xdbf6, 0xdcf6, 0xd5f7, 0xa7f8, 0x001a, 0x6ca4, 0x6da4, 0x001a, 0x6ea4, 0xd5a4, 0xa5a5, 0xd3c9, 0x72a6, 0x73a6, 0x001a, 0xb7a7, 0xb8a7, 0xb6a7, 0xb5a7, 0x001a, 0x73a9, 0x001a, 0x001a, 0x55cc, 0x75a9, 0x74a9, 0x56cc, 0x001a, 0x001a, 0x001a, 0xc4ab, 0x001a, 0x5dae, 0x65d1, 0x001a, 0xf0d4, 0x001a, 0x45b1, 0x47b4, 0xefd4, 0x46b4, 0x001a, 0xe5b9, 0x001a, 0x7de1, 0xc7be, 0x001a, 0xa9c0, 0xd7ec, 0x001a, 0x5ec4, 0x001a, 0x70c5, 0x001a, 0x72c9, 0x001a, 0xa6a5, 0x73c9, 0x76a6, 0x001a, 0x74a6, 0x75a6, 0x77a6, 0x001a, 0xbaa7, 0xb9a7, 0x001a, 0xbcca, 0xbba7, 0x001a, 0x001a, 0xbdca, 0x57cc, 0x001a, 0x58cc, 0x001a, 0x76a9, 0x78a9, 0x7aa9, 0x77a9, 0x7ba9, 0x79a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ab, 0xc5ab, 0xc7ab, 0xc9ab, 0xc6ab, 0x66d1, 0x77ce, 0x001a, 0x001a, 0x001a, 0x68d1, 0x67d1, 0x63ae, 0x001a, 0x5fae, 0x001a, 0x001a, 0x60ae, 0x62ae, 0x64ae, 0x61ae, 0x001a, 0x66ae, 0x65ae, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ab1, 0xf2d4, 0xf1d4, 0x49b1, 0x001a, 0x48b1, 0x47b1, 0x4bb1, 0x46b1, 0x001a, 0x001a, 0xd5d8, 0xd2d8, 0x49b4, 0xd1d8, 0xd6d8, 0x001a, 0x4bb4, 0xd4d8, 0x48b4, 0x4ab4, 0xd3d8, 0x001a, 0x48dd, 0x001a, 0x49dd, 0x4add, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6b9, 0xeeb9, 0x7ee1, 0xe8b9, 0xecb9, 0xa1e1, 0xedb9, 0xe9b9, 0xeab9, 0xe7b9, 0xebb9, 0x66bc, 0xd0d8, 0x67bc, 0x65bc, 0x001a, 0x64bc, 0x5de9, 0xc8be, 0xd8ec, 0xd9ec, 0x001a, 0x001a, 0x64c3, 0x5fc4, 0x001a, 0x6fa4, 0x001a, 0x78a6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaab, 0x001a, 0x69d1, 0x67ae, 0x001a, 0x001a, 0x4eb1, 0x4db1, 0x4cb1, 0x4cb4, 0x4db4, 0xd7d8, 0xefb9, 0xc9be, 0x70a4, 0x5cc9, 0xd6a4, 0x74c9, 0x001a, 0x001a, 0xd4c9, 0x79a6, 0x001a, 0x001a, 0x001a, 0x7ca9, 0x001a, 0x001a, 0x001a, 0x001a, 0x4bdd, 0x001a, 0x001a, 0x71a4, 0x001a, 0xd7a4, 0xd5c9, 0x001a, 0x001a, 0xbeca, 0x001a, 0xbfca, 0x001a, 0xbca7, 0x001a, 0x001a, 0x001a, 0xd8d8, 0x4eb4, 0x001a, 0x4cdd, 0x001a, 0x001a, 0x001a, 0xaac0, 0x72a4, 0xa8a4, 0xd8a4, 0x75c9, 0xa7a5, 0x001a, 0xc0a7, 0xbfa7, 0xbda7, 0xbea7, 0x001a, 0x001a, 0x59cc, 0x7ea9, 0xa1a9, 0x5acc, 0x7da9, 0x001a, 0x001a, 0xceab, 0x78ce, 0xcdab, 0xcbab, 0xccab, 0x6aae, 0x68ae, 0x001a, 0x001a, 0x6bd1, 0x69ae, 0x6ad1, 0x001a, 0x5eae, 0xf3d4, 0x001a, 0x001a, 0x50b1, 0x51b1, 0x001a, 0x001a, 0x4fb1, 0x001a, 0xf0b9, 0xa2e1, 0x68bc, 0x69bc, 0x001a, 0x61e5, 0xabc0, 0xc2ef, 0xc3ef, 0x001a, 0xddc4, 0xa8f8, 0x4bc9, 0xd9a4, 0x001a, 0x73a4, 0x001a, 0x77c9, 0x76c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x7aa6, 0xd7c9, 0xd8c9, 0xd6c9, 0x001a, 0xd9c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7ca, 0x001a, 0xc2ca, 0xc4ca, 0xc6ca, 0xc3ca, 0xc4a7, 0xc0ca, 0x001a, 0xc1ca, 0xc1a7, 0xc2a7, 0xc5ca, 0xc8ca, 0xc3a7, 0xc9ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x68cc, 0x001a, 0x62cc, 0x5dcc, 0xa3a9, 0x65cc, 0x63cc, 0x5ccc, 0x69cc, 0x6ccc, 0x67cc, 0x60cc, 0xa5a9, 0x66cc, 0xa6a9, 0x61cc, 0x64cc, 0x5bcc, 0x5fcc, 0x6bcc, 0xa7a9, 0x001a, 0xa8a9, 0x001a, 0x5ecc, 0x6acc, 0xa2a9, 0xa4a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xabce, 0xa4ce, 0xaace, 0xa3ce, 0xa5ce, 0x7dce, 0x7bce, 0x001a, 0xacce, 0xa9ce, 0x79ce, 0x001a, 0xd0ab, 0xa7ce, 0xa8ce, 0x001a, 0xa6ce, 0x7cce, 0x7ace, 0xcfab, 0xa2ce, 0x7ece, 0x001a, 0x001a, 0xa1ce, 0xadce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6fae, 0x001a, 0x6eae, 0x001a, 0x6cd1, 0x6bae, 0x6ed1, 0x001a, 0x70ae, 0x6fd1, 0x001a, 0x001a, 0x73ae, 0x001a, 0x71ae, 0x70d1, 0xaece, 0x72d1, 0x001a, 0x6dae, 0x001a, 0x6cae, 0x001a, 0x6dd1, 0x71d1, 0x72ae, 0x001a, 0x001a, 0x001a, 0x001a, 0x53b1, 0x52b1, 0x001a, 0x001a, 0x001a, 0xf5d4, 0xf9d4, 0xfbd4, 0x54b1, 0xfed4, 0x001a, 0x58b1, 0x41d5, 0x001a, 0x5ab1, 0x001a, 0x56b1, 0x5eb1, 0x001a, 0x5bb1, 0xf7d4, 0x55b1, 0x001a, 0xf6d4, 0xf4d4, 0x43d5, 0xf8d4, 0x001a, 0x57b1, 0x42d5, 0x5cb1, 0xfdd4, 0xfcd4, 0x5db1, 0xfad4, 0x59b1, 0x001a, 0x001a, 0x001a, 0x001a, 0x44d5, 0x001a, 0x40d5, 0xe7d8, 0xeed8, 0xe3d8, 0x51b4, 0xdfd8, 0xefd8, 0xd9d8, 0xecd8, 0xead8, 0xe4d8, 0x001a, 0xedd8, 0xe6d8, 0x001a, 0xded8, 0xf0d8, 0xdcd8, 0xe9d8, 0xdad8, 0x001a, 0xf1d8, 0x001a, 0x52b4, 0x001a, 0xebd8, 0x4fdd, 0xddd8, 0x4fb4, 0x001a, 0xe1d8, 0x001a, 0x50b4, 0xe0d8, 0xe5d8, 0x001a, 0x001a, 0xe2d8, 0x001a, 0x001a, 0x001a, 0xe8d8, 0x001a, 0x001a, 0x001a, 0x001a, 0x53dd, 0x001a, 0x001a, 0x001a, 0x56dd, 0x4edd, 0x001a, 0x50dd, 0x001a, 0x55dd, 0x54dd, 0x43b7, 0x001a, 0xdbd8, 0x52dd, 0x001a, 0x001a, 0x44b7, 0x001a, 0x4ddd, 0x51dd, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9e1, 0x001a, 0xb0e1, 0xa7e1, 0x001a, 0xaee1, 0xa5e1, 0xade1, 0xb1e1, 0xa4e1, 0xa8e1, 0xa3e1, 0x001a, 0xf1b9, 0x001a, 0xa6e1, 0xf2b9, 0xace1, 0xabe1, 0xaae1, 0x001a, 0x001a, 0xafe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x65e5, 0x67e5, 0x6bbc, 0x68e5, 0x001a, 0x63e5, 0x001a, 0x62e5, 0x6ce5, 0x001a, 0x6ae5, 0x6abc, 0x6de5, 0x64e5, 0x69e5, 0x6be5, 0x66e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x61e9, 0x66e9, 0x60e9, 0x65e9, 0x001a, 0x5ee9, 0x68e9, 0x64e9, 0x69e9, 0x63e9, 0x5fe9, 0x67e9, 0x001a, 0x6ae9, 0x62e9, 0x001a, 0xdaec, 0xafc0, 0x001a, 0xadc0, 0x001a, 0xacc0, 0xaec0, 0x001a, 0x001a, 0xc4ef, 0x001a, 0x72f1, 0xfdf1, 0x001a, 0x001a, 0x44f4, 0x45f4, 0x001a, 0x60c4, 0x001a, 0xc9f5, 0x001a, 0xdec4, 0x001a, 0xcaf5, 0x001a, 0xdef6, 0x72c5, 0x001a, 0x71c5, 0xddf6, 0xc9c5, 0x001a, 0xd6f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x74a4, 0x7ba6, 0xdac9, 0xcaca, 0xb5a8, 0x5fb1, 0x001a, 0x001a, 0x75a4, 0xaaa5, 0xa9a5, 0xa8a5, 0x001a, 0x001a, 0xc5a7, 0x001a, 0x001a, 0x74ae, 0x001a, 0x57dd, 0x76a4, 0x77a4, 0x78a4, 0xdaa4, 0x001a, 0x001a, 0xd1ab, 0x001a, 0xafce, 0x001a, 0x001a, 0x001a, 0x53b4, 0x79a4, 0x5dc9, 0x001a, 0x001a, 0xaba5, 0xaca5, 0x78c9, 0x001a, 0x7ca6, 0x001a, 0x001a, 0x001a, 0xcbca, 0x001a, 0xc6a7, 0x001a, 0xccca, 0x001a, 0x001a, 0xaea9, 0x001a, 0x001a, 0x6ecc, 0xaca9, 0xaba9, 0x6dcc, 0xa9a9, 0x6fcc, 0xaaa9, 0xada9, 0x001a, 0xd2ab, 0x001a, 0xd4ab, 0xb3ce, 0xb0ce, 0xb1ce, 0xb2ce, 0xb4ce, 0xd3ab, 0x001a, 0x001a, 0x74d1, 0x73d1, 0x001a, 0x76ae, 0x001a, 0x75ae, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62b1, 0x46d5, 0x001a, 0x61b1, 0x63b1, 0x60b1, 0x001a, 0x001a, 0x001a, 0x001a, 0x55b4, 0x45d5, 0x001a, 0x56b4, 0xf3d8, 0x001a, 0x57b4, 0xf2d8, 0x54b4, 0x001a, 0x001a, 0x001a, 0x001a, 0x5add, 0x5cdd, 0x45b7, 0x5bdd, 0x59dd, 0x58dd, 0x001a, 0x001a, 0x001a, 0xb4e1, 0xf7b9, 0xf5b9, 0x001a, 0xf6b9, 0xb2e1, 0xb3e1, 0x001a, 0xf3b9, 0x71e5, 0x6fe5, 0x001a, 0x6dbc, 0x70e5, 0x6ebc, 0x6cbc, 0xf4b9, 0x001a, 0x001a, 0x6de9, 0x6be9, 0x6ce9, 0x6ee5, 0xdcec, 0xb0c0, 0xdbec, 0xc5ef, 0xc6ef, 0x6ee9, 0xfef1, 0x001a, 0x7aa4, 0xada5, 0x7ea6, 0xdbc9, 0x7da6, 0x001a, 0xafa9, 0x46b7, 0x001a, 0xdba4, 0xaea5, 0xd5ab, 0x58b4, 0x001a, 0x79c9, 0x001a, 0x7ac9, 0x001a, 0xdcc9, 0x001a, 0x001a, 0xc8a7, 0xd0ca, 0xceca, 0xc9a7, 0xcdca, 0xcfca, 0xd1ca, 0x001a, 0xc7a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3a9, 0xb4a9, 0xb1a9, 0x001a, 0x001a, 0xb0a9, 0xb8ce, 0xb2a9, 0x001a, 0x001a, 0x001a, 0xd6ab, 0x001a, 0xb7ce, 0xb9ce, 0xb6ce, 0xbace, 0xd7ab, 0x79ae, 0x75d1, 0x001a, 0x77d1, 0x77ae, 0x78d1, 0x78ae, 0x76d1, 0x001a, 0xb5ce, 0x47d5, 0x4ad5, 0x4bd5, 0x48d5, 0x67b1, 0x66b1, 0x64b1, 0x65b1, 0x49d5, 0x001a, 0x001a, 0x001a, 0x001a, 0x68b1, 0x001a, 0x001a, 0x5ab4, 0x5bb4, 0x001a, 0x5cb4, 0x5ddd, 0x5fdd, 0x61dd, 0x48b7, 0x47b7, 0x59b4, 0x60dd, 0x5edd, 0x001a, 0xb8e1, 0x001a, 0x001a, 0xb6e1, 0xbce1, 0xf8b9, 0xbde1, 0xbae1, 0xf9b9, 0xb7e1, 0xb5e1, 0xbbe1, 0x70bc, 0x73e5, 0xb9e1, 0x72bc, 0x74e5, 0x71bc, 0x74bc, 0x75e5, 0x6fbc, 0x73bc, 0x001a, 0x73e9, 0x71e9, 0x70e9, 0x72e9, 0x6fe9, 0x001a, 0x001a, 0x66c3, 0x001a, 0x46f4, 0x47f4, 0x001a, 0xcbf5, 0xdff6, 0x55c6, 0x001a, 0x001a, 0xb5a9, 0xcaa7, 0x001a, 0x001a, 0xd8ab, 0x001a, 0x001a, 0x001a, 0x7ba4, 0xdca4, 0x001a, 0xafa5, 0xddc9, 0x001a, 0xcba7, 0xd2ca, 0x001a, 0xbbce, 0xd9ab, 0x001a, 0xfab9, 0x7ca4, 0x001a, 0x001a, 0x001a, 0xa1a6, 0x001a, 0x001a, 0x49b7, 0x7da4, 0xdda4, 0xdea4, 0x001a, 0xb1a5, 0xb0a5, 0x001a, 0xdec9, 0xa2a6, 0x001a, 0xd3ca, 0x001a, 0xcca7, 0x001a, 0x001a, 0x71cc, 0x72cc, 0x73cc, 0x001a, 0xb6a9, 0xb7a9, 0x70cc, 0xb8a9, 0x001a, 0x001a, 0x001a, 0xdaab, 0xbcce, 0x001a, 0x7ad1, 0x7aae, 0x001a, 0x79d1, 0x001a, 0x69b1, 0x4cd5, 0x6ab1, 0x4dd5, 0x001a, 0x001a, 0x001a, 0x5db4, 0x001a, 0x001a, 0x001a, 0x62dd, 0x001a, 0x001a, 0xbfe1, 0xbee1, 0x001a, 0xfbb9, 0x001a, 0x75bc, 0x76e5, 0xcabe, 0x74e9, 0xb1c0, 0x001a, 0x73c5, 0xd8f7, 0x001a, 0x001a, 0x001a, 0x001a, 0x74cc, 0x001a, 0xbdce, 0x6bb1, 0xf4d8, 0x4ab7, 0x001a, 0x001a, 0x001a, 0x55c2, 0x001a, 0x001a, 0x001a, 0x001a, 0xcea7, 0x001a, 0xcda7, 0xdbab, 0x001a, 0x7bd1, 0x001a, 0x6db1, 0x43b3, 0x6eb1, 0x6cb1, 0x5eb4, 0x001a, 0xc0e1, 0xfcb9, 0x76bc, 0x001a, 0x4cc9, 0xdfc9, 0x001a, 0xd5ca, 0xcfa7, 0xd4ca, 0xd0a7, 0x001a, 0x001a, 0xbca9, 0x77cc, 0x76cc, 0xbba9, 0xb9a9, 0xbaa9, 0x75cc, 0x001a, 0x001a, 0xddab, 0xbece, 0xe0ab, 0xdcab, 0xe2ab, 0xdeab, 0xdfab, 0xe1ab, 0x001a, 0x001a, 0x001a, 0x7dae, 0x7cae, 0x7bae, 0x001a, 0x001a, 0x001a, 0x4fd5, 0x6fb1, 0x72b1, 0x70b1, 0x001a, 0x4ed5, 0x75b1, 0x001a, 0x71b1, 0x50d5, 0x74b1, 0x73b1, 0x001a, 0x001a, 0x001a, 0xf6d8, 0xf5d8, 0x001a, 0x61b4, 0x5fb4, 0x60b4, 0xf7d8, 0x4bb7, 0x64dd, 0x4cb7, 0x63dd, 0x001a, 0x001a, 0x77e5, 0x001a, 0x001a, 0x78bc, 0xc1e1, 0x77bc, 0x001a, 0xfdb9, 0x001a, 0xdeec, 0x75e9, 0xb2c0, 0xddec, 0x40f2, 0x48f4, 0x49f4, 0x001a, 0xdfa4, 0x001a, 0xb2a5, 0x001a, 0x001a, 0x001a, 0x7bc9, 0x001a, 0x001a, 0xd2a7, 0xd4a7, 0x001a, 0xe2c9, 0xd8ca, 0xd7ca, 0xd6ca, 0x001a, 0xe1c9, 0xe0c9, 0xa4a6, 0xd3a7, 0xd1a7, 0xa3a6, 0x001a, 0x001a, 0x001a, 0xbda9, 0x78cc, 0x001a, 0xbea9, 0xddca, 0x001a, 0xdfca, 0xdeca, 0x79cc, 0x001a, 0x001a, 0xdaca, 0x001a, 0xd8a7, 0xd6a7, 0x001a, 0xd9ca, 0xdbca, 0xe1ca, 0x001a, 0xd5a7, 0x001a, 0xdcca, 0xe5ca, 0xc0a9, 0x001a, 0xe2ca, 0xd7a7, 0x001a, 0xe0ca, 0xe3ca, 0x001a, 0xbfa9, 0x001a, 0xc1a9, 0xe4ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafcc, 0xa2cc, 0x7ecc, 0xaecc, 0xa9cc, 0xe7ab, 0xc2a9, 0xaacc, 0xadcc, 0xe3ab, 0xaccc, 0xc3a9, 0xc8a9, 0xc6a9, 0xa3cc, 0x001a, 0x7ccc, 0xa5cc, 0xcda9, 0xb0cc, 0xe4ab, 0xa6cc, 0x001a, 0xe5ab, 0xc9a9, 0xa8cc, 0x001a, 0xcdce, 0xe6ab, 0x7bcc, 0xcaa9, 0xe8ab, 0xcba9, 0xc7a9, 0xcca9, 0xa7cc, 0x7acc, 0xabcc, 0xc4a9, 0x001a, 0x001a, 0x7dcc, 0xa4cc, 0xa1cc, 0xc5a9, 0x001a, 0xbfce, 0x001a, 0xc0ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcace, 0xa1d1, 0xcbce, 0xeeab, 0xcece, 0xc4ce, 0xedab, 0xc6ce, 0x001a, 0xc7ce, 0x001a, 0x001a, 0xc9ce, 0xe9ab, 0x001a, 0x001a, 0xa3ae, 0x001a, 0xdaf9, 0xc5ce, 0xc1ce, 0xa4ae, 0x001a, 0x001a, 0xcfce, 0x7eae, 0x7dd1, 0xc8ce, 0x001a, 0x7cd1, 0xc3ce, 0xccce, 0x001a, 0x001a, 0xecab, 0xa1ae, 0xf2ab, 0xa2ae, 0xd0ce, 0x7ed1, 0xebab, 0xa6ae, 0xf1ab, 0xf0ab, 0xefab, 0xa5ae, 0xd1ce, 0xa7ae, 0xeaab, 0x001a, 0xc2ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x76b1, 0xa4d1, 0xa6d1, 0x001a, 0xa8d1, 0xa8ae, 0xaeae, 0x53d5, 0xacd1, 0xa3d1, 0x78b1, 0x51d5, 0x001a, 0xadae, 0xabae, 0xaed1, 0x001a, 0x52d5, 0x001a, 0xa5d1, 0x001a, 0xacae, 0xa9d1, 0xafae, 0xabd1, 0x001a, 0x001a, 0xaaae, 0xaad1, 0xadd1, 0xa7d1, 0x001a, 0xa9ae, 0x79b1, 0x001a, 0xa2d1, 0x77b1, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ab1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x55d5, 0x5ed5, 0x64b4, 0x001a, 0x7cb1, 0xa3b1, 0x65b4, 0x60d5, 0xaab1, 0xf9d8, 0x56d5, 0xa2b1, 0xa5b1, 0x7eb1, 0x54d5, 0x62d5, 0x65d5, 0x49d9, 0x001a, 0x63d5, 0xfdd8, 0xa1b1, 0xa8b1, 0xacb1, 0x5dd5, 0xf8d8, 0x61d5, 0x7bb1, 0xfad8, 0x64d5, 0xfcd8, 0x59d5, 0x001a, 0x62b4, 0x001a, 0x57d5, 0x58d5, 0xa7b1, 0x001a, 0x001a, 0xa6b1, 0x5bd5, 0xabb1, 0x5fd5, 0xa4b1, 0x5cd5, 0x001a, 0xa9b1, 0x66b4, 0x63b4, 0xfbd8, 0x001a, 0x5ad5, 0x001a, 0x7db1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6bb4, 0x6fb4, 0x40d9, 0x51b7, 0x6db4, 0x44d9, 0x71b4, 0x65dd, 0x46d9, 0x53b7, 0x69b4, 0x6cb4, 0x47d9, 0x001a, 0x48d9, 0x4ed9, 0x73b4, 0x54b7, 0x001a, 0x4ad9, 0x4fd9, 0x43d9, 0x5eb7, 0x001a, 0x55b7, 0x72b4, 0x41d9, 0x50d9, 0x001a, 0x5db7, 0x70b4, 0x4eb7, 0x4dd9, 0x001a, 0x74b4, 0x45d9, 0xfed8, 0x6ab4, 0x42d9, 0x001a, 0x4bd9, 0x001a, 0x4db7, 0x52b7, 0x67b4, 0x4cd9, 0x001a, 0x50b7, 0x001a, 0x001a, 0x001a, 0x68b4, 0x001a, 0x001a, 0x001a, 0x5cb7, 0xc3e1, 0x70dd, 0x001a, 0x68dd, 0xc2e1, 0x001a, 0x6cdd, 0x6edd, 0x001a, 0x001a, 0x6bdd, 0x001a, 0x5bb7, 0x001a, 0x6add, 0x5fb7, 0x001a, 0x001a, 0x001a, 0xd2e1, 0x001a, 0x001a, 0x5ab7, 0x40ba, 0x71dd, 0xc4e1, 0x001a, 0x001a, 0x58b7, 0x69dd, 0x6ddd, 0xfeb9, 0x4fb7, 0x66dd, 0x67dd, 0x41ba, 0x57b7, 0x59b7, 0x56b7, 0x6fdd, 0x001a, 0x001a, 0xc8e1, 0xc9e1, 0xcee1, 0x7dbc, 0xd5e1, 0x001a, 0x47ba, 0x001a, 0x46ba, 0xd0e1, 0x001a, 0x7cbc, 0xc5e1, 0x45ba, 0x001a, 0xd4e1, 0x43ba, 0x44ba, 0x001a, 0xd1e1, 0xaae5, 0x7abc, 0x6eb4, 0x001a, 0xd3e1, 0xa3bc, 0xcbe1, 0x001a, 0x7bbc, 0x001a, 0xa2bc, 0xc6e1, 0xcae1, 0xc7e1, 0xcde1, 0x48ba, 0x79bc, 0x42ba, 0x001a, 0x7ae5, 0xcfe1, 0x001a, 0xa1bc, 0x001a, 0xa4bc, 0x001a, 0xcce1, 0x001a, 0x7ebc, 0x79e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ee5, 0xcebe, 0x78e5, 0xa3e9, 0xa9e5, 0xa8bc, 0x001a, 0xa6bc, 0xccbe, 0xa6e5, 0xa2e5, 0xacbc, 0x001a, 0x78e9, 0x001a, 0x001a, 0x001a, 0xaabc, 0xa1e5, 0x001a, 0x76e9, 0x001a, 0xa5e5, 0x001a, 0xa8e5, 0x7de5, 0x001a, 0xabbc, 0x001a, 0x001a, 0xa5bc, 0x77e9, 0xcdbe, 0xa7e5, 0xa7bc, 0xa9bc, 0xa4e5, 0xadbc, 0xa3e5, 0x7ce5, 0x7be5, 0xcbbe, 0xabe5, 0x7ae9, 0xe0ec, 0xd0be, 0x001a, 0xa2e9, 0x001a, 0x7ee9, 0x001a, 0xe1ec, 0x001a, 0xd1be, 0xa1e9, 0x001a, 0x7ce9, 0xb4c0, 0xdfec, 0x001a, 0x79e9, 0x7be9, 0xb5c0, 0xd3be, 0xb3c0, 0xd2be, 0xb7c0, 0x7de9, 0xcfbe, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfef, 0x001a, 0xc7ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7ec, 0xc8ef, 0xe3ec, 0x001a, 0x001a, 0x56c2, 0xe5ec, 0xe4ec, 0xb6c0, 0xe2ec, 0xe6ec, 0xd0ef, 0xccef, 0xceef, 0x001a, 0xc9ef, 0xcaef, 0x001a, 0xcdef, 0xcbef, 0x67c3, 0x001a, 0x001a, 0x6ac3, 0x69c3, 0x68c3, 0x61c4, 0x4af4, 0x62c4, 0x41f2, 0xdfc4, 0xccf5, 0xe0c4, 0x74c5, 0xcac5, 0xd9f7, 0x001a, 0xdaf7, 0xdbf7, 0x001a, 0x001a, 0xbaf9, 0xe0a4, 0x7cc9, 0xb3a5, 0x001a, 0xa6a6, 0xa7a6, 0xa5a6, 0x001a, 0xa8a6, 0xdaa7, 0xd9a7, 0x001a, 0xb1cc, 0xcfa9, 0xcea9, 0x001a, 0x001a, 0xafd1, 0xadb1, 0xaeb1, 0x001a, 0x001a, 0x001a, 0x75b4, 0x72dd, 0x60b7, 0x61b7, 0x74dd, 0x76dd, 0x75dd, 0x001a, 0xd7e1, 0x001a, 0xd6e1, 0x49ba, 0xd8e1, 0x001a, 0xace5, 0xaebc, 0x001a, 0xd4be, 0x001a, 0xb8c0, 0x57c2, 0xb9c0, 0x001a, 0xe1a4, 0x001a, 0x001a, 0x001a, 0xe6ca, 0x001a, 0x001a, 0xb2cc, 0xd1a9, 0xd0a9, 0xd2a9, 0xf3ab, 0xd2ce, 0xd3ce, 0x001a, 0x001a, 0xb0d1, 0xb0ae, 0xafb1, 0x76b4, 0x51d9, 0xe2a4, 0x001a, 0x7ea4, 0xe3a4, 0x001a, 0x7dc9, 0xb7a5, 0xb6a5, 0xb4a5, 0xb5a5, 0x001a, 0x001a, 0x001a, 0xaba6, 0xe9c9, 0xebc9, 0xaaa6, 0xe3c9, 0x001a, 0xe4c9, 0x001a, 0xeac9, 0xe6c9, 0xe8c9, 0xa9a6, 0xe5c9, 0xecc9, 0xe7c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1a7, 0xeaa7, 0xe8a7, 0xf0ca, 0xedca, 0xf5ca, 0xe6a7, 0xf6ca, 0x001a, 0xdfa7, 0xf3ca, 0x001a, 0xe5a7, 0xefca, 0xeeca, 0xe3a7, 0xf4ca, 0xe4a7, 0xd3a9, 0xdea7, 0xf1ca, 0x001a, 0xe7ca, 0xdba7, 0x001a, 0xeea7, 0xecca, 0xf2ca, 0xe0a7, 0xe2a7, 0x001a, 0xe8ca, 0x001a, 0xe9ca, 0xeaca, 0x001a, 0xeda7, 0xe7a7, 0xeca7, 0xebca, 0xeba7, 0xdda7, 0xdca7, 0xe9a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1a9, 0xbecc, 0xb7cc, 0xdca9, 0xefa9, 0xb3cc, 0xbacc, 0xbccc, 0xbfcc, 0xeaa9, 0x001a, 0xbbcc, 0xb4cc, 0xe8a9, 0xb8cc, 0x001a, 0xc0cc, 0xd9a9, 0x001a, 0xbdcc, 0xe3a9, 0xe2a9, 0xb6cc, 0xd7a9, 0x001a, 0x001a, 0xd8a9, 0x001a, 0xd6a9, 0x001a, 0xeea9, 0xe6a9, 0xe0a9, 0xd4a9, 0xb9cc, 0xdfa9, 0xd5a9, 0xe7a9, 0xf0a9, 0xd4ce, 0xe4a9, 0xb5cc, 0xdaa9, 0xdda9, 0xdea9, 0x001a, 0xeca9, 0xeda9, 0xeba9, 0xe5a9, 0xe9a9, 0xdba9, 0xf4ab, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdace, 0x41ac, 0xf8ab, 0xfaab, 0x40ac, 0xe6ce, 0xfdab, 0xb1d1, 0xb1ae, 0x43ac, 0xd7ce, 0xdfce, 0xfeab, 0xdece, 0xdbce, 0xe3ce, 0xe5ce, 0xf7ab, 0xfbab, 0x42ac, 0xb3ae, 0xe0ce, 0xf9ab, 0x45ac, 0xd9ce, 0x001a, 0x001a, 0x001a, 0xfcab, 0xb2ae, 0xf6ab, 0x001a, 0xd6ce, 0xddce, 0xd5ce, 0xd8ce, 0xdcce, 0xb2d1, 0x44ac, 0x001a, 0xe1ce, 0xe2ce, 0xe4ce, 0xf5ab, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1ae, 0xbed1, 0xbfae, 0xc0ae, 0xb4d1, 0xc4d1, 0x001a, 0xb6ae, 0x001a, 0x001a, 0x66d5, 0xc6d1, 0xc0d1, 0x001a, 0xb7d1, 0x001a, 0xc9d1, 0xbad1, 0xbcae, 0x7dd5, 0xbdd1, 0xbeae, 0xb5ae, 0x001a, 0xcbd1, 0xbfd1, 0xb8ae, 0xb8d1, 0xb5d1, 0xb6d1, 0xb9ae, 0xc5d1, 0xccd1, 0xbbae, 0xbcd1, 0xbbd1, 0xc3ae, 0xc2ae, 0xb4ae, 0xbaae, 0xbdae, 0xc8d1, 0x001a, 0x001a, 0xc2d1, 0xb7ae, 0xb3d1, 0xcad1, 0xc1d1, 0xc3d1, 0xc7d1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x67d5, 0x001a, 0xb7b1, 0xcbb1, 0xcab1, 0x001a, 0xbfb1, 0x001a, 0x79d5, 0x75d5, 0x72d5, 0xa6d5, 0xbab1, 0xb2b1, 0x001a, 0x001a, 0x77d5, 0xa8b4, 0xb6b1, 0xa1d5, 0x001a, 0xccb1, 0xc9b1, 0x7bd5, 0x6ad5, 0x001a, 0x001a, 0xc8b1, 0xa3d5, 0x69d5, 0xbdb1, 0xc1b1, 0xa2d5, 0x001a, 0x73d5, 0xc2b1, 0xbcb1, 0x68d5, 0x001a, 0x78b4, 0xa5d5, 0x71d5, 0xc7b1, 0x74d5, 0xa4d5, 0xc6b1, 0x001a, 0x52d9, 0x001a, 0xb3b1, 0x6fd5, 0xb8b1, 0xc3b1, 0x001a, 0xbeb1, 0x78d5, 0x6ed5, 0x6cd5, 0x7ed5, 0xb0b1, 0xc4b1, 0xb4b1, 0x77b4, 0x7cd5, 0xb5b1, 0x001a, 0xb1b1, 0xc0b1, 0xbbb1, 0xb9b1, 0x70d5, 0xc5b1, 0x6dd5, 0x7ad5, 0x76d5, 0x54d9, 0x53d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6bd5, 0x64d9, 0x001a, 0x7ab4, 0x001a, 0x6ad9, 0x59d9, 0x67d9, 0x77dd, 0x7db4, 0x6bd9, 0x6ed9, 0x7cb4, 0x5cd9, 0x6dd9, 0x6cd9, 0x7eb4, 0x55d9, 0x79b4, 0xa3b4, 0x001a, 0xa1b4, 0x69d9, 0x001a, 0x5fd9, 0xa5b4, 0x70d9, 0x68d9, 0x71d9, 0xadb4, 0xabb4, 0x66d9, 0x65d9, 0x001a, 0x63d9, 0x5dd9, 0xa4b4, 0x001a, 0xa2b4, 0xb9d1, 0x56d9, 0x001a, 0xb7dd, 0x57d9, 0x7bb4, 0xaab4, 0x79dd, 0x001a, 0xa6b4, 0xa7b4, 0x58d9, 0x6fd9, 0x78dd, 0x60d9, 0x5bd9, 0xa9b4, 0x61d9, 0x5ed9, 0x001a, 0x001a, 0xaeb4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x70b7, 0x001a, 0x001a, 0x7cdd, 0xb1dd, 0xb6dd, 0xaadd, 0x6cb7, 0xbbdd, 0x69b7, 0x7add, 0x001a, 0x7bdd, 0x62b7, 0x6bb7, 0xa4dd, 0x6eb7, 0x6fb7, 0xa5dd, 0x001a, 0xb2dd, 0xb8dd, 0x6ab7, 0x001a, 0x64b7, 0xa3dd, 0x7ddd, 0xbadd, 0xa8dd, 0xa9dd, 0x7edd, 0xb4dd, 0xabdd, 0xb5dd, 0xaddd, 0x001a, 0x65b7, 0xd9e1, 0x68b7, 0x66b7, 0xb9dd, 0xb0dd, 0xacdd, 0x001a, 0x001a, 0xa1dd, 0x53ba, 0xafdd, 0x6db7, 0xa7dd, 0x001a, 0xa6dd, 0x001a, 0x001a, 0x001a, 0x67b7, 0x63b7, 0xeee1, 0xb3dd, 0xaedd, 0x001a, 0xa2dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e1, 0x001a, 0xdae1, 0xe5e1, 0x001a, 0xece1, 0x51ba, 0xacb4, 0xeae1, 0x4cba, 0x001a, 0x001a, 0x001a, 0x4bba, 0xf1e1, 0x001a, 0xdbe1, 0xe8e1, 0xdce1, 0xe7e1, 0x4fba, 0xebe1, 0x62d9, 0x001a, 0x001a, 0x001a, 0xf2e1, 0xe3e1, 0x52ba, 0xbae5, 0xafbc, 0x001a, 0xf0e1, 0xefe1, 0x54ba, 0xade5, 0xb0bc, 0xaee5, 0x001a, 0xdfe1, 0xe0e1, 0xdde1, 0xe2e1, 0xdee1, 0xf3e1, 0x4eba, 0xb1bc, 0x50ba, 0x55ba, 0x001a, 0xe1e1, 0x001a, 0xede1, 0x001a, 0x001a, 0xe6e1, 0x001a, 0x001a, 0xb1e5, 0x001a, 0x4aba, 0xb4bc, 0xaae9, 0xb6e5, 0xb5e5, 0xb7e5, 0x001a, 0x001a, 0xb4e5, 0xb5bc, 0x001a, 0xbbbc, 0xb8bc, 0x001a, 0xb9bc, 0xafe5, 0xb2e5, 0xbce5, 0xc1bc, 0xbfbc, 0x001a, 0xb3e5, 0x5ad9, 0xb2bc, 0xb9e5, 0xb0e5, 0x001a, 0xc2bc, 0xb8e5, 0x4dba, 0xb7bc, 0xe4e1, 0x001a, 0x001a, 0xbabc, 0x001a, 0xbebc, 0xc0bc, 0xbdbc, 0xbcbc, 0x001a, 0xb6bc, 0xbbe5, 0xb3bc, 0xc3bc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8be, 0xd9be, 0xa9e9, 0xe2be, 0xdfbe, 0x001a, 0xd6be, 0xddbe, 0xabe9, 0xdbbe, 0xd5be, 0x001a, 0xdcbe, 0x001a, 0xa8e9, 0xbbc0, 0xd7be, 0x001a, 0xdebe, 0xbac0, 0xa7e9, 0xa6e9, 0x001a, 0xe0be, 0x001a, 0xe1be, 0x001a, 0xa5e9, 0xa4e9, 0xbcc0, 0xaee9, 0xdabe, 0xace9, 0x001a, 0x001a, 0x001a, 0x001a, 0xbdc0, 0x001a, 0xc2c0, 0xeaec, 0xecec, 0x001a, 0xbfc0, 0x001a, 0xedec, 0xe9ec, 0x001a, 0xebec, 0xc0c0, 0xc3c0, 0x001a, 0xe8ec, 0xbec0, 0xc1c0, 0x59c2, 0xade9, 0x58c2, 0x001a, 0x001a, 0x5ec2, 0xd4ef, 0x001a, 0x5cc2, 0x5dc2, 0xd7ef, 0xd3ef, 0x5ac2, 0xd1ef, 0x6bc3, 0xd5ef, 0x001a, 0xd6ef, 0xd2ef, 0x001a, 0x5bc2, 0x42f2, 0x001a, 0x45f2, 0x001a, 0x001a, 0x46f2, 0x44f2, 0x47f2, 0x6cc3, 0x43f2, 0x001a, 0x001a, 0x4ef4, 0x64c4, 0x4df4, 0x4cf4, 0x4bf4, 0x63c4, 0x65c4, 0x001a, 0xcdf5, 0xe2c4, 0xe1c4, 0x001a, 0x001a, 0xe1f6, 0xe0f6, 0xe3f6, 0xcbc5, 0x75c5, 0xddf7, 0xe2f6, 0x001a, 0x001a, 0xdcf7, 0xcdc5, 0xccc5, 0xf3c5, 0xa9f8, 0xeff8, 0xe4a4, 0x001a, 0x001a, 0x72d9, 0xafe9, 0x001a, 0x001a, 0xaca6, 0xf7ca, 0xf1a7, 0xefa7, 0x001a, 0xf0a7, 0x001a, 0xc1cc, 0xf1a9, 0x46ac, 0x001a, 0xe7ce, 0x001a, 0xe8ce, 0x001a, 0x47ac, 0xced1, 0x001a, 0xc4ae, 0xc5ae, 0xcdd1, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3b1, 0x001a, 0xcfb1, 0x001a, 0xa7d5, 0xd6b1, 0xd5b1, 0xceb1, 0xd1b1, 0xd4b1, 0xd0b1, 0x001a, 0x001a, 0x76d9, 0xcdb1, 0xafb4, 0x001a, 0x001a, 0x001a, 0xb1b4, 0xb2b4, 0x75d9, 0x78d9, 0xb0b4, 0x73d9, 0x77d9, 0x001a, 0x74d9, 0x001a, 0x71b7, 0x001a, 0x001a, 0xbcdd, 0x001a, 0x001a, 0x56ba, 0xf4e1, 0xe3be, 0xc4bc, 0xbde5, 0xc5bc, 0xc6bc, 0xbfe5, 0xbee5, 0xc0e5, 0xb1e9, 0x001a, 0x001a, 0xb0e9, 0xefec, 0xeeec, 0xc4c0, 0xc5c0, 0x48f2, 0x001a, 0x001a, 0xe5a4, 0x001a, 0x001a, 0x001a, 0x001a, 0x79d9, 0x001a, 0x001a, 0x001a, 0xb4b4, 0xb3b4, 0xbddd, 0x001a, 0xd8ef, 0xe3c4, 0xdef7, 0xe6a4, 0x001a, 0xc6ae, 0x001a, 0xd8b1, 0xd7b1, 0x7ad9, 0x7bd9, 0x72b7, 0xf5e1, 0x57ba, 0xb2e9, 0x001a, 0xe7a4, 0xb8a5, 0x001a, 0xf2a9, 0xc2cc, 0x001a, 0xe9ce, 0x48ac, 0xd9b1, 0x001a, 0x7cd9, 0xb5b4, 0x73b7, 0x001a, 0xc1e5, 0xc2e5, 0x001a, 0x001a, 0xf0ec, 0x5fc2, 0xf0f8, 0xe8a4, 0x001a, 0xc3cc, 0xf3a9, 0x49ac, 0x001a, 0xeace, 0x001a, 0xc7ae, 0xd2d1, 0xd0d1, 0xd1d1, 0xc8ae, 0xcfd1, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbb1, 0xdcb1, 0xa8d5, 0xddb1, 0xdab1, 0x7dd9, 0x001a, 0x7ed9, 0xbedd, 0x001a, 0x001a, 0x59ba, 0x58ba, 0x001a, 0x001a, 0xf1ec, 0xd9ef, 0x001a, 0x4af2, 0x49f2, 0x4ff4, 0x001a, 0x5ec9, 0x4aac, 0x001a, 0x001a, 0xe9a4, 0xb9a5, 0x001a, 0xaea6, 0xada6, 0x001a, 0x001a, 0xafa6, 0xb0a6, 0xeec9, 0xedc9, 0xf8ca, 0xf2a7, 0xfbca, 0xfaca, 0xf9ca, 0xfcca, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4a9, 0xc9cc, 0xc5cc, 0xcecc, 0x001a, 0x001a, 0xfba9, 0x001a, 0xf9a9, 0xcacc, 0xc6cc, 0xcdcc, 0xf8a9, 0x40aa, 0xc8cc, 0xc4cc, 0xfea9, 0xcbcc, 0xf7a9, 0xcccc, 0xfaa9, 0xfca9, 0xd0cc, 0xcfcc, 0xc7cc, 0xf6a9, 0xf5a9, 0xfda9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefce, 0xf5ce, 0x001a, 0x50ac, 0x4dac, 0xecce, 0xf1ce, 0x001a, 0x53ac, 0x4bac, 0xf0ce, 0x4eac, 0x51ac, 0x001a, 0x001a, 0xf3ce, 0x001a, 0x4cac, 0xf8ce, 0x4fac, 0x001a, 0x52ac, 0xedce, 0xf2ce, 0xf6ce, 0xeece, 0xebce, 0x001a, 0x001a, 0xf7ce, 0xf4ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0ae, 0xc9ae, 0xccae, 0x001a, 0xcfae, 0x001a, 0xd5d1, 0x001a, 0xcaae, 0xd3d1, 0x001a, 0xceae, 0x001a, 0x001a, 0xcbae, 0x001a, 0xd6d1, 0xcdae, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacd5, 0xdfb1, 0xabd5, 0xadd5, 0xdeb1, 0xe3b1, 0xd4d1, 0x001a, 0xaad5, 0xaed5, 0x001a, 0xe0b1, 0xa9d5, 0xe2b1, 0x001a, 0xe1b1, 0x001a, 0xa7d9, 0x001a, 0xa2d9, 0x001a, 0xb6b4, 0xbab4, 0xb7b4, 0xa5d9, 0xa8d9, 0x001a, 0xb8b4, 0x001a, 0xb9b4, 0xbeb4, 0xc7dd, 0xa6d9, 0xbcb4, 0xa3d9, 0xa1d9, 0x001a, 0xbdb4, 0x001a, 0xa4d9, 0x001a, 0x001a, 0x001a, 0x79b7, 0x001a, 0xbfdd, 0x76b7, 0x77b7, 0x75b7, 0xc4dd, 0xc3dd, 0xc0dd, 0x7bb7, 0x001a, 0x001a, 0xc2dd, 0xbbb4, 0x001a, 0x001a, 0xc6dd, 0xc1dd, 0x78b7, 0x74b7, 0x7ab7, 0xc5dd, 0x001a, 0x001a, 0x001a, 0x5cba, 0x001a, 0xf8e1, 0xf7e1, 0xf6e1, 0x5aba, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5bba, 0xc5e5, 0xc8e5, 0xc8bc, 0x001a, 0x001a, 0xc7bc, 0xc9e5, 0xc4e5, 0xcabc, 0xc6e5, 0x001a, 0xc9bc, 0xc3e5, 0x001a, 0xc7e5, 0xe9be, 0xe6be, 0xbbe9, 0xbae9, 0x001a, 0xb9e9, 0xb4e9, 0x001a, 0xb5e9, 0x001a, 0x001a, 0x001a, 0xe7be, 0x001a, 0xe4be, 0xe8be, 0xb3e9, 0xe5be, 0xb6e9, 0xb7e9, 0xbce9, 0x001a, 0x001a, 0xb8e9, 0x001a, 0x001a, 0xf2ec, 0x001a, 0x001a, 0x001a, 0xc7c0, 0x001a, 0xdcef, 0xc6c0, 0xdaef, 0xdbef, 0x60c2, 0x6ec3, 0x4bf2, 0x001a, 0x6dc3, 0x001a, 0x001a, 0x51f4, 0x52f4, 0x001a, 0x66c4, 0x001a, 0x50f4, 0xe4c4, 0x001a, 0xdff7, 0xcec5, 0xaaf8, 0xabf8, 0x001a, 0xeaa4, 0x001a, 0xb1a6, 0xb2a6, 0xf3a7, 0x001a, 0xd1cc, 0x54ac, 0xd1ae, 0xe4b1, 0x001a, 0x001a, 0xd2b0, 0x001a, 0xbfb4, 0xc0b4, 0xccb3, 0xa9d9, 0x001a, 0x7cb7, 0xfae1, 0xf9e1, 0x001a, 0x001a, 0xeba4, 0xb3a6, 0xd2cc, 0x42aa, 0x001a, 0x41aa, 0x001a, 0xf9ce, 0xface, 0x001a, 0xd7d1, 0xd8d1, 0xd2ae, 0xd3ae, 0x001a, 0xd4ae, 0xafd5, 0x001a, 0x001a, 0xe6b1, 0x001a, 0xc2b4, 0x001a, 0xc1b4, 0xc8dd, 0x7adf, 0xfbe1, 0xbde9, 0x001a, 0x001a, 0x61c2, 0x67c4, 0xeca4, 0x001a, 0xbca5, 0xbda5, 0xbba5, 0xbea5, 0xbaa5, 0x001a, 0x001a, 0xb6a6, 0x001a, 0xf6c9, 0xb5a6, 0xb7a6, 0x001a, 0x001a, 0xf1c9, 0xf0c9, 0xf3c9, 0xf2c9, 0xf5c9, 0xb4a6, 0xefc9, 0xf4c9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdca, 0xfda7, 0xfeca, 0x43cb, 0xfca7, 0x001a, 0x47cb, 0x42cb, 0x45cb, 0xf5a7, 0xf6a7, 0xf7a7, 0xf8a7, 0x001a, 0x40a8, 0x001a, 0x41cb, 0xfaa7, 0x41a8, 0x001a, 0x40cb, 0x46cb, 0x001a, 0xf9a7, 0x44cb, 0xfba7, 0xf4a7, 0xfea7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x57aa, 0x001a, 0xd4cc, 0x43aa, 0x001a, 0x4daa, 0x4eaa, 0x46aa, 0x58aa, 0x48aa, 0xdccc, 0x53aa, 0xd7cc, 0x49aa, 0xe6cc, 0xe7cc, 0xdfcc, 0xd8cc, 0x56aa, 0xe4cc, 0x51aa, 0x4faa, 0x001a, 0xe5cc, 0x001a, 0xe3cc, 0xdbcc, 0xd3cc, 0xdacc, 0x4aaa, 0x001a, 0x50aa, 0x001a, 0x44aa, 0xdecc, 0xddcc, 0xd5cc, 0x001a, 0x52aa, 0xe1cc, 0xd6cc, 0x55aa, 0xe8cc, 0x45aa, 0x001a, 0x4caa, 0xd9cc, 0xe2cc, 0x54aa, 0x001a, 0x47aa, 0x4baa, 0x001a, 0xe0cc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5bcf, 0x5cac, 0x69ac, 0x001a, 0x56cf, 0x4ccf, 0x62ac, 0x4acf, 0x5bac, 0x45cf, 0x65ac, 0x52cf, 0xfece, 0x41cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x44cf, 0xfbce, 0x51cf, 0x61cf, 0x60ac, 0x46cf, 0x58cf, 0x001a, 0xfdce, 0x5fcf, 0x60cf, 0x63cf, 0x5acf, 0x4bcf, 0x53cf, 0x66ac, 0x59ac, 0x61ac, 0x6dac, 0x56ac, 0x58ac, 0x001a, 0x001a, 0x001a, 0x43cf, 0x6aac, 0x63ac, 0x5dcf, 0x40cf, 0x6cac, 0x67ac, 0x49cf, 0x001a, 0x001a, 0x6bac, 0x50cf, 0x48cf, 0x64ac, 0x5ccf, 0x54cf, 0x001a, 0x5eac, 0x62cf, 0x47cf, 0x5aac, 0x59cf, 0x4fcf, 0x5fac, 0x55cf, 0x57ac, 0xfcce, 0x68ac, 0xe3ae, 0x5dac, 0x4ecf, 0x4dcf, 0x42cf, 0x001a, 0x5ecf, 0x001a, 0x57cf, 0x001a, 0x001a, 0x55ac, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecd1, 0xeaae, 0xedd1, 0x001a, 0xe1d1, 0xdfae, 0xebae, 0x001a, 0xdad1, 0x001a, 0xe3d1, 0xebd1, 0x001a, 0xd9d1, 0xf4d1, 0xd5ae, 0x001a, 0x001a, 0x001a, 0xf3d1, 0xeed1, 0x001a, 0xefd1, 0xddae, 0xe8ae, 0xe5d1, 0x001a, 0xe6d1, 0xf0d1, 0xe7d1, 0x001a, 0xe2d1, 0xdcd1, 0xddd1, 0xead1, 0xe4d1, 0x001a, 0x001a, 0xd6ae, 0xdaae, 0xf2d1, 0xded1, 0xe6ae, 0xe2ae, 0x001a, 0x001a, 0xe5ae, 0xecae, 0xdbae, 0xe7ae, 0xe9d1, 0xe9ae, 0xd8ae, 0x001a, 0xd7ae, 0xdbd1, 0x001a, 0xdfd1, 0xe0ae, 0xf1d1, 0xe8d1, 0xe0d1, 0xe4ae, 0xe1ae, 0x001a, 0xd9ae, 0xdcae, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4d5, 0x001a, 0xb4d5, 0xb5d5, 0xb9d5, 0x001a, 0xc8d5, 0xc5d5, 0x001a, 0xbed5, 0xbdd5, 0xedb1, 0xc1d5, 0xd0d5, 0xb0d5, 0x001a, 0xd1d5, 0xc3d5, 0xd5d5, 0xc9d5, 0xecb1, 0xc7d5, 0xe7b1, 0xfcb1, 0xf2b1, 0x001a, 0xf6b1, 0xf5b1, 0xb1d5, 0x001a, 0xced5, 0xd4d5, 0xccd5, 0xd3d5, 0x001a, 0x001a, 0xc0d5, 0xb2d5, 0xd2d5, 0xc2d5, 0xeab1, 0xf7b1, 0x001a, 0xcbd5, 0xf0b1, 0x001a, 0x001a, 0x001a, 0xcad5, 0xb3d5, 0xf8b1, 0x001a, 0xfab1, 0xcdd5, 0xfbb1, 0xe9b1, 0xbad5, 0xcfd5, 0x001a, 0x001a, 0xefb1, 0xf9b1, 0xbcd5, 0xc6d5, 0xb7d5, 0xbbd5, 0xf4b1, 0xb6d5, 0xe8b1, 0xf1b1, 0xeeb1, 0xbfd5, 0xdeae, 0xc0d9, 0xebb1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3b1, 0x001a, 0xc3d9, 0xd9d9, 0xced9, 0xd6b4, 0x001a, 0xd1b4, 0xbdd9, 0xd2b4, 0xcdd9, 0x001a, 0xc6d9, 0xd3d9, 0xceb4, 0xabd9, 0xd5d9, 0xc4b4, 0xb3d9, 0xc7b4, 0xc6b4, 0x001a, 0xd7b4, 0x001a, 0xadd9, 0xcfd9, 0xd0d9, 0xc9b4, 0xc5b4, 0xbbd9, 0x001a, 0xd0b4, 0xb6d9, 0x001a, 0xd1d9, 0xccb4, 0xc9d9, 0xd6d9, 0xb0d9, 0xb5d9, 0xafd9, 0x001a, 0xcbb4, 0xc2d9, 0xdedd, 0xb1d9, 0xcfb4, 0xbad9, 0xd2d9, 0xcab4, 0xb7d9, 0xb4d9, 0xc5d9, 0xcdb4, 0xc3b4, 0xd9b4, 0xc8d9, 0xc7d9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacd9, 0xc8b4, 0xd4d9, 0xbcd9, 0xbed9, 0x001a, 0xcbd9, 0xcad9, 0xaad9, 0xd3b4, 0xd5b4, 0xb2d9, 0xb9d9, 0xc1d9, 0xd4b4, 0xb8d9, 0xc4d9, 0xd7d9, 0x001a, 0xccd9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8d9, 0x001a, 0x001a, 0x001a, 0x001a, 0xaed9, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2dd, 0xa6b7, 0x001a, 0xf0dd, 0xdbdd, 0xe0dd, 0xd9dd, 0x001a, 0xecdd, 0xcbdd, 0xd2dd, 0x001a, 0xeadd, 0xf4dd, 0xdcdd, 0x001a, 0xcfdd, 0xe2dd, 0xe7dd, 0xd3dd, 0x001a, 0xe4dd, 0xd0dd, 0x001a, 0x001a, 0xd7dd, 0xd8dd, 0xa8b7, 0xebdd, 0xe9dd, 0x001a, 0xccdd, 0xeedd, 0x001a, 0xefdd, 0xf1dd, 0xacb7, 0xa4b7, 0x001a, 0xb8d5, 0xd4dd, 0xe6dd, 0xd5dd, 0xa1b7, 0xb1b7, 0xeddd, 0xafb7, 0xabb7, 0xcadd, 0xa3b7, 0x001a, 0xcddd, 0xb0b7, 0x001a, 0xdddd, 0xc9dd, 0x001a, 0xa9b7, 0xe1dd, 0xd1dd, 0xaab7, 0xdadd, 0x7eb7, 0xd8b4, 0xe3dd, 0xbfd9, 0xcedd, 0x001a, 0x001a, 0xe8dd, 0xa5b7, 0xe5dd, 0xa2b7, 0xdfdd, 0xadb7, 0xd6dd, 0xf3dd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7b7, 0xc6de, 0x001a, 0x001a, 0xaeb7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ae2, 0x48e2, 0x001a, 0x5ee2, 0x46e2, 0x001a, 0x58e2, 0x7db7, 0x5fba, 0x42e2, 0x5de2, 0x001a, 0x47e2, 0x55e2, 0x64ba, 0x5dba, 0x001a, 0x5be2, 0x001a, 0x40e2, 0x5ae2, 0x001a, 0x6fba, 0x51e2, 0x61e2, 0x6dba, 0x49e2, 0x5eba, 0x4be2, 0x59e2, 0x67ba, 0x44e2, 0x6bba, 0x61ba, 0x4de2, 0x43e2, 0xfce1, 0x001a, 0x57e2, 0x68ba, 0x60e2, 0xfde1, 0x65ba, 0x001a, 0x53e2, 0x001a, 0x66ba, 0x45e2, 0x50e2, 0x4ce2, 0x4ee2, 0x001a, 0x60ba, 0x5fe2, 0x6eba, 0x4fe2, 0x001a, 0x62e2, 0x001a, 0x001a, 0xfee1, 0x54e2, 0x63ba, 0x6cba, 0x6aba, 0x41e2, 0x56e2, 0x69ba, 0x001a, 0x001a, 0x62ba, 0x52e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ce2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e5, 0x001a, 0xd1e5, 0xcde5, 0xe1e5, 0xdee5, 0xcdbc, 0x001a, 0x001a, 0xe5e5, 0xd4e5, 0xd8bc, 0xdbe5, 0x001a, 0x001a, 0xd0e5, 0xdae5, 0xd5bc, 0xeee5, 0x001a, 0xebe5, 0xdde5, 0xcee5, 0x001a, 0x001a, 0xe2e5, 0xe4e5, 0xd1bc, 0xd8e5, 0xd3e5, 0xcae5, 0xcebc, 0xd6bc, 0x001a, 0xe7e5, 0xd7bc, 0xcbe5, 0xede5, 0xe0e5, 0xe6e5, 0xd4bc, 0x001a, 0x001a, 0xe3e5, 0x001a, 0xeae5, 0x001a, 0xd9bc, 0x001a, 0xd3bc, 0xdce5, 0xcfe5, 0xefe5, 0xcce5, 0xe8e5, 0xd0bc, 0x001a, 0xd6e5, 0x001a, 0xd7e5, 0xcfbc, 0xccbc, 0xd2e5, 0xd2bc, 0x001a, 0xcbbc, 0x001a, 0xe9e5, 0xece5, 0xd9e5, 0xcae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e9, 0x001a, 0xbee9, 0xf6be, 0x001a, 0x001a, 0xebbe, 0xf0be, 0xecbe, 0xcce9, 0xd7e9, 0xeabe, 0xc4e9, 0xcde9, 0xdfe5, 0xcee9, 0x001a, 0x001a, 0xf1be, 0x001a, 0xdde9, 0xf5be, 0xf8be, 0xc0e9, 0x001a, 0xf4be, 0x001a, 0xdbe9, 0xdce9, 0xd2e9, 0xd1e9, 0xc9e9, 0x001a, 0x001a, 0xd3e9, 0xdae9, 0xd9e9, 0x001a, 0xefbe, 0xedbe, 0xcbe9, 0xc8e9, 0x001a, 0xc5e9, 0xd8e9, 0xf7be, 0xd6e9, 0xf3be, 0xf2be, 0x001a, 0xd0e9, 0x001a, 0xbfe9, 0xc1e9, 0xc3e9, 0xd5e9, 0xcfe9, 0xeebe, 0x001a, 0xc6e9, 0x001a, 0xd4e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfc0, 0x45ed, 0xc8c0, 0xf5ec, 0x001a, 0x41ed, 0xcac0, 0x48ed, 0x001a, 0xfcec, 0x001a, 0xf7ec, 0x001a, 0x001a, 0x49ed, 0xf3ec, 0xfeec, 0x001a, 0xd1c0, 0x44ed, 0x4aed, 0xfdec, 0xc9c0, 0x40ed, 0xf4ec, 0xd0c0, 0x001a, 0x001a, 0x47ed, 0xf9ec, 0xccc0, 0x001a, 0xfbec, 0xf8ec, 0xd2c0, 0xfaec, 0xcbc0, 0xcec0, 0x43ed, 0xf6ec, 0x46ed, 0x001a, 0x42ed, 0x001a, 0x001a, 0x001a, 0x63c2, 0xe7ef, 0x68c2, 0x69c2, 0x001a, 0x001a, 0x001a, 0x62c2, 0xe6ef, 0x001a, 0xe3ef, 0xe4ef, 0x66c2, 0xdeef, 0xe2ef, 0x65c2, 0x001a, 0xdfef, 0x001a, 0x001a, 0x001a, 0x001a, 0x67c2, 0x64c2, 0x001a, 0xddef, 0xe1ef, 0xe5ef, 0x001a, 0x001a, 0x001a, 0x51f2, 0x4ef2, 0x57f2, 0x001a, 0x56f2, 0x54f2, 0x4ff2, 0x001a, 0x72c3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50f2, 0x71c3, 0xcdc0, 0x53f2, 0x70c3, 0x58f2, 0x52f2, 0x4df2, 0xe0ef, 0x001a, 0x001a, 0x001a, 0x6fc3, 0x001a, 0x4cf2, 0x56f4, 0x001a, 0x55f4, 0x55f2, 0x68c4, 0x001a, 0x59f4, 0x5af4, 0x54f4, 0x58f4, 0x001a, 0x53f4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1f5, 0x57f4, 0xe7c4, 0xe5c4, 0xcff5, 0x001a, 0x001a, 0x001a, 0xd2f5, 0x001a, 0xcef5, 0xd0f5, 0xe6c4, 0x001a, 0x001a, 0x001a, 0xe5f6, 0xe6f6, 0x76c5, 0xe4f6, 0x001a, 0x001a, 0x001a, 0xe2f7, 0xcfc5, 0xe0f7, 0xe1f7, 0xacf8, 0x001a, 0x001a, 0x56c6, 0xf3f8, 0xf1f8, 0xf2f8, 0xf4f8, 0x001a, 0x001a, 0x001a, 0xbbf9, 0x001a, 0xeda4, 0xb8a6, 0x001a, 0x59aa, 0x001a, 0xe9cc, 0x001a, 0x001a, 0x64cf, 0x001a, 0x001a, 0x001a, 0xf5d1, 0xf7d1, 0x001a, 0xf6d1, 0x001a, 0xf8d1, 0xfdb1, 0xd7d5, 0xf9d1, 0x001a, 0xd6d5, 0xd8d5, 0xd9d5, 0xdad9, 0xdbb4, 0xdbd9, 0xddd9, 0xdcb4, 0xdab4, 0xdcd9, 0x001a, 0xfadd, 0xf8dd, 0xf7dd, 0x001a, 0xf6dd, 0xf5dd, 0xb2b7, 0xf9dd, 0x70ba, 0x63e2, 0x65e2, 0x71ba, 0x64e2, 0xdbbc, 0x001a, 0xdabc, 0xf0e5, 0x001a, 0x001a, 0xdfe9, 0xdee9, 0xe0e9, 0x001a, 0x001a, 0xf9be, 0x001a, 0x4bed, 0xd3c0, 0x001a, 0xe8ef, 0x6ac2, 0x59f2, 0x77c5, 0xeea4, 0xbfa5, 0xb9a6, 0x42a8, 0x5aaa, 0x5baa, 0x001a, 0x001a, 0x6eac, 0x001a, 0x001a, 0xfad1, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3b7, 0x001a, 0x001a, 0x001a, 0xd1e6, 0xfabe, 0x6bc2, 0xefa4, 0x001a, 0xbaa6, 0x001a, 0x001a, 0xebcc, 0x5caa, 0xeacc, 0x001a, 0x65cf, 0x6fac, 0x66cf, 0x001a, 0x70ac, 0x001a, 0xfcd1, 0xeeae, 0xedae, 0x001a, 0xded5, 0xdcd5, 0xddd5, 0xdbd5, 0x001a, 0xdad5, 0x001a, 0x001a, 0xded9, 0xe1d9, 0xdeb4, 0xdfd9, 0xddb4, 0xe0d9, 0x001a, 0xfbdd, 0x001a, 0x001a, 0x66e2, 0x67e2, 0x68e2, 0x001a, 0xf3e5, 0xf2e5, 0xdcbc, 0xf1e5, 0xf4e5, 0xe1e9, 0x001a, 0x001a, 0xe2e9, 0xe3e9, 0x001a, 0x4ced, 0xd4c0, 0x6cc2, 0x5af2, 0x001a, 0xe8c4, 0x5fc9, 0x001a, 0x71ac, 0x67cf, 0xefae, 0x001a, 0x001a, 0xfeb1, 0x001a, 0xdfb4, 0xe2d9, 0x001a, 0xb5b7, 0xb4b7, 0x001a, 0x001a, 0x69e2, 0x6ae2, 0xddbc, 0xdebc, 0xe5e9, 0xe4e9, 0xe9ef, 0xe3f7, 0xf0a4, 0x60c9, 0xc0a5, 0x001a, 0x43a8, 0x48cb, 0x001a, 0x72ac, 0xb6b7, 0xf1a4, 0x001a, 0x68cf, 0x73ac, 0x69cf, 0x001a, 0xd5c0, 0xf2a4, 0x001a, 0x001a, 0xeccc, 0x001a, 0x6acf, 0x001a, 0x42d2, 0x41d2, 0xfed1, 0x001a, 0xfdd1, 0x43d2, 0x40d2, 0x001a, 0x001a, 0x40b2, 0x41b2, 0x001a, 0x001a, 0xe0b4, 0xe3d9, 0x001a, 0xe4d9, 0xe5d9, 0x001a, 0x001a, 0x001a, 0x41de, 0x42de, 0x40de, 0x001a, 0xfddd, 0xfedd, 0xb7b7, 0x6be2, 0xf7e5, 0xf6e5, 0xf5e5, 0xf8e5, 0xe7e9, 0xe6e9, 0xfbbe, 0xe8e9, 0x001a, 0xd6c0, 0x4ded, 0x001a, 0xeaef, 0x5bf2, 0xe7f6, 0x001a, 0xf3a4, 0xc2a5, 0xc1a5, 0x001a, 0x5daa, 0x61c9, 0x7ec9, 0xbba6, 0x001a, 0xf7c9, 0x49cb, 0x4acb, 0x5eaa, 0x001a, 0xedcc, 0x001a, 0x74ac, 0x6bcf, 0x6ccf, 0x001a, 0xf0ae, 0xf4ae, 0x44d2, 0xf3ae, 0xf1ae, 0xf2ae, 0x001a, 0xdfd5, 0x42b2, 0xe3b4, 0x001a, 0xe1b4, 0xe2b4, 0xe6d9, 0x001a, 0x001a, 0x72ba, 0xf4a4, 0x001a, 0xa1c9, 0x001a, 0xc3a5, 0x001a, 0x001a, 0xa4c9, 0x001a, 0x001a, 0xc6a5, 0xa3c9, 0xc5a5, 0xc4a5, 0x44a8, 0xa2c9, 0x001a, 0x001a, 0xf8c9, 0x001a, 0x001a, 0x001a, 0xfcc9, 0xfec9, 0x40ca, 0xc5a6, 0xc6a6, 0xfbc9, 0xc1a6, 0x001a, 0xf9c9, 0x001a, 0xfdc9, 0xc2a6, 0x001a, 0xbda6, 0x001a, 0xbea6, 0x001a, 0xc4a6, 0xfac9, 0xbca6, 0x45a8, 0xbfa6, 0xc0a6, 0xc3a6, 0x001a, 0x001a, 0x001a, 0x5bcb, 0x59cb, 0x4ccb, 0x51a8, 0x53cb, 0x4ca8, 0x4dcb, 0x001a, 0x55cb, 0x001a, 0x52cb, 0x4fa8, 0x51cb, 0x56a8, 0x5acb, 0x58a8, 0x001a, 0x5aa8, 0x001a, 0x4bcb, 0x001a, 0x4da8, 0x5ccb, 0x001a, 0x54a8, 0x57a8, 0x001a, 0x45cd, 0x47a8, 0x5ea8, 0x55a8, 0x4ecb, 0x4aa8, 0x59a8, 0x56cb, 0x48a8, 0x49a8, 0x43cd, 0x4fcb, 0x50a8, 0x5ba8, 0x5dcb, 0x50cb, 0x4ea8, 0x001a, 0x53a8, 0xeecc, 0x5ca8, 0x57cb, 0x52a8, 0x001a, 0x5da8, 0x46a8, 0x54cb, 0x4ba8, 0x58cb, 0x44cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6aaa, 0x7aaa, 0xf5cc, 0x71aa, 0x001a, 0x4bcd, 0x62aa, 0x001a, 0x65aa, 0x42cd, 0x001a, 0xf3cc, 0xf7cc, 0x6daa, 0x6faa, 0xfacc, 0x76aa, 0x68aa, 0x66aa, 0x67aa, 0x75aa, 0x47cd, 0x70aa, 0xf9cc, 0xfbcc, 0x6eaa, 0x73aa, 0xfccc, 0x4acd, 0x001a, 0x75ac, 0x79aa, 0x001a, 0x63aa, 0x49cd, 0x001a, 0x4dcd, 0xf8cc, 0x4fcd, 0x40cd, 0x6caa, 0xf4cc, 0x6baa, 0x7daa, 0x72aa, 0x001a, 0xf2cc, 0x75cf, 0x78aa, 0x7caa, 0x41cd, 0x46cd, 0x001a, 0x7eaa, 0x77aa, 0x69aa, 0x5faa, 0x001a, 0x64aa, 0x001a, 0xf6cc, 0x60aa, 0x4ecd, 0x001a, 0xf0cc, 0xefcc, 0xfdcc, 0xf1cc, 0x7baa, 0xf5ae, 0x74aa, 0xfecc, 0x61aa, 0x001a, 0xa6ac, 0x001a, 0x001a, 0x001a, 0x4ccd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ccf, 0xa1cf, 0x001a, 0xa4cf, 0x77cf, 0x001a, 0x001a, 0xa7cf, 0xaacf, 0xaccf, 0x74cf, 0x76ac, 0x7bac, 0x49d2, 0xadac, 0xa5cf, 0xadcf, 0x7bcf, 0x73cf, 0x001a, 0x001a, 0x001a, 0x64d2, 0x7eac, 0xa2cf, 0x78cf, 0x7acf, 0xa5ac, 0x001a, 0x7dcf, 0x7dac, 0x70cf, 0xa8cf, 0x001a, 0xabcf, 0x001a, 0x001a, 0x7aac, 0x001a, 0xa8ac, 0x6dcf, 0xaaac, 0x78ac, 0xaeac, 0xa9cf, 0x6fcf, 0xabac, 0x5ed2, 0x48cd, 0x7cac, 0x77ac, 0x76cf, 0x6ecf, 0xacac, 0xa4ac, 0xa3cf, 0xa9ac, 0xa7ac, 0x79cf, 0xa1ac, 0x71cf, 0xa2ac, 0xa3ac, 0x72cf, 0xa6cf, 0x79ac, 0x7ecf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4cd2, 0xfdae, 0x43af, 0x001a, 0x001a, 0x001a, 0x55d2, 0x5bd2, 0x57d2, 0x4ad2, 0x4dd2, 0x46d2, 0x47d2, 0x4aaf, 0xfaae, 0x56d2, 0x5fd2, 0x45af, 0xf6ae, 0x001a, 0x40af, 0x4ed2, 0x42af, 0x4fd2, 0x59d2, 0x001a, 0x001a, 0x001a, 0x44af, 0x68d2, 0x48d2, 0xfcae, 0xfbae, 0x48af, 0x45d2, 0x66d2, 0x5ad2, 0x67d2, 0x61d2, 0x53d2, 0x62d2, 0x001a, 0x5cd2, 0x65d2, 0x63d2, 0x49af, 0x54d2, 0xf9ae, 0xf8ae, 0x41af, 0x47af, 0x60d2, 0x46af, 0x51d2, 0x43b2, 0x001a, 0x69d2, 0x50d2, 0x4bd2, 0xfeae, 0x4baf, 0xf7ae, 0x001a, 0x58d2, 0x5dd2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x65b2, 0xe1d5, 0xe5d5, 0x001a, 0x52b2, 0x50b2, 0x001a, 0x001a, 0x47b2, 0xe3d5, 0xe2d5, 0x5bb2, 0x001a, 0xe8d5, 0x55b2, 0x001a, 0xfad5, 0x47d6, 0x44b2, 0xf7d5, 0xf0d5, 0x67b2, 0xe0d5, 0x001a, 0xfcd5, 0x001a, 0x64b2, 0x58b2, 0x63b2, 0x4eb2, 0xecd5, 0xfed5, 0xf6d5, 0x4fb2, 0x49b2, 0x45d6, 0x001a, 0xfdd5, 0x40d6, 0x51b2, 0x59b2, 0x42d6, 0xead5, 0xfbd5, 0xefd5, 0x44d6, 0x5eb2, 0x46b2, 0x5cb2, 0xf4d5, 0xf2d5, 0xf3d5, 0x53b2, 0xeed5, 0xedd5, 0x48b2, 0xe7d5, 0x46d6, 0x4ab2, 0xf1d5, 0x68b2, 0x001a, 0x62b2, 0xe6d5, 0x5fb2, 0x5db2, 0x66b2, 0xf8d5, 0x61b2, 0x52d2, 0xf9d5, 0x60b2, 0x41d6, 0x45b2, 0xf5d5, 0x57b2, 0xe9d5, 0x56b2, 0x001a, 0x54b2, 0x4cb2, 0x4bb2, 0xe7d9, 0x43d6, 0x001a, 0x001a, 0xebd5, 0x001a, 0x001a, 0xfcd9, 0x001a, 0x4db2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41b5, 0x5ab2, 0xeeb4, 0xf6d9, 0xfcb4, 0x001a, 0xead9, 0xebb4, 0xe7b4, 0x49da, 0xedb4, 0xf1b4, 0xecb4, 0xf5b4, 0x4dda, 0x44da, 0x001a, 0x001a, 0xf1d9, 0xfab4, 0xf4b4, 0xfdd9, 0xe4b4, 0x4ada, 0x43da, 0xe8b4, 0xf7d9, 0xf7b4, 0x55da, 0x56da, 0x001a, 0xe5b4, 0x48da, 0xf9b4, 0xfbd9, 0xedd9, 0xeed9, 0xfdb4, 0xf2d9, 0xf9d9, 0xf3d9, 0x001a, 0xfbb4, 0x44b5, 0xefd9, 0xe8d9, 0xe9d9, 0x001a, 0xebd9, 0xeab4, 0xf8d9, 0x001a, 0xf8b4, 0x42b5, 0x001a, 0x001a, 0xfad9, 0x53da, 0x4bda, 0xe6b4, 0x51da, 0xf2b4, 0x001a, 0xf0b4, 0x001a, 0x57da, 0xefb4, 0x41da, 0xf4d9, 0xfed9, 0x47b5, 0x45da, 0x42da, 0xf0d9, 0x43b5, 0x4fda, 0x4cda, 0x54da, 0xe9b4, 0x40da, 0x46b5, 0x001a, 0x47da, 0x001a, 0x001a, 0xf3b4, 0xf6b4, 0x001a, 0x46da, 0x45b5, 0xf5d9, 0xe4d5, 0x001a, 0x001a, 0x50da, 0x4eda, 0x52da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xecd9, 0x40b5, 0x001a, 0x001a, 0x001a, 0x61de, 0x60de, 0x46de, 0xbdb7, 0x001a, 0x5fde, 0x49de, 0x4ade, 0x001a, 0xc7b7, 0x68de, 0xc2b7, 0x5ede, 0x001a, 0x43de, 0xc8b7, 0xbeb7, 0x52de, 0x48de, 0x4bde, 0x63de, 0xb8b7, 0x6ade, 0x62de, 0xc1b7, 0x57de, 0xccb7, 0x001a, 0x001a, 0xcbb7, 0xc5b7, 0x001a, 0x001a, 0x69de, 0xb9b7, 0x55de, 0x4cde, 0x59de, 0x65de, 0xcdb7, 0x001a, 0xbbb7, 0x54de, 0x001a, 0x4dde, 0xc4b7, 0x001a, 0xc3b7, 0x50de, 0x5ade, 0x64de, 0x47de, 0x51de, 0xbcb7, 0x5bde, 0xc9b7, 0xc0b7, 0x4ede, 0xbfb7, 0x45de, 0x53de, 0x67de, 0xfeb4, 0xb0ba, 0x56de, 0x6ce2, 0x58de, 0x66de, 0xc6b7, 0x4fde, 0xbab7, 0xcab7, 0xf0bc, 0x44de, 0x001a, 0x5dde, 0x001a, 0x001a, 0x001a, 0x5cde, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaae2, 0xadba, 0x7de2, 0xa4e2, 0xa2ba, 0x001a, 0x6ee2, 0xafba, 0x001a, 0x77ba, 0x6de2, 0xb0e2, 0xb1ba, 0x71e2, 0xa3e2, 0x001a, 0x73e2, 0xb3e2, 0xafe2, 0x75ba, 0xa1ba, 0x53e6, 0xaeba, 0x7dba, 0x6fe2, 0x001a, 0xaee2, 0xa3ba, 0xabe2, 0xb8e2, 0x75e2, 0x7ee2, 0x001a, 0x001a, 0xb6e2, 0xace2, 0x7cba, 0x001a, 0x001a, 0x7ce2, 0x76ba, 0x74ba, 0xa8ba, 0x001a, 0x001a, 0x7ae2, 0x77e2, 0x78e2, 0x001a, 0xb2e2, 0x001a, 0xb7e2, 0xb5e2, 0x7aba, 0xb9e2, 0x7eba, 0xa7ba, 0x001a, 0x70e2, 0xfae5, 0x79e2, 0x001a, 0x78ba, 0xacba, 0xa9ba, 0x7bba, 0xa5e2, 0x74e2, 0xaaba, 0xa7e2, 0xa4ba, 0xa6ba, 0x73ba, 0x001a, 0xa9e2, 0xa1e2, 0x72e2, 0xa5ba, 0xb1e2, 0xb4e2, 0x7be2, 0xa8e2, 0x001a, 0x79ba, 0xdfbc, 0xa6e2, 0xf9e5, 0x001a, 0xade2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x76e2, 0x44e6, 0x4ee6, 0xe2bc, 0x4de6, 0x59e6, 0xe4bc, 0x4be6, 0x001a, 0x4fe6, 0xefbc, 0x001a, 0x46e6, 0xe7bc, 0x001a, 0x52e6, 0xf0e9, 0xf3bc, 0xf2bc, 0x54e6, 0x43e6, 0x5ee6, 0xedbc, 0x001a, 0xe3bc, 0x57e6, 0x001a, 0x5be6, 0x60e6, 0x55e6, 0x49e6, 0xe6bc, 0xe9bc, 0xf1bc, 0xecbc, 0x001a, 0x4ce6, 0xa2e2, 0x001a, 0x001a, 0x48e6, 0x5fe6, 0xe8bc, 0x001a, 0xebbc, 0x61e6, 0xe0bc, 0x56e6, 0xfbe5, 0x5ce6, 0xdfc0, 0x001a, 0x4ae6, 0x001a, 0xe1bc, 0x45e6, 0xe5bc, 0xfce5, 0xabba, 0x41e6, 0x001a, 0x5ae6, 0x42e6, 0x40e6, 0xeabc, 0x001a, 0x58e6, 0x001a, 0xfee5, 0x51e6, 0x50e6, 0x5de6, 0x47e6, 0xeebc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3e9, 0x001a, 0x49bf, 0xfebe, 0x40ea, 0xebe9, 0x41bf, 0xf7e9, 0x48bf, 0x43bf, 0xf5e9, 0x4fed, 0xfbe9, 0x42ea, 0xfae9, 0xe9e9, 0xf8e9, 0x44ea, 0x46ea, 0xfdbe, 0x45ea, 0x44bf, 0x4abf, 0x001a, 0x47bf, 0x001a, 0xfee9, 0x46bf, 0xf9e9, 0x001a, 0xede9, 0xf2e9, 0x001a, 0xfde9, 0x45bf, 0x42bf, 0xfcbe, 0x40bf, 0xf1e9, 0x001a, 0xfde5, 0xece9, 0xefe9, 0x41ea, 0xf4e9, 0xeae9, 0x4eed, 0x43ea, 0xeee9, 0xfce9, 0x001a, 0x001a, 0x001a, 0x001a, 0x51ed, 0xe3c0, 0x001a, 0x001a, 0xd7c0, 0x001a, 0x001a, 0xdbc0, 0x53ed, 0x59ed, 0x57ed, 0xd9c0, 0xdac0, 0xe1c0, 0x5aed, 0x52ed, 0xdcc0, 0x001a, 0x56ed, 0x55ed, 0x5bed, 0xe2c0, 0x001a, 0xddc0, 0xe0c0, 0x54ed, 0xe4c0, 0xdec0, 0xe5c0, 0xd8c0, 0x58ed, 0x001a, 0x50ed, 0x001a, 0x001a, 0xf7ef, 0x001a, 0x001a, 0x71c2, 0xf4ef, 0xf6ef, 0x001a, 0x6fc2, 0xf2ef, 0xf3ef, 0xeeef, 0x001a, 0x001a, 0xf6e9, 0xefef, 0x70c2, 0xebef, 0x001a, 0x6dc2, 0xf8ef, 0x6ec2, 0xecef, 0xedef, 0xf1ef, 0x73c2, 0x001a, 0x72c2, 0x001a, 0x001a, 0xf0ef, 0x78c3, 0x5ff2, 0x65f2, 0x79c3, 0x5cf2, 0x76c3, 0x73c3, 0x67f2, 0x77c3, 0x001a, 0x74c3, 0x5ef2, 0x61f2, 0x62f2, 0x63f2, 0x66f2, 0x001a, 0xf5ef, 0x5df2, 0x75c3, 0x64f2, 0x68f2, 0x60f2, 0x001a, 0x001a, 0x001a, 0x5df4, 0x6ac4, 0x60f4, 0x6bc4, 0x68f4, 0x5ff4, 0x5cf4, 0x001a, 0x5ef4, 0x62f4, 0x65f4, 0x64f4, 0x67f4, 0x5bf4, 0x001a, 0x69c4, 0x63f4, 0x66f4, 0x69f4, 0x61f4, 0xd3f5, 0xd4f5, 0xd8f5, 0xd9f5, 0x001a, 0xd6f5, 0xd7f5, 0xd5f5, 0x001a, 0xe9c4, 0x001a, 0x001a, 0x001a, 0x001a, 0x78c5, 0xebf6, 0x001a, 0x001a, 0xe8f6, 0xe9f6, 0xeaf6, 0x79c5, 0x001a, 0xe5f7, 0xe4f7, 0x001a, 0xaff8, 0xf4c5, 0xadf8, 0xb0f8, 0xaef8, 0xf5f8, 0x57c6, 0x65c6, 0xa3f9, 0x6cf9, 0x001a, 0xa2f9, 0xd0f9, 0xd1f9, 0xf5a4, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7a6, 0x41ca, 0x001a, 0x001a, 0x5ecb, 0x001a, 0x5fa8, 0x001a, 0x62a8, 0x001a, 0x5fcb, 0x001a, 0x60a8, 0x61a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x58cd, 0x5acd, 0x55cd, 0x52cd, 0x54cd, 0x001a, 0x001a, 0x001a, 0xa4aa, 0x001a, 0x001a, 0x001a, 0xa2aa, 0x001a, 0x001a, 0x56cd, 0xa3aa, 0x53cd, 0x50cd, 0xa1aa, 0x57cd, 0x001a, 0x51cd, 0xa5aa, 0x59cd, 0x001a, 0x001a, 0x001a, 0x001a, 0xafcf, 0x001a, 0xb3cf, 0x001a, 0x001a, 0xb7ac, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6cf, 0x001a, 0xafac, 0xb2ac, 0xb4ac, 0xb6ac, 0xb3ac, 0xb2cf, 0xb1cf, 0x001a, 0xb1ac, 0xb4cf, 0xb5cf, 0x001a, 0xaecf, 0xb5ac, 0x001a, 0xb0ac, 0x001a, 0x001a, 0x001a, 0xb0cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x77d2, 0x78d2, 0x79d2, 0x50af, 0x001a, 0x4caf, 0x6ed2, 0x001a, 0x76d2, 0x7bd2, 0x51af, 0x001a, 0x6cd2, 0x72d2, 0x6bd2, 0x75d2, 0x001a, 0x001a, 0x71d2, 0x4daf, 0x4faf, 0x7ad2, 0x001a, 0x6ad2, 0x6dd2, 0x73d2, 0x001a, 0x74d2, 0x7cd2, 0x70d2, 0x001a, 0x4eaf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6db2, 0x4ed6, 0x001a, 0x001a, 0x50d6, 0x4cd6, 0x001a, 0x58d6, 0x4ad6, 0x57d6, 0x69b2, 0x48d6, 0x5bda, 0x52d6, 0x6cb2, 0x001a, 0x53d6, 0x56d6, 0x001a, 0x5ad6, 0x001a, 0x4fd6, 0x001a, 0x54d6, 0x001a, 0x001a, 0x6ab2, 0x6bb2, 0x59d6, 0x4dd6, 0x49d6, 0x5bd6, 0x001a, 0x51d6, 0x001a, 0x001a, 0x55d6, 0x001a, 0x001a, 0x001a, 0x4bd6, 0x001a, 0x48b5, 0x49b5, 0x65da, 0x4fb5, 0x001a, 0x59da, 0x62da, 0x58da, 0x4cb5, 0x60da, 0x5eda, 0x001a, 0x5fda, 0x4ab5, 0x001a, 0x63da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5cda, 0x5ada, 0x4bb5, 0x5dda, 0x61da, 0x001a, 0x001a, 0x001a, 0x4db5, 0x001a, 0x001a, 0x001a, 0x64da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x70de, 0x77de, 0x79de, 0xa1de, 0x001a, 0xdab7, 0x6bde, 0x001a, 0xd2b7, 0x001a, 0x7ade, 0xd7b7, 0xa2de, 0xceb7, 0x001a, 0x7dde, 0x001a, 0x6dde, 0x7ede, 0x6cde, 0x001a, 0xdcb7, 0x001a, 0x78de, 0xcfb7, 0xa3de, 0x001a, 0xd4b7, 0x71de, 0xd9b7, 0x7cde, 0x6fde, 0x76de, 0x72de, 0x6ede, 0xd1b7, 0xd8b7, 0xd6b7, 0xd3b7, 0xdbb7, 0xd0b7, 0x75de, 0x001a, 0xd5b7, 0x001a, 0x4eb5, 0x001a, 0x7bde, 0x001a, 0x73de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74de, 0x001a, 0x001a, 0xc1e2, 0x001a, 0xb4ba, 0x001a, 0x001a, 0xbde2, 0xc3e2, 0xbfe2, 0x001a, 0xb6ba, 0xbee2, 0xc2e2, 0xbae2, 0x001a, 0xbce2, 0xb5ba, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0e2, 0xbbe2, 0x001a, 0xb7ba, 0x001a, 0xb2ba, 0x001a, 0x001a, 0xc4e2, 0x001a, 0xb3ba, 0x67e6, 0x64e6, 0x70e6, 0x6ae6, 0x6ce6, 0xf4bc, 0x66e6, 0x6ee6, 0x001a, 0x001a, 0x6de6, 0x6be6, 0x001a, 0x71e6, 0xf7bc, 0x68e6, 0x6fe6, 0x001a, 0xf5bc, 0x001a, 0x001a, 0x63e6, 0x65e6, 0xf6bc, 0x62e6, 0x72e6, 0x001a, 0x69e6, 0x001a, 0x001a, 0x4aea, 0x51bf, 0x001a, 0x001a, 0x55ea, 0x53ea, 0x4bbf, 0x49ea, 0x4cea, 0x4dea, 0x48ea, 0x55bf, 0x56bf, 0x47ea, 0x56ea, 0x51ea, 0x4fbf, 0x4cbf, 0x50ea, 0x4eea, 0x001a, 0x001a, 0x52bf, 0x52ea, 0x4dbf, 0x001a, 0x4ebf, 0x001a, 0x4fea, 0x50bf, 0x4bea, 0x001a, 0x54ea, 0x53bf, 0x57ea, 0x58ea, 0x54bf, 0x001a, 0x001a, 0xe7c0, 0xeec0, 0x5ced, 0x62ed, 0x001a, 0x60ed, 0xeac0, 0xe9c0, 0xe6c0, 0x5eed, 0x001a, 0x001a, 0x001a, 0xecc0, 0xebc0, 0xe8c0, 0x001a, 0x61ed, 0x5ded, 0x5fed, 0x001a, 0xedc0, 0x001a, 0x001a, 0x001a, 0x77c2, 0xfbef, 0x001a, 0x74c2, 0x75c2, 0xfdef, 0x76c2, 0xfaef, 0x001a, 0xf9ef, 0x6cf2, 0xfcef, 0x001a, 0x6df2, 0x7ac3, 0x6bf2, 0x001a, 0x001a, 0x6af2, 0x001a, 0x69f2, 0x7bc3, 0x001a, 0x001a, 0x6cc4, 0x001a, 0x001a, 0x6af4, 0x6bf4, 0x001a, 0x001a, 0x001a, 0x001a, 0xdcf5, 0xdbf5, 0xeac4, 0x001a, 0xdaf5, 0xecf6, 0xedf6, 0x001a, 0x001a, 0xe6f7, 0xb1f8, 0x001a, 0x001a, 0xf6f8, 0xbcf9, 0x79c6, 0xc6f9, 0xf6a4, 0x001a, 0xa6aa, 0xa7aa, 0x001a, 0x001a, 0xb8ac, 0x001a, 0x001a, 0x001a, 0x001a, 0xefc0, 0xf7a4, 0x001a, 0xa8aa, 0x52af, 0xddb7, 0xf8a4, 0x001a, 0x6eb2, 0xb8ba, 0x62c9, 0x001a, 0xb7cf, 0x7dd2, 0x001a, 0xc5e2, 0x001a, 0xf0c0, 0xf9a4, 0xa9aa, 0xb8cf, 0xb9cf, 0x66da, 0x50b5, 0x001a, 0x001a, 0xa4de, 0x001a, 0x001a, 0xdeb7, 0xc6e2, 0x001a, 0x001a, 0xf8bc, 0x001a, 0x7cc3, 0xfaa4, 0x67da, 0xfba4, 0x001a, 0xc9a6, 0x42ca, 0xc8a6, 0x65a8, 0x64a8, 0x63a8, 0x60cb, 0x001a, 0x001a, 0x001a, 0xaaaa, 0x001a, 0xabaa, 0x5bcd, 0x001a, 0xbacf, 0x001a, 0xbdcf, 0xbaac, 0xbbcf, 0x001a, 0xb9ac, 0xbccf, 0xbbac, 0x001a, 0xa2d2, 0xa1d2, 0x7ed2, 0x53af, 0x001a, 0x5dd6, 0x5ed6, 0x6fb2, 0x5cd6, 0x5fd6, 0x52b5, 0x70b2, 0x001a, 0x001a, 0x51b5, 0x6bda, 0x6ada, 0x001a, 0x68da, 0x69da, 0x001a, 0x6cda, 0xa6de, 0xa5de, 0xa9de, 0x001a, 0xa8de, 0xa7de, 0xb9ba, 0xc9e2, 0x001a, 0xc8e2, 0xbaba, 0xc7e2, 0x73e6, 0x001a, 0x74e6, 0xf9bc, 0x001a, 0x59ea, 0x5aea, 0x001a, 0x001a, 0x72f2, 0x7dc3, 0x71f2, 0x70f2, 0x6ef2, 0x6ff2, 0xebc4, 0x6cf4, 0xeef6, 0xf7f8, 0x001a, 0xfca4, 0x001a, 0xa5c9, 0xc7a5, 0xa6c9, 0x001a, 0x001a, 0x001a, 0x43ca, 0x44ca, 0x001a, 0x001a, 0x001a, 0x001a, 0x66cb, 0x001a, 0x001a, 0x62cb, 0x001a, 0x61cb, 0xacaa, 0x65cb, 0x67a8, 0x63cb, 0x66a8, 0x67cb, 0x64cb, 0x001a, 0x001a, 0x5fcd, 0xbecf, 0x5dcd, 0x64cd, 0x001a, 0xadaa, 0x001a, 0xb0aa, 0x65cd, 0x61cd, 0x001a, 0x62cd, 0x001a, 0x5ccd, 0xafaa, 0x5ecd, 0xaeaa, 0x63cd, 0x001a, 0x60cd, 0x001a, 0x001a, 0xc2cf, 0xbdac, 0xbeac, 0x001a, 0xc5cf, 0xbfcf, 0x001a, 0xc4cf, 0x001a, 0xc0cf, 0xbcac, 0xc3cf, 0xc1cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8d2, 0xa5d2, 0x001a, 0xa7d2, 0x58af, 0x57af, 0x55af, 0xa4d2, 0xa9d2, 0x54af, 0x56af, 0xa6d2, 0x67d6, 0xa3d2, 0xaad2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62d6, 0x66d6, 0x001a, 0x65d6, 0x6eda, 0x79da, 0x001a, 0x001a, 0x68d6, 0x001a, 0x63d6, 0x6dda, 0x74b2, 0x001a, 0x001a, 0x73b2, 0x61d6, 0x64d6, 0x75b2, 0x001a, 0x72b2, 0x71b2, 0x60d6, 0x69d6, 0x001a, 0x001a, 0x001a, 0x70da, 0x77da, 0x001a, 0x54b5, 0x76da, 0x73da, 0x001a, 0x56b5, 0x001a, 0x001a, 0x001a, 0x75da, 0x001a, 0x001a, 0x6fda, 0x71da, 0x74da, 0x72da, 0x55b5, 0x78da, 0x53b5, 0xdfb7, 0x001a, 0x001a, 0xadde, 0xacde, 0xaade, 0x001a, 0xe2b7, 0xe1b7, 0xaede, 0x001a, 0xabde, 0xcae2, 0xbbba, 0xe0b7, 0x001a, 0x001a, 0x001a, 0xb0de, 0xafde, 0x001a, 0xcde2, 0xcbe2, 0xfabc, 0x001a, 0xbcba, 0xcce2, 0x76e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbbc, 0x75e6, 0x7ee6, 0x7de6, 0x7be6, 0x001a, 0x7ae6, 0x77e6, 0x78e6, 0x79e6, 0x7ce6, 0xa1e6, 0x001a, 0x001a, 0x5fea, 0x5cea, 0x5dea, 0x57bf, 0x5bea, 0x61ea, 0x60ea, 0x5eea, 0x001a, 0x64ed, 0x65ed, 0xf1c0, 0x001a, 0xf2c0, 0x63ed, 0x001a, 0x79c2, 0xfeef, 0x78c2, 0x7ec3, 0x001a, 0xa1c3, 0x6dc4, 0x6ef4, 0x6df4, 0xddf5, 0xeff6, 0x7ac5, 0xe8f7, 0xe7f7, 0xe9f7, 0xc8a5, 0xc6cf, 0x59af, 0x76b2, 0x6ad6, 0xc9a5, 0xa7c9, 0xfda4, 0x001a, 0x001a, 0x45ca, 0x001a, 0x001a, 0x001a, 0x6ccb, 0x6acb, 0x6bcb, 0x68cb, 0x68a8, 0x69cb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6dcd, 0x001a, 0xb3aa, 0x6bcd, 0x67cd, 0x6acd, 0x001a, 0x66cd, 0xb5aa, 0x69cd, 0x001a, 0xb2aa, 0xb1aa, 0x001a, 0xb4aa, 0x6ccd, 0x68cd, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2ac, 0xc5ac, 0xcecf, 0xcdcf, 0xcccf, 0xbfac, 0xd5cf, 0xcbcf, 0x001a, 0xc1ac, 0xafd2, 0x001a, 0xd2cf, 0xd0cf, 0xc4ac, 0x001a, 0xc8cf, 0xd3cf, 0x001a, 0xcacf, 0xd4cf, 0xd1cf, 0xc9cf, 0x001a, 0xc0ac, 0xd6cf, 0xc7cf, 0xc3ac, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4d2, 0xabd2, 0xb6d2, 0x001a, 0xaed2, 0xb9d2, 0xbad2, 0xacd2, 0xb8d2, 0xb5d2, 0xb3d2, 0xb7d2, 0x5faf, 0x001a, 0x5daf, 0x001a, 0x001a, 0xb1d2, 0x001a, 0xadd2, 0x001a, 0xb0d2, 0xbbd2, 0xb2d2, 0x5eaf, 0xcfcf, 0x001a, 0x5aaf, 0x5caf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x78d6, 0x6dd6, 0x6bd6, 0x001a, 0x6cd6, 0x001a, 0x73d6, 0x001a, 0x74d6, 0x70d6, 0x7bb2, 0x75d6, 0x72d6, 0x6fd6, 0x001a, 0x79b2, 0x6ed6, 0x77b2, 0x7ab2, 0x71d6, 0x79d6, 0x5baf, 0x78b2, 0x77d6, 0x76d6, 0x7cb2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7eda, 0x001a, 0x001a, 0x001a, 0xa1da, 0x60b5, 0x001a, 0xa7da, 0x001a, 0x001a, 0xa9da, 0xa2da, 0x5ab5, 0xa6da, 0xa5da, 0x5bb5, 0x61b5, 0x001a, 0x62b5, 0xa8da, 0x58b5, 0x7dda, 0x7bda, 0xa3da, 0x7ada, 0x5fb5, 0x7cda, 0xa4da, 0xaada, 0x59b5, 0x5eb5, 0x5cb5, 0x5db5, 0x001a, 0x001a, 0x001a, 0x57b5, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9b7, 0xb7de, 0xe8b7, 0xbbde, 0x001a, 0xb1de, 0x001a, 0xbcde, 0x001a, 0x001a, 0x001a, 0xb2de, 0xb3de, 0x001a, 0xbdde, 0xbade, 0xb8de, 0xb9de, 0xb5de, 0xb4de, 0x001a, 0xbede, 0xe5b7, 0x001a, 0xb6de, 0x001a, 0xeab7, 0xe4b7, 0xebb7, 0xecb7, 0x001a, 0xe7b7, 0xe6b7, 0x001a, 0x001a, 0xcee2, 0xbeba, 0xbdba, 0x001a, 0x001a, 0xd3e2, 0x001a, 0xfcbc, 0xbfba, 0x001a, 0x001a, 0xc1ba, 0xd4e2, 0xe3b7, 0xc0ba, 0xd0e2, 0xd2e2, 0xcfe2, 0x001a, 0xd1e2, 0x001a, 0x001a, 0x001a, 0xabe6, 0x001a, 0x001a, 0xaae6, 0xa7e6, 0x40bd, 0x62ea, 0x41bd, 0xa6e6, 0x001a, 0xfebc, 0x001a, 0xa8e6, 0xa5e6, 0xa2e6, 0xa9e6, 0xa3e6, 0xa4e6, 0xfdbc, 0x001a, 0x001a, 0x001a, 0x001a, 0x69ed, 0x001a, 0x66ea, 0x001a, 0x65ea, 0x67ea, 0x001a, 0x66ed, 0x5abf, 0x001a, 0x63ea, 0x001a, 0x58bf, 0x001a, 0x5cbf, 0x5bbf, 0x64ea, 0x68ea, 0x001a, 0x59bf, 0x001a, 0x6ded, 0xf5c0, 0x7ac2, 0xf6c0, 0xf3c0, 0x6aed, 0x68ed, 0x001a, 0x6bed, 0x001a, 0x6eed, 0xf4c0, 0x6ced, 0x67ed, 0x001a, 0x001a, 0x42f0, 0x45f0, 0x75f2, 0x40f0, 0x001a, 0x6ff4, 0x46f0, 0x001a, 0xa2c3, 0x44f0, 0x7bc2, 0x41f0, 0x43f0, 0x47f0, 0x76f2, 0x001a, 0x74f2, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3c3, 0x73f2, 0x001a, 0x001a, 0x001a, 0x6ec4, 0x001a, 0x001a, 0x001a, 0x001a, 0xedc4, 0xf1f6, 0xecc4, 0xf3f6, 0xf0f6, 0xf2f6, 0xd0c5, 0xb2f8, 0xcaa5, 0x6ecd, 0xbcd2, 0xbdd2, 0x7db2, 0xbfde, 0x5dbf, 0xa4c3, 0x7bc5, 0xb3f8, 0xcba5, 0x001a, 0x6fcd, 0x60a2, 0x001a, 0x001a, 0xd7cf, 0x001a, 0xd8cf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbed2, 0xbfd2, 0x7eb2, 0xa1b2, 0x001a, 0x001a, 0x001a, 0xabda, 0x001a, 0xc2de, 0xc1de, 0xc0de, 0xd5e2, 0x001a, 0xd6e2, 0xd7e2, 0xc2ba, 0x001a, 0x001a, 0xade6, 0xace6, 0x001a, 0x001a, 0x69ea, 0x5ebf, 0x5fbf, 0x001a, 0x72ed, 0x6fed, 0x70ed, 0x71ed, 0x49f0, 0x48f0, 0x7cc2, 0x77f2, 0xdef5, 0xcca5, 0x001a, 0xc6ac, 0x001a, 0xa2b2, 0xc3de, 0x001a, 0xcda5, 0x001a, 0xc0d2, 0xa3b2, 0x001a, 0x001a, 0x63b5, 0x64b5, 0x001a, 0xcea5, 0xcfa5, 0x46ca, 0x6aa8, 0x69a8, 0xc7ac, 0xd9cf, 0xacda, 0xd0a5, 0xd1a5, 0xd2a5, 0xd3a5, 0x001a, 0x001a, 0x001a, 0x6ba8, 0x6ca8, 0x6ecb, 0x6dcb, 0x001a, 0x001a, 0xb6aa, 0x72cd, 0x70cd, 0x71cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdacf, 0xdbcf, 0x001a, 0x001a, 0xcbac, 0xc9ac, 0x001a, 0xcaac, 0xc8ac, 0x001a, 0x001a, 0x001a, 0x001a, 0x60af, 0x001a, 0x001a, 0x001a, 0x001a, 0x64af, 0x63af, 0xc1d2, 0x62af, 0x61af, 0x001a, 0xc2d2, 0x001a, 0x001a, 0xa6b2, 0x7bd6, 0x7ad6, 0xa4b2, 0xa5b2, 0x001a, 0x001a, 0x001a, 0x66b5, 0x65b5, 0xaeda, 0x001a, 0x001a, 0xadda, 0xa7b2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xedb7, 0xc5de, 0xeeb7, 0xc4de, 0x001a, 0x001a, 0x001a, 0xd8e2, 0xaee6, 0x42bd, 0x6aea, 0x001a, 0x001a, 0x001a, 0x73ed, 0x001a, 0xa6c3, 0xa5c3, 0x001a, 0x001a, 0x7cc5, 0xd4a5, 0x73cd, 0x001a, 0x001a, 0xa8b2, 0xd9e2, 0xc3ba, 0x001a, 0x001a, 0x6fcb, 0x70cb, 0x001a, 0x001a, 0x74cd, 0xb8aa, 0xb9aa, 0x001a, 0x001a, 0xb7aa, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfac, 0xd0ac, 0xcdac, 0xceac, 0x001a, 0xdccf, 0x001a, 0x001a, 0xddcf, 0xccac, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3d2, 0x001a, 0x68af, 0x69af, 0x001a, 0xabb2, 0xc9d2, 0x001a, 0x6eaf, 0x6caf, 0xcad2, 0xc5d2, 0x6baf, 0x6aaf, 0x65af, 0xc8d2, 0xc7d2, 0xc4d2, 0x6daf, 0x001a, 0xc6d2, 0x66af, 0x001a, 0x67af, 0x001a, 0x001a, 0xacb2, 0xa1d6, 0xa2d6, 0xadb2, 0x7cd6, 0x7ed6, 0xa4d6, 0xa3d6, 0x7dd6, 0x001a, 0xa9b2, 0xaab2, 0x001a, 0xb6da, 0x6bb5, 0x6ab5, 0xb0da, 0x68b5, 0x001a, 0xb3da, 0x6cb5, 0xb4da, 0x6db5, 0xb1da, 0x67b5, 0x69b5, 0xb5da, 0x001a, 0xb2da, 0xafda, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2de, 0x001a, 0xc7de, 0xf0b7, 0xf3b7, 0xf2b7, 0xf7b7, 0xf6b7, 0xd3de, 0xd1de, 0xcade, 0xcede, 0xcdde, 0xf4b7, 0xd0de, 0xccde, 0xd4de, 0xcbde, 0xf5b7, 0xefb7, 0xf1b7, 0x001a, 0xc9de, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbe2, 0xc7ba, 0xdfe2, 0xc6ba, 0xdce2, 0xc5ba, 0x001a, 0xc8de, 0xcfde, 0xdee2, 0x001a, 0xc8ba, 0xe0e2, 0xdde2, 0xdae2, 0x001a, 0x001a, 0xb1e6, 0xb5e6, 0xb7e6, 0xb3e6, 0xb2e6, 0xb0e6, 0x45bd, 0x43bd, 0x48bd, 0x49bd, 0xb4e6, 0x46bd, 0xafe6, 0x47bd, 0xc4ba, 0xb6e6, 0x44bd, 0x001a, 0x001a, 0x001a, 0x6cea, 0x001a, 0x6bea, 0x73ea, 0x6dea, 0x72ea, 0x6fea, 0x60bf, 0x71ea, 0x001a, 0x001a, 0x61bf, 0x001a, 0x62bf, 0x001a, 0x70ea, 0x6eea, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8c0, 0x74ed, 0x001a, 0x001a, 0xf7c0, 0x77ed, 0x75ed, 0x76ed, 0x001a, 0x001a, 0xf9c0, 0x001a, 0x001a, 0x001a, 0x4df0, 0x001a, 0xa1c2, 0x4ef0, 0x001a, 0x001a, 0x7dc2, 0x4ff0, 0x7ec2, 0x4cf0, 0x50f0, 0x001a, 0x4af0, 0x001a, 0x001a, 0xa7c3, 0x78f2, 0xa8c3, 0x6fc4, 0x001a, 0x4bf0, 0x70c4, 0x001a, 0x001a, 0x001a, 0xeec4, 0xdff5, 0x001a, 0x7ec5, 0xf4f6, 0x7dc5, 0x001a, 0xeaf7, 0xf5c5, 0xf6c5, 0x001a, 0x001a, 0xccf9, 0x001a, 0x001a, 0xd1ac, 0xdecf, 0x001a, 0x6eb5, 0x6fb5, 0xd5a5, 0xcaa6, 0x47ca, 0x001a, 0x71cb, 0x6da8, 0x001a, 0xbaaa, 0x001a, 0xd2ac, 0xd3ac, 0xd4ac, 0xa6d6, 0xcbd2, 0x6faf, 0x001a, 0x001a, 0xaeb2, 0xa5d6, 0x001a, 0x001a, 0xb8da, 0x71b5, 0x001a, 0xb7da, 0x70b5, 0x001a, 0x001a, 0xd5de, 0x4abd, 0xbbe6, 0xb8e6, 0xb9e6, 0xbae6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x78ed, 0x001a, 0x51f0, 0x001a, 0x001a, 0x001a, 0x71f4, 0x70f4, 0x001a, 0xf5f6, 0xd6a5, 0x75cd, 0x70af, 0x001a, 0x001a, 0x001a, 0x72b5, 0xd6de, 0x001a, 0x001a, 0xe1e2, 0x001a, 0x4bbd, 0x74ea, 0x001a, 0x52f0, 0x72f4, 0xd7a5, 0x001a, 0x001a, 0xbbaa, 0xd7ac, 0xdfcf, 0xd8ac, 0xd6ac, 0x001a, 0xd5ac, 0xccd2, 0x71af, 0x001a, 0x001a, 0x72af, 0x73af, 0x001a, 0x001a, 0x001a, 0xb0b2, 0xa7d6, 0xafb2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9da, 0xb1b2, 0x73b5, 0xd7de, 0xf8b7, 0xf9b7, 0x001a, 0xc9ba, 0x001a, 0xcaba, 0x4cbd, 0x64bf, 0x75ea, 0x63bf, 0x001a, 0x79ed, 0xfac0, 0x001a, 0x53f0, 0x73f4, 0xd8a5, 0x6ea8, 0x78cd, 0x77cd, 0xbcaa, 0x76cd, 0xbdaa, 0x79cd, 0x001a, 0xe5cf, 0xdbac, 0xdaac, 0xe7cf, 0xe6cf, 0xdfac, 0x001a, 0xdeac, 0x001a, 0x001a, 0xd9ac, 0x001a, 0xe1cf, 0xe2cf, 0xe3cf, 0x001a, 0xe0ac, 0xe0cf, 0xdcac, 0xe4cf, 0xddac, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfd2, 0xd3d2, 0xd1d2, 0xd0d2, 0x001a, 0xd4d2, 0x001a, 0x001a, 0x001a, 0xd5d2, 0xd6d2, 0xced2, 0x001a, 0xcdd2, 0x001a, 0x75af, 0x76af, 0x001a, 0xd7d2, 0xd2d2, 0x001a, 0xb0d6, 0x001a, 0xd8d2, 0x77af, 0x74af, 0x001a, 0x001a, 0x001a, 0xaad6, 0x001a, 0xa9d6, 0x001a, 0xabd6, 0xacd6, 0xaed6, 0xadd6, 0xb2d6, 0xb5b2, 0xb2b2, 0xb6b2, 0xa8d6, 0xb7b2, 0xb1d6, 0xb4b2, 0xafd6, 0xb3b2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcda, 0xbeda, 0xbada, 0xbbda, 0x001a, 0x001a, 0xbfda, 0xc1da, 0xc2da, 0xbdda, 0xc0da, 0x74b5, 0x001a, 0x001a, 0xdbde, 0x001a, 0xe0de, 0xd8de, 0xdcde, 0x001a, 0x001a, 0xe1de, 0xddde, 0xfab7, 0x43b8, 0x001a, 0xfdb7, 0xd9de, 0xdade, 0xceba, 0x46b8, 0xfeb7, 0x001a, 0x44b8, 0xfcb7, 0xdfde, 0x45b8, 0xdede, 0x41b8, 0xfbb7, 0x42b8, 0xe2de, 0xe6e2, 0xe8e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x40b8, 0x001a, 0x001a, 0xe3e2, 0xccba, 0xe9e2, 0xcdba, 0xe7e2, 0xe2e2, 0xe5e2, 0xeae2, 0xcbba, 0xe4e2, 0x001a, 0x4ebd, 0xbfe6, 0xbee6, 0x001a, 0x51bd, 0x4fbd, 0xbce6, 0x4dbd, 0xbde6, 0x001a, 0x50bd, 0x001a, 0x001a, 0x001a, 0x7dea, 0x001a, 0xa1ea, 0x001a, 0x7eea, 0x76ea, 0x7aea, 0x79ea, 0x77ea, 0x66bf, 0x67bf, 0x65bf, 0x78ea, 0x7bea, 0x7cea, 0x001a, 0x68bf, 0x001a, 0x40c1, 0xa3ed, 0x001a, 0xfcc0, 0x7bed, 0xfec0, 0x41c1, 0x001a, 0x001a, 0xfdc0, 0xa2ed, 0x7ced, 0xfbc0, 0xa1ed, 0x7aed, 0x7eed, 0x7ded, 0x001a, 0x001a, 0x55f0, 0xa4c2, 0xa5c2, 0xa2c2, 0x001a, 0xa3c2, 0x001a, 0x001a, 0x54f0, 0x001a, 0x7bf2, 0x001a, 0x001a, 0xa9c3, 0x001a, 0x79f2, 0x7af2, 0x001a, 0x74f4, 0x77f4, 0x75f4, 0x76f4, 0xe0f5, 0x001a, 0x001a, 0xefc4, 0xebf7, 0xb4f8, 0x001a, 0xf7c5, 0xf8f8, 0xf9f8, 0x66c6, 0xd9a5, 0xe1ac, 0x001a, 0xc3da, 0x001a, 0xe3de, 0x001a, 0xdaa5, 0x6fa8, 0x001a, 0xbeaa, 0x001a, 0xe8cf, 0xe9cf, 0x78af, 0x001a, 0x001a, 0xc4da, 0x75b5, 0x47b8, 0x42c1, 0xa4ed, 0x7cf2, 0x78f4, 0xdba5, 0x001a, 0x001a, 0x001a, 0xa1cd, 0x7acd, 0x7ccd, 0x7ecd, 0x7dcd, 0x7bcd, 0xbfaa, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2ac, 0xf2cf, 0x001a, 0xedcf, 0xeacf, 0x001a, 0x001a, 0xf1cf, 0x001a, 0x001a, 0xe4ac, 0xe5ac, 0xf0cf, 0xefcf, 0xeecf, 0xebcf, 0xeccf, 0xf3cf, 0xe3ac, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7caf, 0x001a, 0xa4af, 0xa3af, 0xe1d2, 0xdbd2, 0xd9d2, 0x001a, 0xa1af, 0xb9d6, 0x7aaf, 0xded2, 0xe2d2, 0xe4d2, 0xe0d2, 0xdad2, 0xa2af, 0xdfd2, 0xddd2, 0x79af, 0xe5d2, 0xa5af, 0xe3d2, 0x7daf, 0xdcd2, 0x001a, 0x7eaf, 0x7baf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9b2, 0x001a, 0xbad6, 0x001a, 0x001a, 0xb3d6, 0xb5d6, 0xb7d6, 0x001a, 0xb8d6, 0xb6d6, 0xbab2, 0x001a, 0xbbd6, 0x001a, 0xb4d6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8da, 0x76b5, 0xd0da, 0x001a, 0xc5da, 0x001a, 0xd1da, 0x001a, 0xc6da, 0xc7da, 0x001a, 0x001a, 0xcfda, 0xceda, 0xcbda, 0xb8b2, 0x77b5, 0xc9da, 0xccda, 0x78b5, 0xcdda, 0xcada, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeede, 0x001a, 0xf2de, 0x4eb8, 0x001a, 0xf0e2, 0x51b8, 0xf0de, 0xd6f9, 0x001a, 0xedde, 0xe8de, 0xeade, 0xebde, 0xe4de, 0x001a, 0x4db8, 0x001a, 0x001a, 0x4cb8, 0x001a, 0x48b8, 0xe7de, 0x001a, 0x4fb8, 0x001a, 0x50b8, 0xe6de, 0xe9de, 0xf1de, 0x4ab8, 0x4bb8, 0xefde, 0xe5de, 0x001a, 0x001a, 0x001a, 0xf2e2, 0xd0ba, 0xf4e2, 0xecde, 0xf6e2, 0xd4ba, 0xf7e2, 0xf3e2, 0x001a, 0xd1ba, 0xefe2, 0xd3ba, 0xece2, 0xf1e2, 0xf5e2, 0xeee2, 0x001a, 0x001a, 0x49b8, 0x001a, 0xebe2, 0xd2ba, 0xede2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x54bd, 0xc1e6, 0x58bd, 0x001a, 0x56bd, 0x001a, 0x001a, 0xcfba, 0x001a, 0xc8e6, 0xc9e6, 0x53bd, 0x001a, 0x001a, 0xc7e6, 0xcae6, 0x55bd, 0x52bd, 0xc3e6, 0xc0e6, 0xc5e6, 0xc2e6, 0x59bd, 0xc4e6, 0x001a, 0x001a, 0xc6e6, 0x57bd, 0x001a, 0x001a, 0x001a, 0x001a, 0x6abf, 0xa8ea, 0x001a, 0xa2ea, 0xa6ea, 0xacea, 0xadea, 0xa9ea, 0xaaea, 0xa7ea, 0x001a, 0xa4ea, 0x001a, 0x6cbf, 0x69bf, 0xa3ea, 0xa5ea, 0x001a, 0x6bbf, 0xabea, 0x001a, 0x46c1, 0x001a, 0x001a, 0xaaed, 0xa5ed, 0x45c1, 0x001a, 0x001a, 0x43c1, 0x001a, 0xaced, 0x44c1, 0xa8ed, 0xa9ed, 0xa6ed, 0xaded, 0x56f0, 0x001a, 0x47c1, 0xa7ed, 0x001a, 0xaeed, 0xabed, 0x001a, 0x001a, 0x001a, 0x5af0, 0x001a, 0x001a, 0x57f0, 0x001a, 0xa6c2, 0x001a, 0x5bf0, 0x5df0, 0x5cf0, 0x58f0, 0x59f0, 0x001a, 0x001a, 0xa3f2, 0x001a, 0xaac3, 0x001a, 0x7ef2, 0xa2f2, 0x7df2, 0xa4f2, 0x001a, 0x001a, 0xa1f2, 0x001a, 0x7af4, 0x7df4, 0x79f4, 0x71c4, 0x7bf4, 0x7cf4, 0x7ef4, 0x72c4, 0x74c4, 0x73c4, 0xe1f5, 0x001a, 0xe3f5, 0x001a, 0xe2f5, 0x001a, 0x001a, 0x001a, 0xf6f6, 0x001a, 0x001a, 0xb5f8, 0xfaf8, 0xdca5, 0x001a, 0x001a, 0x72cb, 0xc0aa, 0xa3cd, 0xc1aa, 0xc2aa, 0xa2cd, 0x001a, 0xf8cf, 0xf7cf, 0xe6ac, 0xe9ac, 0xe8ac, 0xe7ac, 0xf4cf, 0xf6cf, 0xf5cf, 0x001a, 0x001a, 0xe8d2, 0xa7af, 0xecd2, 0xebd2, 0xead2, 0xe6d2, 0xa6af, 0xaaaf, 0xadaf, 0x001a, 0x001a, 0xaeaf, 0xe7d2, 0xe9d2, 0xacaf, 0xabaf, 0xa9af, 0xa8af, 0xc2d6, 0x001a, 0xc0d6, 0xbcd6, 0xbbb2, 0x001a, 0xbdd6, 0xbcb2, 0xbed6, 0xbfd6, 0xc1d6, 0x001a, 0xbdb2, 0x001a, 0x001a, 0xd5da, 0x001a, 0xd4da, 0xd3da, 0xd2da, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6de, 0x52b8, 0x001a, 0xf3de, 0xf5de, 0x001a, 0x53b8, 0x001a, 0x54b8, 0xf4de, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41e3, 0x001a, 0xf9e2, 0xfae2, 0x001a, 0xd7ba, 0xd5ba, 0xd6ba, 0x43e3, 0x001a, 0x42e3, 0xfee2, 0xfde2, 0xfce2, 0xfbe2, 0x40e3, 0xf8e2, 0x001a, 0xcbe6, 0xd0e6, 0xcee6, 0x001a, 0x001a, 0x001a, 0xcde6, 0xcce6, 0xcfe6, 0x001a, 0xaeea, 0x001a, 0x6dbf, 0x48c1, 0xb0ed, 0x001a, 0x49c1, 0xafed, 0x5ff0, 0x5ef0, 0xa7c2, 0x001a, 0xa5f2, 0xabc3, 0xa1f4, 0xa1c5, 0xf7f6, 0x001a, 0xb7f8, 0xb6f8, 0xa8c9, 0xeaac, 0xebac, 0xc3d6, 0x001a, 0x56b8, 0xdda5, 0x72a8, 0x71a8, 0x70a8, 0x001a, 0x001a, 0x001a, 0xa4cd, 0x001a, 0x001a, 0xc4aa, 0xc3aa, 0x001a, 0xeeac, 0x001a, 0xfacf, 0xfdcf, 0xfbcf, 0x001a, 0xecac, 0xedac, 0x001a, 0x001a, 0xf9cf, 0xfccf, 0x001a, 0xb5af, 0x001a, 0x001a, 0x001a, 0xf3d2, 0xf5d2, 0xf4d2, 0xb2af, 0xefd2, 0x001a, 0x001a, 0xb0af, 0xafaf, 0x001a, 0xb3af, 0xb1af, 0x001a, 0xb4af, 0xf2d2, 0xedd2, 0xeed2, 0xf1d2, 0xf0d2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6d6, 0xc7d6, 0xc5d6, 0x001a, 0xc4d6, 0xbeb2, 0x001a, 0x001a, 0x001a, 0x001a, 0x7db5, 0x001a, 0xd6da, 0xd8da, 0xdada, 0x7cb5, 0x001a, 0x001a, 0x7ab5, 0x001a, 0xd7da, 0x7bb5, 0xd9da, 0x79b5, 0x001a, 0x001a, 0x41df, 0xf7de, 0xfade, 0xfede, 0x5ab8, 0xfcde, 0x001a, 0xfbde, 0xf8de, 0xf9de, 0x58b8, 0x40df, 0x57b8, 0x001a, 0x5cb8, 0x5bb8, 0x59b8, 0x001a, 0xfdde, 0x001a, 0x001a, 0x001a, 0x49e3, 0x001a, 0x48e3, 0x001a, 0x001a, 0x44e3, 0x001a, 0x001a, 0xd8ba, 0x47e3, 0x46e3, 0xd9ba, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ebd, 0x001a, 0xd2e6, 0x001a, 0x5fbd, 0x5bbd, 0x5dbd, 0x001a, 0x5abd, 0x5cbd, 0x001a, 0x001a, 0x001a, 0xafea, 0x001a, 0x70bf, 0xb1ea, 0xb0ea, 0x001a, 0x45e3, 0x72bf, 0x71bf, 0x6ebf, 0x6fbf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5ed, 0x001a, 0xb3ed, 0x4ac1, 0xb4ed, 0x001a, 0xb6ed, 0xb2ed, 0xb1ed, 0x001a, 0x001a, 0x60f0, 0xaac2, 0xa8c2, 0xa9c2, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6f2, 0xa7f2, 0xadc3, 0x001a, 0xacc3, 0xa3f4, 0xa4f4, 0xa2f4, 0x001a, 0xf8f6, 0xf9f6, 0x001a, 0x001a, 0xdea5, 0x48ca, 0x73a8, 0x001a, 0xa5cd, 0xc6aa, 0xc5aa, 0xa6cd, 0x001a, 0x001a, 0x40d0, 0xefac, 0xfecf, 0xf0ac, 0x001a, 0x001a, 0xb6af, 0xf8d2, 0xf6d2, 0xfcd2, 0xb7af, 0xf7d2, 0xfbd2, 0xf9d2, 0xfad2, 0x001a, 0x001a, 0xc8d6, 0xcad6, 0x001a, 0xbfb2, 0x001a, 0xc9d6, 0xc0b2, 0xa2b5, 0xa1b5, 0x7eb5, 0xdbda, 0x001a, 0x001a, 0x001a, 0x001a, 0x44df, 0x5db8, 0x5eb8, 0x001a, 0x43df, 0x42df, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ae3, 0xdbba, 0xdaba, 0x4be3, 0x4ce3, 0x001a, 0x61bd, 0x60bd, 0x001a, 0xb5ea, 0xd3e6, 0xd5e6, 0xd4e6, 0xb4ea, 0xb2ea, 0xb6ea, 0xb3ea, 0x001a, 0x73bf, 0x001a, 0x001a, 0x001a, 0xb7ed, 0x4bc1, 0xb8ed, 0xb9ed, 0x001a, 0x001a, 0xabc2, 0xacc2, 0x001a, 0x75c4, 0x001a, 0x001a, 0xd1c5, 0xdfa5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfdd2, 0xb8af, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbab3, 0xb9b3, 0x001a, 0x001a, 0xa4b5, 0xddda, 0xa3b5, 0xdcda, 0x001a, 0x001a, 0x001a, 0x001a, 0x45df, 0x001a, 0xdcba, 0x4de3, 0xddba, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x76c4, 0xa5f4, 0x001a, 0xcba6, 0xc7aa, 0xa7cd, 0x001a, 0xf2ac, 0x001a, 0xf1ac, 0x42d0, 0x43d0, 0x001a, 0x001a, 0x40d3, 0x42d3, 0xb9af, 0x001a, 0x44d3, 0x47d3, 0x45d3, 0x001a, 0x001a, 0x001a, 0x46d3, 0x43d3, 0xfed2, 0xbaaf, 0x48d3, 0x41d3, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3d6, 0xc6b2, 0xdcd6, 0xc3b2, 0x001a, 0xd5d6, 0xc7b2, 0x001a, 0xc1b2, 0x001a, 0xd0d6, 0xddd6, 0xd1d6, 0xced6, 0xc5b2, 0x001a, 0xc2b2, 0x001a, 0xd4d6, 0xd7d6, 0xc4b2, 0xd8d6, 0xc8b2, 0xd9d6, 0xcfd6, 0xd6d6, 0xdad6, 0xd2d6, 0xcdd6, 0xcbd6, 0x001a, 0x001a, 0xdbd6, 0x001a, 0x001a, 0xdfda, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4da, 0x001a, 0x001a, 0x001a, 0xe0da, 0xe6da, 0xa7b5, 0xccd6, 0xe1da, 0xa5b5, 0xdeda, 0xacb5, 0xe2da, 0xabb5, 0xe3da, 0xadb5, 0xa8b5, 0xaeb5, 0xa9b5, 0x001a, 0xaab5, 0x001a, 0xa6b5, 0x001a, 0xe5da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x61b8, 0x50df, 0x001a, 0x53df, 0x47df, 0x4cdf, 0x46df, 0x63b8, 0x001a, 0x4adf, 0x001a, 0x001a, 0x001a, 0x48df, 0x62b8, 0x001a, 0x4fdf, 0x4edf, 0x4bdf, 0x4ddf, 0x49df, 0xe1ba, 0x52df, 0x5fb8, 0x51df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5de3, 0x001a, 0xe8ba, 0x58e3, 0x001a, 0xe7ba, 0x4ee3, 0x001a, 0x50e3, 0xe0ba, 0x55e3, 0x54e3, 0x57e3, 0xe5ba, 0x52e3, 0x51e3, 0x001a, 0x001a, 0xe4ba, 0xdfba, 0x53e3, 0xe2ba, 0x59e3, 0x5be3, 0x001a, 0x56e3, 0x4fe3, 0xe3ba, 0x001a, 0x001a, 0x69bd, 0xdeba, 0x001a, 0x001a, 0x5ce3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e6, 0x62bd, 0x001a, 0xdbe6, 0x001a, 0x63bd, 0x001a, 0x001a, 0x65bd, 0xdee6, 0x001a, 0xd6e6, 0xe6ba, 0xdce6, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e6, 0x001a, 0x60b8, 0x68bd, 0x001a, 0x001a, 0x64bd, 0x001a, 0x66bd, 0x67bd, 0x001a, 0x76bf, 0xdde6, 0xd7e6, 0x6abd, 0x001a, 0xdae6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0ea, 0xbbea, 0x001a, 0x001a, 0xc5ea, 0x74bf, 0xbdea, 0x78bf, 0xc3ea, 0xbaea, 0xb7ea, 0xc6ea, 0x51c1, 0x79bf, 0xc2ea, 0xb8ea, 0x77bf, 0xbcea, 0x7bbf, 0xb9ea, 0xbeea, 0x7abf, 0xc1ea, 0xc4ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbed, 0xcced, 0xbced, 0xc3ed, 0xc1ed, 0x001a, 0x001a, 0x4fc1, 0xc8ed, 0xbfea, 0x001a, 0xbfed, 0x001a, 0xc9ed, 0x4ec1, 0xbeed, 0xbded, 0xc7ed, 0xc4ed, 0xc6ed, 0x001a, 0xbaed, 0xcaed, 0x4cc1, 0x001a, 0xc5ed, 0xceed, 0xc2ed, 0x50c1, 0x4dc1, 0xc0ed, 0xbbed, 0xcded, 0x75bf, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x63f0, 0x001a, 0x001a, 0x61f0, 0x67f0, 0xb0c2, 0x65f0, 0x64f0, 0xb2c2, 0x6af0, 0xb1c2, 0x001a, 0x6bf0, 0x68f0, 0xaec2, 0x69f0, 0x62f0, 0xafc2, 0xadc2, 0xabf2, 0x66f0, 0x001a, 0x001a, 0x6cf0, 0x001a, 0x001a, 0xa8f2, 0x001a, 0x001a, 0x001a, 0xb2c3, 0xb0c3, 0xaaf2, 0x001a, 0xacf2, 0xa9f2, 0xb1c3, 0xaec3, 0xafc3, 0xb3c3, 0x001a, 0x001a, 0x78c4, 0x001a, 0xaaf4, 0x001a, 0xa9f4, 0xa7f4, 0xa6f4, 0xa8f4, 0x001a, 0x77c4, 0x79c4, 0x001a, 0x001a, 0xf0c4, 0x001a, 0x001a, 0xe5f5, 0xe4f5, 0x001a, 0x001a, 0xfaf6, 0x001a, 0xfcf6, 0xfef6, 0xfdf6, 0xfbf6, 0x001a, 0x001a, 0xa3c5, 0xa2c5, 0x001a, 0x001a, 0xd3c5, 0xd2c5, 0xd4c5, 0xedf7, 0xecf7, 0x001a, 0xfbf8, 0xb8f8, 0xfcf8, 0x58c6, 0x001a, 0x59c6, 0x6df9, 0x001a, 0x001a, 0x7ec6, 0xcca6, 0x001a, 0xa8cd, 0x001a, 0x001a, 0x45d0, 0x46d0, 0x44d0, 0x001a, 0x001a, 0xf3ac, 0x001a, 0x47d0, 0x48d0, 0x49d0, 0x001a, 0x001a, 0x49d3, 0x4fd3, 0x001a, 0x001a, 0x4dd3, 0xbbaf, 0x4bd3, 0x001a, 0x4cd3, 0x4ed3, 0x001a, 0x001a, 0x001a, 0x4ad3, 0xc9b2, 0x001a, 0xded6, 0xcbb2, 0xe0d6, 0xcab2, 0xdfd6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8da, 0xafb5, 0x001a, 0xeada, 0xe7da, 0xe1d6, 0x001a, 0xb0b5, 0x001a, 0xdbf9, 0xe9da, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56df, 0x001a, 0x64b8, 0x54df, 0x65b8, 0x55df, 0x66b8, 0x001a, 0x001a, 0x001a, 0xe9ba, 0x61e3, 0x5ee3, 0x60e3, 0xeaba, 0xebba, 0x5fe3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfe6, 0x001a, 0x001a, 0xe0e6, 0x001a, 0x6bbd, 0xe2e6, 0xe1e6, 0x001a, 0x61a2, 0x001a, 0xcaea, 0xcbea, 0xc7ea, 0x001a, 0xc8ea, 0x7cbf, 0x7dbf, 0xc9ea, 0x001a, 0x57c1, 0x001a, 0x001a, 0x53c1, 0x58c1, 0x54c1, 0x56c1, 0x52c1, 0x001a, 0x55c1, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3c2, 0xcfed, 0x001a, 0xaef2, 0x001a, 0xadf2, 0x001a, 0xabf4, 0x7ac4, 0x7bc4, 0x41f7, 0xe6f5, 0x001a, 0x40f7, 0x001a, 0xfdf8, 0xa4f9, 0xcda6, 0x001a, 0x001a, 0x74a8, 0x001a, 0xa9cd, 0xc8aa, 0x001a, 0xf6ac, 0x4cd0, 0xf4ac, 0x4ad0, 0xf9ac, 0xf5ac, 0xfaac, 0xf8ac, 0x4bd0, 0xf7ac, 0xbfaf, 0xbeaf, 0x5ad3, 0xc7af, 0x53d3, 0x59d3, 0xc3af, 0x52d3, 0x58d3, 0x56d3, 0xc2af, 0xc4af, 0x55d3, 0xbdaf, 0x54d3, 0xc8af, 0xc5af, 0xc9af, 0xc6af, 0x51d3, 0x50d3, 0x57d3, 0xc0af, 0xbcaf, 0xc1af, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0d6, 0xe9d6, 0x001a, 0xb5b5, 0xe8d6, 0x001a, 0xcfb2, 0xd6b2, 0xd3b2, 0xd9b2, 0xd8b2, 0xd4b2, 0x001a, 0xe2d6, 0xe5d6, 0x001a, 0xe4d6, 0xd0b2, 0xe6d6, 0xefd6, 0xd1b2, 0xe3d6, 0xecd6, 0xedd6, 0xd2b2, 0xead6, 0xd7b2, 0xcdb2, 0xd5b2, 0xe7d6, 0xccb2, 0xebd6, 0x001a, 0x001a, 0xeed6, 0x001a, 0x001a, 0x001a, 0xfbda, 0xf2da, 0xb2b5, 0xf9da, 0xf6da, 0xeeda, 0xf7da, 0xb4b5, 0xefda, 0x001a, 0xebda, 0x001a, 0x001a, 0x6cb8, 0xf4da, 0x001a, 0xb1b5, 0xfada, 0x001a, 0xb8b5, 0xbab5, 0xedda, 0x001a, 0x001a, 0xb9b5, 0xf0da, 0xb3b5, 0xf8da, 0xf1da, 0xf5da, 0x001a, 0xf3da, 0xb6b5, 0xecda, 0xbbb5, 0xceb2, 0xb7b5, 0xbcb5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x68b8, 0x5ddf, 0x5fdf, 0x61df, 0x65df, 0x001a, 0x5bdf, 0x59df, 0x6ab8, 0x001a, 0x60df, 0x64df, 0x5cdf, 0x58df, 0x001a, 0x57df, 0x001a, 0x001a, 0x001a, 0x62df, 0x5adf, 0x5edf, 0x6bb8, 0x001a, 0x69b8, 0x66df, 0x67b8, 0x63df, 0x001a, 0x72e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeeba, 0x6ae3, 0x78bd, 0x74e3, 0xf1ba, 0x78e3, 0xf7ba, 0x65e3, 0x001a, 0x001a, 0x75e3, 0x62e3, 0x001a, 0x77e3, 0x66e3, 0x001a, 0xfeba, 0xfbba, 0x76e3, 0x70e3, 0xedba, 0xf5ba, 0xf4ba, 0x001a, 0xf3ba, 0xf9ba, 0x001a, 0x63e3, 0xfaba, 0x71e3, 0xf6ba, 0xecba, 0x73e3, 0xefba, 0xf0ba, 0xf8ba, 0x68e3, 0x67e3, 0x64e3, 0x001a, 0x6ce3, 0x69e3, 0x6de3, 0xfdba, 0x001a, 0x79e3, 0xf2ba, 0x6ee3, 0x6fe3, 0x001a, 0x6be3, 0x001a, 0x001a, 0x001a, 0xfcba, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7e6, 0x70bd, 0x79bd, 0x75bd, 0xe4e6, 0x001a, 0x72bd, 0x76bd, 0xf0e6, 0x6cbd, 0xe8e6, 0x001a, 0x74bd, 0x001a, 0x001a, 0xebe6, 0xe6e6, 0x73bd, 0x77bd, 0xe5e6, 0x001a, 0x71bd, 0x001a, 0xefe6, 0x6ebd, 0xeee6, 0xede6, 0x7abd, 0x72e5, 0x6dbd, 0x001a, 0xece6, 0xe3e6, 0x001a, 0x7bbd, 0xeae6, 0x6fbd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2bf, 0xa7bf, 0x7ebf, 0xd8ea, 0xcfea, 0xdbea, 0xd3ea, 0xd9ea, 0xa8bf, 0xa1bf, 0xccea, 0xd2ea, 0xdcea, 0xd5ea, 0xdaea, 0xceea, 0x001a, 0x001a, 0xd6ea, 0xa3bf, 0xd4ea, 0xa6bf, 0xa5bf, 0xd0ea, 0xd1ea, 0xcdea, 0xd7ea, 0xa4bf, 0xdeea, 0xddea, 0x001a, 0x001a, 0x001a, 0xdaed, 0xd6ed, 0x5fc1, 0x001a, 0xd0ed, 0x59c1, 0x69c1, 0xdced, 0x61c1, 0x5dc1, 0xd3ed, 0x64c1, 0x67c1, 0xdeed, 0x5cc1, 0xd5ed, 0x65c1, 0xe0ed, 0xdded, 0xd1ed, 0x60c1, 0x5ac1, 0x68c1, 0xd8ed, 0x63c1, 0xd2ed, 0x5ec1, 0xdfed, 0x62c1, 0x5bc1, 0xd9ed, 0x66c1, 0xd7ed, 0x001a, 0x001a, 0xdbed, 0x001a, 0x001a, 0x001a, 0x6ef0, 0x74f0, 0xb9c2, 0x77f0, 0xb4c2, 0xb5c2, 0x6ff0, 0x76f0, 0x71f0, 0xbac2, 0xb7c2, 0x001a, 0x6df0, 0x001a, 0xb6c2, 0x73f0, 0x75f0, 0xb8c2, 0x72f0, 0x70f0, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8f2, 0xb7c3, 0xb8c3, 0xb4c3, 0x001a, 0xb5c3, 0x001a, 0xb4f2, 0xb2f2, 0x001a, 0xb6f2, 0xbac3, 0xb7f2, 0xb0f2, 0xaff2, 0xb3f2, 0xb1f2, 0xb6c3, 0xb5f2, 0xacf4, 0x7ec4, 0x7dc4, 0xadf4, 0x001a, 0xaff4, 0xaef4, 0xa1c4, 0x001a, 0x001a, 0x001a, 0xebf5, 0xe8f5, 0xe9f5, 0x001a, 0xe7f5, 0xeaf5, 0xf2c4, 0xecf5, 0x001a, 0xf1c4, 0x001a, 0x42f7, 0x001a, 0xd5c5, 0xd7c5, 0xeef7, 0xd6c5, 0xb9f8, 0x40f9, 0x42f9, 0xfef8, 0x41f9, 0x6cc6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcea6, 0x001a, 0xfbac, 0x6fd2, 0xcaaf, 0x001a, 0x001a, 0xdab2, 0xfcda, 0xfdda, 0x001a, 0x001a, 0x001a, 0xdfea, 0x6ac1, 0xe1ed, 0x001a, 0x001a, 0xbbc2, 0x001a, 0xbaf2, 0xb9f2, 0xa2c4, 0xedf5, 0x001a, 0x43f7, 0xf8c5, 0x49ca, 0x001a, 0x001a, 0xc9aa, 0x75a8, 0x001a, 0x001a, 0x4dd0, 0x001a, 0x001a, 0x60d3, 0x5bd3, 0x5fd3, 0x5dd3, 0xcbaf, 0x5ed3, 0x5cd3, 0x001a, 0xf1d6, 0x001a, 0xfeda, 0x40db, 0x69df, 0x6adf, 0x6eb8, 0x6fb8, 0x68df, 0x6bdf, 0x67df, 0x6db8, 0x001a, 0x40bb, 0x001a, 0x70b8, 0x7ae3, 0x001a, 0x7cbd, 0xf1e6, 0x7dbd, 0x001a, 0xa9bf, 0xe2ea, 0xe0ea, 0xe1ea, 0xe4ed, 0xe3ed, 0xe2ed, 0x001a, 0x001a, 0x001a, 0xbbf2, 0x001a, 0xb9c3, 0xbcf2, 0x44f7, 0xf9c5, 0xbaf8, 0xcfa6, 0xcbaa, 0xcaaa, 0x4fd0, 0xfcac, 0x001a, 0x001a, 0x4ed0, 0x62d3, 0x001a, 0xccaf, 0xf2d6, 0x61d3, 0x001a, 0x001a, 0x001a, 0xdcb2, 0xf5d6, 0xf3d6, 0xf4d6, 0xdbb2, 0x001a, 0x42db, 0x43db, 0x41db, 0x001a, 0x73b8, 0x6ddf, 0x6cdf, 0x6edf, 0x72b8, 0x71b8, 0x001a, 0x001a, 0xf2e6, 0xf4e6, 0x001a, 0x7ebd, 0xf3e6, 0xe3ea, 0xaabf, 0x79f0, 0x001a, 0x78f0, 0xbbc3, 0xbdf2, 0xbdc3, 0xbcc3, 0xb0f4, 0xeef5, 0xf3c4, 0xd0a6, 0x50d0, 0xfdac, 0x65d3, 0xceaf, 0x64d3, 0x63d3, 0x001a, 0xcdaf, 0x001a, 0xfbd6, 0x001a, 0xfdd6, 0xf6d6, 0xf7d6, 0xddb2, 0xf8d6, 0xdeb2, 0xfcd6, 0xf9d6, 0xfad6, 0xdfb2, 0x001a, 0xbeb5, 0xbfb5, 0x001a, 0x44db, 0x001a, 0x001a, 0x001a, 0x6fdf, 0x70df, 0x001a, 0x7ee3, 0x43bb, 0x41bb, 0x42bb, 0x7be3, 0x7ce3, 0x001a, 0x7de3, 0xf9e6, 0x001a, 0xfae6, 0xa1bd, 0xf7e6, 0xf6e6, 0xf8e6, 0xf5e6, 0xadbf, 0xe4ea, 0xabbf, 0xacbf, 0xe6ed, 0x6bc1, 0xe5ed, 0xa8ef, 0x001a, 0x7af0, 0x7bf0, 0xbcc2, 0x001a, 0xbdc2, 0x6cc1, 0xbef2, 0xbff2, 0xb1f4, 0xa3c4, 0xd1a6, 0x001a, 0xd2a6, 0xfeac, 0xccaa, 0xcfaf, 0x51d0, 0x001a, 0x001a, 0x001a, 0xc0b5, 0xd3a6, 0x41ad, 0x52d0, 0x53d0, 0x40ad, 0x42ad, 0xd4a6, 0x001a, 0x54d0, 0xd1af, 0x66d3, 0xd3af, 0xd0af, 0xd2af, 0x001a, 0x41d7, 0xe0b2, 0x001a, 0x40d7, 0xfed6, 0x001a, 0x71df, 0x001a, 0x001a, 0xa1e3, 0x001a, 0xa2bd, 0x001a, 0xaebf, 0xe6ea, 0xe5ea, 0x001a, 0xe7ed, 0x001a, 0x001a, 0x001a, 0xeff5, 0x001a, 0x001a, 0xd5a6, 0x73cb, 0xaacd, 0x43ad, 0x55d0, 0x001a, 0x68d3, 0x001a, 0x001a, 0x001a, 0xd4af, 0x67d3, 0xd5af, 0x001a, 0x001a, 0x001a, 0x43d7, 0x001a, 0x001a, 0xe2b2, 0x42d7, 0x44d7, 0x001a, 0xe1b2, 0x001a, 0x001a, 0x001a, 0x001a, 0x46db, 0x47db, 0x45db, 0xc1b5, 0x001a, 0x001a, 0x001a, 0x74b8, 0x001a, 0x75b8, 0x001a, 0x45bb, 0x001a, 0xa3e3, 0xa2e3, 0x44bb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe6, 0x001a, 0x001a, 0xfce6, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7ea, 0x001a, 0x001a, 0x70c1, 0x6fc1, 0x6dc1, 0x6ec1, 0x71c1, 0x001a, 0x7cf0, 0xbfc2, 0xbec2, 0xc0f2, 0xb2f4, 0x001a, 0x001a, 0x001a, 0xa5c5, 0xa4c5, 0xd6a6, 0x001a, 0x001a, 0xfbd1, 0x001a, 0x77b8, 0xc2b5, 0x76b8, 0x46bb, 0x001a, 0xd7a6, 0xa9c9, 0xd8a6, 0xd9a6, 0x001a, 0x001a, 0xabcd, 0x76cb, 0x001a, 0x77cb, 0x77a8, 0x001a, 0x74cb, 0x76a8, 0x001a, 0x79a8, 0x75cb, 0x7ba8, 0x7aa8, 0x78cb, 0x78a8, 0x001a, 0x001a, 0x001a, 0xd1aa, 0xcfaa, 0xadcd, 0x001a, 0xceaa, 0x001a, 0x001a, 0x001a, 0xd3aa, 0xd5aa, 0xd2aa, 0x001a, 0xb0cd, 0xaccd, 0xd6aa, 0x001a, 0xd0aa, 0x7ca8, 0x001a, 0xd4aa, 0xafcd, 0x001a, 0x001a, 0xaecd, 0x001a, 0xcdaa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5bd0, 0x47ad, 0x48ad, 0x5dd0, 0x001a, 0x57d0, 0x5ad0, 0x63d0, 0x61d0, 0x001a, 0x49ad, 0x67d0, 0x4cad, 0x64d0, 0x5cd0, 0x59d0, 0x001a, 0x001a, 0x49db, 0x62d0, 0x44ad, 0x65d0, 0x56d0, 0x5fd0, 0x46ad, 0x4bad, 0x60d0, 0x4fad, 0x4dad, 0x001a, 0x58d0, 0x4aad, 0x001a, 0x5ed0, 0x4ead, 0x45ad, 0x66d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaaf, 0x001a, 0xe3af, 0xd8af, 0xd6af, 0x6ad3, 0xdeaf, 0xdbaf, 0x6cd3, 0x001a, 0x001a, 0xddaf, 0x6bd3, 0x69d3, 0x6ed3, 0xe2af, 0xe0af, 0x48db, 0x001a, 0x6fd3, 0x6dd3, 0xd7af, 0x001a, 0x001a, 0xd9af, 0xdcaf, 0x001a, 0xdfaf, 0x001a, 0xe1af, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ed7, 0xe4b2, 0x001a, 0x45d7, 0x47d7, 0x001a, 0x48d7, 0x001a, 0x50d7, 0x4cd7, 0x4ad7, 0x001a, 0x4dd7, 0x51d7, 0xe5b2, 0xe9b2, 0x46d7, 0x001a, 0x4fd7, 0x001a, 0xe7b2, 0x001a, 0xe6b2, 0x4bd7, 0x49d7, 0x001a, 0xe3b2, 0xe8b2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8b5, 0x51db, 0x001a, 0x001a, 0x4fdb, 0xcab5, 0x001a, 0x001a, 0x001a, 0x001a, 0x4adb, 0xa1df, 0x001a, 0xc9b5, 0x4edb, 0x001a, 0x001a, 0x4bdb, 0xc5b5, 0xcbb5, 0x50db, 0xc7b5, 0x4ddb, 0x47bb, 0xc6b5, 0x4cdb, 0xccb5, 0xc4b5, 0xc3b5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x77df, 0x75df, 0x001a, 0x7bdf, 0x001a, 0x73df, 0xa2df, 0x78df, 0x001a, 0x72df, 0x7bb8, 0xa3b8, 0x7ddf, 0x001a, 0x76df, 0x001a, 0x7eb8, 0x001a, 0x001a, 0x7cb8, 0x7edf, 0x79b8, 0x78b8, 0x79df, 0x7db8, 0xcdb5, 0x001a, 0x7cdf, 0x74df, 0x7ab8, 0xa1b8, 0xa2b8, 0x001a, 0x001a, 0x001a, 0x001a, 0x4cbb, 0x48bb, 0x001a, 0x4dbb, 0xa6e3, 0x001a, 0x001a, 0xa5e3, 0xa7e3, 0x4abb, 0xa4e3, 0x4bbb, 0xaae3, 0xa9e3, 0xa8e3, 0x001a, 0x49bb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41e7, 0x001a, 0x44e7, 0xa8bd, 0x43e7, 0xa7bd, 0xa3bd, 0xa4bd, 0xa5bd, 0x40e7, 0xfee6, 0xa6bd, 0x001a, 0x42e7, 0xfde6, 0x001a, 0x001a, 0xe9ea, 0xf3ea, 0xb1bf, 0xb0bf, 0x001a, 0xedea, 0xefea, 0x001a, 0xeaea, 0x001a, 0xeeea, 0xe8ea, 0xf1ea, 0xafbf, 0xf0ea, 0xecea, 0x001a, 0xf2ea, 0x001a, 0xebea, 0x74c1, 0xe8ed, 0xeeed, 0x78c1, 0x7ac1, 0x77c1, 0x76c1, 0x001a, 0x75c1, 0x73c1, 0xe9ed, 0xeced, 0x72c1, 0xeded, 0x001a, 0x79c1, 0xebed, 0x001a, 0xeaed, 0xc0c2, 0x001a, 0xc1c2, 0xa1f0, 0x7df0, 0x7ef0, 0x001a, 0x001a, 0xc2f2, 0x001a, 0xc1f2, 0xbec3, 0xb4f4, 0xa4c4, 0xb3f4, 0x001a, 0xf0f5, 0x45f7, 0xa6c5, 0x43f9, 0x44f9, 0xd8c5, 0xdaa6, 0x001a, 0xd7aa, 0x52db, 0x4ebb, 0x7bc1, 0xefed, 0xdba6, 0x001a, 0xe5af, 0xe4af, 0x53db, 0x001a, 0x001a, 0x001a, 0xf4ea, 0xdca6, 0x50ad, 0x001a, 0x001a, 0x54db, 0x55db, 0x56db, 0x4fbb, 0xb2bf, 0xdda6, 0x001a, 0xd8aa, 0x68d0, 0xe6af, 0x70d3, 0xeab2, 0x001a, 0x57db, 0xa4b8, 0x001a, 0x50bb, 0xb3bf, 0x7cc1, 0xc2c2, 0xb5f4, 0xdea6, 0xd9aa, 0x001a, 0x001a, 0xe7af, 0x52d7, 0xceb5, 0x001a, 0x51bb, 0xabe3, 0x45e7, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfa6, 0xcfb5, 0xa3df, 0x52bb, 0xe0a6, 0xb1cd, 0x69d0, 0x51ad, 0x001a, 0x001a, 0x72d3, 0x001a, 0x001a, 0xeaaf, 0x001a, 0xe8af, 0xe9af, 0xebaf, 0x001a, 0x001a, 0x71d3, 0x001a, 0x001a, 0x57d7, 0x54d7, 0x56d7, 0xebb2, 0xedb2, 0xecb2, 0x53d7, 0xeeb2, 0x55d7, 0x001a, 0x58db, 0x59db, 0x001a, 0x5adb, 0xa6df, 0x001a, 0xa7df, 0x001a, 0xa5df, 0xa8df, 0x001a, 0xa5b8, 0x001a, 0xa4df, 0x001a, 0x53bb, 0x001a, 0x001a, 0x4ae7, 0x46e7, 0x49e7, 0x4be7, 0x48e7, 0x47e7, 0x001a, 0xf5ea, 0xf6ea, 0xf7ea, 0xb4bf, 0xb5bf, 0xf1ed, 0xf0ed, 0xf2ed, 0x001a, 0xa3f0, 0xa2f0, 0x001a, 0xc4f2, 0x001a, 0xc5f2, 0xc3f2, 0x001a, 0xa5c4, 0x001a, 0xb6f4, 0xb7f4, 0x001a, 0x46f7, 0xeff7, 0xbbf8, 0xe1a6, 0x7da8, 0x001a, 0x7dc1, 0xe2a6, 0x001a, 0x58d7, 0x5bdb, 0x001a, 0x41c6, 0x4aca, 0x001a, 0x001a, 0x001a, 0x4bca, 0x4dca, 0xe3a6, 0x4eca, 0x4cca, 0x001a, 0x001a, 0xa2cb, 0xa3cb, 0x7bcb, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1cb, 0xa1a8, 0x001a, 0xa2a8, 0x7ccb, 0x7acb, 0x79cb, 0x7dcb, 0x7ea8, 0x7ecb, 0x6ad0, 0x001a, 0x001a, 0x001a, 0xb6cd, 0xdcaa, 0xb5cd, 0xb7cd, 0x001a, 0xdbaa, 0xbccd, 0xdfaa, 0xb2cd, 0xc0cd, 0xc6cd, 0xe6aa, 0xc3cd, 0xe3aa, 0x001a, 0xb9cd, 0xbfcd, 0xc1cd, 0x001a, 0xb4cd, 0xe2aa, 0xddaa, 0xbacd, 0xe4aa, 0xe7aa, 0xe1aa, 0x001a, 0xdaaa, 0xbecd, 0xb8cd, 0xc5cd, 0xe9aa, 0xe5aa, 0xe0aa, 0xbdcd, 0xecaf, 0xbbcd, 0xdeaa, 0xe8aa, 0x001a, 0xb3cd, 0x001a, 0xc2cd, 0xc4cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62ad, 0x5cad, 0x64ad, 0x61ad, 0x71d0, 0x74d0, 0x5dad, 0x001a, 0x6bd0, 0x001a, 0x56ad, 0x60ad, 0x001a, 0x63ad, 0x65ad, 0xa2d0, 0x77d0, 0x001a, 0x55ad, 0xa1d0, 0x59ad, 0x57ad, 0x52ad, 0x6fd0, 0x001a, 0x7ed0, 0x73d0, 0x76d0, 0xa5d0, 0x001a, 0x66ad, 0x7dd0, 0x5ead, 0x78d0, 0xa4d0, 0x75d0, 0x79d0, 0x7cd0, 0x001a, 0x001a, 0x6dd0, 0xa3d0, 0x7bd0, 0x001a, 0x001a, 0x6cd0, 0x001a, 0x70d0, 0x5fad, 0x5aad, 0x53ad, 0x58ad, 0x54ad, 0x67ad, 0x6ed0, 0xa5d3, 0x5bad, 0x001a, 0x001a, 0x7ad0, 0x41ce, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8d3, 0xfaaf, 0x001a, 0x76d3, 0x001a, 0xa3d3, 0x7dd3, 0x001a, 0xb2d3, 0x001a, 0xaad3, 0x001a, 0x7ed3, 0x001a, 0xa9d3, 0x78d3, 0x7cd3, 0xb5d3, 0xfdaf, 0xadd3, 0xa4d3, 0xedaf, 0xb3d3, 0x74d3, 0x001a, 0xacd3, 0x001a, 0xfcaf, 0xf7af, 0x73d3, 0xf5af, 0xf4af, 0xf9af, 0xabd3, 0xf1af, 0xf8af, 0x72d0, 0x5cdb, 0xa6d3, 0x001a, 0x001a, 0x7ad3, 0xfbaf, 0x7bd3, 0xa1d3, 0xfeaf, 0x75d3, 0xafd3, 0x001a, 0xaed3, 0xb6d3, 0xf3af, 0xf0af, 0xb4d3, 0xb0d3, 0xa7d3, 0xa2d3, 0xf6af, 0xf2af, 0x77d3, 0xeeaf, 0xb1d3, 0xefaf, 0x001a, 0x79d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ed7, 0x60d7, 0x65d7, 0x79d7, 0xfcb2, 0xf2b2, 0x001a, 0x5dd7, 0xfdb2, 0xfeb2, 0x68d7, 0x6fd7, 0x75d7, 0x001a, 0x62d7, 0x001a, 0x69d7, 0x001a, 0x001a, 0x40b3, 0x77d7, 0x72d7, 0xfab2, 0xf8b2, 0x6ed7, 0x6ad7, 0x5cd7, 0xefb2, 0x61d7, 0x59d7, 0x001a, 0xf7b2, 0xf9b2, 0x66d7, 0x63d7, 0xf4b2, 0x73d7, 0xf1b2, 0x64d7, 0x7ad7, 0x6cd7, 0x001a, 0x6bd7, 0xf0b2, 0x001a, 0xfbb2, 0x001a, 0xf3b2, 0x5ad7, 0x5fd7, 0x70d7, 0x76d7, 0x41b3, 0x5bd7, 0x67d7, 0x6dd7, 0xf6b2, 0x001a, 0x001a, 0x78d7, 0x71d7, 0x74d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5b2, 0x001a, 0x6cdb, 0x60db, 0xd7b5, 0x7ddb, 0xa7db, 0xaadb, 0xd5b5, 0x68db, 0xa3db, 0x69db, 0x77db, 0xe2b5, 0x73db, 0xdfb5, 0x001a, 0x74db, 0x5ddb, 0x001a, 0xa4db, 0x001a, 0x001a, 0xe8b5, 0xa1db, 0x75db, 0xacdb, 0x70db, 0xc8df, 0x001a, 0xafdb, 0xe6b5, 0x6edb, 0x7adb, 0xe9b5, 0xd4b5, 0x72db, 0xaddb, 0x6bdb, 0x64db, 0x6fdb, 0x001a, 0x63db, 0x61db, 0xd0b5, 0xa5db, 0x6adb, 0xa8db, 0x001a, 0xa9db, 0xd8b5, 0xddb5, 0xd9b5, 0xe1b5, 0x7edb, 0xdab5, 0x76db, 0x66db, 0x001a, 0xd2b5, 0x5edb, 0xa2db, 0xabdb, 0x65db, 0xe0b5, 0xb0db, 0x71db, 0x001a, 0x6ddb, 0x001a, 0xd1b5, 0xe5b5, 0x001a, 0x7cdb, 0xe7b5, 0x001a, 0x78db, 0xdcb5, 0xd6b5, 0xdeb5, 0xd3b5, 0xe4b5, 0x79db, 0x67db, 0x7bdb, 0x62db, 0xa6db, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaedb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5fdb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7df, 0x001a, 0xdddf, 0x55b8, 0xccdf, 0x001a, 0xcadf, 0xb5df, 0xa9b8, 0xc5df, 0xd9df, 0xc1df, 0xb1b8, 0xd8df, 0xbfdf, 0xe3b5, 0xcfdf, 0xc0df, 0xd6df, 0xb0b8, 0xa8b8, 0x001a, 0xaadf, 0xb2df, 0x001a, 0xcbdf, 0xc3df, 0xdcdf, 0xc6df, 0xb6b8, 0xd7df, 0x001a, 0xadb8, 0x001a, 0xc9df, 0xd1df, 0xb6df, 0xd0df, 0x001a, 0xe1df, 0xb1df, 0xd2df, 0x001a, 0xdfdf, 0x001a, 0xabdf, 0xdbb5, 0x001a, 0xb9df, 0xb8df, 0xafb8, 0x001a, 0xbcdf, 0xbedf, 0xcddf, 0xdedf, 0xb2b8, 0x001a, 0xb3b8, 0x001a, 0xb0df, 0xabb8, 0xb4df, 0xdadf, 0xb4b8, 0x001a, 0xacb8, 0xaeb8, 0xb5b8, 0xe0df, 0xd3df, 0xcedf, 0x001a, 0x001a, 0xbbdf, 0xbadf, 0xaab8, 0xacdf, 0xa7b8, 0xc4df, 0xaddf, 0xc2df, 0x001a, 0x001a, 0xb7df, 0xdbdf, 0x001a, 0x001a, 0x001a, 0xa6b8, 0x001a, 0x001a, 0x001a, 0xb3df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafdf, 0xd5df, 0xaedf, 0x60bb, 0xd3e3, 0x001a, 0x001a, 0xc2e3, 0x001a, 0x001a, 0xace3, 0xcae3, 0x58bb, 0xbbe3, 0xc5e3, 0x5bbb, 0xbee3, 0x59bb, 0xafe3, 0xcde3, 0xaee3, 0xc1e3, 0x001a, 0xade3, 0x001a, 0x001a, 0xbfe3, 0xc8e3, 0xc6e3, 0xbae3, 0xb5e3, 0xb3e3, 0x001a, 0xb4e3, 0xc7e3, 0xd2e3, 0xbce3, 0x5abb, 0x001a, 0xb7e3, 0x001a, 0xcbe3, 0x001a, 0x5dbb, 0xb6e3, 0xb0e3, 0xc0e3, 0x61bb, 0x001a, 0x001a, 0x55bb, 0x5ebb, 0xb8e3, 0xb2e3, 0x001a, 0x57bb, 0xd4df, 0x56bb, 0xc3e3, 0x001a, 0x54bb, 0x63bb, 0x5cbb, 0xc4e3, 0xb9e3, 0xb1e3, 0xcce3, 0xbde3, 0x62bb, 0xd0e3, 0x5fbb, 0xcfe3, 0x001a, 0xc9e3, 0xcee3, 0x001a, 0x001a, 0x001a, 0xd1e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73e7, 0x74e7, 0x67e7, 0x66e7, 0x62e7, 0xb4bd, 0x001a, 0xacbd, 0x76e7, 0x75e7, 0xa9df, 0x5fe7, 0x63e7, 0x5de7, 0x001a, 0x70e7, 0x61e7, 0x001a, 0x77e7, 0x5ae7, 0x58e7, 0x64e7, 0x6ee7, 0x69e7, 0xb6bd, 0x4fe7, 0x001a, 0x6de7, 0x001a, 0x001a, 0x001a, 0xb7bd, 0xbddf, 0x5be7, 0x52e7, 0x55e7, 0x7be7, 0x5ce7, 0x53e7, 0x51e7, 0x4ee7, 0x001a, 0xb0bd, 0x65e7, 0xafbd, 0xb3bd, 0x60e7, 0x68e7, 0xa9bd, 0x78e7, 0x7ce7, 0xabbd, 0x001a, 0x57e7, 0x6be7, 0x6fe7, 0x54e7, 0x79e7, 0xb2bd, 0x001a, 0xb1bd, 0x4ce7, 0xb5bd, 0x72e7, 0x56e7, 0x6ae7, 0x50e7, 0x5ee7, 0x59e7, 0xadbd, 0xaebd, 0x6ce7, 0x7de7, 0x7ae7, 0x71e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4de7, 0x001a, 0xaabd, 0x49eb, 0x001a, 0x40eb, 0x43eb, 0x001a, 0xbbbf, 0x45eb, 0xf9ea, 0x41eb, 0x47eb, 0xb8bf, 0xbcbf, 0xb6bf, 0x001a, 0x001a, 0xfbea, 0x4ceb, 0x001a, 0x001a, 0x46eb, 0x001a, 0xfcea, 0x55eb, 0x4feb, 0xf8ea, 0x46ee, 0xfeea, 0xb7bf, 0x001a, 0x4aeb, 0x001a, 0x54eb, 0xbfbf, 0x001a, 0x51eb, 0xfdea, 0x44eb, 0x48eb, 0x42eb, 0x56eb, 0x53eb, 0x50eb, 0xb9bf, 0xbabf, 0xbebf, 0xfaea, 0x57eb, 0xbdbf, 0x4deb, 0x001a, 0x001a, 0x4beb, 0x001a, 0x001a, 0x001a, 0x4eeb, 0x53ee, 0x40ee, 0x45ee, 0x52ee, 0x44ee, 0xfbed, 0x41ee, 0x001a, 0xa2c1, 0x001a, 0xf4ed, 0x4dee, 0x4fee, 0xf3ed, 0xa1c1, 0x51ee, 0x49ee, 0xa8c1, 0x50ee, 0x42ee, 0xaac1, 0xf9ed, 0x52eb, 0x4aee, 0x47ee, 0xf5ed, 0x55ee, 0xa4c1, 0x001a, 0x001a, 0xa5c1, 0xf7ed, 0x48ee, 0x001a, 0x54ee, 0x4bee, 0xfded, 0xa7c1, 0xa3c1, 0x4cee, 0xfeed, 0x56ee, 0xf8ed, 0x43ee, 0x4eee, 0xfaed, 0xfced, 0x001a, 0xcbc2, 0xf6ed, 0xa9c1, 0xc4c2, 0x7ec1, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6c1, 0xc8c2, 0xb3f0, 0x001a, 0xa9f0, 0xa4f0, 0xaaf0, 0xb4f0, 0xb8f0, 0xb7f0, 0xcac2, 0xc9c2, 0x001a, 0x001a, 0xabf0, 0xb9f0, 0xaef0, 0xa6f0, 0x001a, 0xa8f0, 0xa7f0, 0xadf0, 0xb2f0, 0xa5f0, 0xacf0, 0xb1f0, 0xc7c2, 0x001a, 0xaff0, 0x001a, 0xc5c2, 0xb0f0, 0xc3c2, 0xc6c2, 0xd5f2, 0xb5f0, 0x001a, 0x001a, 0xc2c3, 0x001a, 0xcdf2, 0xd1f2, 0xc9f2, 0xccf2, 0x001a, 0xd4f2, 0xc0c3, 0xd9f2, 0xd2f2, 0x001a, 0xcaf2, 0xdaf2, 0xd3f2, 0xc3c3, 0xc4c3, 0xd7f2, 0x001a, 0xcbf2, 0xbfc3, 0xc1c3, 0xc6f2, 0xcef2, 0xc8f2, 0x001a, 0xd8f2, 0xd6f2, 0xc7f2, 0xcff2, 0x001a, 0x001a, 0x001a, 0xbef4, 0xc5c3, 0xd0f2, 0xa7c4, 0xa9c4, 0xa6c4, 0x001a, 0xc3f4, 0xbbf4, 0xb9f4, 0xbdf4, 0xbaf4, 0x001a, 0x001a, 0xbff4, 0xc1f4, 0xaac4, 0xacc4, 0x001a, 0xc0f4, 0xadc4, 0xabc4, 0xc2f4, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8c4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4c4, 0xf1f5, 0xf7f5, 0xf6c4, 0xbcf4, 0xf6f5, 0x001a, 0xfdf5, 0xf4f5, 0xfbf5, 0xfaf5, 0xb8f4, 0xf5f5, 0xb6f0, 0xfef5, 0xf3f5, 0xf8f5, 0x001a, 0xfcf5, 0xf2f5, 0x001a, 0x4af7, 0xf5c4, 0xf9f5, 0x001a, 0x001a, 0xf4f7, 0x4bf7, 0x49f7, 0x47f7, 0x48f7, 0x4cf7, 0x001a, 0xd9c5, 0xf2f7, 0xf0f7, 0xf5f7, 0xf3f7, 0x001a, 0xf6f7, 0xdac5, 0xf1f7, 0x001a, 0x001a, 0xbcf8, 0x001a, 0x001a, 0x45f9, 0x46f9, 0x47f9, 0x001a, 0x001a, 0xc7f9, 0xbdf9, 0x4fca, 0xeaaa, 0x001a, 0x68ad, 0x001a, 0xb8d3, 0xb7d3, 0x40b0, 0x42b3, 0x7cd7, 0x001a, 0x001a, 0x7bd7, 0x001a, 0xeab5, 0xb8b8, 0x001a, 0xb7b8, 0xb9b8, 0x001a, 0xd4e3, 0x7ee7, 0x58eb, 0x5aeb, 0x59eb, 0x001a, 0xabc1, 0x57ee, 0xbaf0, 0xa5f9, 0xe4a6, 0x001a, 0xc9cd, 0xcacd, 0xc8cd, 0xc7cd, 0xebaa, 0x001a, 0xa9d0, 0xa7d0, 0x001a, 0x001a, 0xa6d0, 0x001a, 0x69ad, 0x6bad, 0x6aad, 0xa8d0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4d3, 0xc1d3, 0xbfd3, 0x001a, 0x001a, 0x41b0, 0xc2d3, 0x46b0, 0xbcd3, 0xcbd3, 0x001a, 0xcdd3, 0xbdd3, 0x001a, 0x43b0, 0xced3, 0xc9d3, 0xbbd3, 0xc0d3, 0xcad3, 0xc6d3, 0xc3d3, 0x001a, 0x48b0, 0xccd3, 0xbed3, 0x001a, 0x001a, 0xc7d3, 0xb9d3, 0x47b0, 0x44b0, 0xc5d3, 0x001a, 0xc8d3, 0xbad3, 0x45b0, 0x42b0, 0x001a, 0x001a, 0x001a, 0x001a, 0x4cb3, 0xa5d7, 0x4bb3, 0x001a, 0xa8d7, 0xabd7, 0x48b3, 0x46b3, 0x7ed7, 0xa9d7, 0xa7d7, 0xa4d7, 0xacd7, 0xadd7, 0xafd7, 0xb0d7, 0x7dd7, 0x45b3, 0xa2d7, 0xa1d7, 0xaed7, 0x47b3, 0xa3d7, 0x49b3, 0x44b3, 0xa6d7, 0x4db3, 0x001a, 0x4ab3, 0xaad7, 0x001a, 0x001a, 0x001a, 0xf1b5, 0xbfdb, 0x001a, 0xb4db, 0xeeb5, 0x001a, 0xe7df, 0xbddb, 0xb1db, 0xecb5, 0xb6db, 0xefb5, 0xbadb, 0xb8db, 0xf2b5, 0xebb5, 0x001a, 0x001a, 0xb2db, 0xb5db, 0xf0b5, 0x001a, 0xb3db, 0x001a, 0xbedb, 0xbcdb, 0xb7db, 0xb9db, 0xbbdb, 0xedb5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8df, 0xeedf, 0xe4df, 0xeadf, 0xbab8, 0xe6df, 0xc0b8, 0x001a, 0x001a, 0xbfb8, 0x001a, 0xbeb8, 0xeddf, 0xc1b8, 0xc2b8, 0xe3df, 0xf0df, 0xc3b8, 0xbdb8, 0xbcb8, 0xecdf, 0xc4b8, 0xe2df, 0xe5df, 0xefdf, 0xebdf, 0x001a, 0x001a, 0xf4e3, 0xe9e3, 0xbbb8, 0x001a, 0x001a, 0x001a, 0x001a, 0x6abb, 0xdde3, 0xf2e3, 0xdee3, 0x65bb, 0x001a, 0xdbe3, 0x001a, 0xe4e3, 0xdce3, 0x67bb, 0xd6e3, 0xf1e3, 0x68bb, 0xeee3, 0xefe3, 0xd7e3, 0x6dbb, 0xe6e3, 0x001a, 0xe0e3, 0xe7e3, 0xdae3, 0x001a, 0xf3e3, 0xebe3, 0xe5e3, 0xd5e3, 0x69bb, 0xece3, 0x001a, 0x6cbb, 0xf0e3, 0x001a, 0xeae3, 0x66bb, 0xe8e3, 0x001a, 0xe2e3, 0x64bb, 0xd9e3, 0xe1e3, 0xede3, 0xdfe3, 0x001a, 0x001a, 0xe3e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1bd, 0xe9df, 0xb2e7, 0xbbe7, 0xb1e7, 0xade7, 0xaae7, 0xc2bd, 0xa8e7, 0x6bbb, 0xa1e7, 0xc0bd, 0xa7e7, 0xbfbd, 0xace7, 0xa9e7, 0xb9e7, 0xb4e7, 0xaee7, 0xb3e7, 0xbbbd, 0xabe7, 0xbee7, 0xa2e7, 0xa3e7, 0xbae7, 0xbcbd, 0xbfe7, 0xbebd, 0xc0e7, 0xb0e7, 0xd8e3, 0xb6e7, 0xafe7, 0xb8e7, 0xb5e7, 0x001a, 0x001a, 0x001a, 0xa6e7, 0xb9bd, 0xbde7, 0xbabd, 0xa4e7, 0xbdbd, 0x64eb, 0xb7e7, 0xbce7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x61eb, 0xb8bd, 0xc0bf, 0x6beb, 0x67eb, 0x001a, 0x65eb, 0x60eb, 0x6feb, 0x001a, 0x001a, 0x001a, 0xc4bf, 0x001a, 0x5ceb, 0x68eb, 0x69eb, 0x5feb, 0x5eeb, 0x6ceb, 0x001a, 0x62eb, 0x5deb, 0x63eb, 0x001a, 0x6eeb, 0x5beb, 0x6deb, 0x6aeb, 0xc2bf, 0xc1bf, 0x001a, 0x001a, 0xc3bf, 0x66eb, 0xcbf0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x59ee, 0xb1c1, 0x5dee, 0x5aee, 0x61ee, 0x67ee, 0x5cee, 0x001a, 0x70ee, 0xaec1, 0x6aee, 0x5fee, 0x6bee, 0x66ee, 0x6dee, 0x5eee, 0xb3c1, 0xb2c1, 0x60ee, 0x6eee, 0x58ee, 0x6cee, 0xacc1, 0x001a, 0x64ee, 0x63ee, 0x68ee, 0x5bee, 0xb0c1, 0x001a, 0xb4c1, 0x62ee, 0x69ee, 0xb5c1, 0x65ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xadc1, 0xafc1, 0xc7f0, 0xc5f0, 0x001a, 0x001a, 0xccf0, 0xc9f0, 0xcdf0, 0x001a, 0xbef0, 0xc6f0, 0xd1f0, 0x6fee, 0xc2f0, 0xcfc2, 0xa5e7, 0xbdf0, 0xcaf0, 0xc4f0, 0xc1f0, 0xbcf0, 0xbbf0, 0xd0f0, 0x001a, 0xc0f0, 0xbff0, 0xcdc2, 0xc8f0, 0x001a, 0xccc2, 0x001a, 0x001a, 0xcec2, 0xc3f0, 0xcff0, 0x001a, 0xdef2, 0xdff2, 0x001a, 0xc9c3, 0xdcf2, 0xc6c3, 0xe4f2, 0x001a, 0xcac3, 0xe6f2, 0xdbf2, 0xcef0, 0xe8f2, 0xddf2, 0x001a, 0xc7c3, 0xe3f2, 0x001a, 0xe5f2, 0xe0f2, 0xe7f2, 0xe2f2, 0xe1f2, 0xc8c3, 0x001a, 0x001a, 0xc5f4, 0xc6f4, 0x001a, 0xc8f4, 0xaec4, 0xafc4, 0xc9f4, 0xc7f4, 0x001a, 0xc4f4, 0x001a, 0x42f6, 0x45f6, 0x41f6, 0x001a, 0xfac4, 0x43f6, 0xf9c4, 0xf8c4, 0xf7c4, 0x44f6, 0x51f7, 0x4ff7, 0x001a, 0x4ef7, 0x40f6, 0x50f7, 0x46f6, 0x4df7, 0x001a, 0xf9f7, 0xd7f7, 0xf7f7, 0xdbc5, 0xf8f7, 0xfaf7, 0x001a, 0xbff8, 0xfac5, 0xbef8, 0xbdf8, 0xfbc5, 0x001a, 0x5ac6, 0x6ef9, 0xa7f9, 0xa6f9, 0xa8f9, 0xe5a6, 0xaad0, 0x001a, 0xcfd3, 0xd0d3, 0x001a, 0x001a, 0x001a, 0xc0db, 0x001a, 0x47f6, 0xc0f8, 0xe6a6, 0x6cad, 0xabd0, 0x001a, 0x001a, 0x001a, 0xb1d7, 0x4eb3, 0x001a, 0xc2db, 0xc1db, 0xf3b5, 0x001a, 0xc5b8, 0xc1e7, 0xc3bd, 0x001a, 0xc4bd, 0x001a, 0x001a, 0x001a, 0xc5bf, 0xfcc5, 0xe7a6, 0x001a, 0x001a, 0x001a, 0xacd0, 0xedaa, 0xaed0, 0xadd0, 0x6dad, 0x001a, 0xd1d3, 0x001a, 0xd8d3, 0x49b0, 0xd6d3, 0xd4d3, 0x001a, 0xdbd3, 0xd2d3, 0xd3d3, 0x4ab0, 0x001a, 0x4eb0, 0x001a, 0x001a, 0xdcd3, 0x4db0, 0xdad3, 0xd7d3, 0xd5d3, 0x4bb0, 0x4cb0, 0xd9d3, 0x001a, 0x001a, 0x001a, 0x001a, 0x50b3, 0xb2d7, 0x001a, 0x55b3, 0xc2d7, 0x54b3, 0xc4d7, 0x001a, 0x001a, 0xb8d7, 0x52b3, 0xc3d7, 0x001a, 0xb3d7, 0x53b3, 0xbfd7, 0xbbd7, 0xbdd7, 0xb7d7, 0xbed7, 0x001a, 0x001a, 0x4fb3, 0xbad7, 0x001a, 0xb9d7, 0xb5d7, 0x001a, 0xc0d7, 0x001a, 0x001a, 0xbcd7, 0xb4d7, 0x001a, 0xb6d7, 0x51b3, 0xc1d7, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6b5, 0xcddb, 0x001a, 0x001a, 0x001a, 0xc9db, 0xcbdb, 0xc6db, 0xc5db, 0xc3db, 0x001a, 0xcadb, 0xccdb, 0xc8db, 0x001a, 0xc7db, 0xf4b5, 0xf5b5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfdb, 0xcdb8, 0xf2df, 0xf8df, 0xf3df, 0xf4df, 0xd8f9, 0xf9df, 0x001a, 0xcfb8, 0x001a, 0xc7b8, 0xceb8, 0xf1df, 0xc4db, 0xcab8, 0xc8b8, 0xf7df, 0xf6df, 0xc9b8, 0xcbb8, 0xf5df, 0xc6b8, 0x001a, 0xccb8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6e3, 0x74bb, 0x001a, 0x001a, 0x42e4, 0x41e4, 0x001a, 0xfbe3, 0x76bb, 0x40e4, 0xf7e3, 0xf8e3, 0x6ebb, 0x70bb, 0x001a, 0xfde3, 0xf5e3, 0x72bb, 0x71bb, 0xf9e3, 0xfee3, 0xfce3, 0x73bb, 0xfae3, 0x001a, 0x001a, 0xcedb, 0x6fbb, 0x001a, 0x001a, 0xc2e7, 0xc9e7, 0xc6bd, 0x001a, 0xcde7, 0xcabd, 0xc5e7, 0xc3e7, 0x001a, 0xcce7, 0x001a, 0xc5bd, 0xcbe7, 0xc7bd, 0xc8bd, 0xc4e7, 0xc9bd, 0xcae7, 0xc6e7, 0xc7e7, 0xc8e7, 0x75bb, 0x001a, 0x001a, 0x001a, 0x70eb, 0x7ceb, 0x001a, 0xcabf, 0x77eb, 0x79eb, 0x001a, 0xc8bf, 0x71eb, 0x75eb, 0x001a, 0x78eb, 0xc6bf, 0xc9bf, 0x7beb, 0x73eb, 0x74eb, 0x7aeb, 0x72eb, 0x76eb, 0xc7bf, 0x72ee, 0x001a, 0x71ee, 0xb7c1, 0x77ee, 0xb9c1, 0x001a, 0x001a, 0xb6c1, 0x73ee, 0xbac1, 0x74ee, 0x001a, 0x001a, 0x75ee, 0x78ee, 0x001a, 0xb8c1, 0x001a, 0xd6f0, 0x001a, 0x001a, 0xd9f0, 0x001a, 0xd3f0, 0xd5f0, 0x001a, 0x001a, 0xd4f0, 0xd7f0, 0xd8f0, 0x76ee, 0xd2f0, 0x001a, 0x001a, 0xcdc3, 0xecf2, 0xeff2, 0xf1f2, 0xeaf2, 0xebf2, 0xeef2, 0xf0f2, 0xcec3, 0xccc3, 0xcbc3, 0xedf2, 0xe9f2, 0xcaf4, 0xb0c4, 0x001a, 0xcbf4, 0x001a, 0x001a, 0x49f6, 0xfbc4, 0x4bf6, 0xfcc4, 0x48f6, 0x4af6, 0xa8c5, 0x001a, 0x52f7, 0xa7c5, 0xfdf7, 0xfcf7, 0x001a, 0xfbf7, 0x001a, 0x001a, 0x48f9, 0x49f9, 0x4bf9, 0x4af9, 0x001a, 0x50ca, 0xe8a6, 0x001a, 0x6ead, 0xc5d7, 0xf7b5, 0x001a, 0xfadf, 0xd0c2, 0x001a, 0xf2f2, 0x001a, 0x001a, 0xa3a8, 0x001a, 0x001a, 0x001a, 0x57b3, 0x001a, 0x001a, 0x001a, 0x56b3, 0x001a, 0xd0db, 0xf8b5, 0xd2db, 0xd1db, 0x001a, 0x001a, 0xfbdf, 0xd0b8, 0x43e4, 0x46e4, 0x45e4, 0x001a, 0x44e4, 0xcee7, 0xd0e7, 0xcfe7, 0x001a, 0xccbf, 0x001a, 0x001a, 0x001a, 0xcbbf, 0x001a, 0xbbc1, 0x79ee, 0x7bee, 0x7aee, 0x001a, 0x001a, 0xd1c2, 0x001a, 0x001a, 0x001a, 0xf4f2, 0xf3f2, 0x001a, 0xccf4, 0xb1c4, 0x001a, 0x001a, 0xfdc4, 0x54f7, 0x53f7, 0x5bc6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a8, 0xafd0, 0x6fad, 0xc8d7, 0xc6d7, 0x001a, 0x001a, 0xc7d7, 0xd4db, 0xd5db, 0x43e0, 0xd3db, 0x001a, 0xfcdf, 0x41e0, 0x40e0, 0x42e0, 0xd1b8, 0xfedf, 0xfddf, 0x44e0, 0x001a, 0x49e4, 0x47e4, 0x001a, 0x48e4, 0xd3e7, 0xd1e7, 0x001a, 0x001a, 0xd2e7, 0x7deb, 0x7cee, 0x7dee, 0xd2c2, 0x001a, 0xf5f2, 0xcdf4, 0xb2c4, 0x001a, 0x4cf6, 0x55f7, 0xa9c5, 0x001a, 0xfef7, 0x4cf9, 0xa5a8, 0x001a, 0x71ad, 0x72ad, 0xb0d0, 0x001a, 0x001a, 0xb1d0, 0x70ad, 0x001a, 0x54b0, 0x001a, 0x52b0, 0x001a, 0x51b0, 0x58b0, 0x50b0, 0x59b0, 0xddd3, 0x56b0, 0x001a, 0x53b0, 0x57b0, 0x55b0, 0x4fb0, 0x001a, 0x001a, 0x5fb3, 0x001a, 0x59b3, 0xccd7, 0x5eb3, 0x001a, 0x001a, 0x60b3, 0x5ab3, 0x001a, 0x5bb3, 0x001a, 0xcad7, 0x001a, 0x001a, 0x58b3, 0x001a, 0xcbd7, 0x5db3, 0x001a, 0x001a, 0xc9d7, 0x5cb3, 0x001a, 0x001a, 0x44b6, 0x001a, 0x46b6, 0x001a, 0x001a, 0xd8db, 0x45b6, 0xf9b5, 0xfdb5, 0x001a, 0xe4b8, 0x49e0, 0xdadb, 0xfeb5, 0x001a, 0x001a, 0xdddb, 0xdedb, 0x43b6, 0x001a, 0xe0db, 0x001a, 0xe2db, 0x001a, 0xe3db, 0xd7db, 0xd6db, 0xe4db, 0x42b6, 0xe1db, 0xdfdb, 0x001a, 0x40b6, 0xfbb5, 0x47b6, 0xdbdb, 0xdcdb, 0xd9db, 0x001a, 0x41b6, 0x001a, 0x001a, 0xfcb5, 0x001a, 0xfab5, 0x48e0, 0xdfb8, 0xdab8, 0x001a, 0x001a, 0xd5b8, 0x001a, 0xe5b8, 0xd6b8, 0x001a, 0xd2b8, 0xe1b8, 0xdeb8, 0xe0b8, 0x001a, 0xd7b8, 0xdcb8, 0xd3b8, 0xd4b8, 0x50e0, 0x4de0, 0x45e0, 0x4ae0, 0x001a, 0xe2b8, 0x51e0, 0xe3b8, 0xd9b8, 0x001a, 0x001a, 0x47e0, 0x001a, 0x4fe0, 0x4be0, 0x4ee0, 0x4ce0, 0xddb8, 0x46e0, 0xd8b8, 0x001a, 0x001a, 0x001a, 0x4ce4, 0x78bb, 0x7bbb, 0x001a, 0x4ee4, 0x001a, 0xa5bb, 0x4de4, 0x7dbb, 0x001a, 0xcfbd, 0x4fe4, 0x001a, 0xa4bb, 0x4be4, 0xa6bb, 0x001a, 0x001a, 0x001a, 0x79bb, 0x001a, 0xdbb8, 0x7cbb, 0x001a, 0x7abb, 0x7ebb, 0xa2bb, 0x77bb, 0xa7bb, 0xa3bb, 0x001a, 0xa1bb, 0x4ae4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6bd, 0x001a, 0xd2bd, 0x001a, 0x001a, 0x001a, 0xd9bd, 0x001a, 0xd6e7, 0xdabd, 0xe2e7, 0xdbe7, 0xcbbd, 0xe3e7, 0xdde7, 0xd5bd, 0xdee7, 0x001a, 0xd4bd, 0xe1e7, 0xcebd, 0xdfe7, 0xd5e7, 0xcdbd, 0xaaeb, 0xd3bd, 0x001a, 0xd0bd, 0x001a, 0xd8bd, 0x001a, 0xd4e7, 0x001a, 0xd8e7, 0xccbd, 0xd7e7, 0xd9e7, 0xdae7, 0xd7bd, 0xdce7, 0xe0e7, 0xe4e7, 0x001a, 0xdbbd, 0xd2bf, 0xa5eb, 0xabeb, 0xa8eb, 0x7eeb, 0xaceb, 0xa1eb, 0x001a, 0xa7eb, 0x001a, 0xcdbf, 0xd3bf, 0xadeb, 0x001a, 0x001a, 0xcfbf, 0x001a, 0xd9bf, 0xd4bf, 0xafeb, 0xa9eb, 0xd0bf, 0xa2eb, 0xdabf, 0xa3eb, 0xa4eb, 0xdbbf, 0xd8bf, 0xd1bd, 0x001a, 0xcebf, 0xb0eb, 0xdcbf, 0x001a, 0xd5bf, 0xaeeb, 0xd1bf, 0xd6bf, 0xd7bf, 0x001a, 0xc3c1, 0xa4ee, 0xadee, 0xaaee, 0xacee, 0x001a, 0xc0c1, 0xa5ee, 0x001a, 0xabee, 0xbcc1, 0xa7ee, 0xc4c1, 0xa3ee, 0xa8ee, 0xafee, 0xa6eb, 0xa9ee, 0xa2ee, 0xbdc1, 0xa1ee, 0xbec1, 0xb0ee, 0xbfc1, 0xaeee, 0xc2c1, 0x7eee, 0x001a, 0xc1c1, 0x001a, 0xa6ee, 0xdcf0, 0xeaf0, 0xe5f0, 0xe7f0, 0xdbf0, 0xd3c2, 0x001a, 0xdaf0, 0xd6c2, 0xd5c2, 0x001a, 0xe9f0, 0xe1f0, 0xdef0, 0xe4f0, 0x001a, 0xddf0, 0x001a, 0xdff0, 0xe8f0, 0xe6f0, 0x001a, 0xd4c2, 0xedf0, 0xebf0, 0xe2f0, 0xecf0, 0xe3f0, 0x001a, 0xf9f2, 0xcfc3, 0x41f3, 0x001a, 0x001a, 0x4ff6, 0xd6c3, 0xe0f0, 0xf7f2, 0xd2c3, 0xf8f2, 0xfdf2, 0x001a, 0x001a, 0xd4c3, 0xd5c3, 0xf6f2, 0x40f3, 0x42f3, 0xfaf2, 0xfcf2, 0xfef2, 0xfbf2, 0x43f3, 0xd1c3, 0xd7c3, 0xd3c3, 0x001a, 0xd0c3, 0xd0f4, 0x001a, 0xb7c4, 0xcef4, 0x001a, 0x001a, 0xd2f4, 0x001a, 0xd3f4, 0xb5c4, 0xd4f4, 0xd1f4, 0x001a, 0xcff4, 0xb8c4, 0xb4c4, 0xd5f4, 0x001a, 0xb6c4, 0xb3c4, 0x001a, 0x001a, 0x001a, 0xfec4, 0x001a, 0x001a, 0x40c5, 0x4ef6, 0x4df6, 0x50f6, 0x51f6, 0x001a, 0x41c5, 0x56f7, 0x5bf7, 0xaac5, 0x001a, 0x58f7, 0x001a, 0x57f7, 0x5af7, 0x59f7, 0x001a, 0x43f8, 0x001a, 0xdcc5, 0x42f8, 0x40f8, 0x001a, 0x41f8, 0x001a, 0x001a, 0x001a, 0xfec5, 0xfdc5, 0xc1f8, 0xc2f8, 0x40c6, 0x001a, 0x4df9, 0x4ef9, 0x67c6, 0x001a, 0x6dc6, 0x001a, 0xa9f9, 0xc8f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6a8, 0x001a, 0xcdd7, 0x001a, 0xced7, 0x52e0, 0x50e4, 0xe5e7, 0xc6c1, 0x001a, 0xc5c1, 0xeef0, 0x44f3, 0x001a, 0x44f8, 0xa7a8, 0xded3, 0x5ab0, 0x61b3, 0x54e0, 0x53e0, 0xdcbd, 0xe6e7, 0xddbd, 0xb1ee, 0xd7c2, 0x001a, 0x001a, 0x001a, 0x76c6, 0xa8a8, 0xcbcd, 0xdfd3, 0x001a, 0x001a, 0x62b3, 0x001a, 0xcfd7, 0xd0d7, 0x001a, 0xe5db, 0x001a, 0x48b6, 0xe6b8, 0x001a, 0x56e0, 0x55e0, 0x57e0, 0x001a, 0x51e4, 0x52e4, 0xa8bb, 0xddbf, 0xdebd, 0xdebf, 0x001a, 0xb5ee, 0xb2ee, 0xb4ee, 0xb3ee, 0xc7c1, 0x001a, 0xeff0, 0x46f3, 0x45f3, 0xa4cb, 0x5cb0, 0x5bb0, 0xe0d3, 0x001a, 0xd1d7, 0x001a, 0x001a, 0xe7db, 0xe6db, 0x49b6, 0x001a, 0x59e0, 0x5ae0, 0x58e0, 0x001a, 0x001a, 0xe8b8, 0xe7b8, 0x001a, 0xaabb, 0xa9bb, 0x001a, 0xe7e7, 0xb3eb, 0xb1eb, 0xb2eb, 0xdfbf, 0xb7ee, 0xb6ee, 0x001a, 0xf2f0, 0xf1f0, 0xf0f0, 0x47f3, 0x001a, 0xaaf9, 0xa9a8, 0x73ad, 0x001a, 0x74ad, 0x5db0, 0x5eb0, 0xe2d3, 0xe1d3, 0xd2d7, 0x001a, 0x68b3, 0x66b3, 0x63b3, 0x67b3, 0x65b3, 0x64b3, 0x001a, 0x001a, 0x4ab6, 0xeadb, 0x001a, 0xedb8, 0x4cb6, 0x51b6, 0xecdb, 0x53b6, 0x52b6, 0x55b6, 0xebdb, 0xe8db, 0x4fb6, 0x4bb6, 0x4db6, 0xe9db, 0x54b6, 0x50b6, 0x4eb6, 0xefb8, 0xeeb8, 0xecb8, 0xf0b8, 0x001a, 0xeab8, 0xebb8, 0x001a, 0xe9b8, 0x001a, 0x5be0, 0x001a, 0x001a, 0x54e4, 0x001a, 0xacbb, 0xadbb, 0xabbb, 0x001a, 0x53e4, 0x001a, 0x55e4, 0x001a, 0xeae7, 0xece7, 0x001a, 0xe7bd, 0xede7, 0xe0bd, 0xe9e7, 0xdfbd, 0xe9bd, 0xe5bd, 0xe6bd, 0xe2bd, 0xe8e7, 0xe1bd, 0xeee7, 0xebe7, 0x001a, 0xe8bd, 0x001a, 0xe3bd, 0xe4bd, 0xb5eb, 0x001a, 0xb7eb, 0xb6eb, 0x001a, 0xb8eb, 0xe0bf, 0xb4eb, 0x001a, 0x001a, 0xcbc1, 0xb8ee, 0xc8c1, 0xccc1, 0xcac1, 0xc9c1, 0xf3f0, 0x001a, 0xf6f0, 0x001a, 0xf5f0, 0x001a, 0xf4f0, 0xd8c2, 0x48f3, 0x49f3, 0xd8c3, 0x4af3, 0xd9c3, 0x001a, 0x001a, 0xbac4, 0x001a, 0xb9c4, 0x52f6, 0x001a, 0x001a, 0x42c5, 0x53f6, 0x5cf7, 0xabc5, 0xacc5, 0x001a, 0x45f8, 0x001a, 0x42c6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaaa8, 0x001a, 0x6ab3, 0x69b3, 0x5ce0, 0x5de0, 0x001a, 0xaebb, 0xb9eb, 0xeabd, 0xbaeb, 0xb9ee, 0xaba8, 0x001a, 0xb2d0, 0x76ad, 0x75ad, 0x001a, 0xe3d3, 0x5fb0, 0xe4d3, 0xd5d7, 0x001a, 0xd4d7, 0x001a, 0xd3d7, 0x001a, 0x001a, 0xeedb, 0x58b6, 0x001a, 0x001a, 0xeddb, 0x57b6, 0x001a, 0x001a, 0x001a, 0xefdb, 0x56b6, 0x001a, 0x5fe0, 0x62e0, 0x60e0, 0x61e0, 0x65e0, 0x5ee0, 0x66e0, 0x63e0, 0x64e0, 0xb0bb, 0x56e4, 0x001a, 0x001a, 0xafbb, 0x001a, 0xf2e7, 0xf0e7, 0x001a, 0x001a, 0xebbd, 0xefe7, 0xf1e7, 0x001a, 0xecbd, 0x001a, 0xbbeb, 0x001a, 0xbceb, 0xcdc1, 0x001a, 0x4cf3, 0x4ef3, 0x4bf3, 0x4df3, 0xd6f4, 0x54f6, 0x001a, 0x001a, 0x6ff9, 0xaca8, 0x77ad, 0xe5d3, 0xe7d3, 0xe6d3, 0x001a, 0xd8d7, 0x6cb3, 0x001a, 0xd6d7, 0x001a, 0x6bb3, 0xd9d7, 0x001a, 0xdad7, 0xd7d7, 0x001a, 0x001a, 0xfbdb, 0x60b6, 0xf3db, 0xf9db, 0x001a, 0x001a, 0x5bb6, 0x5eb6, 0xf2db, 0x59b6, 0xf6db, 0x6ce0, 0x5db6, 0x001a, 0xf1db, 0x001a, 0xf7db, 0xf4db, 0xfadb, 0xf0db, 0xf8db, 0x5cb6, 0x5fb6, 0xf5db, 0x5ab6, 0x001a, 0xf2b8, 0x68e0, 0xf1b8, 0x6fe0, 0x6ee0, 0xf8b8, 0x001a, 0xf9b8, 0x70e0, 0xf3b8, 0x6de0, 0xf7b8, 0x72e0, 0x69e0, 0x001a, 0x6be0, 0xf4b8, 0x67e0, 0x6ae0, 0x71e0, 0xf5b8, 0x73e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6b8, 0x001a, 0xb1bb, 0x5be4, 0x61e4, 0x59e4, 0x62e4, 0x001a, 0x58e4, 0x5de4, 0x63e4, 0x60e4, 0x5fe4, 0x5ee4, 0x001a, 0x57e4, 0x5ce4, 0x001a, 0x001a, 0x5ae4, 0x001a, 0xf1bd, 0xeebd, 0xfbe7, 0x41e8, 0x43e8, 0x40e8, 0xf8e7, 0xfae7, 0x45e8, 0x42e8, 0xfce7, 0x46e8, 0xf9e7, 0x44e8, 0xefbd, 0xf5bd, 0xf3bd, 0xf3e7, 0xf4bd, 0xf0bd, 0xf4e7, 0xf6e7, 0xf5e7, 0xfde7, 0xfee7, 0x001a, 0xf2bd, 0x001a, 0xedbd, 0x001a, 0x001a, 0xf7e7, 0x001a, 0xc6eb, 0xe2bf, 0x001a, 0xbdeb, 0xe3bf, 0xe6bf, 0xc2eb, 0x001a, 0xbfeb, 0xe5bf, 0x001a, 0x001a, 0xc3eb, 0xc4eb, 0xbeeb, 0xc7eb, 0xc0eb, 0xc5eb, 0xe4bf, 0x001a, 0xe1bf, 0xc1eb, 0x001a, 0xbfee, 0xd0c1, 0xcec1, 0xd1c1, 0xcfc1, 0xbeee, 0xbbee, 0xbaee, 0x001a, 0xbdee, 0x001a, 0x001a, 0xbcee, 0x45f1, 0xdec2, 0xfbf0, 0xfaf0, 0x001a, 0xd9c2, 0x41f1, 0x40f1, 0xf7f0, 0x43f1, 0xfcf0, 0xddc2, 0xf9f0, 0x42f1, 0xf8f0, 0xdac2, 0xdcc2, 0xfdf0, 0xdbc2, 0xfef0, 0x001a, 0x44f1, 0x52f3, 0x001a, 0xdec3, 0x4ff3, 0x001a, 0x53f3, 0x001a, 0x001a, 0xdbc3, 0x51f3, 0xe0c3, 0x001a, 0xddc3, 0x001a, 0x50f3, 0x001a, 0xdfc3, 0x54f3, 0xdac3, 0x001a, 0x001a, 0x001a, 0x001a, 0xbcc4, 0xbec4, 0x001a, 0xd9f4, 0xbdc4, 0xd7f4, 0xdcc3, 0xd8f4, 0xbbc4, 0x43c5, 0x45c5, 0x56f6, 0x44c5, 0x55f6, 0x001a, 0x61f7, 0xadc5, 0x60f7, 0xaec5, 0x5ef7, 0x5df7, 0x62f7, 0x63f7, 0x46f8, 0x001a, 0x5ff7, 0x001a, 0x001a, 0xc6f8, 0xc3f8, 0xc4f8, 0xc5f8, 0x5cc6, 0x001a, 0x51f9, 0x50f9, 0x4ff9, 0x70f9, 0x001a, 0xbef9, 0xabf9, 0x6ec6, 0xada8, 0x60b0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfab8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6bd, 0x001a, 0x001a, 0xc8eb, 0x001a, 0x001a, 0xdfc2, 0x001a, 0x55f3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacf9, 0xaea8, 0xeeaa, 0x79ad, 0x78ad, 0x001a, 0x63b0, 0x001a, 0xe8d3, 0x61b0, 0xe9d3, 0x62b0, 0x001a, 0x001a, 0xdfd7, 0xdbd7, 0x001a, 0x001a, 0x6db3, 0xded7, 0xddd7, 0xdcd7, 0x6eb3, 0xe0d7, 0xe1d7, 0x001a, 0x001a, 0x001a, 0x43dc, 0x41dc, 0x45dc, 0x46dc, 0x4cdc, 0x001a, 0x48dc, 0x4adc, 0x001a, 0x42dc, 0xfcdb, 0x001a, 0x49dc, 0x001a, 0x001a, 0x4bdc, 0x44dc, 0x47dc, 0xfddb, 0x62b6, 0x40dc, 0xfedb, 0x61b6, 0x63b6, 0x001a, 0xfdb8, 0x75e0, 0x77e0, 0x76e0, 0x7be0, 0xfbb8, 0x001a, 0x78e0, 0x74e0, 0x79e0, 0x7ae0, 0xfcb8, 0xfeb8, 0x7ce0, 0x001a, 0x67e4, 0x66e4, 0x001a, 0x64e4, 0x65e4, 0xb3bb, 0xb5bb, 0xb2bb, 0xb4bb, 0x4de8, 0x4ee8, 0x49e8, 0x001a, 0x4ae8, 0xf8bd, 0xfdbd, 0xf7bd, 0xfebd, 0xf9bd, 0x4be8, 0x001a, 0x001a, 0x4ce8, 0x48e8, 0x40be, 0xfbbd, 0x001a, 0x001a, 0xfabd, 0xfcbd, 0x001a, 0x47e8, 0x001a, 0xcaeb, 0xe8bf, 0x001a, 0x001a, 0xcceb, 0xeabf, 0xcfeb, 0xcbeb, 0xc9eb, 0xceeb, 0xe9bf, 0xcdeb, 0x001a, 0xe7bf, 0x001a, 0x001a, 0xd3c1, 0xd6c1, 0xc1ee, 0x001a, 0xd4c1, 0xc0ee, 0xd2c1, 0xd5c1, 0x46f1, 0x47f1, 0x48f1, 0xe0c2, 0x001a, 0x49f1, 0x001a, 0xe1c2, 0xe2c3, 0x58f3, 0x59f3, 0x57f3, 0x56f3, 0x5af3, 0xe1c3, 0xddf4, 0xdbf4, 0xdcf4, 0xdef4, 0xdaf4, 0xdff4, 0x58f6, 0x001a, 0x59f6, 0x57f6, 0x46c5, 0x64f7, 0xafc5, 0x65f7, 0x48f8, 0x47f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafa8, 0x64b6, 0x001a, 0x001a, 0x40b9, 0x001a, 0x001a, 0x001a, 0xb6bb, 0x001a, 0x001a, 0xecbf, 0x001a, 0xebbf, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3c3, 0x7cc4, 0x47c5, 0xb0a8, 0x64b0, 0x41b9, 0x001a, 0x5bf3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6cb, 0x001a, 0x001a, 0xb1a8, 0x001a, 0xb4a8, 0xb3a8, 0xb2a8, 0x001a, 0x001a, 0xa5cb, 0x001a, 0xcdcd, 0x001a, 0xcfcd, 0xefaa, 0x001a, 0x001a, 0xf1aa, 0xcccd, 0xcecd, 0xf0aa, 0xd1cd, 0xd0cd, 0xd2cd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6d0, 0xb4d0, 0x7cad, 0xb3d0, 0xa3ad, 0x7ead, 0x7bad, 0x001a, 0xa4ad, 0x001a, 0x7dad, 0xa2ad, 0x001a, 0xa1ad, 0xb5d0, 0x001a, 0x7aad, 0x001a, 0x001a, 0x001a, 0x6ab0, 0xebd3, 0xf1d3, 0x67b0, 0x6eb0, 0x001a, 0x69b0, 0xeed3, 0xf0d3, 0x6cb0, 0xead3, 0xedd3, 0x68b0, 0x65b0, 0xecd3, 0x6bb0, 0xefd3, 0x6db0, 0x66b0, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3d7, 0xe6d7, 0x70b3, 0x001a, 0x7ab3, 0x76b3, 0xe4d7, 0x001a, 0x001a, 0x7eb3, 0x77b3, 0x7cb3, 0x72b3, 0x001a, 0x6fb3, 0x71b3, 0x7db3, 0xe5d7, 0x75b3, 0x78b3, 0x74b3, 0x79b3, 0xe7d7, 0x7bb3, 0x73b3, 0xe2d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ddc, 0x65b6, 0x4fdc, 0x001a, 0x67b6, 0x69b6, 0x001a, 0x4edc, 0x66b6, 0x6ab6, 0x001a, 0x68b6, 0x001a, 0x001a, 0x001a, 0x47b9, 0xa3e0, 0x4fb9, 0x7ee0, 0x001a, 0x50b9, 0x45b9, 0x001a, 0xa1e0, 0x001a, 0x001a, 0x4ab9, 0x001a, 0xa2e0, 0x43b9, 0x42b9, 0x001a, 0x4db9, 0x4cb9, 0x4bb9, 0x49b9, 0x4eb9, 0x7de0, 0x44b9, 0x46b9, 0x48b9, 0x001a, 0x001a, 0xb8bb, 0xbbbb, 0x001a, 0xbfbb, 0xb9bb, 0xbebb, 0xbcbb, 0x001a, 0xb7bb, 0x001a, 0xbdbb, 0xbabb, 0x001a, 0x001a, 0x001a, 0x52e8, 0x43be, 0x41be, 0x001a, 0x53e8, 0x001a, 0x44be, 0x42be, 0x51e8, 0x50e8, 0x001a, 0xf0bf, 0x4fe8, 0xeebf, 0xedbf, 0xd0eb, 0x45be, 0xefbf, 0xd1eb, 0xf2bf, 0xd2eb, 0xf1bf, 0xd8c1, 0xc3ee, 0xd7c1, 0xdcc1, 0xdac1, 0xdbc1, 0xe3c2, 0xd9c1, 0xc2ee, 0xd3eb, 0xe2c2, 0xe4c2, 0x001a, 0xe4c3, 0xe5c3, 0x001a, 0xe0f4, 0x001a, 0xdec5, 0xddc5, 0xb6a8, 0x001a, 0x001a, 0x55ca, 0x6fb0, 0x001a, 0x52ca, 0x53ca, 0x51ca, 0x001a, 0x54ca, 0x001a, 0x001a, 0xaacb, 0xa7cb, 0xaccb, 0xa8cb, 0xb7a8, 0xbaa8, 0x001a, 0xa9cb, 0xb9a8, 0xabcb, 0x001a, 0x001a, 0xb8a8, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5cd, 0xd7cd, 0xf4aa, 0xd3cd, 0xd6cd, 0xd4cd, 0xf2aa, 0xf5aa, 0x001a, 0xf3aa, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8d0, 0xbcd0, 0xb9d0, 0x001a, 0xa7ad, 0x001a, 0xa8ad, 0x001a, 0xbbd0, 0x001a, 0xbdd0, 0xbfd0, 0x001a, 0xa5ad, 0xbed0, 0x001a, 0x001a, 0xa6ad, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeed7, 0xbad0, 0xf2d3, 0xfbd3, 0xf9d3, 0xf4d3, 0xf5d3, 0xfad3, 0xfcd3, 0x71b0, 0x001a, 0xf7d3, 0xf3d3, 0x70b0, 0x72b0, 0xf6d3, 0xfdd3, 0xf8d3, 0x001a, 0x001a, 0xa1b3, 0xf1d7, 0xe9d7, 0xefd7, 0xf0d7, 0xa2b3, 0x001a, 0xe8d7, 0xead7, 0xb7d0, 0xecd7, 0xedd7, 0xebd7, 0x6cb6, 0x001a, 0x001a, 0x001a, 0x56dc, 0xd4eb, 0x57dc, 0x54dc, 0xa3b3, 0x6eb6, 0x53dc, 0x59dc, 0x58dc, 0x6bb6, 0x5cdc, 0x52dc, 0x5bdc, 0x50dc, 0x5adc, 0x55dc, 0x6db6, 0x001a, 0xaae0, 0x001a, 0xa5e0, 0xabe0, 0xa6e0, 0xa4e0, 0xa7e0, 0x51b9, 0x001a, 0xa9e0, 0x001a, 0xa8e0, 0x52b9, 0xc1bb, 0xc0bb, 0x6ee4, 0x71e4, 0x69e4, 0x6de4, 0xc2bb, 0x6ce4, 0x6ae4, 0x70e4, 0x6be4, 0x68e4, 0x6fe4, 0x001a, 0x59e8, 0x48be, 0x4af1, 0x56e8, 0x57e8, 0x55e8, 0x51dc, 0x47be, 0x5ae8, 0x54e8, 0x46be, 0x49be, 0x58e8, 0xd5eb, 0xf3bf, 0xd6eb, 0xd7eb, 0x001a, 0xc4ee, 0xddc1, 0x4bf1, 0x4cf1, 0x001a, 0x001a, 0x4df1, 0x5df3, 0x5cf3, 0xe2f4, 0x001a, 0xe1f4, 0x5bf6, 0x5cf6, 0x5af6, 0x66f7, 0xb0c5, 0xbba8, 0xaaad, 0xa9ad, 0x75b0, 0x74b0, 0x40d4, 0x41d4, 0xfed3, 0x001a, 0x73b0, 0xf5d7, 0x001a, 0xf6d7, 0xf2d7, 0xa4b3, 0xf3d7, 0x001a, 0xf4d7, 0x001a, 0x001a, 0x001a, 0x001a, 0x5fdc, 0x61dc, 0x5ddc, 0x60dc, 0x6fb6, 0x5edc, 0x70b6, 0x001a, 0x001a, 0x73dd, 0x55b9, 0x54b9, 0x001a, 0x53b9, 0x001a, 0xace0, 0xade0, 0x001a, 0x001a, 0x73e4, 0x75e4, 0xc6bb, 0xc3bb, 0x001a, 0xc5bb, 0xc4bb, 0x74e4, 0x72e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x61e8, 0x5ee8, 0x5fe8, 0x4dbe, 0x60e8, 0x5be8, 0x5ce8, 0x4abe, 0x001a, 0x4bbe, 0x5de8, 0x4cbe, 0x001a, 0xdbeb, 0x001a, 0xdceb, 0xd9eb, 0xdaeb, 0xf4bf, 0xd8eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ee, 0xc5ee, 0xc7ee, 0xe0c1, 0xcbee, 0xdfc1, 0xc9ee, 0xccee, 0xcaee, 0xc6ee, 0xdec1, 0x001a, 0x4ff1, 0x001a, 0x50f1, 0x4ef1, 0x001a, 0x52f1, 0xe5c2, 0xe6c2, 0x5ff3, 0xe7c3, 0x51f1, 0x5ef3, 0xe6c3, 0xe5f4, 0xe6f4, 0xbfc4, 0xe4f4, 0x001a, 0xe3f4, 0x001a, 0x5df6, 0x48c5, 0x001a, 0x49f8, 0xc8f8, 0xc7f8, 0x001a, 0x43c6, 0x5dc6, 0xc9f8, 0x71f9, 0x001a, 0x6fc6, 0xbca8, 0xf6aa, 0x001a, 0x56b9, 0x001a, 0xc0c4, 0xbda8, 0xabad, 0xa5b3, 0x71b6, 0xe7c2, 0xf7aa, 0x001a, 0xc1d0, 0xc0d0, 0x42d4, 0x001a, 0x78b0, 0x76b0, 0x7ab0, 0x44d4, 0x001a, 0x79b0, 0x77b0, 0x001a, 0x001a, 0x001a, 0x001a, 0x43d4, 0xa8b3, 0xfcd7, 0x001a, 0xa7b3, 0xa9b3, 0x42d8, 0xabb3, 0xfed7, 0x40d8, 0xf7d7, 0xaab3, 0x43d8, 0x001a, 0x001a, 0xf9d7, 0x001a, 0xfad7, 0xf8d7, 0xa6b3, 0x001a, 0x41d8, 0xfbd7, 0xfdd7, 0x001a, 0x001a, 0x001a, 0x6ddc, 0x001a, 0x6cdc, 0x6adc, 0x62dc, 0x71dc, 0x65dc, 0x6fdc, 0x76dc, 0x6edc, 0x79b6, 0x001a, 0x75b6, 0x63dc, 0x001a, 0x69dc, 0x77b6, 0x001a, 0x68dc, 0x78b6, 0x7ab6, 0x6bdc, 0x001a, 0x72b6, 0x73b6, 0x77dc, 0x75dc, 0x001a, 0x74dc, 0x66dc, 0x001a, 0x72dc, 0x001a, 0x76b6, 0x001a, 0x001a, 0x001a, 0x001a, 0x74b6, 0x73dc, 0x64dc, 0x67dc, 0x70dc, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbae4, 0xb7e0, 0x001a, 0xb0e0, 0xc3e0, 0xcce0, 0xb3e0, 0x61b9, 0x001a, 0xc0e0, 0x57b9, 0x59b9, 0x65b9, 0xb1e0, 0x001a, 0x001a, 0x5ab9, 0x5cb9, 0x66b9, 0x5bb9, 0x001a, 0x001a, 0x001a, 0x001a, 0x64b9, 0xb9e0, 0x001a, 0xaee0, 0x62b9, 0xb8e0, 0x5eb9, 0xcae0, 0x63b9, 0xc8e0, 0xbce0, 0xc6e0, 0x60b9, 0xafe0, 0xc9e0, 0xc4e0, 0x001a, 0xcbe0, 0x58b9, 0x001a, 0x001a, 0x67b9, 0x5db9, 0x001a, 0x001a, 0xb5e0, 0x001a, 0xbde0, 0xc1e0, 0x001a, 0xc5e0, 0x5fb9, 0xb4e0, 0xb2e0, 0xbee0, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbe0, 0xbae0, 0x001a, 0xbfe0, 0xc2e0, 0x001a, 0xc7e0, 0x001a, 0x001a, 0x001a, 0x78e4, 0x001a, 0xc7bb, 0xa4e4, 0x7ae4, 0xccbb, 0xd0bb, 0xade4, 0xb5e4, 0xa6e4, 0xc8bb, 0x001a, 0xaae4, 0xb6e0, 0x001a, 0xc9bb, 0xb1e4, 0xb6e4, 0xaee4, 0x001a, 0xb0e4, 0xb9e4, 0xb2e4, 0x7ee4, 0xa9e4, 0x001a, 0x001a, 0xd1bb, 0x001a, 0xcdbb, 0x7ce4, 0xabe4, 0xcbbb, 0xa5e4, 0xcabb, 0xb3e4, 0xa2e4, 0x79e4, 0xcebb, 0xb8e4, 0x001a, 0x001a, 0x7be4, 0xafe4, 0xace4, 0xa7e4, 0x77e4, 0x76e4, 0xa1e4, 0xb4e4, 0xcfbb, 0xb7e4, 0x7de4, 0xa3e4, 0x52be, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5abe, 0x55be, 0xa4e8, 0xa1e8, 0x67e8, 0x50be, 0x001a, 0xd7f9, 0x001a, 0x4fbe, 0x56be, 0x001a, 0x001a, 0x001a, 0x65e8, 0x54be, 0x71e8, 0x63e8, 0x64e8, 0x4ebe, 0xa3e8, 0x58be, 0x74e8, 0x79e8, 0x73e8, 0xeeeb, 0x6fe8, 0x77e8, 0x75e8, 0x68e8, 0x62e8, 0x7de8, 0x57be, 0x7ee8, 0x001a, 0x78e8, 0x001a, 0x6de8, 0x6be8, 0x66e8, 0x001a, 0x001a, 0x001a, 0x6ee8, 0x7be8, 0x6ae8, 0x7ae8, 0xa2e8, 0x001a, 0x001a, 0x53be, 0x001a, 0x76e8, 0x7ce8, 0x72e8, 0x6ce8, 0x51be, 0x001a, 0x001a, 0x001a, 0xa8e4, 0x70e8, 0x59be, 0x69e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4eb, 0xf7bf, 0xf3eb, 0xf0eb, 0x44ec, 0xfbbf, 0x001a, 0x41ec, 0xf8eb, 0x43ec, 0xe9eb, 0xf6eb, 0x001a, 0xfdbf, 0x001a, 0xe1eb, 0x001a, 0xdfeb, 0x42ec, 0x001a, 0x40ec, 0xfeeb, 0xedeb, 0xeceb, 0xe2eb, 0x40c0, 0x001a, 0xe8eb, 0xf2eb, 0xfdeb, 0x43c0, 0x45ec, 0x001a, 0xe8c1, 0x45c0, 0xfebf, 0xe6eb, 0x001a, 0xefeb, 0xdeeb, 0xe0eb, 0xf5bf, 0x42c0, 0xfabf, 0xe7eb, 0xf7eb, 0xf1eb, 0x41c0, 0xddeb, 0xe3c1, 0xf9eb, 0xfceb, 0xfcbf, 0x001a, 0xebeb, 0x44c0, 0xf9bf, 0x001a, 0x001a, 0x001a, 0xf8bf, 0xf5eb, 0xfbeb, 0xf6bf, 0x001a, 0xe4eb, 0xfaeb, 0x001a, 0x001a, 0xe5eb, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeaeb, 0xd2ee, 0x001a, 0xd7ee, 0xe5c1, 0xe7c1, 0xddee, 0xe1c1, 0xecee, 0xe3ee, 0xd8ee, 0xd9ee, 0xe2ee, 0x001a, 0xeec1, 0xe1ee, 0xd1ee, 0xe0ee, 0xd4ee, 0xedee, 0xedc1, 0xebc1, 0xd5ee, 0x001a, 0xe8ee, 0x001a, 0xdaee, 0xe7ee, 0x001a, 0xe9ee, 0xd0ee, 0xe6c1, 0x001a, 0xeaee, 0x001a, 0x001a, 0xdeee, 0x001a, 0xeac1, 0xdbee, 0x001a, 0x001a, 0xecc1, 0xe4ee, 0x001a, 0x001a, 0x001a, 0xe4c1, 0xd6ee, 0xe5ee, 0x001a, 0xdfee, 0xe3eb, 0xe6ee, 0xd3ee, 0x001a, 0xe9c1, 0x001a, 0xebee, 0x001a, 0xe2c1, 0xceee, 0x001a, 0x001a, 0x001a, 0x001a, 0x60f1, 0x59f1, 0xe9c2, 0x001a, 0x54f1, 0x63f1, 0x5bf1, 0xdcee, 0x001a, 0x65f1, 0x55f1, 0x001a, 0xe8c2, 0x5ff1, 0xeac2, 0xf2c2, 0xf0c2, 0x61f1, 0xf1c2, 0x57f1, 0x001a, 0x58f1, 0x5df1, 0x62f1, 0x001a, 0xcdee, 0xebc2, 0x6af1, 0x67f1, 0x6bf1, 0x5ef1, 0x5af1, 0x68f1, 0x6af3, 0x5cf1, 0x001a, 0xeec2, 0x001a, 0xedc2, 0xcfee, 0xefc2, 0x64f1, 0x66f1, 0xecc2, 0x69f1, 0x53f1, 0x001a, 0x56f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73f3, 0x001a, 0x63f3, 0xebc3, 0x71f3, 0x001a, 0x001a, 0x61f3, 0xecc3, 0x001a, 0x6cf3, 0x001a, 0x68f3, 0xf1c3, 0x72f3, 0x62f3, 0x65f3, 0xe9c3, 0x74f3, 0x001a, 0x6df3, 0x70f3, 0xefc3, 0xf4c3, 0xf2c3, 0x69f3, 0x64f3, 0x001a, 0xedc3, 0xeec3, 0x60f3, 0xeac3, 0x001a, 0xe8c3, 0xf0c3, 0x6ff3, 0xf3c3, 0x001a, 0x6bf3, 0x75f3, 0xf5c3, 0x001a, 0x001a, 0x001a, 0x67f3, 0x001a, 0x6ef3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3f4, 0x42f5, 0xf5f4, 0xfcf4, 0x66f3, 0xfaf4, 0xe9f4, 0x40f5, 0xc3c4, 0xedf4, 0xfef4, 0xf4f4, 0x001a, 0x001a, 0xc2c4, 0x001a, 0x001a, 0x44f5, 0xf6f4, 0x001a, 0xfbf4, 0xfdf4, 0xe7f4, 0x41f5, 0xf2f4, 0xf7f4, 0xebf4, 0xeff4, 0x43f5, 0xf9f4, 0xe8f4, 0xecf4, 0xeef4, 0xf8f4, 0x001a, 0xc1c4, 0xf1f4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeaf4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0f4, 0x61f6, 0x66f6, 0x4fc5, 0x68f6, 0x001a, 0x49c5, 0x001a, 0x64f6, 0x6af6, 0x4ec5, 0x4ac5, 0x001a, 0x4bc5, 0x60f6, 0x67f6, 0x4dc5, 0x65f6, 0x4cc5, 0x5ff6, 0x63f6, 0x62f6, 0x001a, 0x5ef6, 0x69f6, 0x001a, 0x001a, 0x001a, 0xb1c5, 0x6df7, 0x70f7, 0x6cf7, 0x6ef7, 0x6ff7, 0x69f7, 0x6af7, 0x67f7, 0x001a, 0x001a, 0x6bf7, 0x68f7, 0xb2c5, 0xb3c5, 0x001a, 0x001a, 0x4bf8, 0x001a, 0x4df8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4cf8, 0x4ef8, 0x001a, 0xe0c5, 0x001a, 0x4af8, 0xdfc5, 0xe1c5, 0x001a, 0x001a, 0x001a, 0xcbf8, 0xccf8, 0x44c6, 0xcaf8, 0x001a, 0x53f9, 0x52f9, 0x54f9, 0x5fc6, 0x55f9, 0x5ec6, 0x56f9, 0x72f9, 0x75f9, 0x74f9, 0x68c6, 0x73f9, 0x001a, 0x001a, 0x001a, 0x72c6, 0x70c6, 0x71c6, 0x77c6, 0xc0f9, 0xc1f9, 0xbff9, 0xc9f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8aa, 0x001a, 0x001a, 0x44d8, 0x78dc, 0xa5e8, 0x76f3, 0x001a, 0x001a, 0xf9aa, 0x001a, 0xacad, 0x7bb0, 0x001a, 0x001a, 0x45d8, 0x001a, 0x46d8, 0xacb3, 0x001a, 0x7db6, 0x7adc, 0x79dc, 0xa3b6, 0x7cb6, 0x7bdc, 0x7eb6, 0xa2b6, 0xa1b6, 0x7bb6, 0x001a, 0x001a, 0x001a, 0x68b9, 0x001a, 0x001a, 0xd0e0, 0xcee0, 0x001a, 0xcfe0, 0xcde0, 0x001a, 0xd2bb, 0x001a, 0xd5bb, 0xd7bb, 0xd6bb, 0x001a, 0x001a, 0xd3bb, 0xd4bb, 0x001a, 0xa7e8, 0xa6e8, 0x5bbe, 0xa8e8, 0x001a, 0xa9e8, 0x5cbe, 0x001a, 0x001a, 0x001a, 0x4dec, 0x4bec, 0xf3ee, 0x001a, 0x49ec, 0x4aec, 0x46c0, 0x46ec, 0x4eec, 0x48ec, 0x4cec, 0xefee, 0x001a, 0x001a, 0xf1ee, 0x001a, 0xf2ee, 0xf3c1, 0xeeee, 0xf2c1, 0xf0ee, 0xefc1, 0xf0c1, 0xf1c1, 0x47ec, 0x001a, 0x001a, 0xf5c2, 0x6ef1, 0x6cf1, 0x6df1, 0xf3c2, 0xf6c2, 0xf4c2, 0x001a, 0x001a, 0x001a, 0x77f3, 0x78f3, 0xf6c3, 0x001a, 0x45f5, 0x47f5, 0x46f5, 0xc4c4, 0x50c5, 0x6df6, 0x6cf6, 0x6bf6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfaaa, 0x001a, 0xaac9, 0x001a, 0x58ca, 0xe9a6, 0x56ca, 0x59ca, 0x57ca, 0x001a, 0x001a, 0x001a, 0xaecb, 0x001a, 0xc1a8, 0x001a, 0xc2a8, 0xb0cb, 0xbfa8, 0xafcb, 0xadcb, 0xc0a8, 0xbea8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8cd, 0xdbcd, 0xfdaa, 0xdacd, 0xd9cd, 0x001a, 0xfcaa, 0xfbaa, 0x001a, 0x40ab, 0xdccd, 0xfeaa, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6d0, 0xaead, 0xafad, 0xb0ad, 0xc7d0, 0xc3d0, 0xadad, 0xc4d0, 0x001a, 0xc5d0, 0xc2d0, 0x001a, 0x001a, 0x001a, 0xa4b0, 0x001a, 0x001a, 0xa1b0, 0x45d4, 0xa2b0, 0xa5b0, 0x46d4, 0x001a, 0x7eb0, 0x7cb0, 0x7db0, 0xa3b0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xadb3, 0x49d8, 0xb5b3, 0x48d8, 0x001a, 0x4bd8, 0xb1b3, 0x4ad8, 0xabb6, 0xafb3, 0xb2b3, 0xaeb3, 0xb3b3, 0xb4b3, 0xb0b3, 0x001a, 0x001a, 0x001a, 0x47d8, 0xa7b6, 0x7ddc, 0x001a, 0xa3dc, 0x001a, 0x001a, 0xa2dc, 0xacb6, 0xa8b6, 0xa9b6, 0x7cdc, 0x7edc, 0xa1dc, 0xa4b6, 0xa6b6, 0x001a, 0xaab6, 0xa5b6, 0x001a, 0x001a, 0xd3e0, 0xd1e0, 0xd2e0, 0x6ab9, 0x6bb9, 0x001a, 0xd4e0, 0x69b9, 0xd8bb, 0x001a, 0xdabb, 0xd9bb, 0x001a, 0xbbe4, 0x001a, 0x001a, 0xbce4, 0xabe8, 0x001a, 0xaae8, 0x001a, 0x001a, 0x47c0, 0x48c0, 0x4fec, 0x49c0, 0x001a, 0xf6ee, 0x001a, 0xf4ee, 0x001a, 0xf5ee, 0xf4c1, 0x001a, 0x6ff1, 0xf7c3, 0x001a, 0x001a, 0x001a, 0xf5c1, 0x41ab, 0x001a, 0xa6b0, 0x47d4, 0x001a, 0x001a, 0x4cd8, 0xb6b3, 0xadb6, 0xa4dc, 0xa6dc, 0xafb6, 0xaeb6, 0xb0b6, 0xb1b6, 0xa5dc, 0x6eb9, 0x6fb9, 0x6db9, 0xdbbb, 0x6cb9, 0xd5e0, 0x001a, 0x001a, 0x001a, 0xdcbb, 0xace8, 0x50ec, 0x4ac0, 0xf6c1, 0x70f1, 0x74f1, 0xf9c2, 0x71f1, 0xfac2, 0xf8c2, 0x75f1, 0xfbc2, 0x73f1, 0x001a, 0x79f3, 0xf7c2, 0xf8c3, 0x001a, 0xcdf8, 0x001a, 0x001a, 0x42ab, 0xb8b3, 0xb7b3, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2b6, 0xa8dc, 0xa7dc, 0xb3b6, 0x001a, 0x001a, 0xd9e0, 0x73b9, 0x70b9, 0xd8e0, 0x72b9, 0xd6e0, 0x71b9, 0x001a, 0xd7e0, 0x001a, 0xbde4, 0xddbb, 0x001a, 0xafe8, 0x001a, 0x5dbe, 0xade8, 0x5ebe, 0x5fbe, 0xaee8, 0x60be, 0x001a, 0x51ec, 0x001a, 0x4ec0, 0x4bc0, 0x50c0, 0x53ec, 0x4cc0, 0x52ec, 0x4fc0, 0x001a, 0x001a, 0x4dc0, 0x001a, 0xf9ee, 0xfbee, 0x001a, 0x001a, 0xf7c1, 0xfaee, 0xf8c1, 0xf8ee, 0xf7ee, 0x001a, 0x77f1, 0x76f1, 0xfcc2, 0x78f1, 0x7ef3, 0xfac3, 0x7df3, 0x7af3, 0xf9c3, 0x7bf3, 0x7cf3, 0x001a, 0x48f5, 0x49f5, 0xc5c4, 0x001a, 0x53c5, 0x001a, 0x001a, 0x6ef6, 0x001a, 0x001a, 0x51c5, 0x52c5, 0x6ff6, 0x001a, 0x001a, 0xb4c5, 0xb5c5, 0x71f7, 0x001a, 0x001a, 0x45c6, 0xcff8, 0x47c6, 0x001a, 0xcef8, 0xd0f8, 0x46c6, 0x57f9, 0x001a, 0xadf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x43ab, 0x001a, 0x001a, 0x001a, 0x74b9, 0x001a, 0xbee4, 0x001a, 0xb0e8, 0x51c0, 0x52c0, 0x001a, 0x44ab, 0x001a, 0x61be, 0xfbc3, 0xb1ad, 0x001a, 0x001a, 0x001a, 0x53c0, 0x001a, 0xe2c5, 0xb2ad, 0x4dd8, 0x001a, 0xa9dc, 0x001a, 0xabdc, 0x001a, 0xaadc, 0x001a, 0xdde0, 0xdae0, 0x75b9, 0x001a, 0x76b9, 0xdbe0, 0xdce0, 0x001a, 0xc0e4, 0xc5e4, 0xdebb, 0xbfe4, 0xc1e4, 0xc8e4, 0xc3e4, 0xc7e4, 0xc4e4, 0xc2e4, 0xc6e4, 0xdfbb, 0x001a, 0x001a, 0xb3e8, 0x001a, 0xb1e8, 0x63be, 0x001a, 0x62be, 0xb2e8, 0x64be, 0x001a, 0x001a, 0x001a, 0x001a, 0x56ec, 0x001a, 0x001a, 0x55ec, 0x54c0, 0x54ec, 0xfcee, 0x001a, 0xfeee, 0x41ef, 0x40ef, 0x001a, 0xf9c1, 0xfdee, 0xa1f1, 0xfdc2, 0x7df1, 0xa2f1, 0xfec2, 0x001a, 0x7bf1, 0x001a, 0x7ef1, 0x7cf1, 0x79f1, 0x40c3, 0x7af1, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1f3, 0x001a, 0x001a, 0xa3f3, 0xa2f3, 0x001a, 0x4af5, 0x001a, 0x4bf5, 0x001a, 0x001a, 0x001a, 0x70f6, 0x001a, 0xb7c5, 0x001a, 0xb6c5, 0x4ff8, 0x50f8, 0x48c6, 0xd1f8, 0x001a, 0x69c6, 0x001a, 0xb3ad, 0xb4b6, 0xcae4, 0xc9e4, 0xb5e8, 0xb4e8, 0x001a, 0x001a, 0xfac1, 0x43ef, 0x42ef, 0xa5f1, 0xa3f1, 0xa6f1, 0xa4f1, 0x001a, 0x001a, 0xfcc3, 0xa4f3, 0xa5f3, 0xa6f3, 0x001a, 0x71f6, 0x001a, 0x72f7, 0x001a, 0xd2f8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4ad, 0x001a, 0x001a, 0x57ec, 0x44ef, 0x001a, 0xb5ad, 0x001a, 0x001a, 0xe0bb, 0x001a, 0x58ec, 0x41c3, 0xa7f1, 0xfdc3, 0x001a, 0x4cf5, 0x4df5, 0x54c5, 0x51f8, 0xb6ad, 0xbbb3, 0xbcb3, 0x4ed8, 0xb5b6, 0xb6b6, 0xacdc, 0xb7b6, 0x001a, 0x7ab9, 0x001a, 0x7cb9, 0xdfe0, 0xe0e0, 0xdee0, 0x77b9, 0x78b9, 0x7bb9, 0x79b9, 0x001a, 0x001a, 0xcbe4, 0xe1bb, 0xe2bb, 0x001a, 0x001a, 0xbce8, 0x67be, 0xb7e8, 0xb6e8, 0x001a, 0xbbe8, 0x65be, 0x001a, 0x001a, 0x5bc0, 0x001a, 0xb8e8, 0xbde8, 0xbae8, 0xb9e8, 0x001a, 0x66be, 0x001a, 0x59c0, 0x001a, 0x5aec, 0x55c0, 0x001a, 0x5bec, 0x001a, 0x001a, 0x59ec, 0x001a, 0x58c0, 0x56c0, 0x5ac0, 0x001a, 0x57c0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x45ef, 0x001a, 0x4aef, 0x46ef, 0x49ef, 0xfbc1, 0x001a, 0xd4ed, 0x48ef, 0x47ef, 0x001a, 0x44c3, 0x42c3, 0x45c3, 0x43c3, 0xa8f1, 0xa9f1, 0xaaf1, 0x46c3, 0x001a, 0x001a, 0x001a, 0xaaf3, 0x40c4, 0xa8f3, 0x001a, 0x41c4, 0xa7f3, 0xa9f3, 0xfec3, 0x51f5, 0x4ef5, 0x001a, 0x4ff5, 0x50f5, 0x72f6, 0x56c5, 0x001a, 0x55c5, 0x001a, 0x74f7, 0x73f7, 0xb8c5, 0x001a, 0x001a, 0x001a, 0xe3c5, 0x49c6, 0x60c6, 0x58f9, 0xaef9, 0xaff9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7ad, 0xaddc, 0x001a, 0x001a, 0xe1e0, 0xcce4, 0xcde4, 0xe3bb, 0x001a, 0xe4bb, 0xbee8, 0x68be, 0x001a, 0x001a, 0xfcc1, 0x001a, 0xabf1, 0x001a, 0x47c3, 0xadf3, 0x42c4, 0xacf3, 0xaef3, 0xabf3, 0x75f6, 0x52f5, 0x53f5, 0x001a, 0xc6c4, 0x001a, 0x74f6, 0x001a, 0x001a, 0x73f6, 0x001a, 0x75f7, 0xb0f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8ad, 0x001a, 0x001a, 0x001a, 0xb9ad, 0x001a, 0x001a, 0xa7b0, 0x48d4, 0x001a, 0x4fd8, 0x001a, 0xb8b6, 0x001a, 0xbbb6, 0xb9b6, 0xaedc, 0x001a, 0xbdb6, 0x001a, 0xbab6, 0x001a, 0x001a, 0xbcb6, 0x001a, 0x7eb9, 0x001a, 0xe2e0, 0x001a, 0x001a, 0xe3e0, 0xc0e8, 0x001a, 0x7db9, 0xa1b9, 0xa2b9, 0x001a, 0xcfe4, 0x001a, 0xcee4, 0xe5bb, 0x001a, 0xe6bb, 0x001a, 0xd0e4, 0xbfe8, 0xe8bb, 0x69be, 0x001a, 0xe7bb, 0x001a, 0x001a, 0x001a, 0x5cc0, 0xc1e8, 0x6bbe, 0x6abe, 0xc2e8, 0xc5e8, 0xc3e8, 0xc4e8, 0x6cbe, 0x001a, 0x61c0, 0x5fc0, 0x001a, 0x001a, 0x5ec0, 0x5dec, 0x001a, 0x60c0, 0x001a, 0x001a, 0x5cec, 0x4bef, 0x001a, 0x5eec, 0x5dc0, 0x5fec, 0x4eef, 0x4cef, 0x4def, 0x52ef, 0x4bc3, 0x51ef, 0x54ef, 0x53ef, 0x50ef, 0x4fef, 0x001a, 0xfdc1, 0x001a, 0x001a, 0x001a, 0x001a, 0xaef1, 0x001a, 0xadf1, 0x4ac3, 0x48c3, 0x49c3, 0x001a, 0xacf1, 0x001a, 0xb1f3, 0x001a, 0x43c4, 0x001a, 0xb0f3, 0xaff3, 0x44c4, 0x001a, 0x58f5, 0x57f5, 0x001a, 0x55f5, 0x001a, 0x54f5, 0xc8c4, 0xc7c4, 0x59f5, 0x76f7, 0xb9c5, 0x77f6, 0x57c5, 0x76f6, 0x56f5, 0x001a, 0x77f7, 0xe4c5, 0x001a, 0x61c6, 0x59f9, 0x001a, 0xb1f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbaad, 0x50d8, 0x55ef, 0xbbad, 0x001a, 0x001a, 0xd2e4, 0xd1e4, 0x60ec, 0x001a, 0x001a, 0x57ef, 0x001a, 0x56ef, 0x001a, 0x4cc3, 0xb2f3, 0xb3f3, 0xc9c4, 0x001a, 0x001a, 0xb2f9, 0xa8b0, 0xbfb6, 0xbeb6, 0xe4e0, 0xe6e0, 0xa4b9, 0xe5e0, 0xa3b9, 0xa5b9, 0xe7e0, 0x001a, 0x001a, 0x001a, 0xd4e4, 0xd6e4, 0xd5e4, 0x001a, 0xd8e4, 0x001a, 0x001a, 0x001a, 0xe9bb, 0xd7e4, 0xd3e4, 0x001a, 0x001a, 0x001a, 0xd9e4, 0x001a, 0xcce8, 0x001a, 0xcfe8, 0xd1e8, 0xc7e8, 0xcbe8, 0xc8e8, 0x6ebe, 0x71be, 0x73be, 0xc9e8, 0xcae8, 0x72be, 0xcde8, 0xd0e8, 0xcee8, 0x74be, 0x001a, 0x70be, 0xc6e8, 0x6dbe, 0x001a, 0x6fbe, 0x001a, 0x001a, 0x63c0, 0x66ec, 0x64ec, 0x63ec, 0x001a, 0x69ec, 0x001a, 0x68ec, 0x67ec, 0x001a, 0x62ec, 0x62c0, 0x61ec, 0x001a, 0x65ec, 0x64c0, 0x001a, 0x001a, 0x5aef, 0x001a, 0x5eef, 0x5bef, 0x5def, 0x5cef, 0x59ef, 0x5fef, 0x62ef, 0x60ef, 0x61ef, 0x40c2, 0x001a, 0xfec1, 0x58ef, 0x63ef, 0xb3f1, 0xb6f1, 0xb8f1, 0xb7f1, 0x001a, 0xb1f1, 0xb5f1, 0xb0f1, 0x001a, 0xb2f1, 0x4dc3, 0xaff1, 0x001a, 0xb4f1, 0x001a, 0x001a, 0xc0f3, 0xb5f3, 0x45c4, 0x001a, 0x001a, 0x46c4, 0xb4f3, 0xb9f3, 0xbff3, 0xb7f3, 0xbef3, 0x001a, 0xbbf3, 0x001a, 0xbaf3, 0xbdf3, 0xb8f3, 0xb6f3, 0x001a, 0xbcf3, 0x001a, 0x60f5, 0x5ef5, 0xcac4, 0x5df5, 0x63f5, 0x61f5, 0x001a, 0xcbc4, 0x5cf5, 0x5af5, 0x001a, 0x5bf5, 0xcdc4, 0x5ff5, 0xccc4, 0x62f5, 0x78f6, 0x7ef6, 0x001a, 0x001a, 0x79f6, 0x5bc5, 0xa1f6, 0x5ac5, 0x7df6, 0x7cf6, 0x59c5, 0x7bf6, 0x58c5, 0x7af6, 0x001a, 0x7df7, 0xa1f7, 0x7ef7, 0x001a, 0x7bf7, 0xbbc5, 0x78f7, 0x7cf7, 0xa3f7, 0x001a, 0xa2f7, 0x79f7, 0x7af7, 0xbac5, 0x52f8, 0xe7c5, 0x001a, 0x53f8, 0xe5c5, 0xe6c5, 0x001a, 0x001a, 0xd3f8, 0x4ac6, 0x76f9, 0x001a, 0x6ac6, 0x001a, 0xb3f9, 0x6bc6, 0xb4f9, 0xb5f9, 0xc3f9, 0xc2f9, 0x7ac6, 0xcdf9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9b0, 0x001a, 0x001a, 0xe9e0, 0x001a, 0xe8e0, 0x001a, 0xeabb, 0xebbb, 0xdae4, 0x001a, 0xd2e8, 0x6cec, 0x001a, 0x001a, 0x75be, 0x65c0, 0x6aec, 0x001a, 0x6dec, 0x66c0, 0x001a, 0x64ef, 0x6bec, 0xb9f1, 0x4ec3, 0xc1f3, 0x001a, 0x001a, 0x001a, 0x66f5, 0x64f5, 0x001a, 0x001a, 0x65f5, 0x001a, 0x001a, 0xa2f6, 0x001a, 0x5cc5, 0xa4f7, 0xeac5, 0xbcc5, 0xe8c5, 0xe9c5, 0xd4f8, 0x62c6, 0x001a, 0xaab0, 0x001a, 0x001a, 0x001a, 0xbaf1, 0x001a, 0x001a, 0x49d4, 0x001a, 0xa6b9, 0x001a, 0xdbe4, 0x001a, 0x001a, 0xecbb, 0xdce4, 0x001a, 0x001a, 0x001a, 0xd4e8, 0xd3e8, 0x68c0, 0x76be, 0x77be, 0x001a, 0xd7e8, 0xd6e8, 0xd5e8, 0x001a, 0x001a, 0x6eec, 0x71ec, 0x001a, 0x70ec, 0x6fec, 0x67c0, 0x68ef, 0x66ef, 0x65ef, 0x001a, 0x001a, 0x67ef, 0x001a, 0x4fc3, 0xbcf1, 0xbdf1, 0x50c3, 0x001a, 0xbbf1, 0x001a, 0xc3f3, 0xc2f3, 0xc5f3, 0x47c4, 0xc4f3, 0x001a, 0x67f5, 0x69f5, 0x68f5, 0x001a, 0x001a, 0xa3f6, 0xa6f6, 0xa4f6, 0xa5f6, 0xa5f7, 0xbdc5, 0x001a, 0x001a, 0x001a, 0x54f8, 0x55f8, 0x56f8, 0x001a, 0x4bc6, 0x63c6, 0xb6f9, 0xabb0, 0x001a, 0x78be, 0x69c0, 0xbef1, 0x001a, 0xa6f7, 0x001a, 0x001a, 0xc4f9, 0x4ad4, 0x001a, 0x7bc6, 0xacb0, 0x72ec, 0x001a, 0xbff1, 0x001a, 0xc6f3, 0x001a, 0x001a, 0xa7f6, 0xa7f7, 0xadb0, 0x001a, 0xdde4, 0xdee4, 0x001a, 0xedbb, 0xeebb, 0xd9e8, 0x7abe, 0x79be, 0xd8e8, 0x001a, 0x69ef, 0x001a, 0xc0f1, 0xc2f1, 0xc1f1, 0x53c3, 0x52c3, 0x51c3, 0x001a, 0x5ec5, 0xa8f6, 0x001a, 0x5dc5, 0xa9f7, 0xa8f7, 0x001a, 0x4cc6, 0xd5f8, 0xbdb3, 0xeae0, 0x001a, 0x001a, 0x001a, 0xe1e4, 0xdfe4, 0xe0e4, 0x001a, 0x001a, 0xe2e8, 0x001a, 0xdde8, 0xdae8, 0xe1e8, 0x001a, 0x001a, 0x001a, 0xe3e8, 0x001a, 0x001a, 0x7cbe, 0xe0e8, 0xdce8, 0x001a, 0x001a, 0xdbe8, 0xdfe8, 0xdee8, 0x7bbe, 0x001a, 0x001a, 0x7dec, 0x78ec, 0x76ec, 0xa1ec, 0x77ec, 0x001a, 0x73ec, 0x001a, 0x79ec, 0x001a, 0x001a, 0x74ec, 0x72ef, 0x75ec, 0xa2ec, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7cec, 0x6ac0, 0x7bec, 0x7aec, 0x001a, 0x7eec, 0x001a, 0x001a, 0x001a, 0x001a, 0x6aef, 0x6def, 0x001a, 0x001a, 0x6cef, 0x001a, 0x74ef, 0x6fef, 0x73ef, 0x001a, 0x71ef, 0x70ef, 0x6eef, 0x001a, 0x6bef, 0x001a, 0x43c2, 0x42c2, 0x001a, 0x44c2, 0x41c2, 0x75ef, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8f1, 0xcbf1, 0x001a, 0xc9f1, 0xcdf1, 0x001a, 0x001a, 0x001a, 0xcef1, 0x001a, 0xc6f1, 0x58c3, 0xc7f1, 0x001a, 0xc5f1, 0xccf1, 0x001a, 0xc4f1, 0xc3f1, 0x57c3, 0x55c3, 0x54c3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaf1, 0xcff3, 0xd5f3, 0x4ac4, 0xd0f3, 0x001a, 0xd3f3, 0xd7f3, 0x4bc4, 0xd2f3, 0x001a, 0xcaf3, 0x001a, 0xc9f3, 0xd6f3, 0xcdf3, 0x001a, 0xcbf3, 0xd4f3, 0xccf3, 0x49c4, 0x48c4, 0x001a, 0xc7f3, 0xc8f3, 0xd1f3, 0x001a, 0x001a, 0x001a, 0xcef3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6cf5, 0x6ff5, 0x001a, 0x001a, 0x001a, 0x001a, 0x56c3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6df5, 0x73f5, 0x71f5, 0x6bf5, 0x76f5, 0x001a, 0x6af5, 0x001a, 0xcfc4, 0x72f5, 0x001a, 0x001a, 0x001a, 0x6ef5, 0xcec4, 0x75f5, 0x001a, 0x001a, 0x74f5, 0x001a, 0x001a, 0x001a, 0x001a, 0xabf6, 0xaaf6, 0x001a, 0x001a, 0x001a, 0xb1f6, 0x001a, 0xadf6, 0xb0f6, 0x60c5, 0x001a, 0x001a, 0xaef6, 0xaff6, 0x001a, 0xa9f6, 0xacf6, 0x5fc5, 0x001a, 0x001a, 0x001a, 0xbfc5, 0xb4f7, 0xaff7, 0xb3f7, 0x001a, 0xb6f7, 0xb2f7, 0x001a, 0xaef7, 0x001a, 0xc1c5, 0xb1f7, 0xb5f7, 0xc0c5, 0xacf7, 0x70f5, 0xb0f7, 0x001a, 0x001a, 0xadf7, 0x001a, 0xaaf7, 0x001a, 0xabf7, 0xbec5, 0x5af8, 0x5cf8, 0x5ff8, 0x5bf8, 0x60f8, 0x001a, 0x59f8, 0x001a, 0x57f8, 0x001a, 0xebc5, 0x5df8, 0xedc5, 0xecc5, 0x58f8, 0x5ef8, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaf8, 0x4dc6, 0xdbf8, 0x001a, 0xd9f8, 0xd6f8, 0x001a, 0x001a, 0xd8f8, 0xd7f8, 0x5af9, 0x001a, 0x001a, 0x001a, 0x001a, 0x5cf9, 0x5bf9, 0x001a, 0x001a, 0x79f9, 0x001a, 0x78f9, 0x77f9, 0x7af9, 0x001a, 0x73c6, 0x74c6, 0xcaf9, 0xcef9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbeb3, 0xafdc, 0xede0, 0x001a, 0xa7b9, 0xebe0, 0x001a, 0x001a, 0xece0, 0x001a, 0x001a, 0x001a, 0xe2e4, 0xe3e4, 0xf1bb, 0xefbb, 0xe4e4, 0xf0bb, 0xe8e8, 0x001a, 0xebe8, 0xe5e8, 0xece8, 0xe4e8, 0xe6e8, 0x001a, 0xe7e8, 0xeae8, 0x001a, 0x001a, 0xa1be, 0xefe8, 0xeee8, 0x7dbe, 0xe9e8, 0xede8, 0x7ebe, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xacec, 0x001a, 0x6fc0, 0x001a, 0xa7ec, 0x6bc0, 0x001a, 0xa4ec, 0xaaec, 0xadec, 0x001a, 0x70c0, 0x001a, 0xa9ec, 0xa6ec, 0xaeec, 0xa5ec, 0x001a, 0xabec, 0x6cc0, 0x001a, 0xa3ec, 0x6dc0, 0x001a, 0x6ec0, 0xa8ec, 0x001a, 0x001a, 0x001a, 0xa9ef, 0x7aef, 0x7bef, 0x7eef, 0x7cef, 0x001a, 0x76ef, 0x001a, 0x001a, 0x79ef, 0xa5ef, 0x7def, 0x001a, 0x001a, 0x45c2, 0x001a, 0xa7ef, 0xa4ef, 0x46c2, 0xa6ef, 0x77ef, 0xa2ef, 0xa3ef, 0x001a, 0xa1ef, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2f1, 0xd4f1, 0xd7f1, 0x001a, 0x001a, 0xd1f1, 0x001a, 0x59c3, 0xd9f1, 0xd0f1, 0xdaf1, 0x001a, 0xd6f1, 0xd8f1, 0xdcf1, 0xd5f1, 0xddf1, 0xd3f1, 0xcff1, 0x5ac3, 0x001a, 0xdbf1, 0x5bc3, 0x4dc4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x78ef, 0xf1f3, 0xe8f3, 0x4fc4, 0xe4f3, 0x50c4, 0x001a, 0x001a, 0xedf3, 0xe7f3, 0xddf3, 0x4ec4, 0xeaf3, 0xe5f3, 0xe6f3, 0x001a, 0xd8f3, 0xdff3, 0xeef3, 0x001a, 0xebf3, 0x001a, 0xe3f3, 0x001a, 0xeff3, 0xdef3, 0xd9f3, 0xecf3, 0x001a, 0xdbf3, 0xe9f3, 0xe0f3, 0xf0f3, 0xdcf3, 0x4cc4, 0xdaf3, 0xe1f3, 0xe2f3, 0x001a, 0x001a, 0x001a, 0x7df5, 0x001a, 0x7bf5, 0x001a, 0xa2f5, 0x001a, 0xaef5, 0xa5f5, 0x7cf5, 0x78f5, 0xa7f5, 0x7ef5, 0xa3f5, 0x7af5, 0xaaf5, 0x77f5, 0xa1f5, 0xa6f5, 0xa8f5, 0xabf5, 0x79f5, 0x001a, 0xaff5, 0xb0f5, 0xa9f5, 0xadf5, 0xa4f5, 0x001a, 0xc1f6, 0xc4f6, 0x001a, 0x61c5, 0x001a, 0xc3f6, 0xc8f6, 0xc6f6, 0x62c5, 0xbdf6, 0xb3f6, 0xb2f6, 0x64c5, 0xbff6, 0xc0f6, 0xbcf6, 0xb4f6, 0x001a, 0xb9f6, 0xacf5, 0x001a, 0xb5f6, 0x63c5, 0xbbf6, 0x001a, 0xbaf6, 0x001a, 0xb6f6, 0xc2f6, 0x001a, 0xb7f6, 0xbbf7, 0xc5f6, 0xc7f6, 0xbef6, 0xb8f6, 0xbcf7, 0xbef7, 0xb8f7, 0xc2c5, 0x001a, 0xc5f7, 0xc3f7, 0xc3c5, 0xc2f7, 0xc1f7, 0xbaf7, 0xb7f7, 0xbdf7, 0xc6f7, 0xb9f7, 0xbff7, 0x001a, 0x69f8, 0x6ef8, 0x64f8, 0x67f8, 0xeec5, 0x6bf8, 0x001a, 0x72f8, 0xc0f7, 0x001a, 0x65f8, 0x6ff8, 0x73f8, 0x6af8, 0x63f8, 0x6df8, 0x001a, 0x6cf8, 0x71f8, 0x70f8, 0xc4f7, 0x68f8, 0x62f8, 0x66f8, 0x4ec6, 0x4fc6, 0x61f8, 0x001a, 0xe6f8, 0xddf8, 0xe5f8, 0xe2f8, 0xe3f8, 0xdcf8, 0xdff8, 0xe7f8, 0xe1f8, 0xe0f8, 0xdef8, 0x001a, 0xe4f8, 0x001a, 0x5df9, 0x001a, 0x5ef9, 0x001a, 0x60f9, 0x5ff9, 0x62f9, 0x61f9, 0x7cf9, 0x7bf9, 0xb7f9, 0x001a, 0xb8f9, 0x001a, 0xc5f9, 0x78c6, 0x7cc6, 0x001a, 0xcff9, 0x7dc6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfb3, 0x001a, 0x001a, 0x001a, 0xd0c4, 0xc9f6, 0x001a, 0x50c6, 0x51c6, 0x001a, 0xc0b3, 0xeee0, 0x001a, 0xa8b9, 0xf0e8, 0x001a, 0x001a, 0xb0ec, 0xb1ec, 0xafec, 0xabef, 0xaaef, 0x47c2, 0xdff1, 0xacef, 0xdef1, 0x001a, 0x001a, 0xf3f3, 0x51c4, 0x53c4, 0xf2f3, 0x001a, 0x001a, 0x52c4, 0x001a, 0xb1f5, 0xb3f5, 0xb2f5, 0xcaf6, 0x65c5, 0x001a, 0xefc5, 0xe8f8, 0x63f9, 0x001a, 0x001a, 0xd2f9, 0xc1b3, 0x001a, 0xe5e4, 0x001a, 0xa2be, 0x001a, 0x001a, 0x001a, 0xb3ec, 0xb2ec, 0x001a, 0xadef, 0x001a, 0x001a, 0x001a, 0x54c4, 0xd1c4, 0xc7f7, 0xcbf9, 0x001a, 0x001a, 0x001a, 0xc2b3, 0xf2bb, 0x001a, 0xa3be, 0x001a, 0xf4f3, 0x001a, 0x74f8, 0xc0b6, 0x001a, 0x001a, 0x001a, 0x001a, 0xaeef, 0x001a, 0x001a, 0x001a, 0x64c6, 0xc1b6, 0xa4be, 0x48c2, 0x75f8, 0xc2b6, 0x001a, 0xf1e8, 0x72c0, 0xb4ec, 0xb5ec, 0x001a, 0x71c0, 0x001a, 0xafef, 0x4cc2, 0x4ac2, 0x4bc2, 0x49c2, 0xe0f1, 0x5cc3, 0x001a, 0x001a, 0x001a, 0xb5f5, 0xb4f5, 0xb7f5, 0xb6f5, 0xd2c4, 0x001a, 0x001a, 0xcbf6, 0x001a, 0xcdf6, 0xccf6, 0x66c5, 0xc8f7, 0x001a, 0x76f8, 0x77f8, 0xf0c5, 0x64f9, 0x7df9, 0x75c6, 0x001a, 0xb0dc, 0xb6ec, 0xb0ef, 0xf5f3, 0xefe0, 0x001a, 0xb1ef, 0xe2f1, 0xe1f1, 0x001a, 0x001a, 0x001a, 0x001a, 0x78f8, 0x52c6, 0x001a, 0x65f9, 0x7ef9, 0x001a, 0x001a, 0x001a, 0xa9b9, 0xf2e8, 0xf3e8, 0x001a, 0xb7ec, 0xaab9, 0x001a, 0x5dc3, 0xe3f1, 0x001a, 0xcff6, 0x67c5, 0xd0f6, 0xcef6, 0x79f8, 0x001a, 0xe9f8, 0x001a, 0xabb9, 0x001a, 0xb4ef, 0xb3ef, 0xb2ef, 0xe4f1, 0x001a, 0x001a, 0xe8f1, 0xe7f1, 0xe6f1, 0xe5f1, 0x5ec3, 0xf6f3, 0xb9f5, 0xd3c4, 0xb8f5, 0xd1f6, 0xcbf7, 0xcaf7, 0xc4c5, 0xc9f7, 0x7cf8, 0x7bf8, 0x7af8, 0x001a, 0x001a, 0xf3bb, 0x001a, 0xb8ec, 0x4dc2, 0x001a, 0xf7f3, 0xf8f3, 0xccf7, 0x7df8, 0x001a, 0x001a, 0xeaf8, 0x66f9, 0xb9f9, 0xd4f9, 0xf4bb, 0x4ec2, 0xe9f1, 0xf9f3, 0xd2f6, 0x7ef8, 0x001a, 0x001a, 0xa6be, 0x001a, 0xb5ef, 0xeaf1, 0xfaf3, 0xfbf3, 0xfcf3, 0xbef5, 0x001a, 0xbaf5, 0x68c5, 0xbdf5, 0xbcf5, 0xd4c4, 0xbbf5, 0xd6c4, 0x001a, 0xd5c4, 0xd4f6, 0xd3f6, 0x69c5, 0x6ac5, 0x001a, 0x001a, 0xc6c5, 0xcdf7, 0xc5c5, 0x001a, 0xa3f8, 0xa4f8, 0xa2f8, 0xa1f8, 0x54c6, 0x001a, 0xebf8, 0xecf8, 0xedf8, 0x53c6, 0x67f9, 0x6af9, 0x69f9, 0x68f9, 0x001a, 0x001a, 0xd3f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73c0, 0x001a, 0x001a, 0x65c3, 0xbff5, 0xd5f6, 0x001a, 0xc7c5, 0xcef7, 0x001a, 0x001a, 0xd5f9, 0x001a, 0x001a, 0x001a, 0x74c0, 0x001a, 0x001a, 0x001a, 0xb6ef, 0x001a, 0xcff7, 0x001a, 0xa1f9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfa00[ 64 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ac9, 0xfcdd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfe00[ 512 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4aa1, 0x57a1, 0x001a, 0x59a1, 0x5ba1, 0x5fa1, 0x60a1, 0x63a1, 0x64a1, 0x67a1, 0x68a1, 0x6ba1, 0x6ca1, 0x6fa1, 0x70a1, 0x73a1, 0x74a1, 0x77a1, 0x78a1, 0x7ba1, 0x7ca1, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6a1, 0xc7a1, 0xcaa1, 0xcba1, 0xc8a1, 0xc9a1, 0x5ca1, 0x4da1, 0x4ea1, 0x4fa1, 0x001a, 0x51a1, 0x52a1, 0x53a1, 0x54a1, 0x001a, 0x7da1, 0x7ea1, 0xa1a1, 0xa2a1, 0xa3a1, 0xa4a1, 0xcca1, 0xcda1, 0xcea1, 0xdea1, 0xdfa1, 0xe0a1, 0xe1a1, 0xe2a1, 0x001a, 0x42a2, 0x4ca2, 0x4da2, 0x4ea2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x49a1, 0x001a, 0xada1, 0x43a2, 0x48a2, 0xaea1, 0x001a, 0x5da1, 0x5ea1, 0xafa1, 0xcfa1, 0x41a1, 0xd0a1, 0x44a1, 0xfea1, 0xafa2, 0xb0a2, 0xb1a2, 0xb2a2, 0xb3a2, 0xb4a2, 0xb5a2, 0xb6a2, 0xb7a2, 0xb8a2, 0x47a1, 0x46a1, 0xd5a1, 0xd7a1, 0xd6a1, 0x48a1, 0x49a2, 0xcfa2, 0xd0a2, 0xd1a2, 0xd2a2, 0xd3a2, 0xd4a2, 0xd5a2, 0xd6a2, 0xd7a2, 0xd8a2, 0xd9a2, 0xdaa2, 0xdba2, 0xdca2, 0xdda2, 0xdea2, 0xdfa2, 0xe0a2, 0xe1a2, 0xe2a2, 0xe3a2, 0xe4a2, 0xe5a2, 0xe6a2, 0xe7a2, 0xe8a2, 0x001a, 0x40a2, 0x001a, 0x001a, 0xc4a1, 0x001a, 0xe9a2, 0xeaa2, 0xeba2, 0xeca2, 0xeda2, 0xeea2, 0xefa2, 0xf0a2, 0xf1a2, 0xf2a2, 0xf3a2, 0xf4a2, 0xf5a2, 0xf6a2, 0xf7a2, 0xf8a2, 0xf9a2, 0xfaa2, 0xfba2, 0xfca2, 0xfda2, 0xfea2, 0x40a3, 0x41a3, 0x42a3, 0x43a3, 0x61a1, 0x55a1, 0x62a1, 0xe3a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x46a2, 0x47a2, 0x001a, 0xc3a1, 0x001a, 0x44a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; /* Determines the size of a byte stream character from an Unicode character * Adds the size to the byte stream character size value * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_950_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_950_unicode_character_size_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream character size.", function ); return( -1 ); } if( unicode_character < 0x80 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x02c0 ) && ( unicode_character < 0x0400 ) ) { unicode_character -= 0x02c0; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x02c0[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2300 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x2500 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2500; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x2500[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fc0 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xfa00 ) && ( unicode_character < 0xfa40 ) ) { unicode_character -= 0xfa00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfa00[ unicode_character ]; } else if( ( unicode_character >= 0xfe00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xfe00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfe00[ unicode_character ]; } byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_character_size += 2; } else { *byte_stream_character_size += 1; } return( 1 ); } /* Copies an Unicode character from a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_950_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_950_copy_from_byte_stream"; uint8_t additional_character = 0; uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } byte_stream_character = byte_stream[ *byte_stream_index ]; if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) { *byte_stream_index += 1; additional_character = byte_stream[ *byte_stream_index ]; if( ( byte_stream_character >= 0xa1 ) && ( byte_stream_character <= 0xa2 ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xa1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa140[ additional_character ]; break; case 0xa2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa240[ additional_character ]; break; } } else if( ( additional_character >= 0xa1 ) && ( additional_character < 0xff ) ) { additional_character -= 0xa1; switch( byte_stream_character ) { case 0xa1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa1a1[ additional_character ]; break; case 0xa2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa2a1[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa3 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa340[ additional_character ]; } else if( ( additional_character >= 0xa1 ) && ( additional_character < 0xc0 ) ) { additional_character -= 0xa1; *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa3a1[ additional_character ]; } else if( additional_character == 0xe1 ) { *unicode_character = 0x20ac; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xa4 ) && ( byte_stream_character <= 0xc5 ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xa4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa440[ additional_character ]; break; case 0xa5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa540[ additional_character ]; break; case 0xa6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa640[ additional_character ]; break; case 0xa7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa740[ additional_character ]; break; case 0xa8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa840[ additional_character ]; break; case 0xa9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa940[ additional_character ]; break; case 0xaa: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaa40[ additional_character ]; break; case 0xab: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xab40[ additional_character ]; break; case 0xac: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xac40[ additional_character ]; break; case 0xad: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xad40[ additional_character ]; break; case 0xae: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xae40[ additional_character ]; break; case 0xaf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaf40[ additional_character ]; break; case 0xb0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb040[ additional_character ]; break; case 0xb1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb140[ additional_character ]; break; case 0xb2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb240[ additional_character ]; break; case 0xb3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb340[ additional_character ]; break; case 0xb4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb440[ additional_character ]; break; case 0xb5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb540[ additional_character ]; break; case 0xb6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb640[ additional_character ]; break; case 0xb7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb740[ additional_character ]; break; case 0xb8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb840[ additional_character ]; break; case 0xb9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb940[ additional_character ]; break; case 0xba: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xba40[ additional_character ]; break; case 0xbb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbb40[ additional_character ]; break; case 0xbc: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbc40[ additional_character ]; break; case 0xbd: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbd40[ additional_character ]; break; case 0xbe: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbe40[ additional_character ]; break; case 0xbf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbf40[ additional_character ]; break; case 0xc0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc040[ additional_character ]; break; case 0xc1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc140[ additional_character ]; break; case 0xc2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc240[ additional_character ]; break; case 0xc3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc340[ additional_character ]; break; case 0xc4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc440[ additional_character ]; break; case 0xc5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc540[ additional_character ]; break; } } else if( ( additional_character >= 0xa1 ) && ( additional_character < 0xff ) ) { additional_character -= 0xa1; switch( byte_stream_character ) { case 0xa4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa4a1[ additional_character ]; break; case 0xa5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa5a1[ additional_character ]; break; case 0xa6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa6a1[ additional_character ]; break; case 0xa7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa7a1[ additional_character ]; break; case 0xa8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa8a1[ additional_character ]; break; case 0xa9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa9a1[ additional_character ]; break; case 0xaa: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaaa1[ additional_character ]; break; case 0xab: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaba1[ additional_character ]; break; case 0xac: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaca1[ additional_character ]; break; case 0xad: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xada1[ additional_character ]; break; case 0xae: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaea1[ additional_character ]; break; case 0xaf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xafa1[ additional_character ]; break; case 0xb0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb0a1[ additional_character ]; break; case 0xb1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb1a1[ additional_character ]; break; case 0xb2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb2a1[ additional_character ]; break; case 0xb3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb3a1[ additional_character ]; break; case 0xb4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb4a1[ additional_character ]; break; case 0xb5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb5a1[ additional_character ]; break; case 0xb6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb6a1[ additional_character ]; break; case 0xb7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb7a1[ additional_character ]; break; case 0xb8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb8a1[ additional_character ]; break; case 0xb9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb9a1[ additional_character ]; break; case 0xba: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbaa1[ additional_character ]; break; case 0xbb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbba1[ additional_character ]; break; case 0xbc: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbca1[ additional_character ]; break; case 0xbd: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbda1[ additional_character ]; break; case 0xbe: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbea1[ additional_character ]; break; case 0xbf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbfa1[ additional_character ]; break; case 0xc0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc0a1[ additional_character ]; break; case 0xc1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc1a1[ additional_character ]; break; case 0xc2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc2a1[ additional_character ]; break; case 0xc3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc3a1[ additional_character ]; break; case 0xc4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc4a1[ additional_character ]; break; case 0xc5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc5a1[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xc6 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc640[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xc9 ) && ( byte_stream_character <= 0xf9 ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xc9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc940[ additional_character ]; break; case 0xca: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xca40[ additional_character ]; break; case 0xcb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcb40[ additional_character ]; break; case 0xcc: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcc40[ additional_character ]; break; case 0xcd: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcd40[ additional_character ]; break; case 0xce: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xce40[ additional_character ]; break; case 0xcf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcf40[ additional_character ]; break; case 0xd0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd040[ additional_character ]; break; case 0xd1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd140[ additional_character ]; break; case 0xd2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd240[ additional_character ]; break; case 0xd3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd340[ additional_character ]; break; case 0xd4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd440[ additional_character ]; break; case 0xd5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd540[ additional_character ]; break; case 0xd6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd640[ additional_character ]; break; case 0xd7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd740[ additional_character ]; break; case 0xd8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd840[ additional_character ]; break; case 0xd9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd940[ additional_character ]; break; case 0xda: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xda40[ additional_character ]; break; case 0xdb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdb40[ additional_character ]; break; case 0xdc: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdc40[ additional_character ]; break; case 0xdd: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdd40[ additional_character ]; break; case 0xde: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xde40[ additional_character ]; break; case 0xdf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdf40[ additional_character ]; break; case 0xe0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe040[ additional_character ]; break; case 0xe1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe140[ additional_character ]; break; case 0xe2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe240[ additional_character ]; break; case 0xe3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe340[ additional_character ]; break; case 0xe4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe440[ additional_character ]; break; case 0xe5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe540[ additional_character ]; break; case 0xe6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe640[ additional_character ]; break; case 0xe7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe740[ additional_character ]; break; case 0xe8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe840[ additional_character ]; break; case 0xe9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe940[ additional_character ]; break; case 0xea: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xea40[ additional_character ]; break; case 0xeb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeb40[ additional_character ]; break; case 0xec: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xec40[ additional_character ]; break; case 0xed: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xed40[ additional_character ]; break; case 0xee: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xee40[ additional_character ]; break; case 0xef: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xef40[ additional_character ]; break; case 0xf0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf040[ additional_character ]; break; case 0xf1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf140[ additional_character ]; break; case 0xf2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf240[ additional_character ]; break; case 0xf3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf340[ additional_character ]; break; case 0xf4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf440[ additional_character ]; break; case 0xf5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf540[ additional_character ]; break; case 0xf6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf640[ additional_character ]; break; case 0xf7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf740[ additional_character ]; break; case 0xf8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf840[ additional_character ]; break; case 0xf9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf940[ additional_character ]; break; } } else if( ( additional_character >= 0xa1 ) && ( additional_character < 0xff ) ) { additional_character -= 0xa1; switch( byte_stream_character ) { case 0xc9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc9a1[ additional_character ]; break; case 0xca: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcaa1[ additional_character ]; break; case 0xcb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcba1[ additional_character ]; break; case 0xcc: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcca1[ additional_character ]; break; case 0xcd: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcda1[ additional_character ]; break; case 0xce: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcea1[ additional_character ]; break; case 0xcf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcfa1[ additional_character ]; break; case 0xd0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd0a1[ additional_character ]; break; case 0xd1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd1a1[ additional_character ]; break; case 0xd2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd2a1[ additional_character ]; break; case 0xd3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd3a1[ additional_character ]; break; case 0xd4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd4a1[ additional_character ]; break; case 0xd5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd5a1[ additional_character ]; break; case 0xd6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd6a1[ additional_character ]; break; case 0xd7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd7a1[ additional_character ]; break; case 0xd8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd8a1[ additional_character ]; break; case 0xd9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd9a1[ additional_character ]; break; case 0xda: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdaa1[ additional_character ]; break; case 0xdb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdba1[ additional_character ]; break; case 0xdc: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdca1[ additional_character ]; break; case 0xdd: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdda1[ additional_character ]; break; case 0xde: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdea1[ additional_character ]; break; case 0xdf: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdfa1[ additional_character ]; break; case 0xe0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe0a1[ additional_character ]; break; case 0xe1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe1a1[ additional_character ]; break; case 0xe2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe2a1[ additional_character ]; break; case 0xe3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe3a1[ additional_character ]; break; case 0xe4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe4a1[ additional_character ]; break; case 0xe5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe5a1[ additional_character ]; break; case 0xe6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe6a1[ additional_character ]; break; case 0xe7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe7a1[ additional_character ]; break; case 0xe8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe8a1[ additional_character ]; break; case 0xe9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe9a1[ additional_character ]; break; case 0xea: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeaa1[ additional_character ]; break; case 0xeb: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeba1[ additional_character ]; break; case 0xec: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeca1[ additional_character ]; break; case 0xed: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeda1[ additional_character ]; break; case 0xee: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeea1[ additional_character ]; break; case 0xef: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xefa1[ additional_character ]; break; case 0xf0: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf0a1[ additional_character ]; break; case 0xf1: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf1a1[ additional_character ]; break; case 0xf2: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf2a1[ additional_character ]; break; case 0xf3: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf3a1[ additional_character ]; break; case 0xf4: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf4a1[ additional_character ]; break; case 0xf5: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf5a1[ additional_character ]; break; case 0xf6: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf6a1[ additional_character ]; break; case 0xf7: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf7a1[ additional_character ]; break; case 0xf8: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf8a1[ additional_character ]; break; case 0xf9: *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf9a1[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } *byte_stream_index += 1; return( 1 ); } /* Copies an Unicode character to a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_950_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_950_copy_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } if( unicode_character < 0x80 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x02c0 ) && ( unicode_character < 0x0400 ) ) { unicode_character -= 0x02c0; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x02c0[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2300 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x2500 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2500; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x2500[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fc0 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xfa00 ) && ( unicode_character < 0xfa40 ) ) { unicode_character -= 0xfa00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfa00[ unicode_character ]; } else if( ( unicode_character >= 0xfe00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xfe00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfe00[ unicode_character ]; } byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_index += 1; byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); } *byte_stream_index += 1; return( 1 ); } libewf-20140807/libuna/libuna_utf8_string.h0000664000175000017500000002141013443450072022562 0ustar00lordyestalordyesta00000000000000/* * UTF-8 string functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF8_STRING_H ) #define _LIBUNA_UTF8_STRING_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf8_string_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, int codepage, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_byte_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_byte_stream is implemented by * libuna_byte_stream_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_byte_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_byte_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_size_from_utf7_stream( const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_utf7_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_utf7_stream is implemented by * libuna_utf7_stream_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_utf7_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_utf7_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_size_from_utf8_stream( const uint8_t *utf8_stream, size_t utf8_stream_size, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_utf8_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_utf8_stream is implemented by * libuna_utf8_stream_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_utf8_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_utf8_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_utf16( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_utf16( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_utf16( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_size_from_utf16_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_utf16_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_utf16_stream is implemented by * libuna_utf16_stream_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_utf16_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_utf16_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_utf32( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_utf32( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_utf32( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_size_from_utf32_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, size_t *utf8_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_copy_from_utf32_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); /* The functionality for libuna_utf8_string_copy_to_utf32_stream is implemented by * libuna_utf32_stream_copy_from_utf8 */ LIBUNA_EXTERN \ int libuna_utf8_string_with_index_copy_from_utf32_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_string_compare_with_utf32_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF8_STRING_H ) */ libewf-20140807/libuna/libuna_codepage_windows_936.c0000664000175000017500000151072113443450072024234 0ustar00lordyestalordyesta00000000000000/* * Windows 936 codepage (Chinese Simplified) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_936.h" #include "libuna_libcerror.h" #include "libuna_types.h" /* Extended ASCII to Unicode character lookup table for Windows 936 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8140[ 192 ] = { 0x4e02, 0x4e04, 0x4e05, 0x4e06, 0x4e0f, 0x4e12, 0x4e17, 0x4e1f, 0x4e20, 0x4e21, 0x4e23, 0x4e26, 0x4e29, 0x4e2e, 0x4e2f, 0x4e31, 0x4e33, 0x4e35, 0x4e37, 0x4e3c, 0x4e40, 0x4e41, 0x4e42, 0x4e44, 0x4e46, 0x4e4a, 0x4e51, 0x4e55, 0x4e57, 0x4e5a, 0x4e5b, 0x4e62, 0x4e63, 0x4e64, 0x4e65, 0x4e67, 0x4e68, 0x4e6a, 0x4e6b, 0x4e6c, 0x4e6d, 0x4e6e, 0x4e6f, 0x4e72, 0x4e74, 0x4e75, 0x4e76, 0x4e77, 0x4e78, 0x4e79, 0x4e7a, 0x4e7b, 0x4e7c, 0x4e7d, 0x4e7f, 0x4e80, 0x4e81, 0x4e82, 0x4e83, 0x4e84, 0x4e85, 0x4e87, 0x4e8a, 0xfffd, 0x4e90, 0x4e96, 0x4e97, 0x4e99, 0x4e9c, 0x4e9d, 0x4e9e, 0x4ea3, 0x4eaa, 0x4eaf, 0x4eb0, 0x4eb1, 0x4eb4, 0x4eb6, 0x4eb7, 0x4eb8, 0x4eb9, 0x4ebc, 0x4ebd, 0x4ebe, 0x4ec8, 0x4ecc, 0x4ecf, 0x4ed0, 0x4ed2, 0x4eda, 0x4edb, 0x4edc, 0x4ee0, 0x4ee2, 0x4ee6, 0x4ee7, 0x4ee9, 0x4eed, 0x4eee, 0x4eef, 0x4ef1, 0x4ef4, 0x4ef8, 0x4ef9, 0x4efa, 0x4efc, 0x4efe, 0x4f00, 0x4f02, 0x4f03, 0x4f04, 0x4f05, 0x4f06, 0x4f07, 0x4f08, 0x4f0b, 0x4f0c, 0x4f12, 0x4f13, 0x4f14, 0x4f15, 0x4f16, 0x4f1c, 0x4f1d, 0x4f21, 0x4f23, 0x4f28, 0x4f29, 0x4f2c, 0x4f2d, 0x4f2e, 0x4f31, 0x4f33, 0x4f35, 0x4f37, 0x4f39, 0x4f3b, 0x4f3e, 0x4f3f, 0x4f40, 0x4f41, 0x4f42, 0x4f44, 0x4f45, 0x4f47, 0x4f48, 0x4f49, 0x4f4a, 0x4f4b, 0x4f4c, 0x4f52, 0x4f54, 0x4f56, 0x4f61, 0x4f62, 0x4f66, 0x4f68, 0x4f6a, 0x4f6b, 0x4f6d, 0x4f6e, 0x4f71, 0x4f72, 0x4f75, 0x4f77, 0x4f78, 0x4f79, 0x4f7a, 0x4f7d, 0x4f80, 0x4f81, 0x4f82, 0x4f85, 0x4f86, 0x4f87, 0x4f8a, 0x4f8c, 0x4f8e, 0x4f90, 0x4f92, 0x4f93, 0x4f95, 0x4f96, 0x4f98, 0x4f99, 0x4f9a, 0x4f9c, 0x4f9e, 0x4f9f, 0x4fa1, 0x4fa2, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8240[ 192 ] = { 0x4fa4, 0x4fab, 0x4fad, 0x4fb0, 0x4fb1, 0x4fb2, 0x4fb3, 0x4fb4, 0x4fb6, 0x4fb7, 0x4fb8, 0x4fb9, 0x4fba, 0x4fbb, 0x4fbc, 0x4fbd, 0x4fbe, 0x4fc0, 0x4fc1, 0x4fc2, 0x4fc6, 0x4fc7, 0x4fc8, 0x4fc9, 0x4fcb, 0x4fcc, 0x4fcd, 0x4fd2, 0x4fd3, 0x4fd4, 0x4fd5, 0x4fd6, 0x4fd9, 0x4fdb, 0x4fe0, 0x4fe2, 0x4fe4, 0x4fe5, 0x4fe7, 0x4feb, 0x4fec, 0x4ff0, 0x4ff2, 0x4ff4, 0x4ff5, 0x4ff6, 0x4ff7, 0x4ff9, 0x4ffb, 0x4ffc, 0x4ffd, 0x4fff, 0x5000, 0x5001, 0x5002, 0x5003, 0x5004, 0x5005, 0x5006, 0x5007, 0x5008, 0x5009, 0x500a, 0xfffd, 0x500b, 0x500e, 0x5010, 0x5011, 0x5013, 0x5015, 0x5016, 0x5017, 0x501b, 0x501d, 0x501e, 0x5020, 0x5022, 0x5023, 0x5024, 0x5027, 0x502b, 0x502f, 0x5030, 0x5031, 0x5032, 0x5033, 0x5034, 0x5035, 0x5036, 0x5037, 0x5038, 0x5039, 0x503b, 0x503d, 0x503f, 0x5040, 0x5041, 0x5042, 0x5044, 0x5045, 0x5046, 0x5049, 0x504a, 0x504b, 0x504d, 0x5050, 0x5051, 0x5052, 0x5053, 0x5054, 0x5056, 0x5057, 0x5058, 0x5059, 0x505b, 0x505d, 0x505e, 0x505f, 0x5060, 0x5061, 0x5062, 0x5063, 0x5064, 0x5066, 0x5067, 0x5068, 0x5069, 0x506a, 0x506b, 0x506d, 0x506e, 0x506f, 0x5070, 0x5071, 0x5072, 0x5073, 0x5074, 0x5075, 0x5078, 0x5079, 0x507a, 0x507c, 0x507d, 0x5081, 0x5082, 0x5083, 0x5084, 0x5086, 0x5087, 0x5089, 0x508a, 0x508b, 0x508c, 0x508e, 0x508f, 0x5090, 0x5091, 0x5092, 0x5093, 0x5094, 0x5095, 0x5096, 0x5097, 0x5098, 0x5099, 0x509a, 0x509b, 0x509c, 0x509d, 0x509e, 0x509f, 0x50a0, 0x50a1, 0x50a2, 0x50a4, 0x50a6, 0x50aa, 0x50ab, 0x50ad, 0x50ae, 0x50af, 0x50b0, 0x50b1, 0x50b3, 0x50b4, 0x50b5, 0x50b6, 0x50b7, 0x50b8, 0x50b9, 0x50bc, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8340[ 192 ] = { 0x50bd, 0x50be, 0x50bf, 0x50c0, 0x50c1, 0x50c2, 0x50c3, 0x50c4, 0x50c5, 0x50c6, 0x50c7, 0x50c8, 0x50c9, 0x50ca, 0x50cb, 0x50cc, 0x50cd, 0x50ce, 0x50d0, 0x50d1, 0x50d2, 0x50d3, 0x50d4, 0x50d5, 0x50d7, 0x50d8, 0x50d9, 0x50db, 0x50dc, 0x50dd, 0x50de, 0x50df, 0x50e0, 0x50e1, 0x50e2, 0x50e3, 0x50e4, 0x50e5, 0x50e8, 0x50e9, 0x50ea, 0x50eb, 0x50ef, 0x50f0, 0x50f1, 0x50f2, 0x50f4, 0x50f6, 0x50f7, 0x50f8, 0x50f9, 0x50fa, 0x50fc, 0x50fd, 0x50fe, 0x50ff, 0x5100, 0x5101, 0x5102, 0x5103, 0x5104, 0x5105, 0x5108, 0xfffd, 0x5109, 0x510a, 0x510c, 0x510d, 0x510e, 0x510f, 0x5110, 0x5111, 0x5113, 0x5114, 0x5115, 0x5116, 0x5117, 0x5118, 0x5119, 0x511a, 0x511b, 0x511c, 0x511d, 0x511e, 0x511f, 0x5120, 0x5122, 0x5123, 0x5124, 0x5125, 0x5126, 0x5127, 0x5128, 0x5129, 0x512a, 0x512b, 0x512c, 0x512d, 0x512e, 0x512f, 0x5130, 0x5131, 0x5132, 0x5133, 0x5134, 0x5135, 0x5136, 0x5137, 0x5138, 0x5139, 0x513a, 0x513b, 0x513c, 0x513d, 0x513e, 0x5142, 0x5147, 0x514a, 0x514c, 0x514e, 0x514f, 0x5150, 0x5152, 0x5153, 0x5157, 0x5158, 0x5159, 0x515b, 0x515d, 0x515e, 0x515f, 0x5160, 0x5161, 0x5163, 0x5164, 0x5166, 0x5167, 0x5169, 0x516a, 0x516f, 0x5172, 0x517a, 0x517e, 0x517f, 0x5183, 0x5184, 0x5186, 0x5187, 0x518a, 0x518b, 0x518e, 0x518f, 0x5190, 0x5191, 0x5193, 0x5194, 0x5198, 0x519a, 0x519d, 0x519e, 0x519f, 0x51a1, 0x51a3, 0x51a6, 0x51a7, 0x51a8, 0x51a9, 0x51aa, 0x51ad, 0x51ae, 0x51b4, 0x51b8, 0x51b9, 0x51ba, 0x51be, 0x51bf, 0x51c1, 0x51c2, 0x51c3, 0x51c5, 0x51c8, 0x51ca, 0x51cd, 0x51ce, 0x51d0, 0x51d2, 0x51d3, 0x51d4, 0x51d5, 0x51d6, 0x51d7, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8440[ 192 ] = { 0x51d8, 0x51d9, 0x51da, 0x51dc, 0x51de, 0x51df, 0x51e2, 0x51e3, 0x51e5, 0x51e6, 0x51e7, 0x51e8, 0x51e9, 0x51ea, 0x51ec, 0x51ee, 0x51f1, 0x51f2, 0x51f4, 0x51f7, 0x51fe, 0x5204, 0x5205, 0x5209, 0x520b, 0x520c, 0x520f, 0x5210, 0x5213, 0x5214, 0x5215, 0x521c, 0x521e, 0x521f, 0x5221, 0x5222, 0x5223, 0x5225, 0x5226, 0x5227, 0x522a, 0x522c, 0x522f, 0x5231, 0x5232, 0x5234, 0x5235, 0x523c, 0x523e, 0x5244, 0x5245, 0x5246, 0x5247, 0x5248, 0x5249, 0x524b, 0x524e, 0x524f, 0x5252, 0x5253, 0x5255, 0x5257, 0x5258, 0xfffd, 0x5259, 0x525a, 0x525b, 0x525d, 0x525f, 0x5260, 0x5262, 0x5263, 0x5264, 0x5266, 0x5268, 0x526b, 0x526c, 0x526d, 0x526e, 0x5270, 0x5271, 0x5273, 0x5274, 0x5275, 0x5276, 0x5277, 0x5278, 0x5279, 0x527a, 0x527b, 0x527c, 0x527e, 0x5280, 0x5283, 0x5284, 0x5285, 0x5286, 0x5287, 0x5289, 0x528a, 0x528b, 0x528c, 0x528d, 0x528e, 0x528f, 0x5291, 0x5292, 0x5294, 0x5295, 0x5296, 0x5297, 0x5298, 0x5299, 0x529a, 0x529c, 0x52a4, 0x52a5, 0x52a6, 0x52a7, 0x52ae, 0x52af, 0x52b0, 0x52b4, 0x52b5, 0x52b6, 0x52b7, 0x52b8, 0x52b9, 0x52ba, 0x52bb, 0x52bc, 0x52bd, 0x52c0, 0x52c1, 0x52c2, 0x52c4, 0x52c5, 0x52c6, 0x52c8, 0x52ca, 0x52cc, 0x52cd, 0x52ce, 0x52cf, 0x52d1, 0x52d3, 0x52d4, 0x52d5, 0x52d7, 0x52d9, 0x52da, 0x52db, 0x52dc, 0x52dd, 0x52de, 0x52e0, 0x52e1, 0x52e2, 0x52e3, 0x52e5, 0x52e6, 0x52e7, 0x52e8, 0x52e9, 0x52ea, 0x52eb, 0x52ec, 0x52ed, 0x52ee, 0x52ef, 0x52f1, 0x52f2, 0x52f3, 0x52f4, 0x52f5, 0x52f6, 0x52f7, 0x52f8, 0x52fb, 0x52fc, 0x52fd, 0x5301, 0x5302, 0x5303, 0x5304, 0x5307, 0x5309, 0x530a, 0x530b, 0x530c, 0x530e, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8540[ 192 ] = { 0x5311, 0x5312, 0x5313, 0x5314, 0x5318, 0x531b, 0x531c, 0x531e, 0x531f, 0x5322, 0x5324, 0x5325, 0x5327, 0x5328, 0x5329, 0x532b, 0x532c, 0x532d, 0x532f, 0x5330, 0x5331, 0x5332, 0x5333, 0x5334, 0x5335, 0x5336, 0x5337, 0x5338, 0x533c, 0x533d, 0x5340, 0x5342, 0x5344, 0x5346, 0x534b, 0x534c, 0x534d, 0x5350, 0x5354, 0x5358, 0x5359, 0x535b, 0x535d, 0x5365, 0x5368, 0x536a, 0x536c, 0x536d, 0x5372, 0x5376, 0x5379, 0x537b, 0x537c, 0x537d, 0x537e, 0x5380, 0x5381, 0x5383, 0x5387, 0x5388, 0x538a, 0x538e, 0x538f, 0xfffd, 0x5390, 0x5391, 0x5392, 0x5393, 0x5394, 0x5396, 0x5397, 0x5399, 0x539b, 0x539c, 0x539e, 0x53a0, 0x53a1, 0x53a4, 0x53a7, 0x53aa, 0x53ab, 0x53ac, 0x53ad, 0x53af, 0x53b0, 0x53b1, 0x53b2, 0x53b3, 0x53b4, 0x53b5, 0x53b7, 0x53b8, 0x53b9, 0x53ba, 0x53bc, 0x53bd, 0x53be, 0x53c0, 0x53c3, 0x53c4, 0x53c5, 0x53c6, 0x53c7, 0x53ce, 0x53cf, 0x53d0, 0x53d2, 0x53d3, 0x53d5, 0x53da, 0x53dc, 0x53dd, 0x53de, 0x53e1, 0x53e2, 0x53e7, 0x53f4, 0x53fa, 0x53fe, 0x53ff, 0x5400, 0x5402, 0x5405, 0x5407, 0x540b, 0x5414, 0x5418, 0x5419, 0x541a, 0x541c, 0x5422, 0x5424, 0x5425, 0x542a, 0x5430, 0x5433, 0x5436, 0x5437, 0x543a, 0x543d, 0x543f, 0x5441, 0x5442, 0x5444, 0x5445, 0x5447, 0x5449, 0x544c, 0x544d, 0x544e, 0x544f, 0x5451, 0x545a, 0x545d, 0x545e, 0x545f, 0x5460, 0x5461, 0x5463, 0x5465, 0x5467, 0x5469, 0x546a, 0x546b, 0x546c, 0x546d, 0x546e, 0x546f, 0x5470, 0x5474, 0x5479, 0x547a, 0x547e, 0x547f, 0x5481, 0x5483, 0x5485, 0x5487, 0x5488, 0x5489, 0x548a, 0x548d, 0x5491, 0x5493, 0x5497, 0x5498, 0x549c, 0x549e, 0x549f, 0x54a0, 0x54a1, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8640[ 192 ] = { 0x54a2, 0x54a5, 0x54ae, 0x54b0, 0x54b2, 0x54b5, 0x54b6, 0x54b7, 0x54b9, 0x54ba, 0x54bc, 0x54be, 0x54c3, 0x54c5, 0x54ca, 0x54cb, 0x54d6, 0x54d8, 0x54db, 0x54e0, 0x54e1, 0x54e2, 0x54e3, 0x54e4, 0x54eb, 0x54ec, 0x54ef, 0x54f0, 0x54f1, 0x54f4, 0x54f5, 0x54f6, 0x54f7, 0x54f8, 0x54f9, 0x54fb, 0x54fe, 0x5500, 0x5502, 0x5503, 0x5504, 0x5505, 0x5508, 0x550a, 0x550b, 0x550c, 0x550d, 0x550e, 0x5512, 0x5513, 0x5515, 0x5516, 0x5517, 0x5518, 0x5519, 0x551a, 0x551c, 0x551d, 0x551e, 0x551f, 0x5521, 0x5525, 0x5526, 0xfffd, 0x5528, 0x5529, 0x552b, 0x552d, 0x5532, 0x5534, 0x5535, 0x5536, 0x5538, 0x5539, 0x553a, 0x553b, 0x553d, 0x5540, 0x5542, 0x5545, 0x5547, 0x5548, 0x554b, 0x554c, 0x554d, 0x554e, 0x554f, 0x5551, 0x5552, 0x5553, 0x5554, 0x5557, 0x5558, 0x5559, 0x555a, 0x555b, 0x555d, 0x555e, 0x555f, 0x5560, 0x5562, 0x5563, 0x5568, 0x5569, 0x556b, 0x556f, 0x5570, 0x5571, 0x5572, 0x5573, 0x5574, 0x5579, 0x557a, 0x557d, 0x557f, 0x5585, 0x5586, 0x558c, 0x558d, 0x558e, 0x5590, 0x5592, 0x5593, 0x5595, 0x5596, 0x5597, 0x559a, 0x559b, 0x559e, 0x55a0, 0x55a1, 0x55a2, 0x55a3, 0x55a4, 0x55a5, 0x55a6, 0x55a8, 0x55a9, 0x55aa, 0x55ab, 0x55ac, 0x55ad, 0x55ae, 0x55af, 0x55b0, 0x55b2, 0x55b4, 0x55b6, 0x55b8, 0x55ba, 0x55bc, 0x55bf, 0x55c0, 0x55c1, 0x55c2, 0x55c3, 0x55c6, 0x55c7, 0x55c8, 0x55ca, 0x55cb, 0x55ce, 0x55cf, 0x55d0, 0x55d5, 0x55d7, 0x55d8, 0x55d9, 0x55da, 0x55db, 0x55de, 0x55e0, 0x55e2, 0x55e7, 0x55e9, 0x55ed, 0x55ee, 0x55f0, 0x55f1, 0x55f4, 0x55f6, 0x55f8, 0x55f9, 0x55fa, 0x55fb, 0x55fc, 0x55ff, 0x5602, 0x5603, 0x5604, 0x5605, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8740[ 192 ] = { 0x5606, 0x5607, 0x560a, 0x560b, 0x560d, 0x5610, 0x5611, 0x5612, 0x5613, 0x5614, 0x5615, 0x5616, 0x5617, 0x5619, 0x561a, 0x561c, 0x561d, 0x5620, 0x5621, 0x5622, 0x5625, 0x5626, 0x5628, 0x5629, 0x562a, 0x562b, 0x562e, 0x562f, 0x5630, 0x5633, 0x5635, 0x5637, 0x5638, 0x563a, 0x563c, 0x563d, 0x563e, 0x5640, 0x5641, 0x5642, 0x5643, 0x5644, 0x5645, 0x5646, 0x5647, 0x5648, 0x5649, 0x564a, 0x564b, 0x564f, 0x5650, 0x5651, 0x5652, 0x5653, 0x5655, 0x5656, 0x565a, 0x565b, 0x565d, 0x565e, 0x565f, 0x5660, 0x5661, 0xfffd, 0x5663, 0x5665, 0x5666, 0x5667, 0x566d, 0x566e, 0x566f, 0x5670, 0x5672, 0x5673, 0x5674, 0x5675, 0x5677, 0x5678, 0x5679, 0x567a, 0x567d, 0x567e, 0x567f, 0x5680, 0x5681, 0x5682, 0x5683, 0x5684, 0x5687, 0x5688, 0x5689, 0x568a, 0x568b, 0x568c, 0x568d, 0x5690, 0x5691, 0x5692, 0x5694, 0x5695, 0x5696, 0x5697, 0x5698, 0x5699, 0x569a, 0x569b, 0x569c, 0x569d, 0x569e, 0x569f, 0x56a0, 0x56a1, 0x56a2, 0x56a4, 0x56a5, 0x56a6, 0x56a7, 0x56a8, 0x56a9, 0x56aa, 0x56ab, 0x56ac, 0x56ad, 0x56ae, 0x56b0, 0x56b1, 0x56b2, 0x56b3, 0x56b4, 0x56b5, 0x56b6, 0x56b8, 0x56b9, 0x56ba, 0x56bb, 0x56bd, 0x56be, 0x56bf, 0x56c0, 0x56c1, 0x56c2, 0x56c3, 0x56c4, 0x56c5, 0x56c6, 0x56c7, 0x56c8, 0x56c9, 0x56cb, 0x56cc, 0x56cd, 0x56ce, 0x56cf, 0x56d0, 0x56d1, 0x56d2, 0x56d3, 0x56d5, 0x56d6, 0x56d8, 0x56d9, 0x56dc, 0x56e3, 0x56e5, 0x56e6, 0x56e7, 0x56e8, 0x56e9, 0x56ea, 0x56ec, 0x56ee, 0x56ef, 0x56f2, 0x56f3, 0x56f6, 0x56f7, 0x56f8, 0x56fb, 0x56fc, 0x5700, 0x5701, 0x5702, 0x5705, 0x5707, 0x570b, 0x570c, 0x570d, 0x570e, 0x570f, 0x5710, 0x5711, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8840[ 192 ] = { 0x5712, 0x5713, 0x5714, 0x5715, 0x5716, 0x5717, 0x5718, 0x5719, 0x571a, 0x571b, 0x571d, 0x571e, 0x5720, 0x5721, 0x5722, 0x5724, 0x5725, 0x5726, 0x5727, 0x572b, 0x5731, 0x5732, 0x5734, 0x5735, 0x5736, 0x5737, 0x5738, 0x573c, 0x573d, 0x573f, 0x5741, 0x5743, 0x5744, 0x5745, 0x5746, 0x5748, 0x5749, 0x574b, 0x5752, 0x5753, 0x5754, 0x5755, 0x5756, 0x5758, 0x5759, 0x5762, 0x5763, 0x5765, 0x5767, 0x576c, 0x576e, 0x5770, 0x5771, 0x5772, 0x5774, 0x5775, 0x5778, 0x5779, 0x577a, 0x577d, 0x577e, 0x577f, 0x5780, 0xfffd, 0x5781, 0x5787, 0x5788, 0x5789, 0x578a, 0x578d, 0x578e, 0x578f, 0x5790, 0x5791, 0x5794, 0x5795, 0x5796, 0x5797, 0x5798, 0x5799, 0x579a, 0x579c, 0x579d, 0x579e, 0x579f, 0x57a5, 0x57a8, 0x57aa, 0x57ac, 0x57af, 0x57b0, 0x57b1, 0x57b3, 0x57b5, 0x57b6, 0x57b7, 0x57b9, 0x57ba, 0x57bb, 0x57bc, 0x57bd, 0x57be, 0x57bf, 0x57c0, 0x57c1, 0x57c4, 0x57c5, 0x57c6, 0x57c7, 0x57c8, 0x57c9, 0x57ca, 0x57cc, 0x57cd, 0x57d0, 0x57d1, 0x57d3, 0x57d6, 0x57d7, 0x57db, 0x57dc, 0x57de, 0x57e1, 0x57e2, 0x57e3, 0x57e5, 0x57e6, 0x57e7, 0x57e8, 0x57e9, 0x57ea, 0x57eb, 0x57ec, 0x57ee, 0x57f0, 0x57f1, 0x57f2, 0x57f3, 0x57f5, 0x57f6, 0x57f7, 0x57fb, 0x57fc, 0x57fe, 0x57ff, 0x5801, 0x5803, 0x5804, 0x5805, 0x5808, 0x5809, 0x580a, 0x580c, 0x580e, 0x580f, 0x5810, 0x5812, 0x5813, 0x5814, 0x5816, 0x5817, 0x5818, 0x581a, 0x581b, 0x581c, 0x581d, 0x581f, 0x5822, 0x5823, 0x5825, 0x5826, 0x5827, 0x5828, 0x5829, 0x582b, 0x582c, 0x582d, 0x582e, 0x582f, 0x5831, 0x5832, 0x5833, 0x5834, 0x5836, 0x5837, 0x5838, 0x5839, 0x583a, 0x583b, 0x583c, 0x583d, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8940[ 192 ] = { 0x583e, 0x583f, 0x5840, 0x5841, 0x5842, 0x5843, 0x5845, 0x5846, 0x5847, 0x5848, 0x5849, 0x584a, 0x584b, 0x584e, 0x584f, 0x5850, 0x5852, 0x5853, 0x5855, 0x5856, 0x5857, 0x5859, 0x585a, 0x585b, 0x585c, 0x585d, 0x585f, 0x5860, 0x5861, 0x5862, 0x5863, 0x5864, 0x5866, 0x5867, 0x5868, 0x5869, 0x586a, 0x586d, 0x586e, 0x586f, 0x5870, 0x5871, 0x5872, 0x5873, 0x5874, 0x5875, 0x5876, 0x5877, 0x5878, 0x5879, 0x587a, 0x587b, 0x587c, 0x587d, 0x587f, 0x5882, 0x5884, 0x5886, 0x5887, 0x5888, 0x588a, 0x588b, 0x588c, 0xfffd, 0x588d, 0x588e, 0x588f, 0x5890, 0x5891, 0x5894, 0x5895, 0x5896, 0x5897, 0x5898, 0x589b, 0x589c, 0x589d, 0x58a0, 0x58a1, 0x58a2, 0x58a3, 0x58a4, 0x58a5, 0x58a6, 0x58a7, 0x58aa, 0x58ab, 0x58ac, 0x58ad, 0x58ae, 0x58af, 0x58b0, 0x58b1, 0x58b2, 0x58b3, 0x58b4, 0x58b5, 0x58b6, 0x58b7, 0x58b8, 0x58b9, 0x58ba, 0x58bb, 0x58bd, 0x58be, 0x58bf, 0x58c0, 0x58c2, 0x58c3, 0x58c4, 0x58c6, 0x58c7, 0x58c8, 0x58c9, 0x58ca, 0x58cb, 0x58cc, 0x58cd, 0x58ce, 0x58cf, 0x58d0, 0x58d2, 0x58d3, 0x58d4, 0x58d6, 0x58d7, 0x58d8, 0x58d9, 0x58da, 0x58db, 0x58dc, 0x58dd, 0x58de, 0x58df, 0x58e0, 0x58e1, 0x58e2, 0x58e3, 0x58e5, 0x58e6, 0x58e7, 0x58e8, 0x58e9, 0x58ea, 0x58ed, 0x58ef, 0x58f1, 0x58f2, 0x58f4, 0x58f5, 0x58f7, 0x58f8, 0x58fa, 0x58fb, 0x58fc, 0x58fd, 0x58fe, 0x58ff, 0x5900, 0x5901, 0x5903, 0x5905, 0x5906, 0x5908, 0x5909, 0x590a, 0x590b, 0x590c, 0x590e, 0x5910, 0x5911, 0x5912, 0x5913, 0x5917, 0x5918, 0x591b, 0x591d, 0x591e, 0x5920, 0x5921, 0x5922, 0x5923, 0x5926, 0x5928, 0x592c, 0x5930, 0x5932, 0x5933, 0x5935, 0x5936, 0x593b, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8a40[ 192 ] = { 0x593d, 0x593e, 0x593f, 0x5940, 0x5943, 0x5945, 0x5946, 0x594a, 0x594c, 0x594d, 0x5950, 0x5952, 0x5953, 0x5959, 0x595b, 0x595c, 0x595d, 0x595e, 0x595f, 0x5961, 0x5963, 0x5964, 0x5966, 0x5967, 0x5968, 0x5969, 0x596a, 0x596b, 0x596c, 0x596d, 0x596e, 0x596f, 0x5970, 0x5971, 0x5972, 0x5975, 0x5977, 0x597a, 0x597b, 0x597c, 0x597e, 0x597f, 0x5980, 0x5985, 0x5989, 0x598b, 0x598c, 0x598e, 0x598f, 0x5990, 0x5991, 0x5994, 0x5995, 0x5998, 0x599a, 0x599b, 0x599c, 0x599d, 0x599f, 0x59a0, 0x59a1, 0x59a2, 0x59a6, 0xfffd, 0x59a7, 0x59ac, 0x59ad, 0x59b0, 0x59b1, 0x59b3, 0x59b4, 0x59b5, 0x59b6, 0x59b7, 0x59b8, 0x59ba, 0x59bc, 0x59bd, 0x59bf, 0x59c0, 0x59c1, 0x59c2, 0x59c3, 0x59c4, 0x59c5, 0x59c7, 0x59c8, 0x59c9, 0x59cc, 0x59cd, 0x59ce, 0x59cf, 0x59d5, 0x59d6, 0x59d9, 0x59db, 0x59de, 0x59df, 0x59e0, 0x59e1, 0x59e2, 0x59e4, 0x59e6, 0x59e7, 0x59e9, 0x59ea, 0x59eb, 0x59ed, 0x59ee, 0x59ef, 0x59f0, 0x59f1, 0x59f2, 0x59f3, 0x59f4, 0x59f5, 0x59f6, 0x59f7, 0x59f8, 0x59fa, 0x59fc, 0x59fd, 0x59fe, 0x5a00, 0x5a02, 0x5a0a, 0x5a0b, 0x5a0d, 0x5a0e, 0x5a0f, 0x5a10, 0x5a12, 0x5a14, 0x5a15, 0x5a16, 0x5a17, 0x5a19, 0x5a1a, 0x5a1b, 0x5a1d, 0x5a1e, 0x5a21, 0x5a22, 0x5a24, 0x5a26, 0x5a27, 0x5a28, 0x5a2a, 0x5a2b, 0x5a2c, 0x5a2d, 0x5a2e, 0x5a2f, 0x5a30, 0x5a33, 0x5a35, 0x5a37, 0x5a38, 0x5a39, 0x5a3a, 0x5a3b, 0x5a3d, 0x5a3e, 0x5a3f, 0x5a41, 0x5a42, 0x5a43, 0x5a44, 0x5a45, 0x5a47, 0x5a48, 0x5a4b, 0x5a4c, 0x5a4d, 0x5a4e, 0x5a4f, 0x5a50, 0x5a51, 0x5a52, 0x5a53, 0x5a54, 0x5a56, 0x5a57, 0x5a58, 0x5a59, 0x5a5b, 0x5a5c, 0x5a5d, 0x5a5e, 0x5a5f, 0x5a60, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8b40[ 192 ] = { 0x5a61, 0x5a63, 0x5a64, 0x5a65, 0x5a66, 0x5a68, 0x5a69, 0x5a6b, 0x5a6c, 0x5a6d, 0x5a6e, 0x5a6f, 0x5a70, 0x5a71, 0x5a72, 0x5a73, 0x5a78, 0x5a79, 0x5a7b, 0x5a7c, 0x5a7d, 0x5a7e, 0x5a80, 0x5a81, 0x5a82, 0x5a83, 0x5a84, 0x5a85, 0x5a86, 0x5a87, 0x5a88, 0x5a89, 0x5a8a, 0x5a8b, 0x5a8c, 0x5a8d, 0x5a8e, 0x5a8f, 0x5a90, 0x5a91, 0x5a93, 0x5a94, 0x5a95, 0x5a96, 0x5a97, 0x5a98, 0x5a99, 0x5a9c, 0x5a9d, 0x5a9e, 0x5a9f, 0x5aa0, 0x5aa1, 0x5aa2, 0x5aa3, 0x5aa4, 0x5aa5, 0x5aa6, 0x5aa7, 0x5aa8, 0x5aa9, 0x5aab, 0x5aac, 0xfffd, 0x5aad, 0x5aae, 0x5aaf, 0x5ab0, 0x5ab1, 0x5ab4, 0x5ab6, 0x5ab7, 0x5ab9, 0x5aba, 0x5abb, 0x5abc, 0x5abd, 0x5abf, 0x5ac0, 0x5ac3, 0x5ac4, 0x5ac5, 0x5ac6, 0x5ac7, 0x5ac8, 0x5aca, 0x5acb, 0x5acd, 0x5ace, 0x5acf, 0x5ad0, 0x5ad1, 0x5ad3, 0x5ad5, 0x5ad7, 0x5ad9, 0x5ada, 0x5adb, 0x5add, 0x5ade, 0x5adf, 0x5ae2, 0x5ae4, 0x5ae5, 0x5ae7, 0x5ae8, 0x5aea, 0x5aec, 0x5aed, 0x5aee, 0x5aef, 0x5af0, 0x5af2, 0x5af3, 0x5af4, 0x5af5, 0x5af6, 0x5af7, 0x5af8, 0x5af9, 0x5afa, 0x5afb, 0x5afc, 0x5afd, 0x5afe, 0x5aff, 0x5b00, 0x5b01, 0x5b02, 0x5b03, 0x5b04, 0x5b05, 0x5b06, 0x5b07, 0x5b08, 0x5b0a, 0x5b0b, 0x5b0c, 0x5b0d, 0x5b0e, 0x5b0f, 0x5b10, 0x5b11, 0x5b12, 0x5b13, 0x5b14, 0x5b15, 0x5b18, 0x5b19, 0x5b1a, 0x5b1b, 0x5b1c, 0x5b1d, 0x5b1e, 0x5b1f, 0x5b20, 0x5b21, 0x5b22, 0x5b23, 0x5b24, 0x5b25, 0x5b26, 0x5b27, 0x5b28, 0x5b29, 0x5b2a, 0x5b2b, 0x5b2c, 0x5b2d, 0x5b2e, 0x5b2f, 0x5b30, 0x5b31, 0x5b33, 0x5b35, 0x5b36, 0x5b38, 0x5b39, 0x5b3a, 0x5b3b, 0x5b3c, 0x5b3d, 0x5b3e, 0x5b3f, 0x5b41, 0x5b42, 0x5b43, 0x5b44, 0x5b45, 0x5b46, 0x5b47, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8c40[ 192 ] = { 0x5b48, 0x5b49, 0x5b4a, 0x5b4b, 0x5b4c, 0x5b4d, 0x5b4e, 0x5b4f, 0x5b52, 0x5b56, 0x5b5e, 0x5b60, 0x5b61, 0x5b67, 0x5b68, 0x5b6b, 0x5b6d, 0x5b6e, 0x5b6f, 0x5b72, 0x5b74, 0x5b76, 0x5b77, 0x5b78, 0x5b79, 0x5b7b, 0x5b7c, 0x5b7e, 0x5b7f, 0x5b82, 0x5b86, 0x5b8a, 0x5b8d, 0x5b8e, 0x5b90, 0x5b91, 0x5b92, 0x5b94, 0x5b96, 0x5b9f, 0x5ba7, 0x5ba8, 0x5ba9, 0x5bac, 0x5bad, 0x5bae, 0x5baf, 0x5bb1, 0x5bb2, 0x5bb7, 0x5bba, 0x5bbb, 0x5bbc, 0x5bc0, 0x5bc1, 0x5bc3, 0x5bc8, 0x5bc9, 0x5bca, 0x5bcb, 0x5bcd, 0x5bce, 0x5bcf, 0xfffd, 0x5bd1, 0x5bd4, 0x5bd5, 0x5bd6, 0x5bd7, 0x5bd8, 0x5bd9, 0x5bda, 0x5bdb, 0x5bdc, 0x5be0, 0x5be2, 0x5be3, 0x5be6, 0x5be7, 0x5be9, 0x5bea, 0x5beb, 0x5bec, 0x5bed, 0x5bef, 0x5bf1, 0x5bf2, 0x5bf3, 0x5bf4, 0x5bf5, 0x5bf6, 0x5bf7, 0x5bfd, 0x5bfe, 0x5c00, 0x5c02, 0x5c03, 0x5c05, 0x5c07, 0x5c08, 0x5c0b, 0x5c0c, 0x5c0d, 0x5c0e, 0x5c10, 0x5c12, 0x5c13, 0x5c17, 0x5c19, 0x5c1b, 0x5c1e, 0x5c1f, 0x5c20, 0x5c21, 0x5c23, 0x5c26, 0x5c28, 0x5c29, 0x5c2a, 0x5c2b, 0x5c2d, 0x5c2e, 0x5c2f, 0x5c30, 0x5c32, 0x5c33, 0x5c35, 0x5c36, 0x5c37, 0x5c43, 0x5c44, 0x5c46, 0x5c47, 0x5c4c, 0x5c4d, 0x5c52, 0x5c53, 0x5c54, 0x5c56, 0x5c57, 0x5c58, 0x5c5a, 0x5c5b, 0x5c5c, 0x5c5d, 0x5c5f, 0x5c62, 0x5c64, 0x5c67, 0x5c68, 0x5c69, 0x5c6a, 0x5c6b, 0x5c6c, 0x5c6d, 0x5c70, 0x5c72, 0x5c73, 0x5c74, 0x5c75, 0x5c76, 0x5c77, 0x5c78, 0x5c7b, 0x5c7c, 0x5c7d, 0x5c7e, 0x5c80, 0x5c83, 0x5c84, 0x5c85, 0x5c86, 0x5c87, 0x5c89, 0x5c8a, 0x5c8b, 0x5c8e, 0x5c8f, 0x5c92, 0x5c93, 0x5c95, 0x5c9d, 0x5c9e, 0x5c9f, 0x5ca0, 0x5ca1, 0x5ca4, 0x5ca5, 0x5ca6, 0x5ca7, 0x5ca8, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8d40[ 192 ] = { 0x5caa, 0x5cae, 0x5caf, 0x5cb0, 0x5cb2, 0x5cb4, 0x5cb6, 0x5cb9, 0x5cba, 0x5cbb, 0x5cbc, 0x5cbe, 0x5cc0, 0x5cc2, 0x5cc3, 0x5cc5, 0x5cc6, 0x5cc7, 0x5cc8, 0x5cc9, 0x5cca, 0x5ccc, 0x5ccd, 0x5cce, 0x5ccf, 0x5cd0, 0x5cd1, 0x5cd3, 0x5cd4, 0x5cd5, 0x5cd6, 0x5cd7, 0x5cd8, 0x5cda, 0x5cdb, 0x5cdc, 0x5cdd, 0x5cde, 0x5cdf, 0x5ce0, 0x5ce2, 0x5ce3, 0x5ce7, 0x5ce9, 0x5ceb, 0x5cec, 0x5cee, 0x5cef, 0x5cf1, 0x5cf2, 0x5cf3, 0x5cf4, 0x5cf5, 0x5cf6, 0x5cf7, 0x5cf8, 0x5cf9, 0x5cfa, 0x5cfc, 0x5cfd, 0x5cfe, 0x5cff, 0x5d00, 0xfffd, 0x5d01, 0x5d04, 0x5d05, 0x5d08, 0x5d09, 0x5d0a, 0x5d0b, 0x5d0c, 0x5d0d, 0x5d0f, 0x5d10, 0x5d11, 0x5d12, 0x5d13, 0x5d15, 0x5d17, 0x5d18, 0x5d19, 0x5d1a, 0x5d1c, 0x5d1d, 0x5d1f, 0x5d20, 0x5d21, 0x5d22, 0x5d23, 0x5d25, 0x5d28, 0x5d2a, 0x5d2b, 0x5d2c, 0x5d2f, 0x5d30, 0x5d31, 0x5d32, 0x5d33, 0x5d35, 0x5d36, 0x5d37, 0x5d38, 0x5d39, 0x5d3a, 0x5d3b, 0x5d3c, 0x5d3f, 0x5d40, 0x5d41, 0x5d42, 0x5d43, 0x5d44, 0x5d45, 0x5d46, 0x5d48, 0x5d49, 0x5d4d, 0x5d4e, 0x5d4f, 0x5d50, 0x5d51, 0x5d52, 0x5d53, 0x5d54, 0x5d55, 0x5d56, 0x5d57, 0x5d59, 0x5d5a, 0x5d5c, 0x5d5e, 0x5d5f, 0x5d60, 0x5d61, 0x5d62, 0x5d63, 0x5d64, 0x5d65, 0x5d66, 0x5d67, 0x5d68, 0x5d6a, 0x5d6d, 0x5d6e, 0x5d70, 0x5d71, 0x5d72, 0x5d73, 0x5d75, 0x5d76, 0x5d77, 0x5d78, 0x5d79, 0x5d7a, 0x5d7b, 0x5d7c, 0x5d7d, 0x5d7e, 0x5d7f, 0x5d80, 0x5d81, 0x5d83, 0x5d84, 0x5d85, 0x5d86, 0x5d87, 0x5d88, 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c, 0x5d8d, 0x5d8e, 0x5d8f, 0x5d90, 0x5d91, 0x5d92, 0x5d93, 0x5d94, 0x5d95, 0x5d96, 0x5d97, 0x5d98, 0x5d9a, 0x5d9b, 0x5d9c, 0x5d9e, 0x5d9f, 0x5da0, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8e40[ 192 ] = { 0x5da1, 0x5da2, 0x5da3, 0x5da4, 0x5da5, 0x5da6, 0x5da7, 0x5da8, 0x5da9, 0x5daa, 0x5dab, 0x5dac, 0x5dad, 0x5dae, 0x5daf, 0x5db0, 0x5db1, 0x5db2, 0x5db3, 0x5db4, 0x5db5, 0x5db6, 0x5db8, 0x5db9, 0x5dba, 0x5dbb, 0x5dbc, 0x5dbd, 0x5dbe, 0x5dbf, 0x5dc0, 0x5dc1, 0x5dc2, 0x5dc3, 0x5dc4, 0x5dc6, 0x5dc7, 0x5dc8, 0x5dc9, 0x5dca, 0x5dcb, 0x5dcc, 0x5dce, 0x5dcf, 0x5dd0, 0x5dd1, 0x5dd2, 0x5dd3, 0x5dd4, 0x5dd5, 0x5dd6, 0x5dd7, 0x5dd8, 0x5dd9, 0x5dda, 0x5ddc, 0x5ddf, 0x5de0, 0x5de3, 0x5de4, 0x5dea, 0x5dec, 0x5ded, 0xfffd, 0x5df0, 0x5df5, 0x5df6, 0x5df8, 0x5df9, 0x5dfa, 0x5dfb, 0x5dfc, 0x5dff, 0x5e00, 0x5e04, 0x5e07, 0x5e09, 0x5e0a, 0x5e0b, 0x5e0d, 0x5e0e, 0x5e12, 0x5e13, 0x5e17, 0x5e1e, 0x5e1f, 0x5e20, 0x5e21, 0x5e22, 0x5e23, 0x5e24, 0x5e25, 0x5e28, 0x5e29, 0x5e2a, 0x5e2b, 0x5e2c, 0x5e2f, 0x5e30, 0x5e32, 0x5e33, 0x5e34, 0x5e35, 0x5e36, 0x5e39, 0x5e3a, 0x5e3e, 0x5e3f, 0x5e40, 0x5e41, 0x5e43, 0x5e46, 0x5e47, 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4d, 0x5e4e, 0x5e4f, 0x5e50, 0x5e51, 0x5e52, 0x5e53, 0x5e56, 0x5e57, 0x5e58, 0x5e59, 0x5e5a, 0x5e5c, 0x5e5d, 0x5e5f, 0x5e60, 0x5e63, 0x5e64, 0x5e65, 0x5e66, 0x5e67, 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c, 0x5e6d, 0x5e6e, 0x5e6f, 0x5e70, 0x5e71, 0x5e75, 0x5e77, 0x5e79, 0x5e7e, 0x5e81, 0x5e82, 0x5e83, 0x5e85, 0x5e88, 0x5e89, 0x5e8c, 0x5e8d, 0x5e8e, 0x5e92, 0x5e98, 0x5e9b, 0x5e9d, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4, 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac, 0x5eae, 0x5eaf, 0x5eb0, 0x5eb1, 0x5eb2, 0x5eb4, 0x5eba, 0x5ebb, 0x5ebc, 0x5ebd, 0x5ebf, 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4, 0x5ec5, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8f40[ 192 ] = { 0x5ec6, 0x5ec7, 0x5ec8, 0x5ecb, 0x5ecc, 0x5ecd, 0x5ece, 0x5ecf, 0x5ed0, 0x5ed4, 0x5ed5, 0x5ed7, 0x5ed8, 0x5ed9, 0x5eda, 0x5edc, 0x5edd, 0x5ede, 0x5edf, 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4, 0x5ee5, 0x5ee6, 0x5ee7, 0x5ee9, 0x5eeb, 0x5eec, 0x5eed, 0x5eee, 0x5eef, 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef5, 0x5ef8, 0x5ef9, 0x5efb, 0x5efc, 0x5efd, 0x5f05, 0x5f06, 0x5f07, 0x5f09, 0x5f0c, 0x5f0d, 0x5f0e, 0x5f10, 0x5f12, 0x5f14, 0x5f16, 0x5f19, 0x5f1a, 0x5f1c, 0x5f1d, 0x5f1e, 0x5f21, 0x5f22, 0x5f23, 0x5f24, 0xfffd, 0x5f28, 0x5f2b, 0x5f2c, 0x5f2e, 0x5f30, 0x5f32, 0x5f33, 0x5f34, 0x5f35, 0x5f36, 0x5f37, 0x5f38, 0x5f3b, 0x5f3d, 0x5f3e, 0x5f3f, 0x5f41, 0x5f42, 0x5f43, 0x5f44, 0x5f45, 0x5f46, 0x5f47, 0x5f48, 0x5f49, 0x5f4a, 0x5f4b, 0x5f4c, 0x5f4d, 0x5f4e, 0x5f4f, 0x5f51, 0x5f54, 0x5f59, 0x5f5a, 0x5f5b, 0x5f5c, 0x5f5e, 0x5f5f, 0x5f60, 0x5f63, 0x5f65, 0x5f67, 0x5f68, 0x5f6b, 0x5f6e, 0x5f6f, 0x5f72, 0x5f74, 0x5f75, 0x5f76, 0x5f78, 0x5f7a, 0x5f7d, 0x5f7e, 0x5f7f, 0x5f83, 0x5f86, 0x5f8d, 0x5f8e, 0x5f8f, 0x5f91, 0x5f93, 0x5f94, 0x5f96, 0x5f9a, 0x5f9b, 0x5f9d, 0x5f9e, 0x5f9f, 0x5fa0, 0x5fa2, 0x5fa3, 0x5fa4, 0x5fa5, 0x5fa6, 0x5fa7, 0x5fa9, 0x5fab, 0x5fac, 0x5faf, 0x5fb0, 0x5fb1, 0x5fb2, 0x5fb3, 0x5fb4, 0x5fb6, 0x5fb8, 0x5fb9, 0x5fba, 0x5fbb, 0x5fbe, 0x5fbf, 0x5fc0, 0x5fc1, 0x5fc2, 0x5fc7, 0x5fc8, 0x5fca, 0x5fcb, 0x5fce, 0x5fd3, 0x5fd4, 0x5fd5, 0x5fda, 0x5fdb, 0x5fdc, 0x5fde, 0x5fdf, 0x5fe2, 0x5fe3, 0x5fe5, 0x5fe6, 0x5fe8, 0x5fe9, 0x5fec, 0x5fef, 0x5ff0, 0x5ff2, 0x5ff3, 0x5ff4, 0x5ff6, 0x5ff7, 0x5ff9, 0x5ffa, 0x5ffc, 0x6007, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9040[ 192 ] = { 0x6008, 0x6009, 0x600b, 0x600c, 0x6010, 0x6011, 0x6013, 0x6017, 0x6018, 0x601a, 0x601e, 0x601f, 0x6022, 0x6023, 0x6024, 0x602c, 0x602d, 0x602e, 0x6030, 0x6031, 0x6032, 0x6033, 0x6034, 0x6036, 0x6037, 0x6038, 0x6039, 0x603a, 0x603d, 0x603e, 0x6040, 0x6044, 0x6045, 0x6046, 0x6047, 0x6048, 0x6049, 0x604a, 0x604c, 0x604e, 0x604f, 0x6051, 0x6053, 0x6054, 0x6056, 0x6057, 0x6058, 0x605b, 0x605c, 0x605e, 0x605f, 0x6060, 0x6061, 0x6065, 0x6066, 0x606e, 0x6071, 0x6072, 0x6074, 0x6075, 0x6077, 0x607e, 0x6080, 0xfffd, 0x6081, 0x6082, 0x6085, 0x6086, 0x6087, 0x6088, 0x608a, 0x608b, 0x608e, 0x608f, 0x6090, 0x6091, 0x6093, 0x6095, 0x6097, 0x6098, 0x6099, 0x609c, 0x609e, 0x60a1, 0x60a2, 0x60a4, 0x60a5, 0x60a7, 0x60a9, 0x60aa, 0x60ae, 0x60b0, 0x60b3, 0x60b5, 0x60b6, 0x60b7, 0x60b9, 0x60ba, 0x60bd, 0x60be, 0x60bf, 0x60c0, 0x60c1, 0x60c2, 0x60c3, 0x60c4, 0x60c7, 0x60c8, 0x60c9, 0x60cc, 0x60cd, 0x60ce, 0x60cf, 0x60d0, 0x60d2, 0x60d3, 0x60d4, 0x60d6, 0x60d7, 0x60d9, 0x60db, 0x60de, 0x60e1, 0x60e2, 0x60e3, 0x60e4, 0x60e5, 0x60ea, 0x60f1, 0x60f2, 0x60f5, 0x60f7, 0x60f8, 0x60fb, 0x60fc, 0x60fd, 0x60fe, 0x60ff, 0x6102, 0x6103, 0x6104, 0x6105, 0x6107, 0x610a, 0x610b, 0x610c, 0x6110, 0x6111, 0x6112, 0x6113, 0x6114, 0x6116, 0x6117, 0x6118, 0x6119, 0x611b, 0x611c, 0x611d, 0x611e, 0x6121, 0x6122, 0x6125, 0x6128, 0x6129, 0x612a, 0x612c, 0x612d, 0x612e, 0x612f, 0x6130, 0x6131, 0x6132, 0x6133, 0x6134, 0x6135, 0x6136, 0x6137, 0x6138, 0x6139, 0x613a, 0x613b, 0x613c, 0x613d, 0x613e, 0x6140, 0x6141, 0x6142, 0x6143, 0x6144, 0x6145, 0x6146, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9140[ 192 ] = { 0x6147, 0x6149, 0x614b, 0x614d, 0x614f, 0x6150, 0x6152, 0x6153, 0x6154, 0x6156, 0x6157, 0x6158, 0x6159, 0x615a, 0x615b, 0x615c, 0x615e, 0x615f, 0x6160, 0x6161, 0x6163, 0x6164, 0x6165, 0x6166, 0x6169, 0x616a, 0x616b, 0x616c, 0x616d, 0x616e, 0x616f, 0x6171, 0x6172, 0x6173, 0x6174, 0x6176, 0x6178, 0x6179, 0x617a, 0x617b, 0x617c, 0x617d, 0x617e, 0x617f, 0x6180, 0x6181, 0x6182, 0x6183, 0x6184, 0x6185, 0x6186, 0x6187, 0x6188, 0x6189, 0x618a, 0x618c, 0x618d, 0x618f, 0x6190, 0x6191, 0x6192, 0x6193, 0x6195, 0xfffd, 0x6196, 0x6197, 0x6198, 0x6199, 0x619a, 0x619b, 0x619c, 0x619e, 0x619f, 0x61a0, 0x61a1, 0x61a2, 0x61a3, 0x61a4, 0x61a5, 0x61a6, 0x61aa, 0x61ab, 0x61ad, 0x61ae, 0x61af, 0x61b0, 0x61b1, 0x61b2, 0x61b3, 0x61b4, 0x61b5, 0x61b6, 0x61b8, 0x61b9, 0x61ba, 0x61bb, 0x61bc, 0x61bd, 0x61bf, 0x61c0, 0x61c1, 0x61c3, 0x61c4, 0x61c5, 0x61c6, 0x61c7, 0x61c9, 0x61cc, 0x61cd, 0x61ce, 0x61cf, 0x61d0, 0x61d3, 0x61d5, 0x61d6, 0x61d7, 0x61d8, 0x61d9, 0x61da, 0x61db, 0x61dc, 0x61dd, 0x61de, 0x61df, 0x61e0, 0x61e1, 0x61e2, 0x61e3, 0x61e4, 0x61e5, 0x61e7, 0x61e8, 0x61e9, 0x61ea, 0x61eb, 0x61ec, 0x61ed, 0x61ee, 0x61ef, 0x61f0, 0x61f1, 0x61f2, 0x61f3, 0x61f4, 0x61f6, 0x61f7, 0x61f8, 0x61f9, 0x61fa, 0x61fb, 0x61fc, 0x61fd, 0x61fe, 0x6200, 0x6201, 0x6202, 0x6203, 0x6204, 0x6205, 0x6207, 0x6209, 0x6213, 0x6214, 0x6219, 0x621c, 0x621d, 0x621e, 0x6220, 0x6223, 0x6226, 0x6227, 0x6228, 0x6229, 0x622b, 0x622d, 0x622f, 0x6230, 0x6231, 0x6232, 0x6235, 0x6236, 0x6238, 0x6239, 0x623a, 0x623b, 0x623c, 0x6242, 0x6244, 0x6245, 0x6246, 0x624a, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9240[ 192 ] = { 0x624f, 0x6250, 0x6255, 0x6256, 0x6257, 0x6259, 0x625a, 0x625c, 0x625d, 0x625e, 0x625f, 0x6260, 0x6261, 0x6262, 0x6264, 0x6265, 0x6268, 0x6271, 0x6272, 0x6274, 0x6275, 0x6277, 0x6278, 0x627a, 0x627b, 0x627d, 0x6281, 0x6282, 0x6283, 0x6285, 0x6286, 0x6287, 0x6288, 0x628b, 0x628c, 0x628d, 0x628e, 0x628f, 0x6290, 0x6294, 0x6299, 0x629c, 0x629d, 0x629e, 0x62a3, 0x62a6, 0x62a7, 0x62a9, 0x62aa, 0x62ad, 0x62ae, 0x62af, 0x62b0, 0x62b2, 0x62b3, 0x62b4, 0x62b6, 0x62b7, 0x62b8, 0x62ba, 0x62be, 0x62c0, 0x62c1, 0xfffd, 0x62c3, 0x62cb, 0x62cf, 0x62d1, 0x62d5, 0x62dd, 0x62de, 0x62e0, 0x62e1, 0x62e4, 0x62ea, 0x62eb, 0x62f0, 0x62f2, 0x62f5, 0x62f8, 0x62f9, 0x62fa, 0x62fb, 0x6300, 0x6303, 0x6304, 0x6305, 0x6306, 0x630a, 0x630b, 0x630c, 0x630d, 0x630f, 0x6310, 0x6312, 0x6313, 0x6314, 0x6315, 0x6317, 0x6318, 0x6319, 0x631c, 0x6326, 0x6327, 0x6329, 0x632c, 0x632d, 0x632e, 0x6330, 0x6331, 0x6333, 0x6334, 0x6335, 0x6336, 0x6337, 0x6338, 0x633b, 0x633c, 0x633e, 0x633f, 0x6340, 0x6341, 0x6344, 0x6347, 0x6348, 0x634a, 0x6351, 0x6352, 0x6353, 0x6354, 0x6356, 0x6357, 0x6358, 0x6359, 0x635a, 0x635b, 0x635c, 0x635d, 0x6360, 0x6364, 0x6365, 0x6366, 0x6368, 0x636a, 0x636b, 0x636c, 0x636f, 0x6370, 0x6372, 0x6373, 0x6374, 0x6375, 0x6378, 0x6379, 0x637c, 0x637d, 0x637e, 0x637f, 0x6381, 0x6383, 0x6384, 0x6385, 0x6386, 0x638b, 0x638d, 0x6391, 0x6393, 0x6394, 0x6395, 0x6397, 0x6399, 0x639a, 0x639b, 0x639c, 0x639d, 0x639e, 0x639f, 0x63a1, 0x63a4, 0x63a6, 0x63ab, 0x63af, 0x63b1, 0x63b2, 0x63b5, 0x63b6, 0x63b9, 0x63bb, 0x63bd, 0x63bf, 0x63c0, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9340[ 192 ] = { 0x63c1, 0x63c2, 0x63c3, 0x63c5, 0x63c7, 0x63c8, 0x63ca, 0x63cb, 0x63cc, 0x63d1, 0x63d3, 0x63d4, 0x63d5, 0x63d7, 0x63d8, 0x63d9, 0x63da, 0x63db, 0x63dc, 0x63dd, 0x63df, 0x63e2, 0x63e4, 0x63e5, 0x63e6, 0x63e7, 0x63e8, 0x63eb, 0x63ec, 0x63ee, 0x63ef, 0x63f0, 0x63f1, 0x63f3, 0x63f5, 0x63f7, 0x63f9, 0x63fa, 0x63fb, 0x63fc, 0x63fe, 0x6403, 0x6404, 0x6406, 0x6407, 0x6408, 0x6409, 0x640a, 0x640d, 0x640e, 0x6411, 0x6412, 0x6415, 0x6416, 0x6417, 0x6418, 0x6419, 0x641a, 0x641d, 0x641f, 0x6422, 0x6423, 0x6424, 0xfffd, 0x6425, 0x6427, 0x6428, 0x6429, 0x642b, 0x642e, 0x642f, 0x6430, 0x6431, 0x6432, 0x6433, 0x6435, 0x6436, 0x6437, 0x6438, 0x6439, 0x643b, 0x643c, 0x643e, 0x6440, 0x6442, 0x6443, 0x6449, 0x644b, 0x644c, 0x644d, 0x644e, 0x644f, 0x6450, 0x6451, 0x6453, 0x6455, 0x6456, 0x6457, 0x6459, 0x645a, 0x645b, 0x645c, 0x645d, 0x645f, 0x6460, 0x6461, 0x6462, 0x6463, 0x6464, 0x6465, 0x6466, 0x6468, 0x646a, 0x646b, 0x646c, 0x646e, 0x646f, 0x6470, 0x6471, 0x6472, 0x6473, 0x6474, 0x6475, 0x6476, 0x6477, 0x647b, 0x647c, 0x647d, 0x647e, 0x647f, 0x6480, 0x6481, 0x6483, 0x6486, 0x6488, 0x6489, 0x648a, 0x648b, 0x648c, 0x648d, 0x648e, 0x648f, 0x6490, 0x6493, 0x6494, 0x6497, 0x6498, 0x649a, 0x649b, 0x649c, 0x649d, 0x649f, 0x64a0, 0x64a1, 0x64a2, 0x64a3, 0x64a5, 0x64a6, 0x64a7, 0x64a8, 0x64aa, 0x64ab, 0x64af, 0x64b1, 0x64b2, 0x64b3, 0x64b4, 0x64b6, 0x64b9, 0x64bb, 0x64bd, 0x64be, 0x64bf, 0x64c1, 0x64c3, 0x64c4, 0x64c6, 0x64c7, 0x64c8, 0x64c9, 0x64ca, 0x64cb, 0x64cc, 0x64cf, 0x64d1, 0x64d3, 0x64d4, 0x64d5, 0x64d6, 0x64d9, 0x64da, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9440[ 192 ] = { 0x64db, 0x64dc, 0x64dd, 0x64df, 0x64e0, 0x64e1, 0x64e3, 0x64e5, 0x64e7, 0x64e8, 0x64e9, 0x64ea, 0x64eb, 0x64ec, 0x64ed, 0x64ee, 0x64ef, 0x64f0, 0x64f1, 0x64f2, 0x64f3, 0x64f4, 0x64f5, 0x64f6, 0x64f7, 0x64f8, 0x64f9, 0x64fa, 0x64fb, 0x64fc, 0x64fd, 0x64fe, 0x64ff, 0x6501, 0x6502, 0x6503, 0x6504, 0x6505, 0x6506, 0x6507, 0x6508, 0x650a, 0x650b, 0x650c, 0x650d, 0x650e, 0x650f, 0x6510, 0x6511, 0x6513, 0x6514, 0x6515, 0x6516, 0x6517, 0x6519, 0x651a, 0x651b, 0x651c, 0x651d, 0x651e, 0x651f, 0x6520, 0x6521, 0xfffd, 0x6522, 0x6523, 0x6524, 0x6526, 0x6527, 0x6528, 0x6529, 0x652a, 0x652c, 0x652d, 0x6530, 0x6531, 0x6532, 0x6533, 0x6537, 0x653a, 0x653c, 0x653d, 0x6540, 0x6541, 0x6542, 0x6543, 0x6544, 0x6546, 0x6547, 0x654a, 0x654b, 0x654d, 0x654e, 0x6550, 0x6552, 0x6553, 0x6554, 0x6557, 0x6558, 0x655a, 0x655c, 0x655f, 0x6560, 0x6561, 0x6564, 0x6565, 0x6567, 0x6568, 0x6569, 0x656a, 0x656d, 0x656e, 0x656f, 0x6571, 0x6573, 0x6575, 0x6576, 0x6578, 0x6579, 0x657a, 0x657b, 0x657c, 0x657d, 0x657e, 0x657f, 0x6580, 0x6581, 0x6582, 0x6583, 0x6584, 0x6585, 0x6586, 0x6588, 0x6589, 0x658a, 0x658d, 0x658e, 0x658f, 0x6592, 0x6594, 0x6595, 0x6596, 0x6598, 0x659a, 0x659d, 0x659e, 0x65a0, 0x65a2, 0x65a3, 0x65a6, 0x65a8, 0x65aa, 0x65ac, 0x65ae, 0x65b1, 0x65b2, 0x65b3, 0x65b4, 0x65b5, 0x65b6, 0x65b7, 0x65b8, 0x65ba, 0x65bb, 0x65be, 0x65bf, 0x65c0, 0x65c2, 0x65c7, 0x65c8, 0x65c9, 0x65ca, 0x65cd, 0x65d0, 0x65d1, 0x65d3, 0x65d4, 0x65d5, 0x65d8, 0x65d9, 0x65da, 0x65db, 0x65dc, 0x65dd, 0x65de, 0x65df, 0x65e1, 0x65e3, 0x65e4, 0x65ea, 0x65eb, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9540[ 192 ] = { 0x65f2, 0x65f3, 0x65f4, 0x65f5, 0x65f8, 0x65f9, 0x65fb, 0x65fc, 0x65fd, 0x65fe, 0x65ff, 0x6601, 0x6604, 0x6605, 0x6607, 0x6608, 0x6609, 0x660b, 0x660d, 0x6610, 0x6611, 0x6612, 0x6616, 0x6617, 0x6618, 0x661a, 0x661b, 0x661c, 0x661e, 0x6621, 0x6622, 0x6623, 0x6624, 0x6626, 0x6629, 0x662a, 0x662b, 0x662c, 0x662e, 0x6630, 0x6632, 0x6633, 0x6637, 0x6638, 0x6639, 0x663a, 0x663b, 0x663d, 0x663f, 0x6640, 0x6642, 0x6644, 0x6645, 0x6646, 0x6647, 0x6648, 0x6649, 0x664a, 0x664d, 0x664e, 0x6650, 0x6651, 0x6658, 0xfffd, 0x6659, 0x665b, 0x665c, 0x665d, 0x665e, 0x6660, 0x6662, 0x6663, 0x6665, 0x6667, 0x6669, 0x666a, 0x666b, 0x666c, 0x666d, 0x6671, 0x6672, 0x6673, 0x6675, 0x6678, 0x6679, 0x667b, 0x667c, 0x667d, 0x667f, 0x6680, 0x6681, 0x6683, 0x6685, 0x6686, 0x6688, 0x6689, 0x668a, 0x668b, 0x668d, 0x668e, 0x668f, 0x6690, 0x6692, 0x6693, 0x6694, 0x6695, 0x6698, 0x6699, 0x669a, 0x669b, 0x669c, 0x669e, 0x669f, 0x66a0, 0x66a1, 0x66a2, 0x66a3, 0x66a4, 0x66a5, 0x66a6, 0x66a9, 0x66aa, 0x66ab, 0x66ac, 0x66ad, 0x66af, 0x66b0, 0x66b1, 0x66b2, 0x66b3, 0x66b5, 0x66b6, 0x66b7, 0x66b8, 0x66ba, 0x66bb, 0x66bc, 0x66bd, 0x66bf, 0x66c0, 0x66c1, 0x66c2, 0x66c3, 0x66c4, 0x66c5, 0x66c6, 0x66c7, 0x66c8, 0x66c9, 0x66ca, 0x66cb, 0x66cc, 0x66cd, 0x66ce, 0x66cf, 0x66d0, 0x66d1, 0x66d2, 0x66d3, 0x66d4, 0x66d5, 0x66d6, 0x66d7, 0x66d8, 0x66da, 0x66de, 0x66df, 0x66e0, 0x66e1, 0x66e2, 0x66e3, 0x66e4, 0x66e5, 0x66e7, 0x66e8, 0x66ea, 0x66eb, 0x66ec, 0x66ed, 0x66ee, 0x66ef, 0x66f1, 0x66f5, 0x66f6, 0x66f8, 0x66fa, 0x66fb, 0x66fd, 0x6701, 0x6702, 0x6703, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9640[ 192 ] = { 0x6704, 0x6705, 0x6706, 0x6707, 0x670c, 0x670e, 0x670f, 0x6711, 0x6712, 0x6713, 0x6716, 0x6718, 0x6719, 0x671a, 0x671c, 0x671e, 0x6720, 0x6721, 0x6722, 0x6723, 0x6724, 0x6725, 0x6727, 0x6729, 0x672e, 0x6730, 0x6732, 0x6733, 0x6736, 0x6737, 0x6738, 0x6739, 0x673b, 0x673c, 0x673e, 0x673f, 0x6741, 0x6744, 0x6745, 0x6747, 0x674a, 0x674b, 0x674d, 0x6752, 0x6754, 0x6755, 0x6757, 0x6758, 0x6759, 0x675a, 0x675b, 0x675d, 0x6762, 0x6763, 0x6764, 0x6766, 0x6767, 0x676b, 0x676c, 0x676e, 0x6771, 0x6774, 0x6776, 0xfffd, 0x6778, 0x6779, 0x677a, 0x677b, 0x677d, 0x6780, 0x6782, 0x6783, 0x6785, 0x6786, 0x6788, 0x678a, 0x678c, 0x678d, 0x678e, 0x678f, 0x6791, 0x6792, 0x6793, 0x6794, 0x6796, 0x6799, 0x679b, 0x679f, 0x67a0, 0x67a1, 0x67a4, 0x67a6, 0x67a9, 0x67ac, 0x67ae, 0x67b1, 0x67b2, 0x67b4, 0x67b9, 0x67ba, 0x67bb, 0x67bc, 0x67bd, 0x67be, 0x67bf, 0x67c0, 0x67c2, 0x67c5, 0x67c6, 0x67c7, 0x67c8, 0x67c9, 0x67ca, 0x67cb, 0x67cc, 0x67cd, 0x67ce, 0x67d5, 0x67d6, 0x67d7, 0x67db, 0x67df, 0x67e1, 0x67e3, 0x67e4, 0x67e6, 0x67e7, 0x67e8, 0x67ea, 0x67eb, 0x67ed, 0x67ee, 0x67f2, 0x67f5, 0x67f6, 0x67f7, 0x67f8, 0x67f9, 0x67fa, 0x67fb, 0x67fc, 0x67fe, 0x6801, 0x6802, 0x6803, 0x6804, 0x6806, 0x680d, 0x6810, 0x6812, 0x6814, 0x6815, 0x6818, 0x6819, 0x681a, 0x681b, 0x681c, 0x681e, 0x681f, 0x6820, 0x6822, 0x6823, 0x6824, 0x6825, 0x6826, 0x6827, 0x6828, 0x682b, 0x682c, 0x682d, 0x682e, 0x682f, 0x6830, 0x6831, 0x6834, 0x6835, 0x6836, 0x683a, 0x683b, 0x683f, 0x6847, 0x684b, 0x684d, 0x684f, 0x6852, 0x6856, 0x6857, 0x6858, 0x6859, 0x685a, 0x685b, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9740[ 192 ] = { 0x685c, 0x685d, 0x685e, 0x685f, 0x686a, 0x686c, 0x686d, 0x686e, 0x686f, 0x6870, 0x6871, 0x6872, 0x6873, 0x6875, 0x6878, 0x6879, 0x687a, 0x687b, 0x687c, 0x687d, 0x687e, 0x687f, 0x6880, 0x6882, 0x6884, 0x6887, 0x6888, 0x6889, 0x688a, 0x688b, 0x688c, 0x688d, 0x688e, 0x6890, 0x6891, 0x6892, 0x6894, 0x6895, 0x6896, 0x6898, 0x6899, 0x689a, 0x689b, 0x689c, 0x689d, 0x689e, 0x689f, 0x68a0, 0x68a1, 0x68a3, 0x68a4, 0x68a5, 0x68a9, 0x68aa, 0x68ab, 0x68ac, 0x68ae, 0x68b1, 0x68b2, 0x68b4, 0x68b6, 0x68b7, 0x68b8, 0xfffd, 0x68b9, 0x68ba, 0x68bb, 0x68bc, 0x68bd, 0x68be, 0x68bf, 0x68c1, 0x68c3, 0x68c4, 0x68c5, 0x68c6, 0x68c7, 0x68c8, 0x68ca, 0x68cc, 0x68ce, 0x68cf, 0x68d0, 0x68d1, 0x68d3, 0x68d4, 0x68d6, 0x68d7, 0x68d9, 0x68db, 0x68dc, 0x68dd, 0x68de, 0x68df, 0x68e1, 0x68e2, 0x68e4, 0x68e5, 0x68e6, 0x68e7, 0x68e8, 0x68e9, 0x68ea, 0x68eb, 0x68ec, 0x68ed, 0x68ef, 0x68f2, 0x68f3, 0x68f4, 0x68f6, 0x68f7, 0x68f8, 0x68fb, 0x68fd, 0x68fe, 0x68ff, 0x6900, 0x6902, 0x6903, 0x6904, 0x6906, 0x6907, 0x6908, 0x6909, 0x690a, 0x690c, 0x690f, 0x6911, 0x6913, 0x6914, 0x6915, 0x6916, 0x6917, 0x6918, 0x6919, 0x691a, 0x691b, 0x691c, 0x691d, 0x691e, 0x6921, 0x6922, 0x6923, 0x6925, 0x6926, 0x6927, 0x6928, 0x6929, 0x692a, 0x692b, 0x692c, 0x692e, 0x692f, 0x6931, 0x6932, 0x6933, 0x6935, 0x6936, 0x6937, 0x6938, 0x693a, 0x693b, 0x693c, 0x693e, 0x6940, 0x6941, 0x6943, 0x6944, 0x6945, 0x6946, 0x6947, 0x6948, 0x6949, 0x694a, 0x694b, 0x694c, 0x694d, 0x694e, 0x694f, 0x6950, 0x6951, 0x6952, 0x6953, 0x6955, 0x6956, 0x6958, 0x6959, 0x695b, 0x695c, 0x695f, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9840[ 192 ] = { 0x6961, 0x6962, 0x6964, 0x6965, 0x6967, 0x6968, 0x6969, 0x696a, 0x696c, 0x696d, 0x696f, 0x6970, 0x6972, 0x6973, 0x6974, 0x6975, 0x6976, 0x697a, 0x697b, 0x697d, 0x697e, 0x697f, 0x6981, 0x6983, 0x6985, 0x698a, 0x698b, 0x698c, 0x698e, 0x698f, 0x6990, 0x6991, 0x6992, 0x6993, 0x6996, 0x6997, 0x6999, 0x699a, 0x699d, 0x699e, 0x699f, 0x69a0, 0x69a1, 0x69a2, 0x69a3, 0x69a4, 0x69a5, 0x69a6, 0x69a9, 0x69aa, 0x69ac, 0x69ae, 0x69af, 0x69b0, 0x69b2, 0x69b3, 0x69b5, 0x69b6, 0x69b8, 0x69b9, 0x69ba, 0x69bc, 0x69bd, 0xfffd, 0x69be, 0x69bf, 0x69c0, 0x69c2, 0x69c3, 0x69c4, 0x69c5, 0x69c6, 0x69c7, 0x69c8, 0x69c9, 0x69cb, 0x69cd, 0x69cf, 0x69d1, 0x69d2, 0x69d3, 0x69d5, 0x69d6, 0x69d7, 0x69d8, 0x69d9, 0x69da, 0x69dc, 0x69dd, 0x69de, 0x69e1, 0x69e2, 0x69e3, 0x69e4, 0x69e5, 0x69e6, 0x69e7, 0x69e8, 0x69e9, 0x69ea, 0x69eb, 0x69ec, 0x69ee, 0x69ef, 0x69f0, 0x69f1, 0x69f3, 0x69f4, 0x69f5, 0x69f6, 0x69f7, 0x69f8, 0x69f9, 0x69fa, 0x69fb, 0x69fc, 0x69fe, 0x6a00, 0x6a01, 0x6a02, 0x6a03, 0x6a04, 0x6a05, 0x6a06, 0x6a07, 0x6a08, 0x6a09, 0x6a0b, 0x6a0c, 0x6a0d, 0x6a0e, 0x6a0f, 0x6a10, 0x6a11, 0x6a12, 0x6a13, 0x6a14, 0x6a15, 0x6a16, 0x6a19, 0x6a1a, 0x6a1b, 0x6a1c, 0x6a1d, 0x6a1e, 0x6a20, 0x6a22, 0x6a23, 0x6a24, 0x6a25, 0x6a26, 0x6a27, 0x6a29, 0x6a2b, 0x6a2c, 0x6a2d, 0x6a2e, 0x6a30, 0x6a32, 0x6a33, 0x6a34, 0x6a36, 0x6a37, 0x6a38, 0x6a39, 0x6a3a, 0x6a3b, 0x6a3c, 0x6a3f, 0x6a40, 0x6a41, 0x6a42, 0x6a43, 0x6a45, 0x6a46, 0x6a48, 0x6a49, 0x6a4a, 0x6a4b, 0x6a4c, 0x6a4d, 0x6a4e, 0x6a4f, 0x6a51, 0x6a52, 0x6a53, 0x6a54, 0x6a55, 0x6a56, 0x6a57, 0x6a5a, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9940[ 192 ] = { 0x6a5c, 0x6a5d, 0x6a5e, 0x6a5f, 0x6a60, 0x6a62, 0x6a63, 0x6a64, 0x6a66, 0x6a67, 0x6a68, 0x6a69, 0x6a6a, 0x6a6b, 0x6a6c, 0x6a6d, 0x6a6e, 0x6a6f, 0x6a70, 0x6a72, 0x6a73, 0x6a74, 0x6a75, 0x6a76, 0x6a77, 0x6a78, 0x6a7a, 0x6a7b, 0x6a7d, 0x6a7e, 0x6a7f, 0x6a81, 0x6a82, 0x6a83, 0x6a85, 0x6a86, 0x6a87, 0x6a88, 0x6a89, 0x6a8a, 0x6a8b, 0x6a8c, 0x6a8d, 0x6a8f, 0x6a92, 0x6a93, 0x6a94, 0x6a95, 0x6a96, 0x6a98, 0x6a99, 0x6a9a, 0x6a9b, 0x6a9c, 0x6a9d, 0x6a9e, 0x6a9f, 0x6aa1, 0x6aa2, 0x6aa3, 0x6aa4, 0x6aa5, 0x6aa6, 0xfffd, 0x6aa7, 0x6aa8, 0x6aaa, 0x6aad, 0x6aae, 0x6aaf, 0x6ab0, 0x6ab1, 0x6ab2, 0x6ab3, 0x6ab4, 0x6ab5, 0x6ab6, 0x6ab7, 0x6ab8, 0x6ab9, 0x6aba, 0x6abb, 0x6abc, 0x6abd, 0x6abe, 0x6abf, 0x6ac0, 0x6ac1, 0x6ac2, 0x6ac3, 0x6ac4, 0x6ac5, 0x6ac6, 0x6ac7, 0x6ac8, 0x6ac9, 0x6aca, 0x6acb, 0x6acc, 0x6acd, 0x6ace, 0x6acf, 0x6ad0, 0x6ad1, 0x6ad2, 0x6ad3, 0x6ad4, 0x6ad5, 0x6ad6, 0x6ad7, 0x6ad8, 0x6ad9, 0x6ada, 0x6adb, 0x6adc, 0x6add, 0x6ade, 0x6adf, 0x6ae0, 0x6ae1, 0x6ae2, 0x6ae3, 0x6ae4, 0x6ae5, 0x6ae6, 0x6ae7, 0x6ae8, 0x6ae9, 0x6aea, 0x6aeb, 0x6aec, 0x6aed, 0x6aee, 0x6aef, 0x6af0, 0x6af1, 0x6af2, 0x6af3, 0x6af4, 0x6af5, 0x6af6, 0x6af7, 0x6af8, 0x6af9, 0x6afa, 0x6afb, 0x6afc, 0x6afd, 0x6afe, 0x6aff, 0x6b00, 0x6b01, 0x6b02, 0x6b03, 0x6b04, 0x6b05, 0x6b06, 0x6b07, 0x6b08, 0x6b09, 0x6b0a, 0x6b0b, 0x6b0c, 0x6b0d, 0x6b0e, 0x6b0f, 0x6b10, 0x6b11, 0x6b12, 0x6b13, 0x6b14, 0x6b15, 0x6b16, 0x6b17, 0x6b18, 0x6b19, 0x6b1a, 0x6b1b, 0x6b1c, 0x6b1d, 0x6b1e, 0x6b1f, 0x6b25, 0x6b26, 0x6b28, 0x6b29, 0x6b2a, 0x6b2b, 0x6b2c, 0x6b2d, 0x6b2e, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9a40[ 192 ] = { 0x6b2f, 0x6b30, 0x6b31, 0x6b33, 0x6b34, 0x6b35, 0x6b36, 0x6b38, 0x6b3b, 0x6b3c, 0x6b3d, 0x6b3f, 0x6b40, 0x6b41, 0x6b42, 0x6b44, 0x6b45, 0x6b48, 0x6b4a, 0x6b4b, 0x6b4d, 0x6b4e, 0x6b4f, 0x6b50, 0x6b51, 0x6b52, 0x6b53, 0x6b54, 0x6b55, 0x6b56, 0x6b57, 0x6b58, 0x6b5a, 0x6b5b, 0x6b5c, 0x6b5d, 0x6b5e, 0x6b5f, 0x6b60, 0x6b61, 0x6b68, 0x6b69, 0x6b6b, 0x6b6c, 0x6b6d, 0x6b6e, 0x6b6f, 0x6b70, 0x6b71, 0x6b72, 0x6b73, 0x6b74, 0x6b75, 0x6b76, 0x6b77, 0x6b78, 0x6b7a, 0x6b7d, 0x6b7e, 0x6b7f, 0x6b80, 0x6b85, 0x6b88, 0xfffd, 0x6b8c, 0x6b8e, 0x6b8f, 0x6b90, 0x6b91, 0x6b94, 0x6b95, 0x6b97, 0x6b98, 0x6b99, 0x6b9c, 0x6b9d, 0x6b9e, 0x6b9f, 0x6ba0, 0x6ba2, 0x6ba3, 0x6ba4, 0x6ba5, 0x6ba6, 0x6ba7, 0x6ba8, 0x6ba9, 0x6bab, 0x6bac, 0x6bad, 0x6bae, 0x6baf, 0x6bb0, 0x6bb1, 0x6bb2, 0x6bb6, 0x6bb8, 0x6bb9, 0x6bba, 0x6bbb, 0x6bbc, 0x6bbd, 0x6bbe, 0x6bc0, 0x6bc3, 0x6bc4, 0x6bc6, 0x6bc7, 0x6bc8, 0x6bc9, 0x6bca, 0x6bcc, 0x6bce, 0x6bd0, 0x6bd1, 0x6bd8, 0x6bda, 0x6bdc, 0x6bdd, 0x6bde, 0x6bdf, 0x6be0, 0x6be2, 0x6be3, 0x6be4, 0x6be5, 0x6be6, 0x6be7, 0x6be8, 0x6be9, 0x6bec, 0x6bed, 0x6bee, 0x6bf0, 0x6bf1, 0x6bf2, 0x6bf4, 0x6bf6, 0x6bf7, 0x6bf8, 0x6bfa, 0x6bfb, 0x6bfc, 0x6bfe, 0x6bff, 0x6c00, 0x6c01, 0x6c02, 0x6c03, 0x6c04, 0x6c08, 0x6c09, 0x6c0a, 0x6c0b, 0x6c0c, 0x6c0e, 0x6c12, 0x6c17, 0x6c1c, 0x6c1d, 0x6c1e, 0x6c20, 0x6c23, 0x6c25, 0x6c2b, 0x6c2c, 0x6c2d, 0x6c31, 0x6c33, 0x6c36, 0x6c37, 0x6c39, 0x6c3a, 0x6c3b, 0x6c3c, 0x6c3e, 0x6c3f, 0x6c43, 0x6c44, 0x6c45, 0x6c48, 0x6c4b, 0x6c4c, 0x6c4d, 0x6c4e, 0x6c4f, 0x6c51, 0x6c52, 0x6c53, 0x6c56, 0x6c58, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9b40[ 192 ] = { 0x6c59, 0x6c5a, 0x6c62, 0x6c63, 0x6c65, 0x6c66, 0x6c67, 0x6c6b, 0x6c6c, 0x6c6d, 0x6c6e, 0x6c6f, 0x6c71, 0x6c73, 0x6c75, 0x6c77, 0x6c78, 0x6c7a, 0x6c7b, 0x6c7c, 0x6c7f, 0x6c80, 0x6c84, 0x6c87, 0x6c8a, 0x6c8b, 0x6c8d, 0x6c8e, 0x6c91, 0x6c92, 0x6c95, 0x6c96, 0x6c97, 0x6c98, 0x6c9a, 0x6c9c, 0x6c9d, 0x6c9e, 0x6ca0, 0x6ca2, 0x6ca8, 0x6cac, 0x6caf, 0x6cb0, 0x6cb4, 0x6cb5, 0x6cb6, 0x6cb7, 0x6cba, 0x6cc0, 0x6cc1, 0x6cc2, 0x6cc3, 0x6cc6, 0x6cc7, 0x6cc8, 0x6ccb, 0x6ccd, 0x6cce, 0x6ccf, 0x6cd1, 0x6cd2, 0x6cd8, 0xfffd, 0x6cd9, 0x6cda, 0x6cdc, 0x6cdd, 0x6cdf, 0x6ce4, 0x6ce6, 0x6ce7, 0x6ce9, 0x6cec, 0x6ced, 0x6cf2, 0x6cf4, 0x6cf9, 0x6cff, 0x6d00, 0x6d02, 0x6d03, 0x6d05, 0x6d06, 0x6d08, 0x6d09, 0x6d0a, 0x6d0d, 0x6d0f, 0x6d10, 0x6d11, 0x6d13, 0x6d14, 0x6d15, 0x6d16, 0x6d18, 0x6d1c, 0x6d1d, 0x6d1f, 0x6d20, 0x6d21, 0x6d22, 0x6d23, 0x6d24, 0x6d26, 0x6d28, 0x6d29, 0x6d2c, 0x6d2d, 0x6d2f, 0x6d30, 0x6d34, 0x6d36, 0x6d37, 0x6d38, 0x6d3a, 0x6d3f, 0x6d40, 0x6d42, 0x6d44, 0x6d49, 0x6d4c, 0x6d50, 0x6d55, 0x6d56, 0x6d57, 0x6d58, 0x6d5b, 0x6d5d, 0x6d5f, 0x6d61, 0x6d62, 0x6d64, 0x6d65, 0x6d67, 0x6d68, 0x6d6b, 0x6d6c, 0x6d6d, 0x6d70, 0x6d71, 0x6d72, 0x6d73, 0x6d75, 0x6d76, 0x6d79, 0x6d7a, 0x6d7b, 0x6d7d, 0x6d7e, 0x6d7f, 0x6d80, 0x6d81, 0x6d83, 0x6d84, 0x6d86, 0x6d87, 0x6d8a, 0x6d8b, 0x6d8d, 0x6d8f, 0x6d90, 0x6d92, 0x6d96, 0x6d97, 0x6d98, 0x6d99, 0x6d9a, 0x6d9c, 0x6da2, 0x6da5, 0x6dac, 0x6dad, 0x6db0, 0x6db1, 0x6db3, 0x6db4, 0x6db6, 0x6db7, 0x6db9, 0x6dba, 0x6dbb, 0x6dbc, 0x6dbd, 0x6dbe, 0x6dc1, 0x6dc2, 0x6dc3, 0x6dc8, 0x6dc9, 0x6dca, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9c40[ 192 ] = { 0x6dcd, 0x6dce, 0x6dcf, 0x6dd0, 0x6dd2, 0x6dd3, 0x6dd4, 0x6dd5, 0x6dd7, 0x6dda, 0x6ddb, 0x6ddc, 0x6ddf, 0x6de2, 0x6de3, 0x6de5, 0x6de7, 0x6de8, 0x6de9, 0x6dea, 0x6ded, 0x6def, 0x6df0, 0x6df2, 0x6df4, 0x6df5, 0x6df6, 0x6df8, 0x6dfa, 0x6dfd, 0x6dfe, 0x6dff, 0x6e00, 0x6e01, 0x6e02, 0x6e03, 0x6e04, 0x6e06, 0x6e07, 0x6e08, 0x6e09, 0x6e0b, 0x6e0f, 0x6e12, 0x6e13, 0x6e15, 0x6e18, 0x6e19, 0x6e1b, 0x6e1c, 0x6e1e, 0x6e1f, 0x6e22, 0x6e26, 0x6e27, 0x6e28, 0x6e2a, 0x6e2c, 0x6e2e, 0x6e30, 0x6e31, 0x6e33, 0x6e35, 0xfffd, 0x6e36, 0x6e37, 0x6e39, 0x6e3b, 0x6e3c, 0x6e3d, 0x6e3e, 0x6e3f, 0x6e40, 0x6e41, 0x6e42, 0x6e45, 0x6e46, 0x6e47, 0x6e48, 0x6e49, 0x6e4a, 0x6e4b, 0x6e4c, 0x6e4f, 0x6e50, 0x6e51, 0x6e52, 0x6e55, 0x6e57, 0x6e59, 0x6e5a, 0x6e5c, 0x6e5d, 0x6e5e, 0x6e60, 0x6e61, 0x6e62, 0x6e63, 0x6e64, 0x6e65, 0x6e66, 0x6e67, 0x6e68, 0x6e69, 0x6e6a, 0x6e6c, 0x6e6d, 0x6e6f, 0x6e70, 0x6e71, 0x6e72, 0x6e73, 0x6e74, 0x6e75, 0x6e76, 0x6e77, 0x6e78, 0x6e79, 0x6e7a, 0x6e7b, 0x6e7c, 0x6e7d, 0x6e80, 0x6e81, 0x6e82, 0x6e84, 0x6e87, 0x6e88, 0x6e8a, 0x6e8b, 0x6e8c, 0x6e8d, 0x6e8e, 0x6e91, 0x6e92, 0x6e93, 0x6e94, 0x6e95, 0x6e96, 0x6e97, 0x6e99, 0x6e9a, 0x6e9b, 0x6e9d, 0x6e9e, 0x6ea0, 0x6ea1, 0x6ea3, 0x6ea4, 0x6ea6, 0x6ea8, 0x6ea9, 0x6eab, 0x6eac, 0x6ead, 0x6eae, 0x6eb0, 0x6eb3, 0x6eb5, 0x6eb8, 0x6eb9, 0x6ebc, 0x6ebe, 0x6ebf, 0x6ec0, 0x6ec3, 0x6ec4, 0x6ec5, 0x6ec6, 0x6ec8, 0x6ec9, 0x6eca, 0x6ecc, 0x6ecd, 0x6ece, 0x6ed0, 0x6ed2, 0x6ed6, 0x6ed8, 0x6ed9, 0x6edb, 0x6edc, 0x6edd, 0x6ee3, 0x6ee7, 0x6eea, 0x6eeb, 0x6eec, 0x6eed, 0x6eee, 0x6eef, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9d40[ 192 ] = { 0x6ef0, 0x6ef1, 0x6ef2, 0x6ef3, 0x6ef5, 0x6ef6, 0x6ef7, 0x6ef8, 0x6efa, 0x6efb, 0x6efc, 0x6efd, 0x6efe, 0x6eff, 0x6f00, 0x6f01, 0x6f03, 0x6f04, 0x6f05, 0x6f07, 0x6f08, 0x6f0a, 0x6f0b, 0x6f0c, 0x6f0d, 0x6f0e, 0x6f10, 0x6f11, 0x6f12, 0x6f16, 0x6f17, 0x6f18, 0x6f19, 0x6f1a, 0x6f1b, 0x6f1c, 0x6f1d, 0x6f1e, 0x6f1f, 0x6f21, 0x6f22, 0x6f23, 0x6f25, 0x6f26, 0x6f27, 0x6f28, 0x6f2c, 0x6f2e, 0x6f30, 0x6f32, 0x6f34, 0x6f35, 0x6f37, 0x6f38, 0x6f39, 0x6f3a, 0x6f3b, 0x6f3c, 0x6f3d, 0x6f3f, 0x6f40, 0x6f41, 0x6f42, 0xfffd, 0x6f43, 0x6f44, 0x6f45, 0x6f48, 0x6f49, 0x6f4a, 0x6f4c, 0x6f4e, 0x6f4f, 0x6f50, 0x6f51, 0x6f52, 0x6f53, 0x6f54, 0x6f55, 0x6f56, 0x6f57, 0x6f59, 0x6f5a, 0x6f5b, 0x6f5d, 0x6f5f, 0x6f60, 0x6f61, 0x6f63, 0x6f64, 0x6f65, 0x6f67, 0x6f68, 0x6f69, 0x6f6a, 0x6f6b, 0x6f6c, 0x6f6f, 0x6f70, 0x6f71, 0x6f73, 0x6f75, 0x6f76, 0x6f77, 0x6f79, 0x6f7b, 0x6f7d, 0x6f7e, 0x6f7f, 0x6f80, 0x6f81, 0x6f82, 0x6f83, 0x6f85, 0x6f86, 0x6f87, 0x6f8a, 0x6f8b, 0x6f8f, 0x6f90, 0x6f91, 0x6f92, 0x6f93, 0x6f94, 0x6f95, 0x6f96, 0x6f97, 0x6f98, 0x6f99, 0x6f9a, 0x6f9b, 0x6f9d, 0x6f9e, 0x6f9f, 0x6fa0, 0x6fa2, 0x6fa3, 0x6fa4, 0x6fa5, 0x6fa6, 0x6fa8, 0x6fa9, 0x6faa, 0x6fab, 0x6fac, 0x6fad, 0x6fae, 0x6faf, 0x6fb0, 0x6fb1, 0x6fb2, 0x6fb4, 0x6fb5, 0x6fb7, 0x6fb8, 0x6fba, 0x6fbb, 0x6fbc, 0x6fbd, 0x6fbe, 0x6fbf, 0x6fc1, 0x6fc3, 0x6fc4, 0x6fc5, 0x6fc6, 0x6fc7, 0x6fc8, 0x6fca, 0x6fcb, 0x6fcc, 0x6fcd, 0x6fce, 0x6fcf, 0x6fd0, 0x6fd3, 0x6fd4, 0x6fd5, 0x6fd6, 0x6fd7, 0x6fd8, 0x6fd9, 0x6fda, 0x6fdb, 0x6fdc, 0x6fdd, 0x6fdf, 0x6fe2, 0x6fe3, 0x6fe4, 0x6fe5, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9e40[ 192 ] = { 0x6fe6, 0x6fe7, 0x6fe8, 0x6fe9, 0x6fea, 0x6feb, 0x6fec, 0x6fed, 0x6ff0, 0x6ff1, 0x6ff2, 0x6ff3, 0x6ff4, 0x6ff5, 0x6ff6, 0x6ff7, 0x6ff8, 0x6ff9, 0x6ffa, 0x6ffb, 0x6ffc, 0x6ffd, 0x6ffe, 0x6fff, 0x7000, 0x7001, 0x7002, 0x7003, 0x7004, 0x7005, 0x7006, 0x7007, 0x7008, 0x7009, 0x700a, 0x700b, 0x700c, 0x700d, 0x700e, 0x700f, 0x7010, 0x7012, 0x7013, 0x7014, 0x7015, 0x7016, 0x7017, 0x7018, 0x7019, 0x701c, 0x701d, 0x701e, 0x701f, 0x7020, 0x7021, 0x7022, 0x7024, 0x7025, 0x7026, 0x7027, 0x7028, 0x7029, 0x702a, 0xfffd, 0x702b, 0x702c, 0x702d, 0x702e, 0x702f, 0x7030, 0x7031, 0x7032, 0x7033, 0x7034, 0x7036, 0x7037, 0x7038, 0x703a, 0x703b, 0x703c, 0x703d, 0x703e, 0x703f, 0x7040, 0x7041, 0x7042, 0x7043, 0x7044, 0x7045, 0x7046, 0x7047, 0x7048, 0x7049, 0x704a, 0x704b, 0x704d, 0x704e, 0x7050, 0x7051, 0x7052, 0x7053, 0x7054, 0x7055, 0x7056, 0x7057, 0x7058, 0x7059, 0x705a, 0x705b, 0x705c, 0x705d, 0x705f, 0x7060, 0x7061, 0x7062, 0x7063, 0x7064, 0x7065, 0x7066, 0x7067, 0x7068, 0x7069, 0x706a, 0x706e, 0x7071, 0x7072, 0x7073, 0x7074, 0x7077, 0x7079, 0x707a, 0x707b, 0x707d, 0x7081, 0x7082, 0x7083, 0x7084, 0x7086, 0x7087, 0x7088, 0x708b, 0x708c, 0x708d, 0x708f, 0x7090, 0x7091, 0x7093, 0x7097, 0x7098, 0x709a, 0x709b, 0x709e, 0x709f, 0x70a0, 0x70a1, 0x70a2, 0x70a3, 0x70a4, 0x70a5, 0x70a6, 0x70a7, 0x70a8, 0x70a9, 0x70aa, 0x70b0, 0x70b2, 0x70b4, 0x70b5, 0x70b6, 0x70ba, 0x70be, 0x70bf, 0x70c4, 0x70c5, 0x70c6, 0x70c7, 0x70c9, 0x70cb, 0x70cc, 0x70cd, 0x70ce, 0x70cf, 0x70d0, 0x70d1, 0x70d2, 0x70d3, 0x70d4, 0x70d5, 0x70d6, 0x70d7, 0x70da, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9f40[ 192 ] = { 0x70dc, 0x70dd, 0x70de, 0x70e0, 0x70e1, 0x70e2, 0x70e3, 0x70e5, 0x70ea, 0x70ee, 0x70f0, 0x70f1, 0x70f2, 0x70f3, 0x70f4, 0x70f5, 0x70f6, 0x70f8, 0x70fa, 0x70fb, 0x70fc, 0x70fe, 0x70ff, 0x7100, 0x7101, 0x7102, 0x7103, 0x7104, 0x7105, 0x7106, 0x7107, 0x7108, 0x710b, 0x710c, 0x710d, 0x710e, 0x710f, 0x7111, 0x7112, 0x7114, 0x7117, 0x711b, 0x711c, 0x711d, 0x711e, 0x711f, 0x7120, 0x7121, 0x7122, 0x7123, 0x7124, 0x7125, 0x7127, 0x7128, 0x7129, 0x712a, 0x712b, 0x712c, 0x712d, 0x712e, 0x7132, 0x7133, 0x7134, 0xfffd, 0x7135, 0x7137, 0x7138, 0x7139, 0x713a, 0x713b, 0x713c, 0x713d, 0x713e, 0x713f, 0x7140, 0x7141, 0x7142, 0x7143, 0x7144, 0x7146, 0x7147, 0x7148, 0x7149, 0x714b, 0x714d, 0x714f, 0x7150, 0x7151, 0x7152, 0x7153, 0x7154, 0x7155, 0x7156, 0x7157, 0x7158, 0x7159, 0x715a, 0x715b, 0x715d, 0x715f, 0x7160, 0x7161, 0x7162, 0x7163, 0x7165, 0x7169, 0x716a, 0x716b, 0x716c, 0x716d, 0x716f, 0x7170, 0x7171, 0x7174, 0x7175, 0x7176, 0x7177, 0x7179, 0x717b, 0x717c, 0x717e, 0x717f, 0x7180, 0x7181, 0x7182, 0x7183, 0x7185, 0x7186, 0x7187, 0x7188, 0x7189, 0x718b, 0x718c, 0x718d, 0x718e, 0x7190, 0x7191, 0x7192, 0x7193, 0x7195, 0x7196, 0x7197, 0x719a, 0x719b, 0x719c, 0x719d, 0x719e, 0x71a1, 0x71a2, 0x71a3, 0x71a4, 0x71a5, 0x71a6, 0x71a7, 0x71a9, 0x71aa, 0x71ab, 0x71ad, 0x71ae, 0x71af, 0x71b0, 0x71b1, 0x71b2, 0x71b4, 0x71b6, 0x71b7, 0x71b8, 0x71ba, 0x71bb, 0x71bc, 0x71bd, 0x71be, 0x71bf, 0x71c0, 0x71c1, 0x71c2, 0x71c4, 0x71c5, 0x71c6, 0x71c7, 0x71c8, 0x71c9, 0x71ca, 0x71cb, 0x71cc, 0x71cd, 0x71cf, 0x71d0, 0x71d1, 0x71d2, 0x71d3, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa040[ 192 ] = { 0x71d6, 0x71d7, 0x71d8, 0x71d9, 0x71da, 0x71db, 0x71dc, 0x71dd, 0x71de, 0x71df, 0x71e1, 0x71e2, 0x71e3, 0x71e4, 0x71e6, 0x71e8, 0x71e9, 0x71ea, 0x71eb, 0x71ec, 0x71ed, 0x71ef, 0x71f0, 0x71f1, 0x71f2, 0x71f3, 0x71f4, 0x71f5, 0x71f6, 0x71f7, 0x71f8, 0x71fa, 0x71fb, 0x71fc, 0x71fd, 0x71fe, 0x71ff, 0x7200, 0x7201, 0x7202, 0x7203, 0x7204, 0x7205, 0x7207, 0x7208, 0x7209, 0x720a, 0x720b, 0x720c, 0x720d, 0x720e, 0x720f, 0x7210, 0x7211, 0x7212, 0x7213, 0x7214, 0x7215, 0x7216, 0x7217, 0x7218, 0x7219, 0x721a, 0xfffd, 0x721b, 0x721c, 0x721e, 0x721f, 0x7220, 0x7221, 0x7222, 0x7223, 0x7224, 0x7225, 0x7226, 0x7227, 0x7229, 0x722b, 0x722d, 0x722e, 0x722f, 0x7232, 0x7233, 0x7234, 0x723a, 0x723c, 0x723e, 0x7240, 0x7241, 0x7242, 0x7243, 0x7244, 0x7245, 0x7246, 0x7249, 0x724a, 0x724b, 0x724e, 0x724f, 0x7250, 0x7251, 0x7253, 0x7254, 0x7255, 0x7257, 0x7258, 0x725a, 0x725c, 0x725e, 0x7260, 0x7263, 0x7264, 0x7265, 0x7268, 0x726a, 0x726b, 0x726c, 0x726d, 0x7270, 0x7271, 0x7273, 0x7274, 0x7276, 0x7277, 0x7278, 0x727b, 0x727c, 0x727d, 0x7282, 0x7283, 0x7285, 0x7286, 0x7287, 0x7288, 0x7289, 0x728c, 0x728e, 0x7290, 0x7291, 0x7293, 0x7294, 0x7295, 0x7296, 0x7297, 0x7298, 0x7299, 0x729a, 0x729b, 0x729c, 0x729d, 0x729e, 0x72a0, 0x72a1, 0x72a2, 0x72a3, 0x72a4, 0x72a5, 0x72a6, 0x72a7, 0x72a8, 0x72a9, 0x72aa, 0x72ab, 0x72ae, 0x72b1, 0x72b2, 0x72b3, 0x72b5, 0x72ba, 0x72bb, 0x72bc, 0x72bd, 0x72be, 0x72bf, 0x72c0, 0x72c5, 0x72c6, 0x72c7, 0x72c9, 0x72ca, 0x72cb, 0x72cc, 0x72cf, 0x72d1, 0x72d3, 0x72d4, 0x72d5, 0x72d6, 0x72d8, 0x72da, 0x72db, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa1a0[ 96 ] = { 0xfffd, 0x3000, 0x3001, 0x3002, 0x00b7, 0x02c9, 0x02c7, 0x00a8, 0x3003, 0x3005, 0x2014, 0xff5e, 0x2016, 0x2026, 0x2018, 0x2019, 0x201c, 0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3016, 0x3017, 0x3010, 0x3011, 0x00b1, 0x00d7, 0x00f7, 0x2236, 0x2227, 0x2228, 0x2211, 0x220f, 0x222a, 0x2229, 0x2208, 0x2237, 0x221a, 0x22a5, 0x2225, 0x2220, 0x2312, 0x2299, 0x222b, 0x222e, 0x2261, 0x224c, 0x2248, 0x223d, 0x221d, 0x2260, 0x226e, 0x226f, 0x2264, 0x2265, 0x221e, 0x2235, 0x2234, 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xff04, 0x00a4, 0xffe0, 0xffe1, 0x2030, 0x00a7, 0x2116, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x203b, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa2a0[ 96 ] = { 0xfffd, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, 0x2498, 0x2499, 0x249a, 0x249b, 0x2474, 0x2475, 0x2476, 0x2477, 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0xfffd, 0xfffd, 0x3220, 0x3221, 0x3222, 0x3223, 0x3224, 0x3225, 0x3226, 0x3227, 0x3228, 0x3229, 0xfffd, 0xfffd, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216a, 0x216b, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa3a0[ 96 ] = { 0xfffd, 0xff01, 0xff02, 0xff03, 0xffe5, 0xff05, 0xff06, 0xff07, 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f, 0xff20, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f, 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xffe3, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa4a0[ 88 ] = { 0xfffd, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f, 0x3090, 0x3091, 0x3092, 0x3093, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa5a0[ 88 ] = { 0xfffd, 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7, 0x30a8, 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af, 0x30b0, 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7, 0x30b8, 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf, 0x30c0, 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7, 0x30c8, 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d0, 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7, 0x30d8, 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef, 0x30f0, 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa6a0[ 88 ] = { 0xfffd, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfe35, 0xfe36, 0xfe39, 0xfe3a, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, 0xfe42, 0xfe43, 0xfe44, 0xfffd, 0xfffd, 0xfe3b, 0xfe3c, 0xfe37, 0xfe38, 0xfe31, 0xfffd, 0xfe33, 0xfe34, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7a0[ 40 ] = { 0xfffd, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7d0[ 40 ] = { 0xfffd, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa840[ 88 ] = { 0x02ca, 0x02cb, 0x02d9, 0x2013, 0x2015, 0x2025, 0x2035, 0x2105, 0x2109, 0x2196, 0x2197, 0x2198, 0x2199, 0x2215, 0x221f, 0x2223, 0x2252, 0x2266, 0x2267, 0x22bf, 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x256d, 0x256e, 0x256f, 0x2570, 0x2571, 0x2572, 0x2573, 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0xfffd, 0x2588, 0x2589, 0x258a, 0x258b, 0x258c, 0x258d, 0x258e, 0x258f, 0x2593, 0x2594, 0x2595, 0x25bc, 0x25bd, 0x25e2, 0x25e3, 0x25e4, 0x25e5, 0x2609, 0x2295, 0x3012, 0x301d, 0x301e, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa8a0[ 80 ] = { 0xfffd, 0x0101, 0x00e1, 0x01ce, 0x00e0, 0x0113, 0x00e9, 0x011b, 0x00e8, 0x012b, 0x00ed, 0x01d0, 0x00ec, 0x014d, 0x00f3, 0x01d2, 0x00f2, 0x016b, 0x00fa, 0x01d4, 0x00f9, 0x01d6, 0x01d8, 0x01da, 0x01dc, 0x00fc, 0x00ea, 0x0251, 0xfffd, 0x0144, 0x0148, 0xfffd, 0x0261, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x3105, 0x3106, 0x3107, 0x3108, 0x3109, 0x310a, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f, 0x3110, 0x3111, 0x3112, 0x3113, 0x3114, 0x3115, 0x3116, 0x3117, 0x3118, 0x3119, 0x311a, 0x311b, 0x311c, 0x311d, 0x311e, 0x311f, 0x3120, 0x3121, 0x3122, 0x3123, 0x3124, 0x3125, 0x3126, 0x3127, 0x3128, 0x3129, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa940[ 72 ] = { 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027, 0x3028, 0x3029, 0x32a3, 0x338e, 0x338f, 0x339c, 0x339d, 0x339e, 0x33a1, 0x33c4, 0x33ce, 0x33d1, 0x33d2, 0x33d5, 0xfe30, 0xffe2, 0xffe4, 0xfffd, 0x2121, 0x3231, 0xfffd, 0x2010, 0xfffd, 0xfffd, 0xfffd, 0x30fc, 0x309b, 0x309c, 0x30fd, 0x30fe, 0x3006, 0x309d, 0x309e, 0xfe49, 0xfe4a, 0xfe4b, 0xfe4c, 0xfe4d, 0xfe4e, 0xfe4f, 0xfe50, 0xfe51, 0xfe52, 0xfe54, 0xfe55, 0xfe56, 0xfe57, 0xfe59, 0xfe5a, 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0xfe5f, 0xfe60, 0xfe61, 0xfffd, 0xfe62, 0xfe63, 0xfe64, 0xfe65, 0xfe66, 0xfe68, 0xfe69, 0xfe6a }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa9a0[ 80 ] = { 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506, 0x2507, 0x2508, 0x2509, 0x250a, 0x250b, 0x250c, 0x250d, 0x250e, 0x250f, 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516, 0x2517, 0x2518, 0x2519, 0x251a, 0x251b, 0x251c, 0x251d, 0x251e, 0x251f, 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527, 0x2528, 0x2529, 0x252a, 0x252b, 0x252c, 0x252d, 0x252e, 0x252f, 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537, 0x2538, 0x2539, 0x253a, 0x253b, 0x253c, 0x253d, 0x253e, 0x253f, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0x254b }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaa40[ 96 ] = { 0x72dc, 0x72dd, 0x72df, 0x72e2, 0x72e3, 0x72e4, 0x72e5, 0x72e6, 0x72e7, 0x72ea, 0x72eb, 0x72f5, 0x72f6, 0x72f9, 0x72fd, 0x72fe, 0x72ff, 0x7300, 0x7302, 0x7304, 0x7305, 0x7306, 0x7307, 0x7308, 0x7309, 0x730b, 0x730c, 0x730d, 0x730f, 0x7310, 0x7311, 0x7312, 0x7314, 0x7318, 0x7319, 0x731a, 0x731f, 0x7320, 0x7323, 0x7324, 0x7326, 0x7327, 0x7328, 0x732d, 0x732f, 0x7330, 0x7332, 0x7333, 0x7335, 0x7336, 0x733a, 0x733b, 0x733c, 0x733d, 0x7340, 0x7341, 0x7342, 0x7343, 0x7344, 0x7345, 0x7346, 0x7347, 0x7348, 0xfffd, 0x7349, 0x734a, 0x734b, 0x734c, 0x734e, 0x734f, 0x7351, 0x7353, 0x7354, 0x7355, 0x7356, 0x7358, 0x7359, 0x735a, 0x735b, 0x735c, 0x735d, 0x735e, 0x735f, 0x7361, 0x7362, 0x7363, 0x7364, 0x7365, 0x7366, 0x7367, 0x7368, 0x7369, 0x736a, 0x736b, 0x736e, 0x7370 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xab40[ 96 ] = { 0x7372, 0x7373, 0x7374, 0x7375, 0x7376, 0x7377, 0x7378, 0x7379, 0x737a, 0x737b, 0x737c, 0x737d, 0x737f, 0x7380, 0x7381, 0x7382, 0x7383, 0x7385, 0x7386, 0x7388, 0x738a, 0x738c, 0x738d, 0x738f, 0x7390, 0x7392, 0x7393, 0x7394, 0x7395, 0x7397, 0x7398, 0x7399, 0x739a, 0x739c, 0x739d, 0x739e, 0x73a0, 0x73a1, 0x73a3, 0x73a4, 0x73a5, 0x73a6, 0x73a7, 0x73a8, 0x73aa, 0x73ac, 0x73ad, 0x73b1, 0x73b4, 0x73b5, 0x73b6, 0x73b8, 0x73b9, 0x73bc, 0x73bd, 0x73be, 0x73bf, 0x73c1, 0x73c3, 0x73c4, 0x73c5, 0x73c6, 0x73c7, 0xfffd, 0x73cb, 0x73cc, 0x73ce, 0x73d2, 0x73d3, 0x73d4, 0x73d5, 0x73d6, 0x73d7, 0x73d8, 0x73da, 0x73db, 0x73dc, 0x73dd, 0x73df, 0x73e1, 0x73e2, 0x73e3, 0x73e4, 0x73e6, 0x73e8, 0x73ea, 0x73eb, 0x73ec, 0x73ee, 0x73ef, 0x73f0, 0x73f1, 0x73f3, 0x73f4, 0x73f5, 0x73f6 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xac40[ 96 ] = { 0x73f8, 0x73f9, 0x73fa, 0x73fb, 0x73fc, 0x73fd, 0x73fe, 0x73ff, 0x7400, 0x7401, 0x7402, 0x7404, 0x7407, 0x7408, 0x740b, 0x740c, 0x740d, 0x740e, 0x7411, 0x7412, 0x7413, 0x7414, 0x7415, 0x7416, 0x7417, 0x7418, 0x7419, 0x741c, 0x741d, 0x741e, 0x741f, 0x7420, 0x7421, 0x7423, 0x7424, 0x7427, 0x7429, 0x742b, 0x742d, 0x742f, 0x7431, 0x7432, 0x7437, 0x7438, 0x7439, 0x743a, 0x743b, 0x743d, 0x743e, 0x743f, 0x7440, 0x7442, 0x7443, 0x7444, 0x7445, 0x7446, 0x7447, 0x7448, 0x7449, 0x744a, 0x744b, 0x744c, 0x744d, 0xfffd, 0x744e, 0x744f, 0x7450, 0x7451, 0x7452, 0x7453, 0x7454, 0x7456, 0x7458, 0x745d, 0x7460, 0x7461, 0x7462, 0x7463, 0x7464, 0x7465, 0x7466, 0x7467, 0x7468, 0x7469, 0x746a, 0x746b, 0x746c, 0x746e, 0x746f, 0x7471, 0x7472, 0x7473, 0x7474, 0x7475, 0x7478, 0x7479 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xad40[ 96 ] = { 0x747b, 0x747c, 0x747d, 0x747f, 0x7482, 0x7484, 0x7485, 0x7486, 0x7488, 0x7489, 0x748a, 0x748c, 0x748d, 0x748f, 0x7491, 0x7492, 0x7493, 0x7494, 0x7495, 0x7496, 0x7497, 0x7498, 0x7499, 0x749a, 0x749b, 0x749d, 0x749f, 0x74a0, 0x74a1, 0x74a2, 0x74a3, 0x74a4, 0x74a5, 0x74a6, 0x74aa, 0x74ab, 0x74ac, 0x74ad, 0x74ae, 0x74af, 0x74b0, 0x74b1, 0x74b2, 0x74b3, 0x74b4, 0x74b5, 0x74b6, 0x74b7, 0x74b8, 0x74b9, 0x74bb, 0x74bc, 0x74bd, 0x74be, 0x74bf, 0x74c0, 0x74c1, 0x74c2, 0x74c3, 0x74c4, 0x74c5, 0x74c6, 0x74c7, 0xfffd, 0x74c8, 0x74c9, 0x74ca, 0x74cb, 0x74cc, 0x74cd, 0x74ce, 0x74cf, 0x74d0, 0x74d1, 0x74d3, 0x74d4, 0x74d5, 0x74d6, 0x74d7, 0x74d8, 0x74d9, 0x74da, 0x74db, 0x74dd, 0x74df, 0x74e1, 0x74e5, 0x74e7, 0x74e8, 0x74e9, 0x74ea, 0x74eb, 0x74ec, 0x74ed, 0x74f0, 0x74f1 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xae40[ 96 ] = { 0x74f3, 0x74f5, 0x74f8, 0x74f9, 0x74fa, 0x74fb, 0x74fc, 0x74fd, 0x74fe, 0x7500, 0x7501, 0x7502, 0x7503, 0x7505, 0x7506, 0x7507, 0x7508, 0x7509, 0x750a, 0x750b, 0x750c, 0x750e, 0x7510, 0x7512, 0x7514, 0x7515, 0x7516, 0x7517, 0x751b, 0x751d, 0x751e, 0x7520, 0x7521, 0x7522, 0x7523, 0x7524, 0x7526, 0x7527, 0x752a, 0x752e, 0x7534, 0x7536, 0x7539, 0x753c, 0x753d, 0x753f, 0x7541, 0x7542, 0x7543, 0x7544, 0x7546, 0x7547, 0x7549, 0x754a, 0x754d, 0x7550, 0x7551, 0x7552, 0x7553, 0x7555, 0x7556, 0x7557, 0x7558, 0xfffd, 0x755d, 0x755e, 0x755f, 0x7560, 0x7561, 0x7562, 0x7563, 0x7564, 0x7567, 0x7568, 0x7569, 0x756b, 0x756c, 0x756d, 0x756e, 0x756f, 0x7570, 0x7571, 0x7573, 0x7575, 0x7576, 0x7577, 0x757a, 0x757b, 0x757c, 0x757d, 0x757e, 0x7580, 0x7581, 0x7582, 0x7584, 0x7585 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaf40[ 96 ] = { 0x7588, 0x7589, 0x758a, 0x758c, 0x758d, 0x758e, 0x7590, 0x7593, 0x7595, 0x7598, 0x759b, 0x759c, 0x759e, 0x75a2, 0x75a6, 0x75a7, 0x75a8, 0x75a9, 0x75aa, 0x75ad, 0x75b6, 0x75b7, 0x75ba, 0x75bb, 0x75bf, 0x75c0, 0x75c1, 0x75c6, 0x75cb, 0x75cc, 0x75ce, 0x75cf, 0x75d0, 0x75d1, 0x75d3, 0x75d7, 0x75d9, 0x75da, 0x75dc, 0x75dd, 0x75df, 0x75e0, 0x75e1, 0x75e5, 0x75e9, 0x75ec, 0x75ed, 0x75ee, 0x75ef, 0x75f2, 0x75f3, 0x75f5, 0x75f6, 0x75f7, 0x75f8, 0x75fa, 0x75fb, 0x75fd, 0x75fe, 0x7602, 0x7604, 0x7606, 0x7607, 0xfffd, 0x7608, 0x7609, 0x760b, 0x760d, 0x760e, 0x760f, 0x7611, 0x7612, 0x7613, 0x7614, 0x7616, 0x761a, 0x761c, 0x761d, 0x761e, 0x7621, 0x7623, 0x7627, 0x7628, 0x762c, 0x762e, 0x762f, 0x7631, 0x7632, 0x7636, 0x7637, 0x7639, 0x763a, 0x763b, 0x763d, 0x7641, 0x7642 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb040[ 192 ] = { 0x7645, 0x7646, 0x7647, 0x7648, 0x7649, 0x764a, 0x764b, 0x764e, 0x764f, 0x7650, 0x7651, 0x7652, 0x7653, 0x7655, 0x7657, 0x7658, 0x7659, 0x765a, 0x765b, 0x765d, 0x765f, 0x7660, 0x7661, 0x7662, 0x7664, 0x7665, 0x7666, 0x7667, 0x7668, 0x7669, 0x766a, 0x766c, 0x766d, 0x766e, 0x7670, 0x7671, 0x7672, 0x7673, 0x7674, 0x7675, 0x7676, 0x7677, 0x7679, 0x767a, 0x767c, 0x767f, 0x7680, 0x7681, 0x7683, 0x7685, 0x7689, 0x768a, 0x768c, 0x768d, 0x768f, 0x7690, 0x7692, 0x7694, 0x7695, 0x7697, 0x7698, 0x769a, 0x769b, 0xfffd, 0x769c, 0x769d, 0x769e, 0x769f, 0x76a0, 0x76a1, 0x76a2, 0x76a3, 0x76a5, 0x76a6, 0x76a7, 0x76a8, 0x76a9, 0x76aa, 0x76ab, 0x76ac, 0x76ad, 0x76af, 0x76b0, 0x76b3, 0x76b5, 0x76b6, 0x76b7, 0x76b8, 0x76b9, 0x76ba, 0x76bb, 0x76bc, 0x76bd, 0x76be, 0x76c0, 0x76c1, 0x76c3, 0x554a, 0x963f, 0x57c3, 0x6328, 0x54ce, 0x5509, 0x54c0, 0x7691, 0x764c, 0x853c, 0x77ee, 0x827e, 0x788d, 0x7231, 0x9698, 0x978d, 0x6c28, 0x5b89, 0x4ffa, 0x6309, 0x6697, 0x5cb8, 0x80fa, 0x6848, 0x80ae, 0x6602, 0x76ce, 0x51f9, 0x6556, 0x71ac, 0x7ff1, 0x8884, 0x50b2, 0x5965, 0x61ca, 0x6fb3, 0x82ad, 0x634c, 0x6252, 0x53ed, 0x5427, 0x7b06, 0x516b, 0x75a4, 0x5df4, 0x62d4, 0x8dcb, 0x9776, 0x628a, 0x8019, 0x575d, 0x9738, 0x7f62, 0x7238, 0x767d, 0x67cf, 0x767e, 0x6446, 0x4f70, 0x8d25, 0x62dc, 0x7a17, 0x6591, 0x73ed, 0x642c, 0x6273, 0x822c, 0x9881, 0x677f, 0x7248, 0x626e, 0x62cc, 0x4f34, 0x74e3, 0x534a, 0x529e, 0x7eca, 0x90a6, 0x5e2e, 0x6886, 0x699c, 0x8180, 0x7ed1, 0x68d2, 0x78c5, 0x868c, 0x9551, 0x508d, 0x8c24, 0x82de, 0x80de, 0x5305, 0x8912, 0x5265, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb140[ 192 ] = { 0x76c4, 0x76c7, 0x76c9, 0x76cb, 0x76cc, 0x76d3, 0x76d5, 0x76d9, 0x76da, 0x76dc, 0x76dd, 0x76de, 0x76e0, 0x76e1, 0x76e2, 0x76e3, 0x76e4, 0x76e6, 0x76e7, 0x76e8, 0x76e9, 0x76ea, 0x76eb, 0x76ec, 0x76ed, 0x76f0, 0x76f3, 0x76f5, 0x76f6, 0x76f7, 0x76fa, 0x76fb, 0x76fd, 0x76ff, 0x7700, 0x7702, 0x7703, 0x7705, 0x7706, 0x770a, 0x770c, 0x770e, 0x770f, 0x7710, 0x7711, 0x7712, 0x7713, 0x7714, 0x7715, 0x7716, 0x7717, 0x7718, 0x771b, 0x771c, 0x771d, 0x771e, 0x7721, 0x7723, 0x7724, 0x7725, 0x7727, 0x772a, 0x772b, 0xfffd, 0x772c, 0x772e, 0x7730, 0x7731, 0x7732, 0x7733, 0x7734, 0x7739, 0x773b, 0x773d, 0x773e, 0x773f, 0x7742, 0x7744, 0x7745, 0x7746, 0x7748, 0x7749, 0x774a, 0x774b, 0x774c, 0x774d, 0x774e, 0x774f, 0x7752, 0x7753, 0x7754, 0x7755, 0x7756, 0x7757, 0x7758, 0x7759, 0x775c, 0x8584, 0x96f9, 0x4fdd, 0x5821, 0x9971, 0x5b9d, 0x62b1, 0x62a5, 0x66b4, 0x8c79, 0x9c8d, 0x7206, 0x676f, 0x7891, 0x60b2, 0x5351, 0x5317, 0x8f88, 0x80cc, 0x8d1d, 0x94a1, 0x500d, 0x72c8, 0x5907, 0x60eb, 0x7119, 0x88ab, 0x5954, 0x82ef, 0x672c, 0x7b28, 0x5d29, 0x7ef7, 0x752d, 0x6cf5, 0x8e66, 0x8ff8, 0x903c, 0x9f3b, 0x6bd4, 0x9119, 0x7b14, 0x5f7c, 0x78a7, 0x84d6, 0x853d, 0x6bd5, 0x6bd9, 0x6bd6, 0x5e01, 0x5e87, 0x75f9, 0x95ed, 0x655d, 0x5f0a, 0x5fc5, 0x8f9f, 0x58c1, 0x81c2, 0x907f, 0x965b, 0x97ad, 0x8fb9, 0x7f16, 0x8d2c, 0x6241, 0x4fbf, 0x53d8, 0x535e, 0x8fa8, 0x8fa9, 0x8fab, 0x904d, 0x6807, 0x5f6a, 0x8198, 0x8868, 0x9cd6, 0x618b, 0x522b, 0x762a, 0x5f6c, 0x658c, 0x6fd2, 0x6ee8, 0x5bbe, 0x6448, 0x5175, 0x51b0, 0x67c4, 0x4e19, 0x79c9, 0x997c, 0x70b3, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb240[ 192 ] = { 0x775d, 0x775e, 0x775f, 0x7760, 0x7764, 0x7767, 0x7769, 0x776a, 0x776d, 0x776e, 0x776f, 0x7770, 0x7771, 0x7772, 0x7773, 0x7774, 0x7775, 0x7776, 0x7777, 0x7778, 0x777a, 0x777b, 0x777c, 0x7781, 0x7782, 0x7783, 0x7786, 0x7787, 0x7788, 0x7789, 0x778a, 0x778b, 0x778f, 0x7790, 0x7793, 0x7794, 0x7795, 0x7796, 0x7797, 0x7798, 0x7799, 0x779a, 0x779b, 0x779c, 0x779d, 0x779e, 0x77a1, 0x77a3, 0x77a4, 0x77a6, 0x77a8, 0x77ab, 0x77ad, 0x77ae, 0x77af, 0x77b1, 0x77b2, 0x77b4, 0x77b6, 0x77b7, 0x77b8, 0x77b9, 0x77ba, 0xfffd, 0x77bc, 0x77be, 0x77c0, 0x77c1, 0x77c2, 0x77c3, 0x77c4, 0x77c5, 0x77c6, 0x77c7, 0x77c8, 0x77c9, 0x77ca, 0x77cb, 0x77cc, 0x77ce, 0x77cf, 0x77d0, 0x77d1, 0x77d2, 0x77d3, 0x77d4, 0x77d5, 0x77d6, 0x77d8, 0x77d9, 0x77da, 0x77dd, 0x77de, 0x77df, 0x77e0, 0x77e1, 0x77e4, 0x75c5, 0x5e76, 0x73bb, 0x83e0, 0x64ad, 0x62e8, 0x94b5, 0x6ce2, 0x535a, 0x52c3, 0x640f, 0x94c2, 0x7b94, 0x4f2f, 0x5e1b, 0x8236, 0x8116, 0x818a, 0x6e24, 0x6cca, 0x9a73, 0x6355, 0x535c, 0x54fa, 0x8865, 0x57e0, 0x4e0d, 0x5e03, 0x6b65, 0x7c3f, 0x90e8, 0x6016, 0x64e6, 0x731c, 0x88c1, 0x6750, 0x624d, 0x8d22, 0x776c, 0x8e29, 0x91c7, 0x5f69, 0x83dc, 0x8521, 0x9910, 0x53c2, 0x8695, 0x6b8b, 0x60ed, 0x60e8, 0x707f, 0x82cd, 0x8231, 0x4ed3, 0x6ca7, 0x85cf, 0x64cd, 0x7cd9, 0x69fd, 0x66f9, 0x8349, 0x5395, 0x7b56, 0x4fa7, 0x518c, 0x6d4b, 0x5c42, 0x8e6d, 0x63d2, 0x53c9, 0x832c, 0x8336, 0x67e5, 0x78b4, 0x643d, 0x5bdf, 0x5c94, 0x5dee, 0x8be7, 0x62c6, 0x67f4, 0x8c7a, 0x6400, 0x63ba, 0x8749, 0x998b, 0x8c17, 0x7f20, 0x94f2, 0x4ea7, 0x9610, 0x98a4, 0x660c, 0x7316, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb340[ 192 ] = { 0x77e6, 0x77e8, 0x77ea, 0x77ef, 0x77f0, 0x77f1, 0x77f2, 0x77f4, 0x77f5, 0x77f7, 0x77f9, 0x77fa, 0x77fb, 0x77fc, 0x7803, 0x7804, 0x7805, 0x7806, 0x7807, 0x7808, 0x780a, 0x780b, 0x780e, 0x780f, 0x7810, 0x7813, 0x7815, 0x7819, 0x781b, 0x781e, 0x7820, 0x7821, 0x7822, 0x7824, 0x7828, 0x782a, 0x782b, 0x782e, 0x782f, 0x7831, 0x7832, 0x7833, 0x7835, 0x7836, 0x783d, 0x783f, 0x7841, 0x7842, 0x7843, 0x7844, 0x7846, 0x7848, 0x7849, 0x784a, 0x784b, 0x784d, 0x784f, 0x7851, 0x7853, 0x7854, 0x7858, 0x7859, 0x785a, 0xfffd, 0x785b, 0x785c, 0x785e, 0x785f, 0x7860, 0x7861, 0x7862, 0x7863, 0x7864, 0x7865, 0x7866, 0x7867, 0x7868, 0x7869, 0x786f, 0x7870, 0x7871, 0x7872, 0x7873, 0x7874, 0x7875, 0x7876, 0x7878, 0x7879, 0x787a, 0x787b, 0x787d, 0x787e, 0x787f, 0x7880, 0x7881, 0x7882, 0x7883, 0x573a, 0x5c1d, 0x5e38, 0x957f, 0x507f, 0x80a0, 0x5382, 0x655e, 0x7545, 0x5531, 0x5021, 0x8d85, 0x6284, 0x949e, 0x671d, 0x5632, 0x6f6e, 0x5de2, 0x5435, 0x7092, 0x8f66, 0x626f, 0x64a4, 0x63a3, 0x5f7b, 0x6f88, 0x90f4, 0x81e3, 0x8fb0, 0x5c18, 0x6668, 0x5ff1, 0x6c89, 0x9648, 0x8d81, 0x886c, 0x6491, 0x79f0, 0x57ce, 0x6a59, 0x6210, 0x5448, 0x4e58, 0x7a0b, 0x60e9, 0x6f84, 0x8bda, 0x627f, 0x901e, 0x9a8b, 0x79e4, 0x5403, 0x75f4, 0x6301, 0x5319, 0x6c60, 0x8fdf, 0x5f1b, 0x9a70, 0x803b, 0x9f7f, 0x4f88, 0x5c3a, 0x8d64, 0x7fc5, 0x65a5, 0x70bd, 0x5145, 0x51b2, 0x866b, 0x5d07, 0x5ba0, 0x62bd, 0x916c, 0x7574, 0x8e0c, 0x7a20, 0x6101, 0x7b79, 0x4ec7, 0x7ef8, 0x7785, 0x4e11, 0x81ed, 0x521d, 0x51fa, 0x6a71, 0x53a8, 0x8e87, 0x9504, 0x96cf, 0x6ec1, 0x9664, 0x695a, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb440[ 192 ] = { 0x7884, 0x7885, 0x7886, 0x7888, 0x788a, 0x788b, 0x788f, 0x7890, 0x7892, 0x7894, 0x7895, 0x7896, 0x7899, 0x789d, 0x789e, 0x78a0, 0x78a2, 0x78a4, 0x78a6, 0x78a8, 0x78a9, 0x78aa, 0x78ab, 0x78ac, 0x78ad, 0x78ae, 0x78af, 0x78b5, 0x78b6, 0x78b7, 0x78b8, 0x78ba, 0x78bb, 0x78bc, 0x78bd, 0x78bf, 0x78c0, 0x78c2, 0x78c3, 0x78c4, 0x78c6, 0x78c7, 0x78c8, 0x78cc, 0x78cd, 0x78ce, 0x78cf, 0x78d1, 0x78d2, 0x78d3, 0x78d6, 0x78d7, 0x78d8, 0x78da, 0x78db, 0x78dc, 0x78dd, 0x78de, 0x78df, 0x78e0, 0x78e1, 0x78e2, 0x78e3, 0xfffd, 0x78e4, 0x78e5, 0x78e6, 0x78e7, 0x78e9, 0x78ea, 0x78eb, 0x78ed, 0x78ee, 0x78ef, 0x78f0, 0x78f1, 0x78f3, 0x78f5, 0x78f6, 0x78f8, 0x78f9, 0x78fb, 0x78fc, 0x78fd, 0x78fe, 0x78ff, 0x7900, 0x7902, 0x7903, 0x7904, 0x7906, 0x7907, 0x7908, 0x7909, 0x790a, 0x790b, 0x790c, 0x7840, 0x50a8, 0x77d7, 0x6410, 0x89e6, 0x5904, 0x63e3, 0x5ddd, 0x7a7f, 0x693d, 0x4f20, 0x8239, 0x5598, 0x4e32, 0x75ae, 0x7a97, 0x5e62, 0x5e8a, 0x95ef, 0x521b, 0x5439, 0x708a, 0x6376, 0x9524, 0x5782, 0x6625, 0x693f, 0x9187, 0x5507, 0x6df3, 0x7eaf, 0x8822, 0x6233, 0x7ef0, 0x75b5, 0x8328, 0x78c1, 0x96cc, 0x8f9e, 0x6148, 0x74f7, 0x8bcd, 0x6b64, 0x523a, 0x8d50, 0x6b21, 0x806a, 0x8471, 0x56f1, 0x5306, 0x4ece, 0x4e1b, 0x51d1, 0x7c97, 0x918b, 0x7c07, 0x4fc3, 0x8e7f, 0x7be1, 0x7a9c, 0x6467, 0x5d14, 0x50ac, 0x8106, 0x7601, 0x7cb9, 0x6dec, 0x7fe0, 0x6751, 0x5b58, 0x5bf8, 0x78cb, 0x64ae, 0x6413, 0x63aa, 0x632b, 0x9519, 0x642d, 0x8fbe, 0x7b54, 0x7629, 0x6253, 0x5927, 0x5446, 0x6b79, 0x50a3, 0x6234, 0x5e26, 0x6b86, 0x4ee3, 0x8d37, 0x888b, 0x5f85, 0x902e, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb540[ 192 ] = { 0x790d, 0x790e, 0x790f, 0x7910, 0x7911, 0x7912, 0x7914, 0x7915, 0x7916, 0x7917, 0x7918, 0x7919, 0x791a, 0x791b, 0x791c, 0x791d, 0x791f, 0x7920, 0x7921, 0x7922, 0x7923, 0x7925, 0x7926, 0x7927, 0x7928, 0x7929, 0x792a, 0x792b, 0x792c, 0x792d, 0x792e, 0x792f, 0x7930, 0x7931, 0x7932, 0x7933, 0x7935, 0x7936, 0x7937, 0x7938, 0x7939, 0x793d, 0x793f, 0x7942, 0x7943, 0x7944, 0x7945, 0x7947, 0x794a, 0x794b, 0x794c, 0x794d, 0x794e, 0x794f, 0x7950, 0x7951, 0x7952, 0x7954, 0x7955, 0x7958, 0x7959, 0x7961, 0x7963, 0xfffd, 0x7964, 0x7966, 0x7969, 0x796a, 0x796b, 0x796c, 0x796e, 0x7970, 0x7971, 0x7972, 0x7973, 0x7974, 0x7975, 0x7976, 0x7979, 0x797b, 0x797c, 0x797d, 0x797e, 0x797f, 0x7982, 0x7983, 0x7986, 0x7987, 0x7988, 0x7989, 0x798b, 0x798c, 0x798d, 0x798e, 0x7990, 0x7991, 0x7992, 0x6020, 0x803d, 0x62c5, 0x4e39, 0x5355, 0x90f8, 0x63b8, 0x80c6, 0x65e6, 0x6c2e, 0x4f46, 0x60ee, 0x6de1, 0x8bde, 0x5f39, 0x86cb, 0x5f53, 0x6321, 0x515a, 0x8361, 0x6863, 0x5200, 0x6363, 0x8e48, 0x5012, 0x5c9b, 0x7977, 0x5bfc, 0x5230, 0x7a3b, 0x60bc, 0x9053, 0x76d7, 0x5fb7, 0x5f97, 0x7684, 0x8e6c, 0x706f, 0x767b, 0x7b49, 0x77aa, 0x51f3, 0x9093, 0x5824, 0x4f4e, 0x6ef4, 0x8fea, 0x654c, 0x7b1b, 0x72c4, 0x6da4, 0x7fdf, 0x5ae1, 0x62b5, 0x5e95, 0x5730, 0x8482, 0x7b2c, 0x5e1d, 0x5f1f, 0x9012, 0x7f14, 0x98a0, 0x6382, 0x6ec7, 0x7898, 0x70b9, 0x5178, 0x975b, 0x57ab, 0x7535, 0x4f43, 0x7538, 0x5e97, 0x60e6, 0x5960, 0x6dc0, 0x6bbf, 0x7889, 0x53fc, 0x96d5, 0x51cb, 0x5201, 0x6389, 0x540a, 0x9493, 0x8c03, 0x8dcc, 0x7239, 0x789f, 0x8776, 0x8fed, 0x8c0d, 0x53e0, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb640[ 192 ] = { 0x7993, 0x7994, 0x7995, 0x7996, 0x7997, 0x7998, 0x7999, 0x799b, 0x799c, 0x799d, 0x799e, 0x799f, 0x79a0, 0x79a1, 0x79a2, 0x79a3, 0x79a4, 0x79a5, 0x79a6, 0x79a8, 0x79a9, 0x79aa, 0x79ab, 0x79ac, 0x79ad, 0x79ae, 0x79af, 0x79b0, 0x79b1, 0x79b2, 0x79b4, 0x79b5, 0x79b6, 0x79b7, 0x79b8, 0x79bc, 0x79bf, 0x79c2, 0x79c4, 0x79c5, 0x79c7, 0x79c8, 0x79ca, 0x79cc, 0x79ce, 0x79cf, 0x79d0, 0x79d3, 0x79d4, 0x79d6, 0x79d7, 0x79d9, 0x79da, 0x79db, 0x79dc, 0x79dd, 0x79de, 0x79e0, 0x79e1, 0x79e2, 0x79e5, 0x79e8, 0x79ea, 0xfffd, 0x79ec, 0x79ee, 0x79f1, 0x79f2, 0x79f3, 0x79f4, 0x79f5, 0x79f6, 0x79f7, 0x79f9, 0x79fa, 0x79fc, 0x79fe, 0x79ff, 0x7a01, 0x7a04, 0x7a05, 0x7a07, 0x7a08, 0x7a09, 0x7a0a, 0x7a0c, 0x7a0f, 0x7a10, 0x7a11, 0x7a12, 0x7a13, 0x7a15, 0x7a16, 0x7a18, 0x7a19, 0x7a1b, 0x7a1c, 0x4e01, 0x76ef, 0x53ee, 0x9489, 0x9876, 0x9f0e, 0x952d, 0x5b9a, 0x8ba2, 0x4e22, 0x4e1c, 0x51ac, 0x8463, 0x61c2, 0x52a8, 0x680b, 0x4f97, 0x606b, 0x51bb, 0x6d1e, 0x515c, 0x6296, 0x6597, 0x9661, 0x8c46, 0x9017, 0x75d8, 0x90fd, 0x7763, 0x6bd2, 0x728a, 0x72ec, 0x8bfb, 0x5835, 0x7779, 0x8d4c, 0x675c, 0x9540, 0x809a, 0x5ea6, 0x6e21, 0x5992, 0x7aef, 0x77ed, 0x953b, 0x6bb5, 0x65ad, 0x7f0e, 0x5806, 0x5151, 0x961f, 0x5bf9, 0x58a9, 0x5428, 0x8e72, 0x6566, 0x987f, 0x56e4, 0x949d, 0x76fe, 0x9041, 0x6387, 0x54c6, 0x591a, 0x593a, 0x579b, 0x8eb2, 0x6735, 0x8dfa, 0x8235, 0x5241, 0x60f0, 0x5815, 0x86fe, 0x5ce8, 0x9e45, 0x4fc4, 0x989d, 0x8bb9, 0x5a25, 0x6076, 0x5384, 0x627c, 0x904f, 0x9102, 0x997f, 0x6069, 0x800c, 0x513f, 0x8033, 0x5c14, 0x9975, 0x6d31, 0x4e8c, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb740[ 192 ] = { 0x7a1d, 0x7a1f, 0x7a21, 0x7a22, 0x7a24, 0x7a25, 0x7a26, 0x7a27, 0x7a28, 0x7a29, 0x7a2a, 0x7a2b, 0x7a2c, 0x7a2d, 0x7a2e, 0x7a2f, 0x7a30, 0x7a31, 0x7a32, 0x7a34, 0x7a35, 0x7a36, 0x7a38, 0x7a3a, 0x7a3e, 0x7a40, 0x7a41, 0x7a42, 0x7a43, 0x7a44, 0x7a45, 0x7a47, 0x7a48, 0x7a49, 0x7a4a, 0x7a4b, 0x7a4c, 0x7a4d, 0x7a4e, 0x7a4f, 0x7a50, 0x7a52, 0x7a53, 0x7a54, 0x7a55, 0x7a56, 0x7a58, 0x7a59, 0x7a5a, 0x7a5b, 0x7a5c, 0x7a5d, 0x7a5e, 0x7a5f, 0x7a60, 0x7a61, 0x7a62, 0x7a63, 0x7a64, 0x7a65, 0x7a66, 0x7a67, 0x7a68, 0xfffd, 0x7a69, 0x7a6a, 0x7a6b, 0x7a6c, 0x7a6d, 0x7a6e, 0x7a6f, 0x7a71, 0x7a72, 0x7a73, 0x7a75, 0x7a7b, 0x7a7c, 0x7a7d, 0x7a7e, 0x7a82, 0x7a85, 0x7a87, 0x7a89, 0x7a8a, 0x7a8b, 0x7a8c, 0x7a8e, 0x7a8f, 0x7a90, 0x7a93, 0x7a94, 0x7a99, 0x7a9a, 0x7a9b, 0x7a9e, 0x7aa1, 0x7aa2, 0x8d30, 0x53d1, 0x7f5a, 0x7b4f, 0x4f10, 0x4e4f, 0x9600, 0x6cd5, 0x73d0, 0x85e9, 0x5e06, 0x756a, 0x7ffb, 0x6a0a, 0x77fe, 0x9492, 0x7e41, 0x51e1, 0x70e6, 0x53cd, 0x8fd4, 0x8303, 0x8d29, 0x72af, 0x996d, 0x6cdb, 0x574a, 0x82b3, 0x65b9, 0x80aa, 0x623f, 0x9632, 0x59a8, 0x4eff, 0x8bbf, 0x7eba, 0x653e, 0x83f2, 0x975e, 0x5561, 0x98de, 0x80a5, 0x532a, 0x8bfd, 0x5420, 0x80ba, 0x5e9f, 0x6cb8, 0x8d39, 0x82ac, 0x915a, 0x5429, 0x6c1b, 0x5206, 0x7eb7, 0x575f, 0x711a, 0x6c7e, 0x7c89, 0x594b, 0x4efd, 0x5fff, 0x6124, 0x7caa, 0x4e30, 0x5c01, 0x67ab, 0x8702, 0x5cf0, 0x950b, 0x98ce, 0x75af, 0x70fd, 0x9022, 0x51af, 0x7f1d, 0x8bbd, 0x5949, 0x51e4, 0x4f5b, 0x5426, 0x592b, 0x6577, 0x80a4, 0x5b75, 0x6276, 0x62c2, 0x8f90, 0x5e45, 0x6c1f, 0x7b26, 0x4f0f, 0x4fd8, 0x670d, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb840[ 192 ] = { 0x7aa3, 0x7aa4, 0x7aa7, 0x7aa9, 0x7aaa, 0x7aab, 0x7aae, 0x7aaf, 0x7ab0, 0x7ab1, 0x7ab2, 0x7ab4, 0x7ab5, 0x7ab6, 0x7ab7, 0x7ab8, 0x7ab9, 0x7aba, 0x7abb, 0x7abc, 0x7abd, 0x7abe, 0x7ac0, 0x7ac1, 0x7ac2, 0x7ac3, 0x7ac4, 0x7ac5, 0x7ac6, 0x7ac7, 0x7ac8, 0x7ac9, 0x7aca, 0x7acc, 0x7acd, 0x7ace, 0x7acf, 0x7ad0, 0x7ad1, 0x7ad2, 0x7ad3, 0x7ad4, 0x7ad5, 0x7ad7, 0x7ad8, 0x7ada, 0x7adb, 0x7adc, 0x7add, 0x7ae1, 0x7ae2, 0x7ae4, 0x7ae7, 0x7ae8, 0x7ae9, 0x7aea, 0x7aeb, 0x7aec, 0x7aee, 0x7af0, 0x7af1, 0x7af2, 0x7af3, 0xfffd, 0x7af4, 0x7af5, 0x7af6, 0x7af7, 0x7af8, 0x7afb, 0x7afc, 0x7afe, 0x7b00, 0x7b01, 0x7b02, 0x7b05, 0x7b07, 0x7b09, 0x7b0c, 0x7b0d, 0x7b0e, 0x7b10, 0x7b12, 0x7b13, 0x7b16, 0x7b17, 0x7b18, 0x7b1a, 0x7b1c, 0x7b1d, 0x7b1f, 0x7b21, 0x7b22, 0x7b23, 0x7b27, 0x7b29, 0x7b2d, 0x6d6e, 0x6daa, 0x798f, 0x88b1, 0x5f17, 0x752b, 0x629a, 0x8f85, 0x4fef, 0x91dc, 0x65a7, 0x812f, 0x8151, 0x5e9c, 0x8150, 0x8d74, 0x526f, 0x8986, 0x8d4b, 0x590d, 0x5085, 0x4ed8, 0x961c, 0x7236, 0x8179, 0x8d1f, 0x5bcc, 0x8ba3, 0x9644, 0x5987, 0x7f1a, 0x5490, 0x5676, 0x560e, 0x8be5, 0x6539, 0x6982, 0x9499, 0x76d6, 0x6e89, 0x5e72, 0x7518, 0x6746, 0x67d1, 0x7aff, 0x809d, 0x8d76, 0x611f, 0x79c6, 0x6562, 0x8d63, 0x5188, 0x521a, 0x94a2, 0x7f38, 0x809b, 0x7eb2, 0x5c97, 0x6e2f, 0x6760, 0x7bd9, 0x768b, 0x9ad8, 0x818f, 0x7f94, 0x7cd5, 0x641e, 0x9550, 0x7a3f, 0x544a, 0x54e5, 0x6b4c, 0x6401, 0x6208, 0x9e3d, 0x80f3, 0x7599, 0x5272, 0x9769, 0x845b, 0x683c, 0x86e4, 0x9601, 0x9694, 0x94ec, 0x4e2a, 0x5404, 0x7ed9, 0x6839, 0x8ddf, 0x8015, 0x66f4, 0x5e9a, 0x7fb9, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb940[ 192 ] = { 0x7b2f, 0x7b30, 0x7b32, 0x7b34, 0x7b35, 0x7b36, 0x7b37, 0x7b39, 0x7b3b, 0x7b3d, 0x7b3f, 0x7b40, 0x7b41, 0x7b42, 0x7b43, 0x7b44, 0x7b46, 0x7b48, 0x7b4a, 0x7b4d, 0x7b4e, 0x7b53, 0x7b55, 0x7b57, 0x7b59, 0x7b5c, 0x7b5e, 0x7b5f, 0x7b61, 0x7b63, 0x7b64, 0x7b65, 0x7b66, 0x7b67, 0x7b68, 0x7b69, 0x7b6a, 0x7b6b, 0x7b6c, 0x7b6d, 0x7b6f, 0x7b70, 0x7b73, 0x7b74, 0x7b76, 0x7b78, 0x7b7a, 0x7b7c, 0x7b7d, 0x7b7f, 0x7b81, 0x7b82, 0x7b83, 0x7b84, 0x7b86, 0x7b87, 0x7b88, 0x7b89, 0x7b8a, 0x7b8b, 0x7b8c, 0x7b8e, 0x7b8f, 0xfffd, 0x7b91, 0x7b92, 0x7b93, 0x7b96, 0x7b98, 0x7b99, 0x7b9a, 0x7b9b, 0x7b9e, 0x7b9f, 0x7ba0, 0x7ba3, 0x7ba4, 0x7ba5, 0x7bae, 0x7baf, 0x7bb0, 0x7bb2, 0x7bb3, 0x7bb5, 0x7bb6, 0x7bb7, 0x7bb9, 0x7bba, 0x7bbb, 0x7bbc, 0x7bbd, 0x7bbe, 0x7bbf, 0x7bc0, 0x7bc2, 0x7bc3, 0x7bc4, 0x57c2, 0x803f, 0x6897, 0x5de5, 0x653b, 0x529f, 0x606d, 0x9f9a, 0x4f9b, 0x8eac, 0x516c, 0x5bab, 0x5f13, 0x5de9, 0x6c5e, 0x62f1, 0x8d21, 0x5171, 0x94a9, 0x52fe, 0x6c9f, 0x82df, 0x72d7, 0x57a2, 0x6784, 0x8d2d, 0x591f, 0x8f9c, 0x83c7, 0x5495, 0x7b8d, 0x4f30, 0x6cbd, 0x5b64, 0x59d1, 0x9f13, 0x53e4, 0x86ca, 0x9aa8, 0x8c37, 0x80a1, 0x6545, 0x987e, 0x56fa, 0x96c7, 0x522e, 0x74dc, 0x5250, 0x5be1, 0x6302, 0x8902, 0x4e56, 0x62d0, 0x602a, 0x68fa, 0x5173, 0x5b98, 0x51a0, 0x89c2, 0x7ba1, 0x9986, 0x7f50, 0x60ef, 0x704c, 0x8d2f, 0x5149, 0x5e7f, 0x901b, 0x7470, 0x89c4, 0x572d, 0x7845, 0x5f52, 0x9f9f, 0x95fa, 0x8f68, 0x9b3c, 0x8be1, 0x7678, 0x6842, 0x67dc, 0x8dea, 0x8d35, 0x523d, 0x8f8a, 0x6eda, 0x68cd, 0x9505, 0x90ed, 0x56fd, 0x679c, 0x88f9, 0x8fc7, 0x54c8, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xba40[ 192 ] = { 0x7bc5, 0x7bc8, 0x7bc9, 0x7bca, 0x7bcb, 0x7bcd, 0x7bce, 0x7bcf, 0x7bd0, 0x7bd2, 0x7bd4, 0x7bd5, 0x7bd6, 0x7bd7, 0x7bd8, 0x7bdb, 0x7bdc, 0x7bde, 0x7bdf, 0x7be0, 0x7be2, 0x7be3, 0x7be4, 0x7be7, 0x7be8, 0x7be9, 0x7beb, 0x7bec, 0x7bed, 0x7bef, 0x7bf0, 0x7bf2, 0x7bf3, 0x7bf4, 0x7bf5, 0x7bf6, 0x7bf8, 0x7bf9, 0x7bfa, 0x7bfb, 0x7bfd, 0x7bff, 0x7c00, 0x7c01, 0x7c02, 0x7c03, 0x7c04, 0x7c05, 0x7c06, 0x7c08, 0x7c09, 0x7c0a, 0x7c0d, 0x7c0e, 0x7c10, 0x7c11, 0x7c12, 0x7c13, 0x7c14, 0x7c15, 0x7c17, 0x7c18, 0x7c19, 0xfffd, 0x7c1a, 0x7c1b, 0x7c1c, 0x7c1d, 0x7c1e, 0x7c20, 0x7c21, 0x7c22, 0x7c23, 0x7c24, 0x7c25, 0x7c28, 0x7c29, 0x7c2b, 0x7c2c, 0x7c2d, 0x7c2e, 0x7c2f, 0x7c30, 0x7c31, 0x7c32, 0x7c33, 0x7c34, 0x7c35, 0x7c36, 0x7c37, 0x7c39, 0x7c3a, 0x7c3b, 0x7c3c, 0x7c3d, 0x7c3e, 0x7c42, 0x9ab8, 0x5b69, 0x6d77, 0x6c26, 0x4ea5, 0x5bb3, 0x9a87, 0x9163, 0x61a8, 0x90af, 0x97e9, 0x542b, 0x6db5, 0x5bd2, 0x51fd, 0x558a, 0x7f55, 0x7ff0, 0x64bc, 0x634d, 0x65f1, 0x61be, 0x608d, 0x710a, 0x6c57, 0x6c49, 0x592f, 0x676d, 0x822a, 0x58d5, 0x568e, 0x8c6a, 0x6beb, 0x90dd, 0x597d, 0x8017, 0x53f7, 0x6d69, 0x5475, 0x559d, 0x8377, 0x83cf, 0x6838, 0x79be, 0x548c, 0x4f55, 0x5408, 0x76d2, 0x8c89, 0x9602, 0x6cb3, 0x6db8, 0x8d6b, 0x8910, 0x9e64, 0x8d3a, 0x563f, 0x9ed1, 0x75d5, 0x5f88, 0x72e0, 0x6068, 0x54fc, 0x4ea8, 0x6a2a, 0x8861, 0x6052, 0x8f70, 0x54c4, 0x70d8, 0x8679, 0x9e3f, 0x6d2a, 0x5b8f, 0x5f18, 0x7ea2, 0x5589, 0x4faf, 0x7334, 0x543c, 0x539a, 0x5019, 0x540e, 0x547c, 0x4e4e, 0x5ffd, 0x745a, 0x58f6, 0x846b, 0x80e1, 0x8774, 0x72d0, 0x7cca, 0x6e56, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbb40[ 192 ] = { 0x7c43, 0x7c44, 0x7c45, 0x7c46, 0x7c47, 0x7c48, 0x7c49, 0x7c4a, 0x7c4b, 0x7c4c, 0x7c4e, 0x7c4f, 0x7c50, 0x7c51, 0x7c52, 0x7c53, 0x7c54, 0x7c55, 0x7c56, 0x7c57, 0x7c58, 0x7c59, 0x7c5a, 0x7c5b, 0x7c5c, 0x7c5d, 0x7c5e, 0x7c5f, 0x7c60, 0x7c61, 0x7c62, 0x7c63, 0x7c64, 0x7c65, 0x7c66, 0x7c67, 0x7c68, 0x7c69, 0x7c6a, 0x7c6b, 0x7c6c, 0x7c6d, 0x7c6e, 0x7c6f, 0x7c70, 0x7c71, 0x7c72, 0x7c75, 0x7c76, 0x7c77, 0x7c78, 0x7c79, 0x7c7a, 0x7c7e, 0x7c7f, 0x7c80, 0x7c81, 0x7c82, 0x7c83, 0x7c84, 0x7c85, 0x7c86, 0x7c87, 0xfffd, 0x7c88, 0x7c8a, 0x7c8b, 0x7c8c, 0x7c8d, 0x7c8e, 0x7c8f, 0x7c90, 0x7c93, 0x7c94, 0x7c96, 0x7c99, 0x7c9a, 0x7c9b, 0x7ca0, 0x7ca1, 0x7ca3, 0x7ca6, 0x7ca7, 0x7ca8, 0x7ca9, 0x7cab, 0x7cac, 0x7cad, 0x7caf, 0x7cb0, 0x7cb4, 0x7cb5, 0x7cb6, 0x7cb7, 0x7cb8, 0x7cba, 0x7cbb, 0x5f27, 0x864e, 0x552c, 0x62a4, 0x4e92, 0x6caa, 0x6237, 0x82b1, 0x54d7, 0x534e, 0x733e, 0x6ed1, 0x753b, 0x5212, 0x5316, 0x8bdd, 0x69d0, 0x5f8a, 0x6000, 0x6dee, 0x574f, 0x6b22, 0x73af, 0x6853, 0x8fd8, 0x7f13, 0x6362, 0x60a3, 0x5524, 0x75ea, 0x8c62, 0x7115, 0x6da3, 0x5ba6, 0x5e7b, 0x8352, 0x614c, 0x9ec4, 0x78fa, 0x8757, 0x7c27, 0x7687, 0x51f0, 0x60f6, 0x714c, 0x6643, 0x5e4c, 0x604d, 0x8c0e, 0x7070, 0x6325, 0x8f89, 0x5fbd, 0x6062, 0x86d4, 0x56de, 0x6bc1, 0x6094, 0x6167, 0x5349, 0x60e0, 0x6666, 0x8d3f, 0x79fd, 0x4f1a, 0x70e9, 0x6c47, 0x8bb3, 0x8bf2, 0x7ed8, 0x8364, 0x660f, 0x5a5a, 0x9b42, 0x6d51, 0x6df7, 0x8c41, 0x6d3b, 0x4f19, 0x706b, 0x83b7, 0x6216, 0x60d1, 0x970d, 0x8d27, 0x7978, 0x51fb, 0x573e, 0x57fa, 0x673a, 0x7578, 0x7a3d, 0x79ef, 0x7b95, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbc40[ 192 ] = { 0x7cbf, 0x7cc0, 0x7cc2, 0x7cc3, 0x7cc4, 0x7cc6, 0x7cc9, 0x7ccb, 0x7cce, 0x7ccf, 0x7cd0, 0x7cd1, 0x7cd2, 0x7cd3, 0x7cd4, 0x7cd8, 0x7cda, 0x7cdb, 0x7cdd, 0x7cde, 0x7ce1, 0x7ce2, 0x7ce3, 0x7ce4, 0x7ce5, 0x7ce6, 0x7ce7, 0x7ce9, 0x7cea, 0x7ceb, 0x7cec, 0x7ced, 0x7cee, 0x7cf0, 0x7cf1, 0x7cf2, 0x7cf3, 0x7cf4, 0x7cf5, 0x7cf6, 0x7cf7, 0x7cf9, 0x7cfa, 0x7cfc, 0x7cfd, 0x7cfe, 0x7cff, 0x7d00, 0x7d01, 0x7d02, 0x7d03, 0x7d04, 0x7d05, 0x7d06, 0x7d07, 0x7d08, 0x7d09, 0x7d0b, 0x7d0c, 0x7d0d, 0x7d0e, 0x7d0f, 0x7d10, 0xfffd, 0x7d11, 0x7d12, 0x7d13, 0x7d14, 0x7d15, 0x7d16, 0x7d17, 0x7d18, 0x7d19, 0x7d1a, 0x7d1b, 0x7d1c, 0x7d1d, 0x7d1e, 0x7d1f, 0x7d21, 0x7d23, 0x7d24, 0x7d25, 0x7d26, 0x7d28, 0x7d29, 0x7d2a, 0x7d2c, 0x7d2d, 0x7d2e, 0x7d30, 0x7d31, 0x7d32, 0x7d33, 0x7d34, 0x7d35, 0x7d36, 0x808c, 0x9965, 0x8ff9, 0x6fc0, 0x8ba5, 0x9e21, 0x59ec, 0x7ee9, 0x7f09, 0x5409, 0x6781, 0x68d8, 0x8f91, 0x7c4d, 0x96c6, 0x53ca, 0x6025, 0x75be, 0x6c72, 0x5373, 0x5ac9, 0x7ea7, 0x6324, 0x51e0, 0x810a, 0x5df1, 0x84df, 0x6280, 0x5180, 0x5b63, 0x4f0e, 0x796d, 0x5242, 0x60b8, 0x6d4e, 0x5bc4, 0x5bc2, 0x8ba1, 0x8bb0, 0x65e2, 0x5fcc, 0x9645, 0x5993, 0x7ee7, 0x7eaa, 0x5609, 0x67b7, 0x5939, 0x4f73, 0x5bb6, 0x52a0, 0x835a, 0x988a, 0x8d3e, 0x7532, 0x94be, 0x5047, 0x7a3c, 0x4ef7, 0x67b6, 0x9a7e, 0x5ac1, 0x6b7c, 0x76d1, 0x575a, 0x5c16, 0x7b3a, 0x95f4, 0x714e, 0x517c, 0x80a9, 0x8270, 0x5978, 0x7f04, 0x8327, 0x68c0, 0x67ec, 0x78b1, 0x7877, 0x62e3, 0x6361, 0x7b80, 0x4fed, 0x526a, 0x51cf, 0x8350, 0x69db, 0x9274, 0x8df5, 0x8d31, 0x89c1, 0x952e, 0x7bad, 0x4ef6, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbd40[ 192 ] = { 0x7d37, 0x7d38, 0x7d39, 0x7d3a, 0x7d3b, 0x7d3c, 0x7d3d, 0x7d3e, 0x7d3f, 0x7d40, 0x7d41, 0x7d42, 0x7d43, 0x7d44, 0x7d45, 0x7d46, 0x7d47, 0x7d48, 0x7d49, 0x7d4a, 0x7d4b, 0x7d4c, 0x7d4d, 0x7d4e, 0x7d4f, 0x7d50, 0x7d51, 0x7d52, 0x7d53, 0x7d54, 0x7d55, 0x7d56, 0x7d57, 0x7d58, 0x7d59, 0x7d5a, 0x7d5b, 0x7d5c, 0x7d5d, 0x7d5e, 0x7d5f, 0x7d60, 0x7d61, 0x7d62, 0x7d63, 0x7d64, 0x7d65, 0x7d66, 0x7d67, 0x7d68, 0x7d69, 0x7d6a, 0x7d6b, 0x7d6c, 0x7d6d, 0x7d6f, 0x7d70, 0x7d71, 0x7d72, 0x7d73, 0x7d74, 0x7d75, 0x7d76, 0xfffd, 0x7d78, 0x7d79, 0x7d7a, 0x7d7b, 0x7d7c, 0x7d7d, 0x7d7e, 0x7d7f, 0x7d80, 0x7d81, 0x7d82, 0x7d83, 0x7d84, 0x7d85, 0x7d86, 0x7d87, 0x7d88, 0x7d89, 0x7d8a, 0x7d8b, 0x7d8c, 0x7d8d, 0x7d8e, 0x7d8f, 0x7d90, 0x7d91, 0x7d92, 0x7d93, 0x7d94, 0x7d95, 0x7d96, 0x7d97, 0x7d98, 0x5065, 0x8230, 0x5251, 0x996f, 0x6e10, 0x6e85, 0x6da7, 0x5efa, 0x50f5, 0x59dc, 0x5c06, 0x6d46, 0x6c5f, 0x7586, 0x848b, 0x6868, 0x5956, 0x8bb2, 0x5320, 0x9171, 0x964d, 0x8549, 0x6912, 0x7901, 0x7126, 0x80f6, 0x4ea4, 0x90ca, 0x6d47, 0x9a84, 0x5a07, 0x56bc, 0x6405, 0x94f0, 0x77eb, 0x4fa5, 0x811a, 0x72e1, 0x89d2, 0x997a, 0x7f34, 0x7ede, 0x527f, 0x6559, 0x9175, 0x8f7f, 0x8f83, 0x53eb, 0x7a96, 0x63ed, 0x63a5, 0x7686, 0x79f8, 0x8857, 0x9636, 0x622a, 0x52ab, 0x8282, 0x6854, 0x6770, 0x6377, 0x776b, 0x7aed, 0x6d01, 0x7ed3, 0x89e3, 0x59d0, 0x6212, 0x85c9, 0x82a5, 0x754c, 0x501f, 0x4ecb, 0x75a5, 0x8beb, 0x5c4a, 0x5dfe, 0x7b4b, 0x65a4, 0x91d1, 0x4eca, 0x6d25, 0x895f, 0x7d27, 0x9526, 0x4ec5, 0x8c28, 0x8fdb, 0x9773, 0x664b, 0x7981, 0x8fd1, 0x70ec, 0x6d78, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbe40[ 192 ] = { 0x7d99, 0x7d9a, 0x7d9b, 0x7d9c, 0x7d9d, 0x7d9e, 0x7d9f, 0x7da0, 0x7da1, 0x7da2, 0x7da3, 0x7da4, 0x7da5, 0x7da7, 0x7da8, 0x7da9, 0x7daa, 0x7dab, 0x7dac, 0x7dad, 0x7daf, 0x7db0, 0x7db1, 0x7db2, 0x7db3, 0x7db4, 0x7db5, 0x7db6, 0x7db7, 0x7db8, 0x7db9, 0x7dba, 0x7dbb, 0x7dbc, 0x7dbd, 0x7dbe, 0x7dbf, 0x7dc0, 0x7dc1, 0x7dc2, 0x7dc3, 0x7dc4, 0x7dc5, 0x7dc6, 0x7dc7, 0x7dc8, 0x7dc9, 0x7dca, 0x7dcb, 0x7dcc, 0x7dcd, 0x7dce, 0x7dcf, 0x7dd0, 0x7dd1, 0x7dd2, 0x7dd3, 0x7dd4, 0x7dd5, 0x7dd6, 0x7dd7, 0x7dd8, 0x7dd9, 0xfffd, 0x7dda, 0x7ddb, 0x7ddc, 0x7ddd, 0x7dde, 0x7ddf, 0x7de0, 0x7de1, 0x7de2, 0x7de3, 0x7de4, 0x7de5, 0x7de6, 0x7de7, 0x7de8, 0x7de9, 0x7dea, 0x7deb, 0x7dec, 0x7ded, 0x7dee, 0x7def, 0x7df0, 0x7df1, 0x7df2, 0x7df3, 0x7df4, 0x7df5, 0x7df6, 0x7df7, 0x7df8, 0x7df9, 0x7dfa, 0x5c3d, 0x52b2, 0x8346, 0x5162, 0x830e, 0x775b, 0x6676, 0x9cb8, 0x4eac, 0x60ca, 0x7cbe, 0x7cb3, 0x7ecf, 0x4e95, 0x8b66, 0x666f, 0x9888, 0x9759, 0x5883, 0x656c, 0x955c, 0x5f84, 0x75c9, 0x9756, 0x7adf, 0x7ade, 0x51c0, 0x70af, 0x7a98, 0x63ea, 0x7a76, 0x7ea0, 0x7396, 0x97ed, 0x4e45, 0x7078, 0x4e5d, 0x9152, 0x53a9, 0x6551, 0x65e7, 0x81fc, 0x8205, 0x548e, 0x5c31, 0x759a, 0x97a0, 0x62d8, 0x72d9, 0x75bd, 0x5c45, 0x9a79, 0x83ca, 0x5c40, 0x5480, 0x77e9, 0x4e3e, 0x6cae, 0x805a, 0x62d2, 0x636e, 0x5de8, 0x5177, 0x8ddd, 0x8e1e, 0x952f, 0x4ff1, 0x53e5, 0x60e7, 0x70ac, 0x5267, 0x6350, 0x9e43, 0x5a1f, 0x5026, 0x7737, 0x5377, 0x7ee2, 0x6485, 0x652b, 0x6289, 0x6398, 0x5014, 0x7235, 0x89c9, 0x51b3, 0x8bc0, 0x7edd, 0x5747, 0x83cc, 0x94a7, 0x519b, 0x541b, 0x5cfb, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbf40[ 192 ] = { 0x7dfb, 0x7dfc, 0x7dfd, 0x7dfe, 0x7dff, 0x7e00, 0x7e01, 0x7e02, 0x7e03, 0x7e04, 0x7e05, 0x7e06, 0x7e07, 0x7e08, 0x7e09, 0x7e0a, 0x7e0b, 0x7e0c, 0x7e0d, 0x7e0e, 0x7e0f, 0x7e10, 0x7e11, 0x7e12, 0x7e13, 0x7e14, 0x7e15, 0x7e16, 0x7e17, 0x7e18, 0x7e19, 0x7e1a, 0x7e1b, 0x7e1c, 0x7e1d, 0x7e1e, 0x7e1f, 0x7e20, 0x7e21, 0x7e22, 0x7e23, 0x7e24, 0x7e25, 0x7e26, 0x7e27, 0x7e28, 0x7e29, 0x7e2a, 0x7e2b, 0x7e2c, 0x7e2d, 0x7e2e, 0x7e2f, 0x7e30, 0x7e31, 0x7e32, 0x7e33, 0x7e34, 0x7e35, 0x7e36, 0x7e37, 0x7e38, 0x7e39, 0xfffd, 0x7e3a, 0x7e3c, 0x7e3d, 0x7e3e, 0x7e3f, 0x7e40, 0x7e42, 0x7e43, 0x7e44, 0x7e45, 0x7e46, 0x7e48, 0x7e49, 0x7e4a, 0x7e4b, 0x7e4c, 0x7e4d, 0x7e4e, 0x7e4f, 0x7e50, 0x7e51, 0x7e52, 0x7e53, 0x7e54, 0x7e55, 0x7e56, 0x7e57, 0x7e58, 0x7e59, 0x7e5a, 0x7e5b, 0x7e5c, 0x7e5d, 0x4fca, 0x7ae3, 0x6d5a, 0x90e1, 0x9a8f, 0x5580, 0x5496, 0x5361, 0x54af, 0x5f00, 0x63e9, 0x6977, 0x51ef, 0x6168, 0x520a, 0x582a, 0x52d8, 0x574e, 0x780d, 0x770b, 0x5eb7, 0x6177, 0x7ce0, 0x625b, 0x6297, 0x4ea2, 0x7095, 0x8003, 0x62f7, 0x70e4, 0x9760, 0x5777, 0x82db, 0x67ef, 0x68f5, 0x78d5, 0x9897, 0x79d1, 0x58f3, 0x54b3, 0x53ef, 0x6e34, 0x514b, 0x523b, 0x5ba2, 0x8bfe, 0x80af, 0x5543, 0x57a6, 0x6073, 0x5751, 0x542d, 0x7a7a, 0x6050, 0x5b54, 0x63a7, 0x62a0, 0x53e3, 0x6263, 0x5bc7, 0x67af, 0x54ed, 0x7a9f, 0x82e6, 0x9177, 0x5e93, 0x88e4, 0x5938, 0x57ae, 0x630e, 0x8de8, 0x80ef, 0x5757, 0x7b77, 0x4fa9, 0x5feb, 0x5bbd, 0x6b3e, 0x5321, 0x7b50, 0x72c2, 0x6846, 0x77ff, 0x7736, 0x65f7, 0x51b5, 0x4e8f, 0x76d4, 0x5cbf, 0x7aa5, 0x8475, 0x594e, 0x9b41, 0x5080, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc040[ 192 ] = { 0x7e5e, 0x7e5f, 0x7e60, 0x7e61, 0x7e62, 0x7e63, 0x7e64, 0x7e65, 0x7e66, 0x7e67, 0x7e68, 0x7e69, 0x7e6a, 0x7e6b, 0x7e6c, 0x7e6d, 0x7e6e, 0x7e6f, 0x7e70, 0x7e71, 0x7e72, 0x7e73, 0x7e74, 0x7e75, 0x7e76, 0x7e77, 0x7e78, 0x7e79, 0x7e7a, 0x7e7b, 0x7e7c, 0x7e7d, 0x7e7e, 0x7e7f, 0x7e80, 0x7e81, 0x7e83, 0x7e84, 0x7e85, 0x7e86, 0x7e87, 0x7e88, 0x7e89, 0x7e8a, 0x7e8b, 0x7e8c, 0x7e8d, 0x7e8e, 0x7e8f, 0x7e90, 0x7e91, 0x7e92, 0x7e93, 0x7e94, 0x7e95, 0x7e96, 0x7e97, 0x7e98, 0x7e99, 0x7e9a, 0x7e9c, 0x7e9d, 0x7e9e, 0xfffd, 0x7eae, 0x7eb4, 0x7ebb, 0x7ebc, 0x7ed6, 0x7ee4, 0x7eec, 0x7ef9, 0x7f0a, 0x7f10, 0x7f1e, 0x7f37, 0x7f39, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f, 0x7f40, 0x7f41, 0x7f43, 0x7f46, 0x7f47, 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f, 0x7f52, 0x7f53, 0x9988, 0x6127, 0x6e83, 0x5764, 0x6606, 0x6346, 0x56f0, 0x62ec, 0x6269, 0x5ed3, 0x9614, 0x5783, 0x62c9, 0x5587, 0x8721, 0x814a, 0x8fa3, 0x5566, 0x83b1, 0x6765, 0x8d56, 0x84dd, 0x5a6a, 0x680f, 0x62e6, 0x7bee, 0x9611, 0x5170, 0x6f9c, 0x8c30, 0x63fd, 0x89c8, 0x61d2, 0x7f06, 0x70c2, 0x6ee5, 0x7405, 0x6994, 0x72fc, 0x5eca, 0x90ce, 0x6717, 0x6d6a, 0x635e, 0x52b3, 0x7262, 0x8001, 0x4f6c, 0x59e5, 0x916a, 0x70d9, 0x6d9d, 0x52d2, 0x4e50, 0x96f7, 0x956d, 0x857e, 0x78ca, 0x7d2f, 0x5121, 0x5792, 0x64c2, 0x808b, 0x7c7b, 0x6cea, 0x68f1, 0x695e, 0x51b7, 0x5398, 0x68a8, 0x7281, 0x9ece, 0x7bf1, 0x72f8, 0x79bb, 0x6f13, 0x7406, 0x674e, 0x91cc, 0x9ca4, 0x793c, 0x8389, 0x8354, 0x540f, 0x6817, 0x4e3d, 0x5389, 0x52b1, 0x783e, 0x5386, 0x5229, 0x5088, 0x4f8b, 0x4fd0, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc140[ 192 ] = { 0x7f56, 0x7f59, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f60, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6f, 0x7f70, 0x7f73, 0x7f75, 0x7f76, 0x7f77, 0x7f78, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7f, 0x7f80, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87, 0x7f88, 0x7f89, 0x7f8b, 0x7f8d, 0x7f8f, 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f95, 0x7f96, 0x7f97, 0x7f98, 0x7f99, 0x7f9b, 0x7f9c, 0x7fa0, 0x7fa2, 0x7fa3, 0x7fa5, 0x7fa6, 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7fb1, 0xfffd, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7, 0x7fba, 0x7fbb, 0x7fbe, 0x7fc0, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc6, 0x7fc7, 0x7fc8, 0x7fc9, 0x7fcb, 0x7fcd, 0x7fcf, 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd6, 0x7fd7, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fe2, 0x7fe3, 0x75e2, 0x7acb, 0x7c92, 0x6ca5, 0x96b6, 0x529b, 0x7483, 0x54e9, 0x4fe9, 0x8054, 0x83b2, 0x8fde, 0x9570, 0x5ec9, 0x601c, 0x6d9f, 0x5e18, 0x655b, 0x8138, 0x94fe, 0x604b, 0x70bc, 0x7ec3, 0x7cae, 0x51c9, 0x6881, 0x7cb1, 0x826f, 0x4e24, 0x8f86, 0x91cf, 0x667e, 0x4eae, 0x8c05, 0x64a9, 0x804a, 0x50da, 0x7597, 0x71ce, 0x5be5, 0x8fbd, 0x6f66, 0x4e86, 0x6482, 0x9563, 0x5ed6, 0x6599, 0x5217, 0x88c2, 0x70c8, 0x52a3, 0x730e, 0x7433, 0x6797, 0x78f7, 0x9716, 0x4e34, 0x90bb, 0x9cde, 0x6dcb, 0x51db, 0x8d41, 0x541d, 0x62ce, 0x73b2, 0x83f1, 0x96f6, 0x9f84, 0x94c3, 0x4f36, 0x7f9a, 0x51cc, 0x7075, 0x9675, 0x5cad, 0x9886, 0x53e6, 0x4ee4, 0x6e9c, 0x7409, 0x69b4, 0x786b, 0x998f, 0x7559, 0x5218, 0x7624, 0x6d41, 0x67f3, 0x516d, 0x9f99, 0x804b, 0x5499, 0x7b3c, 0x7abf, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc240[ 192 ] = { 0x7fe4, 0x7fe7, 0x7fe8, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fef, 0x7ff2, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffd, 0x7ffe, 0x7fff, 0x8002, 0x8007, 0x8008, 0x8009, 0x800a, 0x800e, 0x800f, 0x8011, 0x8013, 0x801a, 0x801b, 0x801d, 0x801e, 0x801f, 0x8021, 0x8023, 0x8024, 0x802b, 0x802c, 0x802d, 0x802e, 0x802f, 0x8030, 0x8032, 0x8034, 0x8039, 0x803a, 0x803c, 0x803e, 0x8040, 0x8041, 0x8044, 0x8045, 0x8047, 0x8048, 0x8049, 0x804e, 0x804f, 0x8050, 0x8051, 0x8053, 0x8055, 0x8056, 0x8057, 0xfffd, 0x8059, 0x805b, 0x805c, 0x805d, 0x805e, 0x805f, 0x8060, 0x8061, 0x8062, 0x8063, 0x8064, 0x8065, 0x8066, 0x8067, 0x8068, 0x806b, 0x806c, 0x806d, 0x806e, 0x806f, 0x8070, 0x8072, 0x8073, 0x8074, 0x8075, 0x8076, 0x8077, 0x8078, 0x8079, 0x807a, 0x807b, 0x807c, 0x807d, 0x9686, 0x5784, 0x62e2, 0x9647, 0x697c, 0x5a04, 0x6402, 0x7bd3, 0x6f0f, 0x964b, 0x82a6, 0x5362, 0x9885, 0x5e90, 0x7089, 0x63b3, 0x5364, 0x864f, 0x9c81, 0x9e93, 0x788c, 0x9732, 0x8def, 0x8d42, 0x9e7f, 0x6f5e, 0x7984, 0x5f55, 0x9646, 0x622e, 0x9a74, 0x5415, 0x94dd, 0x4fa3, 0x65c5, 0x5c65, 0x5c61, 0x7f15, 0x8651, 0x6c2f, 0x5f8b, 0x7387, 0x6ee4, 0x7eff, 0x5ce6, 0x631b, 0x5b6a, 0x6ee6, 0x5375, 0x4e71, 0x63a0, 0x7565, 0x62a1, 0x8f6e, 0x4f26, 0x4ed1, 0x6ca6, 0x7eb6, 0x8bba, 0x841d, 0x87ba, 0x7f57, 0x903b, 0x9523, 0x7ba9, 0x9aa1, 0x88f8, 0x843d, 0x6d1b, 0x9a86, 0x7edc, 0x5988, 0x9ebb, 0x739b, 0x7801, 0x8682, 0x9a6c, 0x9a82, 0x561b, 0x5417, 0x57cb, 0x4e70, 0x9ea6, 0x5356, 0x8fc8, 0x8109, 0x7792, 0x9992, 0x86ee, 0x6ee1, 0x8513, 0x66fc, 0x6162, 0x6f2b, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc340[ 192 ] = { 0x807e, 0x8081, 0x8082, 0x8085, 0x8088, 0x808a, 0x808d, 0x808e, 0x808f, 0x8090, 0x8091, 0x8092, 0x8094, 0x8095, 0x8097, 0x8099, 0x809e, 0x80a3, 0x80a6, 0x80a7, 0x80a8, 0x80ac, 0x80b0, 0x80b3, 0x80b5, 0x80b6, 0x80b8, 0x80b9, 0x80bb, 0x80c5, 0x80c7, 0x80c8, 0x80c9, 0x80ca, 0x80cb, 0x80cf, 0x80d0, 0x80d1, 0x80d2, 0x80d3, 0x80d4, 0x80d5, 0x80d8, 0x80df, 0x80e0, 0x80e2, 0x80e3, 0x80e6, 0x80ee, 0x80f5, 0x80f7, 0x80f9, 0x80fb, 0x80fe, 0x80ff, 0x8100, 0x8101, 0x8103, 0x8104, 0x8105, 0x8107, 0x8108, 0x810b, 0xfffd, 0x810c, 0x8115, 0x8117, 0x8119, 0x811b, 0x811c, 0x811d, 0x811f, 0x8120, 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126, 0x8127, 0x8128, 0x8129, 0x812a, 0x812b, 0x812d, 0x812e, 0x8130, 0x8133, 0x8134, 0x8135, 0x8137, 0x8139, 0x813a, 0x813b, 0x813c, 0x813d, 0x813f, 0x8c29, 0x8292, 0x832b, 0x76f2, 0x6c13, 0x5fd9, 0x83bd, 0x732b, 0x8305, 0x951a, 0x6bdb, 0x77db, 0x94c6, 0x536f, 0x8302, 0x5192, 0x5e3d, 0x8c8c, 0x8d38, 0x4e48, 0x73ab, 0x679a, 0x6885, 0x9176, 0x9709, 0x7164, 0x6ca1, 0x7709, 0x5a92, 0x9541, 0x6bcf, 0x7f8e, 0x6627, 0x5bd0, 0x59b9, 0x5a9a, 0x95e8, 0x95f7, 0x4eec, 0x840c, 0x8499, 0x6aac, 0x76df, 0x9530, 0x731b, 0x68a6, 0x5b5f, 0x772f, 0x919a, 0x9761, 0x7cdc, 0x8ff7, 0x8c1c, 0x5f25, 0x7c73, 0x79d8, 0x89c5, 0x6ccc, 0x871c, 0x5bc6, 0x5e42, 0x68c9, 0x7720, 0x7ef5, 0x5195, 0x514d, 0x52c9, 0x5a29, 0x7f05, 0x9762, 0x82d7, 0x63cf, 0x7784, 0x85d0, 0x79d2, 0x6e3a, 0x5e99, 0x5999, 0x8511, 0x706d, 0x6c11, 0x62bf, 0x76bf, 0x654f, 0x60af, 0x95fd, 0x660e, 0x879f, 0x9e23, 0x94ed, 0x540d, 0x547d, 0x8c2c, 0x6478, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc440[ 192 ] = { 0x8140, 0x8141, 0x8142, 0x8143, 0x8144, 0x8145, 0x8147, 0x8149, 0x814d, 0x814e, 0x814f, 0x8152, 0x8156, 0x8157, 0x8158, 0x815b, 0x815c, 0x815d, 0x815e, 0x815f, 0x8161, 0x8162, 0x8163, 0x8164, 0x8166, 0x8168, 0x816a, 0x816b, 0x816c, 0x816f, 0x8172, 0x8173, 0x8175, 0x8176, 0x8177, 0x8178, 0x8181, 0x8183, 0x8184, 0x8185, 0x8186, 0x8187, 0x8189, 0x818b, 0x818c, 0x818d, 0x818e, 0x8190, 0x8192, 0x8193, 0x8194, 0x8195, 0x8196, 0x8197, 0x8199, 0x819a, 0x819e, 0x819f, 0x81a0, 0x81a1, 0x81a2, 0x81a4, 0x81a5, 0xfffd, 0x81a7, 0x81a9, 0x81ab, 0x81ac, 0x81ad, 0x81ae, 0x81af, 0x81b0, 0x81b1, 0x81b2, 0x81b4, 0x81b5, 0x81b6, 0x81b7, 0x81b8, 0x81b9, 0x81bc, 0x81bd, 0x81be, 0x81bf, 0x81c4, 0x81c5, 0x81c7, 0x81c8, 0x81c9, 0x81cb, 0x81cd, 0x81ce, 0x81cf, 0x81d0, 0x81d1, 0x81d2, 0x81d3, 0x6479, 0x8611, 0x6a21, 0x819c, 0x78e8, 0x6469, 0x9b54, 0x62b9, 0x672b, 0x83ab, 0x58a8, 0x9ed8, 0x6cab, 0x6f20, 0x5bde, 0x964c, 0x8c0b, 0x725f, 0x67d0, 0x62c7, 0x7261, 0x4ea9, 0x59c6, 0x6bcd, 0x5893, 0x66ae, 0x5e55, 0x52df, 0x6155, 0x6728, 0x76ee, 0x7766, 0x7267, 0x7a46, 0x62ff, 0x54ea, 0x5450, 0x94a0, 0x90a3, 0x5a1c, 0x7eb3, 0x6c16, 0x4e43, 0x5976, 0x8010, 0x5948, 0x5357, 0x7537, 0x96be, 0x56ca, 0x6320, 0x8111, 0x607c, 0x95f9, 0x6dd6, 0x5462, 0x9981, 0x5185, 0x5ae9, 0x80fd, 0x59ae, 0x9713, 0x502a, 0x6ce5, 0x5c3c, 0x62df, 0x4f60, 0x533f, 0x817b, 0x9006, 0x6eba, 0x852b, 0x62c8, 0x5e74, 0x78be, 0x64b5, 0x637b, 0x5ff5, 0x5a18, 0x917f, 0x9e1f, 0x5c3f, 0x634f, 0x8042, 0x5b7d, 0x556e, 0x954a, 0x954d, 0x6d85, 0x60a8, 0x67e0, 0x72de, 0x51dd, 0x5b81, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc540[ 192 ] = { 0x81d4, 0x81d5, 0x81d6, 0x81d7, 0x81d8, 0x81d9, 0x81da, 0x81db, 0x81dc, 0x81dd, 0x81de, 0x81df, 0x81e0, 0x81e1, 0x81e2, 0x81e4, 0x81e5, 0x81e6, 0x81e8, 0x81e9, 0x81eb, 0x81ee, 0x81ef, 0x81f0, 0x81f1, 0x81f2, 0x81f5, 0x81f6, 0x81f7, 0x81f8, 0x81f9, 0x81fa, 0x81fd, 0x81ff, 0x8203, 0x8207, 0x8208, 0x8209, 0x820a, 0x820b, 0x820e, 0x820f, 0x8211, 0x8213, 0x8215, 0x8216, 0x8217, 0x8218, 0x8219, 0x821a, 0x821d, 0x8220, 0x8224, 0x8225, 0x8226, 0x8227, 0x8229, 0x822e, 0x8232, 0x823a, 0x823c, 0x823d, 0x823f, 0xfffd, 0x8240, 0x8241, 0x8242, 0x8243, 0x8245, 0x8246, 0x8248, 0x824a, 0x824c, 0x824d, 0x824e, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256, 0x8257, 0x8259, 0x825b, 0x825c, 0x825d, 0x825e, 0x8260, 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266, 0x8267, 0x8269, 0x62e7, 0x6cde, 0x725b, 0x626d, 0x94ae, 0x7ebd, 0x8113, 0x6d53, 0x519c, 0x5f04, 0x5974, 0x52aa, 0x6012, 0x5973, 0x6696, 0x8650, 0x759f, 0x632a, 0x61e6, 0x7cef, 0x8bfa, 0x54e6, 0x6b27, 0x9e25, 0x6bb4, 0x85d5, 0x5455, 0x5076, 0x6ca4, 0x556a, 0x8db4, 0x722c, 0x5e15, 0x6015, 0x7436, 0x62cd, 0x6392, 0x724c, 0x5f98, 0x6e43, 0x6d3e, 0x6500, 0x6f58, 0x76d8, 0x78d0, 0x76fc, 0x7554, 0x5224, 0x53db, 0x4e53, 0x5e9e, 0x65c1, 0x802a, 0x80d6, 0x629b, 0x5486, 0x5228, 0x70ae, 0x888d, 0x8dd1, 0x6ce1, 0x5478, 0x80da, 0x57f9, 0x88f4, 0x8d54, 0x966a, 0x914d, 0x4f69, 0x6c9b, 0x55b7, 0x76c6, 0x7830, 0x62a8, 0x70f9, 0x6f8e, 0x5f6d, 0x84ec, 0x68da, 0x787c, 0x7bf7, 0x81a8, 0x670b, 0x9e4f, 0x6367, 0x78b0, 0x576f, 0x7812, 0x9739, 0x6279, 0x62ab, 0x5288, 0x7435, 0x6bd7, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc640[ 192 ] = { 0x826a, 0x826b, 0x826c, 0x826d, 0x8271, 0x8275, 0x8276, 0x8277, 0x8278, 0x827b, 0x827c, 0x8280, 0x8281, 0x8283, 0x8285, 0x8286, 0x8287, 0x8289, 0x828c, 0x8290, 0x8293, 0x8294, 0x8295, 0x8296, 0x829a, 0x829b, 0x829e, 0x82a0, 0x82a2, 0x82a3, 0x82a7, 0x82b2, 0x82b5, 0x82b6, 0x82ba, 0x82bb, 0x82bc, 0x82bf, 0x82c0, 0x82c2, 0x82c3, 0x82c5, 0x82c6, 0x82c9, 0x82d0, 0x82d6, 0x82d9, 0x82da, 0x82dd, 0x82e2, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82ec, 0x82ed, 0x82ee, 0x82f0, 0x82f2, 0x82f3, 0x82f5, 0x82f6, 0x82f8, 0xfffd, 0x82fa, 0x82fc, 0x82fd, 0x82fe, 0x82ff, 0x8300, 0x830a, 0x830b, 0x830d, 0x8310, 0x8312, 0x8313, 0x8316, 0x8318, 0x8319, 0x831d, 0x831e, 0x831f, 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, 0x8329, 0x832a, 0x832e, 0x8330, 0x8332, 0x8337, 0x833b, 0x833d, 0x5564, 0x813e, 0x75b2, 0x76ae, 0x5339, 0x75de, 0x50fb, 0x5c41, 0x8b6c, 0x7bc7, 0x504f, 0x7247, 0x9a97, 0x98d8, 0x6f02, 0x74e2, 0x7968, 0x6487, 0x77a5, 0x62fc, 0x9891, 0x8d2b, 0x54c1, 0x8058, 0x4e52, 0x576a, 0x82f9, 0x840d, 0x5e73, 0x51ed, 0x74f6, 0x8bc4, 0x5c4f, 0x5761, 0x6cfc, 0x9887, 0x5a46, 0x7834, 0x9b44, 0x8feb, 0x7c95, 0x5256, 0x6251, 0x94fa, 0x4ec6, 0x8386, 0x8461, 0x83e9, 0x84b2, 0x57d4, 0x6734, 0x5703, 0x666e, 0x6d66, 0x8c31, 0x66dd, 0x7011, 0x671f, 0x6b3a, 0x6816, 0x621a, 0x59bb, 0x4e03, 0x51c4, 0x6f06, 0x67d2, 0x6c8f, 0x5176, 0x68cb, 0x5947, 0x6b67, 0x7566, 0x5d0e, 0x8110, 0x9f50, 0x65d7, 0x7948, 0x7941, 0x9a91, 0x8d77, 0x5c82, 0x4e5e, 0x4f01, 0x542f, 0x5951, 0x780c, 0x5668, 0x6c14, 0x8fc4, 0x5f03, 0x6c7d, 0x6ce3, 0x8bab, 0x6390, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc740[ 192 ] = { 0x833e, 0x833f, 0x8341, 0x8342, 0x8344, 0x8345, 0x8348, 0x834a, 0x834b, 0x834c, 0x834d, 0x834e, 0x8353, 0x8355, 0x8356, 0x8357, 0x8358, 0x8359, 0x835d, 0x8362, 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, 0x8379, 0x837a, 0x837e, 0x837f, 0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8387, 0x8388, 0x838a, 0x838b, 0x838c, 0x838d, 0x838f, 0x8390, 0x8391, 0x8394, 0x8395, 0x8396, 0x8397, 0x8399, 0x839a, 0x839d, 0x839f, 0x83a1, 0x83a2, 0x83a3, 0x83a4, 0x83a5, 0x83a6, 0x83a7, 0x83ac, 0x83ad, 0x83ae, 0xfffd, 0x83af, 0x83b5, 0x83bb, 0x83be, 0x83bf, 0x83c2, 0x83c3, 0x83c4, 0x83c6, 0x83c8, 0x83c9, 0x83cb, 0x83cd, 0x83ce, 0x83d0, 0x83d1, 0x83d2, 0x83d3, 0x83d5, 0x83d7, 0x83d9, 0x83da, 0x83db, 0x83de, 0x83e2, 0x83e3, 0x83e4, 0x83e6, 0x83e7, 0x83e8, 0x83eb, 0x83ec, 0x83ed, 0x6070, 0x6d3d, 0x7275, 0x6266, 0x948e, 0x94c5, 0x5343, 0x8fc1, 0x7b7e, 0x4edf, 0x8c26, 0x4e7e, 0x9ed4, 0x94b1, 0x94b3, 0x524d, 0x6f5c, 0x9063, 0x6d45, 0x8c34, 0x5811, 0x5d4c, 0x6b20, 0x6b49, 0x67aa, 0x545b, 0x8154, 0x7f8c, 0x5899, 0x8537, 0x5f3a, 0x62a2, 0x6a47, 0x9539, 0x6572, 0x6084, 0x6865, 0x77a7, 0x4e54, 0x4fa8, 0x5de7, 0x9798, 0x64ac, 0x7fd8, 0x5ced, 0x4fcf, 0x7a8d, 0x5207, 0x8304, 0x4e14, 0x602f, 0x7a83, 0x94a6, 0x4fb5, 0x4eb2, 0x79e6, 0x7434, 0x52e4, 0x82b9, 0x64d2, 0x79bd, 0x5bdd, 0x6c81, 0x9752, 0x8f7b, 0x6c22, 0x503e, 0x537f, 0x6e05, 0x64ce, 0x6674, 0x6c30, 0x60c5, 0x9877, 0x8bf7, 0x5e86, 0x743c, 0x7a77, 0x79cb, 0x4e18, 0x90b1, 0x7403, 0x6c42, 0x56da, 0x914b, 0x6cc5, 0x8d8b, 0x533a, 0x86c6, 0x66f2, 0x8eaf, 0x5c48, 0x9a71, 0x6e20, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc840[ 192 ] = { 0x83ee, 0x83ef, 0x83f3, 0x83f4, 0x83f5, 0x83f6, 0x83f7, 0x83fa, 0x83fb, 0x83fc, 0x83fe, 0x83ff, 0x8400, 0x8402, 0x8405, 0x8407, 0x8408, 0x8409, 0x840a, 0x8410, 0x8412, 0x8413, 0x8414, 0x8415, 0x8416, 0x8417, 0x8419, 0x841a, 0x841b, 0x841e, 0x841f, 0x8420, 0x8421, 0x8422, 0x8423, 0x8429, 0x842a, 0x842b, 0x842c, 0x842d, 0x842e, 0x842f, 0x8430, 0x8432, 0x8433, 0x8434, 0x8435, 0x8436, 0x8437, 0x8439, 0x843a, 0x843b, 0x843e, 0x843f, 0x8440, 0x8441, 0x8442, 0x8443, 0x8444, 0x8445, 0x8447, 0x8448, 0x8449, 0xfffd, 0x844a, 0x844b, 0x844c, 0x844d, 0x844e, 0x844f, 0x8450, 0x8452, 0x8453, 0x8454, 0x8455, 0x8456, 0x8458, 0x845d, 0x845e, 0x845f, 0x8460, 0x8462, 0x8464, 0x8465, 0x8466, 0x8467, 0x8468, 0x846a, 0x846e, 0x846f, 0x8470, 0x8472, 0x8474, 0x8477, 0x8479, 0x847b, 0x847c, 0x53d6, 0x5a36, 0x9f8b, 0x8da3, 0x53bb, 0x5708, 0x98a7, 0x6743, 0x919b, 0x6cc9, 0x5168, 0x75ca, 0x62f3, 0x72ac, 0x5238, 0x529d, 0x7f3a, 0x7094, 0x7638, 0x5374, 0x9e4a, 0x69b7, 0x786e, 0x96c0, 0x88d9, 0x7fa4, 0x7136, 0x71c3, 0x5189, 0x67d3, 0x74e4, 0x58e4, 0x6518, 0x56b7, 0x8ba9, 0x9976, 0x6270, 0x7ed5, 0x60f9, 0x70ed, 0x58ec, 0x4ec1, 0x4eba, 0x5fcd, 0x97e7, 0x4efb, 0x8ba4, 0x5203, 0x598a, 0x7eab, 0x6254, 0x4ecd, 0x65e5, 0x620e, 0x8338, 0x84c9, 0x8363, 0x878d, 0x7194, 0x6eb6, 0x5bb9, 0x7ed2, 0x5197, 0x63c9, 0x67d4, 0x8089, 0x8339, 0x8815, 0x5112, 0x5b7a, 0x5982, 0x8fb1, 0x4e73, 0x6c5d, 0x5165, 0x8925, 0x8f6f, 0x962e, 0x854a, 0x745e, 0x9510, 0x95f0, 0x6da6, 0x82e5, 0x5f31, 0x6492, 0x6d12, 0x8428, 0x816e, 0x9cc3, 0x585e, 0x8d5b, 0x4e09, 0x53c1, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc940[ 192 ] = { 0x847d, 0x847e, 0x847f, 0x8480, 0x8481, 0x8483, 0x8484, 0x8485, 0x8486, 0x848a, 0x848d, 0x848f, 0x8490, 0x8491, 0x8492, 0x8493, 0x8494, 0x8495, 0x8496, 0x8498, 0x849a, 0x849b, 0x849d, 0x849e, 0x849f, 0x84a0, 0x84a2, 0x84a3, 0x84a4, 0x84a5, 0x84a6, 0x84a7, 0x84a8, 0x84a9, 0x84aa, 0x84ab, 0x84ac, 0x84ad, 0x84ae, 0x84b0, 0x84b1, 0x84b3, 0x84b5, 0x84b6, 0x84b7, 0x84bb, 0x84bc, 0x84be, 0x84c0, 0x84c2, 0x84c3, 0x84c5, 0x84c6, 0x84c7, 0x84c8, 0x84cb, 0x84cc, 0x84ce, 0x84cf, 0x84d2, 0x84d4, 0x84d5, 0x84d7, 0xfffd, 0x84d8, 0x84d9, 0x84da, 0x84db, 0x84dc, 0x84de, 0x84e1, 0x84e2, 0x84e4, 0x84e7, 0x84e8, 0x84e9, 0x84ea, 0x84eb, 0x84ed, 0x84ee, 0x84ef, 0x84f1, 0x84f2, 0x84f3, 0x84f4, 0x84f5, 0x84f6, 0x84f7, 0x84f8, 0x84f9, 0x84fa, 0x84fb, 0x84fd, 0x84fe, 0x8500, 0x8501, 0x8502, 0x4f1e, 0x6563, 0x6851, 0x55d3, 0x4e27, 0x6414, 0x9a9a, 0x626b, 0x5ac2, 0x745f, 0x8272, 0x6da9, 0x68ee, 0x50e7, 0x838e, 0x7802, 0x6740, 0x5239, 0x6c99, 0x7eb1, 0x50bb, 0x5565, 0x715e, 0x7b5b, 0x6652, 0x73ca, 0x82eb, 0x6749, 0x5c71, 0x5220, 0x717d, 0x886b, 0x95ea, 0x9655, 0x64c5, 0x8d61, 0x81b3, 0x5584, 0x6c55, 0x6247, 0x7f2e, 0x5892, 0x4f24, 0x5546, 0x8d4f, 0x664c, 0x4e0a, 0x5c1a, 0x88f3, 0x68a2, 0x634e, 0x7a0d, 0x70e7, 0x828d, 0x52fa, 0x97f6, 0x5c11, 0x54e8, 0x90b5, 0x7ecd, 0x5962, 0x8d4a, 0x86c7, 0x820c, 0x820d, 0x8d66, 0x6444, 0x5c04, 0x6151, 0x6d89, 0x793e, 0x8bbe, 0x7837, 0x7533, 0x547b, 0x4f38, 0x8eab, 0x6df1, 0x5a20, 0x7ec5, 0x795e, 0x6c88, 0x5ba1, 0x5a76, 0x751a, 0x80be, 0x614e, 0x6e17, 0x58f0, 0x751f, 0x7525, 0x7272, 0x5347, 0x7ef3, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xca40[ 192 ] = { 0x8503, 0x8504, 0x8505, 0x8506, 0x8507, 0x8508, 0x8509, 0x850a, 0x850b, 0x850d, 0x850e, 0x850f, 0x8510, 0x8512, 0x8514, 0x8515, 0x8516, 0x8518, 0x8519, 0x851b, 0x851c, 0x851d, 0x851e, 0x8520, 0x8522, 0x8523, 0x8524, 0x8525, 0x8526, 0x8527, 0x8528, 0x8529, 0x852a, 0x852d, 0x852e, 0x852f, 0x8530, 0x8531, 0x8532, 0x8533, 0x8534, 0x8535, 0x8536, 0x853e, 0x853f, 0x8540, 0x8541, 0x8542, 0x8544, 0x8545, 0x8546, 0x8547, 0x854b, 0x854c, 0x854d, 0x854e, 0x854f, 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0xfffd, 0x8557, 0x8558, 0x855a, 0x855b, 0x855c, 0x855d, 0x855f, 0x8560, 0x8561, 0x8562, 0x8563, 0x8565, 0x8566, 0x8567, 0x8569, 0x856a, 0x856b, 0x856c, 0x856d, 0x856e, 0x856f, 0x8570, 0x8571, 0x8573, 0x8575, 0x8576, 0x8577, 0x8578, 0x857c, 0x857d, 0x857f, 0x8580, 0x8581, 0x7701, 0x76db, 0x5269, 0x80dc, 0x5723, 0x5e08, 0x5931, 0x72ee, 0x65bd, 0x6e7f, 0x8bd7, 0x5c38, 0x8671, 0x5341, 0x77f3, 0x62fe, 0x65f6, 0x4ec0, 0x98df, 0x8680, 0x5b9e, 0x8bc6, 0x53f2, 0x77e2, 0x4f7f, 0x5c4e, 0x9a76, 0x59cb, 0x5f0f, 0x793a, 0x58eb, 0x4e16, 0x67ff, 0x4e8b, 0x62ed, 0x8a93, 0x901d, 0x52bf, 0x662f, 0x55dc, 0x566c, 0x9002, 0x4ed5, 0x4f8d, 0x91ca, 0x9970, 0x6c0f, 0x5e02, 0x6043, 0x5ba4, 0x89c6, 0x8bd5, 0x6536, 0x624b, 0x9996, 0x5b88, 0x5bff, 0x6388, 0x552e, 0x53d7, 0x7626, 0x517d, 0x852c, 0x67a2, 0x68b3, 0x6b8a, 0x6292, 0x8f93, 0x53d4, 0x8212, 0x6dd1, 0x758f, 0x4e66, 0x8d4e, 0x5b70, 0x719f, 0x85af, 0x6691, 0x66d9, 0x7f72, 0x8700, 0x9ecd, 0x9f20, 0x5c5e, 0x672f, 0x8ff0, 0x6811, 0x675f, 0x620d, 0x7ad6, 0x5885, 0x5eb6, 0x6570, 0x6f31, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcb40[ 192 ] = { 0x8582, 0x8583, 0x8586, 0x8588, 0x8589, 0x858a, 0x858b, 0x858c, 0x858d, 0x858e, 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595, 0x8596, 0x8597, 0x8598, 0x8599, 0x859a, 0x859d, 0x859e, 0x859f, 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a5, 0x85a6, 0x85a7, 0x85a9, 0x85ab, 0x85ac, 0x85ad, 0x85b1, 0x85b2, 0x85b3, 0x85b4, 0x85b5, 0x85b6, 0x85b8, 0x85ba, 0x85bb, 0x85bc, 0x85bd, 0x85be, 0x85bf, 0x85c0, 0x85c2, 0x85c3, 0x85c4, 0x85c5, 0x85c6, 0x85c7, 0x85c8, 0x85ca, 0x85cb, 0x85cc, 0x85cd, 0x85ce, 0x85d1, 0x85d2, 0xfffd, 0x85d4, 0x85d6, 0x85d7, 0x85d8, 0x85d9, 0x85da, 0x85db, 0x85dd, 0x85de, 0x85df, 0x85e0, 0x85e1, 0x85e2, 0x85e3, 0x85e5, 0x85e6, 0x85e7, 0x85e8, 0x85ea, 0x85eb, 0x85ec, 0x85ed, 0x85ee, 0x85ef, 0x85f0, 0x85f1, 0x85f2, 0x85f3, 0x85f4, 0x85f5, 0x85f6, 0x85f7, 0x85f8, 0x6055, 0x5237, 0x800d, 0x6454, 0x8870, 0x7529, 0x5e05, 0x6813, 0x62f4, 0x971c, 0x53cc, 0x723d, 0x8c01, 0x6c34, 0x7761, 0x7a0e, 0x542e, 0x77ac, 0x987a, 0x821c, 0x8bf4, 0x7855, 0x6714, 0x70c1, 0x65af, 0x6495, 0x5636, 0x601d, 0x79c1, 0x53f8, 0x4e1d, 0x6b7b, 0x8086, 0x5bfa, 0x55e3, 0x56db, 0x4f3a, 0x4f3c, 0x9972, 0x5df3, 0x677e, 0x8038, 0x6002, 0x9882, 0x9001, 0x5b8b, 0x8bbc, 0x8bf5, 0x641c, 0x8258, 0x64de, 0x55fd, 0x82cf, 0x9165, 0x4fd7, 0x7d20, 0x901f, 0x7c9f, 0x50f3, 0x5851, 0x6eaf, 0x5bbf, 0x8bc9, 0x8083, 0x9178, 0x849c, 0x7b97, 0x867d, 0x968b, 0x968f, 0x7ee5, 0x9ad3, 0x788e, 0x5c81, 0x7a57, 0x9042, 0x96a7, 0x795f, 0x5b59, 0x635f, 0x7b0b, 0x84d1, 0x68ad, 0x5506, 0x7f29, 0x7410, 0x7d22, 0x9501, 0x6240, 0x584c, 0x4ed6, 0x5b83, 0x5979, 0x5854, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcc40[ 192 ] = { 0x85f9, 0x85fa, 0x85fc, 0x85fd, 0x85fe, 0x8600, 0x8601, 0x8602, 0x8603, 0x8604, 0x8606, 0x8607, 0x8608, 0x8609, 0x860a, 0x860b, 0x860c, 0x860d, 0x860e, 0x860f, 0x8610, 0x8612, 0x8613, 0x8614, 0x8615, 0x8617, 0x8618, 0x8619, 0x861a, 0x861b, 0x861c, 0x861d, 0x861e, 0x861f, 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, 0x8626, 0x8628, 0x862a, 0x862b, 0x862c, 0x862d, 0x862e, 0x862f, 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637, 0x8639, 0x863a, 0x863b, 0x863d, 0x863e, 0x863f, 0x8640, 0xfffd, 0x8641, 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647, 0x8648, 0x8649, 0x864a, 0x864b, 0x864c, 0x8652, 0x8653, 0x8655, 0x8656, 0x8657, 0x8658, 0x8659, 0x865b, 0x865c, 0x865d, 0x865f, 0x8660, 0x8661, 0x8663, 0x8664, 0x8665, 0x8666, 0x8667, 0x8668, 0x8669, 0x866a, 0x736d, 0x631e, 0x8e4b, 0x8e0f, 0x80ce, 0x82d4, 0x62ac, 0x53f0, 0x6cf0, 0x915e, 0x592a, 0x6001, 0x6c70, 0x574d, 0x644a, 0x8d2a, 0x762b, 0x6ee9, 0x575b, 0x6a80, 0x75f0, 0x6f6d, 0x8c2d, 0x8c08, 0x5766, 0x6bef, 0x8892, 0x78b3, 0x63a2, 0x53f9, 0x70ad, 0x6c64, 0x5858, 0x642a, 0x5802, 0x68e0, 0x819b, 0x5510, 0x7cd6, 0x5018, 0x8eba, 0x6dcc, 0x8d9f, 0x70eb, 0x638f, 0x6d9b, 0x6ed4, 0x7ee6, 0x8404, 0x6843, 0x9003, 0x6dd8, 0x9676, 0x8ba8, 0x5957, 0x7279, 0x85e4, 0x817e, 0x75bc, 0x8a8a, 0x68af, 0x5254, 0x8e22, 0x9511, 0x63d0, 0x9898, 0x8e44, 0x557c, 0x4f53, 0x66ff, 0x568f, 0x60d5, 0x6d95, 0x5243, 0x5c49, 0x5929, 0x6dfb, 0x586b, 0x7530, 0x751c, 0x606c, 0x8214, 0x8146, 0x6311, 0x6761, 0x8fe2, 0x773a, 0x8df3, 0x8d34, 0x94c1, 0x5e16, 0x5385, 0x542c, 0x70c3, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcd40[ 192 ] = { 0x866d, 0x866f, 0x8670, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, 0x8677, 0x8678, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687, 0x8688, 0x8689, 0x868e, 0x868f, 0x8690, 0x8691, 0x8692, 0x8694, 0x8696, 0x8697, 0x8698, 0x8699, 0x869a, 0x869b, 0x869e, 0x869f, 0x86a0, 0x86a1, 0x86a2, 0x86a5, 0x86a6, 0x86ab, 0x86ad, 0x86ae, 0x86b2, 0x86b3, 0x86b7, 0x86b8, 0x86b9, 0x86bb, 0x86bc, 0x86bd, 0x86be, 0x86bf, 0x86c1, 0x86c2, 0x86c3, 0x86c5, 0x86c8, 0x86cc, 0x86cd, 0x86d2, 0x86d3, 0x86d5, 0x86d6, 0x86d7, 0x86da, 0x86dc, 0xfffd, 0x86dd, 0x86e0, 0x86e1, 0x86e2, 0x86e3, 0x86e5, 0x86e6, 0x86e7, 0x86e8, 0x86ea, 0x86eb, 0x86ec, 0x86ef, 0x86f5, 0x86f6, 0x86f7, 0x86fa, 0x86fb, 0x86fc, 0x86fd, 0x86ff, 0x8701, 0x8704, 0x8705, 0x8706, 0x870b, 0x870c, 0x870e, 0x870f, 0x8710, 0x8711, 0x8714, 0x8716, 0x6c40, 0x5ef7, 0x505c, 0x4ead, 0x5ead, 0x633a, 0x8247, 0x901a, 0x6850, 0x916e, 0x77b3, 0x540c, 0x94dc, 0x5f64, 0x7ae5, 0x6876, 0x6345, 0x7b52, 0x7edf, 0x75db, 0x5077, 0x6295, 0x5934, 0x900f, 0x51f8, 0x79c3, 0x7a81, 0x56fe, 0x5f92, 0x9014, 0x6d82, 0x5c60, 0x571f, 0x5410, 0x5154, 0x6e4d, 0x56e2, 0x63a8, 0x9893, 0x817f, 0x8715, 0x892a, 0x9000, 0x541e, 0x5c6f, 0x81c0, 0x62d6, 0x6258, 0x8131, 0x9e35, 0x9640, 0x9a6e, 0x9a7c, 0x692d, 0x59a5, 0x62d3, 0x553e, 0x6316, 0x54c7, 0x86d9, 0x6d3c, 0x5a03, 0x74e6, 0x889c, 0x6b6a, 0x5916, 0x8c4c, 0x5f2f, 0x6e7e, 0x73a9, 0x987d, 0x4e38, 0x70f7, 0x5b8c, 0x7897, 0x633d, 0x665a, 0x7696, 0x60cb, 0x5b9b, 0x5a49, 0x4e07, 0x8155, 0x6c6a, 0x738b, 0x4ea1, 0x6789, 0x7f51, 0x5f80, 0x65fa, 0x671b, 0x5fd8, 0x5984, 0x5a01, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xce40[ 192 ] = { 0x8719, 0x871b, 0x871d, 0x871f, 0x8720, 0x8724, 0x8726, 0x8727, 0x8728, 0x872a, 0x872b, 0x872c, 0x872d, 0x872f, 0x8730, 0x8732, 0x8733, 0x8735, 0x8736, 0x8738, 0x8739, 0x873a, 0x873c, 0x873d, 0x8740, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x874a, 0x874b, 0x874d, 0x874f, 0x8750, 0x8751, 0x8752, 0x8754, 0x8755, 0x8756, 0x8758, 0x875a, 0x875b, 0x875c, 0x875d, 0x875e, 0x875f, 0x8761, 0x8762, 0x8766, 0x8767, 0x8768, 0x8769, 0x876a, 0x876b, 0x876c, 0x876d, 0x876f, 0x8771, 0x8772, 0x8773, 0x8775, 0xfffd, 0x8777, 0x8778, 0x8779, 0x877a, 0x877f, 0x8780, 0x8781, 0x8784, 0x8786, 0x8787, 0x8789, 0x878a, 0x878c, 0x878e, 0x878f, 0x8790, 0x8791, 0x8792, 0x8794, 0x8795, 0x8796, 0x8798, 0x8799, 0x879a, 0x879b, 0x879c, 0x879d, 0x879e, 0x87a0, 0x87a1, 0x87a2, 0x87a3, 0x87a4, 0x5dcd, 0x5fae, 0x5371, 0x97e6, 0x8fdd, 0x6845, 0x56f4, 0x552f, 0x60df, 0x4e3a, 0x6f4d, 0x7ef4, 0x82c7, 0x840e, 0x59d4, 0x4f1f, 0x4f2a, 0x5c3e, 0x7eac, 0x672a, 0x851a, 0x5473, 0x754f, 0x80c3, 0x5582, 0x9b4f, 0x4f4d, 0x6e2d, 0x8c13, 0x5c09, 0x6170, 0x536b, 0x761f, 0x6e29, 0x868a, 0x6587, 0x95fb, 0x7eb9, 0x543b, 0x7a33, 0x7d0a, 0x95ee, 0x55e1, 0x7fc1, 0x74ee, 0x631d, 0x8717, 0x6da1, 0x7a9d, 0x6211, 0x65a1, 0x5367, 0x63e1, 0x6c83, 0x5deb, 0x545c, 0x94a8, 0x4e4c, 0x6c61, 0x8bec, 0x5c4b, 0x65e0, 0x829c, 0x68a7, 0x543e, 0x5434, 0x6bcb, 0x6b66, 0x4e94, 0x6342, 0x5348, 0x821e, 0x4f0d, 0x4fae, 0x575e, 0x620a, 0x96fe, 0x6664, 0x7269, 0x52ff, 0x52a1, 0x609f, 0x8bef, 0x6614, 0x7199, 0x6790, 0x897f, 0x7852, 0x77fd, 0x6670, 0x563b, 0x5438, 0x9521, 0x727a, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcf40[ 192 ] = { 0x87a5, 0x87a6, 0x87a7, 0x87a9, 0x87aa, 0x87ae, 0x87b0, 0x87b1, 0x87b2, 0x87b4, 0x87b6, 0x87b7, 0x87b8, 0x87b9, 0x87bb, 0x87bc, 0x87be, 0x87bf, 0x87c1, 0x87c2, 0x87c3, 0x87c4, 0x87c5, 0x87c7, 0x87c8, 0x87c9, 0x87cc, 0x87cd, 0x87ce, 0x87cf, 0x87d0, 0x87d4, 0x87d5, 0x87d6, 0x87d7, 0x87d8, 0x87d9, 0x87da, 0x87dc, 0x87dd, 0x87de, 0x87df, 0x87e1, 0x87e2, 0x87e3, 0x87e4, 0x87e6, 0x87e7, 0x87e8, 0x87e9, 0x87eb, 0x87ec, 0x87ed, 0x87ef, 0x87f0, 0x87f1, 0x87f2, 0x87f3, 0x87f4, 0x87f5, 0x87f6, 0x87f7, 0x87f8, 0xfffd, 0x87fa, 0x87fb, 0x87fc, 0x87fd, 0x87ff, 0x8800, 0x8801, 0x8802, 0x8804, 0x8805, 0x8806, 0x8807, 0x8808, 0x8809, 0x880b, 0x880c, 0x880d, 0x880e, 0x880f, 0x8810, 0x8811, 0x8812, 0x8814, 0x8817, 0x8818, 0x8819, 0x881a, 0x881c, 0x881d, 0x881e, 0x881f, 0x8820, 0x8823, 0x7a00, 0x606f, 0x5e0c, 0x6089, 0x819d, 0x5915, 0x60dc, 0x7184, 0x70ef, 0x6eaa, 0x6c50, 0x7280, 0x6a84, 0x88ad, 0x5e2d, 0x4e60, 0x5ab3, 0x559c, 0x94e3, 0x6d17, 0x7cfb, 0x9699, 0x620f, 0x7ec6, 0x778e, 0x867e, 0x5323, 0x971e, 0x8f96, 0x6687, 0x5ce1, 0x4fa0, 0x72ed, 0x4e0b, 0x53a6, 0x590f, 0x5413, 0x6380, 0x9528, 0x5148, 0x4ed9, 0x9c9c, 0x7ea4, 0x54b8, 0x8d24, 0x8854, 0x8237, 0x95f2, 0x6d8e, 0x5f26, 0x5acc, 0x663e, 0x9669, 0x73b0, 0x732e, 0x53bf, 0x817a, 0x9985, 0x7fa1, 0x5baa, 0x9677, 0x9650, 0x7ebf, 0x76f8, 0x53a2, 0x9576, 0x9999, 0x7bb1, 0x8944, 0x6e58, 0x4e61, 0x7fd4, 0x7965, 0x8be6, 0x60f3, 0x54cd, 0x4eab, 0x9879, 0x5df7, 0x6a61, 0x50cf, 0x5411, 0x8c61, 0x8427, 0x785d, 0x9704, 0x524a, 0x54ee, 0x56a3, 0x9500, 0x6d88, 0x5bb5, 0x6dc6, 0x6653, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd040[ 192 ] = { 0x8824, 0x8825, 0x8826, 0x8827, 0x8828, 0x8829, 0x882a, 0x882b, 0x882c, 0x882d, 0x882e, 0x882f, 0x8830, 0x8831, 0x8833, 0x8834, 0x8835, 0x8836, 0x8837, 0x8838, 0x883a, 0x883b, 0x883d, 0x883e, 0x883f, 0x8841, 0x8842, 0x8843, 0x8846, 0x8847, 0x8848, 0x8849, 0x884a, 0x884b, 0x884e, 0x884f, 0x8850, 0x8851, 0x8852, 0x8853, 0x8855, 0x8856, 0x8858, 0x885a, 0x885b, 0x885c, 0x885d, 0x885e, 0x885f, 0x8860, 0x8866, 0x8867, 0x886a, 0x886d, 0x886f, 0x8871, 0x8873, 0x8874, 0x8875, 0x8876, 0x8878, 0x8879, 0x887a, 0xfffd, 0x887b, 0x887c, 0x8880, 0x8883, 0x8886, 0x8887, 0x8889, 0x888a, 0x888c, 0x888e, 0x888f, 0x8890, 0x8891, 0x8893, 0x8894, 0x8895, 0x8897, 0x8898, 0x8899, 0x889a, 0x889b, 0x889d, 0x889e, 0x889f, 0x88a0, 0x88a1, 0x88a3, 0x88a5, 0x88a6, 0x88a7, 0x88a8, 0x88a9, 0x88aa, 0x5c0f, 0x5b5d, 0x6821, 0x8096, 0x5578, 0x7b11, 0x6548, 0x6954, 0x4e9b, 0x6b47, 0x874e, 0x978b, 0x534f, 0x631f, 0x643a, 0x90aa, 0x659c, 0x80c1, 0x8c10, 0x5199, 0x68b0, 0x5378, 0x87f9, 0x61c8, 0x6cc4, 0x6cfb, 0x8c22, 0x5c51, 0x85aa, 0x82af, 0x950c, 0x6b23, 0x8f9b, 0x65b0, 0x5ffb, 0x5fc3, 0x4fe1, 0x8845, 0x661f, 0x8165, 0x7329, 0x60fa, 0x5174, 0x5211, 0x578b, 0x5f62, 0x90a2, 0x884c, 0x9192, 0x5e78, 0x674f, 0x6027, 0x59d3, 0x5144, 0x51f6, 0x80f8, 0x5308, 0x6c79, 0x96c4, 0x718a, 0x4f11, 0x4fee, 0x7f9e, 0x673d, 0x55c5, 0x9508, 0x79c0, 0x8896, 0x7ee3, 0x589f, 0x620c, 0x9700, 0x865a, 0x5618, 0x987b, 0x5f90, 0x8bb8, 0x84c4, 0x9157, 0x53d9, 0x65ed, 0x5e8f, 0x755c, 0x6064, 0x7d6e, 0x5a7f, 0x7eea, 0x7eed, 0x8f69, 0x55a7, 0x5ba3, 0x60ac, 0x65cb, 0x7384, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd140[ 192 ] = { 0x88ac, 0x88ae, 0x88af, 0x88b0, 0x88b2, 0x88b3, 0x88b4, 0x88b5, 0x88b6, 0x88b8, 0x88b9, 0x88ba, 0x88bb, 0x88bd, 0x88be, 0x88bf, 0x88c0, 0x88c3, 0x88c4, 0x88c7, 0x88c8, 0x88ca, 0x88cb, 0x88cc, 0x88cd, 0x88cf, 0x88d0, 0x88d1, 0x88d3, 0x88d6, 0x88d7, 0x88da, 0x88db, 0x88dc, 0x88dd, 0x88de, 0x88e0, 0x88e1, 0x88e6, 0x88e7, 0x88e9, 0x88ea, 0x88eb, 0x88ec, 0x88ed, 0x88ee, 0x88ef, 0x88f2, 0x88f5, 0x88f6, 0x88f7, 0x88fa, 0x88fb, 0x88fd, 0x88ff, 0x8900, 0x8901, 0x8903, 0x8904, 0x8905, 0x8906, 0x8907, 0x8908, 0xfffd, 0x8909, 0x890b, 0x890c, 0x890d, 0x890e, 0x890f, 0x8911, 0x8914, 0x8915, 0x8916, 0x8917, 0x8918, 0x891c, 0x891d, 0x891e, 0x891f, 0x8920, 0x8922, 0x8923, 0x8924, 0x8926, 0x8927, 0x8928, 0x8929, 0x892c, 0x892d, 0x892e, 0x892f, 0x8931, 0x8932, 0x8933, 0x8935, 0x8937, 0x9009, 0x7663, 0x7729, 0x7eda, 0x9774, 0x859b, 0x5b66, 0x7a74, 0x96ea, 0x8840, 0x52cb, 0x718f, 0x5faa, 0x65ec, 0x8be2, 0x5bfb, 0x9a6f, 0x5de1, 0x6b89, 0x6c5b, 0x8bad, 0x8baf, 0x900a, 0x8fc5, 0x538b, 0x62bc, 0x9e26, 0x9e2d, 0x5440, 0x4e2b, 0x82bd, 0x7259, 0x869c, 0x5d16, 0x8859, 0x6daf, 0x96c5, 0x54d1, 0x4e9a, 0x8bb6, 0x7109, 0x54bd, 0x9609, 0x70df, 0x6df9, 0x76d0, 0x4e25, 0x7814, 0x8712, 0x5ca9, 0x5ef6, 0x8a00, 0x989c, 0x960e, 0x708e, 0x6cbf, 0x5944, 0x63a9, 0x773c, 0x884d, 0x6f14, 0x8273, 0x5830, 0x71d5, 0x538c, 0x781a, 0x96c1, 0x5501, 0x5f66, 0x7130, 0x5bb4, 0x8c1a, 0x9a8c, 0x6b83, 0x592e, 0x9e2f, 0x79e7, 0x6768, 0x626c, 0x4f6f, 0x75a1, 0x7f8a, 0x6d0b, 0x9633, 0x6c27, 0x4ef0, 0x75d2, 0x517b, 0x6837, 0x6f3e, 0x9080, 0x8170, 0x5996, 0x7476, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd240[ 192 ] = { 0x8938, 0x8939, 0x893a, 0x893b, 0x893c, 0x893d, 0x893e, 0x893f, 0x8940, 0x8942, 0x8943, 0x8945, 0x8946, 0x8947, 0x8948, 0x8949, 0x894a, 0x894b, 0x894c, 0x894d, 0x894e, 0x894f, 0x8950, 0x8951, 0x8952, 0x8953, 0x8954, 0x8955, 0x8956, 0x8957, 0x8958, 0x8959, 0x895a, 0x895b, 0x895c, 0x895d, 0x8960, 0x8961, 0x8962, 0x8963, 0x8964, 0x8965, 0x8967, 0x8968, 0x8969, 0x896a, 0x896b, 0x896c, 0x896d, 0x896e, 0x896f, 0x8970, 0x8971, 0x8972, 0x8973, 0x8974, 0x8975, 0x8976, 0x8977, 0x8978, 0x8979, 0x897a, 0x897c, 0xfffd, 0x897d, 0x897e, 0x8980, 0x8982, 0x8984, 0x8985, 0x8987, 0x8988, 0x8989, 0x898a, 0x898b, 0x898c, 0x898d, 0x898e, 0x898f, 0x8990, 0x8991, 0x8992, 0x8993, 0x8994, 0x8995, 0x8996, 0x8997, 0x8998, 0x8999, 0x899a, 0x899b, 0x899c, 0x899d, 0x899e, 0x899f, 0x89a0, 0x89a1, 0x6447, 0x5c27, 0x9065, 0x7a91, 0x8c23, 0x59da, 0x54ac, 0x8200, 0x836f, 0x8981, 0x8000, 0x6930, 0x564e, 0x8036, 0x7237, 0x91ce, 0x51b6, 0x4e5f, 0x9875, 0x6396, 0x4e1a, 0x53f6, 0x66f3, 0x814b, 0x591c, 0x6db2, 0x4e00, 0x58f9, 0x533b, 0x63d6, 0x94f1, 0x4f9d, 0x4f0a, 0x8863, 0x9890, 0x5937, 0x9057, 0x79fb, 0x4eea, 0x80f0, 0x7591, 0x6c82, 0x5b9c, 0x59e8, 0x5f5d, 0x6905, 0x8681, 0x501a, 0x5df2, 0x4e59, 0x77e3, 0x4ee5, 0x827a, 0x6291, 0x6613, 0x9091, 0x5c79, 0x4ebf, 0x5f79, 0x81c6, 0x9038, 0x8084, 0x75ab, 0x4ea6, 0x88d4, 0x610f, 0x6bc5, 0x5fc6, 0x4e49, 0x76ca, 0x6ea2, 0x8be3, 0x8bae, 0x8c0a, 0x8bd1, 0x5f02, 0x7ffc, 0x7fcc, 0x7ece, 0x8335, 0x836b, 0x56e0, 0x6bb7, 0x97f3, 0x9634, 0x59fb, 0x541f, 0x94f6, 0x6deb, 0x5bc5, 0x996e, 0x5c39, 0x5f15, 0x9690, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd340[ 192 ] = { 0x89a2, 0x89a3, 0x89a4, 0x89a5, 0x89a6, 0x89a7, 0x89a8, 0x89a9, 0x89aa, 0x89ab, 0x89ac, 0x89ad, 0x89ae, 0x89af, 0x89b0, 0x89b1, 0x89b2, 0x89b3, 0x89b4, 0x89b5, 0x89b6, 0x89b7, 0x89b8, 0x89b9, 0x89ba, 0x89bb, 0x89bc, 0x89bd, 0x89be, 0x89bf, 0x89c0, 0x89c3, 0x89cd, 0x89d3, 0x89d4, 0x89d5, 0x89d7, 0x89d8, 0x89d9, 0x89db, 0x89dd, 0x89df, 0x89e0, 0x89e1, 0x89e2, 0x89e4, 0x89e7, 0x89e8, 0x89e9, 0x89ea, 0x89ec, 0x89ed, 0x89ee, 0x89f0, 0x89f1, 0x89f2, 0x89f4, 0x89f5, 0x89f6, 0x89f7, 0x89f8, 0x89f9, 0x89fa, 0xfffd, 0x89fb, 0x89fc, 0x89fd, 0x89fe, 0x89ff, 0x8a01, 0x8a02, 0x8a03, 0x8a04, 0x8a05, 0x8a06, 0x8a08, 0x8a09, 0x8a0a, 0x8a0b, 0x8a0c, 0x8a0d, 0x8a0e, 0x8a0f, 0x8a10, 0x8a11, 0x8a12, 0x8a13, 0x8a14, 0x8a15, 0x8a16, 0x8a17, 0x8a18, 0x8a19, 0x8a1a, 0x8a1b, 0x8a1c, 0x8a1d, 0x5370, 0x82f1, 0x6a31, 0x5a74, 0x9e70, 0x5e94, 0x7f28, 0x83b9, 0x8424, 0x8425, 0x8367, 0x8747, 0x8fce, 0x8d62, 0x76c8, 0x5f71, 0x9896, 0x786c, 0x6620, 0x54df, 0x62e5, 0x4f63, 0x81c3, 0x75c8, 0x5eb8, 0x96cd, 0x8e0a, 0x86f9, 0x548f, 0x6cf3, 0x6d8c, 0x6c38, 0x607f, 0x52c7, 0x7528, 0x5e7d, 0x4f18, 0x60a0, 0x5fe7, 0x5c24, 0x7531, 0x90ae, 0x94c0, 0x72b9, 0x6cb9, 0x6e38, 0x9149, 0x6709, 0x53cb, 0x53f3, 0x4f51, 0x91c9, 0x8bf1, 0x53c8, 0x5e7c, 0x8fc2, 0x6de4, 0x4e8e, 0x76c2, 0x6986, 0x865e, 0x611a, 0x8206, 0x4f59, 0x4fde, 0x903e, 0x9c7c, 0x6109, 0x6e1d, 0x6e14, 0x9685, 0x4e88, 0x5a31, 0x96e8, 0x4e0e, 0x5c7f, 0x79b9, 0x5b87, 0x8bed, 0x7fbd, 0x7389, 0x57df, 0x828b, 0x90c1, 0x5401, 0x9047, 0x55bb, 0x5cea, 0x5fa1, 0x6108, 0x6b32, 0x72f1, 0x80b2, 0x8a89, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd440[ 192 ] = { 0x8a1e, 0x8a1f, 0x8a20, 0x8a21, 0x8a22, 0x8a23, 0x8a24, 0x8a25, 0x8a26, 0x8a27, 0x8a28, 0x8a29, 0x8a2a, 0x8a2b, 0x8a2c, 0x8a2d, 0x8a2e, 0x8a2f, 0x8a30, 0x8a31, 0x8a32, 0x8a33, 0x8a34, 0x8a35, 0x8a36, 0x8a37, 0x8a38, 0x8a39, 0x8a3a, 0x8a3b, 0x8a3c, 0x8a3d, 0x8a3f, 0x8a40, 0x8a41, 0x8a42, 0x8a43, 0x8a44, 0x8a45, 0x8a46, 0x8a47, 0x8a49, 0x8a4a, 0x8a4b, 0x8a4c, 0x8a4d, 0x8a4e, 0x8a4f, 0x8a50, 0x8a51, 0x8a52, 0x8a53, 0x8a54, 0x8a55, 0x8a56, 0x8a57, 0x8a58, 0x8a59, 0x8a5a, 0x8a5b, 0x8a5c, 0x8a5d, 0x8a5e, 0xfffd, 0x8a5f, 0x8a60, 0x8a61, 0x8a62, 0x8a63, 0x8a64, 0x8a65, 0x8a66, 0x8a67, 0x8a68, 0x8a69, 0x8a6a, 0x8a6b, 0x8a6c, 0x8a6d, 0x8a6e, 0x8a6f, 0x8a70, 0x8a71, 0x8a72, 0x8a73, 0x8a74, 0x8a75, 0x8a76, 0x8a77, 0x8a78, 0x8a7a, 0x8a7b, 0x8a7c, 0x8a7d, 0x8a7e, 0x8a7f, 0x8a80, 0x6d74, 0x5bd3, 0x88d5, 0x9884, 0x8c6b, 0x9a6d, 0x9e33, 0x6e0a, 0x51a4, 0x5143, 0x57a3, 0x8881, 0x539f, 0x63f4, 0x8f95, 0x56ed, 0x5458, 0x5706, 0x733f, 0x6e90, 0x7f18, 0x8fdc, 0x82d1, 0x613f, 0x6028, 0x9662, 0x66f0, 0x7ea6, 0x8d8a, 0x8dc3, 0x94a5, 0x5cb3, 0x7ca4, 0x6708, 0x60a6, 0x9605, 0x8018, 0x4e91, 0x90e7, 0x5300, 0x9668, 0x5141, 0x8fd0, 0x8574, 0x915d, 0x6655, 0x97f5, 0x5b55, 0x531d, 0x7838, 0x6742, 0x683d, 0x54c9, 0x707e, 0x5bb0, 0x8f7d, 0x518d, 0x5728, 0x54b1, 0x6512, 0x6682, 0x8d5e, 0x8d43, 0x810f, 0x846c, 0x906d, 0x7cdf, 0x51ff, 0x85fb, 0x67a3, 0x65e9, 0x6fa1, 0x86a4, 0x8e81, 0x566a, 0x9020, 0x7682, 0x7076, 0x71e5, 0x8d23, 0x62e9, 0x5219, 0x6cfd, 0x8d3c, 0x600e, 0x589e, 0x618e, 0x66fe, 0x8d60, 0x624e, 0x55b3, 0x6e23, 0x672d, 0x8f67, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd540[ 192 ] = { 0x8a81, 0x8a82, 0x8a83, 0x8a84, 0x8a85, 0x8a86, 0x8a87, 0x8a88, 0x8a8b, 0x8a8c, 0x8a8d, 0x8a8e, 0x8a8f, 0x8a90, 0x8a91, 0x8a92, 0x8a94, 0x8a95, 0x8a96, 0x8a97, 0x8a98, 0x8a99, 0x8a9a, 0x8a9b, 0x8a9c, 0x8a9d, 0x8a9e, 0x8a9f, 0x8aa0, 0x8aa1, 0x8aa2, 0x8aa3, 0x8aa4, 0x8aa5, 0x8aa6, 0x8aa7, 0x8aa8, 0x8aa9, 0x8aaa, 0x8aab, 0x8aac, 0x8aad, 0x8aae, 0x8aaf, 0x8ab0, 0x8ab1, 0x8ab2, 0x8ab3, 0x8ab4, 0x8ab5, 0x8ab6, 0x8ab7, 0x8ab8, 0x8ab9, 0x8aba, 0x8abb, 0x8abc, 0x8abd, 0x8abe, 0x8abf, 0x8ac0, 0x8ac1, 0x8ac2, 0xfffd, 0x8ac3, 0x8ac4, 0x8ac5, 0x8ac6, 0x8ac7, 0x8ac8, 0x8ac9, 0x8aca, 0x8acb, 0x8acc, 0x8acd, 0x8ace, 0x8acf, 0x8ad0, 0x8ad1, 0x8ad2, 0x8ad3, 0x8ad4, 0x8ad5, 0x8ad6, 0x8ad7, 0x8ad8, 0x8ad9, 0x8ada, 0x8adb, 0x8adc, 0x8add, 0x8ade, 0x8adf, 0x8ae0, 0x8ae1, 0x8ae2, 0x8ae3, 0x94e1, 0x95f8, 0x7728, 0x6805, 0x69a8, 0x548b, 0x4e4d, 0x70b8, 0x8bc8, 0x6458, 0x658b, 0x5b85, 0x7a84, 0x503a, 0x5be8, 0x77bb, 0x6be1, 0x8a79, 0x7c98, 0x6cbe, 0x76cf, 0x65a9, 0x8f97, 0x5d2d, 0x5c55, 0x8638, 0x6808, 0x5360, 0x6218, 0x7ad9, 0x6e5b, 0x7efd, 0x6a1f, 0x7ae0, 0x5f70, 0x6f33, 0x5f20, 0x638c, 0x6da8, 0x6756, 0x4e08, 0x5e10, 0x8d26, 0x4ed7, 0x80c0, 0x7634, 0x969c, 0x62db, 0x662d, 0x627e, 0x6cbc, 0x8d75, 0x7167, 0x7f69, 0x5146, 0x8087, 0x53ec, 0x906e, 0x6298, 0x54f2, 0x86f0, 0x8f99, 0x8005, 0x9517, 0x8517, 0x8fd9, 0x6d59, 0x73cd, 0x659f, 0x771f, 0x7504, 0x7827, 0x81fb, 0x8d1e, 0x9488, 0x4fa6, 0x6795, 0x75b9, 0x8bca, 0x9707, 0x632f, 0x9547, 0x9635, 0x84b8, 0x6323, 0x7741, 0x5f81, 0x72f0, 0x4e89, 0x6014, 0x6574, 0x62ef, 0x6b63, 0x653f, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd640[ 192 ] = { 0x8ae4, 0x8ae5, 0x8ae6, 0x8ae7, 0x8ae8, 0x8ae9, 0x8aea, 0x8aeb, 0x8aec, 0x8aed, 0x8aee, 0x8aef, 0x8af0, 0x8af1, 0x8af2, 0x8af3, 0x8af4, 0x8af5, 0x8af6, 0x8af7, 0x8af8, 0x8af9, 0x8afa, 0x8afb, 0x8afc, 0x8afd, 0x8afe, 0x8aff, 0x8b00, 0x8b01, 0x8b02, 0x8b03, 0x8b04, 0x8b05, 0x8b06, 0x8b08, 0x8b09, 0x8b0a, 0x8b0b, 0x8b0c, 0x8b0d, 0x8b0e, 0x8b0f, 0x8b10, 0x8b11, 0x8b12, 0x8b13, 0x8b14, 0x8b15, 0x8b16, 0x8b17, 0x8b18, 0x8b19, 0x8b1a, 0x8b1b, 0x8b1c, 0x8b1d, 0x8b1e, 0x8b1f, 0x8b20, 0x8b21, 0x8b22, 0x8b23, 0xfffd, 0x8b24, 0x8b25, 0x8b27, 0x8b28, 0x8b29, 0x8b2a, 0x8b2b, 0x8b2c, 0x8b2d, 0x8b2e, 0x8b2f, 0x8b30, 0x8b31, 0x8b32, 0x8b33, 0x8b34, 0x8b35, 0x8b36, 0x8b37, 0x8b38, 0x8b39, 0x8b3a, 0x8b3b, 0x8b3c, 0x8b3d, 0x8b3e, 0x8b3f, 0x8b40, 0x8b41, 0x8b42, 0x8b43, 0x8b44, 0x8b45, 0x5e27, 0x75c7, 0x90d1, 0x8bc1, 0x829d, 0x679d, 0x652f, 0x5431, 0x8718, 0x77e5, 0x80a2, 0x8102, 0x6c41, 0x4e4b, 0x7ec7, 0x804c, 0x76f4, 0x690d, 0x6b96, 0x6267, 0x503c, 0x4f84, 0x5740, 0x6307, 0x6b62, 0x8dbe, 0x53ea, 0x65e8, 0x7eb8, 0x5fd7, 0x631a, 0x63b7, 0x81f3, 0x81f4, 0x7f6e, 0x5e1c, 0x5cd9, 0x5236, 0x667a, 0x79e9, 0x7a1a, 0x8d28, 0x7099, 0x75d4, 0x6ede, 0x6cbb, 0x7a92, 0x4e2d, 0x76c5, 0x5fe0, 0x949f, 0x8877, 0x7ec8, 0x79cd, 0x80bf, 0x91cd, 0x4ef2, 0x4f17, 0x821f, 0x5468, 0x5dde, 0x6d32, 0x8bcc, 0x7ca5, 0x8f74, 0x8098, 0x5e1a, 0x5492, 0x76b1, 0x5b99, 0x663c, 0x9aa4, 0x73e0, 0x682a, 0x86db, 0x6731, 0x732a, 0x8bf8, 0x8bdb, 0x9010, 0x7af9, 0x70db, 0x716e, 0x62c4, 0x77a9, 0x5631, 0x4e3b, 0x8457, 0x67f1, 0x52a9, 0x86c0, 0x8d2e, 0x94f8, 0x7b51, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd740[ 192 ] = { 0x8b46, 0x8b47, 0x8b48, 0x8b49, 0x8b4a, 0x8b4b, 0x8b4c, 0x8b4d, 0x8b4e, 0x8b4f, 0x8b50, 0x8b51, 0x8b52, 0x8b53, 0x8b54, 0x8b55, 0x8b56, 0x8b57, 0x8b58, 0x8b59, 0x8b5a, 0x8b5b, 0x8b5c, 0x8b5d, 0x8b5e, 0x8b5f, 0x8b60, 0x8b61, 0x8b62, 0x8b63, 0x8b64, 0x8b65, 0x8b67, 0x8b68, 0x8b69, 0x8b6a, 0x8b6b, 0x8b6d, 0x8b6e, 0x8b6f, 0x8b70, 0x8b71, 0x8b72, 0x8b73, 0x8b74, 0x8b75, 0x8b76, 0x8b77, 0x8b78, 0x8b79, 0x8b7a, 0x8b7b, 0x8b7c, 0x8b7d, 0x8b7e, 0x8b7f, 0x8b80, 0x8b81, 0x8b82, 0x8b83, 0x8b84, 0x8b85, 0x8b86, 0xfffd, 0x8b87, 0x8b88, 0x8b89, 0x8b8a, 0x8b8b, 0x8b8c, 0x8b8d, 0x8b8e, 0x8b8f, 0x8b90, 0x8b91, 0x8b92, 0x8b93, 0x8b94, 0x8b95, 0x8b96, 0x8b97, 0x8b98, 0x8b99, 0x8b9a, 0x8b9b, 0x8b9c, 0x8b9d, 0x8b9e, 0x8b9f, 0x8bac, 0x8bb1, 0x8bbb, 0x8bc7, 0x8bd0, 0x8bea, 0x8c09, 0x8c1e, 0x4f4f, 0x6ce8, 0x795d, 0x9a7b, 0x6293, 0x722a, 0x62fd, 0x4e13, 0x7816, 0x8f6c, 0x64b0, 0x8d5a, 0x7bc6, 0x6869, 0x5e84, 0x88c5, 0x5986, 0x649e, 0x58ee, 0x72b6, 0x690e, 0x9525, 0x8ffd, 0x8d58, 0x5760, 0x7f00, 0x8c06, 0x51c6, 0x6349, 0x62d9, 0x5353, 0x684c, 0x7422, 0x8301, 0x914c, 0x5544, 0x7740, 0x707c, 0x6d4a, 0x5179, 0x54a8, 0x8d44, 0x59ff, 0x6ecb, 0x6dc4, 0x5b5c, 0x7d2b, 0x4ed4, 0x7c7d, 0x6ed3, 0x5b50, 0x81ea, 0x6e0d, 0x5b57, 0x9b03, 0x68d5, 0x8e2a, 0x5b97, 0x7efc, 0x603b, 0x7eb5, 0x90b9, 0x8d70, 0x594f, 0x63cd, 0x79df, 0x8db3, 0x5352, 0x65cf, 0x7956, 0x8bc5, 0x963b, 0x7ec4, 0x94bb, 0x7e82, 0x5634, 0x9189, 0x6700, 0x7f6a, 0x5c0a, 0x9075, 0x6628, 0x5de6, 0x4f50, 0x67de, 0x505a, 0x4f5c, 0x5750, 0x5ea7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd840[ 192 ] = { 0x8c38, 0x8c39, 0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, 0x8c3e, 0x8c3f, 0x8c40, 0x8c42, 0x8c43, 0x8c44, 0x8c45, 0x8c48, 0x8c4a, 0x8c4b, 0x8c4d, 0x8c4e, 0x8c4f, 0x8c50, 0x8c51, 0x8c52, 0x8c53, 0x8c54, 0x8c56, 0x8c57, 0x8c58, 0x8c59, 0x8c5b, 0x8c5c, 0x8c5d, 0x8c5e, 0x8c5f, 0x8c60, 0x8c63, 0x8c64, 0x8c65, 0x8c66, 0x8c67, 0x8c68, 0x8c69, 0x8c6c, 0x8c6d, 0x8c6e, 0x8c6f, 0x8c70, 0x8c71, 0x8c72, 0x8c74, 0x8c75, 0x8c76, 0x8c77, 0x8c7b, 0x8c7c, 0x8c7d, 0x8c7e, 0x8c7f, 0x8c80, 0x8c81, 0x8c83, 0x8c84, 0x8c86, 0x8c87, 0xfffd, 0x8c88, 0x8c8b, 0x8c8d, 0x8c8e, 0x8c8f, 0x8c90, 0x8c91, 0x8c92, 0x8c93, 0x8c95, 0x8c96, 0x8c97, 0x8c99, 0x8c9a, 0x8c9b, 0x8c9c, 0x8c9d, 0x8c9e, 0x8c9f, 0x8ca0, 0x8ca1, 0x8ca2, 0x8ca3, 0x8ca4, 0x8ca5, 0x8ca6, 0x8ca7, 0x8ca8, 0x8ca9, 0x8caa, 0x8cab, 0x8cac, 0x8cad, 0x4e8d, 0x4e0c, 0x5140, 0x4e10, 0x5eff, 0x5345, 0x4e15, 0x4e98, 0x4e1e, 0x9b32, 0x5b6c, 0x5669, 0x4e28, 0x79ba, 0x4e3f, 0x5315, 0x4e47, 0x592d, 0x723b, 0x536e, 0x6c10, 0x56df, 0x80e4, 0x9997, 0x6bd3, 0x777e, 0x9f17, 0x4e36, 0x4e9f, 0x9f10, 0x4e5c, 0x4e69, 0x4e93, 0x8288, 0x5b5b, 0x556c, 0x560f, 0x4ec4, 0x538d, 0x539d, 0x53a3, 0x53a5, 0x53ae, 0x9765, 0x8d5d, 0x531a, 0x53f5, 0x5326, 0x532e, 0x533e, 0x8d5c, 0x5366, 0x5363, 0x5202, 0x5208, 0x520e, 0x522d, 0x5233, 0x523f, 0x5240, 0x524c, 0x525e, 0x5261, 0x525c, 0x84af, 0x527d, 0x5282, 0x5281, 0x5290, 0x5293, 0x5182, 0x7f54, 0x4ebb, 0x4ec3, 0x4ec9, 0x4ec2, 0x4ee8, 0x4ee1, 0x4eeb, 0x4ede, 0x4f1b, 0x4ef3, 0x4f22, 0x4f64, 0x4ef5, 0x4f25, 0x4f27, 0x4f09, 0x4f2b, 0x4f5e, 0x4f67, 0x6538, 0x4f5a, 0x4f5d, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd940[ 192 ] = { 0x8cae, 0x8caf, 0x8cb0, 0x8cb1, 0x8cb2, 0x8cb3, 0x8cb4, 0x8cb5, 0x8cb6, 0x8cb7, 0x8cb8, 0x8cb9, 0x8cba, 0x8cbb, 0x8cbc, 0x8cbd, 0x8cbe, 0x8cbf, 0x8cc0, 0x8cc1, 0x8cc2, 0x8cc3, 0x8cc4, 0x8cc5, 0x8cc6, 0x8cc7, 0x8cc8, 0x8cc9, 0x8cca, 0x8ccb, 0x8ccc, 0x8ccd, 0x8cce, 0x8ccf, 0x8cd0, 0x8cd1, 0x8cd2, 0x8cd3, 0x8cd4, 0x8cd5, 0x8cd6, 0x8cd7, 0x8cd8, 0x8cd9, 0x8cda, 0x8cdb, 0x8cdc, 0x8cdd, 0x8cde, 0x8cdf, 0x8ce0, 0x8ce1, 0x8ce2, 0x8ce3, 0x8ce4, 0x8ce5, 0x8ce6, 0x8ce7, 0x8ce8, 0x8ce9, 0x8cea, 0x8ceb, 0x8cec, 0xfffd, 0x8ced, 0x8cee, 0x8cef, 0x8cf0, 0x8cf1, 0x8cf2, 0x8cf3, 0x8cf4, 0x8cf5, 0x8cf6, 0x8cf7, 0x8cf8, 0x8cf9, 0x8cfa, 0x8cfb, 0x8cfc, 0x8cfd, 0x8cfe, 0x8cff, 0x8d00, 0x8d01, 0x8d02, 0x8d03, 0x8d04, 0x8d05, 0x8d06, 0x8d07, 0x8d08, 0x8d09, 0x8d0a, 0x8d0b, 0x8d0c, 0x8d0d, 0x4f5f, 0x4f57, 0x4f32, 0x4f3d, 0x4f76, 0x4f74, 0x4f91, 0x4f89, 0x4f83, 0x4f8f, 0x4f7e, 0x4f7b, 0x4faa, 0x4f7c, 0x4fac, 0x4f94, 0x4fe6, 0x4fe8, 0x4fea, 0x4fc5, 0x4fda, 0x4fe3, 0x4fdc, 0x4fd1, 0x4fdf, 0x4ff8, 0x5029, 0x504c, 0x4ff3, 0x502c, 0x500f, 0x502e, 0x502d, 0x4ffe, 0x501c, 0x500c, 0x5025, 0x5028, 0x507e, 0x5043, 0x5055, 0x5048, 0x504e, 0x506c, 0x507b, 0x50a5, 0x50a7, 0x50a9, 0x50ba, 0x50d6, 0x5106, 0x50ed, 0x50ec, 0x50e6, 0x50ee, 0x5107, 0x510b, 0x4edd, 0x6c3d, 0x4f58, 0x4f65, 0x4fce, 0x9fa0, 0x6c46, 0x7c74, 0x516e, 0x5dfd, 0x9ec9, 0x9998, 0x5181, 0x5914, 0x52f9, 0x530d, 0x8a07, 0x5310, 0x51eb, 0x5919, 0x5155, 0x4ea0, 0x5156, 0x4eb3, 0x886e, 0x88a4, 0x4eb5, 0x8114, 0x88d2, 0x7980, 0x5b34, 0x8803, 0x7fb8, 0x51ab, 0x51b1, 0x51bd, 0x51bc, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xda40[ 192 ] = { 0x8d0e, 0x8d0f, 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, 0x8d16, 0x8d17, 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d20, 0x8d51, 0x8d52, 0x8d57, 0x8d5f, 0x8d65, 0x8d68, 0x8d69, 0x8d6a, 0x8d6c, 0x8d6e, 0x8d6f, 0x8d71, 0x8d72, 0x8d78, 0x8d79, 0x8d7a, 0x8d7b, 0x8d7c, 0x8d7d, 0x8d7e, 0x8d7f, 0x8d80, 0x8d82, 0x8d83, 0x8d86, 0x8d87, 0x8d88, 0x8d89, 0x8d8c, 0x8d8d, 0x8d8e, 0x8d8f, 0x8d90, 0x8d92, 0x8d93, 0x8d95, 0x8d96, 0x8d97, 0x8d98, 0x8d99, 0x8d9a, 0x8d9b, 0x8d9c, 0x8d9d, 0x8d9e, 0x8da0, 0x8da1, 0xfffd, 0x8da2, 0x8da4, 0x8da5, 0x8da6, 0x8da7, 0x8da8, 0x8da9, 0x8daa, 0x8dab, 0x8dac, 0x8dad, 0x8dae, 0x8daf, 0x8db0, 0x8db2, 0x8db6, 0x8db7, 0x8db9, 0x8dbb, 0x8dbd, 0x8dc0, 0x8dc1, 0x8dc2, 0x8dc5, 0x8dc7, 0x8dc8, 0x8dc9, 0x8dca, 0x8dcd, 0x8dd0, 0x8dd2, 0x8dd3, 0x8dd4, 0x51c7, 0x5196, 0x51a2, 0x51a5, 0x8ba0, 0x8ba6, 0x8ba7, 0x8baa, 0x8bb4, 0x8bb5, 0x8bb7, 0x8bc2, 0x8bc3, 0x8bcb, 0x8bcf, 0x8bce, 0x8bd2, 0x8bd3, 0x8bd4, 0x8bd6, 0x8bd8, 0x8bd9, 0x8bdc, 0x8bdf, 0x8be0, 0x8be4, 0x8be8, 0x8be9, 0x8bee, 0x8bf0, 0x8bf3, 0x8bf6, 0x8bf9, 0x8bfc, 0x8bff, 0x8c00, 0x8c02, 0x8c04, 0x8c07, 0x8c0c, 0x8c0f, 0x8c11, 0x8c12, 0x8c14, 0x8c15, 0x8c16, 0x8c19, 0x8c1b, 0x8c18, 0x8c1d, 0x8c1f, 0x8c20, 0x8c21, 0x8c25, 0x8c27, 0x8c2a, 0x8c2b, 0x8c2e, 0x8c2f, 0x8c32, 0x8c33, 0x8c35, 0x8c36, 0x5369, 0x537a, 0x961d, 0x9622, 0x9621, 0x9631, 0x962a, 0x963d, 0x963c, 0x9642, 0x9649, 0x9654, 0x965f, 0x9667, 0x966c, 0x9672, 0x9674, 0x9688, 0x968d, 0x9697, 0x96b0, 0x9097, 0x909b, 0x909d, 0x9099, 0x90ac, 0x90a1, 0x90b4, 0x90b3, 0x90b6, 0x90ba, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdb40[ 192 ] = { 0x8dd5, 0x8dd8, 0x8dd9, 0x8ddc, 0x8de0, 0x8de1, 0x8de2, 0x8de5, 0x8de6, 0x8de7, 0x8de9, 0x8ded, 0x8dee, 0x8df0, 0x8df1, 0x8df2, 0x8df4, 0x8df6, 0x8dfc, 0x8dfe, 0x8dff, 0x8e00, 0x8e01, 0x8e02, 0x8e03, 0x8e04, 0x8e06, 0x8e07, 0x8e08, 0x8e0b, 0x8e0d, 0x8e0e, 0x8e10, 0x8e11, 0x8e12, 0x8e13, 0x8e15, 0x8e16, 0x8e17, 0x8e18, 0x8e19, 0x8e1a, 0x8e1b, 0x8e1c, 0x8e20, 0x8e21, 0x8e24, 0x8e25, 0x8e26, 0x8e27, 0x8e28, 0x8e2b, 0x8e2d, 0x8e30, 0x8e32, 0x8e33, 0x8e34, 0x8e36, 0x8e37, 0x8e38, 0x8e3b, 0x8e3c, 0x8e3e, 0xfffd, 0x8e3f, 0x8e43, 0x8e45, 0x8e46, 0x8e4c, 0x8e4d, 0x8e4e, 0x8e4f, 0x8e50, 0x8e53, 0x8e54, 0x8e55, 0x8e56, 0x8e57, 0x8e58, 0x8e5a, 0x8e5b, 0x8e5c, 0x8e5d, 0x8e5e, 0x8e5f, 0x8e60, 0x8e61, 0x8e62, 0x8e63, 0x8e64, 0x8e65, 0x8e67, 0x8e68, 0x8e6a, 0x8e6b, 0x8e6e, 0x8e71, 0x90b8, 0x90b0, 0x90cf, 0x90c5, 0x90be, 0x90d0, 0x90c4, 0x90c7, 0x90d3, 0x90e6, 0x90e2, 0x90dc, 0x90d7, 0x90db, 0x90eb, 0x90ef, 0x90fe, 0x9104, 0x9122, 0x911e, 0x9123, 0x9131, 0x912f, 0x9139, 0x9143, 0x9146, 0x520d, 0x5942, 0x52a2, 0x52ac, 0x52ad, 0x52be, 0x54ff, 0x52d0, 0x52d6, 0x52f0, 0x53df, 0x71ee, 0x77cd, 0x5ef4, 0x51f5, 0x51fc, 0x9b2f, 0x53b6, 0x5f01, 0x755a, 0x5def, 0x574c, 0x57a9, 0x57a1, 0x587e, 0x58bc, 0x58c5, 0x58d1, 0x5729, 0x572c, 0x572a, 0x5733, 0x5739, 0x572e, 0x572f, 0x575c, 0x573b, 0x5742, 0x5769, 0x5785, 0x576b, 0x5786, 0x577c, 0x577b, 0x5768, 0x576d, 0x5776, 0x5773, 0x57ad, 0x57a4, 0x578c, 0x57b2, 0x57cf, 0x57a7, 0x57b4, 0x5793, 0x57a0, 0x57d5, 0x57d8, 0x57da, 0x57d9, 0x57d2, 0x57b8, 0x57f4, 0x57ef, 0x57f8, 0x57e4, 0x57dd, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdc40[ 192 ] = { 0x8e73, 0x8e75, 0x8e77, 0x8e78, 0x8e79, 0x8e7a, 0x8e7b, 0x8e7d, 0x8e7e, 0x8e80, 0x8e82, 0x8e83, 0x8e84, 0x8e86, 0x8e88, 0x8e89, 0x8e8a, 0x8e8b, 0x8e8c, 0x8e8d, 0x8e8e, 0x8e91, 0x8e92, 0x8e93, 0x8e95, 0x8e96, 0x8e97, 0x8e98, 0x8e99, 0x8e9a, 0x8e9b, 0x8e9d, 0x8e9f, 0x8ea0, 0x8ea1, 0x8ea2, 0x8ea3, 0x8ea4, 0x8ea5, 0x8ea6, 0x8ea7, 0x8ea8, 0x8ea9, 0x8eaa, 0x8ead, 0x8eae, 0x8eb0, 0x8eb1, 0x8eb3, 0x8eb4, 0x8eb5, 0x8eb6, 0x8eb7, 0x8eb8, 0x8eb9, 0x8ebb, 0x8ebc, 0x8ebd, 0x8ebe, 0x8ebf, 0x8ec0, 0x8ec1, 0x8ec2, 0xfffd, 0x8ec3, 0x8ec4, 0x8ec5, 0x8ec6, 0x8ec7, 0x8ec8, 0x8ec9, 0x8eca, 0x8ecb, 0x8ecc, 0x8ecd, 0x8ecf, 0x8ed0, 0x8ed1, 0x8ed2, 0x8ed3, 0x8ed4, 0x8ed5, 0x8ed6, 0x8ed7, 0x8ed8, 0x8ed9, 0x8eda, 0x8edb, 0x8edc, 0x8edd, 0x8ede, 0x8edf, 0x8ee0, 0x8ee1, 0x8ee2, 0x8ee3, 0x8ee4, 0x580b, 0x580d, 0x57fd, 0x57ed, 0x5800, 0x581e, 0x5819, 0x5844, 0x5820, 0x5865, 0x586c, 0x5881, 0x5889, 0x589a, 0x5880, 0x99a8, 0x9f19, 0x61ff, 0x8279, 0x827d, 0x827f, 0x828f, 0x828a, 0x82a8, 0x8284, 0x828e, 0x8291, 0x8297, 0x8299, 0x82ab, 0x82b8, 0x82be, 0x82b0, 0x82c8, 0x82ca, 0x82e3, 0x8298, 0x82b7, 0x82ae, 0x82cb, 0x82cc, 0x82c1, 0x82a9, 0x82b4, 0x82a1, 0x82aa, 0x829f, 0x82c4, 0x82ce, 0x82a4, 0x82e1, 0x8309, 0x82f7, 0x82e4, 0x830f, 0x8307, 0x82dc, 0x82f4, 0x82d2, 0x82d8, 0x830c, 0x82fb, 0x82d3, 0x8311, 0x831a, 0x8306, 0x8314, 0x8315, 0x82e0, 0x82d5, 0x831c, 0x8351, 0x835b, 0x835c, 0x8308, 0x8392, 0x833c, 0x8334, 0x8331, 0x839b, 0x835e, 0x832f, 0x834f, 0x8347, 0x8343, 0x835f, 0x8340, 0x8317, 0x8360, 0x832d, 0x833a, 0x8333, 0x8366, 0x8365, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdd40[ 192 ] = { 0x8ee5, 0x8ee6, 0x8ee7, 0x8ee8, 0x8ee9, 0x8eea, 0x8eeb, 0x8eec, 0x8eed, 0x8eee, 0x8eef, 0x8ef0, 0x8ef1, 0x8ef2, 0x8ef3, 0x8ef4, 0x8ef5, 0x8ef6, 0x8ef7, 0x8ef8, 0x8ef9, 0x8efa, 0x8efb, 0x8efc, 0x8efd, 0x8efe, 0x8eff, 0x8f00, 0x8f01, 0x8f02, 0x8f03, 0x8f04, 0x8f05, 0x8f06, 0x8f07, 0x8f08, 0x8f09, 0x8f0a, 0x8f0b, 0x8f0c, 0x8f0d, 0x8f0e, 0x8f0f, 0x8f10, 0x8f11, 0x8f12, 0x8f13, 0x8f14, 0x8f15, 0x8f16, 0x8f17, 0x8f18, 0x8f19, 0x8f1a, 0x8f1b, 0x8f1c, 0x8f1d, 0x8f1e, 0x8f1f, 0x8f20, 0x8f21, 0x8f22, 0x8f23, 0xfffd, 0x8f24, 0x8f25, 0x8f26, 0x8f27, 0x8f28, 0x8f29, 0x8f2a, 0x8f2b, 0x8f2c, 0x8f2d, 0x8f2e, 0x8f2f, 0x8f30, 0x8f31, 0x8f32, 0x8f33, 0x8f34, 0x8f35, 0x8f36, 0x8f37, 0x8f38, 0x8f39, 0x8f3a, 0x8f3b, 0x8f3c, 0x8f3d, 0x8f3e, 0x8f3f, 0x8f40, 0x8f41, 0x8f42, 0x8f43, 0x8f44, 0x8368, 0x831b, 0x8369, 0x836c, 0x836a, 0x836d, 0x836e, 0x83b0, 0x8378, 0x83b3, 0x83b4, 0x83a0, 0x83aa, 0x8393, 0x839c, 0x8385, 0x837c, 0x83b6, 0x83a9, 0x837d, 0x83b8, 0x837b, 0x8398, 0x839e, 0x83a8, 0x83ba, 0x83bc, 0x83c1, 0x8401, 0x83e5, 0x83d8, 0x5807, 0x8418, 0x840b, 0x83dd, 0x83fd, 0x83d6, 0x841c, 0x8438, 0x8411, 0x8406, 0x83d4, 0x83df, 0x840f, 0x8403, 0x83f8, 0x83f9, 0x83ea, 0x83c5, 0x83c0, 0x8426, 0x83f0, 0x83e1, 0x845c, 0x8451, 0x845a, 0x8459, 0x8473, 0x8487, 0x8488, 0x847a, 0x8489, 0x8478, 0x843c, 0x8446, 0x8469, 0x8476, 0x848c, 0x848e, 0x8431, 0x846d, 0x84c1, 0x84cd, 0x84d0, 0x84e6, 0x84bd, 0x84d3, 0x84ca, 0x84bf, 0x84ba, 0x84e0, 0x84a1, 0x84b9, 0x84b4, 0x8497, 0x84e5, 0x84e3, 0x850c, 0x750d, 0x8538, 0x84f0, 0x8539, 0x851f, 0x853a, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xde40[ 192 ] = { 0x8f45, 0x8f46, 0x8f47, 0x8f48, 0x8f49, 0x8f4a, 0x8f4b, 0x8f4c, 0x8f4d, 0x8f4e, 0x8f4f, 0x8f50, 0x8f51, 0x8f52, 0x8f53, 0x8f54, 0x8f55, 0x8f56, 0x8f57, 0x8f58, 0x8f59, 0x8f5a, 0x8f5b, 0x8f5c, 0x8f5d, 0x8f5e, 0x8f5f, 0x8f60, 0x8f61, 0x8f62, 0x8f63, 0x8f64, 0x8f65, 0x8f6a, 0x8f80, 0x8f8c, 0x8f92, 0x8f9d, 0x8fa0, 0x8fa1, 0x8fa2, 0x8fa4, 0x8fa5, 0x8fa6, 0x8fa7, 0x8faa, 0x8fac, 0x8fad, 0x8fae, 0x8faf, 0x8fb2, 0x8fb3, 0x8fb4, 0x8fb5, 0x8fb7, 0x8fb8, 0x8fba, 0x8fbb, 0x8fbc, 0x8fbf, 0x8fc0, 0x8fc3, 0x8fc6, 0xfffd, 0x8fc9, 0x8fca, 0x8fcb, 0x8fcc, 0x8fcd, 0x8fcf, 0x8fd2, 0x8fd6, 0x8fd7, 0x8fda, 0x8fe0, 0x8fe1, 0x8fe3, 0x8fe7, 0x8fec, 0x8fef, 0x8ff1, 0x8ff2, 0x8ff4, 0x8ff5, 0x8ff6, 0x8ffa, 0x8ffb, 0x8ffc, 0x8ffe, 0x8fff, 0x9007, 0x9008, 0x900c, 0x900e, 0x9013, 0x9015, 0x9018, 0x8556, 0x853b, 0x84ff, 0x84fc, 0x8559, 0x8548, 0x8568, 0x8564, 0x855e, 0x857a, 0x77a2, 0x8543, 0x8572, 0x857b, 0x85a4, 0x85a8, 0x8587, 0x858f, 0x8579, 0x85ae, 0x859c, 0x8585, 0x85b9, 0x85b7, 0x85b0, 0x85d3, 0x85c1, 0x85dc, 0x85ff, 0x8627, 0x8605, 0x8629, 0x8616, 0x863c, 0x5efe, 0x5f08, 0x593c, 0x5941, 0x8037, 0x5955, 0x595a, 0x5958, 0x530f, 0x5c22, 0x5c25, 0x5c2c, 0x5c34, 0x624c, 0x626a, 0x629f, 0x62bb, 0x62ca, 0x62da, 0x62d7, 0x62ee, 0x6322, 0x62f6, 0x6339, 0x634b, 0x6343, 0x63ad, 0x63f6, 0x6371, 0x637a, 0x638e, 0x63b4, 0x636d, 0x63ac, 0x638a, 0x6369, 0x63ae, 0x63bc, 0x63f2, 0x63f8, 0x63e0, 0x63ff, 0x63c4, 0x63de, 0x63ce, 0x6452, 0x63c6, 0x63be, 0x6445, 0x6441, 0x640b, 0x641b, 0x6420, 0x640c, 0x6426, 0x6421, 0x645e, 0x6484, 0x646d, 0x6496, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdf40[ 192 ] = { 0x9019, 0x901c, 0x9023, 0x9024, 0x9025, 0x9027, 0x9028, 0x9029, 0x902a, 0x902b, 0x902c, 0x9030, 0x9031, 0x9032, 0x9033, 0x9034, 0x9037, 0x9039, 0x903a, 0x903d, 0x903f, 0x9040, 0x9043, 0x9045, 0x9046, 0x9048, 0x9049, 0x904a, 0x904b, 0x904c, 0x904e, 0x9054, 0x9055, 0x9056, 0x9059, 0x905a, 0x905c, 0x905d, 0x905e, 0x905f, 0x9060, 0x9061, 0x9064, 0x9066, 0x9067, 0x9069, 0x906a, 0x906b, 0x906c, 0x906f, 0x9070, 0x9071, 0x9072, 0x9073, 0x9076, 0x9077, 0x9078, 0x9079, 0x907a, 0x907b, 0x907c, 0x907e, 0x9081, 0xfffd, 0x9084, 0x9085, 0x9086, 0x9087, 0x9089, 0x908a, 0x908c, 0x908d, 0x908e, 0x908f, 0x9090, 0x9092, 0x9094, 0x9096, 0x9098, 0x909a, 0x909c, 0x909e, 0x909f, 0x90a0, 0x90a4, 0x90a5, 0x90a7, 0x90a8, 0x90a9, 0x90ab, 0x90ad, 0x90b2, 0x90b7, 0x90bc, 0x90bd, 0x90bf, 0x90c0, 0x647a, 0x64b7, 0x64b8, 0x6499, 0x64ba, 0x64c0, 0x64d0, 0x64d7, 0x64e4, 0x64e2, 0x6509, 0x6525, 0x652e, 0x5f0b, 0x5fd2, 0x7519, 0x5f11, 0x535f, 0x53f1, 0x53fd, 0x53e9, 0x53e8, 0x53fb, 0x5412, 0x5416, 0x5406, 0x544b, 0x5452, 0x5453, 0x5454, 0x5456, 0x5443, 0x5421, 0x5457, 0x5459, 0x5423, 0x5432, 0x5482, 0x5494, 0x5477, 0x5471, 0x5464, 0x549a, 0x549b, 0x5484, 0x5476, 0x5466, 0x549d, 0x54d0, 0x54ad, 0x54c2, 0x54b4, 0x54d2, 0x54a7, 0x54a6, 0x54d3, 0x54d4, 0x5472, 0x54a3, 0x54d5, 0x54bb, 0x54bf, 0x54cc, 0x54d9, 0x54da, 0x54dc, 0x54a9, 0x54aa, 0x54a4, 0x54dd, 0x54cf, 0x54de, 0x551b, 0x54e7, 0x5520, 0x54fd, 0x5514, 0x54f3, 0x5522, 0x5523, 0x550f, 0x5511, 0x5527, 0x552a, 0x5567, 0x558f, 0x55b5, 0x5549, 0x556d, 0x5541, 0x5555, 0x553f, 0x5550, 0x553c, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe040[ 192 ] = { 0x90c2, 0x90c3, 0x90c6, 0x90c8, 0x90c9, 0x90cb, 0x90cc, 0x90cd, 0x90d2, 0x90d4, 0x90d5, 0x90d6, 0x90d8, 0x90d9, 0x90da, 0x90de, 0x90df, 0x90e0, 0x90e3, 0x90e4, 0x90e5, 0x90e9, 0x90ea, 0x90ec, 0x90ee, 0x90f0, 0x90f1, 0x90f2, 0x90f3, 0x90f5, 0x90f6, 0x90f7, 0x90f9, 0x90fa, 0x90fb, 0x90fc, 0x90ff, 0x9100, 0x9101, 0x9103, 0x9105, 0x9106, 0x9107, 0x9108, 0x9109, 0x910a, 0x910b, 0x910c, 0x910d, 0x910e, 0x910f, 0x9110, 0x9111, 0x9112, 0x9113, 0x9114, 0x9115, 0x9116, 0x9117, 0x9118, 0x911a, 0x911b, 0x911c, 0xfffd, 0x911d, 0x911f, 0x9120, 0x9121, 0x9124, 0x9125, 0x9126, 0x9127, 0x9128, 0x9129, 0x912a, 0x912b, 0x912c, 0x912d, 0x912e, 0x9130, 0x9132, 0x9133, 0x9134, 0x9135, 0x9136, 0x9137, 0x9138, 0x913a, 0x913b, 0x913c, 0x913d, 0x913e, 0x913f, 0x9140, 0x9141, 0x9142, 0x9144, 0x5537, 0x5556, 0x5575, 0x5576, 0x5577, 0x5533, 0x5530, 0x555c, 0x558b, 0x55d2, 0x5583, 0x55b1, 0x55b9, 0x5588, 0x5581, 0x559f, 0x557e, 0x55d6, 0x5591, 0x557b, 0x55df, 0x55bd, 0x55be, 0x5594, 0x5599, 0x55ea, 0x55f7, 0x55c9, 0x561f, 0x55d1, 0x55eb, 0x55ec, 0x55d4, 0x55e6, 0x55dd, 0x55c4, 0x55ef, 0x55e5, 0x55f2, 0x55f3, 0x55cc, 0x55cd, 0x55e8, 0x55f5, 0x55e4, 0x8f94, 0x561e, 0x5608, 0x560c, 0x5601, 0x5624, 0x5623, 0x55fe, 0x5600, 0x5627, 0x562d, 0x5658, 0x5639, 0x5657, 0x562c, 0x564d, 0x5662, 0x5659, 0x565c, 0x564c, 0x5654, 0x5686, 0x5664, 0x5671, 0x566b, 0x567b, 0x567c, 0x5685, 0x5693, 0x56af, 0x56d4, 0x56d7, 0x56dd, 0x56e1, 0x56f5, 0x56eb, 0x56f9, 0x56ff, 0x5704, 0x570a, 0x5709, 0x571c, 0x5e0f, 0x5e19, 0x5e14, 0x5e11, 0x5e31, 0x5e3b, 0x5e3c, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe140[ 192 ] = { 0x9145, 0x9147, 0x9148, 0x9151, 0x9153, 0x9154, 0x9155, 0x9156, 0x9158, 0x9159, 0x915b, 0x915c, 0x915f, 0x9160, 0x9166, 0x9167, 0x9168, 0x916b, 0x916d, 0x9173, 0x917a, 0x917b, 0x917c, 0x9180, 0x9181, 0x9182, 0x9183, 0x9184, 0x9186, 0x9188, 0x918a, 0x918e, 0x918f, 0x9193, 0x9194, 0x9195, 0x9196, 0x9197, 0x9198, 0x9199, 0x919c, 0x919d, 0x919e, 0x919f, 0x91a0, 0x91a1, 0x91a4, 0x91a5, 0x91a6, 0x91a7, 0x91a8, 0x91a9, 0x91ab, 0x91ac, 0x91b0, 0x91b1, 0x91b2, 0x91b3, 0x91b6, 0x91b7, 0x91b8, 0x91b9, 0x91bb, 0xfffd, 0x91bc, 0x91bd, 0x91be, 0x91bf, 0x91c0, 0x91c1, 0x91c2, 0x91c3, 0x91c4, 0x91c5, 0x91c6, 0x91c8, 0x91cb, 0x91d0, 0x91d2, 0x91d3, 0x91d4, 0x91d5, 0x91d6, 0x91d7, 0x91d8, 0x91d9, 0x91da, 0x91db, 0x91dd, 0x91de, 0x91df, 0x91e0, 0x91e1, 0x91e2, 0x91e3, 0x91e4, 0x91e5, 0x5e37, 0x5e44, 0x5e54, 0x5e5b, 0x5e5e, 0x5e61, 0x5c8c, 0x5c7a, 0x5c8d, 0x5c90, 0x5c96, 0x5c88, 0x5c98, 0x5c99, 0x5c91, 0x5c9a, 0x5c9c, 0x5cb5, 0x5ca2, 0x5cbd, 0x5cac, 0x5cab, 0x5cb1, 0x5ca3, 0x5cc1, 0x5cb7, 0x5cc4, 0x5cd2, 0x5ce4, 0x5ccb, 0x5ce5, 0x5d02, 0x5d03, 0x5d27, 0x5d26, 0x5d2e, 0x5d24, 0x5d1e, 0x5d06, 0x5d1b, 0x5d58, 0x5d3e, 0x5d34, 0x5d3d, 0x5d6c, 0x5d5b, 0x5d6f, 0x5d5d, 0x5d6b, 0x5d4b, 0x5d4a, 0x5d69, 0x5d74, 0x5d82, 0x5d99, 0x5d9d, 0x8c73, 0x5db7, 0x5dc5, 0x5f73, 0x5f77, 0x5f82, 0x5f87, 0x5f89, 0x5f8c, 0x5f95, 0x5f99, 0x5f9c, 0x5fa8, 0x5fad, 0x5fb5, 0x5fbc, 0x8862, 0x5f61, 0x72ad, 0x72b0, 0x72b4, 0x72b7, 0x72b8, 0x72c3, 0x72c1, 0x72ce, 0x72cd, 0x72d2, 0x72e8, 0x72ef, 0x72e9, 0x72f2, 0x72f4, 0x72f7, 0x7301, 0x72f3, 0x7303, 0x72fa, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe240[ 192 ] = { 0x91e6, 0x91e7, 0x91e8, 0x91e9, 0x91ea, 0x91eb, 0x91ec, 0x91ed, 0x91ee, 0x91ef, 0x91f0, 0x91f1, 0x91f2, 0x91f3, 0x91f4, 0x91f5, 0x91f6, 0x91f7, 0x91f8, 0x91f9, 0x91fa, 0x91fb, 0x91fc, 0x91fd, 0x91fe, 0x91ff, 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205, 0x9206, 0x9207, 0x9208, 0x9209, 0x920a, 0x920b, 0x920c, 0x920d, 0x920e, 0x920f, 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215, 0x9216, 0x9217, 0x9218, 0x9219, 0x921a, 0x921b, 0x921c, 0x921d, 0x921e, 0x921f, 0x9220, 0x9221, 0x9222, 0x9223, 0x9224, 0xfffd, 0x9225, 0x9226, 0x9227, 0x9228, 0x9229, 0x922a, 0x922b, 0x922c, 0x922d, 0x922e, 0x922f, 0x9230, 0x9231, 0x9232, 0x9233, 0x9234, 0x9235, 0x9236, 0x9237, 0x9238, 0x9239, 0x923a, 0x923b, 0x923c, 0x923d, 0x923e, 0x923f, 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, 0x72fb, 0x7317, 0x7313, 0x7321, 0x730a, 0x731e, 0x731d, 0x7315, 0x7322, 0x7339, 0x7325, 0x732c, 0x7338, 0x7331, 0x7350, 0x734d, 0x7357, 0x7360, 0x736c, 0x736f, 0x737e, 0x821b, 0x5925, 0x98e7, 0x5924, 0x5902, 0x9963, 0x9967, 0x9968, 0x9969, 0x996a, 0x996b, 0x996c, 0x9974, 0x9977, 0x997d, 0x9980, 0x9984, 0x9987, 0x998a, 0x998d, 0x9990, 0x9991, 0x9993, 0x9994, 0x9995, 0x5e80, 0x5e91, 0x5e8b, 0x5e96, 0x5ea5, 0x5ea0, 0x5eb9, 0x5eb5, 0x5ebe, 0x5eb3, 0x8d53, 0x5ed2, 0x5ed1, 0x5edb, 0x5ee8, 0x5eea, 0x81ba, 0x5fc4, 0x5fc9, 0x5fd6, 0x5fcf, 0x6003, 0x5fee, 0x6004, 0x5fe1, 0x5fe4, 0x5ffe, 0x6005, 0x6006, 0x5fea, 0x5fed, 0x5ff8, 0x6019, 0x6035, 0x6026, 0x601b, 0x600f, 0x600d, 0x6029, 0x602b, 0x600a, 0x603f, 0x6021, 0x6078, 0x6079, 0x607b, 0x607a, 0x6042, 0xfffd, }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe340[ 192 ] = { 0x9246, 0x9247, 0x9248, 0x9249, 0x924a, 0x924b, 0x924c, 0x924d, 0x924e, 0x924f, 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, 0x9256, 0x9257, 0x9258, 0x9259, 0x925a, 0x925b, 0x925c, 0x925d, 0x925e, 0x925f, 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, 0x9266, 0x9267, 0x9268, 0x9269, 0x926a, 0x926b, 0x926c, 0x926d, 0x926e, 0x926f, 0x9270, 0x9271, 0x9272, 0x9273, 0x9275, 0x9276, 0x9277, 0x9278, 0x9279, 0x927a, 0x927b, 0x927c, 0x927d, 0x927e, 0x927f, 0x9280, 0x9281, 0x9282, 0x9283, 0x9284, 0x9285, 0xfffd, 0x9286, 0x9287, 0x9288, 0x9289, 0x928a, 0x928b, 0x928c, 0x928d, 0x928f, 0x9290, 0x9291, 0x9292, 0x9293, 0x9294, 0x9295, 0x9296, 0x9297, 0x9298, 0x9299, 0x929a, 0x929b, 0x929c, 0x929d, 0x929e, 0x929f, 0x92a0, 0x92a1, 0x92a2, 0x92a3, 0x92a4, 0x92a5, 0x92a6, 0x92a7, 0x606a, 0x607d, 0x6096, 0x609a, 0x60ad, 0x609d, 0x6083, 0x6092, 0x608c, 0x609b, 0x60ec, 0x60bb, 0x60b1, 0x60dd, 0x60d8, 0x60c6, 0x60da, 0x60b4, 0x6120, 0x6126, 0x6115, 0x6123, 0x60f4, 0x6100, 0x610e, 0x612b, 0x614a, 0x6175, 0x61ac, 0x6194, 0x61a7, 0x61b7, 0x61d4, 0x61f5, 0x5fdd, 0x96b3, 0x95e9, 0x95eb, 0x95f1, 0x95f3, 0x95f5, 0x95f6, 0x95fc, 0x95fe, 0x9603, 0x9604, 0x9606, 0x9608, 0x960a, 0x960b, 0x960c, 0x960d, 0x960f, 0x9612, 0x9615, 0x9616, 0x9617, 0x9619, 0x961a, 0x4e2c, 0x723f, 0x6215, 0x6c35, 0x6c54, 0x6c5c, 0x6c4a, 0x6ca3, 0x6c85, 0x6c90, 0x6c94, 0x6c8c, 0x6c68, 0x6c69, 0x6c74, 0x6c76, 0x6c86, 0x6ca9, 0x6cd0, 0x6cd4, 0x6cad, 0x6cf7, 0x6cf8, 0x6cf1, 0x6cd7, 0x6cb2, 0x6ce0, 0x6cd6, 0x6cfa, 0x6ceb, 0x6cee, 0x6cb1, 0x6cd3, 0x6cef, 0x6cfe, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe440[ 192 ] = { 0x92a8, 0x92a9, 0x92aa, 0x92ab, 0x92ac, 0x92ad, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92b3, 0x92b4, 0x92b5, 0x92b6, 0x92b7, 0x92b8, 0x92b9, 0x92ba, 0x92bb, 0x92bc, 0x92bd, 0x92be, 0x92bf, 0x92c0, 0x92c1, 0x92c2, 0x92c3, 0x92c4, 0x92c5, 0x92c6, 0x92c7, 0x92c9, 0x92ca, 0x92cb, 0x92cc, 0x92cd, 0x92ce, 0x92cf, 0x92d0, 0x92d1, 0x92d2, 0x92d3, 0x92d4, 0x92d5, 0x92d6, 0x92d7, 0x92d8, 0x92d9, 0x92da, 0x92db, 0x92dc, 0x92dd, 0x92de, 0x92df, 0x92e0, 0x92e1, 0x92e2, 0x92e3, 0x92e4, 0x92e5, 0x92e6, 0x92e7, 0x92e8, 0xfffd, 0x92e9, 0x92ea, 0x92eb, 0x92ec, 0x92ed, 0x92ee, 0x92ef, 0x92f0, 0x92f1, 0x92f2, 0x92f3, 0x92f4, 0x92f5, 0x92f6, 0x92f7, 0x92f8, 0x92f9, 0x92fa, 0x92fb, 0x92fc, 0x92fd, 0x92fe, 0x92ff, 0x9300, 0x9301, 0x9302, 0x9303, 0x9304, 0x9305, 0x9306, 0x9307, 0x9308, 0x9309, 0x6d39, 0x6d27, 0x6d0c, 0x6d43, 0x6d48, 0x6d07, 0x6d04, 0x6d19, 0x6d0e, 0x6d2b, 0x6d4d, 0x6d2e, 0x6d35, 0x6d1a, 0x6d4f, 0x6d52, 0x6d54, 0x6d33, 0x6d91, 0x6d6f, 0x6d9e, 0x6da0, 0x6d5e, 0x6d93, 0x6d94, 0x6d5c, 0x6d60, 0x6d7c, 0x6d63, 0x6e1a, 0x6dc7, 0x6dc5, 0x6dde, 0x6e0e, 0x6dbf, 0x6de0, 0x6e11, 0x6de6, 0x6ddd, 0x6dd9, 0x6e16, 0x6dab, 0x6e0c, 0x6dae, 0x6e2b, 0x6e6e, 0x6e4e, 0x6e6b, 0x6eb2, 0x6e5f, 0x6e86, 0x6e53, 0x6e54, 0x6e32, 0x6e25, 0x6e44, 0x6edf, 0x6eb1, 0x6e98, 0x6ee0, 0x6f2d, 0x6ee2, 0x6ea5, 0x6ea7, 0x6ebd, 0x6ebb, 0x6eb7, 0x6ed7, 0x6eb4, 0x6ecf, 0x6e8f, 0x6ec2, 0x6e9f, 0x6f62, 0x6f46, 0x6f47, 0x6f24, 0x6f15, 0x6ef9, 0x6f2f, 0x6f36, 0x6f4b, 0x6f74, 0x6f2a, 0x6f09, 0x6f29, 0x6f89, 0x6f8d, 0x6f8c, 0x6f78, 0x6f72, 0x6f7c, 0x6f7a, 0x6fd1, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe540[ 192 ] = { 0x930a, 0x930b, 0x930c, 0x930d, 0x930e, 0x930f, 0x9310, 0x9311, 0x9312, 0x9313, 0x9314, 0x9315, 0x9316, 0x9317, 0x9318, 0x9319, 0x931a, 0x931b, 0x931c, 0x931d, 0x931e, 0x931f, 0x9320, 0x9321, 0x9322, 0x9323, 0x9324, 0x9325, 0x9326, 0x9327, 0x9328, 0x9329, 0x932a, 0x932b, 0x932c, 0x932d, 0x932e, 0x932f, 0x9330, 0x9331, 0x9332, 0x9333, 0x9334, 0x9335, 0x9336, 0x9337, 0x9338, 0x9339, 0x933a, 0x933b, 0x933c, 0x933d, 0x933f, 0x9340, 0x9341, 0x9342, 0x9343, 0x9344, 0x9345, 0x9346, 0x9347, 0x9348, 0x9349, 0xfffd, 0x934a, 0x934b, 0x934c, 0x934d, 0x934e, 0x934f, 0x9350, 0x9351, 0x9352, 0x9353, 0x9354, 0x9355, 0x9356, 0x9357, 0x9358, 0x9359, 0x935a, 0x935b, 0x935c, 0x935d, 0x935e, 0x935f, 0x9360, 0x9361, 0x9362, 0x9363, 0x9364, 0x9365, 0x9366, 0x9367, 0x9368, 0x9369, 0x936b, 0x6fc9, 0x6fa7, 0x6fb9, 0x6fb6, 0x6fc2, 0x6fe1, 0x6fee, 0x6fde, 0x6fe0, 0x6fef, 0x701a, 0x7023, 0x701b, 0x7039, 0x7035, 0x704f, 0x705e, 0x5b80, 0x5b84, 0x5b95, 0x5b93, 0x5ba5, 0x5bb8, 0x752f, 0x9a9e, 0x6434, 0x5be4, 0x5bee, 0x8930, 0x5bf0, 0x8e47, 0x8b07, 0x8fb6, 0x8fd3, 0x8fd5, 0x8fe5, 0x8fee, 0x8fe4, 0x8fe9, 0x8fe6, 0x8ff3, 0x8fe8, 0x9005, 0x9004, 0x900b, 0x9026, 0x9011, 0x900d, 0x9016, 0x9021, 0x9035, 0x9036, 0x902d, 0x902f, 0x9044, 0x9051, 0x9052, 0x9050, 0x9068, 0x9058, 0x9062, 0x905b, 0x66b9, 0x9074, 0x907d, 0x9082, 0x9088, 0x9083, 0x908b, 0x5f50, 0x5f57, 0x5f56, 0x5f58, 0x5c3b, 0x54ab, 0x5c50, 0x5c59, 0x5b71, 0x5c63, 0x5c66, 0x7fbc, 0x5f2a, 0x5f29, 0x5f2d, 0x8274, 0x5f3c, 0x9b3b, 0x5c6e, 0x5981, 0x5983, 0x598d, 0x59a9, 0x59aa, 0x59a3, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe640[ 192 ] = { 0x936c, 0x936d, 0x936e, 0x936f, 0x9370, 0x9371, 0x9372, 0x9373, 0x9374, 0x9375, 0x9376, 0x9377, 0x9378, 0x9379, 0x937a, 0x937b, 0x937c, 0x937d, 0x937e, 0x937f, 0x9380, 0x9381, 0x9382, 0x9383, 0x9384, 0x9385, 0x9386, 0x9387, 0x9388, 0x9389, 0x938a, 0x938b, 0x938c, 0x938d, 0x938e, 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, 0x9395, 0x9396, 0x9397, 0x9398, 0x9399, 0x939a, 0x939b, 0x939c, 0x939d, 0x939e, 0x939f, 0x93a0, 0x93a1, 0x93a2, 0x93a3, 0x93a4, 0x93a5, 0x93a6, 0x93a7, 0x93a8, 0x93a9, 0x93aa, 0x93ab, 0xfffd, 0x93ac, 0x93ad, 0x93ae, 0x93af, 0x93b0, 0x93b1, 0x93b2, 0x93b3, 0x93b4, 0x93b5, 0x93b6, 0x93b7, 0x93b8, 0x93b9, 0x93ba, 0x93bb, 0x93bc, 0x93bd, 0x93be, 0x93bf, 0x93c0, 0x93c1, 0x93c2, 0x93c3, 0x93c4, 0x93c5, 0x93c6, 0x93c7, 0x93c8, 0x93c9, 0x93cb, 0x93cc, 0x93cd, 0x5997, 0x59ca, 0x59ab, 0x599e, 0x59a4, 0x59d2, 0x59b2, 0x59af, 0x59d7, 0x59be, 0x5a05, 0x5a06, 0x59dd, 0x5a08, 0x59e3, 0x59d8, 0x59f9, 0x5a0c, 0x5a09, 0x5a32, 0x5a34, 0x5a11, 0x5a23, 0x5a13, 0x5a40, 0x5a67, 0x5a4a, 0x5a55, 0x5a3c, 0x5a62, 0x5a75, 0x80ec, 0x5aaa, 0x5a9b, 0x5a77, 0x5a7a, 0x5abe, 0x5aeb, 0x5ab2, 0x5ad2, 0x5ad4, 0x5ab8, 0x5ae0, 0x5ae3, 0x5af1, 0x5ad6, 0x5ae6, 0x5ad8, 0x5adc, 0x5b09, 0x5b17, 0x5b16, 0x5b32, 0x5b37, 0x5b40, 0x5c15, 0x5c1c, 0x5b5a, 0x5b65, 0x5b73, 0x5b51, 0x5b53, 0x5b62, 0x9a75, 0x9a77, 0x9a78, 0x9a7a, 0x9a7f, 0x9a7d, 0x9a80, 0x9a81, 0x9a85, 0x9a88, 0x9a8a, 0x9a90, 0x9a92, 0x9a93, 0x9a96, 0x9a98, 0x9a9b, 0x9a9c, 0x9a9d, 0x9a9f, 0x9aa0, 0x9aa2, 0x9aa3, 0x9aa5, 0x9aa7, 0x7e9f, 0x7ea1, 0x7ea3, 0x7ea5, 0x7ea8, 0x7ea9, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe740[ 192 ] = { 0x93ce, 0x93cf, 0x93d0, 0x93d1, 0x93d2, 0x93d3, 0x93d4, 0x93d5, 0x93d7, 0x93d8, 0x93d9, 0x93da, 0x93db, 0x93dc, 0x93dd, 0x93de, 0x93df, 0x93e0, 0x93e1, 0x93e2, 0x93e3, 0x93e4, 0x93e5, 0x93e6, 0x93e7, 0x93e8, 0x93e9, 0x93ea, 0x93eb, 0x93ec, 0x93ed, 0x93ee, 0x93ef, 0x93f0, 0x93f1, 0x93f2, 0x93f3, 0x93f4, 0x93f5, 0x93f6, 0x93f7, 0x93f8, 0x93f9, 0x93fa, 0x93fb, 0x93fc, 0x93fd, 0x93fe, 0x93ff, 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, 0x9407, 0x9408, 0x9409, 0x940a, 0x940b, 0x940c, 0x940d, 0xfffd, 0x940e, 0x940f, 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, 0x9417, 0x9418, 0x9419, 0x941a, 0x941b, 0x941c, 0x941d, 0x941e, 0x941f, 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, 0x9427, 0x9428, 0x9429, 0x942a, 0x942b, 0x942c, 0x942d, 0x942e, 0x7ead, 0x7eb0, 0x7ebe, 0x7ec0, 0x7ec1, 0x7ec2, 0x7ec9, 0x7ecb, 0x7ecc, 0x7ed0, 0x7ed4, 0x7ed7, 0x7edb, 0x7ee0, 0x7ee1, 0x7ee8, 0x7eeb, 0x7eee, 0x7eef, 0x7ef1, 0x7ef2, 0x7f0d, 0x7ef6, 0x7efa, 0x7efb, 0x7efe, 0x7f01, 0x7f02, 0x7f03, 0x7f07, 0x7f08, 0x7f0b, 0x7f0c, 0x7f0f, 0x7f11, 0x7f12, 0x7f17, 0x7f19, 0x7f1c, 0x7f1b, 0x7f1f, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2f, 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f35, 0x5e7a, 0x757f, 0x5ddb, 0x753e, 0x9095, 0x738e, 0x7391, 0x73ae, 0x73a2, 0x739f, 0x73cf, 0x73c2, 0x73d1, 0x73b7, 0x73b3, 0x73c0, 0x73c9, 0x73c8, 0x73e5, 0x73d9, 0x987c, 0x740a, 0x73e9, 0x73e7, 0x73de, 0x73ba, 0x73f2, 0x740f, 0x742a, 0x745b, 0x7426, 0x7425, 0x7428, 0x7430, 0x742e, 0x742c, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe840[ 192 ] = { 0x942f, 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, 0x9437, 0x9438, 0x9439, 0x943a, 0x943b, 0x943c, 0x943d, 0x943f, 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447, 0x9448, 0x9449, 0x944a, 0x944b, 0x944c, 0x944d, 0x944e, 0x944f, 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457, 0x9458, 0x9459, 0x945a, 0x945b, 0x945c, 0x945d, 0x945e, 0x945f, 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467, 0x9468, 0x9469, 0x946a, 0x946c, 0x946d, 0x946e, 0x946f, 0xfffd, 0x9470, 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477, 0x9478, 0x9479, 0x947a, 0x947b, 0x947c, 0x947d, 0x947e, 0x947f, 0x9480, 0x9481, 0x9482, 0x9483, 0x9484, 0x9491, 0x9496, 0x9498, 0x94c7, 0x94cf, 0x94d3, 0x94d4, 0x94da, 0x94e6, 0x94fb, 0x951c, 0x9520, 0x741b, 0x741a, 0x7441, 0x745c, 0x7457, 0x7455, 0x7459, 0x7477, 0x746d, 0x747e, 0x749c, 0x748e, 0x7480, 0x7481, 0x7487, 0x748b, 0x749e, 0x74a8, 0x74a9, 0x7490, 0x74a7, 0x74d2, 0x74ba, 0x97ea, 0x97eb, 0x97ec, 0x674c, 0x6753, 0x675e, 0x6748, 0x6769, 0x67a5, 0x6787, 0x676a, 0x6773, 0x6798, 0x67a7, 0x6775, 0x67a8, 0x679e, 0x67ad, 0x678b, 0x6777, 0x677c, 0x67f0, 0x6809, 0x67d8, 0x680a, 0x67e9, 0x67b0, 0x680c, 0x67d9, 0x67b5, 0x67da, 0x67b3, 0x67dd, 0x6800, 0x67c3, 0x67b8, 0x67e2, 0x680e, 0x67c1, 0x67fd, 0x6832, 0x6833, 0x6860, 0x6861, 0x684e, 0x6862, 0x6844, 0x6864, 0x6883, 0x681d, 0x6855, 0x6866, 0x6841, 0x6867, 0x6840, 0x683e, 0x684a, 0x6849, 0x6829, 0x68b5, 0x688f, 0x6874, 0x6877, 0x6893, 0x686b, 0x68c2, 0x696e, 0x68fc, 0x691f, 0x6920, 0x68f9, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe940[ 192 ] = { 0x9527, 0x9533, 0x953d, 0x9543, 0x9548, 0x954b, 0x9555, 0x955a, 0x9560, 0x956e, 0x9574, 0x9575, 0x9577, 0x9578, 0x9579, 0x957a, 0x957b, 0x957c, 0x957d, 0x957e, 0x9580, 0x9581, 0x9582, 0x9583, 0x9584, 0x9585, 0x9586, 0x9587, 0x9588, 0x9589, 0x958a, 0x958b, 0x958c, 0x958d, 0x958e, 0x958f, 0x9590, 0x9591, 0x9592, 0x9593, 0x9594, 0x9595, 0x9596, 0x9597, 0x9598, 0x9599, 0x959a, 0x959b, 0x959c, 0x959d, 0x959e, 0x959f, 0x95a0, 0x95a1, 0x95a2, 0x95a3, 0x95a4, 0x95a5, 0x95a6, 0x95a7, 0x95a8, 0x95a9, 0x95aa, 0xfffd, 0x95ab, 0x95ac, 0x95ad, 0x95ae, 0x95af, 0x95b0, 0x95b1, 0x95b2, 0x95b3, 0x95b4, 0x95b5, 0x95b6, 0x95b7, 0x95b8, 0x95b9, 0x95ba, 0x95bb, 0x95bc, 0x95bd, 0x95be, 0x95bf, 0x95c0, 0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5, 0x95c6, 0x95c7, 0x95c8, 0x95c9, 0x95ca, 0x95cb, 0x6924, 0x68f0, 0x690b, 0x6901, 0x6957, 0x68e3, 0x6910, 0x6971, 0x6939, 0x6960, 0x6942, 0x695d, 0x6984, 0x696b, 0x6980, 0x6998, 0x6978, 0x6934, 0x69cc, 0x6987, 0x6988, 0x69ce, 0x6989, 0x6966, 0x6963, 0x6979, 0x699b, 0x69a7, 0x69bb, 0x69ab, 0x69ad, 0x69d4, 0x69b1, 0x69c1, 0x69ca, 0x69df, 0x6995, 0x69e0, 0x698d, 0x69ff, 0x6a2f, 0x69ed, 0x6a17, 0x6a18, 0x6a65, 0x69f2, 0x6a44, 0x6a3e, 0x6aa0, 0x6a50, 0x6a5b, 0x6a35, 0x6a8e, 0x6a79, 0x6a3d, 0x6a28, 0x6a58, 0x6a7c, 0x6a91, 0x6a90, 0x6aa9, 0x6a97, 0x6aab, 0x7337, 0x7352, 0x6b81, 0x6b82, 0x6b87, 0x6b84, 0x6b92, 0x6b93, 0x6b8d, 0x6b9a, 0x6b9b, 0x6ba1, 0x6baa, 0x8f6b, 0x8f6d, 0x8f71, 0x8f72, 0x8f73, 0x8f75, 0x8f76, 0x8f78, 0x8f77, 0x8f79, 0x8f7a, 0x8f7c, 0x8f7e, 0x8f81, 0x8f82, 0x8f84, 0x8f87, 0x8f8b, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xea40[ 192 ] = { 0x95cc, 0x95cd, 0x95ce, 0x95cf, 0x95d0, 0x95d1, 0x95d2, 0x95d3, 0x95d4, 0x95d5, 0x95d6, 0x95d7, 0x95d8, 0x95d9, 0x95da, 0x95db, 0x95dc, 0x95dd, 0x95de, 0x95df, 0x95e0, 0x95e1, 0x95e2, 0x95e3, 0x95e4, 0x95e5, 0x95e6, 0x95e7, 0x95ec, 0x95ff, 0x9607, 0x9613, 0x9618, 0x961b, 0x961e, 0x9620, 0x9623, 0x9624, 0x9625, 0x9626, 0x9627, 0x9628, 0x9629, 0x962b, 0x962c, 0x962d, 0x962f, 0x9630, 0x9637, 0x9638, 0x9639, 0x963a, 0x963e, 0x9641, 0x9643, 0x964a, 0x964e, 0x964f, 0x9651, 0x9652, 0x9653, 0x9656, 0x9657, 0xfffd, 0x9658, 0x9659, 0x965a, 0x965c, 0x965d, 0x965e, 0x9660, 0x9663, 0x9665, 0x9666, 0x966b, 0x966d, 0x966e, 0x966f, 0x9670, 0x9671, 0x9673, 0x9678, 0x9679, 0x967a, 0x967b, 0x967c, 0x967d, 0x967e, 0x967f, 0x9680, 0x9681, 0x9682, 0x9683, 0x9684, 0x9687, 0x9689, 0x968a, 0x8f8d, 0x8f8e, 0x8f8f, 0x8f98, 0x8f9a, 0x8ece, 0x620b, 0x6217, 0x621b, 0x621f, 0x6222, 0x6221, 0x6225, 0x6224, 0x622c, 0x81e7, 0x74ef, 0x74f4, 0x74ff, 0x750f, 0x7511, 0x7513, 0x6534, 0x65ee, 0x65ef, 0x65f0, 0x660a, 0x6619, 0x6772, 0x6603, 0x6615, 0x6600, 0x7085, 0x66f7, 0x661d, 0x6634, 0x6631, 0x6636, 0x6635, 0x8006, 0x665f, 0x6654, 0x6641, 0x664f, 0x6656, 0x6661, 0x6657, 0x6677, 0x6684, 0x668c, 0x66a7, 0x669d, 0x66be, 0x66db, 0x66dc, 0x66e6, 0x66e9, 0x8d32, 0x8d33, 0x8d36, 0x8d3b, 0x8d3d, 0x8d40, 0x8d45, 0x8d46, 0x8d48, 0x8d49, 0x8d47, 0x8d4d, 0x8d55, 0x8d59, 0x89c7, 0x89ca, 0x89cb, 0x89cc, 0x89ce, 0x89cf, 0x89d0, 0x89d1, 0x726e, 0x729f, 0x725d, 0x7266, 0x726f, 0x727e, 0x727f, 0x7284, 0x728b, 0x728d, 0x728f, 0x7292, 0x6308, 0x6332, 0x63b0, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xeb40[ 192 ] = { 0x968c, 0x968e, 0x9691, 0x9692, 0x9693, 0x9695, 0x9696, 0x969a, 0x969b, 0x969d, 0x969e, 0x969f, 0x96a0, 0x96a1, 0x96a2, 0x96a3, 0x96a4, 0x96a5, 0x96a6, 0x96a8, 0x96a9, 0x96aa, 0x96ab, 0x96ac, 0x96ad, 0x96ae, 0x96af, 0x96b1, 0x96b2, 0x96b4, 0x96b5, 0x96b7, 0x96b8, 0x96ba, 0x96bb, 0x96bf, 0x96c2, 0x96c3, 0x96c8, 0x96ca, 0x96cb, 0x96d0, 0x96d1, 0x96d3, 0x96d4, 0x96d6, 0x96d7, 0x96d8, 0x96d9, 0x96da, 0x96db, 0x96dc, 0x96dd, 0x96de, 0x96df, 0x96e1, 0x96e2, 0x96e3, 0x96e4, 0x96e5, 0x96e6, 0x96e7, 0x96eb, 0xfffd, 0x96ec, 0x96ed, 0x96ee, 0x96f0, 0x96f1, 0x96f2, 0x96f4, 0x96f5, 0x96f8, 0x96fa, 0x96fb, 0x96fc, 0x96fd, 0x96ff, 0x9702, 0x9703, 0x9705, 0x970a, 0x970b, 0x970c, 0x9710, 0x9711, 0x9712, 0x9714, 0x9715, 0x9717, 0x9718, 0x9719, 0x971a, 0x971b, 0x971d, 0x971f, 0x9720, 0x643f, 0x64d8, 0x8004, 0x6bea, 0x6bf3, 0x6bfd, 0x6bf5, 0x6bf9, 0x6c05, 0x6c07, 0x6c06, 0x6c0d, 0x6c15, 0x6c18, 0x6c19, 0x6c1a, 0x6c21, 0x6c29, 0x6c24, 0x6c2a, 0x6c32, 0x6535, 0x6555, 0x656b, 0x724d, 0x7252, 0x7256, 0x7230, 0x8662, 0x5216, 0x809f, 0x809c, 0x8093, 0x80bc, 0x670a, 0x80bd, 0x80b1, 0x80ab, 0x80ad, 0x80b4, 0x80b7, 0x80e7, 0x80e8, 0x80e9, 0x80ea, 0x80db, 0x80c2, 0x80c4, 0x80d9, 0x80cd, 0x80d7, 0x6710, 0x80dd, 0x80eb, 0x80f1, 0x80f4, 0x80ed, 0x810d, 0x810e, 0x80f2, 0x80fc, 0x6715, 0x8112, 0x8c5a, 0x8136, 0x811e, 0x812c, 0x8118, 0x8132, 0x8148, 0x814c, 0x8153, 0x8174, 0x8159, 0x815a, 0x8171, 0x8160, 0x8169, 0x817c, 0x817d, 0x816d, 0x8167, 0x584d, 0x5ab5, 0x8188, 0x8182, 0x8191, 0x6ed5, 0x81a3, 0x81aa, 0x81cc, 0x6726, 0x81ca, 0x81bb, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xec40[ 192 ] = { 0x9721, 0x9722, 0x9723, 0x9724, 0x9725, 0x9726, 0x9727, 0x9728, 0x9729, 0x972b, 0x972c, 0x972e, 0x972f, 0x9731, 0x9733, 0x9734, 0x9735, 0x9736, 0x9737, 0x973a, 0x973b, 0x973c, 0x973d, 0x973f, 0x9740, 0x9741, 0x9742, 0x9743, 0x9744, 0x9745, 0x9746, 0x9747, 0x9748, 0x9749, 0x974a, 0x974b, 0x974c, 0x974d, 0x974e, 0x974f, 0x9750, 0x9751, 0x9754, 0x9755, 0x9757, 0x9758, 0x975a, 0x975c, 0x975d, 0x975f, 0x9763, 0x9764, 0x9766, 0x9767, 0x9768, 0x976a, 0x976b, 0x976c, 0x976d, 0x976e, 0x976f, 0x9770, 0x9771, 0xfffd, 0x9772, 0x9775, 0x9777, 0x9778, 0x9779, 0x977a, 0x977b, 0x977d, 0x977e, 0x977f, 0x9780, 0x9781, 0x9782, 0x9783, 0x9784, 0x9786, 0x9787, 0x9788, 0x9789, 0x978a, 0x978c, 0x978e, 0x978f, 0x9790, 0x9793, 0x9795, 0x9796, 0x9797, 0x9799, 0x979a, 0x979b, 0x979c, 0x979d, 0x81c1, 0x81a6, 0x6b24, 0x6b37, 0x6b39, 0x6b43, 0x6b46, 0x6b59, 0x98d1, 0x98d2, 0x98d3, 0x98d5, 0x98d9, 0x98da, 0x6bb3, 0x5f40, 0x6bc2, 0x89f3, 0x6590, 0x9f51, 0x6593, 0x65bc, 0x65c6, 0x65c4, 0x65c3, 0x65cc, 0x65ce, 0x65d2, 0x65d6, 0x7080, 0x709c, 0x7096, 0x709d, 0x70bb, 0x70c0, 0x70b7, 0x70ab, 0x70b1, 0x70e8, 0x70ca, 0x7110, 0x7113, 0x7116, 0x712f, 0x7131, 0x7173, 0x715c, 0x7168, 0x7145, 0x7172, 0x714a, 0x7178, 0x717a, 0x7198, 0x71b3, 0x71b5, 0x71a8, 0x71a0, 0x71e0, 0x71d4, 0x71e7, 0x71f9, 0x721d, 0x7228, 0x706c, 0x7118, 0x7166, 0x71b9, 0x623e, 0x623d, 0x6243, 0x6248, 0x6249, 0x793b, 0x7940, 0x7946, 0x7949, 0x795b, 0x795c, 0x7953, 0x795a, 0x7962, 0x7957, 0x7960, 0x796f, 0x7967, 0x797a, 0x7985, 0x798a, 0x799a, 0x79a7, 0x79b3, 0x5fd1, 0x5fd0, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xed40[ 192 ] = { 0x979e, 0x979f, 0x97a1, 0x97a2, 0x97a4, 0x97a5, 0x97a6, 0x97a7, 0x97a8, 0x97a9, 0x97aa, 0x97ac, 0x97ae, 0x97b0, 0x97b1, 0x97b3, 0x97b5, 0x97b6, 0x97b7, 0x97b8, 0x97b9, 0x97ba, 0x97bb, 0x97bc, 0x97bd, 0x97be, 0x97bf, 0x97c0, 0x97c1, 0x97c2, 0x97c3, 0x97c4, 0x97c5, 0x97c6, 0x97c7, 0x97c8, 0x97c9, 0x97ca, 0x97cb, 0x97cc, 0x97cd, 0x97ce, 0x97cf, 0x97d0, 0x97d1, 0x97d2, 0x97d3, 0x97d4, 0x97d5, 0x97d6, 0x97d7, 0x97d8, 0x97d9, 0x97da, 0x97db, 0x97dc, 0x97dd, 0x97de, 0x97df, 0x97e0, 0x97e1, 0x97e2, 0x97e3, 0xfffd, 0x97e4, 0x97e5, 0x97e8, 0x97ee, 0x97ef, 0x97f0, 0x97f1, 0x97f2, 0x97f4, 0x97f7, 0x97f8, 0x97f9, 0x97fa, 0x97fb, 0x97fc, 0x97fd, 0x97fe, 0x97ff, 0x9800, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9806, 0x9807, 0x9808, 0x9809, 0x980a, 0x980b, 0x980c, 0x980d, 0x980e, 0x603c, 0x605d, 0x605a, 0x6067, 0x6041, 0x6059, 0x6063, 0x60ab, 0x6106, 0x610d, 0x615d, 0x61a9, 0x619d, 0x61cb, 0x61d1, 0x6206, 0x8080, 0x807f, 0x6c93, 0x6cf6, 0x6dfc, 0x77f6, 0x77f8, 0x7800, 0x7809, 0x7817, 0x7818, 0x7811, 0x65ab, 0x782d, 0x781c, 0x781d, 0x7839, 0x783a, 0x783b, 0x781f, 0x783c, 0x7825, 0x782c, 0x7823, 0x7829, 0x784e, 0x786d, 0x7856, 0x7857, 0x7826, 0x7850, 0x7847, 0x784c, 0x786a, 0x789b, 0x7893, 0x789a, 0x7887, 0x789c, 0x78a1, 0x78a3, 0x78b2, 0x78b9, 0x78a5, 0x78d4, 0x78d9, 0x78c9, 0x78ec, 0x78f2, 0x7905, 0x78f4, 0x7913, 0x7924, 0x791e, 0x7934, 0x9f9b, 0x9ef9, 0x9efb, 0x9efc, 0x76f1, 0x7704, 0x770d, 0x76f9, 0x7707, 0x7708, 0x771a, 0x7722, 0x7719, 0x772d, 0x7726, 0x7735, 0x7738, 0x7750, 0x7751, 0x7747, 0x7743, 0x775a, 0x7768, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xee40[ 192 ] = { 0x980f, 0x9810, 0x9811, 0x9812, 0x9813, 0x9814, 0x9815, 0x9816, 0x9817, 0x9818, 0x9819, 0x981a, 0x981b, 0x981c, 0x981d, 0x981e, 0x981f, 0x9820, 0x9821, 0x9822, 0x9823, 0x9824, 0x9825, 0x9826, 0x9827, 0x9828, 0x9829, 0x982a, 0x982b, 0x982c, 0x982d, 0x982e, 0x982f, 0x9830, 0x9831, 0x9832, 0x9833, 0x9834, 0x9835, 0x9836, 0x9837, 0x9838, 0x9839, 0x983a, 0x983b, 0x983c, 0x983d, 0x983e, 0x983f, 0x9840, 0x9841, 0x9842, 0x9843, 0x9844, 0x9845, 0x9846, 0x9847, 0x9848, 0x9849, 0x984a, 0x984b, 0x984c, 0x984d, 0xfffd, 0x984e, 0x984f, 0x9850, 0x9851, 0x9852, 0x9853, 0x9854, 0x9855, 0x9856, 0x9857, 0x9858, 0x9859, 0x985a, 0x985b, 0x985c, 0x985d, 0x985e, 0x985f, 0x9860, 0x9861, 0x9862, 0x9863, 0x9864, 0x9865, 0x9866, 0x9867, 0x9868, 0x9869, 0x986a, 0x986b, 0x986c, 0x986d, 0x986e, 0x7762, 0x7765, 0x777f, 0x778d, 0x777d, 0x7780, 0x778c, 0x7791, 0x779f, 0x77a0, 0x77b0, 0x77b5, 0x77bd, 0x753a, 0x7540, 0x754e, 0x754b, 0x7548, 0x755b, 0x7572, 0x7579, 0x7583, 0x7f58, 0x7f61, 0x7f5f, 0x8a48, 0x7f68, 0x7f74, 0x7f71, 0x7f79, 0x7f81, 0x7f7e, 0x76cd, 0x76e5, 0x8832, 0x9485, 0x9486, 0x9487, 0x948b, 0x948a, 0x948c, 0x948d, 0x948f, 0x9490, 0x9494, 0x9497, 0x9495, 0x949a, 0x949b, 0x949c, 0x94a3, 0x94a4, 0x94ab, 0x94aa, 0x94ad, 0x94ac, 0x94af, 0x94b0, 0x94b2, 0x94b4, 0x94b6, 0x94b7, 0x94b8, 0x94b9, 0x94ba, 0x94bc, 0x94bd, 0x94bf, 0x94c4, 0x94c8, 0x94c9, 0x94ca, 0x94cb, 0x94cc, 0x94cd, 0x94ce, 0x94d0, 0x94d1, 0x94d2, 0x94d5, 0x94d6, 0x94d7, 0x94d9, 0x94d8, 0x94db, 0x94de, 0x94df, 0x94e0, 0x94e2, 0x94e4, 0x94e5, 0x94e7, 0x94e8, 0x94ea, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xef40[ 192 ] = { 0x986f, 0x9870, 0x9871, 0x9872, 0x9873, 0x9874, 0x988b, 0x988e, 0x9892, 0x9895, 0x9899, 0x98a3, 0x98a8, 0x98a9, 0x98aa, 0x98ab, 0x98ac, 0x98ad, 0x98ae, 0x98af, 0x98b0, 0x98b1, 0x98b2, 0x98b3, 0x98b4, 0x98b5, 0x98b6, 0x98b7, 0x98b8, 0x98b9, 0x98ba, 0x98bb, 0x98bc, 0x98bd, 0x98be, 0x98bf, 0x98c0, 0x98c1, 0x98c2, 0x98c3, 0x98c4, 0x98c5, 0x98c6, 0x98c7, 0x98c8, 0x98c9, 0x98ca, 0x98cb, 0x98cc, 0x98cd, 0x98cf, 0x98d0, 0x98d4, 0x98d6, 0x98d7, 0x98db, 0x98dc, 0x98dd, 0x98e0, 0x98e1, 0x98e2, 0x98e3, 0x98e4, 0xfffd, 0x98e5, 0x98e6, 0x98e9, 0x98ea, 0x98eb, 0x98ec, 0x98ed, 0x98ee, 0x98ef, 0x98f0, 0x98f1, 0x98f2, 0x98f3, 0x98f4, 0x98f5, 0x98f6, 0x98f7, 0x98f8, 0x98f9, 0x98fa, 0x98fb, 0x98fc, 0x98fd, 0x98fe, 0x98ff, 0x9900, 0x9901, 0x9902, 0x9903, 0x9904, 0x9905, 0x9906, 0x9907, 0x94e9, 0x94eb, 0x94ee, 0x94ef, 0x94f3, 0x94f4, 0x94f5, 0x94f7, 0x94f9, 0x94fc, 0x94fd, 0x94ff, 0x9503, 0x9502, 0x9506, 0x9507, 0x9509, 0x950a, 0x950d, 0x950e, 0x950f, 0x9512, 0x9513, 0x9514, 0x9515, 0x9516, 0x9518, 0x951b, 0x951d, 0x951e, 0x951f, 0x9522, 0x952a, 0x952b, 0x9529, 0x952c, 0x9531, 0x9532, 0x9534, 0x9536, 0x9537, 0x9538, 0x953c, 0x953e, 0x953f, 0x9542, 0x9535, 0x9544, 0x9545, 0x9546, 0x9549, 0x954c, 0x954e, 0x954f, 0x9552, 0x9553, 0x9554, 0x9556, 0x9557, 0x9558, 0x9559, 0x955b, 0x955e, 0x955f, 0x955d, 0x9561, 0x9562, 0x9564, 0x9565, 0x9566, 0x9567, 0x9568, 0x9569, 0x956a, 0x956b, 0x956c, 0x956f, 0x9571, 0x9572, 0x9573, 0x953a, 0x77e7, 0x77ec, 0x96c9, 0x79d5, 0x79ed, 0x79e3, 0x79eb, 0x7a06, 0x5d47, 0x7a03, 0x7a02, 0x7a1e, 0x7a14, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf040[ 192 ] = { 0x9908, 0x9909, 0x990a, 0x990b, 0x990c, 0x990e, 0x990f, 0x9911, 0x9912, 0x9913, 0x9914, 0x9915, 0x9916, 0x9917, 0x9918, 0x9919, 0x991a, 0x991b, 0x991c, 0x991d, 0x991e, 0x991f, 0x9920, 0x9921, 0x9922, 0x9923, 0x9924, 0x9925, 0x9926, 0x9927, 0x9928, 0x9929, 0x992a, 0x992b, 0x992c, 0x992d, 0x992f, 0x9930, 0x9931, 0x9932, 0x9933, 0x9934, 0x9935, 0x9936, 0x9937, 0x9938, 0x9939, 0x993a, 0x993b, 0x993c, 0x993d, 0x993e, 0x993f, 0x9940, 0x9941, 0x9942, 0x9943, 0x9944, 0x9945, 0x9946, 0x9947, 0x9948, 0x9949, 0xfffd, 0x994a, 0x994b, 0x994c, 0x994d, 0x994e, 0x994f, 0x9950, 0x9951, 0x9952, 0x9953, 0x9956, 0x9957, 0x9958, 0x9959, 0x995a, 0x995b, 0x995c, 0x995d, 0x995e, 0x995f, 0x9960, 0x9961, 0x9962, 0x9964, 0x9966, 0x9973, 0x9978, 0x9979, 0x997b, 0x997e, 0x9982, 0x9983, 0x9989, 0x7a39, 0x7a37, 0x7a51, 0x9ecf, 0x99a5, 0x7a70, 0x7688, 0x768e, 0x7693, 0x7699, 0x76a4, 0x74de, 0x74e0, 0x752c, 0x9e20, 0x9e22, 0x9e28, 0x9e29, 0x9e2a, 0x9e2b, 0x9e2c, 0x9e32, 0x9e31, 0x9e36, 0x9e38, 0x9e37, 0x9e39, 0x9e3a, 0x9e3e, 0x9e41, 0x9e42, 0x9e44, 0x9e46, 0x9e47, 0x9e48, 0x9e49, 0x9e4b, 0x9e4c, 0x9e4e, 0x9e51, 0x9e55, 0x9e57, 0x9e5a, 0x9e5b, 0x9e5c, 0x9e5e, 0x9e63, 0x9e66, 0x9e67, 0x9e68, 0x9e69, 0x9e6a, 0x9e6b, 0x9e6c, 0x9e71, 0x9e6d, 0x9e73, 0x7592, 0x7594, 0x7596, 0x75a0, 0x759d, 0x75ac, 0x75a3, 0x75b3, 0x75b4, 0x75b8, 0x75c4, 0x75b1, 0x75b0, 0x75c3, 0x75c2, 0x75d6, 0x75cd, 0x75e3, 0x75e8, 0x75e6, 0x75e4, 0x75eb, 0x75e7, 0x7603, 0x75f1, 0x75fc, 0x75ff, 0x7610, 0x7600, 0x7605, 0x760c, 0x7617, 0x760a, 0x7625, 0x7618, 0x7615, 0x7619, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf140[ 192 ] = { 0x998c, 0x998e, 0x999a, 0x999b, 0x999c, 0x999d, 0x999e, 0x999f, 0x99a0, 0x99a1, 0x99a2, 0x99a3, 0x99a4, 0x99a6, 0x99a7, 0x99a9, 0x99aa, 0x99ab, 0x99ac, 0x99ad, 0x99ae, 0x99af, 0x99b0, 0x99b1, 0x99b2, 0x99b3, 0x99b4, 0x99b5, 0x99b6, 0x99b7, 0x99b8, 0x99b9, 0x99ba, 0x99bb, 0x99bc, 0x99bd, 0x99be, 0x99bf, 0x99c0, 0x99c1, 0x99c2, 0x99c3, 0x99c4, 0x99c5, 0x99c6, 0x99c7, 0x99c8, 0x99c9, 0x99ca, 0x99cb, 0x99cc, 0x99cd, 0x99ce, 0x99cf, 0x99d0, 0x99d1, 0x99d2, 0x99d3, 0x99d4, 0x99d5, 0x99d6, 0x99d7, 0x99d8, 0xfffd, 0x99d9, 0x99da, 0x99db, 0x99dc, 0x99dd, 0x99de, 0x99df, 0x99e0, 0x99e1, 0x99e2, 0x99e3, 0x99e4, 0x99e5, 0x99e6, 0x99e7, 0x99e8, 0x99e9, 0x99ea, 0x99eb, 0x99ec, 0x99ed, 0x99ee, 0x99ef, 0x99f0, 0x99f1, 0x99f2, 0x99f3, 0x99f4, 0x99f5, 0x99f6, 0x99f7, 0x99f8, 0x99f9, 0x761b, 0x763c, 0x7622, 0x7620, 0x7640, 0x762d, 0x7630, 0x763f, 0x7635, 0x7643, 0x763e, 0x7633, 0x764d, 0x765e, 0x7654, 0x765c, 0x7656, 0x766b, 0x766f, 0x7fca, 0x7ae6, 0x7a78, 0x7a79, 0x7a80, 0x7a86, 0x7a88, 0x7a95, 0x7aa6, 0x7aa0, 0x7aac, 0x7aa8, 0x7aad, 0x7ab3, 0x8864, 0x8869, 0x8872, 0x887d, 0x887f, 0x8882, 0x88a2, 0x88c6, 0x88b7, 0x88bc, 0x88c9, 0x88e2, 0x88ce, 0x88e3, 0x88e5, 0x88f1, 0x891a, 0x88fc, 0x88e8, 0x88fe, 0x88f0, 0x8921, 0x8919, 0x8913, 0x891b, 0x890a, 0x8934, 0x892b, 0x8936, 0x8941, 0x8966, 0x897b, 0x758b, 0x80e5, 0x76b2, 0x76b4, 0x77dc, 0x8012, 0x8014, 0x8016, 0x801c, 0x8020, 0x8022, 0x8025, 0x8026, 0x8027, 0x8029, 0x8028, 0x8031, 0x800b, 0x8035, 0x8043, 0x8046, 0x804d, 0x8052, 0x8069, 0x8071, 0x8983, 0x9878, 0x9880, 0x9883, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf240[ 192 ] = { 0x99fa, 0x99fb, 0x99fc, 0x99fd, 0x99fe, 0x99ff, 0x9a00, 0x9a01, 0x9a02, 0x9a03, 0x9a04, 0x9a05, 0x9a06, 0x9a07, 0x9a08, 0x9a09, 0x9a0a, 0x9a0b, 0x9a0c, 0x9a0d, 0x9a0e, 0x9a0f, 0x9a10, 0x9a11, 0x9a12, 0x9a13, 0x9a14, 0x9a15, 0x9a16, 0x9a17, 0x9a18, 0x9a19, 0x9a1a, 0x9a1b, 0x9a1c, 0x9a1d, 0x9a1e, 0x9a1f, 0x9a20, 0x9a21, 0x9a22, 0x9a23, 0x9a24, 0x9a25, 0x9a26, 0x9a27, 0x9a28, 0x9a29, 0x9a2a, 0x9a2b, 0x9a2c, 0x9a2d, 0x9a2e, 0x9a2f, 0x9a30, 0x9a31, 0x9a32, 0x9a33, 0x9a34, 0x9a35, 0x9a36, 0x9a37, 0x9a38, 0xfffd, 0x9a39, 0x9a3a, 0x9a3b, 0x9a3c, 0x9a3d, 0x9a3e, 0x9a3f, 0x9a40, 0x9a41, 0x9a42, 0x9a43, 0x9a44, 0x9a45, 0x9a46, 0x9a47, 0x9a48, 0x9a49, 0x9a4a, 0x9a4b, 0x9a4c, 0x9a4d, 0x9a4e, 0x9a4f, 0x9a50, 0x9a51, 0x9a52, 0x9a53, 0x9a54, 0x9a55, 0x9a56, 0x9a57, 0x9a58, 0x9a59, 0x9889, 0x988c, 0x988d, 0x988f, 0x9894, 0x989a, 0x989b, 0x989e, 0x989f, 0x98a1, 0x98a2, 0x98a5, 0x98a6, 0x864d, 0x8654, 0x866c, 0x866e, 0x867f, 0x867a, 0x867c, 0x867b, 0x86a8, 0x868d, 0x868b, 0x86ac, 0x869d, 0x86a7, 0x86a3, 0x86aa, 0x8693, 0x86a9, 0x86b6, 0x86c4, 0x86b5, 0x86ce, 0x86b0, 0x86ba, 0x86b1, 0x86af, 0x86c9, 0x86cf, 0x86b4, 0x86e9, 0x86f1, 0x86f2, 0x86ed, 0x86f3, 0x86d0, 0x8713, 0x86de, 0x86f4, 0x86df, 0x86d8, 0x86d1, 0x8703, 0x8707, 0x86f8, 0x8708, 0x870a, 0x870d, 0x8709, 0x8723, 0x873b, 0x871e, 0x8725, 0x872e, 0x871a, 0x873e, 0x8748, 0x8734, 0x8731, 0x8729, 0x8737, 0x873f, 0x8782, 0x8722, 0x877d, 0x877e, 0x877b, 0x8760, 0x8770, 0x874c, 0x876e, 0x878b, 0x8753, 0x8763, 0x877c, 0x8764, 0x8759, 0x8765, 0x8793, 0x87af, 0x87a8, 0x87d2, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf340[ 192 ] = { 0x9a5a, 0x9a5b, 0x9a5c, 0x9a5d, 0x9a5e, 0x9a5f, 0x9a60, 0x9a61, 0x9a62, 0x9a63, 0x9a64, 0x9a65, 0x9a66, 0x9a67, 0x9a68, 0x9a69, 0x9a6a, 0x9a6b, 0x9a72, 0x9a83, 0x9a89, 0x9a8d, 0x9a8e, 0x9a94, 0x9a95, 0x9a99, 0x9aa6, 0x9aa9, 0x9aaa, 0x9aab, 0x9aac, 0x9aad, 0x9aae, 0x9aaf, 0x9ab2, 0x9ab3, 0x9ab4, 0x9ab5, 0x9ab9, 0x9abb, 0x9abd, 0x9abe, 0x9abf, 0x9ac3, 0x9ac4, 0x9ac6, 0x9ac7, 0x9ac8, 0x9ac9, 0x9aca, 0x9acd, 0x9ace, 0x9acf, 0x9ad0, 0x9ad2, 0x9ad4, 0x9ad5, 0x9ad6, 0x9ad7, 0x9ad9, 0x9ada, 0x9adb, 0x9adc, 0xfffd, 0x9add, 0x9ade, 0x9ae0, 0x9ae2, 0x9ae3, 0x9ae4, 0x9ae5, 0x9ae7, 0x9ae8, 0x9ae9, 0x9aea, 0x9aec, 0x9aee, 0x9af0, 0x9af1, 0x9af2, 0x9af3, 0x9af4, 0x9af5, 0x9af6, 0x9af7, 0x9af8, 0x9afa, 0x9afc, 0x9afd, 0x9afe, 0x9aff, 0x9b00, 0x9b01, 0x9b02, 0x9b04, 0x9b05, 0x9b06, 0x87c6, 0x8788, 0x8785, 0x87ad, 0x8797, 0x8783, 0x87ab, 0x87e5, 0x87ac, 0x87b5, 0x87b3, 0x87cb, 0x87d3, 0x87bd, 0x87d1, 0x87c0, 0x87ca, 0x87db, 0x87ea, 0x87e0, 0x87ee, 0x8816, 0x8813, 0x87fe, 0x880a, 0x881b, 0x8821, 0x8839, 0x883c, 0x7f36, 0x7f42, 0x7f44, 0x7f45, 0x8210, 0x7afa, 0x7afd, 0x7b08, 0x7b03, 0x7b04, 0x7b15, 0x7b0a, 0x7b2b, 0x7b0f, 0x7b47, 0x7b38, 0x7b2a, 0x7b19, 0x7b2e, 0x7b31, 0x7b20, 0x7b25, 0x7b24, 0x7b33, 0x7b3e, 0x7b1e, 0x7b58, 0x7b5a, 0x7b45, 0x7b75, 0x7b4c, 0x7b5d, 0x7b60, 0x7b6e, 0x7b7b, 0x7b62, 0x7b72, 0x7b71, 0x7b90, 0x7ba6, 0x7ba7, 0x7bb8, 0x7bac, 0x7b9d, 0x7ba8, 0x7b85, 0x7baa, 0x7b9c, 0x7ba2, 0x7bab, 0x7bb4, 0x7bd1, 0x7bc1, 0x7bcc, 0x7bdd, 0x7bda, 0x7be5, 0x7be6, 0x7bea, 0x7c0c, 0x7bfe, 0x7bfc, 0x7c0f, 0x7c16, 0x7c0b, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf440[ 192 ] = { 0x9b07, 0x9b09, 0x9b0a, 0x9b0b, 0x9b0c, 0x9b0d, 0x9b0e, 0x9b10, 0x9b11, 0x9b12, 0x9b14, 0x9b15, 0x9b16, 0x9b17, 0x9b18, 0x9b19, 0x9b1a, 0x9b1b, 0x9b1c, 0x9b1d, 0x9b1e, 0x9b20, 0x9b21, 0x9b22, 0x9b24, 0x9b25, 0x9b26, 0x9b27, 0x9b28, 0x9b29, 0x9b2a, 0x9b2b, 0x9b2c, 0x9b2d, 0x9b2e, 0x9b30, 0x9b31, 0x9b33, 0x9b34, 0x9b35, 0x9b36, 0x9b37, 0x9b38, 0x9b39, 0x9b3a, 0x9b3d, 0x9b3e, 0x9b3f, 0x9b40, 0x9b46, 0x9b4a, 0x9b4b, 0x9b4c, 0x9b4e, 0x9b50, 0x9b52, 0x9b53, 0x9b55, 0x9b56, 0x9b57, 0x9b58, 0x9b59, 0x9b5a, 0xfffd, 0x9b5b, 0x9b5c, 0x9b5d, 0x9b5e, 0x9b5f, 0x9b60, 0x9b61, 0x9b62, 0x9b63, 0x9b64, 0x9b65, 0x9b66, 0x9b67, 0x9b68, 0x9b69, 0x9b6a, 0x9b6b, 0x9b6c, 0x9b6d, 0x9b6e, 0x9b6f, 0x9b70, 0x9b71, 0x9b72, 0x9b73, 0x9b74, 0x9b75, 0x9b76, 0x9b77, 0x9b78, 0x9b79, 0x9b7a, 0x9b7b, 0x7c1f, 0x7c2a, 0x7c26, 0x7c38, 0x7c41, 0x7c40, 0x81fe, 0x8201, 0x8202, 0x8204, 0x81ec, 0x8844, 0x8221, 0x8222, 0x8223, 0x822d, 0x822f, 0x8228, 0x822b, 0x8238, 0x823b, 0x8233, 0x8234, 0x823e, 0x8244, 0x8249, 0x824b, 0x824f, 0x825a, 0x825f, 0x8268, 0x887e, 0x8885, 0x8888, 0x88d8, 0x88df, 0x895e, 0x7f9d, 0x7f9f, 0x7fa7, 0x7faf, 0x7fb0, 0x7fb2, 0x7c7c, 0x6549, 0x7c91, 0x7c9d, 0x7c9c, 0x7c9e, 0x7ca2, 0x7cb2, 0x7cbc, 0x7cbd, 0x7cc1, 0x7cc7, 0x7ccc, 0x7ccd, 0x7cc8, 0x7cc5, 0x7cd7, 0x7ce8, 0x826e, 0x66a8, 0x7fbf, 0x7fce, 0x7fd5, 0x7fe5, 0x7fe1, 0x7fe6, 0x7fe9, 0x7fee, 0x7ff3, 0x7cf8, 0x7d77, 0x7da6, 0x7dae, 0x7e47, 0x7e9b, 0x9eb8, 0x9eb4, 0x8d73, 0x8d84, 0x8d94, 0x8d91, 0x8db1, 0x8d67, 0x8d6d, 0x8c47, 0x8c49, 0x914a, 0x9150, 0x914e, 0x914f, 0x9164, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf540[ 192 ] = { 0x9b7c, 0x9b7d, 0x9b7e, 0x9b7f, 0x9b80, 0x9b81, 0x9b82, 0x9b83, 0x9b84, 0x9b85, 0x9b86, 0x9b87, 0x9b88, 0x9b89, 0x9b8a, 0x9b8b, 0x9b8c, 0x9b8d, 0x9b8e, 0x9b8f, 0x9b90, 0x9b91, 0x9b92, 0x9b93, 0x9b94, 0x9b95, 0x9b96, 0x9b97, 0x9b98, 0x9b99, 0x9b9a, 0x9b9b, 0x9b9c, 0x9b9d, 0x9b9e, 0x9b9f, 0x9ba0, 0x9ba1, 0x9ba2, 0x9ba3, 0x9ba4, 0x9ba5, 0x9ba6, 0x9ba7, 0x9ba8, 0x9ba9, 0x9baa, 0x9bab, 0x9bac, 0x9bad, 0x9bae, 0x9baf, 0x9bb0, 0x9bb1, 0x9bb2, 0x9bb3, 0x9bb4, 0x9bb5, 0x9bb6, 0x9bb7, 0x9bb8, 0x9bb9, 0x9bba, 0xfffd, 0x9bbb, 0x9bbc, 0x9bbd, 0x9bbe, 0x9bbf, 0x9bc0, 0x9bc1, 0x9bc2, 0x9bc3, 0x9bc4, 0x9bc5, 0x9bc6, 0x9bc7, 0x9bc8, 0x9bc9, 0x9bca, 0x9bcb, 0x9bcc, 0x9bcd, 0x9bce, 0x9bcf, 0x9bd0, 0x9bd1, 0x9bd2, 0x9bd3, 0x9bd4, 0x9bd5, 0x9bd6, 0x9bd7, 0x9bd8, 0x9bd9, 0x9bda, 0x9bdb, 0x9162, 0x9161, 0x9170, 0x9169, 0x916f, 0x917d, 0x917e, 0x9172, 0x9174, 0x9179, 0x918c, 0x9185, 0x9190, 0x918d, 0x9191, 0x91a2, 0x91a3, 0x91aa, 0x91ad, 0x91ae, 0x91af, 0x91b5, 0x91b4, 0x91ba, 0x8c55, 0x9e7e, 0x8db8, 0x8deb, 0x8e05, 0x8e59, 0x8e69, 0x8db5, 0x8dbf, 0x8dbc, 0x8dba, 0x8dc4, 0x8dd6, 0x8dd7, 0x8dda, 0x8dde, 0x8dce, 0x8dcf, 0x8ddb, 0x8dc6, 0x8dec, 0x8df7, 0x8df8, 0x8de3, 0x8df9, 0x8dfb, 0x8de4, 0x8e09, 0x8dfd, 0x8e14, 0x8e1d, 0x8e1f, 0x8e2c, 0x8e2e, 0x8e23, 0x8e2f, 0x8e3a, 0x8e40, 0x8e39, 0x8e35, 0x8e3d, 0x8e31, 0x8e49, 0x8e41, 0x8e42, 0x8e51, 0x8e52, 0x8e4a, 0x8e70, 0x8e76, 0x8e7c, 0x8e6f, 0x8e74, 0x8e85, 0x8e8f, 0x8e94, 0x8e90, 0x8e9c, 0x8e9e, 0x8c78, 0x8c82, 0x8c8a, 0x8c85, 0x8c98, 0x8c94, 0x659b, 0x89d6, 0x89de, 0x89da, 0x89dc, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf640[ 192 ] = { 0x9bdc, 0x9bdd, 0x9bde, 0x9bdf, 0x9be0, 0x9be1, 0x9be2, 0x9be3, 0x9be4, 0x9be5, 0x9be6, 0x9be7, 0x9be8, 0x9be9, 0x9bea, 0x9beb, 0x9bec, 0x9bed, 0x9bee, 0x9bef, 0x9bf0, 0x9bf1, 0x9bf2, 0x9bf3, 0x9bf4, 0x9bf5, 0x9bf6, 0x9bf7, 0x9bf8, 0x9bf9, 0x9bfa, 0x9bfb, 0x9bfc, 0x9bfd, 0x9bfe, 0x9bff, 0x9c00, 0x9c01, 0x9c02, 0x9c03, 0x9c04, 0x9c05, 0x9c06, 0x9c07, 0x9c08, 0x9c09, 0x9c0a, 0x9c0b, 0x9c0c, 0x9c0d, 0x9c0e, 0x9c0f, 0x9c10, 0x9c11, 0x9c12, 0x9c13, 0x9c14, 0x9c15, 0x9c16, 0x9c17, 0x9c18, 0x9c19, 0x9c1a, 0xfffd, 0x9c1b, 0x9c1c, 0x9c1d, 0x9c1e, 0x9c1f, 0x9c20, 0x9c21, 0x9c22, 0x9c23, 0x9c24, 0x9c25, 0x9c26, 0x9c27, 0x9c28, 0x9c29, 0x9c2a, 0x9c2b, 0x9c2c, 0x9c2d, 0x9c2e, 0x9c2f, 0x9c30, 0x9c31, 0x9c32, 0x9c33, 0x9c34, 0x9c35, 0x9c36, 0x9c37, 0x9c38, 0x9c39, 0x9c3a, 0x9c3b, 0x89e5, 0x89eb, 0x89ef, 0x8a3e, 0x8b26, 0x9753, 0x96e9, 0x96f3, 0x96ef, 0x9706, 0x9701, 0x9708, 0x970f, 0x970e, 0x972a, 0x972d, 0x9730, 0x973e, 0x9f80, 0x9f83, 0x9f85, 0x9f86, 0x9f87, 0x9f88, 0x9f89, 0x9f8a, 0x9f8c, 0x9efe, 0x9f0b, 0x9f0d, 0x96b9, 0x96bc, 0x96bd, 0x96ce, 0x96d2, 0x77bf, 0x96e0, 0x928e, 0x92ae, 0x92c8, 0x933e, 0x936a, 0x93ca, 0x938f, 0x943e, 0x946b, 0x9c7f, 0x9c82, 0x9c85, 0x9c86, 0x9c87, 0x9c88, 0x7a23, 0x9c8b, 0x9c8e, 0x9c90, 0x9c91, 0x9c92, 0x9c94, 0x9c95, 0x9c9a, 0x9c9b, 0x9c9e, 0x9c9f, 0x9ca0, 0x9ca1, 0x9ca2, 0x9ca3, 0x9ca5, 0x9ca6, 0x9ca7, 0x9ca8, 0x9ca9, 0x9cab, 0x9cad, 0x9cae, 0x9cb0, 0x9cb1, 0x9cb2, 0x9cb3, 0x9cb4, 0x9cb5, 0x9cb6, 0x9cb7, 0x9cba, 0x9cbb, 0x9cbc, 0x9cbd, 0x9cc4, 0x9cc5, 0x9cc6, 0x9cc7, 0x9cca, 0x9ccb, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf740[ 192 ] = { 0x9c3c, 0x9c3d, 0x9c3e, 0x9c3f, 0x9c40, 0x9c41, 0x9c42, 0x9c43, 0x9c44, 0x9c45, 0x9c46, 0x9c47, 0x9c48, 0x9c49, 0x9c4a, 0x9c4b, 0x9c4c, 0x9c4d, 0x9c4e, 0x9c4f, 0x9c50, 0x9c51, 0x9c52, 0x9c53, 0x9c54, 0x9c55, 0x9c56, 0x9c57, 0x9c58, 0x9c59, 0x9c5a, 0x9c5b, 0x9c5c, 0x9c5d, 0x9c5e, 0x9c5f, 0x9c60, 0x9c61, 0x9c62, 0x9c63, 0x9c64, 0x9c65, 0x9c66, 0x9c67, 0x9c68, 0x9c69, 0x9c6a, 0x9c6b, 0x9c6c, 0x9c6d, 0x9c6e, 0x9c6f, 0x9c70, 0x9c71, 0x9c72, 0x9c73, 0x9c74, 0x9c75, 0x9c76, 0x9c77, 0x9c78, 0x9c79, 0x9c7a, 0xfffd, 0x9c7b, 0x9c7d, 0x9c7e, 0x9c80, 0x9c83, 0x9c84, 0x9c89, 0x9c8a, 0x9c8c, 0x9c8f, 0x9c93, 0x9c96, 0x9c97, 0x9c98, 0x9c99, 0x9c9d, 0x9caa, 0x9cac, 0x9caf, 0x9cb9, 0x9cbe, 0x9cbf, 0x9cc0, 0x9cc1, 0x9cc2, 0x9cc8, 0x9cc9, 0x9cd1, 0x9cd2, 0x9cda, 0x9cdb, 0x9ce0, 0x9ce1, 0x9ccc, 0x9ccd, 0x9cce, 0x9ccf, 0x9cd0, 0x9cd3, 0x9cd4, 0x9cd5, 0x9cd7, 0x9cd8, 0x9cd9, 0x9cdc, 0x9cdd, 0x9cdf, 0x9ce2, 0x977c, 0x9785, 0x9791, 0x9792, 0x9794, 0x97af, 0x97ab, 0x97a3, 0x97b2, 0x97b4, 0x9ab1, 0x9ab0, 0x9ab7, 0x9e58, 0x9ab6, 0x9aba, 0x9abc, 0x9ac1, 0x9ac0, 0x9ac5, 0x9ac2, 0x9acb, 0x9acc, 0x9ad1, 0x9b45, 0x9b43, 0x9b47, 0x9b49, 0x9b48, 0x9b4d, 0x9b51, 0x98e8, 0x990d, 0x992e, 0x9955, 0x9954, 0x9adf, 0x9ae1, 0x9ae6, 0x9aef, 0x9aeb, 0x9afb, 0x9aed, 0x9af9, 0x9b08, 0x9b0f, 0x9b13, 0x9b1f, 0x9b23, 0x9ebd, 0x9ebe, 0x7e3b, 0x9e82, 0x9e87, 0x9e88, 0x9e8b, 0x9e92, 0x93d6, 0x9e9d, 0x9e9f, 0x9edb, 0x9edc, 0x9edd, 0x9ee0, 0x9edf, 0x9ee2, 0x9ee9, 0x9ee7, 0x9ee5, 0x9eea, 0x9eef, 0x9f22, 0x9f2c, 0x9f2f, 0x9f39, 0x9f37, 0x9f3d, 0x9f3e, 0x9f44, 0xfffd }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf840[ 96 ] = { 0x9ce3, 0x9ce4, 0x9ce5, 0x9ce6, 0x9ce7, 0x9ce8, 0x9ce9, 0x9cea, 0x9ceb, 0x9cec, 0x9ced, 0x9cee, 0x9cef, 0x9cf0, 0x9cf1, 0x9cf2, 0x9cf3, 0x9cf4, 0x9cf5, 0x9cf6, 0x9cf7, 0x9cf8, 0x9cf9, 0x9cfa, 0x9cfb, 0x9cfc, 0x9cfd, 0x9cfe, 0x9cff, 0x9d00, 0x9d01, 0x9d02, 0x9d03, 0x9d04, 0x9d05, 0x9d06, 0x9d07, 0x9d08, 0x9d09, 0x9d0a, 0x9d0b, 0x9d0c, 0x9d0d, 0x9d0e, 0x9d0f, 0x9d10, 0x9d11, 0x9d12, 0x9d13, 0x9d14, 0x9d15, 0x9d16, 0x9d17, 0x9d18, 0x9d19, 0x9d1a, 0x9d1b, 0x9d1c, 0x9d1d, 0x9d1e, 0x9d1f, 0x9d20, 0x9d21, 0xfffd, 0x9d22, 0x9d23, 0x9d24, 0x9d25, 0x9d26, 0x9d27, 0x9d28, 0x9d29, 0x9d2a, 0x9d2b, 0x9d2c, 0x9d2d, 0x9d2e, 0x9d2f, 0x9d30, 0x9d31, 0x9d32, 0x9d33, 0x9d34, 0x9d35, 0x9d36, 0x9d37, 0x9d38, 0x9d39, 0x9d3a, 0x9d3b, 0x9d3c, 0x9d3d, 0x9d3e, 0x9d3f, 0x9d40, 0x9d41 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf940[ 96 ] = { 0x9d43, 0x9d44, 0x9d45, 0x9d46, 0x9d47, 0x9d48, 0x9d49, 0x9d4a, 0x9d4b, 0x9d4c, 0x9d4d, 0x9d4e, 0x9d4f, 0x9d50, 0x9d51, 0x9d52, 0x9d53, 0x9d54, 0x9d55, 0x9d56, 0x9d57, 0x9d58, 0x9d59, 0x9d5a, 0x9d5b, 0x9d5c, 0x9d5d, 0x9d5e, 0x9d5f, 0x9d60, 0x9d61, 0x9d62, 0x9d63, 0x9d64, 0x9d65, 0x9d66, 0x9d67, 0x9d68, 0x9d69, 0x9d6a, 0x9d6b, 0x9d6c, 0x9d6d, 0x9d6e, 0x9d6f, 0x9d70, 0x9d71, 0x9d72, 0x9d73, 0x9d74, 0x9d75, 0x9d76, 0x9d77, 0x9d78, 0x9d79, 0x9d7a, 0x9d7b, 0x9d7c, 0x9d7d, 0x9d7e, 0x9d7f, 0x9d80, 0x9d81, 0xfffd, 0x9d82, 0x9d83, 0x9d84, 0x9d85, 0x9d86, 0x9d87, 0x9d88, 0x9d89, 0x9d8a, 0x9d8b, 0x9d8c, 0x9d8d, 0x9d8e, 0x9d8f, 0x9d90, 0x9d91, 0x9d92, 0x9d93, 0x9d94, 0x9d95, 0x9d96, 0x9d97, 0x9d98, 0x9d99, 0x9d9a, 0x9d9b, 0x9d9c, 0x9d9d, 0x9d9e, 0x9d9f, 0x9da0, 0x9da1 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfa40[ 96 ] = { 0x9da3, 0x9da4, 0x9da5, 0x9da6, 0x9da7, 0x9da8, 0x9da9, 0x9daa, 0x9dab, 0x9dac, 0x9dad, 0x9dae, 0x9daf, 0x9db0, 0x9db1, 0x9db2, 0x9db3, 0x9db4, 0x9db5, 0x9db6, 0x9db7, 0x9db8, 0x9db9, 0x9dba, 0x9dbb, 0x9dbc, 0x9dbd, 0x9dbe, 0x9dbf, 0x9dc0, 0x9dc1, 0x9dc2, 0x9dc3, 0x9dc4, 0x9dc5, 0x9dc6, 0x9dc7, 0x9dc8, 0x9dc9, 0x9dca, 0x9dcb, 0x9dcc, 0x9dcd, 0x9dce, 0x9dcf, 0x9dd0, 0x9dd1, 0x9dd2, 0x9dd3, 0x9dd4, 0x9dd5, 0x9dd6, 0x9dd7, 0x9dd8, 0x9dd9, 0x9dda, 0x9ddb, 0x9ddc, 0x9ddd, 0x9dde, 0x9ddf, 0x9de0, 0x9de1, 0xfffd, 0x9de2, 0x9de3, 0x9de4, 0x9de5, 0x9de6, 0x9de7, 0x9de8, 0x9de9, 0x9dea, 0x9deb, 0x9dec, 0x9ded, 0x9dee, 0x9def, 0x9df0, 0x9df1, 0x9df2, 0x9df3, 0x9df4, 0x9df5, 0x9df6, 0x9df7, 0x9df8, 0x9df9, 0x9dfa, 0x9dfb, 0x9dfc, 0x9dfd, 0x9dfe, 0x9dff, 0x9e00, 0x9e01 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfb40[ 96 ] = { 0x9e03, 0x9e04, 0x9e05, 0x9e06, 0x9e07, 0x9e08, 0x9e09, 0x9e0a, 0x9e0b, 0x9e0c, 0x9e0d, 0x9e0e, 0x9e0f, 0x9e10, 0x9e11, 0x9e12, 0x9e13, 0x9e14, 0x9e15, 0x9e16, 0x9e17, 0x9e18, 0x9e19, 0x9e1a, 0x9e1b, 0x9e1c, 0x9e1d, 0x9e1e, 0x9e24, 0x9e27, 0x9e2e, 0x9e30, 0x9e34, 0x9e3b, 0x9e3c, 0x9e40, 0x9e4d, 0x9e50, 0x9e52, 0x9e53, 0x9e54, 0x9e56, 0x9e59, 0x9e5d, 0x9e5f, 0x9e60, 0x9e61, 0x9e62, 0x9e65, 0x9e6e, 0x9e6f, 0x9e72, 0x9e74, 0x9e75, 0x9e76, 0x9e77, 0x9e78, 0x9e79, 0x9e7a, 0x9e7b, 0x9e7c, 0x9e7d, 0x9e80, 0xfffd, 0x9e81, 0x9e83, 0x9e84, 0x9e85, 0x9e86, 0x9e89, 0x9e8a, 0x9e8c, 0x9e8d, 0x9e8e, 0x9e8f, 0x9e90, 0x9e91, 0x9e94, 0x9e95, 0x9e96, 0x9e97, 0x9e98, 0x9e99, 0x9e9a, 0x9e9b, 0x9e9c, 0x9e9e, 0x9ea0, 0x9ea1, 0x9ea2, 0x9ea3, 0x9ea4, 0x9ea5, 0x9ea7, 0x9ea8, 0x9ea9 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfc40[ 96 ] = { 0x9eab, 0x9eac, 0x9ead, 0x9eae, 0x9eaf, 0x9eb0, 0x9eb1, 0x9eb2, 0x9eb3, 0x9eb5, 0x9eb6, 0x9eb7, 0x9eb9, 0x9eba, 0x9ebc, 0x9ebf, 0x9ec0, 0x9ec1, 0x9ec2, 0x9ec3, 0x9ec5, 0x9ec6, 0x9ec7, 0x9ec8, 0x9eca, 0x9ecb, 0x9ecc, 0x9ed0, 0x9ed2, 0x9ed3, 0x9ed5, 0x9ed6, 0x9ed7, 0x9ed9, 0x9eda, 0x9ede, 0x9ee1, 0x9ee3, 0x9ee4, 0x9ee6, 0x9ee8, 0x9eeb, 0x9eec, 0x9eed, 0x9eee, 0x9ef0, 0x9ef1, 0x9ef2, 0x9ef3, 0x9ef4, 0x9ef5, 0x9ef6, 0x9ef7, 0x9ef8, 0x9efa, 0x9efd, 0x9eff, 0x9f00, 0x9f01, 0x9f02, 0x9f03, 0x9f04, 0x9f05, 0xfffd, 0x9f06, 0x9f07, 0x9f08, 0x9f09, 0x9f0a, 0x9f0c, 0x9f0f, 0x9f11, 0x9f12, 0x9f14, 0x9f15, 0x9f16, 0x9f18, 0x9f1a, 0x9f1b, 0x9f1c, 0x9f1d, 0x9f1e, 0x9f1f, 0x9f21, 0x9f23, 0x9f24, 0x9f25, 0x9f26, 0x9f27, 0x9f28, 0x9f29, 0x9f2a, 0x9f2b, 0x9f2d, 0x9f2e, 0x9f30 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfd40[ 96 ] = { 0x9f32, 0x9f33, 0x9f34, 0x9f35, 0x9f36, 0x9f38, 0x9f3a, 0x9f3c, 0x9f3f, 0x9f40, 0x9f41, 0x9f42, 0x9f43, 0x9f45, 0x9f46, 0x9f47, 0x9f48, 0x9f49, 0x9f4a, 0x9f4b, 0x9f4c, 0x9f4d, 0x9f4e, 0x9f4f, 0x9f52, 0x9f53, 0x9f54, 0x9f55, 0x9f56, 0x9f57, 0x9f58, 0x9f59, 0x9f5a, 0x9f5b, 0x9f5c, 0x9f5d, 0x9f5e, 0x9f5f, 0x9f60, 0x9f61, 0x9f62, 0x9f63, 0x9f64, 0x9f65, 0x9f66, 0x9f67, 0x9f68, 0x9f69, 0x9f6a, 0x9f6b, 0x9f6c, 0x9f6d, 0x9f6e, 0x9f6f, 0x9f70, 0x9f71, 0x9f72, 0x9f73, 0x9f74, 0x9f75, 0x9f76, 0x9f77, 0x9f78, 0xfffd, 0x9f79, 0x9f7a, 0x9f7b, 0x9f7c, 0x9f7d, 0x9f7e, 0x9f81, 0x9f82, 0x9f8d, 0x9f8e, 0x9f8f, 0x9f90, 0x9f91, 0x9f92, 0x9f93, 0x9f94, 0x9f95, 0x9f96, 0x9f97, 0x9f98, 0x9f9c, 0x9f9d, 0x9f9e, 0x9fa1, 0x9fa2, 0x9fa3, 0x9fa4, 0x9fa5, 0xf92c, 0xf979, 0xf995, 0xf9e7 }; const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfe40[ 16 ] = { 0xfa0c, 0xfa0d, 0xfa0e, 0xfa0f, 0xfa11, 0xfa13, 0xfa14, 0xfa18, 0xfa1f, 0xfa20, 0xfa21, 0xfa23, 0xfa24, 0xfa27, 0xfa28, 0xfa29 }; /* Unicode to ASCII character lookup table for Windows 936 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0x0080[ 1024 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8a1, 0x001a, 0x001a, 0xeca1, 0xa7a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3a1, 0xc0a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a8, 0xa2a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8a8, 0xa6a8, 0xbaa8, 0x001a, 0xaca8, 0xaaa8, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0a8, 0xaea8, 0x001a, 0x001a, 0x001a, 0xc2a1, 0x001a, 0xb4a8, 0xb2a8, 0x001a, 0xb9a8, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa9a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbda8, 0x001a, 0x001a, 0x001a, 0xbea8, 0x001a, 0x001a, 0x001a, 0x001a, 0xada8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3a8, 0x001a, 0xaba8, 0x001a, 0xafa8, 0x001a, 0xb3a8, 0x001a, 0xb5a8, 0x001a, 0xb6a8, 0x001a, 0xb7a8, 0x001a, 0xb8a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbba8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6a1, 0x001a, 0xa5a1, 0x40a8, 0x41a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x42a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a6, 0xa2a6, 0xa3a6, 0xa4a6, 0xa5a6, 0xa6a6, 0xa7a6, 0xa8a6, 0xa9a6, 0xaaa6, 0xaba6, 0xaca6, 0xada6, 0xaea6, 0xafa6, 0xb0a6, 0xb1a6, 0x001a, 0xb2a6, 0xb3a6, 0xb4a6, 0xb5a6, 0xb6a6, 0xb7a6, 0xb8a6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1a6, 0xc2a6, 0xc3a6, 0xc4a6, 0xc5a6, 0xc6a6, 0xc7a6, 0xc8a6, 0xc9a6, 0xcaa6, 0xcba6, 0xcca6, 0xcda6, 0xcea6, 0xcfa6, 0xd0a6, 0xd1a6, 0x001a, 0xd2a6, 0xd3a6, 0xd4a6, 0xd5a6, 0xd6a6, 0xd7a6, 0xd8a6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a7, 0xa2a7, 0xa3a7, 0xa4a7, 0xa5a7, 0xa6a7, 0xa8a7, 0xa9a7, 0xaaa7, 0xaba7, 0xaca7, 0xada7, 0xaea7, 0xafa7, 0xb0a7, 0xb1a7, 0xb2a7, 0xb3a7, 0xb4a7, 0xb5a7, 0xb6a7, 0xb7a7, 0xb8a7, 0xb9a7, 0xbaa7, 0xbba7, 0xbca7, 0xbda7, 0xbea7, 0xbfa7, 0xc0a7, 0xc1a7, 0xd1a7, 0xd2a7, 0xd3a7, 0xd4a7, 0xd5a7, 0xd6a7, 0xd8a7, 0xd9a7, 0xdaa7, 0xdba7, 0xdca7, 0xdda7, 0xdea7, 0xdfa7, 0xe0a7, 0xe1a7, 0xe2a7, 0xe3a7, 0xe4a7, 0xe5a7, 0xe6a7, 0xe7a7, 0xe8a7, 0xe9a7, 0xeaa7, 0xeba7, 0xeca7, 0xeda7, 0xeea7, 0xefa7, 0xf0a7, 0xf1a7, 0x001a, 0xd7a7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0x2000[ 832 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ca9, 0x001a, 0x001a, 0x43a8, 0xaaa1, 0x44a8, 0xaca1, 0x001a, 0xaea1, 0xafa1, 0x001a, 0x001a, 0xb0a1, 0xb1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x45a8, 0xada1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeba1, 0x001a, 0xe4a1, 0xe5a1, 0x001a, 0x46a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x0080, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6a1, 0x001a, 0x47a8, 0x001a, 0x001a, 0x001a, 0x48a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeda1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x59a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1a2, 0xf2a2, 0xf3a2, 0xf4a2, 0xf5a2, 0xf6a2, 0xf7a2, 0xf8a2, 0xf9a2, 0xfaa2, 0xfba2, 0xfca2, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a2, 0xa2a2, 0xa3a2, 0xa4a2, 0xa5a2, 0xa6a2, 0xa7a2, 0xa8a2, 0xa9a2, 0xaaa2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfba1, 0xfca1, 0xfaa1, 0xfda1, 0x001a, 0x001a, 0x49a8, 0x4aa8, 0x4ba8, 0x4ca8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcaa1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7a1, 0x001a, 0xc6a1, 0x001a, 0x001a, 0x001a, 0x4da8, 0x001a, 0x001a, 0x001a, 0x001a, 0xcca1, 0x001a, 0x001a, 0xd8a1, 0xdea1, 0x4ea8, 0xcfa1, 0x001a, 0x001a, 0x4fa8, 0x001a, 0xcea1, 0x001a, 0xc4a1, 0xc5a1, 0xc9a1, 0xc8a1, 0xd2a1, 0x001a, 0x001a, 0xd3a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0a1, 0xdfa1, 0xc3a1, 0xcba1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6a1, 0x001a, 0x001a, 0x001a, 0xd5a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9a1, 0xd4a1, 0x001a, 0x001a, 0xdca1, 0xdda1, 0x51a8, 0x52a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdaa1, 0xdba1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x92a8, 0x001a, 0x001a, 0x001a, 0xd1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcda1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x53a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0x2440[ 576 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9a2, 0xdaa2, 0xdba2, 0xdca2, 0xdda2, 0xdea2, 0xdfa2, 0xe0a2, 0xe1a2, 0xe2a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5a2, 0xc6a2, 0xc7a2, 0xc8a2, 0xc9a2, 0xcaa2, 0xcba2, 0xcca2, 0xcda2, 0xcea2, 0xcfa2, 0xd0a2, 0xd1a2, 0xd2a2, 0xd3a2, 0xd4a2, 0xd5a2, 0xd6a2, 0xd7a2, 0xd8a2, 0xb1a2, 0xb2a2, 0xb3a2, 0xb4a2, 0xb5a2, 0xb6a2, 0xb7a2, 0xb8a2, 0xb9a2, 0xbaa2, 0xbba2, 0xbca2, 0xbda2, 0xbea2, 0xbfa2, 0xc0a2, 0xc1a2, 0xc2a2, 0xc3a2, 0xc4a2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4a9, 0xa5a9, 0xa6a9, 0xa7a9, 0xa8a9, 0xa9a9, 0xaaa9, 0xaba9, 0xaca9, 0xada9, 0xaea9, 0xafa9, 0xb0a9, 0xb1a9, 0xb2a9, 0xb3a9, 0xb4a9, 0xb5a9, 0xb6a9, 0xb7a9, 0xb8a9, 0xb9a9, 0xbaa9, 0xbba9, 0xbca9, 0xbda9, 0xbea9, 0xbfa9, 0xc0a9, 0xc1a9, 0xc2a9, 0xc3a9, 0xc4a9, 0xc5a9, 0xc6a9, 0xc7a9, 0xc8a9, 0xc9a9, 0xcaa9, 0xcba9, 0xcca9, 0xcda9, 0xcea9, 0xcfa9, 0xd0a9, 0xd1a9, 0xd2a9, 0xd3a9, 0xd4a9, 0xd5a9, 0xd6a9, 0xd7a9, 0xd8a9, 0xd9a9, 0xdaa9, 0xdba9, 0xdca9, 0xdda9, 0xdea9, 0xdfa9, 0xe0a9, 0xe1a9, 0xe2a9, 0xe3a9, 0xe4a9, 0xe5a9, 0xe6a9, 0xe7a9, 0xe8a9, 0xe9a9, 0xeaa9, 0xeba9, 0xeca9, 0xeda9, 0xeea9, 0xefa9, 0x001a, 0x001a, 0x001a, 0x001a, 0x54a8, 0x55a8, 0x56a8, 0x57a8, 0x58a8, 0x59a8, 0x5aa8, 0x5ba8, 0x5ca8, 0x5da8, 0x5ea8, 0x5fa8, 0x60a8, 0x61a8, 0x62a8, 0x63a8, 0x64a8, 0x65a8, 0x66a8, 0x67a8, 0x68a8, 0x69a8, 0x6aa8, 0x6ba8, 0x6ca8, 0x6da8, 0x6ea8, 0x6fa8, 0x70a8, 0x71a8, 0x72a8, 0x73a8, 0x74a8, 0x75a8, 0x76a8, 0x77a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x78a8, 0x79a8, 0x7aa8, 0x7ba8, 0x7ca8, 0x7da8, 0x7ea8, 0x80a8, 0x81a8, 0x82a8, 0x83a8, 0x84a8, 0x85a8, 0x86a8, 0x87a8, 0x001a, 0x001a, 0x001a, 0x88a8, 0x89a8, 0x8aa8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6a1, 0xf5a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8a1, 0xf7a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8ba8, 0x8ca8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4a1, 0xf3a1, 0x001a, 0x001a, 0x001a, 0xf0a1, 0x001a, 0x001a, 0xf2a1, 0xf1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8da8, 0x8ea8, 0x8fa8, 0x90a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefa1, 0xeea1, 0x001a, 0x001a, 0x91a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2a1, 0x001a, 0xe1a1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0x3000[ 1024 ] = { 0xa1a1, 0xa2a1, 0xa3a1, 0xa8a1, 0x001a, 0xa9a1, 0x65a9, 0x96a9, 0xb4a1, 0xb5a1, 0xb6a1, 0xb7a1, 0xb8a1, 0xb9a1, 0xbaa1, 0xbba1, 0xbea1, 0xbfa1, 0x93a8, 0xfea1, 0xb2a1, 0xb3a1, 0xbca1, 0xbda1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x94a8, 0x95a8, 0x001a, 0x001a, 0x40a9, 0x41a9, 0x42a9, 0x43a9, 0x44a9, 0x45a9, 0x46a9, 0x47a9, 0x48a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a4, 0xa2a4, 0xa3a4, 0xa4a4, 0xa5a4, 0xa6a4, 0xa7a4, 0xa8a4, 0xa9a4, 0xaaa4, 0xaba4, 0xaca4, 0xada4, 0xaea4, 0xafa4, 0xb0a4, 0xb1a4, 0xb2a4, 0xb3a4, 0xb4a4, 0xb5a4, 0xb6a4, 0xb7a4, 0xb8a4, 0xb9a4, 0xbaa4, 0xbba4, 0xbca4, 0xbda4, 0xbea4, 0xbfa4, 0xc0a4, 0xc1a4, 0xc2a4, 0xc3a4, 0xc4a4, 0xc5a4, 0xc6a4, 0xc7a4, 0xc8a4, 0xc9a4, 0xcaa4, 0xcba4, 0xcca4, 0xcda4, 0xcea4, 0xcfa4, 0xd0a4, 0xd1a4, 0xd2a4, 0xd3a4, 0xd4a4, 0xd5a4, 0xd6a4, 0xd7a4, 0xd8a4, 0xd9a4, 0xdaa4, 0xdba4, 0xdca4, 0xdda4, 0xdea4, 0xdfa4, 0xe0a4, 0xe1a4, 0xe2a4, 0xe3a4, 0xe4a4, 0xe5a4, 0xe6a4, 0xe7a4, 0xe8a4, 0xe9a4, 0xeaa4, 0xeba4, 0xeca4, 0xeda4, 0xeea4, 0xefa4, 0xf0a4, 0xf1a4, 0xf2a4, 0xf3a4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x61a9, 0x62a9, 0x66a9, 0x67a9, 0x001a, 0x001a, 0xa1a5, 0xa2a5, 0xa3a5, 0xa4a5, 0xa5a5, 0xa6a5, 0xa7a5, 0xa8a5, 0xa9a5, 0xaaa5, 0xaba5, 0xaca5, 0xada5, 0xaea5, 0xafa5, 0xb0a5, 0xb1a5, 0xb2a5, 0xb3a5, 0xb4a5, 0xb5a5, 0xb6a5, 0xb7a5, 0xb8a5, 0xb9a5, 0xbaa5, 0xbba5, 0xbca5, 0xbda5, 0xbea5, 0xbfa5, 0xc0a5, 0xc1a5, 0xc2a5, 0xc3a5, 0xc4a5, 0xc5a5, 0xc6a5, 0xc7a5, 0xc8a5, 0xc9a5, 0xcaa5, 0xcba5, 0xcca5, 0xcda5, 0xcea5, 0xcfa5, 0xd0a5, 0xd1a5, 0xd2a5, 0xd3a5, 0xd4a5, 0xd5a5, 0xd6a5, 0xd7a5, 0xd8a5, 0xd9a5, 0xdaa5, 0xdba5, 0xdca5, 0xdda5, 0xdea5, 0xdfa5, 0xe0a5, 0xe1a5, 0xe2a5, 0xe3a5, 0xe4a5, 0xe5a5, 0xe6a5, 0xe7a5, 0xe8a5, 0xe9a5, 0xeaa5, 0xeba5, 0xeca5, 0xeda5, 0xeea5, 0xefa5, 0xf0a5, 0xf1a5, 0xf2a5, 0xf3a5, 0xf4a5, 0xf5a5, 0xf6a5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x60a9, 0x63a9, 0x64a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5a8, 0xc6a8, 0xc7a8, 0xc8a8, 0xc9a8, 0xcaa8, 0xcba8, 0xcca8, 0xcda8, 0xcea8, 0xcfa8, 0xd0a8, 0xd1a8, 0xd2a8, 0xd3a8, 0xd4a8, 0xd5a8, 0xd6a8, 0xd7a8, 0xd8a8, 0xd9a8, 0xdaa8, 0xdba8, 0xdca8, 0xdda8, 0xdea8, 0xdfa8, 0xe0a8, 0xe1a8, 0xe2a8, 0xe3a8, 0xe4a8, 0xe5a8, 0xe6a8, 0xe7a8, 0xe8a8, 0xe9a8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5a2, 0xe6a2, 0xe7a2, 0xe8a2, 0xe9a2, 0xeaa2, 0xeba2, 0xeca2, 0xeda2, 0xeea2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5aa9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x49a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4aa9, 0x4ba9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ca9, 0x4da9, 0x4ea9, 0x001a, 0x001a, 0x4fa9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x51a9, 0x001a, 0x001a, 0x52a9, 0x53a9, 0x001a, 0x001a, 0x54a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0x4e00[ 20902 ] = { 0xbbd2, 0xa1b6, 0x4081, 0xdfc6, 0x4181, 0x4281, 0x4381, 0xf2cd, 0xc9d5, 0xfdc8, 0xcfc9, 0xc2cf, 0xa2d8, 0xbbb2, 0xebd3, 0x4481, 0xa4d8, 0xf3b3, 0x4581, 0xa8d7, 0xd2c7, 0xa7d8, 0xc0ca, 0x4681, 0xf0c7, 0xfbb1, 0xb5d2, 0xd4b4, 0xabb6, 0xbfcb, 0xa9d8, 0x4781, 0x4881, 0x4981, 0xaab6, 0x4a81, 0xbdc1, 0xcfd1, 0x4b81, 0xa5c9, 0xadd8, 0x4c81, 0xf6b8, 0xbed1, 0xdce3, 0xd0d6, 0x4d81, 0x4e81, 0xe1b7, 0x4f81, 0xaeb4, 0x5081, 0xd9c1, 0x5181, 0xbcd8, 0x5281, 0xe8cd, 0xa4b5, 0xaace, 0xf7d6, 0x5381, 0xf6c0, 0xd9be, 0xafd8, 0x5481, 0x5581, 0x5681, 0xcbc4, 0x5781, 0xc3be, 0x5881, 0xb1d8, 0xb4c3, 0xe5d2, 0x5981, 0xaed6, 0xdace, 0xa7d5, 0xf5ba, 0xa6b7, 0xd6c0, 0x5a81, 0xb9c6, 0xd2c5, 0xc7c7, 0x5b81, 0xd4b9, 0x5c81, 0xcbb3, 0xd2d2, 0x5d81, 0x5e81, 0xbfd8, 0xc5be, 0xf2c6, 0xb2d2, 0xb0cf, 0xe7cf, 0x5f81, 0x6081, 0x6181, 0x6281, 0xe9ca, 0x6381, 0x6481, 0xc0d8, 0x6581, 0x6681, 0x6781, 0x6881, 0x6981, 0x6a81, 0xf2c2, 0xd2c2, 0x6b81, 0xe9c8, 0x6c81, 0x6d81, 0x6e81, 0x6f81, 0x7081, 0x7181, 0x7281, 0x7381, 0x7481, 0x7581, 0xacc7, 0x7681, 0x7781, 0x7881, 0x7981, 0x7a81, 0x7b81, 0x7c81, 0xcbc1, 0x7d81, 0xe8d3, 0xf9d5, 0x7e81, 0xc2ca, 0xfeb6, 0xa1d8, 0xdad3, 0xf7bf, 0x8081, 0xc6d4, 0xa5bb, 0xc1d8, 0xe5ce, 0xaebe, 0x8181, 0x8281, 0xa8d8, 0x8381, 0xc7d1, 0xa9d0, 0x8481, 0x8581, 0x8681, 0xbdd8, 0xefd9, 0xf6cd, 0xbabf, 0x8781, 0xbbbd, 0xa5ba, 0xe0d2, 0xfab2, 0xe0ba, 0xb6c4, 0x8881, 0xedcf, 0xa9be, 0xa4cd, 0xc1c1, 0x8981, 0x8a81, 0x8b81, 0xd7c7, 0xf1d9, 0x8c81, 0xf4d9, 0x8d81, 0x8e81, 0x8f81, 0x9081, 0xcbc8, 0xe9d8, 0x9181, 0x9281, 0x9381, 0xdad2, 0xb2ca, 0xcac8, 0xecd8, 0xead8, 0xc6d8, 0xf6bd, 0xcdc6, 0xf0b3, 0x9481, 0xebd8, 0xf1bd, 0xe9bd, 0x9581, 0xd4c8, 0xd3b4, 0x9681, 0x9781, 0xd8c2, 0x9881, 0xd6b2, 0xd0d7, 0xcbca, 0xfbcb, 0xccd5, 0xb6b8, 0xc9cf, 0x9981, 0x9a81, 0x9b81, 0xdad9, 0xf0d8, 0xaac7, 0x9c81, 0xeed8, 0x9d81, 0xfab4, 0xeec1, 0xd4d2, 0x9e81, 0x9f81, 0xedd8, 0xa081, 0xc7d2, 0xefd8, 0xc7c3, 0xa181, 0xa281, 0xa381, 0xf6d1, 0xa481, 0xd9d6, 0xf2d8, 0xa581, 0xf5d8, 0xfebc, 0xdbbc, 0xa681, 0xa781, 0xa881, 0xcec8, 0xa981, 0xddb7, 0xaa81, 0xc2b7, 0xab81, 0xf3c6, 0xac81, 0xad81, 0xae81, 0xaf81, 0xb081, 0xb181, 0xb281, 0xf8d8, 0xc1d2, 0xb381, 0xb481, 0xe9ce, 0xbfbc, 0xfcb7, 0xa5b7, 0xddd0, 0xb581, 0xb681, 0xb781, 0xb881, 0xb981, 0xdad6, 0xc5d3, 0xefbb, 0xe1bb, 0xf1d8, 0xba81, 0xbb81, 0xa1c9, 0xb0ce, 0xabb4, 0xbc81, 0xf3d8, 0xbd81, 0xcbc9, 0xf6d8, 0xd7c2, 0xf7d8, 0xbe81, 0xbf81, 0xb1ce, 0xf9d8, 0xc081, 0xc181, 0xc281, 0xaeb2, 0xc0b9, 0xc381, 0xa3d9, 0xc481, 0xe9b0, 0xc581, 0xe6c1, 0xc681, 0xecc9, 0xc781, 0xc5cb, 0xc881, 0xc6cb, 0xa4d9, 0xc981, 0xca81, 0xcb81, 0xcc81, 0xcd81, 0xe8b5, 0xce81, 0xcf81, 0xabb5, 0xd081, 0xd181, 0xd281, 0xd381, 0xd481, 0xd581, 0xbbce, 0xcdb5, 0xa1d7, 0xf4d7, 0xd3d3, 0xd681, 0xe5cc, 0xd781, 0xceba, 0xd881, 0xa2d9, 0xdcd9, 0xe0d3, 0xfdd8, 0xf0b7, 0xf7d7, 0xfed8, 0xfad8, 0xa1d9, 0xe3c4, 0xd981, 0xda81, 0xb6d3, 0xf4d8, 0xddd9, 0xdb81, 0xfbd8, 0xdc81, 0xe5c5, 0xdd81, 0xde81, 0xd0c0, 0xdf81, 0xe081, 0xf0d1, 0xdbb0, 0xe181, 0xe281, 0xd1bc, 0xa6d9, 0xe381, 0xa5d9, 0xe481, 0xe581, 0xe681, 0xe781, 0xacd9, 0xaed9, 0xe881, 0xabd9, 0xb9ca, 0xe981, 0xea81, 0xeb81, 0xa9d9, 0xb6d6, 0xec81, 0xed81, 0xee81, 0xdeb3, 0xa8d9, 0xef81, 0xfdc0, 0xf081, 0xccca, 0xf181, 0xaad9, 0xf281, 0xa7d9, 0xf381, 0xf481, 0xb0d9, 0xf581, 0xf681, 0xb1b6, 0xf781, 0xf881, 0xf981, 0xa9b9, 0xfa81, 0xc0d2, 0xfb81, 0xfc81, 0xc0cf, 0xfd81, 0xfe81, 0xc2c2, 0x4082, 0xc4bd, 0xecd5, 0xe0b2, 0xc8c7, 0xebbf, 0xadd9, 0x4182, 0xafd9, 0x4282, 0xeace, 0xeeba, 0x4382, 0x4482, 0x4582, 0x4682, 0x4782, 0xd6c7, 0x4882, 0x4982, 0x4a82, 0x4b82, 0x4c82, 0x4d82, 0x4e82, 0x4f82, 0x5082, 0xe3b1, 0x5182, 0x5282, 0x5382, 0xd9b4, 0xedb6, 0xb4d9, 0x5482, 0x5582, 0x5682, 0x5782, 0xa1bf, 0x5882, 0x5982, 0x5a82, 0xded9, 0xcec7, 0xfec0, 0xb8d9, 0x5b82, 0x5c82, 0x5d82, 0x5e82, 0x5f82, 0xd7cb, 0xfdb7, 0x6082, 0xb5d9, 0x6182, 0xb7d9, 0xa3b1, 0xe1d3, 0xb9d9, 0x6282, 0xc5d0, 0x6382, 0xb6d9, 0x6482, 0x6582, 0xb1d9, 0x6682, 0xb2d9, 0xa9c1, 0xb3d9, 0x6782, 0x6882, 0xf3bc, 0xded0, 0xa9b8, 0x6982, 0xe3be, 0x6a82, 0xbdd9, 0x6b82, 0x6c82, 0x6d82, 0x6e82, 0xbad9, 0x6f82, 0xb3b0, 0x7082, 0x7182, 0x7282, 0xc2d9, 0x7382, 0x7482, 0x7582, 0x7682, 0x7782, 0x7882, 0x7982, 0x7a82, 0x7b82, 0x7c82, 0x7d82, 0x7e82, 0x8082, 0xc4d9, 0xb6b1, 0x8182, 0xbfd9, 0x8282, 0x8382, 0xb9b5, 0x8482, 0xf3be, 0x8582, 0x8682, 0x8782, 0xc8cc, 0xf2ba, 0xd0d2, 0x8882, 0xc3d9, 0x8982, 0x8a82, 0xe8bd, 0x8b82, 0xabb3, 0x8c82, 0x8d82, 0x8e82, 0xc5d9, 0xebbe, 0x8f82, 0xc6d9, 0xbbd9, 0xdfc4, 0x9082, 0xbed9, 0xc1d9, 0xc0d9, 0x9182, 0x9282, 0x9382, 0x9482, 0x9582, 0x9682, 0x9782, 0x9882, 0x9982, 0x9a82, 0x9b82, 0xaed5, 0x9c82, 0xb5d6, 0x9d82, 0xe3c7, 0x9e82, 0x9f82, 0xa082, 0xa182, 0xc8d9, 0xa282, 0xa382, 0xa482, 0xd9bc, 0xcad9, 0xa582, 0xa682, 0xa782, 0xbcd9, 0xa882, 0xcbd9, 0xabc6, 0xa982, 0xaa82, 0xab82, 0xac82, 0xad82, 0xc9d9, 0xae82, 0xaf82, 0xb082, 0xb182, 0xf6d7, 0xb282, 0xa3cd, 0xb382, 0xb482, 0xb582, 0xb682, 0xb782, 0xb882, 0xb982, 0xba82, 0xa1bd, 0xbb82, 0xbc82, 0xbd82, 0xbe82, 0xbf82, 0xc082, 0xccd9, 0xc182, 0xc282, 0xc382, 0xc482, 0xc582, 0xc682, 0xc782, 0xc882, 0xc982, 0xbcc5, 0xb5cd, 0xca82, 0xcb82, 0xcc82, 0xcdd9, 0xcd82, 0xce82, 0xc7d9, 0xa5b3, 0xfebf, 0xcf82, 0xd082, 0xd182, 0xd282, 0xb5b8, 0xd382, 0xd482, 0xfcc0, 0xd582, 0xd682, 0xd782, 0xd882, 0xf8b0, 0xd982, 0xda82, 0xdb82, 0xdc82, 0xdd82, 0xde82, 0xdf82, 0xe082, 0xe182, 0xe282, 0xe382, 0xe482, 0xe582, 0xe682, 0xe782, 0xe882, 0xe982, 0xea82, 0xeb82, 0xec82, 0xed82, 0xf6b4, 0xee82, 0xced9, 0xef82, 0xcfd9, 0xa2b4, 0xd0d9, 0xf082, 0xf182, 0xdfb4, 0xf282, 0xf382, 0xf482, 0xf582, 0xf682, 0xc1b0, 0xf782, 0xf882, 0xf982, 0xfa82, 0xfb82, 0xfc82, 0xfd82, 0xd1d9, 0xb5c9, 0xfe82, 0x4083, 0x4183, 0x4283, 0x4383, 0x4483, 0x4583, 0x4683, 0x4783, 0x4883, 0x4983, 0x4a83, 0x4b83, 0x4c83, 0x4d83, 0x4e83, 0x4f83, 0x5083, 0x5183, 0xf1cf, 0x5283, 0x5383, 0x5483, 0x5583, 0x5683, 0x5783, 0xd2d9, 0x5883, 0x5983, 0x5a83, 0xc5c1, 0x5b83, 0x5c83, 0x5d83, 0x5e83, 0x5f83, 0x6083, 0x6183, 0x6283, 0x6383, 0x6483, 0x6583, 0xd6d9, 0xaec9, 0x6683, 0x6783, 0x6883, 0x6983, 0xd5d9, 0xd4d9, 0xd7d9, 0x6a83, 0x6b83, 0x6c83, 0x6d83, 0xdbcb, 0x6e83, 0xa9bd, 0x6f83, 0x7083, 0x7183, 0x7283, 0x7383, 0xa7c6, 0x7483, 0x7583, 0x7683, 0x7783, 0x7883, 0x7983, 0x7a83, 0x7b83, 0x7c83, 0x7d83, 0xd3d9, 0xd8d9, 0x7e83, 0x8083, 0x8183, 0xd9d9, 0x8283, 0x8383, 0x8483, 0x8583, 0x8683, 0x8783, 0xe5c8, 0x8883, 0x8983, 0x8a83, 0x8b83, 0x8c83, 0x8d83, 0x8e83, 0x8f83, 0x9083, 0x9183, 0x9283, 0x9383, 0x9483, 0x9583, 0xdcc0, 0x9683, 0x9783, 0x9883, 0x9983, 0x9a83, 0x9b83, 0x9c83, 0x9d83, 0x9e83, 0x9f83, 0xa083, 0xa183, 0xa283, 0xa383, 0xa483, 0xa583, 0xa683, 0xa783, 0xa883, 0xa983, 0xaa83, 0xab83, 0xac83, 0xad83, 0xae83, 0xaf83, 0xb083, 0xb183, 0xb283, 0xf9b6, 0xa3d8, 0xcad4, 0xb383, 0xaad4, 0xd6d0, 0xe4b3, 0xd7d5, 0xb483, 0xc8cf, 0xe2b9, 0xb583, 0xcbbf, 0xb683, 0xe2c3, 0xb783, 0xb883, 0xb983, 0xd2b6, 0xba83, 0xbb83, 0xc3cd, 0xeed9, 0xf0d9, 0xbc83, 0xbd83, 0xbe83, 0xb3b5, 0xbf83, 0xb5b6, 0xc083, 0xc183, 0xc283, 0xc383, 0xc483, 0xa4be, 0xc583, 0xc683, 0xebc8, 0xc783, 0xc883, 0xabc8, 0xc983, 0xca83, 0xcbb0, 0xabb9, 0xf9c1, 0xe2d9, 0xcb83, 0xbcc0, 0xb2b9, 0xcc83, 0xd8b9, 0xcbd0, 0xf8b1, 0xe4c6, 0xdfbe, 0xe4b5, 0xc8d7, 0xcd83, 0xf8d1, 0xe6bc, 0xdeca, 0xce83, 0xcf83, 0xbdbc, 0xe6d9, 0xe7d8, 0xd083, 0xd183, 0xdac4, 0xd283, 0xd383, 0xd4b8, 0xbdc8, 0xd483, 0xd583, 0xe1b2, 0xd9d4, 0xd683, 0xd783, 0xd883, 0xd983, 0xb0c3, 0xda83, 0xdb83, 0xe1c3, 0xa2da, 0xdfc8, 0xdc83, 0xb4d0, 0xdd83, 0xfcbe, 0xa9c5, 0xde83, 0xdf83, 0xe083, 0xdab9, 0xe183, 0xa3da, 0xe283, 0xa9d4, 0xa4da, 0xe383, 0xe483, 0xe583, 0xe683, 0xe783, 0xfbd9, 0xacb6, 0xe883, 0xe983, 0xebb7, 0xf9b1, 0xfcd9, 0xe5b3, 0xf6be, 0xea83, 0xf6bf, 0xb1d2, 0xe4c0, 0xeb83, 0xec83, 0xed83, 0xb3b6, 0xfed9, 0xfdd9, 0xee83, 0xef83, 0xbbbe, 0xf083, 0xf183, 0xf283, 0xe0c6, 0xf383, 0xbcd7, 0xa1da, 0xf483, 0xb9c1, 0xf583, 0xf2b5, 0xe8c1, 0xf683, 0xf783, 0xf5bc, 0xf883, 0xd5b4, 0xf983, 0xfa83, 0xfb83, 0xfc83, 0xfd83, 0xfe83, 0x4084, 0x4184, 0x4284, 0xddc1, 0x4384, 0xfdc4, 0x4484, 0x4584, 0xb8bc, 0xb2b7, 0x4684, 0x4784, 0xefb7, 0x4884, 0x4984, 0x4a84, 0x4b84, 0x4c84, 0x4d84, 0xecd9, 0x4e84, 0xbec6, 0x4f84, 0xadbf, 0xcbbb, 0x5084, 0x5184, 0xcab5, 0x5284, 0xc9db, 0xd7d0, 0x5384, 0xb9cd, 0xbcb0, 0xf6b3, 0xf7bb, 0xcadb, 0xafba, 0x5484, 0xe4d4, 0xb6b5, 0xf3b5, 0xd6d8, 0xd0c8, 0x5584, 0x5684, 0xd6b7, 0xd0c7, 0xd7d8, 0x5784, 0xafbf, 0x5884, 0x5984, 0xbbdb, 0xd8d8, 0x5a84, 0x5b84, 0xccd0, 0xaebb, 0x5c84, 0x5d84, 0x5e84, 0xbeeb, 0xd0c1, 0xf5c1, 0xf2d4, 0xd5b8, 0xb4b4, 0x5f84, 0xf5b3, 0x6084, 0x6184, 0xbec9, 0x6284, 0x6384, 0x6484, 0xd0c5, 0x6584, 0x6684, 0x6784, 0xd9c5, 0xfbc0, 0x6884, 0xf0b1, 0x6984, 0xd9d8, 0xceb9, 0x6a84, 0xbdb5, 0x6b84, 0x6c84, 0xdad8, 0x6d84, 0x6e84, 0xc6d6, 0xa2cb, 0xafc8, 0xb2c9, 0xccb4, 0xccbf, 0x6f84, 0xf4b9, 0x7084, 0xdbd8, 0xdcd8, 0xe7b6, 0xc1bc, 0xeacc, 0x7184, 0x7284, 0x7384, 0x7484, 0x7584, 0x7684, 0xf7cf, 0x7784, 0xddd8, 0xb0c7, 0x7884, 0x7984, 0xd0b9, 0xa3bd, 0x7a84, 0x7b84, 0xdecc, 0x7c84, 0xcac6, 0x7d84, 0x7e84, 0x8084, 0x8184, 0x8284, 0xe0d8, 0x8384, 0xded8, 0x8484, 0x8584, 0xdfd8, 0x8684, 0x8784, 0x8884, 0xfeb0, 0x8984, 0xe7be, 0x8a84, 0xa3ca, 0xf4bc, 0x8b84, 0x8c84, 0x8d84, 0x8e84, 0xb1b8, 0x8f84, 0x9084, 0xeeb8, 0x9184, 0x9284, 0x9384, 0x9484, 0x9584, 0x9684, 0x9784, 0x9884, 0x9984, 0x9a84, 0xe2d8, 0x9b84, 0xcbbd, 0x9c84, 0xe4d8, 0xe3d8, 0x9d84, 0x9e84, 0x9f84, 0xa084, 0xa184, 0xfcc5, 0xa284, 0xa384, 0xa484, 0xa584, 0xa684, 0xa784, 0xa884, 0xe5d8, 0xa984, 0xaa84, 0xe6d8, 0xab84, 0xac84, 0xad84, 0xae84, 0xaf84, 0xb084, 0xb184, 0xa6c1, 0xb284, 0xb0c8, 0xecb0, 0xa6b9, 0xd3bc, 0xf1ce, 0xbddb, 0xd3c1, 0xb384, 0xb484, 0xb584, 0xb684, 0xafb6, 0xfad6, 0xacc5, 0xd9bd, 0xbedb, 0xbfdb, 0xb784, 0xb884, 0xb984, 0xf8c0, 0xa2be, 0xcdc0, 0xba84, 0xbb84, 0xbc84, 0xbd84, 0xbe84, 0xbf84, 0xc084, 0xc184, 0xc284, 0xc384, 0xc0db, 0xc6ca, 0xc484, 0xc584, 0xc684, 0xaab2, 0xc784, 0xc884, 0xc984, 0xc2d3, 0xca84, 0xe3c3, 0xcb84, 0xabd1, 0xcc84, 0xcd84, 0xce84, 0xcf84, 0xc2db, 0xd084, 0xd5c0, 0xd184, 0xd284, 0xd384, 0xc3db, 0xd484, 0xb1bf, 0xd584, 0xd684, 0xd784, 0xd884, 0xd984, 0xda84, 0xbcc4, 0xdb84, 0xdc84, 0xdd84, 0xde84, 0xdac7, 0xdf84, 0xe084, 0xe184, 0xe284, 0xe384, 0xe484, 0xe584, 0xe684, 0xe784, 0xe884, 0xe984, 0xc4db, 0xea84, 0xeb84, 0xec84, 0xed84, 0xee84, 0xef84, 0xf084, 0xf184, 0xe8d9, 0xd7c9, 0xf284, 0xf384, 0xf484, 0xb4b9, 0xf0ce, 0xc8d4, 0xf584, 0xf684, 0xf784, 0xf884, 0xfcb0, 0xd2b4, 0xf984, 0xd9d0, 0xfa84, 0xfb84, 0xfc84, 0xfd84, 0xe9d9, 0xfe84, 0xcbde, 0xebd9, 0x4085, 0x4185, 0x4285, 0x4385, 0xb0d8, 0xafbb, 0xb1b1, 0x4485, 0xd7b3, 0xced8, 0x4585, 0x4685, 0xd1d4, 0x4785, 0x4885, 0xb3bd, 0xefbf, 0x4985, 0xbbcf, 0x4a85, 0x4b85, 0xd0d8, 0x4c85, 0x4d85, 0x4e85, 0xcbb7, 0x4f85, 0x5085, 0x5185, 0xd1d8, 0x5285, 0x5385, 0x5485, 0x5585, 0x5685, 0x5785, 0x5885, 0x5985, 0x5a85, 0x5b85, 0xa5c6, 0xf8c7, 0xbdd2, 0x5c85, 0x5d85, 0xd2d8, 0xe4c4, 0x5e85, 0xaeca, 0x5f85, 0xa7c7, 0x6085, 0xa6d8, 0x6185, 0xfdc9, 0xe7ce, 0xdcbb, 0xebb0, 0x6285, 0x6385, 0x6485, 0xaabb, 0xadd0, 0x6585, 0xb0b1, 0xe4d7, 0xbfd7, 0x6685, 0xa5b5, 0xf4c2, 0xcfc4, 0x6785, 0x6885, 0xa9b2, 0x6985, 0xb7b2, 0x6a85, 0xe5b1, 0xb2df, 0xbcd5, 0xa8bf, 0xacc2, 0xd5d8, 0xb1c2, 0x6b85, 0xd4d8, 0xd4ce, 0x6c85, 0xe0da, 0x6d85, 0xc0ce, 0x6e85, 0x6f85, 0xb4d8, 0xaec3, 0xa1d3, 0xa3ce, 0x7085, 0xb4bc, 0xb4c8, 0xd1c2, 0x7185, 0xedbe, 0xb6d0, 0x7285, 0xe1da, 0x7385, 0x7485, 0x7585, 0x7685, 0xe4c7, 0x7785, 0x7885, 0xa7b3, 0x7985, 0xf2b6, 0xfccc, 0xfac0, 0x7a85, 0x7b85, 0xf7c0, 0x7c85, 0xb9d1, 0xe1d1, 0xc7d8, 0x7d85, 0x7e85, 0x8085, 0x8185, 0x8285, 0x8385, 0x8485, 0xdeb2, 0x8585, 0x8685, 0xe5c0, 0x8785, 0xf1ba, 0x8885, 0x8985, 0xc8d8, 0x8a85, 0xadd4, 0x8b85, 0x8c85, 0xe1cf, 0xc9d8, 0x8d85, 0xcad8, 0xc3cf, 0x8e85, 0xf8b3, 0xc7be, 0x8f85, 0x9085, 0x9185, 0x9285, 0xcbd8, 0x9385, 0x9485, 0x9585, 0x9685, 0x9785, 0x9885, 0x9985, 0xccdb, 0x9a85, 0x9b85, 0x9c85, 0x9d85, 0xa5c8, 0x9e85, 0x9f85, 0xa085, 0xd8cf, 0xa185, 0xfec8, 0xceb2, 0xa285, 0xa385, 0xa485, 0xa585, 0xa685, 0xd6d3, 0xe6b2, 0xb0bc, 0xd1d3, 0xabcb, 0xb4b7, 0xa785, 0xa885, 0xa985, 0xa2b7, 0xaa85, 0xab85, 0xe5ca, 0xac85, 0xa1c8, 0xdcca, 0xe4b1, 0xf0d0, 0xad85, 0xd1c5, 0xae85, 0xaf85, 0xb085, 0xc5db, 0xfeb5, 0xb185, 0xb285, 0xdabf, 0xc5b9, 0xe4be, 0xedc1, 0xb385, 0xb6df, 0xb5df, 0xbbd6, 0xd0bd, 0xd9d5, 0xc8b0, 0xa3b6, 0xc9bf, 0xa8cc, 0xb3df, 0xb7ca, 0xd2d3, 0xb485, 0xcfd8, 0xb6d2, 0xc5ba, 0xbecb, 0xbecc, 0xb585, 0xb7df, 0xf0b5, 0xb4df, 0xb685, 0xb785, 0xb885, 0xf5d3, 0xb985, 0xd4b3, 0xf7b8, 0xba85, 0xbadf, 0xbb85, 0xcfba, 0xaabc, 0xf5b5, 0xbc85, 0xaccd, 0xfbc3, 0xf3ba, 0xf4c0, 0xc2cd, 0xf2cf, 0xb8df, 0xc5cf, 0xbd85, 0xc0c2, 0xb9df, 0xf0c2, 0xbe85, 0xbf85, 0xc085, 0xfdbe, 0xc185, 0xdfc1, 0xcccd, 0xf7d2, 0xcdb7, 0xc1df, 0xc285, 0xc4df, 0xc385, 0xc485, 0xf1b7, 0xc9b0, 0xd6b6, 0xd4b7, 0xc585, 0xacba, 0xfdcc, 0xd4bf, 0xb1cb, 0xf4c6, 0xc685, 0xa8d6, 0xc5df, 0xc785, 0xe2ce, 0xb3b3, 0xc885, 0xc985, 0xfcce, 0xb5b4, 0xca85, 0xc7ce, 0xf0ba, 0xcb85, 0xe1ce, 0xcc85, 0xbdd1, 0xcd85, 0xce85, 0xc0df, 0xcf85, 0xd085, 0xf4b4, 0xd185, 0xcab3, 0xd285, 0xe6b8, 0xbbdf, 0xd385, 0xd485, 0xd585, 0xd685, 0xc5c4, 0xd785, 0xbcdf, 0xbddf, 0xbedf, 0xbbc5, 0xbfdf, 0xc2df, 0xb1d4, 0xc3df, 0xd885, 0xbac7, 0xd8ce, 0xd985, 0xda85, 0xdb85, 0xdc85, 0xdd85, 0xd8c4, 0xde85, 0xcadf, 0xdf85, 0xcfdf, 0xe085, 0xdcd6, 0xe185, 0xe285, 0xe385, 0xe485, 0xe585, 0xe685, 0xe785, 0xe885, 0xc9df, 0xdadf, 0xb6ce, 0xe985, 0xc7ba, 0xcedf, 0xc8df, 0xdec5, 0xea85, 0xeb85, 0xebc9, 0xf4ba, 0xfcc3, 0xec85, 0xed85, 0xd7be, 0xee85, 0xc6df, 0xef85, 0xcddf, 0xf085, 0xd8c5, 0xf185, 0xf285, 0xf385, 0xf485, 0xa6d5, 0xcdba, 0xf585, 0xccbe, 0xbdd3, 0xc0b8, 0xf685, 0xe4d6, 0xf785, 0xc7df, 0xbeb9, 0xa7bf, 0xf885, 0xf985, 0xfcc1, 0xcbdf, 0xccdf, 0xfa85, 0xd0df, 0xfb85, 0xfc85, 0xfd85, 0xfe85, 0x4086, 0xdbdf, 0xe5df, 0x4186, 0xd7df, 0xd6df, 0xc9d7, 0xe3df, 0xe4df, 0xebe5, 0xa7d2, 0xd2df, 0x4286, 0xa9bf, 0x4386, 0xdbd4, 0x4486, 0xc8bf, 0xd4df, 0x4586, 0x4686, 0x4786, 0xcccf, 0x4886, 0x4986, 0xdddf, 0x4a86, 0xcad1, 0x4b86, 0xdedf, 0xa7b0, 0xb7c6, 0xd3df, 0x4c86, 0xe5ba, 0x4d86, 0xdfb6, 0xdbcd, 0xfeb9, 0xd5d4, 0x4e86, 0x4f86, 0xdfdf, 0xeccf, 0xa5b0, 0xe7df, 0xd1df, 0xc6d1, 0xd5df, 0xd8df, 0xd9df, 0xdcdf, 0x5086, 0xa9bb, 0x5186, 0xe0df, 0xe1df, 0x5286, 0xe2df, 0xe6df, 0xe8df, 0xb4d3, 0x5386, 0x5486, 0x5586, 0x5686, 0x5786, 0xe7b8, 0xb6c5, 0xeadf, 0xdac9, 0xa8c1, 0xc4c4, 0x5886, 0x5986, 0xdebf, 0xf8cf, 0x5a86, 0x5b86, 0x5c86, 0xdcd5, 0xeedf, 0x5d86, 0x5e86, 0x5f86, 0x6086, 0x6186, 0x6286, 0xb8b2, 0x6386, 0xdfba, 0xecdf, 0x6486, 0xc1db, 0x6586, 0xe4d1, 0x6686, 0x6786, 0x6886, 0x6986, 0xf4cb, 0xbdb4, 0x6a86, 0xa6b0, 0x6b86, 0x6c86, 0x6d86, 0x6e86, 0x6f86, 0xf1df, 0xc6cc, 0xf2df, 0x7086, 0x7186, 0xeddf, 0x7286, 0x7386, 0x7486, 0x7586, 0x7686, 0x7786, 0xe9df, 0x7886, 0x7986, 0x7a86, 0x7b86, 0xebdf, 0x7c86, 0xefdf, 0xf0df, 0xbdbb, 0x7d86, 0x7e86, 0xf3df, 0x8086, 0x8186, 0xf4df, 0x8286, 0xa3bb, 0x8386, 0xdbca, 0xa8ce, 0xa7e0, 0xaab3, 0x8486, 0xa6e0, 0x8586, 0x8686, 0x8786, 0xa1e0, 0x8886, 0x8986, 0x8a86, 0x8b86, 0xfedf, 0x8c86, 0xd9cd, 0xfcdf, 0x8d86, 0xfadf, 0x8e86, 0xd0bf, 0xc4d7, 0x8f86, 0xccc9, 0x9086, 0x9186, 0xf8df, 0xa1b0, 0x9286, 0x9386, 0x9486, 0x9586, 0x9686, 0xfddf, 0x9786, 0x9886, 0x9986, 0x9a86, 0xfbdf, 0xa2e0, 0x9b86, 0x9c86, 0x9d86, 0x9e86, 0x9f86, 0xa8e0, 0xa086, 0xa186, 0xa286, 0xa386, 0xc8b7, 0xa486, 0xa586, 0xa1c6, 0xb6c9, 0xb2c0, 0xf5df, 0xa686, 0xa786, 0xbec5, 0xa886, 0xc4d8, 0xf9df, 0xf6c4, 0xa986, 0xaa86, 0xab86, 0xac86, 0xad86, 0xae86, 0xa3e0, 0xa4e0, 0xa5e0, 0xa5d0, 0xaf86, 0xb086, 0xb4e0, 0xe4cc, 0xb186, 0xb1e0, 0xb286, 0xa6bf, 0xafe0, 0xb9ce, 0xabe0, 0xc6c9, 0xb386, 0xb486, 0xaec0, 0xaee0, 0xedba, 0xb0ba, 0xa9e0, 0xb586, 0xb686, 0xb786, 0xf6df, 0xb886, 0xb3e0, 0xb986, 0xba86, 0xb8e0, 0xbb86, 0xbc86, 0xbd86, 0xadb4, 0xb9e0, 0xbe86, 0xbf86, 0xb2cf, 0xc8ba, 0xc086, 0xb0e0, 0xc186, 0xc286, 0xc386, 0xc486, 0xc586, 0xc686, 0xc786, 0xfad0, 0xc886, 0xc986, 0xca86, 0xcb86, 0xcc86, 0xcd86, 0xce86, 0xcf86, 0xd086, 0xace0, 0xd186, 0xfbd4, 0xd286, 0xf7df, 0xd386, 0xe7c5, 0xd486, 0xade0, 0xd586, 0xf7d3, 0xd686, 0xb6e0, 0xb7e0, 0xd786, 0xd886, 0xd986, 0xda86, 0xdb86, 0xc4e0, 0xe1d0, 0xdc86, 0xdd86, 0xde86, 0xbce0, 0xdf86, 0xe086, 0xc9e0, 0xcae0, 0xe186, 0xe286, 0xe386, 0xbee0, 0xaae0, 0xa4c9, 0xc1e0, 0xe486, 0xb2e0, 0xe586, 0xe686, 0xe786, 0xe886, 0xe986, 0xc8ca, 0xc3e0, 0xea86, 0xb5e0, 0xeb86, 0xcbce, 0xec86, 0xc3cb, 0xcde0, 0xc6e0, 0xc2e0, 0xed86, 0xcbe0, 0xee86, 0xbae0, 0xbfe0, 0xc0e0, 0xef86, 0xf086, 0xc5e0, 0xf186, 0xf286, 0xc7e0, 0xc8e0, 0xf386, 0xcce0, 0xf486, 0xbbe0, 0xf586, 0xf686, 0xf786, 0xf886, 0xf986, 0xd4cb, 0xd5e0, 0xfa86, 0xd6e0, 0xd2e0, 0xfb86, 0xfc86, 0xfd86, 0xfe86, 0x4087, 0x4187, 0xd0e0, 0xcebc, 0x4287, 0x4387, 0xd1e0, 0x4487, 0xc2b8, 0xc5d8, 0x4587, 0x4687, 0x4787, 0x4887, 0x4987, 0x4a87, 0x4b87, 0x4c87, 0xead0, 0x4d87, 0x4e87, 0xefc2, 0x4f87, 0x5087, 0xcfe0, 0xbde0, 0x5187, 0x5287, 0x5387, 0xd4e0, 0xd3e0, 0x5487, 0x5587, 0xd7e0, 0x5687, 0x5787, 0x5887, 0x5987, 0xdce0, 0xd8e0, 0x5a87, 0x5b87, 0x5c87, 0xf6d6, 0xb0b3, 0x5d87, 0xecd7, 0x5e87, 0xbbcb, 0x5f87, 0x6087, 0xdae0, 0x6187, 0xfbce, 0x6287, 0x6387, 0x6487, 0xd9ba, 0x6587, 0x6687, 0x6787, 0x6887, 0x6987, 0x6a87, 0x6b87, 0x6c87, 0x6d87, 0x6e87, 0x6f87, 0x7087, 0xe1e0, 0xdde0, 0xadd2, 0x7187, 0x7287, 0x7387, 0x7487, 0x7587, 0xe2e0, 0x7687, 0x7787, 0xdbe0, 0xd9e0, 0xdfe0, 0x7887, 0x7987, 0xe0e0, 0x7a87, 0x7b87, 0x7c87, 0x7d87, 0x7e87, 0xdee0, 0x8087, 0xe4e0, 0x8187, 0x8287, 0x8387, 0xf7c6, 0xacd8, 0xebd4, 0xe6e0, 0xc9ca, 0x8487, 0x8587, 0x8687, 0x8787, 0xe5e0, 0x8887, 0x8987, 0x8a87, 0x8b87, 0xc1b8, 0x8c87, 0x8d87, 0x8e87, 0x8f87, 0xe7e0, 0xe8e0, 0x9087, 0x9187, 0x9287, 0x9387, 0x9487, 0x9587, 0x9687, 0x9787, 0xe9e0, 0xe3e0, 0x9887, 0x9987, 0x9a87, 0x9b87, 0x9c87, 0x9d87, 0x9e87, 0xbfba, 0xe7cc, 0x9f87, 0xa087, 0xa187, 0xeae0, 0xa287, 0xa387, 0xa487, 0xa587, 0xa687, 0xa787, 0xa887, 0xa987, 0xaa87, 0xab87, 0xac87, 0xad87, 0xae87, 0xaf87, 0xb087, 0xf9cf, 0xb187, 0xb287, 0xb387, 0xb487, 0xb587, 0xb687, 0xb787, 0xb887, 0xb987, 0xba87, 0xbb87, 0xebe0, 0xbc87, 0xbd87, 0xbe87, 0xbf87, 0xc087, 0xc187, 0xc287, 0xc2c8, 0xc387, 0xc487, 0xc587, 0xc687, 0xc0bd, 0xc787, 0xc887, 0xc987, 0xca87, 0xcb87, 0xcc87, 0xcd87, 0xce87, 0xcf87, 0xd087, 0xd187, 0xd287, 0xd387, 0xd2c4, 0xd487, 0xd587, 0xd687, 0xd787, 0xd887, 0xd987, 0xda87, 0xdb87, 0xdc87, 0xece0, 0xdd87, 0xde87, 0xede0, 0xdf87, 0xe087, 0xf4c7, 0xc4cb, 0xe187, 0xeee0, 0xd8bb, 0xb6d8, 0xf2d2, 0xefe0, 0xc5cd, 0xe287, 0xdab6, 0xe387, 0xe487, 0xe587, 0xe687, 0xe787, 0xe887, 0xf1e0, 0xe987, 0xb0d4, 0xea87, 0xeb87, 0xa7c0, 0xd1b4, 0xec87, 0xed87, 0xa7ce, 0xf0e0, 0xee87, 0xef87, 0xf087, 0xf2e0, 0xccb9, 0xf187, 0xf287, 0xfab9, 0xbccd, 0xf3e0, 0xf387, 0xf487, 0xf587, 0xd4c6, 0xf4e0, 0xf687, 0xb2d4, 0xf787, 0xa6c8, 0xf6e0, 0xf5e0, 0xf887, 0xf987, 0xfa87, 0xfb87, 0xfc87, 0xfd87, 0xfe87, 0x4088, 0x4188, 0x4288, 0x4388, 0x4488, 0x4588, 0x4688, 0x4788, 0x4888, 0x4988, 0xf7e0, 0x4a88, 0x4b88, 0xc1cd, 0x4c88, 0x4d88, 0x4e88, 0xa5ca, 0x4f88, 0x5088, 0x5188, 0x5288, 0xdad4, 0xd7db, 0xd9db, 0x5388, 0xd8db, 0xe7b9, 0xdcdb, 0xdddb, 0xd8b5, 0x5488, 0x5588, 0xdadb, 0x5688, 0x5788, 0x5888, 0x5988, 0x5a88, 0xdbdb, 0xa1b3, 0xdfdb, 0x5b88, 0x5c88, 0xf8bb, 0x5d88, 0xb7d6, 0x5e88, 0xe0db, 0x5f88, 0x6088, 0x6188, 0x6288, 0xf9be, 0x6388, 0x6488, 0xbbb7, 0x6588, 0xd0db, 0xaecc, 0xb2bf, 0xb5bb, 0xf8d7, 0xd3bf, 0x6688, 0x6788, 0x6888, 0x6988, 0x6a88, 0xe9bf, 0x6b88, 0x6c88, 0xe1bc, 0xb3cc, 0xdedb, 0xd3b0, 0xebce, 0xd8b7, 0xb9d7, 0xc2c6, 0x6d88, 0x6e88, 0xa4c0, 0x6f88, 0xb9cc, 0x7088, 0xe7db, 0xe1db, 0xbac6, 0xe3db, 0x7188, 0xe8db, 0x7288, 0xf7c5, 0x7388, 0x7488, 0x7588, 0xeadb, 0x7688, 0x7788, 0xe9db, 0xc0bf, 0x7888, 0x7988, 0x7a88, 0xe6db, 0xe5db, 0x7b88, 0x7c88, 0x7d88, 0x7e88, 0x8088, 0xb9b4, 0xacc0, 0xa2c2, 0xe2db, 0xe4db, 0x8188, 0x8288, 0x8388, 0x8488, 0xcdd0, 0xeddb, 0x8588, 0x8688, 0x8788, 0x8888, 0x8988, 0xddc0, 0xf2db, 0x8a88, 0x8b88, 0x8c88, 0x8d88, 0x8e88, 0x8f88, 0x9088, 0xe2b6, 0x9188, 0x9288, 0x9388, 0x9488, 0xf3db, 0xd2db, 0xb8b9, 0xabd4, 0xecdb, 0x9588, 0xd1bf, 0xf0db, 0x9688, 0xd1db, 0x9788, 0xe6b5, 0x9888, 0xebdb, 0xe5bf, 0x9988, 0x9a88, 0x9b88, 0xeedb, 0x9c88, 0xf1db, 0x9d88, 0x9e88, 0x9f88, 0xf9db, 0xa088, 0xa188, 0xa288, 0xa388, 0xa488, 0xa588, 0xa688, 0xa788, 0xa888, 0xa1b9, 0xa3b0, 0xa988, 0xaa88, 0xab88, 0xac88, 0xad88, 0xae88, 0xaf88, 0xf1c2, 0xb088, 0xb188, 0xc7b3, 0xefdb, 0xb288, 0xb388, 0xf8db, 0xb488, 0xd2c6, 0xf4db, 0xb588, 0xb688, 0xf5db, 0xf7db, 0xf6db, 0xb788, 0xb888, 0xfedb, 0xb988, 0xf2d3, 0xbab2, 0xba88, 0xbb88, 0xbc88, 0xfddb, 0xbd88, 0xbe88, 0xbf88, 0xc088, 0xc188, 0xc288, 0xc388, 0xc488, 0xa4dc, 0xc588, 0xfbdb, 0xc688, 0xc788, 0xc888, 0xc988, 0xfadb, 0xca88, 0xcb88, 0xcc88, 0xfcdb, 0xe0c5, 0xf9bb, 0xcd88, 0xce88, 0xa3dc, 0xcf88, 0xd088, 0xa5dc, 0xd188, 0xc3cc, 0xd288, 0xd388, 0xd488, 0xd1b6, 0xc0dd, 0xd588, 0xd688, 0xd788, 0xa1dc, 0xd888, 0xa2dc, 0xd988, 0xda88, 0xdb88, 0xb5c7, 0xdc88, 0xdd88, 0xde88, 0xe9b6, 0xdf88, 0xe088, 0xe188, 0xa7dc, 0xe288, 0xe388, 0xe488, 0xe588, 0xa6dc, 0xe688, 0xa9dc, 0xa4b1, 0xe788, 0xe888, 0xccb5, 0xe988, 0xea88, 0xeb88, 0xec88, 0xed88, 0xb0bf, 0xee88, 0xef88, 0xf088, 0xf188, 0xf288, 0xdfd1, 0xf388, 0xf488, 0xf588, 0xf688, 0xc2b6, 0xf788, 0xf888, 0xf988, 0xfa88, 0xfb88, 0xfc88, 0xfd88, 0xfe88, 0x4089, 0x4189, 0x4289, 0x4389, 0x4489, 0x4589, 0xa8dc, 0x4689, 0x4789, 0x4889, 0x4989, 0x4a89, 0x4b89, 0x4c89, 0xfacb, 0xf3eb, 0x4d89, 0x4e89, 0x4f89, 0xdccb, 0x5089, 0x5189, 0xfecb, 0x5289, 0x5389, 0x5489, 0xc1cc, 0x5589, 0x5689, 0x5789, 0x5889, 0x5989, 0xfbc8, 0x5a89, 0x5b89, 0x5c89, 0x5d89, 0x5e89, 0x5f89, 0xaadc, 0x6089, 0x6189, 0x6289, 0x6389, 0x6489, 0xeecc, 0xabdc, 0x6589, 0x6689, 0x6789, 0x6889, 0x6989, 0x6a89, 0x6b89, 0x6c89, 0x6d89, 0x6e89, 0x6f89, 0x7089, 0x7189, 0x7289, 0x7389, 0x7489, 0x7589, 0xd3db, 0x7689, 0xafdc, 0xacdc, 0x7789, 0xb3be, 0x7889, 0xfbca, 0x7989, 0x7a89, 0x7b89, 0xaddc, 0x7c89, 0x7d89, 0x7e89, 0x8089, 0x8189, 0x8289, 0x8389, 0x8489, 0xcac9, 0xb9c4, 0x8589, 0x8689, 0x8789, 0x8889, 0x8989, 0xbdc7, 0xaedc, 0x8a89, 0x8b89, 0x8c89, 0xf6d4, 0xe6d0, 0x8d89, 0x8e89, 0x8f89, 0x9089, 0x9189, 0x9289, 0x9389, 0x9489, 0xabc4, 0xd5b6, 0x9589, 0x9689, 0x9789, 0x9889, 0x9989, 0x9a89, 0x9b89, 0x9c89, 0x9d89, 0x9e89, 0x9f89, 0xa089, 0xa189, 0xa289, 0xa389, 0xa489, 0xa589, 0xa689, 0xd4db, 0xa789, 0xa889, 0xa989, 0xaa89, 0xdab1, 0xab89, 0xac89, 0xad89, 0xd5db, 0xae89, 0xaf89, 0xb089, 0xb189, 0xb289, 0xb389, 0xb489, 0xb589, 0xb689, 0xb789, 0xb889, 0xd6db, 0xb989, 0xba89, 0xbb89, 0xbeba, 0xbc89, 0xbd89, 0xbe89, 0xbf89, 0xc089, 0xc189, 0xc289, 0xc389, 0xc489, 0xc589, 0xc689, 0xc789, 0xc889, 0xc989, 0xc0c8, 0xca89, 0xcb89, 0xcc89, 0xcd89, 0xce89, 0xcf89, 0xbfca, 0xc9c8, 0xd089, 0xb3d7, 0xd189, 0xf9c9, 0xd289, 0xd389, 0xc7bf, 0xd489, 0xd589, 0xf8ba, 0xd689, 0xd789, 0xbcd2, 0xd889, 0xd989, 0xda89, 0xdb89, 0xdc89, 0xdd89, 0xde89, 0xdf89, 0xbae2, 0xe089, 0xa6b4, 0xe189, 0xe289, 0xb8b1, 0xe389, 0xe489, 0xe589, 0xe689, 0xe789, 0xb4b8, 0xe889, 0xc4cf, 0xe989, 0xea89, 0xeb89, 0xec89, 0xe7d9, 0xa6cf, 0xe2cd, 0xed89, 0xee89, 0xedd9, 0xe0b6, 0xef89, 0xb9d2, 0xf089, 0xf189, 0xbbb9, 0xf289, 0xf389, 0xf489, 0xf589, 0xb9e2, 0xb7e2, 0xf689, 0xf3b4, 0xf789, 0xeccc, 0xabcc, 0xf2b7, 0xf889, 0xb2d8, 0xebd1, 0xbbba, 0xf989, 0xa7ca, 0xfa89, 0xfb89, 0xb7cd, 0xfc89, 0xfd89, 0xc4d2, 0xe4bf, 0xd0bc, 0xe1b6, 0xfe89, 0xc5de, 0x408a, 0x418a, 0x428a, 0x438a, 0xc6de, 0xbcdb, 0x448a, 0xd9d1, 0x458a, 0x468a, 0xe6c6, 0xcec4, 0xeeb7, 0x478a, 0xdcb7, 0x488a, 0x498a, 0xfcbf, 0xe0d7, 0x4a8a, 0xf5c6, 0x4b8a, 0x4c8a, 0xbcb1, 0xc8de, 0xb1bd, 0xd7cc, 0xcade, 0x4d8a, 0xc9de, 0x4e8a, 0x4f8a, 0x508a, 0x518a, 0x528a, 0xecb5, 0x538a, 0xddc9, 0x548a, 0x558a, 0xc2b0, 0x568a, 0x578a, 0x588a, 0x598a, 0x5a8a, 0x5b8a, 0x5c8a, 0x5d8a, 0x5e8a, 0x5f8a, 0x608a, 0x618a, 0x628a, 0xaec5, 0xabc5, 0x638a, 0xccc4, 0x648a, 0xe9bc, 0xfdcb, 0x658a, 0x668a, 0x678a, 0xc3ba, 0x688a, 0x698a, 0x6a8a, 0xf9e5, 0xe7c8, 0xfae5, 0xfdcd, 0x6b8a, 0xb1d7, 0xbeb8, 0xe8c2, 0x6c8a, 0xd1c8, 0x6d8a, 0x6e8a, 0xfbe5, 0x6f8a, 0x708a, 0x718a, 0x728a, 0xcab6, 0xcbbc, 0x738a, 0x748a, 0xfdd1, 0xa1e6, 0x758a, 0xeec3, 0x768a, 0x778a, 0x788a, 0x798a, 0xa4e6, 0x7a8a, 0x7b8a, 0x7c8a, 0x7d8a, 0xfee5, 0xa5e6, 0xd7cd, 0x7e8a, 0x808a, 0xc1b7, 0xfce5, 0xfde5, 0xa3e6, 0x818a, 0x828a, 0xddc4, 0xa8e6, 0x838a, 0x848a, 0xa7e6, 0x858a, 0x868a, 0x878a, 0x888a, 0x898a, 0x8a8a, 0xc3c3, 0x8b8a, 0xdec6, 0x8c8a, 0x8d8a, 0xaae6, 0x8e8a, 0x8f8a, 0x908a, 0x918a, 0x928a, 0x938a, 0x948a, 0xb7c4, 0x958a, 0x968a, 0x978a, 0xa2e6, 0xbcca, 0x988a, 0x998a, 0x9a8a, 0x9b8a, 0xe3bd, 0xc3b9, 0xa6e6, 0xd5d0, 0xafce, 0x9c8a, 0x9d8a, 0xa9e6, 0xb0e6, 0x9e8a, 0xa6d2, 0x9f8a, 0xaabd, 0xade6, 0xa08a, 0xa18a, 0xa28a, 0xa38a, 0xa48a, 0xafe6, 0xa58a, 0xd1c0, 0xa68a, 0xa78a, 0xccd2, 0xa88a, 0xa98a, 0xaa8a, 0xa7bc, 0xab8a, 0xac8a, 0xad8a, 0xae8a, 0xaf8a, 0xb08a, 0xb18a, 0xb28a, 0xb38a, 0xb48a, 0xb58a, 0xb68a, 0xb1e6, 0xb78a, 0xf6d2, 0xb88a, 0xb98a, 0xba8a, 0xcbd7, 0xbb8a, 0xfecd, 0xbc8a, 0xdecd, 0xa6c2, 0xabe6, 0xace6, 0xbfbd, 0xaee6, 0xb3e6, 0xbd8a, 0xbe8a, 0xb2e6, 0xbf8a, 0xc08a, 0xc18a, 0xc28a, 0xb6e6, 0xc38a, 0xb8e6, 0xc48a, 0xc58a, 0xc68a, 0xc78a, 0xefc4, 0xc88a, 0xc98a, 0xca8a, 0xc8c4, 0xcb8a, 0xcc8a, 0xeabe, 0xefc9, 0xcd8a, 0xce8a, 0xb7e6, 0xcf8a, 0xf0b6, 0xd08a, 0xd18a, 0xd28a, 0xe4c3, 0xd38a, 0xd48a, 0xd58a, 0xd68a, 0xd78a, 0xd88a, 0xd98a, 0xe9d3, 0xb4e6, 0xda8a, 0xb5e6, 0xdb8a, 0xa2c8, 0xdc8a, 0xdd8a, 0xde8a, 0xdf8a, 0xe08a, 0xbde6, 0xe18a, 0xe28a, 0xe38a, 0xb9e6, 0xe48a, 0xe58a, 0xe68a, 0xe78a, 0xe88a, 0xc5c6, 0xe98a, 0xea8a, 0xf1cd, 0xbbe6, 0xeb8a, 0xec8a, 0xed8a, 0xee8a, 0xef8a, 0xf08a, 0xf18a, 0xf28a, 0xf38a, 0xf48a, 0xbce6, 0xf58a, 0xf68a, 0xf78a, 0xf88a, 0xe9bb, 0xf98a, 0xfa8a, 0xfb8a, 0xfc8a, 0xfd8a, 0xfe8a, 0x408b, 0xbee6, 0x418b, 0x428b, 0x438b, 0x448b, 0xbae6, 0x458b, 0x468b, 0xb7c0, 0x478b, 0x488b, 0x498b, 0x4a8b, 0x4b8b, 0x4c8b, 0x4d8b, 0x4e8b, 0x4f8b, 0xa4d3, 0xbfe6, 0xf4c9, 0xc3e6, 0x508b, 0x518b, 0xc4e6, 0x528b, 0x538b, 0x548b, 0x558b, 0xf6d0, 0x568b, 0x578b, 0x588b, 0x598b, 0x5a8b, 0x5b8b, 0x5c8b, 0x5d8b, 0x5e8b, 0x5f8b, 0x608b, 0x618b, 0x628b, 0x638b, 0x648b, 0x658b, 0x668b, 0x678b, 0xbdc3, 0x688b, 0x698b, 0x6a8b, 0x6b8b, 0x6c8b, 0x6d8b, 0x6e8b, 0xc4c3, 0xc2e6, 0x6f8b, 0x708b, 0x718b, 0x728b, 0x738b, 0x748b, 0x758b, 0x768b, 0x778b, 0x788b, 0x798b, 0x7a8b, 0x7b8b, 0x7c8b, 0xc1e6, 0x7d8b, 0x7e8b, 0x808b, 0x818b, 0x828b, 0x838b, 0x848b, 0xc7e6, 0xb1cf, 0x858b, 0xf4eb, 0x868b, 0x878b, 0xcae6, 0x888b, 0x898b, 0x8a8b, 0x8b8b, 0x8c8b, 0xc5e6, 0x8d8b, 0x8e8b, 0xdebc, 0xa9c9, 0x8f8b, 0x908b, 0x918b, 0x928b, 0x938b, 0x948b, 0xb5bc, 0x958b, 0x968b, 0xd3cf, 0x978b, 0x988b, 0x998b, 0x9a8b, 0x9b8b, 0xc8e6, 0x9c8b, 0xc9e6, 0x9d8b, 0xcee6, 0x9e8b, 0xd0e6, 0x9f8b, 0xa08b, 0xa18b, 0xd1e6, 0xa28b, 0xa38b, 0xa48b, 0xcbe6, 0xd5b5, 0xa58b, 0xcce6, 0xa68b, 0xa78b, 0xcfe6, 0xa88b, 0xa98b, 0xdbc4, 0xaa8b, 0xc6e6, 0xab8b, 0xac8b, 0xad8b, 0xae8b, 0xaf8b, 0xcde6, 0xb08b, 0xb18b, 0xb28b, 0xb38b, 0xb48b, 0xb58b, 0xb68b, 0xb78b, 0xb88b, 0xb98b, 0xba8b, 0xbb8b, 0xbc8b, 0xbd8b, 0xbe8b, 0xbf8b, 0xc08b, 0xc18b, 0xc28b, 0xc38b, 0xc48b, 0xc58b, 0xc68b, 0xd2e6, 0xc78b, 0xc88b, 0xc98b, 0xca8b, 0xcb8b, 0xcc8b, 0xcd8b, 0xce8b, 0xcf8b, 0xd08b, 0xd18b, 0xd28b, 0xd4e6, 0xd3e6, 0xd38b, 0xd48b, 0xd58b, 0xd68b, 0xd78b, 0xd88b, 0xd98b, 0xda8b, 0xdb8b, 0xdc8b, 0xdd8b, 0xde8b, 0xdf8b, 0xe08b, 0xe18b, 0xe28b, 0xe38b, 0xe48b, 0xe58b, 0xe68b, 0xe78b, 0xe88b, 0xe98b, 0xea8b, 0xeb8b, 0xec8b, 0xd5e6, 0xed8b, 0xf8d9, 0xee8b, 0xef8b, 0xd6e6, 0xf08b, 0xf18b, 0xf28b, 0xf38b, 0xf48b, 0xf58b, 0xf68b, 0xf78b, 0xd7e6, 0xf88b, 0xf98b, 0xfa8b, 0xfb8b, 0xfc8b, 0xfd8b, 0xfe8b, 0x408c, 0x418c, 0x428c, 0x438c, 0x448c, 0x458c, 0x468c, 0x478c, 0xd3d7, 0xdde6, 0x488c, 0xdee6, 0xd7bf, 0xd0d4, 0x498c, 0xd6d7, 0xe6b4, 0xefcb, 0xdae6, 0xc3d8, 0xced7, 0xa2d0, 0x4a8c, 0xcfc3, 0x4b8c, 0x4c8c, 0xdfe6, 0xbebc, 0xc2b9, 0xdbe6, 0xa7d1, 0x4d8c, 0x4e8c, 0xa2ba, 0xcfc2, 0x4f8c, 0xabd8, 0x508c, 0x518c, 0x528c, 0xebca, 0xeee5, 0x538c, 0xdce6, 0x548c, 0xf5b7, 0x558c, 0x568c, 0x578c, 0x588c, 0xe6c8, 0x598c, 0x5a8c, 0xf5c4, 0x5b8c, 0x5c8c, 0xb2e5, 0xfec4, 0x5d8c, 0xfccb, 0xb3e5, 0xacd5, 0x5e8c, 0xeed3, 0xd8ca, 0xb2b0, 0x5f8c, 0xcecb, 0xeacd, 0x608c, 0x618c, 0xeaba, 0x628c, 0x638c, 0x648c, 0xb5e5, 0x658c, 0xb4e5, 0x668c, 0xdad7, 0xd9b9, 0xe6d6, 0xa8b6, 0xf0cd, 0xcbd2, 0xa6b1, 0xb5ca, 0x678c, 0xe8b3, 0xf3c9, 0xcdbf, 0xfbd0, 0xd2ca, 0xb6e5, 0xc2bb, 0x688c, 0x698c, 0x6a8c, 0xdccf, 0xacb9, 0x6b8c, 0x6c8c, 0x6d8c, 0x6e8c, 0xd7d4, 0x6f8c, 0x708c, 0xa6ba, 0xe7d1, 0xfccf, 0xd2bc, 0x718c, 0xb7e5, 0xddc8, 0x728c, 0x738c, 0x748c, 0xedbf, 0xf6b1, 0xdecb, 0x758c, 0x768c, 0xc5bc, 0x778c, 0xc4bc, 0xfad2, 0xdcc3, 0xdcbf, 0x788c, 0x798c, 0x7a8c, 0x7b8c, 0xbbb8, 0x7c8c, 0x7d8c, 0x7e8c, 0xc2c3, 0x808c, 0xaeba, 0xa2d4, 0x818c, 0x828c, 0x838c, 0x848c, 0x858c, 0x868c, 0x878c, 0x888c, 0x898c, 0xdec7, 0xafc4, 0xecb2, 0x8a8c, 0xd1b9, 0x8b8c, 0x8c8c, 0xbbe5, 0xc8c1, 0x8d8c, 0x8e8c, 0xafd5, 0x8f8c, 0x908c, 0x918c, 0x928c, 0x938c, 0xbce5, 0x948c, 0xbee5, 0x958c, 0x968c, 0x978c, 0x988c, 0x998c, 0x9a8c, 0x9b8c, 0xe7b4, 0xd4b6, 0xc2cb, 0xb0d1, 0xbcb5, 0x9c8c, 0x9d8c, 0xd9ca, 0x9e8c, 0xe2b7, 0x9f8c, 0xa08c, 0xe4c9, 0xa18c, 0xabbd, 0xa28c, 0xa38c, 0xbece, 0xf0d7, 0xa48c, 0xa58c, 0xa68c, 0xa78c, 0xa1d0, 0xa88c, 0xd9c9, 0xa98c, 0xaa8c, 0xfbb6, 0xd8e6, 0xe2bc, 0xab8c, 0xbeb3, 0xac8c, 0xd0c9, 0xad8c, 0xd9e6, 0xa2b3, 0xae8c, 0xaf8c, 0xb08c, 0xb18c, 0xccde, 0xb28c, 0xc8d3, 0xcdde, 0xb38c, 0xa2d2, 0xb48c, 0xb58c, 0xb68c, 0xb78c, 0xcede, 0xb88c, 0xb98c, 0xba8c, 0xbb8c, 0xcdbe, 0xbc8c, 0xbd8c, 0xcfde, 0xbe8c, 0xbf8c, 0xc08c, 0xacca, 0xfcd2, 0xdfb3, 0xeae5, 0xe1c4, 0xa1be, 0xb2ce, 0xf2c4, 0xd6be, 0xa8c6, 0xe3b2, 0xc18c, 0xc28c, 0xd3be, 0xc38c, 0xc48c, 0xfcc7, 0xebcc, 0xecbd, 0xddce, 0xc58c, 0xc68c, 0xbaca, 0xc1c6, 0xece5, 0xbcd0, 0xc78c, 0xc88c, 0xc98c, 0xb9d5, 0xca8c, 0xcb8c, 0xcc8c, 0xede5, 0xcd8c, 0xce8c, 0xcf8c, 0xd08c, 0xf4ca, 0xd18c, 0xc0cd, 0xc5c2, 0xd28c, 0xefe5, 0xd38c, 0xc4c2, 0xf0e5, 0xd48c, 0xd58c, 0xd68c, 0xd78c, 0xd88c, 0xd98c, 0xda8c, 0xf8e5, 0xcdcd, 0xdb8c, 0xbdc9, 0xdc8c, 0xdd8c, 0xde8c, 0xdf8c, 0xe08c, 0xe18c, 0xe28c, 0xd9d2, 0xa8e1, 0xe38c, 0xe48c, 0xe58c, 0xe68c, 0xecd3, 0xe78c, 0xeacb, 0xf1c6, 0xe88c, 0xe98c, 0xea8c, 0xeb8c, 0xec8c, 0xace1, 0xed8c, 0xee8c, 0xef8c, 0xa7e1, 0xa9e1, 0xf08c, 0xf18c, 0xaae1, 0xafe1, 0xf28c, 0xf38c, 0xedb2, 0xf48c, 0xabe1, 0xdab8, 0xade1, 0xaee1, 0xb0e1, 0xbab5, 0xb1e1, 0xf58c, 0xf68c, 0xf78c, 0xf88c, 0xf98c, 0xb3e1, 0xb8e1, 0xfa8c, 0xfb8c, 0xfc8c, 0xfd8c, 0xfe8c, 0xd2d1, 0x408d, 0xb6e1, 0xb5e1, 0xebc1, 0x418d, 0x428d, 0x438d, 0xb7e1, 0x448d, 0xc0d4, 0x458d, 0xb2e1, 0x468d, 0xbae1, 0xb6b0, 0x478d, 0x488d, 0x498d, 0x4a8d, 0xb4e1, 0x4b8d, 0xf9bf, 0x4c8d, 0xb9e1, 0x4d8d, 0x4e8d, 0xbbe1, 0x4f8d, 0x508d, 0x518d, 0x528d, 0x538d, 0x548d, 0xbee1, 0x558d, 0x568d, 0x578d, 0x588d, 0x598d, 0x5a8d, 0xbce1, 0x5b8d, 0x5c8d, 0x5d8d, 0x5e8d, 0x5f8d, 0x608d, 0xc5d6, 0x618d, 0x628d, 0x638d, 0x648d, 0x658d, 0x668d, 0x678d, 0xbfcf, 0x688d, 0x698d, 0xbde1, 0xbfe1, 0xcdc2, 0x6a8d, 0xebb6, 0x6b8d, 0xf8d3, 0x6c8d, 0x6d8d, 0xcdc7, 0x6e8d, 0x6f8d, 0xe5b7, 0x708d, 0x718d, 0x728d, 0x738d, 0x748d, 0x758d, 0x768d, 0x778d, 0x788d, 0x798d, 0xfebe, 0x7a8d, 0x7b8d, 0x7c8d, 0x7d8d, 0x7e8d, 0x808d, 0xc0e1, 0xc1e1, 0x818d, 0x828d, 0xc7e1, 0xe7b3, 0x838d, 0x848d, 0x858d, 0x868d, 0x878d, 0x888d, 0xe9c6, 0x898d, 0x8a8d, 0x8b8d, 0x8c8d, 0x8d8d, 0xdeb4, 0x8e8d, 0xc2d1, 0x8f8d, 0x908d, 0x918d, 0x928d, 0xc8e1, 0x938d, 0x948d, 0xc6e1, 0x958d, 0x968d, 0x978d, 0x988d, 0x998d, 0xc5e1, 0x9a8d, 0xc3e1, 0xc2e1, 0x9b8d, 0xc0b1, 0x9c8d, 0x9d8d, 0x9e8d, 0xb8d5, 0xc4e1, 0x9f8d, 0xa08d, 0xa18d, 0xa28d, 0xa38d, 0xcbe1, 0xa48d, 0xa58d, 0xa68d, 0xa78d, 0xa88d, 0xa98d, 0xaa8d, 0xab8d, 0xcce1, 0xcae1, 0xac8d, 0xad8d, 0xae8d, 0xaf8d, 0xb08d, 0xb18d, 0xb28d, 0xb38d, 0xfaef, 0xb48d, 0xb58d, 0xd3e1, 0xd2e1, 0xb6c7, 0xb68d, 0xb78d, 0xb88d, 0xb98d, 0xba8d, 0xbb8d, 0xbc8d, 0xbd8d, 0xbe8d, 0xbf8d, 0xc08d, 0xc9e1, 0xc18d, 0xc28d, 0xcee1, 0xc38d, 0xd0e1, 0xc48d, 0xc58d, 0xc68d, 0xc78d, 0xc88d, 0xc98d, 0xca8d, 0xcb8d, 0xcc8d, 0xcd8d, 0xce8d, 0xd4e1, 0xcf8d, 0xd1e1, 0xcde1, 0xd08d, 0xd18d, 0xcfe1, 0xd28d, 0xd38d, 0xd48d, 0xd58d, 0xd5e1, 0xd68d, 0xd78d, 0xd88d, 0xd98d, 0xda8d, 0xdb8d, 0xdc8d, 0xdd8d, 0xde8d, 0xdf8d, 0xe08d, 0xe18d, 0xe28d, 0xd6e1, 0xe38d, 0xe48d, 0xe58d, 0xe68d, 0xe78d, 0xe88d, 0xe98d, 0xea8d, 0xeb8d, 0xec8d, 0xed8d, 0xee8d, 0xef8d, 0xf08d, 0xf18d, 0xf28d, 0xf38d, 0xf48d, 0xf58d, 0xf68d, 0xf78d, 0xf88d, 0xd7e1, 0xf98d, 0xfa8d, 0xfb8d, 0xd8e1, 0xfc8d, 0xfd8d, 0xfe8d, 0x408e, 0x418e, 0x428e, 0x438e, 0x448e, 0x458e, 0x468e, 0x478e, 0x488e, 0x498e, 0x4a8e, 0x4b8e, 0x4c8e, 0x4d8e, 0x4e8e, 0x4f8e, 0x508e, 0x518e, 0x528e, 0x538e, 0x548e, 0x558e, 0xdae1, 0x568e, 0x578e, 0x588e, 0x598e, 0x5a8e, 0x5b8e, 0x5c8e, 0x5d8e, 0x5e8e, 0x5f8e, 0x608e, 0x618e, 0x628e, 0xdbe1, 0x638e, 0x648e, 0x658e, 0x668e, 0x678e, 0x688e, 0x698e, 0xa1ce, 0x6a8e, 0x6b8e, 0x6c8e, 0x6d8e, 0x6e8e, 0x6f8e, 0x708e, 0x718e, 0x728e, 0x738e, 0x748e, 0x758e, 0x768e, 0xdde7, 0x778e, 0xa8b4, 0xddd6, 0x788e, 0x798e, 0xb2d1, 0xb2b3, 0x7a8e, 0x7b8e, 0xa4b9, 0xf3d7, 0xc9c7, 0xdebe, 0xaeb9, 0x7c8e, 0xd7ce, 0x7d8e, 0x7e8e, 0xeeb2, 0xcfdb, 0x808e, 0xbabc, 0xd1d2, 0xc8cb, 0xcdb0, 0x818e, 0x828e, 0xefcf, 0x838e, 0x848e, 0x858e, 0x868e, 0x878e, 0xe3d9, 0xedbd, 0x888e, 0x898e, 0xd2b1, 0xd0ca, 0xbcb2, 0x8a8e, 0xa7cb, 0xabb7, 0x8b8e, 0xa6ca, 0x8c8e, 0x8d8e, 0x8e8e, 0xa3cf, 0x8f8e, 0x908e, 0xf8e0, 0xcad5, 0xfbe0, 0x918e, 0x928e, 0xfae0, 0xc1c5, 0xfbcc, 0x938e, 0xb1c1, 0xf9e0, 0xe3d6, 0xafb2, 0xc4d6, 0xdbb5, 0x948e, 0x958e, 0x968e, 0x978e, 0x988e, 0x998e, 0x9a8e, 0x9b8e, 0xf8b4, 0xa1d6, 0x9c8e, 0x9d8e, 0x9e8e, 0x9f8e, 0xa08e, 0xafcf, 0xefb0, 0xa18e, 0xa28e, 0xfce0, 0xa38e, 0xa48e, 0xa58e, 0xa68e, 0xa78e, 0xa1e1, 0xa3b3, 0xa88e, 0xa98e, 0xfde0, 0xfee0, 0xb1c3, 0xaa8e, 0xab8e, 0xac8e, 0xad8e, 0xddc3, 0xae8e, 0xa2e1, 0xf9b7, 0xaf8e, 0xb08e, 0xb18e, 0xb28e, 0xb38e, 0xb48e, 0xcfbb, 0xb58e, 0xb68e, 0xb78e, 0xb88e, 0xb98e, 0xba8e, 0xbb8e, 0xa3e1, 0xbbc4, 0xbc8e, 0xbd8e, 0xbe8e, 0xbf8e, 0xc08e, 0xa4e1, 0xc18e, 0xc28e, 0xa5e1, 0xc38e, 0xc48e, 0xa6e1, 0xb1b4, 0xc58e, 0xc68e, 0xc78e, 0xc88e, 0xc98e, 0xca8e, 0xcb8e, 0xcc8e, 0xcd8e, 0xce8e, 0xcf8e, 0xd08e, 0xd18e, 0xd28e, 0xd38e, 0xc9b8, 0xbdc6, 0xeac4, 0xd48e, 0xa2b2, 0xd58e, 0xd2d0, 0xd68e, 0xdbe7, 0xc3bb, 0xd7d3, 0xc4d3, 0xd78e, 0xe3b9, 0xcfe2, 0xd88e, 0xd98e, 0xda8e, 0xafd7, 0xdb8e, 0xecc7, 0xd3b1, 0xdc8e, 0xdd8e, 0xb2b4, 0xd1e2, 0xde8e, 0xdf8e, 0xe08e, 0xf2d0, 0xaec2, 0xd0e2, 0xe18e, 0xe2bf, 0xa6d3, 0xd7b5, 0xd2e2, 0xeab5, 0xe28e, 0xedc3, 0xfdb8, 0xe38e, 0xaeb8, 0xe48e, 0xd3c5, 0xcfb7, 0xd4e2, 0xe58e, 0xe68e, 0xe78e, 0xe88e, 0xd3e2, 0xc8b6, 0xf9d7, 0xe98e, 0xea8e, 0xeb8e, 0xec8e, 0xed8e, 0xa5cd, 0xee8e, 0xef8e, 0xf08e, 0xf18e, 0xf28e, 0xd8e2, 0xf38e, 0xd6e2, 0xfcca, 0xb5bf, 0xb9d3, 0xd5e2, 0xf48e, 0xf58e, 0xf68e, 0xf78e, 0xd7e2, 0xf88e, 0xf98e, 0xfa8e, 0xfb8e, 0xfc8e, 0xfd8e, 0xfe8e, 0x408f, 0x418f, 0x428f, 0xaec1, 0xc8c0, 0x438f, 0x448f, 0x458f, 0x468f, 0x478f, 0x488f, 0xdbe2, 0xdae2, 0xaac0, 0x498f, 0x4a8f, 0xcec1, 0x4b8f, 0x4c8f, 0x4d8f, 0x4e8f, 0xdce2, 0x4f8f, 0x508f, 0x518f, 0x528f, 0x538f, 0x548f, 0x558f, 0x568f, 0x578f, 0x588f, 0x598f, 0x5a8f, 0xdde2, 0x5b8f, 0xdee2, 0x5c8f, 0x5d8f, 0x5e8f, 0x5f8f, 0x608f, 0x618f, 0x628f, 0x638f, 0x648f, 0xc8db, 0x658f, 0xd3d1, 0xa2cd, 0x668f, 0x678f, 0xa8bd, 0x688f, 0x698f, 0x6a8f, 0xc3de, 0xa5d8, 0xaabf, 0xcddb, 0xecd2, 0xfac6, 0xaac5, 0x6b8f, 0x6c8f, 0x6d8f, 0xc4de, 0x6e8f, 0xd7b1, 0xaedf, 0x6f8f, 0x708f, 0x718f, 0xbdca, 0x728f, 0xb1df, 0x738f, 0xadb9, 0x748f, 0xfdd2, 0x758f, 0xa5b8, 0xebba, 0x768f, 0x778f, 0xdab3, 0x788f, 0x798f, 0x7a8f, 0xdcb5, 0xc5d5, 0x7b8f, 0x7c8f, 0x7d8f, 0x7e8f, 0xd6c3, 0xd2cf, 0xa1bb, 0x808f, 0xf3e5, 0xf2e5, 0x818f, 0x828f, 0xf4e5, 0x838f, 0xe4cd, 0x848f, 0xf5c8, 0x858f, 0x868f, 0x878f, 0x888f, 0x898f, 0x8a8f, 0x8b8f, 0xafb5, 0xbfc7, 0x8c8f, 0xf6e5, 0x8d8f, 0x8e8f, 0x8f8f, 0xb0ec, 0x908f, 0x918f, 0x928f, 0x938f, 0x948f, 0x958f, 0x968f, 0x978f, 0x988f, 0x998f, 0x9a8f, 0x9b8f, 0x9c8f, 0x9d8f, 0x9e8f, 0xe6e5, 0x9f8f, 0xe9b9, 0xb1b5, 0xa08f, 0xbcc2, 0xe8e5, 0xe7e5, 0xe9e5, 0xa18f, 0xa28f, 0xa38f, 0xa48f, 0xcdd2, 0xa58f, 0xa68f, 0xa78f, 0xeae1, 0xced0, 0xa88f, 0xaecd, 0xa98f, 0xe5d1, 0xaa8f, 0xab8f, 0xcab2, 0xebb1, 0xac8f, 0xf2b1, 0xedc5, 0xad8f, 0xae8f, 0xc3d5, 0xb0d3, 0xaf8f, 0xdce1, 0xb08f, 0xb18f, 0xb28f, 0xdde1, 0xb38f, 0xdbd2, 0xb48f, 0xb9b3, 0xcbb1, 0xb58f, 0xb68f, 0xb78f, 0xf9cd, 0xf7d5, 0xdee1, 0xb88f, 0xb6be, 0xfdb4, 0xb98f, 0xdfe1, 0xdcba, 0xe0e1, 0xb2bb, 0xc9c2, 0xe1e1, 0xba8f, 0xbb8f, 0xbc8f, 0xecd0, 0xbd8f, 0xbdcd, 0xbe8f, 0xbf8f, 0xe2e1, 0xc08f, 0xc3b5, 0xc7c5, 0xe3e1, 0xc18f, 0xc28f, 0xe4e1, 0xc38f, 0xc48f, 0xc58f, 0xc68f, 0xf9d3, 0xc78f, 0xc88f, 0xc98f, 0xca8f, 0xcb8f, 0xcc8f, 0xe5e1, 0xcd8f, 0xadd1, 0xce8f, 0xcf8f, 0xe6e1, 0xa2ce, 0xd08f, 0xd18f, 0xd28f, 0xd38f, 0xd48f, 0xd58f, 0xe7e1, 0xd68f, 0xc2b5, 0xd78f, 0xd88f, 0xd98f, 0xda8f, 0xe8e1, 0xd5bb, 0xdb8f, 0xdc8f, 0xdd8f, 0xde8f, 0xdf8f, 0xc4d0, 0xe0e2, 0xd8b1, 0xe4d2, 0xe08f, 0xe18f, 0xe1e2, 0xe28f, 0xe38f, 0xc9bc, 0xccc8, 0xe48f, 0xe3e2, 0xfeec, 0xfdec, 0xafdf, 0xe58f, 0xe68f, 0xe78f, 0xe2e2, 0xbed6, 0xfccd, 0xa6c3, 0xe88f, 0xe98f, 0xea8f, 0xc3e3, 0xeb8f, 0xec8f, 0xd2d6, 0xe7e2, 0xed8f, 0xee8f, 0xe8e2, 0xef8f, 0xf08f, 0xc7d3, 0xf18f, 0xf28f, 0xece2, 0xecbf, 0xf38f, 0xede2, 0xe5e2, 0xf48f, 0xf58f, 0xc0b3, 0xf68f, 0xf78f, 0xf88f, 0xeec4, 0xf98f, 0xfa8f, 0xeee2, 0xfb8f, 0xfc8f, 0xc3d0, 0xfd8f, 0xf6ba, 0xe9e2, 0xdeb7, 0xb3bb, 0xaccc, 0xcbcb, 0xe4e2, 0xe6e2, 0xeae2, 0xebe2, 0xfe8f, 0x4090, 0x4190, 0xf7e2, 0x4290, 0x4390, 0xf4e2, 0xf5d4, 0xf3e2, 0x4490, 0x4590, 0xadc5, 0x4690, 0xfad5, 0xc2c5, 0xc0b2, 0x4790, 0x4890, 0xefe2, 0x4990, 0xf2e2, 0xafc1, 0xbccb, 0x4a90, 0x4b90, 0xa1b5, 0xf9e2, 0x4c90, 0x4d90, 0x4e90, 0xb1bc, 0xf1e2, 0xd4d0, 0xb9d4, 0xf5e2, 0xd6b9, 0xf6e2, 0x4f90, 0x5090, 0x5190, 0xd3c7, 0x5290, 0x5390, 0x5490, 0x5590, 0x5690, 0xf0e2, 0x5790, 0x5890, 0x5990, 0x5a90, 0x5b90, 0xdcd7, 0xa1ed, 0x5c90, 0x5d90, 0xf8e2, 0x5e90, 0xa5ed, 0xfee2, 0xd1ca, 0x5f90, 0x6090, 0x6190, 0x6290, 0x6390, 0x6490, 0x6590, 0xb5c1, 0x6690, 0xd0bb, 0x6790, 0x6890, 0xd6bf, 0x6990, 0xe3ba, 0x6a90, 0x6b90, 0xa1cb, 0x6c90, 0x6d90, 0x6e90, 0xa6ed, 0xa3ed, 0x6f90, 0x7090, 0xa2ed, 0x7190, 0x7290, 0x7390, 0x7490, 0xd6bb, 0xa7ed, 0xf4d0, 0x7590, 0x7690, 0xa4ed, 0xdeba, 0xf7b6, 0xa1e3, 0xb2b6, 0xf1cc, 0xa7b9, 0x7790, 0xa2cf, 0xa1c7, 0x7890, 0x7990, 0xd2bf, 0x7a90, 0x7b90, 0xf1b6, 0x7c90, 0xfae2, 0xfbe2, 0xfde2, 0xfce2, 0xd5c4, 0xa2e3, 0x7d90, 0xc1d3, 0x7e90, 0x8090, 0x8190, 0xa7e3, 0xc4c7, 0x8290, 0x8390, 0x8490, 0x8590, 0xa4cf, 0x8690, 0x8790, 0xa9e3, 0xb7ba, 0x8890, 0x8990, 0x8a90, 0x8b90, 0xa8e3, 0x8c90, 0xdabb, 0x8d90, 0xa3e3, 0x8e90, 0x8f90, 0x9090, 0xa4e3, 0xaae3, 0x9190, 0xa6e3, 0x9290, 0xf2ce, 0xc6d3, 0x9390, 0x9490, 0xbcbb, 0x9590, 0x9690, 0xc3d4, 0x9790, 0xfac4, 0x9890, 0x9990, 0xa8ed, 0xfcd0, 0xa5e3, 0x9a90, 0xf5c3, 0x9b90, 0xade3, 0xafb1, 0x9c90, 0xb2e3, 0x9d90, 0x9e90, 0x9f90, 0xc2bc, 0xa090, 0xa190, 0xace3, 0xbfb5, 0xa290, 0xa390, 0xa490, 0xa590, 0xa690, 0xa790, 0xa890, 0xa990, 0xe9c7, 0xb0e3, 0xaa90, 0xab90, 0xac90, 0xaabe, 0xefcd, 0xad90, 0xae90, 0xaf90, 0xb090, 0xb190, 0xf3bb, 0xb290, 0xb390, 0xb490, 0xe8cc, 0xb590, 0xb690, 0xafe3, 0xb790, 0xb1e3, 0xb890, 0xa7cf, 0xaee3, 0xb990, 0xa9ce, 0xddbb, 0xba90, 0xbb90, 0xbc90, 0xbd90, 0xbe90, 0xebb5, 0xe5be, 0xd2b2, 0xcdb3, 0xbf90, 0xb9b1, 0xabe3, 0xd1b2, 0xacb5, 0xdfb9, 0xe8b6, 0xc090, 0xc190, 0xebcf, 0xb7e3, 0xc290, 0xccbb, 0xc390, 0xc490, 0xc7c8, 0xcad0, 0xc590, 0xc690, 0xc790, 0xc890, 0xc990, 0xb8e3, 0xeeb3, 0xca90, 0xcb90, 0xcc90, 0xcd90, 0xa9ed, 0xce90, 0xfad3, 0xe4d3, 0xcf90, 0xd090, 0xd190, 0xaaed, 0xb9e3, 0xe2d2, 0xd290, 0xd390, 0xd490, 0xd590, 0xd690, 0xb5e3, 0xd790, 0xd890, 0xd990, 0xda90, 0xded3, 0xdb90, 0xdc90, 0xdd90, 0xde90, 0xd0b8, 0xb3e3, 0xdf90, 0xe090, 0xb6e3, 0xdfb7, 0xe190, 0xb4e3, 0xa2c0, 0xe290, 0xe390, 0xe490, 0xbae3, 0xe590, 0xe690, 0xe790, 0xe890, 0xe990, 0xea90, 0xeb90, 0xec90, 0xed90, 0xee90, 0xef90, 0xf090, 0xf190, 0xf290, 0xf390, 0xf490, 0xf590, 0xf690, 0xf790, 0xb8d4, 0xf890, 0xf990, 0xfa90, 0xfb90, 0xfc90, 0xfd90, 0xfe90, 0x4091, 0xc8b4, 0x4191, 0xbbe3, 0x4291, 0xc5bb, 0x4391, 0xf7c9, 0x4491, 0x4591, 0xe5c9, 0x4691, 0x4791, 0x4891, 0xbdc4, 0x4991, 0x4a91, 0x4b91, 0x4c91, 0x4d91, 0x4e91, 0x4f91, 0xabed, 0x5091, 0x5191, 0x5291, 0x5391, 0xfdc2, 0x5491, 0x5591, 0x5691, 0x5791, 0xdbbb, 0xaebf, 0x5891, 0x5991, 0x5a91, 0x5b91, 0x5c91, 0x5d91, 0x5e91, 0xbfce, 0x5f91, 0x6091, 0x6191, 0x6291, 0xbce3, 0x6391, 0xb6bf, 0x6491, 0x6591, 0x6691, 0x6791, 0x6891, 0x6991, 0x6a91, 0x6b91, 0x6c91, 0x6d91, 0x6e91, 0x6f91, 0x7091, 0x7191, 0x7291, 0x7391, 0x7491, 0x7591, 0x7691, 0xefb1, 0x7791, 0x7891, 0xf7d4, 0x7991, 0x7a91, 0x7b91, 0x7c91, 0x7d91, 0xbee3, 0x7e91, 0x8091, 0x8191, 0x8291, 0x8391, 0x8491, 0x8591, 0x8691, 0xaded, 0x8791, 0x8891, 0x8991, 0x8a91, 0x8b91, 0x8c91, 0x8d91, 0x8e91, 0x8f91, 0xbfe3, 0xa9ba, 0xaced, 0x9091, 0x9191, 0xbde3, 0x9291, 0x9391, 0x9491, 0x9591, 0x9691, 0x9791, 0x9891, 0x9991, 0x9a91, 0x9b91, 0xc0e3, 0x9c91, 0x9d91, 0x9e91, 0x9f91, 0xa091, 0xa191, 0xb6ba, 0xa291, 0xa391, 0xa491, 0xaeb6, 0xa591, 0xa691, 0xa791, 0xa891, 0xa991, 0xb8d0, 0xaa91, 0xc3b0, 0xaeed, 0xab91, 0xac91, 0xad91, 0xae91, 0xaf91, 0xafed, 0xc1c0, 0xb091, 0xc1e3, 0xb191, 0xb291, 0xb391, 0xb491, 0xb591, 0xb691, 0xb791, 0xb891, 0xb991, 0xba91, 0xbb91, 0xbc91, 0xbd91, 0xbe91, 0xbf91, 0xc091, 0xc191, 0xb3c5, 0xc291, 0xc391, 0xc491, 0xc591, 0xc691, 0xc791, 0xc891, 0xc991, 0xca91, 0xcb91, 0xcc91, 0xcd91, 0xce91, 0xcf91, 0xc2e3, 0xd091, 0xd191, 0xd291, 0xd391, 0xd491, 0xd591, 0xd691, 0xd791, 0xd891, 0xb2dc, 0xd991, 0xda91, 0xdb91, 0xdc91, 0xdd91, 0xde91, 0xb0ed, 0xdf91, 0xeab8, 0xe091, 0xecce, 0xa7ea, 0xe7d0, 0xf9ca, 0xd6c8, 0xb7cf, 0xc9b3, 0xd2ce, 0xe4bd, 0xe191, 0xe291, 0xdee3, 0xf2bb, 0xa8ea, 0xbdd5, 0xe391, 0xddc6, 0xa9ea, 0xe491, 0xe591, 0xe691, 0xaaea, 0xe791, 0xacea, 0xabea, 0xe891, 0xaeea, 0xadea, 0xe991, 0xea91, 0xeb91, 0xec91, 0xd8bd, 0xed91, 0xafea, 0xee91, 0xbec2, 0xef91, 0xf091, 0xf191, 0xf291, 0xc1b4, 0xf7b4, 0xf391, 0xf491, 0xa7bb, 0xf591, 0xf691, 0xf791, 0xf891, 0xf991, 0xe6ec, 0xe5ec, 0xbfb7, 0xf9cb, 0xe2b1, 0xfa91, 0xe7ec, 0xfb91, 0xfc91, 0xfd91, 0xc8c9, 0xe8ec, 0xe9ec, 0xfe91, 0xd6ca, 0xd0de, 0xc5b2, 0xfad4, 0x4092, 0x4192, 0xcbc6, 0xc7b0, 0xf2b4, 0xd3c8, 0x4292, 0x4392, 0x4492, 0xd0cd, 0x4592, 0x4692, 0xb8bf, 0x4792, 0x4892, 0x4992, 0x4a92, 0x4b92, 0x4c92, 0x4d92, 0xdbbf, 0x4e92, 0x4f92, 0xa4c7, 0xb4d6, 0x5092, 0xa9c0, 0xd1de, 0xa8c9, 0xefd1, 0xa4c5, 0xe7b0, 0xb6b3, 0xc5c8, 0x5192, 0x5292, 0xe2b0, 0x5392, 0x5492, 0xf6b7, 0x5592, 0x5692, 0xfac5, 0x5792, 0x5892, 0xf3b6, 0x5992, 0xd2d5, 0xd0b3, 0xbcbc, 0x5a92, 0x5b92, 0x5c92, 0xadb3, 0x5d92, 0x5e92, 0x5f92, 0x6092, 0xf1be, 0xd1b0, 0x6192, 0x6292, 0x6392, 0x6492, 0x6592, 0x6692, 0xd6d2, 0xe3ca, 0xa5d7, 0x6792, 0xb6cd, 0xb6b6, 0xb9bf, 0xdbd5, 0x6892, 0xa7b8, 0xd7c5, 0x6992, 0x6a92, 0x6b92, 0xd2de, 0xd9bf, 0xd5c2, 0xc0c7, 0x6c92, 0xa4bb, 0xa8b1, 0x6d92, 0x6e92, 0xeac5, 0x6f92, 0x7092, 0xfbc5, 0xa7cc, 0x7192, 0x7292, 0x7392, 0x7492, 0xa7b1, 0x7592, 0x7692, 0x7792, 0xd6b5, 0x7892, 0x7992, 0x7a92, 0xa8c4, 0x7b92, 0xd3de, 0xbad1, 0xe9b3, 0x7c92, 0xf2c3, 0x7d92, 0x7e92, 0xf7b7, 0x8092, 0xf4d6, 0xa3b5, 0xf0b2, 0xb4c4, 0xe9c4, 0xadc0, 0xd4de, 0x8192, 0xe8b0, 0xc4c5, 0xe0c1, 0x8292, 0xd5b9, 0x8392, 0xdcbe, 0xd8cd, 0xceb0, 0x8492, 0xcfcd, 0xd6de, 0xd0be, 0xbed7, 0xd5de, 0xd0d5, 0xddb0, 0x8592, 0x8692, 0xe2c4, 0x8792, 0x8892, 0xa3c2, 0xf0bc, 0x8992, 0xb5d3, 0xb9c0, 0xa1c5, 0xa6b2, 0xf1d4, 0x8a92, 0x8b92, 0xa8c0, 0xc3ca, 0xd7de, 0xfcd5, 0x8c92, 0xb0b9, 0x8d92, 0xadc8, 0xa9cb, 0x8e92, 0xd9de, 0xbdbf, 0x8f92, 0x9092, 0x9192, 0x9292, 0xb4c6, 0xa7d7, 0xb0ca, 0xc3c4, 0x9392, 0xd6b3, 0xd2b9, 0x9492, 0x9592, 0x9692, 0x9792, 0xb8d6, 0xfcea, 0xb4b0, 0x9892, 0x9992, 0x9a92, 0x9b92, 0xe6bf, 0x9c92, 0x9d92, 0xf4cc, 0x9e92, 0x9f92, 0xa092, 0xa192, 0xdacd, 0xa292, 0xa392, 0xa492, 0xbfd6, 0xcec2, 0xa592, 0xcece, 0xa2cc, 0xaed0, 0xd3c4, 0xb2b5, 0xd8de, 0xf5d5, 0xb7bc, 0xd3bb, 0xa692, 0xa792, 0xa4b0, 0xa892, 0xb2c5, 0xecb4, 0xa992, 0xaa92, 0xab92, 0xf1d5, 0xac92, 0xad92, 0xfdea, 0xae92, 0xaf92, 0xb092, 0xb192, 0xb292, 0xb392, 0xdade, 0xa6cd, 0xb492, 0xb592, 0xeccd, 0xb692, 0xb792, 0xb892, 0xb992, 0xe6ce, 0xdcde, 0xba92, 0xb1cd, 0xa6c0, 0xbb92, 0xbc92, 0xbdd7, 0xbd92, 0xdbde, 0xc6b0, 0xb4ba, 0xd3c9, 0xf3c4, 0xe8be, 0xbe92, 0xbf92, 0xc092, 0xc192, 0xb6b2, 0xc292, 0xc392, 0xc492, 0xc592, 0xc692, 0xc792, 0xc892, 0xc992, 0xccc0, 0xf0cb, 0xca92, 0xf1bc, 0xbbbb, 0xb7b5, 0xcb92, 0xcc92, 0xcd92, 0xf5c5, 0xce92, 0xe6de, 0xcf92, 0xd092, 0xd192, 0xe3de, 0xddbe, 0xd292, 0xd392, 0xdfde, 0xd492, 0xd592, 0xd692, 0xd792, 0xb7b4, 0xddbd, 0xd892, 0xd992, 0xe0de, 0xedc4, 0xda92, 0xdb92, 0xdc92, 0xdd92, 0xc6cf, 0xde92, 0xe0b5, 0xdf92, 0xe092, 0xe192, 0xe292, 0xdeb6, 0xdaca, 0xf4b5, 0xe5de, 0xe392, 0xc6d5, 0xe492, 0xe1de, 0xcdcc, 0xfec6, 0xe592, 0xc5c5, 0xe692, 0xe792, 0xe892, 0xb4d2, 0xe992, 0xf2be, 0xea92, 0xeb92, 0xec92, 0xed92, 0xee92, 0xef92, 0xf092, 0xd3c2, 0xf192, 0xbdcc, 0xb8b3, 0xf292, 0xd3bd, 0xf392, 0xd8bf, 0xc6cd, 0xdad1, 0xebb4, 0xf492, 0xe4de, 0xddde, 0xe7de, 0xf592, 0xfeea, 0xf692, 0xf792, 0xb0c2, 0xe2de, 0xf892, 0xf992, 0xc0d6, 0xa7b5, 0xfa92, 0xf4b2, 0xfb92, 0xe8de, 0xfc92, 0xf2de, 0xfd92, 0xfe92, 0x4093, 0x4193, 0x4293, 0xedde, 0x4393, 0xf1de, 0x4493, 0x4593, 0xe0c8, 0x4693, 0x4793, 0x4893, 0xe1d7, 0xefde, 0xe8c3, 0xe1cc, 0x4993, 0xe5b2, 0x4a93, 0x4b93, 0x4c93, 0xbed2, 0x4d93, 0x4e93, 0x4f93, 0x5093, 0x5193, 0x5293, 0x5393, 0xeede, 0x5493, 0xebde, 0xd5ce, 0x5593, 0xa7b4, 0x5693, 0x5793, 0x5893, 0x5993, 0x5a93, 0xabbf, 0xbebe, 0x5b93, 0x5c93, 0xd2bd, 0x5d93, 0x5e93, 0x5f93, 0x6093, 0xe9de, 0x6193, 0xaed4, 0x6293, 0xdede, 0x6393, 0xeade, 0x6493, 0x6593, 0x6693, 0x6793, 0xbfc0, 0x6893, 0xecde, 0xf3b2, 0xe9b8, 0xa7c2, 0x6993, 0x6a93, 0xc1bd, 0x6b93, 0x6c93, 0x6d93, 0x6e93, 0x6f93, 0xf5de, 0xf8de, 0x7093, 0x7193, 0xabb2, 0xa4b4, 0x7293, 0x7393, 0xeab4, 0xa6c9, 0x7493, 0x7593, 0x7693, 0x7793, 0x7893, 0x7993, 0xf6de, 0xd1cb, 0x7a93, 0xe3b8, 0x7b93, 0xf7de, 0xfade, 0x7c93, 0x7d93, 0x7e93, 0x8093, 0xf9de, 0x8193, 0x8293, 0x8393, 0xc2cc, 0x8493, 0xe1b0, 0xeeb4, 0x8593, 0x8693, 0x8793, 0x8893, 0x8993, 0x8a93, 0xbae5, 0x8b93, 0x8c93, 0x8d93, 0x8e93, 0x8f93, 0xafd0, 0x9093, 0x9193, 0xebb2, 0x9293, 0xa1eb, 0x9393, 0xf4de, 0x9493, 0x9593, 0xe3c9, 0xf3de, 0xdab0, 0xa1d2, 0xf7b1, 0x9693, 0xafcc, 0x9793, 0x9893, 0x9993, 0x9a93, 0x9b93, 0x9c93, 0x9d93, 0xf0de, 0x9e93, 0xa4cb, 0x9f93, 0xa093, 0xa193, 0xaad5, 0xa293, 0xa393, 0xa493, 0xa593, 0xa693, 0xfbde, 0xa793, 0xa893, 0xa993, 0xaa93, 0xab93, 0xac93, 0xad93, 0xae93, 0xddb4, 0xaf93, 0xa6c4, 0xb093, 0xb193, 0xb293, 0xfdde, 0xb393, 0xb493, 0xb593, 0xb693, 0xb793, 0xb893, 0xb993, 0xba93, 0xbb93, 0xbc93, 0xfec3, 0xa1c4, 0xa1df, 0xbd93, 0xbe93, 0xbf93, 0xc093, 0xc193, 0xc293, 0xc393, 0xccc1, 0xc493, 0xfcde, 0xefbe, 0xc593, 0xb2c6, 0xc693, 0xc793, 0xc893, 0xc993, 0xca93, 0xcb93, 0xcc93, 0xcd93, 0xce93, 0xc5b3, 0xf6c8, 0xcf93, 0xd093, 0xbacb, 0xfede, 0xd193, 0xd293, 0xa4df, 0xd393, 0xd493, 0xd593, 0xd693, 0xb2d7, 0xd793, 0xd893, 0xd993, 0xda93, 0xdb93, 0xb7b3, 0xdc93, 0xdd93, 0xde93, 0xdf93, 0xc3c1, 0xe093, 0xe193, 0xcbc7, 0xa5b2, 0xe9b4, 0xe293, 0xabd7, 0xe393, 0xe493, 0xe593, 0xe693, 0xecc4, 0xe793, 0xa2df, 0xa3df, 0xe893, 0xa5df, 0xe993, 0xb3ba, 0xea93, 0xeb93, 0xec93, 0xa6df, 0xed93, 0xdec0, 0xee93, 0xef93, 0xc3c9, 0xf093, 0xf193, 0xf293, 0xf393, 0xf493, 0xf593, 0xf693, 0xd9b2, 0xe6c7, 0xf793, 0xa7df, 0xf893, 0xdcc7, 0xf993, 0xfa93, 0xfb93, 0xfc93, 0xa8df, 0xa2eb, 0xfd93, 0xfe93, 0x4094, 0x4194, 0x4294, 0xd3cb, 0x4394, 0x4494, 0x4594, 0xaadf, 0x4694, 0xa9df, 0x4794, 0xc1b2, 0x4894, 0x4994, 0x4a94, 0x4b94, 0x4c94, 0x4d94, 0x4e94, 0x4f94, 0x5094, 0x5194, 0x5294, 0x5394, 0x5494, 0x5594, 0x5694, 0x5794, 0x5894, 0x5994, 0x5a94, 0x5b94, 0x5c94, 0x5d94, 0x5e94, 0x5f94, 0x6094, 0xcac5, 0x6194, 0x6294, 0x6394, 0x6494, 0x6594, 0x6694, 0x6794, 0x6894, 0xabdf, 0x6994, 0x6a94, 0x6b94, 0x6c94, 0x6d94, 0x6e94, 0x6f94, 0x7094, 0xdcd4, 0x7194, 0x7294, 0x7394, 0x7494, 0x7594, 0xc1c8, 0x7694, 0x7794, 0x7894, 0x7994, 0x7a94, 0x7b94, 0x7c94, 0x7d94, 0x7e94, 0x8094, 0x8194, 0x8294, 0xacdf, 0x8394, 0x8494, 0x8594, 0x8694, 0x8794, 0xf0be, 0x8894, 0x8994, 0xaddf, 0xa7d6, 0x8a94, 0x8b94, 0x8c94, 0x8d94, 0xb7ea, 0xb6eb, 0xd5ca, 0x8e94, 0xfcd8, 0xc4b8, 0x8f94, 0xa5b9, 0x9094, 0x9194, 0xc5b7, 0xfed5, 0x9294, 0x9394, 0x9494, 0x9594, 0x9694, 0xcab9, 0x9794, 0x9894, 0xa7d0, 0xcdf4, 0x9994, 0x9a94, 0xd0b5, 0x9b94, 0x9c94, 0xf4c3, 0x9d94, 0xc8be, 0x9e94, 0x9f94, 0xa094, 0xb7eb, 0xbdb0, 0xa194, 0xa294, 0xccbd, 0xa394, 0xb2c1, 0xa494, 0xd6b1, 0xa8b3, 0xa594, 0xa694, 0xa794, 0xd2b8, 0xa2c9, 0xa894, 0xa994, 0xd8b6, 0xaa94, 0xab94, 0xac94, 0xad94, 0xb8eb, 0xb4be, 0xae94, 0xaf94, 0xb094, 0xfdca, 0xb194, 0xc3c7, 0xb294, 0xfbd5, 0xb394, 0xb494, 0xf3b7, 0xb594, 0xb694, 0xb794, 0xb894, 0xb994, 0xba94, 0xbb94, 0xbc94, 0xbd94, 0xbe94, 0xbf94, 0xc094, 0xc194, 0xc294, 0xc394, 0xc4ce, 0xc494, 0xc594, 0xc694, 0xabd5, 0xf3b1, 0xc794, 0xc894, 0xc994, 0xb3ec, 0xdfb0, 0xca94, 0xb5ec, 0xcb94, 0xcc94, 0xcd94, 0xb7b6, 0xce94, 0xcfc1, 0xcf94, 0xfaf5, 0xb1d0, 0xd094, 0xd194, 0xe5d5, 0xd294, 0xd3ce, 0xd394, 0xd494, 0xefbd, 0xe2b3, 0xd594, 0xabb8, 0xd694, 0xb6d5, 0xd794, 0xbded, 0xd894, 0xcfb6, 0xd994, 0xb9cb, 0xc2d0, 0xda94, 0xdb94, 0xdc94, 0xdd94, 0xde94, 0xdf94, 0xe094, 0xe194, 0xbdb7, 0xe294, 0xe394, 0xb6ec, 0xa9ca, 0xe494, 0xe594, 0xe694, 0xd4c5, 0xe794, 0xb9ec, 0xb8ec, 0xc3c2, 0xb7ec, 0xe894, 0xe994, 0xea94, 0xeb94, 0xfdd0, 0xbaec, 0xec94, 0xbbec, 0xe5d7, 0xed94, 0xee94, 0xbcec, 0xef94, 0xf094, 0xf194, 0xbdec, 0xecc6, 0xf294, 0xf394, 0xf494, 0xf594, 0xf694, 0xf794, 0xf894, 0xf994, 0xdece, 0xfa94, 0xc8bc, 0xfb94, 0xfc94, 0xd5c8, 0xa9b5, 0xc9be, 0xbcd6, 0xe7d4, 0xfd94, 0xfe94, 0xaed1, 0xf1d0, 0xb8ea, 0xb9ea, 0xbaea, 0xb5ba, 0x4095, 0x4195, 0x4295, 0x4395, 0xb1ca, 0xf5bf, 0x4495, 0x4595, 0xfacd, 0x4695, 0x4795, 0x4895, 0x4995, 0x4a95, 0xc0ea, 0x4b95, 0xbab0, 0xbeea, 0x4c95, 0x4d95, 0xa5c0, 0x4e95, 0x4f95, 0x5095, 0xbbea, 0x5195, 0xfdb2, 0x5295, 0xf7c3, 0xe8bb, 0x5395, 0x5495, 0x5595, 0xd7d2, 0xf4ce, 0xbfea, 0x5695, 0x5795, 0x5895, 0xbcea, 0x5995, 0x5a95, 0x5b95, 0xc3ea, 0x5c95, 0xc7d0, 0xb3d3, 0x5d95, 0x5e95, 0x5f95, 0x6095, 0xbab4, 0x6195, 0xc1c3, 0xf2d7, 0x6295, 0x6395, 0x6495, 0x6595, 0xd1d5, 0x6695, 0xc7ca, 0x6795, 0xc5ea, 0x6895, 0x6995, 0xc4ea, 0xc7ea, 0xc6ea, 0x6a95, 0x6b95, 0x6c95, 0x6d95, 0x6e95, 0xe7d6, 0x6f95, 0xd4cf, 0x7095, 0x7195, 0xcbea, 0x7295, 0xcebb, 0x7395, 0x7495, 0x7595, 0x7695, 0x7795, 0x7895, 0x7995, 0xfabd, 0xcec9, 0x7a95, 0x7b95, 0xccea, 0x7c95, 0x7d95, 0xb9c9, 0xfecf, 0xcaea, 0xced4, 0xcdea, 0xcfea, 0x7e95, 0x8095, 0xedcd, 0x8195, 0x8295, 0x8395, 0x8495, 0xc9ea, 0x8595, 0xceea, 0x8695, 0x8795, 0xeece, 0x8895, 0xdebb, 0x8995, 0xbfb3, 0x8a95, 0x8b95, 0x8c95, 0x8d95, 0x8e95, 0xd5c6, 0xb0be, 0xface, 0x8f95, 0x9095, 0x9195, 0xe7c7, 0x9295, 0xa7be, 0xd0ea, 0x9395, 0x9495, 0xc7d6, 0x9595, 0x9695, 0x9795, 0xc0c1, 0x9895, 0x9995, 0x9a95, 0xddd4, 0x9b95, 0xd1ea, 0x9c95, 0x9d95, 0xbecf, 0x9e95, 0x9f95, 0xa095, 0xa195, 0xd2ea, 0xa295, 0xa395, 0xa495, 0xa595, 0xeeca, 0xa695, 0xa795, 0xa895, 0xa995, 0xafc5, 0xb5b0, 0xaa95, 0xab95, 0xac95, 0xad95, 0xae95, 0xd4ea, 0xaf95, 0xb095, 0xb195, 0xb295, 0xb395, 0xb495, 0xb595, 0xb695, 0xb795, 0xd3ea, 0xdff4, 0xb895, 0xb995, 0xba95, 0xbb95, 0xbc95, 0xbac4, 0xbd95, 0xbe95, 0xbf95, 0xc095, 0xc195, 0xa9b1, 0xc295, 0xc395, 0xc495, 0xc595, 0xdfe5, 0xc695, 0xc795, 0xc895, 0xc995, 0xd5ea, 0xca95, 0xcb95, 0xcc95, 0xcd95, 0xce95, 0xcf95, 0xd095, 0xd195, 0xd295, 0xd395, 0xd495, 0xd595, 0xd695, 0xd795, 0xd895, 0xd995, 0xda95, 0xdb95, 0xdc95, 0xdd95, 0xde95, 0xdf95, 0xe095, 0xe195, 0xe295, 0xe395, 0xefca, 0xe495, 0xd6ea, 0xd7ea, 0xd8c6, 0xe595, 0xe695, 0xe795, 0xe895, 0xe995, 0xea95, 0xeb95, 0xec95, 0xd8ea, 0xed95, 0xee95, 0xd9ea, 0xef95, 0xf095, 0xf195, 0xf295, 0xf395, 0xf495, 0xbbd4, 0xf595, 0xfac7, 0xb7d2, 0xfcb8, 0xf695, 0xf795, 0xc2ea, 0xf895, 0xdcb2, 0xf995, 0xfa95, 0xfcc2, 0xfb95, 0xf8d4, 0xe6cc, 0xeed7, 0xfc95, 0xfd95, 0xfe95, 0x4096, 0x4196, 0x4296, 0x4396, 0xc2d4, 0xd0d3, 0xc3eb, 0xf3c5, 0x4496, 0xfeb7, 0x4596, 0x4696, 0xd4eb, 0x4796, 0x4896, 0x4996, 0xb7cb, 0xdeeb, 0x4a96, 0xcac0, 0x4b96, 0x4c96, 0x4d96, 0xfbcd, 0x4e96, 0xafb3, 0x4f96, 0xdac6, 0x5096, 0x5196, 0x5296, 0x5396, 0x5496, 0x5596, 0xfceb, 0x5696, 0xbec4, 0x5796, 0xb4ce, 0xa9c4, 0xbeb1, 0xfdd4, 0x5896, 0xf5ca, 0x5996, 0xecd6, 0x5a96, 0x5b96, 0xd3c6, 0xe4b6, 0x5c96, 0x5d96, 0x5e96, 0x5f96, 0xfabb, 0x6096, 0x6196, 0xe0d0, 0x6296, 0x6396, 0xb1c9, 0x6496, 0xd3d4, 0xa8c8, 0x6596, 0x6696, 0xcbb8, 0x6796, 0xbee8, 0xbcc9, 0x6896, 0x6996, 0xbbe8, 0x6a96, 0xeec0, 0xd3d0, 0xc4b2, 0xe5b4, 0x6b96, 0xbce8, 0x6c96, 0x6d96, 0xc8d5, 0x6e96, 0x6f96, 0x7096, 0x7196, 0x7296, 0xc5b6, 0x7396, 0xbde8, 0xf8ca, 0xdcb8, 0xf5cc, 0x7496, 0x7596, 0x7696, 0xb4c0, 0x7796, 0x7896, 0xeed1, 0xbfe8, 0xc2e8, 0x7996, 0x7a96, 0xbcba, 0x7b96, 0xadb1, 0xdcbd, 0x7c96, 0xbdea, 0xc3e8, 0x7d96, 0xc6e8, 0x7e96, 0xcbe8, 0x8096, 0x8196, 0x8296, 0x8396, 0xcce8, 0x8496, 0xc9cb, 0xe5b0, 0x8596, 0xabbc, 0x8696, 0x8796, 0xb9b9, 0x8896, 0x8996, 0xc1e8, 0x8a96, 0xf7cd, 0x8b96, 0xcae8, 0x8c96, 0x8d96, 0x8e96, 0x8f96, 0xf6ce, 0x9096, 0x9196, 0x9296, 0x9396, 0xedd5, 0x9496, 0xd6c1, 0xc4e8, 0x9596, 0xb6c3, 0x9696, 0xfbb9, 0xa6d6, 0xc8e8, 0x9796, 0x9896, 0x9996, 0xe0ca, 0xe6d4, 0x9a96, 0xc0e8, 0x9b96, 0xc5e8, 0xc7e8, 0x9c96, 0xb9c7, 0xe3b7, 0x9d96, 0xc9e8, 0x9e96, 0xddbf, 0xd2e8, 0x9f96, 0xa096, 0xd7e8, 0xa196, 0xd5e8, 0xdcbc, 0xcfbc, 0xdbe8, 0xa296, 0xa396, 0xa496, 0xa596, 0xa696, 0xa796, 0xa896, 0xa996, 0xdee8, 0xaa96, 0xdae8, 0xfab1, 0xab96, 0xac96, 0xad96, 0xae96, 0xaf96, 0xb096, 0xb196, 0xb296, 0xb396, 0xb496, 0xd8b0, 0xb3c4, 0xccb8, 0xe2c6, 0xbec8, 0xe1c8, 0xb596, 0xb696, 0xb796, 0xcfe8, 0xd4e8, 0xd6e8, 0xb896, 0xf1b9, 0xd8e8, 0xf5d7, 0xb996, 0xfbc4, 0xba96, 0xdce8, 0xbb96, 0xbc96, 0xe9b2, 0xbd96, 0xbe96, 0xbf96, 0xd1e8, 0xc096, 0xc196, 0xedbc, 0xc296, 0xc396, 0xc2bf, 0xcde8, 0xf9d6, 0xc496, 0xf8c1, 0xf1b2, 0xc596, 0xc696, 0xc796, 0xc896, 0xc996, 0xca96, 0xcb96, 0xcc96, 0xdfe8, 0xcd96, 0xc1ca, 0xd9e8, 0xce96, 0xcf96, 0xd096, 0xd196, 0xa4d5, 0xd296, 0xeab1, 0xbbd5, 0xcee8, 0xd0e8, 0xb0b6, 0xd3e8, 0xd396, 0xdde8, 0xb8c0, 0xd496, 0xf7ca, 0xd596, 0xa8cb, 0xd696, 0xd796, 0xdcc6, 0xf5c0, 0xd896, 0xd996, 0xda96, 0xdb96, 0xdc96, 0xe9e8, 0xdd96, 0xde96, 0xdf96, 0xa3d0, 0xe096, 0xe196, 0xe296, 0xe396, 0xe496, 0xe596, 0xe696, 0xf2e8, 0xead6, 0xe796, 0xe896, 0xe996, 0xea96, 0xeb96, 0xec96, 0xed96, 0xe0e8, 0xe1e8, 0xee96, 0xef96, 0xf096, 0xf9d1, 0xcbba, 0xf9b8, 0xf196, 0xf296, 0xf1b8, 0xd4d4, 0xefe8, 0xf396, 0xeee8, 0xece8, 0xf0b9, 0xd2cc, 0xe6e8, 0xa6ce, 0xf2bf, 0xf496, 0xb8b0, 0xf1e8, 0xf0e8, 0xf596, 0xc0d7, 0xf696, 0xe4e8, 0xf796, 0xa9cd, 0xa3c9, 0xf896, 0xb8bb, 0xdbbd, 0xeae8, 0xf996, 0xfa96, 0xfb96, 0xfc96, 0xfd96, 0xfe96, 0x4097, 0x4197, 0x4297, 0x4397, 0xe2e8, 0xe3e8, 0xe5e8, 0xb5b5, 0xe7e8, 0xc5c7, 0xebe8, 0xede8, 0xb0bd, 0xaed7, 0x4497, 0xf8e8, 0x4597, 0x4697, 0x4797, 0x4897, 0x4997, 0x4a97, 0x4b97, 0x4c97, 0xf5e8, 0x4d97, 0xb0cd, 0xf6e8, 0x4e97, 0x4f97, 0x5097, 0x5197, 0x5297, 0x5397, 0x5497, 0x5597, 0x5697, 0xbac1, 0x5797, 0xe8e8, 0x5897, 0xb7c3, 0xf0b0, 0x5997, 0x5a97, 0x5b97, 0x5c97, 0x5d97, 0x5e97, 0x5f97, 0x6097, 0xf4e8, 0x6197, 0x6297, 0x6397, 0xf7e8, 0x6497, 0x6597, 0x6697, 0xa3b9, 0x6797, 0x6897, 0x6997, 0x6a97, 0x6b97, 0x6c97, 0x6d97, 0x6e97, 0x6f97, 0x7097, 0xd2c9, 0x7197, 0x7297, 0x7397, 0xcec3, 0xe0ce, 0xe6c0, 0x7497, 0x7597, 0x7697, 0x7797, 0xf3cb, 0x7897, 0xddcc, 0xb5d0, 0x7997, 0x7a97, 0xe1ca, 0x7b97, 0xf3e8, 0x7c97, 0x7d97, 0x7e97, 0x8097, 0x8197, 0x8297, 0x8397, 0x8497, 0x8597, 0x8697, 0xecbc, 0x8797, 0xf9e8, 0x8897, 0x8997, 0x8a97, 0x8b97, 0x8c97, 0x8d97, 0xdec3, 0x8e97, 0xe5c6, 0x8f97, 0xf7b9, 0x9097, 0x9197, 0x9297, 0x9397, 0xf4b0, 0x9497, 0x9597, 0xd8d7, 0x9697, 0x9797, 0xacbc, 0x9897, 0xefc5, 0x9997, 0x9a97, 0x9b97, 0x9c97, 0x9d97, 0xc4cc, 0x9e97, 0x9f97, 0xa6e9, 0xa097, 0xa197, 0xa297, 0xa397, 0xa497, 0xa597, 0xa697, 0xa797, 0xa897, 0xa997, 0xadc9, 0xaa97, 0xa2e9, 0xe2c0, 0xab97, 0xac97, 0xad97, 0xc3bf, 0xae97, 0xaf97, 0xb097, 0xfee8, 0xd7b9, 0xb197, 0xfbe8, 0xb297, 0xb397, 0xb497, 0xb597, 0xa4e9, 0xb697, 0xb797, 0xb897, 0xced2, 0xb997, 0xba97, 0xbb97, 0xbc97, 0xbd97, 0xa3e9, 0xbe97, 0xb2d6, 0xb5d7, 0xbf97, 0xa7e9, 0xc097, 0xb7bd, 0xc197, 0xc297, 0xc397, 0xc497, 0xc597, 0xc697, 0xc797, 0xc897, 0xc997, 0xca97, 0xcb97, 0xcc97, 0xfce8, 0xfde8, 0xcd97, 0xce97, 0xcf97, 0xa1e9, 0xd097, 0xd197, 0xd297, 0xd397, 0xd497, 0xd597, 0xd697, 0xd797, 0xd6cd, 0xd897, 0xd997, 0xacd2, 0xda97, 0xdb97, 0xdc97, 0xb2e9, 0xdd97, 0xde97, 0xdf97, 0xe097, 0xa9e9, 0xe197, 0xe297, 0xe397, 0xaab4, 0xe497, 0xbbb4, 0xe597, 0xe697, 0xabe9, 0xe797, 0xe897, 0xe997, 0xea97, 0xeb97, 0xec97, 0xed97, 0xee97, 0xef97, 0xf097, 0xf197, 0xf297, 0xf397, 0xf497, 0xf597, 0xf697, 0xf797, 0xa8d0, 0xf897, 0xf997, 0xa5e9, 0xfa97, 0xfb97, 0xfeb3, 0xfc97, 0xfd97, 0xace9, 0xe3c0, 0xfe97, 0xaae9, 0x4098, 0x4198, 0xb9e9, 0x4298, 0x4398, 0xb8e9, 0x4498, 0x4598, 0x4698, 0x4798, 0xaee9, 0x4898, 0x4998, 0xfae8, 0x4a98, 0x4b98, 0xa8e9, 0x4c98, 0x4d98, 0x4e98, 0x4f98, 0x5098, 0xacbf, 0xb1e9, 0xbae9, 0x5198, 0x5298, 0xa5c2, 0x5398, 0x5498, 0x5598, 0xafe9, 0x5698, 0xc5b8, 0x5798, 0xade9, 0x5898, 0xdcd3, 0xb4e9, 0xb5e9, 0xb7e9, 0x5998, 0x5a98, 0x5b98, 0xc7e9, 0x5c98, 0x5d98, 0x5e98, 0x5f98, 0x6098, 0x6198, 0xc6c0, 0xc5e9, 0x6298, 0x6398, 0xb0e9, 0x6498, 0x6598, 0xbbe9, 0xf1b0, 0x6698, 0x6798, 0x6898, 0x6998, 0x6a98, 0x6b98, 0x6c98, 0x6d98, 0x6e98, 0x6f98, 0xbce9, 0xa5d5, 0x7098, 0x7198, 0xbee9, 0x7298, 0xbfe9, 0x7398, 0x7498, 0x7598, 0xc1e9, 0x7698, 0x7798, 0xf1c1, 0x7898, 0x7998, 0xb6c8, 0x7a98, 0x7b98, 0x7c98, 0xbde9, 0x7d98, 0x7e98, 0x8098, 0x8198, 0x8298, 0xc2e9, 0x8398, 0x8498, 0x8598, 0x8698, 0x8798, 0x8898, 0x8998, 0x8a98, 0xc3e9, 0x8b98, 0xb3e9, 0x8c98, 0xb6e9, 0x8d98, 0xb1bb, 0x8e98, 0x8f98, 0x9098, 0xc0e9, 0x9198, 0x9298, 0x9398, 0x9498, 0x9598, 0x9698, 0xf7bc, 0x9798, 0x9898, 0x9998, 0xc4e9, 0xc6e9, 0x9a98, 0x9b98, 0x9c98, 0x9d98, 0x9e98, 0x9f98, 0xa098, 0xa198, 0xa298, 0xa398, 0xa498, 0xa598, 0xcae9, 0xa698, 0xa798, 0xa898, 0xa998, 0xcee9, 0xaa98, 0xab98, 0xac98, 0xad98, 0xae98, 0xaf98, 0xb098, 0xb198, 0xb298, 0xb398, 0xdbb2, 0xb498, 0xc8e9, 0xb598, 0xb698, 0xb798, 0xb898, 0xb998, 0xba98, 0xbb98, 0xbc98, 0xbd98, 0xbe98, 0xaeb7, 0xbf98, 0xc098, 0xc198, 0xc298, 0xc398, 0xc498, 0xc598, 0xc698, 0xc798, 0xc898, 0xc998, 0xca98, 0xcbe9, 0xcce9, 0xcb98, 0xcc98, 0xcd98, 0xce98, 0xcf98, 0xd098, 0xc1d5, 0xd198, 0xa3c4, 0xd298, 0xd398, 0xd498, 0xd598, 0xd698, 0xd798, 0xd8e9, 0xd898, 0xe1ba, 0xd998, 0xda98, 0xdb98, 0xdc98, 0xc9e9, 0xdd98, 0xa3d3, 0xde98, 0xdf98, 0xe098, 0xd4e9, 0xe198, 0xe298, 0xe398, 0xe498, 0xe598, 0xe698, 0xe798, 0xd7e9, 0xd0e9, 0xe898, 0xe998, 0xea98, 0xeb98, 0xec98, 0xcfe9, 0xed98, 0xee98, 0xc1c7, 0xef98, 0xf098, 0xf198, 0xf298, 0xf398, 0xf498, 0xf598, 0xf698, 0xd2e9, 0xf798, 0xf898, 0xf998, 0xfa98, 0xfb98, 0xfc98, 0xfd98, 0xd9e9, 0xc8b3, 0xfe98, 0xd3e9, 0x4099, 0x4199, 0x4299, 0x4399, 0x4499, 0xf0cf, 0x4599, 0x4699, 0x4799, 0xcde9, 0x4899, 0x4999, 0x4a99, 0x4b99, 0x4c99, 0x4d99, 0x4e99, 0x4f99, 0x5099, 0x5199, 0x5299, 0xf7b3, 0x5399, 0x5499, 0x5599, 0x5699, 0x5799, 0x5899, 0x5999, 0xd6e9, 0x5a99, 0x5b99, 0xdae9, 0x5c99, 0x5d99, 0x5e99, 0xb4cc, 0x5f99, 0x6099, 0x6199, 0xadcf, 0x6299, 0x6399, 0x6499, 0x6599, 0x6699, 0x6799, 0x6899, 0x6999, 0x6a99, 0xd5e9, 0x6b99, 0xdce9, 0xdbe9, 0x6c99, 0x6d99, 0x6e99, 0x6f99, 0x7099, 0xdee9, 0x7199, 0x7299, 0x7399, 0x7499, 0x7599, 0x7699, 0x7799, 0x7899, 0xd1e9, 0x7999, 0x7a99, 0x7b99, 0x7c99, 0x7d99, 0x7e99, 0x8099, 0x8199, 0xdde9, 0x8299, 0xdfe9, 0xcac3, 0x8399, 0x8499, 0x8599, 0x8699, 0x8799, 0x8899, 0x8999, 0x8a99, 0x8b99, 0x8c99, 0x8d99, 0x8e99, 0x8f99, 0x9099, 0x9199, 0x9299, 0x9399, 0x9499, 0x9599, 0x9699, 0x9799, 0x9899, 0x9999, 0x9a99, 0x9b99, 0x9c99, 0x9d99, 0x9e99, 0x9f99, 0xa099, 0xa199, 0xa299, 0xa399, 0xa499, 0xa599, 0xa699, 0xa799, 0xa899, 0xa999, 0xaa99, 0xab99, 0xac99, 0xad99, 0xae99, 0xaf99, 0xb099, 0xb199, 0xb299, 0xb399, 0xb499, 0xb599, 0xb699, 0xb799, 0xb899, 0xb999, 0xba99, 0xbb99, 0xbc99, 0xbd99, 0xbe99, 0xbf99, 0xc099, 0xc199, 0xc299, 0xc399, 0xc499, 0xc599, 0xc699, 0xc799, 0xc899, 0xc999, 0xca99, 0xcb99, 0xcc99, 0xcd99, 0xce99, 0xcf99, 0xd099, 0xd199, 0xd299, 0xd399, 0xd499, 0xd599, 0xd699, 0xd799, 0xd899, 0xd999, 0xda99, 0xdb99, 0xdc99, 0xdd99, 0xde99, 0xdf99, 0xe099, 0xe199, 0xe299, 0xe399, 0xe499, 0xe599, 0xe699, 0xe799, 0xe899, 0xe999, 0xea99, 0xeb99, 0xec99, 0xed99, 0xee99, 0xef99, 0xf099, 0xf199, 0xf299, 0xf399, 0xf499, 0xf599, 0xb7c7, 0xceb4, 0xb6bb, 0xc0d0, 0xa3ec, 0xf699, 0xf799, 0xb7c5, 0xf899, 0xf999, 0xfa99, 0xfb99, 0xfc99, 0xfd99, 0xfe99, 0x409a, 0x419a, 0x429a, 0xfbd3, 0x439a, 0x449a, 0x459a, 0x469a, 0xa4ec, 0x479a, 0xa5ec, 0xdbc6, 0x489a, 0x499a, 0x4a9a, 0xeebf, 0x4b9a, 0x4c9a, 0x4d9a, 0x4e9a, 0xa6ec, 0x4f9a, 0x509a, 0xa7ec, 0xaad0, 0x519a, 0xb8c7, 0x529a, 0x539a, 0xe8b8, 0x549a, 0x559a, 0x569a, 0x579a, 0x589a, 0x599a, 0x5a9a, 0x5b9a, 0x5c9a, 0x5d9a, 0x5e9a, 0x5f9a, 0xa8ec, 0x609a, 0x619a, 0x629a, 0x639a, 0x649a, 0x659a, 0x669a, 0x679a, 0xb9d6, 0xfdd5, 0xcbb4, 0xbdb2, 0xe4ce, 0xe7c6, 0x689a, 0x699a, 0xe1cd, 0x6a9a, 0x6b9a, 0x6c9a, 0x6d9a, 0x6e9a, 0x6f9a, 0x709a, 0x719a, 0x729a, 0x739a, 0x749a, 0x759a, 0x769a, 0x779a, 0xf5b4, 0x789a, 0xc0cb, 0xdfbc, 0x799a, 0x7a9a, 0x7b9a, 0x7c9a, 0xe2e9, 0xe3e9, 0xead1, 0xe5e9, 0x7d9a, 0xf9b4, 0xe4e9, 0x7e9a, 0xb3d1, 0xe2ca, 0xd0b2, 0x809a, 0xe8e9, 0x819a, 0x829a, 0x839a, 0x849a, 0xe6e9, 0xe7e9, 0x859a, 0x869a, 0xb3d6, 0x879a, 0x889a, 0x899a, 0xe9e9, 0xeae9, 0x8a9a, 0x8b9a, 0x8c9a, 0x8d9a, 0x8e9a, 0xebe9, 0x8f9a, 0x909a, 0x919a, 0x929a, 0x939a, 0x949a, 0x959a, 0x969a, 0xece9, 0x979a, 0x989a, 0x999a, 0x9a9a, 0x9b9a, 0x9c9a, 0x9d9a, 0x9e9a, 0xafec, 0xb9c5, 0xceb6, 0x9f9a, 0xf3d2, 0xa09a, 0xa19a, 0xa29a, 0xa39a, 0xa49a, 0xa59a, 0xa69a, 0xeeb5, 0xa79a, 0xd9bb, 0xb1ec, 0xa89a, 0xa99a, 0xe3d2, 0xaa9a, 0xab9a, 0xac9a, 0xad9a, 0xae9a, 0xe3ce, 0xaf9a, 0xb8c4, 0xb09a, 0xbfc3, 0xb19a, 0xb29a, 0xbeb6, 0xb9d8, 0xc8b1, 0xcfb1, 0xd1b1, 0xfec5, 0xb39a, 0xd0b1, 0xb49a, 0xabc3, 0xb59a, 0xb69a, 0xb79a, 0xb89a, 0xb99a, 0xb1d5, 0xba9a, 0xbb9a, 0xbc9a, 0xbd9a, 0xbe9a, 0xbf9a, 0xc09a, 0xc19a, 0xa4eb, 0xc1ba, 0xc29a, 0xc39a, 0xc49a, 0xbacc, 0xc59a, 0xc69a, 0xc79a, 0xa5eb, 0xc89a, 0xa7eb, 0xc99a, 0xca9a, 0xcb9a, 0xa8eb, 0xcc9a, 0xcd9a, 0xce9a, 0xa6eb, 0xcf9a, 0xd09a, 0xd19a, 0xd29a, 0xd39a, 0xd49a, 0xd59a, 0xa9eb, 0xabeb, 0xaaeb, 0xd69a, 0xd79a, 0xd89a, 0xd99a, 0xda9a, 0xaceb, 0xdb9a, 0xcfca, 0xb5d8, 0xf1c3, 0xdc9a, 0xa5c3, 0xf8c6, 0xadeb, 0xcac4, 0xdd9a, 0xaeeb, 0xafeb, 0xb0eb, 0xd5b7, 0xde9a, 0xdf9a, 0xe09a, 0xfab7, 0xe19a, 0xb1eb, 0xe2c7, 0xe29a, 0xb3eb, 0xe39a, 0xa4ba, 0xf5d1, 0xb1b0, 0xb2eb, 0xb4eb, 0xe49a, 0xe59a, 0xe69a, 0xaab5, 0xc8c2, 0xe8c7, 0xe79a, 0xb5eb, 0xe89a, 0xaecb, 0xdfe3, 0xe99a, 0xea9a, 0xc0d3, 0xeb9a, 0xec9a, 0xed9a, 0xee9a, 0xdbd9, 0xef9a, 0xf09a, 0xa1cd, 0xadd6, 0xf3c7, 0xf19a, 0xf29a, 0xf39a, 0xe0d9, 0xe3bb, 0xf49a, 0xbaba, 0xe2e3, 0xf59a, 0xf69a, 0xf79a, 0xf89a, 0xf99a, 0xabcf, 0xfa9a, 0xfb9a, 0xfc9a, 0xe0e3, 0xc7c9, 0xfd9a, 0xb9ba, 0xfe9a, 0x409b, 0x419b, 0xb4d1, 0xe1e3, 0xeac8, 0xafb9, 0xadbd, 0xd8b3, 0xdbce, 0x429b, 0x439b, 0xc0cc, 0x449b, 0x459b, 0x469b, 0xe8e3, 0xe9e3, 0xf4cd, 0x479b, 0x489b, 0x499b, 0x4a9b, 0x4b9b, 0xadcc, 0x4c9b, 0xb3bc, 0x4d9b, 0xeae3, 0x4e9b, 0xebe3, 0x4f9b, 0x509b, 0xdad0, 0x519b, 0x529b, 0x539b, 0xfbc6, 0xdab7, 0x549b, 0x559b, 0xdfc7, 0xcad2, 0xd6ce, 0x569b, 0xe4e3, 0xece3, 0x579b, 0xf2c9, 0xc1b3, 0x589b, 0x599b, 0xe7e3, 0x5a9b, 0x5b9b, 0xe3c6, 0xe5e3, 0x5c9b, 0x5d9b, 0xb3ed, 0xe6e3, 0x5e9b, 0x5f9b, 0x609b, 0x619b, 0xb3c9, 0x629b, 0xe6c5, 0x639b, 0x649b, 0x659b, 0xb5b9, 0x669b, 0xbbc3, 0x679b, 0xe3e3, 0xbdc5, 0xa4c1, 0xd9c2, 0xd7b2, 0x689b, 0xede3, 0xa6bb, 0xadc4, 0x699b, 0xf0e3, 0xdabe, 0x6a9b, 0x6b9b, 0xfbe3, 0xf5e3, 0xd3ba, 0x6c9b, 0x6d9b, 0x6e9b, 0x6f9b, 0xd0b7, 0xcdd3, 0x709b, 0xced6, 0xd3d5, 0xc1b9, 0xb4d5, 0xd8d1, 0x719b, 0x729b, 0x739b, 0x749b, 0xb9d0, 0xf6c7, 0x759b, 0x769b, 0x779b, 0xaac8, 0xb4b2, 0x789b, 0xdac3, 0x799b, 0x7a9b, 0x7b9b, 0xeee3, 0x7c9b, 0x7d9b, 0xfce3, 0xefe3, 0xa8b7, 0xf7e3, 0xf4e3, 0x7e9b, 0x809b, 0x819b, 0xbab7, 0x829b, 0x839b, 0xa2c5, 0x849b, 0xf6e3, 0xddc5, 0xa8b2, 0xfcc6, 0x859b, 0xe0c4, 0x869b, 0x879b, 0xa2d7, 0x889b, 0xe1c0, 0xf9e3, 0x899b, 0x8a9b, 0xfae3, 0xfde3, 0xa9cc, 0xf3e3, 0x8b9b, 0xbed3, 0x8c9b, 0xc3b1, 0xb4ed, 0xf1e3, 0xf2e3, 0x8d9b, 0xf8e3, 0xbad0, 0xc3c6, 0xf3d4, 0xfee3, 0x8e9b, 0x8f9b, 0xe0bd, 0x909b, 0x919b, 0xa7e4, 0x929b, 0x939b, 0xa6e4, 0x949b, 0x959b, 0x969b, 0xf3d1, 0xa3e4, 0x979b, 0xa9e4, 0x989b, 0x999b, 0x9a9b, 0xf7c8, 0x9b9b, 0x9c9b, 0x9d9b, 0x9e9b, 0xb4cf, 0x9f9b, 0xa8e4, 0xaee4, 0xe5c2, 0xa09b, 0xa19b, 0xb4b6, 0xa29b, 0xa39b, 0xa49b, 0xa59b, 0xa69b, 0xa79b, 0xf2bd, 0xa89b, 0xa2e4, 0xa99b, 0xaa9b, 0xe9ba, 0xaae4, 0xab9b, 0xac9b, 0xace4, 0xad9b, 0xae9b, 0xfdb6, 0xded6, 0xb2e4, 0xaf9b, 0xade4, 0xb09b, 0xb19b, 0xb29b, 0xa1e4, 0xb39b, 0xeebb, 0xddcd, 0xa2c7, 0xc9c5, 0xb49b, 0xb59b, 0xf7c1, 0xb69b, 0xa4e4, 0xb79b, 0xb3c7, 0xacbd, 0xbdbd, 0xa5e4, 0xb89b, 0xc7d7, 0xe2b2, 0xb99b, 0xabe4, 0xc3bc, 0xafe4, 0xba9b, 0xebbb, 0xb0e4, 0xa8c5, 0xb1e4, 0xbb9b, 0xbc9b, 0xbd9b, 0xbe9b, 0xe3d5, 0xa3bf, 0xbf9b, 0xbae4, 0xc09b, 0xb7e4, 0xc19b, 0xbbe4, 0xc29b, 0xc39b, 0xbde4, 0xc49b, 0xc59b, 0xd6c6, 0xc69b, 0xc79b, 0xc6ba, 0xcbc0, 0xc89b, 0xc99b, 0xca9b, 0xa1b8, 0xb4e4, 0xcb9b, 0xcc9b, 0xcd9b, 0xce9b, 0xa1d4, 0xcf9b, 0xd09b, 0xa3ba, 0xfebd, 0xd19b, 0xd29b, 0xd39b, 0xbce4, 0xd49b, 0xd59b, 0xd69b, 0xd79b, 0xd89b, 0xbfcd, 0xd99b, 0xda9b, 0xf9c4, 0xdb9b, 0xdc9b, 0xfbcf, 0xe6c9, 0xdd9b, 0xde9b, 0xbfd3, 0xdf9b, 0xd1cf, 0xe09b, 0xe19b, 0xb3e4, 0xe29b, 0xb8e4, 0xb9e4, 0xe9cc, 0xe39b, 0xe49b, 0xe59b, 0xe69b, 0xe79b, 0xcecc, 0xe89b, 0xd4c0, 0xb5e4, 0xb0c1, 0xb6e4, 0xd0ce, 0xe99b, 0xc1bb, 0xd3b5, 0xea9b, 0xf3c8, 0xa7bd, 0xc7d5, 0xacc9, 0xa2b8, 0xcae4, 0xeb9b, 0xec9b, 0xcce4, 0xc4d1, 0xed9b, 0xee9b, 0xbad2, 0xef9b, 0xf09b, 0xadba, 0xf19b, 0xf29b, 0xd4ba, 0xf39b, 0xf49b, 0xf59b, 0xf69b, 0xf79b, 0xf89b, 0xc3e4, 0xedb5, 0xf99b, 0xfa9b, 0xfb9b, 0xcdd7, 0xc0e4, 0xfdcf, 0xbfe4, 0xfc9b, 0xfd9b, 0xfe9b, 0xdcc1, 0xcacc, 0x409c, 0x419c, 0x429c, 0x439c, 0xe7ca, 0x449c, 0x459c, 0x469c, 0x479c, 0xd7c4, 0x489c, 0xd4cc, 0xc8e4, 0x499c, 0x4a9c, 0x4b9c, 0xc7e4, 0xc1e4, 0x4c9c, 0xc4e4, 0xadb5, 0x4d9c, 0x4e9c, 0xd9d3, 0x4f9c, 0xc6e4, 0x509c, 0x519c, 0x529c, 0x539c, 0xf9d2, 0xe3b4, 0x549c, 0xb4bb, 0x559c, 0x569c, 0xeec9, 0x579c, 0xbeb4, 0x589c, 0x599c, 0x5a9c, 0xecbb, 0x5b9c, 0xcdd1, 0x5c9c, 0xedcc, 0xb5ed, 0x5d9c, 0x5e9c, 0x5f9c, 0x609c, 0x619c, 0x629c, 0x639c, 0x649c, 0xe5c7, 0x659c, 0x669c, 0x679c, 0x689c, 0xa8d4, 0x699c, 0xcbe4, 0xd5d7, 0xc2e4, 0x6a9c, 0xa5bd, 0xc5e4, 0x6b9c, 0x6c9c, 0xe6d3, 0x6d9c, 0xc9e4, 0xf8c9, 0x6e9c, 0x6f9c, 0xbee4, 0x709c, 0x719c, 0xe5d3, 0x729c, 0x739c, 0xfec7, 0xc9b6, 0x749c, 0xfcd4, 0xb3b2, 0xd7e4, 0x759c, 0x769c, 0x779c, 0xc2ce, 0x789c, 0xcde4, 0x799c, 0xbcce, 0x7a9c, 0xdbb8, 0x7b9c, 0x7c9c, 0xd6e4, 0x7d9c, 0xcabf, 0x7e9c, 0x809c, 0x819c, 0xced3, 0x829c, 0xecc3, 0x839c, 0x849c, 0x859c, 0x869c, 0x879c, 0x889c, 0x899c, 0x8a9c, 0xc8c5, 0xd8e4, 0x8b9c, 0x8c9c, 0x8d9c, 0x8e9c, 0x8f9c, 0x909c, 0x919c, 0x929c, 0xc4cd, 0xcfe4, 0x939c, 0x949c, 0x959c, 0x969c, 0xd4e4, 0xd5e4, 0x979c, 0xfeba, 0x989c, 0xe6cf, 0x999c, 0x9a9c, 0xbfd5, 0x9b9c, 0x9c9c, 0x9d9c, 0xd2e4, 0x9e9c, 0x9f9c, 0xa09c, 0xa19c, 0xa29c, 0xa39c, 0xa49c, 0xa59c, 0xa69c, 0xa79c, 0xa89c, 0xd0e4, 0xa99c, 0xaa9c, 0xcee4, 0xab9c, 0xac9c, 0xad9c, 0xae9c, 0xaf9c, 0xb09c, 0xb19c, 0xb29c, 0xb39c, 0xb49c, 0xb59c, 0xb69c, 0xb79c, 0xb89c, 0xb99c, 0xe5cd, 0xaaca, 0xba9c, 0xbb9c, 0xbc9c, 0xa3c0, 0xbd9c, 0xa6bd, 0xd3e4, 0xbe9c, 0xbf9c, 0xc8b8, 0xc09c, 0xc19c, 0xc29c, 0xc39c, 0xc49c, 0xe7e4, 0xb4d4, 0xc59c, 0xc69c, 0xc79c, 0xc89c, 0xc99c, 0xca9c, 0xcb9c, 0xdbe4, 0xcc9c, 0xcd9c, 0xce9c, 0xefc1, 0xcf9c, 0xd09c, 0xe9e4, 0xd19c, 0xd29c, 0xe7d2, 0xd39c, 0xd49c, 0xdfe4, 0xd59c, 0xe0e4, 0xd69c, 0xd79c, 0xaacf, 0xd89c, 0xd99c, 0xda9c, 0xdb9c, 0xddcb, 0xdc9c, 0xdae4, 0xd1e4, 0xdd9c, 0xe5e4, 0xde9c, 0xdcc8, 0xe3e4, 0xdf9c, 0xe09c, 0xe7c4, 0xe2e4, 0xe19c, 0xe1e4, 0xe29c, 0xe39c, 0xe49c, 0xfcb3, 0xe8e4, 0xe59c, 0xe69c, 0xe79c, 0xe89c, 0xe1b5, 0xe99c, 0xea9c, 0xeb9c, 0xccd7, 0xec9c, 0xed9c, 0xee9c, 0xe6e4, 0xef9c, 0xacbb, 0xf09c, 0xd2d7, 0xcfcc, 0xf8eb, 0xf19c, 0xe4e4, 0xf29c, 0xf39c, 0xf6b9, 0xf49c, 0xf59c, 0xf69c, 0xcdd6, 0xd9e4, 0xdce4, 0xfac2, 0xdee4, 0xf79c, 0xcbc2, 0xc4c0, 0xd0c2, 0xf89c, 0xf5b1, 0xb2cc, 0xf99c, 0xfa9c, 0xfb9c, 0xfc9c, 0xfd9c, 0xfe9c, 0x409d, 0x419d, 0x429d, 0x439d, 0xceb5, 0x449d, 0x459d, 0x469d, 0x479d, 0xefe4, 0x489d, 0x499d, 0x4a9d, 0x4b9d, 0x4c9d, 0x4d9d, 0x4e9d, 0x4f9d, 0xafc6, 0x509d, 0x519d, 0x529d, 0xe1c6, 0x539d, 0x549d, 0xf5e4, 0x559d, 0x569d, 0x579d, 0x589d, 0x599d, 0xa9c2, 0x5a9d, 0x5b9d, 0x5c9d, 0xecc0, 0xddd1, 0xeee4, 0x5d9d, 0x5e9d, 0x5f9d, 0x609d, 0x619d, 0x629d, 0x639d, 0x649d, 0x659d, 0x669d, 0xaec4, 0x679d, 0x689d, 0x699d, 0xede4, 0x6a9d, 0x6b9d, 0x6c9d, 0x6d9d, 0xf6e4, 0xf4e4, 0xfec2, 0x6e9d, 0xdde4, 0x6f9d, 0xf0e4, 0x709d, 0xfeca, 0x719d, 0xc4d5, 0x729d, 0x739d, 0xf1e4, 0x749d, 0x759d, 0x769d, 0x779d, 0x789d, 0x799d, 0x7a9d, 0xfad1, 0x7b9d, 0x7c9d, 0x7d9d, 0x7e9d, 0x809d, 0x819d, 0x829d, 0xebe4, 0xece4, 0x839d, 0x849d, 0x859d, 0xf2e4, 0x869d, 0xabce, 0x879d, 0x889d, 0x899d, 0x8a9d, 0x8b9d, 0x8c9d, 0x8d9d, 0x8e9d, 0x8f9d, 0x909d, 0xcbc5, 0x919d, 0x929d, 0x939d, 0xb1c7, 0x949d, 0xbac2, 0x959d, 0x969d, 0x979d, 0xeae4, 0x989d, 0x999d, 0x9a9d, 0xcac1, 0x9b9d, 0x9c9d, 0x9d9d, 0x9e9d, 0x9f9d, 0xa09d, 0xb6cc, 0xb1b3, 0xa19d, 0xa29d, 0xa39d, 0xfbe4, 0xa49d, 0xf3e4, 0xa59d, 0xa69d, 0xa79d, 0xfae4, 0xa89d, 0xfde4, 0xa99d, 0xfce4, 0xaa9d, 0xab9d, 0xac9d, 0xad9d, 0xae9d, 0xaf9d, 0xb09d, 0xceb3, 0xb19d, 0xb29d, 0xb39d, 0xbab3, 0xf7e4, 0xb49d, 0xb59d, 0xf9e4, 0xf8e4, 0xecc5, 0xb69d, 0xb79d, 0xb89d, 0xb99d, 0xba9d, 0xbb9d, 0xbc9d, 0xbd9d, 0xbe9d, 0xbf9d, 0xc09d, 0xc19d, 0xc29d, 0xbdc0, 0xc39d, 0xc49d, 0xc59d, 0xc69d, 0xe8d4, 0xc79d, 0xc89d, 0xc99d, 0xca9d, 0xcb9d, 0xa2e5, 0xcc9d, 0xcd9d, 0xce9d, 0xcf9d, 0xd09d, 0xd19d, 0xd29d, 0xd39d, 0xd49d, 0xd59d, 0xd69d, 0xc4b0, 0xd79d, 0xd89d, 0xa4e5, 0xd99d, 0xda9d, 0xa3e5, 0xdb9d, 0xdc9d, 0xdd9d, 0xde9d, 0xdf9d, 0xe09d, 0xa4bc, 0xe19d, 0xa5e5, 0xe29d, 0xe39d, 0xe49d, 0xe59d, 0xe69d, 0xe79d, 0xa1e5, 0xe89d, 0xe99d, 0xea9d, 0xeb9d, 0xec9d, 0xed9d, 0xee9d, 0xfee4, 0xf4b1, 0xef9d, 0xf09d, 0xf19d, 0xf29d, 0xf39d, 0xf49d, 0xf59d, 0xf69d, 0xf79d, 0xf89d, 0xf99d, 0xa8e5, 0xfa9d, 0xa9e5, 0xa6e5, 0xfb9d, 0xfc9d, 0xfd9d, 0xfe9d, 0x409e, 0x419e, 0x429e, 0x439e, 0x449e, 0x459e, 0x469e, 0x479e, 0xa7e5, 0xaae5, 0x489e, 0x499e, 0x4a9e, 0x4b9e, 0x4c9e, 0x4d9e, 0x4e9e, 0x4f9e, 0x509e, 0x519e, 0x529e, 0x539e, 0x549e, 0x559e, 0x569e, 0x579e, 0x589e, 0x599e, 0x5a9e, 0x5b9e, 0x5c9e, 0x5d9e, 0x5e9e, 0x5f9e, 0x609e, 0x619e, 0x629e, 0x639e, 0x649e, 0x659e, 0x669e, 0x679e, 0x689e, 0xd9c6, 0x699e, 0x6a9e, 0x6b9e, 0x6c9e, 0x6d9e, 0x6e9e, 0x6f9e, 0x709e, 0xabe5, 0xade5, 0x719e, 0x729e, 0x739e, 0x749e, 0x759e, 0x769e, 0x779e, 0xace5, 0x789e, 0x799e, 0x7a9e, 0x7b9e, 0x7c9e, 0x7d9e, 0x7e9e, 0x809e, 0x819e, 0x829e, 0x839e, 0x849e, 0x859e, 0x869e, 0x879e, 0x889e, 0x899e, 0xafe5, 0x8a9e, 0x8b9e, 0x8c9e, 0xaee5, 0x8d9e, 0x8e9e, 0x8f9e, 0x909e, 0x919e, 0x929e, 0x939e, 0x949e, 0x959e, 0x969e, 0x979e, 0x989e, 0x999e, 0x9a9e, 0x9b9e, 0x9c9e, 0x9d9e, 0x9e9e, 0xe0b9, 0x9f9e, 0xa09e, 0xb0e5, 0xa19e, 0xa29e, 0xa39e, 0xa49e, 0xa59e, 0xa69e, 0xa79e, 0xa89e, 0xa99e, 0xaa9e, 0xab9e, 0xac9e, 0xad9e, 0xae9e, 0xb1e5, 0xaf9e, 0xb09e, 0xb19e, 0xb29e, 0xb39e, 0xb49e, 0xb59e, 0xb69e, 0xb79e, 0xb89e, 0xb99e, 0xba9e, 0xf0bb, 0xe1ec, 0xf0c3, 0xbb9e, 0xc6b5, 0xd2bb, 0xbc9e, 0xbd9e, 0xbe9e, 0xbf9e, 0xe9c1, 0xeed4, 0xc09e, 0xc4be, 0xc19e, 0xc29e, 0xc39e, 0xc6d7, 0xc49e, 0xd6d4, 0xd3b2, 0xbeec, 0xc59e, 0xc69e, 0xc79e, 0xc89e, 0xc1ea, 0xc99e, 0xca9e, 0xcb9e, 0xafc2, 0xb6b4, 0xcc9e, 0xcd9e, 0xce9e, 0xd7d1, 0xcf9e, 0xd09e, 0xd19e, 0xb4b3, 0xd29e, 0xb2c8, 0xbbbf, 0xc0ec, 0xd39e, 0xd49e, 0xcbd6, 0xd59e, 0xd69e, 0xbfec, 0xc1ec, 0xd79e, 0xd89e, 0xd99e, 0xda9e, 0xdb9e, 0xdc9e, 0xdd9e, 0xde9e, 0xdf9e, 0xe09e, 0xe19e, 0xe29e, 0xe39e, 0xc5ec, 0xe6be, 0xbfcc, 0xdac5, 0xbcbe, 0xe49e, 0xc6ec, 0xe59e, 0xfeb1, 0xe69e, 0xe79e, 0xe89e, 0xc4ec, 0xa8d5, 0xe3b5, 0xe99e, 0xc2ec, 0xb6c1, 0xe3b3, 0xea9e, 0xeb9e, 0xc3ec, 0xb8cb, 0xc3c0, 0xfecc, 0xec9e, 0xed9e, 0xee9e, 0xef9e, 0xd2c1, 0xf09e, 0xc8ec, 0xf19e, 0xf29e, 0xf39e, 0xf49e, 0xf59e, 0xf69e, 0xf79e, 0xf89e, 0xf99e, 0xfa9e, 0xfb9e, 0xfc9e, 0xfd9e, 0xe6ba, 0xd3c0, 0xfe9e, 0xf2d6, 0x409f, 0x419f, 0x429f, 0xccd1, 0x439f, 0x449f, 0x459f, 0x469f, 0xbebf, 0x479f, 0xb3b7, 0xd5c9, 0xc7ec, 0xe2bb, 0x489f, 0xcccc, 0xfdbd, 0xc8c8, 0x499f, 0xa9cf, 0x4a9f, 0x4b9f, 0x4c9f, 0x4d9f, 0x4e9f, 0x4f9f, 0x509f, 0xe9cd, 0x519f, 0xebc5, 0x529f, 0x539f, 0x549f, 0xe9b7, 0x559f, 0x569f, 0x579f, 0x589f, 0x599f, 0x5a9f, 0x5b9f, 0x5c9f, 0x5d9f, 0x5e9f, 0x5f9f, 0xc9d1, 0xb8ba, 0x609f, 0x619f, 0x629f, 0x639f, 0x649f, 0xc9ec, 0x659f, 0x669f, 0xcaec, 0x679f, 0xc0bb, 0xcbec, 0x689f, 0xe2ec, 0xbab1, 0xd9b7, 0x699f, 0x6a9f, 0x6b9f, 0x6c9f, 0x6d9f, 0x6e9f, 0x6f9f, 0x709f, 0x719f, 0x729f, 0x739f, 0xb9bd, 0x749f, 0x759f, 0x769f, 0x779f, 0x789f, 0x799f, 0x7a9f, 0x7b9f, 0xccec, 0xe6d1, 0xcdec, 0x7c9f, 0x7d9f, 0x7e9f, 0x809f, 0xbbc8, 0x819f, 0x829f, 0x839f, 0x849f, 0x859f, 0x869f, 0x879f, 0x889f, 0x899f, 0x8a9f, 0x8b9f, 0x8c9f, 0x8d9f, 0x8e9f, 0xd1ec, 0x8f9f, 0x909f, 0x919f, 0x929f, 0xd3ec, 0x939f, 0xcdbb, 0x949f, 0xe5bc, 0x959f, 0x969f, 0x979f, 0x989f, 0x999f, 0x9a9f, 0x9b9f, 0x9c9f, 0x9d9f, 0x9e9f, 0x9f9f, 0xa09f, 0xa19f, 0xcfec, 0xa29f, 0xb7c9, 0xa39f, 0xa49f, 0xa59f, 0xa69f, 0xa79f, 0xbac3, 0xa89f, 0xe3ec, 0xd5d5, 0xd0ec, 0xa99f, 0xaa9f, 0xab9f, 0xac9f, 0xad9f, 0xf3d6, 0xae9f, 0xaf9f, 0xb09f, 0xd2ec, 0xceec, 0xb19f, 0xb29f, 0xb39f, 0xb49f, 0xd4ec, 0xb59f, 0xd5ec, 0xb69f, 0xb79f, 0xbfc9, 0xb89f, 0xb99f, 0xba9f, 0xbb9f, 0xbc9f, 0xbd9f, 0xa8cf, 0xbe9f, 0xbf9f, 0xc09f, 0xc19f, 0xc29f, 0xdcd0, 0xc39f, 0xc49f, 0xc59f, 0xc69f, 0xacd1, 0xc79f, 0xc89f, 0xc99f, 0xca9f, 0xdbc8, 0xcb9f, 0xcc9f, 0xcd9f, 0xd6ec, 0xf5ce, 0xce9f, 0xcf9f, 0xd09f, 0xd19f, 0xd29f, 0xecca, 0xdaec, 0xd39f, 0xd49f, 0xd59f, 0xd69f, 0xd79f, 0xd89f, 0xd99f, 0xd9ec, 0xda9f, 0xdb9f, 0xdc9f, 0xbeb0, 0xdd9f, 0xde9f, 0xdf9f, 0xe09f, 0xe19f, 0xe29f, 0xd7ec, 0xe39f, 0xd8ec, 0xe49f, 0xe59f, 0xe69f, 0xe4ec, 0xe79f, 0xe89f, 0xe99f, 0xea9f, 0xeb9f, 0xec9f, 0xed9f, 0xee9f, 0xef9f, 0xbcc8, 0xf09f, 0xf19f, 0xf29f, 0xf39f, 0xf49f, 0xf59f, 0xf69f, 0xf79f, 0xf89f, 0xf99f, 0xc7c1, 0xfa9f, 0xfb9f, 0xfc9f, 0xfd9f, 0xfe9f, 0xdcec, 0xe0d1, 0x40a0, 0x41a0, 0x42a0, 0x43a0, 0x44a0, 0x45a0, 0x46a0, 0x47a0, 0x48a0, 0x49a0, 0xdbec, 0x4aa0, 0x4ba0, 0x4ca0, 0x4da0, 0xefd4, 0x4ea0, 0xddec, 0x4fa0, 0x50a0, 0x51a0, 0x52a0, 0x53a0, 0x54a0, 0xc6db, 0x55a0, 0x56a0, 0x57a0, 0x58a0, 0x59a0, 0x5aa0, 0x5ba0, 0x5ca0, 0x5da0, 0x5ea0, 0xdeec, 0x5fa0, 0x60a0, 0x61a0, 0x62a0, 0x63a0, 0x64a0, 0x65a0, 0x66a0, 0x67a0, 0x68a0, 0x69a0, 0x6aa0, 0xacb1, 0x6ba0, 0x6ca0, 0x6da0, 0x6ea0, 0x6fa0, 0x70a0, 0x71a0, 0x72a0, 0x73a0, 0x74a0, 0x75a0, 0x76a0, 0x77a0, 0x78a0, 0x79a0, 0x7aa0, 0x7ba0, 0x7ca0, 0x7da0, 0x7ea0, 0x80a0, 0x81a0, 0xdfec, 0x82a0, 0x83a0, 0x84a0, 0x85a0, 0x86a0, 0x87a0, 0x88a0, 0x89a0, 0x8aa0, 0x8ba0, 0xe0ec, 0x8ca0, 0xa6d7, 0x8da0, 0xc0c5, 0x8ea0, 0x8fa0, 0x90a0, 0xbceb, 0xaeb0, 0x91a0, 0x92a0, 0x93a0, 0xf4be, 0xb8b8, 0xafd2, 0xd6b0, 0xf9b5, 0x94a0, 0xb3d8, 0x95a0, 0xaccb, 0x96a0, 0xdde3, 0x97a0, 0x98a0, 0x99a0, 0x9aa0, 0x9ba0, 0x9ca0, 0x9da0, 0xacc6, 0xe6b0, 0x9ea0, 0x9fa0, 0xa0a0, 0xc6c5, 0xb9eb, 0xa1a0, 0xa2a0, 0xa3a0, 0xa4a0, 0xbaeb, 0xa5a0, 0xa6a0, 0xa7a0, 0xbbeb, 0xa8a0, 0xa9a0, 0xc0d1, 0xaaa0, 0xa3c5, 0xaba0, 0xf2ea, 0xaca0, 0xb2c4, 0xada0, 0xb5c4, 0xcec0, 0xaea0, 0xafa0, 0xb0a0, 0xf3ea, 0xc1c4, 0xb1a0, 0xefce, 0xb2a0, 0xb3a0, 0xb4a0, 0xb5a0, 0xf0ea, 0xf4ea, 0xb6a0, 0xb7a0, 0xfcc9, 0xb8a0, 0xb9a0, 0xa3c7, 0xbaa0, 0xbba0, 0xbca0, 0xd8cc, 0xfece, 0xbda0, 0xbea0, 0xbfa0, 0xf5ea, 0xf6ea, 0xaccf, 0xe7c0, 0xc0a0, 0xc1a0, 0xf7ea, 0xc2a0, 0xc3a0, 0xc4a0, 0xc5a0, 0xc6a0, 0xbfb6, 0xf8ea, 0xc7a0, 0xf9ea, 0xc8a0, 0xfaea, 0xc9a0, 0xcaa0, 0xfbea, 0xcba0, 0xcca0, 0xcda0, 0xcea0, 0xcfa0, 0xd0a0, 0xd1a0, 0xd2a0, 0xd3a0, 0xd4a0, 0xd5a0, 0xd6a0, 0xf1ea, 0xd7a0, 0xd8a0, 0xd9a0, 0xdaa0, 0xdba0, 0xdca0, 0xdda0, 0xdea0, 0xdfa0, 0xe0a0, 0xe1a0, 0xe2a0, 0xaec8, 0xebe1, 0xe3a0, 0xb8b7, 0xece1, 0xe4a0, 0xe5a0, 0xe6a0, 0xede1, 0xe7a0, 0xb4d7, 0xeee1, 0xefe1, 0xccd3, 0xe8a0, 0xe9a0, 0xeaa0, 0xeba0, 0xeca0, 0xeda0, 0xeea0, 0xf1e1, 0xf1bf, 0xf0e1, 0xd2b5, 0xefa0, 0xf0a0, 0xf1a0, 0xb7b1, 0xf2a0, 0xf3a0, 0xf4a0, 0xf5a0, 0xf3e1, 0xf2e1, 0xf6a0, 0xfcba, 0xf7a0, 0xf4e1, 0xf8a0, 0xf9a0, 0xfaa0, 0xfba0, 0xb7b9, 0xfca0, 0xd1be, 0xfda0, 0xfea0, 0x40aa, 0x41aa, 0xfcc4, 0x42aa, 0xddba, 0xc6bd, 0x43aa, 0x44aa, 0x45aa, 0x46aa, 0x47aa, 0x48aa, 0xf5e1, 0xf7e1, 0x49aa, 0x4aaa, 0xc0b6, 0xc1cf, 0xa8ca, 0xf6e1, 0xf8d5, 0xfcd3, 0xf8e1, 0xfce1, 0xf9e1, 0x4baa, 0x4caa, 0xfae1, 0xeac0, 0x4daa, 0xfee1, 0xa1e2, 0xc7c0, 0x4eaa, 0x4faa, 0x50aa, 0x51aa, 0xfbe1, 0x52aa, 0xfde1, 0x53aa, 0x54aa, 0x55aa, 0x56aa, 0x57aa, 0x58aa, 0xa5e2, 0x59aa, 0x5aaa, 0x5baa, 0xd4c1, 0x5caa, 0x5daa, 0x5eaa, 0x5faa, 0xa3e2, 0x60aa, 0xa8e2, 0xfeb2, 0xa2e2, 0x61aa, 0x62aa, 0x63aa, 0xcdc3, 0xc2b2, 0xa7e2, 0xa6e2, 0x64aa, 0x65aa, 0xa4e2, 0xa9e2, 0x66aa, 0x67aa, 0xabe2, 0x68aa, 0x69aa, 0x6aaa, 0xc9d0, 0xedd6, 0xa8c3, 0xace2, 0x6baa, 0xd7cf, 0x6caa, 0x6daa, 0xaee2, 0x6eaa, 0x6faa, 0xefba, 0x70aa, 0x71aa, 0xe0e9, 0xade2, 0xaae2, 0x72aa, 0x73aa, 0x74aa, 0x75aa, 0xabbb, 0xb3d4, 0x76aa, 0x77aa, 0x78aa, 0x79aa, 0x7aaa, 0x7baa, 0x7caa, 0x7daa, 0x7eaa, 0x80aa, 0x81aa, 0x82aa, 0x83aa, 0xb0e2, 0x84aa, 0x85aa, 0xafe2, 0x86aa, 0xe1e9, 0x87aa, 0x88aa, 0x89aa, 0x8aaa, 0xb1e2, 0x8baa, 0x8caa, 0x8daa, 0x8eaa, 0x8faa, 0x90aa, 0x91aa, 0x92aa, 0xb2e2, 0x93aa, 0x94aa, 0x95aa, 0x96aa, 0x97aa, 0x98aa, 0x99aa, 0x9aaa, 0x9baa, 0x9caa, 0x9daa, 0xb3e2, 0xa1cc, 0x9eaa, 0xb4e2, 0x9faa, 0xa0aa, 0x40ab, 0x41ab, 0x42ab, 0x43ab, 0x44ab, 0x45ab, 0x46ab, 0x47ab, 0x48ab, 0x49ab, 0x4aab, 0x4bab, 0xb5e2, 0x4cab, 0x4dab, 0x4eab, 0x4fab, 0x50ab, 0xfed0, 0x51ab, 0x52ab, 0xcac2, 0x53ab, 0xf1d3, 0x54ab, 0xf5cd, 0x55ab, 0x56ab, 0xe0e7, 0x57ab, 0x58ab, 0xe1e7, 0x59ab, 0x5aab, 0x5bab, 0x5cab, 0xc1be, 0x5dab, 0x5eab, 0x5fab, 0x60ab, 0xeac2, 0x61ab, 0x62ab, 0x63ab, 0xe4e7, 0x64ab, 0x65ab, 0xe3e7, 0x66ab, 0x67ab, 0x68ab, 0x69ab, 0x6aab, 0x6bab, 0xe6cd, 0x6cab, 0xb5c3, 0x6dab, 0x6eab, 0xe2e7, 0xb7bb, 0xd6cf, 0x6fab, 0xe1c1, 0xe9e7, 0x70ab, 0x71ab, 0x72ab, 0xe8e7, 0x73ab, 0x74ab, 0xf4e7, 0xa3b2, 0x75ab, 0x76ab, 0x77ab, 0x78ab, 0xeae7, 0x79ab, 0xe6e7, 0x7aab, 0x7bab, 0x7cab, 0x7dab, 0x7eab, 0xece7, 0xebe7, 0xbac9, 0x80ab, 0x81ab, 0xe4d5, 0x82ab, 0xe5e7, 0xa9b7, 0xe7e7, 0x83ab, 0x84ab, 0x85ab, 0x86ab, 0x87ab, 0x88ab, 0x89ab, 0xeee7, 0x8aab, 0x8bab, 0x8cab, 0x8dab, 0xf3e7, 0x8eab, 0xe9d6, 0x8fab, 0x90ab, 0x91ab, 0x92ab, 0xede7, 0x93ab, 0xf2e7, 0x94ab, 0xf1e7, 0x95ab, 0x96ab, 0x97ab, 0xe0b0, 0x98ab, 0x99ab, 0x9aab, 0x9bab, 0xf5e7, 0x9cab, 0x9dab, 0x9eab, 0x9fab, 0xa0ab, 0x40ac, 0x41ac, 0x42ac, 0x43ac, 0x44ac, 0x45ac, 0x46ac, 0x47ac, 0x48ac, 0x49ac, 0x4aac, 0xf2c7, 0x4bac, 0xc5c0, 0xedc0, 0x4cac, 0x4dac, 0xf0c1, 0xf0e7, 0x4eac, 0x4fac, 0x50ac, 0x51ac, 0xf6e7, 0xf6cb, 0x52ac, 0x53ac, 0x54ac, 0x55ac, 0x56ac, 0x57ac, 0x58ac, 0x59ac, 0x5aac, 0xa2e8, 0xa1e8, 0x5bac, 0x5cac, 0x5dac, 0x5eac, 0x5fac, 0x60ac, 0xc1d7, 0x61ac, 0x62ac, 0xfae7, 0xf9e7, 0x63ac, 0xfbe7, 0x64ac, 0xf7e7, 0x65ac, 0xfee7, 0x66ac, 0xfde7, 0x67ac, 0xfce7, 0x68ac, 0x69ac, 0xd5c1, 0xd9c7, 0xfdc5, 0xc3c5, 0x6aac, 0x6bac, 0x6cac, 0x6dac, 0x6eac, 0xedc7, 0x6fac, 0x70ac, 0x71ac, 0x72ac, 0xa3e8, 0x73ac, 0x74ac, 0x75ac, 0x76ac, 0x77ac, 0x78ac, 0x79ac, 0x7aac, 0x7bac, 0x7cac, 0x7dac, 0x7eac, 0x80ac, 0x81ac, 0x82ac, 0x83ac, 0x84ac, 0x85ac, 0x86ac, 0xa6e8, 0x87ac, 0xa5e8, 0x88ac, 0xa7e8, 0xf7ba, 0xf8e7, 0xa4e8, 0x89ac, 0xf0c8, 0xaac9, 0x8aac, 0x8bac, 0x8cac, 0x8dac, 0x8eac, 0x8fac, 0x90ac, 0x91ac, 0x92ac, 0x93ac, 0x94ac, 0x95ac, 0x96ac, 0xa9e8, 0x97ac, 0x98ac, 0xe5b9, 0x99ac, 0x9aac, 0x9bac, 0x9cac, 0x9dac, 0xfed1, 0xa8e8, 0x9eac, 0x9fac, 0xa0ac, 0x40ad, 0x41ad, 0x42ad, 0xaae8, 0x43ad, 0xade8, 0xaee8, 0x44ad, 0xa7c1, 0x45ad, 0x46ad, 0x47ad, 0xafe8, 0x48ad, 0x49ad, 0x4aad, 0xb0e8, 0x4bad, 0x4cad, 0xace8, 0x4dad, 0xb4e8, 0x4ead, 0x4fad, 0x50ad, 0x51ad, 0x52ad, 0x53ad, 0x54ad, 0x55ad, 0x56ad, 0x57ad, 0x58ad, 0xabe8, 0x59ad, 0xb1e8, 0x5aad, 0x5bad, 0x5cad, 0x5dad, 0x5ead, 0x5fad, 0x60ad, 0x61ad, 0xb5e8, 0xb2e8, 0xb3e8, 0x62ad, 0x63ad, 0x64ad, 0x65ad, 0x66ad, 0x67ad, 0x68ad, 0x69ad, 0x6aad, 0x6bad, 0x6cad, 0x6dad, 0x6ead, 0x6fad, 0x70ad, 0x71ad, 0xb7e8, 0x72ad, 0x73ad, 0x74ad, 0x75ad, 0x76ad, 0x77ad, 0x78ad, 0x79ad, 0x7aad, 0x7bad, 0x7cad, 0x7dad, 0x7ead, 0x80ad, 0x81ad, 0x82ad, 0x83ad, 0x84ad, 0x85ad, 0x86ad, 0x87ad, 0x88ad, 0x89ad, 0xb6e8, 0x8aad, 0x8bad, 0x8cad, 0x8dad, 0x8ead, 0x8fad, 0x90ad, 0x91ad, 0x92ad, 0xcfb9, 0x93ad, 0xacf0, 0x94ad, 0xadf0, 0x95ad, 0xb0c6, 0xeab0, 0xbfc8, 0x96ad, 0xdfcd, 0x97ad, 0x98ad, 0x99ad, 0x9aad, 0x9bad, 0x9cad, 0x9dad, 0xcdce, 0xb1ea, 0x9ead, 0x9fad, 0xa0ad, 0x40ae, 0xb2ea, 0x41ae, 0xbfc6, 0xc9b4, 0x42ae, 0x43ae, 0x44ae, 0x45ae, 0x46ae, 0x47ae, 0x48ae, 0xb3ea, 0x49ae, 0x4aae, 0x4bae, 0x4cae, 0xe7d5, 0x4dae, 0x4eae, 0x4fae, 0x50ae, 0x51ae, 0x52ae, 0x53ae, 0x54ae, 0xf9dd, 0x55ae, 0xb4ea, 0x56ae, 0xb5ea, 0x57ae, 0xb6ea, 0x58ae, 0x59ae, 0x5aae, 0x5bae, 0xcab8, 0xb0df, 0xf5c9, 0x5cae, 0xf0cc, 0x5dae, 0x5eae, 0xfac9, 0x5fae, 0x60ae, 0x61ae, 0x62ae, 0x63ae, 0xfbc9, 0x64ae, 0x65ae, 0xc3d3, 0xa6cb, 0x66ae, 0xa6b8, 0xaef0, 0xc2b1, 0x67ae, 0xb8e5, 0xefcc, 0xc9d3, 0xd7bc, 0xeac9, 0x68ae, 0xe7b5, 0x69ae, 0xd0c4, 0xe9b5, 0x6aae, 0xaeee, 0xadbb, 0x6bae, 0x6cae, 0xdee7, 0x6dae, 0xafee, 0x6eae, 0x6fae, 0x70ae, 0x71ae, 0xa9b3, 0x72ae, 0x73ae, 0xb2ee, 0x74ae, 0x75ae, 0xb1ee, 0xe7bd, 0x76ae, 0xb0ee, 0xb7ce, 0x77ae, 0x78ae, 0x79ae, 0x7aae, 0xcfc5, 0x7bae, 0x7cae, 0x7dae, 0x7eae, 0xf4c1, 0xcedb, 0xb3ee, 0xf3d0, 0x80ae, 0x81ae, 0x82ae, 0x83ae, 0x84ae, 0x85ae, 0x86ae, 0x87ae, 0xd4c2, 0xe8c6, 0x88ae, 0x89ae, 0x8aae, 0xacb7, 0x8bae, 0x8cae, 0x8dae, 0x8eae, 0x8fae, 0x90ae, 0x91ae, 0xb4ee, 0x92ae, 0xebb3, 0x93ae, 0x94ae, 0x95ae, 0xfbbb, 0xb5ee, 0x96ae, 0x97ae, 0x98ae, 0x99ae, 0x9aae, 0xdce7, 0x9bae, 0x9cae, 0x9dae, 0xb6ee, 0x9eae, 0x9fae, 0xaebd, 0xa0ae, 0x40af, 0x41af, 0x42af, 0xe2f1, 0x43af, 0x44af, 0x45af, 0xe8ca, 0x46af, 0xc9d2, 0xdaf0, 0x47af, 0xdbf0, 0x48af, 0xdcf0, 0xc6c1, 0x49af, 0xedb8, 0xcebe, 0x4aaf, 0x4baf, 0xdef0, 0x4caf, 0xb1c5, 0xddf0, 0xf1d1, 0x4daf, 0xe0f0, 0xccb0, 0xeabd, 0x4eaf, 0x4faf, 0x50af, 0x51af, 0x52af, 0xdfd2, 0xdff0, 0x53af, 0xafb4, 0xe8b7, 0xe6f0, 0xe5f0, 0xa3c6, 0xe1f0, 0xe2f0, 0xc3b4, 0x54af, 0x55af, 0xe3f0, 0xeed5, 0x56af, 0x57af, 0xdbcc, 0xd2be, 0xb2bc, 0x58af, 0x59af, 0x5aaf, 0xe8f0, 0xe7f0, 0xe4f0, 0xa1b2, 0x5baf, 0xa2d6, 0xb8d3, 0xb7be, 0xacc8, 0x5caf, 0x5daf, 0xeaf0, 0x5eaf, 0x5faf, 0x60af, 0x61af, 0xf7d1, 0x62af, 0xccd6, 0xdbba, 0xe9f0, 0x63af, 0xbbb6, 0x64af, 0x65af, 0xb4cd, 0x66af, 0x67af, 0xa6c6, 0x68af, 0x69af, 0x6aaf, 0xa1c1, 0xebf0, 0xeef0, 0x6baf, 0xedf0, 0xf0f0, 0xecf0, 0x6caf, 0xbebb, 0xeff0, 0x6daf, 0x6eaf, 0x6faf, 0x70af, 0xb5cc, 0xf2f0, 0x71af, 0x72af, 0xd5b3, 0x73af, 0x74af, 0x75af, 0x76af, 0xd4b1, 0x77af, 0x78af, 0xf3f0, 0x79af, 0x7aaf, 0xf4f0, 0xf6f0, 0xe1b4, 0x7baf, 0xf1f0, 0x7caf, 0xf7f0, 0x7daf, 0x7eaf, 0x80af, 0x81af, 0xfaf0, 0x82af, 0xf8f0, 0x83af, 0x84af, 0x85af, 0xf5f0, 0x86af, 0x87af, 0x88af, 0x89af, 0xfdf0, 0x8aaf, 0xf9f0, 0xfcf0, 0xfef0, 0x8baf, 0xa1f1, 0x8caf, 0x8daf, 0x8eaf, 0xc1ce, 0xa4f1, 0x8faf, 0xa3f1, 0x90af, 0xf6c1, 0xfbf0, 0xddca, 0x91af, 0x92af, 0xf1b4, 0xf1b1, 0xb1cc, 0x93af, 0xa6f1, 0x94af, 0x95af, 0xa7f1, 0x96af, 0x97af, 0xacf1, 0xced5, 0xa9f1, 0x98af, 0x99af, 0xb3c8, 0x9aaf, 0x9baf, 0x9caf, 0xa2f1, 0x9daf, 0xabf1, 0xa8f1, 0xa5f1, 0x9eaf, 0x9faf, 0xaaf1, 0xa0af, 0x40b0, 0x41b0, 0x42b0, 0x43b0, 0x44b0, 0x45b0, 0x46b0, 0xa9b0, 0xadf1, 0x47b0, 0x48b0, 0x49b0, 0x4ab0, 0x4bb0, 0x4cb0, 0xaff1, 0x4db0, 0xb1f1, 0x4eb0, 0x4fb0, 0x50b0, 0x51b0, 0x52b0, 0xb0f1, 0x53b0, 0xaef1, 0x54b0, 0x55b0, 0x56b0, 0x57b0, 0xa2d1, 0x58b0, 0x59b0, 0x5ab0, 0x5bb0, 0x5cb0, 0x5db0, 0x5eb0, 0xb2f1, 0x5fb0, 0x60b0, 0x61b0, 0xb3f1, 0x62b0, 0x63b0, 0x64b0, 0x65b0, 0x66b0, 0x67b0, 0x68b0, 0x69b0, 0xefb9, 0x6ab0, 0x6bb0, 0xc7b5, 0x6cb0, 0xd7b0, 0xd9b0, 0x6db0, 0x6eb0, 0x6fb0, 0xedd4, 0x70b0, 0xc4b5, 0x71b0, 0xd4bd, 0xcabb, 0xa7f0, 0x72b0, 0x73b0, 0xdeb8, 0x74b0, 0x75b0, 0xa8f0, 0x76b0, 0x77b0, 0xa8b0, 0x78b0, 0xa9f0, 0x79b0, 0x7ab0, 0xeecd, 0x7bb0, 0x7cb0, 0xaaf0, 0x7db0, 0x7eb0, 0x80b0, 0x81b0, 0x82b0, 0x83b0, 0x84b0, 0x85b0, 0x86b0, 0x87b0, 0xabf0, 0x88b0, 0x89b0, 0x8ab0, 0x8bb0, 0x8cb0, 0x8db0, 0x8eb0, 0x8fb0, 0x90b0, 0xa4c6, 0x91b0, 0x92b0, 0xe5d6, 0xe4f1, 0x93b0, 0xe5f1, 0x94b0, 0x95b0, 0x96b0, 0x97b0, 0x98b0, 0x99b0, 0x9ab0, 0x9bb0, 0x9cb0, 0x9db0, 0xf3c3, 0x9eb0, 0x9fb0, 0xdbd3, 0xa0b0, 0x40b1, 0xd1d6, 0xe8c5, 0x41b1, 0xafd3, 0x42b1, 0xe6d2, 0x43b1, 0x44b1, 0xc1ee, 0xbbb0, 0xb5d5, 0xced1, 0xe0bc, 0xd0ba, 0x45b1, 0xf8bf, 0x46b1, 0xc7b8, 0xc1b5, 0xccc5, 0x47b1, 0x48b1, 0xa2ca, 0x49b1, 0x4ab1, 0x4bb1, 0xcbc3, 0x4cb1, 0x4db1, 0x4eb1, 0x4fb1, 0x50b1, 0xc2ee, 0x51b1, 0x52b1, 0x53b1, 0x54b1, 0x55b1, 0x56b1, 0x57b1, 0x58b1, 0xbfc4, 0xa2b6, 0x59b1, 0xeced, 0xa4c3, 0x5ab1, 0xb1d6, 0x5bb1, 0x5cb1, 0x5db1, 0xe0cf, 0xefed, 0x5eb1, 0x5fb1, 0xcec5, 0x60b1, 0xdcb6, 0x61b1, 0x62b1, 0xa1ca, 0x63b1, 0x64b1, 0xeded, 0x65b1, 0x66b1, 0xf0ed, 0xf1ed, 0xbcc3, 0x67b1, 0xb4bf, 0x68b1, 0xeeed, 0x69b1, 0x6ab1, 0x6bb1, 0x6cb1, 0x6db1, 0x6eb1, 0x6fb1, 0x70b1, 0x71b1, 0x72b1, 0x73b1, 0xf4ed, 0xf2ed, 0x74b1, 0x75b1, 0x76b1, 0x77b1, 0xe6d5, 0xdfc3, 0x78b1, 0xf3ed, 0x79b1, 0x7ab1, 0x7bb1, 0xf6ed, 0x7cb1, 0xa3d5, 0xa3d1, 0x7db1, 0x7eb1, 0x80b1, 0xf5ed, 0x81b1, 0xd0c3, 0x82b1, 0x83b1, 0x84b1, 0x85b1, 0x86b1, 0xf7ed, 0xf4bf, 0xecbe, 0xf8ed, 0x87b1, 0xf7cc, 0x88b1, 0xdbd1, 0x89b1, 0x8ab1, 0x8bb1, 0xc5d7, 0xf6d5, 0x8cb1, 0xfced, 0x8db1, 0x8eb1, 0x8fb1, 0xfbed, 0x90b1, 0x91b1, 0x92b1, 0x93b1, 0x94b1, 0x95b1, 0x96b1, 0x97b1, 0xf9ed, 0xfaed, 0x98b1, 0x99b1, 0x9ab1, 0x9bb1, 0x9cb1, 0x9db1, 0x9eb1, 0x9fb1, 0xfded, 0xa6be, 0xa0b1, 0x40b2, 0x41b2, 0x42b2, 0x43b2, 0xafcb, 0xa1ee, 0xbdb6, 0x44b2, 0xa2ee, 0xc0c4, 0x45b2, 0xfeed, 0x46b2, 0x47b2, 0xdebd, 0xc7b2, 0x48b2, 0x49b2, 0x4ab2, 0x4bb2, 0x4cb2, 0x4db2, 0x4eb2, 0x4fb2, 0x50b2, 0x51b2, 0x52b2, 0x53b2, 0xc3b6, 0x54b2, 0x55b2, 0x56b2, 0xa5ee, 0xbad8, 0xa3ee, 0xa6ee, 0x57b2, 0x58b2, 0x59b2, 0xe9c3, 0xf2b3, 0x5ab2, 0x5bb2, 0x5cb2, 0x5db2, 0x5eb2, 0x5fb2, 0xa7ee, 0xa4ee, 0xb9cf, 0x60b2, 0x61b2, 0xa8ee, 0xf7c2, 0x62b2, 0x63b2, 0x64b2, 0x65b2, 0x66b2, 0x67b2, 0x68b2, 0x69b2, 0x6ab2, 0x6bb2, 0x6cb2, 0x6db2, 0xa9ee, 0xaaee, 0x6eb2, 0xabde, 0x6fb2, 0x70b2, 0xb3c6, 0x71b2, 0xc6c7, 0x72b2, 0xf5d6, 0xc9b5, 0x73b2, 0xb2cb, 0x74b2, 0x75b2, 0x76b2, 0xabee, 0x77b2, 0x78b2, 0xabcd, 0x79b2, 0xacee, 0x7ab2, 0x7bb2, 0x7cb2, 0x7db2, 0x7eb2, 0xb0d5, 0x80b2, 0xadee, 0x81b2, 0xc4f6, 0x82b2, 0x83b2, 0x84b2, 0x85b2, 0x86b2, 0x87b2, 0x88b2, 0x89b2, 0x8ab2, 0x8bb2, 0x8cb2, 0x8db2, 0x8eb2, 0xc7db, 0x8fb2, 0x90b2, 0x91b2, 0x92b2, 0x93b2, 0x94b2, 0x95b2, 0x96b2, 0x97b2, 0xa3b4, 0x98b2, 0x99b2, 0x9ab2, 0xacc3, 0xe6f1, 0x9bb2, 0x9cb2, 0x9db2, 0x9eb2, 0x9fb2, 0xb8ca, 0xd3d2, 0xa0b2, 0xaad6, 0x40b3, 0xf2ef, 0x41b3, 0xd8be, 0x42b3, 0xc3bd, 0xf3ef, 0xccb6, 0xabb0, 0x43b3, 0x44b3, 0x45b3, 0x46b3, 0xafca, 0x47b3, 0x48b3, 0xb6ed, 0x49b3, 0xb7ed, 0x4ab3, 0x4bb3, 0x4cb3, 0x4db3, 0xf9ce, 0xafb7, 0xf3bf, 0xb8ed, 0xebc2, 0xb0c9, 0x4eb3, 0x4fb3, 0x50b3, 0x51b3, 0x52b3, 0x53b3, 0xb9ed, 0x54b3, 0x55b3, 0xf6c6, 0xb3bf, 0x56b3, 0x57b3, 0x58b3, 0xbced, 0xf8c5, 0x59b3, 0xd0d1, 0x5ab3, 0xa9d7, 0xbaed, 0xbbed, 0x5bb3, 0xe2d1, 0x5cb3, 0xbfed, 0xc0ed, 0x5db3, 0xc4ed, 0x5eb3, 0x5fb3, 0x60b3, 0xc8ed, 0x61b3, 0xc6ed, 0xceed, 0xe8d5, 0x62b3, 0xc9ed, 0x63b3, 0x64b3, 0xc7ed, 0xbeed, 0x65b3, 0x66b3, 0xe9c5, 0x67b3, 0x68b3, 0x69b3, 0xc6c6, 0x6ab3, 0x6bb3, 0xe9c9, 0xd2d4, 0xc1ed, 0xc2ed, 0xc3ed, 0xc5ed, 0x6cb3, 0xf9c0, 0x6db3, 0xa1b4, 0x6eb3, 0x6fb3, 0x70b3, 0x71b3, 0xe8b9, 0x72b3, 0xd0ed, 0x73b3, 0x74b3, 0x75b3, 0x76b3, 0xd1ed, 0x77b3, 0xcaed, 0x78b3, 0xcfed, 0x79b3, 0xf8ce, 0x7ab3, 0x7bb3, 0xb6cb, 0xcced, 0xcded, 0x7cb3, 0x7db3, 0x7eb3, 0x80b3, 0x81b3, 0xf5cf, 0x82b3, 0x83b3, 0x84b3, 0x85b3, 0x86b3, 0x87b3, 0x88b3, 0x89b3, 0x8ab3, 0x8bb3, 0x8cb3, 0x8db3, 0xd2ed, 0xf2c1, 0xb2d3, 0xcbed, 0xb7c8, 0x8eb3, 0x8fb3, 0x90b3, 0x91b3, 0x92b3, 0x93b3, 0x94b3, 0x95b3, 0xefbc, 0x96b3, 0x97b3, 0x98b3, 0x99b3, 0xf0c5, 0x9ab3, 0x9bb3, 0x9cb3, 0x9db3, 0x9eb3, 0x9fb3, 0xa0b3, 0x40b4, 0x41b4, 0x42b4, 0xd6ed, 0x43b4, 0xefb5, 0x44b4, 0x45b4, 0xb5c2, 0xadb0, 0xe9cb, 0x46b4, 0x47b4, 0xaeb1, 0x48b4, 0xd4ed, 0x49b4, 0x4ab4, 0x4bb4, 0xebcd, 0xe2b5, 0x4cb4, 0xd5ed, 0xd3ed, 0xd7ed, 0x4db4, 0x4eb4, 0xfab5, 0x4fb4, 0xd8ed, 0x50b4, 0xd9ed, 0x51b4, 0xdced, 0x52b4, 0xccb1, 0x53b4, 0x54b4, 0x55b4, 0x56b4, 0x57b4, 0x58b4, 0x59b4, 0x5ab4, 0xf6c5, 0xeebc, 0xdaed, 0xbccc, 0xeab2, 0x5bb4, 0x5cb4, 0x5db4, 0x5eb4, 0xdbed, 0x5fb4, 0x60b4, 0x61b4, 0x62b4, 0xebc4, 0x63b4, 0x64b4, 0xc5b4, 0x65b4, 0x66b4, 0x67b4, 0xf5b0, 0x68b4, 0x69b4, 0x6ab4, 0xdfed, 0xdac0, 0xe8b4, 0x6bb4, 0x6cb4, 0x6db4, 0x6eb4, 0xcdc5, 0x6fb4, 0x70b4, 0x71b4, 0xdded, 0xc4bf, 0x72b4, 0x73b4, 0x74b4, 0xdeed, 0x75b4, 0x76b4, 0x77b4, 0x78b4, 0x79b4, 0x7ab4, 0x7bb4, 0x7cb4, 0x7db4, 0x7eb4, 0x80b4, 0x81b4, 0x82b4, 0x83b4, 0xa5c4, 0x84b4, 0x85b4, 0x86b4, 0xe0ed, 0x87b4, 0x88b4, 0x89b4, 0x8ab4, 0x8bb4, 0xe1ed, 0x8cb4, 0xe3ed, 0x8db4, 0x8eb4, 0xd7c1, 0x8fb4, 0x90b4, 0xc7bb, 0x91b4, 0x92b4, 0x93b4, 0x94b4, 0x95b4, 0x96b4, 0xb8bd, 0x97b4, 0x98b4, 0x99b4, 0xe2ed, 0x9ab4, 0x9bb4, 0x9cb4, 0x9db4, 0x9eb4, 0x9fb4, 0xa0b4, 0x40b5, 0x41b5, 0x42b5, 0x43b5, 0x44b5, 0x45b5, 0xe4ed, 0x46b5, 0x47b5, 0x48b5, 0x49b5, 0x4ab5, 0x4bb5, 0x4cb5, 0x4db5, 0x4eb5, 0x4fb5, 0xe6ed, 0x50b5, 0x51b5, 0x52b5, 0x53b5, 0x54b5, 0xe5ed, 0x55b5, 0x56b5, 0x57b5, 0x58b5, 0x59b5, 0x5ab5, 0x5bb5, 0x5cb5, 0x5db5, 0x5eb5, 0x5fb5, 0x60b5, 0x61b5, 0x62b5, 0x63b5, 0xe7ed, 0x64b5, 0x65b5, 0x66b5, 0x67b5, 0x68b5, 0xbeca, 0xeaec, 0xf1c0, 0x69b5, 0xe7c9, 0x6ab5, 0xebec, 0xeec6, 0x6bb5, 0x6cb5, 0x6db5, 0x6eb5, 0xecec, 0x6fb5, 0xedc6, 0xedec, 0x70b5, 0x71b5, 0x72b5, 0x73b5, 0x74b5, 0x75b5, 0x76b5, 0x77b5, 0x78b5, 0xf0ec, 0x79b5, 0x7ab5, 0xe6d7, 0xf3ec, 0x7bb5, 0x7cb5, 0xf1ec, 0xeeec, 0xefec, 0xa3d7, 0xf1c9, 0xeecb, 0xf4ec, 0x7db5, 0xf2ec, 0x7eb5, 0x80b5, 0xe9cf, 0x81b5, 0xf6ec, 0xb1c6, 0x82b5, 0x83b5, 0x84b5, 0x85b5, 0xc0bc, 0x86b5, 0xf5ec, 0x87b5, 0x88b5, 0x89b5, 0x8ab5, 0x8bb5, 0x8cb5, 0x8db5, 0xbbb5, 0xf6bb, 0x8eb5, 0xf7ec, 0x8fb5, 0x90b5, 0x91b5, 0x92b5, 0x93b5, 0xf7d9, 0xfbbd, 0x94b5, 0x95b5, 0xbbc2, 0xf8ec, 0x96b5, 0x97b5, 0x98b5, 0x99b5, 0xf9ec, 0x9ab5, 0x9bb5, 0x9cb5, 0x9db5, 0xa3b8, 0x9eb5, 0x9fb5, 0xa0b5, 0x40b6, 0x41b6, 0x42b6, 0x43b6, 0x44b6, 0x45b6, 0x46b6, 0xfaec, 0x47b6, 0x48b6, 0x49b6, 0x4ab6, 0x4bb6, 0x4cb6, 0x4db6, 0x4eb6, 0x4fb6, 0x50b6, 0x51b6, 0x52b6, 0xfbec, 0x53b6, 0x54b6, 0x55b6, 0x56b6, 0x57b6, 0x58b6, 0x59b6, 0x5ab6, 0x5bb6, 0x5cb6, 0x5db6, 0xfcec, 0x5eb6, 0x5fb6, 0x60b6, 0x61b6, 0x62b6, 0xedd3, 0xaed8, 0xebc0, 0x63b6, 0xddc7, 0xccba, 0x64b6, 0xe3d0, 0xbdcb, 0x65b6, 0xbacd, 0x66b6, 0x67b6, 0xd1b8, 0x68b6, 0x69b6, 0xfcb1, 0x6ab6, 0xefc7, 0x6bb6, 0xd6d6, 0x6cb6, 0x6db6, 0x6eb6, 0xc6bf, 0xebc3, 0x6fb6, 0x70b6, 0xf5ef, 0x71b6, 0x72b6, 0xd8c3, 0x73b6, 0x74b6, 0x75b6, 0x76b6, 0x77b6, 0x78b6, 0xe2d7, 0x79b6, 0x7ab6, 0x7bb6, 0xf7ef, 0xd3b3, 0x7cb6, 0xd8c7, 0xedd1, 0x7db6, 0xc8d6, 0x7eb6, 0xf8ef, 0x80b6, 0xf6ef, 0x81b6, 0xfdbb, 0xc6b3, 0x82b6, 0x83b6, 0x84b6, 0x85b6, 0x86b6, 0x87b6, 0x88b6, 0xd5bd, 0x89b6, 0x8ab6, 0xc6d2, 0x8bb6, 0xe0bb, 0x8cb6, 0x8db6, 0xa1cf, 0x8eb6, 0xfcef, 0xfbef, 0x8fb6, 0x90b6, 0xf9ef, 0x91b6, 0x92b6, 0x93b6, 0x94b6, 0xccb3, 0x95b6, 0xd4c9, 0xb0cb, 0x96b6, 0x97b6, 0x98b6, 0x99b6, 0x9ab6, 0xfeef, 0x9bb6, 0x9cb6, 0xdeb0, 0x9db6, 0x9eb6, 0xc9d6, 0x9fb6, 0xa0b6, 0x40b7, 0xfdef, 0x41b7, 0xedb3, 0x42b7, 0x43b7, 0xd5f6, 0x44b7, 0x45b7, 0x46b7, 0x47b7, 0x48b7, 0x49b7, 0x4ab7, 0x4bb7, 0x4cb7, 0x4db7, 0x4eb7, 0x4fb7, 0x50b7, 0x51b7, 0x52b7, 0xc8ce, 0x53b7, 0x54b7, 0x55b7, 0xa2f0, 0x56b7, 0xa1f0, 0x57b7, 0xbeb5, 0xdabc, 0xfcbb, 0x58b7, 0xe5b8, 0x59b7, 0x5ab7, 0x5bb7, 0x5cb7, 0x5db7, 0x5eb7, 0xc2c4, 0x5fb7, 0x60b7, 0x61b7, 0x62b7, 0x63b7, 0x64b7, 0x65b7, 0x66b7, 0x67b7, 0x68b7, 0xa3f0, 0x69b7, 0x6ab7, 0x6bb7, 0x6cb7, 0x6db7, 0xebcb, 0x6eb7, 0x6fb7, 0x70b7, 0x71b7, 0x72b7, 0x73b7, 0x74b7, 0x75b7, 0x76b7, 0x77b7, 0x78b7, 0x79b7, 0x7ab7, 0x7bb7, 0x7cb7, 0x7db7, 0x7eb7, 0x80b7, 0x81b7, 0x82b7, 0x83b7, 0x84b7, 0x85b7, 0x86b7, 0xa6f0, 0x87b7, 0x88b7, 0x89b7, 0xa8d1, 0x8ab7, 0xbfbe, 0xeec7, 0xb6f1, 0xb7f1, 0xd5bf, 0x8bb7, 0x8cb7, 0x8db7, 0x8eb7, 0xa9b4, 0xb8f1, 0xbbcd, 0x8fb7, 0xd4c7, 0xadd5, 0x90b7, 0xb9f1, 0x91b7, 0xbaf1, 0x92b7, 0x93b7, 0x94b7, 0x95b7, 0xcfc7, 0x96b7, 0x97b7, 0x98b7, 0xa4d2, 0xcfd6, 0x99b7, 0x9ab7, 0xbbf1, 0xd1bd, 0xb0b4, 0xbdbe, 0x9bb7, 0x9cb7, 0x9db7, 0xdcb4, 0xd1ce, 0x9eb7, 0xdfbf, 0xbdf1, 0x9fb7, 0xa0b7, 0x40b8, 0x41b8, 0xfabf, 0xbcf1, 0x42b8, 0xbff1, 0x43b8, 0x44b8, 0x45b8, 0xbef1, 0xc0f1, 0x46b8, 0x47b8, 0x48b8, 0x49b8, 0x4ab8, 0xc1f1, 0x4bb8, 0x4cb8, 0x4db8, 0x4eb8, 0x4fb8, 0x50b8, 0x51b8, 0x52b8, 0x53b8, 0x54b8, 0x55b8, 0xfec1, 0x56b8, 0x57b8, 0x58b8, 0x59b8, 0x5ab8, 0x5bb8, 0x5cb8, 0x5db8, 0x5eb8, 0x5fb8, 0x60b8, 0xa2c1, 0x61b8, 0x62b8, 0x63b8, 0x64b8, 0x65b8, 0x66b8, 0x67b8, 0x68b8, 0x69b8, 0x6ab8, 0xfaca, 0x6bb8, 0x6cb8, 0xbed5, 0x6db8, 0x6eb8, 0x6fb8, 0x70b8, 0xbabe, 0xb9be, 0xc2d5, 0x71b8, 0x72b8, 0xa2bf, 0x73b8, 0xafcd, 0xb5f1, 0x74b8, 0x75b8, 0x76b8, 0x77b8, 0x78b8, 0x79b8, 0xdfbd, 0x7ab8, 0xcbb6, 0x7bb8, 0x7cb8, 0x7db8, 0x7eb8, 0x80b8, 0x81b8, 0x82b8, 0x83b8, 0x84b8, 0xf1d6, 0xc3f3, 0x85b8, 0x86b8, 0xc4f3, 0x87b8, 0xcdb8, 0x88b8, 0x89b8, 0x8ab8, 0xc6f3, 0xc7f3, 0x8bb8, 0xcab0, 0x8cb8, 0xc5f3, 0x8db8, 0xc9f3, 0xf1cb, 0x8eb8, 0x8fb8, 0x90b8, 0xcbf3, 0x91b8, 0xa6d0, 0x92b8, 0x93b8, 0xcab1, 0xc8f3, 0x94b8, 0x95b8, 0x96b8, 0xcff3, 0x97b8, 0xd1b5, 0x98b8, 0x99b8, 0xd7f3, 0x9ab8, 0xd2f3, 0x9bb8, 0x9cb8, 0x9db8, 0xd4f3, 0xd3f3, 0xfbb7, 0x9eb8, 0xbfb1, 0x9fb8, 0xcef3, 0xcaf3, 0xdab5, 0xa0b8, 0xd0f3, 0x40b9, 0x41b9, 0xd1f3, 0x42b9, 0xd5f3, 0x43b9, 0x44b9, 0x45b9, 0x46b9, 0xcdf3, 0x47b9, 0xe3bc, 0x48b9, 0xfdc1, 0x49b9, 0xd6f3, 0x4ab9, 0x4bb9, 0x4cb9, 0x4db9, 0x4eb9, 0x4fb9, 0xdaf3, 0x50b9, 0xccf3, 0x51b9, 0xc8b5, 0x52b9, 0xeebd, 0xdcf3, 0x53b9, 0x54b9, 0xa4b7, 0xf0bf, 0xfed6, 0xb2cd, 0x55b9, 0xf0b4, 0x56b9, 0xdfb2, 0x57b9, 0xd8f3, 0x58b9, 0xd9f3, 0xb8c9, 0x59b9, 0xddf3, 0x5ab9, 0x5bb9, 0xdef3, 0x5cb9, 0xe1f3, 0x5db9, 0x5eb9, 0x5fb9, 0x60b9, 0x61b9, 0x62b9, 0x63b9, 0x64b9, 0x65b9, 0x66b9, 0x67b9, 0xdff3, 0x68b9, 0x69b9, 0xe3f3, 0xe2f3, 0x6ab9, 0x6bb9, 0xdbf3, 0x6cb9, 0xeabf, 0x6db9, 0xefb3, 0x6eb9, 0xe0f3, 0x6fb9, 0x70b9, 0xa9c7, 0x71b9, 0xf2bc, 0x72b9, 0x73b9, 0x74b9, 0x75b9, 0xebf3, 0x76b9, 0x77b9, 0x78b9, 0x79b9, 0x7ab9, 0x7bb9, 0x7cb9, 0xbfb9, 0x7db9, 0x7eb9, 0xe4f3, 0x80b9, 0x81b9, 0x82b9, 0xadb2, 0xfebb, 0x83b9, 0xe3cb, 0x84b9, 0x85b9, 0x86b9, 0x87b9, 0xedf3, 0xe9f3, 0x88b9, 0x89b9, 0x8ab9, 0xdcb9, 0xeef3, 0x8bb9, 0x8cb9, 0x8db9, 0xe5f3, 0xe6f3, 0xeaf3, 0xe1c2, 0xecf3, 0xeff3, 0xe8f3, 0xfdbc, 0x8eb9, 0x8fb9, 0x90b9, 0xe4cf, 0x91b9, 0x92b9, 0xf0f3, 0x93b9, 0x94b9, 0x95b9, 0xe7f3, 0x96b9, 0x97b9, 0x98b9, 0x99b9, 0x9ab9, 0x9bb9, 0x9cb9, 0x9db9, 0xf2f3, 0x9eb9, 0x9fb9, 0xa0b9, 0x40ba, 0xadd7, 0xaac6, 0x41ba, 0x42ba, 0x43ba, 0x44ba, 0xf3f3, 0x45ba, 0x46ba, 0x47ba, 0x48ba, 0xf1f3, 0x49ba, 0xa8c2, 0x4aba, 0x4bba, 0x4cba, 0x4dba, 0x4eba, 0xddb8, 0xf5f3, 0x4fba, 0x50ba, 0xf4f3, 0x51ba, 0x52ba, 0x53ba, 0xdbb4, 0x54ba, 0x55ba, 0x56ba, 0xf6f3, 0xf7f3, 0x57ba, 0x58ba, 0x59ba, 0xf8f3, 0x5aba, 0x5bba, 0x5cba, 0xbac0, 0x5dba, 0x5eba, 0xe9c0, 0x5fba, 0x60ba, 0x61ba, 0x62ba, 0x63ba, 0xf1c5, 0x64ba, 0x65ba, 0x66ba, 0x67ba, 0xfbf3, 0x68ba, 0xfaf3, 0x69ba, 0x6aba, 0x6bba, 0x6cba, 0x6dba, 0x6eba, 0x6fba, 0x70ba, 0xd8b4, 0x71ba, 0x72ba, 0x73ba, 0xfef3, 0xf9f3, 0x74ba, 0x75ba, 0xfcf3, 0x76ba, 0x77ba, 0x78ba, 0x79ba, 0x7aba, 0x7bba, 0xfdf3, 0x7cba, 0x7dba, 0x7eba, 0x80ba, 0x81ba, 0x82ba, 0x83ba, 0x84ba, 0xa1f4, 0x85ba, 0x86ba, 0x87ba, 0x88ba, 0x89ba, 0x8aba, 0xa3f4, 0xc9bb, 0x8bba, 0x8cba, 0xa2f4, 0x8dba, 0x8eba, 0x8fba, 0x90ba, 0x91ba, 0x92ba, 0x93ba, 0x94ba, 0x95ba, 0x96ba, 0x97ba, 0x98ba, 0x99ba, 0xa4f4, 0x9aba, 0x9bba, 0x9cba, 0x9dba, 0x9eba, 0x9fba, 0xbeb2, 0xa6f4, 0xa5f4, 0xa0ba, 0x40bb, 0x41bb, 0x42bb, 0x43bb, 0x44bb, 0x45bb, 0x46bb, 0x47bb, 0x48bb, 0x49bb, 0xaebc, 0x4abb, 0x4bbb, 0x4cbb, 0x4dbb, 0x4ebb, 0x4fbb, 0x50bb, 0x51bb, 0x52bb, 0x53bb, 0x54bb, 0x55bb, 0x56bb, 0x57bb, 0x58bb, 0x59bb, 0x5abb, 0x5bbb, 0x5cbb, 0x5dbb, 0x5ebb, 0x5fbb, 0x60bb, 0x61bb, 0x62bb, 0x63bb, 0x64bb, 0x65bb, 0x66bb, 0x67bb, 0x68bb, 0x69bb, 0x6abb, 0x6bbb, 0x6cbb, 0x6dbb, 0x6ebb, 0xd7c3, 0xe1d9, 0x6fbb, 0x70bb, 0x71bb, 0x72bb, 0x73bb, 0x74bb, 0xe0c0, 0xccf4, 0xd1d7, 0x75bb, 0x76bb, 0x77bb, 0x78bb, 0x79bb, 0x7abb, 0x7bbb, 0x7cbb, 0x7dbb, 0x7ebb, 0x80bb, 0xdbb7, 0x81bb, 0x82bb, 0x83bb, 0x84bb, 0x85bb, 0x86bb, 0x87bb, 0xcef4, 0xa3c1, 0x88bb, 0x89bb, 0xc9c6, 0x8abb, 0xd6b4, 0xb3d5, 0x8bbb, 0x8cbb, 0x8dbb, 0xd0f4, 0xcff4, 0xd1f4, 0xdacb, 0x8ebb, 0x8fbb, 0xd2f4, 0x90bb, 0xc1d4, 0xe0d6, 0x91bb, 0x92bb, 0x93bb, 0x94bb, 0xe0b7, 0x95bb, 0x96bb, 0x97bb, 0xb8c1, 0x98bb, 0x99bb, 0xbbc1, 0xd3f4, 0xacbe, 0x9abb, 0x9bbb, 0x9cbb, 0x9dbb, 0x9ebb, 0xe2b4, 0x9fbb, 0xa0bb, 0xd4f4, 0xd5f4, 0xabbe, 0x40bc, 0x41bc, 0xd6f4, 0x42bc, 0x43bc, 0x44bc, 0xdbf4, 0x45bc, 0xd7f4, 0xdaf4, 0x46bc, 0xfdba, 0x47bc, 0xd8f4, 0xd9f4, 0x48bc, 0x49bc, 0x4abc, 0x4bbc, 0x4cbc, 0x4dbc, 0x4ebc, 0xe2b8, 0xc7cc, 0xdcf4, 0x4fbc, 0xdab2, 0x50bc, 0x51bc, 0xd3c3, 0x52bc, 0x53bc, 0xe3d4, 0xb7bf, 0x54bc, 0x55bc, 0x56bc, 0x57bc, 0x58bc, 0x59bc, 0x5abc, 0xddf4, 0x5bbc, 0x5cbc, 0x5dbc, 0x5ebc, 0x5fbc, 0x60bc, 0xb4c5, 0x61bc, 0x62bc, 0x63bc, 0x64bc, 0x65bc, 0x66bc, 0x67bc, 0x68bc, 0xe9f4, 0x69bc, 0x6abc, 0xb5cf, 0x6bbc, 0x6cbc, 0x6dbc, 0x6ebc, 0x6fbc, 0x70bc, 0x71bc, 0x72bc, 0x73bc, 0x74bc, 0x75bc, 0x76bc, 0x77bc, 0x78bc, 0xc9ce, 0x79bc, 0x7abc, 0x7bbc, 0x7cbc, 0x7dbc, 0x7ebc, 0x80bc, 0x81bc, 0x82bc, 0x83bc, 0x84bc, 0x85bc, 0x86bc, 0x87bc, 0x88bc, 0x89bc, 0x8abc, 0x8bbc, 0x8cbc, 0x8dbc, 0x8ebc, 0xd8cb, 0x8fbc, 0xf7cb, 0x90bc, 0x91bc, 0x92bc, 0x93bc, 0xf4bd, 0x94bc, 0x95bc, 0x96bc, 0xcfd7, 0x97bc, 0x98bc, 0x99bc, 0xdbc0, 0x9abc, 0x9bbc, 0x9cbc, 0x9dbc, 0x9ebc, 0x9fbc, 0xa0bc, 0x40bd, 0x41bd, 0x42bd, 0x43bd, 0x44bd, 0x45bd, 0x46bd, 0x47bd, 0x48bd, 0x49bd, 0x4abd, 0x4bbd, 0x4cbd, 0x4dbd, 0x4ebd, 0x4fbd, 0x50bd, 0x51bd, 0x52bd, 0x53bd, 0x54bd, 0x55bd, 0x56bd, 0x57bd, 0x58bd, 0x59bd, 0x5abd, 0x5bbd, 0x5cbd, 0x5dbd, 0x5ebd, 0x5fbd, 0x60bd, 0x61bd, 0x62bd, 0x63bd, 0x64bd, 0x65bd, 0x66bd, 0x67bd, 0x68bd, 0x69bd, 0x6abd, 0x6bbd, 0x6cbd, 0x6dbd, 0x6ebd, 0x6fbd, 0x70bd, 0x71bd, 0x72bd, 0x73bd, 0x74bd, 0x75bd, 0x76bd, 0xf5d0, 0x77bd, 0x78bd, 0x79bd, 0x7abd, 0x7bbd, 0x7cbd, 0x7dbd, 0x7ebd, 0xeaf4, 0x80bd, 0x81bd, 0x82bd, 0x83bd, 0x84bd, 0x85bd, 0x86bd, 0x87bd, 0x88bd, 0x89bd, 0x8abd, 0x8bbd, 0x8cbd, 0x8dbd, 0x8ebd, 0x8fbd, 0x90bd, 0x91bd, 0x92bd, 0x93bd, 0x94bd, 0x95bd, 0x96bd, 0x97bd, 0x98bd, 0x99bd, 0x9abd, 0x9bbd, 0x9cbd, 0x9dbd, 0x9ebd, 0x9fbd, 0xa0bd, 0x40be, 0x41be, 0x42be, 0x43be, 0x44be, 0x45be, 0x46be, 0x47be, 0x48be, 0x49be, 0x4abe, 0x4bbe, 0x4cbe, 0xebf4, 0x4dbe, 0x4ebe, 0x4fbe, 0x50be, 0x51be, 0x52be, 0x53be, 0xecf4, 0x54be, 0x55be, 0x56be, 0x57be, 0x58be, 0x59be, 0x5abe, 0x5bbe, 0x5cbe, 0x5dbe, 0x5ebe, 0x5fbe, 0x60be, 0x61be, 0x62be, 0x63be, 0x64be, 0x65be, 0x66be, 0x67be, 0x68be, 0x69be, 0x6abe, 0x6bbe, 0x6cbe, 0x6dbe, 0x6ebe, 0x6fbe, 0x70be, 0x71be, 0x72be, 0x73be, 0x74be, 0x75be, 0x76be, 0x77be, 0x78be, 0x79be, 0x7abe, 0x7bbe, 0x7cbe, 0x7dbe, 0x7ebe, 0x80be, 0x81be, 0x82be, 0x83be, 0x84be, 0x85be, 0x86be, 0x87be, 0x88be, 0x89be, 0x8abe, 0x8bbe, 0x8cbe, 0x8dbe, 0x8ebe, 0x8fbe, 0x90be, 0x91be, 0x92be, 0x93be, 0x94be, 0x95be, 0x96be, 0x97be, 0x98be, 0x99be, 0x9abe, 0x9bbe, 0x9cbe, 0x9dbe, 0x9ebe, 0x9fbe, 0xa0be, 0x40bf, 0x41bf, 0x42bf, 0x43bf, 0x44bf, 0x45bf, 0x46bf, 0x47bf, 0x48bf, 0x49bf, 0x4abf, 0x4bbf, 0x4cbf, 0x4dbf, 0x4ebf, 0x4fbf, 0x50bf, 0x51bf, 0x52bf, 0x53bf, 0x54bf, 0x55bf, 0x56bf, 0x57bf, 0x58bf, 0x59bf, 0x5abf, 0x5bbf, 0x5cbf, 0x5dbf, 0x5ebf, 0x5fbf, 0x60bf, 0x61bf, 0x62bf, 0x63bf, 0x64bf, 0x65bf, 0x66bf, 0x67bf, 0x68bf, 0x69bf, 0x6abf, 0x6bbf, 0x6cbf, 0x6dbf, 0x6ebf, 0x6fbf, 0x70bf, 0x71bf, 0x72bf, 0x73bf, 0x74bf, 0x75bf, 0x76bf, 0x77bf, 0x78bf, 0x79bf, 0x7abf, 0x7bbf, 0x7cbf, 0x7dbf, 0x7ebf, 0x80bf, 0xe3f7, 0x81bf, 0x82bf, 0x83bf, 0x84bf, 0x85bf, 0xb1b7, 0x86bf, 0x87bf, 0x88bf, 0x89bf, 0x8abf, 0xedf4, 0x8bbf, 0x8cbf, 0x8dbf, 0x8ebf, 0x8fbf, 0x90bf, 0x91bf, 0x92bf, 0x93bf, 0x94bf, 0x95bf, 0x96bf, 0x97bf, 0x98bf, 0x99bf, 0x9abf, 0x9bbf, 0x9cbf, 0x9dbf, 0x9ebf, 0x9fbf, 0xa0bf, 0x40c0, 0x41c0, 0x42c0, 0x43c0, 0x44c0, 0x45c0, 0x46c0, 0x47c0, 0x48c0, 0x49c0, 0x4ac0, 0x4bc0, 0x4cc0, 0x4dc0, 0x4ec0, 0x4fc0, 0x50c0, 0x51c0, 0x52c0, 0x53c0, 0x54c0, 0x55c0, 0x56c0, 0x57c0, 0x58c0, 0x59c0, 0x5ac0, 0x5bc0, 0x5cc0, 0x5dc0, 0x5ec0, 0x5fc0, 0x60c0, 0x61c0, 0x62c0, 0x63c0, 0xebd7, 0x64c0, 0x65c0, 0x66c0, 0x67c0, 0x68c0, 0x69c0, 0x6ac0, 0x6bc0, 0x6cc0, 0x6dc0, 0x6ec0, 0x6fc0, 0x70c0, 0x71c0, 0x72c0, 0x73c0, 0x74c0, 0x75c0, 0x76c0, 0x77c0, 0x78c0, 0x79c0, 0x7ac0, 0x7bc0, 0xeef4, 0x7cc0, 0x7dc0, 0x7ec0, 0xf9e6, 0xc0be, 0xfae6, 0xecba, 0xfbe6, 0xcbcf, 0xfce6, 0xbcd4, 0xb6bc, 0xfde6, 0xfee6, 0xcdbc, 0xd2c8, 0xb3ce, 0xa1e7, 0x80c0, 0xbfb4, 0xa2e7, 0xb4c9, 0xd9b8, 0xc9c4, 0x81c0, 0xddd7, 0xdac2, 0xd7b7, 0xbdd6, 0xc6ce, 0xc4b7, 0x82c0, 0x83c0, 0xa6c5, 0xa3e7, 0xdfcf, 0xa4e7, 0xa5e7, 0xa6e7, 0xb7c1, 0xe9d7, 0xf0c9, 0xb8cf, 0xafd6, 0xd5d6, 0xa7e7, 0xedb0, 0xa8e7, 0xa9e7, 0xdcc9, 0xefd2, 0xadbe, 0xaae7, 0xf3b0, 0xdec8, 0xe1bd, 0xabe7, 0xc6c8, 0x84c0, 0xace7, 0xe6bb, 0xf8b8, 0xa4d1, 0xade7, 0xe7c2, 0xf8be, 0xcabd, 0xb3cd, 0xaee7, 0xafe7, 0xeebe, 0xe5d0, 0x85c0, 0xe7cb, 0xd0cc, 0xccbc, 0xb0e7, 0xa8bc, 0xf7d0, 0xb1e7, 0x86c0, 0xf8d0, 0xb2e7, 0xb3e7, 0xc2b4, 0xb4e7, 0xb5e7, 0xfec9, 0xacce, 0xe0c3, 0xb7e7, 0xc1b1, 0xf1b3, 0x87c0, 0xb8e7, 0xb9e7, 0xdbd7, 0xc0d5, 0xbae7, 0xccc2, 0xbad7, 0xbbe7, 0xbce7, 0xbde7, 0xeabc, 0xe5c3, 0xc2c0, 0xbee7, 0xbfe7, 0xa9bc, 0x88c0, 0xc0e7, 0xc1e7, 0xb6e7, 0xd0b6, 0xc2e7, 0x89c0, 0xc3e7, 0xc4e7, 0xbabb, 0xdeb5, 0xc6c2, 0xe0b1, 0xc5e7, 0xb5d4, 0xc6e7, 0xbfb8, 0xc8e7, 0xc7e7, 0xecb7, 0x8ac0, 0xc9e7, 0xf8b2, 0xcae7, 0xcbe7, 0xcce7, 0xcde7, 0xcee7, 0xcfe7, 0xd0e7, 0xa7d3, 0xf5cb, 0xd1e7, 0xd2e7, 0xd3e7, 0xd4e7, 0xc9c9, 0xd5e7, 0xd6e7, 0xd7e7, 0xd8e7, 0xd9e7, 0xc9bd, 0xdae7, 0xbef3, 0x8bc0, 0xd7b8, 0x8cc0, 0xb1c8, 0x8dc0, 0x8ec0, 0x8fc0, 0x90c0, 0x91c0, 0x92c0, 0x93c0, 0xbff3, 0x94c0, 0xc0f3, 0xc1f3, 0x95c0, 0x96c0, 0x97c0, 0x98c0, 0x99c0, 0x9ac0, 0x9bc0, 0x9cc0, 0x9dc0, 0x9ec0, 0xdeb9, 0xf8cd, 0x9fc0, 0xa0c0, 0xe8d8, 0xb1ba, 0x40c1, 0xdec2, 0xb7ee, 0x41c1, 0xa3b7, 0x42c1, 0x43c1, 0x44c1, 0x45c1, 0xb9ee, 0x46c1, 0xb8ee, 0xd5b0, 0x47c1, 0x48c1, 0x49c1, 0x4ac1, 0x4bc1, 0xbbee, 0xd6d5, 0xefd7, 0x4cc1, 0x4dc1, 0x4ec1, 0xc3d6, 0x4fc1, 0x50c1, 0xbdee, 0xf0ca, 0x51c1, 0xbcee, 0x52c1, 0x53c1, 0x54c1, 0x55c1, 0xbeee, 0x56c1, 0x57c1, 0x58c1, 0x59c1, 0xc0ee, 0x5ac1, 0x5bc1, 0xbfee, 0x5cc1, 0x5dc1, 0x5ec1, 0x5fc1, 0x60c1, 0x61c1, 0x62c1, 0x63c1, 0xf2d1, 0x64c1, 0xbcc7, 0x65c1, 0xc0c3, 0x66c1, 0x67c1, 0x68c1, 0x69c1, 0x6ac1, 0xe1b8, 0x6bc1, 0x6cc1, 0x6dc1, 0x6ec1, 0x6fc1, 0xe7c1, 0x70c1, 0x71c1, 0xc6f4, 0xdfd0, 0xc7f4, 0x72c1, 0xdbcf, 0x73c1, 0x74c1, 0xbac8, 0x75c1, 0x76c1, 0xc8f4, 0x77c1, 0x78c1, 0x79c1, 0x7ac1, 0x7bc1, 0x7cc1, 0x7dc1, 0xc9f4, 0xcaf4, 0x7ec1, 0xcbf4, 0x80c1, 0x81c1, 0x82c1, 0x83c1, 0x84c1, 0xfad9, 0xfeb8, 0x85c1, 0x86c1, 0xf1e5, 0xf0d3, 0x87c1, 0xe0f4, 0x88c1, 0xccce, 0x89c1, 0x8ac1, 0x8bc1, 0xe1b3, 0x8cc1, 0x8dc1, 0x8ec1, 0x8fc1, 0xb4f1, 0x90c1, 0xeed2, 0x91c1, 0xe1f4, 0x92c1, 0x93c1, 0x94c1, 0x95c1, 0x96c1, 0xe8cf, 0xe2f4, 0x97c1, 0x98c1, 0xccc7, 0x99c1, 0x9ac1, 0x9bc1, 0x9cc1, 0x9dc1, 0x9ec1, 0xd4b5, 0xe4b4, 0xe4f4, 0x9fc1, 0xa0c1, 0x40c2, 0xe3f4, 0xe5f4, 0x41c2, 0x42c2, 0xe6f4, 0x43c2, 0x44c2, 0x45c2, 0x46c2, 0xe7f4, 0x47c2, 0xb2ba, 0xbfb0, 0x48c2, 0xe8f4, 0x49c2, 0x4ac2, 0x4bc2, 0x4cc2, 0x4dc2, 0x4ec2, 0x4fc2, 0xadb7, 0xedd2, 0x50c2, 0x51c2, 0x52c2, 0xabd2, 0xcfc0, 0x53c2, 0xbcbf, 0xa3eb, 0xdfd5, 0xc8ea, 0x54c2, 0x55c2, 0x56c2, 0x57c2, 0xf3f1, 0xf8b6, 0xa3cb, 0x58c2, 0x59c2, 0xcdc4, 0x5ac2, 0xe7f1, 0x5bc2, 0xe8f1, 0xfbb8, 0xe9f1, 0xc4ba, 0xc5d4, 0xd2b0, 0x5cc2, 0x5dc2, 0xeaf1, 0x5ec2, 0x5fc2, 0x60c2, 0xebf1, 0x61c2, 0xecf1, 0x62c2, 0x63c2, 0xedf1, 0xeef1, 0xeff1, 0xf1f1, 0xf0f1, 0xd5c5, 0x64c2, 0x65c2, 0x66c2, 0x67c2, 0x68c2, 0x69c2, 0xf2f1, 0x6ac2, 0xfab6, 0x6bc2, 0xf4f1, 0xaed2, 0xc7de, 0xcacb, 0x6cc2, 0x6dc2, 0xdcb3, 0x6ec2, 0xa2b5, 0x6fc2, 0xa2b9, 0x70c2, 0x71c2, 0xf4c4, 0xf5f1, 0x72c2, 0x73c2, 0xf6f1, 0x74c2, 0x75c2, 0x76c2, 0xc4c1, 0xfbc1, 0xb0d6, 0xf7f1, 0x77c2, 0x78c2, 0x79c2, 0x7ac2, 0xf8f1, 0x7bc2, 0xaac1, 0x7cc2, 0x7dc2, 0x7ec2, 0xb8c6, 0x80c2, 0xdbbe, 0x81c2, 0x82c2, 0x83c2, 0x84c2, 0x85c2, 0x86c2, 0x87c2, 0x88c2, 0x89c2, 0x8ac2, 0x8bc2, 0x8cc2, 0x8dc2, 0x8ec2, 0xf9f1, 0xcfb4, 0x8fc2, 0x90c2, 0x91c2, 0x92c2, 0x93c2, 0x94c2, 0xfaf1, 0x95c2, 0x96c2, 0x97c2, 0x98c2, 0x99c2, 0x9ac2, 0x9bc2, 0x9cc2, 0x9dc2, 0x9ec2, 0x9fc2, 0xa0c2, 0x40c3, 0xb2ed, 0xb1ed, 0x41c3, 0x42c3, 0xe0cb, 0xded2, 0x43c3, 0xc1cb, 0xd8d5, 0x44c3, 0xe2c8, 0x45c3, 0xdfc0, 0xa1bc, 0x46c3, 0x47c3, 0x48c3, 0x49c3, 0x4ac3, 0x4bc3, 0xc1eb, 0x4cc3, 0x4dc3, 0xa4d0, 0x4ec3, 0xe2d6, 0x4fc3, 0xc7b6, 0xd8b8, 0xc0eb, 0xceb8, 0x50c3, 0xbfeb, 0xa6b3, 0xc9b9, 0xabd6, 0x51c3, 0xf4b7, 0xcab7, 0x52c3, 0x53c3, 0x54c3, 0xe7bc, 0xbeb7, 0xc6eb, 0x55c3, 0xc7eb, 0xb9b0, 0xcfbf, 0x56c3, 0xc5eb, 0xfdd3, 0x57c3, 0xc8eb, 0x58c3, 0x59c3, 0xc9eb, 0x5ac3, 0x5bc3, 0xceb7, 0x5cc3, 0xc2eb, 0xc4eb, 0xf6c9, 0xd7d6, 0xcdd5, 0xb2d0, 0xcfeb, 0xb8ce, 0xd0eb, 0x5dc3, 0xa8b5, 0x5ec3, 0x5fc3, 0x60c3, 0x61c3, 0x62c3, 0xb3b1, 0xd2eb, 0xa5cc, 0x63c3, 0x64c3, 0x65c3, 0x66c3, 0x67c3, 0x68c3, 0x69c3, 0xd6c5, 0xd3eb, 0x6ac3, 0xd1eb, 0xdfc5, 0xceeb, 0xa4ca, 0xd5eb, 0xfbb0, 0x6bc3, 0x6cc3, 0xfaba, 0x6dc3, 0x6ec3, 0xb7d8, 0xe3f1, 0x6fc3, 0xcaeb, 0xcbeb, 0xcceb, 0xcdeb, 0xd6eb, 0xc0e6, 0xd9eb, 0x70c3, 0xe8bf, 0xc8d2, 0xd7eb, 0xdceb, 0xecb8, 0xd8eb, 0x71c3, 0xbabd, 0x72c3, 0xd8d0, 0x73c3, 0xb7b0, 0x74c3, 0xddeb, 0xdcc4, 0x75c3, 0x76c3, 0x77c3, 0x78c3, 0xacd6, 0x79c3, 0x7ac3, 0x7bc3, 0xe0b4, 0x7cc3, 0x7dc3, 0xf6c2, 0xb9bc, 0x7ec3, 0x80c3, 0xdaeb, 0xdbeb, 0xe0d4, 0xeac6, 0xd4c4, 0xdfeb, 0xa7c5, 0xf5d9, 0x81c3, 0xb1b2, 0x82c3, 0xe4eb, 0x83c3, 0xc5bd, 0x84c3, 0x85c3, 0x86c3, 0xe2eb, 0x87c3, 0x88c3, 0x89c3, 0x8ac3, 0x8bc3, 0x8cc3, 0x8dc3, 0x8ec3, 0x8fc3, 0x90c3, 0x91c3, 0x92c3, 0x93c3, 0xe3eb, 0x94c3, 0x95c3, 0xacb8, 0x96c3, 0xd1cd, 0xe5eb, 0x97c3, 0x98c3, 0x99c3, 0xe1eb, 0x9ac3, 0xb3c1, 0x9bc3, 0x9cc3, 0x9dc3, 0x9ec3, 0x9fc3, 0xa2c6, 0xa0c3, 0x40c4, 0x41c4, 0x42c4, 0x43c4, 0x44c4, 0x45c4, 0xf3cc, 0x46c4, 0xe6eb, 0x47c4, 0xb0c0, 0xb8d2, 0xe7eb, 0x48c4, 0x49c4, 0x4ac4, 0xafb8, 0xadb8, 0x4bc4, 0xe8eb, 0xbbc7, 0xf3cd, 0x4cc4, 0x4dc4, 0x4ec4, 0xeaeb, 0xebeb, 0x4fc4, 0x50c4, 0x51c4, 0x52c4, 0x53c4, 0xedeb, 0x54c4, 0x55c4, 0x56c4, 0x57c4, 0xc8d0, 0x58c4, 0xf2eb, 0x59c4, 0xeeeb, 0x5ac4, 0x5bc4, 0x5cc4, 0xf1eb, 0xf9c8, 0x5dc4, 0xfcd1, 0xeceb, 0x5ec4, 0x5fc4, 0xe9eb, 0x60c4, 0x61c4, 0x62c4, 0x63c4, 0xb9b8, 0xd9cf, 0xe5c4, 0xefeb, 0xf0eb, 0xdacc, 0xc8cd, 0xf2b0, 0x64c4, 0xf6eb, 0x65c4, 0x66c4, 0x67c4, 0x68c4, 0x69c4, 0xf5eb, 0x6ac4, 0xb2b2, 0x6bc4, 0x6cc4, 0x6dc4, 0x6ec4, 0xe0b8, 0x6fc4, 0xf7eb, 0x70c4, 0x71c4, 0x72c4, 0x73c4, 0x74c4, 0x75c4, 0xecb1, 0x76c4, 0x77c4, 0xc5cc, 0xa4c4, 0xa5cf, 0x78c4, 0x79c4, 0x7ac4, 0x7bc4, 0x7cc4, 0xf9eb, 0x7dc4, 0x7ec4, 0xa2ec, 0x80c4, 0xf2c5, 0x81c4, 0xfaeb, 0x82c4, 0x83c4, 0x84c4, 0x85c4, 0x86c4, 0x87c4, 0x88c4, 0x89c4, 0xc5c9, 0x8ac4, 0x8bc4, 0x8cc4, 0x8dc4, 0x8ec4, 0x8fc4, 0xdfe2, 0xfeeb, 0x90c4, 0x91c4, 0x92c4, 0x93c4, 0xcecd, 0xa1ec, 0xdbb1, 0xb7d3, 0x94c4, 0x95c4, 0xdcd2, 0x96c4, 0x97c4, 0x98c4, 0xfdeb, 0x99c4, 0xfbeb, 0x9ac4, 0x9bc4, 0x9cc4, 0x9dc4, 0x9ec4, 0x9fc4, 0xa0c4, 0x40c5, 0x41c5, 0x42c5, 0x43c5, 0x44c5, 0x45c5, 0x46c5, 0x47c5, 0x48c5, 0x49c5, 0x4ac5, 0x4bc5, 0x4cc5, 0x4dc5, 0x4ec5, 0xbcb3, 0x4fc5, 0x50c5, 0x51c5, 0xb0ea, 0x52c5, 0x53c5, 0xd4d7, 0x54c5, 0xabf4, 0xf4b3, 0x55c5, 0x56c5, 0x57c5, 0x58c5, 0x59c5, 0xc1d6, 0xc2d6, 0x5ac5, 0x5bc5, 0x5cc5, 0x5dc5, 0x5ec5, 0x5fc5, 0xe9d5, 0xcabe, 0x60c5, 0xa7f4, 0x61c5, 0xa8d2, 0xa8f4, 0xa9f4, 0x62c5, 0xaaf4, 0xcbbe, 0xdfd3, 0x63c5, 0x64c5, 0x65c5, 0x66c5, 0x67c5, 0xe0c9, 0xe1c9, 0x68c5, 0x69c5, 0xc2f3, 0x6ac5, 0xe6ca, 0x6bc5, 0xf2cc, 0x6cc5, 0x6dc5, 0x6ec5, 0x6fc5, 0x70c5, 0x71c5, 0xb6e2, 0xb4cb, 0x72c5, 0xe8ce, 0xdbd6, 0x73c5, 0xadf4, 0xaef4, 0xaff4, 0x74c5, 0x75c5, 0x76c5, 0x77c5, 0xb2f4, 0x78c5, 0xbdba, 0xb3f4, 0xe3b0, 0xb0f4, 0x79c5, 0xb1f4, 0xa2bd, 0xd5b2, 0x7ac5, 0xb6f4, 0xb7f4, 0xe6b6, 0xb0b2, 0xcfcf, 0xb4f4, 0xacb4, 0x7bc5, 0xb5f4, 0x7cc5, 0x7dc5, 0xb8f4, 0x7ec5, 0x80c5, 0x81c5, 0x82c5, 0x83c5, 0xb9f4, 0x84c5, 0x85c5, 0xa7cd, 0x86c5, 0xbaf4, 0x87c5, 0xbbf4, 0x88c5, 0x89c5, 0x8ac5, 0xbcf4, 0x8bc5, 0x8cc5, 0x8dc5, 0x8ec5, 0x8fc5, 0x90c5, 0x91c5, 0x92c5, 0xd2cb, 0x93c5, 0xbdf4, 0x94c5, 0x95c5, 0x96c5, 0x97c5, 0xbef4, 0x98c5, 0x99c5, 0x9ac5, 0x9bc5, 0x9cc5, 0x9dc5, 0x9ec5, 0x9fc5, 0xbff4, 0xa0c5, 0x40c6, 0x41c6, 0x42c6, 0x43c6, 0xdef4, 0xbcc1, 0xe8bc, 0x44c6, 0xabc9, 0xded1, 0xf5e5, 0x45c6, 0x46c6, 0x47c6, 0x48c6, 0xb3dc, 0xd5d2, 0x49c6, 0x4ac6, 0xb4dc, 0xacb0, 0xb5dc, 0x4bc6, 0x4cc6, 0xdabd, 0x4dc6, 0xb9dc, 0x4ec6, 0x4fc6, 0x50c6, 0xc2d8, 0x51c6, 0xb7dc, 0xf3d3, 0x52c6, 0xd6c9, 0xbadc, 0xb6dc, 0x53c6, 0xbbdc, 0xa2c3, 0x54c6, 0x55c6, 0x56c6, 0x57c6, 0xbcdc, 0xc5dc, 0xbddc, 0x58c6, 0x59c6, 0xdfce, 0xa5d6, 0x5ac6, 0xcfdc, 0x5bc6, 0xcddc, 0x5cc6, 0x5dc6, 0xd2dc, 0xe6bd, 0xabc2, 0x5ec6, 0xb8dc, 0xcbdc, 0xcedc, 0xbedc, 0xd2b7, 0xc5b0, 0xc7dc, 0xbed0, 0xc1dc, 0xa8bb, 0x5fc6, 0xbcb7, 0xccdc, 0x60c6, 0x61c6, 0xc6dc, 0xbfdc, 0xdbc7, 0x62c6, 0x63c6, 0x64c6, 0xbfd1, 0xc0dc, 0x65c6, 0x66c6, 0xcadc, 0x67c6, 0x68c6, 0xd0dc, 0x69c6, 0x6ac6, 0xadce, 0xc2dc, 0x6bc6, 0xc3dc, 0xc8dc, 0xc9dc, 0xd4b2, 0xd1dc, 0xd5cb, 0x6cc6, 0xb7d4, 0xdbdc, 0xdfdc, 0xa6cc, 0xe6dc, 0x6dc6, 0xe7c3, 0xdcdc, 0x6ec6, 0x6fc6, 0xc1bf, 0xd9dc, 0x70c6, 0xfab0, 0xb6b9, 0xe5dc, 0xd3dc, 0x71c6, 0xc4dc, 0xd6dc, 0xf4c8, 0xe0bf, 0x72c6, 0x73c6, 0x74c6, 0x75c6, 0xbbc9, 0x76c6, 0x77c6, 0x78c6, 0xbdb1, 0x79c6, 0xa2d3, 0x7ac6, 0x7bc6, 0xdadc, 0x7cc6, 0x7dc6, 0xd5dc, 0x7ec6, 0xbbc6, 0x80c6, 0xdedc, 0x81c6, 0x82c6, 0x83c6, 0x84c6, 0x85c6, 0xc2d7, 0xafc3, 0xb6b7, 0xd1c7, 0xa9c3, 0xe2dc, 0xd8dc, 0xebdc, 0xd4dc, 0x86c6, 0x87c6, 0xdddc, 0x88c6, 0xa5be, 0xd7dc, 0x89c6, 0xe0dc, 0x8ac6, 0x8bc6, 0xe3dc, 0xe4dc, 0x8cc6, 0xf8dc, 0x8dc6, 0x8ec6, 0xe1dc, 0xa2dd, 0xe7dc, 0x8fc6, 0x90c6, 0x91c6, 0x92c6, 0x93c6, 0x94c6, 0x95c6, 0x96c6, 0x97c6, 0x98c6, 0xebbc, 0xc4b4, 0x99c6, 0x9ac6, 0xa3c3, 0xe7b2, 0xfadc, 0x9bc6, 0xf2dc, 0x9cc6, 0xefdc, 0x9dc6, 0xfcdc, 0xeedc, 0xf0d2, 0xe8b2, 0x9ec6, 0xd7c8, 0xe3c8, 0xfbdc, 0x9fc6, 0xeddc, 0xa0c6, 0x40c7, 0x41c7, 0xf7dc, 0x42c7, 0x43c7, 0xf5dc, 0x44c7, 0x45c7, 0xa3be, 0xf4dc, 0x46c7, 0xddb2, 0x47c7, 0x48c7, 0x49c7, 0x4ac7, 0x4bc7, 0xf3dc, 0xf6bc, 0xe8dc, 0xc4bb, 0x4cc7, 0xf3c0, 0x4dc7, 0x4ec7, 0x4fc7, 0x50c7, 0x51c7, 0xd4bc, 0xe9dc, 0xeadc, 0x52c7, 0xf1dc, 0xf6dc, 0xf9dc, 0xb4b5, 0x53c7, 0xd9c8, 0xe7bb, 0xfedc, 0xfddc, 0xabd3, 0xa1dd, 0xa3dd, 0xa5dd, 0xf1d2, 0xa4dd, 0xa6dd, 0xa7dd, 0xa9d2, 0x54c7, 0x55c7, 0x56c7, 0x57c7, 0x58c7, 0x59c7, 0x5ac7, 0xc9ba, 0xa9dd, 0x5bc7, 0x5cc7, 0xb6dd, 0xb1dd, 0xb4dd, 0x5dc7, 0x5ec7, 0x5fc7, 0x60c7, 0x61c7, 0x62c7, 0x63c7, 0xb0dd, 0xcec6, 0x64c7, 0x65c7, 0xf2c0, 0x66c7, 0x67c7, 0x68c7, 0x69c7, 0xafc9, 0x6ac7, 0x6bc7, 0x6cc7, 0xecdc, 0xaedd, 0x6dc7, 0x6ec7, 0x6fc7, 0x70c7, 0xb7dd, 0x71c7, 0x72c7, 0xf0dc, 0xafdd, 0x73c7, 0xb8dd, 0x74c7, 0xacdd, 0x75c7, 0x76c7, 0x77c7, 0x78c7, 0x79c7, 0x7ac7, 0x7bc7, 0xb9dd, 0xb3dd, 0xaddd, 0xaac4, 0x7cc7, 0x7dc7, 0x7ec7, 0x80c7, 0xa8dd, 0xb3c0, 0xabc1, 0xaadd, 0xabdd, 0x81c7, 0xb2dd, 0xf1bb, 0xb5dd, 0xa8d3, 0xbadd, 0x82c7, 0xbbdd, 0xa7c3, 0x83c7, 0x84c7, 0xd2dd, 0xbcdd, 0x85c7, 0x86c7, 0x87c7, 0xd1dd, 0x88c7, 0xbdb9, 0x89c7, 0x8ac7, 0xd5be, 0x8bc7, 0xfabe, 0x8cc7, 0x8dc7, 0xcaba, 0x8ec7, 0x8fc7, 0x90c7, 0x91c7, 0xcadd, 0x92c7, 0xc5dd, 0x93c7, 0xbfdd, 0x94c7, 0x95c7, 0x96c7, 0xcbb2, 0xc3dd, 0x97c7, 0xcbdd, 0xa4b2, 0xd5dd, 0x98c7, 0x99c7, 0x9ac7, 0xbedd, 0x9bc7, 0x9cc7, 0x9dc7, 0xd0c6, 0xd0dd, 0x9ec7, 0x9fc7, 0xa0c7, 0x40c8, 0x41c8, 0xd4dd, 0xe2c1, 0xc6b7, 0x42c8, 0x43c8, 0x44c8, 0x45c8, 0x46c8, 0xcedd, 0xcfdd, 0x47c8, 0x48c8, 0x49c8, 0xc4dd, 0x4ac8, 0x4bc8, 0x4cc8, 0xbddd, 0x4dc8, 0xcddd, 0xd1cc, 0x4ec8, 0xc9dd, 0x4fc8, 0x50c8, 0x51c8, 0x52c8, 0xc2dd, 0xc8c3, 0xbcc6, 0xaece, 0xccdd, 0x53c8, 0xc8dd, 0x54c8, 0x55c8, 0x56c8, 0x57c8, 0x58c8, 0x59c8, 0xc1dd, 0x5ac8, 0x5bc8, 0x5cc8, 0xc6dd, 0xdcc2, 0x5dc8, 0x5ec8, 0x5fc8, 0x60c8, 0x61c8, 0x62c8, 0xa9d3, 0xaad3, 0xd3dd, 0xf4cf, 0xf8c8, 0x63c8, 0x64c8, 0x65c8, 0x66c8, 0x67c8, 0x68c8, 0x69c8, 0x6ac8, 0xe6dd, 0x6bc8, 0x6cc8, 0x6dc8, 0x6ec8, 0x6fc8, 0x70c8, 0xc7dd, 0x71c8, 0x72c8, 0x73c8, 0xe0dd, 0xe4c2, 0x74c8, 0x75c8, 0x76c8, 0x77c8, 0x78c8, 0x79c8, 0x7ac8, 0x7bc8, 0xe1dd, 0x7cc8, 0x7dc8, 0x7ec8, 0x80c8, 0x81c8, 0x82c8, 0x83c8, 0x84c8, 0x85c8, 0x86c8, 0xd7dd, 0x87c8, 0x88c8, 0x89c8, 0x8ac8, 0x8bc8, 0xf8d6, 0x8cc8, 0xd9dd, 0xd8dd, 0xf0b8, 0xd6dd, 0x8dc8, 0x8ec8, 0x8fc8, 0x90c8, 0xcfc6, 0x91c8, 0xadb6, 0x92c8, 0x93c8, 0x94c8, 0x95c8, 0x96c8, 0xe2dd, 0x97c8, 0xf9ba, 0xe1d4, 0xe7dd, 0x98c8, 0x99c8, 0x9ac8, 0xd0b4, 0x9bc8, 0xdadd, 0x9cc8, 0xfbbf, 0xe3dd, 0x9dc8, 0xdfdd, 0x9ec8, 0xdddd, 0x9fc8, 0xa0c8, 0x40c9, 0x41c9, 0x42c9, 0x43c9, 0x44c9, 0xd9b5, 0x45c9, 0x46c9, 0x47c9, 0x48c9, 0xdbdd, 0xdcdd, 0xdedd, 0x49c9, 0xafbd, 0xe4dd, 0x4ac9, 0xe5dd, 0x4bc9, 0x4cc9, 0x4dc9, 0x4ec9, 0x4fc9, 0x50c9, 0x51c9, 0x52c9, 0xf5dd, 0x53c9, 0xc9c3, 0x54c9, 0x55c9, 0xe2cb, 0x56c9, 0x57c9, 0x58c9, 0x59c9, 0xf2dd, 0x5ac9, 0x5bc9, 0x5cc9, 0x5dc9, 0x5ec9, 0x5fc9, 0x60c9, 0x61c9, 0x62c9, 0x63c9, 0x64c9, 0x65c9, 0x66c9, 0xe1d8, 0x67c9, 0x68c9, 0xd1c6, 0x69c9, 0xf4dd, 0x6ac9, 0x6bc9, 0x6cc9, 0xf4d5, 0xf3dd, 0xf0dd, 0x6dc9, 0x6ec9, 0xecdd, 0x6fc9, 0xefdd, 0x70c9, 0xe8dd, 0x71c9, 0x72c9, 0xeed0, 0x73c9, 0x74c9, 0x75c9, 0x76c9, 0xd8c8, 0xeedd, 0x77c9, 0x78c9, 0xe9dd, 0x79c9, 0x7ac9, 0xeadd, 0xf2cb, 0x7bc9, 0xeddd, 0x7cc9, 0x7dc9, 0xcdb1, 0x7ec9, 0x80c9, 0x81c9, 0x82c9, 0x83c9, 0x84c9, 0xb6c0, 0x85c9, 0xbbbc, 0xf1dd, 0x86c9, 0x87c9, 0xf7dd, 0x88c9, 0xf6dd, 0xebdd, 0x89c9, 0x8ac9, 0x8bc9, 0x8cc9, 0x8dc9, 0xeec5, 0x8ec9, 0x8fc9, 0x90c9, 0xfbdd, 0x91c9, 0x92c9, 0x93c9, 0x94c9, 0x95c9, 0x96c9, 0x97c9, 0x98c9, 0x99c9, 0x9ac9, 0x9bc9, 0xa4de, 0x9cc9, 0x9dc9, 0xa3de, 0x9ec9, 0x9fc9, 0xa0c9, 0x40ca, 0x41ca, 0x42ca, 0x43ca, 0x44ca, 0x45ca, 0x46ca, 0x47ca, 0x48ca, 0xf8dd, 0x49ca, 0x4aca, 0x4bca, 0x4cca, 0xefc3, 0x4dca, 0xfbc2, 0x4eca, 0x4fca, 0x50ca, 0xe1d5, 0x51ca, 0x52ca, 0xb5ce, 0x53ca, 0x54ca, 0x55ca, 0x56ca, 0xfddd, 0x57ca, 0xccb2, 0x58ca, 0x59ca, 0x5aca, 0x5bca, 0x5cca, 0x5dca, 0x5eca, 0x5fca, 0x60ca, 0xe8c4, 0xdfca, 0x61ca, 0x62ca, 0x63ca, 0x64ca, 0x65ca, 0x66ca, 0x67ca, 0x68ca, 0x69ca, 0x6aca, 0xbec7, 0xfadd, 0xfcdd, 0xfedd, 0xa2de, 0xaab0, 0xceb1, 0x6bca, 0x6cca, 0x6dca, 0x6eca, 0x6fca, 0xacde, 0x70ca, 0x71ca, 0x72ca, 0x73ca, 0xa6de, 0xb6bd, 0xefc8, 0x74ca, 0x75ca, 0x76ca, 0x77ca, 0x78ca, 0x79ca, 0x7aca, 0x7bca, 0x7cca, 0x7dca, 0x7eca, 0xa1de, 0x80ca, 0x81ca, 0xa5de, 0x82ca, 0x83ca, 0x84ca, 0x85ca, 0xa9de, 0x86ca, 0x87ca, 0x88ca, 0x89ca, 0x8aca, 0xa8de, 0x8bca, 0x8cca, 0x8dca, 0xa7de, 0x8eca, 0x8fca, 0x90ca, 0x91ca, 0x92ca, 0x93ca, 0x94ca, 0x95ca, 0x96ca, 0xadde, 0x97ca, 0xccd4, 0x98ca, 0x99ca, 0x9aca, 0x9bca, 0xb3de, 0xaade, 0xaede, 0x9cca, 0x9dca, 0xd9c0, 0x9eca, 0x9fca, 0xa0ca, 0x40cb, 0x41cb, 0xa1b1, 0xb6de, 0x42cb, 0xb1de, 0x43cb, 0x44cb, 0x45cb, 0x46cb, 0x47cb, 0x48cb, 0x49cb, 0xb2de, 0x4acb, 0x4bcb, 0x4ccb, 0x4dcb, 0x4ecb, 0x4fcb, 0x50cb, 0x51cb, 0x52cb, 0x53cb, 0x54cb, 0xa6d1, 0xb5de, 0x55cb, 0x56cb, 0x57cb, 0x58cb, 0x59cb, 0x5acb, 0x5bcb, 0xafde, 0x5ccb, 0x5dcb, 0x5ecb, 0xb0de, 0x5fcb, 0xbdd0, 0x60cb, 0x61cb, 0x62cb, 0xb4de, 0xedca, 0xb9de, 0x63cb, 0x64cb, 0x65cb, 0x66cb, 0x67cb, 0x68cb, 0xb8de, 0x69cb, 0xb7de, 0x6acb, 0x6bcb, 0x6ccb, 0x6dcb, 0x6ecb, 0x6fcb, 0x70cb, 0xbbde, 0x71cb, 0x72cb, 0x73cb, 0x74cb, 0x75cb, 0x76cb, 0x77cb, 0xe5bd, 0x78cb, 0x79cb, 0x7acb, 0x7bcb, 0x7ccb, 0xd8b2, 0xeac3, 0x7dcb, 0x7ecb, 0xbade, 0x80cb, 0xbac5, 0x81cb, 0x82cb, 0x83cb, 0x84cb, 0x85cb, 0x86cb, 0xbcde, 0x87cb, 0x88cb, 0x89cb, 0x8acb, 0x8bcb, 0x8ccb, 0x8dcb, 0xd9cc, 0x8ecb, 0x8fcb, 0x90cb, 0x91cb, 0xaab7, 0x92cb, 0x93cb, 0x94cb, 0x95cb, 0x96cb, 0x97cb, 0x98cb, 0x99cb, 0x9acb, 0x9bcb, 0x9ccb, 0x9dcb, 0x9ecb, 0x9fcb, 0xa0cb, 0x40cc, 0x41cc, 0xe5d4, 0x42cc, 0x43cc, 0x44cc, 0xbdde, 0x45cc, 0x46cc, 0x47cc, 0x48cc, 0x49cc, 0xbfde, 0x4acc, 0x4bcc, 0x4ccc, 0x4dcc, 0x4ecc, 0x4fcc, 0x50cc, 0x51cc, 0x52cc, 0x53cc, 0x54cc, 0xa2c4, 0x55cc, 0x56cc, 0x57cc, 0x58cc, 0xc1de, 0x59cc, 0x5acc, 0x5bcc, 0x5ccc, 0x5dcc, 0x5ecc, 0x5fcc, 0x60cc, 0x61cc, 0x62cc, 0x63cc, 0x64cc, 0x65cc, 0x66cc, 0x67cc, 0x68cc, 0xbede, 0x69cc, 0xc0de, 0x6acc, 0x6bcc, 0x6ccc, 0x6dcc, 0x6ecc, 0x6fcc, 0x70cc, 0x71cc, 0x72cc, 0x73cc, 0x74cc, 0x75cc, 0x76cc, 0x77cc, 0xbad5, 0x78cc, 0x79cc, 0x7acc, 0xc2de, 0x7bcc, 0x7ccc, 0x7dcc, 0x7ecc, 0x80cc, 0x81cc, 0x82cc, 0x83cc, 0x84cc, 0x85cc, 0x86cc, 0x87cc, 0x88cc, 0x89cc, 0x8acc, 0x8bcc, 0xaef2, 0xa2bb, 0xb2c2, 0xb0c5, 0xc7c2, 0x8ccc, 0x8dcc, 0xaff2, 0x8ecc, 0x8fcc, 0x90cc, 0x91cc, 0x92cc, 0xe9d0, 0x93cc, 0x94cc, 0x95cc, 0xddd3, 0x96cc, 0x97cc, 0x98cc, 0xbdeb, 0x99cc, 0x9acc, 0x9bcc, 0x9ccc, 0x9dcc, 0x9ecc, 0x9fcc, 0xa0cc, 0xe6b3, 0xb0f2, 0x40cd, 0xb1f2, 0x41cd, 0x42cd, 0xadca, 0x43cd, 0x44cd, 0x45cd, 0x46cd, 0x47cd, 0x48cd, 0x49cd, 0xe7ba, 0xb3f2, 0xb5f2, 0xb4f2, 0xe4cb, 0xbacf, 0xb2f2, 0xb4ca, 0xcfd2, 0xecc2, 0x4acd, 0x4bcd, 0x4ccd, 0x4dcd, 0x4ecd, 0x4fcd, 0x50cd, 0xc3ce, 0xb8f2, 0xf6b0, 0xb7f2, 0x51cd, 0x52cd, 0x53cd, 0x54cd, 0x55cd, 0xbef2, 0x56cd, 0xcfb2, 0x57cd, 0x58cd, 0x59cd, 0x5acd, 0x5bcd, 0x5ccd, 0xc1d1, 0xbaf2, 0x5dcd, 0x5ecd, 0x5fcd, 0x60cd, 0x61cd, 0xbcf2, 0xe9d4, 0x62cd, 0x63cd, 0xbbf2, 0xb6f2, 0xbff2, 0xbdf2, 0x64cd, 0xb9f2, 0x65cd, 0x66cd, 0xc7f2, 0xc4f2, 0xc6f2, 0x67cd, 0x68cd, 0xcaf2, 0xc2f2, 0xc0f2, 0x69cd, 0x6acd, 0x6bcd, 0xc5f2, 0x6ccd, 0x6dcd, 0x6ecd, 0x6fcd, 0x70cd, 0xfbd6, 0x71cd, 0x72cd, 0x73cd, 0xc1f2, 0x74cd, 0xf9c7, 0xdfc9, 0x75cd, 0xc8f2, 0xc6b9, 0xb0b5, 0x76cd, 0x77cd, 0xc3f2, 0xc9f2, 0xd0f2, 0xd6f2, 0x78cd, 0x79cd, 0xd7bb, 0x7acd, 0x7bcd, 0x7ccd, 0xd5f2, 0xdccd, 0x7dcd, 0xebd6, 0x7ecd, 0x80cd, 0xd2f2, 0xd4f2, 0x81cd, 0x82cd, 0x83cd, 0x84cd, 0xf2b8, 0x85cd, 0x86cd, 0x87cd, 0x88cd, 0xcbf2, 0x89cd, 0x8acd, 0x8bcd, 0xcef2, 0xf9c2, 0x8ccd, 0xddd5, 0xccf2, 0xcdf2, 0xcff2, 0xd3f2, 0x8dcd, 0x8ecd, 0x8fcd, 0xd9f2, 0xbcd3, 0x90cd, 0x91cd, 0x92cd, 0x93cd, 0xeab6, 0x94cd, 0xf1ca, 0x95cd, 0xe4b7, 0xd7f2, 0x96cd, 0x97cd, 0x98cd, 0xd8f2, 0xdaf2, 0xddf2, 0xdbf2, 0x99cd, 0x9acd, 0xdcf2, 0x9bcd, 0x9ccd, 0x9dcd, 0x9ecd, 0xd1d1, 0xd1f2, 0x9fcd, 0xc9cd, 0xa0cd, 0xcfce, 0xa9d6, 0x40ce, 0xe3f2, 0x41ce, 0xdbc3, 0x42ce, 0xe0f2, 0x43ce, 0x44ce, 0xafc0, 0xecf2, 0xdef2, 0x45ce, 0xe1f2, 0x46ce, 0x47ce, 0x48ce, 0xe8f2, 0x49ce, 0x4ace, 0x4bce, 0x4cce, 0xe2f2, 0x4dce, 0x4ece, 0xe7f2, 0x4fce, 0x50ce, 0xe6f2, 0x51ce, 0x52ce, 0xe9f2, 0x53ce, 0x54ce, 0x55ce, 0xdff2, 0x56ce, 0x57ce, 0xe4f2, 0xeaf2, 0x58ce, 0x59ce, 0x5ace, 0x5bce, 0x5cce, 0x5dce, 0x5ece, 0xacd3, 0xe5f2, 0xf5b2, 0x5fce, 0x60ce, 0xf2f2, 0x61ce, 0xabd0, 0x62ce, 0x63ce, 0x64ce, 0x65ce, 0xf5f2, 0x66ce, 0x67ce, 0x68ce, 0xc8bb, 0x69ce, 0xf9f2, 0x6ace, 0x6bce, 0x6cce, 0x6dce, 0x6ece, 0x6fce, 0xf0f2, 0x70ce, 0x71ce, 0xf6f2, 0xf8f2, 0xfaf2, 0x72ce, 0x73ce, 0x74ce, 0x75ce, 0x76ce, 0x77ce, 0x78ce, 0x79ce, 0xf3f2, 0x7ace, 0xf1f2, 0x7bce, 0x7cce, 0x7dce, 0xfbba, 0x7ece, 0xfbb5, 0x80ce, 0x81ce, 0x82ce, 0x83ce, 0xeff2, 0xf7f2, 0xedf2, 0xeef2, 0x84ce, 0x85ce, 0x86ce, 0xebf2, 0xa6f3, 0x87ce, 0xa3f3, 0x88ce, 0x89ce, 0xa2f3, 0x8ace, 0x8bce, 0xf4f2, 0x8cce, 0xdac8, 0x8dce, 0x8ece, 0x8fce, 0x90ce, 0x91ce, 0xfbf2, 0x92ce, 0x93ce, 0x94ce, 0xa5f3, 0x95ce, 0x96ce, 0x97ce, 0x98ce, 0x99ce, 0x9ace, 0x9bce, 0xf8c3, 0x9cce, 0x9dce, 0x9ece, 0x9fce, 0xa0ce, 0x40cf, 0x41cf, 0x42cf, 0xfdf2, 0x43cf, 0x44cf, 0xa7f3, 0xa9f3, 0xa4f3, 0x45cf, 0xfcf2, 0x46cf, 0x47cf, 0x48cf, 0xabf3, 0x49cf, 0xaaf3, 0x4acf, 0x4bcf, 0x4ccf, 0x4dcf, 0xddc2, 0x4ecf, 0x4fcf, 0xaef3, 0x50cf, 0x51cf, 0xb0f3, 0x52cf, 0x53cf, 0x54cf, 0x55cf, 0x56cf, 0xa1f3, 0x57cf, 0x58cf, 0x59cf, 0xb1f3, 0xacf3, 0x5acf, 0x5bcf, 0x5ccf, 0x5dcf, 0x5ecf, 0xaff3, 0xfef2, 0xadf3, 0x5fcf, 0x60cf, 0x61cf, 0x62cf, 0x63cf, 0x64cf, 0x65cf, 0xb2f3, 0x66cf, 0x67cf, 0x68cf, 0x69cf, 0xb4f3, 0x6acf, 0x6bcf, 0x6ccf, 0x6dcf, 0xa8f3, 0x6ecf, 0x6fcf, 0x70cf, 0x71cf, 0xb3f3, 0x72cf, 0x73cf, 0x74cf, 0xb5f3, 0x75cf, 0x76cf, 0x77cf, 0x78cf, 0x79cf, 0x7acf, 0x7bcf, 0x7ccf, 0x7dcf, 0x7ecf, 0xb7d0, 0x80cf, 0x81cf, 0x82cf, 0x83cf, 0xb8f3, 0x84cf, 0x85cf, 0x86cf, 0x87cf, 0xf9d9, 0x88cf, 0x89cf, 0x8acf, 0x8bcf, 0x8ccf, 0x8dcf, 0xb9f3, 0x8ecf, 0x8fcf, 0x90cf, 0x91cf, 0x92cf, 0x93cf, 0x94cf, 0x95cf, 0xb7f3, 0x96cf, 0xe4c8, 0xb6f3, 0x97cf, 0x98cf, 0x99cf, 0x9acf, 0xbaf3, 0x9bcf, 0x9ccf, 0x9dcf, 0x9ecf, 0x9fcf, 0xbbf3, 0xc0b4, 0xa0cf, 0x40d0, 0x41d0, 0x42d0, 0x43d0, 0x44d0, 0x45d0, 0x46d0, 0x47d0, 0x48d0, 0x49d0, 0x4ad0, 0x4bd0, 0x4cd0, 0x4dd0, 0xc3ee, 0x4ed0, 0x4fd0, 0x50d0, 0x51d0, 0x52d0, 0x53d0, 0xbcf3, 0x54d0, 0x55d0, 0xbdf3, 0x56d0, 0x57d0, 0x58d0, 0xaad1, 0x59d0, 0x5ad0, 0x5bd0, 0xacf4, 0xc6d0, 0x5cd0, 0x5dd0, 0x5ed0, 0x5fd0, 0x60d0, 0x61d0, 0xd0d0, 0xdcd1, 0x62d0, 0x63d0, 0x64d0, 0x65d0, 0x66d0, 0x67d0, 0xcecf, 0x68d0, 0x69d0, 0xd6bd, 0x6ad0, 0xc3d1, 0x6bd0, 0x6cd0, 0x6dd0, 0x6ed0, 0x6fd0, 0x70d0, 0x71d0, 0xe2ba, 0xe9e1, 0xc2d2, 0xc2f1, 0xb9b2, 0x72d0, 0x73d0, 0xedb1, 0xc3f1, 0x74d0, 0xc0c9, 0xc4b3, 0x75d0, 0xf2d9, 0x76d0, 0xa5cb, 0x77d0, 0xc4f1, 0x78d0, 0x79d0, 0x7ad0, 0x7bd0, 0xd4d6, 0x7cd0, 0x7dd0, 0x7ed0, 0x80d0, 0x81d0, 0xc5f1, 0xc0f4, 0xc6f1, 0x82d0, 0xacd4, 0xc7f1, 0x83d0, 0xc0b0, 0xc1f4, 0x84d0, 0x85d0, 0xc2f4, 0x86d0, 0x87d0, 0xfcb4, 0x88d0, 0xdbc5, 0x89d0, 0x8ad0, 0x8bd0, 0x8cd0, 0xbbcc, 0x8dd0, 0x8ed0, 0x8fd0, 0xe4d0, 0x90d0, 0x91d0, 0x92d0, 0x93d0, 0x94d0, 0xe0cd, 0x95d0, 0x96d0, 0x97d0, 0x98d0, 0x99d0, 0xc8f1, 0x9ad0, 0xf3d9, 0x9bd0, 0x9cd0, 0x9dd0, 0x9ed0, 0x9fd0, 0xa0d0, 0xbbb1, 0x40d1, 0xaecf, 0x41d1, 0x42d1, 0x43d1, 0xa4b8, 0x44d1, 0x45d1, 0x46d1, 0x47d1, 0x48d1, 0xcaf1, 0x49d1, 0x4ad1, 0x4bd1, 0x4cd1, 0xcbf1, 0x4dd1, 0x4ed1, 0x4fd1, 0x50d1, 0xc3b2, 0xd1c1, 0x51d1, 0x52d1, 0xb0d7, 0xc9f1, 0x53d1, 0x54d1, 0xccf1, 0x55d1, 0x56d1, 0x57d1, 0x58d1, 0xcef1, 0x59d1, 0x5ad1, 0x5bd1, 0xf6d9, 0x5cd1, 0xe1d2, 0xa3d4, 0x5dd1, 0x5ed1, 0xc3f4, 0xb9c8, 0x5fd1, 0x60d1, 0x61d1, 0x62d1, 0x63d1, 0xc4f4, 0x64d1, 0x65d1, 0xcdf1, 0xcff1, 0xe3bf, 0xd0f1, 0x66d1, 0x67d1, 0xd4f1, 0x68d1, 0x69d1, 0x6ad1, 0x6bd1, 0x6cd1, 0x6dd1, 0x6ed1, 0xd6f1, 0xd1f1, 0x6fd1, 0xd1c9, 0xe1c5, 0x70d1, 0x71d1, 0x72d1, 0xe3c2, 0xfcb9, 0x73d1, 0x74d1, 0xd3f1, 0x75d1, 0xd5f1, 0x76d1, 0x77d1, 0x78d1, 0xd3b9, 0x79d1, 0x7ad1, 0x7bd1, 0x7cd1, 0x7dd1, 0x7ed1, 0x80d1, 0xdbf1, 0x81d1, 0x82d1, 0x83d1, 0x84d1, 0x85d1, 0xd6ba, 0x86d1, 0xfdb0, 0xd9f1, 0x87d1, 0x88d1, 0x89d1, 0x8ad1, 0x8bd1, 0xd8f1, 0xd2f1, 0xdaf1, 0x8cd1, 0x8dd1, 0x8ed1, 0x8fd1, 0x90d1, 0xd7f1, 0x91d1, 0x92d1, 0x93d1, 0xecc8, 0x94d1, 0x95d1, 0x96d1, 0x97d1, 0xcacd, 0xddf1, 0x98d1, 0x99d1, 0x9ad1, 0x9bd1, 0xbde5, 0x9cd1, 0x9dd1, 0x9ed1, 0xdcf1, 0x9fd1, 0xdef1, 0xa0d1, 0x40d2, 0x41d2, 0x42d2, 0x43d2, 0x44d2, 0x45d2, 0x46d2, 0x47d2, 0x48d2, 0xdff1, 0x49d2, 0x4ad2, 0xe5cf, 0x4bd2, 0x4cd2, 0x4dd2, 0x4ed2, 0x4fd2, 0x50d2, 0x51d2, 0x52d2, 0x53d2, 0x54d2, 0x55d2, 0x56d2, 0x57d2, 0x58d2, 0x59d2, 0x5ad2, 0x5bd2, 0x5cd2, 0x5dd2, 0x5ed2, 0x5fd2, 0x60d2, 0x61d2, 0x62d2, 0x63d2, 0xc5f4, 0xf3bd, 0x64d2, 0x65d2, 0x66d2, 0x67d2, 0x68d2, 0x69d2, 0xe0f1, 0x6ad2, 0x6bd2, 0x6cd2, 0x6dd2, 0x6ed2, 0x6fd2, 0x70d2, 0x71d2, 0x72d2, 0x73d2, 0x74d2, 0x75d2, 0x76d2, 0x77d2, 0x78d2, 0x79d2, 0x7ad2, 0x7bd2, 0x7cd2, 0x7dd2, 0xe1f1, 0x7ed2, 0x80d2, 0x81d2, 0xf7ce, 0x82d2, 0xaad2, 0x83d2, 0xfbf1, 0x84d2, 0x85d2, 0xb2b8, 0x86d2, 0x87d2, 0x88d2, 0x89d2, 0x8ad2, 0x8bd2, 0x8cd2, 0x8dd2, 0x8ed2, 0x8fd2, 0x90d2, 0x91d2, 0x92d2, 0x93d2, 0x94d2, 0x95d2, 0x96d2, 0x97d2, 0x98d2, 0x99d2, 0x9ad2, 0x9bd2, 0x9cd2, 0x9dd2, 0x9ed2, 0x9fd2, 0xa0d2, 0x40d3, 0x41d3, 0x42d3, 0x43d3, 0x44d3, 0x45d3, 0x46d3, 0x47d3, 0x48d3, 0x49d3, 0x4ad3, 0x4bd3, 0x4cd3, 0x4dd3, 0x4ed3, 0x4fd3, 0x50d3, 0x51d3, 0x52d3, 0x53d3, 0x54d3, 0x55d3, 0x56d3, 0x57d3, 0x58d3, 0x59d3, 0x5ad3, 0x5bd3, 0x5cd3, 0x5dd3, 0x5ed3, 0xfbbc, 0xdbb9, 0x5fd3, 0xe6b9, 0xd9c3, 0xd3ca, 0xe8ea, 0xc0c0, 0xf5be, 0xe9ea, 0xeaea, 0xebea, 0x60d3, 0xecea, 0xedea, 0xeeea, 0xefea, 0xc7bd, 0x61d3, 0x62d3, 0x63d3, 0xfbf5, 0x64d3, 0x65d3, 0x66d3, 0xfdf5, 0x67d3, 0xfef5, 0x68d3, 0xfcf5, 0x69d3, 0x6ad3, 0x6bd3, 0x6cd3, 0xe2bd, 0x6dd3, 0xa1f6, 0xa5b4, 0x6ed3, 0x6fd3, 0x70d3, 0x71d3, 0xa2f6, 0x72d3, 0x73d3, 0x74d3, 0xa3f6, 0x75d3, 0x76d3, 0x77d3, 0xb2ec, 0x78d3, 0x79d3, 0x7ad3, 0x7bd3, 0x7cd3, 0x7dd3, 0x7ed3, 0x80d3, 0x81d3, 0x82d3, 0x83d3, 0x84d3, 0xd4d1, 0x85d3, 0x86d3, 0x87d3, 0x88d3, 0x89d3, 0x8ad3, 0xead9, 0x8bd3, 0x8cd3, 0x8dd3, 0x8ed3, 0x8fd3, 0x90d3, 0x91d3, 0x92d3, 0x93d3, 0x94d3, 0x95d3, 0x96d3, 0x97d3, 0x98d3, 0x99d3, 0x9ad3, 0x9bd3, 0x9cd3, 0x9dd3, 0x9ed3, 0x9fd3, 0xa0d3, 0x40d4, 0x41d4, 0x42d4, 0x43d4, 0x44d4, 0x45d4, 0x46d4, 0x47d4, 0x48d4, 0x49d4, 0x4ad4, 0x4bd4, 0x4cd4, 0x4dd4, 0x4ed4, 0x4fd4, 0x50d4, 0x51d4, 0x52d4, 0x53d4, 0x54d4, 0x55d4, 0x56d4, 0x57d4, 0x58d4, 0x59d4, 0x5ad4, 0x5bd4, 0x5cd4, 0x5dd4, 0x5ed4, 0x5fd4, 0xa4f6, 0x60d4, 0x61d4, 0x62d4, 0x63d4, 0x64d4, 0x65d4, 0x66d4, 0x67d4, 0x68d4, 0xbaee, 0x69d4, 0x6ad4, 0x6bd4, 0x6cd4, 0x6dd4, 0x6ed4, 0x6fd4, 0x70d4, 0x71d4, 0x72d4, 0x73d4, 0x74d4, 0x75d4, 0x76d4, 0x77d4, 0x78d4, 0x79d4, 0x7ad4, 0x7bd4, 0x7cd4, 0x7dd4, 0x7ed4, 0x80d4, 0x81d4, 0x82d4, 0x83d4, 0x84d4, 0x85d4, 0x86d4, 0x87d4, 0x88d4, 0x89d4, 0x8ad4, 0x8bd4, 0x8cd4, 0x8dd4, 0x8ed4, 0x8fd4, 0x90d4, 0x91d4, 0x92d4, 0x93d4, 0x94d4, 0x95d4, 0x96d4, 0x97d4, 0x98d4, 0x99d4, 0xb2d5, 0x9ad4, 0x9bd4, 0x9cd4, 0x9dd4, 0x9ed4, 0x9fd4, 0xa0d4, 0x40d5, 0x41d5, 0x42d5, 0x43d5, 0x44d5, 0x45d5, 0x46d5, 0x47d5, 0xfed3, 0xdccc, 0x48d5, 0x49d5, 0x4ad5, 0x4bd5, 0x4cd5, 0x4dd5, 0x4ed5, 0x4fd5, 0xc4ca, 0x50d5, 0x51d5, 0x52d5, 0x53d5, 0x54d5, 0x55d5, 0x56d5, 0x57d5, 0x58d5, 0x59d5, 0x5ad5, 0x5bd5, 0x5cd5, 0x5dd5, 0x5ed5, 0x5fd5, 0x60d5, 0x61d5, 0x62d5, 0x63d5, 0x64d5, 0x65d5, 0x66d5, 0x67d5, 0x68d5, 0x69d5, 0x6ad5, 0x6bd5, 0x6cd5, 0x6dd5, 0x6ed5, 0x6fd5, 0x70d5, 0x71d5, 0x72d5, 0x73d5, 0x74d5, 0x75d5, 0x76d5, 0x77d5, 0x78d5, 0x79d5, 0x7ad5, 0x7bd5, 0x7cd5, 0x7dd5, 0x7ed5, 0x80d5, 0x81d5, 0x82d5, 0x83d5, 0x84d5, 0x85d5, 0x86d5, 0x87d5, 0x88d5, 0x89d5, 0x8ad5, 0x8bd5, 0x8cd5, 0x8dd5, 0x8ed5, 0x8fd5, 0x90d5, 0x91d5, 0x92d5, 0x93d5, 0x94d5, 0x95d5, 0x96d5, 0x97d5, 0x98d5, 0x99d5, 0x9ad5, 0x9bd5, 0x9cd5, 0x9dd5, 0x9ed5, 0x9fd5, 0xa0d5, 0x40d6, 0x41d6, 0x42d6, 0x43d6, 0x44d6, 0x45d6, 0x46d6, 0x47d6, 0x48d6, 0x49d6, 0x4ad6, 0x4bd6, 0x4cd6, 0x4dd6, 0x4ed6, 0x4fd6, 0x50d6, 0x51d6, 0x52d6, 0x53d6, 0x54d6, 0x55d6, 0x56d6, 0x57d6, 0x58d6, 0x59d6, 0x5ad6, 0x5bd6, 0x5cd6, 0x5dd6, 0x5ed6, 0x5fd6, 0x60d6, 0x61d6, 0x62d6, 0xc0e5, 0x63d6, 0x64d6, 0x65d6, 0x66d6, 0x67d6, 0x68d6, 0x69d6, 0x6ad6, 0x6bd6, 0x6cd6, 0x6dd6, 0x6ed6, 0x6fd6, 0x70d6, 0x71d6, 0x72d6, 0x73d6, 0x74d6, 0x75d6, 0x76d6, 0x77d6, 0x78d6, 0x79d6, 0x7ad6, 0x7bd6, 0x7cd6, 0x7dd6, 0x7ed6, 0x80d6, 0x81d6, 0xa5f6, 0x82d6, 0x83d6, 0x84d6, 0x85d6, 0x86d6, 0x87d6, 0x88d6, 0x89d6, 0x8ad6, 0x8bd6, 0x8cd6, 0x8dd6, 0x8ed6, 0x8fd6, 0x90d6, 0x91d6, 0x92d6, 0x93d6, 0x94d6, 0x95d6, 0x96d6, 0x97d6, 0x98d6, 0x99d6, 0x9ad6, 0x9bd6, 0x9cd6, 0x9dd6, 0x9ed6, 0x9fd6, 0xa0d6, 0x40d7, 0x41d7, 0x42d7, 0x43d7, 0x44d7, 0x45d7, 0x46d7, 0x47d7, 0x48d7, 0x49d7, 0x4ad7, 0x4bd7, 0x4cd7, 0x4dd7, 0x4ed7, 0x4fd7, 0x50d7, 0x51d7, 0x52d7, 0x53d7, 0x54d7, 0x55d7, 0x56d7, 0x57d7, 0x58d7, 0x59d7, 0x5ad7, 0x5bd7, 0x5cd7, 0x5dd7, 0x5ed7, 0x5fd7, 0xafbe, 0x60d7, 0x61d7, 0x62d7, 0x63d7, 0x64d7, 0xa9c6, 0x65d7, 0x66d7, 0x67d7, 0x68d7, 0x69d7, 0x6ad7, 0x6bd7, 0x6cd7, 0x6dd7, 0x6ed7, 0x6fd7, 0x70d7, 0x71d7, 0x72d7, 0x73d7, 0x74d7, 0x75d7, 0x76d7, 0x77d7, 0x78d7, 0x79d7, 0x7ad7, 0x7bd7, 0x7cd7, 0x7dd7, 0x7ed7, 0x80d7, 0x81d7, 0x82d7, 0x83d7, 0x84d7, 0x85d7, 0x86d7, 0x87d7, 0x88d7, 0x89d7, 0x8ad7, 0x8bd7, 0x8cd7, 0x8dd7, 0x8ed7, 0x8fd7, 0x90d7, 0x91d7, 0x92d7, 0x93d7, 0x94d7, 0x95d7, 0x96d7, 0x97d7, 0x98d7, 0xa5da, 0xc6bc, 0xa9b6, 0xbcb8, 0xcfc8, 0xa5bc, 0xa6da, 0xa7da, 0xd6cc, 0xc3c8, 0xa8da, 0xfdc6, 0x99d7, 0xb5d1, 0xe9d2, 0xb6d1, 0xc7bc, 0x9ad7, 0xb2bd, 0xe4bb, 0xa9da, 0xaada, 0xc8d1, 0xabda, 0xedd0, 0xefb6, 0xdbc2, 0x9bd7, 0xcfcb, 0xedb7, 0xe8c9, 0xc3b7, 0xf7be, 0xa4d6, 0xacda, 0xadda, 0xc0c6, 0xe7d7, 0xb6ca, 0x9cd7, 0xa9d5, 0xdfcb, 0xefd5, 0xaeda, 0xdfd6, 0xcab4, 0xb0da, 0xafda, 0x9dd7, 0xebd2, 0xb1da, 0xb2da, 0xb3da, 0xd4ca, 0xb4da, 0xabca, 0xb5da, 0xb6da, 0xcfb3, 0xefd6, 0xb7da, 0xb0bb, 0xaeb5, 0xb8da, 0xb9da, 0xeeb9, 0xafd1, 0xe8d2, 0xbada, 0xc3b8, 0xeacf, 0xefb2, 0xbbda, 0xbcda, 0x9ed7, 0xebbd, 0xdcce, 0xefd3, 0xbdda, 0xf3ce, 0xbeda, 0xd5d3, 0xe5bb, 0xbfda, 0xb5cb, 0xd0cb, 0xc0da, 0xebc7, 0xeed6, 0xc1da, 0xb5c5, 0xc1b6, 0xc2da, 0xccb7, 0xcebf, 0xc3da, 0xc4da, 0xadcb, 0xc5da, 0xf7b5, 0xc6da, 0xc2c1, 0xbbd7, 0xc7da, 0xb8cc, 0x9fd7, 0xead2, 0xb1c4, 0xc8da, 0xfdb5, 0xd1bb, 0xc9da, 0xb3d0, 0xcada, 0xcbda, 0xbdce, 0xccda, 0xcdda, 0xceda, 0xf7b2, 0xd1da, 0xcfda, 0xe8d1, 0xd0da, 0xd5c3, 0xd2da, 0xa0d7, 0xd3da, 0xd4da, 0xd5da, 0xbbd0, 0xa5d2, 0xf9b0, 0xd6da, 0xabc7, 0xd7da, 0xf7bd, 0xa1c3, 0xd8da, 0xd9da, 0xfdc3, 0xb7cc, 0xdada, 0xdbda, 0xbec0, 0xd7c6, 0xdcda, 0xddda, 0xb4c7, 0xdeda, 0xdfda, 0xc8b9, 0x40d8, 0x41d8, 0x42d8, 0x43d8, 0x44d8, 0x45d8, 0x46d8, 0x47d8, 0x48d8, 0xedbb, 0x49d8, 0x4ad8, 0x4bd8, 0x4cd8, 0xb9b6, 0xf8f4, 0x4dd8, 0xf9f4, 0x4ed8, 0x4fd8, 0xe3cd, 0x50d8, 0x51d8, 0x52d8, 0x53d8, 0x54d8, 0x55d8, 0x56d8, 0x57d8, 0xb9f5, 0x58d8, 0x59d8, 0x5ad8, 0x5bd8, 0xe0eb, 0x5cd8, 0x5dd8, 0x5ed8, 0x5fd8, 0x60d8, 0x61d8, 0xf3cf, 0xbfbb, 0x62d8, 0x63d8, 0x64d8, 0x65d8, 0x66d8, 0x67d8, 0x68d8, 0xc0ba, 0xa5d4, 0x69d8, 0x6ad8, 0x6bd8, 0x6cd8, 0x6dd8, 0x6ed8, 0x6fd8, 0xd9e1, 0x70d8, 0x71d8, 0x72d8, 0x73d8, 0xf4f5, 0xaab1, 0xf2b2, 0x74d8, 0x75d8, 0x76d8, 0x77d8, 0x78d8, 0x79d8, 0x7ad8, 0xf5f5, 0x7bd8, 0x7cd8, 0xf7f5, 0x7dd8, 0x7ed8, 0x80d8, 0xd1ba, 0xf6f5, 0x81d8, 0xb2c3, 0x82d8, 0x83d8, 0x84d8, 0x85d8, 0x86d8, 0x87d8, 0x88d8, 0xf9f5, 0x89d8, 0x8ad8, 0x8bd8, 0xf8f5, 0x8cd8, 0x8dd8, 0x8ed8, 0x8fd8, 0x90d8, 0x91d8, 0x92d8, 0x93d8, 0x94d8, 0x95d8, 0x96d8, 0x97d8, 0x98d8, 0x99d8, 0x9ad8, 0x9bd8, 0x9cd8, 0x9dd8, 0x9ed8, 0x9fd8, 0xa0d8, 0x40d9, 0x41d9, 0x42d9, 0x43d9, 0x44d9, 0x45d9, 0x46d9, 0x47d9, 0x48d9, 0x49d9, 0x4ad9, 0x4bd9, 0x4cd9, 0x4dd9, 0x4ed9, 0x4fd9, 0x50d9, 0x51d9, 0x52d9, 0x53d9, 0x54d9, 0x55d9, 0x56d9, 0x57d9, 0x58d9, 0x59d9, 0x5ad9, 0x5bd9, 0x5cd9, 0x5dd9, 0x5ed9, 0x5fd9, 0x60d9, 0x61d9, 0x62d9, 0x63d9, 0x64d9, 0x65d9, 0x66d9, 0x67d9, 0x68d9, 0x69d9, 0x6ad9, 0x6bd9, 0x6cd9, 0x6dd9, 0x6ed9, 0x6fd9, 0x70d9, 0x71d9, 0x72d9, 0x73d9, 0x74d9, 0x75d9, 0x76d9, 0x77d9, 0x78d9, 0x79d9, 0x7ad9, 0x7bd9, 0x7cd9, 0x7dd9, 0x7ed9, 0x80d9, 0x81d9, 0x82d9, 0x83d9, 0x84d9, 0x85d9, 0x86d9, 0x87d9, 0x88d9, 0x89d9, 0x8ad9, 0x8bd9, 0x8cd9, 0x8dd9, 0x8ed9, 0x8fd9, 0x90d9, 0x91d9, 0x92d9, 0x93d9, 0x94d9, 0x95d9, 0x96d9, 0x97d9, 0x98d9, 0x99d9, 0x9ad9, 0x9bd9, 0x9cd9, 0x9dd9, 0x9ed9, 0x9fd9, 0xa0d9, 0x40da, 0x41da, 0x42da, 0x43da, 0x44da, 0x45da, 0x46da, 0x47da, 0x48da, 0x49da, 0x4ada, 0x4bda, 0x4cda, 0x4dda, 0x4eda, 0xb4b1, 0xead5, 0xbab8, 0x4fda, 0xb1b9, 0xc6b2, 0xf0d4, 0xcdcf, 0xdcb0, 0xcbd5, 0xf5bb, 0xcad6, 0xb7b7, 0xb0cc, 0xb6c6, 0xe1b1, 0xbab9, 0xfcd6, 0xe1b9, 0xa1b7, 0xfabc, 0xdaea, 0xdbea, 0xf9cc, 0xf3b9, 0xdcea, 0xfbb4, 0xb3c3, 0xd1b7, 0xd8ba, 0xddea, 0xf4d4, 0xdeea, 0xd6bc, 0xdfbb, 0xdfea, 0xdec1, 0xb8c2, 0xdfd4, 0xcad7, 0xe0ea, 0xe1ea, 0xe4ea, 0xe2ea, 0xe3ea, 0xdec9, 0xb3b8, 0xc4b6, 0xe5ea, 0xeaca, 0xcdc9, 0xcdb4, 0x50da, 0x51da, 0xd9e2, 0xe2c5, 0xe6ea, 0xb5c0, 0x52da, 0xb8d7, 0xe7ea, 0xacd7, 0xfcc8, 0xd3d8, 0xcdd8, 0xded4, 0x53da, 0xf9d4, 0xc4c9, 0xaed3, 0xd3b8, 0xe0b3, 0x54da, 0xe2c9, 0xf6f4, 0x55da, 0x56da, 0x57da, 0xd5ba, 0x58da, 0xf7f4, 0x59da, 0x5ada, 0xdfd7, 0x5bda, 0x5cda, 0xf1f4, 0xb0b8, 0xd4d5, 0xcfb8, 0xf0c6, 0x5dda, 0x5eda, 0x5fda, 0x60da, 0x61da, 0x62da, 0x63da, 0x64da, 0x65da, 0xc3b3, 0x66da, 0x67da, 0xf2f4, 0xacb3, 0x68da, 0x69da, 0x6ada, 0x6bda, 0xbdd4, 0xf7c7, 0x6cda, 0x6dda, 0x6eda, 0x6fda, 0x70da, 0xf4f4, 0x71da, 0x72da, 0xf3f4, 0x73da, 0x74da, 0x75da, 0x76da, 0x77da, 0x78da, 0x79da, 0x7ada, 0x7bda, 0x7cda, 0xcbcc, 0x7dda, 0x7eda, 0x80da, 0xa4c8, 0x81da, 0x82da, 0x83da, 0x84da, 0x85da, 0x86da, 0x87da, 0x88da, 0x89da, 0x8ada, 0x8bda, 0x8cda, 0x8dda, 0xf5f4, 0x8eda, 0xe3d7, 0xbfc5, 0xc0f5, 0x8fda, 0x90da, 0xbbf5, 0x91da, 0xc3f5, 0x92da, 0xc2f5, 0x93da, 0xbad6, 0xc1f5, 0x94da, 0x95da, 0x96da, 0xbed4, 0xc4f5, 0x97da, 0xccf5, 0x98da, 0x99da, 0x9ada, 0x9bda, 0xcfb0, 0xf8b5, 0x9cda, 0xc9f5, 0xcaf5, 0x9dda, 0xdcc5, 0x9eda, 0x9fda, 0xa0da, 0x40db, 0xc5f5, 0xc6f5, 0x41db, 0x42db, 0xc7f5, 0xcbf5, 0x43db, 0xe0be, 0xc8f5, 0xfab8, 0x44db, 0x45db, 0x46db, 0xd0f5, 0xd3f5, 0x47db, 0x48db, 0x49db, 0xe7bf, 0x4adb, 0xf2b9, 0xbcf5, 0xcdf5, 0x4bdb, 0x4cdb, 0xb7c2, 0x4ddb, 0x4edb, 0x4fdb, 0xf8cc, 0x50db, 0xf9bc, 0x51db, 0xcef5, 0xcff5, 0xd1f5, 0xe5b6, 0xd2f5, 0x52db, 0xd5f5, 0x53db, 0x54db, 0x55db, 0x56db, 0x57db, 0x58db, 0x59db, 0xbdf5, 0x5adb, 0x5bdb, 0x5cdb, 0xd4f5, 0xbbd3, 0x5ddb, 0xecb3, 0x5edb, 0x5fdb, 0xa4cc, 0x60db, 0x61db, 0x62db, 0x63db, 0xd6f5, 0x64db, 0x65db, 0x66db, 0x67db, 0x68db, 0x69db, 0x6adb, 0x6bdb, 0xd7f5, 0xe1be, 0xd8f5, 0x6cdb, 0x6ddb, 0xdfcc, 0xdbf5, 0x6edb, 0x6fdb, 0x70db, 0x71db, 0x72db, 0xc8b2, 0xd9d7, 0x73db, 0xd9f5, 0x74db, 0xdaf5, 0xdcf5, 0x75db, 0xe2f5, 0x76db, 0x77db, 0x78db, 0xe0f5, 0x79db, 0x7adb, 0x7bdb, 0xdff5, 0xddf5, 0x7cdb, 0x7ddb, 0xe1f5, 0x7edb, 0x80db, 0xdef5, 0xe4f5, 0xe5f5, 0x81db, 0xe3cc, 0x82db, 0x83db, 0xbfe5, 0xb8b5, 0xe3f5, 0xe8f5, 0xa3cc, 0x84db, 0x85db, 0x86db, 0x87db, 0x88db, 0xe6f5, 0xe7f5, 0x89db, 0x8adb, 0x8bdb, 0x8cdb, 0x8ddb, 0x8edb, 0xbef5, 0x8fdb, 0x90db, 0x91db, 0x92db, 0x93db, 0x94db, 0x95db, 0x96db, 0x97db, 0x98db, 0x99db, 0x9adb, 0xc4b1, 0x9bdb, 0x9cdb, 0xbff5, 0x9ddb, 0x9edb, 0xc5b5, 0xe4b2, 0x9fdb, 0xecf5, 0xe9f5, 0xa0db, 0xd7b6, 0x40dc, 0xedf5, 0x41dc, 0xeaf5, 0x42dc, 0x43dc, 0x44dc, 0x45dc, 0x46dc, 0xebf5, 0x47dc, 0x48dc, 0xdab4, 0x49dc, 0xead4, 0x4adc, 0x4bdc, 0x4cdc, 0xeef5, 0x4ddc, 0xf9b3, 0x4edc, 0x4fdc, 0x50dc, 0x51dc, 0x52dc, 0x53dc, 0x54dc, 0xeff5, 0xf1f5, 0x55dc, 0x56dc, 0x57dc, 0xf0f5, 0x58dc, 0x59dc, 0x5adc, 0x5bdc, 0x5cdc, 0x5ddc, 0x5edc, 0xf2f5, 0x5fdc, 0xf3f5, 0x60dc, 0x61dc, 0x62dc, 0x63dc, 0x64dc, 0x65dc, 0x66dc, 0x67dc, 0x68dc, 0x69dc, 0x6adc, 0x6bdc, 0xedc9, 0xaab9, 0x6cdc, 0x6ddc, 0xfbc7, 0x6edc, 0x6fdc, 0xe3b6, 0x70dc, 0x71dc, 0x72dc, 0x73dc, 0x74dc, 0x75dc, 0x76dc, 0xc9cc, 0x77dc, 0x78dc, 0x79dc, 0x7adc, 0x7bdc, 0x7cdc, 0x7ddc, 0x7edc, 0x80dc, 0x81dc, 0x82dc, 0x83dc, 0x84dc, 0x85dc, 0x86dc, 0x87dc, 0x88dc, 0x89dc, 0x8adc, 0xa6ea, 0x8bdc, 0x8cdc, 0x8ddc, 0x8edc, 0x8fdc, 0x90dc, 0x91dc, 0x92dc, 0x93dc, 0x94dc, 0x95dc, 0x96dc, 0x97dc, 0x98dc, 0x99dc, 0x9adc, 0x9bdc, 0x9cdc, 0x9ddc, 0x9edc, 0x9fdc, 0xa0dc, 0x40dd, 0x41dd, 0x42dd, 0x43dd, 0x44dd, 0x45dd, 0x46dd, 0x47dd, 0x48dd, 0x49dd, 0x4add, 0x4bdd, 0x4cdd, 0x4ddd, 0x4edd, 0x4fdd, 0x50dd, 0x51dd, 0x52dd, 0x53dd, 0x54dd, 0x55dd, 0x56dd, 0x57dd, 0x58dd, 0x59dd, 0x5add, 0x5bdd, 0x5cdd, 0x5ddd, 0x5edd, 0x5fdd, 0x60dd, 0x61dd, 0x62dd, 0x63dd, 0x64dd, 0x65dd, 0x66dd, 0x67dd, 0x68dd, 0x69dd, 0x6add, 0x6bdd, 0x6cdd, 0x6ddd, 0x6edd, 0x6fdd, 0x70dd, 0x71dd, 0x72dd, 0x73dd, 0x74dd, 0x75dd, 0x76dd, 0x77dd, 0x78dd, 0x79dd, 0x7add, 0x7bdd, 0x7cdd, 0x7ddd, 0x7edd, 0x80dd, 0x81dd, 0x82dd, 0x83dd, 0x84dd, 0x85dd, 0x86dd, 0x87dd, 0x88dd, 0x89dd, 0x8add, 0x8bdd, 0x8cdd, 0x8ddd, 0x8edd, 0x8fdd, 0x90dd, 0x91dd, 0x92dd, 0x93dd, 0x94dd, 0x95dd, 0x96dd, 0x97dd, 0x98dd, 0x99dd, 0x9add, 0x9bdd, 0x9cdd, 0x9ddd, 0x9edd, 0x9fdd, 0xa0dd, 0x40de, 0x41de, 0x42de, 0x43de, 0x44de, 0x45de, 0x46de, 0x47de, 0x48de, 0x49de, 0x4ade, 0x4bde, 0x4cde, 0x4dde, 0x4ede, 0x4fde, 0x50de, 0x51de, 0x52de, 0x53de, 0x54de, 0x55de, 0x56de, 0x57de, 0x58de, 0x59de, 0x5ade, 0x5bde, 0x5cde, 0x5dde, 0x5ede, 0x5fde, 0x60de, 0xb5b3, 0xfed4, 0xecb9, 0xf9d0, 0x61de, 0xede9, 0xaad7, 0xeee9, 0xd6c2, 0xedc8, 0xe4ba, 0xefe9, 0xf0e9, 0xf1e9, 0xe1d6, 0xf2e9, 0xf3e9, 0xf5e9, 0xf4e9, 0xf6e9, 0xf7e9, 0xe1c7, 0xf8e9, 0xd8d4, 0xf9e9, 0xcebd, 0x62de, 0xfae9, 0xfbe9, 0xcfbd, 0xfce9, 0xa8b8, 0xbec1, 0xfde9, 0xb2b1, 0xd4bb, 0xf5b9, 0xfee9, 0x63de, 0xa1ea, 0xa2ea, 0xa3ea, 0xf8b7, 0xadbc, 0x64de, 0xe4ca, 0xcee0, 0xafd4, 0xbdcf, 0xb7d5, 0xa4ea, 0xded5, 0xa5ea, 0xc1d0, 0xbcb9, 0x65de, 0xc7b4, 0xd9b1, 0x66de, 0x67de, 0x68de, 0xb1c0, 0x69de, 0x6ade, 0x6bde, 0x6cde, 0xe6b1, 0xe7b1, 0x6dde, 0xe8b1, 0x6ede, 0x6fde, 0x70de, 0x71de, 0xbdb3, 0xe8c8, 0x72de, 0x73de, 0x74de, 0x75de, 0xc1e5, 0x76de, 0x77de, 0xdfb1, 0x78de, 0x79de, 0x7ade, 0xc9c1, 0xefb4, 0x7bde, 0x7cde, 0xa8c7, 0xd8d3, 0x7dde, 0xf9c6, 0xb8d1, 0x7ede, 0xfdb9, 0xf5c2, 0x80de, 0x81de, 0x82de, 0x83de, 0x84de, 0xadd3, 0x85de, 0xcbd4, 0xfcbd, 0x86de, 0xc2e5, 0xb5b7, 0xc3e5, 0x87de, 0x88de, 0xb9bb, 0xe2d5, 0x89de, 0xf8bd, 0xb6d4, 0xa5ce, 0xacc1, 0xd9b3, 0x8ade, 0x8bde, 0xf6cc, 0x8cde, 0xc6e5, 0xc4e5, 0xc8e5, 0x8dde, 0xcae5, 0xc7e5, 0xcfb5, 0xc8c6, 0x8ede, 0xfcb5, 0xc5e5, 0x8fde, 0xf6ca, 0x90de, 0x91de, 0xc9e5, 0x92de, 0x93de, 0x94de, 0xd4c3, 0xc5b1, 0xa3bc, 0x95de, 0x96de, 0x97de, 0xb7d7, 0x98de, 0x99de, 0xcbcd, 0xcdcb, 0xcaca, 0xd3cc, 0xcce5, 0xcbe5, 0xe6c4, 0x9ade, 0x9bde, 0xa1d1, 0xb7d1, 0xcde5, 0x9cde, 0xd0e5, 0x9dde, 0xb8cd, 0xf0d6, 0xcfe5, 0xddb5, 0x9ede, 0xbecd, 0x9fde, 0xd1e5, 0xbab6, 0xa0de, 0x40df, 0xa8cd, 0xe4b9, 0x41df, 0xc5ca, 0xd1b3, 0xd9cb, 0xecd4, 0xd2e5, 0xeab7, 0x42df, 0x43df, 0x44df, 0xcee5, 0x45df, 0x46df, 0x47df, 0x48df, 0x49df, 0x4adf, 0xd5e5, 0xfeb4, 0xd6e5, 0x4bdf, 0x4cdf, 0x4ddf, 0x4edf, 0x4fdf, 0xd3e5, 0xd4e5, 0x50df, 0xddd2, 0x51df, 0x52df, 0xdfc2, 0xc6b1, 0x53df, 0xe2d3, 0x54df, 0x55df, 0xddb6, 0xeccb, 0x56df, 0xd7e5, 0x57df, 0x58df, 0xf6d3, 0x59df, 0x5adf, 0x5bdf, 0x5cdf, 0x5ddf, 0xe9b1, 0x5edf, 0xf4b6, 0xdae5, 0xd8e5, 0xd9e5, 0xc0b5, 0x5fdf, 0x60df, 0x61df, 0xc5d2, 0xdce5, 0x62df, 0x63df, 0xdee5, 0x64df, 0x65df, 0x66df, 0x67df, 0x68df, 0x69df, 0xdde5, 0xb2c7, 0x6adf, 0xa3d2, 0x6bdf, 0x6cdf, 0xdbe5, 0x6ddf, 0x6edf, 0x6fdf, 0x70df, 0xe2d4, 0xdad5, 0x71df, 0x72df, 0x73df, 0x74df, 0x75df, 0xe0e5, 0xf1d7, 0x76df, 0x77df, 0x78df, 0x79df, 0x7adf, 0x7bdf, 0x7cdf, 0xe1e5, 0x7ddf, 0xdcb1, 0xfbd1, 0x7edf, 0xe2e5, 0xe4e5, 0x80df, 0x81df, 0x82df, 0x83df, 0xe3e5, 0x84df, 0x85df, 0xe5e5, 0x86df, 0x87df, 0x88df, 0x89df, 0x8adf, 0xd8d2, 0x8bdf, 0xcbb5, 0x8cdf, 0xdfe7, 0x8ddf, 0xf5da, 0x8edf, 0xf8da, 0x8fdf, 0xf6da, 0x90df, 0xf7da, 0x91df, 0x92df, 0x93df, 0xfada, 0xcfd0, 0xc7c4, 0x94df, 0x95df, 0xeeb0, 0x96df, 0x97df, 0x98df, 0xb0d0, 0x99df, 0xf9da, 0x9adf, 0xcad3, 0xaaba, 0xa2db, 0xf1c7, 0x9bdf, 0xfcda, 0xfbda, 0xdbc9, 0xfdda, 0x9cdf, 0xa1db, 0xded7, 0xfeda, 0xdac1, 0x9ddf, 0x9edf, 0xa5db, 0x9fdf, 0xa0df, 0xf4d3, 0x40e0, 0x41e0, 0xa7db, 0xa4db, 0x42e0, 0xa8db, 0x43e0, 0x44e0, 0xbcbd, 0x45e0, 0x46e0, 0x47e0, 0xc9c0, 0xa3db, 0xa6db, 0xa3d6, 0x48e0, 0xa9db, 0x49e0, 0x4ae0, 0x4be0, 0xaddb, 0x4ce0, 0x4de0, 0x4ee0, 0xaedb, 0xacdb, 0xc2ba, 0x4fe0, 0x50e0, 0x51e0, 0xa4bf, 0xabdb, 0x52e0, 0x53e0, 0x54e0, 0xaadb, 0xc7d4, 0xbfb2, 0x55e0, 0x56e0, 0xafdb, 0x57e0, 0xf9b9, 0x58e0, 0xb0db, 0x59e0, 0x5ae0, 0x5be0, 0x5ce0, 0xbbb3, 0x5de0, 0x5ee0, 0x5fe0, 0xa6b5, 0x60e0, 0x61e0, 0x62e0, 0x63e0, 0xbcb6, 0xb1db, 0x64e0, 0x65e0, 0x66e0, 0xf5b6, 0x67e0, 0xb2db, 0x68e0, 0x69e0, 0x6ae0, 0x6be0, 0x6ce0, 0x6de0, 0x6ee0, 0x6fe0, 0x70e0, 0x71e0, 0x72e0, 0x73e0, 0x74e0, 0x75e0, 0x76e0, 0x77e0, 0x78e0, 0x79e0, 0x7ae0, 0x7be0, 0xc9b1, 0x7ce0, 0x7de0, 0x7ee0, 0x80e0, 0xb4db, 0x81e0, 0x82e0, 0x83e0, 0xb3db, 0xb5db, 0x84e0, 0x85e0, 0x86e0, 0x87e0, 0x88e0, 0x89e0, 0x8ae0, 0x8be0, 0x8ce0, 0x8de0, 0x8ee0, 0xb7db, 0x8fe0, 0xb6db, 0x90e0, 0x91e0, 0x92e0, 0x93e0, 0x94e0, 0x95e0, 0x96e0, 0xb8db, 0x97e0, 0x98e0, 0x99e0, 0x9ae0, 0x9be0, 0x9ce0, 0x9de0, 0x9ee0, 0x9fe0, 0xb9db, 0xa0e0, 0x40e1, 0xbadb, 0x41e1, 0x42e1, 0xcfd3, 0xfaf4, 0xf5c7, 0xc3d7, 0xe4c5, 0xfcf4, 0xfdf4, 0xfbf4, 0x43e1, 0xc6be, 0x44e1, 0x45e1, 0x46e1, 0x47e1, 0xefd0, 0x48e1, 0x49e1, 0xd3b7, 0x4ae1, 0x4be1, 0xcdd4, 0xaacc, 0x4ce1, 0x4de1, 0xa2f5, 0xa1f5, 0xa8ba, 0xfef4, 0xd6cb, 0x4ee1, 0x4fe1, 0x50e1, 0xa4f5, 0xd2c0, 0x51e1, 0xeab3, 0x52e1, 0xaacd, 0xa5f5, 0xa3f5, 0xb4bd, 0xa8f5, 0x53e1, 0xa9f5, 0xcdbd, 0xb8c3, 0xe1bf, 0xe1cb, 0xaaf5, 0x54e1, 0x55e1, 0x56e1, 0xa6f5, 0xa7f5, 0xf0c4, 0x57e1, 0x58e1, 0x59e1, 0x5ae1, 0x5be1, 0xacf5, 0x5ce1, 0xbcb4, 0x5de1, 0xedd7, 0x5ee1, 0xd7b4, 0xabf5, 0xaef5, 0x5fe1, 0x60e1, 0xadf5, 0xaff5, 0xd1d0, 0x61e1, 0x62e1, 0x63e1, 0x64e1, 0x65e1, 0x66e1, 0x67e1, 0xd1c3, 0xa9c8, 0x68e1, 0x69e1, 0x6ae1, 0x6be1, 0x6ce1, 0x6de1, 0xb0f5, 0xb1f5, 0x6ee1, 0x6fe1, 0x70e1, 0x71e1, 0x72e1, 0x73e1, 0xb2f5, 0x74e1, 0x75e1, 0xb3f5, 0xb4f5, 0xb5f5, 0x76e1, 0x77e1, 0x78e1, 0x79e1, 0xb7f5, 0xb6f5, 0x7ae1, 0x7be1, 0x7ce1, 0x7de1, 0xb8f5, 0x7ee1, 0x80e1, 0x81e1, 0x82e1, 0x83e1, 0x84e1, 0x85e1, 0x86e1, 0x87e1, 0x88e1, 0x89e1, 0x8ae1, 0xc9b2, 0x8be1, 0xd4d3, 0xcdca, 0x8ce1, 0xefc0, 0xd8d6, 0xb0d2, 0xbfc1, 0x8de1, 0xf0bd, 0x8ee1, 0x8fe1, 0x90e1, 0x91e1, 0x92e1, 0x93e1, 0x94e1, 0x95e1, 0x96e1, 0x97e1, 0xaab8, 0x98e1, 0x99e1, 0x9ae1, 0x9be1, 0x9ce1, 0x9de1, 0x9ee1, 0x9fe1, 0xa0e1, 0x40e2, 0x41e2, 0x42e2, 0x43e2, 0x44e2, 0x45e2, 0x46e2, 0x47e2, 0x48e2, 0x49e2, 0x4ae2, 0x4be2, 0x4ce2, 0x4de2, 0x4ee2, 0x4fe2, 0x50e2, 0x51e2, 0x52e2, 0x53e2, 0x54e2, 0x55e2, 0x56e2, 0x57e2, 0x58e2, 0x59e2, 0x5ae2, 0x5be2, 0x5ce2, 0x5de2, 0x5ee2, 0x5fe2, 0x60e2, 0x61e2, 0x62e2, 0x63e2, 0x64e2, 0x65e2, 0x66e2, 0x67e2, 0x68e2, 0x69e2, 0x6ae2, 0x6be2, 0x6ce2, 0x6de2, 0x6ee2, 0x6fe2, 0x70e2, 0x71e2, 0x72e2, 0x73e2, 0x74e2, 0x75e2, 0x76e2, 0x77e2, 0x78e2, 0x79e2, 0x7ae2, 0x7be2, 0x7ce2, 0x7de2, 0x7ee2, 0x80e2, 0x81e2, 0x82e2, 0x83e2, 0x84e2, 0x85e2, 0x86e2, 0x87e2, 0x88e2, 0x89e2, 0x8ae2, 0x8be2, 0x8ce2, 0x8de2, 0x8ee2, 0x8fe2, 0x90e2, 0x91e2, 0x92e2, 0x93e2, 0x94e2, 0x95e2, 0x96e2, 0x97e2, 0x98e2, 0x99e2, 0x9ae2, 0x9be2, 0x9ce2, 0x9de2, 0x9ee2, 0x9fe2, 0xa0e2, 0x40e3, 0x41e3, 0x42e3, 0x43e3, 0x44e3, 0x45e3, 0x46e3, 0x47e3, 0x48e3, 0x49e3, 0x4ae3, 0x4be3, 0x4ce3, 0x4de3, 0x4ee3, 0x4fe3, 0x50e3, 0x51e3, 0x52e3, 0x53e3, 0x54e3, 0x55e3, 0x56e3, 0x57e3, 0x58e3, 0x59e3, 0x5ae3, 0x5be3, 0x5ce3, 0x5de3, 0x5ee3, 0x5fe3, 0x60e3, 0x61e3, 0x62e3, 0x63e3, 0x64e3, 0x65e3, 0x66e3, 0x67e3, 0x68e3, 0x69e3, 0x6ae3, 0x6be3, 0x6ce3, 0x6de3, 0xf8bc, 0x6ee3, 0x6fe3, 0x70e3, 0x71e3, 0x72e3, 0x73e3, 0x74e3, 0x75e3, 0x76e3, 0x77e3, 0x78e3, 0x79e3, 0x7ae3, 0x7be3, 0x7ce3, 0x7de3, 0x7ee3, 0x80e3, 0x81e3, 0x82e3, 0x83e3, 0x84e3, 0x85e3, 0x86e3, 0x87e3, 0xc6f6, 0x88e3, 0x89e3, 0x8ae3, 0x8be3, 0x8ce3, 0x8de3, 0x8ee3, 0x8fe3, 0x90e3, 0x91e3, 0x92e3, 0x93e3, 0x94e3, 0x95e3, 0x96e3, 0x97e3, 0x98e3, 0x99e3, 0x9ae3, 0x9be3, 0x9ce3, 0x9de3, 0x9ee3, 0x9fe3, 0xa0e3, 0x40e4, 0x41e4, 0x42e4, 0x43e4, 0x44e4, 0x45e4, 0xc7f6, 0x46e4, 0x47e4, 0x48e4, 0x49e4, 0x4ae4, 0x4be4, 0x4ce4, 0x4de4, 0x4ee4, 0x4fe4, 0x50e4, 0x51e4, 0x52e4, 0x53e4, 0x54e4, 0x55e4, 0x56e4, 0x57e4, 0x58e4, 0x59e4, 0x5ae4, 0x5be4, 0x5ce4, 0x5de4, 0x5ee4, 0xc8f6, 0x5fe4, 0x60e4, 0x61e4, 0x62e4, 0x63e4, 0x64e4, 0x65e4, 0x66e4, 0x67e4, 0x68e4, 0x69e4, 0x6ae4, 0x6be4, 0x6ce4, 0x6de4, 0x6ee4, 0x6fe4, 0x70e4, 0x71e4, 0x72e4, 0x73e4, 0x74e4, 0x75e4, 0x76e4, 0x77e4, 0x78e4, 0x79e4, 0x7ae4, 0x7be4, 0x7ce4, 0x7de4, 0x7ee4, 0x80e4, 0x81e4, 0x82e4, 0x83e4, 0x84e4, 0x85e4, 0x86e4, 0x87e4, 0x88e4, 0x89e4, 0x8ae4, 0x8be4, 0x8ce4, 0x8de4, 0x8ee4, 0x8fe4, 0x90e4, 0x91e4, 0x92e4, 0x93e4, 0x94e4, 0x95e4, 0x96e4, 0x97e4, 0x98e4, 0x99e4, 0x9ae4, 0x9be4, 0x9ce4, 0x9de4, 0x9ee4, 0x9fe4, 0xa0e4, 0x40e5, 0x41e5, 0x42e5, 0x43e5, 0x44e5, 0x45e5, 0x46e5, 0x47e5, 0x48e5, 0x49e5, 0x4ae5, 0x4be5, 0x4ce5, 0x4de5, 0x4ee5, 0x4fe5, 0x50e5, 0x51e5, 0x52e5, 0x53e5, 0x54e5, 0x55e5, 0x56e5, 0x57e5, 0x58e5, 0x59e5, 0x5ae5, 0x5be5, 0x5ce5, 0x5de5, 0x5ee5, 0x5fe5, 0x60e5, 0x61e5, 0x62e5, 0x63e5, 0x64e5, 0x65e5, 0x66e5, 0x67e5, 0x68e5, 0x69e5, 0x6ae5, 0x6be5, 0x6ce5, 0x6de5, 0x6ee5, 0x6fe5, 0x70e5, 0x71e5, 0x72e5, 0x73e5, 0xc9f6, 0x74e5, 0x75e5, 0x76e5, 0x77e5, 0x78e5, 0x79e5, 0x7ae5, 0x7be5, 0x7ce5, 0x7de5, 0x7ee5, 0x80e5, 0x81e5, 0x82e5, 0x83e5, 0x84e5, 0x85e5, 0x86e5, 0x87e5, 0x88e5, 0x89e5, 0x8ae5, 0x8be5, 0x8ce5, 0x8de5, 0x8ee5, 0x8fe5, 0x90e5, 0x91e5, 0x92e5, 0x93e5, 0x94e5, 0x95e5, 0x96e5, 0x97e5, 0x98e5, 0x99e5, 0x9ae5, 0x9be5, 0x9ce5, 0x9de5, 0x9ee5, 0x9fe5, 0xcaf6, 0xa0e5, 0x40e6, 0x41e6, 0x42e6, 0x43e6, 0x44e6, 0x45e6, 0x46e6, 0x47e6, 0x48e6, 0x49e6, 0x4ae6, 0x4be6, 0x4ce6, 0x4de6, 0x4ee6, 0x4fe6, 0x50e6, 0x51e6, 0x52e6, 0x53e6, 0x54e6, 0x55e6, 0x56e6, 0x57e6, 0x58e6, 0x59e6, 0x5ae6, 0x5be6, 0x5ce6, 0x5de6, 0x5ee6, 0x5fe6, 0x60e6, 0x61e6, 0x62e6, 0xccf6, 0x63e6, 0x64e6, 0x65e6, 0x66e6, 0x67e6, 0x68e6, 0x69e6, 0x6ae6, 0x6be6, 0x6ce6, 0x6de6, 0x6ee6, 0x6fe6, 0x70e6, 0x71e6, 0x72e6, 0x73e6, 0x74e6, 0x75e6, 0x76e6, 0x77e6, 0x78e6, 0x79e6, 0x7ae6, 0x7be6, 0x7ce6, 0x7de6, 0x7ee6, 0x80e6, 0x81e6, 0x82e6, 0x83e6, 0x84e6, 0x85e6, 0x86e6, 0x87e6, 0x88e6, 0x89e6, 0x8ae6, 0x8be6, 0x8ce6, 0x8de6, 0x8ee6, 0x8fe6, 0x90e6, 0x91e6, 0x92e6, 0x93e6, 0x94e6, 0x95e6, 0x96e6, 0x97e6, 0x98e6, 0x99e6, 0x9ae6, 0x9be6, 0x9ce6, 0x9de6, 0xcbf6, 0x9ee6, 0x9fe6, 0xa0e6, 0x40e7, 0x41e7, 0x42e7, 0x43e7, 0x44e7, 0x45e7, 0x46e7, 0x47e7, 0xe9f7, 0x48e7, 0x49e7, 0x4ae7, 0x4be7, 0x4ce7, 0x4de7, 0x4ee7, 0x4fe7, 0x50e7, 0x51e7, 0x52e7, 0x53e7, 0x54e7, 0x55e7, 0x56e7, 0x57e7, 0x58e7, 0x59e7, 0x5ae7, 0x5be7, 0x5ce7, 0x5de7, 0x5ee7, 0x5fe7, 0x60e7, 0x61e7, 0x62e7, 0x63e7, 0x64e7, 0x65e7, 0x66e7, 0x67e7, 0x68e7, 0x69e7, 0x6ae7, 0x6be7, 0x6ce7, 0x6de7, 0x6ee7, 0x6fe7, 0x70e7, 0x71e7, 0x72e7, 0x73e7, 0x74e7, 0x75e7, 0x76e7, 0x77e7, 0x78e7, 0x79e7, 0x7ae7, 0x7be7, 0x7ce7, 0x7de7, 0x7ee7, 0x80e7, 0x81e7, 0x82e7, 0x83e7, 0x84e7, 0x85e7, 0x86e7, 0x87e7, 0x88e7, 0x89e7, 0x8ae7, 0x8be7, 0x8ce7, 0x8de7, 0x8ee7, 0x8fe7, 0x90e7, 0x91e7, 0x92e7, 0x93e7, 0x94e7, 0x95e7, 0x96e7, 0x97e7, 0x98e7, 0x99e7, 0x9ae7, 0x9be7, 0x9ce7, 0x9de7, 0x9ee7, 0x9fe7, 0xa0e7, 0x40e8, 0x41e8, 0x42e8, 0x43e8, 0x44e8, 0x45e8, 0x46e8, 0x47e8, 0x48e8, 0x49e8, 0x4ae8, 0x4be8, 0x4ce8, 0x4de8, 0x4ee8, 0xcdf6, 0x4fe8, 0x50e8, 0x51e8, 0x52e8, 0x53e8, 0x54e8, 0x55e8, 0x56e8, 0x57e8, 0x58e8, 0x59e8, 0x5ae8, 0x5be8, 0x5ce8, 0x5de8, 0x5ee8, 0x5fe8, 0x60e8, 0x61e8, 0x62e8, 0x63e8, 0x64e8, 0x65e8, 0x66e8, 0x67e8, 0x68e8, 0x69e8, 0x6ae8, 0x6be8, 0x6ce8, 0x6de8, 0x6ee8, 0x6fe8, 0x70e8, 0x71e8, 0x72e8, 0x73e8, 0x74e8, 0x75e8, 0x76e8, 0x77e8, 0x78e8, 0x79e8, 0x7ae8, 0xcef6, 0x7be8, 0x7ce8, 0x7de8, 0x7ee8, 0x80e8, 0x81e8, 0x82e8, 0x83e8, 0x84e8, 0x85e8, 0x86e8, 0x87e8, 0x88e8, 0x89e8, 0x8ae8, 0x8be8, 0x8ce8, 0x8de8, 0x8ee8, 0x8fe8, 0x90e8, 0x91e8, 0x92e8, 0x93e8, 0x94e8, 0xc4ee, 0xc5ee, 0xc6ee, 0xebd5, 0xa4b6, 0xc8ee, 0xc7ee, 0xc9ee, 0xcaee, 0xa5c7, 0xcbee, 0xccee, 0x95e8, 0xb0b7, 0xf6b5, 0xcdee, 0xcfee, 0x96e8, 0xceee, 0x97e8, 0xc6b8, 0xd0ee, 0xd1ee, 0xd2ee, 0xdbb6, 0xaeb3, 0xd3d6, 0xc6c4, 0xb5b1, 0xd6b8, 0xd3ee, 0xd4ee, 0xbfd4, 0xd5c7, 0xfbbe, 0xd9ce, 0xb3b9, 0xd6ee, 0xd5ee, 0xd8ee, 0xd7ee, 0xa5c5, 0xd9ee, 0xdaee, 0xaec7, 0xdbee, 0xafc7, 0xdcee, 0xa7b2, 0xddee, 0xdeee, 0xdfee, 0xe0ee, 0xe1ee, 0xead7, 0xe2ee, 0xe3ee, 0xd8bc, 0xe4ee, 0xcbd3, 0xfacc, 0xacb2, 0xe5c1, 0xe5ee, 0xa6c7, 0xadc3, 0x98e8, 0xe6ee, 0xe7ee, 0xe8ee, 0xe9ee, 0xeaee, 0xebee, 0xecee, 0x99e8, 0xedee, 0xeeee, 0xefee, 0x9ae8, 0x9be8, 0xf0ee, 0xf1ee, 0xf2ee, 0xf4ee, 0xf3ee, 0x9ce8, 0xf5ee, 0xadcd, 0xc1c2, 0xf6ee, 0xf7ee, 0xf8ee, 0xa1d5, 0xf9ee, 0xb3cf, 0xfaee, 0xfbee, 0x9de8, 0xfcee, 0xfdee, 0xa1ef, 0xfeee, 0xa2ef, 0xf5b8, 0xfac3, 0xa3ef, 0xa4ef, 0xc2bd, 0xbfd2, 0xf9b2, 0xa5ef, 0xa6ef, 0xa7ef, 0xf8d2, 0xa8ef, 0xfdd6, 0xa9ef, 0xccc6, 0x9ee8, 0xaaef, 0xabef, 0xb4c1, 0xacef, 0xfacf, 0xf8cb, 0xaeef, 0xadef, 0xfab3, 0xf8b9, 0xafef, 0xb0ef, 0xe2d0, 0xb1ef, 0xb2ef, 0xe6b7, 0xbfd0, 0xb3ef, 0xb4ef, 0xb5ef, 0xf1c8, 0xe0cc, 0xb6ef, 0xb7ef, 0xb8ef, 0xb9ef, 0xbaef, 0xe0d5, 0xbbef, 0xedb4, 0xaac3, 0xbcef, 0x9fe8, 0xbdef, 0xbeef, 0xbfef, 0xa0e8, 0xfdce, 0xc0ef, 0xe0c2, 0xb8b4, 0xb6d7, 0xf5bd, 0x40e9, 0xc7cf, 0xc3ef, 0xc1ef, 0xc2ef, 0xc4ef, 0xa7b6, 0xfcbc, 0xe2be, 0xccc3, 0xc5ef, 0xc6ef, 0x41e9, 0xc7ef, 0xcfef, 0xc8ef, 0xc9ef, 0xcaef, 0xc2c7, 0xf1ef, 0xcdb6, 0xcbef, 0x42e9, 0xccef, 0xcdef, 0xc6b6, 0xbec3, 0xceef, 0x43e9, 0xd0ef, 0xd1ef, 0xd2ef, 0xf2d5, 0x44e9, 0xd3ef, 0xf7c4, 0x45e9, 0xd4ef, 0xf8c4, 0xd5ef, 0xd6ef, 0xe4b8, 0xf7b0, 0xd7ef, 0xd8ef, 0xd9ef, 0x46e9, 0xdaef, 0xdbef, 0xdcef, 0xddef, 0x47e9, 0xdeef, 0xb5be, 0xe1ef, 0xdfef, 0xe0ef, 0x48e9, 0xe2ef, 0xe3ef, 0xcdc1, 0xe4ef, 0xe5ef, 0xe6ef, 0xe7ef, 0xe8ef, 0xe9ef, 0xeaef, 0xebef, 0xecef, 0xd8c0, 0x49e9, 0xedef, 0xadc1, 0xeeef, 0xefef, 0xf0ef, 0x4ae9, 0x4be9, 0xe2cf, 0x4ce9, 0x4de9, 0x4ee9, 0x4fe9, 0x50e9, 0x51e9, 0x52e9, 0x53e9, 0xa4b3, 0x54e9, 0x55e9, 0x56e9, 0x57e9, 0x58e9, 0x59e9, 0x5ae9, 0x5be9, 0x5ce9, 0x5de9, 0x5ee9, 0x5fe9, 0x60e9, 0x61e9, 0x62e9, 0x63e9, 0x64e9, 0x65e9, 0x66e9, 0x67e9, 0x68e9, 0x69e9, 0x6ae9, 0x6be9, 0x6ce9, 0x6de9, 0x6ee9, 0x6fe9, 0x70e9, 0x71e9, 0x72e9, 0x73e9, 0x74e9, 0x75e9, 0x76e9, 0x77e9, 0x78e9, 0x79e9, 0x7ae9, 0x7be9, 0x7ce9, 0x7de9, 0x7ee9, 0x80e9, 0x81e9, 0x82e9, 0x83e9, 0x84e9, 0x85e9, 0x86e9, 0x87e9, 0x88e9, 0x89e9, 0x8ae9, 0x8be9, 0x8ce9, 0x8de9, 0x8ee9, 0x8fe9, 0x90e9, 0x91e9, 0x92e9, 0x93e9, 0x94e9, 0x95e9, 0x96e9, 0x97e9, 0x98e9, 0x99e9, 0x9ae9, 0x9be9, 0x9ce9, 0x9de9, 0x9ee9, 0x9fe9, 0xa0e9, 0x40ea, 0x41ea, 0x42ea, 0x43ea, 0x44ea, 0x45ea, 0x46ea, 0x47ea, 0x48ea, 0x49ea, 0x4aea, 0x4bea, 0x4cea, 0x4dea, 0x4eea, 0x4fea, 0x50ea, 0x51ea, 0x52ea, 0x53ea, 0x54ea, 0x55ea, 0x56ea, 0x57ea, 0x58ea, 0x59ea, 0x5aea, 0x5bea, 0xc5c3, 0xc5e3, 0xc1c9, 0xc6e3, 0x5cea, 0xd5b1, 0xcace, 0xb3b4, 0xf2c8, 0xc7e3, 0xd0cf, 0xc8e3, 0xe4bc, 0xc9e3, 0xcae3, 0xc6c3, 0xa2d5, 0xd6c4, 0xebb9, 0xc5ce, 0xcbe3, 0xf6c3, 0xcce3, 0x5dea, 0xa7b7, 0xf3b8, 0xd2ba, 0xcde3, 0xcee3, 0xc4d4, 0xcfe3, 0x5eea, 0xd0e3, 0xcbd1, 0xd1e3, 0xd2e3, 0xd3e3, 0xd4e3, 0xd6d1, 0xd5e3, 0xfbb2, 0xbbc0, 0xd6e3, 0x5fea, 0xabc0, 0xd7e3, 0xd8e3, 0xd9e3, 0x60ea, 0xdae3, 0xdbe3, 0x61ea, 0xb7b8, 0xe2da, 0x62ea, 0xd3b6, 0x63ea, 0xe4da, 0xe3da, 0x64ea, 0x65ea, 0x66ea, 0x67ea, 0x68ea, 0x69ea, 0x6aea, 0xe6da, 0x6bea, 0x6cea, 0x6dea, 0xeec8, 0x6eea, 0x6fea, 0xe5da, 0xc0b7, 0xf4d1, 0xf5d2, 0xf3d5, 0xd7bd, 0x70ea, 0x71ea, 0x72ea, 0x73ea, 0xe8d7, 0xe8da, 0xe7da, 0x74ea, 0xa2b0, 0xd3cd, 0x75ea, 0xe9da, 0x76ea, 0xbdb8, 0xcabc, 0xbdc2, 0xa4c2, 0xc2b3, 0xeada, 0x77ea, 0xaac2, 0xb0c4, 0xb5bd, 0x78ea, 0x79ea, 0xdecf, 0x7aea, 0x7bea, 0x7cea, 0xebda, 0xc2c9, 0x7dea, 0x7eea, 0x80ea, 0x81ea, 0x82ea, 0xddb1, 0x83ea, 0x84ea, 0x85ea, 0xecda, 0x86ea, 0xb8b6, 0xbad4, 0x87ea, 0xfdb3, 0x88ea, 0x89ea, 0xedda, 0xc9d4, 0xd5cf, 0xe3c5, 0x8aea, 0xeeda, 0x8bea, 0x8cea, 0x8dea, 0x8eea, 0x8fea, 0xefda, 0x90ea, 0xf0da, 0xeac1, 0xd5cc, 0xddcf, 0x91ea, 0x92ea, 0x93ea, 0x94ea, 0x95ea, 0x96ea, 0x97ea, 0x98ea, 0x99ea, 0x9aea, 0x9bea, 0x9cea, 0x9dea, 0xe7d3, 0xa1c2, 0x9eea, 0xf1da, 0x9fea, 0xa0ea, 0xe5cb, 0x40eb, 0xf2da, 0x41eb, 0xe6cb, 0xfed2, 0x42eb, 0x43eb, 0x44eb, 0xf4b8, 0x45eb, 0x46eb, 0xf3da, 0xafb0, 0xb6cf, 0x47eb, 0x48eb, 0xcfd5, 0x49eb, 0x4aeb, 0x4beb, 0x4ceb, 0x4deb, 0x4eeb, 0x4feb, 0x50eb, 0x51eb, 0x52eb, 0xedcb, 0x53eb, 0x54eb, 0x55eb, 0x56eb, 0x57eb, 0x58eb, 0x59eb, 0x5aeb, 0xf4da, 0x5beb, 0x5ceb, 0xc4e3, 0x5deb, 0x5eeb, 0xa5c1, 0x5feb, 0x60eb, 0xbff6, 0x61eb, 0x62eb, 0xc0f6, 0xc1f6, 0xd1c4, 0x63eb, 0xb8c8, 0xe3d1, 0x64eb, 0x65eb, 0xdbd0, 0xc5d1, 0xafbc, 0xcdb9, 0x66eb, 0xf4ef, 0x67eb, 0x68eb, 0xc6b4, 0xbad3, 0xc2f6, 0xfbb3, 0x69eb, 0x6aeb, 0xc3f6, 0x6beb, 0x6ceb, 0xf1b5, 0x6deb, 0x6eeb, 0x6feb, 0x70eb, 0x71eb, 0x72eb, 0x73eb, 0x74eb, 0x75eb, 0x76eb, 0xc5f6, 0x77eb, 0x78eb, 0x79eb, 0x7aeb, 0x7beb, 0x7ceb, 0x7deb, 0xead3, 0xa7f6, 0xa9d1, 0x7eeb, 0x80eb, 0x81eb, 0x82eb, 0xa9f6, 0x83eb, 0x84eb, 0x85eb, 0xa8f6, 0x86eb, 0x87eb, 0xe3c1, 0xd7c0, 0x88eb, 0xa2b1, 0x89eb, 0x8aeb, 0x8beb, 0x8ceb, 0xedce, 0x8deb, 0xe8d0, 0xabf6, 0x8eeb, 0x8feb, 0xf6cf, 0x90eb, 0xaaf6, 0xf0d5, 0xacf6, 0xb9c3, 0x91eb, 0x92eb, 0x93eb, 0xf4bb, 0xaef6, 0xadf6, 0x94eb, 0x95eb, 0x96eb, 0xdec4, 0x97eb, 0x98eb, 0xd8c1, 0x99eb, 0x9aeb, 0x9beb, 0x9ceb, 0x9deb, 0xaacb, 0x9eeb, 0xbccf, 0x9feb, 0xa0eb, 0x40ec, 0x41ec, 0x42ec, 0x43ec, 0x44ec, 0x45ec, 0x46ec, 0x47ec, 0x48ec, 0xaff6, 0x49ec, 0x4aec, 0xb0f6, 0x4bec, 0x4cec, 0xb1f6, 0x4dec, 0xb6c2, 0x4eec, 0x4fec, 0x50ec, 0x51ec, 0x52ec, 0xd4b0, 0xf9c5, 0x53ec, 0x54ec, 0x55ec, 0x56ec, 0xb2f6, 0x57ec, 0x58ec, 0x59ec, 0x5aec, 0x5bec, 0x5cec, 0x5dec, 0x5eec, 0x5fec, 0x60ec, 0x61ec, 0x62ec, 0x63ec, 0x64ec, 0x65ec, 0x66ec, 0x67ec, 0x68ec, 0x69ec, 0xe0c7, 0xa6f6, 0x6aec, 0x6bec, 0xb8be, 0x6cec, 0x6dec, 0xb2be, 0x6eec, 0xe5b5, 0x6fec, 0x70ec, 0xc7b7, 0x71ec, 0xbfbf, 0xd2c3, 0xe6c3, 0x72ec, 0x73ec, 0xccd8, 0x74ec, 0x75ec, 0x76ec, 0xefb8, 0x77ec, 0x78ec, 0x79ec, 0x7aec, 0x7bec, 0x7cec, 0x7dec, 0x7eec, 0x80ec, 0xf9bd, 0xa5d1, 0x81ec, 0xd0b0, 0x82ec, 0x83ec, 0x84ec, 0x85ec, 0x86ec, 0xb0f7, 0x87ec, 0x88ec, 0x89ec, 0x8aec, 0x8bec, 0x8cec, 0x8dec, 0x8eec, 0xb1f7, 0x8fec, 0x90ec, 0x91ec, 0x92ec, 0x93ec, 0xacd0, 0x94ec, 0xb0b0, 0x95ec, 0x96ec, 0x97ec, 0xb2f7, 0xb3f7, 0x98ec, 0xb4f7, 0x99ec, 0x9aec, 0x9bec, 0xcac7, 0x9cec, 0x9dec, 0x9eec, 0x9fec, 0xa0ec, 0x40ed, 0x41ed, 0xcfbe, 0x42ed, 0x43ed, 0xb7f7, 0x44ed, 0x45ed, 0x46ed, 0x47ed, 0x48ed, 0x49ed, 0x4aed, 0xb6f7, 0x4bed, 0xdeb1, 0x4ced, 0xb5f7, 0x4ded, 0x4eed, 0xb8f7, 0x4fed, 0xb9f7, 0x50ed, 0x51ed, 0x52ed, 0x53ed, 0x54ed, 0x55ed, 0x56ed, 0x57ed, 0x58ed, 0x59ed, 0x5aed, 0x5bed, 0x5ced, 0x5ded, 0x5eed, 0x5fed, 0x60ed, 0x61ed, 0x62ed, 0x63ed, 0x64ed, 0x65ed, 0x66ed, 0x67ed, 0x68ed, 0x69ed, 0x6aed, 0x6bed, 0x6ced, 0x6ded, 0x6eed, 0x6fed, 0x70ed, 0x71ed, 0x72ed, 0x73ed, 0x74ed, 0x75ed, 0x76ed, 0x77ed, 0x78ed, 0x79ed, 0x7aed, 0x7bed, 0x7ced, 0x7ded, 0x7eed, 0x80ed, 0x81ed, 0xa4ce, 0xcdc8, 0x82ed, 0xabba, 0xb8e8, 0xb9e8, 0xbae8, 0xc2be, 0x83ed, 0x84ed, 0x85ed, 0x86ed, 0x87ed, 0xf4d2, 0x88ed, 0xcfd4, 0xd8c9, 0x89ed, 0x8aed, 0x8bed, 0x8ced, 0x8ded, 0x8eed, 0x8fed, 0x90ed, 0x91ed, 0x92ed, 0x93ed, 0x94ed, 0x95ed, 0x96ed, 0x97ed, 0x98ed, 0x99ed, 0x9aed, 0x9bed, 0x9ced, 0x9ded, 0x9eed, 0x9fed, 0xa0ed, 0x40ee, 0x41ee, 0x42ee, 0x43ee, 0x44ee, 0x45ee, 0x46ee, 0x47ee, 0x48ee, 0x49ee, 0x4aee, 0x4bee, 0x4cee, 0x4dee, 0x4eee, 0x4fee, 0x50ee, 0x51ee, 0x52ee, 0x53ee, 0x54ee, 0x55ee, 0x56ee, 0x57ee, 0x58ee, 0x59ee, 0x5aee, 0x5bee, 0x5cee, 0x5dee, 0x5eee, 0x5fee, 0x60ee, 0x61ee, 0x62ee, 0x63ee, 0x64ee, 0x65ee, 0x66ee, 0x67ee, 0x68ee, 0x69ee, 0x6aee, 0x6bee, 0x6cee, 0x6dee, 0x6eee, 0x6fee, 0x70ee, 0x71ee, 0x72ee, 0x73ee, 0x74ee, 0x75ee, 0x76ee, 0x77ee, 0x78ee, 0x79ee, 0x7aee, 0x7bee, 0x7cee, 0x7dee, 0x7eee, 0x80ee, 0x81ee, 0x82ee, 0x83ee, 0x84ee, 0x85ee, 0x86ee, 0x87ee, 0x88ee, 0x89ee, 0x8aee, 0x8bee, 0x8cee, 0x8dee, 0x8eee, 0x8fee, 0x90ee, 0x91ee, 0x92ee, 0x93ee, 0x94ee, 0x95ee, 0x96ee, 0x97ee, 0x98ee, 0x99ee, 0x9aee, 0x9bee, 0x9cee, 0x9dee, 0x9eee, 0x9fee, 0xa0ee, 0x40ef, 0x41ef, 0x42ef, 0x43ef, 0x44ef, 0x45ef, 0xb3d2, 0xa5b6, 0xeac7, 0xfcf1, 0xeecf, 0xb3cb, 0xebd0, 0xefe7, 0xe7cd, 0xcbb9, 0xd9b6, 0xfdf1, 0xe4b0, 0xcccb, 0xfef1, 0xa4d4, 0xadc2, 0xecc1, 0xc4c6, 0xb1be, 0xa1f2, 0xd5bc, 0x46ef, 0xa2f2, 0xa3f2, 0x47ef, 0xa4f2, 0xc3d2, 0xb5c6, 0x48ef, 0xc7cd, 0xa5f2, 0x49ef, 0xb1d3, 0xc5bf, 0xe2cc, 0x4aef, 0xa6f2, 0xa7f2, 0xd5d1, 0xeeb6, 0xa8f2, 0xa9f2, 0xdfb5, 0xaaf2, 0xabf2, 0x4bef, 0xfcb2, 0xacf2, 0xadf2, 0xa7c8, 0x4cef, 0x4def, 0x4eef, 0x4fef, 0x50ef, 0x51ef, 0x52ef, 0x53ef, 0x54ef, 0x55ef, 0x56ef, 0x57ef, 0x58ef, 0x59ef, 0x5aef, 0x5bef, 0x5cef, 0x5def, 0x5eef, 0x5fef, 0x60ef, 0x61ef, 0x62ef, 0x63ef, 0x64ef, 0x65ef, 0x66ef, 0x67ef, 0x68ef, 0x69ef, 0x6aef, 0x6bef, 0x6cef, 0x6def, 0x6eef, 0x6fef, 0x70ef, 0x71ef, 0xe7b7, 0x72ef, 0x73ef, 0xa9ec, 0xaaec, 0xabec, 0x74ef, 0xacec, 0x75ef, 0x76ef, 0xaec6, 0xadec, 0xaeec, 0x77ef, 0x78ef, 0x79ef, 0xc9b7, 0xb3ca, 0x7aef, 0x7bef, 0x7cef, 0x7def, 0x7eef, 0x80ef, 0x81ef, 0xb8e2, 0xcff7, 0x82ef, 0x83ef, 0x84ef, 0x85ef, 0x86ef, 0x87ef, 0x88ef, 0x89ef, 0x8aef, 0x8bef, 0x8cef, 0x8def, 0x8eef, 0x8fef, 0x90ef, 0x91ef, 0x92ef, 0x93ef, 0x94ef, 0x95ef, 0x96ef, 0x97ef, 0x98ef, 0x99ef, 0x9aef, 0x9bef, 0x9cef, 0x9def, 0x9eef, 0x9fef, 0xa0ef, 0x40f0, 0x41f0, 0x42f0, 0x43f0, 0x44f0, 0xd0f7, 0x45f0, 0x46f0, 0xcdb2, 0x47f0, 0x48f0, 0x49f0, 0x4af0, 0x4bf0, 0x4cf0, 0x4df0, 0x4ef0, 0x4ff0, 0x50f0, 0x51f0, 0x52f0, 0x53f0, 0x54f0, 0x55f0, 0x56f0, 0x57f0, 0x58f0, 0x59f0, 0x5af0, 0x5bf0, 0x5cf0, 0x5df0, 0x5ef0, 0x5ff0, 0x60f0, 0x61f0, 0x62f0, 0x63f0, 0xd1f7, 0x64f0, 0x65f0, 0x66f0, 0x67f0, 0x68f0, 0x69f0, 0x6af0, 0x6bf0, 0x6cf0, 0x6df0, 0x6ef0, 0x6ff0, 0x70f0, 0x71f0, 0x72f0, 0x73f0, 0x74f0, 0x75f0, 0x76f0, 0x77f0, 0x78f0, 0x79f0, 0x7af0, 0x7bf0, 0x7cf0, 0x7df0, 0x7ef0, 0x80f0, 0x81f0, 0x82f0, 0x83f0, 0x84f0, 0x85f0, 0x86f0, 0x87f0, 0x88f0, 0x89f0, 0xd3f7, 0xd2f7, 0x8af0, 0x8bf0, 0x8cf0, 0x8df0, 0x8ef0, 0x8ff0, 0x90f0, 0x91f0, 0x92f0, 0x93f0, 0x94f0, 0x95f0, 0x96f0, 0xbbe2, 0x97f0, 0xa2bc, 0x98f0, 0xbce2, 0xbde2, 0xbee2, 0xbfe2, 0xc0e2, 0xc1e2, 0xb9b7, 0xfbd2, 0xa4bd, 0xceca, 0xa5b1, 0xc7cb, 0x99f0, 0xc2e2, 0xfcb6, 0xc4c8, 0xc3e2, 0x9af0, 0x9bf0, 0xc8bd, 0x9cf0, 0xfdb1, 0xc4e2, 0x9df0, 0xf6b6, 0xc5e2, 0xd9c4, 0x9ef0, 0x9ff0, 0xc6e2, 0xdacf, 0xddb9, 0xc7e2, 0xa1c0, 0xa0f0, 0xc8e2, 0xf6b2, 0x40f1, 0xc9e2, 0x41f1, 0xf3c1, 0xcae2, 0xcbe2, 0xf8c2, 0xcce2, 0xcde2, 0xcee2, 0xd7ca, 0xb8d8, 0xe5d9, 0xe3cf, 0x42f1, 0x43f1, 0x44f1, 0x45f1, 0x46f1, 0x47f1, 0x48f1, 0x49f1, 0x4af1, 0x4bf1, 0x4cf1, 0xa5f0, 0x4df1, 0x4ef1, 0xb0dc, 0x4ff1, 0x50f1, 0x51f1, 0x52f1, 0x53f1, 0x54f1, 0x55f1, 0x56f1, 0x57f1, 0x58f1, 0x59f1, 0x5af1, 0x5bf1, 0x5cf1, 0x5df1, 0x5ef1, 0x5ff1, 0x60f1, 0x61f1, 0x62f1, 0x63f1, 0x64f1, 0x65f1, 0x66f1, 0x67f1, 0x68f1, 0x69f1, 0x6af1, 0x6bf1, 0x6cf1, 0x6df1, 0x6ef1, 0x6ff1, 0x70f1, 0x71f1, 0x72f1, 0x73f1, 0x74f1, 0x75f1, 0x76f1, 0x77f1, 0x78f1, 0x79f1, 0x7af1, 0x7bf1, 0x7cf1, 0x7df1, 0x7ef1, 0x80f1, 0x81f1, 0x82f1, 0x83f1, 0x84f1, 0x85f1, 0x86f1, 0x87f1, 0x88f1, 0x89f1, 0x8af1, 0x8bf1, 0x8cf1, 0x8df1, 0x8ef1, 0x8ff1, 0x90f1, 0x91f1, 0x92f1, 0x93f1, 0x94f1, 0x95f1, 0x96f1, 0x97f1, 0x98f1, 0x99f1, 0x9af1, 0x9bf1, 0x9cf1, 0x9df1, 0x9ef1, 0x9ff1, 0xa0f1, 0x40f2, 0x41f2, 0x42f2, 0x43f2, 0x44f2, 0x45f2, 0x46f2, 0x47f2, 0x48f2, 0x49f2, 0x4af2, 0x4bf2, 0x4cf2, 0x4df2, 0x4ef2, 0x4ff2, 0x50f2, 0x51f2, 0x52f2, 0x53f2, 0x54f2, 0x55f2, 0x56f2, 0x57f2, 0x58f2, 0x59f2, 0x5af2, 0x5bf2, 0x5cf2, 0x5df2, 0x5ef2, 0x5ff2, 0x60f2, 0x61f2, 0x62f2, 0x63f2, 0x64f2, 0x65f2, 0x66f2, 0x67f2, 0x68f2, 0x69f2, 0x6af2, 0x6bf2, 0x6cf2, 0x6df2, 0x6ef2, 0x6ff2, 0x70f2, 0x71f2, 0x72f2, 0x73f2, 0x74f2, 0x75f2, 0x76f2, 0x77f2, 0x78f2, 0x79f2, 0x7af2, 0x7bf2, 0x7cf2, 0x7df2, 0x7ef2, 0x80f2, 0x81f2, 0x82f2, 0x83f2, 0x84f2, 0x85f2, 0x86f2, 0x87f2, 0x88f2, 0x89f2, 0x8af2, 0x8bf2, 0x8cf2, 0x8df2, 0x8ef2, 0x8ff2, 0x90f2, 0x91f2, 0x92f2, 0x93f2, 0x94f2, 0x95f2, 0x96f2, 0x97f2, 0x98f2, 0x99f2, 0x9af2, 0x9bf2, 0x9cf2, 0x9df2, 0x9ef2, 0x9ff2, 0xa0f2, 0x40f3, 0x41f3, 0x42f3, 0x43f3, 0x44f3, 0x45f3, 0x46f3, 0x47f3, 0x48f3, 0x49f3, 0x4af3, 0x4bf3, 0x4cf3, 0x4df3, 0x4ef3, 0x4ff3, 0x50f3, 0x51f3, 0xedc2, 0xa6d4, 0xd4cd, 0xb1d1, 0xdbb3, 0xfdc7, 0x52f3, 0xb5b2, 0xbfc2, 0xe0e6, 0xbbca, 0xe1e6, 0xe2e6, 0xd4be, 0xe3e6, 0xa4d7, 0xd5cd, 0xe5e6, 0xddbc, 0xe4e6, 0xe6e6, 0xe7e6, 0xeec2, 0x53f3, 0xbebd, 0xe8e6, 0xe6c2, 0xa7ba, 0xe9e6, 0x54f3, 0xeae6, 0xd2b3, 0xe9d1, 0x55f3, 0x56f3, 0xa5bf, 0xebe6, 0xefc6, 0xece6, 0xede6, 0x57f3, 0x58f3, 0xeee6, 0xadc6, 0xefe6, 0x59f3, 0xa7c9, 0xf0e6, 0xf1e6, 0xf2e6, 0xb9e5, 0xf3e6, 0xf4e6, 0xe2c2, 0xf5e6, 0xf6e6, 0xe8d6, 0xf7e6, 0x5af3, 0xf8e6, 0xc7b9, 0x5bf3, 0x5cf3, 0x5df3, 0x5ef3, 0x5ff3, 0x60f3, 0x61f3, 0xbbf7, 0xbaf7, 0x62f3, 0x63f3, 0x64f3, 0x65f3, 0xbef7, 0xbcf7, 0xa1ba, 0x66f3, 0xbff7, 0x67f3, 0xc0f7, 0x68f3, 0x69f3, 0x6af3, 0xc2f7, 0xc1f7, 0xc4f7, 0x6bf3, 0x6cf3, 0xc3f7, 0x6df3, 0x6ef3, 0x6ff3, 0x70f3, 0x71f3, 0xc5f7, 0xc6f7, 0x72f3, 0x73f3, 0x74f3, 0x75f3, 0xc7f7, 0x76f3, 0xe8cb, 0x77f3, 0x78f3, 0x79f3, 0x7af3, 0xdfb8, 0x7bf3, 0x7cf3, 0x7df3, 0x7ef3, 0x80f3, 0x81f3, 0xd4f7, 0x82f3, 0xd5f7, 0x83f3, 0x84f3, 0x85f3, 0x86f3, 0xd6f7, 0x87f3, 0x88f3, 0x89f3, 0x8af3, 0xd8f7, 0x8bf3, 0xdaf7, 0x8cf3, 0xd7f7, 0x8df3, 0x8ef3, 0x8ff3, 0x90f3, 0x91f3, 0x92f3, 0x93f3, 0x94f3, 0x95f3, 0xdbf7, 0x96f3, 0xd9f7, 0x97f3, 0x98f3, 0x99f3, 0x9af3, 0x9bf3, 0x9cf3, 0x9df3, 0xd7d7, 0x9ef3, 0x9ff3, 0xa0f3, 0x40f4, 0xdcf7, 0x41f4, 0x42f4, 0x43f4, 0x44f4, 0x45f4, 0x46f4, 0xddf7, 0x47f4, 0x48f4, 0x49f4, 0xdef7, 0x4af4, 0x4bf4, 0x4cf4, 0x4df4, 0x4ef4, 0x4ff4, 0x50f4, 0x51f4, 0x52f4, 0x53f4, 0x54f4, 0xdff7, 0x55f4, 0x56f4, 0x57f4, 0xe0f7, 0x58f4, 0x59f4, 0x5af4, 0x5bf4, 0x5cf4, 0x5df4, 0x5ef4, 0x5ff4, 0x60f4, 0x61f4, 0x62f4, 0xcbdb, 0x63f4, 0x64f4, 0xaad8, 0x65f4, 0x66f4, 0x67f4, 0x68f4, 0x69f4, 0x6af4, 0x6bf4, 0x6cf4, 0xf7e5, 0xedb9, 0x6df4, 0x6ef4, 0x6ff4, 0x70f4, 0xfdbf, 0xeabb, 0xc9f7, 0xc7c6, 0xc8f7, 0x71f4, 0xcaf7, 0xccf7, 0xcbf7, 0x72f4, 0x73f4, 0x74f4, 0xcdf7, 0x75f4, 0xbace, 0x76f4, 0xcef7, 0x77f4, 0x78f4, 0xa7c4, 0x79f4, 0x7af4, 0x7bf4, 0x7cf4, 0x7df4, 0x7ef4, 0x80f4, 0x81f4, 0x82f4, 0x83f4, 0x84f4, 0x85f4, 0x86f4, 0x87f4, 0x88f4, 0x89f4, 0x8af4, 0x8bf4, 0x8cf4, 0x8df4, 0x8ef4, 0x8ff4, 0x90f4, 0x91f4, 0x92f4, 0x93f4, 0x94f4, 0x95f4, 0x96f4, 0x97f4, 0x98f4, 0x99f4, 0x9af4, 0x9bf4, 0x9cf4, 0x9df4, 0x9ef4, 0x9ff4, 0xa0f4, 0x40f5, 0x41f5, 0x42f5, 0x43f5, 0x44f5, 0x45f5, 0x46f5, 0x47f5, 0x48f5, 0x49f5, 0x4af5, 0x4bf5, 0x4cf5, 0x4df5, 0x4ef5, 0x4ff5, 0x50f5, 0x51f5, 0x52f5, 0x53f5, 0x54f5, 0x55f5, 0x56f5, 0x57f5, 0x58f5, 0x59f5, 0x5af5, 0x5bf5, 0x5cf5, 0x5df5, 0x5ef5, 0x5ff5, 0x60f5, 0x61f5, 0x62f5, 0x63f5, 0x64f5, 0x65f5, 0x66f5, 0x67f5, 0x68f5, 0x69f5, 0x6af5, 0x6bf5, 0x6cf5, 0x6df5, 0x6ef5, 0x6ff5, 0x70f5, 0x71f5, 0x72f5, 0x73f5, 0x74f5, 0x75f5, 0x76f5, 0x77f5, 0x78f5, 0x79f5, 0x7af5, 0x7bf5, 0x7cf5, 0x7df5, 0x7ef5, 0x80f5, 0x81f5, 0x82f5, 0x83f5, 0x84f5, 0x85f5, 0x86f5, 0x87f5, 0x88f5, 0x89f5, 0x8af5, 0x8bf5, 0x8cf5, 0x8df5, 0x8ef5, 0x8ff5, 0x90f5, 0x91f5, 0x92f5, 0x93f5, 0x94f5, 0x95f5, 0x96f5, 0x97f5, 0x98f5, 0x99f5, 0x9af5, 0x9bf5, 0x9cf5, 0x9df5, 0x9ef5, 0x9ff5, 0xa0f5, 0x40f6, 0x41f6, 0x42f6, 0x43f6, 0x44f6, 0x45f6, 0x46f6, 0x47f6, 0x48f6, 0x49f6, 0x4af6, 0x4bf6, 0x4cf6, 0x4df6, 0x4ef6, 0x4ff6, 0x50f6, 0x51f6, 0x52f6, 0x53f6, 0x54f6, 0x55f6, 0x56f6, 0x57f6, 0x58f6, 0x59f6, 0x5af6, 0x5bf6, 0x5cf6, 0x5df6, 0x5ef6, 0x5ff6, 0x60f6, 0x61f6, 0x62f6, 0x63f6, 0x64f6, 0x65f6, 0x66f6, 0x67f6, 0x68f6, 0x69f6, 0x6af6, 0x6bf6, 0x6cf6, 0x6df6, 0x6ef6, 0x6ff6, 0x70f6, 0x71f6, 0x72f6, 0x73f6, 0x74f6, 0x75f6, 0x76f6, 0x77f6, 0x78f6, 0x79f6, 0x7af6, 0x7bf6, 0x7cf6, 0x7df6, 0x7ef6, 0x80f6, 0x81f6, 0x82f6, 0x83f6, 0x84f6, 0x85f6, 0x86f6, 0x87f6, 0x88f6, 0x89f6, 0x8af6, 0x8bf6, 0x8cf6, 0x8df6, 0x8ef6, 0x8ff6, 0x90f6, 0x91f6, 0x92f6, 0x93f6, 0x94f6, 0x95f6, 0x96f6, 0x97f6, 0x98f6, 0x99f6, 0x9af6, 0x9bf6, 0x9cf6, 0x9df6, 0x9ef6, 0x9ff6, 0xa0f6, 0x40f7, 0x41f7, 0x42f7, 0x43f7, 0x44f7, 0x45f7, 0x46f7, 0x47f7, 0x48f7, 0x49f7, 0x4af7, 0x4bf7, 0x4cf7, 0x4df7, 0x4ef7, 0x4ff7, 0x50f7, 0x51f7, 0x52f7, 0x53f7, 0x54f7, 0x55f7, 0x56f7, 0x57f7, 0x58f7, 0x59f7, 0x5af7, 0x5bf7, 0x5cf7, 0x5df7, 0x5ef7, 0x5ff7, 0x60f7, 0x61f7, 0x62f7, 0x63f7, 0x64f7, 0x65f7, 0x66f7, 0x67f7, 0x68f7, 0x69f7, 0x6af7, 0x6bf7, 0x6cf7, 0x6df7, 0x6ef7, 0x6ff7, 0x70f7, 0x71f7, 0x72f7, 0x73f7, 0x74f7, 0x75f7, 0x76f7, 0x77f7, 0x78f7, 0x79f7, 0x7af7, 0x7bf7, 0x7cf7, 0x7df7, 0x7ef7, 0x80f7, 0xe3d3, 0x81f7, 0x82f7, 0xcff6, 0x83f7, 0xb3c2, 0xd0f6, 0x84f7, 0x85f7, 0xd1f6, 0xd2f6, 0xd3f6, 0xd4f6, 0x86f7, 0x87f7, 0xd6f6, 0x88f7, 0xabb1, 0xd7f6, 0x89f7, 0xd8f6, 0xd9f6, 0xdaf6, 0x8af7, 0xdbf6, 0xdcf6, 0x8bf7, 0x8cf7, 0x8df7, 0x8ef7, 0xddf6, 0xdef6, 0xcacf, 0x8ff7, 0xdff6, 0xe0f6, 0xe1f6, 0xe2f6, 0xe3f6, 0xe4f6, 0xf0c0, 0xe5f6, 0xe6f6, 0xe7f6, 0xe8f6, 0xe9f6, 0x90f7, 0xeaf6, 0x91f7, 0xebf6, 0xecf6, 0x92f7, 0xedf6, 0xeef6, 0xeff6, 0xf0f6, 0xf1f6, 0xf2f6, 0xf3f6, 0xf4f6, 0xa8be, 0x93f7, 0xf5f6, 0xf6f6, 0xf7f6, 0xf8f6, 0x94f7, 0x95f7, 0x96f7, 0x97f7, 0x98f7, 0xfac8, 0xf9f6, 0xfaf6, 0xfbf6, 0xfcf6, 0x99f7, 0x9af7, 0xfdf6, 0xfef6, 0xa1f7, 0xa2f7, 0xa3f7, 0xa4f7, 0xa5f7, 0x9bf7, 0x9cf7, 0xa6f7, 0xa7f7, 0xa8f7, 0xeeb1, 0xa9f7, 0xaaf7, 0xabf7, 0x9df7, 0x9ef7, 0xacf7, 0xadf7, 0xdbc1, 0xaef7, 0x9ff7, 0xa0f7, 0xaff7, 0x40f8, 0x41f8, 0x42f8, 0x43f8, 0x44f8, 0x45f8, 0x46f8, 0x47f8, 0x48f8, 0x49f8, 0x4af8, 0x4bf8, 0x4cf8, 0x4df8, 0x4ef8, 0x4ff8, 0x50f8, 0x51f8, 0x52f8, 0x53f8, 0x54f8, 0x55f8, 0x56f8, 0x57f8, 0x58f8, 0x59f8, 0x5af8, 0x5bf8, 0x5cf8, 0x5df8, 0x5ef8, 0x5ff8, 0x60f8, 0x61f8, 0x62f8, 0x63f8, 0x64f8, 0x65f8, 0x66f8, 0x67f8, 0x68f8, 0x69f8, 0x6af8, 0x6bf8, 0x6cf8, 0x6df8, 0x6ef8, 0x6ff8, 0x70f8, 0x71f8, 0x72f8, 0x73f8, 0x74f8, 0x75f8, 0x76f8, 0x77f8, 0x78f8, 0x79f8, 0x7af8, 0x7bf8, 0x7cf8, 0x7df8, 0x7ef8, 0x80f8, 0x81f8, 0x82f8, 0x83f8, 0x84f8, 0x85f8, 0x86f8, 0x87f8, 0x88f8, 0x89f8, 0x8af8, 0x8bf8, 0x8cf8, 0x8df8, 0x8ef8, 0x8ff8, 0x90f8, 0x91f8, 0x92f8, 0x93f8, 0x94f8, 0x95f8, 0x96f8, 0x97f8, 0x98f8, 0x99f8, 0x9af8, 0x9bf8, 0x9cf8, 0x9df8, 0x9ef8, 0x9ff8, 0xa0f8, 0x40f9, 0x41f9, 0x42f9, 0x43f9, 0x44f9, 0x45f9, 0x46f9, 0x47f9, 0x48f9, 0x49f9, 0x4af9, 0x4bf9, 0x4cf9, 0x4df9, 0x4ef9, 0x4ff9, 0x50f9, 0x51f9, 0x52f9, 0x53f9, 0x54f9, 0x55f9, 0x56f9, 0x57f9, 0x58f9, 0x59f9, 0x5af9, 0x5bf9, 0x5cf9, 0x5df9, 0x5ef9, 0x5ff9, 0x60f9, 0x61f9, 0x62f9, 0x63f9, 0x64f9, 0x65f9, 0x66f9, 0x67f9, 0x68f9, 0x69f9, 0x6af9, 0x6bf9, 0x6cf9, 0x6df9, 0x6ef9, 0x6ff9, 0x70f9, 0x71f9, 0x72f9, 0x73f9, 0x74f9, 0x75f9, 0x76f9, 0x77f9, 0x78f9, 0x79f9, 0x7af9, 0x7bf9, 0x7cf9, 0x7df9, 0x7ef9, 0x80f9, 0x81f9, 0x82f9, 0x83f9, 0x84f9, 0x85f9, 0x86f9, 0x87f9, 0x88f9, 0x89f9, 0x8af9, 0x8bf9, 0x8cf9, 0x8df9, 0x8ef9, 0x8ff9, 0x90f9, 0x91f9, 0x92f9, 0x93f9, 0x94f9, 0x95f9, 0x96f9, 0x97f9, 0x98f9, 0x99f9, 0x9af9, 0x9bf9, 0x9cf9, 0x9df9, 0x9ef9, 0x9ff9, 0xa0f9, 0x40fa, 0x41fa, 0x42fa, 0x43fa, 0x44fa, 0x45fa, 0x46fa, 0x47fa, 0x48fa, 0x49fa, 0x4afa, 0x4bfa, 0x4cfa, 0x4dfa, 0x4efa, 0x4ffa, 0x50fa, 0x51fa, 0x52fa, 0x53fa, 0x54fa, 0x55fa, 0x56fa, 0x57fa, 0x58fa, 0x59fa, 0x5afa, 0x5bfa, 0x5cfa, 0x5dfa, 0x5efa, 0x5ffa, 0x60fa, 0x61fa, 0x62fa, 0x63fa, 0x64fa, 0x65fa, 0x66fa, 0x67fa, 0x68fa, 0x69fa, 0x6afa, 0x6bfa, 0x6cfa, 0x6dfa, 0x6efa, 0x6ffa, 0x70fa, 0x71fa, 0x72fa, 0x73fa, 0x74fa, 0x75fa, 0x76fa, 0x77fa, 0x78fa, 0x79fa, 0x7afa, 0x7bfa, 0x7cfa, 0x7dfa, 0x7efa, 0x80fa, 0x81fa, 0x82fa, 0x83fa, 0x84fa, 0x85fa, 0x86fa, 0x87fa, 0x88fa, 0x89fa, 0x8afa, 0x8bfa, 0x8cfa, 0x8dfa, 0x8efa, 0x8ffa, 0x90fa, 0x91fa, 0x92fa, 0x93fa, 0x94fa, 0x95fa, 0x96fa, 0x97fa, 0x98fa, 0x99fa, 0x9afa, 0x9bfa, 0x9cfa, 0x9dfa, 0x9efa, 0x9ffa, 0xa0fa, 0x40fb, 0x41fb, 0x42fb, 0x43fb, 0x44fb, 0x45fb, 0x46fb, 0x47fb, 0x48fb, 0x49fb, 0x4afb, 0x4bfb, 0x4cfb, 0x4dfb, 0x4efb, 0x4ffb, 0x50fb, 0x51fb, 0x52fb, 0x53fb, 0x54fb, 0x55fb, 0x56fb, 0x57fb, 0x58fb, 0x59fb, 0x5afb, 0x5bfb, 0xf1c4, 0xaff0, 0xa6bc, 0xb0f0, 0xf9c3, 0x5cfb, 0xb8c5, 0xbbd1, 0x5dfb, 0xb1f0, 0xb2f0, 0xb3f0, 0xb4f0, 0xb5f0, 0xbcd1, 0x5efb, 0xecd1, 0x5ffb, 0xb7f0, 0xb6f0, 0xa7d4, 0x60fb, 0xd2cd, 0xb8f0, 0xbaf0, 0xb9f0, 0xbbf0, 0xbcf0, 0x61fb, 0x62fb, 0xebb8, 0xbdf0, 0xe8ba, 0x63fb, 0xbef0, 0xbff0, 0xe9be, 0xc0f0, 0xecb6, 0xc1f0, 0xc2f0, 0xc3f0, 0xc4f0, 0xb5c8, 0xc5f0, 0xc6f0, 0x64fb, 0xc7f0, 0xf4c5, 0x65fb, 0xc8f0, 0x66fb, 0x67fb, 0x68fb, 0xc9f0, 0x69fb, 0xcaf0, 0xbdf7, 0x6afb, 0xcbf0, 0xccf0, 0xcdf0, 0x6bfb, 0xcef0, 0x6cfb, 0x6dfb, 0x6efb, 0x6ffb, 0xcff0, 0xd7ba, 0x70fb, 0xd0f0, 0xd1f0, 0xd2f0, 0xd3f0, 0xd4f0, 0xd5f0, 0xd6f0, 0xd8f0, 0x71fb, 0x72fb, 0xa5d3, 0xd7f0, 0x73fb, 0xd9f0, 0x74fb, 0x75fb, 0x76fb, 0x77fb, 0x78fb, 0x79fb, 0x7afb, 0x7bfb, 0x7cfb, 0x7dfb, 0xbaf5, 0xb9c2, 0x7efb, 0x80fb, 0xe4f7, 0x81fb, 0x82fb, 0x83fb, 0x84fb, 0xe5f7, 0xe6f7, 0x85fb, 0x86fb, 0xe7f7, 0x87fb, 0x88fb, 0x89fb, 0x8afb, 0x8bfb, 0x8cfb, 0xe8f7, 0xb4c2, 0x8dfb, 0x8efb, 0x8ffb, 0x90fb, 0x91fb, 0x92fb, 0x93fb, 0x94fb, 0x95fb, 0xeaf7, 0x96fb, 0xebf7, 0x97fb, 0x98fb, 0x99fb, 0x9afb, 0x9bfb, 0x9cfb, 0xf3c2, 0x9dfb, 0x9efb, 0x9ffb, 0xa0fb, 0x40fc, 0x41fc, 0x42fc, 0x43fc, 0x44fc, 0x45fc, 0x46fc, 0x47fc, 0x48fc, 0xf0f4, 0x49fc, 0x4afc, 0x4bfc, 0xeff4, 0x4cfc, 0x4dfc, 0xe9c2, 0x4efc, 0xe1f7, 0xe2f7, 0x4ffc, 0x50fc, 0x51fc, 0x52fc, 0x53fc, 0xc6bb, 0x54fc, 0x55fc, 0x56fc, 0x57fc, 0xe4d9, 0x58fc, 0x59fc, 0x5afc, 0xf2ca, 0xe8c0, 0xa4f0, 0x5bfc, 0xdaba, 0x5cfc, 0x5dfc, 0xadc7, 0x5efc, 0x5ffc, 0x60fc, 0xacc4, 0x61fc, 0x62fc, 0xecf7, 0xedf7, 0xeef7, 0x63fc, 0xf0f7, 0xeff7, 0x64fc, 0xf1f7, 0x65fc, 0x66fc, 0xf4f7, 0x67fc, 0xf3f7, 0x68fc, 0xf2f7, 0xf5f7, 0x69fc, 0x6afc, 0x6bfc, 0x6cfc, 0xf6f7, 0x6dfc, 0x6efc, 0x6ffc, 0x70fc, 0x71fc, 0x72fc, 0x73fc, 0x74fc, 0x75fc, 0xe9ed, 0x76fc, 0xeaed, 0xebed, 0x77fc, 0xbcf6, 0x78fc, 0x79fc, 0x7afc, 0x7bfc, 0x7cfc, 0x7dfc, 0x7efc, 0x80fc, 0x81fc, 0x82fc, 0x83fc, 0x84fc, 0xbdf6, 0x85fc, 0xbef6, 0xa6b6, 0x86fc, 0xbed8, 0x87fc, 0x88fc, 0xc4b9, 0x89fc, 0x8afc, 0x8bfc, 0xbbd8, 0x8cfc, 0xb1dc, 0x8dfc, 0x8efc, 0x8ffc, 0x90fc, 0x91fc, 0x92fc, 0xf3ca, 0x93fc, 0xf7f7, 0x94fc, 0x95fc, 0x96fc, 0x97fc, 0x98fc, 0x99fc, 0x9afc, 0x9bfc, 0x9cfc, 0xf8f7, 0x9dfc, 0x9efc, 0xf9f7, 0x9ffc, 0xa0fc, 0x40fd, 0x41fd, 0x42fd, 0x43fd, 0x44fd, 0xfbf7, 0x45fd, 0xfaf7, 0x46fd, 0xc7b1, 0x47fd, 0xfcf7, 0xfdf7, 0x48fd, 0x49fd, 0x4afd, 0x4bfd, 0x4cfd, 0xfef7, 0x4dfd, 0x4efd, 0x4ffd, 0x50fd, 0x51fd, 0x52fd, 0x53fd, 0x54fd, 0x55fd, 0x56fd, 0x57fd, 0xebc6, 0xb4ec, 0x58fd, 0x59fd, 0x5afd, 0x5bfd, 0x5cfd, 0x5dfd, 0x5efd, 0x5ffd, 0x60fd, 0x61fd, 0x62fd, 0x63fd, 0x64fd, 0x65fd, 0x66fd, 0x67fd, 0x68fd, 0x69fd, 0x6afd, 0x6bfd, 0x6cfd, 0x6dfd, 0x6efd, 0x6ffd, 0x70fd, 0x71fd, 0x72fd, 0x73fd, 0x74fd, 0x75fd, 0x76fd, 0x77fd, 0x78fd, 0x79fd, 0x7afd, 0x7bfd, 0x7cfd, 0x7dfd, 0x7efd, 0x80fd, 0x81fd, 0x82fd, 0x83fd, 0x84fd, 0x85fd, 0xddb3, 0xb3f6, 0x86fd, 0x87fd, 0xb4f6, 0xe4c1, 0xb5f6, 0xb6f6, 0xb7f6, 0xb8f6, 0xb9f6, 0xbaf6, 0xa3c8, 0xbbf6, 0x88fd, 0x89fd, 0x8afd, 0x8bfd, 0x8cfd, 0x8dfd, 0x8efd, 0x8ffd, 0x90fd, 0x91fd, 0x92fd, 0x93fd, 0xfac1, 0xa8b9, 0xe8ed, 0x94fd, 0x95fd, 0x96fd, 0xeab9, 0xdfd9, 0x97fd, 0x98fd, 0x99fd, 0x9afd, 0x9bfd }; const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0xf900[ 320 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9cfd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9dfd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9efd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9ffd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa0fd, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x40fe, 0x41fe, 0x42fe, 0x43fe, 0x001a, 0x44fe, 0x001a, 0x45fe, 0x46fe, 0x001a, 0x001a, 0x001a, 0x47fe, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x48fe, 0x49fe, 0x4afe, 0x001a, 0x4bfe, 0x4cfe, 0x001a, 0x001a, 0x4dfe, 0x4efe, 0x4ffe, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0xfe00[ 512 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x55a9, 0xf2a6, 0x001a, 0xf4a6, 0xf5a6, 0xe0a6, 0xe1a6, 0xf0a6, 0xf1a6, 0xe2a6, 0xe3a6, 0xeea6, 0xefa6, 0xe6a6, 0xe7a6, 0xe4a6, 0xe5a6, 0xe8a6, 0xe9a6, 0xeaa6, 0xeba6, 0x001a, 0x001a, 0x001a, 0x001a, 0x68a9, 0x69a9, 0x6aa9, 0x6ba9, 0x6ca9, 0x6da9, 0x6ea9, 0x6fa9, 0x70a9, 0x71a9, 0x001a, 0x72a9, 0x73a9, 0x74a9, 0x75a9, 0x001a, 0x76a9, 0x77a9, 0x78a9, 0x79a9, 0x7aa9, 0x7ba9, 0x7ca9, 0x7da9, 0x7ea9, 0x80a9, 0x81a9, 0x82a9, 0x83a9, 0x84a9, 0x001a, 0x85a9, 0x86a9, 0x87a9, 0x88a9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1a3, 0xa2a3, 0xa3a3, 0xe7a1, 0xa5a3, 0xa6a3, 0xa7a3, 0xa8a3, 0xa9a3, 0xaaa3, 0xaba3, 0xaca3, 0xada3, 0xaea3, 0xafa3, 0xb0a3, 0xb1a3, 0xb2a3, 0xb3a3, 0xb4a3, 0xb5a3, 0xb6a3, 0xb7a3, 0xb8a3, 0xb9a3, 0xbaa3, 0xbba3, 0xbca3, 0xbda3, 0xbea3, 0xbfa3, 0xc0a3, 0xc1a3, 0xc2a3, 0xc3a3, 0xc4a3, 0xc5a3, 0xc6a3, 0xc7a3, 0xc8a3, 0xc9a3, 0xcaa3, 0xcba3, 0xcca3, 0xcda3, 0xcea3, 0xcfa3, 0xd0a3, 0xd1a3, 0xd2a3, 0xd3a3, 0xd4a3, 0xd5a3, 0xd6a3, 0xd7a3, 0xd8a3, 0xd9a3, 0xdaa3, 0xdba3, 0xdca3, 0xdda3, 0xdea3, 0xdfa3, 0xe0a3, 0xe1a3, 0xe2a3, 0xe3a3, 0xe4a3, 0xe5a3, 0xe6a3, 0xe7a3, 0xe8a3, 0xe9a3, 0xeaa3, 0xeba3, 0xeca3, 0xeda3, 0xeea3, 0xefa3, 0xf0a3, 0xf1a3, 0xf2a3, 0xf3a3, 0xf4a3, 0xf5a3, 0xf6a3, 0xf7a3, 0xf8a3, 0xf9a3, 0xfaa3, 0xfba3, 0xfca3, 0xfda3, 0xaba1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9a1, 0xeaa1, 0x56a9, 0xfea3, 0x57a9, 0xa4a3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; /* Determines the size of a byte stream character from an Unicode character * Adds the size to the byte stream character size value * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_936_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_936_unicode_character_size_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream character size.", function ); return( -1 ); } if( unicode_character < 0x0080 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0480 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2340 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x2440 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2440; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x2440[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fa6 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xf900 ) && ( unicode_character < 0xfa40 ) ) { unicode_character -= 0xf900; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0xf900[ unicode_character ]; } else if( ( unicode_character >= 0xfe00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xfe00; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0xfe00[ unicode_character ]; } byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_character_size += 2; } else { *byte_stream_character_size += 1; } return( 1 ); } /* Copies an Unicode character from a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_936_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_936_copy_from_byte_stream"; uint8_t additional_character = 0; uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } byte_stream_character = byte_stream[ *byte_stream_index ]; if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else if( byte_stream_character == 0x80 ) { *unicode_character = 0x20ac; } else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) { *byte_stream_index += 1; additional_character = byte_stream[ *byte_stream_index ]; if( ( byte_stream_character >= 0x81 ) && ( byte_stream_character <= 0xa0 ) ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0x81: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8140[ additional_character ]; break; case 0x82: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8240[ additional_character ]; break; case 0x83: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8340[ additional_character ]; break; case 0x84: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8440[ additional_character ]; break; case 0x85: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8540[ additional_character ]; break; case 0x86: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8640[ additional_character ]; break; case 0x87: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8740[ additional_character ]; break; case 0x88: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8840[ additional_character ]; break; case 0x89: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8940[ additional_character ]; break; case 0x8a: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8a40[ additional_character ]; break; case 0x8b: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8b40[ additional_character ]; break; case 0x8c: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8c40[ additional_character ]; break; case 0x8d: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8d40[ additional_character ]; break; case 0x8e: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8e40[ additional_character ]; break; case 0x8f: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8f40[ additional_character ]; break; case 0x90: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9040[ additional_character ]; break; case 0x91: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9140[ additional_character ]; break; case 0x92: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9240[ additional_character ]; break; case 0x93: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9340[ additional_character ]; break; case 0x94: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9440[ additional_character ]; break; case 0x95: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9540[ additional_character ]; break; case 0x96: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9640[ additional_character ]; break; case 0x97: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9740[ additional_character ]; break; case 0x98: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9840[ additional_character ]; break; case 0x99: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9940[ additional_character ]; break; case 0x9a: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9a40[ additional_character ]; break; case 0x9b: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9b40[ additional_character ]; break; case 0x9c: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9c40[ additional_character ]; break; case 0x9d: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9d40[ additional_character ]; break; case 0x9e: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9e40[ additional_character ]; break; case 0x9f: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9f40[ additional_character ]; break; case 0xa0: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa040[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xa1 ) && ( byte_stream_character <= 0xa3 ) ) { if( additional_character >= 0xa0 ) { additional_character -= 0xa0; switch( byte_stream_character ) { case 0xa1: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa1a0[ additional_character ]; break; case 0xa2: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa2a0[ additional_character ]; break; case 0xa3: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa3a0[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xa4 ) && ( byte_stream_character <= 0xa6 ) ) { if( ( additional_character >= 0xa0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xa0; switch( byte_stream_character ) { case 0xa4: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa4a0[ additional_character ]; break; case 0xa5: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa5a0[ additional_character ]; break; case 0xa6: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa6a0[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa7 ) { if( ( additional_character >= 0xa0 ) && ( additional_character < 0xc8 ) ) { additional_character -= 0xa0; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7a0[ additional_character ]; } else if( ( additional_character >= 0xd0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xd0; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7d0[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa8 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x98 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa840[ additional_character ]; } else if( ( additional_character >= 0xa0 ) && ( additional_character < 0xf0 ) ) { additional_character -= 0xa0; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa8a0[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xa9 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x88 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa940[ additional_character ]; } else if( additional_character == 0x88 ) { *unicode_character = 0xfe6b; } else if( additional_character == 0x96 ) { *unicode_character = 0x3007; } else if( ( additional_character >= 0xa0 ) && ( additional_character < 0xf0 ) ) { additional_character -= 0xa0; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa9a0[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xaa ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaa40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x7371; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xab ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xab40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x73f7; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xac ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xac40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x747a; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xad ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xad40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x74f2; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xae ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xae40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x7587; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xaf ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaf40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x7644; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xb0 ) && ( byte_stream_character <= 0xf7 ) ) { if( additional_character >= 0x40 ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xb0: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb040[ additional_character ]; break; case 0xb1: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb140[ additional_character ]; break; case 0xb2: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb240[ additional_character ]; break; case 0xb3: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb340[ additional_character ]; break; case 0xb4: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb440[ additional_character ]; break; case 0xb5: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb540[ additional_character ]; break; case 0xb6: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb640[ additional_character ]; break; case 0xb7: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb740[ additional_character ]; break; case 0xb8: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb840[ additional_character ]; break; case 0xb9: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb940[ additional_character ]; break; case 0xba: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xba40[ additional_character ]; break; case 0xbb: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbb40[ additional_character ]; break; case 0xbc: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbc40[ additional_character ]; break; case 0xbd: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbd40[ additional_character ]; break; case 0xbe: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbe40[ additional_character ]; break; case 0xbf: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbf40[ additional_character ]; break; case 0xc0: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc040[ additional_character ]; break; case 0xc1: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc140[ additional_character ]; break; case 0xc2: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc240[ additional_character ]; break; case 0xc3: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc340[ additional_character ]; break; case 0xc4: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc440[ additional_character ]; break; case 0xc5: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc540[ additional_character ]; break; case 0xc6: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc640[ additional_character ]; break; case 0xc7: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc740[ additional_character ]; break; case 0xc8: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc840[ additional_character ]; break; case 0xc9: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc940[ additional_character ]; break; case 0xca: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xca40[ additional_character ]; break; case 0xcb: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcb40[ additional_character ]; break; case 0xcc: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcc40[ additional_character ]; break; case 0xcd: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcd40[ additional_character ]; break; case 0xce: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xce40[ additional_character ]; break; case 0xcf: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcf40[ additional_character ]; break; case 0xd0: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd040[ additional_character ]; break; case 0xd1: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd140[ additional_character ]; break; case 0xd2: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd240[ additional_character ]; break; case 0xd3: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd340[ additional_character ]; break; case 0xd4: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd440[ additional_character ]; break; case 0xd5: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd540[ additional_character ]; break; case 0xd6: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd640[ additional_character ]; break; case 0xd7: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd740[ additional_character ]; break; case 0xd8: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd840[ additional_character ]; break; case 0xd9: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd940[ additional_character ]; break; case 0xda: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xda40[ additional_character ]; break; case 0xdb: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdb40[ additional_character ]; break; case 0xdc: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdc40[ additional_character ]; break; case 0xdd: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdd40[ additional_character ]; break; case 0xde: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xde40[ additional_character ]; break; case 0xdf: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdf40[ additional_character ]; break; case 0xe0: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe040[ additional_character ]; break; case 0xe1: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe140[ additional_character ]; break; case 0xe2: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe240[ additional_character ]; break; case 0xe3: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe340[ additional_character ]; break; case 0xe4: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe440[ additional_character ]; break; case 0xe5: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe540[ additional_character ]; break; case 0xe6: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe640[ additional_character ]; break; case 0xe7: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe740[ additional_character ]; break; case 0xe8: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe840[ additional_character ]; break; case 0xe9: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe940[ additional_character ]; break; case 0xea: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xea40[ additional_character ]; break; case 0xeb: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xeb40[ additional_character ]; break; case 0xec: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xec40[ additional_character ]; break; case 0xed: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xed40[ additional_character ]; break; case 0xee: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xee40[ additional_character ]; break; case 0xef: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xef40[ additional_character ]; break; case 0xf0: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf040[ additional_character ]; break; case 0xf1: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf140[ additional_character ]; break; case 0xf2: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf240[ additional_character ]; break; case 0xf3: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf340[ additional_character ]; break; case 0xf4: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf440[ additional_character ]; break; case 0xf5: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf540[ additional_character ]; break; case 0xf6: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf640[ additional_character ]; break; case 0xf7: *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf740[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xf8 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf840[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x9d42; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xf9 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf940[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x9da2; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xfa ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfa40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x9e02; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xfb ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfb40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x9eaa; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xfc ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfc40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0x9f31; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xfd ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa0 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfd40[ additional_character ]; } else if( additional_character == 0xa0 ) { *unicode_character = 0xf9f1; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xfe ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x50 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfe40[ additional_character ]; } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } *byte_stream_index += 1; return( 1 ); } /* Copies an Unicode character to a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_936_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_936_copy_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } if( unicode_character < 0x0080 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0480 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2340 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x2440 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2440; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x2440[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fa6 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xf900 ) && ( unicode_character < 0xfa40 ) ) { unicode_character -= 0xf900; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0xf900[ unicode_character ]; } else if( ( unicode_character >= 0xfe00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xfe00; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0xfe00[ unicode_character ]; } byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_index += 1; byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); } *byte_stream_index += 1; return( 1 ); } libewf-20140807/libuna/libuna_unicode_character.c0000664000175000017500000041777213443450072023767 0ustar00lordyestalordyesta00000000000000/* * Unicode character functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_base64_stream.h" #include "libuna_codepage_iso_8859_2.h" #include "libuna_codepage_iso_8859_3.h" #include "libuna_codepage_iso_8859_4.h" #include "libuna_codepage_iso_8859_5.h" #include "libuna_codepage_iso_8859_6.h" #include "libuna_codepage_iso_8859_7.h" #include "libuna_codepage_iso_8859_8.h" #include "libuna_codepage_iso_8859_9.h" #include "libuna_codepage_iso_8859_10.h" #include "libuna_codepage_iso_8859_13.h" #include "libuna_codepage_iso_8859_14.h" #include "libuna_codepage_iso_8859_15.h" #include "libuna_codepage_iso_8859_16.h" #include "libuna_codepage_koi8_r.h" #include "libuna_codepage_koi8_u.h" #include "libuna_codepage_windows_874.h" #include "libuna_codepage_windows_932.h" #include "libuna_codepage_windows_936.h" #include "libuna_codepage_windows_949.h" #include "libuna_codepage_windows_950.h" #include "libuna_codepage_windows_1250.h" #include "libuna_codepage_windows_1251.h" #include "libuna_codepage_windows_1252.h" #include "libuna_codepage_windows_1253.h" #include "libuna_codepage_windows_1254.h" #include "libuna_codepage_windows_1255.h" #include "libuna_codepage_windows_1256.h" #include "libuna_codepage_windows_1257.h" #include "libuna_codepage_windows_1258.h" #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_unused.h" /* Valid directly encoded characters: A-Z, a-z, 0-9, '\', '(', ')', ',', '-', '.', '/', ':', '?' * Valid directly encoded whitespace: '\t', '\n', '\r', ' ' * Valid optional directly encoded characters: '!', '"', '#', '$', '%', '&', '*', ';', '<', '=', '>', '@', '[', ']', '^', '_', '`', '{', '|', '}' */ uint8_t libuna_unicode_character_utf7_valid_directly_encoded_character[ 256 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* Valid UTF-7 base64 characters: A-Z, a-z, 0-9, '+' and '/' */ uint8_t libuna_unicode_character_utf7_valid_base64_character[ 256 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* Determines the size of a byte stream character from an Unicode character * Adds the size to the byte stream character size value * Returns 1 if successful or -1 on error */ int libuna_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, int codepage, size_t *byte_stream_character_size, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_size_to_byte_stream"; int result = 1; if( byte_stream_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream character size.", function ); return( -1 ); } switch( codepage ) { case LIBUNA_CODEPAGE_ASCII: case LIBUNA_CODEPAGE_ISO_8859_1: case LIBUNA_CODEPAGE_ISO_8859_2: case LIBUNA_CODEPAGE_ISO_8859_3: case LIBUNA_CODEPAGE_ISO_8859_4: case LIBUNA_CODEPAGE_ISO_8859_5: case LIBUNA_CODEPAGE_ISO_8859_6: case LIBUNA_CODEPAGE_ISO_8859_7: case LIBUNA_CODEPAGE_ISO_8859_8: case LIBUNA_CODEPAGE_ISO_8859_9: case LIBUNA_CODEPAGE_ISO_8859_10: case LIBUNA_CODEPAGE_ISO_8859_11: case LIBUNA_CODEPAGE_ISO_8859_13: case LIBUNA_CODEPAGE_ISO_8859_14: case LIBUNA_CODEPAGE_ISO_8859_15: case LIBUNA_CODEPAGE_ISO_8859_16: case LIBUNA_CODEPAGE_KOI8_R: case LIBUNA_CODEPAGE_KOI8_U: case LIBUNA_CODEPAGE_WINDOWS_874: case LIBUNA_CODEPAGE_WINDOWS_1250: case LIBUNA_CODEPAGE_WINDOWS_1251: case LIBUNA_CODEPAGE_WINDOWS_1252: case LIBUNA_CODEPAGE_WINDOWS_1253: case LIBUNA_CODEPAGE_WINDOWS_1254: case LIBUNA_CODEPAGE_WINDOWS_1255: case LIBUNA_CODEPAGE_WINDOWS_1256: case LIBUNA_CODEPAGE_WINDOWS_1257: case LIBUNA_CODEPAGE_WINDOWS_1258: *byte_stream_character_size += 1; break; case LIBUNA_CODEPAGE_WINDOWS_932: result = libuna_codepage_windows_932_unicode_character_size_to_byte_stream( unicode_character, byte_stream_character_size, error ); break; case LIBUNA_CODEPAGE_WINDOWS_936: result = libuna_codepage_windows_936_unicode_character_size_to_byte_stream( unicode_character, byte_stream_character_size, error ); break; case LIBUNA_CODEPAGE_WINDOWS_949: result = libuna_codepage_windows_949_unicode_character_size_to_byte_stream( unicode_character, byte_stream_character_size, error ); break; case LIBUNA_CODEPAGE_WINDOWS_950: result = libuna_codepage_windows_950_unicode_character_size_to_byte_stream( unicode_character, byte_stream_character_size, error ); break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported codepage: %d.", function, codepage ); return( -1 ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine byte stream character size.", function ); return( -1 ); } return( result ); } /* Copies an Unicode character from a byte stream * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, int codepage, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_byte_stream"; uint8_t byte_stream_character = 0; int result = 1; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } byte_stream_character = byte_stream[ *byte_stream_index ]; switch( codepage ) { case LIBUNA_CODEPAGE_ASCII: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { *unicode_character = 0xfffd; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_1: *unicode_character = byte_stream_character; *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_2: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_3: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_4: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_5: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_6: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_7: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_8: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_9: if( byte_stream_character < 0xd0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xd0; *unicode_character = libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_10: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_11: if( byte_stream_character < 0xa1 ) { *unicode_character = byte_stream_character; } else if( byte_stream_character < 0xdb ) { *unicode_character = byte_stream_character + 0x0d60; } else if( byte_stream_character < 0xdf ) { *unicode_character = 0xfffd; } else if( byte_stream_character < 0xfc ) { *unicode_character = byte_stream_character + 0x0d60; } else { *unicode_character = 0xfffd; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_13: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_14: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_15: if( ( byte_stream_character >= 0xa0 ) && ( byte_stream_character < 0xc0 ) ) { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } else { *unicode_character = byte_stream_character; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_16: if( byte_stream_character < 0xa0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; *unicode_character = libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_KOI8_R: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_KOI8_U: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_874: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_932: result = libuna_codepage_windows_932_copy_from_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_936: result = libuna_codepage_windows_936_copy_from_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_949: result = libuna_codepage_windows_949_copy_from_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_950: result = libuna_codepage_windows_950_copy_from_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_1250: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1251: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1252: if( ( byte_stream_character < 0x80 ) || ( byte_stream_character >= 0xa0 ) ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1253: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1254: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else if( byte_stream_character < 0xa0 ) { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } else if( byte_stream_character < 0xd0 ) { *unicode_character = byte_stream_character; } else if( byte_stream_character < 0xe0 ) { byte_stream_character -= 0xd0; *unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xd0[ byte_stream_character ]; } else if( byte_stream_character < 0xf0 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0xf0; *unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xf0[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1255: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1256: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1257: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1258: if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else { byte_stream_character -= 0x80; *unicode_character = libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; } *byte_stream_index += 1; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported codepage: %d.", function, codepage ); return( -1 ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } return( result ); } /* Copies an Unicode character to a byte stream * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, int codepage, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_byte_stream"; int result = 1; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } switch( codepage ) { case LIBUNA_CODEPAGE_ASCII: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else { byte_stream[ *byte_stream_index ] = 0x1a; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_1: if( unicode_character < 0x0100 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else { byte_stream[ *byte_stream_index ] = 0x1a; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_2: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0120 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0138 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0138; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ unicode_character ]; } else if( ( unicode_character >= 0x02d8 ) && ( unicode_character < 0x02e0 ) ) { unicode_character -= 0x02d8; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ unicode_character ]; } else if( unicode_character == 0x02c7 ) { byte_stream[ *byte_stream_index ] = 0xb7; } else { byte_stream[ *byte_stream_index ] = 0x1a; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_3: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0108 ) && ( unicode_character < 0x0110 ) ) { unicode_character -= 0x0108; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ unicode_character ]; } else if( ( unicode_character >= 0x0118 ) && ( unicode_character < 0x0128 ) ) { unicode_character -= 0x0118; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ unicode_character ]; } else if( ( unicode_character >= 0x0130 ) && ( unicode_character < 0x0138 ) ) { unicode_character -= 0x0130; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ unicode_character ]; } else if( ( unicode_character >= 0x0158 ) && ( unicode_character < 0x0160 ) ) { unicode_character -= 0x0158; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ unicode_character ]; } else switch( unicode_character ) { case 0x016c: byte_stream[ *byte_stream_index ] = 0xdd; break; case 0x016d: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x017b: byte_stream[ *byte_stream_index ] = 0xaf; break; case 0x017c: byte_stream[ *byte_stream_index ] = 0xbf; break; case 0x02d8: byte_stream[ *byte_stream_index ] = 0xa2; break; case 0x02d9: byte_stream[ *byte_stream_index ] = 0xff; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_4: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0158 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0160 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0160; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ unicode_character ]; } else switch( unicode_character ) { case 0x02c7: byte_stream[ *byte_stream_index ] = 0xb7; break; case 0x02d9: byte_stream[ *byte_stream_index ] = 0xff; break; case 0x02db: byte_stream[ *byte_stream_index ] = 0xb2; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_5: if( unicode_character < 0x00a1 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0400 ) && ( unicode_character < 0x0460 ) ) { unicode_character -= 0x0400; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ unicode_character ]; } else switch( unicode_character ) { case 0x00a7: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x00ad: byte_stream[ *byte_stream_index ] = 0xad; break; case 0x2116: byte_stream[ *byte_stream_index ] = 0xf0; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_6: if( unicode_character < 0x00a1 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0618 ) && ( unicode_character < 0x658 ) ) { unicode_character -= 0x0618; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ unicode_character ]; } else switch( unicode_character ) { case 0x00a4: byte_stream[ *byte_stream_index ] = 0xa4; break; case 0x00ad: byte_stream[ *byte_stream_index ] = 0xad; break; case 0x060c: byte_stream[ *byte_stream_index ] = 0xac; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_7: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00b8 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0380 ) && ( unicode_character < 0x03d0 ) ) { unicode_character -= 0x0380; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ unicode_character ]; } else switch( unicode_character ) { case 0x00bb: byte_stream[ *byte_stream_index ] = 0xbb; break; case 0x00bd: byte_stream[ *byte_stream_index ] = 0xbd; break; case 0x037a: byte_stream[ *byte_stream_index ] = 0xaa; break; case 0x2015: byte_stream[ *byte_stream_index ] = 0xaf; break; case 0x2018: byte_stream[ *byte_stream_index ] = 0xa1; break; case 0x2019: byte_stream[ *byte_stream_index ] = 0xa2; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0xa4; break; case 0x20af: byte_stream[ *byte_stream_index ] = 0xa5; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_8: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x05d0 ) && ( unicode_character < 0x05f0 ) ) { unicode_character -= 0x05d0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ unicode_character ]; } else switch( unicode_character ) { case 0x00d7: byte_stream[ *byte_stream_index ] = 0xaa; break; case 0x00f7: byte_stream[ *byte_stream_index ] = 0xba; break; case 0x200e: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x200f: byte_stream[ *byte_stream_index ] = 0xfe; break; case 0x2017: byte_stream[ *byte_stream_index ] = 0xdf; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_9: if( unicode_character < 0x00d0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00d0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00d0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ unicode_character ]; } else switch( unicode_character ) { case 0x011e: byte_stream[ *byte_stream_index ] = 0xd0; break; case 0x011f: byte_stream[ *byte_stream_index ] = 0xf0; break; case 0x0130: byte_stream[ *byte_stream_index ] = 0xdd; break; case 0x0131: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x015e: byte_stream[ *byte_stream_index ] = 0xde; break; case 0x015f: byte_stream[ *byte_stream_index ] = 0xfe; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_10: if( unicode_character < 0x00a1 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00c0 ) && ( unicode_character < 0x0150 ) ) { unicode_character -= 0x00c0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; } else if( ( unicode_character >= 0x0160 ) && ( unicode_character < 0x0170 ) ) { unicode_character -= 0x0160; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ unicode_character ]; } else switch( unicode_character ) { case 0x00a7: byte_stream[ *byte_stream_index ] = 0xa7; break; case 0x00ad: byte_stream[ *byte_stream_index ] = 0xad; break; case 0x00b0: byte_stream[ *byte_stream_index ] = 0xb0; break; case 0x00b7: byte_stream[ *byte_stream_index ] = 0xb7; break; case 0x0172: byte_stream[ *byte_stream_index ] = 0xd9; break; case 0x0173: byte_stream[ *byte_stream_index ] = 0xf9; break; case 0x017d: byte_stream[ *byte_stream_index ] = 0xac; break; case 0x017e: byte_stream[ *byte_stream_index ] = 0xbc; break; case 0x2015: byte_stream[ *byte_stream_index ] = 0xbd; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_11: if( unicode_character < 0x00a1 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0e01 ) && ( unicode_character < 0x0e3b ) ) { byte_stream[ *byte_stream_index ] = (uint8_t) ( unicode_character - 0x0d60 ); } else if( ( unicode_character >= 0x0e3f ) && ( unicode_character < 0x0e5c ) ) { byte_stream[ *byte_stream_index ] = (uint8_t) ( unicode_character - 0x0d60 ); } else { byte_stream[ *byte_stream_index ] = 0x1a; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_13: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x2018 ) && ( unicode_character < 0x2020 ) ) { unicode_character -= 0x2018; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ unicode_character ]; } else { byte_stream[ *byte_stream_index ] = 0x1a; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_14: if( unicode_character < 0x00a1 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00c0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00c0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; } else if( ( unicode_character >= 0x0170 ) && ( unicode_character < 0x0178 ) ) { unicode_character -= 0x0170; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ unicode_character ]; } else if( ( unicode_character >= 0x1e80 ) && ( unicode_character < 0x1e88 ) ) { unicode_character -= 0x1e80; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ unicode_character ]; } else switch( unicode_character ) { case 0x00a3: byte_stream[ *byte_stream_index ] = 0xa3; break; case 0x00a7: byte_stream[ *byte_stream_index ] = 0xa7; break; case 0x00a9: byte_stream[ *byte_stream_index ] = 0xa9; break; case 0x00ad: byte_stream[ *byte_stream_index ] = 0xad; break; case 0x00ae: byte_stream[ *byte_stream_index ] = 0xae; break; case 0x00b6: byte_stream[ *byte_stream_index ] = 0xb6; break; case 0x010a: byte_stream[ *byte_stream_index ] = 0xa4; break; case 0x010b: byte_stream[ *byte_stream_index ] = 0xa5; break; case 0x0120: byte_stream[ *byte_stream_index ] = 0xb2; break; case 0x0121: byte_stream[ *byte_stream_index ] = 0xb3; break; case 0x0178: byte_stream[ *byte_stream_index ] = 0xaf; break; case 0x1e02: byte_stream[ *byte_stream_index ] = 0xa1; break; case 0x1e03: byte_stream[ *byte_stream_index ] = 0xa2; break; case 0x1e0a: byte_stream[ *byte_stream_index ] = 0xa6; break; case 0x1e0b: byte_stream[ *byte_stream_index ] = 0xab; break; case 0x1e1e: byte_stream[ *byte_stream_index ] = 0xb0; break; case 0x1e1f: byte_stream[ *byte_stream_index ] = 0xb1; break; case 0x1e40: byte_stream[ *byte_stream_index ] = 0xb4; break; case 0x1e41: byte_stream[ *byte_stream_index ] = 0xb5; break; case 0x1e56: byte_stream[ *byte_stream_index ] = 0xb7; break; case 0x1e57: byte_stream[ *byte_stream_index ] = 0xb9; break; case 0x1e60: byte_stream[ *byte_stream_index ] = 0xbb; break; case 0x1e61: byte_stream[ *byte_stream_index ] = 0xbf; break; case 0x1e6a: byte_stream[ *byte_stream_index ] = 0xd7; break; case 0x1e6b: byte_stream[ *byte_stream_index ] = 0xf7; break; case 0x1ef2: byte_stream[ *byte_stream_index ] = 0xac; break; case 0x1ef3: byte_stream[ *byte_stream_index ] = 0xbc; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_15: if( unicode_character < 0x00a0 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( unicode_character < 0x0100 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else switch( unicode_character ) { case 0x0152: byte_stream[ *byte_stream_index ] = 0xbc; break; case 0x0153: byte_stream[ *byte_stream_index ] = 0xbd; break; case 0x0160: byte_stream[ *byte_stream_index ] = 0xa6; break; case 0x0161: byte_stream[ *byte_stream_index ] = 0xa8; break; case 0x0178: byte_stream[ *byte_stream_index ] = 0xbe; break; case 0x017d: byte_stream[ *byte_stream_index ] = 0xb4; break; case 0x017e: byte_stream[ *byte_stream_index ] = 0xb8; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0xa4; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_16: if( unicode_character < 0x00a1 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a8 ) && ( unicode_character < 0x0108 ) ) { unicode_character -= 0x00a8; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ unicode_character ]; } else if( ( unicode_character >= 0x0140 ) && ( unicode_character < 0x0148 ) ) { unicode_character -= 0x0140; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ unicode_character ]; } else if( ( unicode_character >= 0x0150 ) && ( unicode_character < 0x0158 ) ) { unicode_character -= 0x0150; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ unicode_character ]; } else if( ( unicode_character >= 0x0178 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0178; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ unicode_character ]; } else if( ( unicode_character >= 0x0218 ) && ( unicode_character < 0x0220 ) ) { unicode_character -= 0x0218; byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ unicode_character ]; } else switch( unicode_character ) { case 0x00a7: byte_stream[ *byte_stream_index ] = 0xa7; break; case 0x010c: byte_stream[ *byte_stream_index ] = 0xb2; break; case 0x010d: byte_stream[ *byte_stream_index ] = 0xb9; break; case 0x0110: byte_stream[ *byte_stream_index ] = 0xd0; break; case 0x0111: byte_stream[ *byte_stream_index ] = 0xf0; break; case 0x0118: byte_stream[ *byte_stream_index ] = 0xdd; break; case 0x0119: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x015a: byte_stream[ *byte_stream_index ] = 0xd7; break; case 0x015b: byte_stream[ *byte_stream_index ] = 0xf7; break; case 0x0160: byte_stream[ *byte_stream_index ] = 0xa6; break; case 0x0161: byte_stream[ *byte_stream_index ] = 0xa8; break; case 0x0170: byte_stream[ *byte_stream_index ] = 0xd8; break; case 0x0171: byte_stream[ *byte_stream_index ] = 0xf8; break; case 0x201d: byte_stream[ *byte_stream_index ] = 0xb5; break; case 0x201e: byte_stream[ *byte_stream_index ] = 0xa5; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0xa4; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_KOI8_R: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0410 ) && ( unicode_character < 0x0450 ) ) { unicode_character -= 0x0410; byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ unicode_character ]; } else if( ( unicode_character >= 0x2550 ) && ( unicode_character < 0x2570 ) ) { unicode_character -= 0x2550; byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x2550[ unicode_character ]; } else switch( unicode_character ) { case 0x00a0: byte_stream[ *byte_stream_index ] = 0x9a; break; case 0x00a9: byte_stream[ *byte_stream_index ] = 0xbf; break; case 0x00b0: byte_stream[ *byte_stream_index ] = 0x9c; break; case 0x00b2: byte_stream[ *byte_stream_index ] = 0x9d; break; case 0x00b7: byte_stream[ *byte_stream_index ] = 0x9e; break; case 0x00f7: byte_stream[ *byte_stream_index ] = 0x9f; break; case 0x0401: byte_stream[ *byte_stream_index ] = 0xb3; break; case 0x0451: byte_stream[ *byte_stream_index ] = 0xa3; break; case 0x2219: byte_stream[ *byte_stream_index ] = 0x95; break; case 0x221a: byte_stream[ *byte_stream_index ] = 0x96; break; case 0x2248: byte_stream[ *byte_stream_index ] = 0x97; break; case 0x2264: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x2265: byte_stream[ *byte_stream_index ] = 0x99; break; case 0x2320: byte_stream[ *byte_stream_index ] = 0x93; break; case 0x2321: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x2500: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2502: byte_stream[ *byte_stream_index ] = 0x81; break; case 0x250c: byte_stream[ *byte_stream_index ] = 0x82; break; case 0x2510: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x2514: byte_stream[ *byte_stream_index ] = 0x84; break; case 0x2518: byte_stream[ *byte_stream_index ] = 0x85; break; case 0x251c: byte_stream[ *byte_stream_index ] = 0x86; break; case 0x2524: byte_stream[ *byte_stream_index ] = 0x87; break; case 0x252c: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x2534: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x253c: byte_stream[ *byte_stream_index ] = 0x8a; break; case 0x2580: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x2584: byte_stream[ *byte_stream_index ] = 0x8c; break; case 0x2588: byte_stream[ *byte_stream_index ] = 0x8d; break; case 0x258c: byte_stream[ *byte_stream_index ] = 0x8e; break; case 0x2590: byte_stream[ *byte_stream_index ] = 0x8f; break; case 0x2591: byte_stream[ *byte_stream_index ] = 0x90; break; case 0x2592: byte_stream[ *byte_stream_index ] = 0x91; break; case 0x2593: byte_stream[ *byte_stream_index ] = 0x92; break; case 0x25a0: byte_stream[ *byte_stream_index ] = 0x94; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_KOI8_U: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0410 ) && ( unicode_character < 0x0450 ) ) { unicode_character -= 0x0410; byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ unicode_character ]; } else if( ( unicode_character >= 0x2550 ) && ( unicode_character < 0x2570 ) ) { unicode_character -= 0x2550; byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x2550[ unicode_character ]; } else switch( unicode_character ) { case 0x00a0: byte_stream[ *byte_stream_index ] = 0x9a; break; case 0x00a9: byte_stream[ *byte_stream_index ] = 0xbf; break; case 0x00b0: byte_stream[ *byte_stream_index ] = 0x9c; break; case 0x00b2: byte_stream[ *byte_stream_index ] = 0x9d; break; case 0x00b7: byte_stream[ *byte_stream_index ] = 0x9e; break; case 0x00f7: byte_stream[ *byte_stream_index ] = 0x9f; break; case 0x0401: byte_stream[ *byte_stream_index ] = 0xb3; break; case 0x0404: byte_stream[ *byte_stream_index ] = 0xb4; break; case 0x0406: byte_stream[ *byte_stream_index ] = 0xb6; break; case 0x0407: byte_stream[ *byte_stream_index ] = 0xb7; break; case 0x0451: byte_stream[ *byte_stream_index ] = 0xa3; break; case 0x0454: byte_stream[ *byte_stream_index ] = 0xa4; break; case 0x0456: byte_stream[ *byte_stream_index ] = 0xa6; break; case 0x0457: byte_stream[ *byte_stream_index ] = 0xa7; break; case 0x0490: byte_stream[ *byte_stream_index ] = 0xbd; break; case 0x0491: byte_stream[ *byte_stream_index ] = 0xad; break; case 0x2219: byte_stream[ *byte_stream_index ] = 0x95; break; case 0x221a: byte_stream[ *byte_stream_index ] = 0x96; break; case 0x2248: byte_stream[ *byte_stream_index ] = 0x97; break; case 0x2264: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x2265: byte_stream[ *byte_stream_index ] = 0x99; break; case 0x2320: byte_stream[ *byte_stream_index ] = 0x93; break; case 0x2321: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x2500: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2502: byte_stream[ *byte_stream_index ] = 0x81; break; case 0x250c: byte_stream[ *byte_stream_index ] = 0x82; break; case 0x2510: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x2514: byte_stream[ *byte_stream_index ] = 0x84; break; case 0x2518: byte_stream[ *byte_stream_index ] = 0x85; break; case 0x251c: byte_stream[ *byte_stream_index ] = 0x86; break; case 0x2524: byte_stream[ *byte_stream_index ] = 0x87; break; case 0x252c: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x2534: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x253c: byte_stream[ *byte_stream_index ] = 0x8a; break; case 0x2580: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x2584: byte_stream[ *byte_stream_index ] = 0x8c; break; case 0x2588: byte_stream[ *byte_stream_index ] = 0x8d; break; case 0x258c: byte_stream[ *byte_stream_index ] = 0x8e; break; case 0x2590: byte_stream[ *byte_stream_index ] = 0x8f; break; case 0x2591: byte_stream[ *byte_stream_index ] = 0x90; break; case 0x2592: byte_stream[ *byte_stream_index ] = 0x91; break; case 0x2593: byte_stream[ *byte_stream_index ] = 0x92; break; case 0x25a0: byte_stream[ *byte_stream_index ] = 0x94; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_874: if( ( unicode_character < 0x0080 ) || ( unicode_character == 0x00a0 ) ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0e00 ) && ( unicode_character < 0x0e60 ) ) { unicode_character -= 0x0e00; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ unicode_character ]; } else if( ( unicode_character >= 0x2018 ) && ( unicode_character < 0x2020 ) ) { unicode_character -= 0x2018; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_874_unicode_to_byte_stream_base_0x2018[ unicode_character ]; } else switch( unicode_character ) { case 0x2013: byte_stream[ *byte_stream_index ] = 0x96; break; case 0x2014: byte_stream[ *byte_stream_index ] = 0x97; break; case 0x2022: byte_stream[ *byte_stream_index ] = 0x95; break; case 0x2026: byte_stream[ *byte_stream_index ] = 0x85; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_932: result = libuna_codepage_windows_932_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_936: result = libuna_codepage_windows_936_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_949: result = libuna_codepage_windows_949_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_950: result = libuna_codepage_windows_950_copy_to_byte_stream( unicode_character, byte_stream, byte_stream_size, byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_1250: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0120 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0138 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0138; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x0138[ unicode_character ]; } else if( ( unicode_character >= 0x02d8 ) && ( unicode_character < 0x02e0 ) ) { unicode_character -= 0x02d8; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x02d8[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else if( ( unicode_character >= 0x2030 ) && ( unicode_character < 0x2040 ) ) { unicode_character -= 0x2030; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2030[ unicode_character ]; } else switch( unicode_character ) { case 0x02c7: byte_stream[ *byte_stream_index ] = 0xa1; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1251: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0400 ) && ( unicode_character < 0x0460 ) ) { unicode_character -= 0x0400; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x0400[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x0490: byte_stream[ *byte_stream_index ] = 0xa5; break; case 0x0491: byte_stream[ *byte_stream_index ] = 0xb4; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x2116: byte_stream[ *byte_stream_index ] = 0xb9; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1252: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0100 ) ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x0152: byte_stream[ *byte_stream_index ] = 0x8c; break; case 0x0153: byte_stream[ *byte_stream_index ] = 0x9c; break; case 0x0160: byte_stream[ *byte_stream_index ] = 0x8a; break; case 0x0161: byte_stream[ *byte_stream_index ] = 0x9a; break; case 0x0178: byte_stream[ *byte_stream_index ] = 0x9f; break; case 0x017d: byte_stream[ *byte_stream_index ] = 0x8e; break; case 0x017e: byte_stream[ *byte_stream_index ] = 0x9e; break; case 0x0192: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x02c6: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x02dc: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1253: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0380 ) && ( unicode_character < 0x03d0 ) ) { unicode_character -= 0x0380; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x0380[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x0192: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1254: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00d0 ) ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00d0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00d0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x011e: byte_stream[ *byte_stream_index ] = 0xd0; break; case 0x011f: byte_stream[ *byte_stream_index ] = 0xf0; break; case 0x0130: byte_stream[ *byte_stream_index ] = 0xdd; break; case 0x0131: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x0152: byte_stream[ *byte_stream_index ] = 0x8c; break; case 0x0153: byte_stream[ *byte_stream_index ] = 0x9c; break; case 0x015e: byte_stream[ *byte_stream_index ] = 0xde; break; case 0x015f: byte_stream[ *byte_stream_index ] = 0xfe; break; case 0x0160: byte_stream[ *byte_stream_index ] = 0x8a; break; case 0x0161: byte_stream[ *byte_stream_index ] = 0x9a; break; case 0x0178: byte_stream[ *byte_stream_index ] = 0x9f; break; case 0x0192: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x02c6: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x02dc: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1255: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x05b0 ) && ( unicode_character < 0x05c8 ) ) { unicode_character -= 0x05b0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05b0[ unicode_character ]; } else if( ( unicode_character >= 0x05d0 ) && ( unicode_character < 0x05f8 ) ) { unicode_character -= 0x05d0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05d0[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x00d7: byte_stream[ *byte_stream_index ] = 0xaa; break; case 0x00f7: byte_stream[ *byte_stream_index ] = 0xba; break; case 0x0192: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x02c6: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x02dc: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x200e: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x200f: byte_stream[ *byte_stream_index ] = 0xfe; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20aa: byte_stream[ *byte_stream_index ] = 0xa4; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1256: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x00e0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00e0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00e0[ unicode_character ]; } else if( ( unicode_character >= 0x0618 ) && ( unicode_character < 0x0658 ) ) { unicode_character -= 0x0618; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x0618[ unicode_character ]; } else if( ( unicode_character >= 0x2008 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2008; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x2008[ unicode_character ]; } else switch( unicode_character ) { case 0x00d7: byte_stream[ *byte_stream_index ] = 0xd7; break; case 0x0152: byte_stream[ *byte_stream_index ] = 0x8c; break; case 0x0153: byte_stream[ *byte_stream_index ] = 0x9c; break; case 0x0192: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x02c6: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x060c: byte_stream[ *byte_stream_index ] = 0xa1; break; case 0x0679: byte_stream[ *byte_stream_index ] = 0x8a; break; case 0x067e: byte_stream[ *byte_stream_index ] = 0x81; break; case 0x0686: byte_stream[ *byte_stream_index ] = 0x8d; break; case 0x0688: byte_stream[ *byte_stream_index ] = 0x8f; break; case 0x0691: byte_stream[ *byte_stream_index ] = 0x9a; break; case 0x0698: byte_stream[ *byte_stream_index ] = 0x8e; break; case 0x06a9: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x06af: byte_stream[ *byte_stream_index ] = 0x90; break; case 0x06ba: byte_stream[ *byte_stream_index ] = 0x9f; break; case 0x06be: byte_stream[ *byte_stream_index ] = 0xaa; break; case 0x06c1: byte_stream[ *byte_stream_index ] = 0xc0; break; case 0x06d2: byte_stream[ *byte_stream_index ] = 0xff; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1257: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x00a0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x02c7: byte_stream[ *byte_stream_index ] = 0x8e; break; case 0x02d9: byte_stream[ *byte_stream_index ] = 0xff; break; case 0x02db: byte_stream[ *byte_stream_index ] = 0x9e; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; case LIBUNA_CODEPAGE_WINDOWS_1258: if( unicode_character < 0x0080 ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00c0 ) && ( unicode_character < 0x0108 ) ) { unicode_character -= 0x00c0; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; } else if( ( unicode_character >= 0x2010 ) && ( unicode_character < 0x2028 ) ) { unicode_character -= 0x2010; byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x2010[ unicode_character ]; } else switch( unicode_character ) { case 0x0110: byte_stream[ *byte_stream_index ] = 0xd0; break; case 0x0111: byte_stream[ *byte_stream_index ] = 0xf0; break; case 0x0152: byte_stream[ *byte_stream_index ] = 0x8c; break; case 0x0153: byte_stream[ *byte_stream_index ] = 0x9c; break; case 0x0178: byte_stream[ *byte_stream_index ] = 0x9f; break; case 0x0192: byte_stream[ *byte_stream_index ] = 0x83; break; case 0x01a0: byte_stream[ *byte_stream_index ] = 0xd5; break; case 0x01a1: byte_stream[ *byte_stream_index ] = 0xf5; break; case 0x01af: byte_stream[ *byte_stream_index ] = 0xdd; break; case 0x01b0: byte_stream[ *byte_stream_index ] = 0xfd; break; case 0x02c6: byte_stream[ *byte_stream_index ] = 0x88; break; case 0x02dc: byte_stream[ *byte_stream_index ] = 0x98; break; case 0x0300: byte_stream[ *byte_stream_index ] = 0xcc; break; case 0x0301: byte_stream[ *byte_stream_index ] = 0xec; break; case 0x0303: byte_stream[ *byte_stream_index ] = 0xde; break; case 0x0309: byte_stream[ *byte_stream_index ] = 0xd2; break; case 0x0323: byte_stream[ *byte_stream_index ] = 0xf2; break; case 0x2030: byte_stream[ *byte_stream_index ] = 0x89; break; case 0x2039: byte_stream[ *byte_stream_index ] = 0x8b; break; case 0x203a: byte_stream[ *byte_stream_index ] = 0x9b; break; case 0x20ab: byte_stream[ *byte_stream_index ] = 0xfe; break; case 0x20ac: byte_stream[ *byte_stream_index ] = 0x80; break; case 0x2122: byte_stream[ *byte_stream_index ] = 0x99; break; default: byte_stream[ *byte_stream_index ] = 0x1a; break; } *byte_stream_index += 1; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported codepage: %d.", function, codepage ); return( -1 ); } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy Unicode character to byte stream.", function ); return( -1 ); } return( 1 ); } /* Determines the size of an UTF-7 stream character from an Unicode character * Adds the size to the UTF-7 stream character size value * Returns 1 if successful or -1 on error */ int libuna_unicode_character_size_to_utf7_stream( libuna_unicode_character_t unicode_character, size_t *utf7_stream_character_size, uint32_t *utf7_stream_base64_data, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_size_to_utf7_stream"; libuna_utf16_character_t utf16_surrogate = 0; size_t safe_utf7_stream_character_size = 0; uint32_t base64_triplet = 0; uint32_t safe_utf7_stream_base64_data = 0; uint8_t base64_encode_character = 0; uint8_t byte_bit_shift = 0; uint8_t current_byte = 0; uint8_t number_of_bytes = 0; if( utf7_stream_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream character size.", function ); return( -1 ); } if( utf7_stream_base64_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream base64 data.", function ); return( -1 ); } safe_utf7_stream_character_size = *utf7_stream_character_size; safe_utf7_stream_base64_data = *utf7_stream_base64_data; /* Determine if the Unicode character is valid */ if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } /* The + character must be escaped */ if( unicode_character == (libuna_unicode_character_t) '+' ) { } /* Allow for the end of string character */ else if( unicode_character == 0 ) { } else if( ( unicode_character >= 256 ) || ( libuna_unicode_character_utf7_valid_directly_encoded_character[ (uint8_t) unicode_character ] == 0 ) ) { base64_encode_character = 1; } if( base64_encode_character == 0 ) { if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { safe_utf7_stream_base64_data = 0; } safe_utf7_stream_character_size += 1; /* The + character must be escaped */ if( unicode_character == (libuna_unicode_character_t) '+' ) { safe_utf7_stream_character_size += 1; } } else { /* Escape the base64 encoded characters with a + */ if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) == 0 ) { safe_utf7_stream_character_size += 1; } /* Otherwise continue the previously base64 encoded characters */ else { base64_triplet = safe_utf7_stream_base64_data & 0x00ffffff; number_of_bytes = ( safe_utf7_stream_base64_data >> 24 ) & 0x03; current_byte = ( safe_utf7_stream_base64_data >> 28 ) & 0x03; if( number_of_bytes > 0 ) { if( safe_utf7_stream_character_size < (size_t) ( number_of_bytes + 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-7 stream character size value out of bounds.", function ); return( -1 ); } /* Correct the size for the last partial base64 stream */ safe_utf7_stream_character_size -= number_of_bytes + 1; } if( safe_utf7_stream_character_size < 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-7 stream character size value out of bounds.", function ); return( -1 ); } /* Correct the size for the base64 stream termination character */ safe_utf7_stream_character_size -= 1; } safe_utf7_stream_base64_data = LIBUNA_UTF7_IS_BASE64_ENCODED; if( unicode_character > LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { unicode_character -= 0x010000; utf16_surrogate = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( ( utf16_surrogate >> 8 ) & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { safe_utf7_stream_character_size += 4; number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( utf16_surrogate & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { safe_utf7_stream_character_size += 4; number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } unicode_character = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); } byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( ( unicode_character >> 8 ) & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { safe_utf7_stream_character_size += 4; number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( unicode_character & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { safe_utf7_stream_character_size += 4; number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } /* Terminate the base64 encoded characters */ if( number_of_bytes > 0 ) { safe_utf7_stream_character_size += number_of_bytes + 1; } safe_utf7_stream_character_size += 1; } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { safe_utf7_stream_base64_data = LIBUNA_UTF7_IS_BASE64_ENCODED; safe_utf7_stream_base64_data |= (uint32_t) current_byte << 28; safe_utf7_stream_base64_data |= (uint32_t) number_of_bytes << 24; safe_utf7_stream_base64_data |= base64_triplet & 0x00ffffff; } *utf7_stream_character_size = safe_utf7_stream_character_size; *utf7_stream_base64_data = safe_utf7_stream_base64_data; return( 1 ); } /* Copies an Unicode character from an UTF-7 stream * The bits of the base64 data contain: * 0 - 23 the base64 triplet * 24 - 25 the number of bytes in the triplet * 26 - 27 unused * 28 - 29 the current byte * 30 unused * 31 flag to indicate the current UTF-7 characters are (modified) base64 encoded * * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf7_stream( libuna_unicode_character_t *unicode_character, const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf7_stream_index, uint32_t *utf7_stream_base64_data, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_utf7_stream"; libuna_utf16_character_t utf16_surrogate = 0; size_t safe_utf7_stream_index = 0; uint32_t base64_triplet = 0; uint32_t safe_utf7_stream_base64_data = 0; uint8_t byte_bit_shift = 0; uint8_t current_byte = 0; uint8_t number_of_bytes = 0; uint8_t padding_size = 0; uint8_t utf7_character_value = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream index.", function ); return( -1 ); } if( *utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-7 stream too small.", function ); return( -1 ); } if( utf7_stream_base64_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 base64 data.", function ); return( -1 ); } safe_utf7_stream_index = *utf7_stream_index; safe_utf7_stream_base64_data = *utf7_stream_base64_data; if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { base64_triplet = safe_utf7_stream_base64_data & 0x00ffffff; number_of_bytes = ( safe_utf7_stream_base64_data >> 24 ) & 0x03; current_byte = ( safe_utf7_stream_base64_data >> 28 ) & 0x03; if( current_byte >= number_of_bytes ) { if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-7 stream character size value out of bounds.", function ); return( -1 ); } utf7_character_value = utf7_stream[ safe_utf7_stream_index ]; /* Any character not in the modified base64 alphabet terminates the base64 encoded sequence */ if( libuna_unicode_character_utf7_valid_base64_character[ utf7_character_value ] == 0 ) { safe_utf7_stream_base64_data = 0; } } } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) == 0 ) { if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-7 stream character size value out of bounds.", function ); return( -1 ); } utf7_character_value = utf7_stream[ safe_utf7_stream_index ]; /* Determine if the character is modified base64 encoded * or a + character */ if( utf7_character_value == (uint8_t) '+' ) { if( ( safe_utf7_stream_index + 1 ) >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-7 stream character size value out of bounds.", function ); return( -1 ); } if( utf7_stream[ safe_utf7_stream_index + 1 ] != (uint8_t) '-' ) { safe_utf7_stream_base64_data = LIBUNA_UTF7_IS_BASE64_ENCODED; safe_utf7_stream_index++; } } /* Allow for the end of string character */ else if( utf7_character_value == 0 ) { } else if( libuna_unicode_character_utf7_valid_directly_encoded_character[ utf7_character_value ] == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid directly encoded UTF-7 character byte: 0x%02" PRIx8 ".", function, utf7_character_value ); return( -1 ); } } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) == 0 ) { *unicode_character = utf7_stream[ safe_utf7_stream_index++ ]; if( ( *unicode_character == (libuna_unicode_character_t) '+' ) && ( utf7_stream[ safe_utf7_stream_index ] == (uint8_t) '-' ) ) { safe_utf7_stream_index++; } } else if( ( number_of_bytes == 0 ) || ( current_byte >= number_of_bytes ) ) { if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy base64 encoded UTF-7 characters.", function ); return( -1 ); } if( padding_size > 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported padding in base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 3 - padding_size; current_byte = 0; } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { byte_bit_shift = 16 - ( current_byte * 8 ); *unicode_character = ( ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL ) << 8; current_byte += 1; if( current_byte >= number_of_bytes ) { if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy base64 encoded UTF-7 characters.", function ); return( -1 ); } if( padding_size > 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported padding in base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 3 - padding_size; current_byte = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); *unicode_character += ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL; current_byte += 1; if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) { if( current_byte >= number_of_bytes ) { if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy base64 encoded UTF-7 characters.", function ); return( -1 ); } if( padding_size > 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported padding in base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 3 - padding_size; current_byte = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); utf16_surrogate = ( ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL ) << 8; current_byte += 1; if( current_byte >= number_of_bytes ) { if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve base64 encoded UTF-7 characters.", function ); return( -1 ); } if( padding_size > 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported padding in base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 3 - padding_size; current_byte = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); utf16_surrogate += ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL; current_byte += 1; /* Determine if the UTF-16 character is within the low surrogate range */ if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; *unicode_character <<= 10; *unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END; *unicode_character += 0x010000; } else { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } } if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-7 stream too small.", function ); return( -1 ); } if( ( current_byte >= number_of_bytes ) && ( utf7_stream[ safe_utf7_stream_index ] == (uint8_t) '-' ) ) { safe_utf7_stream_base64_data = 0; safe_utf7_stream_index++; } } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { safe_utf7_stream_base64_data = LIBUNA_UTF7_IS_BASE64_ENCODED; safe_utf7_stream_base64_data |= (uint32_t) current_byte << 28; safe_utf7_stream_base64_data |= (uint32_t) number_of_bytes << 24; safe_utf7_stream_base64_data |= base64_triplet & 0x00ffffff; } *utf7_stream_index = safe_utf7_stream_index; *utf7_stream_base64_data = safe_utf7_stream_base64_data; return( 1 ); } /* Copies an Unicode character into a UTF-7 stream * The bits of the base64 data contain: * 0 - 23 the base64 triplet * 24 - 25 the number of bytes in the triplet * 26 - 27 unused * 28 - 29 the current byte * 30 unused * 31 flag to indicate the current UTF-7 characters are (modified) base64 encoded * * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_utf7_stream( libuna_unicode_character_t unicode_character, uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf7_stream_index, uint32_t *utf7_stream_base64_data, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_utf7_stream"; libuna_utf16_character_t utf16_surrogate = 0; size_t safe_utf7_stream_index = 0; uint32_t base64_triplet = 0; uint32_t safe_utf7_stream_base64_data = 0; uint8_t base64_encode_character = 0; uint8_t byte_bit_shift = 0; uint8_t current_byte = 0; uint8_t number_of_bytes = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream index.", function ); return( -1 ); } if( utf7_stream_base64_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream base64 data.", function ); return( -1 ); } safe_utf7_stream_index = *utf7_stream_index; safe_utf7_stream_base64_data = *utf7_stream_base64_data; /* Determine if the Unicode character is valid */ if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( unicode_character >= 0x41 ) && ( unicode_character <= 0x49 ) ) { unicode_character = ( unicode_character - 0x41 ) + (libuna_unicode_character_t) 'A'; } else if( ( unicode_character >= 0x4a ) && ( unicode_character <= 0x52 ) ) { unicode_character = ( unicode_character - 0x4a ) + (libuna_unicode_character_t) 'J'; } else if( ( unicode_character >= 0x53 ) && ( unicode_character <= 0x5a ) ) { unicode_character = ( unicode_character - 0x53 ) + (libuna_unicode_character_t) 'S'; } /* a-z is not a continous range on an EBCDIC based system * it consists of the ranges: a-i, j-r, s-z */ else if( ( unicode_character >= 0x61 ) && ( unicode_character <= 0x69 ) ) { unicode_character = ( unicode_character - 0x61 ) + (libuna_unicode_character_t) 'a'; } else if( ( unicode_character >= 0x6a ) && ( unicode_character <= 0x72 ) ) { unicode_character = ( unicode_character - 0x6a ) + (libuna_unicode_character_t) 'j'; } else if( ( unicode_character >= 0x73 ) && ( unicode_character <= 0x7a ) ) { unicode_character = ( unicode_character - 0x73 ) + (libuna_unicode_character_t) 's'; } /* 0-9 */ else if( ( unicode_character >= 0x30 ) && ( unicode_character <= 0x39 ) ) { unicode_character = ( unicode_character - 0x30 ) + (libuna_unicode_character_t) '0'; } /* The + character must be escaped */ else if( unicode_character == (libuna_unicode_character_t) '+' ) { } /* Allow for the end of string character */ else if( unicode_character == 0 ) { } else if( ( unicode_character >= 256 ) || ( libuna_unicode_character_utf7_valid_directly_encoded_character[ (uint8_t) unicode_character ] == 0 ) ) { base64_encode_character = 1; } if( base64_encode_character == 0 ) { if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { safe_utf7_stream_base64_data = 0; } if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-7 stream too small.", function ); return( -1 ); } utf7_stream[ safe_utf7_stream_index++ ] = (uint8_t) unicode_character; /* The + character must be escaped */ if( unicode_character == (libuna_unicode_character_t) '+' ) { if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-7 stream too small.", function ); return( -1 ); } utf7_stream[ safe_utf7_stream_index++ ] = (uint8_t) '-'; } } else { /* Escape the base64 encoded chracters with a + */ if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) == 0 ) { if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-7 stream too small.", function ); return( -1 ); } utf7_stream[ safe_utf7_stream_index++ ] = (uint8_t) '+'; } /* Otherwise continue the previously base64 encoded characters */ else { base64_triplet = safe_utf7_stream_base64_data & 0x00ffffff; number_of_bytes = ( safe_utf7_stream_base64_data >> 24 ) & 0x03; current_byte = ( safe_utf7_stream_base64_data >> 28 ) & 0x03; if( number_of_bytes > 0 ) { /* Correct the index for the last partial base64 stream */ safe_utf7_stream_index -= number_of_bytes + 1; } /* Correct the index for the base64 stream termination character */ safe_utf7_stream_index -= 1; } safe_utf7_stream_base64_data = LIBUNA_UTF7_IS_BASE64_ENCODED; if( unicode_character > LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { unicode_character -= 0x010000; utf16_surrogate = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( ( utf16_surrogate >> 8 ) & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { if( libuna_base64_triplet_copy_to_base64_stream( base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, 0, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( utf16_surrogate & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { if( libuna_base64_triplet_copy_to_base64_stream( base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, 0, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } unicode_character = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); } byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( ( unicode_character >> 8 ) & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { if( libuna_base64_triplet_copy_to_base64_stream( base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, 0, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } byte_bit_shift = 16 - ( current_byte * 8 ); base64_triplet += (uint32_t) ( unicode_character & 0xff ) << byte_bit_shift; current_byte += 1; number_of_bytes += 1; if( number_of_bytes == 3 ) { if( libuna_base64_triplet_copy_to_base64_stream( base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, 0, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set base64 encoded UTF-7 characters.", function ); return( -1 ); } number_of_bytes = 0; current_byte = 0; base64_triplet = 0; } /* Terminate the base64 encoded characters */ if( number_of_bytes > 0 ) { if( libuna_base64_triplet_copy_to_base64_stream( base64_triplet, utf7_stream, utf7_stream_size, &safe_utf7_stream_index, 3 - number_of_bytes, LIBUNA_BASE64_VARIANT_UTF7, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set base64 encoded UTF-7 characters.", function ); return( -1 ); } } if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-7 stream too small.", function ); return( -1 ); } utf7_stream[ safe_utf7_stream_index++ ] = (uint8_t) '-'; } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { safe_utf7_stream_base64_data = LIBUNA_UTF7_IS_BASE64_ENCODED; safe_utf7_stream_base64_data |= (uint32_t) current_byte << 28; safe_utf7_stream_base64_data |= (uint32_t) number_of_bytes << 24; safe_utf7_stream_base64_data |= base64_triplet & 0x00ffffff; } *utf7_stream_index = safe_utf7_stream_index; *utf7_stream_base64_data = safe_utf7_stream_base64_data; return( 1 ); } /* Determines the size of an UTF-8 character from an Unicode character * Adds the size to the UTF-8 character size value * Returns 1 if successful or -1 on error */ int libuna_unicode_character_size_to_utf8( libuna_unicode_character_t unicode_character, size_t *utf8_character_size, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_size_to_utf8"; if( utf8_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 character size.", function ); return( -1 ); } if( unicode_character < 0x00000080UL ) { *utf8_character_size += 1; } else if( unicode_character < 0x00000800UL ) { *utf8_character_size += 2; } else if( unicode_character < 0x00010000UL ) { *utf8_character_size += 3; } else if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { *utf8_character_size += 3; } else { *utf8_character_size += 4; } /* If UTF-8 USC support is needed it should be implemented in * utf8_usc or something, but for now leave this here as a reminder else if( unicode_character < 0x010000 ) { *utf8_character_size += 3; } else if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { *utf8_character_size += 2; } else if( unicode_character < 0x0200000 ) { *utf8_character_size += 4; } else if( unicode_character < 0x0400000 ) { *utf8_character_size += 5; } else { *utf8_character_size += 6; } */ return( 1 ); } /* Copies an Unicode character from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf8( libuna_unicode_character_t *unicode_character, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_utf8"; uint8_t utf8_character_additional_bytes = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } /* Determine the number of additional bytes of the UTF-8 character */ if( utf8_string[ *utf8_string_index ] < 0xc0 ) { utf8_character_additional_bytes = 0; } else if( utf8_string[ *utf8_string_index ] < 0xe0 ) { utf8_character_additional_bytes = 1; } else if( utf8_string[ *utf8_string_index ] < 0xf0 ) { utf8_character_additional_bytes = 2; } else if( utf8_string[ *utf8_string_index ] < 0xf8 ) { utf8_character_additional_bytes = 3; } else if( utf8_string[ *utf8_string_index ] < 0xfc ) { utf8_character_additional_bytes = 4; } else { utf8_character_additional_bytes = 5; } if( ( *utf8_string_index + utf8_character_additional_bytes + 1 ) > utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-8 character bytes.", function ); return( -1 ); } /* Determine the UTF-8 character and make sure it is valid * Unicode limits the UTF-8 character to consist of a maximum of 4 bytes * while ISO 10646 Universal Character Set (UCS) allows up to 6 bytes */ if( utf8_string[ *utf8_string_index ] > 0xf4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index ] ); return( -1 ); } *unicode_character = utf8_string[ *utf8_string_index ]; if( utf8_character_additional_bytes == 0 ) { if( ( utf8_string[ *utf8_string_index ] >= 0x80 ) && ( utf8_string[ *utf8_string_index ] < 0xc2 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index ] ); return( -1 ); } } if( utf8_character_additional_bytes >= 1 ) { if( utf8_string[ *utf8_string_index + 1 ] > 0xbf ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 1 ] ); return( -1 ); } if( ( utf8_string[ *utf8_string_index ] == 0xe0 ) && ( utf8_string[ *utf8_string_index + 1 ] < 0xa0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 1 ] ); return( -1 ); } else if( ( utf8_string[ *utf8_string_index ] == 0xed ) && ( utf8_string[ *utf8_string_index + 1 ] > 0x9f ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 1 ] ); return( -1 ); } else if( ( utf8_string[ *utf8_string_index ] == 0xf0 ) && ( utf8_string[ *utf8_string_index + 1 ] < 0x90 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 1 ] ); return( -1 ); } else if( ( utf8_string[ *utf8_string_index ] == 0xf4 ) && ( utf8_string[ *utf8_string_index + 1 ] > 0x8f ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 1 ] ); return( -1 ); } else if( utf8_string[ *utf8_string_index + 1 ] < 0x80 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 1 ] ); return( -1 ); } *unicode_character <<= 6; *unicode_character += utf8_string[ *utf8_string_index + 1 ]; if( utf8_character_additional_bytes == 1 ) { *unicode_character -= 0x03080; } } if( utf8_character_additional_bytes >= 2 ) { if( ( utf8_string[ *utf8_string_index + 2 ] < 0x80 ) || ( utf8_string[ *utf8_string_index + 2 ] > 0xbf ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 2 ] ); return( -1 ); } *unicode_character <<= 6; *unicode_character += utf8_string[ *utf8_string_index + 2 ]; if( utf8_character_additional_bytes == 2 ) { *unicode_character -= 0x0e2080; } } if( utf8_character_additional_bytes >= 3 ) { if( ( utf8_string[ *utf8_string_index + 3 ] < 0x80 ) || ( utf8_string[ *utf8_string_index + 3 ] > 0xbf ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 3 ] ); return( -1 ); } *unicode_character <<= 6; *unicode_character += utf8_string[ *utf8_string_index + 3 ]; if( utf8_character_additional_bytes == 3 ) { *unicode_character -= 0x03c82080; } } if( utf8_character_additional_bytes >= 4 ) { if( ( utf8_string[ *utf8_string_index + 4 ] < 0x80 ) || ( utf8_string[ *utf8_string_index + 4 ] > 0xbf ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 5th UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 4 ] ); return( -1 ); } *unicode_character <<= 6; *unicode_character += utf8_string[ *utf8_string_index + 4 ]; if( utf8_character_additional_bytes == 4 ) { *unicode_character -= 0x0fa082080; } } if( utf8_character_additional_bytes == 5 ) { if( ( utf8_string[ *utf8_string_index + 5 ] < 0x80 ) || ( utf8_string[ *utf8_string_index + 5 ] > 0xbf ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 6th UTF-8 character byte: 0x%02" PRIx8 ".", function, utf8_string[ *utf8_string_index + 5 ] ); return( -1 ); } *unicode_character <<= 6; *unicode_character += utf8_string[ *utf8_string_index + 5 ]; *unicode_character -= 0x082082080; } /* Determine if the Unicode character is valid */ if( *unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } *utf8_string_index += 1 + utf8_character_additional_bytes; return( 1 ); } /* Copies an Unicode character into a UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_utf8( libuna_unicode_character_t unicode_character, libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_utf8"; uint8_t utf8_character_additional_bytes = 0; uint8_t utf8_character_iterator = 0; uint8_t utf8_first_character_mark = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } /* Determine if the Unicode character is valid */ if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } /* Determine how many UTF-8 character bytes are required */ if( unicode_character < 0x080 ) { utf8_character_additional_bytes = 0; utf8_first_character_mark = 0; } else if( unicode_character < 0x0800 ) { utf8_character_additional_bytes = 1; utf8_first_character_mark = 0x0c0; } else if( unicode_character < 0x010000 ) { utf8_character_additional_bytes = 2; utf8_first_character_mark = 0x0e0; } else if( unicode_character < 0x0200000 ) { utf8_character_additional_bytes = 3; utf8_first_character_mark = 0x0f0; } else if( unicode_character < 0x0400000 ) { utf8_character_additional_bytes = 4; utf8_first_character_mark = 0x0f8; } else { utf8_character_additional_bytes = 5; utf8_first_character_mark = 0x0fc; } /* Convert Unicode character into UTF-8 character bytes */ if( ( *utf8_string_index + utf8_character_additional_bytes ) >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } for( utf8_character_iterator = utf8_character_additional_bytes; utf8_character_iterator > 0; utf8_character_iterator-- ) { utf8_string[ *utf8_string_index + utf8_character_iterator ] = (libuna_utf8_character_t) ( ( unicode_character & 0x0bf ) | 0x080 ); unicode_character >>= 6; } utf8_string[ *utf8_string_index ] = (libuna_utf8_character_t) ( unicode_character | utf8_first_character_mark ); *utf8_string_index += 1 + utf8_character_additional_bytes; return( 1 ); } /* Determines the size of an UTF-16 character from an Unicode character * Adds the size to the UTF-16 character size value * Returns 1 if successful or -1 on error */ int libuna_unicode_character_size_to_utf16( libuna_unicode_character_t unicode_character, size_t *utf16_character_size, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_size_to_utf16"; if( utf16_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 character size.", function ); return( -1 ); } if( ( unicode_character > LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) && ( unicode_character <= LIBUNA_UTF16_CHARACTER_MAX ) ) { *utf16_character_size += 2; } else { *utf16_character_size += 1; } return( 1 ); } /* Copies an Unicode character from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf16( libuna_unicode_character_t *unicode_character, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_utf16"; libuna_utf16_character_t utf16_surrogate = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } *unicode_character = utf16_string[ *utf16_string_index ]; *utf16_string_index += 1; /* Determine if the UTF-16 character is within the high surrogate range */ if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: missing surrogate UTF-16 character bytes.", function ); return( -1 ); } utf16_surrogate = utf16_string[ *utf16_string_index ]; *utf16_string_index += 1; /* Determine if the UTF-16 character is within the low surrogate range */ if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; *unicode_character <<= 10; *unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END; *unicode_character += 0x010000; } else { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } } /* Determine if the Unicode character is valid */ else if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } return( 1 ); } /* Copies an Unicode character into a UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_utf16( libuna_unicode_character_t unicode_character, libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_utf16"; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) || ( unicode_character > LIBUNA_UTF16_CHARACTER_MAX ) ) { unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } if( unicode_character <= LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { utf16_string[ *utf16_string_index ] = (libuna_utf16_character_t) unicode_character; *utf16_string_index += 1; } else { if( ( *utf16_string_index + 1 ) >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } unicode_character -= 0x010000; utf16_string[ *utf16_string_index ] = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); utf16_string[ *utf16_string_index + 1 ] = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); *utf16_string_index += 2; } return( 1 ); } /* Copies an Unicode character from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf16_stream( libuna_unicode_character_t *unicode_character, const uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_stream_index, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_utf16_stream"; libuna_utf16_character_t utf16_surrogate = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream index.", function ); return( -1 ); } if( ( *utf16_stream_index + 1 ) >= utf16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 stream too small.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( byte_order == LIBUNA_ENDIAN_BIG ) { *unicode_character = utf16_stream[ *utf16_stream_index ]; *unicode_character <<= 8; *unicode_character += utf16_stream[ *utf16_stream_index + 1 ]; } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { *unicode_character = utf16_stream[ *utf16_stream_index + 1 ]; *unicode_character <<= 8; *unicode_character += utf16_stream[ *utf16_stream_index ]; } *utf16_stream_index += 2; /* Determine if the UTF-16 character is within the high surrogate range */ if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) { if( ( *utf16_stream_index + 1 ) >= utf16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: missing surrogate UTF-16 character bytes.", function ); return( -1 ); } if( byte_order == LIBUNA_ENDIAN_BIG ) { utf16_surrogate = utf16_stream[ *utf16_stream_index ]; utf16_surrogate <<= 8; utf16_surrogate += utf16_stream[ *utf16_stream_index + 1 ]; } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf16_surrogate = utf16_stream[ *utf16_stream_index + 1 ]; utf16_surrogate <<= 8; utf16_surrogate += utf16_stream[ *utf16_stream_index ]; } *utf16_stream_index += 2; /* Determine if the UTF-16 character is within the low surrogate range */ if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; *unicode_character <<= 10; *unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END; *unicode_character += 0x010000; } else { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } } /* Determine if the Unicode character is valid */ else if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } return( 1 ); } /* Copies an Unicode character to an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_utf16_stream( libuna_unicode_character_t unicode_character, uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_stream_index, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_utf16_stream"; libuna_utf16_character_t utf16_surrogate = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream index.", function ); return( -1 ); } if( ( *utf16_stream_index + 1 ) >= utf16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 stream too small.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) || ( unicode_character > LIBUNA_UTF16_CHARACTER_MAX ) ) { unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } if( unicode_character <= LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { if( byte_order == LIBUNA_ENDIAN_BIG ) { utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf16_stream[ *utf16_stream_index ] = (uint8_t) ( unicode_character & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf16_stream[ *utf16_stream_index ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); } *utf16_stream_index += 2; } else { if( ( *utf16_stream_index + 3 ) >= utf16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 stream too small.", function ); return( -1 ); } unicode_character -= 0x010000; utf16_surrogate = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); if( byte_order == LIBUNA_ENDIAN_BIG ) { utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); utf16_surrogate >>= 8; utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); utf16_surrogate >>= 8; utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); } *utf16_stream_index += 2; utf16_surrogate = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); if( byte_order == LIBUNA_ENDIAN_BIG ) { utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); utf16_surrogate >>= 8; utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); utf16_surrogate >>= 8; utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); } *utf16_stream_index += 2; } return( 1 ); } /* Determines the size of an UTF-32 character from an Unicode character * Adds the size to the UTF-32 character size value * Returns 1 if successful or -1 on error */ int libuna_unicode_character_size_to_utf32( libuna_unicode_character_t unicode_character LIBUNA_ATTRIBUTE_UNUSED, size_t *utf32_character_size, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_size_to_utf32"; LIBUNA_UNREFERENCED_PARAMETER( unicode_character ) if( utf32_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 character size.", function ); return( -1 ); } *utf32_character_size += 1; return( 1 ); } /* Copies an Unicode character from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf32( libuna_unicode_character_t *unicode_character, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_utf32"; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } /* Determine if the Unicode character is valid */ if( ( utf32_string[ *utf32_string_index ] >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( utf32_string[ *utf32_string_index ] <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } else { *unicode_character = utf32_string[ *utf32_string_index ]; } *utf32_string_index += 1; return( 1 ); } /* Copies an Unicode character into a UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_utf32( libuna_unicode_character_t unicode_character, libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_utf32"; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string too small.", function ); return( -1 ); } /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) || ( unicode_character > LIBUNA_UTF32_CHARACTER_MAX ) ) { utf32_string[ *utf32_string_index ] = (libuna_utf32_character_t) LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } else { utf32_string[ *utf32_string_index ] = (libuna_utf32_character_t) unicode_character; } *utf32_string_index += 1; return( 1 ); } /* Copies an Unicode character from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf32_stream( libuna_unicode_character_t *unicode_character, const uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_stream_index, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_from_utf32_stream"; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream index.", function ); return( -1 ); } if( ( *utf32_stream_index + 3 ) >= utf32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 stream too small.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( byte_order == LIBUNA_ENDIAN_BIG ) { *unicode_character = utf32_stream[ *utf32_stream_index ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index + 1 ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index + 2 ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index + 3 ]; } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { *unicode_character = utf32_stream[ *utf32_stream_index + 3 ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index + 2 ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index + 1 ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index ]; } /* Determine if the Unicode character is valid */ if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } *utf32_stream_index += 4; return( 1 ); } /* Copies an Unicode character to an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_to_utf32_stream( libuna_unicode_character_t unicode_character, uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_stream_index, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_unicode_character_copy_to_utf32_stream"; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream index.", function ); return( -1 ); } if( ( *utf32_stream_index + 3 ) >= utf32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 stream too small.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) || ( unicode_character > LIBUNA_UTF32_CHARACTER_MAX ) ) { unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; } if( byte_order == LIBUNA_ENDIAN_BIG ) { utf32_stream[ *utf32_stream_index + 3 ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf32_stream[ *utf32_stream_index + 2 ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf32_stream[ *utf32_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf32_stream[ *utf32_stream_index ] = (uint8_t) ( unicode_character & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf32_stream[ *utf32_stream_index ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf32_stream[ *utf32_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf32_stream[ *utf32_stream_index + 2 ] = (uint8_t) ( unicode_character & 0xff ); unicode_character >>= 8; utf32_stream[ *utf32_stream_index + 3 ] = (uint8_t) ( unicode_character & 0xff ); } *utf32_stream_index += 4; return( 1 ); } libewf-20140807/libuna/libuna_utf8_string.c0000664000175000017500000023522613443450072022571 0ustar00lordyestalordyesta00000000000000/* * UTF-8 string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf8_string.h" /* Determines the size of an UTF-8 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, int codepage, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_byte_stream"; size_t byte_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( byte_stream_size == 0 ) { return( 1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_byte_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_byte_stream"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_byte_stream( utf8_string, utf8_string_size, &utf8_string_index, byte_stream, byte_stream_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_byte_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_byte_stream"; size_t byte_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing byte stream value.", function ); return( -1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with a byte stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_byte_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_byte_stream"; size_t byte_stream_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t byte_stream_unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing byte stream value.", function ); return( -1 ); } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } /* Check if the byte stream is terminated with zero bytes */ if( byte_stream[ byte_stream_size - 1 ] == 0 ) { byte_stream_size -= 1; } while( ( utf8_string_index < utf8_string_size ) && ( byte_stream_index < byte_stream_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &byte_stream_unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } if( utf8_unicode_character < byte_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > byte_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( byte_stream_index < byte_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-8 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_utf7_stream( const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf7_stream"; size_t utf7_stream_index = 0; libuna_unicode_character_t unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( utf7_stream_size == 0 ) { return( 1 ); } while( utf7_stream_index < utf7_stream_size ) { /* Convert the UTF-7 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_utf7_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_utf7_stream"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_utf7_stream( utf8_string, utf8_string_size, &utf8_string_index, utf7_stream, utf7_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to UTF-7 stream to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_utf7_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf7_stream"; size_t utf7_stream_index = 0; libuna_unicode_character_t unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-7 stream value.", function ); return( -1 ); } while( utf7_stream_index < utf7_stream_size ) { /* Convert the UTF-7 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with an UTF-7 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_utf7_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf7_stream"; size_t utf7_stream_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t utf7_stream_unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-7 stream value.", function ); return( -1 ); } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } /* Check if the UTF-7 stream is terminated with zero bytes */ if( utf7_stream[ utf7_stream_size - 1 ] == 0 ) { utf7_stream_size -= 1; } while( ( utf8_string_index < utf8_string_size ) && ( utf7_stream_index < utf7_stream_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the UTF-7 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &utf7_stream_unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } if( utf8_unicode_character < utf7_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > utf7_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf7_stream_index < utf7_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-8 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_utf8_stream( const uint8_t *utf8_stream, size_t utf8_stream_size, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf8_stream"; size_t utf8_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( utf8_stream_size == 0 ) { return( 1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } while( utf8_stream_index < utf8_stream_size ) { /* Convert the UTF-8 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_utf8_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_utf8_stream"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_utf8_stream( utf8_string, utf8_string_size, &utf8_string_index, utf8_stream, utf8_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to UTF-8 stream to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_utf8_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf8_stream"; size_t utf8_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 stream value.", function ); return( -1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } while( utf8_stream_index < utf8_stream_size ) { /* Convert the UTF-8 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with an UTF-8 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_utf8_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf8_stream"; size_t utf8_stream_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t utf8_stream_unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 stream value.", function ); return( -1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } /* Check if the UTF-8 stream is terminated with zero bytes */ if( utf8_stream[ utf8_stream_size - 1 ] == 0 ) { utf8_stream_size -= 1; } while( ( utf8_string_index < utf8_string_size ) && ( utf8_stream_index < utf8_stream_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_stream_unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } if( utf8_unicode_character < utf8_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > utf8_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf8_stream_index < utf8_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-8 string from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf16"; size_t utf16_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( utf16_string_size == 0 ) { return( 1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_utf16( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_utf16"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_utf16( utf8_string, utf8_string_size, &utf8_string_index, utf16_string, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 string to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_utf16( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf16"; size_t utf16_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-16 string value.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with an UTF-16 string * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_utf16( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf16"; size_t utf16_string_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t utf16_unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-16 string value.", function ); return( -1 ); } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } while( ( utf8_string_index < utf8_string_size ) && ( utf16_string_index < utf16_string_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } if( utf8_unicode_character < utf16_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > utf16_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-8 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_utf16_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf16_stream"; size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size % 2 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( utf16_stream_size == 0 ) { return( 1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0xfe ) && ( utf16_stream[ 1 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0xff ) && ( utf16_stream[ 1 ] == 0xfe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_utf16_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_utf16_stream"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_utf16_stream( utf8_string, utf8_string_size, &utf8_string_index, utf16_stream, utf16_stream_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_utf16_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf16_stream"; size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size == 0 ) || ( ( utf16_stream_size % 2 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0xfe ) && ( utf16_stream[ 1 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0xff ) && ( utf16_stream[ 1 ] == 0xfe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with an UTF-16 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_utf16_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf16_stream"; size_t utf16_stream_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t utf16_stream_unicode_character = 0; int read_byte_order = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size == 0 ) || ( ( utf16_stream_size % 2 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0xfe ) && ( utf16_stream[ 1 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0xff ) && ( utf16_stream[ 1 ] == 0xfe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } /* Check if the UTF-16 stream is terminated with zero bytes */ if( ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) && ( utf16_stream[ utf16_stream_size - 1 ] == 0 ) ) { utf16_stream_size -= 2; } while( ( utf8_string_index < utf8_string_size ) && ( utf16_stream_index < utf16_stream_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &utf16_stream_unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } if( utf8_unicode_character < utf16_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > utf16_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf16_stream_index < utf16_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-8 string from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf32"; size_t utf32_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( utf32_string_size == 0 ) { return( 1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_utf32( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_utf32"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_utf32( utf8_string, utf8_string_size, &utf8_string_index, utf32_string, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 string to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_utf32( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf32"; size_t utf32_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-32 string value.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with an UTF-32 string * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_utf32( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf32"; size_t utf32_string_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t utf32_unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-32 string value.", function ); return( -1 ); } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } while( ( utf8_string_index < utf8_string_size ) && ( utf32_string_index < utf32_string_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } if( utf8_unicode_character < utf32_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > utf32_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-8 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_size_from_utf32_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf32_stream"; size_t utf32_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size % 4 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( utf32_stream_size == 0 ) { return( 1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf8_string_size += 1; } return( 1 ); } /* Copies an UTF-8 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_copy_from_utf32_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_copy_from_utf32_stream"; size_t utf8_string_index = 0; if( libuna_utf8_string_with_index_copy_from_utf32_stream( utf8_string, utf8_string_size, &utf8_string_index, utf32_stream, utf32_stream_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf8_string_with_index_copy_from_utf32_stream( libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf32_stream"; size_t utf32_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size == 0 ) || ( ( utf32_stream_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_string, utf8_string_size, utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } return( 1 ); } /* Compares an UTF-8 string with an UTF-32 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf8_string_compare_with_utf32_stream( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf32_stream"; size_t utf32_stream_index = 0; size_t utf8_string_index = 0; libuna_unicode_character_t utf8_unicode_character = 0; libuna_unicode_character_t utf32_stream_unicode_character = 0; int read_byte_order = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size == 0 ) || ( ( utf32_stream_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf8_string[ utf8_string_size - 1 ] == 0 ) { utf8_string_size -= 1; } /* Check if the UTF-32 stream is terminated with zero bytes */ if( ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 3 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 2 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 1 ] == 0 ) ) { utf32_stream_size -= 1; } while( ( utf8_string_index < utf8_string_size ) && ( utf32_stream_index < utf32_stream_size ) ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &utf32_stream_unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } if( utf8_unicode_character < utf32_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf8_unicode_character > utf32_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf8_string_index < utf8_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf32_stream_index < utf32_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } libewf-20140807/libuna/libuna_base32_stream.c0000664000175000017500000024046413443450072022747 0ustar00lordyestalordyesta00000000000000/* * Base32 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libuna_base32_stream.h" #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" static uint8_t libuna_base32_quintet_to_character_table[ 32 ] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7' }; static uint8_t libuna_base32hex_quintet_to_character_table[ 32 ] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V' }; /* Copies a base32 character to a base32 quintet * Returns 1 if successful or -1 on error */ int libuna_base32_character_copy_to_quintet( uint8_t base32_character, uint8_t *base32_quintet, uint32_t base32_variant, libcerror_error_t **error ) { static char *function = "libuna_base32_character_copy_to_quintet"; uint8_t safe_base32_quintet = 0; if( base32_quintet == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 quintet.", function ); return( -1 ); } switch( base32_variant & 0x000f0000UL ) { case LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL: /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( base32_character >= (uint8_t) 'A' ) && ( base32_character <= (uint8_t) 'I' ) ) { safe_base32_quintet = base32_character - (uint8_t) 'A'; } else if( ( base32_character >= (uint8_t) 'J' ) && ( base32_character <= (uint8_t) 'R' ) ) { safe_base32_quintet = base32_character - (uint8_t) 'J' + 9; } else if( ( base32_character >= (uint8_t) 'S' ) && ( base32_character <= (uint8_t) 'Z' ) ) { safe_base32_quintet = base32_character - (uint8_t) 'S' + 18; } else if( ( base32_character >= (uint8_t) '2' ) && ( base32_character <= (uint8_t) '7' ) ) { safe_base32_quintet = base32_character - (uint8_t) '2' + 26; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid base32 character: 0x%02" PRIx8 ".", function, base32_character ); return( -1 ); } break; case LIBUNA_BASE32_VARIANT_ALPHABET_HEX: if( ( base32_character >= (uint8_t) '0' ) && ( base32_character <= (uint8_t) '9' ) ) { safe_base32_quintet = base32_character - (uint8_t) '0'; } /* A-V is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-V */ else if( ( base32_character >= (uint8_t) 'A' ) && ( base32_character <= (uint8_t) 'I' ) ) { safe_base32_quintet = base32_character - (uint8_t) 'A' + 10; } else if( ( base32_character >= (uint8_t) 'J' ) && ( base32_character <= (uint8_t) 'R' ) ) { safe_base32_quintet = base32_character - (uint8_t) 'J' + 19; } else if( ( base32_character >= (uint8_t) 'S' ) && ( base32_character <= (uint8_t) 'V' ) ) { safe_base32_quintet = base32_character - (uint8_t) 'S' + 27; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid base32 character: 0x%02" PRIx8 ".", function, base32_character ); return( -1 ); } break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } *base32_quintet = safe_base32_quintet; return( 1 ); } /* Copies a base32 quintuplet from a base32 stream * * The padding size will still be set to indicate the number of * quintets in the quintuplet * * Returns 1 if successful or -1 on error */ int libuna_base32_quintuplet_copy_from_base32_stream( uint64_t *base32_quintuplet, const uint8_t *base32_stream, size_t base32_stream_size, size_t *base32_stream_index, uint8_t *padding_size, uint32_t base32_variant, libcerror_error_t **error ) { static char *function = "libuna_base32_quintuplet_copy_from_base32_stream"; size_t base32_character_size = 0; size_t safe_base32_stream_index = 0; uint64_t safe_base32_quintuplet = 0; uint32_t base32_character1 = 0; uint32_t base32_character2 = 0; uint8_t quintet1 = 0; uint8_t quintet2 = 0; uint8_t quintet3 = 0; uint8_t quintet4 = 0; uint8_t quintet5 = 0; uint8_t quintet6 = 0; uint8_t quintet7 = 0; uint8_t quintet8 = 0; uint8_t safe_padding_size = 0; if( base32_quintuplet == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 quintuplet.", function ); return( -1 ); } if( base32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream.", function ); return( -1 ); } if( base32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base32 stream size value exceeds maximum.", function ); return( -1 ); } if( base32_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream index.", function ); return( -1 ); } if( *base32_stream_index >= base32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream string too small.", function ); return( -1 ); } if( padding_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid padding size.", function ); return( -1 ); } switch( base32_variant & 0x0f000000UL ) { case LIBUNA_BASE32_VARIANT_PADDING_NONE: case LIBUNA_BASE32_VARIANT_PADDING_OPTIONAL: case LIBUNA_BASE32_VARIANT_PADDING_REQUIRED: break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character_size = 1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base32_character_size = 2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base32_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } safe_base32_stream_index = *base32_stream_index; if( base32_character_size > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 1st base32 character.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ safe_base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; } safe_base32_stream_index += base32_character_size; if( ( base32_character1 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st base32 character.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character1, &quintet1, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base32 character to 1st quintet.", function ); return( -1 ); } if( base32_character_size > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 2nd base32 character.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ safe_base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; } safe_base32_stream_index += base32_character_size; if( ( base32_character1 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd base32 character.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character1, &quintet2, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base32 character to 2nd quintet.", function ); return( -1 ); } safe_padding_size = 6; if( ( 2 * base32_character_size ) <= ( base32_stream_size - safe_base32_stream_index ) ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ safe_base32_stream_index ]; base32_character2 = base32_stream[ safe_base32_stream_index + 1 ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; } safe_base32_stream_index += 2 * base32_character_size; if( ( base32_character1 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd base32 character.", function ); return( -1 ); } if( ( base32_character2 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th base32 character.", function ); return( -1 ); } if( ( base32_character1 == (uint32_t) '=' ) || ( base32_character2 == (uint32_t) '=' ) ) { if( ( base32_variant & 0x0f000000UL ) == LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: padding where not supposed to - invalid 3rd or 4th base32 character.", function ); return( -1 ); } if( base32_character1 != (uint32_t) '=' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd base32 character.", function ); return( -1 ); } if( base32_character2 != (uint32_t) '=' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th base32 character.", function ); return( -1 ); } } else { if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character1, &quintet3, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd base32 quintet.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character2, &quintet4, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th base32 quintet.", function ); return( -1 ); } safe_padding_size -= 2; } } else if( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 3rd or 4th base32 character.", function ); return( -1 ); } if( base32_character_size <= ( base32_stream_size - safe_base32_stream_index ) ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ safe_base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; } safe_base32_stream_index += base32_character_size; if( ( base32_character1 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 5th base32 character.", function ); return( -1 ); } if( base32_character1 == (uint32_t) '=' ) { if( ( base32_variant & 0x0f000000UL ) == LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: padding where not supposed to - invalid 5th base32 character.", function ); return( -1 ); } } else { if( safe_padding_size > 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: non-padding where not supposed to - invalid 5th base32 character.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character1, &quintet5, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 5th base32 quintet.", function ); return( -1 ); } safe_padding_size -= 1; } } else if( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 5th base32 character.", function ); return( -1 ); } if( ( 2 * base32_character_size ) <= ( base32_stream_size - safe_base32_stream_index ) ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ safe_base32_stream_index ]; base32_character2 = base32_stream[ safe_base32_stream_index + 1 ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; } safe_base32_stream_index += 2 * base32_character_size; if( ( base32_character1 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 6th base32 character.", function ); return( -1 ); } if( ( base32_character2 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 7th base32 character.", function ); return( -1 ); } if( ( base32_character1 == (uint32_t) '=' ) || ( base32_character2 == (uint32_t) '=' ) ) { if( ( base32_variant & 0x0f000000UL ) == LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: padding where not supposed to - invalid 6th or 7th base32 character.", function ); return( -1 ); } if( base32_character1 != (uint32_t) '=' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 6th base32 quintet.", function ); return( -1 ); } if( base32_character2 != (uint32_t) '=' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 7th base32 quintet.", function ); return( -1 ); } } else { if( safe_padding_size > 3 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: non-padding where not supposed to - invalid 6th or 7th base32 character.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character1, &quintet6, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 6th base32 quintet.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character2, &quintet7, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 7th base32 quintet.", function ); return( -1 ); } safe_padding_size -= 2; } } else if( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 6th or 7th base32 character.", function ); return( -1 ); } if( base32_character_size <= ( base32_stream_size - safe_base32_stream_index ) ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ safe_base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; } safe_base32_stream_index += base32_character_size; if( ( base32_character1 & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 8th base32 character.", function ); return( -1 ); } if( base32_character1 == (uint32_t) '=' ) { if( ( base32_variant & 0x0f000000UL ) == LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: padding where not supposed to - invalid 8th base32 character.", function ); return( -1 ); } } else { if( safe_padding_size > 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: non-padding where not supposed to - invalid 8th base32 character.", function ); return( -1 ); } if( libuna_base32_character_copy_to_quintet( (uint8_t) base32_character1, &quintet8, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 8th base32 quintet.", function ); return( -1 ); } safe_padding_size -= 1; } } else if( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 8th base32 character.", function ); return( -1 ); } safe_base32_quintuplet = quintet1; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet2; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet3; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet4; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet5; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet6; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet7; safe_base32_quintuplet <<= 5; safe_base32_quintuplet |= quintet8; *base32_stream_index = safe_base32_stream_index; *base32_quintuplet = safe_base32_quintuplet; *padding_size = safe_padding_size; return( 1 ); } /* Copies a base32 quintuplet to a base32 stream * Returns 1 if successful or -1 on error */ int libuna_base32_quintuplet_copy_to_base32_stream( uint64_t base32_quintuplet, uint8_t *base32_stream, size_t base32_stream_size, size_t *base32_stream_index, uint8_t padding_size, uint32_t base32_variant, libcerror_error_t **error ) { uint8_t *quintet_to_character_table = NULL; static char *function = "libuna_base32_quintuplet_copy_to_base32_stream"; size_t base32_character_size = 0; size_t safe_base32_stream_index = 0; uint32_t base32_character1 = 0; uint32_t base32_character2 = 0; uint8_t quintet1 = 0; uint8_t quintet2 = 0; uint8_t quintet3 = 0; uint8_t quintet4 = 0; uint8_t quintet5 = 0; uint8_t quintet6 = 0; uint8_t quintet7 = 0; uint8_t quintet8 = 0; if( base32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream.", function ); return( -1 ); } if( base32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base32 stream size value exceeds maximum.", function ); return( -1 ); } if( base32_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream index.", function ); return( -1 ); } if( *base32_stream_index >= base32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream string too small.", function ); return( -1 ); } if( padding_size > 6 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid padding size value out of bounds.", function ); return( -1 ); } switch( base32_variant & 0x000f0000UL ) { case LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL: quintet_to_character_table = libuna_base32_quintet_to_character_table; break; case LIBUNA_BASE32_VARIANT_ALPHABET_HEX: quintet_to_character_table = libuna_base32hex_quintet_to_character_table; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0x0f000000UL ) { case LIBUNA_BASE32_VARIANT_PADDING_NONE: case LIBUNA_BASE32_VARIANT_PADDING_OPTIONAL: case LIBUNA_BASE32_VARIANT_PADDING_REQUIRED: break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character_size = 1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base32_character_size = 2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base32_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } safe_base32_stream_index = *base32_stream_index; /* Separate the 3 bytes value into 8 x 5 bit values */ quintet8 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet7 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet6 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet5 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet4 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet3 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet2 = (uint8_t) ( base32_quintuplet & 0x1f ); base32_quintuplet >>= 5; quintet1 = (uint8_t) ( base32_quintuplet & 0x1f ); /* Spread the encoding over 2 characters if 1 byte is available */ if( ( 2 * base32_character_size ) > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream is too small - insufficient space for 1st and 2nd base32 characters.", function ); return( -1 ); } base32_character1 = (uint32_t) quintet_to_character_table[ quintet1 ]; base32_character2 = (uint32_t) quintet_to_character_table[ quintet2 ]; switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_stream[ safe_base32_stream_index ] = (uint8_t) base32_character1; base32_stream[ safe_base32_stream_index + 1 ] = (uint8_t) base32_character2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; } safe_base32_stream_index += 2 * base32_character_size; /* Spread the encoding over 4 characters if 2 bytes are available * Otherwise pad the remaining bytes if required */ if( ( padding_size < 6 ) || ( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) ) { if( ( 2 * base32_character_size ) > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream is too small - insufficient space for 3rd and 4th base32 characters.", function ); return( -1 ); } if( padding_size < 6 ) { base32_character1 = (uint32_t) quintet_to_character_table[ quintet3 ]; base32_character2 = (uint32_t) quintet_to_character_table[ quintet4 ]; } else { base32_character1 = (uint32_t) '='; base32_character2 = (uint32_t) '='; } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_stream[ safe_base32_stream_index ] = (uint8_t) base32_character1; base32_stream[ safe_base32_stream_index + 1 ] = (uint8_t) base32_character2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; } safe_base32_stream_index += 2 * base32_character_size; } /* Spread the encoding over 5 characters if 3 bytes are available * Otherwise pad the remaining bytes if required */ if( ( padding_size < 4 ) || ( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) ) { if( base32_character_size > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream is too small - insufficient space for 5th base32 character.", function ); return( -1 ); } if( padding_size < 4 ) { base32_character1 = (uint32_t) quintet_to_character_table[ quintet5 ]; } else { base32_character1 = (uint32_t) '='; } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_stream[ safe_base32_stream_index ] = (uint8_t) base32_character1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; } safe_base32_stream_index += base32_character_size; } /* Spread the encoding over 7 characters if 4 bytes are available * Otherwise pad the remaining bytes if required */ if( ( padding_size < 3 ) || ( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) ) { if( ( 2 * base32_character_size ) > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream is too small - insufficient space for 6th and 7th base32 characters.", function ); return( -1 ); } if( padding_size < 3 ) { base32_character1 = (uint32_t) quintet_to_character_table[ quintet6 ]; base32_character2 = (uint32_t) quintet_to_character_table[ quintet7 ]; } else { base32_character1 = (uint32_t) '='; base32_character2 = (uint32_t) '='; } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_stream[ safe_base32_stream_index ] = (uint8_t) base32_character1; base32_stream[ safe_base32_stream_index + 1 ] = (uint8_t) base32_character2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index + 4 ] ), base32_character2 ); break; } safe_base32_stream_index += 2 * base32_character_size; } /* Spread the encoding over 8 characters if 5 bytes are available * Otherwise pad the remaining bytes if required */ if( ( padding_size < 1 ) || ( ( base32_variant & 0x0f000000UL ) != LIBUNA_BASE32_VARIANT_PADDING_NONE ) ) { if( base32_character_size > ( base32_stream_size - safe_base32_stream_index ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream is too small - insufficient space for 8th base32 character.", function ); return( -1 ); } if( padding_size < 1 ) { base32_character1 = (uint32_t) quintet_to_character_table[ quintet8 ]; } else { base32_character1 = (uint32_t) '='; } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_stream[ safe_base32_stream_index ] = (uint8_t) base32_character1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base32_stream[ safe_base32_stream_index ] ), base32_character1 ); break; } safe_base32_stream_index += base32_character_size; } *base32_stream_index = safe_base32_stream_index; return( 1 ); } /* Copies a base32 quintuplet from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base32_quintuplet_copy_from_byte_stream( uint64_t *base32_quintuplet, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t *padding_size, libcerror_error_t **error ) { static char *function = "libuna_base32_quintuplet_copy_from_byte_stream"; size_t safe_byte_stream_index = 0; uint64_t safe_base32_quintuplet = 0; uint8_t safe_padding_size = 0; if( base32_quintuplet == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 quintuplet.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } if( padding_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid padding size.", function ); return( -1 ); } /* Determine the value of 5 bytes (40 bits) */ safe_byte_stream_index = *byte_stream_index; safe_base32_quintuplet = byte_stream[ safe_byte_stream_index++ ]; safe_padding_size = 6; safe_base32_quintuplet <<= 8; if( safe_byte_stream_index < byte_stream_size ) { safe_base32_quintuplet |= byte_stream[ safe_byte_stream_index++ ]; safe_padding_size -= 2; } safe_base32_quintuplet <<= 8; if( safe_byte_stream_index < byte_stream_size ) { safe_base32_quintuplet |= byte_stream[ safe_byte_stream_index++ ]; safe_padding_size -= 1; } safe_base32_quintuplet <<= 8; if( safe_byte_stream_index < byte_stream_size ) { safe_base32_quintuplet |= byte_stream[ safe_byte_stream_index++ ]; safe_padding_size -= 2; } safe_base32_quintuplet <<= 8; if( safe_byte_stream_index < byte_stream_size ) { safe_base32_quintuplet |= byte_stream[ safe_byte_stream_index++ ]; safe_padding_size -= 1; } *base32_quintuplet = safe_base32_quintuplet; *byte_stream_index = safe_byte_stream_index; *padding_size = safe_padding_size; return( 1 ); } /* Copies a base32 quintuplet to a byte stream * Returns 1 if successful or -1 on error */ int libuna_base32_quintuplet_copy_to_byte_stream( uint64_t base32_quintuplet, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t padding_size, libcerror_error_t **error ) { static char *function = "libuna_base32_quintuplet_copy_to_byte_stream"; size_t safe_byte_stream_index = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } if( padding_size > 6 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid padding size value out of bounds.", function ); return( -1 ); } safe_byte_stream_index = *byte_stream_index; byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( ( base32_quintuplet >> 32 ) & 0xff ); if( padding_size <= 4 ) { if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( ( base32_quintuplet >> 24 ) & 0xff ); } if( padding_size <= 3 ) { if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( ( base32_quintuplet >> 16 ) & 0xff ); } if( padding_size <= 2 ) { if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( ( base32_quintuplet >> 8 ) & 0xff ); } if( padding_size == 0 ) { if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream is too small.", function ); return( -1 ); } byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( base32_quintuplet & 0xff ); } *byte_stream_index = safe_byte_stream_index; return( 1 ); } /* Determines the size of a byte stream from a base32 stream * * LIBUNA_BASE32_FLAG_STRIP_WHITESPACE removes leading space and tab characters, * and trailing space, tab and end of line characters * * Returns 1 if successful or -1 on error */ int libuna_base32_stream_size_to_byte_stream( const uint8_t *base32_stream, size_t base32_stream_size, size_t *byte_stream_size, uint32_t base32_variant, uint8_t flags, libcerror_error_t **error ) { static char *function = "libuna_base32_stream_size_to_byte_stream"; size_t base32_character_size = 0; size_t base32_stream_index = 0; size_t number_of_characters = 0; size_t safe_byte_stream_size = 0; size_t whitespace_size = 0; uint32_t base32_character1 = 0; uint32_t base32_character2 = 0; uint8_t character_limit = 0; uint8_t padding_size = 0; uint8_t strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; if( base32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream.", function ); return( -1 ); } if( base32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base32 stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } switch( base32_variant & 0x000000ffUL ) { case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0x000f0000UL ) { case LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL: case LIBUNA_BASE32_VARIANT_ALPHABET_HEX: break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character_size = 1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base32_character_size = 2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base32_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } if( ( flags & ~( LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags.", function ); return( -1 ); } /* Ignore trailing whitespace */ if( base32_stream_size > base32_character_size ) { base32_stream_index = base32_stream_size - base32_character_size; whitespace_size = 0; while( base32_stream_index > base32_character_size ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; } base32_stream_index -= base32_character_size; if( ( base32_character1 == (uint32_t) '\n' ) || ( base32_character1 == (uint32_t) '\r' ) ) { whitespace_size += base32_character_size; continue; } else if( ( flags & LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) == 0 ) { break; } if( ( base32_character1 == (uint32_t) ' ' ) || ( base32_character1 == (uint32_t) '\t' ) || ( base32_character1 == (uint32_t) '\v' ) ) { whitespace_size += base32_character_size; } else { break; } } base32_stream_size -= whitespace_size; } /* Determine and ignore the padding */ if( base32_stream_size > base32_character_size ) { base32_stream_index = base32_stream_size - base32_character_size; while( ( base32_stream_index > base32_character_size ) && ( padding_size <= 6 ) ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; } base32_stream_index -= base32_character_size; if( base32_character1 == (uint32_t) '=' ) { padding_size += 1; } } if( padding_size > 6 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid amount of padding - found more than 6 padding characters.", function ); return( -1 ); } base32_stream_size -= padding_size * base32_character_size; } base32_stream_index = 0; whitespace_size = 0; while( ( base32_stream_index + base32_character_size ) < base32_stream_size ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; } if( ( base32_character1 == (uint32_t) '\n' ) || ( base32_character1 == (uint32_t) '\r' ) ) { if( ( strip_mode != LIBUNA_STRIP_MODE_NON_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { /* Handle multi-character end-of-line */ if( ( base32_stream_index + base32_character_size ) < base32_stream_size ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character2 = base32_stream[ base32_stream_index + 1 ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index + 4 ] ), base32_character2 ); break; } if( ( base32_character2 == (uint32_t) '\n' ) || ( base32_character2 == (uint32_t) '\r' ) ) { base32_stream_index += base32_character_size; whitespace_size += base32_character_size; } } strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; } if( ( number_of_characters != 0 ) && ( character_limit != 0 ) ) { if( number_of_characters != (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in line: %" PRIzd " does not match character limit: %" PRIu8 ".", function, number_of_characters, character_limit ); return( -1 ); } number_of_characters = 0; } whitespace_size += base32_character_size; } else if( ( base32_character1 == (uint32_t) ' ' ) || ( base32_character1 == (uint32_t) '\t' ) || ( base32_character1 == (uint32_t) '\v' ) ) { if( ( flags & LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) == 0 ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_TRAILING_WHITESPACE; } if( ( strip_mode != LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { whitespace_size += base32_character_size; } } } else if( strip_mode == LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } else if( strip_mode == LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { switch( base32_variant & 0x000f0000UL ) { case LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL: /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( base32_character1 >= (uint32_t) 'A' ) && ( base32_character1 <= (uint32_t) 'I' ) ) { number_of_characters++; } else if( ( base32_character1 >= (uint32_t) 'J' ) && ( base32_character1 <= (uint32_t) 'R' ) ) { number_of_characters++; } else if( ( base32_character1 >= (uint32_t) 'S' ) && ( base32_character1 <= (uint32_t) 'Z' ) ) { number_of_characters++; } else if( ( base32_character1 >= (uint32_t) '2' ) && ( base32_character1 <= (uint32_t) '7' ) ) { number_of_characters++; } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } break; case LIBUNA_BASE32_VARIANT_ALPHABET_HEX: if( ( base32_character1 >= (uint32_t) '0' ) && ( base32_character1 <= (uint32_t) '9' ) ) { number_of_characters++; } /* A-V is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-V */ else if( ( base32_character1 >= (uint32_t) 'A' ) && ( base32_character1 <= (uint32_t) 'I' ) ) { number_of_characters++; } else if( ( base32_character1 >= (uint32_t) 'J' ) && ( base32_character1 <= (uint32_t) 'R' ) ) { number_of_characters++; } else if( ( base32_character1 >= (uint32_t) 'S' ) && ( base32_character1 <= (uint32_t) 'V' ) ) { number_of_characters++; } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } break; default: strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid character in base32 stream at index: %d.", function, base32_stream_index ); return( -1 ); } base32_stream_index += base32_character_size; } if( character_limit != 0 ) { if( number_of_characters > (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in last line exceed maximum.", function ); return( -1 ); } } base32_stream_size -= whitespace_size; /* Make sure the byte stream is able to hold * at least 5 bytes for each 8 base32 characters */ safe_byte_stream_size = ( base32_stream_size * 5 ) / ( base32_character_size * 8 ); *byte_stream_size = safe_byte_stream_size * base32_character_size; return( 1 ); } /* Copies a byte stream from a base32 stream * * LIBUNA_BASE32_FLAG_STRIP_WHITESPACE removes leading space and tab characters, * and trailing space, tab and end of line characters * * Returns 1 if successful or -1 on error */ int libuna_base32_stream_copy_to_byte_stream( const uint8_t *base32_stream, size_t base32_stream_size, uint8_t *byte_stream, size_t byte_stream_size, uint32_t base32_variant, uint8_t flags, libcerror_error_t **error ) { static char *function = "libuna_base32_stream_copy_to_byte_stream"; size_t base32_character_size = 0; size_t base32_stream_index = 0; size_t byte_stream_index = 0; size_t number_of_characters = 0; size_t whitespace_size = 0; uint64_t base32_quintuplet = 0; uint32_t base32_character1 = 0; uint32_t base32_character2 = 0; uint8_t character_limit = 0; uint8_t padding_size = 0; uint8_t strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; if( base32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream.", function ); return( -1 ); } if( base32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base32 stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } switch( base32_variant & 0x000000ffUL ) { case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character_size = 1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base32_character_size = 2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base32_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } if( ( flags & ~( LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags.", function ); return( -1 ); } /* Ignore trailing whitespace */ if( base32_stream_size > base32_character_size ) { base32_stream_index = base32_stream_size - base32_character_size; whitespace_size = 0; while( base32_stream_index > base32_character_size ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; } base32_stream_index -= base32_character_size; if( ( base32_character1 == (uint32_t) '\n' ) || ( base32_character1 == (uint32_t) '\r' ) ) { whitespace_size += base32_character_size; continue; } else if( ( flags & LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) == 0 ) { break; } if( ( base32_character1 == (uint32_t) ' ' ) || ( base32_character1 == (uint32_t) '\t' ) || ( base32_character1 == (uint32_t) '\v' ) ) { whitespace_size += base32_character_size; } else { break; } } base32_stream_size -= whitespace_size; } if( ( flags & LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) == 0 ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } base32_stream_index = 0; while( ( base32_stream_index + base32_character_size ) < base32_stream_size ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character1 = base32_stream[ base32_stream_index ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index ] ), base32_character1 ); break; } if( ( base32_character1 == (uint32_t) '\n' ) || ( base32_character1 == (uint32_t) '\r' ) ) { if( ( strip_mode != LIBUNA_STRIP_MODE_NON_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { /* Handle multi-character end-of-line */ if( ( base32_stream_index + base32_character_size ) < base32_stream_size ) { switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character2 = base32_stream[ base32_stream_index + 1 ]; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base32_stream[ base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base32_stream[ base32_stream_index + 2 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base32_stream[ base32_stream_index + 4 ] ), base32_character2 ); break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base32_stream[ base32_stream_index + 4 ] ), base32_character2 ); break; } if( ( base32_character2 == (uint32_t) '\n' ) || ( base32_character2 == (uint32_t) '\r' ) ) { base32_stream_index += base32_character_size; } } strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; base32_stream_index += base32_character_size; } if( character_limit != 0 ) { if( number_of_characters != (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in line does not match character limit.", function ); return( -1 ); } number_of_characters = 0; } } else if( ( base32_character1 == (uint32_t) ' ' ) || ( base32_character1 == (uint32_t) '\t' ) || ( base32_character1 == (uint32_t) '\v' ) ) { if( ( flags & LIBUNA_BASE32_FLAG_STRIP_WHITESPACE ) != 0 ) { if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_TRAILING_WHITESPACE; } if( ( strip_mode != LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } base32_stream_index += base32_character_size; } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else if( strip_mode == LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } else if( strip_mode == LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid character in base32 stream at index: %d.", function, base32_stream_index ); return( -1 ); } if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { if( padding_size > 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st base32 quintet.", function ); return( -1 ); } /* Convert the base32 stream into a base32 quintuplet */ if( libuna_base32_quintuplet_copy_from_base32_stream( &base32_quintuplet, base32_stream, base32_stream_size, &base32_stream_index, &padding_size, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base32 quintuplet from base32 stream.", function ); return( -1 ); } /* Convert the base32 quintuplet into a byte stream */ if( libuna_base32_quintuplet_copy_to_byte_stream( base32_quintuplet, byte_stream, byte_stream_size, &byte_stream_index, padding_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base32 quintuplet to byte stream.", function ); return( -1 ); } number_of_characters += 8 - padding_size; } } if( character_limit != 0 ) { if( number_of_characters > (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in last line exceed maximum.", function ); return( -1 ); } } return( 1 ); } /* Determines the size of a base32 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base32_stream_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, size_t *base32_stream_size, uint32_t base32_variant, libcerror_error_t **error ) { static char *function = "libuna_base32_stream_size_from_byte_stream"; size_t base32_character_size = 0; size_t safe_base32_stream_size = 0; size_t whitespace_size = 0; uint8_t character_limit = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( base32_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream size.", function ); return( -1 ); } switch( base32_variant & 0x000000ffUL ) { case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } switch( base32_variant & 0xf0000000UL ) { case LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM: base32_character_size = 1; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base32_character_size = 2; break; case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base32_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } /* Make sure the base32 stream is able to hold * at least 8 base32 characters for each 5 bytes */ safe_base32_stream_size = byte_stream_size / 5; if( ( byte_stream_size % 5 ) != 0 ) { safe_base32_stream_size += 1; } safe_base32_stream_size *= 8; if( character_limit != 0 ) { whitespace_size = safe_base32_stream_size / character_limit; if( ( safe_base32_stream_size % character_limit ) != 0 ) { whitespace_size += 1; } safe_base32_stream_size += whitespace_size; } *base32_stream_size = safe_base32_stream_size * base32_character_size; return( 1 ); } /* Copies a base32 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base32_stream_copy_from_byte_stream( uint8_t *base32_stream, size_t base32_stream_size, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base32_variant, libcerror_error_t **error ) { static char *function = "libuna_base32_stream_copy_from_byte_stream"; size_t base32_stream_index = 0; if( libuna_base32_stream_with_index_copy_from_byte_stream( base32_stream, base32_stream_size, &base32_stream_index, byte_stream, byte_stream_size, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base32 stream from byte stream.", function ); return( -1 ); } return( 1 ); } /* Copies a base32 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base32_stream_with_index_copy_from_byte_stream( uint8_t *base32_stream, size_t base32_stream_size, size_t *base32_stream_index, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base32_variant, libcerror_error_t **error ) { static char *function = "libuna_base32_stream_with_index_copy_from_byte_stream"; size_t calculated_base32_stream_size = 0; size_t safe_base32_stream_index = 0; size_t byte_stream_index = 0; size_t number_of_characters = 0; size_t whitespace_size = 0; uint64_t base32_quintuplet = 0; uint8_t character_limit = 0; uint8_t padding_size = 0; if( base32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream.", function ); return( -1 ); } if( base32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base32 stream size value exceeds maximum.", function ); return( -1 ); } if( base32_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base32 stream index.", function ); return( -1 ); } if( *base32_stream_index >= base32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream string too small.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } switch( base32_variant & 0x000000ffUL ) { case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base32 variant.", function ); return( -1 ); } safe_base32_stream_index = *base32_stream_index; /* Make sure the base32 stream is able to hold * at least 8 base32 characters for each 5 bytes */ calculated_base32_stream_size = byte_stream_size / 5; if( ( byte_stream_size % 5 ) != 0 ) { calculated_base32_stream_size += 1; } calculated_base32_stream_size *= 8; if( character_limit != 0 ) { whitespace_size = calculated_base32_stream_size / character_limit; if( ( calculated_base32_stream_size % character_limit ) != 0 ) { whitespace_size += 1; } calculated_base32_stream_size += whitespace_size; } if( base32_stream_size < calculated_base32_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base32 stream is too small.", function ); return( -1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream into a base32 quintuplet */ if( libuna_base32_quintuplet_copy_from_byte_stream( &base32_quintuplet, byte_stream, byte_stream_size, &byte_stream_index, &padding_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base32 quintuplet from byte stream.", function ); return( -1 ); } /* Convert the base32 quintuplet into a base32 stream */ if( libuna_base32_quintuplet_copy_to_base32_stream( base32_quintuplet, base32_stream, base32_stream_size, &safe_base32_stream_index, padding_size, base32_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base32 quintuplet to base32 stream.", function ); return( -1 ); } if( character_limit != 0 ) { number_of_characters += 8; if( number_of_characters >= (size_t) character_limit ) { base32_stream[ safe_base32_stream_index++ ] = (uint8_t) '\n'; number_of_characters = 0; } } } if( character_limit != 0 ) { if( number_of_characters != 0 ) { base32_stream[ safe_base32_stream_index++ ] = (uint8_t) '\n'; } } *base32_stream_index = safe_base32_stream_index; return( 1 ); } libewf-20140807/libuna/libuna_codepage_windows_950.h0000664000175000017500000000356413443450072024236 0ustar00lordyestalordyesta00000000000000/* * Windows 950 codepage (Traditional Chinese) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_950_H ) #define _LIBUNA_CODEPAGE_WINDOWS_950_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_codepage_windows_950_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_950_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_950_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_950_H ) */ libewf-20140807/libuna/libuna_error.h0000664000175000017500000000332713443450072021446 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2019, 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( _LIBUNA_INTERNAL_ERROR_H ) #define _LIBUNA_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBUNA ) #include #endif #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBUNA ) LIBUNA_EXTERN \ void libuna_error_free( libuna_error_t **error ); LIBUNA_EXTERN \ int libuna_error_fprint( libuna_error_t *error, FILE *stream ); LIBUNA_EXTERN \ int libuna_error_sprint( libuna_error_t *error, char *string, size_t size ); LIBUNA_EXTERN \ int libuna_error_backtrace_fprint( libuna_error_t *error, FILE *stream ); LIBUNA_EXTERN \ int libuna_error_backtrace_sprint( libuna_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_INTERNAL_ERROR_H ) */ libewf-20140807/libuna/libuna_codepage_windows_932.h0000664000175000017500000000356313443450072024235 0ustar00lordyestalordyesta00000000000000/* * Windows 932 codepage (Japanese Shift-JIS) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_932_H ) #define _LIBUNA_CODEPAGE_WINDOWS_932_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_codepage_windows_932_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_932_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_932_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_932_H ) */ libewf-20140807/libuna/libuna_utf8_stream.c0000664000175000017500000004314513443450072022553 0ustar00lordyestalordyesta00000000000000/* * UTF-8 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf8_stream.h" /* Copies an UTF-8 stream byte order mark (BOM) * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_copy_byte_order_mark( uint8_t *utf8_stream, size_t utf8_stream_size, size_t *utf8_stream_index, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_copy_byte_order_mark"; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream index.", function ); return( -1 ); } if( ( *utf8_stream_index + 3 ) > utf8_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 stream too small.", function ); return( -1 ); } utf8_stream[ *utf8_stream_index ] = 0xef; utf8_stream[ *utf8_stream_index + 1 ] = 0xbb; utf8_stream[ *utf8_stream_index + 2 ] = 0xbf; *utf8_stream_index += 3; return( 1 ); } /* Determines the size of an UTF-8 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_size_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf8_string_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf8_stream_size = 3; while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies an UTF-8 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_copy_from_utf8( uint8_t *utf8_stream, size_t utf8_stream_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_copy_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf8_stream_index = 0; size_t utf8_string_index = 0; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size < utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 stream is too small.", function ); return( -1 ); } if( libuna_utf8_stream_copy_byte_order_mark( utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-8 byte order mark.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 stream bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-8 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_size_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf8_stream_size = 3; while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies an UTF-8 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_copy_from_utf16( uint8_t *utf8_stream, size_t utf8_stream_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_copy_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; size_t utf8_stream_index = 0; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf8_stream_copy_byte_order_mark( utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-8 byte order mark.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 stream bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-8 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_size_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_string_index = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf8_stream_size = 3; while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many UTF-8 character bytes are required */ if( libuna_unicode_character_size_to_utf8( unicode_character, utf8_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-8.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies an UTF-8 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf8_stream_copy_from_utf32( uint8_t *utf8_stream, size_t utf8_stream_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf8_stream_copy_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_string_index = 0; size_t utf8_stream_index = 0; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf8_stream_copy_byte_order_mark( utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-8 byte order mark.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the Unicode character into UTF-8 character bytes */ if( libuna_unicode_character_copy_to_utf8( unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-8 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } libewf-20140807/libuna/libuna_codepage_koi8_r.h0000664000175000017500000000263113443450072023334 0ustar00lordyestalordyesta00000000000000/* * KOI8-R codepage (Russian Cyrillic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_KOI8_R_H ) #define _LIBUNA_CODEPAGE_KOI8_R_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ 64 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x2550[ 32 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_KOI8_R_H ) */ libewf-20140807/libuna/libuna_base16_stream.c0000664000175000017500000011504713443450072022747 0ustar00lordyestalordyesta00000000000000/* * Base16 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libuna_base16_stream.h" #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" /* Copies a base16 character from a base16 stream * Returns 1 if successful or -1 on error */ int libuna_base16_character_copy_from_base16_stream( uint32_t *base16_character, const uint8_t *base16_stream, uint32_t base16_variant, libcerror_error_t **error ) { static char *function = "libuna_base16_character_copy_from_base16_stream"; uint32_t safe_base16_character = 0; if( base16_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 character.", function ); return( -1 ); } if( base16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 stream.", function ); return( -1 ); } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: safe_base16_character = *base16_stream; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( base16_stream, safe_base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( base16_stream, safe_base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( base16_stream, safe_base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( base16_stream, safe_base16_character ); break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } if( ( safe_base16_character & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid base16 character.", function ); return( -1 ); } *base16_character = safe_base16_character; return( 1 ); } /* Determines the size of a byte stream from a base16 stream * * LIBUNA_BASE16_FLAG_STRIP_WHITESPACE removes leading space and tab characters, * and trailing space, tab and end of line characters * * Returns 1 if successful or -1 on error */ int libuna_base16_stream_size_to_byte_stream( const uint8_t *base16_stream, size_t base16_stream_size, size_t *byte_stream_size, uint32_t base16_variant, uint8_t flags, libcerror_error_t **error ) { static char *function = "libuna_base16_stream_size_to_byte_stream"; size_t base16_character_size = 0; size_t base16_stream_index = 0; size_t number_of_characters = 0; size_t whitespace_size = 0; uint32_t base16_character1 = 0; uint32_t base16_character2 = 0; uint8_t character_case = 0; uint8_t character_limit = 0; uint8_t strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; if( base16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 stream.", function ); return( -1 ); } if( base16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base16 stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } switch( base16_variant & 0x000000ffUL ) { case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0x000f0000UL ) { case LIBUNA_BASE16_VARIANT_CASE_LOWER: character_case = LIBUNA_CASE_LOWER; break; case LIBUNA_BASE16_VARIANT_CASE_MIXED: character_case = LIBUNA_CASE_MIXED; break; case LIBUNA_BASE16_VARIANT_CASE_UPPER: character_case = LIBUNA_CASE_UPPER; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_character_size = 1; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base16_character_size = 2; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base16_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } if( ( flags & ~( LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags.", function ); return( -1 ); } /* Ignore trailing whitespace */ if( base16_stream_size > base16_character_size ) { base16_stream_index = base16_stream_size - base16_character_size; whitespace_size = 0; while( base16_stream_index > base16_character_size ) { if( libuna_base16_character_copy_from_base16_stream( &base16_character1, &( base16_stream[ base16_stream_index ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } base16_stream_index -= base16_character_size; if( ( base16_character1 == (uint32_t) '\n' ) || ( base16_character1 == (uint32_t) '\r' ) ) { whitespace_size += base16_character_size; } else if( ( flags & LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) == 0 ) { break; } else if( ( base16_character1 == (uint32_t) ' ' ) || ( base16_character1 == (uint32_t) '\t' ) || ( base16_character1 == (uint32_t) '\v' ) ) { whitespace_size += base16_character_size; } else { break; } } base16_stream_size -= whitespace_size; } base16_stream_index = 0; whitespace_size = 0; while( base16_stream_index < base16_stream_size ) { if( libuna_base16_character_copy_from_base16_stream( &base16_character1, &( base16_stream[ base16_stream_index ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } base16_stream_index += base16_character_size; if( ( base16_character1 == (uint32_t) '\n' ) || ( base16_character1 == (uint32_t) '\r' ) ) { if( ( strip_mode != LIBUNA_STRIP_MODE_NON_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { /* Handle multi-character end-of-line */ if( ( base16_stream_index + base16_character_size ) < base16_stream_size ) { if( libuna_base16_character_copy_from_base16_stream( &base16_character2, &( base16_stream[ base16_stream_index + base16_character_size ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } if( ( base16_character2 == (uint32_t) '\n' ) || ( base16_character2 == (uint32_t) '\r' ) ) { base16_stream_index += base16_character_size; whitespace_size += base16_character_size; } } strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; } if( character_limit != 0 ) { if( number_of_characters != (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in line does not match character limit.", function ); return( -1 ); } number_of_characters = 0; } whitespace_size += base16_character_size; } else if( ( base16_character1 == (uint32_t) ' ' ) || ( base16_character1 == (uint32_t) '\t' ) || ( base16_character1 == (uint32_t) '\v' ) ) { if( ( flags & LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) != 0 ) { if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_TRAILING_WHITESPACE; } if( ( strip_mode != LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { whitespace_size += base16_character_size; } } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else if( strip_mode == LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } else if( strip_mode == LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { if( ( base16_character1 >= (uint32_t) 'A' ) && ( base16_character1 <= (uint32_t) 'F' ) ) { if( ( character_case != LIBUNA_CASE_MIXED ) && ( character_case != LIBUNA_CASE_UPPER ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } number_of_characters++; } else if( ( base16_character1 >= (uint32_t) 'a' ) && ( base16_character1 <= (uint32_t) 'f' ) ) { if( ( character_case != LIBUNA_CASE_MIXED ) && ( character_case != LIBUNA_CASE_LOWER ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } number_of_characters++; } else if( ( base16_character1 >= (uint32_t) '0' ) && ( base16_character1 <= (uint32_t) '9' ) ) { number_of_characters++; } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid character in base16 stream at index: %" PRIzd ".", function, base16_stream_index - base16_character_size ); return( -1 ); } } if( character_limit != 0 ) { if( number_of_characters > (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in last line exceed maximum.", function ); return( -1 ); } } base16_stream_size -= whitespace_size; /* Make sure the byte stream is able to hold * at least 1 byte for each 2 base16 characters */ base16_character_size *= 2; if( ( base16_stream_size % base16_character_size ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid base16 stream size.", function ); return( -1 ); } base16_stream_size /= base16_character_size; *byte_stream_size = base16_stream_size; return( 1 ); } /* Copies a byte stream from a base16 stream * * LIBUNA_BASE16_FLAG_STRIP_WHITESPACE removes leading space and tab characters, * and trailing space, tab and end of line characters * * Returns 1 if successful or -1 on error */ int libuna_base16_stream_copy_to_byte_stream( const uint8_t *base16_stream, size_t base16_stream_size, uint8_t *byte_stream, size_t byte_stream_size, uint32_t base16_variant, uint8_t flags, libcerror_error_t **error ) { static char *function = "libuna_base16_stream_copy_to_byte_stream"; size_t base16_character_size = 0; size_t base16_stream_index = 0; size_t byte_stream_index = 0; size_t number_of_characters = 0; size_t whitespace_size = 0; uint32_t base16_character1 = 0; uint32_t base16_character2 = 0; uint8_t byte_value = 0; uint8_t character_case = 0; uint8_t character_limit = 0; uint8_t strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; if( base16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 stream.", function ); return( -1 ); } if( base16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base16 stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } switch( base16_variant & 0x000000ffUL ) { case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0x000f0000UL ) { case LIBUNA_BASE16_VARIANT_CASE_LOWER: character_case = LIBUNA_CASE_LOWER; break; case LIBUNA_BASE16_VARIANT_CASE_MIXED: character_case = LIBUNA_CASE_MIXED; break; case LIBUNA_BASE16_VARIANT_CASE_UPPER: character_case = LIBUNA_CASE_UPPER; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_character_size = 1; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base16_character_size = 2; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base16_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } if( ( flags & ~( LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags.", function ); return( -1 ); } /* Ignore trailing whitespace */ if( base16_stream_size > base16_character_size ) { base16_stream_index = base16_stream_size - base16_character_size; whitespace_size = 0; while( base16_stream_index > base16_character_size ) { if( libuna_base16_character_copy_from_base16_stream( &base16_character1, &( base16_stream[ base16_stream_index ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } base16_stream_index -= base16_character_size; if( ( base16_character1 == (uint32_t) '\n' ) || ( base16_character1 == (uint32_t) '\r' ) ) { whitespace_size += base16_character_size; } else if( ( flags & LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) == 0 ) { break; } else if( ( base16_character1 == (uint32_t) ' ' ) || ( base16_character1 == (uint32_t) '\t' ) || ( base16_character1 == (uint32_t) '\v' ) ) { whitespace_size += base16_character_size; } else { break; } } base16_stream_size -= whitespace_size; } if( ( flags & LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) == 0 ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } base16_stream_index = 0; while( base16_stream_index < base16_stream_size ) { if( libuna_base16_character_copy_from_base16_stream( &base16_character1, &( base16_stream[ base16_stream_index ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } base16_stream_index += base16_character_size; if( ( base16_character1 == (uint32_t) '\n' ) || ( base16_character1 == (uint32_t) '\r' ) ) { if( ( strip_mode != LIBUNA_STRIP_MODE_NON_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { /* Handle multi-character end-of-line */ if( ( base16_stream_index + base16_character_size ) < base16_stream_size ) { if( libuna_base16_character_copy_from_base16_stream( &base16_character2, &( base16_stream[ base16_stream_index + base16_character_size ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } if( ( base16_character2 == (uint32_t) '\n' ) || ( base16_character2 == (uint32_t) '\r' ) ) { base16_stream_index += base16_character_size; } } strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; } if( character_limit != 0 ) { if( number_of_characters != (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in line does not match character limit.", function ); return( -1 ); } number_of_characters = 0; } } else if( ( base16_character1 == (uint32_t) ' ' ) || ( base16_character1 == (uint32_t) '\t' ) || ( base16_character1 == (uint32_t) '\v' ) ) { if( ( flags & LIBUNA_BASE16_FLAG_STRIP_WHITESPACE ) != 0 ) { if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_TRAILING_WHITESPACE; } if( ( strip_mode != LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else if( strip_mode == LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } else if( strip_mode == LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid character in base16 stream at index: %" PRIzd ".", function, base16_stream_index - base16_character_size ); return( -1 ); } if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { byte_value = 0; if( ( base16_character1 >= (uint32_t) 'A' ) && ( base16_character1 <= (uint32_t) 'F' ) ) { if( ( character_case != LIBUNA_CASE_MIXED ) && ( character_case != LIBUNA_CASE_UPPER ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } byte_value = (uint8_t) ( base16_character1 - (uint32_t) 'A' + 10 ); } else if( ( base16_character1 >= (uint32_t) 'a' ) && ( base16_character1 <= (uint32_t) 'f' ) ) { if( ( character_case != LIBUNA_CASE_MIXED ) && ( character_case != LIBUNA_CASE_LOWER ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } byte_value = (uint8_t) ( base16_character1 - (uint32_t) 'a' + 10 ); } else if( ( base16_character1 >= (uint32_t) '0' ) && ( base16_character1 <= (uint32_t) '9' ) ) { byte_value = (uint8_t) ( base16_character1 - (uint32_t) '0' ); } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid base16 character stream at index: %" PRIzd ".", function, base16_stream_index - base16_character_size ); return( -1 ); } byte_value <<= 4; if( libuna_base16_character_copy_from_base16_stream( &base16_character1, &( base16_stream[ base16_stream_index ] ), base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base16 character at index: %" PRIzd ".", function, base16_stream_index ); return( -1 ); } base16_stream_index += base16_character_size; if( ( base16_character1 >= (uint32_t) 'A' ) && ( base16_character1 <= (uint32_t) 'F' ) ) { if( ( character_case != LIBUNA_CASE_MIXED ) && ( character_case != LIBUNA_CASE_UPPER ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } byte_value |= (uint8_t) ( base16_character1 - (uint32_t) 'A' + 10 ); } else if( ( base16_character1 >= (uint32_t) 'a' ) && ( base16_character1 <= (uint32_t) 'f' ) ) { if( ( character_case != LIBUNA_CASE_MIXED ) && ( character_case != LIBUNA_CASE_LOWER ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } byte_value |= (uint8_t) ( base16_character1 - (uint32_t) 'a' + 10 ); } else if( ( base16_character1 >= (uint32_t) '0' ) && ( base16_character1 <= (uint32_t) '9' ) ) { byte_value |= (uint8_t) ( base16_character1 - (uint32_t) '0' ); } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid base16 character stream at index: %" PRIzd ".", function, base16_stream_index - base16_character_size ); return( -1 ); } if( byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream is too small.", function ); return( -1 ); } byte_stream[ byte_stream_index++ ] = byte_value; number_of_characters += 2; } } if( character_limit != 0 ) { if( number_of_characters > (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in last line exceed maximum.", function ); return( -1 ); } } return( 1 ); } /* Determines the size of a base16 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base16_stream_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, size_t *base16_stream_size, uint32_t base16_variant, libcerror_error_t **error ) { static char *function = "libuna_base16_stream_size_from_byte_stream"; size_t base16_character_size = 0; size_t safe_base16_stream_size = 0; size_t whitespace_size = 0; uint8_t character_limit = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( base16_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 stream size.", function ); return( -1 ); } switch( base16_variant & 0x000000ffUL ) { case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0x000f0000UL ) { case LIBUNA_BASE16_VARIANT_CASE_LOWER: case LIBUNA_BASE16_VARIANT_CASE_MIXED: case LIBUNA_BASE16_VARIANT_CASE_UPPER: break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_character_size = 1; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base16_character_size = 2; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base16_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } /* The base16 stream contains 2 characters for every byte */ safe_base16_stream_size = byte_stream_size * 2; if( character_limit != 0 ) { whitespace_size = safe_base16_stream_size / character_limit; if( ( safe_base16_stream_size % character_limit ) != 0 ) { whitespace_size += 1; } safe_base16_stream_size += whitespace_size; } *base16_stream_size = safe_base16_stream_size * base16_character_size; return( 1 ); } /* Copies a base16 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base16_stream_copy_from_byte_stream( uint8_t *base16_stream, size_t base16_stream_size, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base16_variant, libcerror_error_t **error ) { static char *function = "libuna_base16_stream_copy_from_byte_stream"; size_t base16_stream_index = 0; if( libuna_base16_stream_with_index_copy_from_byte_stream( base16_stream, base16_stream_size, &base16_stream_index, byte_stream, byte_stream_size, base16_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base16 stream from byte stream.", function ); return( -1 ); } return( 1 ); } /* Copies a base16 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base16_stream_with_index_copy_from_byte_stream( uint8_t *base16_stream, size_t base16_stream_size, size_t *base16_stream_index, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base16_variant, libcerror_error_t **error ) { static char *function = "libuna_base16_stream_with_index_copy_from_byte_stream"; size_t base16_character_size = 0; size_t byte_stream_index = 0; size_t calculated_base16_stream_size = 0; size_t number_of_characters = 0; size_t safe_base16_stream_index = 0; size_t whitespace_size = 0; uint32_t a_character_value = 0; uint32_t base16_character = 0; uint8_t character_limit = 0; if( base16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 stream.", function ); return( -1 ); } if( base16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base16 stream size value exceeds maximum.", function ); return( -1 ); } if( base16_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base16 stream index.", function ); return( -1 ); } if( *base16_stream_index >= base16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base16 stream string too small.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } switch( base16_variant & 0x000000ffUL ) { case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0x000f0000UL ) { case LIBUNA_BASE16_VARIANT_CASE_LOWER: a_character_value = (uint32_t) 'a' - 10; break; case LIBUNA_BASE16_VARIANT_CASE_MIXED: case LIBUNA_BASE16_VARIANT_CASE_UPPER: a_character_value = (uint32_t) 'A' - 10; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_character_size = 1; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base16_character_size = 2; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base16_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base16 variant.", function ); return( -1 ); } safe_base16_stream_index = *base16_stream_index; /* Make sure the base16 stream is able to hold * at least 2 bytes for each byte */ calculated_base16_stream_size = byte_stream_size * 2; if( character_limit != 0 ) { whitespace_size = calculated_base16_stream_size / character_limit; if( ( calculated_base16_stream_size % character_limit ) != 0 ) { whitespace_size += 1; } calculated_base16_stream_size += whitespace_size; } calculated_base16_stream_size *= base16_character_size; if( base16_stream_size < calculated_base16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base16 stream is too small.", function ); return( -1 ); } while( byte_stream_index < byte_stream_size ) { base16_character = byte_stream[ byte_stream_index ] >> 4; if( base16_character <= 9 ) { base16_character += (uint32_t) '0'; } else { base16_character += a_character_value; } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_stream[ safe_base16_stream_index ] = (uint8_t) base16_character; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; } safe_base16_stream_index += base16_character_size; base16_character = byte_stream[ byte_stream_index ] & 0x0f; if( base16_character <= 9 ) { base16_character += (uint32_t) '0'; } else { base16_character += a_character_value; } switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_stream[ safe_base16_stream_index ] = (uint8_t) base16_character; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; } safe_base16_stream_index += base16_character_size; if( character_limit != 0 ) { number_of_characters += 2; if( number_of_characters >= (size_t) character_limit ) { base16_character = (uint32_t) '\n'; switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_stream[ safe_base16_stream_index ] = (uint8_t) base16_character; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; } safe_base16_stream_index += base16_character_size; number_of_characters = 0; } } byte_stream_index++; } if( character_limit != 0 ) { if( number_of_characters != 0 ) { base16_character = (uint32_t) '\n'; switch( base16_variant & 0xf0000000UL ) { case LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM: base16_stream[ safe_base16_stream_index ] = (uint8_t) base16_character; break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; case LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base16_stream[ safe_base16_stream_index ] ), base16_character ); break; } safe_base16_stream_index += base16_character_size; } } *base16_stream_index = safe_base16_stream_index; return( 1 ); } libewf-20140807/libuna/libuna_codepage_windows_1250.h0000664000175000017500000000342013443450072024277 0ustar00lordyestalordyesta00000000000000/* * Windows 1250 codepage (Central European) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1250_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1250_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x0138[ 72 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x02d8[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2010[ 24 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2030[ 16 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1250_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_16.h0000664000175000017500000000337113443450072023740 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-16 codepage (Latin 10) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_16_H ) #define _LIBUNA_CODEPAGE_ISO_8859_16_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ 8 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_16_H ) */ libewf-20140807/libuna/libuna_utf16_stream.h0000664000175000017500000000604413443450072022634 0ustar00lordyestalordyesta00000000000000/* * UTF-16 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF16_STREAM_H ) #define _LIBUNA_UTF16_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf16_stream_copy_byte_order_mark( uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_stream_index, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf16_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_stream_copy_from_utf8( uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_stream_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_utf16_stream */ LIBUNA_EXTERN \ int libuna_utf16_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_stream_copy_from_utf16( uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_stream_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_utf16_stream */ LIBUNA_EXTERN \ int libuna_utf16_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf16_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_stream_copy_from_utf32( uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_stream_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_utf16_stream */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF16_STREAM_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_10.h0000664000175000017500000000266213443450072023734 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-10 codepage (Nordic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_10_H ) #define _LIBUNA_CODEPAGE_ISO_8859_10_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ 144 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ 16 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_10_H ) */ libewf-20140807/libuna/libuna_codepage_windows_932.c0000664000175000017500000105716513443450072024240 0ustar00lordyestalordyesta00000000000000/* * Windows 932 codepage (Japanese Shift-JIS) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_932.h" #include "libuna_libcerror.h" #include "libuna_types.h" /* Extended ASCII to Unicode character lookup table for Windows 932 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8140[ 109 ] = { 0x3000, 0x3001, 0x3002, 0xff0c, 0xff0e, 0x30fb, 0xff1a, 0xff1b, 0xff1f, 0xff01, 0x309b, 0x309c, 0x00b4, 0xff40, 0x00a8, 0xff3e, 0xffe3, 0xff3f, 0x30fd, 0x30fe, 0x309d, 0x309e, 0x3003, 0x4edd, 0x3005, 0x3006, 0x3007, 0x30fc, 0x2015, 0x2010, 0xff0f, 0xff3c, 0xff5e, 0x2225, 0xff5c, 0x2026, 0x2025, 0x2018, 0x2019, 0x201c, 0x201d, 0xff08, 0xff09, 0x3014, 0x3015, 0xff3b, 0xff3d, 0xff5b, 0xff5d, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3010, 0x3011, 0xff0b, 0xff0d, 0x00b1, 0x00d7, 0xfffd, 0x00f7, 0xff1d, 0x2260, 0xff1c, 0xff1e, 0x2266, 0x2267, 0x221e, 0x2234, 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xffe5, 0xff04, 0xffe0, 0xffe1, 0xff05, 0xff03, 0xff06, 0xff0a, 0xff20, 0x00a7, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x25bd, 0x25bc, 0x203b, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81b8[ 8 ] = { 0x2208, 0x220b, 0x2286, 0x2287, 0x2282, 0x2283, 0x222a, 0x2229 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81c8[ 7 ] = { 0x2227, 0x2228, 0xffe2, 0x21d2, 0x21d4, 0x2200, 0x2203 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81da[ 15 ] = { 0x2220, 0x22a5, 0x2312, 0x2202, 0x2207, 0x2261, 0x2252, 0x226a, 0x226b, 0x221a, 0x223d, 0x221d, 0x2235, 0x222b, 0x222c }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81f0[ 8 ] = { 0x212b, 0x2030, 0x266f, 0x266d, 0x266a, 0x2020, 0x2021, 0x00b6 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8440[ 33 ] = { 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8470[ 15 ] = { 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x849f[ 32 ] = { 0x2500, 0x2502, 0x250c, 0x2510, 0x2518, 0x2514, 0x251c, 0x252c, 0x2524, 0x2534, 0x253c, 0x2501, 0x2503, 0x250f, 0x2513, 0x251b, 0x2517, 0x2523, 0x2533, 0x252b, 0x253b, 0x254b, 0x2520, 0x252f, 0x2528, 0x2537, 0x253f, 0x251d, 0x2530, 0x2525, 0x2538, 0x2542 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x875f[ 23 ] = { 0x3349, 0x3314, 0x3322, 0x334d, 0x3318, 0x3327, 0x3303, 0x3336, 0x3351, 0x3357, 0x330d, 0x3326, 0x3323, 0x332b, 0x334a, 0x333b, 0x339c, 0x339d, 0x339e, 0x338e, 0x338f, 0x33c4, 0x33a1 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8780[ 29 ] = { 0x301d, 0x301f, 0x2116, 0x33cd, 0x2121, 0x32a4, 0x32a5, 0x32a6, 0x32a7, 0x32a8, 0x3231, 0x3232, 0x3239, 0x337e, 0x337d, 0x337c, 0x2252, 0x2261, 0x222b, 0x222e, 0x2211, 0x221a, 0x22a5, 0x2220, 0x221f, 0x22bf, 0x2235, 0x2229, 0x222a }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x889f[ 94 ] = { 0x4e9c, 0x5516, 0x5a03, 0x963f, 0x54c0, 0x611b, 0x6328, 0x59f6, 0x9022, 0x8475, 0x831c, 0x7a50, 0x60aa, 0x63e1, 0x6e25, 0x65ed, 0x8466, 0x82a6, 0x9bf5, 0x6893, 0x5727, 0x65a1, 0x6271, 0x5b9b, 0x59d0, 0x867b, 0x98f4, 0x7d62, 0x7dbe, 0x9b8e, 0x6216, 0x7c9f, 0x88b7, 0x5b89, 0x5eb5, 0x6309, 0x6697, 0x6848, 0x95c7, 0x978d, 0x674f, 0x4ee5, 0x4f0a, 0x4f4d, 0x4f9d, 0x5049, 0x56f2, 0x5937, 0x59d4, 0x5a01, 0x5c09, 0x60df, 0x610f, 0x6170, 0x6613, 0x6905, 0x70ba, 0x754f, 0x7570, 0x79fb, 0x7dad, 0x7def, 0x80c3, 0x840e, 0x8863, 0x8b02, 0x9055, 0x907a, 0x533b, 0x4e95, 0x4ea5, 0x57df, 0x80b2, 0x90c1, 0x78ef, 0x4e00, 0x58f1, 0x6ea2, 0x9038, 0x7a32, 0x8328, 0x828b, 0x9c2f, 0x5141, 0x5370, 0x54bd, 0x54e1, 0x56e0, 0x59fb, 0x5f15, 0x98f2, 0x6deb, 0x80e4, 0x852d }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8940[ 189 ] = { 0x9662, 0x9670, 0x96a0, 0x97fb, 0x540b, 0x53f3, 0x5b87, 0x70cf, 0x7fbd, 0x8fc2, 0x96e8, 0x536f, 0x9d5c, 0x7aba, 0x4e11, 0x7893, 0x81fc, 0x6e26, 0x5618, 0x5504, 0x6b1d, 0x851a, 0x9c3b, 0x59e5, 0x53a9, 0x6d66, 0x74dc, 0x958f, 0x5642, 0x4e91, 0x904b, 0x96f2, 0x834f, 0x990c, 0x53e1, 0x55b6, 0x5b30, 0x5f71, 0x6620, 0x66f3, 0x6804, 0x6c38, 0x6cf3, 0x6d29, 0x745b, 0x76c8, 0x7a4e, 0x9834, 0x82f1, 0x885b, 0x8a60, 0x92ed, 0x6db2, 0x75ab, 0x76ca, 0x99c5, 0x60a6, 0x8b01, 0x8d8a, 0x95b2, 0x698e, 0x53ad, 0x5186, 0xfffd, 0x5712, 0x5830, 0x5944, 0x5bb4, 0x5ef6, 0x6028, 0x63a9, 0x63f4, 0x6cbf, 0x6f14, 0x708e, 0x7114, 0x7159, 0x71d5, 0x733f, 0x7e01, 0x8276, 0x82d1, 0x8597, 0x9060, 0x925b, 0x9d1b, 0x5869, 0x65bc, 0x6c5a, 0x7525, 0x51f9, 0x592e, 0x5965, 0x5f80, 0x5fdc, 0x62bc, 0x65fa, 0x6a2a, 0x6b27, 0x6bb4, 0x738b, 0x7fc1, 0x8956, 0x9d2c, 0x9d0e, 0x9ec4, 0x5ca1, 0x6c96, 0x837b, 0x5104, 0x5c4b, 0x61b6, 0x81c6, 0x6876, 0x7261, 0x4e59, 0x4ffa, 0x5378, 0x6069, 0x6e29, 0x7a4f, 0x97f3, 0x4e0b, 0x5316, 0x4eee, 0x4f55, 0x4f3d, 0x4fa1, 0x4f73, 0x52a0, 0x53ef, 0x5609, 0x590f, 0x5ac1, 0x5bb6, 0x5be1, 0x79d1, 0x6687, 0x679c, 0x67b6, 0x6b4c, 0x6cb3, 0x706b, 0x73c2, 0x798d, 0x79be, 0x7a3c, 0x7b87, 0x82b1, 0x82db, 0x8304, 0x8377, 0x83ef, 0x83d3, 0x8766, 0x8ab2, 0x5629, 0x8ca8, 0x8fe6, 0x904e, 0x971e, 0x868a, 0x4fc4, 0x5ce8, 0x6211, 0x7259, 0x753b, 0x81e5, 0x82bd, 0x86fe, 0x8cc0, 0x96c5, 0x9913, 0x99d5, 0x4ecb, 0x4f1a, 0x89e3, 0x56de, 0x584a, 0x58ca, 0x5efb, 0x5feb, 0x602a, 0x6094, 0x6062, 0x61d0, 0x6212, 0x62d0, 0x6539 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8a40[ 189 ] = { 0x9b41, 0x6666, 0x68b0, 0x6d77, 0x7070, 0x754c, 0x7686, 0x7d75, 0x82a5, 0x87f9, 0x958b, 0x968e, 0x8c9d, 0x51f1, 0x52be, 0x5916, 0x54b3, 0x5bb3, 0x5d16, 0x6168, 0x6982, 0x6daf, 0x788d, 0x84cb, 0x8857, 0x8a72, 0x93a7, 0x9ab8, 0x6d6c, 0x99a8, 0x86d9, 0x57a3, 0x67ff, 0x86ce, 0x920e, 0x5283, 0x5687, 0x5404, 0x5ed3, 0x62e1, 0x64b9, 0x683c, 0x6838, 0x6bbb, 0x7372, 0x78ba, 0x7a6b, 0x899a, 0x89d2, 0x8d6b, 0x8f03, 0x90ed, 0x95a3, 0x9694, 0x9769, 0x5b66, 0x5cb3, 0x697d, 0x984d, 0x984e, 0x639b, 0x7b20, 0x6a2b, 0xfffd, 0x6a7f, 0x68b6, 0x9c0d, 0x6f5f, 0x5272, 0x559d, 0x6070, 0x62ec, 0x6d3b, 0x6e07, 0x6ed1, 0x845b, 0x8910, 0x8f44, 0x4e14, 0x9c39, 0x53f6, 0x691b, 0x6a3a, 0x9784, 0x682a, 0x515c, 0x7ac3, 0x84b2, 0x91dc, 0x938c, 0x565b, 0x9d28, 0x6822, 0x8305, 0x8431, 0x7ca5, 0x5208, 0x82c5, 0x74e6, 0x4e7e, 0x4f83, 0x51a0, 0x5bd2, 0x520a, 0x52d8, 0x52e7, 0x5dfb, 0x559a, 0x582a, 0x59e6, 0x5b8c, 0x5b98, 0x5bdb, 0x5e72, 0x5e79, 0x60a3, 0x611f, 0x6163, 0x61be, 0x63db, 0x6562, 0x67d1, 0x6853, 0x68fa, 0x6b3e, 0x6b53, 0x6c57, 0x6f22, 0x6f97, 0x6f45, 0x74b0, 0x7518, 0x76e3, 0x770b, 0x7aff, 0x7ba1, 0x7c21, 0x7de9, 0x7f36, 0x7ff0, 0x809d, 0x8266, 0x839e, 0x89b3, 0x8acc, 0x8cab, 0x9084, 0x9451, 0x9593, 0x9591, 0x95a2, 0x9665, 0x97d3, 0x9928, 0x8218, 0x4e38, 0x542b, 0x5cb8, 0x5dcc, 0x73a9, 0x764c, 0x773c, 0x5ca9, 0x7feb, 0x8d0b, 0x96c1, 0x9811, 0x9854, 0x9858, 0x4f01, 0x4f0e, 0x5371, 0x559c, 0x5668, 0x57fa, 0x5947, 0x5b09, 0x5bc4, 0x5c90, 0x5e0c, 0x5e7e, 0x5fcc, 0x63ee, 0x673a, 0x65d7, 0x65e2, 0x671f, 0x68cb, 0x68c4 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8b40[ 189 ] = { 0x6a5f, 0x5e30, 0x6bc5, 0x6c17, 0x6c7d, 0x757f, 0x7948, 0x5b63, 0x7a00, 0x7d00, 0x5fbd, 0x898f, 0x8a18, 0x8cb4, 0x8d77, 0x8ecc, 0x8f1d, 0x98e2, 0x9a0e, 0x9b3c, 0x4e80, 0x507d, 0x5100, 0x5993, 0x5b9c, 0x622f, 0x6280, 0x64ec, 0x6b3a, 0x72a0, 0x7591, 0x7947, 0x7fa9, 0x87fb, 0x8abc, 0x8b70, 0x63ac, 0x83ca, 0x97a0, 0x5409, 0x5403, 0x55ab, 0x6854, 0x6a58, 0x8a70, 0x7827, 0x6775, 0x9ecd, 0x5374, 0x5ba2, 0x811a, 0x8650, 0x9006, 0x4e18, 0x4e45, 0x4ec7, 0x4f11, 0x53ca, 0x5438, 0x5bae, 0x5f13, 0x6025, 0x6551, 0xfffd, 0x673d, 0x6c42, 0x6c72, 0x6ce3, 0x7078, 0x7403, 0x7a76, 0x7aae, 0x7b08, 0x7d1a, 0x7cfe, 0x7d66, 0x65e7, 0x725b, 0x53bb, 0x5c45, 0x5de8, 0x62d2, 0x62e0, 0x6319, 0x6e20, 0x865a, 0x8a31, 0x8ddd, 0x92f8, 0x6f01, 0x79a6, 0x9b5a, 0x4ea8, 0x4eab, 0x4eac, 0x4f9b, 0x4fa0, 0x50d1, 0x5147, 0x7af6, 0x5171, 0x51f6, 0x5354, 0x5321, 0x537f, 0x53eb, 0x55ac, 0x5883, 0x5ce1, 0x5f37, 0x5f4a, 0x602f, 0x6050, 0x606d, 0x631f, 0x6559, 0x6a4b, 0x6cc1, 0x72c2, 0x72ed, 0x77ef, 0x80f8, 0x8105, 0x8208, 0x854e, 0x90f7, 0x93e1, 0x97ff, 0x9957, 0x9a5a, 0x4ef0, 0x51dd, 0x5c2d, 0x6681, 0x696d, 0x5c40, 0x66f2, 0x6975, 0x7389, 0x6850, 0x7c81, 0x50c5, 0x52e4, 0x5747, 0x5dfe, 0x9326, 0x65a4, 0x6b23, 0x6b3d, 0x7434, 0x7981, 0x79bd, 0x7b4b, 0x7dca, 0x82b9, 0x83cc, 0x887f, 0x895f, 0x8b39, 0x8fd1, 0x91d1, 0x541f, 0x9280, 0x4e5d, 0x5036, 0x53e5, 0x533a, 0x72d7, 0x7396, 0x77e9, 0x82e6, 0x8eaf, 0x99c6, 0x99c8, 0x99d2, 0x5177, 0x611a, 0x865e, 0x55b0, 0x7a7a, 0x5076, 0x5bd3, 0x9047, 0x9685, 0x4e32, 0x6adb, 0x91e7, 0x5c51, 0x5c48 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8c40[ 189 ] = { 0x6398, 0x7a9f, 0x6c93, 0x9774, 0x8f61, 0x7aaa, 0x718a, 0x9688, 0x7c82, 0x6817, 0x7e70, 0x6851, 0x936c, 0x52f2, 0x541b, 0x85ab, 0x8a13, 0x7fa4, 0x8ecd, 0x90e1, 0x5366, 0x8888, 0x7941, 0x4fc2, 0x50be, 0x5211, 0x5144, 0x5553, 0x572d, 0x73ea, 0x578b, 0x5951, 0x5f62, 0x5f84, 0x6075, 0x6176, 0x6167, 0x61a9, 0x63b2, 0x643a, 0x656c, 0x666f, 0x6842, 0x6e13, 0x7566, 0x7a3d, 0x7cfb, 0x7d4c, 0x7d99, 0x7e4b, 0x7f6b, 0x830e, 0x834a, 0x86cd, 0x8a08, 0x8a63, 0x8b66, 0x8efd, 0x981a, 0x9d8f, 0x82b8, 0x8fce, 0x9be8, 0xfffd, 0x5287, 0x621f, 0x6483, 0x6fc0, 0x9699, 0x6841, 0x5091, 0x6b20, 0x6c7a, 0x6f54, 0x7a74, 0x7d50, 0x8840, 0x8a23, 0x6708, 0x4ef6, 0x5039, 0x5026, 0x5065, 0x517c, 0x5238, 0x5263, 0x55a7, 0x570f, 0x5805, 0x5acc, 0x5efa, 0x61b2, 0x61f8, 0x62f3, 0x6372, 0x691c, 0x6a29, 0x727d, 0x72ac, 0x732e, 0x7814, 0x786f, 0x7d79, 0x770c, 0x80a9, 0x898b, 0x8b19, 0x8ce2, 0x8ed2, 0x9063, 0x9375, 0x967a, 0x9855, 0x9a13, 0x9e78, 0x5143, 0x539f, 0x53b3, 0x5e7b, 0x5f26, 0x6e1b, 0x6e90, 0x7384, 0x73fe, 0x7d43, 0x8237, 0x8a00, 0x8afa, 0x9650, 0x4e4e, 0x500b, 0x53e4, 0x547c, 0x56fa, 0x59d1, 0x5b64, 0x5df1, 0x5eab, 0x5f27, 0x6238, 0x6545, 0x67af, 0x6e56, 0x72d0, 0x7cca, 0x88b4, 0x80a1, 0x80e1, 0x83f0, 0x864e, 0x8a87, 0x8de8, 0x9237, 0x96c7, 0x9867, 0x9f13, 0x4e94, 0x4e92, 0x4f0d, 0x5348, 0x5449, 0x543e, 0x5a2f, 0x5f8c, 0x5fa1, 0x609f, 0x68a7, 0x6a8e, 0x745a, 0x7881, 0x8a9e, 0x8aa4, 0x8b77, 0x9190, 0x4e5e, 0x9bc9, 0x4ea4, 0x4f7c, 0x4faf, 0x5019, 0x5016, 0x5149, 0x516c, 0x529f, 0x52b9, 0x52fe, 0x539a, 0x53e3, 0x5411 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8d40[ 189 ] = { 0x540e, 0x5589, 0x5751, 0x57a2, 0x597d, 0x5b54, 0x5b5d, 0x5b8f, 0x5de5, 0x5de7, 0x5df7, 0x5e78, 0x5e83, 0x5e9a, 0x5eb7, 0x5f18, 0x6052, 0x614c, 0x6297, 0x62d8, 0x63a7, 0x653b, 0x6602, 0x6643, 0x66f4, 0x676d, 0x6821, 0x6897, 0x69cb, 0x6c5f, 0x6d2a, 0x6d69, 0x6e2f, 0x6e9d, 0x7532, 0x7687, 0x786c, 0x7a3f, 0x7ce0, 0x7d05, 0x7d18, 0x7d5e, 0x7db1, 0x8015, 0x8003, 0x80af, 0x80b1, 0x8154, 0x818f, 0x822a, 0x8352, 0x884c, 0x8861, 0x8b1b, 0x8ca2, 0x8cfc, 0x90ca, 0x9175, 0x9271, 0x783f, 0x92fc, 0x95a4, 0x964d, 0xfffd, 0x9805, 0x9999, 0x9ad8, 0x9d3b, 0x525b, 0x52ab, 0x53f7, 0x5408, 0x58d5, 0x62f7, 0x6fe0, 0x8c6a, 0x8f5f, 0x9eb9, 0x514b, 0x523b, 0x544a, 0x56fd, 0x7a40, 0x9177, 0x9d60, 0x9ed2, 0x7344, 0x6f09, 0x8170, 0x7511, 0x5ffd, 0x60da, 0x9aa8, 0x72db, 0x8fbc, 0x6b64, 0x9803, 0x4eca, 0x56f0, 0x5764, 0x58be, 0x5a5a, 0x6068, 0x61c7, 0x660f, 0x6606, 0x6839, 0x68b1, 0x6df7, 0x75d5, 0x7d3a, 0x826e, 0x9b42, 0x4e9b, 0x4f50, 0x53c9, 0x5506, 0x5d6f, 0x5de6, 0x5dee, 0x67fb, 0x6c99, 0x7473, 0x7802, 0x8a50, 0x9396, 0x88df, 0x5750, 0x5ea7, 0x632b, 0x50b5, 0x50ac, 0x518d, 0x6700, 0x54c9, 0x585e, 0x59bb, 0x5bb0, 0x5f69, 0x624d, 0x63a1, 0x683d, 0x6b73, 0x6e08, 0x707d, 0x91c7, 0x7280, 0x7815, 0x7826, 0x796d, 0x658e, 0x7d30, 0x83dc, 0x88c1, 0x8f09, 0x969b, 0x5264, 0x5728, 0x6750, 0x7f6a, 0x8ca1, 0x51b4, 0x5742, 0x962a, 0x583a, 0x698a, 0x80b4, 0x54b2, 0x5d0e, 0x57fc, 0x7895, 0x9dfa, 0x4f5c, 0x524a, 0x548b, 0x643e, 0x6628, 0x6714, 0x67f5, 0x7a84, 0x7b56, 0x7d22, 0x932f, 0x685c, 0x9bad, 0x7b39, 0x5319, 0x518a, 0x5237 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8e40[ 189 ] = { 0x5bdf, 0x62f6, 0x64ae, 0x64e6, 0x672d, 0x6bba, 0x85a9, 0x96d1, 0x7690, 0x9bd6, 0x634c, 0x9306, 0x9bab, 0x76bf, 0x6652, 0x4e09, 0x5098, 0x53c2, 0x5c71, 0x60e8, 0x6492, 0x6563, 0x685f, 0x71e6, 0x73ca, 0x7523, 0x7b97, 0x7e82, 0x8695, 0x8b83, 0x8cdb, 0x9178, 0x9910, 0x65ac, 0x66ab, 0x6b8b, 0x4ed5, 0x4ed4, 0x4f3a, 0x4f7f, 0x523a, 0x53f8, 0x53f2, 0x55e3, 0x56db, 0x58eb, 0x59cb, 0x59c9, 0x59ff, 0x5b50, 0x5c4d, 0x5e02, 0x5e2b, 0x5fd7, 0x601d, 0x6307, 0x652f, 0x5b5c, 0x65af, 0x65bd, 0x65e8, 0x679d, 0x6b62, 0xfffd, 0x6b7b, 0x6c0f, 0x7345, 0x7949, 0x79c1, 0x7cf8, 0x7d19, 0x7d2b, 0x80a2, 0x8102, 0x81f3, 0x8996, 0x8a5e, 0x8a69, 0x8a66, 0x8a8c, 0x8aee, 0x8cc7, 0x8cdc, 0x96cc, 0x98fc, 0x6b6f, 0x4e8b, 0x4f3c, 0x4f8d, 0x5150, 0x5b57, 0x5bfa, 0x6148, 0x6301, 0x6642, 0x6b21, 0x6ecb, 0x6cbb, 0x723e, 0x74bd, 0x75d4, 0x78c1, 0x793a, 0x800c, 0x8033, 0x81ea, 0x8494, 0x8f9e, 0x6c50, 0x9e7f, 0x5f0f, 0x8b58, 0x9d2b, 0x7afa, 0x8ef8, 0x5b8d, 0x96eb, 0x4e03, 0x53f1, 0x57f7, 0x5931, 0x5ac9, 0x5ba4, 0x6089, 0x6e7f, 0x6f06, 0x75be, 0x8cea, 0x5b9f, 0x8500, 0x7be0, 0x5072, 0x67f4, 0x829d, 0x5c61, 0x854a, 0x7e1e, 0x820e, 0x5199, 0x5c04, 0x6368, 0x8d66, 0x659c, 0x716e, 0x793e, 0x7d17, 0x8005, 0x8b1d, 0x8eca, 0x906e, 0x86c7, 0x90aa, 0x501f, 0x52fa, 0x5c3a, 0x6753, 0x707c, 0x7235, 0x914c, 0x91c8, 0x932b, 0x82e5, 0x5bc2, 0x5f31, 0x60f9, 0x4e3b, 0x53d6, 0x5b88, 0x624b, 0x6731, 0x6b8a, 0x72e9, 0x73e0, 0x7a2e, 0x816b, 0x8da3, 0x9152, 0x9996, 0x5112, 0x53d7, 0x546a, 0x5bff, 0x6388, 0x6a39, 0x7dac, 0x9700, 0x56da, 0x53ce, 0x5468 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8f40[ 189 ] = { 0x5b97, 0x5c31, 0x5dde, 0x4fee, 0x6101, 0x62fe, 0x6d32, 0x79c0, 0x79cb, 0x7d42, 0x7e4d, 0x7fd2, 0x81ed, 0x821f, 0x8490, 0x8846, 0x8972, 0x8b90, 0x8e74, 0x8f2f, 0x9031, 0x914b, 0x916c, 0x96c6, 0x919c, 0x4ec0, 0x4f4f, 0x5145, 0x5341, 0x5f93, 0x620e, 0x67d4, 0x6c41, 0x6e0b, 0x7363, 0x7e26, 0x91cd, 0x9283, 0x53d4, 0x5919, 0x5bbf, 0x6dd1, 0x795d, 0x7e2e, 0x7c9b, 0x587e, 0x719f, 0x51fa, 0x8853, 0x8ff0, 0x4fca, 0x5cfb, 0x6625, 0x77ac, 0x7ae3, 0x821c, 0x99ff, 0x51c6, 0x5faa, 0x65ec, 0x696f, 0x6b89, 0x6df3, 0xfffd, 0x6e96, 0x6f64, 0x76fe, 0x7d14, 0x5de1, 0x9075, 0x9187, 0x9806, 0x51e6, 0x521d, 0x6240, 0x6691, 0x66d9, 0x6e1a, 0x5eb6, 0x7dd2, 0x7f72, 0x66f8, 0x85af, 0x85f7, 0x8af8, 0x52a9, 0x53d9, 0x5973, 0x5e8f, 0x5f90, 0x6055, 0x92e4, 0x9664, 0x50b7, 0x511f, 0x52dd, 0x5320, 0x5347, 0x53ec, 0x54e8, 0x5546, 0x5531, 0x5617, 0x5968, 0x59be, 0x5a3c, 0x5bb5, 0x5c06, 0x5c0f, 0x5c11, 0x5c1a, 0x5e84, 0x5e8a, 0x5ee0, 0x5f70, 0x627f, 0x6284, 0x62db, 0x638c, 0x6377, 0x6607, 0x660c, 0x662d, 0x6676, 0x677e, 0x68a2, 0x6a1f, 0x6a35, 0x6cbc, 0x6d88, 0x6e09, 0x6e58, 0x713c, 0x7126, 0x7167, 0x75c7, 0x7701, 0x785d, 0x7901, 0x7965, 0x79f0, 0x7ae0, 0x7b11, 0x7ca7, 0x7d39, 0x8096, 0x83d6, 0x848b, 0x8549, 0x885d, 0x88f3, 0x8a1f, 0x8a3c, 0x8a54, 0x8a73, 0x8c61, 0x8cde, 0x91a4, 0x9266, 0x937e, 0x9418, 0x969c, 0x9798, 0x4e0a, 0x4e08, 0x4e1e, 0x4e57, 0x5197, 0x5270, 0x57ce, 0x5834, 0x58cc, 0x5b22, 0x5e38, 0x60c5, 0x64fe, 0x6761, 0x6756, 0x6d44, 0x72b6, 0x7573, 0x7a63, 0x84b8, 0x8b72, 0x91b8, 0x9320, 0x5631, 0x57f4, 0x98fe }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9040[ 189 ] = { 0x62ed, 0x690d, 0x6b96, 0x71ed, 0x7e54, 0x8077, 0x8272, 0x89e6, 0x98df, 0x8755, 0x8fb1, 0x5c3b, 0x4f38, 0x4fe1, 0x4fb5, 0x5507, 0x5a20, 0x5bdd, 0x5be9, 0x5fc3, 0x614e, 0x632f, 0x65b0, 0x664b, 0x68ee, 0x699b, 0x6d78, 0x6df1, 0x7533, 0x75b9, 0x771f, 0x795e, 0x79e6, 0x7d33, 0x81e3, 0x82af, 0x85aa, 0x89aa, 0x8a3a, 0x8eab, 0x8f9b, 0x9032, 0x91dd, 0x9707, 0x4eba, 0x4ec1, 0x5203, 0x5875, 0x58ec, 0x5c0b, 0x751a, 0x5c3d, 0x814e, 0x8a0a, 0x8fc5, 0x9663, 0x976d, 0x7b25, 0x8acf, 0x9808, 0x9162, 0x56f3, 0x53a8, 0xfffd, 0x9017, 0x5439, 0x5782, 0x5e25, 0x63a8, 0x6c34, 0x708a, 0x7761, 0x7c8b, 0x7fe0, 0x8870, 0x9042, 0x9154, 0x9310, 0x9318, 0x968f, 0x745e, 0x9ac4, 0x5d07, 0x5d69, 0x6570, 0x67a2, 0x8da8, 0x96db, 0x636e, 0x6749, 0x6919, 0x83c5, 0x9817, 0x96c0, 0x88fe, 0x6f84, 0x647a, 0x5bf8, 0x4e16, 0x702c, 0x755d, 0x662f, 0x51c4, 0x5236, 0x52e2, 0x59d3, 0x5f81, 0x6027, 0x6210, 0x653f, 0x6574, 0x661f, 0x6674, 0x68f2, 0x6816, 0x6b63, 0x6e05, 0x7272, 0x751f, 0x76db, 0x7cbe, 0x8056, 0x58f0, 0x88fd, 0x897f, 0x8aa0, 0x8a93, 0x8acb, 0x901d, 0x9192, 0x9752, 0x9759, 0x6589, 0x7a0e, 0x8106, 0x96bb, 0x5e2d, 0x60dc, 0x621a, 0x65a5, 0x6614, 0x6790, 0x77f3, 0x7a4d, 0x7c4d, 0x7e3e, 0x810a, 0x8cac, 0x8d64, 0x8de1, 0x8e5f, 0x78a9, 0x5207, 0x62d9, 0x63a5, 0x6442, 0x6298, 0x8a2d, 0x7a83, 0x7bc0, 0x8aac, 0x96ea, 0x7d76, 0x820c, 0x8749, 0x4ed9, 0x5148, 0x5343, 0x5360, 0x5ba3, 0x5c02, 0x5c16, 0x5ddd, 0x6226, 0x6247, 0x64b0, 0x6813, 0x6834, 0x6cc9, 0x6d45, 0x6d17, 0x67d3, 0x6f5c, 0x714e, 0x717d, 0x65cb, 0x7a7f, 0x7bad, 0x7dda }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9140[ 189 ] = { 0x7e4a, 0x7fa8, 0x817a, 0x821b, 0x8239, 0x85a6, 0x8a6e, 0x8cce, 0x8df5, 0x9078, 0x9077, 0x92ad, 0x9291, 0x9583, 0x9bae, 0x524d, 0x5584, 0x6f38, 0x7136, 0x5168, 0x7985, 0x7e55, 0x81b3, 0x7cce, 0x564c, 0x5851, 0x5ca8, 0x63aa, 0x66fe, 0x66fd, 0x695a, 0x72d9, 0x758f, 0x758e, 0x790e, 0x7956, 0x79df, 0x7c97, 0x7d20, 0x7d44, 0x8607, 0x8a34, 0x963b, 0x9061, 0x9f20, 0x50e7, 0x5275, 0x53cc, 0x53e2, 0x5009, 0x55aa, 0x58ee, 0x594f, 0x723d, 0x5b8b, 0x5c64, 0x531d, 0x60e3, 0x60f3, 0x635c, 0x6383, 0x633f, 0x63bb, 0xfffd, 0x64cd, 0x65e9, 0x66f9, 0x5de3, 0x69cd, 0x69fd, 0x6f15, 0x71e5, 0x4e89, 0x75e9, 0x76f8, 0x7a93, 0x7cdf, 0x7dcf, 0x7d9c, 0x8061, 0x8349, 0x8358, 0x846c, 0x84bc, 0x85fb, 0x88c5, 0x8d70, 0x9001, 0x906d, 0x9397, 0x971c, 0x9a12, 0x50cf, 0x5897, 0x618e, 0x81d3, 0x8535, 0x8d08, 0x9020, 0x4fc3, 0x5074, 0x5247, 0x5373, 0x606f, 0x6349, 0x675f, 0x6e2c, 0x8db3, 0x901f, 0x4fd7, 0x5c5e, 0x8cca, 0x65cf, 0x7d9a, 0x5352, 0x8896, 0x5176, 0x63c3, 0x5b58, 0x5b6b, 0x5c0a, 0x640d, 0x6751, 0x905c, 0x4ed6, 0x591a, 0x592a, 0x6c70, 0x8a51, 0x553e, 0x5815, 0x59a5, 0x60f0, 0x6253, 0x67c1, 0x8235, 0x6955, 0x9640, 0x99c4, 0x9a28, 0x4f53, 0x5806, 0x5bfe, 0x8010, 0x5cb1, 0x5e2f, 0x5f85, 0x6020, 0x614b, 0x6234, 0x66ff, 0x6cf0, 0x6ede, 0x80ce, 0x817f, 0x82d4, 0x888b, 0x8cb8, 0x9000, 0x902e, 0x968a, 0x9edb, 0x9bdb, 0x4ee3, 0x53f0, 0x5927, 0x7b2c, 0x918d, 0x984c, 0x9df9, 0x6edd, 0x7027, 0x5353, 0x5544, 0x5b85, 0x6258, 0x629e, 0x62d3, 0x6ca2, 0x6fef, 0x7422, 0x8a17, 0x9438, 0x6fc1, 0x8afe, 0x8338, 0x51e7, 0x86f8, 0x53ea }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9240[ 189 ] = { 0x53e9, 0x4f46, 0x9054, 0x8fb0, 0x596a, 0x8131, 0x5dfd, 0x7aea, 0x8fbf, 0x68da, 0x8c37, 0x72f8, 0x9c48, 0x6a3d, 0x8ab0, 0x4e39, 0x5358, 0x5606, 0x5766, 0x62c5, 0x63a2, 0x65e6, 0x6b4e, 0x6de1, 0x6e5b, 0x70ad, 0x77ed, 0x7aef, 0x7baa, 0x7dbb, 0x803d, 0x80c6, 0x86cb, 0x8a95, 0x935b, 0x56e3, 0x58c7, 0x5f3e, 0x65ad, 0x6696, 0x6a80, 0x6bb5, 0x7537, 0x8ac7, 0x5024, 0x77e5, 0x5730, 0x5f1b, 0x6065, 0x667a, 0x6c60, 0x75f4, 0x7a1a, 0x7f6e, 0x81f4, 0x8718, 0x9045, 0x99b3, 0x7bc9, 0x755c, 0x7af9, 0x7b51, 0x84c4, 0xfffd, 0x9010, 0x79e9, 0x7a92, 0x8336, 0x5ae1, 0x7740, 0x4e2d, 0x4ef2, 0x5b99, 0x5fe0, 0x62bd, 0x663c, 0x67f1, 0x6ce8, 0x866b, 0x8877, 0x8a3b, 0x914e, 0x92f3, 0x99d0, 0x6a17, 0x7026, 0x732a, 0x82e7, 0x8457, 0x8caf, 0x4e01, 0x5146, 0x51cb, 0x558b, 0x5bf5, 0x5e16, 0x5e33, 0x5e81, 0x5f14, 0x5f35, 0x5f6b, 0x5fb4, 0x61f2, 0x6311, 0x66a2, 0x671d, 0x6f6e, 0x7252, 0x753a, 0x773a, 0x8074, 0x8139, 0x8178, 0x8776, 0x8abf, 0x8adc, 0x8d85, 0x8df3, 0x929a, 0x9577, 0x9802, 0x9ce5, 0x52c5, 0x6357, 0x76f4, 0x6715, 0x6c88, 0x73cd, 0x8cc3, 0x93ae, 0x9673, 0x6d25, 0x589c, 0x690e, 0x69cc, 0x8ffd, 0x939a, 0x75db, 0x901a, 0x585a, 0x6802, 0x63b4, 0x69fb, 0x4f43, 0x6f2c, 0x67d8, 0x8fbb, 0x8526, 0x7db4, 0x9354, 0x693f, 0x6f70, 0x576a, 0x58f7, 0x5b2c, 0x7d2c, 0x722a, 0x540a, 0x91e3, 0x9db4, 0x4ead, 0x4f4e, 0x505c, 0x5075, 0x5243, 0x8c9e, 0x5448, 0x5824, 0x5b9a, 0x5e1d, 0x5e95, 0x5ead, 0x5ef7, 0x5f1f, 0x608c, 0x62b5, 0x633a, 0x63d0, 0x68af, 0x6c40, 0x7887, 0x798e, 0x7a0b, 0x7de0, 0x8247, 0x8a02, 0x8ae6, 0x8e44, 0x9013 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9340[ 189 ] = { 0x90b8, 0x912d, 0x91d8, 0x9f0e, 0x6ce5, 0x6458, 0x64e2, 0x6575, 0x6ef4, 0x7684, 0x7b1b, 0x9069, 0x93d1, 0x6eba, 0x54f2, 0x5fb9, 0x64a4, 0x8f4d, 0x8fed, 0x9244, 0x5178, 0x586b, 0x5929, 0x5c55, 0x5e97, 0x6dfb, 0x7e8f, 0x751c, 0x8cbc, 0x8ee2, 0x985b, 0x70b9, 0x4f1d, 0x6bbf, 0x6fb1, 0x7530, 0x96fb, 0x514e, 0x5410, 0x5835, 0x5857, 0x59ac, 0x5c60, 0x5f92, 0x6597, 0x675c, 0x6e21, 0x767b, 0x83df, 0x8ced, 0x9014, 0x90fd, 0x934d, 0x7825, 0x783a, 0x52aa, 0x5ea6, 0x571f, 0x5974, 0x6012, 0x5012, 0x515a, 0x51ac, 0xfffd, 0x51cd, 0x5200, 0x5510, 0x5854, 0x5858, 0x5957, 0x5b95, 0x5cf6, 0x5d8b, 0x60bc, 0x6295, 0x642d, 0x6771, 0x6843, 0x68bc, 0x68df, 0x76d7, 0x6dd8, 0x6e6f, 0x6d9b, 0x706f, 0x71c8, 0x5f53, 0x75d8, 0x7977, 0x7b49, 0x7b54, 0x7b52, 0x7cd6, 0x7d71, 0x5230, 0x8463, 0x8569, 0x85e4, 0x8a0e, 0x8b04, 0x8c46, 0x8e0f, 0x9003, 0x900f, 0x9419, 0x9676, 0x982d, 0x9a30, 0x95d8, 0x50cd, 0x52d5, 0x540c, 0x5802, 0x5c0e, 0x61a7, 0x649e, 0x6d1e, 0x77b3, 0x7ae5, 0x80f4, 0x8404, 0x9053, 0x9285, 0x5ce0, 0x9d07, 0x533f, 0x5f97, 0x5fb3, 0x6d9c, 0x7279, 0x7763, 0x79bf, 0x7be4, 0x6bd2, 0x72ec, 0x8aad, 0x6803, 0x6a61, 0x51f8, 0x7a81, 0x6934, 0x5c4a, 0x9cf6, 0x82eb, 0x5bc5, 0x9149, 0x701e, 0x5678, 0x5c6f, 0x60c7, 0x6566, 0x6c8c, 0x8c5a, 0x9041, 0x9813, 0x5451, 0x66c7, 0x920d, 0x5948, 0x90a3, 0x5185, 0x4e4d, 0x51ea, 0x8599, 0x8b0e, 0x7058, 0x637a, 0x934b, 0x6962, 0x99b4, 0x7e04, 0x7577, 0x5357, 0x6960, 0x8edf, 0x96e3, 0x6c5d, 0x4e8c, 0x5c3c, 0x5f10, 0x8fe9, 0x5302, 0x8cd1, 0x8089, 0x8679, 0x5eff, 0x65e5, 0x4e73, 0x5165 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9440[ 189 ] = { 0x5982, 0x5c3f, 0x97ee, 0x4efb, 0x598a, 0x5fcd, 0x8a8d, 0x6fe1, 0x79b0, 0x7962, 0x5be7, 0x8471, 0x732b, 0x71b1, 0x5e74, 0x5ff5, 0x637b, 0x649a, 0x71c3, 0x7c98, 0x4e43, 0x5efc, 0x4e4b, 0x57dc, 0x56a2, 0x60a9, 0x6fc3, 0x7d0d, 0x80fd, 0x8133, 0x81bf, 0x8fb2, 0x8997, 0x86a4, 0x5df4, 0x628a, 0x64ad, 0x8987, 0x6777, 0x6ce2, 0x6d3e, 0x7436, 0x7834, 0x5a46, 0x7f75, 0x82ad, 0x99ac, 0x4ff3, 0x5ec3, 0x62dd, 0x6392, 0x6557, 0x676f, 0x76c3, 0x724c, 0x80cc, 0x80ba, 0x8f29, 0x914d, 0x500d, 0x57f9, 0x5a92, 0x6885, 0xfffd, 0x6973, 0x7164, 0x72fd, 0x8cb7, 0x58f2, 0x8ce0, 0x966a, 0x9019, 0x877f, 0x79e4, 0x77e7, 0x8429, 0x4f2f, 0x5265, 0x535a, 0x62cd, 0x67cf, 0x6cca, 0x767d, 0x7b94, 0x7c95, 0x8236, 0x8584, 0x8feb, 0x66dd, 0x6f20, 0x7206, 0x7e1b, 0x83ab, 0x99c1, 0x9ea6, 0x51fd, 0x7bb1, 0x7872, 0x7bb8, 0x8087, 0x7b48, 0x6ae8, 0x5e61, 0x808c, 0x7551, 0x7560, 0x516b, 0x9262, 0x6e8c, 0x767a, 0x9197, 0x9aea, 0x4f10, 0x7f70, 0x629c, 0x7b4f, 0x95a5, 0x9ce9, 0x567a, 0x5859, 0x86e4, 0x96bc, 0x4f34, 0x5224, 0x534a, 0x53cd, 0x53db, 0x5e06, 0x642c, 0x6591, 0x677f, 0x6c3e, 0x6c4e, 0x7248, 0x72af, 0x73ed, 0x7554, 0x7e41, 0x822c, 0x85e9, 0x8ca9, 0x7bc4, 0x91c6, 0x7169, 0x9812, 0x98ef, 0x633d, 0x6669, 0x756a, 0x76e4, 0x78d0, 0x8543, 0x86ee, 0x532a, 0x5351, 0x5426, 0x5983, 0x5e87, 0x5f7c, 0x60b2, 0x6249, 0x6279, 0x62ab, 0x6590, 0x6bd4, 0x6ccc, 0x75b2, 0x76ae, 0x7891, 0x79d8, 0x7dcb, 0x7f77, 0x80a5, 0x88ab, 0x8ab9, 0x8cbb, 0x907f, 0x975e, 0x98db, 0x6a0b, 0x7c38, 0x5099, 0x5c3e, 0x5fae, 0x6787, 0x6bd8, 0x7435, 0x7709, 0x7f8e }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9540[ 189 ] = { 0x9f3b, 0x67ca, 0x7a17, 0x5339, 0x758b, 0x9aed, 0x5f66, 0x819d, 0x83f1, 0x8098, 0x5f3c, 0x5fc5, 0x7562, 0x7b46, 0x903c, 0x6867, 0x59eb, 0x5a9b, 0x7d10, 0x767e, 0x8b2c, 0x4ff5, 0x5f6a, 0x6a19, 0x6c37, 0x6f02, 0x74e2, 0x7968, 0x8868, 0x8a55, 0x8c79, 0x5edf, 0x63cf, 0x75c5, 0x79d2, 0x82d7, 0x9328, 0x92f2, 0x849c, 0x86ed, 0x9c2d, 0x54c1, 0x5f6c, 0x658c, 0x6d5c, 0x7015, 0x8ca7, 0x8cd3, 0x983b, 0x654f, 0x74f6, 0x4e0d, 0x4ed8, 0x57e0, 0x592b, 0x5a66, 0x5bcc, 0x51a8, 0x5e03, 0x5e9c, 0x6016, 0x6276, 0x6577, 0xfffd, 0x65a7, 0x666e, 0x6d6e, 0x7236, 0x7b26, 0x8150, 0x819a, 0x8299, 0x8b5c, 0x8ca0, 0x8ce6, 0x8d74, 0x961c, 0x9644, 0x4fae, 0x64ab, 0x6b66, 0x821e, 0x8461, 0x856a, 0x90e8, 0x5c01, 0x6953, 0x98a8, 0x847a, 0x8557, 0x4f0f, 0x526f, 0x5fa9, 0x5e45, 0x670d, 0x798f, 0x8179, 0x8907, 0x8986, 0x6df5, 0x5f17, 0x6255, 0x6cb8, 0x4ecf, 0x7269, 0x9b92, 0x5206, 0x543b, 0x5674, 0x58b3, 0x61a4, 0x626e, 0x711a, 0x596e, 0x7c89, 0x7cde, 0x7d1b, 0x96f0, 0x6587, 0x805e, 0x4e19, 0x4f75, 0x5175, 0x5840, 0x5e63, 0x5e73, 0x5f0a, 0x67c4, 0x4e26, 0x853d, 0x9589, 0x965b, 0x7c73, 0x9801, 0x50fb, 0x58c1, 0x7656, 0x78a7, 0x5225, 0x77a5, 0x8511, 0x7b86, 0x504f, 0x5909, 0x7247, 0x7bc7, 0x7de8, 0x8fba, 0x8fd4, 0x904d, 0x4fbf, 0x52c9, 0x5a29, 0x5f01, 0x97ad, 0x4fdd, 0x8217, 0x92ea, 0x5703, 0x6355, 0x6b69, 0x752b, 0x88dc, 0x8f14, 0x7a42, 0x52df, 0x5893, 0x6155, 0x620a, 0x66ae, 0x6bcd, 0x7c3f, 0x83e9, 0x5023, 0x4ff8, 0x5305, 0x5446, 0x5831, 0x5949, 0x5b9d, 0x5cf0, 0x5cef, 0x5d29, 0x5e96, 0x62b1, 0x6367, 0x653e, 0x65b9, 0x670b }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9640[ 189 ] = { 0x6cd5, 0x6ce1, 0x70f9, 0x7832, 0x7e2b, 0x80de, 0x82b3, 0x840c, 0x84ec, 0x8702, 0x8912, 0x8a2a, 0x8c4a, 0x90a6, 0x92d2, 0x98fd, 0x9cf3, 0x9d6c, 0x4e4f, 0x4ea1, 0x508d, 0x5256, 0x574a, 0x59a8, 0x5e3d, 0x5fd8, 0x5fd9, 0x623f, 0x66b4, 0x671b, 0x67d0, 0x68d2, 0x5192, 0x7d21, 0x80aa, 0x81a8, 0x8b00, 0x8c8c, 0x8cbf, 0x927e, 0x9632, 0x5420, 0x982c, 0x5317, 0x50d5, 0x535c, 0x58a8, 0x64b2, 0x6734, 0x7267, 0x7766, 0x7a46, 0x91e6, 0x52c3, 0x6ca1, 0x6b86, 0x5800, 0x5e4c, 0x5954, 0x672c, 0x7ffb, 0x51e1, 0x76c6, 0xfffd, 0x6469, 0x78e8, 0x9b54, 0x9ebb, 0x57cb, 0x59b9, 0x6627, 0x679a, 0x6bce, 0x54e9, 0x69d9, 0x5e55, 0x819c, 0x6795, 0x9baa, 0x67fe, 0x9c52, 0x685d, 0x4ea6, 0x4fe3, 0x53c8, 0x62b9, 0x672b, 0x6cab, 0x8fc4, 0x4fad, 0x7e6d, 0x9ebf, 0x4e07, 0x6162, 0x6e80, 0x6f2b, 0x8513, 0x5473, 0x672a, 0x9b45, 0x5df3, 0x7b95, 0x5cac, 0x5bc6, 0x871c, 0x6e4a, 0x84d1, 0x7a14, 0x8108, 0x5999, 0x7c8d, 0x6c11, 0x7720, 0x52d9, 0x5922, 0x7121, 0x725f, 0x77db, 0x9727, 0x9d61, 0x690b, 0x5a7f, 0x5a18, 0x51a5, 0x540d, 0x547d, 0x660e, 0x76df, 0x8ff7, 0x9298, 0x9cf4, 0x59ea, 0x725d, 0x6ec5, 0x514d, 0x68c9, 0x7dbf, 0x7dec, 0x9762, 0x9eba, 0x6478, 0x6a21, 0x8302, 0x5984, 0x5b5f, 0x6bdb, 0x731b, 0x76f2, 0x7db2, 0x8017, 0x8499, 0x5132, 0x6728, 0x9ed9, 0x76ee, 0x6762, 0x52ff, 0x9905, 0x5c24, 0x623b, 0x7c7e, 0x8cb0, 0x554f, 0x60b6, 0x7d0b, 0x9580, 0x5301, 0x4e5f, 0x51b6, 0x591c, 0x723a, 0x8036, 0x91ce, 0x5f25, 0x77e2, 0x5384, 0x5f79, 0x7d04, 0x85ac, 0x8a33, 0x8e8d, 0x9756, 0x67f3, 0x85ae, 0x9453, 0x6109, 0x6108, 0x6cb9, 0x7652 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9740[ 189 ] = { 0x8aed, 0x8f38, 0x552f, 0x4f51, 0x512a, 0x52c7, 0x53cb, 0x5ba5, 0x5e7d, 0x60a0, 0x6182, 0x63d6, 0x6709, 0x67da, 0x6e67, 0x6d8c, 0x7336, 0x7337, 0x7531, 0x7950, 0x88d5, 0x8a98, 0x904a, 0x9091, 0x90f5, 0x96c4, 0x878d, 0x5915, 0x4e88, 0x4f59, 0x4e0e, 0x8a89, 0x8f3f, 0x9810, 0x50ad, 0x5e7c, 0x5996, 0x5bb9, 0x5eb8, 0x63da, 0x63fa, 0x64c1, 0x66dc, 0x694a, 0x69d8, 0x6d0b, 0x6eb6, 0x7194, 0x7528, 0x7aaf, 0x7f8a, 0x8000, 0x8449, 0x84c9, 0x8981, 0x8b21, 0x8e0a, 0x9065, 0x967d, 0x990a, 0x617e, 0x6291, 0x6b32, 0xfffd, 0x6c83, 0x6d74, 0x7fcc, 0x7ffc, 0x6dc0, 0x7f85, 0x87ba, 0x88f8, 0x6765, 0x83b1, 0x983c, 0x96f7, 0x6d1b, 0x7d61, 0x843d, 0x916a, 0x4e71, 0x5375, 0x5d50, 0x6b04, 0x6feb, 0x85cd, 0x862d, 0x89a7, 0x5229, 0x540f, 0x5c65, 0x674e, 0x68a8, 0x7406, 0x7483, 0x75e2, 0x88cf, 0x88e1, 0x91cc, 0x96e2, 0x9678, 0x5f8b, 0x7387, 0x7acb, 0x844e, 0x63a0, 0x7565, 0x5289, 0x6d41, 0x6e9c, 0x7409, 0x7559, 0x786b, 0x7c92, 0x9686, 0x7adc, 0x9f8d, 0x4fb6, 0x616e, 0x65c5, 0x865c, 0x4e86, 0x4eae, 0x50da, 0x4e21, 0x51cc, 0x5bee, 0x6599, 0x6881, 0x6dbc, 0x731f, 0x7642, 0x77ad, 0x7a1c, 0x7ce7, 0x826f, 0x8ad2, 0x907c, 0x91cf, 0x9675, 0x9818, 0x529b, 0x7dd1, 0x502b, 0x5398, 0x6797, 0x6dcb, 0x71d0, 0x7433, 0x81e8, 0x8f2a, 0x96a3, 0x9c57, 0x9e9f, 0x7460, 0x5841, 0x6d99, 0x7d2f, 0x985e, 0x4ee4, 0x4f36, 0x4f8b, 0x51b7, 0x52b1, 0x5dba, 0x601c, 0x73b2, 0x793c, 0x82d3, 0x9234, 0x96b7, 0x96f6, 0x970a, 0x9e97, 0x9f62, 0x66a6, 0x6b74, 0x5217, 0x52a3, 0x70c8, 0x88c2, 0x5ec9, 0x604b, 0x6190, 0x6f23, 0x7149, 0x7c3e, 0x7df4, 0x806f }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9840[ 51 ] = { 0x84ee, 0x9023, 0x932c, 0x5442, 0x9b6f, 0x6ad3, 0x7089, 0x8cc2, 0x8def, 0x9732, 0x52b4, 0x5a41, 0x5eca, 0x5f04, 0x6717, 0x697c, 0x6994, 0x6d6a, 0x6f0f, 0x7262, 0x72fc, 0x7bed, 0x8001, 0x807e, 0x874b, 0x90ce, 0x516d, 0x9e93, 0x7984, 0x808b, 0x9332, 0x8ad6, 0x502d, 0x548c, 0x8a71, 0x6b6a, 0x8cc4, 0x8107, 0x60d1, 0x67a0, 0x9df2, 0x4e99, 0x4e98, 0x9c10, 0x8a6b, 0x85c1, 0x8568, 0x6900, 0x6e7e, 0x7897, 0x8155 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x989f[ 94 ] = { 0x5f0c, 0x4e10, 0x4e15, 0x4e2a, 0x4e31, 0x4e36, 0x4e3c, 0x4e3f, 0x4e42, 0x4e56, 0x4e58, 0x4e82, 0x4e85, 0x8c6b, 0x4e8a, 0x8212, 0x5f0d, 0x4e8e, 0x4e9e, 0x4e9f, 0x4ea0, 0x4ea2, 0x4eb0, 0x4eb3, 0x4eb6, 0x4ece, 0x4ecd, 0x4ec4, 0x4ec6, 0x4ec2, 0x4ed7, 0x4ede, 0x4eed, 0x4edf, 0x4ef7, 0x4f09, 0x4f5a, 0x4f30, 0x4f5b, 0x4f5d, 0x4f57, 0x4f47, 0x4f76, 0x4f88, 0x4f8f, 0x4f98, 0x4f7b, 0x4f69, 0x4f70, 0x4f91, 0x4f6f, 0x4f86, 0x4f96, 0x5118, 0x4fd4, 0x4fdf, 0x4fce, 0x4fd8, 0x4fdb, 0x4fd1, 0x4fda, 0x4fd0, 0x4fe4, 0x4fe5, 0x501a, 0x5028, 0x5014, 0x502a, 0x5025, 0x5005, 0x4f1c, 0x4ff6, 0x5021, 0x5029, 0x502c, 0x4ffe, 0x4fef, 0x5011, 0x5006, 0x5043, 0x5047, 0x6703, 0x5055, 0x5050, 0x5048, 0x505a, 0x5056, 0x506c, 0x5078, 0x5080, 0x509a, 0x5085, 0x50b4, 0x50b2 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9940[ 189 ] = { 0x50c9, 0x50ca, 0x50b3, 0x50c2, 0x50d6, 0x50de, 0x50e5, 0x50ed, 0x50e3, 0x50ee, 0x50f9, 0x50f5, 0x5109, 0x5101, 0x5102, 0x5116, 0x5115, 0x5114, 0x511a, 0x5121, 0x513a, 0x5137, 0x513c, 0x513b, 0x513f, 0x5140, 0x5152, 0x514c, 0x5154, 0x5162, 0x7af8, 0x5169, 0x516a, 0x516e, 0x5180, 0x5182, 0x56d8, 0x518c, 0x5189, 0x518f, 0x5191, 0x5193, 0x5195, 0x5196, 0x51a4, 0x51a6, 0x51a2, 0x51a9, 0x51aa, 0x51ab, 0x51b3, 0x51b1, 0x51b2, 0x51b0, 0x51b5, 0x51bd, 0x51c5, 0x51c9, 0x51db, 0x51e0, 0x8655, 0x51e9, 0x51ed, 0xfffd, 0x51f0, 0x51f5, 0x51fe, 0x5204, 0x520b, 0x5214, 0x520e, 0x5227, 0x522a, 0x522e, 0x5233, 0x5239, 0x524f, 0x5244, 0x524b, 0x524c, 0x525e, 0x5254, 0x526a, 0x5274, 0x5269, 0x5273, 0x527f, 0x527d, 0x528d, 0x5294, 0x5292, 0x5271, 0x5288, 0x5291, 0x8fa8, 0x8fa7, 0x52ac, 0x52ad, 0x52bc, 0x52b5, 0x52c1, 0x52cd, 0x52d7, 0x52de, 0x52e3, 0x52e6, 0x98ed, 0x52e0, 0x52f3, 0x52f5, 0x52f8, 0x52f9, 0x5306, 0x5308, 0x7538, 0x530d, 0x5310, 0x530f, 0x5315, 0x531a, 0x5323, 0x532f, 0x5331, 0x5333, 0x5338, 0x5340, 0x5346, 0x5345, 0x4e17, 0x5349, 0x534d, 0x51d6, 0x535e, 0x5369, 0x536e, 0x5918, 0x537b, 0x5377, 0x5382, 0x5396, 0x53a0, 0x53a6, 0x53a5, 0x53ae, 0x53b0, 0x53b6, 0x53c3, 0x7c12, 0x96d9, 0x53df, 0x66fc, 0x71ee, 0x53ee, 0x53e8, 0x53ed, 0x53fa, 0x5401, 0x543d, 0x5440, 0x542c, 0x542d, 0x543c, 0x542e, 0x5436, 0x5429, 0x541d, 0x544e, 0x548f, 0x5475, 0x548e, 0x545f, 0x5471, 0x5477, 0x5470, 0x5492, 0x547b, 0x5480, 0x5476, 0x5484, 0x5490, 0x5486, 0x54c7, 0x54a2, 0x54b8, 0x54a5, 0x54ac, 0x54c4, 0x54c8, 0x54a8 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9a40[ 189 ] = { 0x54ab, 0x54c2, 0x54a4, 0x54be, 0x54bc, 0x54d8, 0x54e5, 0x54e6, 0x550f, 0x5514, 0x54fd, 0x54ee, 0x54ed, 0x54fa, 0x54e2, 0x5539, 0x5540, 0x5563, 0x554c, 0x552e, 0x555c, 0x5545, 0x5556, 0x5557, 0x5538, 0x5533, 0x555d, 0x5599, 0x5580, 0x54af, 0x558a, 0x559f, 0x557b, 0x557e, 0x5598, 0x559e, 0x55ae, 0x557c, 0x5583, 0x55a9, 0x5587, 0x55a8, 0x55da, 0x55c5, 0x55df, 0x55c4, 0x55dc, 0x55e4, 0x55d4, 0x5614, 0x55f7, 0x5616, 0x55fe, 0x55fd, 0x561b, 0x55f9, 0x564e, 0x5650, 0x71df, 0x5634, 0x5636, 0x5632, 0x5638, 0xfffd, 0x566b, 0x5664, 0x562f, 0x566c, 0x566a, 0x5686, 0x5680, 0x568a, 0x56a0, 0x5694, 0x568f, 0x56a5, 0x56ae, 0x56b6, 0x56b4, 0x56c2, 0x56bc, 0x56c1, 0x56c3, 0x56c0, 0x56c8, 0x56ce, 0x56d1, 0x56d3, 0x56d7, 0x56ee, 0x56f9, 0x5700, 0x56ff, 0x5704, 0x5709, 0x5708, 0x570b, 0x570d, 0x5713, 0x5718, 0x5716, 0x55c7, 0x571c, 0x5726, 0x5737, 0x5738, 0x574e, 0x573b, 0x5740, 0x574f, 0x5769, 0x57c0, 0x5788, 0x5761, 0x577f, 0x5789, 0x5793, 0x57a0, 0x57b3, 0x57a4, 0x57aa, 0x57b0, 0x57c3, 0x57c6, 0x57d4, 0x57d2, 0x57d3, 0x580a, 0x57d6, 0x57e3, 0x580b, 0x5819, 0x581d, 0x5872, 0x5821, 0x5862, 0x584b, 0x5870, 0x6bc0, 0x5852, 0x583d, 0x5879, 0x5885, 0x58b9, 0x589f, 0x58ab, 0x58ba, 0x58de, 0x58bb, 0x58b8, 0x58ae, 0x58c5, 0x58d3, 0x58d1, 0x58d7, 0x58d9, 0x58d8, 0x58e5, 0x58dc, 0x58e4, 0x58df, 0x58ef, 0x58fa, 0x58f9, 0x58fb, 0x58fc, 0x58fd, 0x5902, 0x590a, 0x5910, 0x591b, 0x68a6, 0x5925, 0x592c, 0x592d, 0x5932, 0x5938, 0x593e, 0x7ad2, 0x5955, 0x5950, 0x594e, 0x595a, 0x5958, 0x5962, 0x5960, 0x5967, 0x596c, 0x5969 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9b40[ 189 ] = { 0x5978, 0x5981, 0x599d, 0x4f5e, 0x4fab, 0x59a3, 0x59b2, 0x59c6, 0x59e8, 0x59dc, 0x598d, 0x59d9, 0x59da, 0x5a25, 0x5a1f, 0x5a11, 0x5a1c, 0x5a09, 0x5a1a, 0x5a40, 0x5a6c, 0x5a49, 0x5a35, 0x5a36, 0x5a62, 0x5a6a, 0x5a9a, 0x5abc, 0x5abe, 0x5acb, 0x5ac2, 0x5abd, 0x5ae3, 0x5ad7, 0x5ae6, 0x5ae9, 0x5ad6, 0x5afa, 0x5afb, 0x5b0c, 0x5b0b, 0x5b16, 0x5b32, 0x5ad0, 0x5b2a, 0x5b36, 0x5b3e, 0x5b43, 0x5b45, 0x5b40, 0x5b51, 0x5b55, 0x5b5a, 0x5b5b, 0x5b65, 0x5b69, 0x5b70, 0x5b73, 0x5b75, 0x5b78, 0x6588, 0x5b7a, 0x5b80, 0xfffd, 0x5b83, 0x5ba6, 0x5bb8, 0x5bc3, 0x5bc7, 0x5bc9, 0x5bd4, 0x5bd0, 0x5be4, 0x5be6, 0x5be2, 0x5bde, 0x5be5, 0x5beb, 0x5bf0, 0x5bf6, 0x5bf3, 0x5c05, 0x5c07, 0x5c08, 0x5c0d, 0x5c13, 0x5c20, 0x5c22, 0x5c28, 0x5c38, 0x5c39, 0x5c41, 0x5c46, 0x5c4e, 0x5c53, 0x5c50, 0x5c4f, 0x5b71, 0x5c6c, 0x5c6e, 0x4e62, 0x5c76, 0x5c79, 0x5c8c, 0x5c91, 0x5c94, 0x599b, 0x5cab, 0x5cbb, 0x5cb6, 0x5cbc, 0x5cb7, 0x5cc5, 0x5cbe, 0x5cc7, 0x5cd9, 0x5ce9, 0x5cfd, 0x5cfa, 0x5ced, 0x5d8c, 0x5cea, 0x5d0b, 0x5d15, 0x5d17, 0x5d5c, 0x5d1f, 0x5d1b, 0x5d11, 0x5d14, 0x5d22, 0x5d1a, 0x5d19, 0x5d18, 0x5d4c, 0x5d52, 0x5d4e, 0x5d4b, 0x5d6c, 0x5d73, 0x5d76, 0x5d87, 0x5d84, 0x5d82, 0x5da2, 0x5d9d, 0x5dac, 0x5dae, 0x5dbd, 0x5d90, 0x5db7, 0x5dbc, 0x5dc9, 0x5dcd, 0x5dd3, 0x5dd2, 0x5dd6, 0x5ddb, 0x5deb, 0x5df2, 0x5df5, 0x5e0b, 0x5e1a, 0x5e19, 0x5e11, 0x5e1b, 0x5e36, 0x5e37, 0x5e44, 0x5e43, 0x5e40, 0x5e4e, 0x5e57, 0x5e54, 0x5e5f, 0x5e62, 0x5e64, 0x5e47, 0x5e75, 0x5e76, 0x5e7a, 0x9ebc, 0x5e7f, 0x5ea0, 0x5ec1, 0x5ec2, 0x5ec8, 0x5ed0, 0x5ecf }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9c40[ 189 ] = { 0x5ed6, 0x5ee3, 0x5edd, 0x5eda, 0x5edb, 0x5ee2, 0x5ee1, 0x5ee8, 0x5ee9, 0x5eec, 0x5ef1, 0x5ef3, 0x5ef0, 0x5ef4, 0x5ef8, 0x5efe, 0x5f03, 0x5f09, 0x5f5d, 0x5f5c, 0x5f0b, 0x5f11, 0x5f16, 0x5f29, 0x5f2d, 0x5f38, 0x5f41, 0x5f48, 0x5f4c, 0x5f4e, 0x5f2f, 0x5f51, 0x5f56, 0x5f57, 0x5f59, 0x5f61, 0x5f6d, 0x5f73, 0x5f77, 0x5f83, 0x5f82, 0x5f7f, 0x5f8a, 0x5f88, 0x5f91, 0x5f87, 0x5f9e, 0x5f99, 0x5f98, 0x5fa0, 0x5fa8, 0x5fad, 0x5fbc, 0x5fd6, 0x5ffb, 0x5fe4, 0x5ff8, 0x5ff1, 0x5fdd, 0x60b3, 0x5fff, 0x6021, 0x6060, 0xfffd, 0x6019, 0x6010, 0x6029, 0x600e, 0x6031, 0x601b, 0x6015, 0x602b, 0x6026, 0x600f, 0x603a, 0x605a, 0x6041, 0x606a, 0x6077, 0x605f, 0x604a, 0x6046, 0x604d, 0x6063, 0x6043, 0x6064, 0x6042, 0x606c, 0x606b, 0x6059, 0x6081, 0x608d, 0x60e7, 0x6083, 0x609a, 0x6084, 0x609b, 0x6096, 0x6097, 0x6092, 0x60a7, 0x608b, 0x60e1, 0x60b8, 0x60e0, 0x60d3, 0x60b4, 0x5ff0, 0x60bd, 0x60c6, 0x60b5, 0x60d8, 0x614d, 0x6115, 0x6106, 0x60f6, 0x60f7, 0x6100, 0x60f4, 0x60fa, 0x6103, 0x6121, 0x60fb, 0x60f1, 0x610d, 0x610e, 0x6147, 0x613e, 0x6128, 0x6127, 0x614a, 0x613f, 0x613c, 0x612c, 0x6134, 0x613d, 0x6142, 0x6144, 0x6173, 0x6177, 0x6158, 0x6159, 0x615a, 0x616b, 0x6174, 0x616f, 0x6165, 0x6171, 0x615f, 0x615d, 0x6153, 0x6175, 0x6199, 0x6196, 0x6187, 0x61ac, 0x6194, 0x619a, 0x618a, 0x6191, 0x61ab, 0x61ae, 0x61cc, 0x61ca, 0x61c9, 0x61f7, 0x61c8, 0x61c3, 0x61c6, 0x61ba, 0x61cb, 0x7f79, 0x61cd, 0x61e6, 0x61e3, 0x61f6, 0x61fa, 0x61f4, 0x61ff, 0x61fd, 0x61fc, 0x61fe, 0x6200, 0x6208, 0x6209, 0x620d, 0x620c, 0x6214, 0x621b }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9d40[ 189 ] = { 0x621e, 0x6221, 0x622a, 0x622e, 0x6230, 0x6232, 0x6233, 0x6241, 0x624e, 0x625e, 0x6263, 0x625b, 0x6260, 0x6268, 0x627c, 0x6282, 0x6289, 0x627e, 0x6292, 0x6293, 0x6296, 0x62d4, 0x6283, 0x6294, 0x62d7, 0x62d1, 0x62bb, 0x62cf, 0x62ff, 0x62c6, 0x64d4, 0x62c8, 0x62dc, 0x62cc, 0x62ca, 0x62c2, 0x62c7, 0x629b, 0x62c9, 0x630c, 0x62ee, 0x62f1, 0x6327, 0x6302, 0x6308, 0x62ef, 0x62f5, 0x6350, 0x633e, 0x634d, 0x641c, 0x634f, 0x6396, 0x638e, 0x6380, 0x63ab, 0x6376, 0x63a3, 0x638f, 0x6389, 0x639f, 0x63b5, 0x636b, 0xfffd, 0x6369, 0x63be, 0x63e9, 0x63c0, 0x63c6, 0x63e3, 0x63c9, 0x63d2, 0x63f6, 0x63c4, 0x6416, 0x6434, 0x6406, 0x6413, 0x6426, 0x6436, 0x651d, 0x6417, 0x6428, 0x640f, 0x6467, 0x646f, 0x6476, 0x644e, 0x652a, 0x6495, 0x6493, 0x64a5, 0x64a9, 0x6488, 0x64bc, 0x64da, 0x64d2, 0x64c5, 0x64c7, 0x64bb, 0x64d8, 0x64c2, 0x64f1, 0x64e7, 0x8209, 0x64e0, 0x64e1, 0x62ac, 0x64e3, 0x64ef, 0x652c, 0x64f6, 0x64f4, 0x64f2, 0x64fa, 0x6500, 0x64fd, 0x6518, 0x651c, 0x6505, 0x6524, 0x6523, 0x652b, 0x6534, 0x6535, 0x6537, 0x6536, 0x6538, 0x754b, 0x6548, 0x6556, 0x6555, 0x654d, 0x6558, 0x655e, 0x655d, 0x6572, 0x6578, 0x6582, 0x6583, 0x8b8a, 0x659b, 0x659f, 0x65ab, 0x65b7, 0x65c3, 0x65c6, 0x65c1, 0x65c4, 0x65cc, 0x65d2, 0x65db, 0x65d9, 0x65e0, 0x65e1, 0x65f1, 0x6772, 0x660a, 0x6603, 0x65fb, 0x6773, 0x6635, 0x6636, 0x6634, 0x661c, 0x664f, 0x6644, 0x6649, 0x6641, 0x665e, 0x665d, 0x6664, 0x6667, 0x6668, 0x665f, 0x6662, 0x6670, 0x6683, 0x6688, 0x668e, 0x6689, 0x6684, 0x6698, 0x669d, 0x66c1, 0x66b9, 0x66c9, 0x66be, 0x66bc }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9e40[ 189 ] = { 0x66c4, 0x66b8, 0x66d6, 0x66da, 0x66e0, 0x663f, 0x66e6, 0x66e9, 0x66f0, 0x66f5, 0x66f7, 0x670f, 0x6716, 0x671e, 0x6726, 0x6727, 0x9738, 0x672e, 0x673f, 0x6736, 0x6741, 0x6738, 0x6737, 0x6746, 0x675e, 0x6760, 0x6759, 0x6763, 0x6764, 0x6789, 0x6770, 0x67a9, 0x677c, 0x676a, 0x678c, 0x678b, 0x67a6, 0x67a1, 0x6785, 0x67b7, 0x67ef, 0x67b4, 0x67ec, 0x67b3, 0x67e9, 0x67b8, 0x67e4, 0x67de, 0x67dd, 0x67e2, 0x67ee, 0x67b9, 0x67ce, 0x67c6, 0x67e7, 0x6a9c, 0x681e, 0x6846, 0x6829, 0x6840, 0x684d, 0x6832, 0x684e, 0xfffd, 0x68b3, 0x682b, 0x6859, 0x6863, 0x6877, 0x687f, 0x689f, 0x688f, 0x68ad, 0x6894, 0x689d, 0x689b, 0x6883, 0x6aae, 0x68b9, 0x6874, 0x68b5, 0x68a0, 0x68ba, 0x690f, 0x688d, 0x687e, 0x6901, 0x68ca, 0x6908, 0x68d8, 0x6922, 0x6926, 0x68e1, 0x690c, 0x68cd, 0x68d4, 0x68e7, 0x68d5, 0x6936, 0x6912, 0x6904, 0x68d7, 0x68e3, 0x6925, 0x68f9, 0x68e0, 0x68ef, 0x6928, 0x692a, 0x691a, 0x6923, 0x6921, 0x68c6, 0x6979, 0x6977, 0x695c, 0x6978, 0x696b, 0x6954, 0x697e, 0x696e, 0x6939, 0x6974, 0x693d, 0x6959, 0x6930, 0x6961, 0x695e, 0x695d, 0x6981, 0x696a, 0x69b2, 0x69ae, 0x69d0, 0x69bf, 0x69c1, 0x69d3, 0x69be, 0x69ce, 0x5be8, 0x69ca, 0x69dd, 0x69bb, 0x69c3, 0x69a7, 0x6a2e, 0x6991, 0x69a0, 0x699c, 0x6995, 0x69b4, 0x69de, 0x69e8, 0x6a02, 0x6a1b, 0x69ff, 0x6b0a, 0x69f9, 0x69f2, 0x69e7, 0x6a05, 0x69b1, 0x6a1e, 0x69ed, 0x6a14, 0x69eb, 0x6a0a, 0x6a12, 0x6ac1, 0x6a23, 0x6a13, 0x6a44, 0x6a0c, 0x6a72, 0x6a36, 0x6a78, 0x6a47, 0x6a62, 0x6a59, 0x6a66, 0x6a48, 0x6a38, 0x6a22, 0x6a90, 0x6a8d, 0x6aa0, 0x6a84, 0x6aa2, 0x6aa3 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9f40[ 189 ] = { 0x6a97, 0x8617, 0x6abb, 0x6ac3, 0x6ac2, 0x6ab8, 0x6ab3, 0x6aac, 0x6ade, 0x6ad1, 0x6adf, 0x6aaa, 0x6ada, 0x6aea, 0x6afb, 0x6b05, 0x8616, 0x6afa, 0x6b12, 0x6b16, 0x9b31, 0x6b1f, 0x6b38, 0x6b37, 0x76dc, 0x6b39, 0x98ee, 0x6b47, 0x6b43, 0x6b49, 0x6b50, 0x6b59, 0x6b54, 0x6b5b, 0x6b5f, 0x6b61, 0x6b78, 0x6b79, 0x6b7f, 0x6b80, 0x6b84, 0x6b83, 0x6b8d, 0x6b98, 0x6b95, 0x6b9e, 0x6ba4, 0x6baa, 0x6bab, 0x6baf, 0x6bb2, 0x6bb1, 0x6bb3, 0x6bb7, 0x6bbc, 0x6bc6, 0x6bcb, 0x6bd3, 0x6bdf, 0x6bec, 0x6beb, 0x6bf3, 0x6bef, 0xfffd, 0x9ebe, 0x6c08, 0x6c13, 0x6c14, 0x6c1b, 0x6c24, 0x6c23, 0x6c5e, 0x6c55, 0x6c62, 0x6c6a, 0x6c82, 0x6c8d, 0x6c9a, 0x6c81, 0x6c9b, 0x6c7e, 0x6c68, 0x6c73, 0x6c92, 0x6c90, 0x6cc4, 0x6cf1, 0x6cd3, 0x6cbd, 0x6cd7, 0x6cc5, 0x6cdd, 0x6cae, 0x6cb1, 0x6cbe, 0x6cba, 0x6cdb, 0x6cef, 0x6cd9, 0x6cea, 0x6d1f, 0x884d, 0x6d36, 0x6d2b, 0x6d3d, 0x6d38, 0x6d19, 0x6d35, 0x6d33, 0x6d12, 0x6d0c, 0x6d63, 0x6d93, 0x6d64, 0x6d5a, 0x6d79, 0x6d59, 0x6d8e, 0x6d95, 0x6fe4, 0x6d85, 0x6df9, 0x6e15, 0x6e0a, 0x6db5, 0x6dc7, 0x6de6, 0x6db8, 0x6dc6, 0x6dec, 0x6dde, 0x6dcc, 0x6de8, 0x6dd2, 0x6dc5, 0x6dfa, 0x6dd9, 0x6de4, 0x6dd5, 0x6dea, 0x6dee, 0x6e2d, 0x6e6e, 0x6e2e, 0x6e19, 0x6e72, 0x6e5f, 0x6e3e, 0x6e23, 0x6e6b, 0x6e2b, 0x6e76, 0x6e4d, 0x6e1f, 0x6e43, 0x6e3a, 0x6e4e, 0x6e24, 0x6eff, 0x6e1d, 0x6e38, 0x6e82, 0x6eaa, 0x6e98, 0x6ec9, 0x6eb7, 0x6ed3, 0x6ebd, 0x6eaf, 0x6ec4, 0x6eb2, 0x6ed4, 0x6ed5, 0x6e8f, 0x6ea5, 0x6ec2, 0x6e9f, 0x6f41, 0x6f11, 0x704c, 0x6eec, 0x6ef8, 0x6efe, 0x6f3f, 0x6ef2, 0x6f31, 0x6eef, 0x6f32, 0x6ecc }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe040[ 189 ] = { 0x6f3e, 0x6f13, 0x6ef7, 0x6f86, 0x6f7a, 0x6f78, 0x6f81, 0x6f80, 0x6f6f, 0x6f5b, 0x6ff3, 0x6f6d, 0x6f82, 0x6f7c, 0x6f58, 0x6f8e, 0x6f91, 0x6fc2, 0x6f66, 0x6fb3, 0x6fa3, 0x6fa1, 0x6fa4, 0x6fb9, 0x6fc6, 0x6faa, 0x6fdf, 0x6fd5, 0x6fec, 0x6fd4, 0x6fd8, 0x6ff1, 0x6fee, 0x6fdb, 0x7009, 0x700b, 0x6ffa, 0x7011, 0x7001, 0x700f, 0x6ffe, 0x701b, 0x701a, 0x6f74, 0x701d, 0x7018, 0x701f, 0x7030, 0x703e, 0x7032, 0x7051, 0x7063, 0x7099, 0x7092, 0x70af, 0x70f1, 0x70ac, 0x70b8, 0x70b3, 0x70ae, 0x70df, 0x70cb, 0x70dd, 0xfffd, 0x70d9, 0x7109, 0x70fd, 0x711c, 0x7119, 0x7165, 0x7155, 0x7188, 0x7166, 0x7162, 0x714c, 0x7156, 0x716c, 0x718f, 0x71fb, 0x7184, 0x7195, 0x71a8, 0x71ac, 0x71d7, 0x71b9, 0x71be, 0x71d2, 0x71c9, 0x71d4, 0x71ce, 0x71e0, 0x71ec, 0x71e7, 0x71f5, 0x71fc, 0x71f9, 0x71ff, 0x720d, 0x7210, 0x721b, 0x7228, 0x722d, 0x722c, 0x7230, 0x7232, 0x723b, 0x723c, 0x723f, 0x7240, 0x7246, 0x724b, 0x7258, 0x7274, 0x727e, 0x7282, 0x7281, 0x7287, 0x7292, 0x7296, 0x72a2, 0x72a7, 0x72b9, 0x72b2, 0x72c3, 0x72c6, 0x72c4, 0x72ce, 0x72d2, 0x72e2, 0x72e0, 0x72e1, 0x72f9, 0x72f7, 0x500f, 0x7317, 0x730a, 0x731c, 0x7316, 0x731d, 0x7334, 0x732f, 0x7329, 0x7325, 0x733e, 0x734e, 0x734f, 0x9ed8, 0x7357, 0x736a, 0x7368, 0x7370, 0x7378, 0x7375, 0x737b, 0x737a, 0x73c8, 0x73b3, 0x73ce, 0x73bb, 0x73c0, 0x73e5, 0x73ee, 0x73de, 0x74a2, 0x7405, 0x746f, 0x7425, 0x73f8, 0x7432, 0x743a, 0x7455, 0x743f, 0x745f, 0x7459, 0x7441, 0x745c, 0x7469, 0x7470, 0x7463, 0x746a, 0x7476, 0x747e, 0x748b, 0x749e, 0x74a7, 0x74ca, 0x74cf, 0x74d4, 0x73f1 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe140[ 189 ] = { 0x74e0, 0x74e3, 0x74e7, 0x74e9, 0x74ee, 0x74f2, 0x74f0, 0x74f1, 0x74f8, 0x74f7, 0x7504, 0x7503, 0x7505, 0x750c, 0x750e, 0x750d, 0x7515, 0x7513, 0x751e, 0x7526, 0x752c, 0x753c, 0x7544, 0x754d, 0x754a, 0x7549, 0x755b, 0x7546, 0x755a, 0x7569, 0x7564, 0x7567, 0x756b, 0x756d, 0x7578, 0x7576, 0x7586, 0x7587, 0x7574, 0x758a, 0x7589, 0x7582, 0x7594, 0x759a, 0x759d, 0x75a5, 0x75a3, 0x75c2, 0x75b3, 0x75c3, 0x75b5, 0x75bd, 0x75b8, 0x75bc, 0x75b1, 0x75cd, 0x75ca, 0x75d2, 0x75d9, 0x75e3, 0x75de, 0x75fe, 0x75ff, 0xfffd, 0x75fc, 0x7601, 0x75f0, 0x75fa, 0x75f2, 0x75f3, 0x760b, 0x760d, 0x7609, 0x761f, 0x7627, 0x7620, 0x7621, 0x7622, 0x7624, 0x7634, 0x7630, 0x763b, 0x7647, 0x7648, 0x7646, 0x765c, 0x7658, 0x7661, 0x7662, 0x7668, 0x7669, 0x766a, 0x7667, 0x766c, 0x7670, 0x7672, 0x7676, 0x7678, 0x767c, 0x7680, 0x7683, 0x7688, 0x768b, 0x768e, 0x7696, 0x7693, 0x7699, 0x769a, 0x76b0, 0x76b4, 0x76b8, 0x76b9, 0x76ba, 0x76c2, 0x76cd, 0x76d6, 0x76d2, 0x76de, 0x76e1, 0x76e5, 0x76e7, 0x76ea, 0x862f, 0x76fb, 0x7708, 0x7707, 0x7704, 0x7729, 0x7724, 0x771e, 0x7725, 0x7726, 0x771b, 0x7737, 0x7738, 0x7747, 0x775a, 0x7768, 0x776b, 0x775b, 0x7765, 0x777f, 0x777e, 0x7779, 0x778e, 0x778b, 0x7791, 0x77a0, 0x779e, 0x77b0, 0x77b6, 0x77b9, 0x77bf, 0x77bc, 0x77bd, 0x77bb, 0x77c7, 0x77cd, 0x77d7, 0x77da, 0x77dc, 0x77e3, 0x77ee, 0x77fc, 0x780c, 0x7812, 0x7926, 0x7820, 0x792a, 0x7845, 0x788e, 0x7874, 0x7886, 0x787c, 0x789a, 0x788c, 0x78a3, 0x78b5, 0x78aa, 0x78af, 0x78d1, 0x78c6, 0x78cb, 0x78d4, 0x78be, 0x78bc, 0x78c5, 0x78ca, 0x78ec }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe240[ 189 ] = { 0x78e7, 0x78da, 0x78fd, 0x78f4, 0x7907, 0x7912, 0x7911, 0x7919, 0x792c, 0x792b, 0x7940, 0x7960, 0x7957, 0x795f, 0x795a, 0x7955, 0x7953, 0x797a, 0x797f, 0x798a, 0x799d, 0x79a7, 0x9f4b, 0x79aa, 0x79ae, 0x79b3, 0x79b9, 0x79ba, 0x79c9, 0x79d5, 0x79e7, 0x79ec, 0x79e1, 0x79e3, 0x7a08, 0x7a0d, 0x7a18, 0x7a19, 0x7a20, 0x7a1f, 0x7980, 0x7a31, 0x7a3b, 0x7a3e, 0x7a37, 0x7a43, 0x7a57, 0x7a49, 0x7a61, 0x7a62, 0x7a69, 0x9f9d, 0x7a70, 0x7a79, 0x7a7d, 0x7a88, 0x7a97, 0x7a95, 0x7a98, 0x7a96, 0x7aa9, 0x7ac8, 0x7ab0, 0xfffd, 0x7ab6, 0x7ac5, 0x7ac4, 0x7abf, 0x9083, 0x7ac7, 0x7aca, 0x7acd, 0x7acf, 0x7ad5, 0x7ad3, 0x7ad9, 0x7ada, 0x7add, 0x7ae1, 0x7ae2, 0x7ae6, 0x7aed, 0x7af0, 0x7b02, 0x7b0f, 0x7b0a, 0x7b06, 0x7b33, 0x7b18, 0x7b19, 0x7b1e, 0x7b35, 0x7b28, 0x7b36, 0x7b50, 0x7b7a, 0x7b04, 0x7b4d, 0x7b0b, 0x7b4c, 0x7b45, 0x7b75, 0x7b65, 0x7b74, 0x7b67, 0x7b70, 0x7b71, 0x7b6c, 0x7b6e, 0x7b9d, 0x7b98, 0x7b9f, 0x7b8d, 0x7b9c, 0x7b9a, 0x7b8b, 0x7b92, 0x7b8f, 0x7b5d, 0x7b99, 0x7bcb, 0x7bc1, 0x7bcc, 0x7bcf, 0x7bb4, 0x7bc6, 0x7bdd, 0x7be9, 0x7c11, 0x7c14, 0x7be6, 0x7be5, 0x7c60, 0x7c00, 0x7c07, 0x7c13, 0x7bf3, 0x7bf7, 0x7c17, 0x7c0d, 0x7bf6, 0x7c23, 0x7c27, 0x7c2a, 0x7c1f, 0x7c37, 0x7c2b, 0x7c3d, 0x7c4c, 0x7c43, 0x7c54, 0x7c4f, 0x7c40, 0x7c50, 0x7c58, 0x7c5f, 0x7c64, 0x7c56, 0x7c65, 0x7c6c, 0x7c75, 0x7c83, 0x7c90, 0x7ca4, 0x7cad, 0x7ca2, 0x7cab, 0x7ca1, 0x7ca8, 0x7cb3, 0x7cb2, 0x7cb1, 0x7cae, 0x7cb9, 0x7cbd, 0x7cc0, 0x7cc5, 0x7cc2, 0x7cd8, 0x7cd2, 0x7cdc, 0x7ce2, 0x9b3b, 0x7cef, 0x7cf2, 0x7cf4, 0x7cf6, 0x7cfa, 0x7d06 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe340[ 189 ] = { 0x7d02, 0x7d1c, 0x7d15, 0x7d0a, 0x7d45, 0x7d4b, 0x7d2e, 0x7d32, 0x7d3f, 0x7d35, 0x7d46, 0x7d73, 0x7d56, 0x7d4e, 0x7d72, 0x7d68, 0x7d6e, 0x7d4f, 0x7d63, 0x7d93, 0x7d89, 0x7d5b, 0x7d8f, 0x7d7d, 0x7d9b, 0x7dba, 0x7dae, 0x7da3, 0x7db5, 0x7dc7, 0x7dbd, 0x7dab, 0x7e3d, 0x7da2, 0x7daf, 0x7ddc, 0x7db8, 0x7d9f, 0x7db0, 0x7dd8, 0x7ddd, 0x7de4, 0x7dde, 0x7dfb, 0x7df2, 0x7de1, 0x7e05, 0x7e0a, 0x7e23, 0x7e21, 0x7e12, 0x7e31, 0x7e1f, 0x7e09, 0x7e0b, 0x7e22, 0x7e46, 0x7e66, 0x7e3b, 0x7e35, 0x7e39, 0x7e43, 0x7e37, 0xfffd, 0x7e32, 0x7e3a, 0x7e67, 0x7e5d, 0x7e56, 0x7e5e, 0x7e59, 0x7e5a, 0x7e79, 0x7e6a, 0x7e69, 0x7e7c, 0x7e7b, 0x7e83, 0x7dd5, 0x7e7d, 0x8fae, 0x7e7f, 0x7e88, 0x7e89, 0x7e8c, 0x7e92, 0x7e90, 0x7e93, 0x7e94, 0x7e96, 0x7e8e, 0x7e9b, 0x7e9c, 0x7f38, 0x7f3a, 0x7f45, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f50, 0x7f51, 0x7f55, 0x7f54, 0x7f58, 0x7f5f, 0x7f60, 0x7f68, 0x7f69, 0x7f67, 0x7f78, 0x7f82, 0x7f86, 0x7f83, 0x7f88, 0x7f87, 0x7f8c, 0x7f94, 0x7f9e, 0x7f9d, 0x7f9a, 0x7fa3, 0x7faf, 0x7fb2, 0x7fb9, 0x7fae, 0x7fb6, 0x7fb8, 0x8b71, 0x7fc5, 0x7fc6, 0x7fca, 0x7fd5, 0x7fd4, 0x7fe1, 0x7fe6, 0x7fe9, 0x7ff3, 0x7ff9, 0x98dc, 0x8006, 0x8004, 0x800b, 0x8012, 0x8018, 0x8019, 0x801c, 0x8021, 0x8028, 0x803f, 0x803b, 0x804a, 0x8046, 0x8052, 0x8058, 0x805a, 0x805f, 0x8062, 0x8068, 0x8073, 0x8072, 0x8070, 0x8076, 0x8079, 0x807d, 0x807f, 0x8084, 0x8086, 0x8085, 0x809b, 0x8093, 0x809a, 0x80ad, 0x5190, 0x80ac, 0x80db, 0x80e5, 0x80d9, 0x80dd, 0x80c4, 0x80da, 0x80d6, 0x8109, 0x80ef, 0x80f1, 0x811b, 0x8129, 0x8123, 0x812f, 0x814b }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe440[ 189 ] = { 0x968b, 0x8146, 0x813e, 0x8153, 0x8151, 0x80fc, 0x8171, 0x816e, 0x8165, 0x8166, 0x8174, 0x8183, 0x8188, 0x818a, 0x8180, 0x8182, 0x81a0, 0x8195, 0x81a4, 0x81a3, 0x815f, 0x8193, 0x81a9, 0x81b0, 0x81b5, 0x81be, 0x81b8, 0x81bd, 0x81c0, 0x81c2, 0x81ba, 0x81c9, 0x81cd, 0x81d1, 0x81d9, 0x81d8, 0x81c8, 0x81da, 0x81df, 0x81e0, 0x81e7, 0x81fa, 0x81fb, 0x81fe, 0x8201, 0x8202, 0x8205, 0x8207, 0x820a, 0x820d, 0x8210, 0x8216, 0x8229, 0x822b, 0x8238, 0x8233, 0x8240, 0x8259, 0x8258, 0x825d, 0x825a, 0x825f, 0x8264, 0xfffd, 0x8262, 0x8268, 0x826a, 0x826b, 0x822e, 0x8271, 0x8277, 0x8278, 0x827e, 0x828d, 0x8292, 0x82ab, 0x829f, 0x82bb, 0x82ac, 0x82e1, 0x82e3, 0x82df, 0x82d2, 0x82f4, 0x82f3, 0x82fa, 0x8393, 0x8303, 0x82fb, 0x82f9, 0x82de, 0x8306, 0x82dc, 0x8309, 0x82d9, 0x8335, 0x8334, 0x8316, 0x8332, 0x8331, 0x8340, 0x8339, 0x8350, 0x8345, 0x832f, 0x832b, 0x8317, 0x8318, 0x8385, 0x839a, 0x83aa, 0x839f, 0x83a2, 0x8396, 0x8323, 0x838e, 0x8387, 0x838a, 0x837c, 0x83b5, 0x8373, 0x8375, 0x83a0, 0x8389, 0x83a8, 0x83f4, 0x8413, 0x83eb, 0x83ce, 0x83fd, 0x8403, 0x83d8, 0x840b, 0x83c1, 0x83f7, 0x8407, 0x83e0, 0x83f2, 0x840d, 0x8422, 0x8420, 0x83bd, 0x8438, 0x8506, 0x83fb, 0x846d, 0x842a, 0x843c, 0x855a, 0x8484, 0x8477, 0x846b, 0x84ad, 0x846e, 0x8482, 0x8469, 0x8446, 0x842c, 0x846f, 0x8479, 0x8435, 0x84ca, 0x8462, 0x84b9, 0x84bf, 0x849f, 0x84d9, 0x84cd, 0x84bb, 0x84da, 0x84d0, 0x84c1, 0x84c6, 0x84d6, 0x84a1, 0x8521, 0x84ff, 0x84f4, 0x8517, 0x8518, 0x852c, 0x851f, 0x8515, 0x8514, 0x84fc, 0x8540, 0x8563, 0x8558, 0x8548 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe540[ 189 ] = { 0x8541, 0x8602, 0x854b, 0x8555, 0x8580, 0x85a4, 0x8588, 0x8591, 0x858a, 0x85a8, 0x856d, 0x8594, 0x859b, 0x85ea, 0x8587, 0x859c, 0x8577, 0x857e, 0x8590, 0x85c9, 0x85ba, 0x85cf, 0x85b9, 0x85d0, 0x85d5, 0x85dd, 0x85e5, 0x85dc, 0x85f9, 0x860a, 0x8613, 0x860b, 0x85fe, 0x85fa, 0x8606, 0x8622, 0x861a, 0x8630, 0x863f, 0x864d, 0x4e55, 0x8654, 0x865f, 0x8667, 0x8671, 0x8693, 0x86a3, 0x86a9, 0x86aa, 0x868b, 0x868c, 0x86b6, 0x86af, 0x86c4, 0x86c6, 0x86b0, 0x86c9, 0x8823, 0x86ab, 0x86d4, 0x86de, 0x86e9, 0x86ec, 0xfffd, 0x86df, 0x86db, 0x86ef, 0x8712, 0x8706, 0x8708, 0x8700, 0x8703, 0x86fb, 0x8711, 0x8709, 0x870d, 0x86f9, 0x870a, 0x8734, 0x873f, 0x8737, 0x873b, 0x8725, 0x8729, 0x871a, 0x8760, 0x875f, 0x8778, 0x874c, 0x874e, 0x8774, 0x8757, 0x8768, 0x876e, 0x8759, 0x8753, 0x8763, 0x876a, 0x8805, 0x87a2, 0x879f, 0x8782, 0x87af, 0x87cb, 0x87bd, 0x87c0, 0x87d0, 0x96d6, 0x87ab, 0x87c4, 0x87b3, 0x87c7, 0x87c6, 0x87bb, 0x87ef, 0x87f2, 0x87e0, 0x880f, 0x880d, 0x87fe, 0x87f6, 0x87f7, 0x880e, 0x87d2, 0x8811, 0x8816, 0x8815, 0x8822, 0x8821, 0x8831, 0x8836, 0x8839, 0x8827, 0x883b, 0x8844, 0x8842, 0x8852, 0x8859, 0x885e, 0x8862, 0x886b, 0x8881, 0x887e, 0x889e, 0x8875, 0x887d, 0x88b5, 0x8872, 0x8882, 0x8897, 0x8892, 0x88ae, 0x8899, 0x88a2, 0x888d, 0x88a4, 0x88b0, 0x88bf, 0x88b1, 0x88c3, 0x88c4, 0x88d4, 0x88d8, 0x88d9, 0x88dd, 0x88f9, 0x8902, 0x88fc, 0x88f4, 0x88e8, 0x88f2, 0x8904, 0x890c, 0x890a, 0x8913, 0x8943, 0x891e, 0x8925, 0x892a, 0x892b, 0x8941, 0x8944, 0x893b, 0x8936, 0x8938, 0x894c, 0x891d, 0x8960, 0x895e }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe640[ 189 ] = { 0x8966, 0x8964, 0x896d, 0x896a, 0x896f, 0x8974, 0x8977, 0x897e, 0x8983, 0x8988, 0x898a, 0x8993, 0x8998, 0x89a1, 0x89a9, 0x89a6, 0x89ac, 0x89af, 0x89b2, 0x89ba, 0x89bd, 0x89bf, 0x89c0, 0x89da, 0x89dc, 0x89dd, 0x89e7, 0x89f4, 0x89f8, 0x8a03, 0x8a16, 0x8a10, 0x8a0c, 0x8a1b, 0x8a1d, 0x8a25, 0x8a36, 0x8a41, 0x8a5b, 0x8a52, 0x8a46, 0x8a48, 0x8a7c, 0x8a6d, 0x8a6c, 0x8a62, 0x8a85, 0x8a82, 0x8a84, 0x8aa8, 0x8aa1, 0x8a91, 0x8aa5, 0x8aa6, 0x8a9a, 0x8aa3, 0x8ac4, 0x8acd, 0x8ac2, 0x8ada, 0x8aeb, 0x8af3, 0x8ae7, 0xfffd, 0x8ae4, 0x8af1, 0x8b14, 0x8ae0, 0x8ae2, 0x8af7, 0x8ade, 0x8adb, 0x8b0c, 0x8b07, 0x8b1a, 0x8ae1, 0x8b16, 0x8b10, 0x8b17, 0x8b20, 0x8b33, 0x97ab, 0x8b26, 0x8b2b, 0x8b3e, 0x8b28, 0x8b41, 0x8b4c, 0x8b4f, 0x8b4e, 0x8b49, 0x8b56, 0x8b5b, 0x8b5a, 0x8b6b, 0x8b5f, 0x8b6c, 0x8b6f, 0x8b74, 0x8b7d, 0x8b80, 0x8b8c, 0x8b8e, 0x8b92, 0x8b93, 0x8b96, 0x8b99, 0x8b9a, 0x8c3a, 0x8c41, 0x8c3f, 0x8c48, 0x8c4c, 0x8c4e, 0x8c50, 0x8c55, 0x8c62, 0x8c6c, 0x8c78, 0x8c7a, 0x8c82, 0x8c89, 0x8c85, 0x8c8a, 0x8c8d, 0x8c8e, 0x8c94, 0x8c7c, 0x8c98, 0x621d, 0x8cad, 0x8caa, 0x8cbd, 0x8cb2, 0x8cb3, 0x8cae, 0x8cb6, 0x8cc8, 0x8cc1, 0x8ce4, 0x8ce3, 0x8cda, 0x8cfd, 0x8cfa, 0x8cfb, 0x8d04, 0x8d05, 0x8d0a, 0x8d07, 0x8d0f, 0x8d0d, 0x8d10, 0x9f4e, 0x8d13, 0x8ccd, 0x8d14, 0x8d16, 0x8d67, 0x8d6d, 0x8d71, 0x8d73, 0x8d81, 0x8d99, 0x8dc2, 0x8dbe, 0x8dba, 0x8dcf, 0x8dda, 0x8dd6, 0x8dcc, 0x8ddb, 0x8dcb, 0x8dea, 0x8deb, 0x8ddf, 0x8de3, 0x8dfc, 0x8e08, 0x8e09, 0x8dff, 0x8e1d, 0x8e1e, 0x8e10, 0x8e1f, 0x8e42, 0x8e35, 0x8e30, 0x8e34, 0x8e4a }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe740[ 189 ] = { 0x8e47, 0x8e49, 0x8e4c, 0x8e50, 0x8e48, 0x8e59, 0x8e64, 0x8e60, 0x8e2a, 0x8e63, 0x8e55, 0x8e76, 0x8e72, 0x8e7c, 0x8e81, 0x8e87, 0x8e85, 0x8e84, 0x8e8b, 0x8e8a, 0x8e93, 0x8e91, 0x8e94, 0x8e99, 0x8eaa, 0x8ea1, 0x8eac, 0x8eb0, 0x8ec6, 0x8eb1, 0x8ebe, 0x8ec5, 0x8ec8, 0x8ecb, 0x8edb, 0x8ee3, 0x8efc, 0x8efb, 0x8eeb, 0x8efe, 0x8f0a, 0x8f05, 0x8f15, 0x8f12, 0x8f19, 0x8f13, 0x8f1c, 0x8f1f, 0x8f1b, 0x8f0c, 0x8f26, 0x8f33, 0x8f3b, 0x8f39, 0x8f45, 0x8f42, 0x8f3e, 0x8f4c, 0x8f49, 0x8f46, 0x8f4e, 0x8f57, 0x8f5c, 0xfffd, 0x8f62, 0x8f63, 0x8f64, 0x8f9c, 0x8f9f, 0x8fa3, 0x8fad, 0x8faf, 0x8fb7, 0x8fda, 0x8fe5, 0x8fe2, 0x8fea, 0x8fef, 0x9087, 0x8ff4, 0x9005, 0x8ff9, 0x8ffa, 0x9011, 0x9015, 0x9021, 0x900d, 0x901e, 0x9016, 0x900b, 0x9027, 0x9036, 0x9035, 0x9039, 0x8ff8, 0x904f, 0x9050, 0x9051, 0x9052, 0x900e, 0x9049, 0x903e, 0x9056, 0x9058, 0x905e, 0x9068, 0x906f, 0x9076, 0x96a8, 0x9072, 0x9082, 0x907d, 0x9081, 0x9080, 0x908a, 0x9089, 0x908f, 0x90a8, 0x90af, 0x90b1, 0x90b5, 0x90e2, 0x90e4, 0x6248, 0x90db, 0x9102, 0x9112, 0x9119, 0x9132, 0x9130, 0x914a, 0x9156, 0x9158, 0x9163, 0x9165, 0x9169, 0x9173, 0x9172, 0x918b, 0x9189, 0x9182, 0x91a2, 0x91ab, 0x91af, 0x91aa, 0x91b5, 0x91b4, 0x91ba, 0x91c0, 0x91c1, 0x91c9, 0x91cb, 0x91d0, 0x91d6, 0x91df, 0x91e1, 0x91db, 0x91fc, 0x91f5, 0x91f6, 0x921e, 0x91ff, 0x9214, 0x922c, 0x9215, 0x9211, 0x925e, 0x9257, 0x9245, 0x9249, 0x9264, 0x9248, 0x9295, 0x923f, 0x924b, 0x9250, 0x929c, 0x9296, 0x9293, 0x929b, 0x925a, 0x92cf, 0x92b9, 0x92b7, 0x92e9, 0x930f, 0x92fa, 0x9344, 0x932e }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe840[ 189 ] = { 0x9319, 0x9322, 0x931a, 0x9323, 0x933a, 0x9335, 0x933b, 0x935c, 0x9360, 0x937c, 0x936e, 0x9356, 0x93b0, 0x93ac, 0x93ad, 0x9394, 0x93b9, 0x93d6, 0x93d7, 0x93e8, 0x93e5, 0x93d8, 0x93c3, 0x93dd, 0x93d0, 0x93c8, 0x93e4, 0x941a, 0x9414, 0x9413, 0x9403, 0x9407, 0x9410, 0x9436, 0x942b, 0x9435, 0x9421, 0x943a, 0x9441, 0x9452, 0x9444, 0x945b, 0x9460, 0x9462, 0x945e, 0x946a, 0x9229, 0x9470, 0x9475, 0x9477, 0x947d, 0x945a, 0x947c, 0x947e, 0x9481, 0x947f, 0x9582, 0x9587, 0x958a, 0x9594, 0x9596, 0x9598, 0x9599, 0xfffd, 0x95a0, 0x95a8, 0x95a7, 0x95ad, 0x95bc, 0x95bb, 0x95b9, 0x95be, 0x95ca, 0x6ff6, 0x95c3, 0x95cd, 0x95cc, 0x95d5, 0x95d4, 0x95d6, 0x95dc, 0x95e1, 0x95e5, 0x95e2, 0x9621, 0x9628, 0x962e, 0x962f, 0x9642, 0x964c, 0x964f, 0x964b, 0x9677, 0x965c, 0x965e, 0x965d, 0x965f, 0x9666, 0x9672, 0x966c, 0x968d, 0x9698, 0x9695, 0x9697, 0x96aa, 0x96a7, 0x96b1, 0x96b2, 0x96b0, 0x96b4, 0x96b6, 0x96b8, 0x96b9, 0x96ce, 0x96cb, 0x96c9, 0x96cd, 0x894d, 0x96dc, 0x970d, 0x96d5, 0x96f9, 0x9704, 0x9706, 0x9708, 0x9713, 0x970e, 0x9711, 0x970f, 0x9716, 0x9719, 0x9724, 0x972a, 0x9730, 0x9739, 0x973d, 0x973e, 0x9744, 0x9746, 0x9748, 0x9742, 0x9749, 0x975c, 0x9760, 0x9764, 0x9766, 0x9768, 0x52d2, 0x976b, 0x9771, 0x9779, 0x9785, 0x977c, 0x9781, 0x977a, 0x9786, 0x978b, 0x978f, 0x9790, 0x979c, 0x97a8, 0x97a6, 0x97a3, 0x97b3, 0x97b4, 0x97c3, 0x97c6, 0x97c8, 0x97cb, 0x97dc, 0x97ed, 0x9f4f, 0x97f2, 0x7adf, 0x97f6, 0x97f5, 0x980f, 0x980c, 0x9838, 0x9824, 0x9821, 0x9837, 0x983d, 0x9846, 0x984f, 0x984b, 0x986b, 0x986f, 0x9870 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe940[ 189 ] = { 0x9871, 0x9874, 0x9873, 0x98aa, 0x98af, 0x98b1, 0x98b6, 0x98c4, 0x98c3, 0x98c6, 0x98e9, 0x98eb, 0x9903, 0x9909, 0x9912, 0x9914, 0x9918, 0x9921, 0x991d, 0x991e, 0x9924, 0x9920, 0x992c, 0x992e, 0x993d, 0x993e, 0x9942, 0x9949, 0x9945, 0x9950, 0x994b, 0x9951, 0x9952, 0x994c, 0x9955, 0x9997, 0x9998, 0x99a5, 0x99ad, 0x99ae, 0x99bc, 0x99df, 0x99db, 0x99dd, 0x99d8, 0x99d1, 0x99ed, 0x99ee, 0x99f1, 0x99f2, 0x99fb, 0x99f8, 0x9a01, 0x9a0f, 0x9a05, 0x99e2, 0x9a19, 0x9a2b, 0x9a37, 0x9a45, 0x9a42, 0x9a40, 0x9a43, 0xfffd, 0x9a3e, 0x9a55, 0x9a4d, 0x9a5b, 0x9a57, 0x9a5f, 0x9a62, 0x9a65, 0x9a64, 0x9a69, 0x9a6b, 0x9a6a, 0x9aad, 0x9ab0, 0x9abc, 0x9ac0, 0x9acf, 0x9ad1, 0x9ad3, 0x9ad4, 0x9ade, 0x9adf, 0x9ae2, 0x9ae3, 0x9ae6, 0x9aef, 0x9aeb, 0x9aee, 0x9af4, 0x9af1, 0x9af7, 0x9afb, 0x9b06, 0x9b18, 0x9b1a, 0x9b1f, 0x9b22, 0x9b23, 0x9b25, 0x9b27, 0x9b28, 0x9b29, 0x9b2a, 0x9b2e, 0x9b2f, 0x9b32, 0x9b44, 0x9b43, 0x9b4f, 0x9b4d, 0x9b4e, 0x9b51, 0x9b58, 0x9b74, 0x9b93, 0x9b83, 0x9b91, 0x9b96, 0x9b97, 0x9b9f, 0x9ba0, 0x9ba8, 0x9bb4, 0x9bc0, 0x9bca, 0x9bb9, 0x9bc6, 0x9bcf, 0x9bd1, 0x9bd2, 0x9be3, 0x9be2, 0x9be4, 0x9bd4, 0x9be1, 0x9c3a, 0x9bf2, 0x9bf1, 0x9bf0, 0x9c15, 0x9c14, 0x9c09, 0x9c13, 0x9c0c, 0x9c06, 0x9c08, 0x9c12, 0x9c0a, 0x9c04, 0x9c2e, 0x9c1b, 0x9c25, 0x9c24, 0x9c21, 0x9c30, 0x9c47, 0x9c32, 0x9c46, 0x9c3e, 0x9c5a, 0x9c60, 0x9c67, 0x9c76, 0x9c78, 0x9ce7, 0x9cec, 0x9cf0, 0x9d09, 0x9d08, 0x9ceb, 0x9d03, 0x9d06, 0x9d2a, 0x9d26, 0x9daf, 0x9d23, 0x9d1f, 0x9d44, 0x9d15, 0x9d12, 0x9d41, 0x9d3f, 0x9d3e, 0x9d46, 0x9d48 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xea40[ 101 ] = { 0x9d5d, 0x9d5e, 0x9d64, 0x9d51, 0x9d50, 0x9d59, 0x9d72, 0x9d89, 0x9d87, 0x9dab, 0x9d6f, 0x9d7a, 0x9d9a, 0x9da4, 0x9da9, 0x9db2, 0x9dc4, 0x9dc1, 0x9dbb, 0x9db8, 0x9dba, 0x9dc6, 0x9dcf, 0x9dc2, 0x9dd9, 0x9dd3, 0x9df8, 0x9de6, 0x9ded, 0x9def, 0x9dfd, 0x9e1a, 0x9e1b, 0x9e1e, 0x9e75, 0x9e79, 0x9e7d, 0x9e81, 0x9e88, 0x9e8b, 0x9e8c, 0x9e92, 0x9e95, 0x9e91, 0x9e9d, 0x9ea5, 0x9ea9, 0x9eb8, 0x9eaa, 0x9ead, 0x9761, 0x9ecc, 0x9ece, 0x9ecf, 0x9ed0, 0x9ed4, 0x9edc, 0x9ede, 0x9edd, 0x9ee0, 0x9ee5, 0x9ee8, 0x9eef, 0xfffd, 0x9ef4, 0x9ef6, 0x9ef7, 0x9ef9, 0x9efb, 0x9efc, 0x9efd, 0x9f07, 0x9f08, 0x76b7, 0x9f15, 0x9f21, 0x9f2c, 0x9f3e, 0x9f4a, 0x9f52, 0x9f54, 0x9f63, 0x9f5f, 0x9f60, 0x9f61, 0x9f66, 0x9f67, 0x9f6c, 0x9f6a, 0x9f77, 0x9f72, 0x9f76, 0x9f95, 0x9f9c, 0x9fa0, 0x582f, 0x69c7, 0x9059, 0x7464, 0x51dc, 0x7199 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xed40[ 189 ] = { 0x7e8a, 0x891c, 0x9348, 0x9288, 0x84dc, 0x4fc9, 0x70bb, 0x6631, 0x68c8, 0x92f9, 0x66fb, 0x5f45, 0x4e28, 0x4ee1, 0x4efc, 0x4f00, 0x4f03, 0x4f39, 0x4f56, 0x4f92, 0x4f8a, 0x4f9a, 0x4f94, 0x4fcd, 0x5040, 0x5022, 0x4fff, 0x501e, 0x5046, 0x5070, 0x5042, 0x5094, 0x50f4, 0x50d8, 0x514a, 0x5164, 0x519d, 0x51be, 0x51ec, 0x5215, 0x529c, 0x52a6, 0x52c0, 0x52db, 0x5300, 0x5307, 0x5324, 0x5372, 0x5393, 0x53b2, 0x53dd, 0xfa0e, 0x549c, 0x548a, 0x54a9, 0x54ff, 0x5586, 0x5759, 0x5765, 0x57ac, 0x57c8, 0x57c7, 0xfa0f, 0xfffd, 0xfa10, 0x589e, 0x58b2, 0x590b, 0x5953, 0x595b, 0x595d, 0x5963, 0x59a4, 0x59ba, 0x5b56, 0x5bc0, 0x752f, 0x5bd8, 0x5bec, 0x5c1e, 0x5ca6, 0x5cba, 0x5cf5, 0x5d27, 0x5d53, 0xfa11, 0x5d42, 0x5d6d, 0x5db8, 0x5db9, 0x5dd0, 0x5f21, 0x5f34, 0x5f67, 0x5fb7, 0x5fde, 0x605d, 0x6085, 0x608a, 0x60de, 0x60d5, 0x6120, 0x60f2, 0x6111, 0x6137, 0x6130, 0x6198, 0x6213, 0x62a6, 0x63f5, 0x6460, 0x649d, 0x64ce, 0x654e, 0x6600, 0x6615, 0x663b, 0x6609, 0x662e, 0x661e, 0x6624, 0x6665, 0x6657, 0x6659, 0xfa12, 0x6673, 0x6699, 0x66a0, 0x66b2, 0x66bf, 0x66fa, 0x670e, 0xf929, 0x6766, 0x67bb, 0x6852, 0x67c0, 0x6801, 0x6844, 0x68cf, 0xfa13, 0x6968, 0xfa14, 0x6998, 0x69e2, 0x6a30, 0x6a6b, 0x6a46, 0x6a73, 0x6a7e, 0x6ae2, 0x6ae4, 0x6bd6, 0x6c3f, 0x6c5c, 0x6c86, 0x6c6f, 0x6cda, 0x6d04, 0x6d87, 0x6d6f, 0x6d96, 0x6dac, 0x6dcf, 0x6df8, 0x6df2, 0x6dfc, 0x6e39, 0x6e5c, 0x6e27, 0x6e3c, 0x6ebf, 0x6f88, 0x6fb5, 0x6ff5, 0x7005, 0x7007, 0x7028, 0x7085, 0x70ab, 0x710f, 0x7104, 0x715c, 0x7146, 0x7147, 0xfa15, 0x71c1, 0x71fe, 0x72b1 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xee40[ 189 ] = { 0x72be, 0x7324, 0xfa16, 0x7377, 0x73bd, 0x73c9, 0x73d6, 0x73e3, 0x73d2, 0x7407, 0x73f5, 0x7426, 0x742a, 0x7429, 0x742e, 0x7462, 0x7489, 0x749f, 0x7501, 0x756f, 0x7682, 0x769c, 0x769e, 0x769b, 0x76a6, 0xfa17, 0x7746, 0x52af, 0x7821, 0x784e, 0x7864, 0x787a, 0x7930, 0xfa18, 0xfa19, 0xfa1a, 0x7994, 0xfa1b, 0x799b, 0x7ad1, 0x7ae7, 0xfa1c, 0x7aeb, 0x7b9e, 0xfa1d, 0x7d48, 0x7d5c, 0x7db7, 0x7da0, 0x7dd6, 0x7e52, 0x7f47, 0x7fa1, 0xfa1e, 0x8301, 0x8362, 0x837f, 0x83c7, 0x83f6, 0x8448, 0x84b4, 0x8553, 0x8559, 0xfffd, 0x856b, 0xfa1f, 0x85b0, 0xfa20, 0xfa21, 0x8807, 0x88f5, 0x8a12, 0x8a37, 0x8a79, 0x8aa7, 0x8abe, 0x8adf, 0xfa22, 0x8af6, 0x8b53, 0x8b7f, 0x8cf0, 0x8cf4, 0x8d12, 0x8d76, 0xfa23, 0x8ecf, 0xfa24, 0xfa25, 0x9067, 0x90de, 0xfa26, 0x9115, 0x9127, 0x91da, 0x91d7, 0x91de, 0x91ed, 0x91ee, 0x91e4, 0x91e5, 0x9206, 0x9210, 0x920a, 0x923a, 0x9240, 0x923c, 0x924e, 0x9259, 0x9251, 0x9239, 0x9267, 0x92a7, 0x9277, 0x9278, 0x92e7, 0x92d7, 0x92d9, 0x92d0, 0xfa27, 0x92d5, 0x92e0, 0x92d3, 0x9325, 0x9321, 0x92fb, 0xfa28, 0x931e, 0x92ff, 0x931d, 0x9302, 0x9370, 0x9357, 0x93a4, 0x93c6, 0x93de, 0x93f8, 0x9431, 0x9445, 0x9448, 0x9592, 0xf9dc, 0xfa29, 0x969d, 0x96af, 0x9733, 0x973b, 0x9743, 0x974d, 0x974f, 0x9751, 0x9755, 0x9857, 0x9865, 0xfa2a, 0xfa2b, 0x9927, 0xfa2c, 0x999e, 0x9a4e, 0x9ad9, 0x9adc, 0x9b75, 0x9b72, 0x9b8f, 0x9bb1, 0x9bbb, 0x9c00, 0x9d70, 0x9d6b, 0xfa2d, 0x9e19, 0x9ed1, 0xfffd, 0xfffd, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0xffe2, 0xffe4, 0xff07, 0xff02 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfa40[ 189 ] = { 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0xffe2, 0xffe4, 0xff07, 0xff02, 0x3231, 0x2116, 0x2121, 0x2235, 0x7e8a, 0x891c, 0x9348, 0x9288, 0x84dc, 0x4fc9, 0x70bb, 0x6631, 0x68c8, 0x92f9, 0x66fb, 0x5f45, 0x4e28, 0x4ee1, 0x4efc, 0x4f00, 0x4f03, 0x4f39, 0x4f56, 0x4f92, 0x4f8a, 0x4f9a, 0x4f94, 0x4fcd, 0x5040, 0x5022, 0x4fff, 0x501e, 0x5046, 0x5070, 0x5042, 0x5094, 0x50f4, 0x50d8, 0x514a, 0xfffd, 0x5164, 0x519d, 0x51be, 0x51ec, 0x5215, 0x529c, 0x52a6, 0x52c0, 0x52db, 0x5300, 0x5307, 0x5324, 0x5372, 0x5393, 0x53b2, 0x53dd, 0xfa0e, 0x549c, 0x548a, 0x54a9, 0x54ff, 0x5586, 0x5759, 0x5765, 0x57ac, 0x57c8, 0x57c7, 0xfa0f, 0xfa10, 0x589e, 0x58b2, 0x590b, 0x5953, 0x595b, 0x595d, 0x5963, 0x59a4, 0x59ba, 0x5b56, 0x5bc0, 0x752f, 0x5bd8, 0x5bec, 0x5c1e, 0x5ca6, 0x5cba, 0x5cf5, 0x5d27, 0x5d53, 0xfa11, 0x5d42, 0x5d6d, 0x5db8, 0x5db9, 0x5dd0, 0x5f21, 0x5f34, 0x5f67, 0x5fb7, 0x5fde, 0x605d, 0x6085, 0x608a, 0x60de, 0x60d5, 0x6120, 0x60f2, 0x6111, 0x6137, 0x6130, 0x6198, 0x6213, 0x62a6, 0x63f5, 0x6460, 0x649d, 0x64ce, 0x654e, 0x6600, 0x6615, 0x663b, 0x6609, 0x662e, 0x661e, 0x6624, 0x6665, 0x6657, 0x6659, 0xfa12, 0x6673, 0x6699, 0x66a0, 0x66b2, 0x66bf, 0x66fa, 0x670e, 0xf929, 0x6766, 0x67bb, 0x6852, 0x67c0, 0x6801, 0x6844, 0x68cf, 0xfa13, 0x6968, 0xfa14, 0x6998, 0x69e2, 0x6a30, 0x6a6b, 0x6a46, 0x6a73, 0x6a7e, 0x6ae2, 0x6ae4, 0x6bd6, 0x6c3f, 0x6c5c, 0x6c86, 0x6c6f, 0x6cda, 0x6d04, 0x6d87, 0x6d6f }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfb40[ 189 ] = { 0x6d96, 0x6dac, 0x6dcf, 0x6df8, 0x6df2, 0x6dfc, 0x6e39, 0x6e5c, 0x6e27, 0x6e3c, 0x6ebf, 0x6f88, 0x6fb5, 0x6ff5, 0x7005, 0x7007, 0x7028, 0x7085, 0x70ab, 0x710f, 0x7104, 0x715c, 0x7146, 0x7147, 0xfa15, 0x71c1, 0x71fe, 0x72b1, 0x72be, 0x7324, 0xfa16, 0x7377, 0x73bd, 0x73c9, 0x73d6, 0x73e3, 0x73d2, 0x7407, 0x73f5, 0x7426, 0x742a, 0x7429, 0x742e, 0x7462, 0x7489, 0x749f, 0x7501, 0x756f, 0x7682, 0x769c, 0x769e, 0x769b, 0x76a6, 0xfa17, 0x7746, 0x52af, 0x7821, 0x784e, 0x7864, 0x787a, 0x7930, 0xfa18, 0xfa19, 0xfffd, 0xfa1a, 0x7994, 0xfa1b, 0x799b, 0x7ad1, 0x7ae7, 0xfa1c, 0x7aeb, 0x7b9e, 0xfa1d, 0x7d48, 0x7d5c, 0x7db7, 0x7da0, 0x7dd6, 0x7e52, 0x7f47, 0x7fa1, 0xfa1e, 0x8301, 0x8362, 0x837f, 0x83c7, 0x83f6, 0x8448, 0x84b4, 0x8553, 0x8559, 0x856b, 0xfa1f, 0x85b0, 0xfa20, 0xfa21, 0x8807, 0x88f5, 0x8a12, 0x8a37, 0x8a79, 0x8aa7, 0x8abe, 0x8adf, 0xfa22, 0x8af6, 0x8b53, 0x8b7f, 0x8cf0, 0x8cf4, 0x8d12, 0x8d76, 0xfa23, 0x8ecf, 0xfa24, 0xfa25, 0x9067, 0x90de, 0xfa26, 0x9115, 0x9127, 0x91da, 0x91d7, 0x91de, 0x91ed, 0x91ee, 0x91e4, 0x91e5, 0x9206, 0x9210, 0x920a, 0x923a, 0x9240, 0x923c, 0x924e, 0x9259, 0x9251, 0x9239, 0x9267, 0x92a7, 0x9277, 0x9278, 0x92e7, 0x92d7, 0x92d9, 0x92d0, 0xfa27, 0x92d5, 0x92e0, 0x92d3, 0x9325, 0x9321, 0x92fb, 0xfa28, 0x931e, 0x92ff, 0x931d, 0x9302, 0x9370, 0x9357, 0x93a4, 0x93c6, 0x93de, 0x93f8, 0x9431, 0x9445, 0x9448, 0x9592, 0xf9dc, 0xfa29, 0x969d, 0x96af, 0x9733, 0x973b, 0x9743, 0x974d, 0x974f, 0x9751, 0x9755, 0x9857, 0x9865, 0xfa2a, 0xfa2b, 0x9927, 0xfa2c, 0x999e, 0x9a4e, 0x9ad9 }; const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfc40[ 12 ] = { 0x9adc, 0x9b75, 0x9b72, 0x9b8f, 0x9bb1, 0x9bbb, 0x9c00, 0x9d70, 0x9d6b, 0xfa2d, 0x9e19, 0x9ed1 }; /* Unicode to ASCII character lookup table for Windows 932 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0080[ 128 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9881, 0x4e81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8b81, 0x7d81, 0x001a, 0x001a, 0x4c81, 0x001a, 0xf781, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7e81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8081, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0380[ 256 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9f83, 0xa083, 0xa183, 0xa283, 0xa383, 0xa483, 0xa583, 0xa683, 0xa783, 0xa883, 0xa983, 0xaa83, 0xab83, 0xac83, 0xad83, 0xae83, 0xaf83, 0x001a, 0xb083, 0xb183, 0xb283, 0xb383, 0xb483, 0xb583, 0xb683, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbf83, 0xc083, 0xc183, 0xc283, 0xc383, 0xc483, 0xc583, 0xc683, 0xc783, 0xc883, 0xc983, 0xca83, 0xcb83, 0xcc83, 0xcd83, 0xce83, 0xcf83, 0x001a, 0xd083, 0xd183, 0xd283, 0xd383, 0xd483, 0xd583, 0xd683, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4684, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4084, 0x4184, 0x4284, 0x4384, 0x4484, 0x4584, 0x4784, 0x4884, 0x4984, 0x4a84, 0x4b84, 0x4c84, 0x4d84, 0x4e84, 0x4f84, 0x5084, 0x5184, 0x5284, 0x5384, 0x5484, 0x5584, 0x5684, 0x5784, 0x5884, 0x5984, 0x5a84, 0x5b84, 0x5c84, 0x5d84, 0x5e84, 0x5f84, 0x6084, 0x7084, 0x7184, 0x7284, 0x7384, 0x7484, 0x7584, 0x7784, 0x7884, 0x7984, 0x7a84, 0x7b84, 0x7c84, 0x7d84, 0x7e84, 0x8084, 0x8184, 0x8284, 0x8384, 0x8484, 0x8584, 0x8684, 0x8784, 0x8884, 0x8984, 0x8a84, 0x8b84, 0x8c84, 0x8d84, 0x8e84, 0x8f84, 0x9084, 0x9184, 0x001a, 0x7684, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x2000[ 832 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5d81, 0x001a, 0x001a, 0x001a, 0x001a, 0x5c81, 0x001a, 0x001a, 0x6581, 0x6681, 0x001a, 0x001a, 0x6781, 0x6881, 0x001a, 0x001a, 0xf581, 0xf681, 0x001a, 0x001a, 0x001a, 0x6481, 0x6381, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf181, 0x001a, 0x8c81, 0x8d81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa681, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8e81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8287, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8487, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf081, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5487, 0x5587, 0x5687, 0x5787, 0x5887, 0x5987, 0x5a87, 0x5b87, 0x5c87, 0x5d87, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xefee, 0xf0ee, 0xf1ee, 0xf2ee, 0xf3ee, 0xf4ee, 0xf5ee, 0xf6ee, 0xf7ee, 0xf8ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa981, 0xaa81, 0xa881, 0xab81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcb81, 0x001a, 0xcc81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcd81, 0x001a, 0xdd81, 0xce81, 0x001a, 0x001a, 0x001a, 0xde81, 0xb881, 0x001a, 0x001a, 0xb981, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9487, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe381, 0x001a, 0x001a, 0xe581, 0x8781, 0x9887, 0xda81, 0x001a, 0x001a, 0x001a, 0x001a, 0x6181, 0x001a, 0xc881, 0xc981, 0xbf81, 0xbe81, 0xe781, 0xe881, 0x001a, 0x9387, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8881, 0xe681, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe481, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe081, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8281, 0xdf81, 0x001a, 0x001a, 0x001a, 0x001a, 0x8581, 0x8681, 0x001a, 0x001a, 0xe181, 0xe281, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbc81, 0xbd81, 0x001a, 0x001a, 0xba81, 0xbb81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdb81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9987, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdc81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x2440[ 576 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4087, 0x4187, 0x4287, 0x4387, 0x4487, 0x4587, 0x4687, 0x4787, 0x4887, 0x4987, 0x4a87, 0x4b87, 0x4c87, 0x4d87, 0x4e87, 0x4f87, 0x5087, 0x5187, 0x5287, 0x5387, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9f84, 0xaa84, 0xa084, 0xab84, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa184, 0x001a, 0x001a, 0xac84, 0xa284, 0x001a, 0x001a, 0xad84, 0xa484, 0x001a, 0x001a, 0xaf84, 0xa384, 0x001a, 0x001a, 0xae84, 0xa584, 0xba84, 0x001a, 0x001a, 0xb584, 0x001a, 0x001a, 0xb084, 0xa784, 0xbc84, 0x001a, 0x001a, 0xb784, 0x001a, 0x001a, 0xb284, 0xa684, 0x001a, 0x001a, 0xb684, 0xbb84, 0x001a, 0x001a, 0xb184, 0xa884, 0x001a, 0x001a, 0xb884, 0xbd84, 0x001a, 0x001a, 0xb384, 0xa984, 0x001a, 0x001a, 0xb984, 0x001a, 0x001a, 0xbe84, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb484, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa181, 0xa081, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa381, 0xa281, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa581, 0xa481, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9f81, 0x9e81, 0x001a, 0x001a, 0x001a, 0x9b81, 0x001a, 0x001a, 0x9d81, 0x9c81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a81, 0x9981, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a81, 0x001a, 0x8981, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf481, 0x001a, 0x001a, 0xf381, 0x001a, 0xf281, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x3000[ 256 ] = { 0x4081, 0x4181, 0x4281, 0x5681, 0x001a, 0x5881, 0x5981, 0x5a81, 0x7181, 0x7281, 0x7381, 0x7481, 0x7581, 0x7681, 0x7781, 0x7881, 0x7981, 0x7a81, 0xa781, 0xac81, 0x6b81, 0x6c81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8087, 0x001a, 0x8187, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9f82, 0xa082, 0xa182, 0xa282, 0xa382, 0xa482, 0xa582, 0xa682, 0xa782, 0xa882, 0xa982, 0xaa82, 0xab82, 0xac82, 0xad82, 0xae82, 0xaf82, 0xb082, 0xb182, 0xb282, 0xb382, 0xb482, 0xb582, 0xb682, 0xb782, 0xb882, 0xb982, 0xba82, 0xbb82, 0xbc82, 0xbd82, 0xbe82, 0xbf82, 0xc082, 0xc182, 0xc282, 0xc382, 0xc482, 0xc582, 0xc682, 0xc782, 0xc882, 0xc982, 0xca82, 0xcb82, 0xcc82, 0xcd82, 0xce82, 0xcf82, 0xd082, 0xd182, 0xd282, 0xd382, 0xd482, 0xd582, 0xd682, 0xd782, 0xd882, 0xd982, 0xda82, 0xdb82, 0xdc82, 0xdd82, 0xde82, 0xdf82, 0xe082, 0xe182, 0xe282, 0xe382, 0xe482, 0xe582, 0xe682, 0xe782, 0xe882, 0xe982, 0xea82, 0xeb82, 0xec82, 0xed82, 0xee82, 0xef82, 0xf082, 0xf182, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4a81, 0x4b81, 0x5481, 0x5581, 0x001a, 0x001a, 0x4083, 0x4183, 0x4283, 0x4383, 0x4483, 0x4583, 0x4683, 0x4783, 0x4883, 0x4983, 0x4a83, 0x4b83, 0x4c83, 0x4d83, 0x4e83, 0x4f83, 0x5083, 0x5183, 0x5283, 0x5383, 0x5483, 0x5583, 0x5683, 0x5783, 0x5883, 0x5983, 0x5a83, 0x5b83, 0x5c83, 0x5d83, 0x5e83, 0x5f83, 0x6083, 0x6183, 0x6283, 0x6383, 0x6483, 0x6583, 0x6683, 0x6783, 0x6883, 0x6983, 0x6a83, 0x6b83, 0x6c83, 0x6d83, 0x6e83, 0x6f83, 0x7083, 0x7183, 0x7283, 0x7383, 0x7483, 0x7583, 0x7683, 0x7783, 0x7883, 0x7983, 0x7a83, 0x7b83, 0x7c83, 0x7d83, 0x7e83, 0x8083, 0x8183, 0x8283, 0x8383, 0x8483, 0x8583, 0x8683, 0x8783, 0x8883, 0x8983, 0x8a83, 0x8b83, 0x8c83, 0x8d83, 0x8e83, 0x8f83, 0x9083, 0x9183, 0x9283, 0x9383, 0x9483, 0x9583, 0x9683, 0x001a, 0x001a, 0x001a, 0x001a, 0x4581, 0x5b81, 0x5281, 0x5381, 0x001a }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x3200[ 512 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a87, 0x8b87, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c87, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8587, 0x8687, 0x8787, 0x8887, 0x8987, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6587, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6987, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6087, 0x001a, 0x001a, 0x001a, 0x6387, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6187, 0x6b87, 0x001a, 0x001a, 0x6a87, 0x6487, 0x001a, 0x001a, 0x001a, 0x6c87, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6687, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e87, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5f87, 0x6d87, 0x001a, 0x001a, 0x6287, 0x001a, 0x001a, 0x001a, 0x6787, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6887, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7e87, 0x8f87, 0x8e87, 0x8d87, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7287, 0x7387, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6f87, 0x7087, 0x7187, 0x001a, 0x001a, 0x7587, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7487, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8387, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x4e00[ 22288 ] = { 0xea88, 0x9a92, 0x001a, 0xb58e, 0x001a, 0x001a, 0x001a, 0x9c96, 0xe48f, 0x4f8e, 0xe38f, 0xba89, 0x001a, 0x7395, 0x5e97, 0x001a, 0xa098, 0x4e89, 0x001a, 0x001a, 0x8e8a, 0xa198, 0xa290, 0xc099, 0x758b, 0xb895, 0x001a, 0x001a, 0x001a, 0x001a, 0xe58f, 0x001a, 0x001a, 0xbc97, 0x001a, 0x001a, 0x001a, 0x001a, 0xc095, 0x001a, 0x4ced, 0x001a, 0xa298, 0x001a, 0x001a, 0x8692, 0x001a, 0x001a, 0x001a, 0xa398, 0xf88b, 0x001a, 0x001a, 0x001a, 0xa498, 0x001a, 0xdb8a, 0x4f92, 0x001a, 0xe58e, 0xa598, 0x001a, 0x001a, 0xa698, 0x001a, 0x001a, 0xa798, 0x5494, 0x001a, 0x768b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5694, 0x001a, 0xe193, 0xc18c, 0x5296, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x68e5, 0xa898, 0xe68f, 0xa998, 0xb389, 0x001a, 0x001a, 0x001a, 0xe38b, 0xee8c, 0xe796, 0x001a, 0x001a, 0xa49b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9097, 0x001a, 0xfb93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa38a, 0x001a, 0x548b, 0x001a, 0xaa98, 0x001a, 0x001a, 0xab98, 0xb997, 0x001a, 0x5c97, 0x8891, 0xad98, 0x968e, 0xf193, 0x001a, 0xb098, 0x001a, 0x001a, 0x5d89, 0xdd8c, 0x001a, 0xdc8c, 0xe488, 0x001a, 0x001a, 0x6a98, 0x6998, 0x001a, 0xb18d, 0x9f88, 0x001a, 0xb198, 0xb298, 0xb398, 0x5396, 0xb498, 0x001a, 0xf08c, 0xe588, 0x9296, 0x001a, 0x9c8b, 0x001a, 0x001a, 0x9d8b, 0x9e8b, 0xe092, 0xba97, 0x001a, 0xb598, 0x001a, 0x001a, 0xb698, 0x001a, 0x001a, 0xb798, 0x001a, 0x001a, 0x001a, 0x6c90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x598f, 0x6d90, 0xbc98, 0x001a, 0xba98, 0x001a, 0xbb98, 0x778b, 0x001a, 0x001a, 0xa18d, 0xee89, 0x001a, 0xb998, 0xb898, 0xa795, 0x001a, 0x001a, 0x001a, 0x001a, 0x658e, 0x648e, 0xbc91, 0xbd98, 0x7495, 0xe590, 0x001a, 0x001a, 0x001a, 0x5781, 0xbe98, 0xc098, 0x001a, 0x4ded, 0x001a, 0xe391, 0xdf97, 0xc888, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbf98, 0xbc89, 0x001a, 0xc28b, 0x001a, 0x8792, 0x001a, 0x001a, 0x001a, 0x8f8c, 0xc198, 0x001a, 0x001a, 0x001a, 0x4394, 0x4eed, 0x001a, 0x001a, 0x001a, 0x4fed, 0xe98a, 0x001a, 0x50ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc298, 0xc988, 0x001a, 0x001a, 0xde8c, 0xea8a, 0x9a95, 0xb094, 0x788b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xef89, 0x001a, 0xe598, 0x6093, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c94, 0xc498, 0x001a, 0x001a, 0x001a, 0xba94, 0x001a, 0xe097, 0x001a, 0x4c90, 0x51ed, 0x668e, 0x001a, 0x978e, 0xbe89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcf92, 0x001a, 0x001a, 0x4192, 0xc898, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xca88, 0xe192, 0x5a8f, 0xb28d, 0x4397, 0x001a, 0xcc91, 0x001a, 0xbd89, 0x52ed, 0xc798, 0x001a, 0x5d97, 0xc398, 0xc598, 0xec8d, 0xc698, 0x439b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xce98, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd198, 0xcf98, 0x001a, 0x001a, 0xc089, 0x001a, 0xb995, 0xc998, 0x001a, 0x001a, 0x001a, 0x001a, 0xcd98, 0xf18c, 0x001a, 0x001a, 0x678e, 0x001a, 0x001a, 0x001a, 0xa48a, 0x001a, 0x001a, 0xd298, 0x001a, 0xca98, 0x001a, 0x54ed, 0xe197, 0x001a, 0x988e, 0x001a, 0xcb98, 0x001a, 0xd098, 0x53ed, 0x001a, 0x56ed, 0x001a, 0xd398, 0x001a, 0xcc98, 0x001a, 0x55ed, 0x9f8b, 0x001a, 0xcb88, 0x001a, 0x001a, 0xa08b, 0xbf89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x449b, 0x001a, 0x9996, 0x8e95, 0xf28c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4e90, 0xb597, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd695, 0x001a, 0x001a, 0x578c, 0xa391, 0xe289, 0x001a, 0x001a, 0x001a, 0x001a, 0x45ed, 0x728f, 0x001a, 0x001a, 0x57ed, 0xd798, 0x001a, 0xdc98, 0xda98, 0x001a, 0x001a, 0xd598, 0x001a, 0x001a, 0xad91, 0xd898, 0x001a, 0xdb98, 0xd998, 0x001a, 0xdb95, 0x001a, 0xd698, 0x001a, 0x4d90, 0x001a, 0x9396, 0xdd98, 0xde98, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x438f, 0xeb98, 0x001a, 0x001a, 0x001a, 0x6f94, 0x001a, 0x5595, 0xe698, 0x001a, 0xee95, 0x001a, 0xb489, 0x001a, 0x001a, 0x001a, 0xea98, 0x5aed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe498, 0xed98, 0x001a, 0x001a, 0x7191, 0x001a, 0xc28c, 0x001a, 0x7b94, 0x001a, 0xc5e0, 0x001a, 0xec98, 0x7c93, 0x001a, 0xe198, 0x001a, 0xf48c, 0x001a, 0x001a, 0xf38c, 0xdf98, 0x001a, 0x001a, 0x001a, 0x5bed, 0xd88e, 0x001a, 0xe798, 0x59ed, 0xed95, 0x6c92, 0xe398, 0x918c, 0x001a, 0xe098, 0xe898, 0xe298, 0xcf97, 0xe998, 0x6098, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe48b, 0x001a, 0x001a, 0x908c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x58ed, 0x001a, 0x5eed, 0xee98, 0x001a, 0x001a, 0x5ced, 0xef98, 0xf398, 0xcc88, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xce95, 0xf298, 0x001a, 0x001a, 0x001a, 0x001a, 0xf198, 0xf598, 0x001a, 0x001a, 0x001a, 0xf498, 0x001a, 0xe292, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x928c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf698, 0x001a, 0x001a, 0x001a, 0x5ded, 0x001a, 0xc38e, 0x001a, 0xa491, 0xe392, 0xf48b, 0x001a, 0xf798, 0x001a, 0x001a, 0x001a, 0x001a, 0x558b, 0x001a, 0x001a, 0xf898, 0x001a, 0x001a, 0x001a, 0x001a, 0xfa98, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5496, 0x001a, 0x001a, 0x001a, 0x868c, 0x001a, 0x001a, 0x5fed, 0x001a, 0x001a, 0x001a, 0x508e, 0xf594, 0xf998, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc38d, 0x6297, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc98, 0x4299, 0xfb98, 0xc28d, 0x001a, 0x9d8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x588c, 0x001a, 0x001a, 0x001a, 0x4399, 0x001a, 0x001a, 0xcd8b, 0x001a, 0x001a, 0x001a, 0x4099, 0x4199, 0x001a, 0x001a, 0xad93, 0x001a, 0x9c91, 0x001a, 0xa18b, 0x001a, 0x001a, 0x001a, 0x6c96, 0x4499, 0x001a, 0x61ed, 0x001a, 0xbb97, 0x001a, 0x001a, 0x001a, 0x4599, 0x001a, 0x001a, 0x001a, 0x001a, 0x4899, 0x001a, 0x4699, 0x001a, 0x6d91, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4799, 0x4999, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x60ed, 0x4b99, 0x001a, 0x001a, 0x001a, 0x4a99, 0x001a, 0xc695, 0x001a, 0x001a, 0x001a, 0x001a, 0x568b, 0x4d99, 0x4e99, 0x001a, 0xad89, 0x001a, 0x001a, 0x001a, 0x001a, 0x4c99, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf28e, 0x001a, 0x5199, 0x5099, 0x4f99, 0x001a, 0xd498, 0x001a, 0x5299, 0x001a, 0x001a, 0x001a, 0x001a, 0x9e8f, 0x001a, 0x5399, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4497, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd796, 0x001a, 0x001a, 0x001a, 0x001a, 0x5599, 0x001a, 0x001a, 0x5499, 0x5799, 0x5699, 0x001a, 0x001a, 0x5899, 0x5999, 0xf288, 0x001a, 0xb38c, 0x5a8c, 0x5b8f, 0x9b92, 0xa28b, 0xe690, 0xf58c, 0x62ed, 0x8e8d, 0x5b99, 0xc696, 0x6593, 0x001a, 0x998e, 0x001a, 0x5a99, 0x001a, 0x5c99, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7d93, 0x001a, 0x958a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5d99, 0x001a, 0x63ed, 0xfc93, 0x001a, 0x001a, 0x5391, 0x5f99, 0x6099, 0xaa94, 0xf68c, 0x5a98, 0x6199, 0x001a, 0x001a, 0xa48b, 0x001a, 0x001a, 0x001a, 0xba95, 0xb491, 0xef8b, 0x5493, 0x001a, 0x001a, 0x001a, 0x938c, 0x001a, 0x001a, 0x001a, 0x6299, 0x001a, 0x6399, 0x001a, 0x001a, 0xe093, 0x7e89, 0x001a, 0x001a, 0x6699, 0xfb8d, 0x001a, 0x6599, 0xc48d, 0x001a, 0x6799, 0xece3, 0x6899, 0x6096, 0x6999, 0x001a, 0x6a99, 0x6b99, 0xe78f, 0x001a, 0xca8e, 0x001a, 0x001a, 0x001a, 0x64ed, 0x001a, 0x001a, 0xa58a, 0x001a, 0x6e99, 0x001a, 0x6c99, 0xbb96, 0x6d99, 0x001a, 0x7995, 0x6f99, 0x7099, 0x7199, 0x7e93, 0x001a, 0x001a, 0x001a, 0x7599, 0x7399, 0x7499, 0x7299, 0xe18d, 0x7699, 0xe896, 0xe297, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7799, 0x65ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa690, 0x7899, 0x798f, 0x001a, 0x001a, 0x7999, 0x001a, 0x9c92, 0xbd97, 0x8093, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc399, 0x001a, 0x001a, 0x001a, 0x001a, 0x7a99, 0xa3ea, 0xc38b, 0x001a, 0x001a, 0x7b99, 0x7d96, 0x001a, 0x001a, 0x001a, 0x001a, 0x888f, 0xfa91, 0x001a, 0x7d99, 0xe293, 0x001a, 0x66ed, 0x7e99, 0x001a, 0x001a, 0x8099, 0x4d8a, 0x001a, 0x001a, 0x001a, 0x8199, 0xa58b, 0x001a, 0xca93, 0x9a89, 0x6f8f, 0x001a, 0x001a, 0x9f94, 0x8299, 0x001a, 0x8193, 0x001a, 0x001a, 0x6e90, 0x8399, 0x001a, 0xaa95, 0xd890, 0xa08a, 0x001a, 0xa78a, 0x8499, 0x001a, 0x001a, 0x8699, 0x001a, 0x001a, 0x598c, 0x001a, 0x001a, 0x8599, 0x67ed, 0x001a, 0xf197, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x898f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbb94, 0xca95, 0x001a, 0x8799, 0x001a, 0x9897, 0x8899, 0x001a, 0x001a, 0x001a, 0x8999, 0x001a, 0x9e93, 0x001a, 0x001a, 0x8a99, 0x001a, 0x001a, 0xa790, 0xfc8d, 0x948c, 0x8b99, 0x688e, 0x8f8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe492, 0x8d99, 0x001a, 0x001a, 0xa591, 0x001a, 0x001a, 0xed8d, 0x8e99, 0x8f99, 0x4f91, 0x001a, 0x8c99, 0x001a, 0x001a, 0x001a, 0x001a, 0x9199, 0x001a, 0x5596, 0x001a, 0x001a, 0x001a, 0x001a, 0x848d, 0x001a, 0x001a, 0x9099, 0x001a, 0x001a, 0x001a, 0x001a, 0x958c, 0xdc8d, 0x8d94, 0x001a, 0x001a, 0x001a, 0x9499, 0x9299, 0x001a, 0x001a, 0x001a, 0x001a, 0x9b95, 0xe88f, 0x9b99, 0x848a, 0x9599, 0x9399, 0x6e91, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9799, 0x001a, 0x9699, 0x001a, 0x001a, 0x001a, 0x638a, 0x001a, 0x001a, 0x001a, 0x808c, 0x9c99, 0xab97, 0x001a, 0x001a, 0x001a, 0x9899, 0x001a, 0x001a, 0x001a, 0x9d99, 0x9a99, 0x001a, 0x9999, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcd97, 0x68ed, 0x001a, 0x001a, 0xf78c, 0xc189, 0x001a, 0x001a, 0xf297, 0x001a, 0x001a, 0x69ed, 0x001a, 0x001a, 0x958f, 0x7793, 0x858d, 0xa099, 0xa199, 0x001a, 0x5bee, 0x001a, 0xe397, 0x001a, 0x001a, 0x4a98, 0xa399, 0x001a, 0x001a, 0x001a, 0xf88c, 0x001a, 0x001a, 0xa299, 0x001a, 0x4e8a, 0x001a, 0x6aed, 0xa499, 0x001a, 0x7596, 0x001a, 0xba92, 0x001a, 0x4597, 0x001a, 0xd795, 0x001a, 0x001a, 0x001a, 0xa599, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3e8, 0x001a, 0x001a, 0xae93, 0x001a, 0xa699, 0xa88a, 0xb196, 0x001a, 0x6bed, 0x001a, 0x9f8f, 0xa799, 0xe595, 0xab99, 0x001a, 0xa890, 0xa899, 0xce8b, 0x001a, 0xa999, 0xa98a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4d8c, 0xac99, 0x001a, 0xad99, 0x001a, 0x001a, 0xae99, 0xaf99, 0xd98e, 0x001a, 0x001a, 0x001a, 0xf98c, 0xdc96, 0x6ced, 0xe696, 0xf593, 0x001a, 0x001a, 0xef95, 0xb099, 0x6ded, 0xb199, 0x001a, 0x001a, 0x001a, 0x001a, 0xb399, 0x001a, 0xb599, 0xb499, 0x001a, 0x001a, 0x001a, 0x001a, 0xb699, 0xbb89, 0x6b96, 0x001a, 0xfa8d, 0xb799, 0x001a, 0x001a, 0x7891, 0x001a, 0x001a, 0xa08f, 0xa78b, 0x001a, 0xb899, 0x6eed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd994, 0x001a, 0x001a, 0x001a, 0x001a, 0xb999, 0x001a, 0xba99, 0x001a, 0xbb99, 0x001a, 0x001a, 0x001a, 0x001a, 0xbc99, 0x4395, 0xe68b, 0xe388, 0x001a, 0x001a, 0x001a, 0xbd93, 0xbd99, 0x5c8f, 0x001a, 0xe790, 0x001a, 0xbf99, 0xbe99, 0xa18f, 0xdf8c, 0xc199, 0xbc94, 0x001a, 0x001a, 0xc299, 0x001a, 0x001a, 0x001a, 0xda94, 0xb291, 0xec91, 0xa68b, 0x001a, 0x001a, 0xec93, 0x5092, 0x001a, 0x8e94, 0x001a, 0x6d96, 0x001a, 0xc499, 0x001a, 0xe890, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x548c, 0x001a, 0x001a, 0xc599, 0x001a, 0x001a, 0x001a, 0x001a, 0xc699, 0x4b89, 0xf388, 0xeb8a, 0x6fed, 0xa691, 0x708b, 0x9197, 0x001a, 0xc999, 0xb589, 0x001a, 0x001a, 0xc899, 0x001a, 0x001a, 0x001a, 0xa88b, 0x001a, 0x001a, 0xca99, 0x001a, 0xef96, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x70ed, 0x001a, 0x001a, 0xcb99, 0x001a, 0xd097, 0x001a, 0xfa8c, 0x001a, 0x001a, 0x001a, 0x001a, 0xb48c, 0xcc99, 0x001a, 0x001a, 0x001a, 0x001a, 0xce99, 0xcd99, 0x001a, 0x7e90, 0x5889, 0x001a, 0x001a, 0x001a, 0x7d89, 0xcf99, 0x001a, 0xd099, 0x001a, 0x71ed, 0xb58c, 0x001a, 0x001a, 0xd199, 0x001a, 0x001a, 0x001a, 0x001a, 0x8e8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x518e, 0xd299, 0x001a, 0x001a, 0x001a, 0x001a, 0x9496, 0xb38d, 0x798b, 0x4697, 0x6f91, 0xbd94, 0xfb8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x668f, 0x001a, 0xe68e, 0xf38e, 0x001a, 0x968f, 0x001a, 0xbe94, 0x001a, 0x72ed, 0x001a, 0xd599, 0x001a, 0x6289, 0x7091, 0xfb8c, 0xc38c, 0xe58b, 0x001a, 0x001a, 0xd999, 0x4092, 0xfc91, 0xa98b, 0xa28f, 0xda99, 0xd899, 0xc289, 0xe491, 0xb68e, 0x6a8e, 0x4589, 0x001a, 0x001a, 0x908a, 0x868d, 0x698e, 0x001a, 0xdb99, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdc99, 0x001a, 0x688b, 0x658a, 0x001a, 0x001a, 0x001a, 0x878d, 0x678b, 0xdd92, 0x4489, 0xaf93, 0xbc96, 0x408d, 0x9997, 0x6693, 0xfc8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4e8c, 0x001a, 0xe599, 0x001a, 0xe18b, 0x6996, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdb94, 0x001a, 0x001a, 0xe499, 0x001a, 0xdc8a, 0xdf99, 0xe099, 0xe299, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe399, 0x001a, 0x7a8b, 0x8190, 0x001a, 0xab95, 0xe199, 0xdd99, 0xe18c, 0x001a, 0xde99, 0x001a, 0x4398, 0x001a, 0x001a, 0x001a, 0xf095, 0x001a, 0xe692, 0xe08c, 0x908d, 0x001a, 0x001a, 0x001a, 0xe699, 0x001a, 0x001a, 0xdb93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xea99, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc8e, 0x001a, 0xf48e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xed99, 0xeb99, 0x001a, 0xa196, 0x001a, 0xe899, 0xf199, 0xec99, 0x001a, 0x001a, 0x001a, 0xef99, 0xc48c, 0xbd96, 0x001a, 0x001a, 0xf099, 0x001a, 0x001a, 0x001a, 0xf299, 0x001a, 0xf499, 0x001a, 0x001a, 0x001a, 0x75ed, 0xee8d, 0x6198, 0x001a, 0xe999, 0xe799, 0xf399, 0x001a, 0xee99, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf699, 0x001a, 0x429a, 0xf899, 0x001a, 0x001a, 0xfc99, 0x76ed, 0x001a, 0x409a, 0xf999, 0x001a, 0x001a, 0x5d9a, 0x001a, 0x001a, 0xe78d, 0x508a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf799, 0x001a, 0x001a, 0x001a, 0x449a, 0xf488, 0x439a, 0x001a, 0xa388, 0x6995, 0x419a, 0x001a, 0xfa99, 0x001a, 0x001a, 0xf599, 0xfb99, 0xc68d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x459a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf588, 0x4e9a, 0x001a, 0x001a, 0x469a, 0x479a, 0x001a, 0xa38f, 0x8996, 0x001a, 0x001a, 0x001a, 0x4c9a, 0x4b9a, 0x001a, 0x001a, 0x001a, 0x4e93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4d9a, 0x001a, 0x001a, 0x4a9a, 0x001a, 0x77ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x5389, 0x001a, 0xb48d, 0x4f90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x489a, 0x8293, 0x001a, 0x001a, 0x001a, 0x499a, 0x001a, 0xa088, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x539a, 0x4297, 0x001a, 0xa58f, 0x001a, 0x599a, 0x001a, 0x001a, 0x001a, 0x001a, 0x589a, 0x4f9a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc191, 0x001a, 0x509a, 0x001a, 0x001a, 0x001a, 0xed91, 0x559a, 0xa48f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x529a, 0x001a, 0x001a, 0xe296, 0x001a, 0x001a, 0x001a, 0x5b8c, 0x001a, 0x001a, 0x569a, 0x579a, 0x001a, 0x001a, 0x001a, 0x001a, 0x549a, 0x5a9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x519a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x609a, 0x659a, 0x001a, 0x619a, 0x001a, 0x5c9a, 0x001a, 0x001a, 0x669a, 0x5091, 0x001a, 0x78ed, 0x689a, 0x001a, 0x418d, 0x5e9a, 0x9d92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x629a, 0x5b9a, 0xab8a, 0x001a, 0xec8a, 0x858a, 0x639a, 0x5f9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x968c, 0x699a, 0x679a, 0x7291, 0x698b, 0xaa8b, 0x001a, 0x649a, 0x001a, 0xf28b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6389, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d9a, 0x6b9a, 0x001a, 0xa59a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x709a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6a9a, 0x001a, 0x6e9a, 0x001a, 0x001a, 0x6c9a, 0x001a, 0x001a, 0x001a, 0x6b8e, 0x6f9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x729a, 0x001a, 0x779a, 0x001a, 0x001a, 0x001a, 0x759a, 0x749a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5192, 0x001a, 0x001a, 0xc389, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x719a, 0x001a, 0x739a, 0xa68f, 0x5289, 0x001a, 0x001a, 0x769a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdc89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x829a, 0x001a, 0xfa8f, 0x7d9a, 0x001a, 0x7b9a, 0x001a, 0x7c9a, 0x001a, 0x7e9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5c89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5891, 0x001a, 0x789a, 0x001a, 0x799a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x819a, 0x001a, 0x001a, 0x001a, 0xed8a, 0x001a, 0x849a, 0x809a, 0x839a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xac95, 0x001a, 0x001a, 0x001a, 0xd393, 0x001a, 0xb694, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x869a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x859a, 0x648a, 0x001a, 0x001a, 0x879a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x899a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x889a, 0x001a, 0x5894, 0x001a, 0x001a, 0x8b9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8e9a, 0x001a, 0x8d9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x909a, 0x001a, 0x001a, 0x001a, 0x939a, 0x919a, 0x8f9a, 0x929a, 0x001a, 0x001a, 0x001a, 0x001a, 0x949a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x959a, 0x001a, 0x001a, 0x969a, 0x001a, 0x979a, 0x001a, 0x001a, 0x001a, 0x989a, 0x6499, 0x001a, 0xfa8e, 0x6c8e, 0x001a, 0x001a, 0xf189, 0x001a, 0xf688, 0x001a, 0x001a, 0x6392, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x999a, 0x001a, 0xa28d, 0x001a, 0xcd88, 0x7d90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a9a, 0xc58c, 0x001a, 0x001a, 0x918d, 0x001a, 0x9c9a, 0x9b9a, 0x001a, 0x001a, 0xde95, 0x9d9a, 0x001a, 0x001a, 0x001a, 0x9f9a, 0x9e9a, 0x001a, 0xa09a, 0x001a, 0xa19a, 0x001a, 0x978c, 0x001a, 0x001a, 0x8089, 0xa29a, 0x001a, 0x001a, 0xa49a, 0x001a, 0xa39a, 0x001a, 0x001a, 0x001a, 0xa69a, 0x001a, 0x001a, 0x7993, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa79a, 0xb388, 0xdd8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x5c8c, 0x001a, 0x001a, 0x6e92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa89a, 0xa99a, 0x001a, 0x001a, 0xab9a, 0x001a, 0x001a, 0x001a, 0x001a, 0xac9a, 0x001a, 0xe28d, 0x001a, 0x001a, 0x001a, 0x001a, 0xcf8b, 0x001a, 0x001a, 0x5696, 0x001a, 0x001a, 0x001a, 0xaa9a, 0xad9a, 0xbf8d, 0x428d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x79ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb19a, 0x001a, 0x001a, 0xa38d, 0x7aed, 0x5292, 0x001a, 0x001a, 0xae9a, 0xd892, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb29a, 0x001a, 0x001a, 0x8290, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb09a, 0xb39a, 0x001a, 0x5e8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb49a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb59a, 0x001a, 0x438d, 0x5f8a, 0xb79a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb89a, 0x001a, 0x7bed, 0x001a, 0x001a, 0x001a, 0xb99a, 0x001a, 0x001a, 0xb69a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaf9a, 0x001a, 0x001a, 0xba9a, 0x001a, 0x001a, 0xbb9a, 0x7ded, 0x7ced, 0x001a, 0x001a, 0x8496, 0x001a, 0x001a, 0xe98f, 0x001a, 0x001a, 0x001a, 0xbd9a, 0xbe9a, 0xbc9a, 0x001a, 0xc09a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5794, 0x001a, 0x001a, 0xe688, 0x7595, 0x001a, 0x001a, 0xc19a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfb8f, 0x001a, 0x001a, 0xb78e, 0x001a, 0x7c94, 0xee8a, 0x001a, 0xe98d, 0x001a, 0x001a, 0x001a, 0x7896, 0x001a, 0xb093, 0x001a, 0x001a, 0x988c, 0xcd91, 0x001a, 0x001a, 0x001a, 0xbf9a, 0xc29a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc291, 0x001a, 0x001a, 0x001a, 0xc39a, 0x001a, 0x001a, 0x001a, 0xc49a, 0x001a, 0x001a, 0x001a, 0xc69a, 0x001a, 0x001a, 0xe792, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xac8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9fea, 0x8189, 0xf195, 0x001a, 0x001a, 0xea8f, 0x6793, 0x001a, 0x001a, 0x001a, 0x001a, 0xe48d, 0x001a, 0x001a, 0xcc9a, 0x001a, 0x001a, 0xbb95, 0xdb97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf289, 0xc89a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5991, 0xcb9a, 0x001a, 0x8393, 0x001a, 0x001a, 0x6893, 0x8493, 0xb794, 0xcb92, 0x001a, 0x001a, 0x001a, 0xc78d, 0x001a, 0x001a, 0x001a, 0xc79a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9689, 0x001a, 0x5593, 0x001a, 0x001a, 0x001a, 0x001a, 0xc99a, 0x001a, 0xc59a, 0x001a, 0x001a, 0x6f90, 0x001a, 0x001a, 0x001a, 0xcd9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d8f, 0x001a, 0x001a, 0x001a, 0x001a, 0xab8b, 0x001a, 0xce9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe695, 0x001a, 0x001a, 0x001a, 0x9d91, 0x001a, 0x001a, 0x001a, 0x001a, 0xc492, 0x001a, 0x81ed, 0xd09a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e96, 0x001a, 0x001a, 0xd19a, 0x001a, 0x001a, 0xd69a, 0x001a, 0x001a, 0x001a, 0x82ed, 0xad95, 0x001a, 0x001a, 0x001a, 0x001a, 0xd59a, 0xcf9a, 0xd29a, 0xd49a, 0x001a, 0x001a, 0xa48d, 0x001a, 0x001a, 0xc795, 0x001a, 0x001a, 0x001a, 0xd79a, 0x001a, 0x6492, 0x001a, 0x001a, 0xf389, 0x001a, 0xeb8f, 0x001a, 0x001a, 0x001a, 0x001a, 0xd99a, 0x001a, 0xd89a, 0x001a, 0x888d, 0x001a, 0xda9a, 0xdc9a, 0xdb9a, 0x001a, 0x001a, 0xde9a, 0x001a, 0xd39a, 0xe09a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf9a, 0xdd9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d8e, 0x7090, 0x001a, 0x7391, 0xe19a, 0xba90, 0xeb88, 0x8494, 0x001a, 0x001a, 0x001a, 0x001a, 0xd992, 0x001a, 0xe39a, 0xe29a, 0xe49a, 0xe59a, 0xe69a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe79a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcf95, 0xe89a, 0x83ed, 0x001a, 0x001a, 0x001a, 0xc489, 0xe99a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5b97, 0x4f8a, 0x001a, 0xc799, 0x678f, 0xbd91, 0xea9a, 0xe996, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb296, 0x001a, 0x001a, 0xec9a, 0x001a, 0xe591, 0x001a, 0x5693, 0xbe91, 0x7695, 0xed9a, 0xee9a, 0x9b89, 0x001a, 0x001a, 0xb88e, 0xef9a, 0x001a, 0x001a, 0x001a, 0x001a, 0xce88, 0xf09a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf19a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8289, 0x001a, 0x001a, 0xef8a, 0xde93, 0xf295, 0x001a, 0x001a, 0x001a, 0x001a, 0xf59a, 0x7491, 0xf49a, 0x5f8c, 0x001a, 0x84ed, 0x7a96, 0xf39a, 0x001a, 0x8593, 0xf79a, 0x001a, 0xf69a, 0x85ed, 0x001a, 0x86ed, 0x001a, 0x001a, 0xf99a, 0x001a, 0xf89a, 0x87ed, 0x001a, 0x9c89, 0x001a, 0xfa9a, 0xa78f, 0xfc9a, 0x4492, 0x001a, 0xfb9a, 0x001a, 0xb195, 0x001a, 0x001a, 0x001a, 0x001a, 0x978f, 0x7a93, 0x001a, 0x001a, 0x001a, 0x409b, 0x001a, 0x001a, 0x001a, 0x001a, 0x448d, 0x001a, 0x001a, 0x001a, 0x419b, 0x4094, 0xdc94, 0xcf96, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4494, 0x001a, 0x001a, 0x4a9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x578b, 0x001a, 0x001a, 0x6497, 0x001a, 0x001a, 0xad96, 0x001a, 0xaa9b, 0x001a, 0x429b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x459b, 0x88ed, 0xc391, 0x001a, 0x001a, 0x5796, 0x001a, 0x001a, 0x001a, 0x6993, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x469b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8596, 0x89ed, 0xc88d, 0x001a, 0x001a, 0xa88f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x479b, 0x001a, 0x001a, 0x6f8e, 0x001a, 0x6e8e, 0x001a, 0x001a, 0x001a, 0x001a, 0xb788, 0xc68c, 0x001a, 0xa990, 0xcf88, 0x001a, 0x001a, 0x001a, 0x001a, 0x4b9b, 0x4c9b, 0x001a, 0x499b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5789, 0xad8a, 0x001a, 0x489b, 0x001a, 0xc396, 0x5095, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa688, 0x001a, 0x001a, 0x001a, 0x001a, 0xf788, 0x001a, 0x001a, 0x001a, 0x708e, 0x001a, 0xd088, 0x001a, 0xa188, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x519b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4f9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xba96, 0x001a, 0x529b, 0x001a, 0x509b, 0x001a, 0x001a, 0x4e9b, 0x5090, 0x001a, 0x001a, 0x001a, 0x001a, 0x4d9b, 0x001a, 0x001a, 0x001a, 0xd895, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe28c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x569b, 0x579b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa98f, 0x001a, 0x001a, 0x001a, 0x539b, 0x4b98, 0x001a, 0x001a, 0x001a, 0x001a, 0x6b94, 0x001a, 0x001a, 0x559b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa58d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x589b, 0x001a, 0x001a, 0x001a, 0x7795, 0x001a, 0x001a, 0x001a, 0x599b, 0x001a, 0x549b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb996, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7d94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5a9b, 0x5195, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5b9b, 0x5f9b, 0x5c9b, 0x001a, 0x001a, 0xc589, 0x5e9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb98e, 0x001a, 0x5d9b, 0x998c, 0x001a, 0x001a, 0x001a, 0x6b9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x649b, 0x619b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8492, 0x001a, 0x609b, 0x001a, 0x001a, 0x629b, 0x001a, 0x001a, 0x639b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x659b, 0x669b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf08a, 0x001a, 0x689b, 0x679b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x699b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xec8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6c9b, 0x001a, 0xda92, 0x001a, 0x001a, 0x001a, 0x6489, 0x001a, 0x6a9b, 0x001a, 0x001a, 0x001a, 0x6d9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e9b, 0x001a, 0x719b, 0x001a, 0x001a, 0x6f9b, 0x001a, 0x709b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x718e, 0x729b, 0x001a, 0x001a, 0x458d, 0x739b, 0x8aed, 0x9a8e, 0xb691, 0x001a, 0x749b, 0x759b, 0x798e, 0x468d, 0x001a, 0xd096, 0x001a, 0x001a, 0x001a, 0x478b, 0xc78c, 0x769b, 0x778a, 0x001a, 0x001a, 0x779b, 0x001a, 0xb791, 0x001a, 0x001a, 0x001a, 0x001a, 0x789b, 0xa19b, 0x001a, 0x799b, 0x001a, 0x7a9b, 0x001a, 0x001a, 0x7b9b, 0x001a, 0x7d9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7e9b, 0x001a, 0x001a, 0x809b, 0x001a, 0xee91, 0x001a, 0x4689, 0xe78e, 0xc088, 0x001a, 0x7691, 0xae8a, 0xb38e, 0x001a, 0x478d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8693, 0x001a, 0x408f, 0xaf8a, 0x8892, 0xe892, 0xb688, 0x588b, 0xf395, 0x001a, 0xc08e, 0x001a, 0x001a, 0x718b, 0xe990, 0xba8e, 0x4797, 0x819b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7b8b, 0x001a, 0xc98d, 0x001a, 0x001a, 0x518a, 0x8389, 0xaa8f, 0xc689, 0x001a, 0x829b, 0x6597, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x688f, 0x8bed, 0x001a, 0xe28e, 0x839b, 0xf18a, 0xd093, 0xa796, 0x849b, 0x001a, 0x859b, 0x001a, 0x001a, 0x7895, 0x001a, 0x001a, 0x001a, 0x879b, 0x001a, 0xa68a, 0xf58b, 0x869b, 0x001a, 0x001a, 0x001a, 0x8ded, 0x001a, 0x001a, 0xb08a, 0x001a, 0x5190, 0x8b9b, 0x408e, 0x001a, 0xc789, 0x8a9b, 0x001a, 0x889b, 0x8c9b, 0x899b, 0x4a94, 0xcb9e, 0x5290, 0x001a, 0x8d9b, 0x8eed, 0x001a, 0xbe97, 0x001a, 0x8e9b, 0x001a, 0x001a, 0x909b, 0x001a, 0x9e92, 0x8f9b, 0x001a, 0xa190, 0x001a, 0x9b8e, 0x001a, 0x001a, 0x001a, 0xce91, 0xf58e, 0x001a, 0x9595, 0xea90, 0x001a, 0xcb8e, 0x919b, 0xab8f, 0x929b, 0x939b, 0xd188, 0xb891, 0x7190, 0x001a, 0x949b, 0xb193, 0xac8f, 0x001a, 0xad8f, 0x001a, 0x959b, 0x001a, 0x001a, 0xeb90, 0x001a, 0x001a, 0x001a, 0xae8f, 0x001a, 0x001a, 0x001a, 0x8fed, 0x001a, 0x969b, 0x001a, 0x979b, 0x001a, 0xde96, 0x001a, 0x001a, 0x001a, 0x989b, 0x001a, 0x001a, 0x001a, 0x001a, 0xc48b, 0x001a, 0x001a, 0x001a, 0x418f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x999b, 0x9a9b, 0xda8e, 0x4b90, 0xf293, 0x7390, 0xf694, 0x4194, 0xc78b, 0x9b9b, 0x001a, 0x001a, 0x001a, 0x8f8b, 0x9c9b, 0x001a, 0xfc8b, 0x001a, 0xcd93, 0xae89, 0x001a, 0x728e, 0x9d9b, 0xa09b, 0x9f9b, 0xfb8b, 0x001a, 0x9e9b, 0x001a, 0x5793, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xae91, 0x001a, 0x6a93, 0xc68e, 0x001a, 0x001a, 0x7791, 0x9a97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa29b, 0x001a, 0xa39b, 0xd493, 0x001a, 0x528e, 0x001a, 0x001a, 0x001a, 0x001a, 0xa59b, 0x001a, 0x001a, 0xa69b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa79b, 0x001a, 0x001a, 0x001a, 0xf28a, 0xa89b, 0x001a, 0x001a, 0xa99b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaa89, 0x001a, 0x001a, 0x001a, 0x001a, 0x90ed, 0x001a, 0x5a91, 0xe28a, 0x001a, 0xab9b, 0xa696, 0x001a, 0x001a, 0x001a, 0x001a, 0xd091, 0x001a, 0x788a, 0x001a, 0x001a, 0xad9b, 0xaf9b, 0xdd8a, 0x001a, 0x91ed, 0xac9b, 0xae9b, 0x001a, 0xb19b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb09b, 0x001a, 0xb29b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb39b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbb93, 0xac8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe389, 0xb49b, 0xb99b, 0x001a, 0x001a, 0xb79b, 0x001a, 0xf595, 0xf495, 0x001a, 0x001a, 0x001a, 0x001a, 0x92ed, 0x8793, 0x001a, 0x001a, 0x001a, 0xb69b, 0x738f, 0x001a, 0xb59b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9290, 0x001a, 0x001a, 0x001a, 0xba9b, 0x001a, 0x001a, 0xe88d, 0x001a, 0x001a, 0xc09b, 0x001a, 0x001a, 0xc19b, 0xbb9b, 0x528a, 0xbc9b, 0xc59b, 0xc49b, 0xc39b, 0xbf9b, 0x001a, 0x001a, 0x001a, 0xbe9b, 0x001a, 0x001a, 0xc29b, 0x001a, 0x001a, 0x001a, 0x001a, 0x93ed, 0x001a, 0xf695, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x96ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc99b, 0xc69b, 0x001a, 0xc89b, 0x001a, 0x9297, 0x001a, 0xc79b, 0x94ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbd9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9390, 0x001a, 0x001a, 0xca9b, 0x97ed, 0x001a, 0xb58d, 0x001a, 0x001a, 0x001a, 0xcb9b, 0x001a, 0x001a, 0xcc9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcf9b, 0x001a, 0xce9b, 0x001a, 0x001a, 0xcd9b, 0x001a, 0x001a, 0x001a, 0x8893, 0xb89b, 0x001a, 0x001a, 0x001a, 0xd59b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd19b, 0x001a, 0x001a, 0x001a, 0x001a, 0xd09b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd29b, 0x001a, 0xd39b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd69b, 0x98ed, 0x99ed, 0xe497, 0x001a, 0xd79b, 0xd49b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd89b, 0x001a, 0x001a, 0xde8a, 0xd99b, 0x001a, 0x001a, 0x9aed, 0x001a, 0xdb9b, 0xda9b, 0x001a, 0x001a, 0xdc9b, 0x001a, 0x001a, 0x001a, 0x001a, 0xdd9b, 0x001a, 0xec90, 0x428f, 0x001a, 0x001a, 0x848f, 0x001a, 0x8391, 0x001a, 0x488d, 0xb68d, 0x498d, 0x908b, 0x001a, 0x001a, 0xde9b, 0x001a, 0x001a, 0xb78d, 0x001a, 0x001a, 0xc88c, 0xdf9b, 0xa496, 0x6294, 0xe09b, 0x001a, 0x4a8d, 0x001a, 0x001a, 0x001a, 0xaa8a, 0x001a, 0x4692, 0xd08b, 0x001a, 0x001a, 0x001a, 0x738e, 0x7a95, 0x001a, 0x001a, 0xbf94, 0x001a, 0x001a, 0x001a, 0x001a, 0xe19b, 0xf38a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe49b, 0x001a, 0x001a, 0x001a, 0x001a, 0x9f92, 0x001a, 0x001a, 0xe39b, 0xe29b, 0xe59b, 0x001a, 0xe992, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8390, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x748e, 0x001a, 0xc890, 0x001a, 0xd191, 0x418b, 0x001a, 0x001a, 0xa092, 0x001a, 0x001a, 0xe69b, 0xe79b, 0xed8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x5896, 0x001a, 0x001a, 0xea9b, 0x001a, 0x001a, 0xe99b, 0xe89b, 0x9d95, 0x001a, 0xf19b, 0x001a, 0x001a, 0x001a, 0x001a, 0x7996, 0x001a, 0xeb9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xed9b, 0x8b96, 0x001a, 0xec9b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xee9b, 0x001a, 0xa694, 0xef9b, 0xbc95, 0xf09b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb18a, 0xbd95, 0x4e94, 0xf29b, 0xf39b, 0x001a, 0x4b8d, 0xb28a, 0xf49b, 0xb68c, 0x6397, 0x4897, 0xf48a, 0xf69b, 0x001a, 0xa192, 0x001a, 0x4c8d, 0xaf8f, 0x001a, 0x001a, 0xdd94, 0x001a, 0x001a, 0xb08f, 0x001a, 0x001a, 0x001a, 0x001a, 0x988f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xea92, 0xf795, 0x5893, 0x001a, 0x001a, 0x4d8d, 0x001a, 0x7b95, 0x001a, 0x001a, 0x001a, 0xf79b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7893, 0xc08d, 0x001a, 0x001a, 0x001a, 0xc98c, 0x001a, 0xeb92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc188, 0x8e8f, 0x4e8d, 0x6697, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf89b, 0xf99b, 0x7094, 0x001a, 0x001a, 0x001a, 0x001a, 0xfa9b, 0xf597, 0x4c98, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc9b, 0xfb9b, 0x001a, 0x001a, 0x668a, 0x001a, 0x001a, 0x409c, 0x001a, 0x001a, 0x001a, 0x439c, 0x449c, 0x001a, 0x429c, 0x001a, 0x5f95, 0xb18f, 0x469c, 0x459c, 0x419c, 0x001a, 0x001a, 0x001a, 0x001a, 0x479c, 0x489c, 0x001a, 0x001a, 0x499c, 0x001a, 0x001a, 0x001a, 0x4c9c, 0x4a9c, 0x001a, 0x4b9c, 0x4d9c, 0x001a, 0x8489, 0xec92, 0x4e9c, 0x001a, 0x9a8c, 0xf489, 0x5594, 0x001a, 0x4f9c, 0xf993, 0x001a, 0xd995, 0x001a, 0x509c, 0x4d98, 0x001a, 0x001a, 0x001a, 0x001a, 0x519c, 0xbe95, 0x549c, 0x9f98, 0xaf98, 0x001a, 0xae8e, 0xf393, 0x559c, 0x001a, 0x7c8b, 0xa292, 0xf888, 0x569c, 0xa495, 0x4f8d, 0x001a, 0x001a, 0x6f92, 0x001a, 0x001a, 0x001a, 0xed92, 0x001a, 0x9bed, 0x001a, 0x001a, 0x001a, 0xed96, 0xb78c, 0xca8c, 0x001a, 0x579c, 0x001a, 0x001a, 0x001a, 0x589c, 0x001a, 0x5e9c, 0x001a, 0xe38e, 0x001a, 0x001a, 0x9ced, 0xa392, 0x001a, 0xad8b, 0x599c, 0x001a, 0x001a, 0x001a, 0x4a95, 0x001a, 0x6592, 0x001a, 0x001a, 0x5a9c, 0x001a, 0x001a, 0x001a, 0x4bed, 0x001a, 0x001a, 0x5b9c, 0x001a, 0xae8b, 0x001a, 0x5c9c, 0x001a, 0x5d9c, 0x001a, 0x001a, 0x5f9c, 0x001a, 0x9693, 0x001a, 0x001a, 0x609c, 0x619c, 0x001a, 0x629c, 0x001a, 0x001a, 0x539c, 0x529c, 0x001a, 0x001a, 0x001a, 0x639c, 0x608c, 0x001a, 0x001a, 0x001a, 0x4695, 0x9ded, 0x001a, 0xca8d, 0x5695, 0xa492, 0x6a95, 0x649c, 0x001a, 0x001a, 0xb28f, 0x6589, 0x001a, 0x659c, 0x001a, 0x001a, 0x001a, 0x669c, 0x001a, 0xf096, 0x001a, 0x001a, 0xde94, 0x001a, 0x001a, 0x699c, 0x9d89, 0xaa90, 0x689c, 0x679c, 0x618c, 0xd291, 0x001a, 0x6d9c, 0x6b9c, 0x001a, 0x6a9c, 0xa597, 0xe38c, 0x001a, 0x001a, 0x001a, 0x998f, 0x6c9c, 0x6b93, 0x5d8f, 0x001a, 0x001a, 0x001a, 0xbe93, 0x709c, 0x6f9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e9c, 0x001a, 0x719c, 0xe48c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x729c, 0x9c95, 0x7a8f, 0x001a, 0x001a, 0x739c, 0xf794, 0x001a, 0x001a, 0x001a, 0x001a, 0xbf93, 0xa592, 0x001a, 0x001a, 0x9eed, 0x001a, 0x4f93, 0x001a, 0x001a, 0x749c, 0x4a8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5390, 0x001a, 0x4b95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf58a, 0x4594, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x759c, 0x758e, 0x5996, 0x5a96, 0x001a, 0x001a, 0x9e89, 0x7a9c, 0x9fed, 0x001a, 0x8992, 0x001a, 0x001a, 0x001a, 0x779c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf589, 0x001a, 0x001a, 0x001a, 0x001a, 0xab9c, 0x799c, 0x001a, 0x001a, 0x001a, 0x4f94, 0x001a, 0x001a, 0x789c, 0x001a, 0x001a, 0x769c, 0x001a, 0x9a8d, 0x001a, 0x7c9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x839c, 0x899c, 0x819c, 0x001a, 0x7b93, 0x001a, 0x001a, 0x869c, 0x7c95, 0x001a, 0x001a, 0x809c, 0x001a, 0x859c, 0xe597, 0x768e, 0x001a, 0x001a, 0xd391, 0x7d9c, 0x001a, 0x001a, 0x001a, 0x7d8b, 0x889c, 0xab90, 0x8589, 0x829c, 0xf689, 0x879c, 0x001a, 0x001a, 0x001a, 0xaf8b, 0x001a, 0x849c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c9c, 0x969c, 0x949c, 0x001a, 0x001a, 0x919c, 0x001a, 0x001a, 0x001a, 0x909c, 0xf697, 0x001a, 0x929c, 0x001a, 0x001a, 0xb08b, 0x001a, 0x508d, 0x001a, 0x001a, 0x9a8f, 0x001a, 0x001a, 0x001a, 0x999c, 0x8b9c, 0x001a, 0x001a, 0xa0ed, 0x001a, 0x8f9c, 0x7e9c, 0x001a, 0xf889, 0x939c, 0x959c, 0x7092, 0x001a, 0x001a, 0xa68d, 0xb689, 0x8d9c, 0x989c, 0x979c, 0xb18b, 0x001a, 0xa791, 0x868a, 0x001a, 0x001a, 0x001a, 0x001a, 0x628c, 0x001a, 0x8e9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a9c, 0x001a, 0x9d9c, 0x9f9c, 0xa1ed, 0x001a, 0x001a, 0x001a, 0xbb8e, 0xa2ed, 0xa59c, 0xee92, 0x9b9c, 0x001a, 0x001a, 0x001a, 0x001a, 0xa39c, 0x001a, 0xf789, 0x001a, 0xa19c, 0xa29c, 0x001a, 0x001a, 0x9e9c, 0xa09c, 0x001a, 0x001a, 0x001a, 0xe58c, 0x4997, 0x001a, 0x001a, 0xb38a, 0x001a, 0x001a, 0x7889, 0xa49c, 0x001a, 0x5994, 0xab88, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf94, 0x7b9c, 0xaa9c, 0xae9c, 0xe396, 0x001a, 0xa79c, 0x001a, 0x001a, 0x001a, 0x8993, 0xac9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xee8f, 0xad9c, 0xd593, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6698, 0x001a, 0xa99c, 0x001a, 0xa4ed, 0x001a, 0x001a, 0xaf9c, 0x001a, 0x9b8d, 0x001a, 0xc990, 0x001a, 0xa3ed, 0xd288, 0xa89c, 0xa69c, 0x001a, 0x7991, 0x001a, 0x001a, 0x001a, 0x9c9c, 0x538e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc491, 0xbb9c, 0xa6ed, 0x7a91, 0xb69c, 0x001a, 0xb39c, 0xb49c, 0x001a, 0xe48e, 0xb79c, 0xba9c, 0x001a, 0x001a, 0x001a, 0x001a, 0xb59c, 0x448f, 0x001a, 0xb89c, 0x001a, 0x001a, 0xb29c, 0x001a, 0xfa96, 0xf996, 0x001a, 0x001a, 0x001a, 0xbc9c, 0xbd9c, 0xd388, 0x001a, 0xa7ed, 0x001a, 0x001a, 0x001a, 0xb19c, 0x001a, 0x001a, 0x001a, 0x001a, 0xf08b, 0xa488, 0x001a, 0x001a, 0x001a, 0xb48a, 0xa5ed, 0xb99c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc19c, 0xc09c, 0x001a, 0x001a, 0x001a, 0xc59c, 0x001a, 0x001a, 0x001a, 0xa9ed, 0x001a, 0x001a, 0x001a, 0xc69c, 0x001a, 0x001a, 0xa8ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xc49c, 0xc79c, 0xbf9c, 0xc39c, 0x001a, 0x001a, 0xc89c, 0x001a, 0xc99c, 0x001a, 0x001a, 0xbe9c, 0x9c8e, 0x001a, 0xc29c, 0xd491, 0x518d, 0xb09c, 0x5490, 0x001a, 0x001a, 0x001a, 0x001a, 0xd69c, 0x001a, 0xe795, 0x001a, 0x001a, 0xcc9c, 0xcd9c, 0xce9c, 0x001a, 0x001a, 0xd59c, 0x001a, 0xd49c, 0x001a, 0x001a, 0x9d96, 0xb58a, 0x001a, 0xd29c, 0x001a, 0x648c, 0x538a, 0x001a, 0x001a, 0xcf9c, 0x001a, 0x001a, 0xb697, 0xd19c, 0xd488, 0xd39c, 0x001a, 0xca9c, 0xd09c, 0xd79c, 0x638c, 0xcb9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7c97, 0x001a, 0x001a, 0x001a, 0x4a97, 0x001a, 0x001a, 0x001a, 0x001a, 0xda9c, 0x001a, 0x001a, 0xde9c, 0x001a, 0x001a, 0x001a, 0x9e91, 0x001a, 0xf797, 0xdf9c, 0x001a, 0x001a, 0xdc9c, 0x001a, 0xd99c, 0x001a, 0xaaed, 0xd89c, 0xdd9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xae95, 0x001a, 0x001a, 0xb293, 0x001a, 0x658c, 0x001a, 0xe09c, 0xdb9c, 0x001a, 0xe19c, 0x001a, 0x001a, 0x001a, 0x9b8c, 0x001a, 0x001a, 0x001a, 0xaf89, 0x001a, 0x001a, 0x001a, 0xe99c, 0x001a, 0x001a, 0x001a, 0xb68a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe79c, 0x001a, 0x001a, 0xe89c, 0xa78d, 0xe69c, 0xe49c, 0xe39c, 0xea9c, 0xe29c, 0xec9c, 0x001a, 0x001a, 0xf989, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xee9c, 0x001a, 0x001a, 0xed9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa692, 0x001a, 0xf19c, 0x001a, 0xef9c, 0xe59c, 0x9c8c, 0x001a, 0xf09c, 0x001a, 0xf49c, 0xf39c, 0xf59c, 0xf29c, 0xf69c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf79c, 0xf89c, 0xe895, 0x001a, 0xfa9c, 0xf99c, 0x5e8f, 0x001a, 0xac90, 0xe489, 0xfa89, 0xabed, 0xfb9c, 0x001a, 0xbd88, 0x001a, 0x001a, 0x001a, 0xca90, 0xfc9c, 0x001a, 0xc1e6, 0x409d, 0x818c, 0x001a, 0x419d, 0x001a, 0x001a, 0x001a, 0x001a, 0xed90, 0x001a, 0x001a, 0x001a, 0x429d, 0x001a, 0x001a, 0x001a, 0x439d, 0x598b, 0x449d, 0x001a, 0x459d, 0x469d, 0xd591, 0x001a, 0x001a, 0x001a, 0xcb8c, 0x001a, 0x001a, 0xdf96, 0x001a, 0x001a, 0x001a, 0x5b96, 0x8a8f, 0x479d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xee90, 0xbbe7, 0xe094, 0x001a, 0xe88e, 0x001a, 0xcb8d, 0x489d, 0x001a, 0x001a, 0x001a, 0x001a, 0xc591, 0x001a, 0xa595, 0x001a, 0x001a, 0xef91, 0x001a, 0x001a, 0x4b9d, 0x001a, 0x001a, 0x499d, 0x001a, 0x4c9d, 0x001a, 0x001a, 0x4a9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x4d9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaf95, 0x001a, 0x001a, 0xb588, 0x001a, 0x001a, 0x001a, 0x001a, 0x7d95, 0x001a, 0x001a, 0xe194, 0x001a, 0x001a, 0x4e9d, 0x001a, 0x519d, 0xb38f, 0x5a8b, 0x001a, 0x4f9d, 0x569d, 0xb48f, 0x001a, 0x001a, 0x001a, 0x001a, 0x509d, 0x6394, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7d97, 0x529d, 0x539d, 0x579d, 0x8a93, 0x549d, 0x528d, 0xdc90, 0x001a, 0x001a, 0x659d, 0xb294, 0x001a, 0xf091, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaced, 0x001a, 0x001a, 0x001a, 0x001a, 0xe294, 0xab9d, 0x001a, 0x001a, 0x001a, 0x001a, 0xf895, 0x001a, 0x001a, 0x001a, 0xef92, 0x001a, 0x001a, 0x001a, 0x9596, 0x001a, 0x5a9d, 0x9f89, 0x8a92, 0x001a, 0x001a, 0x001a, 0x001a, 0x639d, 0x001a, 0x001a, 0x5392, 0x5d9d, 0x649d, 0x5f9d, 0x669d, 0x629d, 0x001a, 0x619d, 0x8f94, 0x001a, 0x5b9d, 0xfb89, 0x599d, 0x918b, 0xf191, 0x559d, 0x001a, 0x001a, 0x589d, 0x538d, 0xd990, 0x001a, 0xb58f, 0x609d, 0x7194, 0x001a, 0x001a, 0x928b, 0x678a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x878a, 0x4090, 0x689d, 0x6d9d, 0x001a, 0x699d, 0x001a, 0x9d8c, 0x001a, 0x6e9d, 0x418e, 0x898d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x458f, 0x5c9d, 0x001a, 0x9d8e, 0x6b9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x778e, 0x6c9d, 0xc288, 0x001a, 0x001a, 0x679d, 0x001a, 0x001a, 0x001a, 0x001a, 0xa792, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x938b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb28b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6a9d, 0xa588, 0x001a, 0x001a, 0xc18d, 0x001a, 0x001a, 0x001a, 0x5590, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf092, 0x001a, 0x001a, 0xd294, 0x709d, 0x7d91, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa891, 0x001a, 0x001a, 0x4a8e, 0x719d, 0x001a, 0x739d, 0x6f9d, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf95, 0x001a, 0xbb92, 0x001a, 0x001a, 0x001a, 0x001a, 0x7b91, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf995, 0xcc8e, 0x809d, 0x001a, 0x7e9d, 0x001a, 0x001a, 0x9890, 0x001a, 0x001a, 0x001a, 0x9e8c, 0x001a, 0x001a, 0x001a, 0x789d, 0xb78f, 0x001a, 0x001a, 0xe693, 0x5094, 0x001a, 0x001a, 0x001a, 0x001a, 0x769d, 0x001a, 0x001a, 0x7c91, 0x001a, 0x001a, 0x001a, 0x001a, 0xf68e, 0x7b9d, 0x001a, 0x001a, 0xb68f, 0x001a, 0x759d, 0x7a9d, 0x001a, 0x001a, 0x7294, 0x001a, 0x001a, 0x001a, 0x749d, 0x001a, 0x408c, 0x001a, 0x001a, 0x7c8a, 0x001a, 0x001a, 0x001a, 0x7c9d, 0xa997, 0xcc8d, 0x5492, 0x799d, 0x001a, 0xda90, 0x001a, 0x548d, 0x8490, 0x8689, 0x5b91, 0x779d, 0x648b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x668c, 0x001a, 0xcd92, 0x7d9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7e91, 0x001a, 0x001a, 0x819d, 0x001a, 0x839d, 0x001a, 0x001a, 0xb591, 0x899d, 0x001a, 0x849d, 0x001a, 0x001a, 0x869d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6095, 0xf192, 0x001a, 0x879d, 0x001a, 0x001a, 0x001a, 0x4b97, 0x001a, 0x001a, 0x001a, 0x6797, 0xb78a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xac88, 0x001a, 0x859d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x829d, 0x001a, 0x001a, 0x001a, 0x001a, 0xf68a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8789, 0xaded, 0x889d, 0x001a, 0x001a, 0x001a, 0x6897, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb991, 0x001a, 0x939d, 0x001a, 0x001a, 0x001a, 0x8d9d, 0x001a, 0x001a, 0x8a9d, 0x919d, 0x001a, 0x001a, 0x001a, 0x001a, 0x729d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8e9d, 0x001a, 0x929d, 0x001a, 0x001a, 0x001a, 0xc094, 0x8b93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8b9d, 0x001a, 0x8f9d, 0x001a, 0x001a, 0x001a, 0x678c, 0x001a, 0x001a, 0x001a, 0xef8d, 0x001a, 0x001a, 0x001a, 0xdb90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x979d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4593, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaeed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x949d, 0x001a, 0x8096, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x959d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x969d, 0x001a, 0xcc96, 0x001a, 0xa090, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x828c, 0x001a, 0x001a, 0x001a, 0x001a, 0x9d9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x548e, 0x9a9d, 0x001a, 0x999d, 0x001a, 0x001a, 0x001a, 0x001a, 0x5194, 0x001a, 0x001a, 0xafed, 0xb393, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5093, 0x9b9d, 0x001a, 0x001a, 0x001a, 0x9c9d, 0x001a, 0x8f95, 0x001a, 0x6494, 0x428e, 0x001a, 0xef90, 0x001a, 0x6f96, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x688a, 0x001a, 0xa39d, 0x9e9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x6997, 0xa59d, 0x001a, 0x001a, 0xa19d, 0x001a, 0xa29d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8091, 0xb0ed, 0x001a, 0x001a, 0x001a, 0xa09d, 0x001a, 0x5e9d, 0x001a, 0x001a, 0x001a, 0xa49d, 0x001a, 0x9f9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa99d, 0xaa9d, 0x4693, 0xac9d, 0x001a, 0x001a, 0x438e, 0xa79d, 0x001a, 0x001a, 0x001a, 0x001a, 0x5b8b, 0x001a, 0x001a, 0xad9d, 0x001a, 0xa69d, 0xb19d, 0x001a, 0xb09d, 0x001a, 0xaf9d, 0x001a, 0x001a, 0x001a, 0xb29d, 0x001a, 0x001a, 0xb49d, 0xef8f, 0x001a, 0xb39d, 0x001a, 0x001a, 0x001a, 0x001a, 0xb79d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb59d, 0x001a, 0x001a, 0x001a, 0xb69d, 0x909d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb99d, 0xb89d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x989d, 0xba9d, 0xae9d, 0x001a, 0x001a, 0x788e, 0x001a, 0x001a, 0x001a, 0x001a, 0xbb9d, 0xbc9d, 0xbe9d, 0xbd9d, 0xbf9d, 0xfc89, 0x001a, 0x558d, 0x001a, 0x001a, 0xfa95, 0xad90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcc8c, 0x001a, 0x001a, 0xc19d, 0x001a, 0x001a, 0x001a, 0x001a, 0xc49d, 0xb1ed, 0x7195, 0x001a, 0x7e8b, 0x001a, 0x001a, 0x001a, 0xc39d, 0xc29d, 0x7394, 0xc59d, 0xb38b, 0x001a, 0x001a, 0x001a, 0xc79d, 0xc69d, 0x001a, 0x001a, 0x001a, 0xb88a, 0x558e, 0x001a, 0x001a, 0xd693, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x688c, 0x001a, 0x001a, 0x001a, 0x9490, 0x001a, 0xc89d, 0x001a, 0xae90, 0x4793, 0x001a, 0x7e95, 0xc99d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xca9d, 0xcb9d, 0x001a, 0x001a, 0x001a, 0xb695, 0x7c9b, 0xc490, 0x001a, 0x001a, 0x6b95, 0x001a, 0xd68d, 0x001a, 0xe394, 0xc194, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6c93, 0x001a, 0xbf97, 0x001a, 0xcd9d, 0xce8e, 0x001a, 0x001a, 0xce9d, 0x001a, 0xb488, 0x001a, 0x001a, 0xd28b, 0xcb90, 0x001a, 0x8095, 0x001a, 0x001a, 0x001a, 0xcf9d, 0x618e, 0x6692, 0x001a, 0x7a8e, 0x5690, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd09d, 0x001a, 0xfb95, 0x001a, 0x001a, 0x9789, 0x7b8e, 0x001a, 0x001a, 0x001a, 0xd39d, 0x001a, 0xd19d, 0xd49d, 0xb797, 0xd29d, 0x001a, 0x001a, 0x001a, 0x001a, 0xf990, 0xd59d, 0x001a, 0x001a, 0xb091, 0x001a, 0x001a, 0xd69d, 0x001a, 0x001a, 0x001a, 0x001a, 0xf88a, 0x001a, 0xd89d, 0x001a, 0xd79d, 0x001a, 0x001a, 0x001a, 0x001a, 0xd99d, 0xda9d, 0xf98a, 0x001a, 0x001a, 0xfa93, 0x5592, 0x8c8b, 0x7c8e, 0x8191, 0x001a, 0x001a, 0x7b8f, 0xae88, 0x001a, 0x001a, 0x001a, 0xdb9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa089, 0xdf9d, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2ed, 0x001a, 0x568d, 0xde9d, 0x001a, 0x001a, 0xa98d, 0xb88f, 0x001a, 0xb5ed, 0xdd9d, 0x001a, 0xb98f, 0x001a, 0xbe96, 0xa88d, 0x001a, 0x001a, 0x001a, 0xd588, 0xcc90, 0xb3ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe49d, 0x001a, 0xb7ed, 0xaf90, 0x6689, 0x001a, 0x001a, 0x001a, 0xb8ed, 0x748f, 0x001a, 0x8696, 0xf08d, 0x001a, 0x001a, 0x001a, 0x001a, 0xba8f, 0xb6ed, 0xa590, 0x001a, 0x47ed, 0x001a, 0x001a, 0xe39d, 0xe19d, 0xe29d, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4ed, 0x8b92, 0x001a, 0x001a, 0x459e, 0x001a, 0xe89d, 0x9e8e, 0x578d, 0xe69d, 0x001a, 0x001a, 0x001a, 0x001a, 0xe79d, 0x001a, 0x5790, 0x001a, 0x001a, 0x001a, 0xe59d, 0x001a, 0x001a, 0x4e8e, 0x001a, 0x001a, 0x001a, 0x001a, 0xbaed, 0x001a, 0xbbed, 0x001a, 0x001a, 0x001a, 0xea9d, 0xe99d, 0xee9d, 0x001a, 0x001a, 0xef9d, 0x001a, 0xeb9d, 0xb9ed, 0x418a, 0xec9d, 0xed9d, 0xd394, 0x001a, 0x001a, 0x001a, 0x001a, 0x8195, 0x698c, 0xf09d, 0x001a, 0x001a, 0xbded, 0xb090, 0x001a, 0xbb8f, 0x001a, 0x001a, 0x001a, 0x7192, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc58b, 0x001a, 0xf19d, 0xf59d, 0x001a, 0x001a, 0xc989, 0xf29d, 0xf49d, 0x001a, 0x001a, 0x001a, 0x001a, 0xf39d, 0x001a, 0x001a, 0x8b8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x6792, 0xc388, 0xf69d, 0xbeed, 0x001a, 0x001a, 0x001a, 0xf79d, 0x001a, 0x001a, 0xbfed, 0x001a, 0xa892, 0x001a, 0x001a, 0x001a, 0xef97, 0x001a, 0x001a, 0x001a, 0x001a, 0x628e, 0x001a, 0x001a, 0xe995, 0x001a, 0x001a, 0x001a, 0xc0ed, 0x001a, 0x5c96, 0x001a, 0x001a, 0x001a, 0x419e, 0xf99d, 0x001a, 0x001a, 0xfc9d, 0x001a, 0xfb9d, 0xc1ed, 0x001a, 0xf89d, 0x001a, 0x001a, 0x409e, 0x001a, 0x001a, 0xdc93, 0x001a, 0xfa9d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x429e, 0x001a, 0x001a, 0x8c8f, 0x439e, 0x001a, 0x6a97, 0x9894, 0x001a, 0x001a, 0x449e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x469e, 0x001a, 0x001a, 0x479e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x489e, 0x001a, 0xc88b, 0x6789, 0x588d, 0x499e, 0x001a, 0x4a9e, 0x918f, 0x8291, 0xc2ed, 0x4aed, 0xd699, 0x5d91, 0x5c91, 0xd691, 0xc58d, 0x001a, 0x001a, 0xf098, 0x001a, 0x001a, 0x001a, 0x001a, 0x8e8c, 0x4c97, 0x001a, 0xfc95, 0x001a, 0x9e95, 0xc3ed, 0x4b9e, 0x001a, 0x001a, 0x001a, 0x001a, 0xf18d, 0xbd92, 0x4c9e, 0x4e98, 0x001a, 0x001a, 0x001a, 0x5d96, 0x001a, 0xa992, 0x4d9e, 0xfa8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4e9e, 0x4f9e, 0xd896, 0x001a, 0xa296, 0x9696, 0x7b96, 0x448e, 0x519e, 0x001a, 0x001a, 0xe98e, 0x001a, 0x001a, 0x7096, 0x001a, 0x539e, 0x569e, 0x559e, 0x001a, 0xf78a, 0x001a, 0x001a, 0x808b, 0x001a, 0x529e, 0x001a, 0x549e, 0x001a, 0x001a, 0x001a, 0x001a, 0x579e, 0x001a, 0x001a, 0x9990, 0x001a, 0x001a, 0x001a, 0x001a, 0x9b97, 0xc788, 0xde8d, 0xba91, 0x001a, 0xdb8e, 0x001a, 0x001a, 0xf18f, 0x001a, 0x001a, 0x5a9e, 0x001a, 0x001a, 0x6d93, 0x001a, 0x589e, 0xa991, 0x599e, 0xf08f, 0xdb96, 0x5b9e, 0x5c9e, 0x8897, 0xc5ed, 0x001a, 0x001a, 0x001a, 0x619e, 0x001a, 0x001a, 0x598d, 0x001a, 0x7494, 0x5e9e, 0x8c93, 0xdc9d, 0xe09d, 0x001a, 0x6e8b, 0x001a, 0x6694, 0x001a, 0x001a, 0x001a, 0x001a, 0x609e, 0x001a, 0xbc8f, 0xc294, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x669e, 0x001a, 0xf894, 0x001a, 0x5d9e, 0x001a, 0x639e, 0x629e, 0x001a, 0x001a, 0x001a, 0xcd90, 0x001a, 0x001a, 0x001a, 0x001a, 0x8d96, 0x001a, 0xd197, 0x001a, 0x001a, 0x8796, 0x001a, 0xca89, 0x7d8e, 0x001a, 0x001a, 0x6798, 0x659e, 0x9590, 0x001a, 0x001a, 0x001a, 0x649e, 0x001a, 0x001a, 0x5f9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcd8c, 0x001a, 0x001a, 0x001a, 0x6b9e, 0x699e, 0x001a, 0xcb89, 0x679e, 0x6d9e, 0x739e, 0x001a, 0xc6ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ed, 0xc691, 0x001a, 0x001a, 0xbf95, 0x001a, 0x759e, 0x001a, 0x001a, 0x001a, 0x4195, 0x001a, 0x001a, 0x001a, 0x749e, 0x9094, 0x5e96, 0xb98a, 0x001a, 0xf590, 0x5f8f, 0x001a, 0x001a, 0x001a, 0xd192, 0x001a, 0x4d97, 0x001a, 0x001a, 0x709e, 0x6f9e, 0x001a, 0x001a, 0x001a, 0x719e, 0x001a, 0x6e9e, 0x001a, 0x001a, 0x769e, 0x001a, 0x6c9e, 0x001a, 0x001a, 0x6a9e, 0x001a, 0x729e, 0x689e, 0x001a, 0x8c92, 0x001a, 0xf696, 0xc48e, 0xf28d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb88d, 0x001a, 0x001a, 0x8f96, 0x608a, 0x001a, 0xc9ed, 0xcc92, 0xc893, 0x6889, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf090, 0x001a, 0x001a, 0xb290, 0x498c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x789e, 0x001a, 0x001a, 0x5a8d, 0x9c8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7a9e, 0x948a, 0x819e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7d9e, 0x001a, 0xf190, 0x001a, 0x001a, 0x001a, 0x6a8a, 0xaa8d, 0x001a, 0x001a, 0x698a, 0xcd8d, 0x001a, 0x001a, 0x7b9e, 0x858c, 0x6a8c, 0x8d93, 0xcaed, 0x001a, 0x799e, 0x001a, 0xc488, 0x001a, 0x001a, 0x001a, 0x001a, 0x7c9e, 0x7e9e, 0x001a, 0xcb8b, 0x4b8c, 0xc7ed, 0xba8a, 0x6a8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x829e, 0x001a, 0x001a, 0xf78d, 0x9196, 0x001a, 0x568e, 0x001a, 0x001a, 0x001a, 0x839e, 0x001a, 0x001a, 0x001a, 0x4f95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8f9e, 0x001a, 0xb189, 0x849e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x959e, 0x859e, 0x001a, 0xc097, 0x001a, 0x8c9e, 0x001a, 0x7e94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x949e, 0x001a, 0x879e, 0x001a, 0x001a, 0x001a, 0xb288, 0x899e, 0x001a, 0x001a, 0x5b8d, 0x001a, 0x001a, 0x001a, 0x8b9e, 0x001a, 0x8a9e, 0x001a, 0x869e, 0x919e, 0x001a, 0xbd8f, 0x001a, 0x001a, 0x001a, 0xeb9a, 0xe68c, 0x9c97, 0x001a, 0x001a, 0x001a, 0x001a, 0x889e, 0x001a, 0xf292, 0x428a, 0xab8d, 0x001a, 0x809e, 0x001a, 0x909e, 0x818a, 0x001a, 0x001a, 0x8e9e, 0x929e, 0x001a, 0x8e93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc8a, 0x001a, 0xb09e, 0x001a, 0x48ed, 0xc796, 0x979e, 0xfb8a, 0x001a, 0x9e9e, 0x001a, 0xcbed, 0x001a, 0x001a, 0x5f96, 0x001a, 0x9f9e, 0xa19e, 0x001a, 0xa59e, 0x999e, 0x001a, 0x4992, 0x001a, 0x001a, 0x001a, 0x001a, 0x8f93, 0xa99e, 0x9c9e, 0x001a, 0xa69e, 0x001a, 0x001a, 0x001a, 0xa09e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5890, 0xaa9e, 0x001a, 0x001a, 0xb190, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa89e, 0xbb8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6f98, 0x969e, 0x001a, 0x001a, 0xa49e, 0xd688, 0x001a, 0x001a, 0x989e, 0x001a, 0x001a, 0xb896, 0x9d9e, 0x4190, 0xc592, 0x939e, 0x001a, 0x001a, 0xa39e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a90, 0xad9e, 0x918a, 0x9f8c, 0x001a, 0x001a, 0x001a, 0x001a, 0xaf9e, 0x9a9e, 0xae9e, 0x001a, 0xa79e, 0x9b9e, 0x001a, 0xab9e, 0x001a, 0xac9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbd9e, 0x001a, 0x001a, 0x001a, 0xcc93, 0x001a, 0xa29e, 0x001a, 0x001a, 0xb99e, 0x001a, 0x001a, 0x001a, 0xbb9e, 0x001a, 0xd692, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6b97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9695, 0xb69e, 0xc891, 0x001a, 0x001a, 0x001a, 0xbc9e, 0x5e91, 0x001a, 0xb39e, 0xc09e, 0xbf9e, 0x001a, 0xed93, 0xbe9e, 0xe893, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcded, 0x001a, 0xc29e, 0xb59e, 0x001a, 0xc68b, 0xb89e, 0x7c8f, 0x001a, 0x001a, 0x001a, 0x8094, 0xba9e, 0xc98b, 0x001a, 0xb29e, 0xb49e, 0xb19e, 0x001a, 0x001a, 0x4f98, 0x798a, 0xb79e, 0x001a, 0x001a, 0xc19e, 0x548a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe58d, 0x001a, 0x001a, 0x001a, 0x7c89, 0x001a, 0x001a, 0xd29e, 0x001a, 0x001a, 0x5098, 0xd59e, 0x001a, 0x001a, 0xcfed, 0x001a, 0x001a, 0x5990, 0xd49e, 0x001a, 0x001a, 0x001a, 0xd39e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd09e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc49e, 0x001a, 0x001a, 0xe19e, 0xc39e, 0x001a, 0xd69e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xce9e, 0x001a, 0x001a, 0xc99e, 0xc69e, 0x001a, 0xc79e, 0x001a, 0xcf9e, 0x001a, 0x001a, 0x001a, 0xa0ea, 0x001a, 0x001a, 0xcc9e, 0x5c8d, 0xc692, 0x8491, 0xca9e, 0x001a, 0xc59e, 0x001a, 0x001a, 0xc89e, 0x001a, 0x001a, 0x001a, 0x001a, 0x6c97, 0x8a96, 0x001a, 0x001a, 0x001a, 0xcd9e, 0xd79e, 0x001a, 0x001a, 0x001a, 0xd0ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf9e, 0xd89e, 0x001a, 0x001a, 0xe59e, 0x001a, 0xe39e, 0x001a, 0x001a, 0x001a, 0x001a, 0xde9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdd9e, 0x001a, 0xce92, 0x001a, 0x8591, 0x001a, 0xdb9e, 0x001a, 0x001a, 0xd99e, 0x001a, 0x001a, 0xe09e, 0x001a, 0x001a, 0x001a, 0x001a, 0xe69e, 0xf394, 0xec9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe79e, 0xea9e, 0xe49e, 0x001a, 0x001a, 0x9492, 0x001a, 0x5795, 0x001a, 0xda9e, 0x001a, 0x001a, 0xe29e, 0xbe8f, 0x001a, 0xcd96, 0xf69e, 0xe99e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa08c, 0xa189, 0x7e8a, 0x001a, 0x001a, 0xd19e, 0x001a, 0xd1ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xbf8f, 0xee9e, 0x001a, 0xf59e, 0xf78e, 0x928a, 0x001a, 0x001a, 0x4d92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeb9e, 0x001a, 0xd3ed, 0xf09e, 0xf49e, 0x001a, 0x001a, 0xb48b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6b8b, 0xf29e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x408b, 0x001a, 0xc993, 0xf19e, 0x001a, 0x001a, 0x001a, 0xf39e, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xed9e, 0xd4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0xef9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5ed, 0x808a, 0x6892, 0x001a, 0x001a, 0x001a, 0xfa9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf89e, 0xe78c, 0x001a, 0xf79e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x409f, 0x001a, 0x001a, 0x001a, 0x001a, 0x779e, 0x001a, 0x001a, 0x001a, 0xf99e, 0x001a, 0xfb9e, 0xfc9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4b9f, 0x001a, 0x479f, 0x001a, 0x8d9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x469f, 0x001a, 0x001a, 0x001a, 0x001a, 0x459f, 0x001a, 0x001a, 0x429f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe89e, 0x449f, 0x439f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x499f, 0x001a, 0x4598, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4c9f, 0xf98b, 0x001a, 0x001a, 0x489f, 0x4a9f, 0x001a, 0x001a, 0xd6ed, 0x001a, 0xd7ed, 0x001a, 0x001a, 0x001a, 0xa594, 0x001a, 0x4d9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x519f, 0x4e9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9397, 0x4f9f, 0x001a, 0x001a, 0x001a, 0x001a, 0xdc9e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x529f, 0x001a, 0x001a, 0x001a, 0x539f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5489, 0x001a, 0x559f, 0x878c, 0x9f8e, 0x001a, 0xd38b, 0x001a, 0x001a, 0x001a, 0xa289, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7e97, 0x001a, 0x001a, 0x001a, 0x001a, 0x579f, 0x569f, 0x599f, 0x5c8b, 0x001a, 0x001a, 0xd48b, 0xbc8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5c9f, 0x001a, 0x001a, 0x001a, 0x5b9f, 0x001a, 0x5d9f, 0x001a, 0x001a, 0xcc89, 0x001a, 0x5692, 0x001a, 0x5e9f, 0x001a, 0x001a, 0xbd8a, 0x609f, 0x001a, 0x001a, 0x001a, 0x001a, 0x5f9f, 0x001a, 0x619f, 0x001a, 0x001a, 0x001a, 0x629f, 0x001a, 0x639f, 0x7e8e, 0xb390, 0x9f8d, 0x001a, 0x9095, 0x001a, 0x001a, 0xe095, 0x6398, 0x001a, 0x001a, 0x001a, 0x001a, 0x958e, 0x001a, 0x001a, 0x001a, 0xce8d, 0xf097, 0x001a, 0x001a, 0x001a, 0x649f, 0x659f, 0x001a, 0x808e, 0x001a, 0x001a, 0x001a, 0x669f, 0x679f, 0x001a, 0x001a, 0x699f, 0x689f, 0x001a, 0x7796, 0x001a, 0x001a, 0x7d8f, 0xea8e, 0x638e, 0x001a, 0x6a9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6c9f, 0x4290, 0x001a, 0x6b9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6f9f, 0x709f, 0x001a, 0x001a, 0x001a, 0x719f, 0x001a, 0x739f, 0x729f, 0x749f, 0xa389, 0x6992, 0x001a, 0x759f, 0x001a, 0x001a, 0x458e, 0x6b8a, 0x769f, 0x001a, 0x001a, 0x6193, 0xca9a, 0x001a, 0x001a, 0x001a, 0x001a, 0x428b, 0x779f, 0x001a, 0x001a, 0x001a, 0x001a, 0x789f, 0x001a, 0xea95, 0x8896, 0x001a, 0x001a, 0x001a, 0xc593, 0x799f, 0xe494, 0x001a, 0xd8ed, 0x001a, 0xf994, 0x001a, 0x001a, 0xd196, 0x001a, 0x001a, 0x001a, 0x7a9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7c9f, 0x7b9f, 0x001a, 0x001a, 0x7e9f, 0x001a, 0x001a, 0x001a, 0x7d9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x819f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x818e, 0x001a, 0xaf96, 0x001a, 0x829f, 0x839f, 0x001a, 0x001a, 0x438b, 0x001a, 0x001a, 0x001a, 0x849f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x869f, 0x859f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8590, 0x001a, 0x001a, 0x5895, 0x6989, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc394, 0xd9ed, 0xf392, 0x608f, 0x818b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc494, 0x001a, 0xac8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x889f, 0x001a, 0xbe8a, 0x001a, 0x001a, 0x9889, 0x001a, 0xdaed, 0xf093, 0x879f, 0x5d8d, 0x7292, 0x001a, 0x899f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x919f, 0x001a, 0x8a9f, 0x001a, 0x001a, 0x001a, 0x001a, 0xdced, 0xbf91, 0x001a, 0x828b, 0x929f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x888c, 0x001a, 0x001a, 0x448b, 0x909f, 0x001a, 0x001a, 0x8e9f, 0x8b9f, 0x8097, 0x001a, 0x001a, 0xdbed, 0x001a, 0xbe92, 0x001a, 0x001a, 0x001a, 0xd793, 0x8c9f, 0x001a, 0x001a, 0x949f, 0x001a, 0x939f, 0x428c, 0x001a, 0x001a, 0xab89, 0x001a, 0x001a, 0xb98d, 0x8d9f, 0x8f9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7696, 0xf291, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9796, 0x001a, 0x001a, 0x9c9f, 0x001a, 0x001a, 0x9d9f, 0x001a, 0xcd89, 0x001a, 0x001a, 0x001a, 0x001a, 0xa695, 0xfb96, 0x9f9f, 0xa18e, 0xc08f, 0x989f, 0x9e9f, 0x8889, 0x001a, 0xb58b, 0x001a, 0x001a, 0x959f, 0x9a9f, 0x001a, 0x001a, 0x001a, 0xf290, 0x9194, 0x001a, 0xe594, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x979f, 0x001a, 0x4096, 0x001a, 0x999f, 0x001a, 0xa29f, 0xdded, 0xa09f, 0x001a, 0x9b9f, 0x001a, 0x001a, 0x001a, 0x4196, 0x6794, 0x838b, 0x001a, 0x4493, 0x001a, 0x001a, 0x8d92, 0x001a, 0xa39f, 0x001a, 0x001a, 0x001a, 0x001a, 0xa19f, 0xd791, 0x969f, 0x001a, 0x6a89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdeed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d97, 0xae9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xad9f, 0x001a, 0x001a, 0x001a, 0x001a, 0xf490, 0x001a, 0xaa9f, 0x001a, 0x8c97, 0x001a, 0x001a, 0xb493, 0xa49f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc392, 0x001a, 0x001a, 0x001a, 0x6b89, 0x5e8d, 0xa79f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x468f, 0xac9f, 0x001a, 0xab9f, 0xa69f, 0x001a, 0xa99f, 0x001a, 0x001a, 0x888a, 0x001a, 0xa89f, 0x6894, 0x001a, 0x001a, 0xac97, 0x001a, 0x001a, 0xf28f, 0xf390, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb49f, 0xb29f, 0x001a, 0x6c95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaf9f, 0xb19f, 0x001a, 0x5989, 0x001a, 0x001a, 0x5f8d, 0x5198, 0x001a, 0x5c8a, 0x001a, 0x8295, 0xe0ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x8197, 0x001a, 0x001a, 0x438a, 0x5a90, 0xb39f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb89f, 0x001a, 0xdfed, 0xc18f, 0x001a, 0x001a, 0x001a, 0x4f97, 0x001a, 0xb59f, 0x001a, 0x001a, 0x001a, 0x001a, 0xb09f, 0x001a, 0xb69f, 0xe1ed, 0x001a, 0x001a, 0xdc97, 0x001a, 0x9393, 0xc093, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2ed, 0x001a, 0x001a, 0x558a, 0x001a, 0x001a, 0x7489, 0x001a, 0x001a, 0xbc9f, 0x001a, 0x001a, 0xbf9f, 0x001a, 0x001a, 0x001a, 0xc197, 0x001a, 0x001a, 0x001a, 0x8497, 0x001a, 0x001a, 0x001a, 0x001a, 0xc69f, 0xc09f, 0xbd9f, 0x001a, 0x001a, 0x001a, 0xd297, 0xc39f, 0x001a, 0x001a, 0xe3ed, 0x001a, 0x698f, 0xc59f, 0x001a, 0x001a, 0xca9f, 0x001a, 0x001a, 0x9193, 0xc89f, 0x001a, 0x001a, 0x001a, 0x001a, 0xc29f, 0x001a, 0x001a, 0x5792, 0x001a, 0x001a, 0xc99f, 0x001a, 0xbe9f, 0x001a, 0xc49f, 0x001a, 0xcb9f, 0xfa88, 0xc19f, 0x001a, 0xcc9f, 0x001a, 0x001a, 0x5b90, 0xe5ed, 0x7e8f, 0x001a, 0xa395, 0x001a, 0xac8d, 0xe4ed, 0xb99f, 0xc79f, 0x5993, 0xe6ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb490, 0x001a, 0x898a, 0xcf8d, 0xc28f, 0xbb9f, 0x618f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6b8c, 0x001a, 0xba9f, 0x001a, 0x001a, 0x001a, 0xd09f, 0x8d8f, 0xb88c, 0x001a, 0xdf9f, 0x001a, 0xd99f, 0x948b, 0x6e93, 0x001a, 0xd49f, 0xdd9f, 0xad88, 0x5189, 0xe9ed, 0x001a, 0xb789, 0x001a, 0xd69f, 0xaa91, 0xcd9f, 0xcf9f, 0x608d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe09f, 0xe7ed, 0xdb9f, 0x001a, 0xeaed, 0x001a, 0xd39f, 0x001a, 0x001a, 0x001a, 0x001a, 0xda9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa996, 0x001a, 0x001a, 0xd89f, 0xdc9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xce8c, 0x001a, 0xc38f, 0x001a, 0x001a, 0x5892, 0xe8ed, 0x001a, 0x001a, 0xd29f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4e97, 0x001a, 0x001a, 0x001a, 0xd59f, 0x001a, 0x001a, 0xce9f, 0x9293, 0x001a, 0x001a, 0xd19f, 0x001a, 0x001a, 0x001a, 0xd79f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7098, 0xbc8e, 0x9e96, 0x001a, 0xe19f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xac94, 0x001a, 0x001a, 0xed9f, 0xb98c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x808f, 0x001a, 0xe39f, 0x001a, 0x001a, 0x001a, 0xad97, 0x618d, 0x001a, 0xf09f, 0x001a, 0x001a, 0xec88, 0x001a, 0x001a, 0xee9f, 0x001a, 0x001a, 0x001a, 0x001a, 0xe29f, 0x001a, 0x001a, 0x001a, 0x001a, 0xe89f, 0x001a, 0x001a, 0xea9f, 0x001a, 0x001a, 0x001a, 0x6e97, 0xe59f, 0x001a, 0x001a, 0x4d93, 0x001a, 0x001a, 0xe79f, 0x001a, 0xebed, 0x001a, 0x001a, 0xef9f, 0x001a, 0xe99f, 0xc596, 0x001a, 0x001a, 0x001a, 0xe49f, 0x001a, 0xa08e, 0xfc9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a8a, 0x001a, 0xe69f, 0xeb9f, 0xec9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xea91, 0xd891, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf49f, 0x001a, 0x001a, 0xfa9f, 0x001a, 0x001a, 0xf89f, 0x001a, 0x4893, 0x001a, 0x001a, 0x42e0, 0xf59f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf69f, 0xde9f, 0x001a, 0x998b, 0x5995, 0x001a, 0x001a, 0x001a, 0xbd8e, 0x001a, 0x001a, 0x978d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5298, 0x001a, 0xf29f, 0x001a, 0x41e0, 0x8989, 0x8691, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9994, 0x001a, 0xbf8a, 0xf897, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9f96, 0xd092, 0x001a, 0x001a, 0x001a, 0x001a, 0xf99f, 0xfb9f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5191, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x40e0, 0xf79f, 0x001a, 0xf19f, 0x001a, 0x001a, 0x001a, 0xc18a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x898c, 0x001a, 0x001a, 0x001a, 0x4ee0, 0x001a, 0x001a, 0x49e0, 0xf690, 0x001a, 0x001a, 0x838a, 0x001a, 0x001a, 0x001a, 0x001a, 0x818f, 0x001a, 0x52e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4be0, 0xaa92, 0x48e0, 0xd792, 0x001a, 0x001a, 0x001a, 0x6be0, 0x001a, 0x001a, 0x001a, 0x45e0, 0x001a, 0x44e0, 0x001a, 0x4de0, 0x001a, 0x001a, 0x001a, 0x47e0, 0x46e0, 0x4ce0, 0x001a, 0x9f90, 0x001a, 0x43e0, 0x001a, 0xeced, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4fe0, 0x001a, 0x001a, 0x50e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc08a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x55e0, 0x001a, 0x54e0, 0x56e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x59e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6293, 0x001a, 0x53e0, 0x001a, 0xeded, 0x001a, 0x001a, 0x001a, 0x57e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x838c, 0xf791, 0x51e0, 0x5a94, 0x001a, 0x001a, 0x58e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5de0, 0x5be0, 0x001a, 0x001a, 0x5ee0, 0x001a, 0x001a, 0x61e0, 0x001a, 0x001a, 0x001a, 0x5ae0, 0x8a8d, 0x4794, 0x001a, 0x001a, 0xb79f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9497, 0x5ce0, 0x001a, 0x60e0, 0xf391, 0x001a, 0x5fe0, 0x001a, 0x4ae0, 0x001a, 0xeeed, 0x89e8, 0x001a, 0x001a, 0x001a, 0x64e0, 0x001a, 0x001a, 0x001a, 0x68e0, 0x001a, 0x001a, 0x66e0, 0x001a, 0x001a, 0x001a, 0xefed, 0x001a, 0xf0ed, 0x001a, 0x62e0, 0x001a, 0x63e0, 0x001a, 0x001a, 0x001a, 0x67e0, 0x001a, 0x65e0, 0x001a, 0x001a, 0x001a, 0x6d95, 0x001a, 0x001a, 0x6de0, 0x001a, 0x6ae0, 0x69e0, 0x001a, 0x6ce0, 0xd293, 0x6ee0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9592, 0xeb91, 0xf1ed, 0x001a, 0x001a, 0x001a, 0xa390, 0x001a, 0x001a, 0x001a, 0x6fe0, 0x001a, 0x71e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x70e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf39f, 0x001a, 0x001a, 0x001a, 0x001a, 0x72e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe593, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xce89, 0x001a, 0x001a, 0x001a, 0x9493, 0x448a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x848b, 0x001a, 0x001a, 0x001a, 0xdc8e, 0xd08d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2ed, 0x001a, 0x001a, 0x001a, 0x4698, 0x8690, 0x001a, 0x001a, 0x001a, 0x8a89, 0x001a, 0x001a, 0x001a, 0x75e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3ed, 0x78e0, 0x5992, 0x7be0, 0x76e0, 0x001a, 0x001a, 0x001a, 0x7ae0, 0x001a, 0x001a, 0x001a, 0x001a, 0x79e0, 0x5f93, 0xd788, 0x46ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf397, 0x001a, 0x001a, 0x7de0, 0x001a, 0x001a, 0x001a, 0x4789, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x80e0, 0x001a, 0x001a, 0x001a, 0x7ee0, 0x001a, 0x7ce0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x77e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4296, 0x001a, 0x001a, 0x001a, 0x82e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x81e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x8b89, 0x001a, 0x001a, 0x001a, 0x001a, 0x84e0, 0xb095, 0x001a, 0x83e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xb396, 0x001a, 0x001a, 0x001a, 0x001a, 0xc58f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5291, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc48f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7ed, 0xf8ed, 0x001a, 0xf997, 0x001a, 0x001a, 0x8ae0, 0x001a, 0xf790, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x86e0, 0x8be0, 0x001a, 0x001a, 0x8c89, 0x001a, 0x001a, 0xf6ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x89e0, 0x001a, 0x8194, 0x85e0, 0x88e0, 0xc68f, 0x001a, 0xcf94, 0x001a, 0x001a, 0x8ce0, 0x001a, 0xcf8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf890, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8fe0, 0x001a, 0x001a, 0x001a, 0x87e0, 0x001a, 0x468c, 0x001a, 0x001a, 0x001a, 0x001a, 0x8de0, 0x001a, 0x001a, 0x001a, 0x001a, 0x6f97, 0x90e0, 0x001a, 0x001a, 0x001a, 0xa4ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x91e0, 0x001a, 0x001a, 0x001a, 0x92e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x4d94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x94e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x95e0, 0x001a, 0x001a, 0xfaed, 0x001a, 0x5294, 0x001a, 0x001a, 0x001a, 0x001a, 0x9593, 0x97e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x99e0, 0x001a, 0xd397, 0x001a, 0x96e0, 0x001a, 0x98e0, 0x8d89, 0x001a, 0x93e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7a9a, 0x9ae0, 0x001a, 0x001a, 0x001a, 0x001a, 0x8791, 0x578e, 0x9ce0, 0x001a, 0x001a, 0x001a, 0x001a, 0x9be0, 0x4390, 0xd799, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9de0, 0x001a, 0x001a, 0x001a, 0x9fe0, 0x001a, 0x8ee0, 0x9ee0, 0x001a, 0xfbed, 0xa0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1e0, 0x001a, 0x001a, 0xa2e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e0, 0x001a, 0xdc92, 0x001a, 0xa6e0, 0xa5e0, 0x001a, 0x001a, 0xa7e0, 0x001a, 0xa8e0, 0x001a, 0x001a, 0xdd8e, 0x8395, 0x001a, 0x001a, 0x001a, 0xea96, 0xa9e0, 0xaae0, 0x7591, 0xa28e, 0xabe0, 0xace0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xade0, 0xd095, 0xc594, 0x001a, 0x001a, 0xaee0, 0x7694, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xab92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xafe0, 0xe589, 0x001a, 0x8d8b, 0x001a, 0xc496, 0x001a, 0xb496, 0x001a, 0xb289, 0x5398, 0x001a, 0x001a, 0x001a, 0x001a, 0x7196, 0x001a, 0xa895, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb590, 0x001a, 0xb0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xc193, 0x001a, 0x001a, 0x001a, 0xa18c, 0xb1e0, 0x001a, 0xd28d, 0xb3e0, 0xb2e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb5e0, 0x001a, 0x001a, 0x001a, 0xb6e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5d8b, 0x001a, 0xb7e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xa28c, 0x001a, 0x001a, 0xc694, 0x001a, 0xfced, 0xbae0, 0x001a, 0x001a, 0x001a, 0xf38f, 0x001a, 0x001a, 0xb9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x40ee, 0x001a, 0x001a, 0x001a, 0xb68b, 0xbbe0, 0xbde0, 0x001a, 0xbce0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee0, 0x001a, 0xcf8c, 0x001a, 0xbfe0, 0x001a, 0x001a, 0x001a, 0x001a, 0xe78b, 0x001a, 0x5f91, 0x001a, 0x9d8d, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e0, 0xc2e0, 0xc0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeb8e, 0x001a, 0x001a, 0xc693, 0xb78b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4e0, 0x4b92, 0xc3e0, 0x001a, 0x001a, 0x5498, 0x8294, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc7e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9e0, 0xc6e0, 0x001a, 0x001a, 0x001a, 0xd296, 0xc8e0, 0xcae0, 0x001a, 0xc297, 0x001a, 0x001a, 0x001a, 0x001a, 0x41ee, 0xcee0, 0x001a, 0x001a, 0x001a, 0xcde0, 0x9692, 0x4c94, 0x001a, 0x001a, 0xa38c, 0xcce0, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe0, 0x001a, 0x5097, 0x5197, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe0, 0x8e89, 0x001a, 0x001a, 0x001a, 0x001a, 0x968d, 0x828e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0e0, 0xd1e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x628f, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e0, 0x001a, 0xd4e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e0, 0x001a, 0x6c8a, 0x001a, 0x001a, 0xd8e0, 0x001a, 0x43ee, 0xd7e0, 0x001a, 0xdae0, 0xd9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xba8c, 0x001a, 0x001a, 0xa697, 0x001a, 0xca8b, 0x001a, 0xa489, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe88b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe697, 0xdce0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee0, 0x001a, 0x44ee, 0x001a, 0x001a, 0xdfe0, 0x001a, 0xcf89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbe0, 0x45ee, 0x588e, 0x001a, 0x001a, 0xbf92, 0xdde0, 0x001a, 0x001a, 0x001a, 0x48ee, 0x001a, 0x001a, 0x001a, 0x46ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2e0, 0x001a, 0xec8e, 0x001a, 0x001a, 0x47ee, 0x001a, 0xe0e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x5d8c, 0x001a, 0x001a, 0xc794, 0xe1e0, 0x001a, 0x001a, 0xfce0, 0x001a, 0x001a, 0x001a, 0x4aee, 0x001a, 0x001a, 0xe7e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbb8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x858b, 0x001a, 0xe4e0, 0x9d97, 0x49ee, 0x001a, 0xae97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf491, 0x001a, 0x001a, 0xe6e0, 0x4bee, 0x001a, 0x001a, 0x4dee, 0x4cee, 0x001a, 0x001a, 0x001a, 0x4eee, 0x001a, 0x001a, 0x001a, 0xe8e0, 0xd497, 0xd58b, 0xfa94, 0x6994, 0x001a, 0x001a, 0x001a, 0xe9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe0, 0x001a, 0xeee0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeae0, 0x001a, 0x001a, 0x001a, 0xede0, 0xe88c, 0x6c89, 0xefe0, 0x001a, 0x9090, 0xece0, 0xda97, 0x001a, 0x4fee, 0xf2e0, 0xa2ea, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0e0, 0xf3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e0, 0xf1e0, 0x001a, 0x001a, 0xba8d, 0x001a, 0x001a, 0xf4e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x9e97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50ee, 0x001a, 0xf6e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e0, 0x51ee, 0x001a, 0x001a, 0xe3e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8e0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc28a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa38e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e0, 0x001a, 0x001a, 0x001a, 0x001a, 0xfae0, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe0, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5a89, 0x001a, 0x001a, 0x001a, 0x40e1, 0x001a, 0x5a95, 0x41e1, 0x001a, 0x001a, 0xa28a, 0x42e1, 0x001a, 0x43e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x44e1, 0x001a, 0x46e1, 0x47e1, 0x45e1, 0x001a, 0x001a, 0x001a, 0x7295, 0x49e1, 0x48e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x52ee, 0x001a, 0x4be1, 0x4ae1, 0x4ce1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4de1, 0x4fe1, 0x4ee1, 0x001a, 0x001a, 0x998d, 0x001a, 0x51e1, 0x001a, 0x50e1, 0x001a, 0x001a, 0xc38a, 0x001a, 0x7290, 0x001a, 0x5b93, 0x001a, 0x52e1, 0xb690, 0x001a, 0x001a, 0x001a, 0x598e, 0x001a, 0x9989, 0x53e1, 0x001a, 0x7097, 0x001a, 0x001a, 0xe195, 0x54e1, 0x001a, 0x001a, 0x8ced, 0x6393, 0x5297, 0x628d, 0x5c90, 0x001a, 0x001a, 0x001a, 0x6a92, 0xb299, 0x001a, 0xac92, 0xe689, 0x55e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56e1, 0x001a, 0x5be1, 0x001a, 0x001a, 0x59e1, 0x58e1, 0xc09d, 0x458a, 0x57e1, 0x001a, 0xd888, 0x001a, 0xa894, 0x001a, 0x001a, 0xc894, 0x001a, 0x001a, 0x001a, 0x001a, 0xaf97, 0x5ce1, 0x5ae1, 0x7b92, 0xa490, 0x001a, 0x001a, 0xa994, 0x001a, 0x4c95, 0x001a, 0x5ee1, 0xaa97, 0x6c8c, 0x5fe1, 0x001a, 0x5de1, 0xd494, 0x60e1, 0x001a, 0x61e1, 0x001a, 0x53ee, 0xd988, 0x001a, 0x001a, 0xf48f, 0x66e1, 0x001a, 0x63e1, 0xeb93, 0x62e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x458b, 0x001a, 0x001a, 0x69e1, 0x001a, 0x001a, 0x001a, 0x64e1, 0x65e1, 0x001a, 0x68e1, 0x67e1, 0x4495, 0x001a, 0x001a, 0x6191, 0x6091, 0x001a, 0x5e8b, 0x001a, 0x001a, 0x6ae1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6be1, 0x001a, 0x001a, 0x6ce1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ee1, 0x001a, 0x6de1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7589, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x76e1, 0xe694, 0x70e1, 0x001a, 0x72e1, 0x001a, 0x001a, 0x74e1, 0x5d90, 0x001a, 0x001a, 0x75e1, 0x73e1, 0xbe8e, 0x001a, 0x001a, 0x001a, 0x6fe1, 0x71e1, 0x001a, 0x6195, 0x001a, 0xc78f, 0x001a, 0x001a, 0x78e1, 0x001a, 0x001a, 0x77e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x79e1, 0x001a, 0xa48e, 0xad8d, 0x001a, 0x001a, 0x9793, 0x7ae1, 0x001a, 0xc992, 0x001a, 0x001a, 0x7ce1, 0x001a, 0x001a, 0x001a, 0x9f97, 0x7be1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8991, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x82e1, 0x001a, 0x84e1, 0x85e1, 0x7392, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x83e1, 0x001a, 0x80e1, 0x001a, 0x7de1, 0x7ee1, 0x001a, 0x81e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x88e1, 0x001a, 0x86e1, 0x001a, 0x87e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x89e1, 0x8be1, 0x8ce1, 0x8de1, 0x001a, 0x8ee1, 0x001a, 0x001a, 0x8ae1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x90e1, 0x001a, 0x001a, 0x001a, 0x8fe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x91e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc397, 0x001a, 0x001a, 0x001a, 0x94e1, 0x92e1, 0x93e1, 0x001a, 0x001a, 0x001a, 0xe08a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc96, 0x001a, 0x001a, 0x001a, 0xc895, 0x001a, 0x96e1, 0x001a, 0x001a, 0x001a, 0x95e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x97e1, 0x98e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x9ce1, 0x99e1, 0x9ae1, 0x9be1, 0x001a, 0x9de1, 0x001a, 0x001a, 0x001a, 0x9ee1, 0x001a, 0x9fe1, 0x001a, 0x001a, 0x001a, 0xa0e1, 0x001a, 0xa1e1, 0x001a, 0xad94, 0x6f93, 0xa2e1, 0x9294, 0x5395, 0x001a, 0xa3e1, 0x001a, 0x54ee, 0xa4e1, 0x4993, 0x001a, 0x468a, 0x638d, 0xa5e1, 0x001a, 0x001a, 0xa6e1, 0x001a, 0x001a, 0xa7e1, 0x001a, 0x488e, 0x001a, 0x001a, 0xa9e1, 0x001a, 0x001a, 0xa8e1, 0x001a, 0x001a, 0xaae1, 0xabe1, 0x57ee, 0x55ee, 0x001a, 0x56ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x58ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe794, 0x001a, 0xace1, 0x001a, 0x001a, 0x001a, 0xade1, 0x001a, 0x001a, 0x89ea, 0xaee1, 0xafe1, 0xb0e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x4d8e, 0x001a, 0x001a, 0xb1e1, 0x7594, 0x001a, 0x001a, 0x7e96, 0x001a, 0x6d89, 0x001a, 0x7689, 0x001a, 0x001a, 0xb2e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e1, 0x001a, 0x001a, 0x001a, 0xb3e1, 0x9093, 0x001a, 0x001a, 0x001a, 0xb790, 0x589f, 0x001a, 0xb5e1, 0xbf96, 0x001a, 0xb6e1, 0x001a, 0xc48a, 0xd594, 0xb7e1, 0x001a, 0xb8e1, 0x001a, 0x001a, 0xb9e1, 0x001a, 0x001a, 0x001a, 0xda96, 0x001a, 0x001a, 0x001a, 0xd396, 0x001a, 0xbc92, 0x001a, 0x001a, 0x001a, 0x8a91, 0x001a, 0x001a, 0xbbe1, 0x001a, 0x001a, 0x828f, 0x001a, 0x001a, 0xc88f, 0x001a, 0x001a, 0xbee1, 0x001a, 0x001a, 0xbde1, 0xbce1, 0xfb94, 0x001a, 0xc58a, 0xa78c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4e1, 0x001a, 0x001a, 0xc1e1, 0x5e90, 0xb096, 0x001a, 0x001a, 0x001a, 0xc0e1, 0xc2e1, 0xc3e1, 0x001a, 0x001a, 0xbfe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5e1, 0xc6e1, 0x001a, 0xad92, 0x001a, 0xe18a, 0x001a, 0x001a, 0x001a, 0x8592, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5aee, 0xc7e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8e1, 0xcbe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8790, 0x001a, 0xc293, 0x001a, 0xcce1, 0x7296, 0x001a, 0xc9e1, 0x001a, 0x001a, 0xcae1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe1, 0x001a, 0x001a, 0x001a, 0x001a, 0xcee1, 0xcde1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e1, 0x001a, 0x001a, 0xd0e1, 0x001a, 0x001a, 0xd2e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e1, 0x001a, 0xd3e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xcb95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x758f, 0xc497, 0x001a, 0x001a, 0xd5e1, 0x001a, 0x001a, 0xb593, 0x001a, 0x001a, 0xd6e1, 0x001a, 0x001a, 0xd7e1, 0x001a, 0xdbe1, 0xd9e1, 0xdae1, 0x001a, 0xd8e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdce1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee1, 0x001a, 0x001a, 0xdfe1, 0xb596, 0xe0e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xee96, 0xe1e1, 0x001a, 0x6d92, 0x001a, 0x8a94, 0x001a, 0xe98b, 0x001a, 0x001a, 0x001a, 0x5a92, 0xe2e1, 0xb88b, 0x001a, 0x001a, 0x001a, 0xce90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbb8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e1, 0x001a, 0xa48c, 0xd38d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7e1, 0x5cee, 0x001a, 0x001a, 0x001a, 0x7593, 0xd48d, 0x6d8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4396, 0x001a, 0x6a94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7693, 0x001a, 0x001a, 0x001a, 0x001a, 0x7b8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5dee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc98f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5eee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb097, 0x648d, 0x001a, 0x001a, 0xa58c, 0x001a, 0x001a, 0xa194, 0x001a, 0xebe1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5fee, 0x001a, 0xede1, 0x001a, 0x001a, 0x001a, 0x001a, 0xe98c, 0x001a, 0x001a, 0x001a, 0x001a, 0xece1, 0xf492, 0x001a, 0x001a, 0x001a, 0x001a, 0xefe1, 0x568a, 0xeae1, 0x001a, 0x001a, 0xe894, 0x001a, 0x4f89, 0x001a, 0xea8d, 0x001a, 0x7198, 0x001a, 0x001a, 0xeee1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0e1, 0x001a, 0x001a, 0x001a, 0xc995, 0x001a, 0xd790, 0xf2e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xf3e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d8a, 0x001a, 0xf9e1, 0x001a, 0xf8e1, 0x001a, 0x001a, 0xa58e, 0x001a, 0x001a, 0x001a, 0xfae1, 0xf5e1, 0x001a, 0x001a, 0x001a, 0xfbe1, 0xf6e1, 0x001a, 0x001a, 0x001a, 0x001a, 0xd694, 0xf4e1, 0x001a, 0x001a, 0xf7e1, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x40e2, 0x8196, 0x001a, 0x001a, 0x001a, 0xfce1, 0x001a, 0x001a, 0xe988, 0x001a, 0x001a, 0x001a, 0x001a, 0x43e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x42e2, 0x001a, 0x001a, 0x001a, 0xca8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x44e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6291, 0x001a, 0x001a, 0x46e2, 0x45e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x47e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6e1, 0x001a, 0x001a, 0x001a, 0xe8e1, 0x49e2, 0x48e2, 0x001a, 0x001a, 0x001a, 0x60ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa68e, 0x001a, 0xe797, 0x001a, 0xd08e, 0x001a, 0x4ae2, 0x568c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5f8b, 0x468b, 0x838e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5397, 0x001a, 0x001a, 0x50e2, 0x001a, 0x4fe2, 0x6391, 0x4ce2, 0x001a, 0x001a, 0x4ee2, 0x001a, 0x001a, 0x6a8f, 0x5f90, 0x4de2, 0x4be2, 0x001a, 0x4994, 0x001a, 0x001a, 0xcb8f, 0x001a, 0x001a, 0x5b95, 0x001a, 0x001a, 0x001a, 0x001a, 0xd58d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9893, 0x001a, 0x001a, 0x51e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x52e2, 0x68e2, 0xd68b, 0x001a, 0x001a, 0x5c98, 0x5491, 0x001a, 0x001a, 0x001a, 0x001a, 0x53e2, 0x001a, 0x001a, 0xd089, 0xf592, 0x9f95, 0x001a, 0x001a, 0x001a, 0x001a, 0x64ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x66ee, 0x001a, 0x54e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9a8b, 0x55e2, 0x001a, 0x001a, 0x57e2, 0x001a, 0x001a, 0x001a, 0x58e2, 0x001a, 0x4894, 0x001a, 0x001a, 0x59e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ae2, 0x5be2, 0x001a, 0x001a, 0xd78b, 0xd189, 0xc393, 0x478f, 0x848e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ce2, 0x001a, 0x488f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc889, 0x6295, 0x001a, 0x001a, 0x5de2, 0x001a, 0x001a, 0xe994, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6491, 0x001a, 0x60e2, 0x001a, 0x61e2, 0x8994, 0x001a, 0x6090, 0x5ee2, 0x001a, 0x8192, 0x001a, 0x001a, 0x5fe2, 0x001a, 0x001a, 0x001a, 0xcc8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xda88, 0x001a, 0x001a, 0x001a, 0x001a, 0x488b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62e2, 0x001a, 0x001a, 0xf692, 0x001a, 0x63e2, 0xc590, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xab96, 0x001a, 0x001a, 0x4295, 0x64e2, 0x65e2, 0x7492, 0x001a, 0xc597, 0x001a, 0x001a, 0x67e2, 0x66e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xed8e, 0x001a, 0x001a, 0x69e2, 0xee88, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ce2, 0x001a, 0x001a, 0x001a, 0x6ae2, 0xd289, 0x6d8c, 0x6be2, 0x658d, 0x928d, 0x001a, 0xe495, 0x6de2, 0x001a, 0x001a, 0x7396, 0x001a, 0x001a, 0x6fe2, 0x001a, 0x001a, 0x001a, 0xcf90, 0x6e89, 0xb889, 0xaa88, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ee2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x70e2, 0x71e2, 0xf58f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x72e2, 0x001a, 0x6e8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74e2, 0x001a, 0x001a, 0x001a, 0x8a8c, 0x001a, 0x868b, 0x001a, 0x001a, 0x75e2, 0xf38b, 0x001a, 0x001a, 0x76e2, 0x001a, 0xfa90, 0x001a, 0xcb93, 0x001a, 0xde90, 0xf38d, 0x001a, 0x001a, 0x001a, 0x77e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8292, 0x8b91, 0x001a, 0x79e2, 0x7be2, 0x78e2, 0x7ae2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x418c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ce2, 0x458c, 0x001a, 0x001a, 0x001a, 0x878b, 0x7197, 0x7ee2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x80e2, 0x001a, 0x001a, 0x001a, 0x4d89, 0x001a, 0x001a, 0x001a, 0x001a, 0x83e2, 0x001a, 0x001a, 0x001a, 0x968a, 0x82e2, 0x81e2, 0x001a, 0x85e2, 0x7de2, 0x001a, 0x86e2, 0xa797, 0x001a, 0x87e2, 0x001a, 0x88e2, 0x001a, 0x67ee, 0xf29a, 0x8ae2, 0x001a, 0x89e2, 0x001a, 0x001a, 0x001a, 0x8be2, 0x8ce2, 0x001a, 0xb397, 0x8de2, 0x001a, 0xede8, 0xcd8f, 0x8ee2, 0x8fe2, 0x768f, 0x001a, 0xb693, 0x90e2, 0x68ee, 0x001a, 0x001a, 0x4792, 0x6aee, 0x001a, 0x91e2, 0x001a, 0x5b92, 0x92e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa38b, 0x001a, 0x5e99, 0x7c92, 0xb18e, 0x001a, 0x001a, 0x001a, 0x001a, 0xc68a, 0x001a, 0x001a, 0x93e2, 0x001a, 0xa0e2, 0x001a, 0x96e2, 0x001a, 0x888b, 0x001a, 0x95e2, 0xa2e2, 0x001a, 0x001a, 0x001a, 0x94e2, 0x001a, 0xce8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x98e2, 0x99e2, 0x001a, 0x4a93, 0x001a, 0x001a, 0x9ae2, 0x001a, 0x7d8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7990, 0x8495, 0x001a, 0x9ce2, 0x001a, 0x001a, 0x001a, 0xe691, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x97e2, 0x001a, 0x9be2, 0x9de2, 0x001a, 0x001a, 0xf98d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e2, 0x4d95, 0x001a, 0xa494, 0x9993, 0x001a, 0xd88b, 0xa3e2, 0xa1e2, 0x001a, 0xb394, 0x9ee2, 0x7d92, 0x9b93, 0x001a, 0x9a93, 0x001a, 0xf48d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa6e2, 0x001a, 0xa8e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xabe2, 0x001a, 0xace2, 0x001a, 0xa9e2, 0xaae2, 0x001a, 0x001a, 0xa7e2, 0xa5e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x9fe2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcd95, 0xd389, 0x001a, 0x001a, 0x001a, 0xb3e2, 0x001a, 0xb0e2, 0x001a, 0xb5e2, 0x001a, 0x001a, 0xb4e2, 0x001a, 0x9394, 0xa596, 0x001a, 0x5a8e, 0xaee2, 0xb7e2, 0xb2e2, 0x001a, 0xb1e2, 0xade2, 0x6bee, 0xafe2, 0x001a, 0xc78a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5c92, 0x001a, 0x001a, 0xfb90, 0x001a, 0x001a, 0x001a, 0xa094, 0x001a, 0x001a, 0xbce2, 0x001a, 0x001a, 0x001a, 0xa294, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf90, 0xb9e2, 0x001a, 0x001a, 0xcd94, 0x001a, 0xbde2, 0xd195, 0x001a, 0x7a92, 0x001a, 0xb8e2, 0xbae2, 0x001a, 0x001a, 0xbbe2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee2, 0x001a, 0x001a, 0xc28e, 0x001a, 0x001a, 0x001a, 0xc493, 0xc3e2, 0xc2e2, 0x001a, 0x001a, 0xbfe2, 0x001a, 0x001a, 0x001a, 0x5598, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8e2, 0x001a, 0x001a, 0xcce2, 0xc9e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcbe2, 0x001a, 0x001a, 0x001a, 0xc0e2, 0xd399, 0xc7e2, 0xc1e2, 0x001a, 0x001a, 0xcae2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0e2, 0x001a, 0xc88a, 0x001a, 0xcde2, 0x001a, 0x001a, 0x001a, 0xcee2, 0x001a, 0x001a, 0xcfe2, 0xd2e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e2, 0xf494, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3e2, 0xfa97, 0xeb95, 0xd8e2, 0x001a, 0x001a, 0xd5e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e2, 0xd090, 0x001a, 0xd7e2, 0xd9e2, 0x001a, 0x001a, 0x001a, 0xd6e2, 0x001a, 0xdde2, 0x001a, 0xdae2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdbe2, 0xc4e2, 0x001a, 0x001a, 0x001a, 0xdce2, 0xdee2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdfe2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc495, 0x001a, 0xe0e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe096, 0x001a, 0x001a, 0xcc8b, 0x488c, 0xe1e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb295, 0x001a, 0x8890, 0x001a, 0xae96, 0x001a, 0x001a, 0xe2e2, 0x001a, 0xb197, 0x001a, 0x001a, 0x9494, 0x001a, 0x6591, 0x5394, 0x001a, 0x001a, 0x6c8f, 0x001a, 0x001a, 0x001a, 0xbe88, 0x001a, 0xe7e2, 0xe5e2, 0x001a, 0xe3e2, 0x9f8a, 0x001a, 0xcf8f, 0xe8e2, 0x001a, 0x001a, 0xe6e2, 0x001a, 0xe4e2, 0xece2, 0x001a, 0x001a, 0xebe2, 0xeae2, 0xe9e2, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xede2, 0x001a, 0x001a, 0x001a, 0xeee2, 0xb890, 0x001a, 0xefe2, 0x001a, 0xf1e2, 0x001a, 0x001a, 0xf0e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xd08c, 0x001a, 0x001a, 0x001a, 0x5791, 0x001a, 0x001a, 0x001a, 0xf3e2, 0x001a, 0x001a, 0x001a, 0x9c93, 0x001a, 0xf2e2, 0x001a, 0x001a, 0x001a, 0xf4e2, 0x001a, 0xb395, 0x8c91, 0x668d, 0x001a, 0xf5e2, 0x001a, 0x001a, 0x001a, 0x001a, 0xc697, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e2, 0x001a, 0x001a, 0xf8e2, 0x001a, 0xf9e2, 0x001a, 0xfae2, 0x001a, 0x858e, 0x001a, 0xfbe2, 0x6e8c, 0x001a, 0x001a, 0x8a8b, 0x001a, 0x498b, 0x001a, 0x40e3, 0x001a, 0xf196, 0x678d, 0xfce2, 0x001a, 0x001a, 0x001a, 0x43e3, 0xe496, 0x001a, 0x5b94, 0x001a, 0x001a, 0x5295, 0x001a, 0x001a, 0x001a, 0x838f, 0x42e3, 0x001a, 0xd18e, 0x688d, 0x868e, 0x898b, 0xb495, 0x41e3, 0x001a, 0x001a, 0x001a, 0x6691, 0x6196, 0xf58d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x878e, 0xdb92, 0x001a, 0x46e3, 0xdd97, 0xd78d, 0x001a, 0x47e3, 0x6190, 0x001a, 0x49e3, 0x001a, 0x001a, 0x001a, 0xd08f, 0xae8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x48e3, 0x001a, 0x001a, 0x498f, 0xbc8c, 0x6791, 0x44e3, 0x4ae3, 0x001a, 0x6dee, 0x001a, 0x001a, 0x45e3, 0x6f8c, 0x001a, 0x4de3, 0x51e3, 0x8b8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ce3, 0x001a, 0x001a, 0x001a, 0x001a, 0x55e3, 0x6eee, 0x001a, 0x698d, 0x001a, 0x001a, 0x8d97, 0xba88, 0x52e3, 0x001a, 0x001a, 0x8b8b, 0x001a, 0x4fe3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50e3, 0x001a, 0x001a, 0x9d93, 0x4ee3, 0x4be3, 0x001a, 0x478a, 0xe290, 0x001a, 0x001a, 0xa68c, 0x001a, 0x001a, 0x001a, 0x57e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x54e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56e3, 0x001a, 0x001a, 0x001a, 0x53e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x708c, 0xb191, 0x58e3, 0x8e91, 0x001a, 0x001a, 0x65e3, 0x70ee, 0x001a, 0x61e3, 0x5be3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5fe3, 0xf88e, 0xdb88, 0x5ae3, 0x62e3, 0x66e3, 0x6a8d, 0xd496, 0x001a, 0xd492, 0x5ce3, 0x001a, 0x6fee, 0x64e3, 0x001a, 0x59e3, 0x5d92, 0x001a, 0x5ee3, 0xbb88, 0xc896, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5de3, 0x001a, 0x001a, 0xd98b, 0xea94, 0x001a, 0x001a, 0x001a, 0x8d91, 0x001a, 0xce97, 0x8f8f, 0x001a, 0x001a, 0x8ee3, 0x71ee, 0x001a, 0x67e3, 0x001a, 0xfc90, 0x001a, 0x63e3, 0x68e3, 0x6ae3, 0x001a, 0xf792, 0x6de3, 0x001a, 0x001a, 0x69e3, 0x001a, 0x001a, 0x001a, 0xd295, 0xc98a, 0x001a, 0x001a, 0xc996, 0x001a, 0x001a, 0xdc88, 0x001a, 0x001a, 0x6ce3, 0x001a, 0xfb97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6be3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8f89, 0x001a, 0x001a, 0xea93, 0x6ee3, 0x001a, 0x001a, 0x001a, 0x75e3, 0x6fe3, 0x76e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x72e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9b94, 0x001a, 0x001a, 0xc88e, 0x74e3, 0x001a, 0x71e3, 0x77e3, 0x70e3, 0x001a, 0x001a, 0x638f, 0x001a, 0x001a, 0x001a, 0x001a, 0x4496, 0x001a, 0x001a, 0x6b8f, 0x001a, 0x001a, 0x73e3, 0x80e3, 0x001a, 0x001a, 0x7be3, 0x001a, 0x7ee3, 0x001a, 0x7ce3, 0x81e3, 0x7ae3, 0x001a, 0x60e3, 0xd190, 0x001a, 0x001a, 0xc994, 0x001a, 0x7de3, 0x001a, 0x001a, 0x78e3, 0x001a, 0x001a, 0x001a, 0x4091, 0x718c, 0x001a, 0x4a8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x72ee, 0x001a, 0x4490, 0x5591, 0x84e3, 0x001a, 0x001a, 0x86e3, 0x87e3, 0x001a, 0x001a, 0x83e3, 0x85e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x79e3, 0x82e3, 0x001a, 0x8ae3, 0x89e3, 0x001a, 0x001a, 0x9a96, 0x001a, 0x001a, 0x4a8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x88e3, 0x001a, 0x8ce3, 0x8be3, 0x8fe3, 0x001a, 0x91e3, 0x001a, 0x001a, 0x5b8e, 0x8de3, 0x001a, 0x001a, 0x001a, 0x001a, 0x92e3, 0x93e3, 0x40ed, 0x001a, 0x94e3, 0x001a, 0x9ae3, 0x5a93, 0x96e3, 0x001a, 0x95e3, 0x97e3, 0x98e3, 0x001a, 0x99e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x9be3, 0x9ce3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xca8a, 0x001a, 0x9de3, 0x001a, 0x9ee3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9fe3, 0x001a, 0x73ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xa0e3, 0xa1e3, 0xa2e3, 0x001a, 0xa3e3, 0xa4e3, 0x001a, 0x001a, 0xa6e3, 0xa5e3, 0x001a, 0x001a, 0xa7e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa8e3, 0xa9e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xace3, 0xaae3, 0xabe3, 0xdf8d, 0x728c, 0x001a, 0x001a, 0x7592, 0x001a, 0xb194, 0x001a, 0x908f, 0x001a, 0x001a, 0x6c94, 0x001a, 0xeb94, 0xade3, 0xeb9c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaee3, 0xb0e3, 0x001a, 0x8597, 0xafe3, 0xb2e3, 0xb1e3, 0x001a, 0x7297, 0x001a, 0xb3e3, 0x001a, 0xfc94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7e3, 0x001a, 0x001a, 0xb6e3, 0xb5e3, 0x001a, 0x001a, 0x74ee, 0x001a, 0xb8e3, 0x518c, 0x001a, 0x001a, 0x001a, 0x4191, 0x608b, 0x001a, 0x001a, 0x001a, 0x001a, 0xbce3, 0xb9e3, 0x001a, 0x001a, 0xbae3, 0x001a, 0x001a, 0x001a, 0xbde3, 0x001a, 0xbee3, 0xbbe3, 0x001a, 0x001a, 0x001a, 0x4889, 0x001a, 0x001a, 0x001a, 0xa589, 0x001a, 0x001a, 0x001a, 0xc0e3, 0xc1e3, 0x001a, 0x001a, 0x001a, 0xc2e3, 0x001a, 0x8297, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4b8f, 0x001a, 0xc4e3, 0xc3e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8990, 0xc5e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xc6e3, 0x001a, 0x001a, 0xc7e3, 0x001a, 0xe38a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcb8a, 0x001a, 0x001a, 0xc8e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9e3, 0x001a, 0x7c96, 0x8397, 0x001a, 0x001a, 0x001a, 0x7397, 0x5698, 0x001a, 0x6c8d, 0xcce3, 0xd28e, 0xcbe3, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde3, 0xa78e, 0x001a, 0x001a, 0x001a, 0xcf91, 0x001a, 0xcee3, 0x001a, 0x001a, 0x6b8d, 0x001a, 0xd596, 0xcfe3, 0xd0e3, 0x001a, 0x001a, 0xd1e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd3e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa88e, 0x001a, 0x001a, 0xeb96, 0x001a, 0x001a, 0x001a, 0x001a, 0xd5e3, 0x001a, 0x5e92, 0x001a, 0xd4e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd7e3, 0x001a, 0x001a, 0x001a, 0xd6e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e3, 0x001a, 0x001a, 0x001a, 0xb990, 0x001a, 0xd9e3, 0x001a, 0xdae3, 0x001a, 0x001a, 0x001a, 0xb795, 0xdbe3, 0x001a, 0x8f91, 0xdce3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfc97, 0xe0e3, 0x001a, 0xdfe3, 0xdee3, 0xae92, 0x001a, 0xe1e3, 0x4590, 0x001a, 0xe2e3, 0x001a, 0x001a, 0x001a, 0xe3e3, 0x5798, 0xe4e3, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e3, 0xe7e3, 0xe6e3, 0xa394, 0x001a, 0xf793, 0x001a, 0x5d98, 0xa794, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e3, 0x001a, 0x001a, 0xd18f, 0x001a, 0x4995, 0x001a, 0xeae3, 0xe8e3, 0x001a, 0xcc8a, 0x001a, 0x001a, 0x001a, 0xd28c, 0x888e, 0x001a, 0x001a, 0xec94, 0x001a, 0x001a, 0x001a, 0xa88c, 0x6296, 0x001a, 0xede3, 0xebe3, 0x001a, 0x6d8d, 0x001a, 0x6e8d, 0xe788, 0x001a, 0xe68d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7894, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdd88, 0xf2e3, 0x001a, 0x5f92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7794, 0x001a, 0xd991, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e3, 0x001a, 0x001a, 0xf0e3, 0xf3e3, 0xeee3, 0x001a, 0xf1e3, 0x4596, 0x001a, 0x001a, 0xd38c, 0x001a, 0x001a, 0xfb88, 0xefe3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6e3, 0x001a, 0xf7e3, 0x001a, 0x001a, 0xb793, 0x001a, 0x001a, 0x001a, 0xb98b, 0x001a, 0x001a, 0x001a, 0x45e4, 0x5c94, 0x001a, 0x001a, 0x001a, 0x001a, 0x898e, 0x001a, 0x001a, 0xba8b, 0xc690, 0x6598, 0xac96, 0xf5e3, 0xd290, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x728b, 0xf8e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfae3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e3, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe3, 0x001a, 0x4592, 0x001a, 0x5d94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xaf92, 0x001a, 0x001a, 0x001a, 0x001a, 0x42e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xfce3, 0x001a, 0x001a, 0x7490, 0x001a, 0x8595, 0x44e4, 0x001a, 0x43e4, 0x6f8d, 0x7298, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x54e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x48e4, 0x49e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xee8e, 0x001a, 0x001a, 0x47e4, 0x001a, 0x988d, 0x46e4, 0x001a, 0x001a, 0x4ae4, 0x001a, 0x001a, 0x001a, 0xb092, 0xa095, 0x4291, 0x001a, 0x001a, 0x001a, 0x001a, 0xda91, 0x4ee4, 0x001a, 0x4fe4, 0x4be4, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ce4, 0x001a, 0x4de4, 0x001a, 0x001a, 0x001a, 0x001a, 0x708d, 0x001a, 0x001a, 0x001a, 0x55e4, 0x001a, 0x51e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x8695, 0x001a, 0x8c96, 0x4795, 0x001a, 0x001a, 0x50e4, 0x001a, 0x001a, 0x53e4, 0x52e4, 0x001a, 0x001a, 0x001a, 0x6396, 0x56e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x57e4, 0x001a, 0x001a, 0x5691, 0x001a, 0x58e4, 0x001a, 0x001a, 0x5ae4, 0x001a, 0x5ee4, 0x001a, 0x001a, 0x5be4, 0x59e4, 0x5e94, 0x5ce4, 0x001a, 0x5de4, 0x001a, 0x001a, 0x001a, 0xb089, 0x001a, 0x64e4, 0x5fe4, 0x001a, 0x001a, 0x001a, 0x60e4, 0x001a, 0x001a, 0x001a, 0x61e4, 0x001a, 0x9f91, 0x001a, 0x001a, 0x001a, 0x001a, 0x63e4, 0x62e4, 0x65e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x66e4, 0x67e4, 0x001a, 0x001a, 0x6290, 0x001a, 0xe789, 0x001a, 0x68e4, 0xd597, 0x001a, 0xa98e, 0x001a, 0x001a, 0x4c8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a8e, 0x7692, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x69e4, 0x6ae4, 0x5089, 0x001a, 0x6be4, 0x001a, 0x001a, 0x6ce4, 0x6de4, 0x001a, 0x001a, 0x6ee4, 0x001a, 0x6fe4, 0xbb8b, 0xa89d, 0x70e4, 0x001a, 0xe390, 0x71e4, 0xc98e, 0x001a, 0x72e4, 0x001a, 0xae98, 0x001a, 0x001a, 0x001a, 0x73e4, 0xdc95, 0xda8a, 0x001a, 0x001a, 0x4391, 0x778f, 0x001a, 0x9195, 0x4d8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x74e4, 0x718d, 0x75e4, 0xca94, 0x001a, 0x84e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x77e4, 0x001a, 0xc791, 0x9594, 0xbd8c, 0x76e4, 0x4491, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x78e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf892, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ae4, 0x79e4, 0x7ce4, 0x001a, 0x001a, 0x7be4, 0x001a, 0x7de4, 0x001a, 0x001a, 0x80e4, 0x001a, 0x7ee4, 0x001a, 0xcd8a, 0x001a, 0x81e4, 0x001a, 0x82e4, 0x83e4, 0x001a, 0x001a, 0xaf8d, 0xc797, 0x001a, 0x85e4, 0x4690, 0x001a, 0x001a, 0x001a, 0x9089, 0x86e4, 0x87e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x88e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf088, 0x001a, 0x89e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x8ae4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8795, 0x001a, 0x001a, 0x001a, 0xc58e, 0x001a, 0x8ce4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x488a, 0xb088, 0x001a, 0x001a, 0x001a, 0x001a, 0x8be4, 0x8ee4, 0x6d94, 0x001a, 0x6390, 0x001a, 0xd489, 0x001a, 0x4696, 0x001a, 0x001a, 0x001a, 0x001a, 0x7c8c, 0xda8b, 0x001a, 0x8de4, 0x001a, 0xe889, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa18a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9189, 0x92e4, 0xe897, 0xdb91, 0x001a, 0x001a, 0x6395, 0x001a, 0x9ee4, 0x001a, 0xd589, 0x9ce4, 0x001a, 0x9ae4, 0x91e4, 0x001a, 0x8fe4, 0x001a, 0x90e4, 0x001a, 0xe18e, 0xea8b, 0x9792, 0x001a, 0x001a, 0x001a, 0xcf93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7089, 0x001a, 0x94e4, 0x93e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x99e4, 0x95e4, 0x98e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x76ee, 0xce96, 0x97e4, 0xd689, 0x9d8a, 0x9be4, 0x001a, 0x001a, 0x9de4, 0x001a, 0x001a, 0x001a, 0x001a, 0x738c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1e4, 0xaae4, 0xabe4, 0x001a, 0x001a, 0x001a, 0xa988, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xef88, 0x001a, 0x001a, 0xa9e4, 0x001a, 0x001a, 0x001a, 0xa8e4, 0x001a, 0xa3e4, 0xa2e4, 0x001a, 0xa0e4, 0x9fe4, 0x8392, 0x001a, 0xf991, 0xa5e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xa7e4, 0x001a, 0x001a, 0x001a, 0x9091, 0x748c, 0x001a, 0x001a, 0x001a, 0x001a, 0x6089, 0xa6e4, 0x001a, 0x728d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9191, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x77ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8e4, 0x001a, 0xb9e4, 0x001a, 0xd789, 0x001a, 0x001a, 0x001a, 0xac89, 0xb6e4, 0x001a, 0x001a, 0x78ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xace4, 0x001a, 0xb4e4, 0x001a, 0xbbe4, 0xb5e4, 0x001a, 0x001a, 0x001a, 0xb3e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x96e4, 0x001a, 0x001a, 0xb1e4, 0x001a, 0x001a, 0x001a, 0xade4, 0x001a, 0x001a, 0x001a, 0xce8a, 0xafe4, 0xbae4, 0x001a, 0xb0e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbce4, 0x001a, 0xaee4, 0x9c94, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8997, 0x001a, 0x001a, 0x001a, 0xb7e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde4, 0x001a, 0x001a, 0x001a, 0xc5e4, 0x001a, 0x001a, 0x001a, 0x9b90, 0x001a, 0x79ee, 0x001a, 0x001a, 0x658b, 0x001a, 0xdb8b, 0x001a, 0xc0e4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd989, 0x001a, 0x001a, 0xd28f, 0x001a, 0xc3e4, 0x001a, 0x001a, 0x001a, 0xd88d, 0x001a, 0x001a, 0x7093, 0xc8e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xec95, 0x001a, 0xbfe4, 0x001a, 0x001a, 0x001a, 0xd889, 0xd48c, 0x4895, 0xc9e4, 0x001a, 0xbde4, 0x001a, 0x7aee, 0xc6e4, 0x001a, 0x001a, 0x001a, 0xd0e4, 0x001a, 0xc1e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e4, 0xb893, 0x001a, 0x001a, 0xc7e4, 0x001a, 0x001a, 0x001a, 0xc4e4, 0x4796, 0xcae4, 0xde88, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcce4, 0x001a, 0xcbe4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8b94, 0xd2e4, 0x001a, 0xdde4, 0x001a, 0x001a, 0x001a, 0x001a, 0x9e8a, 0x001a, 0x001a, 0x001a, 0xe0e4, 0x001a, 0x001a, 0xcee4, 0x001a, 0x001a, 0x001a, 0xd3e4, 0x8e97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdce4, 0x001a, 0x7bee, 0x7497, 0x001a, 0x001a, 0x001a, 0x001a, 0xa897, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9892, 0x001a, 0x001a, 0x001a, 0x8b8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9295, 0xe2e4, 0x9f93, 0x001a, 0x001a, 0xaf88, 0x001a, 0x001a, 0xdbe4, 0x001a, 0xd7e4, 0x9291, 0xd1e4, 0xd9e4, 0xdee4, 0x001a, 0x4b94, 0x001a, 0x001a, 0x001a, 0xa888, 0x001a, 0xd6e4, 0x001a, 0xdfe4, 0x9895, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdae4, 0x001a, 0xd5e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd38f, 0x001a, 0x001a, 0x001a, 0x001a, 0x4e8f, 0x001a, 0x001a, 0x001a, 0xaa8e, 0x001a, 0x001a, 0x001a, 0x001a, 0xd696, 0x001a, 0x001a, 0x6695, 0x001a, 0x001a, 0xe5e4, 0x001a, 0xeee4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd8e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x978a, 0x001a, 0x7cee, 0x001a, 0x001a, 0x001a, 0xf68f, 0xe3e4, 0x001a, 0xe8e4, 0x9391, 0x001a, 0x001a, 0xe4e4, 0x001a, 0xebe4, 0x001a, 0x001a, 0x7e92, 0x001a, 0xece4, 0x001a, 0x001a, 0x7597, 0xe1e4, 0x578a, 0x001a, 0xe7e4, 0x001a, 0x001a, 0xeae4, 0xaa96, 0x001a, 0x001a, 0x001a, 0x001a, 0xede4, 0x001a, 0x001a, 0xe6e4, 0xe9e4, 0x001a, 0x44ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4896, 0x001a, 0x4098, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8e4, 0x001a, 0x001a, 0xf0e4, 0xc18e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcc95, 0x001a, 0xa096, 0xf7e4, 0xf6e4, 0x001a, 0xf2e4, 0xf3e4, 0x001a, 0x5589, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e4, 0x001a, 0xefe4, 0x001a, 0x001a, 0x001a, 0x001a, 0xd392, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e4, 0xfc88, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa091, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc195, 0x001a, 0x001a, 0xf9e4, 0x40e5, 0x001a, 0xd794, 0x001a, 0x001a, 0x001a, 0x001a, 0xfce4, 0xd48f, 0xc78e, 0x42e5, 0x001a, 0x001a, 0xbc8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x7dee, 0x001a, 0x43e5, 0x001a, 0x9995, 0xfbe4, 0x7eee, 0xd4e4, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfae4, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e98, 0xa093, 0x9395, 0x80ee, 0x001a, 0x4ae5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x51e5, 0x001a, 0x44e5, 0x001a, 0x001a, 0x001a, 0x9694, 0x001a, 0x001a, 0x4ee5, 0x46e5, 0x001a, 0x48e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x52e5, 0x47e5, 0x001a, 0x001a, 0x4be5, 0x001a, 0x001a, 0x9289, 0x001a, 0xe393, 0x001a, 0x4ce5, 0x4fe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x45e5, 0x001a, 0x4591, 0x001a, 0x49e5, 0x468e, 0x6490, 0x4f8c, 0xf296, 0x001a, 0xf796, 0x928f, 0x82ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56e5, 0x54e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6d98, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x53e5, 0x001a, 0x001a, 0x001a, 0x9597, 0x001a, 0x55e5, 0x57e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x58e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5be5, 0x59e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa193, 0x5ae5, 0x001a, 0x001a, 0x001a, 0xcb94, 0x4de5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x938f, 0x001a, 0x5ce5, 0x61e5, 0x9491, 0x001a, 0x001a, 0x60e5, 0x001a, 0x001a, 0x001a, 0x41e5, 0x001a, 0x001a, 0x001a, 0x62e5, 0x6891, 0x001a, 0x001a, 0x5de5, 0x5fe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ee5, 0x001a, 0x001a, 0x509f, 0x419f, 0x001a, 0x001a, 0x64e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x63e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9697, 0x001a, 0xbae1, 0x65e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x66e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x67e5, 0xd58c, 0x001a, 0x738b, 0x001a, 0x001a, 0x001a, 0x69e5, 0x7c99, 0x001a, 0x001a, 0x001a, 0x001a, 0x958b, 0x001a, 0xb897, 0x001a, 0xf18b, 0x6ae5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6be5, 0x001a, 0x001a, 0x001a, 0x8e92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ce5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf893, 0x001a, 0xb888, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe189, 0x71e5, 0x72e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6de5, 0x001a, 0x5c8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ee5, 0x6194, 0x001a, 0x001a, 0x001a, 0x001a, 0x6fe5, 0x70e5, 0x7ae5, 0x001a, 0x001a, 0x001a, 0x74e5, 0x77e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x75e5, 0x001a, 0x76e5, 0xd68e, 0x001a, 0x78e5, 0x001a, 0x6092, 0x001a, 0x758c, 0x618a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7be5, 0x001a, 0x001a, 0x001a, 0x001a, 0x5e8a, 0x001a, 0x81e5, 0x001a, 0x001a, 0x7ce5, 0x80e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xb894, 0x001a, 0x001a, 0x001a, 0x001a, 0x7de5, 0x001a, 0x001a, 0x7ee5, 0x6795, 0xd894, 0x82e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfb91, 0x8ce5, 0x001a, 0x88e5, 0x001a, 0x001a, 0xe989, 0x001a, 0x86e5, 0x001a, 0x4996, 0x87e5, 0x001a, 0x001a, 0x84e5, 0x001a, 0x85e5, 0x8ae5, 0x8de5, 0x001a, 0x001a, 0x8be5, 0x001a, 0x001a, 0x001a, 0x89e5, 0x83e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7792, 0x001a, 0x94e5, 0x001a, 0xa896, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x92e5, 0x001a, 0x001a, 0x001a, 0x93e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8ee5, 0x001a, 0x001a, 0x90e5, 0x001a, 0x001a, 0x001a, 0x91e5, 0x001a, 0x001a, 0x001a, 0x8fe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe490, 0x001a, 0x5898, 0x98e5, 0x001a, 0x99e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x9fe5, 0x001a, 0x4990, 0x001a, 0x9be5, 0x001a, 0x9ee5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x96e5, 0x95e5, 0x001a, 0x001a, 0xa0e5, 0x001a, 0x001a, 0xda89, 0x001a, 0x9ce5, 0x001a, 0xa1e5, 0x001a, 0x001a, 0x001a, 0x9de5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9ae5, 0x001a, 0xb192, 0x001a, 0x97e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8894, 0x001a, 0x001a, 0xa5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5a97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa4e5, 0x001a, 0x001a, 0xa3e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xace5, 0x001a, 0x001a, 0x001a, 0xa6e5, 0x001a, 0x001a, 0x001a, 0xaee5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8697, 0xb1e5, 0x001a, 0xa8e5, 0x001a, 0x001a, 0xa9e5, 0x001a, 0x001a, 0x001a, 0xade5, 0x001a, 0xb0e5, 0xafe5, 0x001a, 0x001a, 0x001a, 0xa7e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xaae5, 0x001a, 0xbbe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb2e5, 0x001a, 0x001a, 0xb3e5, 0x001a, 0x001a, 0x001a, 0xb8e5, 0xb9e5, 0x001a, 0x498a, 0x001a, 0x618b, 0x001a, 0x001a, 0xb7e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa2e5, 0x001a, 0x85ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e5, 0xbae5, 0xb5e5, 0x001a, 0xbce5, 0x001a, 0x001a, 0x001a, 0xbee5, 0xbde5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc0e5, 0xbfe5, 0x79e5, 0x001a, 0x001a, 0x001a, 0xc4e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e5, 0x001a, 0x001a, 0xc3e5, 0x001a, 0xc5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c8c, 0x001a, 0xc7e5, 0x001a, 0xc6e5, 0x001a, 0x4f8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x738d, 0xa59f, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8e5, 0x708f, 0x001a, 0x001a, 0x001a, 0x588a, 0x001a, 0xc9e5, 0x001a, 0x7189, 0x001a, 0xd58f, 0xcae5, 0x001a, 0x001a, 0x748d, 0xcbe5, 0xdf88, 0x001a, 0x001a, 0x001a, 0x001a, 0x5c95, 0x001a, 0x001a, 0xcce5, 0x001a, 0x001a, 0x001a, 0x001a, 0x8a90, 0x001a, 0xd3e5, 0x001a, 0x001a, 0xd0e5, 0x001a, 0x8f92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e5, 0xcee5, 0xdc8b, 0x001a, 0xcde5, 0xd4e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x558c, 0x001a, 0x001a, 0xdc91, 0x001a, 0xdae5, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e5, 0x001a, 0x001a, 0x001a, 0xb391, 0xd5e5, 0x001a, 0xd8e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe5, 0x001a, 0x001a, 0x001a, 0xd9e5, 0x001a, 0xdbe5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xed94, 0x001a, 0x001a, 0xd7e5, 0x001a, 0xdce5, 0xdee5, 0x001a, 0x001a, 0xd18c, 0xd2e5, 0x001a, 0xbf88, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde5, 0x001a, 0xd98d, 0xf497, 0xdfe5, 0xe0e5, 0x9591, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa097, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1e5, 0x5497, 0x001a, 0x001a, 0xe2e5, 0xe3e5, 0x001a, 0x001a, 0xe295, 0xe4e5, 0x001a, 0xbe8d, 0x001a, 0xa197, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeae5, 0xd68f, 0xe8e5, 0x86ee, 0x001a, 0x001a, 0x8797, 0xe5e5, 0x001a, 0x001a, 0xe7e5, 0xbb90, 0x9e90, 0x001a, 0x001a, 0x001a, 0xe6e5, 0x001a, 0xebe5, 0x001a, 0x001a, 0xa195, 0x001a, 0x001a, 0xede5, 0x001a, 0xece5, 0x001a, 0x001a, 0x001a, 0x8c8a, 0x001a, 0x4a96, 0xeee5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x41ed, 0xfae5, 0xf0e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e5, 0x001a, 0x001a, 0x001a, 0x001a, 0xf2e5, 0xf3e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e5, 0x001a, 0xf8e5, 0x001a, 0x001a, 0xf6e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e5, 0x001a, 0xefe5, 0xf5e5, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e5, 0xb5e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa689, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfce5, 0xdd8b, 0xfbe5, 0x001a, 0x001a, 0x001a, 0x41e6, 0x001a, 0x40e6, 0x001a, 0x001a, 0x001a, 0x43e6, 0x001a, 0x001a, 0x42e6, 0x001a, 0x44e6, 0x001a, 0x001a, 0x508f, 0x001a, 0x45e6, 0x001a, 0x001a, 0x46e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x47e6, 0xbc90, 0x001a, 0x7697, 0x001a, 0x48e6, 0x001a, 0x001a, 0xa295, 0x6594, 0x49e6, 0x001a, 0x4ae6, 0xa98c, 0x001a, 0x001a, 0x001a, 0x4b8b, 0x001a, 0x001a, 0x001a, 0x4be6, 0x001a, 0x001a, 0x8b8e, 0x6094, 0x4ce6, 0x001a, 0x6f8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4de6, 0x001a, 0x001a, 0x001a, 0x001a, 0x4fe6, 0x9797, 0x001a, 0x4ee6, 0x6590, 0x001a, 0x50e6, 0x001a, 0x001a, 0x51e6, 0x001a, 0x001a, 0x52e6, 0xcf8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x53e6, 0x001a, 0x001a, 0x54e6, 0x001a, 0x55e6, 0x56e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x708a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x57e6, 0x001a, 0x58e6, 0x59e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf089, 0x001a, 0x001a, 0x4790, 0x5ae6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5be6, 0x001a, 0x001a, 0x001a, 0x5ce6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbe8c, 0x001a, 0xf992, 0x5de6, 0x001a, 0x001a, 0x001a, 0x001a, 0x768c, 0x001a, 0x7590, 0x001a, 0x60e6, 0x001a, 0xa293, 0x001a, 0x5fe6, 0x001a, 0x87ee, 0x508c, 0x001a, 0x001a, 0x5ee6, 0xf591, 0x4c8b, 0x001a, 0x001a, 0x61e6, 0x001a, 0x62e6, 0x001a, 0xd78f, 0x001a, 0x001a, 0x001a, 0x8d8c, 0x001a, 0x63e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x4b96, 0x001a, 0x001a, 0xdd90, 0x001a, 0x001a, 0x001a, 0x968b, 0x001a, 0xf396, 0x6991, 0x001a, 0x64e6, 0x88ee, 0x001a, 0x001a, 0x6690, 0x9092, 0xd88f, 0x001a, 0x001a, 0x001a, 0x001a, 0x65e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x68e6, 0x001a, 0x69e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbc8d, 0xc091, 0x67e6, 0x001a, 0xd98f, 0x5d95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x66e6, 0x001a, 0x001a, 0x8c8e, 0x001a, 0x7289, 0x001a, 0x6de6, 0x778c, 0x001a, 0x001a, 0x8e8e, 0x001a, 0x001a, 0x8d8e, 0x001a, 0x6c98, 0x6ce6, 0x6be6, 0x4691, 0x001a, 0x6c8b, 0x6298, 0x598a, 0xda8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x89ee, 0x001a, 0x001a, 0x6ae6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6fe6, 0x001a, 0x70e6, 0x6ee6, 0x001a, 0xd68c, 0x001a, 0x5f97, 0x001a, 0x001a, 0x8f8e, 0x4694, 0x001a, 0x001a, 0x001a, 0x73e6, 0x001a, 0xbe90, 0x001a, 0x6192, 0x001a, 0x001a, 0x5597, 0x001a, 0x76e6, 0x001a, 0x001a, 0x001a, 0xea8c, 0x001a, 0xbd90, 0x72e6, 0x001a, 0x77e6, 0xeb8c, 0x74e6, 0x75e6, 0x8aee, 0x71e6, 0x001a, 0x001a, 0x001a, 0xe090, 0xc793, 0x001a, 0x001a, 0x4e92, 0x001a, 0xdb89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xee94, 0x001a, 0x001a, 0x628b, 0x001a, 0x8bee, 0xb292, 0x001a, 0x001a, 0x7ae6, 0x001a, 0x78e6, 0x001a, 0x001a, 0x6b92, 0x001a, 0x001a, 0x001a, 0xbf90, 0xd08a, 0x79e6, 0x001a, 0x7a90, 0x001a, 0x001a, 0xc897, 0x001a, 0x001a, 0x001a, 0x5f98, 0x001a, 0x001a, 0x001a, 0x7be6, 0x87e6, 0xb392, 0x001a, 0x86e6, 0x8cee, 0x83e6, 0x8be6, 0x84e6, 0x001a, 0x80e6, 0x001a, 0xfa92, 0x7ee6, 0x001a, 0x001a, 0x001a, 0x7ce6, 0x001a, 0x4097, 0x908e, 0x001a, 0x001a, 0x81e6, 0x001a, 0x7de6, 0x001a, 0x001a, 0x8eee, 0x85e6, 0x948f, 0x001a, 0xbf8c, 0x001a, 0x001a, 0x001a, 0xf891, 0x001a, 0x6496, 0x7989, 0xe088, 0x001a, 0xa393, 0x001a, 0x001a, 0x89e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x88e6, 0x001a, 0xe493, 0x001a, 0x8de6, 0x001a, 0x001a, 0x001a, 0x82e6, 0x001a, 0x8ce6, 0x8ee6, 0x001a, 0xaa8c, 0x8ae6, 0x758d, 0x001a, 0xd38e, 0x001a, 0x001a, 0x8fe6, 0x7797, 0x001a, 0x001a, 0x001a, 0x001a, 0x92e6, 0x001a, 0x95e6, 0x001a, 0x001a, 0x93e6, 0x5495, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x90e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xde8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x94e6, 0x001a, 0x001a, 0x96e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9ae6, 0x001a, 0x001a, 0x97e6, 0x001a, 0x99e6, 0x98e6, 0x001a, 0x001a, 0x001a, 0x8fee, 0x001a, 0x001a, 0x9be6, 0x001a, 0xaf8e, 0x001a, 0x9de6, 0x9ce6, 0x8895, 0x001a, 0x001a, 0x9fe6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x788c, 0x001a, 0x001a, 0x001a, 0x001a, 0x9ee6, 0xa0e6, 0x001a, 0x001a, 0xa1e6, 0x638b, 0xbfe3, 0xf78f, 0x001a, 0xa2e6, 0x001a, 0x001a, 0xec8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e6, 0x001a, 0x90ee, 0xa4e6, 0x001a, 0x001a, 0x5d8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcc9d, 0x001a, 0xa5e6, 0x001a, 0xa6e6, 0x001a, 0x518f, 0x001a, 0xa7e6, 0xa8e6, 0x001a, 0x001a, 0xa9e6, 0x001a, 0x001a, 0xaae6, 0xabe6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4a92, 0x001a, 0x001a, 0xace6, 0x001a, 0x001a, 0x001a, 0x001a, 0xaee6, 0x001a, 0xade6, 0x001a, 0x001a, 0x001a, 0x001a, 0xa493, 0x001a, 0xafe6, 0x001a, 0x4c96, 0x001a, 0xb0e6, 0x001a, 0xb1e6, 0x001a, 0xb2e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xb3e6, 0x001a, 0x001a, 0x001a, 0x001a, 0xd893, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdb8f, 0xb4e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8b8d, 0xac98, 0xb5e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e6, 0x5e95, 0xb7e6, 0x001a, 0xbfe6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb8e6, 0x001a, 0x001a, 0xbae6, 0x001a, 0x001a, 0x001a, 0xb9e6, 0xbbe6, 0x001a, 0x6596, 0xbce6, 0xbde6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee6, 0x001a, 0x001a, 0x001a, 0xc0e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x4c8a, 0xe592, 0x001a, 0x8995, 0xe08d, 0x768d, 0x001a, 0x001a, 0x001a, 0x001a, 0x6e95, 0xdd89, 0xcc94, 0xc3e6, 0xd18a, 0xd390, 0xc2e6, 0xc7e6, 0x9992, 0xe196, 0x001a, 0xc5e6, 0xc6e6, 0x4d8b, 0x001a, 0xc8e6, 0x8394, 0xdd91, 0x001a, 0x001a, 0xef94, 0x5c93, 0xc4e6, 0x001a, 0x6696, 0xea89, 0xcae6, 0x4798, 0xc092, 0x6498, 0x001a, 0x001a, 0x918e, 0xc9e6, 0x001a, 0xaf91, 0x001a, 0x001a, 0xdae6, 0x4791, 0x001a, 0x001a, 0xf693, 0x001a, 0x6f95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde6, 0x5e8e, 0x928e, 0x001a, 0xdc8f, 0x001a, 0x8594, 0x001a, 0xab8c, 0xcce6, 0xcbe6, 0x001a, 0x8a95, 0x001a, 0x001a, 0x001a, 0xbf8e, 0x001a, 0x001a, 0x7193, 0x001a, 0x001a, 0x91ee, 0x001a, 0x001a, 0x001a, 0x92ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcfe6, 0xd0e6, 0x778d, 0xcee6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd1e6, 0xd2e6, 0x001a, 0xd4e6, 0xa191, 0x001a, 0xd3e6, 0xe48a, 0x001a, 0xd6e6, 0x001a, 0xd5e6, 0xd7e6, 0x001a, 0x93ee, 0xd9e6, 0xdbe6, 0x001a, 0xdce6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd490, 0x001a, 0xcd8e, 0xdde6, 0x001a, 0x001a, 0x001a, 0x718a, 0x001a, 0xdee6, 0x001a, 0x001a, 0x9691, 0xdfe6, 0x001a, 0xe0e6, 0x8b95, 0x001a, 0x94ee, 0x4e8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1e6, 0x001a, 0x001a, 0x001a, 0xb492, 0x001a, 0x001a, 0x001a, 0x001a, 0x7a89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe2e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xef8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x9690, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xab91, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e6, 0x001a, 0x001a, 0x001a, 0xe4e6, 0x001a, 0x001a, 0x001a, 0xe3e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebe6, 0xe9e6, 0x001a, 0x001a, 0xe6e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe8e6, 0x001a, 0x001a, 0x001a, 0xe7e6, 0xeae6, 0x001a, 0x978b, 0x001a, 0xeee6, 0x001a, 0xd590, 0x001a, 0xefe6, 0x001a, 0x001a, 0x001a, 0x001a, 0xd78c, 0x001a, 0xece6, 0xede6, 0x001a, 0x001a, 0x001a, 0x4898, 0x001a, 0x001a, 0x001a, 0xb592, 0x001a, 0x4891, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf0e6, 0x001a, 0x001a, 0xf3e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf1e6, 0xf2e6, 0x7897, 0x001a, 0x001a, 0x001a, 0x001a, 0xa593, 0xf6e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e6, 0xf5e6, 0xf7e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x48e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfae6, 0x001a, 0x001a, 0x001a, 0xfbe6, 0xf9e6, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf8e6, 0x001a, 0xfb92, 0x001a, 0x001a, 0x40e7, 0x44e7, 0x41e7, 0xfce6, 0x001a, 0x42e7, 0x001a, 0x001a, 0x001a, 0x43e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ae7, 0x001a, 0x001a, 0x001a, 0x45e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd690, 0x47e7, 0x001a, 0x001a, 0x49e7, 0x46e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ce7, 0x001a, 0x528f, 0x001a, 0x4be7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4de7, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ee7, 0x001a, 0x001a, 0x51e7, 0x50e7, 0x001a, 0x4fe7, 0x001a, 0x001a, 0x53e7, 0x52e7, 0x001a, 0xf496, 0x001a, 0x001a, 0x001a, 0x55e7, 0x001a, 0x54e7, 0x56e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x57e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x59e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x58e7, 0x6790, 0x5ae7, 0x001a, 0x001a, 0xeb8b, 0x5be7, 0x5de7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ee7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5fe7, 0x5ce7, 0x001a, 0x60e7, 0x001a, 0xd48e, 0x61e7, 0x4f8b, 0x528c, 0x001a, 0x96ee, 0x001a, 0x001a, 0xac8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62e7, 0x001a, 0x001a, 0x001a, 0xee93, 0x001a, 0x001a, 0x5d93, 0x63e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x66e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb28e, 0x001a, 0x001a, 0x65e7, 0x64e7, 0x798c, 0x67e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x728a, 0x001a, 0x69e7, 0x001a, 0x001a, 0x001a, 0xda8d, 0x68e7, 0x001a, 0x71e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6be7, 0x6de7, 0xe395, 0x6ae7, 0x001a, 0x001a, 0x001a, 0x6ce7, 0x001a, 0x70e7, 0x6ee7, 0x508b, 0x001a, 0x6fe7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x72e7, 0x001a, 0x001a, 0x7994, 0xd697, 0x001a, 0x001a, 0x001a, 0x001a, 0x538f, 0x001a, 0x001a, 0x001a, 0x73e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x4197, 0x75e7, 0x001a, 0x74e7, 0x001a, 0x001a, 0x78e7, 0x6097, 0x001a, 0x001a, 0x77e7, 0x001a, 0x8d8a, 0x76e7, 0x7be7, 0x001a, 0x001a, 0x7ae7, 0x001a, 0x001a, 0x79e7, 0x5193, 0x7ce7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7de7, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ee7, 0x001a, 0x001a, 0x8c8d, 0x001a, 0x448c, 0x80e7, 0x81e7, 0x82e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6890, 0x83e7, 0x001a, 0xab8e, 0x84e7, 0x001a, 0x001a, 0x001a, 0x85e7, 0x001a, 0x001a, 0x001a, 0x9f99, 0x9e99, 0x001a, 0x001a, 0x001a, 0x001a, 0x86e7, 0x90e3, 0x87e7, 0x4392, 0x4a90, 0x5f94, 0x001a, 0x001a, 0x001a, 0x001a, 0x88e7, 0x001a, 0x001a, 0xd395, 0xd292, 0x9e8d, 0x001a, 0x001a, 0x4892, 0x001a, 0x001a, 0x4989, 0x001a, 0x9896, 0x7690, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7d8c, 0x001a, 0x001a, 0xdf8b, 0x001a, 0x001a, 0xd495, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x89e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8be7, 0x001a, 0x001a, 0x8ae7, 0xde89, 0x001a, 0x001a, 0xf493, 0x8ce7, 0x9794, 0x001a, 0x5293, 0x001a, 0x8de7, 0x718f, 0x001a, 0x001a, 0x001a, 0x8fe7, 0x001a, 0x001a, 0xc096, 0x9ee7, 0x91e7, 0x92e7, 0x001a, 0x001a, 0xc792, 0x001a, 0x001a, 0xde91, 0x9791, 0x001a, 0xa693, 0x001a, 0x90e7, 0x748b, 0x001a, 0x001a, 0x001a, 0x001a, 0x99e7, 0x001a, 0x96e7, 0xa3e7, 0xa793, 0x8092, 0x93e7, 0x001a, 0xfc92, 0x7293, 0x94e7, 0x98e7, 0x8090, 0x001a, 0x8794, 0xca92, 0x001a, 0x001a, 0xc090, 0x97e7, 0xac91, 0xa291, 0x95e7, 0xa788, 0x4198, 0x001a, 0x001a, 0x001a, 0x9ae7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf91, 0x001a, 0x001a, 0x548f, 0x6990, 0x001a, 0x001a, 0x9ce7, 0x9be7, 0x001a, 0xed88, 0x9de7, 0x001a, 0x001a, 0x4e95, 0x001a, 0xa5e7, 0x001a, 0x001a, 0xd993, 0x8b90, 0x001a, 0x001a, 0x7892, 0x001a, 0xf68b, 0x001a, 0xa4e7, 0x5697, 0x5e89, 0x001a, 0xd595, 0xdf89, 0x9fe7, 0xa0e7, 0xa1e7, 0xa2e7, 0xb993, 0x4292, 0xe188, 0xa6e7, 0x001a, 0xa7e7, 0xa1ea, 0x001a, 0x001a, 0xbb91, 0x001a, 0xa8e7, 0x001a, 0x9389, 0x6b91, 0x001a, 0xad8c, 0x001a, 0x7997, 0x001a, 0x99ee, 0xa9e7, 0x4b93, 0x001a, 0x001a, 0x001a, 0x9891, 0xd58e, 0xaae7, 0x001a, 0x001a, 0xade7, 0x001a, 0x001a, 0x858f, 0xabe7, 0x4a91, 0x4991, 0x001a, 0xe288, 0x001a, 0xc997, 0xafe7, 0x001a, 0xf094, 0xb1e7, 0xb0e7, 0xaee7, 0x84e2, 0xd28a, 0x001a, 0x001a, 0x8ee7, 0x001a, 0xb3e7, 0xb2e7, 0x001a, 0x001a, 0x001a, 0x001a, 0xb4e7, 0x001a, 0x5797, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdf93, 0x001a, 0x001a, 0x4d96, 0x001a, 0xb5e7, 0x001a, 0xd78e, 0x001a, 0x001a, 0x001a, 0x001a, 0xb6e7, 0x001a, 0xb7e7, 0x001a, 0x001a, 0x001a, 0xb8e7, 0x001a, 0x001a, 0x4093, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe888, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x788d, 0x001a, 0x001a, 0x001a, 0x5998, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbce7, 0x001a, 0x001a, 0x9aee, 0x001a, 0x001a, 0x538c, 0xb9e7, 0x001a, 0xbae7, 0x001a, 0x001a, 0x001a, 0x9495, 0x001a, 0x001a, 0x001a, 0x001a, 0x738a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5897, 0x001a, 0xbd8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7393, 0x001a, 0x001a, 0x001a, 0x001a, 0xbde7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbee7, 0x001a, 0x001a, 0x9cee, 0x001a, 0x001a, 0x001a, 0xbfe7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9dee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4193, 0x001a, 0x001a, 0xc1e7, 0x001a, 0xc0e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd193, 0xc2e7, 0x558f, 0xde8e, 0x7a94, 0x9192, 0x001a, 0x001a, 0x001a, 0xf08e, 0x001a, 0x8c90, 0x001a, 0xc3e7, 0x001a, 0xc4e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7c90, 0xc5e7, 0x001a, 0xc6e7, 0x001a, 0x001a, 0x001a, 0xc7e7, 0x8f97, 0x001a, 0x568f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9e7, 0xc8e7, 0x001a, 0x798d, 0x001a, 0x938d, 0x5f8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcce7, 0x001a, 0x001a, 0x001a, 0x001a, 0x868f, 0x001a, 0xcbe7, 0x001a, 0xcae7, 0x001a, 0xe791, 0x001a, 0x001a, 0xed8c, 0x001a, 0xc190, 0x001a, 0x001a, 0x001a, 0x001a, 0xae94, 0x001a, 0x001a, 0x001a, 0x001a, 0x588f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcde7, 0x001a, 0xdd8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0e7, 0xcee7, 0x001a, 0x001a, 0x001a, 0xcfe7, 0x001a, 0x001a, 0x001a, 0x001a, 0xd2e7, 0xd1e7, 0x001a, 0x001a, 0xf88f, 0x001a, 0xd3e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd4e7, 0xd5e7, 0x001a, 0x001a, 0x001a, 0x001a, 0xce94, 0xd18d, 0xdf8e, 0xd6e7, 0x001a, 0xd7e7, 0xa297, 0x648f, 0xec96, 0xca97, 0xd8e7, 0xe08b, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e7, 0x9fee, 0x4293, 0x001a, 0x9eee, 0xdce7, 0x988a, 0x6a90, 0xa0ee, 0xdae7, 0x001a, 0xdbe7, 0x001a, 0xde92, 0xa3ee, 0xa4ee, 0x7496, 0xfa8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1ee, 0xa2ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdee7, 0xdfe7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde7, 0x001a, 0x001a, 0xe1e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa5ee, 0x001a, 0x001a, 0x001a, 0xa7ee, 0x001a, 0x001a, 0xdd93, 0x628a, 0x001a, 0xa6ee, 0xe5e7, 0x001a, 0x001a, 0xe2e7, 0xe4e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe0e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ee8, 0x001a, 0x001a, 0xe3e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe997, 0x001a, 0x001a, 0xd88c, 0x001a, 0xaeee, 0xa8ee, 0x001a, 0xaaee, 0x001a, 0x001a, 0xede7, 0xa9ee, 0x001a, 0x001a, 0x001a, 0x5393, 0xe8e7, 0x001a, 0x001a, 0xebe7, 0xe9e7, 0x001a, 0xeee7, 0x001a, 0x001a, 0xabee, 0x001a, 0xefe7, 0xadee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7e7, 0x001a, 0xacee, 0xf4e7, 0x9489, 0x001a, 0x001a, 0xe6e7, 0x001a, 0x001a, 0x001a, 0xab94, 0x001a, 0xeae7, 0x001a, 0xde8f, 0xafee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7a8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1ee, 0xb2ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6796, 0x001a, 0xe28b, 0x001a, 0x001a, 0x658f, 0x001a, 0xba93, 0x001a, 0x001a, 0x43ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4c91, 0x001a, 0xf2e7, 0x001a, 0xece7, 0xf1e7, 0x001a, 0xc196, 0x001a, 0xb692, 0xf3e7, 0xf0e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb0ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4b91, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e7, 0x001a, 0xf6e7, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf5e7, 0xb6ee, 0x001a, 0x4e96, 0xbaee, 0x001a, 0xb8ee, 0x001a, 0xb4ee, 0x001a, 0xb5ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb9ee, 0x001a, 0x001a, 0x001a, 0x9b8f, 0x001a, 0x001a, 0xb3ee, 0x001a, 0xf8e7, 0xdd95, 0x001a, 0x001a, 0x7389, 0x001a, 0x001a, 0x001a, 0x001a, 0x6595, 0x9292, 0x001a, 0x001a, 0x001a, 0x001a, 0x988b, 0x49ed, 0xfae7, 0xbdee, 0x7c8d, 0x001a, 0x001a, 0xc0ee, 0x001a, 0x001a, 0xc2ee, 0x001a, 0x001a, 0x001a, 0x4b8e, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e7, 0x8d90, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8e90, 0x40e8, 0x42e8, 0x001a, 0x001a, 0xc1ee, 0xbfee, 0x001a, 0xf98f, 0xbcee, 0x41e8, 0x43e8, 0x001a, 0xbbee, 0xd18b, 0x001a, 0x6495, 0x001a, 0x001a, 0xe08e, 0x4298, 0x001a, 0xfce7, 0xf68d, 0x001a, 0x001a, 0x5e98, 0x001a, 0x001a, 0x45e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x44e8, 0x46e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xfbe7, 0x001a, 0x001a, 0x001a, 0x42ed, 0x001a, 0x001a, 0xe793, 0x001a, 0x7493, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd592, 0x001a, 0x4be8, 0xc4ee, 0x001a, 0x001a, 0x001a, 0x6292, 0x47e8, 0x001a, 0x001a, 0x001a, 0x48e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4c8c, 0x001a, 0x4ae8, 0x001a, 0xc3ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xae8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x49e8, 0x001a, 0xdf8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x998a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4fe8, 0x001a, 0xbd8d, 0x9991, 0x001a, 0x001a, 0xc892, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5ee, 0x001a, 0x001a, 0x5a8a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4de8, 0x4ee8, 0xc192, 0x001a, 0x4ce8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x50e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56e8, 0x001a, 0x001a, 0xc6ee, 0x001a, 0x59e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x58e8, 0x4c93, 0x001a, 0x001a, 0x001a, 0x001a, 0x51e8, 0x52e8, 0x55e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x57e8, 0xc7ee, 0x001a, 0x001a, 0xbe8b, 0x001a, 0x001a, 0x5ae8, 0x54e8, 0x001a, 0x001a, 0x53e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc8ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5ee8, 0x001a, 0x001a, 0x001a, 0x5fe8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x60e8, 0x001a, 0x001a, 0x5de8, 0x5ce8, 0x001a, 0x001a, 0x001a, 0xe08f, 0xa893, 0x5be8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x64e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc9ee, 0x001a, 0x001a, 0x001a, 0x63e8, 0x61e8, 0x001a, 0xf691, 0x001a, 0x65e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x66e8, 0x001a, 0x001a, 0x68e8, 0xcaee, 0x001a, 0x001a, 0xcbee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd38a, 0x67e8, 0xf896, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73e8, 0x69e8, 0x001a, 0x001a, 0x6ce8, 0x001a, 0x6ae8, 0x001a, 0x6be8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6de8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6fe8, 0x001a, 0x001a, 0x001a, 0x001a, 0x70e8, 0x001a, 0x71e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x74e8, 0x72e8, 0x75e8, 0x77e8, 0x001a, 0x76e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb792, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe596, 0x001a, 0x78e8, 0x4d91, 0x001a, 0x001a, 0x001a, 0x79e8, 0x001a, 0xc295, 0x7ae8, 0x4a8a, 0x001a, 0x001a, 0x001a, 0x5b89, 0x001a, 0xd58a, 0xccee, 0xd48a, 0x7be8, 0x001a, 0x7ce8, 0x001a, 0x7de8, 0x7ee8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x80e8, 0x001a, 0xd68a, 0x748a, 0x7d8d, 0xb494, 0x001a, 0x82e8, 0x81e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x83e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x7b89, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x86e8, 0x001a, 0x85e8, 0x84e8, 0x001a, 0x87e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x8ae8, 0x001a, 0x001a, 0x001a, 0xc588, 0x001a, 0x001a, 0x88e8, 0x001a, 0x8ce8, 0x8be8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8ee8, 0x8de8, 0x8fe8, 0x001a, 0xac93, 0x001a, 0x001a, 0x001a, 0x90e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x91e8, 0x93e8, 0x001a, 0x001a, 0x92e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8c95, 0x001a, 0x001a, 0x001a, 0x001a, 0x94e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x95e8, 0x001a, 0xe38d, 0x001a, 0x001a, 0x001a, 0x96e8, 0x97e8, 0x001a, 0x001a, 0x6896, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6a91, 0x001a, 0x001a, 0x001a, 0xa288, 0xc991, 0x001a, 0x98e8, 0x001a, 0x8d95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9be8, 0x99e8, 0x7e8d, 0x001a, 0x9ae8, 0xc08c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc395, 0x9de8, 0x9fe8, 0x9ee8, 0xa0e8, 0x001a, 0x001a, 0x4089, 0x7790, 0x9c8f, 0xd78a, 0xa1e8, 0x001a, 0x001a, 0x001a, 0x8694, 0x001a, 0xa3e8, 0x001a, 0x001a, 0x001a, 0x4189, 0x001a, 0xa2e8, 0xc292, 0x001a, 0xcb97, 0xa993, 0x9ce8, 0xa497, 0x001a, 0xaf8c, 0x001a, 0x001a, 0x7a97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf78b, 0xb297, 0x001a, 0x478c, 0x001a, 0xe091, 0x40e4, 0x001a, 0xa4e8, 0x4b8a, 0x8f90, 0x001a, 0x001a, 0x001a, 0x001a, 0x758a, 0xa6e8, 0x001a, 0xa7e8, 0xa5e8, 0x848c, 0x001a, 0xdb8d, 0xe18f, 0xcfee, 0x001a, 0x001a, 0x4289, 0x001a, 0x001a, 0xd797, 0x001a, 0x001a, 0x001a, 0xa9e8, 0xace7, 0x001a, 0xa8e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xd0ee, 0xace8, 0xaae8, 0xabe8, 0x001a, 0xade8, 0x001a, 0xaee8, 0xea97, 0xafe8, 0xb0e8, 0x001a, 0xc790, 0xb994, 0x001a, 0x001a, 0x001a, 0x9d90, 0xe58a, 0x001a, 0x001a, 0x5997, 0xeb89, 0x578f, 0xd98c, 0x001a, 0xb3e8, 0x001a, 0xb2e8, 0x938e, 0xb4e8, 0xb1e8, 0x001a, 0x001a, 0x478e, 0x001a, 0x001a, 0x001a, 0xb8e8, 0xabe5, 0x001a, 0x001a, 0xd499, 0x001a, 0x9790, 0xb6e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa397, 0xef93, 0x001a, 0x001a, 0x001a, 0x001a, 0x4a89, 0x001a, 0xe190, 0xb48e, 0x001a, 0x001a, 0x001a, 0x001a, 0xb595, 0x001a, 0x5f89, 0x001a, 0x001a, 0x001a, 0xeb97, 0x8b97, 0x001a, 0xb9e8, 0x001a, 0x6493, 0x001a, 0x001a, 0x001a, 0x001a, 0xf98e, 0x001a, 0x001a, 0x001a, 0xbae8, 0x001a, 0xbbe8, 0x6b90, 0xbce8, 0x001a, 0xec97, 0x001a, 0x001a, 0xb7e8, 0xbee8, 0xc0e8, 0x001a, 0xbfe8, 0x001a, 0xbde8, 0x001a, 0x001a, 0xc1e8, 0x001a, 0x001a, 0xc2e8, 0x001a, 0x001a, 0x9a91, 0x001a, 0xe089, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3e8, 0x001a, 0x001a, 0xb696, 0x001a, 0x001a, 0xc4e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc5e8, 0x001a, 0x4998, 0xd1ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x509e, 0xc6e8, 0x001a, 0xd2ee, 0x001a, 0xc7e8, 0xc8e8, 0x001a, 0x001a, 0x001a, 0xcce8, 0xd3ee, 0xc9e8, 0x001a, 0xcae8, 0x001a, 0xcbe8, 0xcde8, 0x001a, 0x001a, 0x001a, 0xd4ee, 0x001a, 0xd5ee, 0x001a, 0xd6ee, 0xc290, 0x001a, 0x001a, 0xd7ee, 0xf596, 0x001a, 0x001a, 0xc390, 0x001a, 0x001a, 0xcee8, 0x001a, 0xf194, 0x001a, 0xcfe8, 0x72ea, 0xca96, 0x001a, 0xd0e8, 0x001a, 0xd1e8, 0x001a, 0xd2e8, 0x768a, 0x001a, 0xd4e8, 0x001a, 0x7890, 0x001a, 0x001a, 0x001a, 0xd5e8, 0x001a, 0x001a, 0x438c, 0x001a, 0x001a, 0x001a, 0x001a, 0xd6e8, 0xdae8, 0x001a, 0xd8e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9e8, 0x001a, 0x001a, 0x938a, 0xd7e8, 0xdbe8, 0x001a, 0x001a, 0x001a, 0x001a, 0xdce8, 0x001a, 0xc688, 0x001a, 0xdde8, 0xdee8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe28f, 0x001a, 0x001a, 0x001a, 0xdfe8, 0x001a, 0x001a, 0x001a, 0x668b, 0x001a, 0x001a, 0xe2e8, 0x001a, 0x001a, 0xe1e8, 0x001a, 0xe0e8, 0x001a, 0x001a, 0x91e6, 0x001a, 0xda95, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe3e8, 0xe4e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e8, 0x001a, 0x001a, 0xe6e8, 0x001a, 0xe7e8, 0x001a, 0x001a, 0xe8e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd88a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeae8, 0x4294, 0x001a, 0x001a, 0x001a, 0xece8, 0xb989, 0x001a, 0xefe8, 0xeee8, 0x001a, 0x001a, 0x001a, 0x001a, 0x4389, 0x001a, 0x001a, 0x001a, 0xbf8b, 0x001a, 0xc595, 0xb892, 0xa08d, 0x001a, 0x808d, 0x878f, 0x001a, 0x7b90, 0x001a, 0x001a, 0x001a, 0xf1e8, 0x001a, 0x001a, 0xf0e8, 0x6197, 0xe68a, 0xd094, 0xda93, 0x001a, 0x001a, 0x001a, 0x9c90, 0xcc97, 0x001a, 0x7a8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf4e8, 0x001a, 0x001a, 0xf3e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6a96, 0xaa93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6f89, 0x001a, 0x001a, 0xf5e8, 0xf2e8, 0x001a, 0x001a, 0x7095, 0x8a97, 0xf6e8, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf7e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xf9e8, 0xe891, 0x7a8a, 0x7b8a, 0xf8e8, 0x001a, 0x001a, 0x001a, 0x001a, 0xe78a, 0xb08c, 0x001a, 0xd8ee, 0xe88a, 0x001a, 0x001a, 0x5e93, 0x001a, 0x001a, 0xde97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xd9ee, 0x001a, 0xda8c, 0x001a, 0x001a, 0x001a, 0xfae8, 0x001a, 0x001a, 0x001a, 0xfbe8, 0xfce8, 0x40e9, 0x001a, 0x42e9, 0x41e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9795, 0x001a, 0x43e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x44e9, 0x001a, 0x45e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x46e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x48e9, 0x47e9, 0x001a, 0x49e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf294, 0xcae3, 0x001a, 0x001a, 0x4890, 0x001a, 0x001a, 0x518b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ae9, 0x001a, 0x4be9, 0x001a, 0xaa99, 0x5a9f, 0xd194, 0x001a, 0x001a, 0xf988, 0x001a, 0xb988, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x948e, 0x4f96, 0xfc8f, 0x001a, 0x001a, 0x001a, 0x001a, 0x4ce9, 0x001a, 0xdd96, 0x001a, 0x001a, 0x001a, 0x4de9, 0x7b97, 0x001a, 0x6189, 0x001a, 0x001a, 0x001a, 0x608e, 0x001a, 0x4ee9, 0xec89, 0x4fe9, 0x001a, 0x001a, 0x001a, 0x50e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x52e9, 0x53e9, 0x001a, 0x55e9, 0x51e9, 0x001a, 0x001a, 0x54e9, 0x001a, 0x001a, 0xdcee, 0xd98a, 0x001a, 0x001a, 0x001a, 0x56e9, 0x001a, 0x57e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x58e9, 0x59e9, 0x001a, 0x001a, 0x001a, 0x5ae9, 0x001a, 0x001a, 0x5ce9, 0x001a, 0x001a, 0x001a, 0x5be9, 0x001a, 0x5ee9, 0x61e9, 0x001a, 0x001a, 0x001a, 0x5de9, 0x5fe9, 0x60e9, 0x001a, 0x001a, 0x62e9, 0x001a, 0xc08b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf18e, 0x63e9, 0x64e9, 0x818d, 0x001a, 0x001a, 0x001a, 0x001a, 0xdeee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x65e9, 0x001a, 0x001a, 0x5d8a, 0x001a, 0x001a, 0x001a, 0x6e94, 0x66e9, 0x67e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x7992, 0xe993, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x68e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x9d94, 0x001a, 0x001a, 0xca91, 0x7789, 0xec8b, 0x001a, 0xed8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9392, 0x6de9, 0xee8b, 0x001a, 0x001a, 0xed89, 0x001a, 0x001a, 0x6ce9, 0x001a, 0x001a, 0x6ae9, 0x001a, 0x6be9, 0x001a, 0x69e9, 0x001a, 0x001a, 0x77e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6ee9, 0x6fe9, 0x001a, 0x001a, 0x70e9, 0x71e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73e9, 0x001a, 0x001a, 0x72e9, 0x001a, 0x001a, 0x001a, 0x788f, 0x001a, 0x74e9, 0x001a, 0x001a, 0x001a, 0x76e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x528b, 0x75e9, 0x001a, 0x001a, 0x9b91, 0xb18c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x78e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcb91, 0x001a, 0x001a, 0x79e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xab93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7ae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x80e9, 0x001a, 0x7de9, 0x001a, 0x7ce9, 0x7ee9, 0x001a, 0x7be9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x82e9, 0xdfee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x81e9, 0x001a, 0x84e9, 0x001a, 0x001a, 0xc18b, 0x83e9, 0x001a, 0x001a, 0x001a, 0x85e9, 0x001a, 0x001a, 0x86e9, 0x001a, 0x88e9, 0x87e9, 0x001a, 0x001a, 0x001a, 0x89e9, 0x8be9, 0x8ae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9c8d, 0x001a, 0x001a, 0x001a, 0x001a, 0x8ce9, 0x001a, 0x001a, 0x8de9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5b8a, 0x001a, 0x001a, 0x001a, 0x8ee9, 0x001a, 0x001a, 0x001a, 0x8fe9, 0x001a, 0x001a, 0x001a, 0x9190, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x90e9, 0x001a, 0x91e9, 0x001a, 0x92e9, 0x93e9, 0x001a, 0x001a, 0x001a, 0x828d, 0xe0ee, 0x001a, 0x001a, 0xe1ee, 0x001a, 0x94e9, 0x95e9, 0x001a, 0x001a, 0x96e9, 0x97e9, 0x001a, 0x001a, 0x98e9, 0x001a, 0x001a, 0x001a, 0xaf94, 0x9ae9, 0x001a, 0x4595, 0x9be9, 0x99e9, 0x001a, 0x9de9, 0x001a, 0x001a, 0x9ce9, 0x001a, 0x001a, 0x9ee9, 0x001a, 0x001a, 0x001a, 0x9fe9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa0e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xa1e9, 0x001a, 0xa2e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xa3e9, 0x001a, 0x001a, 0xa4e9, 0xa5e9, 0x001a, 0xa6e9, 0x001a, 0xa7e9, 0xa8e9, 0xa9e9, 0xaae9, 0x001a, 0x001a, 0x001a, 0xabe9, 0xace9, 0x001a, 0x549f, 0xade9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xf6e2, 0x538b, 0x001a, 0x001a, 0x001a, 0x001a, 0x408a, 0xb08d, 0xafe9, 0xaee9, 0xa396, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb1e9, 0xb2e9, 0xb0e9, 0x001a, 0xb3e9, 0x001a, 0x001a, 0x8296, 0x001a, 0x001a, 0x001a, 0xb4e9, 0x001a, 0x9b8b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4498, 0x001a, 0x001a, 0xe3ee, 0x001a, 0xb5e9, 0xe2ee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb7e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbc88, 0xe4ee, 0x001a, 0xb8e9, 0xa995, 0xb6e9, 0x001a, 0x001a, 0xb9e9, 0xbae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbbe9, 0xbce9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xbde9, 0x001a, 0x8e96, 0x4c8e, 0x001a, 0xf88d, 0x4e91, 0x001a, 0x001a, 0xe5ee, 0x001a, 0x001a, 0xbee9, 0x001a, 0x001a, 0x001a, 0x001a, 0xc1e9, 0x001a, 0xe6ee, 0x001a, 0x001a, 0x001a, 0x001a, 0xbfe9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc2e9, 0x001a, 0x001a, 0xef8c, 0xc0e9, 0x001a, 0x001a, 0x001a, 0x001a, 0xc3e9, 0x001a, 0xc4e9, 0xc5e9, 0x001a, 0xc9e9, 0x001a, 0x498e, 0x001a, 0x001a, 0x001a, 0x001a, 0xe291, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcae9, 0xc7e9, 0xc6e9, 0xc8e9, 0x001a, 0x001a, 0x001a, 0x7e8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcee9, 0xcde9, 0xcce9, 0x001a, 0x001a, 0xb188, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe7ee, 0x001a, 0x001a, 0x001a, 0xd8e9, 0x001a, 0xd4e9, 0x001a, 0xd5e9, 0xd1e9, 0xd7e9, 0x001a, 0xd3e9, 0x828a, 0x001a, 0x001a, 0x6b98, 0x001a, 0xd6e9, 0xd2e9, 0xd0e9, 0xcfe9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdae9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xdde9, 0x001a, 0x001a, 0xdce9, 0xdbe9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6895, 0xd9e9, 0xf188, 0xdee9, 0x001a, 0xe0e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8f8a, 0xcbe9, 0x5689, 0x001a, 0x001a, 0xe2e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe1e9, 0xdfe9, 0x4c92, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9096, 0x001a, 0x001a, 0x001a, 0x001a, 0xd897, 0x001a, 0x001a, 0xe3e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe4e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe5e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe6e9, 0x001a, 0xe7e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb992, 0x001a, 0xe8e9, 0x001a, 0xb594, 0x001a, 0xede9, 0xe9e9, 0x001a, 0x001a, 0x001a, 0xeae9, 0x001a, 0x001a, 0x5096, 0xc296, 0x001a, 0xce93, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xeee9, 0x001a, 0x001a, 0xefe9, 0xbc93, 0xece9, 0xebe9, 0x001a, 0x001a, 0x001a, 0x001a, 0xa889, 0x001a, 0x001a, 0x001a, 0xf7e9, 0x001a, 0x001a, 0xf6e9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9589, 0x001a, 0x001a, 0x001a, 0xf4e9, 0x001a, 0x001a, 0x001a, 0xf3e9, 0x001a, 0x001a, 0xf1e9, 0x001a, 0x9b8a, 0x001a, 0xf0e9, 0xb08e, 0xa789, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x838d, 0x001a, 0x001a, 0xfae9, 0xf9e9, 0x001a, 0xf8e9, 0x001a, 0x001a, 0xf5e9, 0x001a, 0xfbe9, 0x001a, 0xfce9, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x44ea, 0x43ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x45ea, 0x001a, 0x001a, 0x4c89, 0x40ea, 0x41ea, 0x001a, 0x948d, 0xb796, 0x001a, 0x001a, 0x42ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xe9ee, 0x5196, 0x001a, 0x001a, 0x4aea, 0xe8ee, 0x001a, 0x46ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4bea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x48ea, 0x001a, 0x47ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7b8c, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4cea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4dea, 0x001a, 0x001a, 0x001a, 0x001a, 0x4eea, 0x001a, 0x49ea, 0x001a, 0x001a, 0x001a, 0xf2e9, 0x001a, 0x001a, 0x4fea, 0x001a, 0xdf92, 0x001a, 0x001a, 0x001a, 0x53ea, 0x001a, 0x54ea, 0x52ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x51ea, 0x57ea, 0x001a, 0x50ea, 0x001a, 0x55ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x56ea, 0x001a, 0x001a, 0x001a, 0x59ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x58ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5bea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5cea, 0x001a, 0x5dea, 0x001a, 0x001a, 0x6898, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x5aea, 0xe991, 0xeb8d, 0x001a, 0x001a, 0x5eea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xebee, 0x5fea, 0x60ea, 0x001a, 0x001a, 0x61ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x62ea, 0x001a, 0x001a, 0xb28c, 0x63ea, 0x001a, 0x001a, 0x001a, 0x64ea, 0x001a, 0xad8e, 0x001a, 0x65ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x66ea, 0x001a, 0x001a, 0x67ea, 0x68ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x6bea, 0x69ea, 0x5b98, 0x001a, 0x6aea, 0x001a, 0xed97, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6cea, 0x001a, 0xd997, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6dea, 0x9e94, 0x001a, 0x001a, 0x6eea, 0x70ea, 0x001a, 0x001a, 0x71ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6fea, 0x8d8d, 0xcb96, 0x8396, 0xf59b, 0x001a, 0x809f, 0x9b96, 0x001a, 0x001a, 0x001a, 0x001a, 0xa989, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73ea, 0x6f8b, 0x74ea, 0x75ea, 0x76ea, 0xecee, 0x958d, 0x001a, 0x77ea, 0x001a, 0x001a, 0x001a, 0xd2e0, 0xd996, 0x001a, 0xe191, 0x78ea, 0x7aea, 0x79ea, 0x001a, 0x7bea, 0x001a, 0x001a, 0x001a, 0x001a, 0x7cea, 0x001a, 0x001a, 0x7dea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x7eea, 0x001a, 0x001a, 0x001a, 0x001a, 0x80ea, 0x001a, 0x81ea, 0x82ea, 0x001a, 0x83ea, 0x001a, 0x84ea, 0x85ea, 0x86ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x87ea, 0x88ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4393, 0x001a, 0x001a, 0x001a, 0x001a, 0xdb8c, 0x001a, 0x8aea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x6c91, 0x8bea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8cea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x4095, 0x001a, 0x001a, 0x8dea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x8eea, 0x56e2, 0x001a, 0x001a, 0xd8e6, 0xebe8, 0x001a, 0x001a, 0x8fea, 0x001a, 0x90ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x92ea, 0x93ea, 0x94ea, 0xee97, 0x91ea, 0x001a, 0x001a, 0x95ea, 0x96ea, 0x001a, 0x001a, 0x98ea, 0x001a, 0x97ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9aea, 0x001a, 0x001a, 0x001a, 0x9bea, 0x99ea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xb497, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9cea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9dea, 0x73e2, 0x001a, 0x001a, 0x9eea, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0xf900[ 320 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xc4ed, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0xcdee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x73ed, 0x7eed, 0x80ed, 0x95ed, 0xbced, 0xcced, 0xceed, 0xf9ed, 0x42ee, 0x59ee, 0x61ee, 0x62ee, 0x63ee, 0x65ee, 0x69ee, 0x6cee, 0x75ee, 0x81ee, 0x83ee, 0x84ee, 0x8dee, 0x95ee, 0x97ee, 0x98ee, 0x9bee, 0xb7ee, 0xbeee, 0xceee, 0xdaee, 0xdbee, 0xddee, 0xeaee, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0xff00[ 256 ] = { 0x001a, 0x4981, 0xfcee, 0x9481, 0x9081, 0x9381, 0x9581, 0xfbee, 0x6981, 0x6a81, 0x9681, 0x7b81, 0x4381, 0x7c81, 0x4481, 0x5e81, 0x4f82, 0x5082, 0x5182, 0x5282, 0x5382, 0x5482, 0x5582, 0x5682, 0x5782, 0x5882, 0x4681, 0x4781, 0x8381, 0x8181, 0x8481, 0x4881, 0x9781, 0x6082, 0x6182, 0x6282, 0x6382, 0x6482, 0x6582, 0x6682, 0x6782, 0x6882, 0x6982, 0x6a82, 0x6b82, 0x6c82, 0x6d82, 0x6e82, 0x6f82, 0x7082, 0x7182, 0x7282, 0x7382, 0x7482, 0x7582, 0x7682, 0x7782, 0x7882, 0x7982, 0x6d81, 0x5f81, 0x6e81, 0x4f81, 0x5181, 0x4d81, 0x8182, 0x8282, 0x8382, 0x8482, 0x8582, 0x8682, 0x8782, 0x8882, 0x8982, 0x8a82, 0x8b82, 0x8c82, 0x8d82, 0x8e82, 0x8f82, 0x9082, 0x9182, 0x9282, 0x9382, 0x9482, 0x9582, 0x9682, 0x9782, 0x9882, 0x9982, 0x9a82, 0x6f81, 0x6281, 0x7081, 0x6081, 0x001a, 0x001a, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x9181, 0x9281, 0xca81, 0x5081, 0xfaee, 0x8f81, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; /* Determines the size of a byte stream character from an Unicode character * Adds the size to the byte stream character size value * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_932_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_932_unicode_character_size_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream_character_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream character size.", function ); return( -1 ); } if( unicode_character < 0x0080 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x0380 ) && ( unicode_character < 0x0480 ) ) { unicode_character -= 0x0380; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0380[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2340 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x2440 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2440; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x2440[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3100 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x3200 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3200; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x3200[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fc0 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xf900 ) && ( unicode_character < 0xfa40 ) ) { unicode_character -= 0xf900; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0xf900[ unicode_character ]; } else if( ( unicode_character >= 0xff00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xff00; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0xff00[ unicode_character ]; } byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_character_size += 2; } else { *byte_stream_character_size += 1; } return( 1 ); } /* Copies an Unicode character from a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_932_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_932_copy_from_byte_stream"; uint8_t additional_character = 0; uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid Unicode character.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } byte_stream_character = byte_stream[ *byte_stream_index ]; if( byte_stream_character < 0x80 ) { *unicode_character = byte_stream_character; } else if( ( byte_stream_character >= 0xa1 ) && ( byte_stream_character < 0xe0 ) ) { *unicode_character = 0xff61 + byte_stream_character - 0xa1; } else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) { *byte_stream_index += 1; additional_character = byte_stream[ *byte_stream_index ]; if( byte_stream_character == 0x81 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xad ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8140[ additional_character ]; } else if( ( additional_character >= 0xb8 ) && ( additional_character < 0xc0 ) ) { additional_character -= 0xb8; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81b8[ additional_character ]; } else if( ( additional_character >= 0xc8 ) && ( additional_character < 0xcf ) ) { additional_character -= 0xc8; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81c8[ additional_character ]; } else if( ( additional_character >= 0xda ) && ( additional_character < 0xe9 ) ) { additional_character -= 0xda; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81da[ additional_character ]; } else if( ( additional_character >= 0xf0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xf0; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81f0[ additional_character ]; } else if( additional_character == 0xfc ) { *unicode_character = 0x25ef; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0x82 ) { if( ( additional_character >= 0x4f ) && ( additional_character < 0x59 ) ) { *unicode_character = 0xff10 - 0x4f + additional_character; } else if( ( additional_character >= 0x60 ) && ( additional_character < 0x7a ) ) { *unicode_character = 0xff21 - 0x60 + additional_character; } else if( ( additional_character >= 0x81 ) && ( additional_character < 0x9b ) ) { *unicode_character = 0xff41 - 0x81 + additional_character; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xf2 ) ) { *unicode_character = 0x3041 - 0x9f + additional_character; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0x83 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { *unicode_character = 0x30a1 - 0x40 + additional_character; } else if( ( additional_character >= 0x80 ) && ( additional_character < 0x97 ) ) { *unicode_character = 0x30e0 - 0x80 + additional_character; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xb0 ) ) { *unicode_character = 0x0391 - 0x9f + additional_character; } else if( ( additional_character >= 0xb0 ) && ( additional_character < 0xb7 ) ) { *unicode_character = 0x03a3 - 0xb0 + additional_character; } else if( ( additional_character >= 0xbf ) && ( additional_character < 0xd0 ) ) { *unicode_character = 0x03b1 - 0xbf + additional_character; } else if( ( additional_character >= 0xd0 ) && ( additional_character < 0xd7 ) ) { *unicode_character = 0x03c3 - 0xd0 + additional_character; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0x84 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x61 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8440[ additional_character ]; } else if( ( additional_character >= 0x70 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x70; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8470[ additional_character ]; } else if( ( additional_character >= 0x80 ) && ( additional_character < 0x92 ) ) { *unicode_character = 0x043e - 0x80 + additional_character; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xbf ) ) { additional_character -= 0x9f; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x849f[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0x87 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x54 ) ) { *unicode_character = 0x2460 - 0x40 + additional_character; } else if( ( additional_character >= 0x54 ) && ( additional_character < 0x5e ) ) { *unicode_character = 0x2160 - 0x54 + additional_character; } else if( ( additional_character >= 0x5f ) && ( additional_character < 0x76 ) ) { additional_character -= 0x5f; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x875f[ additional_character ]; } else if( additional_character == 0x7e ) { *unicode_character = 0x337b; } else if( ( additional_character >= 0x80 ) && ( additional_character < 0x9d ) ) { additional_character -= 0x80; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8780[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0x88 ) { if( ( additional_character >= 0x9f ) && ( additional_character < 0xfd ) ) { additional_character -= 0x9f; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x889f[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0x89 ) && ( byte_stream_character <= 0x97 ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xfd ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0x89: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8940[ additional_character ]; break; case 0x8a: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8a40[ additional_character ]; break; case 0x8b: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8b40[ additional_character ]; break; case 0x8c: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8c40[ additional_character ]; break; case 0x8d: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8d40[ additional_character ]; break; case 0x8e: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8e40[ additional_character ]; break; case 0x8f: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8f40[ additional_character ]; break; case 0x90: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9040[ additional_character ]; break; case 0x91: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9140[ additional_character ]; break; case 0x92: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9240[ additional_character ]; break; case 0x93: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9340[ additional_character ]; break; case 0x94: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9440[ additional_character ]; break; case 0x95: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9540[ additional_character ]; break; case 0x96: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9640[ additional_character ]; break; case 0x97: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9740[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0x98 ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x73 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9840[ additional_character ]; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xfd ) ) { additional_character -= 0x9f; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x989f[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0x99 ) && ( byte_stream_character <= 0x9f ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xfd ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0x99: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9940[ additional_character ]; break; case 0x9a: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9a40[ additional_character ]; break; case 0x9b: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9b40[ additional_character ]; break; case 0x9c: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9c40[ additional_character ]; break; case 0x9d: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9d40[ additional_character ]; break; case 0x9e: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9e40[ additional_character ]; break; case 0x9f: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9f40[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xe0 ) && ( byte_stream_character <= 0xe9 ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xfd ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xe0: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe040[ additional_character ]; break; case 0xe1: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe140[ additional_character ]; break; case 0xe2: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe240[ additional_character ]; break; case 0xe3: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe340[ additional_character ]; break; case 0xe4: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe440[ additional_character ]; break; case 0xe5: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe540[ additional_character ]; break; case 0xe6: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe640[ additional_character ]; break; case 0xe7: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe740[ additional_character ]; break; case 0xe8: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe840[ additional_character ]; break; case 0xe9: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe940[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xea ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xa5 ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xea40[ additional_character ]; } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xed ) && ( byte_stream_character <= 0xee ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xfd ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xed: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xed40[ additional_character ]; break; case 0xee: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xee40[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( ( byte_stream_character >= 0xfa ) && ( byte_stream_character <= 0xfb ) ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0xfd ) ) { additional_character -= 0x40; switch( byte_stream_character ) { case 0xfa: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfa40[ additional_character ]; break; case 0xfb: *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfb40[ additional_character ]; break; } } else { *unicode_character = 0xfffd; } } else if( byte_stream_character == 0xfc ) { if( ( additional_character >= 0x40 ) && ( additional_character < 0x4c ) ) { additional_character -= 0x40; *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfc40[ additional_character ]; } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } } else { *unicode_character = 0xfffd; } *byte_stream_index += 1; return( 1 ); } /* Copies an Unicode character to a byte stream * Returns 1 if successful or -1 on error */ int libuna_codepage_windows_932_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ) { static char *function = "libuna_codepage_windows_932_copy_to_byte_stream"; uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream too small.", function ); return( -1 ); } if( unicode_character < 0x0080 ) { byte_stream_value = (uint16_t) unicode_character; } else if( ( unicode_character >= 0x0080 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x0080; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0080[ unicode_character ]; } else if( ( unicode_character >= 0x0380 ) && ( unicode_character < 0x0480 ) ) { unicode_character -= 0x0380; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0380[ unicode_character ]; } else if( ( unicode_character >= 0x2000 ) && ( unicode_character < 0x2340 ) ) { unicode_character -= 0x2000; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x2000[ unicode_character ]; } else if( ( unicode_character >= 0x2440 ) && ( unicode_character < 0x2680 ) ) { unicode_character -= 0x2440; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x2440[ unicode_character ]; } else if( ( unicode_character >= 0x3000 ) && ( unicode_character < 0x3100 ) ) { unicode_character -= 0x3000; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x3000[ unicode_character ]; } else if( ( unicode_character >= 0x3200 ) && ( unicode_character < 0x3400 ) ) { unicode_character -= 0x3200; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x3200[ unicode_character ]; } else if( ( unicode_character >= 0x4e00 ) && ( unicode_character < 0x9fc0 ) ) { unicode_character -= 0x4e00; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0x4e00[ unicode_character ]; } else if( ( unicode_character >= 0xf900 ) && ( unicode_character < 0xfa40 ) ) { unicode_character -= 0xf900; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0xf900[ unicode_character ]; } else if( ( unicode_character >= 0xff00 ) && ( unicode_character < 0x10000 ) ) { unicode_character -= 0xff00; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0xff00[ unicode_character ]; } byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); byte_stream_value >>= 8; if( byte_stream_value != 0 ) { *byte_stream_index += 1; byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); } *byte_stream_index += 1; return( 1 ); } libewf-20140807/libuna/libuna_utf8_stream.h0000664000175000017500000000566313443450072022563 0ustar00lordyestalordyesta00000000000000/* * UTF-8 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF8_STREAM_H ) #define _LIBUNA_UTF8_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf8_stream_copy_byte_order_mark( uint8_t *utf8_stream, size_t utf8_stream_size, size_t *utf8_stream_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_stream_copy_from_utf8( uint8_t *utf8_stream, size_t utf8_stream_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_stream_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_utf8_stream */ LIBUNA_EXTERN \ int libuna_utf8_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_stream_copy_from_utf16( uint8_t *utf8_stream, size_t utf8_stream_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_stream_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_utf8_stream */ LIBUNA_EXTERN \ int libuna_utf8_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf8_stream_copy_from_utf32( uint8_t *utf8_stream, size_t utf8_stream_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf8_stream_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_utf8_stream */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF8_STREAM_H ) */ libewf-20140807/libuna/libuna_url_stream.h0000664000175000017500000000361313443450072022470 0ustar00lordyestalordyesta00000000000000/* * Percent or URL encoded stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_URL_STREAM_H ) #define _LIBUNA_URL_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_url_stream_size_from_byte_stream( uint8_t *byte_stream, size_t byte_stream_size, size_t *url_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_url_stream_copy_from_byte_stream( uint8_t *url_stream, size_t url_stream_size, uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_url_stream_size_to_byte_stream( uint8_t *url_stream, size_t url_stream_size, size_t *byte_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_url_stream_copy_to_byte_stream( uint8_t *url_stream, size_t url_stream_size, uint8_t *byte_stream, size_t byte_stream_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_URL_STREAM_H ) */ libewf-20140807/libuna/libuna_codepage_windows_949.h0000664000175000017500000000354713443450072024247 0ustar00lordyestalordyesta00000000000000/* * Windows 949 codepage (Korean) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_949_H ) #define _LIBUNA_CODEPAGE_WINDOWS_949_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_codepage_windows_949_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_949_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_codepage_windows_949_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_949_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_8.c0000664000175000017500000000510713443450072023653 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-8 codepage (Hebrew) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_8.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-8 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0xfffd, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2017, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0xfffd, 0xfffd, 0x200e, 0x200f, 0xfffd }; /* Unicode to ASCII character lookup table for ISO 8859-8 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0x1a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0x1a, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a }; const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ 32 ] = { 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_types.h0000664000175000017500000000276313443450072021464 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2008-2019, 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( _LIBUNA_INTERNAL_TYPES_H ) #define _LIBUNA_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna * The definitions in are copied here * for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) /* Unicode character definitions */ typedef uint32_t libuna_unicode_character_t; /* UTF-8 character definitions */ typedef uint8_t libuna_utf8_character_t; /* UTF-16 character definitions */ typedef uint16_t libuna_utf16_character_t; /* UTF-32 character definitions */ typedef uint32_t libuna_utf32_character_t; #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBUNA_INTERNAL_TYPES_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1252.h0000664000175000017500000000253313443450072024305 0ustar00lordyestalordyesta00000000000000/* * Windows 1252 codepage (Western European/Latin 1) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1252_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1252_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1252_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1250.c0000664000175000017500000001033513443450072024275 0ustar00lordyestalordyesta00000000000000/* * Windows 1250 codepage (Central European) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1250.h" /* Extended ASCII to Unicode character lookup table for Windows 1250 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0xfffd, 0x201a, 0xfffd, 0x201e, 0x2026, 0x2020, 0x2021, 0xfffd, 0x2030, 0x0160, 0x2039, 0x015a, 0x0164, 0x017d, 0x0179, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0xfffd, 0x2122, 0x0161, 0x203a, 0x015b, 0x0165, 0x017e, 0x017a, 0x00a0, 0x02c7, 0x02d8, 0x0141, 0x00a4, 0x0104, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x015e, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x017b, 0x00b0, 0x00b1, 0x02db, 0x0142, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x0105, 0x015f, 0x00bb, 0x013d, 0x02dd, 0x013e, 0x017c, 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 }; /* Unicode to ASCII character lookup table for Windows 1250 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ 128 ] = { 0xa0, 0x1a, 0x1a, 0x1a, 0xa4, 0x1a, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0x1a, 0xb0, 0xb1, 0x1a, 0x1a, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0x1a, 0x1a, 0xbb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc1, 0xc2, 0x1a, 0xc4, 0x1a, 0x1a, 0xc7, 0x1a, 0xc9, 0x1a, 0xcb, 0x1a, 0xcd, 0xce, 0x1a, 0x1a, 0x1a, 0x1a, 0xd3, 0xd4, 0x1a, 0xd6, 0xd7, 0x1a, 0x1a, 0xda, 0x1a, 0xdc, 0xdd, 0x1a, 0xdf, 0x1a, 0xe1, 0xe2, 0x1a, 0xe4, 0x1a, 0x1a, 0xe7, 0x1a, 0xe9, 0x1a, 0xeb, 0x1a, 0xed, 0xee, 0x1a, 0x1a, 0x1a, 0x1a, 0xf3, 0xf4, 0x1a, 0xf6, 0xf7, 0x1a, 0x1a, 0xfa, 0x1a, 0xfc, 0xfd, 0x1a, 0x1a, 0x1a, 0x1a, 0xc3, 0xe3, 0xa5, 0xb9, 0xc6, 0xe6, 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0xcf, 0xef, 0xd0, 0xf0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xca, 0xea, 0xcc, 0xec, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x0138[ 72 ] = { 0x1a, 0xc5, 0xe5, 0x1a, 0x1a, 0xbc, 0xbe, 0x1a, 0x1a, 0xa3, 0xb3, 0xd1, 0xf1, 0x1a, 0x1a, 0xd2, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd5, 0xf5, 0x1a, 0x1a, 0xc0, 0xe0, 0x1a, 0x1a, 0xd8, 0xf8, 0x8c, 0x9c, 0x1a, 0x1a, 0xaa, 0xba, 0x8a, 0x9a, 0xde, 0xfe, 0x8d, 0x9d, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd9, 0xf9, 0xdb, 0xfb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x8f, 0x9f, 0xaf, 0xbf, 0x8e, 0x9e, 0x1a }; const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x02d8[ 8 ] = { 0xa2, 0xff, 0x1a, 0xb2, 0x1a, 0xbd, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2030[ 16 ] = { 0x89, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x8b, 0x9b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_utf16_string.c0000664000175000017500000022620613443450072022646 0ustar00lordyestalordyesta00000000000000/* * UTF-16 string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf16_string.h" /* Determines the size of an UTF-16 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, int codepage, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_byte_stream"; size_t byte_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( byte_stream_size == 0 ) { return( 1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } /* Determine how many UTF-16 character byte words are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_byte_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_byte_stream"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_byte_stream( utf16_string, utf16_string_size, &utf16_string_index, byte_stream, byte_stream_size, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from a byte stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_byte_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_byte_stream"; size_t byte_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing byte stream value.", function ); return( -1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character byte words */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Compares an UTF-16 string with a byte stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf16_string_compare_with_byte_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_byte_stream"; size_t byte_stream_index = 0; size_t utf16_string_index = 0; libuna_unicode_character_t utf16_unicode_character = 0; libuna_unicode_character_t byte_stream_unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing byte stream value.", function ); return( -1 ); } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } /* Check if the byte stream is terminated with zero bytes */ if( byte_stream[ byte_stream_size - 1 ] == 0 ) { byte_stream_size -= 1; } while( ( utf16_string_index < utf16_string_size ) && ( byte_stream_index < byte_stream_size ) ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the byte stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_byte_stream( &byte_stream_unicode_character, byte_stream, byte_stream_size, &byte_stream_index, codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from byte stream.", function ); return( -1 ); } if( utf16_unicode_character < byte_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf16_unicode_character > byte_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( byte_stream_index < byte_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-16 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_utf7_stream( const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf7_stream"; size_t utf7_stream_index = 0; libuna_unicode_character_t unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( utf7_stream_size == 0 ) { return( 1 ); } while( utf7_stream_index < utf7_stream_size ) { /* Convert the UTF-7 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_utf7_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_utf7_stream"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_utf7_stream( utf16_string, utf16_string_size, &utf16_string_index, utf7_stream, utf7_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to UTF-7 stream to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from an UTF-7 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_utf7_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf7_stream"; size_t utf7_stream_index = 0; libuna_unicode_character_t unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-7 stream value.", function ); return( -1 ); } while( utf7_stream_index < utf7_stream_size ) { /* Convert the UTF-7 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character bytes */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Compares an UTF-16 string with an UTF-7 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf16_string_compare_with_utf7_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_utf7_stream"; size_t utf16_string_index = 0; size_t utf7_stream_index = 0; libuna_unicode_character_t utf16_unicode_character = 0; libuna_unicode_character_t utf7_stream_unicode_character = 0; uint32_t utf7_stream_base64_data = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-7 stream value.", function ); return( -1 ); } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } /* Check if the UTF-7 stream is terminated with zero bytes */ if( utf7_stream[ utf7_stream_size - 1 ] == 0 ) { utf7_stream_size -= 1; } while( ( utf16_string_index < utf16_string_size ) && ( utf7_stream_index < utf7_stream_size ) ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the UTF-7 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf7_stream( &utf7_stream_unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-7 stream.", function ); return( -1 ); } if( utf16_unicode_character < utf7_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf16_unicode_character > utf7_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf7_stream_index < utf7_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-16 string from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf8"; size_t utf8_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( utf8_string_size == 0 ) { return( 1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_utf8( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_utf8"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_utf8( utf16_string, utf16_string_size, &utf16_string_index, utf8_string, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 string to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_utf8( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf8"; size_t utf8_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 string value.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character bytes */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Determines the size of an UTF-16 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_utf8_stream( const uint8_t *utf8_stream, size_t utf8_stream_size, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf8_stream"; size_t utf8_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( utf8_stream_size == 0 ) { return( 1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } while( utf8_stream_index < utf8_stream_size ) { /* Convert the UTF-8 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_utf8_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_utf8_stream"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_utf8_stream( utf16_string, utf16_string_size, &utf16_string_index, utf8_stream, utf8_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to UTF-8 stream to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from an UTF-8 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_utf8_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf8_stream"; size_t utf8_stream_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 stream value.", function ); return( -1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } while( utf8_stream_index < utf8_stream_size ) { /* Convert the UTF-8 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character bytes */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Compares an UTF-16 string with an UTF-8 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf16_string_compare_with_utf8_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_utf8_stream"; size_t utf16_string_index = 0; size_t utf8_stream_index = 0; libuna_unicode_character_t utf16_unicode_character = 0; libuna_unicode_character_t utf8_stream_unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 stream.", function ); return( -1 ); } if( utf8_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_stream_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-8 stream value.", function ); return( -1 ); } /* Check if UTF-8 stream starts with a byte order mark (BOM) */ if( utf8_stream_size >= 3 ) { if( ( utf8_stream[ 0 ] == 0x0ef ) && ( utf8_stream[ 1 ] == 0x0bb ) && ( utf8_stream[ 2 ] == 0x0bf ) ) { utf8_stream_index += 3; } } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } /* Check if the UTF-8 stream is terminated with zero bytes */ if( utf8_stream[ utf8_stream_size - 1 ] == 0 ) { utf8_stream_size -= 1; } while( ( utf16_string_index < utf16_string_size ) && ( utf8_stream_index < utf8_stream_size ) ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &utf8_stream_unicode_character, utf8_stream, utf8_stream_size, &utf8_stream_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 stream.", function ); return( -1 ); } if( utf16_unicode_character < utf8_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf16_unicode_character > utf8_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf8_stream_index < utf8_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-16 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_utf16_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf16_stream"; size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size % 2 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( utf16_stream_size == 0 ) { return( 1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0x0ff ) && ( utf16_stream[ 1 ] == 0x0fe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0x0fe ) && ( utf16_stream[ 1 ] == 0x0ff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_utf16_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_utf16_stream"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_utf16_stream( utf16_string, utf16_string_size, &utf16_string_index, utf16_stream, utf16_stream_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from an UTF-16 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_utf16_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf16_stream"; size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size == 0 ) || ( ( utf16_stream_size % 2 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0x0ff ) && ( utf16_stream[ 1 ] == 0x0fe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0x0fe ) && ( utf16_stream[ 1 ] == 0x0ff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character bytes */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Compares an UTF-16 string with an UTF-16 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf16_string_compare_with_utf16_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_utf16_stream"; size_t utf16_stream_index = 0; size_t utf16_string_index = 0; libuna_unicode_character_t utf16_unicode_character = 0; libuna_unicode_character_t utf16_stream_unicode_character = 0; int read_byte_order = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf16_stream_size == 0 ) || ( ( utf16_stream_size % 2 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-16 stream value.", function ); return( -1 ); } /* Check if UTF-16 stream is in big or little endian */ if( utf16_stream_size >= 2 ) { if( ( utf16_stream[ 0 ] == 0xfe ) && ( utf16_stream[ 1 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf16_stream_index = 2; } else if( ( utf16_stream[ 0 ] == 0xff ) && ( utf16_stream[ 1 ] == 0xfe ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf16_stream_index = 2; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } /* Check if the UTF-16 stream is terminated with zero bytes */ if( ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) && ( utf16_stream[ utf16_stream_size - 1 ] == 0 ) ) { utf16_stream_size -= 2; } while( ( utf16_string_index < utf16_string_size ) && ( utf16_stream_index < utf16_stream_size ) ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the UTF-16 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16_stream( &utf16_stream_unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 stream.", function ); return( -1 ); } if( utf16_unicode_character < utf16_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf16_unicode_character > utf16_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf16_stream_index < utf16_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-16 string from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf32"; size_t utf32_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( utf32_string_size == 0 ) { return( 1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_utf32( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_utf32"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_utf32( utf16_string, utf16_string_size, &utf16_string_index, utf32_string, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 string to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_utf32( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf32"; size_t utf32_string_index = 0; libuna_unicode_character_t unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-32 string value.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character bytes */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Compares an UTF-16 string with an UTF-32 string * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf16_string_compare_with_utf32( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_utf32"; size_t utf16_string_index = 0; size_t utf32_string_index = 0; libuna_unicode_character_t utf16_unicode_character = 0; libuna_unicode_character_t utf32_unicode_character = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: missing UTF-32 string value.", function ); return( -1 ); } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } if( utf32_string[ utf32_string_size - 1 ] == 0 ) { utf32_string_size -= 1; } while( ( utf16_string_index < utf16_string_size ) && ( utf32_string_index < utf32_string_size ) ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &utf32_unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } if( utf16_unicode_character < utf32_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf16_unicode_character > utf32_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf32_string_index < utf32_string_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } /* Determines the size of an UTF-16 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_size_from_utf32_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, size_t *utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf32_stream"; size_t utf32_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size % 4 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( utf32_stream_size == 0 ) { return( 1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { *utf16_string_size += 1; } return( 1 ); } /* Copies an UTF-16 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_copy_from_utf32_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_copy_from_utf32_stream"; size_t utf16_string_index = 0; if( libuna_utf16_string_with_index_copy_from_utf32_stream( utf16_string, utf16_string_size, &utf16_string_index, utf32_stream, utf32_stream_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 string from an UTF-32 stream * Returns 1 if successful or -1 on error */ int libuna_utf16_string_with_index_copy_from_utf32_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf32_stream"; size_t utf32_stream_index = 0; libuna_unicode_character_t unicode_character = 0; int read_byte_order = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size == 0 ) || ( ( utf32_stream_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >=4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 character bytes */ if( libuna_unicode_character_copy_to_utf16( unicode_character, utf16_string, utf16_string_size, utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16.", function ); return( -1 ); } } /* Check if the string is terminated with an end-of-string character */ if( unicode_character != 0 ) { if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } return( 1 ); } /* Compares an UTF-16 string with an UTF-32 stream * Returns LIBUNA_COMPARE_LESS, LIBUNA_COMPARE_EQUAL, LIBUNA_COMPARE_GREATER if successful or -1 on error */ int libuna_utf16_string_compare_with_utf32_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_utf32_stream"; size_t utf16_string_index = 0; size_t utf32_stream_index = 0; libuna_unicode_character_t utf16_unicode_character = 0; libuna_unicode_character_t utf32_stream_unicode_character = 0; int read_byte_order = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 stream.", function ); return( -1 ); } if( utf32_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 stream size value exceeds maximum.", function ); return( -1 ); } if( ( utf32_stream_size == 0 ) || ( ( utf32_stream_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing UTF-32 stream value.", function ); return( -1 ); } /* Check if UTF-32 stream is in big or little endian */ if( utf32_stream_size >= 4 ) { if( ( utf32_stream[ 0 ] == 0x00 ) && ( utf32_stream[ 1 ] == 0x00 ) && ( utf32_stream[ 2 ] == 0xfe ) && ( utf32_stream[ 3 ] == 0xff ) ) { read_byte_order = LIBUNA_ENDIAN_BIG; utf32_stream_index = 4; } else if( ( utf32_stream[ 0 ] == 0xff ) && ( utf32_stream[ 1 ] == 0xfe ) && ( utf32_stream[ 2 ] == 0x00 ) && ( utf32_stream[ 3 ] == 0x00 ) ) { read_byte_order = LIBUNA_ENDIAN_LITTLE; utf32_stream_index = 4; } if( byte_order == 0 ) { byte_order = read_byte_order; } } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf16_string[ utf16_string_size - 1 ] == 0 ) { utf16_string_size -= 1; } /* Check if the UTF-32 stream is terminated with zero bytes */ if( ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 3 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 2 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 1 ] == 0 ) ) { utf32_stream_size -= 1; } while( ( utf16_string_index < utf16_string_size ) && ( utf32_stream_index < utf32_stream_size ) ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &utf16_unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Convert the UTF-32 stream bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32_stream( &utf32_stream_unicode_character, utf32_stream, utf32_stream_size, &utf32_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 stream.", function ); return( -1 ); } if( utf16_unicode_character < utf32_stream_unicode_character ) { return( LIBUNA_COMPARE_LESS ); } else if( utf16_unicode_character > utf32_stream_unicode_character ) { return( LIBUNA_COMPARE_GREATER ); } } /* Check if both strings were entirely processed */ if( utf16_string_index < utf16_string_size ) { return( LIBUNA_COMPARE_GREATER ); } else if( utf32_stream_index < utf32_stream_size ) { return( LIBUNA_COMPARE_LESS ); } return( LIBUNA_COMPARE_EQUAL ); } libewf-20140807/libuna/libuna_codepage_iso_8859_5.h0000664000175000017500000000247713443450072023664 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-5 codepage (Cyrillic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_5_H ) #define _LIBUNA_CODEPAGE_ISO_8859_5_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ 96 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_5_H ) */ libewf-20140807/libuna/libuna_extern.h0000664000175000017500000000235613443450072021623 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2008-2019, 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( _LIBUNA_INTERNAL_EXTERN_H ) #define _LIBUNA_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if !defined( HAVE_LOCAL_LIBUNA ) #include #define LIBUNA_EXTERN_VARIABLE LIBUNA_EXTERN #else #define LIBUNA_EXTERN /* extern */ #define LIBUNA_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBUNA_INTERNAL_EXTERN_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_4.h0000664000175000017500000000265313443450072023657 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-4 codepage (Baltic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_4_H ) #define _LIBUNA_CODEPAGE_ISO_8859_4_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ 184 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ 32 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_4_H ) */ libewf-20140807/libuna/libuna_byte_stream.h0000664000175000017500000000555313443450072022636 0ustar00lordyestalordyesta00000000000000/* * Byte stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_BYTE_STREAM_H ) #define _LIBUNA_BYTE_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_byte_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, int codepage, size_t *byte_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_byte_stream_copy_from_utf8( uint8_t *byte_stream, size_t byte_stream_size, int codepage, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_byte_stream_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_byte_stream */ LIBUNA_EXTERN \ int libuna_byte_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, int codepage, size_t *byte_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_byte_stream_copy_from_utf16( uint8_t *byte_stream, size_t byte_stream_size, int codepage, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_byte_stream_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_byte_stream */ LIBUNA_EXTERN \ int libuna_byte_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, int codepage, size_t *byte_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_byte_stream_copy_from_utf32( uint8_t *byte_stream, size_t byte_stream_size, int codepage, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_byte_stream_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_byte_stream */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_BYTE_STREAM_H ) */ libewf-20140807/libuna/libuna_utf16_string.h0000664000175000017500000002136313443450072022650 0ustar00lordyestalordyesta00000000000000/* * UTF-16 string functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF16_STRING_H ) #define _LIBUNA_UTF16_STRING_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf16_string_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, int codepage, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_byte_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_byte_stream is implemented by * libuna_byte_stream_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_byte_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_compare_with_byte_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *byte_stream, size_t byte_stream_size, int codepage, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_size_from_utf7_stream( const uint8_t *utf7_stream, size_t utf7_stream_size, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_utf7_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_utf7_stream is implemented by * libuna_utf7_stream_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_utf7_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_compare_with_utf7_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf7_stream, size_t utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_utf8( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_utf8( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_compare_with_utf8 is implemented by * libuna_utf8_string_compare_with_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_size_from_utf8_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_utf8_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_utf8_stream is implemented by * libuna_utf8_stream_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_utf8_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_compare_with_utf8_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf8_stream, size_t utf8_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_size_from_utf16_stream( const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_utf16_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_utf16_stream is implemented by * libuna_utf16_stream_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_utf16_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_compare_with_utf16_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_utf32( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_utf32( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_compare_with_utf32( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_size_from_utf32_stream( const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, size_t *utf16_string_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_copy_from_utf32_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); /* The functionality for libuna_utf16_string_copy_to_utf32_stream is implemented by * libuna_utf32_stream_copy_from_utf16 */ LIBUNA_EXTERN \ int libuna_utf16_string_with_index_copy_from_utf32_stream( libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf16_string_compare_with_utf32_stream( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, const uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF16_STRING_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_4.c0000664000175000017500000000675313443450072023657 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-4 codepage (Baltic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_4.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-4 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9 }; /* Unicode to ASCII character lookup table for ISO 8859-4 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ 184 ] = { 0xa0, 0x1a, 0x1a, 0x1a, 0xa4, 0x1a, 0x1a, 0xa7, 0xa8, 0x1a, 0x1a, 0x1a, 0x1a, 0xad, 0x1a, 0xaf, 0xb0, 0x1a, 0x1a, 0x1a, 0xb4, 0x1a, 0x1a, 0x1a, 0xb8, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x1a, 0x1a, 0xc9, 0x1a, 0xcb, 0x1a, 0xcd, 0xce, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0x1a, 0xda, 0xdb, 0xdc, 0x1a, 0x1a, 0xdf, 0x1a, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x1a, 0x1a, 0xe9, 0x1a, 0xeb, 0x1a, 0xed, 0xee, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0x1a, 0xfa, 0xfb, 0xfc, 0x1a, 0x1a, 0x1a, 0xc0, 0xe0, 0x1a, 0x1a, 0xa1, 0xb1, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0x1a, 0x1a, 0xd0, 0xf0, 0xaa, 0xba, 0x1a, 0x1a, 0xcc, 0xec, 0xca, 0xea, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xab, 0xbb, 0x1a, 0x1a, 0x1a, 0x1a, 0xa5, 0xb5, 0xcf, 0xef, 0x1a, 0x1a, 0xc7, 0xe7, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd3, 0xf3, 0xa2, 0x1a, 0x1a, 0xa6, 0xb6, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd1, 0xf1, 0x1a, 0x1a, 0x1a, 0xbd, 0xbf, 0xd2, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xa3, 0xb3 }; const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ 32 ] = { 0xa9, 0xb9, 0x1a, 0x1a, 0x1a, 0x1a, 0xac, 0xbc, 0xdd, 0xfd, 0xde, 0xfe, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd9, 0xf9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xae, 0xbe, 0x1a }; libewf-20140807/libuna/libuna_codepage_iso_8859_10.c0000664000175000017500000000623313443450072023725 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-10 codepage (Nordic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_10.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-10 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138 }; /* Unicode to ASCII character lookup table for ISO 8859-10 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ 144 ] = { 0x1a, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x1a, 0x1a, 0xc9, 0x1a, 0xcb, 0x1a, 0xcd, 0xce, 0xcf, 0xd0, 0x1a, 0x1a, 0xd3, 0xd4, 0xd5, 0xd6, 0x1a, 0xd8, 0x1a, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0x1a, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x1a, 0x1a, 0xe9, 0x1a, 0xeb, 0x1a, 0xed, 0xee, 0xef, 0xf0, 0x1a, 0x1a, 0xf3, 0xf4, 0xf5, 0xf6, 0x1a, 0xf8, 0x1a, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x1a, 0xc0, 0xe0, 0x1a, 0x1a, 0xa1, 0xb1, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0x1a, 0x1a, 0xa9, 0xb9, 0xa2, 0xb2, 0x1a, 0x1a, 0xcc, 0xec, 0xca, 0xea, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xa3, 0xb3, 0x1a, 0x1a, 0x1a, 0x1a, 0xa5, 0xb5, 0xa4, 0xb4, 0x1a, 0x1a, 0xc7, 0xe7, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xa6, 0xb6, 0xff, 0x1a, 0x1a, 0xa8, 0xb8, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd1, 0xf1, 0x1a, 0x1a, 0x1a, 0xaf, 0xbf, 0xd2, 0xf2, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ 16 ] = { 0xaa, 0xba, 0x1a, 0x1a, 0x1a, 0x1a, 0xab, 0xbb, 0xd7, 0xf7, 0xae, 0xbe, 0x1a, 0x1a, 0x1a, 0x1a }; libewf-20140807/libuna/Makefile.in0000664000175000017500000014007713443455350020667 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libuna ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libuna_la_LIBADD = am__libuna_la_SOURCES_DIST = libuna_base16_stream.c \ libuna_base16_stream.h libuna_base32_stream.c \ libuna_base32_stream.h libuna_base64_stream.c \ libuna_base64_stream.h libuna_byte_stream.c \ libuna_byte_stream.h libuna_codepage_iso_8859_2.c \ libuna_codepage_iso_8859_2.h libuna_codepage_iso_8859_3.c \ libuna_codepage_iso_8859_3.h libuna_codepage_iso_8859_4.c \ libuna_codepage_iso_8859_4.h libuna_codepage_iso_8859_5.c \ libuna_codepage_iso_8859_5.h libuna_codepage_iso_8859_6.c \ libuna_codepage_iso_8859_6.h libuna_codepage_iso_8859_7.c \ libuna_codepage_iso_8859_7.h libuna_codepage_iso_8859_8.c \ libuna_codepage_iso_8859_8.h libuna_codepage_iso_8859_9.c \ libuna_codepage_iso_8859_9.h libuna_codepage_iso_8859_10.c \ libuna_codepage_iso_8859_10.h libuna_codepage_iso_8859_13.c \ libuna_codepage_iso_8859_13.h libuna_codepage_iso_8859_14.c \ libuna_codepage_iso_8859_14.h libuna_codepage_iso_8859_15.c \ libuna_codepage_iso_8859_15.h libuna_codepage_iso_8859_16.c \ libuna_codepage_iso_8859_16.h libuna_codepage_koi8_r.c \ libuna_codepage_koi8_r.h libuna_codepage_koi8_u.c \ libuna_codepage_koi8_u.h libuna_codepage_windows_874.c \ libuna_codepage_windows_874.h libuna_codepage_windows_932.c \ libuna_codepage_windows_932.h libuna_codepage_windows_936.c \ libuna_codepage_windows_936.h libuna_codepage_windows_949.c \ libuna_codepage_windows_949.h libuna_codepage_windows_950.c \ libuna_codepage_windows_950.h libuna_codepage_windows_1250.c \ libuna_codepage_windows_1250.h libuna_codepage_windows_1251.c \ libuna_codepage_windows_1251.h libuna_codepage_windows_1252.c \ libuna_codepage_windows_1252.h libuna_codepage_windows_1253.c \ libuna_codepage_windows_1253.h libuna_codepage_windows_1254.c \ libuna_codepage_windows_1254.h libuna_codepage_windows_1255.c \ libuna_codepage_windows_1255.h libuna_codepage_windows_1256.c \ libuna_codepage_windows_1256.h libuna_codepage_windows_1257.c \ libuna_codepage_windows_1257.h libuna_codepage_windows_1258.c \ libuna_codepage_windows_1258.h libuna_definitions.h \ libuna_error.c libuna_error.h libuna_extern.h \ libuna_libcerror.h libuna_support.c libuna_support.h \ libuna_types.h libuna_unicode_character.c \ libuna_unicode_character.h libuna_unused.h libuna_url_stream.c \ libuna_url_stream.h libuna_utf16_stream.c \ libuna_utf16_stream.h libuna_utf16_string.c \ libuna_utf16_string.h libuna_utf32_stream.c \ libuna_utf32_stream.h libuna_utf32_string.c \ libuna_utf32_string.h libuna_utf7_stream.c \ libuna_utf7_stream.h libuna_utf8_stream.c libuna_utf8_stream.h \ libuna_utf8_string.c libuna_utf8_string.h @HAVE_LOCAL_LIBUNA_TRUE@am_libuna_la_OBJECTS = \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base16_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base32_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base64_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_byte_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_2.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_3.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_4.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_5.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_6.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_7.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_8.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_9.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_10.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_13.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_14.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_15.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_16.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_r.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_u.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_874.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_932.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_936.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_949.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_950.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1250.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1251.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1252.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1253.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1254.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1255.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1256.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1257.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1258.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_error.lo libuna_support.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_unicode_character.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_url_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf16_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf16_string.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf32_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf32_string.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf7_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf8_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf8_string.lo libuna_la_OBJECTS = $(am_libuna_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBUNA_TRUE@am_libuna_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libuna_base16_stream.Plo \ ./$(DEPDIR)/libuna_base32_stream.Plo \ ./$(DEPDIR)/libuna_base64_stream.Plo \ ./$(DEPDIR)/libuna_byte_stream.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_10.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_13.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_14.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_15.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_16.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_2.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_3.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_4.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_5.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_6.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_7.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_8.Plo \ ./$(DEPDIR)/libuna_codepage_iso_8859_9.Plo \ ./$(DEPDIR)/libuna_codepage_koi8_r.Plo \ ./$(DEPDIR)/libuna_codepage_koi8_u.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1250.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1251.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1252.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1253.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1254.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1255.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1256.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1257.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1258.Plo \ ./$(DEPDIR)/libuna_codepage_windows_874.Plo \ ./$(DEPDIR)/libuna_codepage_windows_932.Plo \ ./$(DEPDIR)/libuna_codepage_windows_936.Plo \ ./$(DEPDIR)/libuna_codepage_windows_949.Plo \ ./$(DEPDIR)/libuna_codepage_windows_950.Plo \ ./$(DEPDIR)/libuna_error.Plo ./$(DEPDIR)/libuna_support.Plo \ ./$(DEPDIR)/libuna_unicode_character.Plo \ ./$(DEPDIR)/libuna_url_stream.Plo \ ./$(DEPDIR)/libuna_utf16_stream.Plo \ ./$(DEPDIR)/libuna_utf16_string.Plo \ ./$(DEPDIR)/libuna_utf32_stream.Plo \ ./$(DEPDIR)/libuna_utf32_string.Plo \ ./$(DEPDIR)/libuna_utf7_stream.Plo \ ./$(DEPDIR)/libuna_utf8_stream.Plo \ ./$(DEPDIR)/libuna_utf8_string.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libuna_la_SOURCES) DIST_SOURCES = $(am__libuna_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBUNA_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBUNA_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBUNA_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBUNA_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBUNA_TRUE@noinst_LTLIBRARIES = libuna.la @HAVE_LOCAL_LIBUNA_TRUE@libuna_la_SOURCES = \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base16_stream.c libuna_base16_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base32_stream.c libuna_base32_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base64_stream.c libuna_base64_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_byte_stream.c libuna_byte_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_2.c libuna_codepage_iso_8859_2.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_3.c libuna_codepage_iso_8859_3.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_4.c libuna_codepage_iso_8859_4.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_5.c libuna_codepage_iso_8859_5.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_6.c libuna_codepage_iso_8859_6.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_7.c libuna_codepage_iso_8859_7.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_8.c libuna_codepage_iso_8859_8.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_9.c libuna_codepage_iso_8859_9.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_10.c libuna_codepage_iso_8859_10.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_13.c libuna_codepage_iso_8859_13.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_14.c libuna_codepage_iso_8859_14.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_15.c libuna_codepage_iso_8859_15.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_16.c libuna_codepage_iso_8859_16.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_r.c libuna_codepage_koi8_r.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_u.c libuna_codepage_koi8_u.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_874.c libuna_codepage_windows_874.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_932.c libuna_codepage_windows_932.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_936.c libuna_codepage_windows_936.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_949.c libuna_codepage_windows_949.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_950.c libuna_codepage_windows_950.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1250.c libuna_codepage_windows_1250.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1251.c libuna_codepage_windows_1251.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1252.c libuna_codepage_windows_1252.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1253.c libuna_codepage_windows_1253.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1254.c libuna_codepage_windows_1254.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1255.c libuna_codepage_windows_1255.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1256.c libuna_codepage_windows_1256.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1257.c libuna_codepage_windows_1257.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1258.c libuna_codepage_windows_1258.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_definitions.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_error.c libuna_error.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_extern.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_libcerror.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_support.c libuna_support.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_types.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_unicode_character.c libuna_unicode_character.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_unused.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_url_stream.c libuna_url_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf16_stream.c libuna_utf16_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf16_string.c libuna_utf16_string.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf32_stream.c libuna_utf32_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf32_string.c libuna_utf32_string.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf7_stream.c libuna_utf7_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf8_stream.c libuna_utf8_stream.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf8_string.c libuna_utf8_string.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libuna/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libuna/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libuna.la: $(libuna_la_OBJECTS) $(libuna_la_DEPENDENCIES) $(EXTRA_libuna_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libuna_la_rpath) $(libuna_la_OBJECTS) $(libuna_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_base16_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_base32_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_base64_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_byte_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_10.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_13.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_14.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_15.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_16.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_3.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_4.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_5.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_6.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_7.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_8.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_9.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_koi8_r.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_koi8_u.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1250.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1251.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1252.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1253.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1254.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1255.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1256.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1257.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1258.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_874.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_932.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_936.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_949.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_950.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_unicode_character.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_url_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf16_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf16_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf32_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf32_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf7_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf8_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_utf8_string.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libuna_base16_stream.Plo -rm -f ./$(DEPDIR)/libuna_base32_stream.Plo -rm -f ./$(DEPDIR)/libuna_base64_stream.Plo -rm -f ./$(DEPDIR)/libuna_byte_stream.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_10.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_13.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_14.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_15.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_16.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_2.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_3.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_4.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_5.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_6.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_7.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_8.Plo -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_9.Plo -rm -f ./$(DEPDIR)/libuna_codepage_koi8_r.Plo -rm -f ./$(DEPDIR)/libuna_codepage_koi8_u.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1250.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1251.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1252.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1253.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1254.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1255.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1256.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1257.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1258.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_874.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_932.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_936.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_949.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_950.Plo -rm -f ./$(DEPDIR)/libuna_error.Plo -rm -f ./$(DEPDIR)/libuna_support.Plo -rm -f ./$(DEPDIR)/libuna_unicode_character.Plo -rm -f ./$(DEPDIR)/libuna_url_stream.Plo -rm -f ./$(DEPDIR)/libuna_utf16_stream.Plo -rm -f ./$(DEPDIR)/libuna_utf16_string.Plo -rm -f ./$(DEPDIR)/libuna_utf32_stream.Plo -rm -f ./$(DEPDIR)/libuna_utf32_string.Plo -rm -f ./$(DEPDIR)/libuna_utf7_stream.Plo -rm -f ./$(DEPDIR)/libuna_utf8_stream.Plo -rm -f ./$(DEPDIR)/libuna_utf8_string.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libuna ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libuna_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libuna/libuna_utf7_stream.h0000664000175000017500000000537213443450072022557 0ustar00lordyestalordyesta00000000000000/* * UTF-7 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF7_STREAM_H ) #define _LIBUNA_UTF7_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf7_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf7_stream_copy_from_utf8( uint8_t *utf7_stream, size_t utf7_stream_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf7_stream_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_utf7_stream */ LIBUNA_EXTERN \ int libuna_utf7_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf7_stream_copy_from_utf16( uint8_t *utf7_stream, size_t utf7_stream_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf7_stream_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_utf7_stream */ LIBUNA_EXTERN \ int libuna_utf7_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf7_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf7_stream_copy_from_utf32( uint8_t *utf7_stream, size_t utf7_stream_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf7_stream_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_utf7_stream */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF7_STREAM_H ) */ libewf-20140807/libuna/libuna_base32_stream.h0000664000175000017500000000717213443450072022751 0ustar00lordyestalordyesta00000000000000/* * Base32 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_BASE32_STREAM_H ) #define _LIBUNA_BASE32_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif int libuna_base32_character_copy_to_quintet( uint8_t base32_character, uint8_t *base32_quintet, uint32_t base32_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_quintuplet_copy_from_base32_stream( uint64_t *base32_quintuplet, const uint8_t *base32_stream, size_t base32_stream_size, size_t *base32_stream_index, uint8_t *padding_size, uint32_t base32_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_quintuplet_copy_to_base32_stream( uint64_t base32_quintuplet, uint8_t *base32_stream, size_t base32_stream_size, size_t *base32_stream_index, uint8_t padding_size, uint32_t base32_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_quintuplet_copy_from_byte_stream( uint64_t *base32_quintuplet, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t *padding_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_quintuplet_copy_to_byte_stream( uint64_t base32_quintuplet, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t padding_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_stream_size_to_byte_stream( const uint8_t *base32_stream, size_t base32_stream_size, size_t *byte_stream_size, uint32_t base32_variant, uint8_t flags, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_stream_copy_to_byte_stream( const uint8_t *base32_stream, size_t base32_stream_size, uint8_t *byte_stream, size_t byte_stream_size, uint32_t base32_variant, uint8_t flags, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_stream_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, size_t *base32_stream_size, uint32_t base32_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_stream_copy_from_byte_stream( uint8_t *base32_stream, size_t base32_stream_size, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base32_variant, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_base32_stream_with_index_copy_from_byte_stream( uint8_t *base32_stream, size_t base32_stream_size, size_t *base32_stream_index, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base32_variant, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_BASE32_STREAM_H ) */ libewf-20140807/libuna/libuna_utf16_stream.c0000664000175000017500000004621513443450072022633 0ustar00lordyestalordyesta00000000000000/* * UTF-16 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf16_stream.h" /* Copies an UTF-16 stream byte order mark (BOM) * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_copy_byte_order_mark( uint8_t *utf16_stream, size_t utf16_stream_size, size_t *utf16_stream_index, int byte_order, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_copy_byte_order_mark"; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream index.", function ); return( -1 ); } if( ( *utf16_stream_index + 2 ) > utf16_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 stream too small.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( byte_order == LIBUNA_ENDIAN_BIG ) { utf16_stream[ *utf16_stream_index ] = 0xfe; utf16_stream[ *utf16_stream_index + 1 ] = 0xff; } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { utf16_stream[ *utf16_stream_index ] = 0xff; utf16_stream[ *utf16_stream_index + 1 ] = 0xfe; } *utf16_stream_index += 2; return( 1 ); } /* Determines the size of an UTF-16 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf16_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_size_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf8_string_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf16_stream_size = 1; while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Convert the number of characters into bytes */ *utf16_stream_size *= 2; return( 1 ); } /* Copies an UTF-16 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_copy_from_utf8( uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_copy_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf16_stream_index = 0; size_t utf8_string_index = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf16_stream_copy_byte_order_mark( utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-16 byte order mark.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 stream bytes */ if( libuna_unicode_character_copy_to_utf16_stream( unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-16 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf16_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_size_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf16_stream_size = 1; while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Convert the number of characters into bytes */ *utf16_stream_size *= 2; return( 1 ); } /* Copies an UTF-16 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_copy_from_utf16( uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_copy_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_stream_index = 0; size_t utf16_string_index = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf16_stream_copy_byte_order_mark( utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-16 byte order mark.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 stream bytes */ if( libuna_unicode_character_copy_to_utf16_stream( unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-16 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf16_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_size_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_string_index = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream size.", function ); return( -1 ); } /* Add the byte order mark */ *utf16_stream_size += 1; while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many UTF-16 character bytes are required */ if( libuna_unicode_character_size_to_utf16( unicode_character, utf16_stream_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-16.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } /* Convert the number of characters into bytes */ *utf16_stream_size *= 2; return( 1 ); } /* Copies an UTF-16 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf16_stream_copy_from_utf32( uint8_t *utf16_stream, size_t utf16_stream_size, int byte_order, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf16_stream_copy_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf16_stream_index = 0; size_t utf32_string_index = 0; if( utf16_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 stream.", function ); return( -1 ); } if( utf16_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 stream size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != LIBUNA_ENDIAN_BIG ) && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( libuna_utf16_stream_copy_byte_order_mark( utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy UTF-16 byte order mark.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-16 stream bytes */ if( libuna_unicode_character_copy_to_utf16_stream( unicode_character, utf16_stream, utf16_stream_size, &utf16_stream_index, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-16 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } libewf-20140807/libuna/libuna_utf7_stream.c0000664000175000017500000003651513443450072022555 0ustar00lordyestalordyesta00000000000000/* * UTF-7 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf7_stream.h" /* Determines the size of an UTF-7 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf7_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf7_stream_size_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf8_string_index = 0; uint32_t utf7_stream_base64_data = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream size.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8.", function ); return( -1 ); } /* Determine how many UTF-7 character bytes are required */ if( libuna_unicode_character_size_to_utf7_stream( unicode_character, utf7_stream_size, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-7.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies an UTF-7 stream from an UTF-8 string * Returns 1 if successful or -1 on error */ int libuna_utf7_stream_copy_from_utf8( uint8_t *utf7_stream, size_t utf7_stream_size, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf7_stream_copy_from_utf8"; libuna_unicode_character_t unicode_character = 0; size_t utf7_stream_index = 0; size_t utf8_string_index = 0; uint32_t utf7_stream_base64_data = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } while( utf8_string_index < utf8_string_size ) { /* Convert the UTF-8 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf8( &unicode_character, utf8_string, utf8_string_size, &utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-8 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-7 stream bytes */ if( libuna_unicode_character_copy_to_utf7_stream( unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-7 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-7 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf7_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf7_stream_size_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; uint32_t utf7_stream_base64_data = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream size.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16.", function ); return( -1 ); } /* Determine how many UTF-7 character bytes are required */ if( libuna_unicode_character_size_to_utf7_stream( unicode_character, utf7_stream_size, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-7.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies an UTF-7 stream from an UTF-16 string * Returns 1 if successful or -1 on error */ int libuna_utf7_stream_copy_from_utf16( uint8_t *utf7_stream, size_t utf7_stream_size, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf7_stream_copy_from_utf16"; libuna_unicode_character_t unicode_character = 0; size_t utf16_string_index = 0; size_t utf7_stream_index = 0; uint32_t utf7_stream_base64_data = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } while( utf16_string_index < utf16_string_size ) { /* Convert the UTF-16 string bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf16( &unicode_character, utf16_string, utf16_string_size, &utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-16 string.", function ); return( -1 ); } /* Convert the Unicode character into UTF-7 stream bytes */ if( libuna_unicode_character_copy_to_utf7_stream( unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-7 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Determines the size of an UTF-7 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf7_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf7_stream_size, libcerror_error_t **error ) { static char *function = "libuna_utf7_stream_size_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_string_index = 0; uint32_t utf7_stream_base64_data = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf7_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream size.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Determine how many UTF-7 character bytes are required */ if( libuna_unicode_character_size_to_utf7_stream( unicode_character, utf7_stream_size, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to determine size of Unicode character in UTF-7.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } /* Copies an UTF-7 stream from an UTF-32 string * Returns 1 if successful or -1 on error */ int libuna_utf7_stream_copy_from_utf32( uint8_t *utf7_stream, size_t utf7_stream_size, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libuna_utf7_stream_copy_from_utf32"; libuna_unicode_character_t unicode_character = 0; size_t utf32_string_index = 0; size_t utf7_stream_index = 0; uint32_t utf7_stream_base64_data = 0; if( utf7_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-7 stream.", function ); return( -1 ); } if( utf7_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-7 stream size value exceeds maximum.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } while( utf32_string_index < utf32_string_size ) { /* Convert the UTF-32 character bytes into an Unicode character */ if( libuna_unicode_character_copy_from_utf32( &unicode_character, utf32_string, utf32_string_size, &utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from UTF-32.", function ); return( -1 ); } /* Convert the Unicode character into UTF-7 character bytes */ if( libuna_unicode_character_copy_to_utf7_stream( unicode_character, utf7_stream, utf7_stream_size, &utf7_stream_index, &utf7_stream_base64_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, "%s: unable to copy Unicode character to UTF-7 stream.", function ); return( -1 ); } if( unicode_character == 0 ) { break; } } return( 1 ); } libewf-20140807/libuna/libuna_support.h0000664000175000017500000000232413443450072022025 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2019, 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( _LIBUNA_SUPPORT_H ) #define _LIBUNA_SUPPORT_H #include #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBUNA ) LIBUNA_EXTERN \ const char *libuna_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_SUPPORT_H ) */ libewf-20140807/libuna/libuna_utf32_stream.h0000664000175000017500000000604413443450072022632 0ustar00lordyestalordyesta00000000000000/* * UTF-32 stream functions * * Copyright (C) 2008-2019, 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( _LIBUNA_UTF32_STREAM_H ) #define _LIBUNA_UTF32_STREAM_H #include #include #include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN \ int libuna_utf32_stream_copy_byte_order_mark( uint8_t *utf32_stream, size_t utf32_stream_size, size_t *utf32_stream_index, int byte_order, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_stream_size_from_utf8( const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf32_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_stream_copy_from_utf8( uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, const libuna_utf8_character_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_stream_copy_to_utf8 is implemented by * libuna_utf8_string_copy_from_utf32_stream */ LIBUNA_EXTERN \ int libuna_utf32_stream_size_from_utf16( const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, size_t *utf32_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_stream_copy_from_utf16( uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, const libuna_utf16_character_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_stream_copy_to_utf16 is implemented by * libuna_utf16_string_copy_from_utf32_stream */ LIBUNA_EXTERN \ int libuna_utf32_stream_size_from_utf32( const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, size_t *utf32_stream_size, libcerror_error_t **error ); LIBUNA_EXTERN \ int libuna_utf32_stream_copy_from_utf32( uint8_t *utf32_stream, size_t utf32_stream_size, int byte_order, const libuna_utf32_character_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); /* The functionality for libuna_utf32_stream_copy_to_utf32 is implemented by * libuna_utf32_string_copy_from_utf32_stream */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_UTF32_STREAM_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_3.c0000664000175000017500000000641113443450072023645 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-3 codepage (Latin 3) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_3.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-3 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0xfffd, 0x0124, 0x00a7, 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0xfffd, 0x017b, 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0xfffd, 0x017c, 0x00c0, 0x00c1, 0x00c2, 0xfffd, 0x00c4, 0x010a, 0x0108, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0xfffd, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0xfffd, 0x00e4, 0x010b, 0x0109, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0xfffd, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9 }; /* Unicode to ASCII character lookup table for ISO 8859-3 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ 96 ] = { 0xa0, 0x1a, 0x1a, 0xa3, 0xa4, 0x1a, 0x1a, 0xa7, 0xa8, 0x1a, 0x1a, 0x1a, 0x1a, 0xad, 0x1a, 0x1a, 0xb0, 0x1a, 0xb2, 0xb3, 0xb4, 0xb5, 0x1a, 0xb7, 0xb8, 0x1a, 0x1a, 0x1a, 0x1a, 0xbd, 0x1a, 0x1a, 0xc0, 0xc1, 0xc2, 0x1a, 0xc4, 0x1a, 0x1a, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0x1a, 0xd1, 0xd2, 0xd3, 0xd4, 0x1a, 0xd6, 0xd7, 0x1a, 0xd9, 0xda, 0xdb, 0xdc, 0x1a, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0x1a, 0xe4, 0x1a, 0x1a, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x1a, 0xf1, 0xf2, 0xf3, 0xf4, 0x1a, 0xf6, 0xf7, 0x1a, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ 8 ] = { 0xc6, 0xe6, 0xc5, 0xe5, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ 16 ] = { 0x1a, 0x1a, 0x1a, 0x1a, 0xd8, 0xf8, 0xab, 0xbb, 0xd5, 0xf5, 0x1a, 0x1a, 0xa6, 0xb6, 0xa1, 0xb1 }; const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ 8 ] = { 0xa9, 0xb9, 0x1a, 0x1a, 0xac, 0xbc, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ 8 ] = { 0x1a, 0x1a, 0x1a, 0x1a, 0xde, 0xfe, 0xaa, 0xba }; libewf-20140807/libuna/libuna_definitions.h0000664000175000017500000003313013443450072022623 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2008-2019, 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( _LIBUNA_INTERNAL_DEFINITIONS_H ) #define _LIBUNA_INTERNAL_DEFINITIONS_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if !defined( HAVE_LOCAL_LIBUNA ) #include /* The definitions in are copied here * for local use of libuna */ #else #include #define LIBUNA_VERSION 20190102 /* The libuna version string */ #define LIBUNA_VERSION_STRING "20190102" /* The endian definitions */ #define LIBUNA_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBUNA_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE /* The codepage definitions */ enum LIBUNA_CODEPAGES { LIBUNA_CODEPAGE_ASCII = 20127, LIBUNA_CODEPAGE_ISO_8859_1 = 28591, LIBUNA_CODEPAGE_ISO_8859_2 = 28592, LIBUNA_CODEPAGE_ISO_8859_3 = 28593, LIBUNA_CODEPAGE_ISO_8859_4 = 28594, LIBUNA_CODEPAGE_ISO_8859_5 = 28595, LIBUNA_CODEPAGE_ISO_8859_6 = 28596, LIBUNA_CODEPAGE_ISO_8859_7 = 28597, LIBUNA_CODEPAGE_ISO_8859_8 = 28598, LIBUNA_CODEPAGE_ISO_8859_9 = 28599, LIBUNA_CODEPAGE_ISO_8859_10 = 28600, LIBUNA_CODEPAGE_ISO_8859_11 = 28601, LIBUNA_CODEPAGE_ISO_8859_13 = 28603, LIBUNA_CODEPAGE_ISO_8859_14 = 28604, LIBUNA_CODEPAGE_ISO_8859_15 = 28605, LIBUNA_CODEPAGE_ISO_8859_16 = 28606, LIBUNA_CODEPAGE_KOI8_R = 20866, LIBUNA_CODEPAGE_KOI8_U = 21866, LIBUNA_CODEPAGE_OEM_437 = 437, LIBUNA_CODEPAGE_OEM_720 = 720, LIBUNA_CODEPAGE_OEM_737 = 737, LIBUNA_CODEPAGE_OEM_775 = 775, LIBUNA_CODEPAGE_OEM_850 = 850, LIBUNA_CODEPAGE_OEM_852 = 852, LIBUNA_CODEPAGE_OEM_855 = 855, LIBUNA_CODEPAGE_OEM_857 = 857, LIBUNA_CODEPAGE_OEM_858 = 858, LIBUNA_CODEPAGE_OEM_862 = 862, LIBUNA_CODEPAGE_OEM_866 = 866, LIBUNA_CODEPAGE_WINDOWS_874 = 874, LIBUNA_CODEPAGE_WINDOWS_932 = 932, LIBUNA_CODEPAGE_WINDOWS_936 = 936, LIBUNA_CODEPAGE_WINDOWS_949 = 949, LIBUNA_CODEPAGE_WINDOWS_950 = 950, LIBUNA_CODEPAGE_WINDOWS_1250 = 1250, LIBUNA_CODEPAGE_WINDOWS_1251 = 1251, LIBUNA_CODEPAGE_WINDOWS_1252 = 1252, LIBUNA_CODEPAGE_WINDOWS_1253 = 1253, LIBUNA_CODEPAGE_WINDOWS_1254 = 1254, LIBUNA_CODEPAGE_WINDOWS_1255 = 1255, LIBUNA_CODEPAGE_WINDOWS_1256 = 1256, LIBUNA_CODEPAGE_WINDOWS_1257 = 1257, LIBUNA_CODEPAGE_WINDOWS_1258 = 1258 }; #define LIBUNA_CODEPAGE_US_ASCII LIBUNA_CODEPAGE_ASCII #define LIBUNA_CODEPAGE_ISO_WESTERN_EUROPEAN LIBUNA_CODEPAGE_ISO_8859_1 #define LIBUNA_CODEPAGE_ISO_CENTRAL_EUROPEAN LIBUNA_CODEPAGE_ISO_8859_2 #define LIBUNA_CODEPAGE_ISO_SOUTH_EUROPEAN LIBUNA_CODEPAGE_ISO_8859_3 #define LIBUNA_CODEPAGE_ISO_NORTH_EUROPEAN LIBUNA_CODEPAGE_ISO_8859_4 #define LIBUNA_CODEPAGE_ISO_CYRILLIC LIBUNA_CODEPAGE_ISO_8859_5 #define LIBUNA_CODEPAGE_ISO_ARABIC LIBUNA_CODEPAGE_ISO_8859_6 #define LIBUNA_CODEPAGE_ISO_GREEK LIBUNA_CODEPAGE_ISO_8859_7 #define LIBUNA_CODEPAGE_ISO_HEBREW LIBUNA_CODEPAGE_ISO_8859_8 #define LIBUNA_CODEPAGE_ISO_TURKISH LIBUNA_CODEPAGE_ISO_8859_9 #define LIBUNA_CODEPAGE_ISO_NORDIC LIBUNA_CODEPAGE_ISO_8859_10 #define LIBUNA_CODEPAGE_ISO_THAI LIBUNA_CODEPAGE_ISO_8859_11 #define LIBUNA_CODEPAGE_ISO_BALTIC LIBUNA_CODEPAGE_ISO_8859_13 #define LIBUNA_CODEPAGE_ISO_CELTIC LIBUNA_CODEPAGE_ISO_8859_14 #define LIBUNA_CODEPAGE_ISO_LATIN_1 LIBUNA_CODEPAGE_ISO_8859_1 #define LIBUNA_CODEPAGE_ISO_LATIN_2 LIBUNA_CODEPAGE_ISO_8859_2 #define LIBUNA_CODEPAGE_ISO_LATIN_3 LIBUNA_CODEPAGE_ISO_8859_3 #define LIBUNA_CODEPAGE_ISO_LATIN_4 LIBUNA_CODEPAGE_ISO_8859_4 #define LIBUNA_CODEPAGE_ISO_LATIN_5 LIBUNA_CODEPAGE_ISO_8859_9 #define LIBUNA_CODEPAGE_ISO_LATIN_6 LIBUNA_CODEPAGE_ISO_8859_10 #define LIBUNA_CODEPAGE_ISO_LATIN_7 LIBUNA_CODEPAGE_ISO_8859_13 #define LIBUNA_CODEPAGE_ISO_LATIN_8 LIBUNA_CODEPAGE_ISO_8859_14 #define LIBUNA_CODEPAGE_ISO_LATIN_9 LIBUNA_CODEPAGE_ISO_8859_15 #define LIBUNA_CODEPAGE_ISO_LATIN_10 LIBUNA_CODEPAGE_ISO_8859_16 #define LIBUNA_CODEPAGE_KOI8_RUSSIAN LIBUNA_CODEPAGE_KOI8_R #define LIBUNA_CODEPAGE_KOI8_UKRAINIAN LIBUNA_CODEPAGE_KOI8_U #define LIBUNA_CODEPAGE_OEM_874 LIBUNA_CODEPAGE_WINDOWS_874 #define LIBUNA_CODEPAGE_OEM_932 LIBUNA_CODEPAGE_WINDOWS_932 #define LIBUNA_CODEPAGE_OEM_936 LIBUNA_CODEPAGE_WINDOWS_936 #define LIBUNA_CODEPAGE_OEM_949 LIBUNA_CODEPAGE_WINDOWS_949 #define LIBUNA_CODEPAGE_OEM_950 LIBUNA_CODEPAGE_WINDOWS_950 #define LIBUNA_CODEPAGE_OEM_1258 LIBUNA_CODEPAGE_WINDOWS_1258 #define LIBUNA_CODEPAGE_OEM_US_ENGLISH LIBUNA_CODEPAGE_OEM_437 #define LIBUNA_CODEPAGE_OEM_ARABIC LIBUNA_CODEPAGE_OEM_720 #define LIBUNA_CODEPAGE_OEM_GREEK LIBUNA_CODEPAGE_OEM_737 #define LIBUNA_CODEPAGE_OEM_BALTIC LIBUNA_CODEPAGE_OEM_775 #define LIBUNA_CODEPAGE_OEM_LATIN_1 LIBUNA_CODEPAGE_OEM_850 #define LIBUNA_CODEPAGE_OEM_LATIN_2 LIBUNA_CODEPAGE_OEM_852 #define LIBUNA_CODEPAGE_OEM_CYRILLIC LIBUNA_CODEPAGE_OEM_855 #define LIBUNA_CODEPAGE_OEM_TURKISH LIBUNA_CODEPAGE_OEM_857 #define LIBUNA_CODEPAGE_OEM_LATIN_1_WITH_EURO LIBUNA_CODEPAGE_OEM_858 #define LIBUNA_CODEPAGE_OEM_HEBREW LIBUNA_CODEPAGE_OEM_862 #define LIBUNA_CODEPAGE_OEM_RUSSIAN LIBUNA_CODEPAGE_OEM_866 #define LIBUNA_CODEPAGE_OEM_THAI LIBUNA_CODEPAGE_WINDOWS_874 #define LIBUNA_CODEPAGE_OEM_JAPANESE LIBUNA_CODEPAGE_WINDOWS_932 #define LIBUNA_CODEPAGE_OEM_CHINESE_SIMPLIFIED LIBUNA_CODEPAGE_WINDOWS_936 #define LIBUNA_CODEPAGE_OEM_KOREAN LIBUNA_CODEPAGE_WINDOWS_949 #define LIBUNA_CODEPAGE_OEM_CHINESE_TRADITIONAL LIBUNA_CODEPAGE_WINDOWS_950 #define LIBUNA_CODEPAGE_OEM_VIETNAMESE LIBUNA_CODEPAGE_WINDOWS_1258 #define LIBUNA_CODEPAGE_WINDOWS_THAI LIBUNA_CODEPAGE_WINDOWS_874 #define LIBUNA_CODEPAGE_WINDOWS_JAPANESE LIBUNA_CODEPAGE_WINDOWS_932 #define LIBUNA_CODEPAGE_WINDOWS_CHINESE_SIMPLIFIED LIBUNA_CODEPAGE_WINDOWS_936 #define LIBUNA_CODEPAGE_WINDOWS_KOREAN LIBUNA_CODEPAGE_WINDOWS_949 #define LIBUNA_CODEPAGE_WINDOWS_CHINESE_TRADITIONAL LIBUNA_CODEPAGE_WINDOWS_950 #define LIBUNA_CODEPAGE_WINDOWS_CENTRAL_EUROPEAN LIBUNA_CODEPAGE_WINDOWS_1250 #define LIBUNA_CODEPAGE_WINDOWS_CYRILLIC LIBUNA_CODEPAGE_WINDOWS_1251 #define LIBUNA_CODEPAGE_WINDOWS_WESTERN_EUROPEAN LIBUNA_CODEPAGE_WINDOWS_1252 #define LIBUNA_CODEPAGE_WINDOWS_GREEK LIBUNA_CODEPAGE_WINDOWS_1253 #define LIBUNA_CODEPAGE_WINDOWS_TURKISH LIBUNA_CODEPAGE_WINDOWS_1254 #define LIBUNA_CODEPAGE_WINDOWS_HEBREW LIBUNA_CODEPAGE_WINDOWS_1255 #define LIBUNA_CODEPAGE_WINDOWS_ARABIC LIBUNA_CODEPAGE_WINDOWS_1256 #define LIBUNA_CODEPAGE_WINDOWS_BALTIC LIBUNA_CODEPAGE_WINDOWS_1257 #define LIBUNA_CODEPAGE_WINDOWS_VIETNAMESE LIBUNA_CODEPAGE_WINDOWS_1258 #define LIBUNA_CODEPAGE_SHIFT_JIS LIBUNA_CODEPAGE_WINDOWS_932 #define LIBUNA_CODEPAGE_GB2312 LIBUNA_CODEPAGE_WINDOWS_936 /* The comparison function definitions */ enum LIBUNA_COMPARE_DEFINITIONS { /* The first string is less than the second string */ LIBUNA_COMPARE_LESS, /* The first and second strings are equal */ LIBUNA_COMPARE_EQUAL, /* The first string is greater than the second string */ LIBUNA_COMPARE_GREATER }; /* Base16 variants * Byte: * 0 - 1 Character limit * 2 - 3 Reserved * 4 Case (0 not supported) * 5 - 6 Reserved * 7 String encoding (0 is byte stream) */ enum LIBUNA_BASE16_VARIANTS { LIBUNA_BASE16_VARIANT_CASE_LOWER = 0x00010000UL, LIBUNA_BASE16_VARIANT_CASE_MIXED = 0x00020000UL, LIBUNA_BASE16_VARIANT_CASE_UPPER = 0x00030000UL, LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE = 0x00000000UL, LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_64 = 0x00000040UL, LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_76 = 0x0000004cUL, LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN = 0x10000000UL, LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN = 0x20000000UL, LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN = 0x30000000UL, LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN = 0x40000000UL }; #define LIBUNA_BASE16_VARIANT_ENCODING_BYTE_STREAM 0 #define LIBUNA_BASE16_VARIANT_RFC4648 \ LIBUNA_BASE16_VARIANT_CASE_MIXED | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE /* Base16 processing flags */ enum LIBUNA_BASE16_FLAGS { LIBUNA_BASE16_FLAG_STRIP_WHITESPACE = 0x01 }; /* Base32 variants * Byte: * 0 - 1 Character limit * 2 - 3 Reserved * 4 Alphabet type (0 not supported) * 5 Reserved * 6 Padding (0 not supported) * 7 String encoding (0 is byte stream) */ enum LIBUNA_BASE32_VARIANTS { LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL = 0x00010000UL, LIBUNA_BASE32_VARIANT_ALPHABET_HEX = 0x00020000UL, LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE = 0x00000000UL, LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_64 = 0x00000040UL, LIBUNA_BASE32_VARIANT_PADDING_NONE = 0x01000000UL, LIBUNA_BASE32_VARIANT_PADDING_OPTIONAL = 0x02000000UL, LIBUNA_BASE32_VARIANT_PADDING_REQUIRED = 0x03000000UL, LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN = 0x10000000UL, LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN = 0x20000000UL, LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN = 0x30000000UL, LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN = 0x40000000UL }; #define LIBUNA_BASE32_VARIANT_RFC4648 \ LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED #define LIBUNA_BASE32_VARIANT_HEX \ LIBUNA_BASE32_VARIANT_ALPHABET_HEX | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED /* Base32 processing flags */ enum LIBUNA_BASE32_FLAGS { LIBUNA_BASE32_FLAG_STRIP_WHITESPACE = 0x01 }; /* Base64 variants * Byte: * 0 - 1 Character limit * 2 - 3 Reserved * 4 Alphabet type (0 not supported) * 5 Reserved * 6 Padding (0 not supported) * 7 String encoding (0 is byte stream) */ enum LIBUNA_BASE64_VARIANTS { LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL = 0x00010000UL, LIBUNA_BASE64_VARIANT_ALPHABET_URL = 0x00020000UL, LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE = 0x00000000UL, LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_64 = 0x00000040UL, LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_76 = 0x0000004cUL, /* No padding */ LIBUNA_BASE64_VARIANT_PADDING_NONE = 0x01000000UL, /* Padding is optional */ LIBUNA_BASE64_VARIANT_PADDING_OPTIONAL = 0x02000000UL, /* Padding is required */ LIBUNA_BASE64_VARIANT_PADDING_REQUIRED = 0x03000000UL, /* Invalid base64 characters are considered padding */ LIBUNA_BASE64_VARIANT_PADDING_INVALID = 0x04000000UL, LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN = 0x10000000UL, LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN = 0x20000000UL, LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN = 0x30000000UL, LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN = 0x40000000UL }; #define LIBUNA_BASE64_VARIANT_RFC1421 \ LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_64 | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED #define LIBUNA_BASE64_VARIANT_PEM \ LIBUNA_BASE64_VARIANT_RFC1421 #define LIBUNA_BASE64_VARIANT_RFC1642 \ LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_NONE #define LIBUNA_BASE64_VARIANT_UTF7 \ LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_INVALID #define LIBUNA_BASE64_VARIANT_RFC2045 \ LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_76 | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED #define LIBUNA_BASE64_VARIANT_MIME \ LIBUNA_BASE64_VARIANT_RFC2045 #define LIBUNA_BASE64_VARIANT_URL \ LIBUNA_BASE64_VARIANT_ALPHABET_URL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_OPTIONAL /* TODO #define LIBUNA_BASE64_VARIANT_RFC3548 #define LIBUNA_BASE64_VARIANT_RFC4648 */ /* Base64 processing flags */ enum LIBUNA_BASE64_FLAGS { LIBUNA_BASE64_FLAG_STRIP_WHITESPACE = 0x01 }; #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ #define LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM 0 #define LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM 0 /* Character case definitions */ enum LIBUNA_CASE { LIBUNA_CASE_LOWER = (uint8_t) 'l', LIBUNA_CASE_MIXED = (uint8_t) 'm', LIBUNA_CASE_UPPER = (uint8_t) 'u' }; /* Strip mode definitions */ enum LIBUNA_STRIP_MODES { LIBUNA_STRIP_MODE_LEADING_WHITESPACE, LIBUNA_STRIP_MODE_NON_WHITESPACE, LIBUNA_STRIP_MODE_TRAILING_WHITESPACE, LIBUNA_STRIP_MODE_INVALID_CHARACTER }; /* Character definitions */ #define LIBUNA_UNICODE_REPLACEMENT_CHARACTER 0x0000fffdUL #define LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX 0x0000ffffUL #define LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START 0x0000dc00UL #define LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END 0x0000dfffUL #define LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START 0x0000d800UL #define LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END 0x0000dbffUL #define LIBUNA_UNICODE_CHARACTER_MAX 0x0010ffffUL #define LIBUNA_UTF16_CHARACTER_MAX 0x0010ffffUL #define LIBUNA_UTF32_CHARACTER_MAX 0x7fffffffUL #define LIBUNA_ASCII_REPLACEMENT_CHARACTER 0x1a /* UTF-7 definitions */ #define LIBUNA_UTF7_IS_BASE64_ENCODED 0x80000000UL #endif /* !defined( _LIBUNA_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1255.h0000664000175000017500000000322713443450072024311 0ustar00lordyestalordyesta00000000000000/* * Windows 1255 codepage (Hebrew) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1255_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1255_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05b0[ 24 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05d0[ 40 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1255_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_14.c0000664000175000017500000000541113443450072023726 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-14 codepage (Celtic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_14.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-14 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff }; /* Unicode to ASCII character lookup table for ISO 8859-14 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ 64 ] = { 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0x1a, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x1a, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x1a, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0x1a, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0x1a, 0xff, }; const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ 8 ] = { 0x1a, 0x1a, 0x1a, 0x1a, 0xd0, 0xf0, 0xde, 0xfe }; const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ 8 ] = { 0xa8, 0xb8, 0xaa, 0xba, 0xbd, 0xbe, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_codepage_iso_8859_13.c0000664000175000017500000000712213443450072023726 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-13 codepage (Baltic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_13.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-13 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019 }; /* Unicode to ASCII character lookup table for ISO 8859-13 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ 224 ] = { 0xa0, 0x1a, 0xa2, 0xa3, 0xa4, 0x1a, 0xa6, 0xa7, 0x1a, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0x1a, 0xb0, 0xb1, 0xb2, 0xb3, 0x1a, 0xb5, 0xb6, 0xb7, 0x1a, 0xb9, 0x1a, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc4, 0xc5, 0xaf, 0x1a, 0x1a, 0xc9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd3, 0x1a, 0xd5, 0xd6, 0xd7, 0xa8, 0x1a, 0x1a, 0x1a, 0xdc, 0x1a, 0x1a, 0xdf, 0x1a, 0x1a, 0x1a, 0x1a, 0xe4, 0xe5, 0xbf, 0x1a, 0x1a, 0xe9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf3, 0x1a, 0xf5, 0xf6, 0xf7, 0xb8, 0x1a, 0x1a, 0x1a, 0xfc, 0x1a, 0x1a, 0x1a, 0xc2, 0xe2, 0x1a, 0x1a, 0xc0, 0xe0, 0xc3, 0xe3, 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0x1a, 0x1a, 0x1a, 0x1a, 0xc7, 0xe7, 0x1a, 0x1a, 0xcb, 0xeb, 0xc6, 0xe6, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xcc, 0xec, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xce, 0xee, 0x1a, 0x1a, 0xc1, 0xe1, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xcd, 0xed, 0x1a, 0x1a, 0x1a, 0xcf, 0xef, 0x1a, 0x1a, 0x1a, 0x1a, 0xd9, 0xf9, 0xd1, 0xf1, 0xd2, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd4, 0xf4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xaa, 0xba, 0x1a, 0x1a, 0xda, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0xd0, 0xf0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xdb, 0xfb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd8, 0xf8, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xca, 0xea, 0xdd, 0xfd, 0xde, 0xfe, 0x1a }; const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ 8 ] = { 0x1a, 0xff, 0x1a, 0x1a, 0xb4, 0xa1, 0xa5, 0x1a }; libewf-20140807/libuna/libuna_codepage_iso_8859_8.h0000664000175000017500000000265213443450072023662 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-8 codepage (Hebrew) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_8_H ) #define _LIBUNA_CODEPAGE_ISO_8859_8_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ 32 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ 32 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_8_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_9.c0000664000175000017500000000400713443450072023652 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-9 codepage (Turkish) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_9.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-9 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ 48 ] = { 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff }; /* Unicode to ASCII character lookup table for ISO 8859-9 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ 48 ] = { 0x1a, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x1a, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x1a, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a, 0x1a, 0xff }; libewf-20140807/libuna/libuna_codepage_windows_1254.c0000664000175000017500000000507513443450072024306 0ustar00lordyestalordyesta00000000000000/* * Windows 1254 codepage (Turkish) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1254.h" /* Extended ASCII to Unicode character lookup table for Windows 1254 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ 32 ] = { 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0xfffd, 0xfffd, 0x0178, }; const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xd0[ 16 ] = { 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, }; const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xf0[ 16 ] = { 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, }; /* Unicode to ASCII character lookup table for Windows 1254 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ 48 ] = { 0x1a, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x1a, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x1a, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a, 0x1a, 0xff, }; const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a, }; libewf-20140807/libuna/libuna_codepage_windows_1258.c0000664000175000017500000000604313443450072024306 0ustar00lordyestalordyesta00000000000000/* * Windows 1258 codepage (Vietnamese) functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_windows_1258.h" /* Extended ASCII to Unicode character lookup table for Windows 1258 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0xfffd, 0x2039, 0x0152, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0xfffd, 0x203a, 0x0153, 0xfffd, 0xfffd, 0x0178, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x0300, 0x00cd, 0x00ce, 0x00cf, 0x0110, 0x00d1, 0x0309, 0x00d3, 0x00d4, 0x01a0, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x01af, 0x0303, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x0301, 0x00ed, 0x00ee, 0x00ef, 0x0111, 0x00f1, 0x0323, 0x00f3, 0x00f4, 0x01a1, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x01b0, 0x20ab, 0x00ff }; /* Unicode to ASCII character lookup table for Windows 1258 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ 72 ] = { 0xc0, 0xc1, 0xc2, 0x1a, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0x1a, 0xcd, 0xce, 0xcf, 0x1a, 0xd1, 0x1a, 0xd3, 0xd4, 0x1a, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x1a, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0x1a, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0x1a, 0xed, 0xee, 0xef, 0x1a, 0xf1, 0x1a, 0xf3, 0xf4, 0x1a, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a, 0x1a, 0xff, 0x1a, 0x1a, 0xc3, 0xe3, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x2010[ 24 ] = { 0x1a, 0x1a, 0x1a, 0x96, 0x97, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x82, 0x1a, 0x93, 0x94, 0x84, 0x1a, 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; libewf-20140807/libuna/libuna_codepage_iso_8859_15.c0000664000175000017500000000345113443450072023731 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-15 codepage (Latin 9) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_15.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-15 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ 32 ] = { 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf }; /* Unicode to ASCII character lookup table for ISO 8859-15 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0xa1, 0xa2, 0xa3, 0x1a, 0xa5, 0x1a, 0xa7, 0x1a, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0x1a, 0xb5, 0xb6, 0xb7, 0x1a, 0xb9, 0xba, 0xbb, 0x1a, 0x1a, 0x1a, 0xbf }; libewf-20140807/libuna/libuna_codepage_iso_8859_7.c0000664000175000017500000000547313443450072023660 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-7 codepage (Greek) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_7.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-7 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, 0xfffd, 0x2015, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0xfffd, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0xfffd }; /* Unicode to ASCII character lookup table for ISO 8859-7 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ 24 ] = { 0xa0, 0x1a, 0x1a, 0xa3, 0x1a, 0x1a, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0x1a, 0x1a, 0xb0, 0xb1, 0xb2, 0xb3, 0x1a, 0x1a, 0x1a, 0xb7 }; const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ 80 ] = { 0x1a, 0x1a, 0x1a, 0x1a, 0xb4, 0xb5, 0xb6, 0x1a, 0xb8, 0xb9, 0xba, 0x1a, 0xbc, 0x1a, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0x1a, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x1a }; libewf-20140807/libuna/libuna_codepage_iso_8859_9.h0000664000175000017500000000247613443450072023667 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-9 codepage (Turkish) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_9_H ) #define _LIBUNA_CODEPAGE_ISO_8859_9_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ 48 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ 48 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_9_H ) */ libewf-20140807/libuna/libuna_codepage_windows_1258.h0000664000175000017500000000267513443450072024322 0ustar00lordyestalordyesta00000000000000/* * Windows 1258 codepage (Vietnamese) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_WINDOWS_1258_H ) #define _LIBUNA_CODEPAGE_WINDOWS_1258_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ 128 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ 72 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x2010[ 24 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_WINDOWS_1258_H ) */ libewf-20140807/libuna/libuna_base64_stream.c0000664000175000017500000022157213443450072022753 0ustar00lordyestalordyesta00000000000000/* * Base64 stream functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libuna_base64_stream.h" #include "libuna_definitions.h" #include "libuna_libcerror.h" #include "libuna_types.h" static uint8_t libuna_base64_sixtet_to_character_table[ 64 ] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; static uint8_t libuna_base64url_sixtet_to_character_table[ 64 ] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_' }; /* Copies a base64 character to a base64 sixtet * Returns 1 if successful, 0 if not a valid base64 character or -1 on error */ int libuna_base64_character_copy_to_sixtet( uint32_t base64_character, uint8_t *base64_sixtet, uint32_t base64_variant, libcerror_error_t **error ) { static char *function = "libuna_base64_character_copy_to_sixtet"; uint32_t safe_base64_sixtet = 0; uint8_t base64_character_62 = 0; uint8_t base64_character_63 = 0; if( base64_sixtet == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 sixtet.", function ); return( -1 ); } switch( base64_variant & 0x000f0000UL ) { case LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL: base64_character_62 = (uint8_t) '+'; base64_character_63 = (uint8_t) '/'; break; case LIBUNA_BASE64_VARIANT_ALPHABET_URL: base64_character_62 = (uint8_t) '-'; base64_character_63 = (uint8_t) '_'; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } if( ( base64_character & 0xffffff00UL ) != 0 ) { return( 0 ); } /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( base64_character >= (uint32_t) 'A' ) && ( base64_character <= (uint32_t) 'I' ) ) { safe_base64_sixtet = base64_character - (uint32_t) 'A'; } else if( ( base64_character >= (uint32_t) 'J' ) && ( base64_character <= (uint32_t) 'R' ) ) { safe_base64_sixtet = base64_character - (uint32_t) 'J' + 9; } else if( ( base64_character >= (uint32_t) 'S' ) && ( base64_character <= (uint32_t) 'Z' ) ) { safe_base64_sixtet = base64_character - (uint32_t) 'S' + 18; } /* a-z is not a continous range on an EBCDIC based system * it consists of the ranges: a-i, j-r, s-z */ else if( ( base64_character >= (uint32_t) 'a' ) && ( base64_character <= (uint32_t) 'i' ) ) { safe_base64_sixtet = base64_character - (uint32_t) 'a' + 26; } else if( ( base64_character >= (uint32_t) 'j' ) && ( base64_character <= (uint32_t) 'r' ) ) { safe_base64_sixtet = base64_character - (uint32_t) 'j' + 35; } else if( ( base64_character >= (uint32_t) 's' ) && ( base64_character <= (uint32_t) 'z' ) ) { safe_base64_sixtet = base64_character - (uint32_t) 's' + 44; } else if( ( base64_character >= (uint32_t) '0' ) && ( base64_character <= (uint32_t) '9' ) ) { safe_base64_sixtet = base64_character - (uint32_t) '0' + 52; } else if( base64_character == base64_character_62 ) { safe_base64_sixtet = 62; } else if( base64_character == base64_character_63 ) { safe_base64_sixtet = 63; } else { return( 0 ); } *base64_sixtet = (uint8_t) ( safe_base64_sixtet & 0xff ); return( 1 ); } /* Copies a base64 triplet from a base64 stream * * The padding size will still be set to indicate the number of * sixtets in the triplet * * Returns 1 if successful or -1 on error */ int libuna_base64_triplet_copy_from_base64_stream( uint32_t *base64_triplet, const uint8_t *base64_stream, size_t base64_stream_size, size_t *base64_stream_index, uint8_t *padding_size, uint32_t base64_variant, libcerror_error_t **error ) { static char *function = "libuna_base64_triplet_copy_from_base64_stream"; size_t base64_character_size = 0; size_t safe_base64_stream_index = 0; uint32_t base64_character = 0; uint32_t safe_base64_triplet = 0; uint8_t safe_padding_size = 0; uint8_t sixtet1 = 0; uint8_t sixtet2 = 0; uint8_t sixtet3 = 0; uint8_t sixtet4 = 0; int result = 0; if( base64_triplet == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 triplet.", function ); return( -1 ); } if( base64_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream.", function ); return( -1 ); } if( base64_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base64 stream size value exceeds maximum.", function ); return( -1 ); } if( base64_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream index.", function ); return( -1 ); } if( *base64_stream_index >= base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream string too small.", function ); return( -1 ); } if( padding_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid padding size.", function ); return( -1 ); } switch( base64_variant & 0x0f000000UL ) { case LIBUNA_BASE64_VARIANT_PADDING_NONE: case LIBUNA_BASE64_VARIANT_PADDING_OPTIONAL: case LIBUNA_BASE64_VARIANT_PADDING_REQUIRED: case LIBUNA_BASE64_VARIANT_PADDING_INVALID: break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character_size = 1; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base64_character_size = 2; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base64_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } safe_base64_stream_index = *base64_stream_index; if( ( safe_base64_stream_index + base64_character_size ) > base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 1st base64 character.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character = base64_stream[ safe_base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; result = libuna_base64_character_copy_to_sixtet( base64_character, &sixtet1, base64_variant, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 character to 1st sixtet.", function ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st base64 character.", function ); return( -1 ); } if( ( safe_base64_stream_index + base64_character_size ) > base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 2nd base64 character.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character = base64_stream[ safe_base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; result = libuna_base64_character_copy_to_sixtet( base64_character, &sixtet2, base64_variant, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 character to 2nd sixtet.", function ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd base64 character.", function ); return( -1 ); } safe_padding_size = 2; if( ( safe_base64_stream_index + base64_character_size ) <= base64_stream_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character = base64_stream[ safe_base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; if( ( base64_character & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd base64 character.", function ); return( -1 ); } if( base64_character == (uint32_t) '=' ) { if( ( base64_variant & 0x0f000000UL ) == LIBUNA_BASE64_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: padding where not supposed to - invalid 3rd base64 character.", function ); return( -1 ); } } else { result = libuna_base64_character_copy_to_sixtet( base64_character, &sixtet3, base64_variant, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 character to 3rd sixtet.", function ); return( -1 ); } else if( result == 0 ) { if( ( base64_variant & 0x0f000000UL ) != LIBUNA_BASE64_VARIANT_PADDING_INVALID ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd base64 sixtet.", function ); return( -1 ); } } else { safe_padding_size -= 1; } } } else if( ( base64_variant & 0x0f000000UL ) != LIBUNA_BASE64_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 3rd base64 character.", function ); return( -1 ); } if( ( safe_base64_stream_index + base64_character_size ) <= base64_stream_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character = base64_stream[ safe_base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; if( ( base64_character & 0xffffff00UL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th base64 character.", function ); return( -1 ); } if( base64_character == (uint32_t) '=' ) { if( ( base64_variant & 0x0f000000UL ) == LIBUNA_BASE64_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: padding where not supposed to - invalid 4th base64 character.", function ); return( -1 ); } } else { result = libuna_base64_character_copy_to_sixtet( base64_character, &sixtet4, base64_variant, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 character to 4th sixtet.", function ); return( -1 ); } else if( result == 0 ) { if( ( base64_variant & 0x0f000000UL ) != LIBUNA_BASE64_VARIANT_PADDING_INVALID ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th base64 sixtet.", function ); return( -1 ); } } else { if( safe_padding_size > 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: non-padding where not supposed to - invalid 4th base64 character.", function ); return( -1 ); } safe_padding_size -= 1; } } } else if( ( base64_variant & 0x0f000000UL ) != LIBUNA_BASE64_VARIANT_PADDING_NONE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: missing 4th base64 character.", function ); return( -1 ); } safe_base64_triplet = sixtet1; safe_base64_triplet <<= 6; safe_base64_triplet |= sixtet2; safe_base64_triplet <<= 6; safe_base64_triplet |= sixtet3; safe_base64_triplet <<= 6; safe_base64_triplet |= sixtet4; *base64_triplet = safe_base64_triplet; *base64_stream_index = safe_base64_stream_index; *padding_size = safe_padding_size; return( 1 ); } /* Copies a base64 triplet to a base64 stream * Returns 1 if successful or -1 on error */ int libuna_base64_triplet_copy_to_base64_stream( uint32_t base64_triplet, uint8_t *base64_stream, size_t base64_stream_size, size_t *base64_stream_index, uint8_t padding_size, uint32_t base64_variant, libcerror_error_t **error ) { uint8_t *sixtet_to_character_table = NULL; static char *function = "libuna_base64_triplet_copy_to_base64_stream"; size_t base64_character_size = 0; size_t safe_base64_stream_index = 0; uint32_t base64_character = 0; uint8_t padding_character = 0; uint8_t sixtet1 = 0; uint8_t sixtet2 = 0; uint8_t sixtet3 = 0; uint8_t sixtet4 = 0; if( base64_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream.", function ); return( -1 ); } if( base64_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base64 stream size value exceeds maximum.", function ); return( -1 ); } if( base64_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream index.", function ); return( -1 ); } if( *base64_stream_index >= base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream string too small.", function ); return( -1 ); } if( padding_size > 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid padding size value out of bounds.", function ); return( -1 ); } switch( base64_variant & 0x000f0000UL ) { case LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL: sixtet_to_character_table = libuna_base64_sixtet_to_character_table; break; case LIBUNA_BASE64_VARIANT_ALPHABET_URL: sixtet_to_character_table = libuna_base64url_sixtet_to_character_table; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0x0f000000UL ) { case LIBUNA_BASE64_VARIANT_PADDING_NONE: case LIBUNA_BASE64_VARIANT_PADDING_OPTIONAL: case LIBUNA_BASE64_VARIANT_PADDING_INVALID: padding_character = 0; break; case LIBUNA_BASE64_VARIANT_PADDING_REQUIRED: padding_character = (uint8_t) '='; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character_size = 1; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base64_character_size = 2; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base64_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } safe_base64_stream_index = *base64_stream_index; /* Separate the 3 bytes value into 4 x 6 bit values */ sixtet4 = (uint8_t) ( base64_triplet & 0x3f ); base64_triplet >>= 6; sixtet3 = (uint8_t) ( base64_triplet & 0x3f ); base64_triplet >>= 6; sixtet2 = (uint8_t) ( base64_triplet & 0x3f ); base64_triplet >>= 6; sixtet1 = (uint8_t) ( base64_triplet & 0x3f ); /* Spread the encoding over 2 characters if 1 byte is available */ if( ( safe_base64_stream_index + ( base64_character_size * 2 ) ) > base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream is too small.", function ); return( -1 ); } base64_character = sixtet_to_character_table[ sixtet1 ]; switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_stream[ safe_base64_stream_index ] = (uint8_t) base64_character; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; base64_character = sixtet_to_character_table[ sixtet2 ]; switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_stream[ safe_base64_stream_index ] = (uint8_t) base64_character; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; /* Spread the encoding over 3 characters if 2 bytes are available * Otherwise pad the remaining bytes if required */ if( ( safe_base64_stream_index + base64_character_size ) > base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream is too small.", function ); return( -1 ); } if( ( padding_size < 2 ) || ( padding_character != 0 ) ) { if( padding_size < 2 ) { base64_character = sixtet_to_character_table[ sixtet3 ]; } else if( padding_character != 0 ) { base64_character = padding_character; } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_stream[ safe_base64_stream_index ] = (uint8_t) base64_character; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; } /* Spread the encoding over 4 characters if 3 bytes are available * Otherwise pad the remaining bytes if required */ if( ( safe_base64_stream_index + base64_character_size ) > base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream is too small.", function ); return( -1 ); } if( ( padding_size < 1 ) || ( padding_character != 0 ) ) { if( padding_size < 1 ) { base64_character = sixtet_to_character_table[ sixtet4 ]; } else if( padding_character != 0 ) { base64_character = padding_character; } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_stream[ safe_base64_stream_index ] = (uint8_t) base64_character; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; } *base64_stream_index = safe_base64_stream_index; return( 1 ); } /* Copies a base64 triplet from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base64_triplet_copy_from_byte_stream( uint32_t *base64_triplet, const uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t *padding_size, libcerror_error_t **error ) { static char *function = "libuna_base64_triplet_copy_from_byte_stream"; size_t safe_byte_stream_index = 0; uint32_t safe_base64_triplet = 0; uint8_t safe_padding_size = 0; if( base64_triplet == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 triplet.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } if( padding_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid padding size.", function ); return( -1 ); } safe_byte_stream_index = *byte_stream_index; /* Determine the value of 3 bytes (24 bits) */ safe_base64_triplet = byte_stream[ safe_byte_stream_index++ ]; safe_padding_size = 2; safe_base64_triplet <<= 8; if( safe_byte_stream_index < byte_stream_size ) { safe_base64_triplet |= byte_stream[ safe_byte_stream_index++ ]; safe_padding_size -= 1; } safe_base64_triplet <<= 8; if( safe_byte_stream_index < byte_stream_size ) { safe_base64_triplet |= byte_stream[ safe_byte_stream_index++ ]; safe_padding_size -= 1; } *base64_triplet = safe_base64_triplet; *byte_stream_index = safe_byte_stream_index; *padding_size = safe_padding_size; return( 1 ); } /* Copies a base64 triplet to a byte stream * Returns 1 if successful or -1 on error */ int libuna_base64_triplet_copy_to_byte_stream( uint32_t base64_triplet, uint8_t *byte_stream, size_t byte_stream_size, size_t *byte_stream_index, uint8_t padding_size, libcerror_error_t **error ) { static char *function = "libuna_base64_triplet_copy_to_byte_stream"; size_t safe_byte_stream_index = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream index.", function ); return( -1 ); } if( *byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } if( padding_size > 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid padding size value out of bounds.", function ); return( -1 ); } safe_byte_stream_index = *byte_stream_index; byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( ( base64_triplet >> 16 ) & 0xff ); if( padding_size <= 1 ) { if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream string too small.", function ); return( -1 ); } byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( ( base64_triplet >> 8 ) & 0xff ); } if( padding_size == 0 ) { if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte stream is too small.", function ); return( -1 ); } byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( base64_triplet & 0xff ); } *byte_stream_index = safe_byte_stream_index; return( 1 ); } /* Determines the size of a byte stream from a base64 stream * * LIBUNA_BASE64_FLAG_STRIP_WHITESPACE removes leading space and tab characters, * and trailing space, tab and end of line characters * * Returns 1 if successful or -1 on error */ int libuna_base64_stream_size_to_byte_stream( const uint8_t *base64_stream, size_t base64_stream_size, size_t *byte_stream_size, uint32_t base64_variant, uint8_t flags, libcerror_error_t **error ) { static char *function = "libuna_base64_stream_size_to_byte_stream"; size_t base64_character_size = 0; size_t base64_stream_index = 0; size_t number_of_characters = 0; size_t safe_byte_stream_size = 0; size_t whitespace_size = 0; uint32_t base64_character1 = 0; uint32_t base64_character2 = 0; uint8_t base64_character_62 = 0; uint8_t base64_character_63 = 0; uint8_t character_limit = 0; uint8_t padding_size = 0; uint8_t strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; if( base64_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream.", function ); return( -1 ); } if( ( base64_stream_size == 0 ) || ( base64_stream_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid base64 stream size value out of bounds.", function ); return( -1 ); } if( byte_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream size.", function ); return( -1 ); } switch( base64_variant & 0x000000ffUL ) { case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0x000f0000UL ) { case LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL: base64_character_62 = (uint8_t) '+'; base64_character_63 = (uint8_t) '/'; break; case LIBUNA_BASE64_VARIANT_ALPHABET_URL: base64_character_62 = (uint8_t) '-'; base64_character_63 = (uint8_t) '_'; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character_size = 1; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base64_character_size = 2; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base64_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } if( base64_stream_size < base64_character_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid base64 stream value too small.", function ); return( -1 ); } if( ( flags & ~( LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags.", function ); return( -1 ); } base64_stream_index = base64_stream_size - base64_character_size; whitespace_size = 0; while( base64_stream_index > base64_character_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } base64_stream_index -= base64_character_size; if( ( base64_character1 == (uint32_t) '\n' ) || ( base64_character1 == (uint32_t) '\r' ) ) { whitespace_size += base64_character_size; } else if( ( flags & LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) == 0 ) { break; } else if( ( base64_character1 == (uint32_t) ' ' ) || ( base64_character1 == (uint32_t) '\t' ) || ( base64_character1 == (uint32_t) '\v' ) ) { whitespace_size += base64_character_size; } else { break; } } base64_stream_size -= whitespace_size; base64_stream_index = base64_stream_size - base64_character_size; if( base64_stream_size < base64_character_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid base64 stream value too small.", function ); return( -1 ); } if( base64_stream_index > base64_character_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } base64_stream_index -= base64_character_size; if( base64_character1 == (uint32_t) '=' ) { padding_size += 1; } } if( base64_stream_index > base64_character_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } base64_stream_index -= base64_character_size; if( base64_character1 == (uint32_t) '=' ) { padding_size += 1; } } if( base64_stream_index > base64_character_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } if( base64_character1 == (uint32_t) '=' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid number of padding bytes.", function ); return( -1 ); } } base64_stream_index = 0; whitespace_size = 0; while( base64_stream_index < ( base64_stream_size - ( padding_size * base64_character_size ) ) ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } base64_stream_index += base64_character_size; if( ( base64_character1 == (uint32_t) '\n' ) || ( base64_character1 == (uint32_t) '\r' ) ) { if( ( strip_mode != LIBUNA_STRIP_MODE_NON_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { if( ( base64_stream_index + base64_character_size ) < base64_stream_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character2 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; } if( ( base64_character2 == (uint32_t) '\n' ) || ( base64_character2 == (uint32_t) '\r' ) ) { base64_stream_index += base64_character_size; whitespace_size += base64_character_size; } } strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; } if( ( number_of_characters != 0 ) && ( character_limit != 0 ) ) { if( number_of_characters != (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in line does not match character limit.", function ); return( -1 ); } number_of_characters = 0; } whitespace_size += base64_character_size; } else if( ( base64_character1 == (uint32_t) ' ' ) || ( base64_character1 == (uint32_t) '\t' ) || ( base64_character1 == (uint32_t) '\v' ) ) { if( ( flags & LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) != 0 ) { if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_TRAILING_WHITESPACE; } if( ( strip_mode != LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { whitespace_size += base64_character_size; } } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else if( strip_mode == LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } else if( strip_mode == LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z */ if( ( base64_character1 >= (uint32_t) 'A' ) && ( base64_character1 <= (uint32_t) 'I' ) ) { number_of_characters++; } else if( ( base64_character1 >= (uint32_t) 'J' ) && ( base64_character1 <= (uint32_t) 'R' ) ) { number_of_characters++; } else if( ( base64_character1 >= (uint32_t) 'S' ) && ( base64_character1 <= (uint32_t) 'Z' ) ) { number_of_characters++; } /* a-z is not a continous range on an EBCDIC based system * it consists of the ranges: a-i, j-r, s-z */ else if( ( base64_character1 >= (uint32_t) 'a' ) && ( base64_character1 <= (uint32_t) 'i' ) ) { number_of_characters++; } else if( ( base64_character1 >= (uint32_t) 'j' ) && ( base64_character1 <= (uint32_t) 'r' ) ) { number_of_characters++; } else if( ( base64_character1 >= (uint32_t) 's' ) && ( base64_character1 <= (uint32_t) 'z' ) ) { number_of_characters++; } else if( ( base64_character1 >= (uint32_t) '0' ) && ( base64_character1 <= (uint32_t) '9' ) ) { number_of_characters++; } else if( ( base64_character1 == (uint32_t) base64_character_62 ) || ( base64_character1 == (uint32_t) base64_character_63 ) ) { number_of_characters++; } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid character in base64 stream at index: %" PRIzd ".", function, base64_stream_index - base64_character_size ); return( -1 ); } } if( character_limit != 0 ) { if( number_of_characters > (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in last line exceed maximum.", function ); return( -1 ); } } base64_stream_size -= whitespace_size; /* Make sure the byte stream is able to hold * at least 3 bytes for each 4 base64 characters */ base64_character_size *= 4; safe_byte_stream_size = base64_stream_size / base64_character_size; if( ( base64_stream_size % base64_character_size ) != 0 ) { safe_byte_stream_size += 1; } safe_byte_stream_size *= 3; /* The padding size contains the number of bytes to correct */ *byte_stream_size = safe_byte_stream_size - padding_size; return( 1 ); } /* Copies a byte stream from a base64 stream * * LIBUNA_BASE64_FLAG_STRIP_WHITESPACE removes leading space and tab characters, * and trailing space, tab and end of line characters * * Returns 1 if successful or -1 on error */ int libuna_base64_stream_copy_to_byte_stream( const uint8_t *base64_stream, size_t base64_stream_size, uint8_t *byte_stream, size_t byte_stream_size, uint32_t base64_variant, uint8_t flags, libcerror_error_t **error ) { static char *function = "libuna_base64_stream_copy_to_byte_stream"; size_t base64_character_size = 0; size_t base64_stream_index = 0; size_t byte_stream_index = 0; size_t number_of_characters = 0; size_t whitespace_size = 0; uint32_t base64_character1 = 0; uint32_t base64_character2 = 0; uint32_t base64_triplet = 0; uint8_t character_limit = 0; uint8_t padding_size = 0; uint8_t strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; if( base64_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream.", function ); return( -1 ); } if( base64_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base64 stream size value exceeds maximum.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } switch( base64_variant & 0x000000ffUL ) { case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character_size = 1; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base64_character_size = 2; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base64_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } if( base64_stream_size < base64_character_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid base64 stream value too small.", function ); return( -1 ); } if( ( flags & ~( LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags.", function ); return( -1 ); } base64_stream_index = base64_stream_size - base64_character_size; whitespace_size = 0; while( base64_stream_index > base64_character_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } base64_stream_index -= base64_character_size; if( ( base64_character1 == (uint32_t) '\n' ) || ( base64_character1 == (uint32_t) '\r' ) ) { whitespace_size += base64_character_size; } else if( ( flags & LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) == 0 ) { break; } else if( ( base64_character1 == (uint32_t) ' ' ) || ( base64_character1 == (uint32_t) '\t' ) || ( base64_character1 == (uint32_t) '\v' ) ) { whitespace_size += base64_character_size; } else { break; } } base64_stream_size -= whitespace_size; base64_stream_index = 0; if( ( flags & LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) == 0 ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } while( base64_stream_index < base64_stream_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character1 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character1 ); break; } base64_stream_index += base64_character_size; if( ( base64_character1 == (uint32_t) '\n' ) || ( base64_character1 == (uint32_t) '\r' ) ) { if( ( strip_mode != LIBUNA_STRIP_MODE_NON_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } else { if( ( base64_stream_index + base64_character_size ) < base64_stream_size ) { switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character2 = base64_stream[ base64_stream_index ]; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_to_uint16_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_to_uint16_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_to_uint32_big_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_to_uint32_little_endian( &( base64_stream[ base64_stream_index ] ), base64_character2 ); break; } if( ( base64_character2 == (uint32_t) '\n' ) || ( base64_character2 == (uint32_t) '\r' ) ) { base64_stream_index += base64_character_size; } } strip_mode = LIBUNA_STRIP_MODE_LEADING_WHITESPACE; } if( character_limit != 0 ) { if( number_of_characters != (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in line does not match character limit.", function ); return( -1 ); } number_of_characters = 0; } } else if( ( base64_character1 == (uint32_t) ' ' ) || ( base64_character1 == (uint32_t) '\t' ) || ( base64_character1 == (uint32_t) '\v' ) ) { if( ( flags & LIBUNA_BASE64_FLAG_STRIP_WHITESPACE ) != 0 ) { if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_TRAILING_WHITESPACE; } if( ( strip_mode != LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) && ( strip_mode != LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } } else if( strip_mode == LIBUNA_STRIP_MODE_LEADING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_NON_WHITESPACE; } else if( strip_mode == LIBUNA_STRIP_MODE_TRAILING_WHITESPACE ) { strip_mode = LIBUNA_STRIP_MODE_INVALID_CHARACTER; } if( strip_mode == LIBUNA_STRIP_MODE_INVALID_CHARACTER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: invalid character in base64 stream at index: %" PRIzd ".", function, base64_stream_index - base64_character_size ); return( -1 ); } if( strip_mode == LIBUNA_STRIP_MODE_NON_WHITESPACE ) { if( padding_size > 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st base64 sixtet.", function ); return( -1 ); } base64_stream_index -= base64_character_size; /* Convert the base64 stream into a base64 triplet */ if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, base64_stream, base64_stream_size, &base64_stream_index, &padding_size, base64_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 triplet from base64 stream.", function ); return( -1 ); } /* Convert the base64 triplet into a byte stream */ if( libuna_base64_triplet_copy_to_byte_stream( base64_triplet, byte_stream, byte_stream_size, &byte_stream_index, padding_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 triplet to byte stream.", function ); return( -1 ); } number_of_characters += 4 - padding_size; } } if( character_limit != 0 ) { if( number_of_characters > (size_t) character_limit ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: number of characters in last line exceed maximum.", function ); return( -1 ); } } return( 1 ); } /* Determines the size of a base64 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base64_stream_size_from_byte_stream( const uint8_t *byte_stream, size_t byte_stream_size, size_t *base64_stream_size, uint32_t base64_variant, libcerror_error_t **error ) { static char *function = "libuna_base64_stream_size_from_byte_stream"; size_t base64_character_size = 0; size_t calculated_base64_stream_size = 0; size_t remaining_size = 0; size_t whitespace_size = 0; uint8_t character_limit = 0; uint8_t padding_character = 0; if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( base64_stream_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream size.", function ); return( -1 ); } switch( base64_variant & 0x000000ffUL ) { case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0x0f000000UL ) { case LIBUNA_BASE64_VARIANT_PADDING_NONE: padding_character = 0; break; case LIBUNA_BASE64_VARIANT_PADDING_OPTIONAL: padding_character = (uint8_t) '='; break; case LIBUNA_BASE64_VARIANT_PADDING_REQUIRED: padding_character = (uint8_t) '='; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character_size = 1; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base64_character_size = 2; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base64_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } /* Make sure the base64 stream is able to hold * at least 4 base64 characters for each 3 bytes */ calculated_base64_stream_size = ( byte_stream_size / 3 ) * 4; remaining_size = byte_stream_size % 3; if( remaining_size != 0 ) { if( padding_character != 0 ) { calculated_base64_stream_size += 4; } else if( remaining_size == 1 ) { calculated_base64_stream_size += 2; } else if( remaining_size == 2 ) { calculated_base64_stream_size += 3; } } if( character_limit != 0 ) { if( calculated_base64_stream_size > character_limit ) { whitespace_size = calculated_base64_stream_size / character_limit; if( ( calculated_base64_stream_size % character_limit ) != 0 ) { whitespace_size += 1; } calculated_base64_stream_size += whitespace_size; } calculated_base64_stream_size += 1; } calculated_base64_stream_size *= base64_character_size; *base64_stream_size = calculated_base64_stream_size; return( 1 ); } /* Copies a base64 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base64_stream_copy_from_byte_stream( uint8_t *base64_stream, size_t base64_stream_size, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base64_variant, libcerror_error_t **error ) { static char *function = "libuna_base64_stream_copy_from_byte_stream"; size_t base64_stream_index = 0; if( libuna_base64_stream_with_index_copy_from_byte_stream( base64_stream, base64_stream_size, &base64_stream_index, byte_stream, byte_stream_size, base64_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base64 stream from byte stream.", function ); return( -1 ); } return( 1 ); } /* Copies a base64 stream from a byte stream * Returns 1 if successful or -1 on error */ int libuna_base64_stream_with_index_copy_from_byte_stream( uint8_t *base64_stream, size_t base64_stream_size, size_t *base64_stream_index, const uint8_t *byte_stream, size_t byte_stream_size, uint32_t base64_variant, libcerror_error_t **error ) { static char *function = "libuna_base64_stream_with_index_copy_from_byte_stream"; size_t base64_character_size = 0; size_t calculated_base64_stream_size = 0; size_t byte_stream_index = 0; size_t number_of_characters = 0; size_t remaining_size = 0; size_t safe_base64_stream_index = 0; size_t whitespace_size = 0; uint32_t base64_character = 0; uint32_t base64_triplet = 0; uint8_t character_limit = 0; uint8_t padding_character = 0; uint8_t padding_size = 0; if( base64_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream.", function ); return( -1 ); } if( base64_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid base64 stream size value exceeds maximum.", function ); return( -1 ); } if( base64_stream_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid base64 stream index.", function ); return( -1 ); } if( *base64_stream_index >= base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream string too small.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } switch( base64_variant & 0x000000ffUL ) { case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE: character_limit = 0; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_64: character_limit = 64; break; case LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_76: character_limit = 76; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0x0f000000UL ) { case LIBUNA_BASE64_VARIANT_PADDING_NONE: padding_character = 0; break; case LIBUNA_BASE64_VARIANT_PADDING_OPTIONAL: padding_character = (uint8_t) '='; break; case LIBUNA_BASE64_VARIANT_PADDING_REQUIRED: padding_character = (uint8_t) '='; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_character_size = 1; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: base64_character_size = 2; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: base64_character_size = 4; break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported base64 variant.", function ); return( -1 ); } safe_base64_stream_index = *base64_stream_index; /* Make sure the base64 stream is able to hold * at least 4 base64 characters for each 3 bytes */ calculated_base64_stream_size = ( byte_stream_size / 3 ) * 4; remaining_size = byte_stream_size % 3; if( remaining_size != 0 ) { if( padding_character != 0 ) { calculated_base64_stream_size += 4; } else if( remaining_size == 1 ) { calculated_base64_stream_size += 2; } else if( remaining_size == 2 ) { calculated_base64_stream_size += 3; } } if( character_limit != 0 ) { if( calculated_base64_stream_size > character_limit ) { whitespace_size = calculated_base64_stream_size / character_limit; if( ( calculated_base64_stream_size % character_limit ) != 0 ) { whitespace_size += 1; } calculated_base64_stream_size += whitespace_size; } calculated_base64_stream_size += 1; } calculated_base64_stream_size *= base64_character_size; if( base64_stream_size < calculated_base64_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: base64 stream is too small.", function ); return( -1 ); } while( byte_stream_index < byte_stream_size ) { /* Convert the byte stream into a base64 triplet */ if( libuna_base64_triplet_copy_from_byte_stream( &base64_triplet, byte_stream, byte_stream_size, &byte_stream_index, &padding_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 triplet from byte stream.", function ); return( -1 ); } /* Convert the base64 triplet into a base64 stream */ if( libuna_base64_triplet_copy_to_base64_stream( base64_triplet, base64_stream, base64_stream_size, &safe_base64_stream_index, padding_size, base64_variant, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy base64 triplet to base64 stream.", function ); return( -1 ); } if( character_limit != 0 ) { number_of_characters += 4; if( number_of_characters >= (size_t) character_limit ) { base64_character = (uint32_t) '\n'; switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_stream[ safe_base64_stream_index ] = (uint8_t) base64_character; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; number_of_characters = 0; } } } if( character_limit != 0 ) { if( number_of_characters != 0 ) { base64_character = (uint32_t) '\n'; switch( base64_variant & 0xf0000000UL ) { case LIBUNA_BASE64_VARIANT_ENCODING_BYTE_STREAM: base64_stream[ safe_base64_stream_index ] = (uint8_t) base64_character; break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN: byte_stream_copy_from_uint16_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN: byte_stream_copy_from_uint16_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN: byte_stream_copy_from_uint32_big_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; case LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN: byte_stream_copy_from_uint32_little_endian( &( base64_stream[ safe_base64_stream_index ] ), base64_character ); break; } safe_base64_stream_index += base64_character_size; } } *base64_stream_index = safe_base64_stream_index; return( 1 ); } libewf-20140807/libuna/libuna_error.c0000664000175000017500000000550413443450072021440 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libuna_error.h" #include "libuna_libcerror.h" #if !defined( HAVE_LOCAL_LIBUNA ) /* Free an error and its elements */ void libuna_error_free( libuna_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libuna_error_fprint( libuna_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libuna_error_sprint( libuna_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libuna_error_backtrace_fprint( libuna_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libuna_error_backtrace_sprint( libuna_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ libewf-20140807/libuna/libuna_codepage_koi8_u.c0000664000175000017500000000600013443450072023324 0ustar00lordyestalordyesta00000000000000/* * KOI8-U codepage (Ukrainian Cyrillic) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_koi8_u.h" /* Extended ASCII to Unicode character lookup table for KOI8-U codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ 128 ] = { 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x0491, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x0490, 0x256c, 0x00a9, 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }; /* Unicode to ASCII character lookup table for KOI8-U codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ 64 ] = { 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1 }; const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x2550[ 32 ] = { 0xa0, 0xa1, 0xa2, 0x1a, 0xa5, 0x1a, 0x1a, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x1a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0x1a, 0xb5, 0x1a, 0x1a, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x1a, 0xbe, 0x1a, 0x1a, 0x1a }; libewf-20140807/libuna/libuna_codepage_iso_8859_13.h0000664000175000017500000000266113443450072023736 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-13 codepage (Baltic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_13_H ) #define _LIBUNA_CODEPAGE_ISO_8859_13_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ 224 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ 8 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_13_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_7.h0000664000175000017500000000265113443450072023660 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-7 codepage (Greek) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_7_H ) #define _LIBUNA_CODEPAGE_ISO_8859_7_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ 24 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ 80 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_7_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_14.h0000664000175000017500000000303513443450072023733 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-14 codepage (Celtic) functions * * Copyright (C) 2008-2019, 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( _LIBUNA_CODEPAGE_ISO_8859_14_H ) #define _LIBUNA_CODEPAGE_ISO_8859_14_H #include #include #include "libuna_extern.h" #if defined( __cplusplus ) extern "C" { #endif LIBUNA_EXTERN_VARIABLE \ const uint16_t libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ 96 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ 64 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ 8 ]; LIBUNA_EXTERN_VARIABLE \ const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ 8 ]; #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBUNA_CODEPAGE_ISO_8859_14_H ) */ libewf-20140807/libuna/libuna_codepage_iso_8859_16.c0000664000175000017500000000634213443450072023734 0ustar00lordyestalordyesta00000000000000/* * ISO 8859-16 codepage (Latin 10) function * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libuna_codepage_iso_8859_16.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-16 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff }; /* Unicode to ASCII character lookup table for ISO 8859-16 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ 96 ] = { 0x1a, 0xa9, 0x1a, 0xab, 0x1a, 0xad, 0x1a, 0x1a, 0xb0, 0xb1, 0x1a, 0x1a, 0x1a, 0x1a, 0xb6, 0xb7, 0x1a, 0x1a, 0x1a, 0xbb, 0x1a, 0x1a, 0x1a, 0x1a, 0xc0, 0xc1, 0xc2, 0x1a, 0xc4, 0x1a, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0x1a, 0x1a, 0xd2, 0xd3, 0xd4, 0x1a, 0xd6, 0x1a, 0x1a, 0xd9, 0xda, 0xdb, 0xdc, 0x1a, 0x1a, 0xdf, 0xe0, 0xe1, 0xe2, 0x1a, 0xe4, 0x1a, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x1a, 0x1a, 0xf2, 0xf3, 0xf4, 0x1a, 0xf6, 0x1a, 0x1a, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a, 0x1a, 0xff, 0x1a, 0x1a, 0xc3, 0xe3, 0xa1, 0xa2, 0xc5, 0xe5 }; const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ 8 ] = { 0x1a, 0xa3, 0xb3, 0xd1, 0xf1, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ 8 ] = { 0xd5, 0xf5, 0xbc, 0xbd, 0x1a, 0x1a, 0x1a, 0x1a }; const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ 8 ] = { 0xbe, 0xac, 0xae, 0xaf, 0xbf, 0xb4, 0xb8, 0x1a }; const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ 8 ] = { 0xaa, 0xba, 0xde, 0xfe, 0x1a, 0x1a, 0x1a, 0x1a }; libewf-20140807/libfvalue/0000775000175000017500000000000013443455446017316 5ustar00lordyestalordyesta00000000000000libewf-20140807/libfvalue/libfvalue_split_utf8_string.c0000664000175000017500000003304013443450055025171 0ustar00lordyestalordyesta00000000000000/* * Split UTF-8 string functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_libcerror.h" #include "libfvalue_split_utf8_string.h" #include "libfvalue_types.h" /* Creates a split UTF-8 string * Make sure the value split_string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_split_utf8_string_initialize( libfvalue_split_utf8_string_t **split_string, const uint8_t *utf8_string, size_t utf8_string_size, int number_of_segments, libcerror_error_t **error ) { libfvalue_internal_split_utf8_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf8_string_initialize"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string value already set.", function ); return( -1 ); } if( number_of_segments < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of segments less than zero.", function ); return( -1 ); } internal_split_string = memory_allocate_structure( libfvalue_internal_split_utf8_string_t ); if( internal_split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create split string.", function ); goto on_error; } if( memory_set( internal_split_string, 0, sizeof( libfvalue_internal_split_utf8_string_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear split string.", function ); memory_free( internal_split_string ); return( -1 ); } if( ( utf8_string != NULL ) && ( utf8_string_size > 0 ) ) { internal_split_string->string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * utf8_string_size ); if( internal_split_string->string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); goto on_error; } if( memory_copy( internal_split_string->string, utf8_string, sizeof( uint8_t ) * ( utf8_string_size - 1 ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to copy string.", function ); goto on_error; } internal_split_string->string[ utf8_string_size - 1 ] = 0; internal_split_string->string_size = utf8_string_size; } if( number_of_segments > 0 ) { internal_split_string->segments = (uint8_t **) memory_allocate( sizeof( uint8_t * ) * number_of_segments ); if( internal_split_string->segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segments.", function ); goto on_error; } if( memory_set( internal_split_string->segments, 0, sizeof( uint8_t * ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segments.", function ); goto on_error; } internal_split_string->segment_sizes = (size_t *) memory_allocate( sizeof( size_t ) * number_of_segments ); if( internal_split_string->segment_sizes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment sizes.", function ); goto on_error; } if( memory_set( internal_split_string->segment_sizes, 0, sizeof( size_t ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment sizes.", function ); goto on_error; } } internal_split_string->number_of_segments = number_of_segments; *split_string = (libfvalue_split_utf8_string_t *) internal_split_string; return( 1 ); on_error: if( internal_split_string != NULL ) { if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } memory_free( internal_split_string ); } return( -1 ); } /* Frees a split UTF-8 string * Returns 1 if successful or -1 on error */ int libfvalue_split_utf8_string_free( libfvalue_split_utf8_string_t **split_string, libcerror_error_t **error ) { libfvalue_internal_split_utf8_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf8_string_free"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { internal_split_string = (libfvalue_internal_split_utf8_string_t *) *split_string; *split_string = NULL; if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } memory_free( internal_split_string ); } return( 1 ); } /* Retrieves the UTF-8 string * Returns 1 if successful or -1 on error */ int libfvalue_split_utf8_string_get_string( libfvalue_split_utf8_string_t *split_string, uint8_t **utf8_string, size_t *utf8_string_size, libcerror_error_t **error ) { libfvalue_internal_split_utf8_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf8_string_get_string"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf8_string_t *) split_string; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string = internal_split_string->string; *utf8_string_size = internal_split_string->string_size; return( 1 ); } /* Retrieves the number of segments * Returns 1 if successful or -1 on error */ int libfvalue_split_utf8_string_get_number_of_segments( libfvalue_split_utf8_string_t *split_string, int *number_of_segments, libcerror_error_t **error ) { libfvalue_internal_split_utf8_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf8_string_get_number_of_segments"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf8_string_t *) split_string; if( number_of_segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of segments.", function ); return( -1 ); } *number_of_segments = internal_split_string->number_of_segments; return( 1 ); } /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libfvalue_split_utf8_string_get_segment_by_index( libfvalue_split_utf8_string_t *split_string, int segment_index, uint8_t **utf8_string_segment, size_t *utf8_string_segment_size, libcerror_error_t **error ) { libfvalue_internal_split_utf8_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf8_string_get_segment_by_index"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf8_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( utf8_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string segment.", function ); return( -1 ); } if( utf8_string_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string segment size.", function ); return( -1 ); } *utf8_string_segment = internal_split_string->segments[ segment_index ]; *utf8_string_segment_size = internal_split_string->segment_sizes[ segment_index ]; return( 1 ); } /* Sets a specific segment * Returns 1 if successful or -1 on error */ int libfvalue_split_utf8_string_set_segment_by_index( libfvalue_split_utf8_string_t *split_string, int segment_index, uint8_t *utf8_string_segment, size_t utf8_string_segment_size, libcerror_error_t **error ) { libfvalue_internal_split_utf8_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf8_string_set_segment_by_index"; size_t utf8_string_segment_offset = 0; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf8_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( utf8_string_segment == NULL ) { if( utf8_string_segment_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string segment size value out of bounds.", function ); return( -1 ); } } else { if( utf8_string_segment < internal_split_string->string ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string segment value out of bounds.", function ); return( -1 ); } utf8_string_segment_offset = (size_t) ( utf8_string_segment - internal_split_string->string ); if( utf8_string_segment_offset > internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string segment value out of bounds.", function ); return( -1 ); } utf8_string_segment_offset += utf8_string_segment_size; if( utf8_string_segment_offset > internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string segment value out of bounds.", function ); return( -1 ); } } internal_split_string->segments[ segment_index ] = utf8_string_segment; internal_split_string->segment_sizes[ segment_index ] = utf8_string_segment_size; return( 1 ); } libewf-20140807/libfvalue/libfvalue_support.h0000664000175000017500000000226113443450055023224 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_SUPPORT_H ) #define _LIBFVALUE_SUPPORT_H #include #include #include "libfvalue_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFVALUE ) LIBFVALUE_EXTERN \ const char *libfvalue_get_version( void ); #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_SUPPORT_H ) */ libewf-20140807/libfvalue/libfvalue_value_entry.c0000664000175000017500000001107013443450055024036 0ustar00lordyestalordyesta00000000000000/* * Value entry functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_libcerror.h" #include "libfvalue_value_entry.h" /* Creates a value entry * Make sure the value value_entry is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_value_entry_initialize( libfvalue_value_entry_t **value_entry, libcerror_error_t **error ) { static char *function = "libfvalue_value_entry_initialize"; if( value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry.", function ); return( -1 ); } if( *value_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid value entry value already set.", function ); return( -1 ); } *value_entry = memory_allocate_structure( libfvalue_value_entry_t ); if( *value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create value entry.", function ); goto on_error; } if( memory_set( *value_entry, 0, sizeof( libfvalue_value_entry_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear value entry.", function ); goto on_error; } return( 1 ); on_error: if( *value_entry != NULL ) { memory_free( *value_entry ); *value_entry = NULL; } return( -1 ); } /* Frees a value entry * Returns 1 if successful or -1 on error */ int libfvalue_value_entry_free( libfvalue_value_entry_t **value_entry, libcerror_error_t **error ) { static char *function = "libfvalue_value_entry_free"; if( value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry.", function ); return( -1 ); } if( *value_entry != NULL ) { memory_free( *value_entry ); *value_entry = NULL; } return( 1 ); } /* Clones a value entry * Returns 1 if successful or -1 on error */ int libfvalue_value_entry_clone( libfvalue_value_entry_t **destination_value_entry, libfvalue_value_entry_t *source_value_entry, libcerror_error_t **error ) { static char *function = "libfvalue_value_entry_clone"; if( destination_value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination value entry.", function ); return( -1 ); } if( *destination_value_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination value entry already set.", function ); return( -1 ); } if( source_value_entry == NULL ) { *destination_value_entry = NULL; return( 1 ); } *destination_value_entry = memory_allocate_structure( libfvalue_value_entry_t ); if( *destination_value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination value entry.", function ); goto on_error; } if( memory_copy( *destination_value_entry, source_value_entry, sizeof( libfvalue_value_entry_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy value entry.", function ); goto on_error; } return( 1 ); on_error: if( *destination_value_entry != NULL ) { memory_free( *destination_value_entry ); *destination_value_entry = NULL; } return( -1 ); } libewf-20140807/libfvalue/libfvalue_libfwnt.h0000664000175000017500000000325713443450055023163 0ustar00lordyestalordyesta00000000000000/* * The libfwnt header wrapper * * Copyright (C) 2010-2018, 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( _LIBFVALUE_LIBFWNT_H ) #define _LIBFVALUE_LIBFWNT_H #include /* Define HAVE_LOCAL_LIBFWNT for local use of libfwnt */ #if defined( HAVE_LOCAL_LIBFWNT ) #include #include #include #include #include #include #include #include #include /* Note that libfvalue does not require to have libfwnt support */ #elif defined( HAVE_LIBFWNT_H ) /* If libtool DLL support is enabled set LIBFWNT_DLL_IMPORT * before including libfwnt.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFWNT_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFWNT ) */ #endif /* !defined( _LIBFVALUE_LIBFWNT_H ) */ libewf-20140807/libfvalue/libfvalue_utf8_string.h0000664000175000017500000000261313443450055023765 0ustar00lordyestalordyesta00000000000000/* * UTF-8 string value functions * * Copyright (C) 2010-2018, 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( _LIBVALUE_UTF8_STRING_H ) #define _LIBVALUE_UTF8_STRING_H #include #include #include "libfvalue_definitions.h" #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( _cplusplus ) extern "C" { #endif LIBFVALUE_EXTERN \ int libfvalue_utf8_string_split( const uint8_t *utf8_string, size_t utf8_string_size, uint8_t delimiter, libfvalue_split_utf8_string_t **split_string, libcerror_error_t **error ); #if defined( _cplusplus ) } #endif #endif /* !defined( _LIBVALUE_UTF8_STRING_H ) */ libewf-20140807/libfvalue/libfvalue_libcerror.h0000664000175000017500000000264313443450055023477 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2010-2018, 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( _LIBFVALUE_LIBCERROR_H ) #define _LIBFVALUE_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBFVALUE_LIBCERROR_H ) */ libewf-20140807/libfvalue/libfvalue_split_utf16_string.h0000664000175000017500000000547613443450055025271 0ustar00lordyestalordyesta00000000000000/* * Split UTF-16 string functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_SPLIT_UTF16_STRING_H ) #define _LIBFVALUE_SPLIT_UTF16_STRING_H #include #include #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_internal_split_utf16_string libfvalue_internal_split_utf16_string_t; struct libfvalue_internal_split_utf16_string { /* The number of string segments */ int number_of_segments; /* The string */ uint16_t *string; /* The string size */ size_t string_size; /* The segments */ uint16_t **segments; /* The segment sizes */ size_t *segment_sizes; }; int libfvalue_split_utf16_string_initialize( libfvalue_split_utf16_string_t **split_string, const uint16_t *utf16_string, size_t utf16_string_size, int number_of_segments, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf16_string_free( libfvalue_split_utf16_string_t **split_string, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf16_string_get_string( libfvalue_split_utf16_string_t *split_string, uint16_t **utf16_string, size_t *utf16_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf16_string_get_number_of_segments( libfvalue_split_utf16_string_t *split_string, int *number_of_segments, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf16_string_get_segment_by_index( libfvalue_split_utf16_string_t *split_string, int segment_index, uint16_t **utf16_string_segment, size_t *utf16_string_segment_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf16_string_set_segment_by_index( libfvalue_split_utf16_string_t *split_string, int segment_index, uint16_t *utf16_string_segment, size_t utf16_string_segment_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_SPLIT_UTF16_STRING_H ) */ libewf-20140807/libfvalue/libfvalue_value.c0000664000175000017500000036226013443450055022627 0ustar00lordyestalordyesta00000000000000/* * Value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include #include #include "libfvalue_data_handle.h" #include "libfvalue_definitions.h" #include "libfvalue_libcdata.h" #include "libfvalue_libcerror.h" #include "libfvalue_libcnotify.h" #include "libfvalue_types.h" #include "libfvalue_value.h" /* Creates a value * Make sure the value value is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_value_initialize( libfvalue_value_t **value, const char *type_string, const char *type_description, libfvalue_data_handle_t *data_handle, int (*initialize_instance)( intptr_t **instance, libcerror_error_t **error ), int (*free_instance)( intptr_t **instance, libcerror_error_t **error ), int (*clone_instance)( intptr_t **destination_instance, intptr_t *source_instance, libcerror_error_t **error ), int (*copy_from_byte_stream)( intptr_t *instance, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ), int (*copy_to_byte_stream)( intptr_t *instance, uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ), int (*copy_from_integer)( intptr_t *instance, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ), int (*copy_to_integer)( intptr_t *instance, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ), int (*copy_from_floating_point)( intptr_t *instance, double floating_point_value, size_t floating_point_value_size, libcerror_error_t **error ), int (*copy_to_floating_point)( intptr_t *instance, double *floating_point_value, size_t *floating_point_value_size, libcerror_error_t **error ), int (*copy_from_utf8_string_with_index)( intptr_t *instance, const uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*get_utf8_string_size)( intptr_t *instance, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_to_utf8_string_with_index)( intptr_t *instance, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_from_utf16_string_with_index)( intptr_t *instance, const uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*get_utf16_string_size)( intptr_t *instance, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_to_utf16_string_with_index)( intptr_t *instance, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_from_utf32_string_with_index)( intptr_t *instance, const uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*get_utf32_string_size)( intptr_t *instance, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_to_utf32_string_with_index)( intptr_t *instance, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_initialize"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( *value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid value value already set.", function ); return( -1 ); } if( type_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type string", function ); return( -1 ); } internal_value = memory_allocate_structure( libfvalue_internal_value_t ); if( internal_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create value.", function ); goto on_error; } if( memory_set( internal_value, 0, sizeof( libfvalue_internal_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear value.", function ); memory_free( internal_value ); return( -1 ); } if( free_instance != NULL ) { if( libcdata_array_initialize( &( internal_value->value_instances ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value instances array.", function ); goto on_error; } } if( data_handle == NULL ) { /* TODO add read function ? */ if( libfvalue_data_handle_initialize( &( internal_value->data_handle ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data handle.", function ); goto on_error; } internal_value->flags |= LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED; } else { internal_value->data_handle = data_handle; } internal_value->type_string = type_string; internal_value->type_description = type_description; internal_value->initialize_instance = initialize_instance; internal_value->free_instance = free_instance; internal_value->clone_instance = clone_instance; internal_value->copy_from_byte_stream = copy_from_byte_stream; internal_value->copy_to_byte_stream = copy_to_byte_stream; internal_value->copy_from_integer = copy_from_integer; internal_value->copy_to_integer = copy_to_integer; internal_value->copy_from_floating_point = copy_from_floating_point; internal_value->copy_to_floating_point = copy_to_floating_point; internal_value->copy_from_utf8_string_with_index = copy_from_utf8_string_with_index; internal_value->get_utf8_string_size = get_utf8_string_size; internal_value->copy_to_utf8_string_with_index = copy_to_utf8_string_with_index; internal_value->copy_from_utf16_string_with_index = copy_from_utf16_string_with_index; internal_value->get_utf16_string_size = get_utf16_string_size; internal_value->copy_to_utf16_string_with_index = copy_to_utf16_string_with_index; internal_value->copy_from_utf32_string_with_index = copy_from_utf32_string_with_index; internal_value->get_utf32_string_size = get_utf32_string_size; internal_value->copy_to_utf32_string_with_index = copy_to_utf32_string_with_index; internal_value->flags |= flags; *value = (libfvalue_value_t *) internal_value; return( 1 ); on_error: if( internal_value != NULL ) { if( internal_value->value_instances != NULL ) { libcdata_array_free( &( internal_value->value_instances ), NULL, NULL ); } memory_free( internal_value ); } return( -1 ); } /* Frees a value * Returns 1 if successful or -1 on error */ int libfvalue_value_free( libfvalue_value_t **value, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_free"; int result = 1; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( *value != NULL ) { if( libfvalue_value_clear( *value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } internal_value = (libfvalue_internal_value_t *) *value; *value = NULL; if( internal_value->value_instances != NULL ) { if( libcdata_array_free( &( internal_value->value_instances ), internal_value->free_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value instances array.", function ); result = -1; } } if( ( internal_value->flags & LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED ) != 0 ) { if( libfvalue_data_handle_free( &( internal_value->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } internal_value->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED ); } memory_free( internal_value ); } return( result ); } /* Clones a value * Returns 1 if successful or -1 on error */ int libfvalue_value_clone( libfvalue_value_t **destination_value, libfvalue_value_t *source_value, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_source_value = NULL; libfvalue_data_handle_t *destination_data_handle = NULL; static char *function = "libfvalue_value_clone"; if( destination_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination value.", function ); return( -1 ); } if( *destination_value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination value already set.", function ); return( -1 ); } if( source_value == NULL ) { *destination_value = NULL; return( 1 ); } internal_source_value = (libfvalue_internal_value_t *) source_value; if( libfvalue_data_handle_clone( &destination_data_handle, internal_source_value->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data handle.", function ); goto on_error; } if( libfvalue_value_initialize( destination_value, internal_source_value->type_string, internal_source_value->type_description, destination_data_handle, internal_source_value->initialize_instance, internal_source_value->free_instance, internal_source_value->clone_instance, internal_source_value->copy_from_byte_stream, internal_source_value->copy_to_byte_stream, internal_source_value->copy_from_integer, internal_source_value->copy_to_integer, internal_source_value->copy_from_floating_point, internal_source_value->copy_to_floating_point, internal_source_value->copy_from_utf8_string_with_index, internal_source_value->get_utf8_string_size, internal_source_value->copy_to_utf8_string_with_index, internal_source_value->copy_from_utf16_string_with_index, internal_source_value->get_utf16_string_size, internal_source_value->copy_to_utf16_string_with_index, internal_source_value->copy_from_utf32_string_with_index, internal_source_value->get_utf32_string_size, internal_source_value->copy_to_utf32_string_with_index, internal_source_value->flags | LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination value.", function ); goto on_error; } if( *destination_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination value.", function ); goto on_error; } destination_data_handle = NULL; if( internal_source_value->identifier != NULL ) { if( libfvalue_value_set_identifier( *destination_value, internal_source_value->identifier, internal_source_value->identifier_size, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set identifier in destination value.", function ); goto on_error; } } /* The value instances are not cloned and are re-created on demand */ return( 1 ); on_error: if( destination_data_handle != NULL ) { libfvalue_data_handle_free( &destination_data_handle, NULL ); } if( *destination_value != NULL ) { libfvalue_value_free( destination_value, NULL ); } return( -1 ); } /* Clears a value * Returns 1 if successful or -1 on error */ int libfvalue_value_clear( libfvalue_value_t *value, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_clear"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( ( internal_value->flags & LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED ) != 0 ) { if( internal_value->identifier != NULL ) { memory_free( internal_value->identifier ); } internal_value->flags &= ~( LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED ); } if( libfvalue_data_handle_clear( internal_value->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear data handle.", function ); return( -1 ); } if( internal_value->value_instances != NULL ) { if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( libcdata_array_empty( internal_value->value_instances, internal_value->free_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty value instances array.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the value type * Returns 1 if successful or -1 on error */ int libfvalue_value_get_type( libfvalue_value_t *value, int *value_type, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_type"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value type.", function ); return( -1 ); } *value_type = internal_value->type; return( 1 ); } /* Compares two index values * Returns LIBCDATA_COMPARE_LESS, LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error */ int libfvalue_compare_identifier( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_first_value = NULL; libfvalue_internal_value_t *internal_second_value = NULL; static char *function = "libfvalue_compare_identifier"; size_t compare_size = 0; int result = 0; if( first_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first value.", function ); return( -1 ); } internal_first_value = (libfvalue_internal_value_t *) first_value; if( second_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid second value.", function ); return( -1 ); } internal_second_value = (libfvalue_internal_value_t *) second_value; if( internal_first_value->identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid first value - missing identifier.", function ); return( -1 ); } if( internal_second_value->identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid second value - missing identifier.", function ); return( -1 ); } if( internal_first_value->identifier_size <= internal_second_value->identifier_size ) { compare_size = internal_first_value->identifier_size; } else { compare_size = internal_second_value->identifier_size; } result = memory_compare( internal_first_value->identifier, internal_second_value->identifier, compare_size ); if( result < 0 ) { return( LIBCDATA_COMPARE_LESS ); } else if( result > 0 ) { return( LIBCDATA_COMPARE_GREATER ); } if( internal_first_value->identifier_size < internal_second_value->identifier_size ) { return( LIBCDATA_COMPARE_LESS ); } else if( internal_first_value->identifier_size > internal_second_value->identifier_size ) { return( LIBCDATA_COMPARE_GREATER ); } return( LIBCDATA_COMPARE_EQUAL ); } /* Retrieves the identifier * Returns 1 if successful or -1 on error */ int libfvalue_value_get_identifier( libfvalue_value_t *value, uint8_t **identifier, size_t *identifier_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_identifier"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( identifier_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier size.", function ); return( -1 ); } *identifier = internal_value->identifier; *identifier_size = internal_value->identifier_size; return( 1 ); } /* Sets the identifier * Returns 1 if successful or -1 on error */ int libfvalue_value_set_identifier( libfvalue_value_t *value, const uint8_t *identifier, size_t identifier_size, uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_set_identifier"; uint8_t supported_flags = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->identifier != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid value - identifier already set.", function ); return( -1 ); } if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( ( identifier_size == 0 ) || ( identifier_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid identifier length value out of bounds.", function ); return( -1 ); } supported_flags = LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED | LIBFVALUE_VALUE_IDENTIFIER_FLAG_CLONE_BY_REFERENCE; if( ( flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function, flags ); return( -1 ); } if( ( internal_value->flags & LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED ) != 0 ) { if( internal_value->identifier != NULL ) { memory_free( internal_value->identifier ); internal_value->identifier = NULL; internal_value->identifier_size = 0; } internal_value->flags &= ~( LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED ); } if( ( flags & LIBFVALUE_VALUE_IDENTIFIER_FLAG_CLONE_BY_REFERENCE ) != 0 ) { internal_value->identifier = (uint8_t *) identifier; if( ( flags & LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED ) != 0 ) { internal_value->flags |= LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED; } } else { internal_value->identifier = (uint8_t *) memory_allocate( sizeof( uint8_t ) * identifier_size ); if( internal_value->identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create identifier.", function ); goto on_error; } if( memory_copy( internal_value->identifier, identifier, identifier_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy identifier.", function ); goto on_error; } internal_value->flags |= LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED; } internal_value->identifier_size = identifier_size; return( 1 ); on_error: if( internal_value->identifier != NULL ) { memory_free( internal_value->identifier ); internal_value->identifier = NULL; } return( -1 ); } /* Retrieves the value data flags * Returns 1 if successful or -1 on error */ int libfvalue_value_get_data_flags( libfvalue_value_t *value, uint32_t *data_flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_data_flags"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( libfvalue_data_handle_get_data_flags( internal_value->data_handle, data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data flags from data handle.", function ); return( -1 ); } return( 1 ); } /* Sets the value data flags * Returns 1 if successful or -1 on error */ int libfvalue_value_set_data_flags( libfvalue_value_t *value, uint32_t data_flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_set_data_flags"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( libfvalue_data_handle_set_data_flags( internal_value->data_handle, data_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data flags in data handle.", function ); return( -1 ); } return( 1 ); } /* Determines if the value has data * Returns 1 if the value has data, 0 if not or -1 on error */ int libfvalue_value_has_data( libfvalue_value_t *value, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; uint8_t *data = NULL; static char *function = "libfvalue_value_has_data"; size_t data_size = 0; int encoding = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( libfvalue_data_handle_get_data( internal_value->data_handle, &data, &data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data from data handle.", function ); return( -1 ); } if( data == NULL ) { return( 0 ); } return( 1 ); } /* Initializes the data * Returns 1 if successful or -1 on error */ int libfvalue_value_initialize_data( libfvalue_value_t *value, size_t data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; uint8_t *data = NULL; static char *function = "libfvalue_value_initialize_data"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( ( data_size == 0 ) || ( data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid data size value out of bounds.", function ); return( -1 ); } result = libfvalue_value_has_data( value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if value has data.", function ); return( -1 ); } else if( result != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid value data already set.", function ); return( -1 ); } data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * data_size ); if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); goto on_error; } if( libfvalue_data_handle_set_data( internal_value->data_handle, data, data_size, LIBFVALUE_ENDIAN_NATIVE, LIBFVALUE_VALUE_DATA_FLAG_MANAGED | LIBFVALUE_VALUE_DATA_FLAG_CLONE_BY_REFERENCE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data in data handle.", function ); goto on_error; } return( 1 ); on_error: if( data != NULL ) { memory_free( data ); } return( -1 ); } /* Retrieves the data size * Returns 1 if successful or -1 on error */ int libfvalue_value_get_data_size( libfvalue_value_t *value, size_t *data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; uint8_t *data = NULL; static char *function = "libfvalue_value_get_data_size"; int encoding = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( libfvalue_data_handle_get_data( internal_value->data_handle, &data, data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data from data handle.", function ); return( -1 ); } if( data == NULL ) { if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } *data_size = 0; } return( 1 ); } /* Retrieves the data * Returns 1 if successful or -1 on error */ int libfvalue_value_get_data( libfvalue_value_t *value, uint8_t **data, size_t *data_size, int *encoding, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_data"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( libfvalue_data_handle_get_data( internal_value->data_handle, data, data_size, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data from data handle.", function ); return( -1 ); } return( 1 ); } /* Sets the data * Returns 1 if successful or -1 on error */ int libfvalue_value_set_data( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_set_data"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( libfvalue_data_handle_set_data( internal_value->data_handle, data, data_size, encoding, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data in data handle.", function ); return( -1 ); } return( 1 ); } /* Copies the data * Returns 1 if successful or -1 on error */ int libfvalue_value_copy_data( libfvalue_value_t *value, uint8_t *data, size_t data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; uint8_t *data_handle_data = NULL; static char *function = "libfvalue_value_copy_data"; size_t data_handle_data_size = 0; int encoding = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data.", function ); return( -1 ); } if( data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } if( libfvalue_data_handle_get_data( internal_value->data_handle, &data_handle_data, &data_handle_data_size, &encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data from data handle.", function ); return( -1 ); } if( ( data_handle_data == NULL ) || ( data_handle_data_size == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing data in data handle.", function ); return( -1 ); } if( data_handle_data_size > data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid data size value too small.", function ); return( -1 ); } if( memory_copy( data, data_handle_data, data_handle_data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data.", function ); return( -1 ); } return( 1 ); } /* Retrieves the format flags * Returns 1 if successful or -1 on error */ int libfvalue_value_get_format_flags( libfvalue_value_t *value, uint32_t *format_flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_format_flags"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( format_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid format flags.", function ); return( -1 ); } *format_flags = internal_value->format_flags; return( 1 ); } /* Sets the format flags * Returns 1 if successful or -1 on error */ int libfvalue_value_set_format_flags( libfvalue_value_t *value, uint32_t format_flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_set_format_flags"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; internal_value->format_flags = format_flags; return( 1 ); } /* Value instance functions */ /* Retrieves the value instance * The value instance is created if it does not exist * Returns 1 if successful or -1 on error */ int libfvalue_value_get_value_instance_by_index( libfvalue_value_t *value, int value_entry_index, intptr_t **value_instance, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; uint8_t *value_entry_data = NULL; static char *function = "libfvalue_value_get_value_instance_by_index"; size_t value_entry_data_size = 0; int encoding = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->initialize_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing initialize instance function.", function ); return( -1 ); } if( internal_value->value_instances != NULL ) { if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( internal_value->copy_from_byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free copy from byte stream function.", function ); return( -1 ); } } if( value_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value instance.", function ); return( -1 ); } if( *value_instance != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid value instance value already set.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_value->value_instances, value_entry_index, value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values instances array.", function, value_entry_index ); goto on_error; } if( *value_instance == NULL ) { result = libfvalue_value_get_entry_data( value, value_entry_index, &value_entry_data, &value_entry_data_size, &encoding, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry data: %d.", function, value_entry_index ); goto on_error; } else if( result != 0 ) { if( internal_value->initialize_instance( value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value instance.", function ); goto on_error; } if( internal_value->copy_from_byte_stream( *value_instance, value_entry_data, value_entry_data_size, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to copy value instance from byte stream.", function ); goto on_error; } } else { *value_instance = NULL; } if( libcdata_array_set_entry_by_index( internal_value->value_instances, value_entry_index, *value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, value_entry_index ); goto on_error; } } return( 1 ); on_error: if( *value_instance != NULL ) { internal_value->free_instance( value_instance, NULL ); } return( -1 ); } /* Value entry functions */ /* Retrieves the number of values entries * Returns 1 if successful or -1 on error */ int libfvalue_value_get_number_of_value_entries( libfvalue_value_t *value, int *number_of_value_entries, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_number_of_value_entries"; int safe_number_of_value_entries = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( number_of_value_entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of value entries.", function ); return( -1 ); } result = libfvalue_value_has_data( value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if value has data.", function ); return( -1 ); } else if( result != 0 ) { if( libfvalue_data_handle_get_number_of_value_entries( internal_value->data_handle, &safe_number_of_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of value entries from data handle.", function ); return( -1 ); } } else if( internal_value->value_instances != NULL ) { if( libcdata_array_get_number_of_entries( internal_value->value_instances, &safe_number_of_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from values instances array.", function ); return( -1 ); } } if( safe_number_of_value_entries < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of value entries value out of bounds.", function ); return( -1 ); } *number_of_value_entries = safe_number_of_value_entries; return( 1 ); } /* Retrieves the entry * Returns 1 if successful, 0 if the value has no data or -1 on error */ int libfvalue_value_get_entry( libfvalue_value_t *value, int value_entry_index, size_t *entry_data_offset, size_t *entry_data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_entry"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; result = libfvalue_value_has_data( value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if value has data.", function ); return( -1 ); } else if( result != 0 ) { if( libfvalue_data_handle_get_value_entry( internal_value->data_handle, value_entry_index, entry_data_offset, entry_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from data handle.", function, value_entry_index ); return( -1 ); } if( *entry_data_size == 0 ) { result = 0; } } if( result == 0 ) { *entry_data_offset = 0; *entry_data_size = 0; } return( result ); } /* Sets the entry * Returns 1 if successful or -1 on error */ int libfvalue_value_set_entry( libfvalue_value_t *value, int value_entry_index, size_t entry_data_offset, size_t entry_data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_set_entry"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_value->value_instances, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values instances array.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( libcdata_array_set_entry_by_index( internal_value->value_instances, value_entry_index, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, value_entry_index ); return( -1 ); } if( internal_value->free_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value instance: %d.", function, value_entry_index ); return( -1 ); } } if( libfvalue_data_handle_set_value_entry( internal_value->data_handle, value_entry_index, entry_data_offset, entry_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in data handle.", function, value_entry_index ); return( -1 ); } return( 1 ); } /* Appends the entry * Returns 1 if successful or -1 on error */ int libfvalue_value_append_entry( libfvalue_value_t *value, int *value_entry_index, size_t entry_data_offset, size_t entry_data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_append_entry"; int entry_index = 0; int number_of_value_entries = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( value_entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry index.", function ); return( -1 ); } if( libfvalue_data_handle_get_number_of_value_entries( internal_value->data_handle, &number_of_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of value entries from data handle.", function ); return( -1 ); } /* Since the data handle can reallocate the buffer used to store the data * and the value instances reference this data make sure that no stale * value instances are kept around. */ for( entry_index = 0; entry_index < number_of_value_entries; entry_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_value->value_instances, entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values instances array.", function, entry_index ); return( -1 ); } if( value_instance != NULL ) { if( libcdata_array_set_entry_by_index( internal_value->value_instances, entry_index, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, entry_index ); return( -1 ); } if( internal_value->free_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value instance: %d.", function, entry_index ); return( -1 ); } } } if( libcdata_array_resize( internal_value->value_instances, number_of_value_entries + 1, internal_value->free_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to resize value instances array.", function ); return( -1 ); } if( libfvalue_data_handle_append_value_entry( internal_value->data_handle, value_entry_index, entry_data_offset, entry_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append entry to data handle.", function ); return( -1 ); } return( 1 ); } /* Retrieves the entry data * Returns 1 if successful, 0 if the value has no data or -1 on error */ int libfvalue_value_get_entry_data( libfvalue_value_t *value, int value_entry_index, uint8_t **entry_data, size_t *entry_data_size, int *encoding, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_get_entry_data"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; result = libfvalue_value_has_data( value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if value has data.", function ); return( -1 ); } else if( result != 0 ) { if( libfvalue_data_handle_get_value_entry_data( internal_value->data_handle, value_entry_index, entry_data, entry_data_size, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d data from data handle.", function, value_entry_index ); return( -1 ); } if( ( *entry_data == NULL ) || ( *entry_data_size == 0 ) ) { result = 0; } } if( result == 0 ) { *entry_data = NULL; *entry_data_size = 0; } return( result ); } /* Sets the entry data * Returns 1 if successful or -1 on error */ int libfvalue_value_set_entry_data( libfvalue_value_t *value, int value_entry_index, const uint8_t *entry_data, size_t entry_data_size, int encoding, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_set_entry_data"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_value->value_instances, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values instances array.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( libcdata_array_set_entry_by_index( internal_value->value_instances, value_entry_index, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d data in values instances array.", function, value_entry_index ); return( -1 ); } if( internal_value->free_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value instance: %d.", function, value_entry_index ); return( -1 ); } } if( libfvalue_data_handle_set_value_entry_data( internal_value->data_handle, value_entry_index, entry_data, entry_data_size, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in data handle.", function, value_entry_index ); return( -1 ); } return( 1 ); } /* Appends the entry data * Returns 1 if successful or -1 on error */ int libfvalue_value_append_entry_data( libfvalue_value_t *value, int *value_entry_index, const uint8_t *entry_data, size_t entry_data_size, int encoding, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_append_entry_data"; int number_of_value_entries = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( value_entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry index.", function ); return( -1 ); } if( libfvalue_data_handle_get_number_of_value_entries( internal_value->data_handle, &number_of_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of value entries from data handle.", function ); return( -1 ); } /* Since the data handle can reallocate the buffer used to store the data * and the value instances reference this data make sure that no stale * value instances are kept around. */ for( *value_entry_index = 0; *value_entry_index < number_of_value_entries; *value_entry_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_value->value_instances, *value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values instances array.", function, *value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( libcdata_array_set_entry_by_index( internal_value->value_instances, *value_entry_index, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, *value_entry_index ); return( -1 ); } if( internal_value->free_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value instance: %d.", function, *value_entry_index ); return( -1 ); } } } if( libcdata_array_resize( internal_value->value_instances, number_of_value_entries + 1, internal_value->free_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to resize value instances array.", function ); return( -1 ); } if( libfvalue_data_handle_append_value_entry_data( internal_value->data_handle, value_entry_index, entry_data, entry_data_size, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append entry to data handle.", function ); return( -1 ); } return( 1 ); } /* Copies the entry data * Returns 1 if successful, 0 if the value has no data or -1 on error */ int libfvalue_value_copy_entry_data( libfvalue_value_t *value, int value_entry_index, uint8_t *entry_data, size_t entry_data_size, int *encoding, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; uint8_t *value_entry_data = NULL; static char *function = "libfvalue_value_copy_entry_data"; size_t value_entry_data_size = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( entry_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry data.", function ); return( -1 ); } if( entry_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid entry data size value exceeds maximum.", function ); return( -1 ); } result = libfvalue_value_has_data( value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if value has data.", function ); return( -1 ); } else if( result != 0 ) { if( libfvalue_data_handle_get_value_entry_data( internal_value->data_handle, value_entry_index, &value_entry_data, &value_entry_data_size, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d data from data handle.", function, value_entry_index ); return( -1 ); } if( ( value_entry_data == NULL ) || ( value_entry_data_size == 0 ) ) { result = 0; } } if( result != 0 ) { if( entry_data_size < value_entry_data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid entry: %d data size value out of bounds.", function, value_entry_index ); return( -1 ); } if( memory_copy( entry_data, value_entry_data, value_entry_data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy entry: %d data.", function, value_entry_index ); return( -1 ); } } return( result ); } /* Boolean value functions */ /* Copies the value data from a boolean value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_boolean( libfvalue_value_t *value, int value_entry_index, uint8_t value_boolean, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_boolean"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_integer( value_instance, (uint64_t) value_boolean, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from boolean.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to a boolean value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_boolean( libfvalue_value_t *value, int value_entry_index, uint8_t *value_boolean, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_boolean"; size_t integer_value_size = 0; uint64_t integer_value = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_boolean == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value boolean.", function ); return( -1 ); } if( internal_value->copy_to_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_integer( value_instance, &integer_value, &integer_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to boolean.", function ); return( -1 ); } if( integer_value != 0 ) { *value_boolean = 1; } else { *value_boolean = 0; } result = 1; } } return( result ); } /* Integer value functions */ /* Copies the value data from an 8-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_8bit( libfvalue_value_t *value, int value_entry_index, uint8_t value_8bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_8bit"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_integer( value_instance, (uint64_t) value_8bit, 8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from 8-bit integer.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to an 8-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_8bit( libfvalue_value_t *value, int value_entry_index, uint8_t *value_8bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_8bit"; size_t integer_value_size = 0; uint64_t integer_value = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_8bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value 8-bit.", function ); return( -1 ); } if( internal_value->copy_to_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_integer( value_instance, &integer_value, &integer_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to integer value.", function ); return( -1 ); } if( integer_value > (uint64_t) UINT8_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: integer value out of bounds.", function ); return( -1 ); } *value_8bit = (uint8_t) integer_value; result = 1; } } return( result ); } /* Copies the value data from a 16-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_16bit( libfvalue_value_t *value, int value_entry_index, uint16_t value_16bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_16bit"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_integer( value_instance, (uint64_t) value_16bit, 16, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from 16-bit integer.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to a 16-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_16bit( libfvalue_value_t *value, int value_entry_index, uint16_t *value_16bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_16bit"; size_t integer_value_size = 0; uint64_t integer_value = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_16bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value 16-bit.", function ); return( -1 ); } if( internal_value->copy_to_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_integer( value_instance, &integer_value, &integer_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to integer value.", function ); return( -1 ); } if( integer_value > (uint64_t) UINT16_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: integer value out of bounds.", function ); return( -1 ); } *value_16bit = (uint16_t) integer_value; result = 1; } } return( result ); } /* Copies the value data from a 32-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_32bit( libfvalue_value_t *value, int value_entry_index, uint32_t value_32bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_32bit"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_integer( value_instance, (uint64_t) value_32bit, 32, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from 32-bit integer.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to a 32-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_32bit( libfvalue_value_t *value, int value_entry_index, uint32_t *value_32bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_32bit"; size_t integer_value_size = 0; uint64_t integer_value = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_32bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value 32-bit.", function ); return( -1 ); } if( internal_value->copy_to_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_integer( value_instance, &integer_value, &integer_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to integer value.", function ); return( -1 ); } if( integer_value > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: integer value out of bounds.", function ); return( -1 ); } *value_32bit = (uint32_t) integer_value; result = 1; } } return( result ); } /* Copies the value data from a 64-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_64bit( libfvalue_value_t *value, int value_entry_index, uint64_t value_64bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_64bit"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_integer( value_instance, (uint64_t) value_64bit, 64, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from 64-bit integer.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to a 64-bit value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_64bit( libfvalue_value_t *value, int value_entry_index, uint64_t *value_64bit, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_64bit"; size_t integer_value_size = 0; uint64_t integer_value = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_64bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value 64-bit.", function ); return( -1 ); } if( internal_value->copy_to_integer != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_integer( value_instance, &integer_value, &integer_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to integer value.", function ); return( -1 ); } *value_64bit = (uint64_t) integer_value; result = 1; } } return( result ); } /* Floating point value functions */ /* Copies the value data from a float value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_float( libfvalue_value_t *value, int value_entry_index, float value_float, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_float"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_floating_point != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_floating_point( value_instance, (double) value_float, 32, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from 32-bit floating point.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to a float value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_float( libfvalue_value_t *value, int value_entry_index, float *value_float, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_float"; size_t floating_point_value_size = 0; double floating_point_value = 0.0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_float == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value float.", function ); return( -1 ); } if( internal_value->copy_to_floating_point != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_floating_point( value_instance, &floating_point_value, &floating_point_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to floating point value.", function ); return( -1 ); } *value_float = (float) floating_point_value; result = 1; } } return( result ); } /* Copies the value data from a double value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_double( libfvalue_value_t *value, int value_entry_index, double value_double, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_double"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_floating_point != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_from_floating_point( value_instance, (double) value_double, 64, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from 32-bit floating point.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to a double value * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_double( libfvalue_value_t *value, int value_entry_index, double *value_double, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_double"; size_t floating_point_value_size = 0; double floating_point_value = 0.0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( value_double == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value double.", function ); return( -1 ); } if( internal_value->copy_to_floating_point != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_floating_point( value_instance, &floating_point_value, &floating_point_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to floating point value.", function ); return( -1 ); } *value_double = (double) floating_point_value; result = 1; } } return( result ); } /* String value functions */ /* Copies the value data from an UTF-8 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_utf8_string( libfvalue_value_t *value, int value_entry_index, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_utf8_string"; size_t utf8_string_index = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->initialize_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing initialize instance function.", function ); return( -1 ); } if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( internal_value->copy_from_utf8_string_with_index != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance == NULL ) { if( internal_value->initialize_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value instance.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_value->value_instances, value_entry_index, value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, value_entry_index ); internal_value->free_instance( &value_instance, NULL ); return( -1 ); } } if( internal_value->copy_from_utf8_string_with_index( value_instance, utf8_string, utf8_string_length, &utf8_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from UTF-8 string.", function ); return( -1 ); } result = 1; } return( result ); } /* Retrieves the size of an UTF-8 encoded string of the value data * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_get_utf8_string_size( libfvalue_value_t *value, int value_entry_index, size_t *utf8_string_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_get_utf8_string_size"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->get_utf8_string_size != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->get_utf8_string_size( value_instance, utf8_string_size, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size UTF-8 string of instance.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to an UTF-8 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_utf8_string( libfvalue_value_t *value, int value_entry_index, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "libfvalue_value_copy_to_utf8_string"; size_t utf8_string_index = 0; int result = 0; result = libfvalue_value_copy_to_utf8_string_with_index( value, value_entry_index, utf8_string, utf8_string_size, &utf8_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %d to UTF-8 string.", function, value_entry_index ); return( -1 ); } return( result ); } /* Copies the value data to an UTF-8 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_utf8_string_with_index( libfvalue_value_t *value, int value_entry_index, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_utf8_string_with_index"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_to_utf8_string_with_index != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_utf8_string_with_index( value_instance, utf8_string, utf8_string_size, utf8_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to UTF-8 string.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data from an UTF-16 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_utf16_string( libfvalue_value_t *value, int value_entry_index, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_utf16_string"; size_t utf16_string_index = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->initialize_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing initialize instance function.", function ); return( -1 ); } if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } if( internal_value->copy_from_utf16_string_with_index != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance == NULL ) { if( internal_value->initialize_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value instance.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_value->value_instances, value_entry_index, value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, value_entry_index ); internal_value->free_instance( &value_instance, NULL ); return( -1 ); } } if( internal_value->copy_from_utf16_string_with_index( value_instance, utf16_string, utf16_string_length, &utf16_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from UTF-16 string.", function ); return( -1 ); } result = 1; } return( result ); } /* Retrieves the size of an UTF-16 encoded string of the value data * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_get_utf16_string_size( libfvalue_value_t *value, int value_entry_index, size_t *utf16_string_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_get_utf16_string_size"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->get_utf16_string_size != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->get_utf16_string_size( value_instance, utf16_string_size, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size UTF-16 string of instance.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to an UTF-16 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_utf16_string( libfvalue_value_t *value, int value_entry_index, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ) { static char *function = "libfvalue_value_copy_to_utf16_string"; size_t utf16_string_index = 0; int result = 0; result = libfvalue_value_copy_to_utf16_string_with_index( value, value_entry_index, utf16_string, utf16_string_size, &utf16_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %d to UTF-16 string.", function, value_entry_index ); return( -1 ); } return( result ); } /* Copies the value data to an UTF-16 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_utf16_string_with_index( libfvalue_value_t *value, int value_entry_index, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_utf16_string_with_index"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_to_utf16_string_with_index != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_utf16_string_with_index( value_instance, utf16_string, utf16_string_size, utf16_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to UTF-16 string.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data from an UTF-32 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_from_utf32_string( libfvalue_value_t *value, int value_entry_index, const uint32_t *utf32_string, size_t utf32_string_length, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_from_utf32_string"; size_t utf32_string_index = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->initialize_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing initialize instance function.", function ); return( -1 ); } if( internal_value->free_instance == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing free instance function.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_utf32_string_with_index != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance == NULL ) { if( internal_value->initialize_instance( &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value instance.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_value->value_instances, value_entry_index, value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values instances array.", function, value_entry_index ); internal_value->free_instance( &value_instance, NULL ); return( -1 ); } } if( internal_value->copy_from_utf32_string_with_index( value_instance, utf32_string, utf32_string_length, &utf32_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance from UTF-32 string.", function ); return( -1 ); } result = 1; } return( result ); } /* Retrieves the size of an UTF-32 encoded string of the value data * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_get_utf32_string_size( libfvalue_value_t *value, int value_entry_index, size_t *utf32_string_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_get_utf32_string_size"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->get_utf32_string_size != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->get_utf32_string_size( value_instance, utf32_string_size, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size UTF-32 string of instance.", function ); return( -1 ); } result = 1; } } return( result ); } /* Copies the value data to an UTF-32 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_utf32_string( libfvalue_value_t *value, int value_entry_index, uint32_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ) { static char *function = "libfvalue_value_copy_to_utf32_string"; size_t utf32_string_index = 0; int result = 0; result = libfvalue_value_copy_to_utf32_string_with_index( value, value_entry_index, utf32_string, utf32_string_size, &utf32_string_index, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy value: %d to UTF-32 string.", function, value_entry_index ); return( -1 ); } return( result ); } /* Copies the value data to an UTF-32 encoded string * Returns 1 if successful, 0 if value could not be set or -1 on error */ int libfvalue_value_copy_to_utf32_string_with_index( libfvalue_value_t *value, int value_entry_index, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_copy_to_utf32_string_with_index"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_to_utf32_string_with_index != NULL ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); return( -1 ); } if( value_instance != NULL ) { if( internal_value->copy_to_utf32_string_with_index( value_instance, utf32_string, utf32_string_size, utf32_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to UTF-32 string.", function ); return( -1 ); } result = 1; } } return( result ); } /* Marshalling functions */ #ifdef TODO /* Reads the value data from a file stream * Returns the number of bytes read or -1 on error */ ssize_t libfvalue_value_read_from_file_stream( libfvalue_value_t *value, FILE *file_stream, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_read_from_file_stream"; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->copy_from_utf8_string_with_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing copy from UTF-8 string function.", function ); return( -1 ); } if( file_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file stream.", function ); return( -1 ); } /* TODO implement function */ return( -1 ); } #endif /* TODO */ /* Writes the value data to a file stream * Returns the number of bytes written or -1 on error */ ssize_t libfvalue_value_write_to_file_stream( libfvalue_value_t *value, FILE *file_stream, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; intptr_t *value_instance = NULL; uint8_t *value_string = NULL; static char *function = "libfvalue_value_write_to_file_stream"; size_t value_string_index = 0; size_t value_string_size = 0; ssize_t write_count = 0; int print_count = 0; int number_of_value_entries = 0; int value_entry_index = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->type_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing type string.", function ); return( -1 ); } if( ( internal_value->identifier == NULL ) || ( internal_value->identifier[ 0 ] == 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing identifier.", function ); return( -1 ); } if( internal_value->get_utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing get UTF-8 string size function.", function ); return( -1 ); } if( internal_value->copy_to_utf8_string_with_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing copy to UTF-8 string function.", function ); return( -1 ); } if( file_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file stream.", function ); return( -1 ); } if( libfvalue_value_get_number_of_value_entries( value, &number_of_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of value entries.", function ); goto on_error; } for( value_entry_index = 0; value_entry_index < number_of_value_entries; value_entry_index++ ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); goto on_error; } print_count = fprintf( file_stream, "<%s type=\"%s\">", (char *) internal_value->identifier, internal_value->type_string ); if( print_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); goto on_error; } write_count += print_count; if( number_of_value_entries > 1 ) { print_count = fprintf( file_stream, "" ); if( print_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); goto on_error; } write_count += print_count; } if( value_instance != NULL ) { if( internal_value->get_utf8_string_size( value_instance, &value_string_size, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size UTF-8 string of instance.", function ); goto on_error; } if( value_string_size > 0 ) { value_string = (uint8_t *) memory_allocate( sizeof( uint8_t ) * value_string_size ); if( value_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to value string.", function ); goto on_error; } if( internal_value->copy_to_utf8_string_with_index( value_instance, value_string, value_string_size, &value_string_index, internal_value->format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to UTF-8 string.", function ); goto on_error; } print_count = fprintf( file_stream, "%s", value_string ); if( print_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); goto on_error; } write_count += print_count; memory_free( value_string ); value_string = NULL; } } if( number_of_value_entries > 1 ) { print_count = fprintf( file_stream, "" ); if( print_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); goto on_error; } write_count += print_count; } print_count = fprintf( file_stream, "", (char *) internal_value->identifier ); if( print_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write to file stream.", function ); goto on_error; } write_count += print_count; } return( write_count ); on_error: if( value_string != NULL ) { memory_free( value_string ); } return( -1 ); } /* Prints the value * Returns 1 if successful or -1 on error */ int libfvalue_value_print( libfvalue_value_t *value, int value_entry_index, uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; system_character_t *value_string = NULL; intptr_t *value_instance = NULL; static char *function = "libfvalue_value_print"; size_t value_string_index = 0; size_t value_string_size = 0; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( internal_value->type_description == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing type description.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( internal_value->get_utf16_string_size == NULL ) #else if( internal_value->get_utf8_string_size == NULL ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing get string size function.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( internal_value->copy_to_utf16_string_with_index == NULL ) #else if( internal_value->copy_to_utf8_string_with_index == NULL ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid value - missing copy to string function.", function ); return( -1 ); } if( ( flags & ~( LIBFVALUE_PRINT_FLAG_WITH_TYPE_DESCRIPTION ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function, flags ); return( -1 ); } if( ( flags & LIBFVALUE_PRINT_FLAG_WITH_TYPE_DESCRIPTION ) != 0 ) { libcnotify_printf( "%s\t: ", internal_value->type_description ); } result = libfvalue_value_has_data( value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if value has data.", function ); goto on_error; } else if( result != 0 ) { if( libfvalue_value_get_value_instance_by_index( value, value_entry_index, &value_instance, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value instance: %d.", function, value_entry_index ); goto on_error; } if( value_instance != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = internal_value->get_utf16_string_size( value_instance, &value_string_size, internal_value->format_flags, error ); #else result = internal_value->get_utf8_string_size( value_instance, &value_string_size, internal_value->format_flags, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size value string of instance.", function ); goto on_error; } if( value_string_size > 0 ) { value_string = system_string_allocate( value_string_size ); if( value_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to value string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = internal_value->copy_to_utf16_string_with_index( value_instance, (uint16_t *) value_string, value_string_size, &value_string_index, internal_value->format_flags, error ); #else result = internal_value->copy_to_utf8_string_with_index( value_instance, (uint8_t *) value_string, value_string_size, &value_string_index, internal_value->format_flags, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy instance to value string.", function ); goto on_error; } libcnotify_printf( "%" PRIs_SYSTEM "", value_string ); memory_free( value_string ); value_string = NULL; } } } if( ( flags & LIBFVALUE_PRINT_FLAG_WITH_TYPE_DESCRIPTION ) != 0 ) { libcnotify_printf( "\n\n" ); } return( 1 ); on_error: if( value_string != NULL ) { memory_free( value_string ); } return( -1 ); } libewf-20140807/libfvalue/libfvalue_libcnotify.h0000664000175000017500000000254513443450055023657 0ustar00lordyestalordyesta00000000000000/* * The internal libcnotify header * * Copyright (C) 2010-2018, 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( _LIBFVALUE_LIBCNOTIFY_H ) #define _LIBFVALUE_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libfvalue/libfvalue_types.h0000664000175000017500000000365613443450055022665 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_TYPES_H ) #define _LIBFVALUE_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue * The definitions in are copied here * for local use of libfvalue */ #if defined( HAVE_LOCAL_LIBFVALUE ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libfvalue_data_handle {} libfvalue_data_handle_t; typedef struct libfvalue_split_utf16_string {} libfvalue_split_utf16_string_t; typedef struct libfvalue_split_utf8_string {} libfvalue_split_utf8_string_t; typedef struct libfvalue_table {} libfvalue_table_t; typedef struct libfvalue_value {} libfvalue_value_t; #else typedef intptr_t libfvalue_data_handle_t; typedef intptr_t libfvalue_split_utf16_string_t; typedef intptr_t libfvalue_split_utf8_string_t; typedef intptr_t libfvalue_table_t; typedef intptr_t libfvalue_value_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBFVALUE ) */ #endif /* !defined( _LIBFVALUE_INTERNAL_TYPES_H ) */ libewf-20140807/libfvalue/Makefile.am0000664000175000017500000000307713443450055021350 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBFVALUE AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libfvalue.la libfvalue_la_SOURCES = \ libfvalue_binary_data.c libfvalue_binary_data.h \ libfvalue_codepage.h \ libfvalue_data_handle.c libfvalue_data_handle.h \ libfvalue_definitions.h \ libfvalue_error.c libfvalue_error.h \ libfvalue_extern.h \ libfvalue_filetime.c libfvalue_filetime.h \ libfvalue_floating_point.c libfvalue_floating_point.h \ libfvalue_integer.c libfvalue_integer.h \ libfvalue_libcdata.h \ libfvalue_libcerror.h \ libfvalue_libcnotify.h \ libfvalue_libfdatetime.h \ libfvalue_libfguid.h \ libfvalue_libfwnt.h \ libfvalue_libuna.h \ libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ libfvalue_split_utf8_string.c libfvalue_split_utf8_string.h \ libfvalue_string.c libfvalue_string.h \ libfvalue_types.h \ libfvalue_table.c libfvalue_table.h \ libfvalue_value.c libfvalue_value.h \ libfvalue_value_entry.c libfvalue_value_entry.h \ libfvalue_value_type.c libfvalue_value_type.h \ libfvalue_support.c libfvalue_support.h \ libfvalue_unused.h \ libfvalue_utf16_string.c libfvalue_utf16_string.h \ libfvalue_utf8_string.c libfvalue_utf8_string.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libfvalue ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfvalue_la_SOURCES) libewf-20140807/libfvalue/libfvalue_integer.h0000664000175000017500000001643213443450055023152 0ustar00lordyestalordyesta00000000000000/* * Integer value functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTEGER_H ) #define _LIBFVALUE_INTEGER_H #include #include #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_integer libfvalue_integer_t; struct libfvalue_integer { /* The value */ uint64_t value; /* The value size */ size_t value_size; }; int libfvalue_integer_initialize( libfvalue_integer_t **integer, libcerror_error_t **error ); int libfvalue_integer_free( libfvalue_integer_t **integer, libcerror_error_t **error ); int libfvalue_integer_clone( libfvalue_integer_t **destination_integer, libfvalue_integer_t *source_integer, libcerror_error_t **error ); int libfvalue_integer_copy_from_byte_stream( libfvalue_integer_t *integer, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ); int libfvalue_integer_copy_from_integer( libfvalue_integer_t *integer, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ); int libfvalue_integer_copy_to_integer( libfvalue_integer_t *integer, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ); int libfvalue_integer_get_string_size( libfvalue_integer_t *integer, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_integer_copy_from_utf8_string_with_index( libfvalue_integer_t *integer, uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_integer_copy_to_utf8_string_with_index( libfvalue_integer_t *integer, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_integer_copy_from_utf16_string_with_index( libfvalue_integer_t *integer, uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_integer_copy_to_utf16_string_with_index( libfvalue_integer_t *integer, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_integer_copy_from_utf32_string_with_index( libfvalue_integer_t *integer, uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_integer_copy_to_utf32_string_with_index( libfvalue_integer_t *integer, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_string_size_from_integer( size_t *string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_copy_from_integer( uint8_t *utf8_string, size_t utf8_string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_with_index_copy_from_integer( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_copy_to_integer( const uint8_t *utf8_string, size_t utf8_string_length, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_with_index_copy_to_integer( const uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_copy_from_integer( uint16_t *utf16_string, size_t utf16_string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_with_index_copy_from_integer( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_copy_to_integer( const uint16_t *utf16_string, size_t utf16_string_length, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_with_index_copy_to_integer( const uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_copy_from_integer( uint32_t *utf32_string, size_t utf32_string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_with_index_copy_from_integer( uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_copy_to_integer( const uint32_t *utf32_string, size_t utf32_string_length, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_with_index_copy_to_integer( const uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTEGER_H ) */ libewf-20140807/libfvalue/libfvalue_support.c0000664000175000017500000000216513443450055023222 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_definitions.h" #include "libfvalue_support.h" #if !defined( HAVE_LOCAL_LIBFVALUE ) /* Returns the library version as a string */ const char *libfvalue_get_version( void ) { return( (const char *) LIBFVALUE_VERSION_STRING ); } #endif libewf-20140807/libfvalue/libfvalue_split_utf16_string.c0000664000175000017500000003363413443450055025261 0ustar00lordyestalordyesta00000000000000/* * Split UTF-16 string functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_libcerror.h" #include "libfvalue_split_utf16_string.h" #include "libfvalue_types.h" /* Creates a split UTF-16 string * Make sure the value split_string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_split_utf16_string_initialize( libfvalue_split_utf16_string_t **split_string, const uint16_t *utf16_string, size_t utf16_string_size, int number_of_segments, libcerror_error_t **error ) { libfvalue_internal_split_utf16_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf16_string_initialize"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string value already set.", function ); return( -1 ); } if( number_of_segments < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of segments less than zero.", function ); return( -1 ); } internal_split_string = memory_allocate_structure( libfvalue_internal_split_utf16_string_t ); if( internal_split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create split string.", function ); goto on_error; } if( memory_set( internal_split_string, 0, sizeof( libfvalue_internal_split_utf16_string_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear split string.", function ); memory_free( internal_split_string ); return( -1 ); } if( ( utf16_string != NULL ) && ( utf16_string_size > 0 ) ) { internal_split_string->string = (uint16_t *) memory_allocate( sizeof( uint16_t ) * utf16_string_size ); if( internal_split_string->string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); goto on_error; } if( memory_copy( internal_split_string->string, utf16_string, sizeof( uint16_t ) * ( utf16_string_size - 1 ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to copy string.", function ); goto on_error; } internal_split_string->string[ utf16_string_size - 1 ] = 0; internal_split_string->string_size = utf16_string_size; } if( number_of_segments > 0 ) { internal_split_string->segments = (uint16_t **) memory_allocate( sizeof( uint16_t * ) * number_of_segments ); if( internal_split_string->segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segments.", function ); goto on_error; } if( memory_set( internal_split_string->segments, 0, sizeof( uint16_t * ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segments.", function ); goto on_error; } internal_split_string->segment_sizes = (size_t *) memory_allocate( sizeof( size_t ) * number_of_segments ); if( internal_split_string->segment_sizes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment sizes.", function ); goto on_error; } if( memory_set( internal_split_string->segment_sizes, 0, sizeof( size_t ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment sizes.", function ); goto on_error; } } internal_split_string->number_of_segments = number_of_segments; *split_string = (libfvalue_split_utf16_string_t *) internal_split_string; return( 1 ); on_error: if( internal_split_string != NULL ) { if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } memory_free( internal_split_string ); } return( -1 ); } /* Frees a split UTF-16 string * Returns 1 if successful or -1 on error */ int libfvalue_split_utf16_string_free( libfvalue_split_utf16_string_t **split_string, libcerror_error_t **error ) { libfvalue_internal_split_utf16_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf16_string_free"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { internal_split_string = (libfvalue_internal_split_utf16_string_t *) *split_string; *split_string = NULL; if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } memory_free( internal_split_string ); } return( 1 ); } /* Retrieves the UTF-16 string * Returns 1 if successful or -1 on error */ int libfvalue_split_utf16_string_get_string( libfvalue_split_utf16_string_t *split_string, uint16_t **utf16_string, size_t *utf16_string_size, libcerror_error_t **error ) { libfvalue_internal_split_utf16_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf16_string_get_string"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf16_string_t *) split_string; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string = internal_split_string->string; *utf16_string_size = internal_split_string->string_size; return( 1 ); } /* Retrieves the number of segments * Returns 1 if successful or -1 on error */ int libfvalue_split_utf16_string_get_number_of_segments( libfvalue_split_utf16_string_t *split_string, int *number_of_segments, libcerror_error_t **error ) { libfvalue_internal_split_utf16_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf16_string_get_number_of_segments"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf16_string_t *) split_string; if( number_of_segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of segments.", function ); return( -1 ); } *number_of_segments = internal_split_string->number_of_segments; return( 1 ); } /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libfvalue_split_utf16_string_get_segment_by_index( libfvalue_split_utf16_string_t *split_string, int segment_index, uint16_t **utf16_string_segment, size_t *utf16_string_segment_size, libcerror_error_t **error ) { libfvalue_internal_split_utf16_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf16_string_get_segment_by_index"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf16_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( utf16_string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string segment.", function ); return( -1 ); } if( utf16_string_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string segment size.", function ); return( -1 ); } *utf16_string_segment = internal_split_string->segments[ segment_index ]; *utf16_string_segment_size = internal_split_string->segment_sizes[ segment_index ]; return( 1 ); } /* Sets a specific segment * Returns 1 if successful or -1 on error */ int libfvalue_split_utf16_string_set_segment_by_index( libfvalue_split_utf16_string_t *split_string, int segment_index, uint16_t *utf16_string_segment, size_t utf16_string_segment_size, libcerror_error_t **error ) { libfvalue_internal_split_utf16_string_t *internal_split_string = NULL; static char *function = "libfvalue_split_utf16_string_set_segment_by_index"; size_t utf16_string_segment_offset = 0; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libfvalue_internal_split_utf16_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( utf16_string_segment_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string segment size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_segment == NULL ) { if( utf16_string_segment_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string segment size value out of bounds.", function ); return( -1 ); } } else { if( utf16_string_segment < internal_split_string->string ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string segment value out of bounds.", function ); return( -1 ); } utf16_string_segment_offset = (size_t) ( utf16_string_segment - internal_split_string->string ); if( utf16_string_segment_offset > internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string segment value out of bounds.", function ); return( -1 ); } utf16_string_segment_offset += utf16_string_segment_size; if( utf16_string_segment_offset > internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string segment value out of bounds.", function ); return( -1 ); } } internal_split_string->segments[ segment_index ] = utf16_string_segment; internal_split_string->segment_sizes[ segment_index ] = utf16_string_segment_size; return( 1 ); } libewf-20140807/libfvalue/libfvalue_unused.h0000664000175000017500000000255613443450055023022 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_UNUSED_H ) #define _LIBFVALUE_INTERNAL_UNUSED_H #include #if !defined( LIBFVALUE_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBFVALUE_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBFVALUE_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBFVALUE_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBFVALUE_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBFVALUE_INTERNAL_UNUSED_H ) */ libewf-20140807/libfvalue/libfvalue_floating_point.c0000664000175000017500000024507613443450055024534 0ustar00lordyestalordyesta00000000000000/* * Floating point value (IEEE 754) functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include #include "libfvalue_definitions.h" #include "libfvalue_floating_point.h" #include "libfvalue_libcerror.h" /* Creates a floating point * Make sure the value floating_point is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_initialize( libfvalue_floating_point_t **floating_point, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_initialize"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( *floating_point != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid floating point value already set.", function ); return( -1 ); } *floating_point = memory_allocate_structure( libfvalue_floating_point_t ); if( *floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create floating point.", function ); goto on_error; } if( memory_set( *floating_point, 0, sizeof( libfvalue_floating_point_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear floating point.", function ); goto on_error; } return( 1 ); on_error: if( *floating_point != NULL ) { memory_free( *floating_point ); *floating_point = NULL; } return( -1 ); } /* Frees a floating point * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_free( libfvalue_floating_point_t **floating_point, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_free"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( *floating_point != NULL ) { memory_free( *floating_point ); *floating_point = NULL; } return( 1 ); } /* Clones a floating point * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_clone( libfvalue_floating_point_t **destination_floating_point, libfvalue_floating_point_t *source_floating_point, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_clone"; if( destination_floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination floating point.", function ); return( -1 ); } if( *destination_floating_point != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination floating point already set.", function ); return( -1 ); } if( source_floating_point == NULL ) { *destination_floating_point = NULL; return( 1 ); } *destination_floating_point = memory_allocate_structure( libfvalue_floating_point_t ); if( *destination_floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination floating point.", function ); goto on_error; } if( memory_copy( *destination_floating_point, source_floating_point, sizeof( libfvalue_floating_point_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy floating point.", function ); goto on_error; } return( 1 ); on_error: if( *destination_floating_point != NULL ) { memory_free( *destination_floating_point ); *destination_floating_point = NULL; } return( -1 ); } /* Copies the floating point from a byte stream * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_from_byte_stream( libfvalue_floating_point_t *floating_point, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_from_byte_stream"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( ( encoding != LIBFVALUE_ENDIAN_BIG ) && ( encoding != LIBFVALUE_ENDIAN_LITTLE ) && ( encoding != LIBFVALUE_ENDIAN_NATIVE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); return( -1 ); } switch( byte_stream_size ) { case 4: if( encoding == LIBFVALUE_ENDIAN_BIG ) { byte_stream_copy_to_uint32_big_endian( byte_stream, floating_point->value ); } else if( encoding == LIBFVALUE_ENDIAN_LITTLE ) { byte_stream_copy_to_uint32_little_endian( byte_stream, floating_point->value ); } else { floating_point->value = (uint64_t) *( (uint32_t *) byte_stream ); } break; case 8: if( encoding == LIBFVALUE_ENDIAN_BIG ) { byte_stream_copy_to_uint64_big_endian( byte_stream, floating_point->value ); } else if( encoding == LIBFVALUE_ENDIAN_LITTLE ) { byte_stream_copy_to_uint64_little_endian( byte_stream, floating_point->value ); } else { floating_point->value = (uint64_t) *( (uint64_t *) byte_stream ); } break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte stream size: %" PRIzd ".", function, byte_stream_size ); return( -1 ); } floating_point->value_size = byte_stream_size * 8; return( 1 ); } /* Copies the floating point from an integer value * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_from_integer( libfvalue_floating_point_t *floating_point, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_floating_point_copy_from_integer"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } value_float64.floating_point = (double) integer_value; floating_point->value = value_float64.integer; floating_point->value_size = 64; return( 1 ); } /* Copies the floating point to an integer value * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_to_integer( libfvalue_floating_point_t *floating_point, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_floating_point_copy_to_integer"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( integer_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value.", function ); return( -1 ); } if( integer_value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value size.", function ); return( -1 ); } value_float64.integer = floating_point->value; *integer_value = (uint64_t) value_float64.floating_point; *integer_value_size = 64; return( 1 ); } /* Copies the floating point from a floating point value * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_from_floating_point( libfvalue_floating_point_t *floating_point, double floating_point_value, size_t floating_point_value_size, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_floating_point_copy_from_floating_point"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } value_float64.floating_point = floating_point_value; floating_point->value = value_float64.integer; floating_point->value_size = 64; return( 1 ); } /* Copies the floating point to a floating point value * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_to_floating_point( libfvalue_floating_point_t *floating_point, double *floating_point_value, size_t *floating_point_value_size, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_floating_point_copy_to_floating_point"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( floating_point_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point value.", function ); return( -1 ); } if( floating_point_value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point value size.", function ); return( -1 ); } value_float64.integer = floating_point->value; *floating_point_value = (double) value_float64.floating_point; *floating_point_value_size = 64; return( 1 ); } /* Retrieves the size of a string of the floating point * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_get_string_size( libfvalue_floating_point_t *floating_point, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_get_string_size"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_string_size_from_floating_point( string_size, floating_point->value, floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to determine size of string of %" PRIzd "-bit floating point.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Copies the floating point from an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_from_utf8_string_with_index( libfvalue_floating_point_t *floating_point, uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_from_utf8_string_with_index"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_utf8_string_with_index_copy_to_floating_point( utf8_string, utf8_string_length, utf8_string_index, &( floating_point->value ), floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit floating point from UTF-8 string.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Copies the floating point to an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_to_utf8_string_with_index( libfvalue_floating_point_t *floating_point, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_to_utf8_string_with_index"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_utf8_string_with_index_copy_from_floating_point( utf8_string, utf8_string_size, utf8_string_index, floating_point->value, floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit floating point to UTF-8 string.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Copies the floating point from an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_from_utf16_string_with_index( libfvalue_floating_point_t *floating_point, uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_from_utf16_string_with_index"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_utf16_string_with_index_copy_to_floating_point( utf16_string, utf16_string_length, utf16_string_index, &( floating_point->value ), floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit floating point from UTF-16 string.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Copies the floating point to an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_to_utf16_string_with_index( libfvalue_floating_point_t *floating_point, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_to_utf16_string_with_index"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_utf16_string_with_index_copy_from_floating_point( utf16_string, utf16_string_size, utf16_string_index, floating_point->value, floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit floating point to UTF-16 string.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Copies the floating point from an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_from_utf32_string_with_index( libfvalue_floating_point_t *floating_point, uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_from_utf32_string_with_index"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_utf32_string_with_index_copy_to_floating_point( utf32_string, utf32_string_length, utf32_string_index, &( floating_point->value ), floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit floating point from UTF-32 string.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Copies the floating point to an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_floating_point_copy_to_utf32_string_with_index( libfvalue_floating_point_t *floating_point, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_floating_point_copy_to_utf32_string_with_index"; if( floating_point == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point.", function ); return( -1 ); } if( libfvalue_utf32_string_with_index_copy_from_floating_point( utf32_string, utf32_string_size, utf32_string_index, floating_point->value, floating_point->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit floating point to UTF-32 string.", function, floating_point->value_size ); return( -1 ); } return( 1 ); } /* Determines the size of a string of a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_string_size_from_floating_point( size_t *string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_size_from_floating_point"; size_t safe_string_size = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t is_indeterminate = 0; uint8_t is_infinite = 0; uint8_t is_not_a_number = 0; uint8_t is_signed = 0; int8_t bit_shift = 0; if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { safe_string_size = ( floating_point_value_size >> 2 ) + 3; } else { bit_shift = (uint8_t) ( floating_point_value_size - 1 ); is_signed = (uint8_t) ( floating_point_value >> bit_shift ); if( is_signed != 0 ) { floating_point_value &= ~( (uint64_t) 1 << bit_shift ); } switch( floating_point_value_size ) { case 32: if( floating_point_value == 0x7f800000UL ) { is_infinite = 1; } else if( ( is_signed != 0 ) && ( floating_point_value == 0x7fc00000UL ) ) { is_indeterminate = 1; } else if( ( floating_point_value >= 0x7f800001UL ) && ( floating_point_value <= 0x7fffffffUL ) ) { is_not_a_number = 1; } break; case 64: #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) if( floating_point_value == 0x7ff0000000000000UL ) #else if( floating_point_value == 0x7ff0000000000000ULL ) #endif { is_infinite = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000UL ) ) #else else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000ULL ) ) #endif { is_indeterminate = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( floating_point_value >= 0x7ff0000000000001UL ) && ( floating_point_value <= 0x7fffffffffffffffUL ) ) #else else if( ( floating_point_value >= 0x7ff0000000000001ULL ) && ( floating_point_value <= 0x7fffffffffffffffULL ) ) #endif { is_not_a_number = 1; } break; } if( is_indeterminate != 0 ) { /* "Ind\x00" */ safe_string_size = 4; } else if( is_infinite != 0 ) { /* "Inf\x00" */ safe_string_size = 4; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ safe_string_size = 4; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { safe_string_size = 15; } else { safe_string_size = 14; } } } *string_size = safe_string_size; return( 1 ); } /* Copies an UTF-8 encoded string from a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_copy_from_floating_point( uint8_t *utf8_string, size_t utf8_string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf8_string_copy_from_floating_point"; size_t utf8_string_index = 0; if( libfvalue_utf8_string_with_index_copy_from_floating_point( utf8_string, utf8_string_size, &utf8_string_index, floating_point_value, floating_point_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy floating point value to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 encoded string of from floating_point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_with_index_copy_from_floating_point( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { byte_stream_float32_t value_float32; byte_stream_float64_t value_float64; static char *function = "libfvalue_utf8_string_with_index_copy_from_floating_point"; size_t safe_utf8_string_index = 0; uint64_t divider = 0; uint64_t value_fraction = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; int16_t exponent10 = 0; int16_t exponent2 = 0; uint8_t byte_value = 0; uint8_t digit_index = 0; uint8_t exponent_sign = 0; uint8_t is_indeterminate = 0; uint8_t is_infinite = 0; uint8_t is_not_a_number = 0; uint8_t is_signed = 0; uint8_t number_of_characters = 0; int8_t bit_shift = 0; double exponent_value = 0.0; double value_float = 0.0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } safe_utf8_string_index = *utf8_string_index; if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { number_of_characters = (uint8_t) ( floating_point_value_size >> 2 ) + 3; } else { bit_shift = (uint8_t) ( floating_point_value_size - 1 ); is_signed = (uint8_t) ( floating_point_value >> bit_shift ); if( is_signed != 0 ) { floating_point_value &= ~( (uint64_t) 1 << bit_shift ); } switch( floating_point_value_size ) { case 32: if( floating_point_value == 0x7f800000UL ) { is_infinite = 1; } else if( ( is_signed != 0 ) && ( floating_point_value == 0x7fc00000UL ) ) { is_indeterminate = 1; } else if( ( floating_point_value >= 0x7f800001UL ) && ( floating_point_value <= 0x7fffffffUL ) ) { is_not_a_number = 1; } else if( floating_point_value != 0 ) { value_float32.integer = (uint32_t) floating_point_value; value_float = (double) value_float32.floating_point; exponent2 = (int16_t) ( floating_point_value >> 23 ); if( exponent2 == 0 ) { exponent2 = -126; } else { exponent2 -= 127; } } break; case 64: #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) if( floating_point_value == 0x7ff0000000000000UL ) #else if( floating_point_value == 0x7ff0000000000000ULL ) #endif { is_infinite = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000UL ) ) #else else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000ULL ) ) #endif { is_indeterminate = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( floating_point_value >= 0x7ff0000000000001UL ) && ( floating_point_value <= 0x7fffffffffffffffUL ) ) #else else if( ( floating_point_value >= 0x7ff0000000000001ULL ) && ( floating_point_value <= 0x7fffffffffffffffULL ) ) #endif { is_not_a_number = 1; } else if( floating_point_value != 0 ) { value_float64.integer = (uint64_t) floating_point_value; value_float = (double) value_float64.floating_point; exponent2 = (int16_t) ( floating_point_value >> 52 ); if( exponent2 == 0 ) { exponent2 = -1023; } else { exponent2 -= 1023; } } break; } if( is_indeterminate != 0 ) { /* "Ind\x00" */ number_of_characters = 4; } else if( is_infinite != 0 ) { /* "Inf\x00" */ number_of_characters = 4; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ number_of_characters = 4; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { number_of_characters = 15; } else { number_of_characters = 14; } } } if( ( number_of_characters > utf8_string_size ) || ( safe_utf8_string_index > ( utf8_string_size - number_of_characters ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string size too small.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'x'; bit_shift = (uint8_t) ( floating_point_value_size - 4 ); do { byte_value = (uint8_t) ( ( floating_point_value >> bit_shift ) & 0x0f ); if( byte_value <= 9 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0' + byte_value; } else { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'a' + byte_value - 10; } bit_shift -= 4; } while( bit_shift >= 0 ); } else { if( is_indeterminate != 0 ) { /* "Ind\x00" */ utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'I'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'n'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'd'; } else if( is_infinite != 0 ) { /* "Inf\x00" */ utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'I'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'n'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'f'; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'N'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'a'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'N'; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '-'; } if( exponent2 < 0 ) { exponent_sign = (uint8_t) '-'; exponent2 *= -1; } else { exponent_sign = (uint8_t) '+'; } exponent_value = 1.0; exponent10 = 0; while( exponent2 > 0 ) { exponent_value *= 2; exponent2--; if( exponent_value >= 10.0 ) { exponent_value /= 10.0; exponent10++; if( exponent_sign == (uint8_t) '-' ) { value_float *= 10.0; } else { value_float /= 10.0; } } } if( value_float != 0.0 ) { while( ( value_float < 1.0 ) || ( value_float >= 10.0 ) ) { exponent10++; if( exponent_sign == (uint8_t) '-' ) { value_float *= 10; } else { value_float /= 10; } } } for( digit_index = 0; digit_index < 7; digit_index++ ) { value_fraction *= 10; value_fraction += (uint8_t) value_float; value_float -= (uint8_t) value_float; value_float *= 10.0; } if( value_float >= 5.0 ) { value_fraction += 1; } divider = 1000000; for( digit_index = 0; digit_index < 7; digit_index++ ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0' + (uint8_t) ( value_fraction / divider ); if( digit_index == 0 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '.'; } value_fraction %= divider; divider /= 10; } utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'e'; utf8_string[ safe_utf8_string_index++ ] = exponent_sign; divider = 100; for( digit_index = 0; digit_index < 3; digit_index++ ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0' + (uint8_t) ( exponent10 / divider ); exponent10 %= divider; divider /= 10; } } } utf8_string[ safe_utf8_string_index++ ] = 0; *utf8_string_index = safe_utf8_string_index; return( 1 ); } /* Copies an UTF-8 encoded string to a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_with_index_copy_to_floating_point( uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint64_t *floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_utf8_string_with_index_copy_to_floating_point"; size_t fraction_index = 0; size_t maximum_string_index = 0; size_t safe_utf8_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; double value_fraction = 0.0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } safe_utf8_string_index = *utf8_string_index; if( floating_point_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point value.", function ); return( -1 ); } if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { maximum_string_index = (size_t) ( floating_point_value_size >> 2 ) + 3; } else { /* The string is at least a single digit with an end of string character */ maximum_string_index = 2; bit_shift = (uint8_t) ( floating_point_value_size - 1 ); divider = 1; value_64bit = ~( ( ~( (uint64_t) 1 << bit_shift ) >> bit_shift ) << bit_shift ); while( ( value_64bit / divider ) >= 10 ) { divider *= 10; maximum_string_index += 1; } } maximum_string_index += safe_utf8_string_index; if( maximum_string_index > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum string index value exceeds maximum.", function ); return( -1 ); } value_64bit = 0; if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { character_value = utf8_string[ safe_utf8_string_index++ ]; if(character_value != (uint8_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } character_value = utf8_string[ safe_utf8_string_index++ ]; if( character_value != (uint8_t) 'x' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } while( safe_utf8_string_index < utf8_string_length ) { character_value = utf8_string[ safe_utf8_string_index ]; if( character_value == 0 ) { break; } if( safe_utf8_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit <<= 4; if( ( character_value >= (uint8_t) '0' ) && ( character_value <= (uint8_t) '9' ) ) { byte_value = (uint8_t) ( character_value - (uint8_t) '0' ); } else if( ( character_value >= (uint8_t) 'A' ) && ( character_value <= (uint8_t) 'F' ) ) { byte_value = (uint8_t) ( character_value - (uint8_t) 'A' + 10 ); } else if( ( character_value >= (uint8_t) 'a' ) && ( character_value <= (uint8_t) 'f' ) ) { byte_value = (uint8_t) ( character_value - (uint8_t) 'a' + 10 ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } value_64bit += byte_value; safe_utf8_string_index++; } } else { value_float64.floating_point = 0.0; character_value = utf8_string[ safe_utf8_string_index ]; /* In the maximum possible string one character is substituted for the sign */ if( character_value == (uint8_t) '-' ) { safe_utf8_string_index++; sign = -1; } else if( character_value == (uint8_t) '+' ) { safe_utf8_string_index++; } while( safe_utf8_string_index < utf8_string_length ) { character_value = utf8_string[ safe_utf8_string_index ]; if( character_value == 0 ) { break; } if( safe_utf8_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } if( character_value == (uint8_t) '.' ) { break; } if( ( character_value < (uint8_t) '0' ) || ( character_value > (uint8_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } value_float64.floating_point *= 10; value_float64.floating_point += character_value - (uint8_t) '0'; safe_utf8_string_index++; } fraction_index = safe_utf8_string_index; safe_utf8_string_index++; utf8_string_length--; if( utf8_string_length > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } while( fraction_index < utf8_string_length ) { character_value = utf8_string[ utf8_string_length ]; if( character_value == 0 ) { break; } if( ( character_value < (uint8_t) '0' ) || ( character_value > (uint8_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, utf8_string_length ); return( -1 ); } value_fraction /= 10; value_fraction += character_value - (uint8_t) '0'; safe_utf8_string_index++; utf8_string_length--; } if( value_fraction != 0.0 ) { value_float64.floating_point += value_fraction / 10; } if( sign == -1 ) { value_float64.floating_point *= 1.0; } value_64bit = value_float64.integer; } *utf8_string_index = safe_utf8_string_index; *floating_point_value = value_64bit; return( 1 ); } /* Copies an UTF-16 encoded string of a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_copy_from_floating_point( uint16_t *utf16_string, size_t utf16_string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf16_string_copy_from_floating_point"; size_t utf16_string_index = 0; if( libfvalue_utf16_string_with_index_copy_from_floating_point( utf16_string, utf16_string_size, &utf16_string_index, floating_point_value, floating_point_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy floating point value to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 encoded string of from floating_point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_with_index_copy_from_floating_point( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { byte_stream_float32_t value_float32; byte_stream_float64_t value_float64; static char *function = "libfvalue_utf16_string_with_index_copy_from_floating_point"; size_t safe_utf16_string_index = 0; uint64_t divider = 0; uint64_t value_fraction = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; int16_t exponent10 = 0; int16_t exponent2 = 0; uint8_t byte_value = 0; uint8_t digit_index = 0; uint8_t exponent_sign = 0; uint8_t is_indeterminate = 0; uint8_t is_infinite = 0; uint8_t is_not_a_number = 0; uint8_t is_signed = 0; uint8_t number_of_characters = 0; int8_t bit_shift = 0; double exponent_value = 0.0; double value_float = 0.0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } safe_utf16_string_index = *utf16_string_index; if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { number_of_characters = (uint16_t) ( floating_point_value_size >> 2 ) + 3; } else { bit_shift = (uint16_t) ( floating_point_value_size - 1 ); is_signed = (uint16_t) ( floating_point_value >> bit_shift ); if( is_signed != 0 ) { floating_point_value &= ~( (uint64_t) 1 << bit_shift ); } switch( floating_point_value_size ) { case 32: if( floating_point_value == 0x7f800000UL ) { is_infinite = 1; } else if( ( is_signed != 0 ) && ( floating_point_value == 0x7fc00000UL ) ) { is_indeterminate = 1; } else if( ( floating_point_value >= 0x7f800001UL ) && ( floating_point_value <= 0x7fffffffUL ) ) { is_not_a_number = 1; } else if( floating_point_value != 0 ) { value_float32.integer = (uint32_t) floating_point_value; value_float = (double) value_float32.floating_point; exponent2 = (int16_t) ( floating_point_value >> 23 ); if( exponent2 == 0 ) { exponent2 = -126; } else { exponent2 -= 127; } } break; case 64: #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) if( floating_point_value == 0x7ff0000000000000UL ) #else if( floating_point_value == 0x7ff0000000000000ULL ) #endif { is_infinite = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000UL ) ) #else else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000ULL ) ) #endif { is_indeterminate = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( floating_point_value >= 0x7ff0000000000001UL ) && ( floating_point_value <= 0x7fffffffffffffffUL ) ) #else else if( ( floating_point_value >= 0x7ff0000000000001ULL ) && ( floating_point_value <= 0x7fffffffffffffffULL ) ) #endif { is_not_a_number = 1; } else if( floating_point_value != 0 ) { value_float64.integer = (uint64_t) floating_point_value; value_float = (double) value_float64.floating_point; exponent2 = (int16_t) ( floating_point_value >> 52 ); if( exponent2 == 0 ) { exponent2 = -1023; } else { exponent2 -= 1023; } } break; } if( is_indeterminate != 0 ) { /* "Ind\x00" */ number_of_characters = 4; } else if( is_infinite != 0 ) { /* "Inf\x00" */ number_of_characters = 4; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ number_of_characters = 4; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { number_of_characters = 15; } else { number_of_characters = 14; } } } if( ( number_of_characters > utf16_string_size ) || ( safe_utf16_string_index > ( utf16_string_size - number_of_characters ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string size too small.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'x'; bit_shift = (uint16_t) ( floating_point_value_size - 4 ); do { byte_value = (uint16_t) ( ( floating_point_value >> bit_shift ) & 0x0f ); if( byte_value <= 9 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0' + byte_value; } else { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'a' + byte_value - 10; } bit_shift -= 4; } while( bit_shift >= 0 ); } else { if( is_indeterminate != 0 ) { /* "Ind\x00" */ utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'I'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'n'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'd'; } else if( is_infinite != 0 ) { /* "Inf\x00" */ utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'I'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'n'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'f'; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'N'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'a'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'N'; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '-'; } if( exponent2 < 0 ) { exponent_sign = (uint16_t) '-'; exponent2 *= -1; } else { exponent_sign = (uint16_t) '+'; } exponent_value = 1.0; exponent10 = 0; while( exponent2 > 0 ) { exponent_value *= 2; exponent2--; if( exponent_value >= 10.0 ) { exponent_value /= 10.0; exponent10++; if( exponent_sign == (uint16_t) '-' ) { value_float *= 10.0; } else { value_float /= 10.0; } } } if( value_float != 0.0 ) { while( ( value_float < 1.0 ) || ( value_float >= 10.0 ) ) { exponent10++; if( exponent_sign == (uint16_t) '-' ) { value_float *= 10; } else { value_float /= 10; } } } for( digit_index = 0; digit_index < 7; digit_index++ ) { value_fraction *= 10; value_fraction += (uint16_t) value_float; value_float -= (uint16_t) value_float; value_float *= 10.0; } if( value_float >= 5.0 ) { value_fraction += 1; } divider = 1000000; for( digit_index = 0; digit_index < 7; digit_index++ ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0' + (uint16_t) ( value_fraction / divider ); if( digit_index == 0 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '.'; } value_fraction %= divider; divider /= 10; } utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'e'; utf16_string[ safe_utf16_string_index++ ] = exponent_sign; divider = 100; for( digit_index = 0; digit_index < 3; digit_index++ ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0' + (uint16_t) ( exponent10 / divider ); exponent10 %= divider; divider /= 10; } } } utf16_string[ safe_utf16_string_index++ ] = 0; *utf16_string_index = safe_utf16_string_index; return( 1 ); } /* Copies an UTF-16 encoded string to a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_with_index_copy_to_floating_point( uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint64_t *floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_utf16_string_with_index_copy_to_floating_point"; size_t fraction_index = 0; size_t maximum_string_index = 0; size_t safe_utf16_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; double value_fraction = 0.0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } safe_utf16_string_index = *utf16_string_index; if( floating_point_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point value.", function ); return( -1 ); } if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { maximum_string_index = (size_t) ( floating_point_value_size >> 2 ) + 3; } else { /* The string is at least a single digit with an end of string character */ maximum_string_index = 2; bit_shift = (uint8_t) ( floating_point_value_size - 1 ); divider = 1; value_64bit = ~( ( ~( (uint64_t) 1 << bit_shift ) >> bit_shift ) << bit_shift ); while( ( value_64bit / divider ) >= 10 ) { divider *= 10; maximum_string_index += 1; } } maximum_string_index += safe_utf16_string_index; if( maximum_string_index > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum string index value exceeds maximum.", function ); return( -1 ); } value_64bit = 0; if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { character_value = utf16_string[ safe_utf16_string_index++ ]; if(character_value != (uint16_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } character_value = utf16_string[ safe_utf16_string_index++ ]; if( character_value != (uint16_t) 'x' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } while( safe_utf16_string_index < utf16_string_length ) { character_value = utf16_string[ safe_utf16_string_index ]; if( character_value == 0 ) { break; } if( safe_utf16_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit <<= 4; if( ( character_value >= (uint16_t) '0' ) && ( character_value <= (uint16_t) '9' ) ) { byte_value = (uint8_t) ( character_value - (uint16_t) '0' ); } else if( ( character_value >= (uint16_t) 'A' ) && ( character_value <= (uint16_t) 'F' ) ) { byte_value = (uint8_t) ( character_value - (uint16_t) 'A' + 10 ); } else if( ( character_value >= (uint16_t) 'a' ) && ( character_value <= (uint16_t) 'f' ) ) { byte_value = (uint8_t) ( character_value - (uint16_t) 'a' + 10 ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x04%" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } value_64bit += byte_value; safe_utf16_string_index++; } } else { value_float64.floating_point = 0.0; character_value = utf16_string[ safe_utf16_string_index ]; /* In the maximum possible string one character is substituted for the sign */ if( character_value == (uint16_t) '-' ) { safe_utf16_string_index++; sign = -1; } else if( character_value == (uint16_t) '+' ) { safe_utf16_string_index++; } while( safe_utf16_string_index < utf16_string_length ) { character_value = utf16_string[ safe_utf16_string_index ]; if( character_value == 0 ) { break; } if( safe_utf16_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } if( character_value == (uint16_t) '.' ) { break; } if( ( character_value < (uint16_t) '0' ) || ( character_value > (uint16_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } value_float64.floating_point *= 10; value_float64.floating_point += character_value - (uint16_t) '0'; safe_utf16_string_index++; } fraction_index = safe_utf16_string_index; safe_utf16_string_index++; utf16_string_length--; if( utf16_string_length > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } while( fraction_index < utf16_string_length ) { character_value = utf16_string[ utf16_string_length ]; if( character_value == 0 ) { break; } if( ( character_value < (uint16_t) '0' ) || ( character_value > (uint16_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx16 " at index: %d.", function, character_value, utf16_string_length ); return( -1 ); } value_fraction /= 10; value_fraction += character_value - (uint16_t) '0'; safe_utf16_string_index++; utf16_string_length--; } if( value_fraction != 0.0 ) { value_float64.floating_point += value_fraction / 10; } if( sign == -1 ) { value_float64.floating_point *= 1.0; } value_64bit = value_float64.integer; } *utf16_string_index = safe_utf16_string_index; *floating_point_value = value_64bit; return( 1 ); } /* Copies an UTF-32 encoded string of a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_copy_from_floating_point( uint32_t *utf32_string, size_t utf32_string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf32_string_copy_from_floating_point"; size_t utf32_string_index = 0; if( libfvalue_utf32_string_with_index_copy_from_floating_point( utf32_string, utf32_string_size, &utf32_string_index, floating_point_value, floating_point_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy floating point value to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 encoded string of from floating_point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_with_index_copy_from_floating_point( uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { byte_stream_float32_t value_float32; byte_stream_float64_t value_float64; static char *function = "libfvalue_utf32_string_with_index_copy_from_floating_point"; size_t safe_utf32_string_index = 0; uint64_t divider = 0; uint64_t value_fraction = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; int16_t exponent10 = 0; int16_t exponent2 = 0; uint8_t byte_value = 0; uint8_t digit_index = 0; uint8_t exponent_sign = 0; uint8_t is_indeterminate = 0; uint8_t is_infinite = 0; uint8_t is_not_a_number = 0; uint8_t is_signed = 0; uint8_t number_of_characters = 0; int8_t bit_shift = 0; double exponent_value = 0.0; double value_float = 0.0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-32 string index value out of bounds.", function ); return( -1 ); } safe_utf32_string_index = *utf32_string_index; if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { number_of_characters = (uint32_t) ( floating_point_value_size >> 2 ) + 3; } else { bit_shift = (uint32_t) ( floating_point_value_size - 1 ); is_signed = (uint32_t) ( floating_point_value >> bit_shift ); if( is_signed != 0 ) { floating_point_value &= ~( (uint64_t) 1 << bit_shift ); } switch( floating_point_value_size ) { case 32: if( floating_point_value == 0x7f800000UL ) { is_infinite = 1; } else if( ( is_signed != 0 ) && ( floating_point_value == 0x7fc00000UL ) ) { is_indeterminate = 1; } else if( ( floating_point_value >= 0x7f800001UL ) && ( floating_point_value <= 0x7fffffffUL ) ) { is_not_a_number = 1; } else if( floating_point_value != 0 ) { value_float32.integer = (uint32_t) floating_point_value; value_float = (double) value_float32.floating_point; exponent2 = (int16_t) ( floating_point_value >> 23 ); if( exponent2 == 0 ) { exponent2 = -126; } else { exponent2 -= 127; } } break; case 64: #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) if( floating_point_value == 0x7ff0000000000000UL ) #else if( floating_point_value == 0x7ff0000000000000ULL ) #endif { is_infinite = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000UL ) ) #else else if( ( is_signed != 0 ) && ( floating_point_value == 0x7ff8000000000000ULL ) ) #endif { is_indeterminate = 1; } #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) else if( ( floating_point_value >= 0x7ff0000000000001UL ) && ( floating_point_value <= 0x7fffffffffffffffUL ) ) #else else if( ( floating_point_value >= 0x7ff0000000000001ULL ) && ( floating_point_value <= 0x7fffffffffffffffULL ) ) #endif { is_not_a_number = 1; } else if( floating_point_value != 0 ) { value_float64.integer = (uint64_t) floating_point_value; value_float = (double) value_float64.floating_point; exponent2 = (int16_t) ( floating_point_value >> 52 ); if( exponent2 == 0 ) { exponent2 = -1023; } else { exponent2 -= 1023; } } break; } if( is_indeterminate != 0 ) { /* "Ind\x00" */ number_of_characters = 4; } else if( is_infinite != 0 ) { /* "Inf\x00" */ number_of_characters = 4; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ number_of_characters = 4; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { number_of_characters = 15; } else { number_of_characters = 14; } } } if( ( number_of_characters > utf32_string_size ) || ( safe_utf32_string_index > ( utf32_string_size - number_of_characters ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string size too small.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'x'; bit_shift = (uint32_t) ( floating_point_value_size - 4 ); do { byte_value = (uint32_t) ( ( floating_point_value >> bit_shift ) & 0x0f ); if( byte_value <= 9 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0' + byte_value; } else { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'a' + byte_value - 10; } bit_shift -= 4; } while( bit_shift >= 0 ); } else { if( is_indeterminate != 0 ) { /* "Ind\x00" */ utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'I'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'n'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'd'; } else if( is_infinite != 0 ) { /* "Inf\x00" */ utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'I'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'n'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'f'; } else if( is_not_a_number != 0 ) { /* "Nan\x00" */ utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'N'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'a'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'N'; } else { /* "[-]0.000000e[+-]000\x00" */ if( is_signed != 0 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '-'; } if( exponent2 < 0 ) { exponent_sign = (uint32_t) '-'; exponent2 *= -1; } else { exponent_sign = (uint32_t) '+'; } exponent_value = 1.0; exponent10 = 0; while( exponent2 > 0 ) { exponent_value *= 2; exponent2--; if( exponent_value >= 10.0 ) { exponent_value /= 10.0; exponent10++; if( exponent_sign == (uint32_t) '-' ) { value_float *= 10.0; } else { value_float /= 10.0; } } } if( value_float != 0.0 ) { while( ( value_float < 1.0 ) || ( value_float >= 10.0 ) ) { exponent10++; if( exponent_sign == (uint32_t) '-' ) { value_float *= 10; } else { value_float /= 10; } } } for( digit_index = 0; digit_index < 7; digit_index++ ) { value_fraction *= 10; value_fraction += (uint32_t) value_float; value_float -= (uint32_t) value_float; value_float *= 10.0; } if( value_float >= 5.0 ) { value_fraction += 1; } divider = 1000000; for( digit_index = 0; digit_index < 7; digit_index++ ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0' + (uint32_t) ( value_fraction / divider ); if( digit_index == 0 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '.'; } value_fraction %= divider; divider /= 10; } utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'e'; utf32_string[ safe_utf32_string_index++ ] = exponent_sign; divider = 100; for( digit_index = 0; digit_index < 3; digit_index++ ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0' + (uint32_t) ( exponent10 / divider ); exponent10 %= divider; divider /= 10; } } } utf32_string[ safe_utf32_string_index++ ] = 0; *utf32_string_index = safe_utf32_string_index; return( 1 ); } /* Copies an UTF-32 encoded string to a floating point value * The floating_point value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_with_index_copy_to_floating_point( uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint64_t *floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { byte_stream_float64_t value_float64; static char *function = "libfvalue_utf32_string_with_index_copy_to_floating_point"; size_t fraction_index = 0; size_t maximum_string_index = 0; size_t safe_utf32_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; double value_fraction = 0.0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-32 string index value out of bounds.", function ); return( -1 ); } safe_utf32_string_index = *utf32_string_index; if( floating_point_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid floating point value.", function ); return( -1 ); } if( ( floating_point_value_size != 32 ) && ( floating_point_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported floating point value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { maximum_string_index = (size_t) ( floating_point_value_size >> 2 ) + 3; } else { /* The string is at least a single digit with an end of string character */ maximum_string_index = 2; bit_shift = (uint8_t) ( floating_point_value_size - 1 ); divider = 1; value_64bit = ~( ( ~( (uint64_t) 1 << bit_shift ) >> bit_shift ) << bit_shift ); while( ( value_64bit / divider ) >= 10 ) { divider *= 10; maximum_string_index += 1; } } maximum_string_index += safe_utf32_string_index; if( maximum_string_index > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum string index value exceeds maximum.", function ); return( -1 ); } value_64bit = 0; if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { character_value = utf32_string[ safe_utf32_string_index++ ]; if(character_value != (uint32_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } character_value = utf32_string[ safe_utf32_string_index++ ]; if( character_value != (uint32_t) 'x' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } while( safe_utf32_string_index < utf32_string_length ) { character_value = utf32_string[ safe_utf32_string_index ]; if( character_value == 0 ) { break; } if( safe_utf32_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit <<= 4; if( ( character_value >= (uint32_t) '0' ) && ( character_value <= (uint32_t) '9' ) ) { byte_value = (uint8_t) ( character_value - (uint32_t) '0' ); } else if( ( character_value >= (uint32_t) 'A' ) && ( character_value <= (uint32_t) 'F' ) ) { byte_value = (uint8_t) ( character_value - (uint32_t) 'A' + 10 ); } else if( ( character_value >= (uint32_t) 'a' ) && ( character_value <= (uint32_t) 'f' ) ) { byte_value = (uint8_t) ( character_value - (uint32_t) 'a' + 10 ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x08%" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } value_64bit += byte_value; safe_utf32_string_index++; } } else { value_float64.floating_point = 0.0; character_value = utf32_string[ safe_utf32_string_index ]; /* In the maximum possible string one character is substituted for the sign */ if( character_value == (uint32_t) '-' ) { safe_utf32_string_index++; sign = -1; } else if( character_value == (uint32_t) '+' ) { safe_utf32_string_index++; } while( safe_utf32_string_index < utf32_string_length ) { character_value = utf32_string[ safe_utf32_string_index ]; if( character_value == 0 ) { break; } if( safe_utf32_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } if( character_value == (uint32_t) '.' ) { break; } if( ( character_value < (uint32_t) '0' ) || ( character_value > (uint32_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } value_float64.floating_point *= 10; value_float64.floating_point += character_value - (uint32_t) '0'; safe_utf32_string_index++; } fraction_index = safe_utf32_string_index; safe_utf32_string_index++; utf32_string_length--; if( utf32_string_length > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } while( fraction_index < utf32_string_length ) { character_value = utf32_string[ utf32_string_length ]; if( character_value == 0 ) { break; } if( ( character_value < (uint32_t) '0' ) || ( character_value > (uint32_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx32 " at index: %d.", function, character_value, utf32_string_length ); return( -1 ); } value_fraction /= 10; value_fraction += character_value - (uint32_t) '0'; safe_utf32_string_index++; utf32_string_length--; } if( value_fraction != 0.0 ) { value_float64.floating_point += value_fraction / 10; } if( sign == -1 ) { value_float64.floating_point *= 1.0; } value_64bit = value_float64.integer; } *utf32_string_index = safe_utf32_string_index; *floating_point_value = value_64bit; return( 1 ); } libewf-20140807/libfvalue/libfvalue_utf8_string.c0000664000175000017500000001420113443450055023754 0ustar00lordyestalordyesta00000000000000/* * UTF-8 string value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include "libfvalue_libcerror.h" #include "libfvalue_split_utf8_string.h" #include "libfvalue_types.h" /* Splits an UTF-8 string * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_split( const uint8_t *utf8_string, size_t utf8_string_size, uint8_t delimiter, libfvalue_split_utf8_string_t **split_string, libcerror_error_t **error ) { uint8_t *segment_start = NULL; uint8_t *segment_end = NULL; uint8_t *string_end = NULL; static char *function = "libfvalue_utf8_string_split"; size_t string_size = 0; ssize_t segment_length = 0; int number_of_segments = 0; int segment_index = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string already set.", function ); return( -1 ); } /* An empty string has no segments */ if( ( utf8_string_size == 0 ) || ( utf8_string[ 0 ] == 0 ) ) { return( 1 ); } /* Determine the number of segments */ segment_start = (uint8_t *) utf8_string; string_end = (uint8_t *) &( utf8_string[ utf8_string_size - 1 ] ); do { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end > string_end ) { break; } segment_index++; if( segment_end == NULL ) { break; } if( segment_end == segment_start ) { segment_start++; } else if( segment_end != utf8_string ) { segment_start = segment_end + 1; } } while( segment_end != NULL ); number_of_segments = segment_index; if( libfvalue_split_utf8_string_initialize( split_string, utf8_string, utf8_string_size, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to intialize split string.", function ); goto on_error; } if( *split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing split string.", function ); goto on_error; } /* Do not bother splitting empty strings */ if( number_of_segments == 0 ) { return( 1 ); } /* Determine the segments * empty segments are stored as strings only containing the end of character */ if( libfvalue_split_utf8_string_get_string( *split_string, &segment_start, &string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve split UTF-8 string.", function ); goto on_error; } if( segment_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment start.", function ); goto on_error; } if( string_size < 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string size value out of bounds.", function ); goto on_error; } string_end = &( segment_start[ string_size - 1 ] ); for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end == NULL ) { segment_length = (ssize_t) ( string_end - segment_start ); } else { segment_length = (ssize_t) ( segment_end - segment_start ); } if( segment_length >= 0 ) { segment_start[ segment_length ] = 0; if( libfvalue_split_utf8_string_set_segment_by_index( *split_string, segment_index, segment_start, segment_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set split UTF-8 string segment: %d.", function, segment_index ); goto on_error; } } if( segment_end == NULL ) { break; } if( segment_end == string_end ) { segment_start++; } if( segment_end != string_end ) { segment_start = segment_end + 1; } } return( 1 ); on_error: if( *split_string != NULL ) { libfvalue_split_utf8_string_free( split_string, NULL ); } return( -1 ); } libewf-20140807/libfvalue/libfvalue_utf16_string.h0000664000175000017500000000262513443450055024047 0ustar00lordyestalordyesta00000000000000/* * UTF-16 string value functions * * Copyright (C) 2010-2018, 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( _LIBVALUE_UTF16_STRING_H ) #define _LIBVALUE_UTF16_STRING_H #include #include #include "libfvalue_definitions.h" #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( _cplusplus ) extern "C" { #endif LIBFVALUE_EXTERN \ int libfvalue_utf16_string_split( const uint16_t *utf16_string, size_t utf16_string_size, uint16_t delimiter, libfvalue_split_utf16_string_t **split_string, libcerror_error_t **error ); #if defined( _cplusplus ) } #endif #endif /* !defined( _LIBVALUE_UTF16_STRING_H ) */ libewf-20140807/libfvalue/libfvalue_codepage.h0000664000175000017500000000626213443450055023264 0ustar00lordyestalordyesta00000000000000/* * Codepage functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_CODEPAGE_H ) #define _LIBFVALUE_INTERNAL_CODEPAGE_H #include #include #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFVALUE ) #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue * The definitions in are copied here * for local use of libfvalue */ #else /* The codepage definitions */ enum LIBFVALUE_CODEPAGES { LIBFVALUE_CODEPAGE_ASCII = 20127, LIBFVALUE_CODEPAGE_ISO_8859_1 = 28591, LIBFVALUE_CODEPAGE_ISO_8859_2 = 28592, LIBFVALUE_CODEPAGE_ISO_8859_3 = 28593, LIBFVALUE_CODEPAGE_ISO_8859_4 = 28594, LIBFVALUE_CODEPAGE_ISO_8859_5 = 28595, LIBFVALUE_CODEPAGE_ISO_8859_6 = 28596, LIBFVALUE_CODEPAGE_ISO_8859_7 = 28597, LIBFVALUE_CODEPAGE_ISO_8859_8 = 28598, LIBFVALUE_CODEPAGE_ISO_8859_9 = 28599, LIBFVALUE_CODEPAGE_ISO_8859_10 = 28600, LIBFVALUE_CODEPAGE_ISO_8859_11 = 28601, LIBFVALUE_CODEPAGE_ISO_8859_13 = 28603, LIBFVALUE_CODEPAGE_ISO_8859_14 = 28604, LIBFVALUE_CODEPAGE_ISO_8859_15 = 28605, LIBFVALUE_CODEPAGE_ISO_8859_16 = 28606, LIBFVALUE_CODEPAGE_KOI8_R = 20866, LIBFVALUE_CODEPAGE_KOI8_U = 21866, LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN = 1200, LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN = 1201, LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN = 12000, LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN = 12001, LIBFVALUE_CODEPAGE_UTF7 = 65000, LIBFVALUE_CODEPAGE_UTF8 = 65001, LIBFVALUE_CODEPAGE_WINDOWS_874 = 874, LIBFVALUE_CODEPAGE_WINDOWS_932 = 932, LIBFVALUE_CODEPAGE_WINDOWS_936 = 936, LIBFVALUE_CODEPAGE_WINDOWS_949 = 949, LIBFVALUE_CODEPAGE_WINDOWS_950 = 950, LIBFVALUE_CODEPAGE_WINDOWS_1250 = 1250, LIBFVALUE_CODEPAGE_WINDOWS_1251 = 1251, LIBFVALUE_CODEPAGE_WINDOWS_1252 = 1252, LIBFVALUE_CODEPAGE_WINDOWS_1253 = 1253, LIBFVALUE_CODEPAGE_WINDOWS_1254 = 1254, LIBFVALUE_CODEPAGE_WINDOWS_1255 = 1255, LIBFVALUE_CODEPAGE_WINDOWS_1256 = 1256, LIBFVALUE_CODEPAGE_WINDOWS_1257 = 1257, LIBFVALUE_CODEPAGE_WINDOWS_1258 = 1258, /* A special codepage to indicate codepage 1200 that uses ASCII strings as well. * This has primarily been seen in the ESE database format and could be SCSU. */ LIBFVALUE_CODEPAGE_1200_MIXED = (int) 0x800004b0 }; #endif /* !defined( HAVE_LOCAL_LIBFVALUE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTERNAL_CODEPAGE_H ) */ libewf-20140807/libfvalue/libfvalue_string.c0000664000175000017500000021157313443450055023021 0ustar00lordyestalordyesta00000000000000/* * String value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_codepage.h" #include "libfvalue_definitions.h" #include "libfvalue_libcerror.h" #include "libfvalue_libcnotify.h" #include "libfvalue_libuna.h" #include "libfvalue_split_utf16_string.h" #include "libfvalue_split_utf8_string.h" #include "libfvalue_string.h" #include "libfvalue_types.h" /* Creates a string * Make sure the value string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_string_initialize( libfvalue_string_t **string, libcerror_error_t **error ) { static char *function = "libfvalue_string_initialize"; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( *string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid string value already set.", function ); return( -1 ); } *string = memory_allocate_structure( libfvalue_string_t ); if( *string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); goto on_error; } if( memory_set( *string, 0, sizeof( libfvalue_string_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear string.", function ); goto on_error; } ( *string )->codepage = LIBFVALUE_CODEPAGE_UTF8; return( 1 ); on_error: if( *string != NULL ) { memory_free( *string ); *string = NULL; } return( -1 ); } /* Frees a string * Returns 1 if successful or -1 on error */ int libfvalue_string_free( libfvalue_string_t **string, libcerror_error_t **error ) { static char *function = "libfvalue_string_free"; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( *string != NULL ) { if( ( *string )->data != NULL ) { if( ( ( *string )->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( ( *string )->data ); } } memory_free( *string ); *string = NULL; } return( 1 ); } /* Clones a string * Returns 1 if successful or -1 on error */ int libfvalue_string_clone( libfvalue_string_t **destination_string, libfvalue_string_t *source_string, libcerror_error_t **error ) { static char *function = "libfvalue_string_clone"; if( destination_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination string.", function ); return( -1 ); } if( *destination_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination string already set.", function ); return( -1 ); } if( source_string == NULL ) { *destination_string = NULL; return( 1 ); } *destination_string = memory_allocate_structure( libfvalue_string_t ); if( *destination_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination string.", function ); goto on_error; } if( memory_set( *destination_string, 0, sizeof( libfvalue_string_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination string.", function ); memory_free( *destination_string ); *destination_string = NULL; return( -1 ); } if( ( source_string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) == 0 ) { ( *destination_string )->data = source_string->data; ( *destination_string )->data_size = source_string->data_size; } else { ( *destination_string )->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * source_string->data_size ); if( ( *destination_string )->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination string data.", function ); goto on_error; } ( *destination_string )->data_size = source_string->data_size; ( *destination_string )->flags |= LIBFVALUE_VALUE_FLAG_DATA_MANAGED; if( memory_copy( ( *destination_string )->data, source_string->data, sizeof( uint8_t ) * source_string->data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy string data.", function ); goto on_error; } } ( *destination_string )->codepage = source_string->codepage; return( 1 ); on_error: if( *destination_string != NULL ) { if( ( ( *destination_string )->data != NULL ) && ( ( *destination_string )->data != source_string->data ) ) { memory_free( ( *destination_string )->data ); } memory_free( *destination_string ); *destination_string = NULL; } return( -1 ); } /* Copies the string from a byte stream * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_from_byte_stream( libfvalue_string_t *string, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_from_byte_stream"; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( ( encoding != LIBFVALUE_CODEPAGE_ASCII ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_1 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_2 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_3 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_4 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_5 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_6 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_7 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_8 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_9 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_10 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_11 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_13 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_14 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_15 ) && ( encoding != LIBFVALUE_CODEPAGE_ISO_8859_16 ) && ( encoding != LIBFVALUE_CODEPAGE_KOI8_R ) && ( encoding != LIBFVALUE_CODEPAGE_KOI8_U ) && ( encoding != LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) && ( encoding != LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN ) && ( encoding != LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) && ( encoding != LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN ) && ( encoding != LIBFVALUE_CODEPAGE_UTF7 ) && ( encoding != LIBFVALUE_CODEPAGE_UTF8 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_874 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_932 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_936 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_949 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_950 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1250 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1251 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1252 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1253 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1254 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1255 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1256 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1257 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_1258 ) && ( encoding != LIBFVALUE_CODEPAGE_1200_MIXED ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); return( -1 ); } if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } string->data_size = byte_stream_size; string->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * string->data_size ); if( string->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string data.", function ); goto on_error; } string->flags |= LIBFVALUE_VALUE_FLAG_DATA_MANAGED; if( memory_copy( string->data, byte_stream, sizeof( uint8_t ) * string->data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy byte stream.", function ); goto on_error; } string->codepage = encoding; return( 1 ); on_error: if( string->data != NULL ) { memory_free( string->data ); string->data = NULL; } string->data_size = 0; return( -1 ); } /* Copies the string from an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_from_utf8_string_with_index( libfvalue_string_t *string, const uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_from_utf8_string_with_index"; size_t safe_utf8_string_index = 0; size_t value_data_size = 0; int byte_order = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string is too small.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } safe_utf8_string_index = *utf8_string_index; switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); goto on_error; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( libuna_utf16_stream_size_from_utf8( &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 stream size of UTF-8 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( libuna_utf32_stream_size_from_utf8( &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 stream size of UTF-8 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf7_stream_size_from_utf8( &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-7 stream size of UTF-8 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_stream_size_from_utf8( &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 stream size of UTF-8 string.", function ); goto on_error; } break; default: if( libuna_byte_stream_size_from_utf8( &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, string->codepage, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine byte stream size of UTF-8 string.", function ); goto on_error; } break; } if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } string->data_size = value_data_size; string->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * string->data_size ); if( string->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string data.", function ); goto on_error; } string->flags |= LIBFVALUE_VALUE_FLAG_DATA_MANAGED; switch( string->codepage ) { case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_stream_copy_from_utf8( string->data, string->data_size, byte_order, &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream from UTF-8 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_stream_copy_from_utf8( string->data, string->data_size, byte_order, &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream from UTF-8 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf7_stream_copy_from_utf8( string->data, string->data_size, &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-7 stream from UTF-8 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_stream_copy_from_utf8( string->data, string->data_size, &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 stream from UTF-8 string.", function ); goto on_error; } break; default: if( libuna_byte_stream_copy_from_utf8( string->data, string->data_size, string->codepage, &( utf8_string[ safe_utf8_string_index ] ), utf8_string_size - safe_utf8_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream from UTF-8 string.", function ); goto on_error; } break; } *utf8_string_index = utf8_string_size; return( 1 ); on_error: if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } return( -1 ); } /* Retrieves the size of an UTF-8 encoded string of the string * Returns 1 if successful or -1 on error */ int libfvalue_string_get_utf8_string_size( libfvalue_string_t *string, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_get_utf8_string_size"; int byte_order = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } if( ( string->data == NULL ) || ( string->data_size == 0 ) ) { if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 1; } else switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: if( ( string->data_size % 2 ) == 0 ) { result = libuna_utf8_string_size_from_utf16_stream( string->data, string->data_size, LIBFVALUE_ENDIAN_LITTLE, utf8_string_size, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of UTF-16 stream.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } } if( result != 1 ) { if( libuna_utf8_string_size_from_byte_stream( string->data, string->data_size, LIBUNA_CODEPAGE_ASCII, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of byte stream.", function ); return( -1 ); } } break; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf8_string_size_from_utf16_stream( string->data, string->data_size, byte_order, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of UTF-16 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf8_string_size_from_utf32_stream( string->data, string->data_size, byte_order, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of UTF-32 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf8_string_size_from_utf7_stream( string->data, string->data_size, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of UTF-7 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_string_size_from_utf8_stream( string->data, string->data_size, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of UTF-8 stream.", function ); return( -1 ); } break; default: if( libuna_utf8_string_size_from_byte_stream( string->data, string->data_size, string->codepage, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 string size of byte stream.", function ); return( -1 ); } break; } return( 1 ); } /* Copies the string to an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_to_utf8_string_with_index( libfvalue_string_t *string, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_to_utf8_string_with_index"; int byte_order = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } if( ( string->data == NULL ) || ( string->data_size == 0 ) ) { if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string is too small.", function ); return( -1 ); } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; } else switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: if( ( string->data_size % 2 ) == 0 ) { result = libuna_utf8_string_with_index_copy_from_utf16_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, LIBFVALUE_ENDIAN_LITTLE, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-8 string.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } } if( result != 1 ) { if( libuna_utf8_string_with_index_copy_from_byte_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, LIBUNA_CODEPAGE_ASCII, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-8 string.", function ); return( -1 ); } } break; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf8_string_with_index_copy_from_utf16_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-8 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf8_string_with_index_copy_from_utf32_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-8 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf8_string_with_index_copy_from_utf7_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-7 stream to UTF-8 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_string_with_index_copy_from_utf8_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 stream to UTF-8 string.", function ); return( -1 ); } break; default: if( libuna_utf8_string_with_index_copy_from_byte_stream( utf8_string, utf8_string_size, utf8_string_index, string->data, string->data_size, string->codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-8 string.", function ); return( -1 ); } break; } return( 1 ); } /* Copies the string from an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_from_utf16_string_with_index( libfvalue_string_t *string, const uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_from_utf16_string_with_index"; size_t safe_utf16_string_index = 0; size_t value_data_size = 0; int byte_order = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string is too small.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } safe_utf16_string_index = *utf16_string_index; switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); goto on_error; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( libuna_utf16_stream_size_from_utf16( &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 stream size of UTF-16 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( libuna_utf32_stream_size_from_utf16( &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 stream size of UTF-16 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf7_stream_size_from_utf16( &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-7 stream size of UTF-16 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_stream_size_from_utf16( &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 stream size of UTF-16 string.", function ); goto on_error; } break; default: if( libuna_byte_stream_size_from_utf16( &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, string->codepage, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine byte stream size of UTF-16 string.", function ); goto on_error; } break; } if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } string->data_size = value_data_size; string->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * string->data_size ); if( string->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string data.", function ); goto on_error; } string->flags |= LIBFVALUE_VALUE_FLAG_DATA_MANAGED; switch( string->codepage ) { case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_stream_copy_from_utf16( string->data, string->data_size, byte_order, &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream from UTF-16 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_stream_copy_from_utf16( string->data, string->data_size, byte_order, &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream from UTF-16 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf7_stream_copy_from_utf16( string->data, string->data_size, &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-7 stream from UTF-16 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_stream_copy_from_utf16( string->data, string->data_size, &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 stream from UTF-16 string.", function ); goto on_error; } break; default: if( libuna_byte_stream_copy_from_utf16( string->data, string->data_size, string->codepage, &( utf16_string[ safe_utf16_string_index ] ), utf16_string_size - safe_utf16_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream from UTF-16 string.", function ); goto on_error; } break; } *utf16_string_index = utf16_string_size; return( 1 ); on_error: if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } return( -1 ); } /* Retrieves the size of an UTF-16 encoded string of the string * Returns 1 if successful or -1 on error */ int libfvalue_string_get_utf16_string_size( libfvalue_string_t *string, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_get_utf16_string_size"; int byte_order = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } if( ( string->data == NULL ) || ( string->data_size == 0 ) ) { if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 1; } else switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: if( ( string->data_size % 2 ) == 0 ) { result = libuna_utf16_string_size_from_utf16_stream( string->data, string->data_size, LIBFVALUE_ENDIAN_LITTLE, utf16_string_size, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of UTF-16 stream.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } } if( result != 1 ) { if( libuna_utf16_string_size_from_byte_stream( string->data, string->data_size, LIBUNA_CODEPAGE_ASCII, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of byte stream.", function ); return( -1 ); } } break; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_string_size_from_utf16_stream( string->data, string->data_size, byte_order, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of UTF-16 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_string_size_from_utf32_stream( string->data, string->data_size, byte_order, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of UTF-32 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf16_string_size_from_utf7_stream( string->data, string->data_size, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of UTF-7 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf16_string_size_from_utf8_stream( string->data, string->data_size, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of UTF-8 stream.", function ); return( -1 ); } break; default: if( libuna_utf16_string_size_from_byte_stream( string->data, string->data_size, string->codepage, utf16_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 string size of byte stream.", function ); return( -1 ); } break; } return( 1 ); } /* Copies the string to an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_to_utf16_string_with_index( libfvalue_string_t *string, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_to_utf16_string_with_index"; int byte_order = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } if( ( string->data == NULL ) || ( string->data_size == 0 ) ) { if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string is too small.", function ); return( -1 ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; } else switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: if( ( string->data_size % 2 ) == 0 ) { result = libuna_utf16_string_with_index_copy_from_utf16_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, LIBFVALUE_ENDIAN_LITTLE, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-16 string.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } } if( result != 1 ) { if( libuna_utf16_string_with_index_copy_from_byte_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, LIBUNA_CODEPAGE_ASCII, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-16 string.", function ); return( -1 ); } } break; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_string_with_index_copy_from_utf16_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-16 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_string_with_index_copy_from_utf32_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-16 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf16_string_with_index_copy_from_utf7_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-7 stream to UTF-16 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf16_string_with_index_copy_from_utf8_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 stream to UTF-16 string.", function ); return( -1 ); } break; default: if( libuna_utf16_string_with_index_copy_from_byte_stream( utf16_string, utf16_string_size, utf16_string_index, string->data, string->data_size, string->codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-16 string.", function ); return( -1 ); } break; } return( 1 ); } /* Copies the string from an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_from_utf32_string_with_index( libfvalue_string_t *string, const uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_from_utf32_string_with_index"; size_t safe_utf32_string_index = 0; size_t value_data_size = 0; int byte_order = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string is too small.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } safe_utf32_string_index = *utf32_string_index; switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); goto on_error; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( libuna_utf16_stream_size_from_utf32( &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-16 stream size of UTF-32 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( libuna_utf32_stream_size_from_utf32( &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 stream size of UTF-32 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf7_stream_size_from_utf32( &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-7 stream size of UTF-32 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_stream_size_from_utf32( &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-8 stream size of UTF-32 string.", function ); goto on_error; } break; default: if( libuna_byte_stream_size_from_utf32( &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, string->codepage, &value_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine byte stream size of UTF-32 string.", function ); goto on_error; } break; } if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } string->data_size = value_data_size; string->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * string->data_size ); if( string->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string data.", function ); goto on_error; } string->flags |= LIBFVALUE_VALUE_FLAG_DATA_MANAGED; switch( string->codepage ) { case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf16_stream_copy_from_utf32( string->data, string->data_size, byte_order, &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream from UTF-32 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_stream_copy_from_utf32( string->data, string->data_size, byte_order, &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream from UTF-32 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf7_stream_copy_from_utf32( string->data, string->data_size, &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-7 stream from UTF-32 string.", function ); goto on_error; } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf8_stream_copy_from_utf32( string->data, string->data_size, &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 stream from UTF-32 string.", function ); goto on_error; } break; default: if( libuna_byte_stream_copy_from_utf32( string->data, string->data_size, string->codepage, &( utf32_string[ safe_utf32_string_index ] ), utf32_string_size - safe_utf32_string_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream from UTF-32 string.", function ); goto on_error; } break; } *utf32_string_index = utf32_string_size; return( 1 ); on_error: if( string->data != NULL ) { if( ( string->flags & LIBFVALUE_VALUE_FLAG_DATA_MANAGED ) != 0 ) { memory_free( string->data ); string->flags &= ~( LIBFVALUE_VALUE_FLAG_DATA_MANAGED ); } string->data = NULL; string->data_size = 0; } return( -1 ); } /* Retrieves the size of an UTF-32 encoded string of the string * Returns 1 if successful or -1 on error */ int libfvalue_string_get_utf32_string_size( libfvalue_string_t *string, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_get_utf32_string_size"; int byte_order = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } if( ( string->data == NULL ) || ( string->data_size == 0 ) ) { if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 1; } else switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: if( ( string->data_size % 2 ) == 0 ) { result = libuna_utf32_string_size_from_utf16_stream( string->data, string->data_size, LIBFVALUE_ENDIAN_LITTLE, utf32_string_size, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of UTF-16 stream.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } } if( result != 1 ) { if( libuna_utf32_string_size_from_byte_stream( string->data, string->data_size, LIBUNA_CODEPAGE_ASCII, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of byte stream.", function ); return( -1 ); } } break; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_string_size_from_utf16_stream( string->data, string->data_size, byte_order, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of UTF-16 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_string_size_from_utf32_stream( string->data, string->data_size, byte_order, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of UTF-32 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf32_string_size_from_utf7_stream( string->data, string->data_size, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of UTF-7 stream.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf32_string_size_from_utf8_stream( string->data, string->data_size, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of UTF-8 stream.", function ); return( -1 ); } break; default: if( libuna_utf32_string_size_from_byte_stream( string->data, string->data_size, string->codepage, utf32_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine UTF-32 string size of byte stream.", function ); return( -1 ); } break; } return( 1 ); } /* Copies the string to an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_string_copy_to_utf32_string_with_index( libfvalue_string_t *string, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_copy_to_utf32_string_with_index"; int byte_order = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_format_flags != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } if( ( string->data == NULL ) || ( string->data_size == 0 ) ) { if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string is too small.", function ); return( -1 ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; } else switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: if( ( string->data_size % 2 ) == 0 ) { result = libuna_utf32_string_with_index_copy_from_utf16_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, LIBFVALUE_ENDIAN_LITTLE, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-16 string.", function ); #if defined( HAVE_DEBUG_OUTPUT ) if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } } if( result != 1 ) { if( libuna_utf32_string_with_index_copy_from_byte_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, LIBUNA_CODEPAGE_ASCII, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-32 string.", function ); return( -1 ); } } break; case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_string_with_index_copy_from_utf16_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 stream to UTF-32 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN ) { byte_order = LIBFVALUE_ENDIAN_BIG; } else { byte_order = LIBFVALUE_ENDIAN_LITTLE; } if( libuna_utf32_string_with_index_copy_from_utf32_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, byte_order, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 stream to UTF-32 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF7: if( libuna_utf32_string_with_index_copy_from_utf7_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-7 stream to UTF-32 string.", function ); return( -1 ); } break; case LIBFVALUE_CODEPAGE_UTF8: if( libuna_utf32_string_with_index_copy_from_utf8_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 stream to UTF-32 string.", function ); return( -1 ); } break; default: if( libuna_utf32_string_with_index_copy_from_byte_stream( utf32_string, utf32_string_size, utf32_string_index, string->data, string->data_size, string->codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy byte stream to UTF-32 string.", function ); return( -1 ); } break; } return( 1 ); } libewf-20140807/libfvalue/libfvalue_data_handle.c0000664000175000017500000011674013443450055023737 0ustar00lordyestalordyesta00000000000000/* * Data handle functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_data_handle.h" #include "libfvalue_definitions.h" #include "libfvalue_libcdata.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #include "libfvalue_value_entry.h" /* Creates a data handle * Make sure the value data_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_initialize( libfvalue_data_handle_t **data_handle, int (*read_value_entries)( libfvalue_data_handle_t *data_handle, const uint8_t *data, size_t data_size, int encoding, uint32_t data_flags, libcerror_error_t **error ), libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_initialize"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } if( *data_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid data handle value already set.", function ); return( -1 ); } internal_data_handle = memory_allocate_structure( libfvalue_internal_data_handle_t ); if( internal_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data handle.", function ); goto on_error; } if( memory_set( internal_data_handle, 0, sizeof( libfvalue_internal_data_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear data handle.", function ); goto on_error; } internal_data_handle->read_value_entries = read_value_entries; *data_handle = (libfvalue_data_handle_t *) internal_data_handle; return( 1 ); on_error: if( internal_data_handle != NULL ) { memory_free( internal_data_handle ); } return( -1 ); } /* Frees a data handle * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_free( libfvalue_data_handle_t **data_handle, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_free"; int result = 1; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } if( *data_handle != NULL ) { internal_data_handle = (libfvalue_internal_data_handle_t *) *data_handle; *data_handle = NULL; if( internal_data_handle->value_entries != NULL ) { if( libcdata_array_free( &( internal_data_handle->value_entries ), (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_entry_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value entries array.", function ); result = -1; } } if( ( internal_data_handle->flags & LIBFVALUE_VALUE_DATA_FLAG_MANAGED ) != 0 ) { if( internal_data_handle->data != NULL ) { memory_free( internal_data_handle->data ); } } memory_free( internal_data_handle ); } return( result ); } /* Clones a data handle * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_clone( libfvalue_data_handle_t **destination_data_handle, libfvalue_data_handle_t *source_data_handle, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_source_data_handle = NULL; static char *function = "libfvalue_data_handle_clone"; if( destination_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination data handle.", function ); return( -1 ); } if( *destination_data_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination data handle already set.", function ); return( -1 ); } if( source_data_handle == NULL ) { *destination_data_handle = NULL; return( 1 ); } internal_source_data_handle = (libfvalue_internal_data_handle_t *) source_data_handle; if( libfvalue_data_handle_initialize( destination_data_handle, internal_source_data_handle->read_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data handle.", function ); goto on_error; } if( *destination_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination data handle.", function ); goto on_error; } if( internal_source_data_handle->data != NULL ) { if( libfvalue_data_handle_set_data( *destination_data_handle, internal_source_data_handle->data, internal_source_data_handle->data_size, internal_source_data_handle->encoding, LIBFVALUE_VALUE_DATA_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data in destination data handle.", function ); goto on_error; } } if( internal_source_data_handle->value_entries != NULL ) { if( libcdata_array_clone( &( ( (libfvalue_internal_data_handle_t *) *destination_data_handle )->value_entries ), internal_source_data_handle->value_entries, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_entry_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfvalue_value_entry_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination value entries array.", function ); goto on_error; } } return( 1 ); on_error: if( *destination_data_handle != NULL ) { libfvalue_data_handle_free( destination_data_handle, NULL ); } return( -1 ); } /* Clears a data handle * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_clear( libfvalue_data_handle_t *data_handle, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_clear"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( internal_data_handle->value_entries != NULL ) { if( libcdata_array_empty( internal_data_handle->value_entries, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_entry_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty value instances array.", function ); return( -1 ); } } if( ( internal_data_handle->flags & LIBFVALUE_VALUE_DATA_FLAG_MANAGED ) != 0 ) { if( internal_data_handle->data != NULL ) { memory_free( internal_data_handle->data ); } } internal_data_handle->data = NULL; internal_data_handle->data_size = 0; internal_data_handle->encoding = 0; internal_data_handle->data_flags = 0; return( 1 ); } /* Retrieves the data * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_get_data( libfvalue_data_handle_t *data_handle, uint8_t **data, size_t *data_size, int *encoding, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_get_data"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data.", function ); return( -1 ); } if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } if( encoding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte order.", function ); return( -1 ); } *data = internal_data_handle->data; *data_size = internal_data_handle->data_size; *encoding = internal_data_handle->encoding; return( 1 ); } /* Sets the data * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_set_data( libfvalue_data_handle_t *data_handle, const uint8_t *data, size_t data_size, int encoding, uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_set_data"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( data == NULL ) { if( data_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid data size value out of bounds.", function ); return( -1 ); } } else { if( data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } } if( ( flags & ~( LIBFVALUE_VALUE_DATA_FLAG_MANAGED | LIBFVALUE_VALUE_DATA_FLAG_CLONE_BY_REFERENCE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function, flags ); return( -1 ); } if( ( internal_data_handle->flags & LIBFVALUE_VALUE_DATA_FLAG_MANAGED ) != 0 ) { if( internal_data_handle->data != NULL ) { memory_free( internal_data_handle->data ); internal_data_handle->data = NULL; internal_data_handle->data_size = 0; } internal_data_handle->flags &= ~( LIBFVALUE_VALUE_DATA_FLAG_MANAGED ); } /* Make sure empty values have data that refers to NULL */ if( ( data == NULL ) || ( data_size == 0 ) ) { internal_data_handle->data = NULL; } else if( ( flags & LIBFVALUE_VALUE_DATA_FLAG_CLONE_BY_REFERENCE ) != 0 ) { internal_data_handle->data = (uint8_t *) data; if( ( flags & LIBFVALUE_VALUE_DATA_FLAG_MANAGED ) != 0 ) { internal_data_handle->flags |= LIBFVALUE_VALUE_DATA_FLAG_MANAGED; } } else { internal_data_handle->data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * data_size ); if( internal_data_handle->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create data.", function ); goto on_error; } if( memory_copy( internal_data_handle->data, data, data_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data.", function ); goto on_error; } internal_data_handle->flags |= LIBFVALUE_VALUE_DATA_FLAG_MANAGED; } internal_data_handle->data_size = data_size; internal_data_handle->encoding = encoding; return( 1 ); on_error: if( internal_data_handle->data != NULL ) { memory_free( internal_data_handle->data ); internal_data_handle->data = NULL; } return( -1 ); } /* Retrieves the data flags * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_get_data_flags( libfvalue_data_handle_t *data_handle, uint32_t *data_flags, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_get_data_flags"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( data_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data flags.", function ); return( -1 ); } *data_flags = internal_data_handle->data_flags; return( 1 ); } /* Sets the data flags * Returns 1 if successful or -1 on error */ int libfvalue_data_handle_set_data_flags( libfvalue_data_handle_t *data_handle, uint32_t data_flags, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_set_data_flags"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; internal_data_handle->data_flags = data_flags; return( 1 ); } /* Retrieves the number of value entries * Returns if successful or -1 on error */ int libfvalue_data_handle_get_number_of_value_entries( libfvalue_data_handle_t *data_handle, int *number_of_value_entries, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_get_number_of_value_entries"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( number_of_value_entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of value entries.", function ); return( -1 ); } if( internal_data_handle->data == NULL ) { *number_of_value_entries = 0; } else if( internal_data_handle->value_entries == NULL ) { *number_of_value_entries = 1; } else { if( libcdata_array_get_number_of_entries( internal_data_handle->value_entries, number_of_value_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from value entries array.", function ); return( -1 ); } } return( 1 ); } /* Retrieves a specific value entry * Returns if successful or -1 on error */ int libfvalue_data_handle_get_value_entry( libfvalue_data_handle_t *data_handle, int value_entry_index, size_t *value_entry_offset, size_t *value_entry_size, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; libfvalue_value_entry_t *value_entry = NULL; static char *function = "libfvalue_data_handle_get_value_entry"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( internal_data_handle->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data handle - missing data.", function ); return( -1 ); } if( value_entry_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry offset.", function ); return( -1 ); } if( value_entry_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry size.", function ); return( -1 ); } if( internal_data_handle->value_entries == NULL ) { *value_entry_offset = 0; *value_entry_size = internal_data_handle->data_size; } else { if( libcdata_array_get_entry_by_index( internal_data_handle->value_entries, value_entry_index, (intptr_t **) &value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values entries array.", function, value_entry_index ); return( -1 ); } if( value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value entry: %d.", function, value_entry_index ); return( -1 ); } *value_entry_offset = value_entry->offset; *value_entry_size = value_entry->size; } return( 1 ); } /* Sets a specific value entry * Returns if successful or -1 on error */ int libfvalue_data_handle_set_value_entry( libfvalue_data_handle_t *data_handle, int value_entry_index, size_t value_entry_offset, size_t value_entry_size, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; libfvalue_value_entry_t *value_entry = NULL; static char *function = "libfvalue_data_handle_set_value_entry"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( internal_data_handle->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data handle - missing data.", function ); return( -1 ); } if( value_entry_index != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry index value out of bounds.", function ); return( -1 ); } if( value_entry_offset > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry offset value exceeds maximum.", function ); return( -1 ); } if( value_entry_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry size value exceeds maximum.", function ); return( -1 ); } if( value_entry_offset > internal_data_handle->data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry offset value out of bounds.", function ); return( -1 ); } if( ( value_entry_size > internal_data_handle->data_size ) || ( value_entry_offset > ( internal_data_handle->data_size - value_entry_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry size value out of bounds.", function ); return( -1 ); } if( internal_data_handle->value_entries == NULL ) { if( value_entry_index != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value index value out of bounds.", function ); return( -1 ); } if( ( value_entry_offset != 0 ) || ( value_entry_size != internal_data_handle->data_size ) ) { if( libfvalue_value_entry_initialize( &value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entry.", function ); return( -1 ); } value_entry->offset = value_entry_offset; value_entry->size = value_entry_size; if( libcdata_array_initialize( &( internal_data_handle->value_entries ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entries array.", function ); libfvalue_value_entry_free( &value_entry, NULL ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_data_handle->value_entries, 0, (intptr_t *) value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: 0 in values entries array.", function ); libfvalue_value_entry_free( &value_entry, NULL ); libcdata_array_free( &( internal_data_handle->value_entries ), NULL, NULL ); return( -1 ); } value_entry = NULL; } } else { if( libcdata_array_get_entry_by_index( internal_data_handle->value_entries, value_entry_index, (intptr_t **) &value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values entries array.", function, value_entry_index ); return( -1 ); } if( value_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value entry.", function ); return( -1 ); } value_entry->offset = value_entry_offset; value_entry->size = value_entry_size; } return( 1 ); } /* Appends a value entry * Returns if successful or -1 on error */ int libfvalue_data_handle_append_value_entry( libfvalue_data_handle_t *data_handle, int *value_entry_index, size_t value_entry_offset, size_t value_entry_size, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; libfvalue_value_entry_t *value_entry = NULL; static char *function = "libfvalue_data_handle_append_value_entry"; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( value_entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry index.", function ); return( -1 ); } if( value_entry_offset > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry offset value exceeds maximum.", function ); return( -1 ); } if( value_entry_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry size value exceeds maximum.", function ); return( -1 ); } if( value_entry_offset > internal_data_handle->data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry offset value out of bounds.", function ); return( -1 ); } if( ( value_entry_size > internal_data_handle->data_size ) || ( value_entry_offset > ( internal_data_handle->data_size - value_entry_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry size value out of bounds.", function ); return( -1 ); } if( internal_data_handle->value_entries == NULL ) { if( libcdata_array_initialize( &( internal_data_handle->value_entries ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entries array.", function ); goto on_error; } } if( libfvalue_value_entry_initialize( &value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entry.", function ); goto on_error; } value_entry->offset = value_entry_offset; value_entry->size = value_entry_size; if( libcdata_array_append_entry( internal_data_handle->value_entries, value_entry_index, (intptr_t *) value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append entry to values entries array.", function ); goto on_error; } value_entry = NULL; return( 1 ); on_error: if( value_entry != NULL ) { libfvalue_value_entry_free( &value_entry, NULL ); } return( -1 ); } /* Retrieves the data of a specific value entry * Returns if successful or -1 on error */ int libfvalue_data_handle_get_value_entry_data( libfvalue_data_handle_t *data_handle, int value_entry_index, uint8_t **value_entry_data, size_t *value_entry_data_size, int *encoding, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_get_value_entry_data"; size_t value_entry_offset = 0; size_t value_entry_size = 0; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( internal_data_handle->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data handle - missing data.", function ); return( -1 ); } if( value_entry_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry data.", function ); return( -1 ); } if( value_entry_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry data size.", function ); return( -1 ); } if( encoding == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid encoding.", function ); return( -1 ); } if( libfvalue_data_handle_get_value_entry( data_handle, value_entry_index, &value_entry_offset, &value_entry_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value entry: %d.", function, value_entry_index ); return( -1 ); } if( value_entry_offset > internal_data_handle->data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: value entry: %d offset out of bounds.", function, value_entry_index ); return( -1 ); } if( ( value_entry_size > internal_data_handle->data_size ) || ( value_entry_offset > ( internal_data_handle->data_size - value_entry_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: value entry: %d size out of bounds.", function, value_entry_index ); return( -1 ); } if( value_entry_size == 0 ) { *value_entry_data = NULL; } else { *value_entry_data = &( ( internal_data_handle->data )[ value_entry_offset ] ); } *value_entry_data_size = value_entry_size; *encoding = internal_data_handle->encoding; return( 1 ); } /* Sets the data of a specific value entry * Returns if successful or -1 on error */ int libfvalue_data_handle_set_value_entry_data( libfvalue_data_handle_t *data_handle, int value_entry_index, const uint8_t *value_entry_data, size_t value_entry_data_size, int encoding, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; static char *function = "libfvalue_data_handle_set_value_entry_data"; size_t value_entry_offset = 0; size_t value_entry_size = 0; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( internal_data_handle->data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid data handle - missing data.", function ); return( -1 ); } /* TODO remove limitation */ if( value_entry_index != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry index value out of bounds.", function ); return( -1 ); } if( value_entry_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry data.", function ); return( -1 ); } if( value_entry_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry data size value exceeds maximum.", function ); return( -1 ); } if( encoding != internal_data_handle->encoding ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid encoding value out of bounds.", function ); return( -1 ); } if( libfvalue_data_handle_get_value_entry( data_handle, value_entry_index, &value_entry_offset, &value_entry_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value entry: %d.", function, value_entry_index ); return( -1 ); } if( value_entry_offset > internal_data_handle->data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: value entry: %d offset out of bounds.", function, value_entry_index ); return( -1 ); } if( ( value_entry_size > internal_data_handle->data_size ) || ( value_entry_offset > ( internal_data_handle->data_size - value_entry_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: value entry: %d size out of bounds.", function, value_entry_index ); return( -1 ); } if( value_entry_data_size != value_entry_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value entry data size value out of bounds.", function ); return( -1 ); } if( value_entry_size > 0 ) { if( memory_copy( &( ( internal_data_handle->data )[ value_entry_offset ] ), value_entry_data, value_entry_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy value entry data.", function ); return( -1 ); } } return( 1 ); } /* Appends the data of a value entry * Returns if successful or -1 on error */ int libfvalue_data_handle_append_value_entry_data( libfvalue_data_handle_t *data_handle, int *value_entry_index, const uint8_t *value_entry_data, size_t value_entry_data_size, int encoding, libcerror_error_t **error ) { libfvalue_internal_data_handle_t *internal_data_handle = NULL; libfvalue_value_entry_t *value_entry = NULL; static char *function = "libfvalue_data_handle_append_value_entry_data"; void *reallocation = NULL; size_t reallocation_data_size = 0; if( data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data handle.", function ); return( -1 ); } internal_data_handle = (libfvalue_internal_data_handle_t *) data_handle; if( value_entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry index.", function ); return( -1 ); } if( value_entry_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value entry data.", function ); return( -1 ); } if( value_entry_data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry data size value exceeds maximum.", function ); return( -1 ); } if( internal_data_handle->data == NULL ) { if( libfvalue_data_handle_set_data( data_handle, value_entry_data, value_entry_data_size, encoding, LIBFVALUE_VALUE_DATA_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data in data handle.", function ); goto on_error; } internal_data_handle->encoding = encoding; } else { if( encoding != internal_data_handle->encoding ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid encoding value out of bounds.", function ); return( -1 ); } if( internal_data_handle->data_size > ( (size_t) SSIZE_MAX - value_entry_data_size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid value entry data size value exceeds maximum.", function ); return( -1 ); } if( internal_data_handle->value_entries == NULL ) { if( libcdata_array_initialize( &( internal_data_handle->value_entries ), 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entries array.", function ); goto on_error; } if( libfvalue_value_entry_initialize( &value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entry.", function ); goto on_error; } value_entry->offset = 0; value_entry->size = internal_data_handle->data_size; if( libcdata_array_set_entry_by_index( internal_data_handle->value_entries, 0, (intptr_t *) value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: 0 in values entries array.", function ); goto on_error; } value_entry = NULL; } if( libfvalue_value_entry_initialize( &value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value entry.", function ); goto on_error; } value_entry->offset = internal_data_handle->data_size; value_entry->size = value_entry_data_size; reallocation_data_size = internal_data_handle->data_size + value_entry_data_size; reallocation = memory_reallocate( internal_data_handle->data, reallocation_data_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize array entries.", function ); goto on_error; } internal_data_handle->data = (uint8_t *) reallocation; internal_data_handle->data_size = reallocation_data_size; if( memory_copy( &( ( internal_data_handle->data )[ value_entry->offset ] ), value_entry_data, value_entry->size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy value entry data.", function ); goto on_error; } if( libcdata_array_append_entry( internal_data_handle->value_entries, value_entry_index, (intptr_t *) value_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append entry to values entries array.", function ); goto on_error; } value_entry = NULL; } return( 1 ); on_error: if( value_entry != NULL ) { libfvalue_value_entry_free( &value_entry, NULL ); } return( -1 ); } libewf-20140807/libfvalue/libfvalue_libcdata.h0000664000175000017500000000302113443450055023246 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2010-2018, 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( _LIBFVALUE_LIBCDATA_H ) #define _LIBFVALUE_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBFVALUE_LIBCDATA_H ) */ libewf-20140807/libfvalue/libfvalue_extern.h0000664000175000017500000000242213443450055023014 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_EXTERN_H ) #define _LIBFVALUE_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue */ #if !defined( HAVE_LOCAL_LIBFVALUE ) #include #define LIBFVALUE_EXTERN_VARIABLE LIBFVALUE_EXTERN #else #define LIBFVALUE_EXTERN /* extern */ #define LIBFVALUE_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBFVALUE ) */ #endif /* !defined( _LIBFVALUE_INTERNAL_EXTERN_H ) */ libewf-20140807/libfvalue/libfvalue_libfdatetime.h0000664000175000017500000000345313443450055024145 0ustar00lordyestalordyesta00000000000000/* * The libfdatetime header wrapper * * Copyright (C) 2010-2018, 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( _LIBFVALUE_LIBFDATETIME_H ) #define _LIBFVALUE_LIBFDATETIME_H #include /* Define HAVE_LOCAL_LIBFDATETIME for local use of libfdatetime */ #if defined( HAVE_LOCAL_LIBFDATETIME ) #include #include #include #include #include #include #include #include #include #include /* Note that libfvalue does not require to have libfdatetime support */ #elif defined( HAVE_LIBFDATETIME_H ) /* If libtool DLL support is enabled set LIBFDATETIME_DLL_IMPORT * before including libfdatetime.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFDATETIME_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFDATETIME ) */ #endif /* !defined( _LIBFVALUE_LIBFDATETIME_H ) */ libewf-20140807/libfvalue/libfvalue_value_entry.h0000664000175000017500000000320313443450055024042 0ustar00lordyestalordyesta00000000000000/* * Value entry functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_VALUE_ENTRY_H ) #define _LIBFVALUE_VALUE_ENTRY_H #include #include #include "libfvalue_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_value_entry libfvalue_value_entry_t; struct libfvalue_value_entry { /* The offset */ size_t offset; /* The size */ size_t size; }; int libfvalue_value_entry_initialize( libfvalue_value_entry_t **value_entry, libcerror_error_t **error ); int libfvalue_value_entry_free( libfvalue_value_entry_t **value_entry, libcerror_error_t **error ); int libfvalue_value_entry_clone( libfvalue_value_entry_t **destination_value_entry, libfvalue_value_entry_t *source_value_entry, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_VALUE_ENTRY_H ) */ libewf-20140807/libfvalue/libfvalue_split_utf8_string.h0000664000175000017500000000543513443450055025205 0ustar00lordyestalordyesta00000000000000/* * Split UTF-8 string functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_SPLIT_UTF8_STRING_H ) #define _LIBFVALUE_SPLIT_UTF8_STRING_H #include #include #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_internal_split_utf8_string libfvalue_internal_split_utf8_string_t; struct libfvalue_internal_split_utf8_string { /* The number of string segments */ int number_of_segments; /* The string */ uint8_t *string; /* The string size */ size_t string_size; /* The segments */ uint8_t **segments; /* The segment sizes */ size_t *segment_sizes; }; int libfvalue_split_utf8_string_initialize( libfvalue_split_utf8_string_t **split_string, const uint8_t *utf8_string, size_t utf8_string_size, int number_of_segments, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf8_string_free( libfvalue_split_utf8_string_t **split_string, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf8_string_get_string( libfvalue_split_utf8_string_t *split_string, uint8_t **utf8_string, size_t *utf8_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf8_string_get_number_of_segments( libfvalue_split_utf8_string_t *split_string, int *number_of_segments, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf8_string_get_segment_by_index( libfvalue_split_utf8_string_t *split_string, int segment_index, uint8_t **utf8_string_segment, size_t *utf8_string_segment_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_split_utf8_string_set_segment_by_index( libfvalue_split_utf8_string_t *split_string, int segment_index, uint8_t *utf8_string_segment, size_t utf8_string_segment_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_SPLIT_UTF8_STRING_H ) */ libewf-20140807/libfvalue/libfvalue_value.h0000664000175000017500000004744113443450055022635 0ustar00lordyestalordyesta00000000000000/* * Value functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_VALUE_H ) #define _LIBFVALUE_INTERNAL_VALUE_H #include #include #include #include "libfvalue_extern.h" #include "libfvalue_libcdata.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_internal_value libfvalue_internal_value_t; struct libfvalue_internal_value { /* The type */ int type; /* The type string */ const char *type_string; /* The type description */ const char *type_description; /* The identifier */ uint8_t *identifier; /* The identifier size */ size_t identifier_size; /* The data handle */ libfvalue_data_handle_t *data_handle; /* The value instances array */ libcdata_array_t *value_instances; /* The initialize instance function */ int (*initialize_instance)( intptr_t **instance, libcerror_error_t **error ); /* The free instance function */ int (*free_instance)( intptr_t **instance, libcerror_error_t **error ); /* The clone (duplicate) instance function */ int (*clone_instance)( intptr_t **destination_instance, intptr_t *source_instance, libcerror_error_t **error ); /* The instance copy from byte stream */ int (*copy_from_byte_stream)( intptr_t *instance, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ); /* The instance copy to byte stream */ int (*copy_to_byte_stream)( intptr_t *instance, uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ); /* The instance copy from integer function */ int (*copy_from_integer)( intptr_t *instance, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ); /* The instance copy to integer function */ int (*copy_to_integer)( intptr_t *instance, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ); /* The instance copy from floating point function */ int (*copy_from_floating_point)( intptr_t *instance, double floating_point_value, size_t floating_point_value_size, libcerror_error_t **error ); /* The instance copy to floating point function */ int (*copy_to_floating_point)( intptr_t *instance, double *floating_point_value, size_t *floating_point_value_size, libcerror_error_t **error ); /* The instance copy from UTF-8 string with index function */ int (*copy_from_utf8_string_with_index)( intptr_t *instance, const uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance get UTF-8 string size function */ int (*get_utf8_string_size)( intptr_t *instance, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance copy to UTF-8 string with index function */ int (*copy_to_utf8_string_with_index)( intptr_t *instance, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance copy from UTF-16 string with index function */ int (*copy_from_utf16_string_with_index)( intptr_t *instance, const uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance get UTF-16 string size function */ int (*get_utf16_string_size)( intptr_t *instance, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance copy to UTF-16 string with index function */ int (*copy_to_utf16_string_with_index)( intptr_t *instance, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance copy from UTF-32 string with index function */ int (*copy_from_utf32_string_with_index)( intptr_t *instance, const uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance get UTF-32 string size function */ int (*get_utf32_string_size)( intptr_t *instance, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ); /* The instance copy to UTF-32 string with index function */ int (*copy_to_utf32_string_with_index)( intptr_t *instance, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); /* The format flags */ uint32_t format_flags; /* The flags */ uint8_t flags; }; LIBFVALUE_EXTERN \ int libfvalue_value_initialize( libfvalue_value_t **value, const char *type_string, const char *type_description, libfvalue_data_handle_t *data_handle, int (*initialize_instance)( intptr_t **instance, libcerror_error_t **error ), int (*free_instance)( intptr_t **instance, libcerror_error_t **error ), int (*clone_instance)( intptr_t **destination_instance, intptr_t *source_instance, libcerror_error_t **error ), int (*copy_from_byte_stream)( intptr_t *instance, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ), int (*copy_to_byte_stream)( intptr_t *instance, uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ), int (*copy_from_integer)( intptr_t *instance, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ), int (*copy_to_integer)( intptr_t *instance, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ), int (*copy_from_floating_point)( intptr_t *instance, double floating_point_value, size_t floating_point_value_size, libcerror_error_t **error ), int (*copy_to_floating_point)( intptr_t *instance, double *floating_point_value, size_t *floating_point_value_size, libcerror_error_t **error ), int (*copy_from_utf8_string_with_index)( intptr_t *instance, const uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*get_utf8_string_size)( intptr_t *instance, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_to_utf8_string_with_index)( intptr_t *instance, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_from_utf16_string_with_index)( intptr_t *instance, const uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*get_utf16_string_size)( intptr_t *instance, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_to_utf16_string_with_index)( intptr_t *instance, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_from_utf32_string_with_index)( intptr_t *instance, const uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ), int (*get_utf32_string_size)( intptr_t *instance, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ), int (*copy_to_utf32_string_with_index)( intptr_t *instance, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_free( libfvalue_value_t **value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_clone( libfvalue_value_t **destination_value, libfvalue_value_t *source_value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_clear( libfvalue_value_t *value, libcerror_error_t **error ); int libfvalue_compare_identifier( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_type( libfvalue_value_t *value, int *value_type, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_identifier( libfvalue_value_t *value, uint8_t **identifier, size_t *identifier_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_set_identifier( libfvalue_value_t *value, const uint8_t *identifier, size_t identifier_size, uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_data_flags( libfvalue_value_t *value, uint32_t *data_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_set_data_flags( libfvalue_value_t *value, uint32_t data_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_has_data( libfvalue_value_t *value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_initialize_data( libfvalue_value_t *value, size_t data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_data_size( libfvalue_value_t *value, size_t *data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_data( libfvalue_value_t *value, uint8_t **data, size_t *data_size, int *encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_set_data( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_data( libfvalue_value_t *value, uint8_t *data, size_t data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_format_flags( libfvalue_value_t *value, uint32_t *format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_set_format_flags( libfvalue_value_t *value, uint32_t format_flags, libcerror_error_t **error ); /* Value instance functions */ int libfvalue_value_get_value_instance_by_index( libfvalue_value_t *value, int value_entry_index, intptr_t **value_instance, libcerror_error_t **error ); /* Value entry functions */ LIBFVALUE_EXTERN \ int libfvalue_value_get_number_of_value_entries( libfvalue_value_t *value, int *number_of_value_entries, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_entry( libfvalue_value_t *value, int value_entry_index, size_t *entry_data_offset, size_t *entry_data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_set_entry( libfvalue_value_t *value, int value_entry_index, size_t entry_data_offset, size_t entry_data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_append_entry( libfvalue_value_t *value, int *value_entry_index, size_t entry_data_offset, size_t entry_data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_entry_data( libfvalue_value_t *value, int value_entry_index, uint8_t **entry_data, size_t *entry_data_size, int *encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_set_entry_data( libfvalue_value_t *value, int value_entry_index, const uint8_t *entry_data, size_t entry_data_size, int encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_append_entry_data( libfvalue_value_t *value, int *value_entry_index, const uint8_t *entry_data, size_t entry_data_size, int encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_entry_data( libfvalue_value_t *value, int value_entry_index, uint8_t *entry_data, size_t entry_data_size, int *encoding, libcerror_error_t **error ); /* Boolean value functions */ LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_boolean( libfvalue_value_t *value, int value_entry_index, uint8_t value_boolean, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_boolean( libfvalue_value_t *value, int value_entry_index, uint8_t *value_boolean, libcerror_error_t **error ); /* Integer value functions */ LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_8bit( libfvalue_value_t *value, int value_entry_index, uint8_t value_8bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_8bit( libfvalue_value_t *value, int value_entry_index, uint8_t *value_8bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_16bit( libfvalue_value_t *value, int value_entry_index, uint16_t value_16bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_16bit( libfvalue_value_t *value, int value_entry_index, uint16_t *value_16bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_32bit( libfvalue_value_t *value, int value_entry_index, uint32_t value_32bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_32bit( libfvalue_value_t *value, int value_entry_index, uint32_t *value_32bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_64bit( libfvalue_value_t *value, int value_entry_index, uint64_t value_64bit, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_64bit( libfvalue_value_t *value, int value_entry_index, uint64_t *value_64bit, libcerror_error_t **error ); /* Floating point value functions */ LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_float( libfvalue_value_t *value, int value_entry_index, float value_float, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_float( libfvalue_value_t *value, int value_entry_index, float *value_float, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_double( libfvalue_value_t *value, int value_entry_index, double value_double, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_double( libfvalue_value_t *value, int value_entry_index, double *value_double, libcerror_error_t **error ); /* String value functions */ LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_utf8_string( libfvalue_value_t *value, int value_entry_index, const uint8_t *utf8_string, size_t utf8_string_length, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_utf8_string_size( libfvalue_value_t *value, int value_entry_index, size_t *utf8_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_utf8_string( libfvalue_value_t *value, int value_entry_index, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_utf8_string_with_index( libfvalue_value_t *value, int value_entry_index, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_utf16_string( libfvalue_value_t *value, int value_entry_index, const uint16_t *utf16_string, size_t utf16_string_length, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_utf16_string_size( libfvalue_value_t *value, int value_entry_index, size_t *utf16_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_utf16_string( libfvalue_value_t *value, int value_entry_index, uint16_t *utf16_string, size_t utf16_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_utf16_string_with_index( libfvalue_value_t *value, int value_entry_index, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_from_utf32_string( libfvalue_value_t *value, int value_entry_index, const uint32_t *utf32_string, size_t utf32_string_length, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_get_utf32_string_size( libfvalue_value_t *value, int value_entry_index, size_t *utf32_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_utf32_string( libfvalue_value_t *value, int value_entry_index, uint32_t *utf32_string, size_t utf32_string_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_copy_to_utf32_string_with_index( libfvalue_value_t *value, int value_entry_index, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, libcerror_error_t **error ); /* Marshalling functions */ LIBFVALUE_EXTERN \ ssize_t libfvalue_value_read_from_file_stream( libfvalue_value_t *value, FILE *file_stream, libcerror_error_t **error ); LIBFVALUE_EXTERN \ ssize_t libfvalue_value_write_to_file_stream( libfvalue_value_t *value, FILE *file_stream, libcerror_error_t **error ); /* Print functions */ int libfvalue_value_print( libfvalue_value_t *value, int value_entry_index, uint8_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTERNAL_VALUE_H ) */ libewf-20140807/libfvalue/libfvalue_binary_data.h0000664000175000017500000000630213443450055023765 0ustar00lordyestalordyesta00000000000000/* * Binary data value functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_BINARY_DATA_H ) #define _LIBFVALUE_BINARY_DATA_H #include #include #include "libfvalue_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_binary_data libfvalue_binary_data_t; struct libfvalue_binary_data { /* The data */ const uint8_t *data; /* The data size */ size_t data_size; }; int libfvalue_binary_data_initialize( libfvalue_binary_data_t **binary_data, libcerror_error_t **error ); int libfvalue_binary_data_free( libfvalue_binary_data_t **binary_data, libcerror_error_t **error ); int libfvalue_binary_data_clone( libfvalue_binary_data_t **destination_binary_data, libfvalue_binary_data_t *source_binary_data, libcerror_error_t **error ); int libfvalue_binary_data_copy_from_byte_stream( libfvalue_binary_data_t *binary_data, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ); int libfvalue_binary_data_get_utf8_string_size( libfvalue_binary_data_t *binary_data, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_binary_data_copy_to_utf8_string_with_index( libfvalue_binary_data_t *binary_data, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_binary_data_get_utf16_string_size( libfvalue_binary_data_t *binary_data, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_binary_data_copy_to_utf16_string_with_index( libfvalue_binary_data_t *binary_data, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_binary_data_get_utf32_string_size( libfvalue_binary_data_t *binary_data, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_binary_data_copy_to_utf32_string_with_index( libfvalue_binary_data_t *binary_data, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_BINARY_DATA_H ) */ libewf-20140807/libfvalue/libfvalue_value_type.h0000664000175000017500000000457013443450055023672 0ustar00lordyestalordyesta00000000000000/* * Value type functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_VALUE_TYPE_H ) #define _LIBFVALUE_INTERNAL_VALUE_TYPE_H #include #include #include #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBFVALUE_EXTERN \ int libfvalue_value_type_initialize( libfvalue_value_t **value, int type, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_value_type_initialize_with_data_handle( libfvalue_value_t **value, int type, libfvalue_data_handle_t *data_handle, uint8_t flags, libcerror_error_t **error ); ssize_t libfvalue_value_type_get_string_size( libfvalue_value_t *value, const uint8_t *data, size_t data_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ ssize_t libfvalue_value_type_set_data_string( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ ssize_t libfvalue_value_type_append_data_string( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ ssize_t libfvalue_value_type_set_data_strings_array( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTERNAL_VALUE_TYPE_H ) */ libewf-20140807/libfvalue/libfvalue_utf16_string.c0000664000175000017500000001424713443450055024045 0ustar00lordyestalordyesta00000000000000/* * UTF-16 string value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include "libfvalue_libcerror.h" #include "libfvalue_split_utf16_string.h" #include "libfvalue_types.h" /* Splits an UTF-16 string * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_split( const uint16_t *utf16_string, size_t utf16_string_size, uint16_t delimiter, libfvalue_split_utf16_string_t **split_string, libcerror_error_t **error ) { uint16_t *segment_start = NULL; uint16_t *segment_end = NULL; uint16_t *string_end = NULL; static char *function = "libfvalue_utf16_string_split"; size_t string_size = 0; ssize_t segment_length = 0; int number_of_segments = 0; int segment_index = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string already set.", function ); return( -1 ); } /* An empty string has no segments */ if( ( utf16_string_size == 0 ) || ( utf16_string[ 0 ] == 0 ) ) { return( 1 ); } /* Determine the number of segments */ segment_start = (uint16_t *) utf16_string; string_end = (uint16_t *) &( utf16_string[ utf16_string_size - 1 ] ); do { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end > string_end ) { break; } segment_index++; if( segment_end == NULL ) { break; } if( segment_end == segment_start ) { segment_start++; } else if( segment_end != utf16_string ) { segment_start = segment_end + 1; } } while( segment_end != NULL ); number_of_segments = segment_index; if( libfvalue_split_utf16_string_initialize( split_string, utf16_string, utf16_string_size, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to intialize split string.", function ); goto on_error; } if( *split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing split string.", function ); goto on_error; } /* Do not bother splitting empty strings */ if( number_of_segments == 0 ) { return( 1 ); } /* Determine the segments * empty segments are stored as strings only containing the end of character */ if( libfvalue_split_utf16_string_get_string( *split_string, &segment_start, &string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve split UTF-16 string.", function ); goto on_error; } if( segment_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment start.", function ); goto on_error; } if( string_size < 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string size value out of bounds.", function ); goto on_error; } string_end = &( segment_start[ string_size - 1 ] ); for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end == NULL ) { segment_length = (ssize_t) ( string_end - segment_start ); } else { segment_length = (ssize_t) ( segment_end - segment_start ); } if( segment_length >= 0 ) { segment_start[ segment_length ] = 0; if( libfvalue_split_utf16_string_set_segment_by_index( *split_string, segment_index, segment_start, segment_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set split UTF-16 string segment: %d.", function, segment_index ); goto on_error; } } if( segment_end == NULL ) { break; } if( segment_end == string_end ) { segment_start++; } if( segment_end != string_end ) { segment_start = segment_end + 1; } } return( 1 ); on_error: if( *split_string != NULL ) { libfvalue_split_utf16_string_free( split_string, NULL ); } return( -1 ); } libewf-20140807/libfvalue/libfvalue_value_type.c0000664000175000017500000010740713443450055023670 0ustar00lordyestalordyesta00000000000000/* * Value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include "libfvalue_binary_data.h" #include "libfvalue_data_handle.h" #include "libfvalue_definitions.h" #include "libfvalue_filetime.h" #include "libfvalue_floating_point.h" #include "libfvalue_integer.h" #include "libfvalue_libcerror.h" #include "libfvalue_libcnotify.h" #include "libfvalue_string.h" #include "libfvalue_types.h" #include "libfvalue_unused.h" #include "libfvalue_value.h" #include "libfvalue_value_type.h" #if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) #include "libfvalue_libfdatetime.h" #endif #if defined( HAVE_LIBFGUID_H ) || defined( HAVE_LOCAL_LIBFGUID ) #include "libfvalue_libfguid.h" #endif #if defined( HAVE_LIBFWNT_H ) || defined( HAVE_LOCAL_LIBFWNT ) #include "libfvalue_libfwnt.h" #endif const char *libfvalue_value_type_strings[ 28 ] = { NULL, "binary-data", "boolean", "enum", "int8", "uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64", "float32", "float64", "NULL", "byte-stream-string", "utf8-string", "utf16-string", "utf32-string", "fat-date-time", "filetime", "floatingtime", "nsf-timedate", "hfs-time", "posix-time", "systemtime", "guid", "nt-sid", }; const char *libfvalue_value_type_descriptions[ 28 ] = { NULL, "Binary data", "Boolean", "Enumeration", "Integer 8-bit signed", "Integer 8-bit unsigned", "Integer 16-bit signed", "Integer 16-bit unsigned", "Integer 32-bit signed", "Integer 32-bit unsigned", "Integer 64-bit signed", "Integer 64-bit unsigned", "Floating point 32-bit (single precision)", "Floating point 64-bit (double precision)", "Null (None)", "Byte stream string", "UTF-8 string", "UTF-16 string", "UTF-32 string", "FAT date time", "Filetime", "FLoatingtime", "NSF timedate", "HFS time", "POSIX time", "Systemtime", "Globally Unique Identifier (GUID)", "NT Security Identifier (SID)", }; /* Creates a value of a specific type * Make sure the value value is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_value_type_initialize( libfvalue_value_t **value, int type, libcerror_error_t **error ) { static char *function = "libfvalue_value_type_initialize"; if( libfvalue_value_type_initialize_with_data_handle( value, type, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value with data handle.", function ); return( -1 ); } return( 1 ); } /* Initialize a value of a specific type with a custom data handle * Returns 1 if successful or -1 on error */ int libfvalue_value_type_initialize_with_data_handle( libfvalue_value_t **value, int type, libfvalue_data_handle_t *data_handle, uint8_t flags, libcerror_error_t **error ) { static char *function = "libfvalue_value_type_initialize_with_data_handle"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } switch( type ) { case LIBFVALUE_VALUE_TYPE_BINARY_DATA: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_binary_data_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_binary_data_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfvalue_binary_data_clone, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfvalue_binary_data_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_binary_data_get_utf8_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_binary_data_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_binary_data_get_utf16_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_binary_data_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_binary_data_get_utf32_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_binary_data_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_FLOATING_POINT_32BIT: case LIBFVALUE_VALUE_TYPE_FLOATING_POINT_64BIT: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_floating_point_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_floating_point_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfvalue_floating_point_clone, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfvalue_floating_point_copy_from_byte_stream, NULL, (int (*)(intptr_t *, uint64_t, size_t, libcerror_error_t **)) &libfvalue_floating_point_copy_from_integer, (int (*)(intptr_t *, uint64_t *, size_t *, libcerror_error_t **)) &libfvalue_floating_point_copy_to_integer, (int (*)(intptr_t *, double, size_t, libcerror_error_t **)) &libfvalue_floating_point_copy_from_floating_point, (int (*)(intptr_t *, double *, size_t *, libcerror_error_t **)) &libfvalue_floating_point_copy_to_floating_point, (int (*)(intptr_t *, const uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_copy_from_utf8_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_copy_to_utf8_string_with_index, (int (*)(intptr_t *, const uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_copy_from_utf16_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_copy_to_utf16_string_with_index, (int (*)(intptr_t *, const uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_copy_from_utf32_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_floating_point_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_BOOLEAN: case LIBFVALUE_VALUE_TYPE_INTEGER_8BIT: case LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_8BIT: case LIBFVALUE_VALUE_TYPE_INTEGER_16BIT: case LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_16BIT: case LIBFVALUE_VALUE_TYPE_INTEGER_32BIT: case LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_32BIT: case LIBFVALUE_VALUE_TYPE_INTEGER_64BIT: case LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_64BIT: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_integer_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_integer_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfvalue_integer_clone, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfvalue_integer_copy_from_byte_stream, NULL, (int (*)(intptr_t *, uint64_t, size_t, libcerror_error_t **)) &libfvalue_integer_copy_from_integer, (int (*)(intptr_t *, uint64_t *, size_t *, libcerror_error_t **)) &libfvalue_integer_copy_to_integer, NULL, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_copy_from_utf8_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_copy_to_utf8_string_with_index, (int (*)(intptr_t *, const uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_copy_from_utf16_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_copy_to_utf16_string_with_index, (int (*)(intptr_t *, const uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_copy_from_utf32_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_integer_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_NULL: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, flags, error ); break; case LIBFVALUE_VALUE_TYPE_STRING_BYTE_STREAM: case LIBFVALUE_VALUE_TYPE_STRING_UTF8: case LIBFVALUE_VALUE_TYPE_STRING_UTF16: case LIBFVALUE_VALUE_TYPE_STRING_UTF32: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_string_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_string_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfvalue_string_clone, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfvalue_string_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_copy_from_utf8_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_get_utf8_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_copy_to_utf8_string_with_index, (int (*)(intptr_t *, const uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_copy_from_utf16_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_get_utf16_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_copy_to_utf16_string_with_index, (int (*)(intptr_t *, const uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_copy_from_utf32_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_get_utf32_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfvalue_string_copy_to_utf32_string_with_index, flags, error ); break; #if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) case LIBFVALUE_VALUE_TYPE_FAT_DATE_TIME: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_fat_date_time_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_fat_date_time_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_fat_date_time_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_fat_date_time_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_fat_date_time_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_fat_date_time_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_fat_date_time_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_fat_date_time_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_fat_date_time_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_FILETIME: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_filetime_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_filetime_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_filetime_copy_from_byte_stream, NULL, (int (*)(intptr_t *, uint64_t, size_t, libcerror_error_t **)) &libfvalue_filetime_copy_from_integer, (int (*)(intptr_t *, uint64_t *, size_t *, libcerror_error_t **)) &libfvalue_filetime_copy_to_integer, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_filetime_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_filetime_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_filetime_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_filetime_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_filetime_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_filetime_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_FLOATINGTIME: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_floatingtime_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_floatingtime_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_floatingtime_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_floatingtime_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_floatingtime_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_floatingtime_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_floatingtime_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_floatingtime_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_floatingtime_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_NSF_TIMEDATE: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_nsf_timedate_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_nsf_timedate_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_nsf_timedate_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_nsf_timedate_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_nsf_timedate_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_nsf_timedate_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_nsf_timedate_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_nsf_timedate_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_nsf_timedate_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_POSIX_TIME: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_posix_time_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_posix_time_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_posix_time_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_posix_time_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_posix_time_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_posix_time_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_posix_time_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_posix_time_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_posix_time_copy_to_utf32_string_with_index, flags, error ); break; case LIBFVALUE_VALUE_TYPE_SYSTEMTIME: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_systemtime_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_systemtime_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_systemtime_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_systemtime_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_systemtime_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_systemtime_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_systemtime_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_systemtime_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfdatetime_systemtime_copy_to_utf32_string_with_index, flags, error ); break; #endif #if defined( HAVE_LIBFGUID_H ) || defined( HAVE_LOCAL_LIBFGUID ) case LIBFVALUE_VALUE_TYPE_GUID: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfguid_identifier_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfguid_identifier_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfguid_identifier_copy_from_byte_stream, (int (*)(intptr_t *, uint8_t *, size_t, int, libcerror_error_t **)) &libfguid_identifier_copy_to_byte_stream, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_copy_from_utf8_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_copy_to_utf8_string_with_index, (int (*)(intptr_t *, const uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_copy_from_utf16_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_copy_to_utf16_string_with_index, (int (*)(intptr_t *, const uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_copy_from_utf32_string_with_index, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfguid_identifier_copy_to_utf32_string_with_index, flags, error ); break; #endif #if defined( HAVE_LIBFWNT_H ) || defined( HAVE_LOCAL_LIBFWNT ) case LIBFVALUE_VALUE_TYPE_NT_SECURITY_IDENTIFIER: result = libfvalue_value_initialize( value, libfvalue_value_type_strings[ type ], libfvalue_value_type_descriptions[ type ], data_handle, (int (*)(intptr_t **, libcerror_error_t **)) &libfwnt_security_identifier_initialize, (int (*)(intptr_t **, libcerror_error_t **)) &libfwnt_security_identifier_free, NULL, (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfwnt_security_identifier_copy_from_byte_stream, NULL, NULL, NULL, NULL, NULL, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfwnt_security_identifier_get_string_size, (int (*)(intptr_t *, uint8_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfwnt_security_identifier_copy_to_utf8_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfwnt_security_identifier_get_string_size, (int (*)(intptr_t *, uint16_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfwnt_security_identifier_copy_to_utf16_string_with_index, NULL, (int (*)(intptr_t *, size_t *, uint32_t, libcerror_error_t **)) &libfwnt_security_identifier_get_string_size, (int (*)(intptr_t *, uint32_t *, size_t, size_t *, uint32_t, libcerror_error_t **)) &libfwnt_security_identifier_copy_to_utf32_string_with_index, flags, error ); break; #endif default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported type: 0x%02" PRIx8 ".", function, type ); break; } if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value.", function ); return( -1 ); } if( *value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing value.", function ); return( -1 ); } ( (libfvalue_internal_value_t *) *value )->type = type; return( 1 ); } /* Determines the size of a variable sized string * This function will look for a end-of-string character as the indicator * of the end of the string upto data size * Returns data size of the string if successful or -1 on error */ ssize_t libfvalue_value_type_get_string_size( libfvalue_value_t *value, const uint8_t *data, size_t data_size, libcerror_error_t **error ) { libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_value_type_get_string_size"; size_t data_index = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; if( ( internal_value->type != LIBFVALUE_VALUE_TYPE_STRING_BYTE_STREAM ) && ( internal_value->type != LIBFVALUE_VALUE_TYPE_STRING_UTF8 ) && ( internal_value->type != LIBFVALUE_VALUE_TYPE_STRING_UTF16 ) && ( internal_value->type != LIBFVALUE_VALUE_TYPE_STRING_UTF32 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported type: 0x%02" PRIx8 ".", function, internal_value->type ); return( -1 ); } if( data_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid data size value exceeds maximum.", function ); return( -1 ); } if( data != NULL ) { if( ( internal_value->type == LIBFVALUE_VALUE_TYPE_STRING_BYTE_STREAM ) || ( internal_value->type == LIBFVALUE_VALUE_TYPE_STRING_UTF8 ) ) { while( data_index < data_size ) { if( data[ data_index ] == 0 ) { data_index += 1; break; } data_index += 1; } } else if( internal_value->type == LIBFVALUE_VALUE_TYPE_STRING_UTF16 ) { if( data_size < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid data size value too small.", function ); return( -1 ); } while( data_index <= ( data_size - 2 ) ) { if( ( data[ data_index ] == 0 ) && ( data[ data_index + 1 ] == 0 ) ) { data_index += 2; break; } data_index += 2; } } else if( internal_value->type == LIBFVALUE_VALUE_TYPE_STRING_UTF32 ) { if( data_size < 4 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid data size value too small.", function ); return( -1 ); } while( data_index <= ( data_size - 4 ) ) { if( ( data[ data_index ] == 0 ) && ( data[ data_index + 1 ] == 0 ) && ( data[ data_index + 2 ] == 0 ) && ( data[ data_index + 3 ] == 0 ) ) { data_index += 4; break; } data_index += 4; } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: string data:\n", function ); libcnotify_print_data( data, data_index, 0 ); } #endif } return( (ssize_t) data_index ); } /* Sets the data of a variable sized string * This function will look for a end-of-string character as the indicator * of the end of the string upto data size * Returns data size of the string if successful or -1 on error */ ssize_t libfvalue_value_type_set_data_string( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, uint8_t flags, libcerror_error_t **error ) { static char *function = "libfvalue_value_type_set_data_string"; ssize_t data_index = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } data_index = libfvalue_value_type_get_string_size( value, data, data_size, error ); if( data_index == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to determine data string size.", function ); return( -1 ); } if( libfvalue_value_set_data( value, data, (size_t) data_index, encoding, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value entry.", function ); return( -1 ); } return( data_index ); } /* Append the data of a variable sized string * This function will look for a end-of-string character as the indicator * of the end of the string upto data size * Returns data size of the string if successful or -1 on error */ ssize_t libfvalue_value_type_append_data_string( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, libcerror_error_t **error ) { static char *function = "libfvalue_value_type_append_data_string"; ssize_t data_index = 0; int value_entry_index = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } data_index = libfvalue_value_type_get_string_size( value, data, data_size, error ); if( data_index == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to determine data string size.", function ); return( -1 ); } if( libfvalue_value_append_entry_data( value, &value_entry_index, data, (size_t) data_index, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value entry.", function ); return( -1 ); } return( data_index ); } /* Sets the data of an array of variable sized strings * This function will look for a NUL-character as the indicator of * the end of the string upto data_size * Returns data size of the string array if successful or -1 on error */ ssize_t libfvalue_value_type_set_data_strings_array( libfvalue_value_t *value, const uint8_t *data, size_t data_size, int encoding, libcerror_error_t **error ) { static char *function = "libfvalue_value_type_set_data_strings_array"; ssize_t data_index = 0; ssize_t last_data_index = 0; int value_entry_index = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } while( (size_t) last_data_index < data_size ) { data_index = libfvalue_value_type_get_string_size( value, &( data[ last_data_index ] ), data_size - last_data_index, error ); if( data_index == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to determine data string size.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: strings array value entry: %d data offset: 0x%08" PRIzx "\n", function, value_entry_index, last_data_index ); libcnotify_printf( "%s: strings array value entry: %d data:\n", function, value_entry_index ); libcnotify_print_data( &( data[ last_data_index ] ), (size_t) data_index, 0 ); } #endif if( libfvalue_value_append_entry_data( value, &value_entry_index, &( data[ last_data_index ] ), (size_t) data_index, encoding, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value entry.", function ); return( -1 ); } last_data_index += data_index; } return( last_data_index ); } libewf-20140807/libfvalue/Makefile.in0000664000175000017500000011343713443455350021366 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libfvalue ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfvalue_la_LIBADD = am__libfvalue_la_SOURCES_DIST = libfvalue_binary_data.c \ libfvalue_binary_data.h libfvalue_codepage.h \ libfvalue_data_handle.c libfvalue_data_handle.h \ libfvalue_definitions.h libfvalue_error.c libfvalue_error.h \ libfvalue_extern.h libfvalue_filetime.c libfvalue_filetime.h \ libfvalue_floating_point.c libfvalue_floating_point.h \ libfvalue_integer.c libfvalue_integer.h libfvalue_libcdata.h \ libfvalue_libcerror.h libfvalue_libcnotify.h \ libfvalue_libfdatetime.h libfvalue_libfguid.h \ libfvalue_libfwnt.h libfvalue_libuna.h \ libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ libfvalue_split_utf8_string.c libfvalue_split_utf8_string.h \ libfvalue_string.c libfvalue_string.h libfvalue_types.h \ libfvalue_table.c libfvalue_table.h libfvalue_value.c \ libfvalue_value.h libfvalue_value_entry.c \ libfvalue_value_entry.h libfvalue_value_type.c \ libfvalue_value_type.h libfvalue_support.c libfvalue_support.h \ libfvalue_unused.h libfvalue_utf16_string.c \ libfvalue_utf16_string.h libfvalue_utf8_string.c \ libfvalue_utf8_string.h @HAVE_LOCAL_LIBFVALUE_TRUE@am_libfvalue_la_OBJECTS = \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_binary_data.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_data_handle.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_error.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_filetime.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_floating_point.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_integer.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf16_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf8_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_table.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_entry.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_type.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_support.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf16_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf8_string.lo libfvalue_la_OBJECTS = $(am_libfvalue_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBFVALUE_TRUE@am_libfvalue_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libfvalue_binary_data.Plo \ ./$(DEPDIR)/libfvalue_data_handle.Plo \ ./$(DEPDIR)/libfvalue_error.Plo \ ./$(DEPDIR)/libfvalue_filetime.Plo \ ./$(DEPDIR)/libfvalue_floating_point.Plo \ ./$(DEPDIR)/libfvalue_integer.Plo \ ./$(DEPDIR)/libfvalue_split_utf16_string.Plo \ ./$(DEPDIR)/libfvalue_split_utf8_string.Plo \ ./$(DEPDIR)/libfvalue_string.Plo \ ./$(DEPDIR)/libfvalue_support.Plo \ ./$(DEPDIR)/libfvalue_table.Plo \ ./$(DEPDIR)/libfvalue_utf16_string.Plo \ ./$(DEPDIR)/libfvalue_utf8_string.Plo \ ./$(DEPDIR)/libfvalue_value.Plo \ ./$(DEPDIR)/libfvalue_value_entry.Plo \ ./$(DEPDIR)/libfvalue_value_type.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libfvalue_la_SOURCES) DIST_SOURCES = $(am__libfvalue_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBFVALUE_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBFVALUE_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBFVALUE_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBFVALUE_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBFVALUE_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBFVALUE_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBFVALUE_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBFVALUE_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_LOCAL_LIBFVALUE_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBFVALUE_TRUE@noinst_LTLIBRARIES = libfvalue.la @HAVE_LOCAL_LIBFVALUE_TRUE@libfvalue_la_SOURCES = \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_binary_data.c libfvalue_binary_data.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_codepage.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_data_handle.c libfvalue_data_handle.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_definitions.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_error.c libfvalue_error.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_extern.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_filetime.c libfvalue_filetime.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_floating_point.c libfvalue_floating_point.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_integer.c libfvalue_integer.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libcdata.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libcerror.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libcnotify.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libfdatetime.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libfguid.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libfwnt.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libuna.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf8_string.c libfvalue_split_utf8_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_string.c libfvalue_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_types.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_table.c libfvalue_table.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value.c libfvalue_value.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_entry.c libfvalue_value_entry.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_type.c libfvalue_value_type.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_support.c libfvalue_support.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_unused.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf16_string.c libfvalue_utf16_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf8_string.c libfvalue_utf8_string.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libfvalue/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libfvalue/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfvalue.la: $(libfvalue_la_OBJECTS) $(libfvalue_la_DEPENDENCIES) $(EXTRA_libfvalue_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libfvalue_la_rpath) $(libfvalue_la_OBJECTS) $(libfvalue_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_binary_data.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_data_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_filetime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_floating_point.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_integer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_split_utf16_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_split_utf8_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_utf16_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_utf8_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_value.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_value_entry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvalue_value_type.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libfvalue_binary_data.Plo -rm -f ./$(DEPDIR)/libfvalue_data_handle.Plo -rm -f ./$(DEPDIR)/libfvalue_error.Plo -rm -f ./$(DEPDIR)/libfvalue_filetime.Plo -rm -f ./$(DEPDIR)/libfvalue_floating_point.Plo -rm -f ./$(DEPDIR)/libfvalue_integer.Plo -rm -f ./$(DEPDIR)/libfvalue_split_utf16_string.Plo -rm -f ./$(DEPDIR)/libfvalue_split_utf8_string.Plo -rm -f ./$(DEPDIR)/libfvalue_string.Plo -rm -f ./$(DEPDIR)/libfvalue_support.Plo -rm -f ./$(DEPDIR)/libfvalue_table.Plo -rm -f ./$(DEPDIR)/libfvalue_utf16_string.Plo -rm -f ./$(DEPDIR)/libfvalue_utf8_string.Plo -rm -f ./$(DEPDIR)/libfvalue_value.Plo -rm -f ./$(DEPDIR)/libfvalue_value_entry.Plo -rm -f ./$(DEPDIR)/libfvalue_value_type.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libfvalue ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfvalue_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libfvalue/libfvalue_libuna.h0000664000175000017500000000331513443450055022763 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2010-2018, 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( _LIBFVALUE_LIBUNA_H ) #define _LIBFVALUE_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _LIBFVALUE_LIBUNA_H ) */ libewf-20140807/libfvalue/libfvalue_error.c0000664000175000017500000000555613443450055022646 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfvalue_error.h" #include "libfvalue_libcerror.h" #if !defined( HAVE_LOCAL_LIBFVALUE ) /* Free an error and its elements */ void libfvalue_error_free( libfvalue_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libfvalue_error_fprint( libfvalue_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libfvalue_error_sprint( libfvalue_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libfvalue_error_backtrace_fprint( libfvalue_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libfvalue_error_backtrace_sprint( libfvalue_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBFVALUE ) */ libewf-20140807/libfvalue/libfvalue_error.h0000664000175000017500000000343413443450055022644 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_ERROR_H ) #define _LIBFVALUE_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBFVALUE ) #include #endif #include "libfvalue_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFVALUE ) LIBFVALUE_EXTERN \ void libfvalue_error_free( libfvalue_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_error_fprint( libfvalue_error_t *error, FILE *stream ); LIBFVALUE_EXTERN \ int libfvalue_error_sprint( libfvalue_error_t *error, char *string, size_t size ); LIBFVALUE_EXTERN \ int libfvalue_error_backtrace_fprint( libfvalue_error_t *error, FILE *stream ); LIBFVALUE_EXTERN \ int libfvalue_error_backtrace_sprint( libfvalue_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBFVALUE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTERNAL_ERROR_H ) */ libewf-20140807/libfvalue/libfvalue_filetime.c0000664000175000017500000000554713443450055023313 0ustar00lordyestalordyesta00000000000000/* * Filetime functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include "libfvalue_definitions.h" #include "libfvalue_filetime.h" #include "libfvalue_libcerror.h" #include "libfvalue_libfdatetime.h" #if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) /* Copies the filetime from an integer value * Returns 1 if successful or -1 on error */ int libfvalue_filetime_copy_from_integer( libfdatetime_filetime_t *filetime, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ) { static char *function = "libfvalue_filetime_copy_from_integer"; if( integer_value_size != 64 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } if( libfdatetime_filetime_copy_from_64bit( filetime, integer_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy filetime from 64-bit value.", function ); return( -1 ); } return( 1 ); } /* Copies the filetime to an integer value * Returns 1 if successful or -1 on error */ int libfvalue_filetime_copy_to_integer( libfdatetime_filetime_t *filetime, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ) { static char *function = "libfvalue_filetime_copy_to_integer"; if( integer_value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value size.", function ); return( -1 ); } if( libfdatetime_filetime_copy_to_64bit( filetime, integer_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy filetime to 64-bit value.", function ); return( -1 ); } *integer_value_size = 64; return( 1 ); } #endif /* defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ libewf-20140807/libfvalue/libfvalue_table.c0000664000175000017500000007613213443450055022602 0ustar00lordyestalordyesta00000000000000/* * Values table functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include "libfvalue_codepage.h" #include "libfvalue_definitions.h" #include "libfvalue_libcdata.h" #include "libfvalue_libcerror.h" #include "libfvalue_table.h" #include "libfvalue_types.h" #include "libfvalue_value.h" #include "libfvalue_value_type.h" /* Creates a values table * Make sure the value table is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_table_initialize( libfvalue_table_t **table, int number_of_values, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_initialize"; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } if( *table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid table value already set.", function ); return( -1 ); } internal_table = memory_allocate_structure( libfvalue_internal_table_t ); if( internal_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create values table.", function ); goto on_error; } if( memory_set( internal_table, 0, sizeof( libfvalue_internal_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear values table.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_table->values ), number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create values array.", function ); goto on_error; } *table = (libfvalue_table_t *) internal_table; return( 1 ); on_error: if( internal_table != NULL ) { memory_free( internal_table ); } return( -1 ); } /* Frees a table * Returns 1 if successful or -1 on error */ int libfvalue_table_free( libfvalue_table_t **table, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_free"; int result = 1; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table.", function ); return( -1 ); } if( *table != NULL ) { internal_table = (libfvalue_internal_table_t *) *table; *table = NULL; if( libcdata_array_free( &( internal_table->values ), (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the values array.", function ); result = -1; } memory_free( internal_table ); } return( result ); } /* Empties the values table * Returns 1 if successful or -1 on error */ int libfvalue_table_empty( libfvalue_table_t *table, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_empty"; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( libcdata_array_empty( internal_table->values, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty values array.", function ); return( -1 ); } return( 1 ); } /* Resizes the values table * Returns 1 if successful or -1 on error */ int libfvalue_table_resize( libfvalue_table_t *table, int number_of_values, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_resize"; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( libcdata_array_resize( internal_table->values, number_of_values, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize values array.", function ); return( -1 ); } return( 1 ); } /* Clones a table * Returns 1 if successful or -1 on error */ int libfvalue_table_clone( libfvalue_table_t **destination_table, libfvalue_table_t *source_table, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_destination_table = NULL; libfvalue_internal_table_t *internal_source_table = NULL; static char *function = "libfvalue_table_clone"; if( destination_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination table.", function ); return( -1 ); } if( *destination_table != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination table already set.", function ); return( -1 ); } if( source_table == NULL ) { *destination_table = NULL; return( 1 ); } internal_source_table = (libfvalue_internal_table_t *) source_table; internal_destination_table = memory_allocate_structure( libfvalue_internal_table_t ); if( internal_destination_table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination values table.", function ); goto on_error; } if( memory_set( internal_destination_table, 0, sizeof( libfvalue_internal_table_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination values table.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_table->values ), internal_source_table->values, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **) ) &libfvalue_value_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination values array.", function ); goto on_error; } *destination_table = (libfvalue_table_t *) internal_destination_table; return( 1 ); on_error: if( internal_destination_table != NULL ) { memory_free( internal_destination_table ); } return( -1 ); } /* Retrieves the number of values * Returns 1 if successful or -1 on error */ int libfvalue_table_get_number_of_values( libfvalue_table_t *table, int *number_of_values, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_get_number_of_values"; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( libcdata_array_get_number_of_entries( internal_table->values, number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries in the values array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the index for an identifier * * When LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH is set a match * of the first part of the identifier is allowed. * * Returns 1 if successful, 0 if no index was found or -1 on error */ int libfvalue_table_get_index_by_identifier( libfvalue_table_t *table, const uint8_t *identifier, size_t identifier_size, int *value_index, uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; libfvalue_internal_value_t *internal_value = NULL; static char *function = "libfvalue_table_get_index_by_identifier"; size_t compare_size = 0; int number_of_values = 0; int result = 0; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid identifier.", function ); return( -1 ); } if( ( identifier_size == 0 ) || ( identifier_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid identifier size value out of bounds.", function ); return( -1 ); } if( value_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value index.", function ); return( -1 ); } if( ( flags & ~( LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function, flags ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_table->values, &number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries in the values array.", function ); return( -1 ); } for( *value_index = 0; *value_index < number_of_values; *value_index += 1 ) { if( libcdata_array_get_entry_by_index( internal_table->values, *value_index, (intptr_t **) &internal_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values array.", function, *value_index ); return( -1 ); } if( internal_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing internal value.", function ); return( -1 ); } if( ( flags & LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH ) == 0 ) { if( internal_value->identifier_size != identifier_size ) { continue; } } if( internal_value->identifier_size <= identifier_size ) { compare_size = internal_value->identifier_size; } else { compare_size = identifier_size; } result = memory_compare( internal_value->identifier, identifier, compare_size ); if( result == 0 ) { return( 1 ); } } return( 0 ); } /* Retrieves a specific value * Returns 1 if successful or -1 on error */ int libfvalue_table_get_value_by_index( libfvalue_table_t *table, int value_index, libfvalue_value_t **value, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_get_value_by_index"; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( libcdata_array_get_entry_by_index( internal_table->values, value_index, (intptr_t **) value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values array.", function, value_index ); return( -1 ); } return( 1 ); } /* Retrieves a value for the specific identifier * * When LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH is set a match * of the first part of the identifier is allowed. * * Returns 1 if successful, 0 if value not available or -1 on error */ int libfvalue_table_get_value_by_identifier( libfvalue_table_t *table, const uint8_t *identifier, size_t identifier_size, libfvalue_value_t **value, uint8_t flags, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; static char *function = "libfvalue_table_get_value_by_identifier"; int value_index = 0; int result = 0; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } result = libfvalue_table_get_index_by_identifier( table, identifier, identifier_size, &value_index, flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to find index for: %s.", function, identifier ); return( -1 ); } else if( result != 0 ) { if( libcdata_array_get_entry_by_index( internal_table->values, value_index, (intptr_t **) value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values array.", function, value_index ); return( -1 ); } } return( result ); } /* Sets a specific value * Frees the stored value if necessary * Returns 1 if successful or -1 on error */ int libfvalue_table_set_value_by_index( libfvalue_table_t *table, int value_index, libfvalue_value_t *value, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; libfvalue_value_t *stored_value = NULL; static char *function = "libfvalue_table_set_value_by_index"; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( libcdata_array_get_entry_by_index( internal_table->values, value_index, (intptr_t **) &stored_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values array.", function, value_index ); return( -1 ); } if( ( stored_value != NULL ) && ( stored_value != value ) ) { if( libfvalue_value_free( &stored_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value: %d.", function, value_index ); return( -1 ); } } if( libcdata_array_set_entry_by_index( internal_table->values, value_index, (intptr_t *) value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values array.", function, value_index ); return( -1 ); } return( 1 ); } /* Sets a value in the values table * This function appends a new value or replaces an existing value * Returns 1 if successful or -1 on error */ int libfvalue_table_set_value( libfvalue_table_t *table, libfvalue_value_t *value, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; libfvalue_internal_value_t *internal_value = NULL; libfvalue_value_t *stored_value = NULL; static char *function = "libfvalue_table_set_value"; int value_index = 0; int result = 0; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } internal_value = (libfvalue_internal_value_t *) value; result = libfvalue_table_get_index_by_identifier( table, internal_value->identifier, internal_value->identifier_size, &value_index, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to find index for: %s.", function, (char *) internal_value->identifier ); return( -1 ); } else if( result == 0 ) { if( libcdata_array_insert_entry( internal_table->values, &value_index, (intptr_t *) value, &libfvalue_compare_identifier, LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert value: %s in values array.", function, (char *) internal_value->identifier ); return( -1 ); } } else { if( libcdata_array_get_entry_by_index( internal_table->values, value_index, (intptr_t **) &stored_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values array.", function, value_index ); return( -1 ); } if( ( stored_value != NULL ) && ( stored_value != value ) ) { if( libcdata_array_set_entry_by_index( internal_table->values, value_index, (intptr_t *) value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in values array.", function, value_index ); return( -1 ); } if( libfvalue_value_free( &stored_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value: %d.", function, value_index ); return( -1 ); } } } return( 1 ); } enum LIBFVALUE_XML_TAG_TYPES { LIBFVALUE_XML_TAG_TYPE_CLOSE = (uint8_t) 'c', LIBFVALUE_XML_TAG_TYPE_OPEN = (uint8_t) 'o' }; /* Copies the values table from an UTF-8 encoded XML string * Returns 1 if successful, 0 if the requested section could not be found or -1 on error */ int libfvalue_table_copy_from_utf8_xml_string( libfvalue_table_t *table, const uint8_t *utf8_string, size_t utf8_string_size, const uint8_t *table_name, size_t table_name_length, libcerror_error_t **error ) { libfvalue_internal_table_t *internal_table = NULL; libfvalue_value_t *value = NULL; uint8_t *value_data = NULL; uint8_t *value_identifier = NULL; const uint8_t *xml_table_name = NULL; const uint8_t *xml_tag_data = NULL; const uint8_t *xml_tag_name = NULL; static char *function = "libfvalue_table_copy_from_utf8_xml_string"; size_t string_index = 0; size_t value_identifier_length = 0; size_t value_data_length = 0; size_t xml_table_name_length = 0; size_t xml_tag_name_length = 0; uint8_t xml_tag_type = 0; int result = 0; int value_index = 0; if( table == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values table.", function ); return( -1 ); } internal_table = (libfvalue_internal_table_t *) table; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string size value out of bounds.", function ); return( -1 ); } if( table_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid table name.", function ); return( -1 ); } if( table_name_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid table name size value out of bounds.", function ); return( -1 ); } #ifdef TODO if( libcdata_array_empty( internal_table->values, (int (*)(intptr_t **, libcerror_error_t **)) &libfvalue_value_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty values array.", function ); return( -1 ); } #endif /* TODO check for "\n"; */ /* Note that below numeric values for the characters are used to prevent * platform specific values being assigned */ while( string_index < utf8_string_size ) { /* Look for the start of the XML tag: '<' */ if( utf8_string[ string_index++ ] != 0x3c ) { continue; } /* Determine if the XML tag is an open or close tag: '/' */ if( utf8_string[ string_index ] != 0x2f ) { xml_tag_type = LIBFVALUE_XML_TAG_TYPE_OPEN; } else { xml_tag_type = LIBFVALUE_XML_TAG_TYPE_CLOSE; string_index++; } xml_tag_name = &( utf8_string[ string_index ] ); xml_tag_name_length = 0; while( string_index < utf8_string_size ) { /* The XML tag name should only consists of: [A-Za-z0-9_] */ if( ( ( utf8_string[ string_index ] >= 0x41 ) && ( utf8_string[ string_index ] <= 0x5a ) ) || ( ( utf8_string[ string_index ] >= 0x61 ) && ( utf8_string[ string_index ] <= 0x7a ) ) || ( ( utf8_string[ string_index ] >= 0x30 ) && ( utf8_string[ string_index ] <= 0x39 ) ) || ( utf8_string[ string_index ] == 0x5f ) ) { xml_tag_name_length++; } else { break; } string_index++; } /* TODO add support for XML tag attributes but ignore them for now */ while( string_index < utf8_string_size ) { /* Look for the end of the XML tag: '>' */ if( utf8_string[ string_index ] == 0x3e ) { break; } string_index++; } /* Look for the end of the XML tag: '>' */ if( utf8_string[ string_index++ ] != 0x3e ) { continue; } if( ( xml_tag_name == NULL ) || ( xml_tag_name_length == 0 ) ) { continue; } if( xml_table_name == NULL ) { if( ( xml_tag_type == LIBFVALUE_XML_TAG_TYPE_OPEN ) && ( xml_tag_name_length == table_name_length ) && ( narrow_string_compare( table_name, xml_tag_name, xml_tag_name_length ) == 0 ) ) { xml_table_name = xml_tag_name; xml_table_name_length = xml_tag_name_length; } } else if( value_identifier == NULL ) { if( ( xml_tag_type == LIBFVALUE_XML_TAG_TYPE_CLOSE ) && ( xml_tag_name_length == xml_table_name_length ) && ( narrow_string_compare( xml_table_name, xml_tag_name, xml_tag_name_length ) == 0 ) ) { xml_table_name = NULL; result = 1; break; } else if( xml_tag_type == LIBFVALUE_XML_TAG_TYPE_OPEN ) { value_identifier_length = xml_tag_name_length; value_identifier = (uint8_t *) memory_allocate( sizeof( uint8_t ) * ( value_identifier_length + 1 ) ); if( value_identifier == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create value identifier.", function ); goto on_error; } if( memory_copy( value_identifier, xml_tag_name, value_identifier_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear values table.", function ); goto on_error; } value_identifier[ value_identifier_length ] = 0; xml_tag_data = &( utf8_string[ string_index ] ); } } else { if( ( xml_tag_type == LIBFVALUE_XML_TAG_TYPE_CLOSE ) && ( xml_tag_name_length == value_identifier_length ) && ( narrow_string_compare( value_identifier, xml_tag_name, xml_tag_name_length ) == 0 ) ) { result = libfvalue_table_get_index_by_identifier( table, value_identifier, value_identifier_length + 1, &value_index, 0, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to find index for: %s.", function, (char *) value_identifier ); goto on_error; } else if( result == 0 ) { if( libfvalue_value_type_initialize( &value, LIBFVALUE_VALUE_TYPE_STRING_UTF8, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create value: %s.", function, (char *) value_identifier ); goto on_error; } if( libfvalue_value_set_identifier( value, value_identifier, value_identifier_length + 1, LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set identifier in value: %s.", function, (char *) value_identifier ); libfvalue_value_free( &value, NULL ); goto on_error; } if( libcdata_array_insert_entry( internal_table->values, &value_index, (intptr_t *) value, &libfvalue_compare_identifier, LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert value: %s in values array.", function, (char *) value_identifier ); libfvalue_value_free( &value, NULL ); goto on_error; } } else { if( libcdata_array_get_entry_by_index( internal_table->values, value_index, (intptr_t **) &value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from values array.", function, value_index ); goto on_error; } } /* Note that the XML tag name of the closing tag is preceded by * 2 characters ' * * 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( _LIBFVALUE_LIBFGUID_H ) #define _LIBFVALUE_LIBFGUID_H #include /* Define HAVE_LOCAL_LIBFGUID for local use of libfguid */ #if defined( HAVE_LOCAL_LIBFGUID ) #include #include #include /* Note that libfvalue does not require to have libfguid support */ #elif defined( HAVE_LIBFGUID_H ) /* If libtool DLL support is enabled set LIBFGUID_DLL_IMPORT * before including libfguid.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFGUID_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFGUID ) */ #endif /* !defined( _LIBFVALUE_LIBFGUID_H ) */ libewf-20140807/libfvalue/libfvalue_string.h0000664000175000017500000001054513443450055023022 0ustar00lordyestalordyesta00000000000000/* * String value functions * * Copyright (C) 2010-2018, 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( _LIBVALUE_STRING_H ) #define _LIBVALUE_STRING_H #include #include #include "libfvalue_definitions.h" #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( _cplusplus ) extern "C" { #endif typedef struct libfvalue_string libfvalue_string_t; struct libfvalue_string { /* The data */ uint8_t *data; /* The data size */ size_t data_size; /* The codepage */ int codepage; /* The flags */ uint8_t flags; }; int libfvalue_string_initialize( libfvalue_string_t **string, libcerror_error_t **error ); int libfvalue_string_free( libfvalue_string_t **string, libcerror_error_t **error ); int libfvalue_string_clone( libfvalue_string_t **destination_string, libfvalue_string_t *source_string, libcerror_error_t **error ); int libfvalue_string_copy_from_byte_stream( libfvalue_string_t *string, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ); int libfvalue_string_copy_from_utf8_string_with_index( libfvalue_string_t *string, const uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_get_utf8_string_size( libfvalue_string_t *string, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_copy_to_utf8_string_with_index( libfvalue_string_t *string, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_copy_from_utf16_string_with_index( libfvalue_string_t *string, const uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_get_utf16_string_size( libfvalue_string_t *string, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_copy_to_utf16_string_with_index( libfvalue_string_t *string, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_copy_from_utf32_string_with_index( libfvalue_string_t *string, const uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_get_utf32_string_size( libfvalue_string_t *string, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_string_copy_to_utf32_string_with_index( libfvalue_string_t *string, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_split( const uint8_t *utf8_string, size_t utf8_string_size, uint8_t delimiter, libfvalue_split_utf8_string_t **split_string, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_split( const uint16_t *utf16_string, size_t utf16_string_size, uint16_t delimiter, libfvalue_split_utf16_string_t **split_string, libcerror_error_t **error ); #if defined( _cplusplus ) } #endif #endif /* !defined( _LIBVALUE_STRING_H ) */ libewf-20140807/libfvalue/libfvalue_table.h0000664000175000017500000000667513443450055022614 0ustar00lordyestalordyesta00000000000000/* * Values table functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_TABLE_H ) #define _LIBFVALUE_INTERNAL_TABLE_H #include #include #include "libfvalue_extern.h" #include "libfvalue_libcdata.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_internal_table libfvalue_internal_table_t; struct libfvalue_internal_table { /* The values array */ libcdata_array_t *values; }; LIBFVALUE_EXTERN \ int libfvalue_table_initialize( libfvalue_table_t **table, int number_of_values, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_free( libfvalue_table_t **table, libcerror_error_t **error ); int libfvalue_table_free_as_value( intptr_t *table, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_empty( libfvalue_table_t *table, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_resize( libfvalue_table_t *table, int number_of_values, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_clone( libfvalue_table_t **destination_table, libfvalue_table_t *source_table, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_get_number_of_values( libfvalue_table_t *table, int *number_of_values, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_get_index_by_identifier( libfvalue_table_t *table, const uint8_t *identifier, size_t identifier_size, int *value_index, uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_get_value_by_index( libfvalue_table_t *table, int value_index, libfvalue_value_t **value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_get_value_by_identifier( libfvalue_table_t *table, const uint8_t *identifier, size_t identifier_size, libfvalue_value_t **value, uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_set_value_by_index( libfvalue_table_t *table, int value_index, libfvalue_value_t *value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_set_value( libfvalue_table_t *table, libfvalue_value_t *value, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_table_copy_from_utf8_xml_string( libfvalue_table_t *table, const uint8_t *utf8_string, size_t utf8_string_size, const uint8_t *table_name, size_t table_name_length, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTERNAL_TABLE_H ) */ libewf-20140807/libfvalue/libfvalue_floating_point.h0000664000175000017500000001671413443450055024534 0ustar00lordyestalordyesta00000000000000/* * Floating point value (IEEE 754) functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_FLOATING_POINT_H ) #define _LIBFVALUE_FLOATING_POINT_H #include #include #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_floating_point libfvalue_floating_point_t; struct libfvalue_floating_point { /* The value */ uint64_t value; /* The value size */ size_t value_size; }; int libfvalue_floating_point_initialize( libfvalue_floating_point_t **floating_point, libcerror_error_t **error ); int libfvalue_floating_point_free( libfvalue_floating_point_t **floating_point, libcerror_error_t **error ); int libfvalue_floating_point_clone( libfvalue_floating_point_t **destination_floating_point, libfvalue_floating_point_t *source_floating_point, libcerror_error_t **error ); int libfvalue_floating_point_copy_from_byte_stream( libfvalue_floating_point_t *floating_point, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ); int libfvalue_floating_point_copy_from_integer( libfvalue_floating_point_t *floating_point, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ); int libfvalue_floating_point_copy_to_integer( libfvalue_floating_point_t *floating_point, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ); int libfvalue_floating_point_copy_from_floating_point( libfvalue_floating_point_t *floating_point, double floating_point_value, size_t floating_point_value_size, libcerror_error_t **error ); int libfvalue_floating_point_copy_to_floating_point( libfvalue_floating_point_t *floating_point, double *floating_point_value, size_t *floating_point_value_size, libcerror_error_t **error ); int libfvalue_floating_point_get_string_size( libfvalue_floating_point_t *floating_point, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_floating_point_copy_from_utf8_string_with_index( libfvalue_floating_point_t *floating_point, uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_floating_point_copy_to_utf8_string_with_index( libfvalue_floating_point_t *floating_point, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_floating_point_copy_from_utf16_string_with_index( libfvalue_floating_point_t *floating_point, uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_floating_point_copy_to_utf16_string_with_index( libfvalue_floating_point_t *floating_point, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_floating_point_copy_from_utf32_string_with_index( libfvalue_floating_point_t *floating_point, uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); int libfvalue_floating_point_copy_to_utf32_string_with_index( libfvalue_floating_point_t *floating_point, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_string_size_from_floating_point( size_t *string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_copy_from_floating_point( uint8_t *utf8_string, size_t utf8_string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_with_index_copy_from_floating_point( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf8_string_with_index_copy_to_floating_point( uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint64_t *floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_copy_from_floating_point( uint16_t *utf16_string, size_t utf16_string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_with_index_copy_from_floating_point( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf16_string_with_index_copy_to_floating_point( uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint64_t *floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_copy_from_floating_point( uint32_t *utf32_string, size_t utf32_string_size, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_with_index_copy_from_floating_point( uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint64_t floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_utf32_string_with_index_copy_to_floating_point( uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint64_t *floating_point_value, size_t floating_point_value_size, uint32_t string_format_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_FLOATING_POINT_H ) */ libewf-20140807/libfvalue/libfvalue_binary_data.c0000664000175000017500000012062113443450055023761 0ustar00lordyestalordyesta00000000000000/* * Binary data value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include "libfvalue_binary_data.h" #include "libfvalue_definitions.h" #include "libfvalue_libcerror.h" #include "libfvalue_libuna.h" /* Creates a binary data * Make sure the value binary_data is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_initialize( libfvalue_binary_data_t **binary_data, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_initialize"; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } if( *binary_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid binary data value already set.", function ); return( -1 ); } *binary_data = memory_allocate_structure( libfvalue_binary_data_t ); if( *binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create binary data.", function ); goto on_error; } if( memory_set( *binary_data, 0, sizeof( libfvalue_binary_data_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear binary data.", function ); goto on_error; } return( 1 ); on_error: if( *binary_data != NULL ) { memory_free( *binary_data ); *binary_data = NULL; } return( -1 ); } /* Frees a binary data * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_free( libfvalue_binary_data_t **binary_data, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_free"; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } if( *binary_data != NULL ) { memory_free( *binary_data ); *binary_data = NULL; } return( 1 ); } /* Clones a binary data * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_clone( libfvalue_binary_data_t **destination_binary_data, libfvalue_binary_data_t *source_binary_data, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_clone"; if( destination_binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination binary data.", function ); return( -1 ); } if( *destination_binary_data != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination binary data already set.", function ); return( -1 ); } if( source_binary_data == NULL ) { *destination_binary_data = NULL; return( 1 ); } *destination_binary_data = memory_allocate_structure( libfvalue_binary_data_t ); if( *destination_binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination binary data.", function ); goto on_error; } if( memory_copy( *destination_binary_data, source_binary_data, sizeof( libfvalue_binary_data_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy binary data.", function ); goto on_error; } return( 1 ); on_error: if( *destination_binary_data != NULL ) { memory_free( *destination_binary_data ); *destination_binary_data = NULL; } return( -1 ); } /* Copies the binary data from a byte stream * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_copy_from_byte_stream( libfvalue_binary_data_t *binary_data, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_copy_from_byte_stream"; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } if( byte_stream == NULL ) { if( byte_stream_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid byte stream size value out of bounds.", function ); return( -1 ); } } else { if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } } if( encoding != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); return( -1 ); } binary_data->data = byte_stream; binary_data->data_size = byte_stream_size; return( 1 ); } /* Retrieves the size of an UTF-8 formatted string of the binary data * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_get_utf8_string_size( libfvalue_binary_data_t *binary_data, size_t *utf8_string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_get_utf8_string_size"; uint32_t format_flags = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } *utf8_string_size = 0; if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { switch( string_format_type ) { case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16: format_flags = LIBUNA_BASE16_VARIANT_CASE_UPPER | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE; if( libuna_base16_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf8_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-8 string of base16 formatted binary data.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32: format_flags = LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED; if( libuna_base32_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf8_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-8 string of base32 formatted binary data.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64: format_flags = LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED; if( libuna_base64_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf8_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-8 string of base64 formatted binary data.", function ); return( -1 ); } break; } } /* Add space for the end-of-string character */ *utf8_string_size += 1; return( 1 ); } /* Copies the binary data to an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_copy_to_utf8_string_with_index( libfvalue_binary_data_t *binary_data, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_copy_to_utf8_string_with_index"; uint32_t format_flags = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string is too small.", function ); return( -1 ); } if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { switch( string_format_type ) { case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16: format_flags = LIBUNA_BASE16_VARIANT_CASE_UPPER | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE; if( libuna_base16_stream_with_index_copy_from_byte_stream( utf8_string, utf8_string_size, utf8_string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base16 formatted binary data to UTF-8 string.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32: format_flags = LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED; if( libuna_base32_stream_with_index_copy_from_byte_stream( utf8_string, utf8_string_size, utf8_string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base32 formatted binary data to UTF-8 string.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64: format_flags = LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED; if( libuna_base64_stream_with_index_copy_from_byte_stream( utf8_string, utf8_string_size, utf8_string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base64 formatted binary data to UTF-8 string.", function ); return( -1 ); } break; } } utf8_string[ *utf8_string_index ] = 0; *utf8_string_index += 1; return( 1 ); } /* Retrieves the size of an UTF-16 formatted string of the binary data * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_get_utf16_string_size( libfvalue_binary_data_t *binary_data, size_t *utf16_string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_get_utf16_string_size"; uint32_t format_flags = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( utf16_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string size.", function ); return( -1 ); } *utf16_string_size = 0; if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { switch( string_format_type ) { case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16: format_flags = LIBUNA_BASE16_VARIANT_CASE_UPPER | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base16_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf16_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-16 string of base16 formatted binary data.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32: format_flags = LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base32_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf16_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-16 string of base32 formatted binary data.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64: format_flags = LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base64_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf16_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-16 string of base64 formatted binary data.", function ); return( -1 ); } break; } /* The size returned is the size of the byte stream and the size needed * should be the number of characters */ *utf16_string_size /= sizeof( uint16_t ); } /* Add space for the end-of-string character */ *utf16_string_size += 1; return( 1 ); } /* Copies the binary data to an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_copy_to_utf16_string_with_index( libfvalue_binary_data_t *binary_data, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_copy_to_utf16_string_with_index"; size_t string_index = 0; size_t string_size = 0; uint32_t format_flags = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index > utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string is too small.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string is too small.", function ); return( -1 ); } if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { string_index = *utf16_string_index * sizeof( uint16_t ); string_size = utf16_string_size * sizeof( uint16_t ); switch( string_format_type ) { case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16: format_flags = LIBUNA_BASE16_VARIANT_CASE_UPPER | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF16_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base16_stream_with_index_copy_from_byte_stream( (uint8_t *) utf16_string, string_size, &string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base16 formatted binary data to UTF-16 string.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32: format_flags = LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF16_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base32_stream_with_index_copy_from_byte_stream( (uint8_t *) utf16_string, string_size, &string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base32 formatted binary data to UTF-16 string.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64: format_flags = LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF16_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base64_stream_with_index_copy_from_byte_stream( (uint8_t *) utf16_string, string_size, &string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base64 formatted binary data to UTF-16 string.", function ); return( -1 ); } break; } *utf16_string_index = string_index / sizeof( uint16_t ); } utf16_string[ *utf16_string_index ] = 0; *utf16_string_index += 1; return( 1 ); } /* Retrieves the size of an UTF-32 formatted string of the binary data * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_get_utf32_string_size( libfvalue_binary_data_t *binary_data, size_t *utf32_string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_get_utf32_string_size"; uint32_t format_flags = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( utf32_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string size.", function ); return( -1 ); } *utf32_string_size = 0; if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { switch( string_format_type ) { case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16: format_flags = LIBUNA_BASE16_VARIANT_CASE_UPPER | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base16_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf32_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-32 string of base16 formatted binary data.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32: format_flags = LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base32_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf32_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-32 string of base32 formatted binary data.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64: format_flags = LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base64_stream_size_from_byte_stream( binary_data->data, binary_data->data_size, utf32_string_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine size of UTF-32 string of base64 formatted binary data.", function ); return( -1 ); } break; } /* The size returned is the size of the byte stream and the size needed * should be the number of characters */ *utf32_string_size /= sizeof( uint32_t ); } /* Add space for the end-of-string character */ *utf32_string_size += 1; return( 1 ); } /* Copies the binary data to an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_binary_data_copy_to_utf32_string_with_index( libfvalue_binary_data_t *binary_data, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_binary_data_copy_to_utf32_string_with_index"; size_t string_index = 0; size_t string_size = 0; uint32_t format_flags = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; if( binary_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid binary data.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index > utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string is too small.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string is too small.", function ); return( -1 ); } if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { string_index = *utf32_string_index * sizeof( uint32_t ); string_size = utf32_string_size * sizeof( uint32_t ); switch( string_format_type ) { case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16: format_flags = LIBUNA_BASE16_VARIANT_CASE_UPPER | LIBUNA_BASE16_VARIANT_CHARACTER_LIMIT_NONE; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF32_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE16_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base16_stream_with_index_copy_from_byte_stream( (uint8_t *) utf32_string, string_size, &string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base16 formatted binary data to UTF-32 string.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32: format_flags = LIBUNA_BASE32_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE32_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE32_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF32_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE32_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base32_stream_with_index_copy_from_byte_stream( (uint8_t *) utf32_string, string_size, &string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base32 formatted binary data to UTF-32 string.", function ); return( -1 ); } break; case LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64: format_flags = LIBUNA_BASE64_VARIANT_ALPHABET_NORMAL | LIBUNA_BASE64_VARIANT_CHARACTER_LIMIT_NONE | LIBUNA_BASE64_VARIANT_PADDING_REQUIRED; if( _BYTE_STREAM_HOST_IS_ENDIAN_BIG ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF32_BIG_ENDIAN; } else if( _BYTE_STREAM_HOST_IS_ENDIAN_LITTLE ) { format_flags |= LIBUNA_BASE64_VARIANT_ENCODING_UTF32_LITTLE_ENDIAN; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported host byte order.", function ); return( -1 ); } if( libuna_base64_stream_with_index_copy_from_byte_stream( (uint8_t *) utf32_string, string_size, &string_index, binary_data->data, binary_data->data_size, format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy base64 formatted binary data to UTF-32 string.", function ); return( -1 ); } break; } *utf32_string_index = string_index / sizeof( uint32_t ); } utf32_string[ *utf32_string_index ] = 0; *utf32_string_index += 1; return( 1 ); } libewf-20140807/libfvalue/libfvalue_filetime.h0000664000175000017500000000314313443450055023306 0ustar00lordyestalordyesta00000000000000/* * Filetime functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_FILETIME_H ) #define _LIBFVALUE_FILETIME_H #include #include #include "libfvalue_libcerror.h" #include "libfvalue_libfdatetime.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) int libfvalue_filetime_copy_from_integer( libfdatetime_filetime_t *filetime, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ); int libfvalue_filetime_copy_to_integer( libfdatetime_filetime_t *filetime, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ); #endif /* defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_FILETIME_H ) */ libewf-20140807/libfvalue/libfvalue_integer.c0000664000175000017500000021200713443450055023141 0ustar00lordyestalordyesta00000000000000/* * Integer value functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include #include "libfvalue_definitions.h" #include "libfvalue_integer.h" #include "libfvalue_libcerror.h" /* Creates an integer * Make sure the value integer is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfvalue_integer_initialize( libfvalue_integer_t **integer, libcerror_error_t **error ) { static char *function = "libfvalue_integer_initialize"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( *integer != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid integer value already set.", function ); return( -1 ); } *integer = memory_allocate_structure( libfvalue_integer_t ); if( *integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create integer.", function ); goto on_error; } if( memory_set( *integer, 0, sizeof( libfvalue_integer_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear integer.", function ); goto on_error; } return( 1 ); on_error: if( *integer != NULL ) { memory_free( *integer ); *integer = NULL; } return( -1 ); } /* Frees an integer * Returns 1 if successful or -1 on error */ int libfvalue_integer_free( libfvalue_integer_t **integer, libcerror_error_t **error ) { static char *function = "libfvalue_integer_free"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( *integer != NULL ) { memory_free( *integer ); *integer = NULL; } return( 1 ); } /* Clones an integer * Returns 1 if successful or -1 on error */ int libfvalue_integer_clone( libfvalue_integer_t **destination_integer, libfvalue_integer_t *source_integer, libcerror_error_t **error ) { static char *function = "libfvalue_integer_clone"; if( destination_integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination integer.", function ); return( -1 ); } if( *destination_integer != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination integer already set.", function ); return( -1 ); } if( source_integer == NULL ) { *destination_integer = NULL; return( 1 ); } *destination_integer = memory_allocate_structure( libfvalue_integer_t ); if( *destination_integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination integer.", function ); goto on_error; } if( memory_copy( *destination_integer, source_integer, sizeof( libfvalue_integer_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy integer.", function ); goto on_error; } return( 1 ); on_error: if( *destination_integer != NULL ) { memory_free( *destination_integer ); *destination_integer = NULL; } return( -1 ); } /* Copies the integer from a byte stream * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_from_byte_stream( libfvalue_integer_t *integer, const uint8_t *byte_stream, size_t byte_stream_size, int encoding, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_from_byte_stream"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( byte_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte stream.", function ); return( -1 ); } if( byte_stream_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid byte stream size value exceeds maximum.", function ); return( -1 ); } if( ( encoding != LIBFVALUE_ENDIAN_BIG ) && ( encoding != LIBFVALUE_ENDIAN_LITTLE ) && ( encoding != LIBFVALUE_ENDIAN_NATIVE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported encoding.", function ); return( -1 ); } switch( byte_stream_size ) { case 1: integer->value = (uint64_t) *( (uint8_t *) byte_stream ); break; case 2: if( encoding == LIBFVALUE_ENDIAN_BIG ) { byte_stream_copy_to_uint16_big_endian( byte_stream, integer->value ); } else if( encoding == LIBFVALUE_ENDIAN_LITTLE ) { byte_stream_copy_to_uint16_little_endian( byte_stream, integer->value ); } else { integer->value = (uint64_t) *( (uint16_t *) byte_stream ); } break; case 4: if( encoding == LIBFVALUE_ENDIAN_BIG ) { byte_stream_copy_to_uint32_big_endian( byte_stream, integer->value ); } else if( encoding == LIBFVALUE_ENDIAN_LITTLE ) { byte_stream_copy_to_uint32_little_endian( byte_stream, integer->value ); } else { integer->value = (uint64_t) *( (uint32_t *) byte_stream ); } break; case 8: if( encoding == LIBFVALUE_ENDIAN_BIG ) { byte_stream_copy_to_uint64_big_endian( byte_stream, integer->value ); } else if( encoding == LIBFVALUE_ENDIAN_LITTLE ) { byte_stream_copy_to_uint64_little_endian( byte_stream, integer->value ); } else { integer->value = (uint64_t) *( (uint64_t *) byte_stream ); } break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte stream size: %" PRIzd ".", function, byte_stream_size ); return( -1 ); } integer->value_size = byte_stream_size * 8; return( 1 ); } /* Copies the integer from an integer value * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_from_integer( libfvalue_integer_t *integer, uint64_t integer_value, size_t integer_value_size, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_from_integer"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } integer->value = integer_value; integer->value_size = integer_value_size; return( 1 ); } /* Copies the integer to an integer value * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_to_integer( libfvalue_integer_t *integer, uint64_t *integer_value, size_t *integer_value_size, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_to_integer"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( integer_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value.", function ); return( -1 ); } if( integer_value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value size.", function ); return( -1 ); } *integer_value = integer->value; *integer_value_size = integer->value_size; return( 1 ); } /* Retrieves the size of a string of the integer * Returns 1 if successful or -1 on error */ int libfvalue_integer_get_string_size( libfvalue_integer_t *integer, size_t *string_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_get_string_size"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_string_size_from_integer( string_size, integer->value, integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to determine size of string of %" PRIzd "-bit integer.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Copies the integer from an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_from_utf8_string_with_index( libfvalue_integer_t *integer, uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_from_utf8_string_with_index"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_utf8_string_with_index_copy_to_integer( utf8_string, utf8_string_length, utf8_string_index, &( integer->value ), integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit integer from UTF-8 string.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Copies the integer to an UTF-8 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_to_utf8_string_with_index( libfvalue_integer_t *integer, uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_to_utf8_string_with_index"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, utf8_string_index, integer->value, integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit integer to UTF-8 string.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Copies the integer from an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_from_utf16_string_with_index( libfvalue_integer_t *integer, uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_from_utf16_string_with_index"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_utf16_string_with_index_copy_to_integer( utf16_string, utf16_string_length, utf16_string_index, &( integer->value ), integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit integer from UTF-16 string.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Copies the integer to an UTF-16 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_to_utf16_string_with_index( libfvalue_integer_t *integer, uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_to_utf16_string_with_index"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, utf16_string_index, integer->value, integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit integer to UTF-16 string.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Copies the integer from an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_from_utf32_string_with_index( libfvalue_integer_t *integer, uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_from_utf32_string_with_index"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_utf32_string_with_index_copy_to_integer( utf32_string, utf32_string_length, utf32_string_index, &( integer->value ), integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit integer from UTF-32 string.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Copies the integer to an UTF-32 encoded string * Returns 1 if successful or -1 on error */ int libfvalue_integer_copy_to_utf32_string_with_index( libfvalue_integer_t *integer, uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_integer_copy_to_utf32_string_with_index"; if( integer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer.", function ); return( -1 ); } if( libfvalue_utf32_string_with_index_copy_from_integer( utf32_string, utf32_string_size, utf32_string_index, integer->value, integer->value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy %" PRIzd "-bit integer to UTF-32 string.", function, integer->value_size ); return( -1 ); } return( 1 ); } /* Determines the size of a string of an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_string_size_from_integer( size_t *string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_string_size_from_integer"; uint64_t divider = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t is_signed = 0; int8_t bit_shift = 0; if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { *string_size = 6; } else { *string_size = 5; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { *string_size = ( integer_value_size >> 2 ) + 1; if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { *string_size += 2; } } else { /* The string is at least a single digit with an end of string character */ *string_size = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { is_signed = (uint8_t) ( integer_value >> bit_shift ); if( is_signed != 0 ) { *string_size += 1; integer_value &= ~( (uint64_t) 1 << bit_shift ); if( integer_value == 0 ) { integer_value |= (uint64_t) 1 << bit_shift; } } } divider = 1; while( ( integer_value / divider ) >= 10 ) { divider *= 10; *string_size += 1; } } return( 1 ); } /* Copies an UTF-8 encoded string from an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_copy_from_integer( uint8_t *utf8_string, size_t utf8_string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf8_string_copy_from_integer"; size_t utf8_string_index = 0; if( libfvalue_utf8_string_with_index_copy_from_integer( utf8_string, utf8_string_size, &utf8_string_index, integer_value, integer_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy integer value to UTF-8 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 encoded string of from integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_with_index_copy_from_integer( uint8_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf8_string_with_index_copy_from_integer"; size_t safe_utf8_string_index = 0; uint64_t divider = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t is_signed = 0; uint8_t number_of_characters = 0; int8_t bit_shift = 0; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } safe_utf8_string_index = *utf8_string_index; if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { number_of_characters = 6; } else { number_of_characters = 5; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { number_of_characters = (uint8_t) ( integer_value_size >> 2 ) + 1; if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { number_of_characters += 2; } } else { /* The string is at least a single digit with an end of string character */ number_of_characters = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { is_signed = (uint8_t) ( integer_value >> bit_shift ); if( is_signed != 0 ) { number_of_characters += 1; integer_value &= ~( (uint64_t) 1 << bit_shift ); if( integer_value == 0 ) { integer_value |= (uint64_t) 1 << bit_shift; } } } divider = 1; while( ( integer_value / divider ) >= 10 ) { divider *= 10; number_of_characters += 1; } } if( ( number_of_characters > utf8_string_size ) || ( safe_utf8_string_index > ( utf8_string_size - number_of_characters ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string size too small.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'f'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'a'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'l'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 's'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'e'; } else { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 't'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'r'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'u'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'e'; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0'; utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'x'; } bit_shift = (uint8_t) ( integer_value_size - 4 ); do { byte_value = (uint8_t) ( ( integer_value >> bit_shift ) & 0x0f ); if( byte_value <= 9 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0' + byte_value; } else { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) 'a' + byte_value - 10; } bit_shift -= 4; } while( bit_shift >= 0 ); } else { if( is_signed != 0 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '-'; } while( divider > 1 ) { utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0' + (uint8_t) ( integer_value / divider ); integer_value %= divider; divider /= 10; } utf8_string[ safe_utf8_string_index++ ] = (uint8_t) '0' + (uint8_t) ( integer_value / divider ); } utf8_string[ safe_utf8_string_index++ ] = 0; *utf8_string_index = safe_utf8_string_index; return( 1 ); } /* Copies an UTF-8 encoded string to an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_copy_to_integer( const uint8_t *utf8_string, size_t utf8_string_length, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf8_string_copy_to_integer"; size_t utf8_string_index = 0; if( libfvalue_utf8_string_with_index_copy_to_integer( utf8_string, utf8_string_length, &utf8_string_index, integer_value, integer_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-8 string to integer value.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-8 encoded string to an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf8_string_with_index_copy_to_integer( const uint8_t *utf8_string, size_t utf8_string_length, size_t *utf8_string_index, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf8_string_with_index_copy_to_integer"; size_t maximum_string_index = 0; size_t safe_utf8_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string index.", function ); return( -1 ); } if( *utf8_string_index >= utf8_string_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-8 string index value out of bounds.", function ); return( -1 ); } safe_utf8_string_index = *utf8_string_index; if( integer_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value.", function ); return( -1 ); } if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { maximum_string_index = 5; } else { maximum_string_index = 4; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { maximum_string_index = (size_t) ( integer_value_size >> 2 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { maximum_string_index += 2; } } else { /* The string is at least a single digit with an end of string character */ maximum_string_index = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); divider = 1; value_64bit = ~( ( ~( (uint64_t) 1 << bit_shift ) >> bit_shift ) << bit_shift ); while( ( value_64bit / divider ) >= 10 ) { divider *= 10; maximum_string_index += 1; } } maximum_string_index += safe_utf8_string_index; if( maximum_string_index > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum string index value exceeds maximum.", function ); return( -1 ); } value_64bit = 0; if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { /* TODO */ } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { character_value = utf8_string[ safe_utf8_string_index++ ]; if( character_value != (uint8_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } character_value = utf8_string[ safe_utf8_string_index++ ]; if( character_value != (uint8_t) 'x' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } } while( safe_utf8_string_index < utf8_string_length ) { character_value = utf8_string[ safe_utf8_string_index ]; if( character_value == 0 ) { break; } if( safe_utf8_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit <<= 4; if( ( character_value >= (uint8_t) '0' ) && ( character_value <= (uint8_t) '9' ) ) { byte_value = character_value - (uint8_t) '0'; } else if( ( character_value >= (uint8_t) 'A' ) && ( character_value <= (uint8_t) 'F' ) ) { byte_value = character_value - (uint8_t) 'A' + 10; } else if( ( character_value >= (uint8_t) 'a' ) && ( character_value <= (uint8_t) 'f' ) ) { byte_value = character_value - (uint8_t) 'a' + 10; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } value_64bit += byte_value; safe_utf8_string_index++; } } else { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { character_value = utf8_string[ safe_utf8_string_index ]; /* In the maximum possible string one character is substituted for the sign */ if( character_value == (uint8_t) '-' ) { safe_utf8_string_index++; sign = -1; } else if( character_value == (uint8_t) '+' ) { safe_utf8_string_index++; } } while( safe_utf8_string_index < utf8_string_length ) { character_value = utf8_string[ safe_utf8_string_index ]; if( character_value == 0 ) { break; } if( safe_utf8_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit *= 10; if( ( character_value < (uint8_t) '0' ) || ( character_value > (uint8_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x%02" PRIx8 " at index: %d.", function, character_value, safe_utf8_string_index ); return( -1 ); } character_value -= (uint8_t) '0'; value_64bit += character_value; safe_utf8_string_index++; } if( sign == -1 ) { value_64bit |= (uint64_t) 1 << bit_shift; } } *utf8_string_index = safe_utf8_string_index; *integer_value = value_64bit; return( 1 ); } /* Copies an UTF-16 encoded string of an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_copy_from_integer( uint16_t *utf16_string, size_t utf16_string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf16_string_copy_from_integer"; size_t utf16_string_index = 0; if( libfvalue_utf16_string_with_index_copy_from_integer( utf16_string, utf16_string_size, &utf16_string_index, integer_value, integer_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy integer value to UTF-16 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 encoded string of an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_with_index_copy_from_integer( uint16_t *utf16_string, size_t utf16_string_size, size_t *utf16_string_index, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf16_string_with_index_copy_from_integer"; size_t safe_utf16_string_index = 0; uint64_t divider = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t is_signed = 0; uint8_t number_of_characters = 0; int8_t bit_shift = 0; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } safe_utf16_string_index = *utf16_string_index; if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { number_of_characters = 6; } else { number_of_characters = 5; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { number_of_characters = (uint8_t) ( integer_value_size >> 2 ) + 1; if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { number_of_characters += 2; } } else { /* The string is at least a single digit with an end of string character */ number_of_characters = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { is_signed = (uint8_t) ( integer_value >> bit_shift ); if( is_signed != 0 ) { number_of_characters += 1; integer_value &= ~( (uint64_t) 1 << bit_shift ); if( integer_value == 0 ) { integer_value |= (uint64_t) 1 << bit_shift; } } } divider = 1; while( ( integer_value / divider ) >= 10 ) { divider *= 10; number_of_characters += 1; } } if( ( number_of_characters > utf16_string_size ) || ( safe_utf16_string_index > ( utf16_string_size - number_of_characters ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-16 string size too small.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'f'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'a'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'l'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 's'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'e'; } else { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 't'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'r'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'u'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'e'; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'x'; } bit_shift = (uint8_t) ( integer_value_size - 4 ); do { byte_value = (uint16_t) ( ( integer_value >> bit_shift ) & 0x0f ); if( byte_value <= 9 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0' + byte_value; } else { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'a' + byte_value - 10; } bit_shift -= 4; } while( bit_shift >= 0 ); } else { if( is_signed != 0 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '-'; } while( divider > 1 ) { utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0' + (uint16_t) ( integer_value / divider ); integer_value %= divider; divider /= 10; } utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0' + (uint16_t) ( integer_value / divider ); } utf16_string[ safe_utf16_string_index++ ] = 0; *utf16_string_index = safe_utf16_string_index; return( 1 ); } /* Copies an UTF-16 encoded string to an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_copy_to_integer( const uint16_t *utf16_string, size_t utf16_string_length, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf16_string_copy_to_integer"; size_t utf16_string_index = 0; if( libfvalue_utf16_string_with_index_copy_to_integer( utf16_string, utf16_string_length, &utf16_string_index, integer_value, integer_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-16 string to integer value.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-16 encoded string to an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf16_string_with_index_copy_to_integer( const uint16_t *utf16_string, size_t utf16_string_length, size_t *utf16_string_index, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf16_string_with_index_copy_to_integer"; size_t maximum_string_index = 0; size_t safe_utf16_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; if( utf16_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string.", function ); return( -1 ); } if( utf16_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-16 string size value exceeds maximum.", function ); return( -1 ); } if( utf16_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-16 string index.", function ); return( -1 ); } if( *utf16_string_index >= utf16_string_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-16 string index value out of bounds.", function ); return( -1 ); } safe_utf16_string_index = *utf16_string_index; if( integer_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value.", function ); return( -1 ); } if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { maximum_string_index = 5; } else { maximum_string_index = 4; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { maximum_string_index = (size_t) ( integer_value_size >> 2 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { maximum_string_index += 2; } } else { /* The string is at least a single digit with an end of string character */ maximum_string_index = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); divider = 1; value_64bit = ~( ( ~( (uint64_t) 1 << bit_shift ) >> bit_shift ) << bit_shift ); while( ( value_64bit / divider ) >= 10 ) { divider *= 10; maximum_string_index += 1; } } maximum_string_index += safe_utf16_string_index; if( maximum_string_index > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum string index value exceeds maximum.", function ); return( -1 ); } value_64bit = 0; if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { /* TODO */ } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { character_value = utf16_string[ safe_utf16_string_index++ ]; if( character_value != (uint16_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x04%" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } character_value = utf16_string[ safe_utf16_string_index++ ]; if( character_value != (uint16_t) 'x' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x04%" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } } while( safe_utf16_string_index < utf16_string_length ) { character_value = utf16_string[ safe_utf16_string_index ]; if( character_value == 0 ) { break; } if( safe_utf16_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit <<= 4; if( ( character_value >= (uint16_t) '0' ) && ( character_value <= (uint16_t) '9' ) ) { byte_value = (uint8_t) ( character_value - (uint16_t) '0' ); } else if( ( character_value >= (uint16_t) 'A' ) && ( character_value <= (uint16_t) 'F' ) ) { byte_value = (uint8_t) ( character_value - (uint16_t) 'A' + 10 ); } else if( ( character_value >= (uint16_t) 'a' ) && ( character_value <= (uint16_t) 'f' ) ) { byte_value = (uint8_t) ( character_value - (uint16_t) 'a' + 10 ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x04%" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } value_64bit += byte_value; safe_utf16_string_index++; } } else { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { character_value = utf16_string[ safe_utf16_string_index ]; /* In the maximum possible string one character is substituted for the sign */ if( character_value == (uint16_t) '-' ) { safe_utf16_string_index++; sign = -1; } else if( character_value == (uint16_t) '+' ) { safe_utf16_string_index++; } } while( safe_utf16_string_index < utf16_string_length ) { character_value = utf16_string[ safe_utf16_string_index ]; if( character_value == 0 ) { break; } if( safe_utf16_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit *= 10; if( ( character_value < (uint16_t) '0' ) || ( character_value > (uint16_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x04%" PRIx16 " at index: %d.", function, character_value, safe_utf16_string_index ); return( -1 ); } character_value = (uint8_t) ( character_value - (uint16_t) '0' ); value_64bit += character_value; safe_utf16_string_index++; } if( sign == -1 ) { value_64bit |= (uint64_t) 1 << bit_shift; } } *utf16_string_index = safe_utf16_string_index; *integer_value = value_64bit; return( 1 ); } /* Copies an UTF-32 encoded string of an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_copy_from_integer( uint32_t *utf32_string, size_t utf32_string_size, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf32_string_copy_from_integer"; size_t utf32_string_index = 0; if( libfvalue_utf32_string_with_index_copy_from_integer( utf32_string, utf32_string_size, &utf32_string_index, integer_value, integer_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy integer value to UTF-32 string.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 encoded string of an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_with_index_copy_from_integer( uint32_t *utf32_string, size_t utf32_string_size, size_t *utf32_string_index, uint64_t integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf32_string_with_index_copy_from_integer"; size_t safe_utf32_string_index = 0; uint64_t divider = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t is_signed = 0; uint8_t number_of_characters = 0; int8_t bit_shift = 0; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-32 string index value out of bounds.", function ); return( -1 ); } safe_utf32_string_index = *utf32_string_index; if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { number_of_characters = 6; } else { number_of_characters = 5; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { number_of_characters = (uint8_t) ( integer_value_size >> 2 ) + 1; if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { number_of_characters += 2; } } else { /* The string is at least a single digit with an end of string character */ number_of_characters = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { is_signed = (uint8_t) ( integer_value >> bit_shift ); if( is_signed != 0 ) { number_of_characters += 1; integer_value &= ~( (uint64_t) 1 << bit_shift ); if( integer_value == 0 ) { integer_value |= (uint64_t) 1 << bit_shift; } } } divider = 1; while( ( integer_value / divider ) >= 10 ) { divider *= 10; number_of_characters += 1; } } if( ( number_of_characters > utf32_string_size ) || ( safe_utf32_string_index > ( utf32_string_size - number_of_characters ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-32 string size too small.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'f'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'a'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'l'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 's'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'e'; } else { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 't'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'r'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'u'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'e'; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'x'; } bit_shift = (uint8_t) ( integer_value_size - 4 ); do { byte_value = (uint32_t) ( ( integer_value >> bit_shift ) & 0x0f ); if( byte_value <= 9 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0' + byte_value; } else { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'a' + byte_value - 10; } bit_shift -= 4; } while( bit_shift >= 0 ); } else { if( is_signed != 0 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '-'; } while( divider > 1 ) { utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0' + (uint32_t) ( integer_value / divider ); integer_value %= divider; divider /= 10; } utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0' + (uint32_t) ( integer_value / divider ); } utf32_string[ safe_utf32_string_index++ ] = 0; *utf32_string_index = safe_utf32_string_index; return( 1 ); } /* Copies an UTF-32 encoded string to an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_copy_to_integer( const uint32_t *utf32_string, size_t utf32_string_length, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf32_string_copy_to_integer"; size_t utf32_string_index = 0; if( libfvalue_utf32_string_with_index_copy_to_integer( utf32_string, utf32_string_length, &utf32_string_index, integer_value, integer_value_size, string_format_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy UTF-32 string to integer value.", function ); return( -1 ); } return( 1 ); } /* Copies an UTF-32 encoded string to an integer value * The integer value size is in bits * Returns 1 if successful or -1 on error */ int libfvalue_utf32_string_with_index_copy_to_integer( const uint32_t *utf32_string, size_t utf32_string_length, size_t *utf32_string_index, uint64_t *integer_value, size_t integer_value_size, uint32_t string_format_flags, libcerror_error_t **error ) { static char *function = "libfvalue_utf32_string_with_index_copy_to_integer"; size_t maximum_string_index = 0; size_t safe_utf32_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; if( utf32_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string.", function ); return( -1 ); } if( utf32_string_length > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-32 string size value exceeds maximum.", function ); return( -1 ); } if( utf32_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-32 string index.", function ); return( -1 ); } if( *utf32_string_index >= utf32_string_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid UTF-32 string index value out of bounds.", function ); return( -1 ); } safe_utf32_string_index = *utf32_string_index; if( integer_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid integer value.", function ); return( -1 ); } if( ( integer_value_size != 8 ) && ( integer_value_size != 16 ) && ( integer_value_size != 32 ) && ( integer_value_size != 64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported integer value size.", function ); return( -1 ); } supported_flags = 0x000000ffUL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED | LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR; if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format flags: 0x%08" PRIx32 ".", function, string_format_flags ); return( -1 ); } string_format_type = string_format_flags & 0x000000ffUL; if( ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) && ( string_format_type != LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported string format type.", function ); return( -1 ); } if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { if( integer_value == 0 ) { maximum_string_index = 5; } else { maximum_string_index = 4; } } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { maximum_string_index = (size_t) ( integer_value_size >> 2 ); if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { maximum_string_index += 2; } } else { /* The string is at least a single digit with an end of string character */ maximum_string_index = 2; bit_shift = (uint8_t) ( integer_value_size - 1 ); divider = 1; value_64bit = ~( ( ~( (uint64_t) 1 << bit_shift ) >> bit_shift ) << bit_shift ); while( ( value_64bit / divider ) >= 10 ) { divider *= 10; maximum_string_index += 1; } } maximum_string_index += safe_utf32_string_index; if( maximum_string_index > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid maximum string index value exceeds maximum.", function ); return( -1 ); } value_64bit = 0; if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN ) { /* TODO */ } else if( string_format_type == LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL ) { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR ) == 0 ) { character_value = utf32_string[ safe_utf32_string_index++ ]; if( character_value != (uint32_t) '0' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x08%" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } character_value = utf32_string[ safe_utf32_string_index++ ]; if( character_value != (uint32_t) 'x' ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x08%" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } } while( safe_utf32_string_index < utf32_string_length ) { character_value = utf32_string[ safe_utf32_string_index ]; if( character_value == 0 ) { break; } if( safe_utf32_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit <<= 4; if( ( character_value >= (uint32_t) '0' ) && ( character_value <= (uint32_t) '9' ) ) { byte_value = (uint8_t) ( character_value - (uint32_t) '0' ); } else if( ( character_value >= (uint32_t) 'A' ) && ( character_value <= (uint32_t) 'F' ) ) { byte_value = (uint8_t) ( character_value - (uint32_t) 'A' + 10 ); } else if( ( character_value >= (uint32_t) 'a' ) && ( character_value <= (uint32_t) 'f' ) ) { byte_value = (uint8_t) ( character_value - (uint32_t) 'a' + 10 ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x08%" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } value_64bit += byte_value; safe_utf32_string_index++; } } else { if( ( string_format_flags & LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED ) != 0 ) { character_value = utf32_string[ safe_utf32_string_index ]; /* In the maximum possible string one character is substituted for the sign */ if( character_value == (uint32_t) '-' ) { safe_utf32_string_index++; sign = -1; } else if( character_value == (uint32_t) '+' ) { safe_utf32_string_index++; } } while( safe_utf32_string_index < utf32_string_length ) { character_value = utf32_string[ safe_utf32_string_index ]; if( character_value == 0 ) { break; } if( safe_utf32_string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } value_64bit *= 10; if( ( character_value < (uint32_t) '0' ) || ( character_value > (uint32_t) '9' ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: 0x08%" PRIx32 " at index: %d.", function, character_value, safe_utf32_string_index ); return( -1 ); } character_value = (uint8_t) ( character_value - (uint32_t) '0' ); value_64bit += character_value; safe_utf32_string_index++; } if( sign == -1 ) { value_64bit |= (uint64_t) 1 << bit_shift; } } *utf32_string_index = safe_utf32_string_index; *integer_value = value_64bit; return( 1 ); } libewf-20140807/libfvalue/libfvalue_data_handle.h0000664000175000017500000001201113443450055023726 0ustar00lordyestalordyesta00000000000000/* * Data handle functions * * Copyright (C) 2010-2018, 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( _LIBFVALUE_INTERNAL_DATA_HANDLE_H ) #define _LIBFVALUE_INTERNAL_DATA_HANDLE_H #include #include #include "libfvalue_extern.h" #include "libfvalue_libcdata.h" #include "libfvalue_libcerror.h" #include "libfvalue_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfvalue_internal_data_handle libfvalue_internal_data_handle_t; struct libfvalue_internal_data_handle { /* The data */ uint8_t *data; /* The data size */ size_t data_size; /* The encoding */ int encoding; /* The data flags */ uint32_t data_flags; /* The value entries array */ libcdata_array_t *value_entries; /* The read value entries function */ int (*read_value_entries)( libfvalue_data_handle_t *data_handle, const uint8_t *data, size_t data_size, int encoding, uint32_t data_flags, libcerror_error_t **error ); /* The flags */ uint8_t flags; }; LIBFVALUE_EXTERN \ int libfvalue_data_handle_initialize( libfvalue_data_handle_t **data_handle, int (*read_value_entries)( libfvalue_data_handle_t *data_handle, const uint8_t *data, size_t data_size, int encoding, uint32_t data_flags, libcerror_error_t **error ), libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_free( libfvalue_data_handle_t **data_handle, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_clone( libfvalue_data_handle_t **destination_data_handle, libfvalue_data_handle_t *source_data_handle, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_clear( libfvalue_data_handle_t *data_handle, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_get_data( libfvalue_data_handle_t *data_handle, uint8_t **data, size_t *data_size, int *encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_set_data( libfvalue_data_handle_t *data_handle, const uint8_t *data, size_t data_size, int encoding, uint8_t flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_get_data_flags( libfvalue_data_handle_t *data_handle, uint32_t *data_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_set_data_flags( libfvalue_data_handle_t *data_handle, uint32_t data_flags, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_get_number_of_value_entries( libfvalue_data_handle_t *data_handle, int *number_of_value_entries, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_get_value_entry( libfvalue_data_handle_t *data_handle, int value_entry_index, size_t *value_entry_offset, size_t *value_entry_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_set_value_entry( libfvalue_data_handle_t *data_handle, int value_entry_index, size_t value_entry_offset, size_t value_entry_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_append_value_entry( libfvalue_data_handle_t *data_handle, int *value_entry_index, size_t value_entry_offset, size_t value_entry_size, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_get_value_entry_data( libfvalue_data_handle_t *data_handle, int value_entry_index, uint8_t **value_entry_data, size_t *value_entry_data_size, int *encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_set_value_entry_data( libfvalue_data_handle_t *data_handle, int value_entry_index, const uint8_t *value_entry_data, size_t value_entry_data_size, int encoding, libcerror_error_t **error ); LIBFVALUE_EXTERN \ int libfvalue_data_handle_append_value_entry_data( libfvalue_data_handle_t *data_handle, int *value_entry_index, const uint8_t *value_entry_data, size_t value_entry_data_size, int encoding, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFVALUE_INTERNAL_DATA_HANDLE_H ) */ libewf-20140807/libfvalue/libfvalue_definitions.h0000664000175000017500000002267613443450055024037 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2010-2018, 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( LIBFVALUE_INTERNAL_DEFINITIONS_H ) #define LIBFVALUE_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue */ #if !defined( HAVE_LOCAL_LIBFVALUE ) #include /* The definitions in are copied here * for local use of libfvalue */ #else #include #define LIBFVALUE_VERSION 20180817 /* The libfvalue version string */ #define LIBFVALUE_VERSION_STRING "20180817" /* The endian definitions */ #define LIBFVALUE_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG #define LIBFVALUE_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE #define LIBFVALUE_ENDIAN_NATIVE (uint8_t) 'n' /* The value flags definitions */ enum LIBFVALUE_VALUE_FLAGS { /* The data handle is not managed by the value * the data handle is expected to be available * during the life-time of the value */ LIBFVALUE_VALUE_FLAG_DATA_HANDLE_NON_MANAGED = 0x00, /* The data handle is managed by the value */ LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED = 0x01, /* The identifier is not managed by the value * the identifier is expected to be available * during the life-time of the value */ LIBFVALUE_VALUE_FLAG_IDENTIFIER_NON_MANAGED = 0x00, /* The identifier is managed by the value */ LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED = 0x02, /* The data is not managed by the value * the data is expected to be available * during the life-time of the value */ LIBFVALUE_VALUE_FLAG_DATA_NON_MANAGED = 0x00, /* The data is managed by the value */ LIBFVALUE_VALUE_FLAG_DATA_MANAGED = 0x04, /* The value has a runtime instance of the value type */ LIBFVALUE_VALUE_FLAG_HAS_RUNTIME_INSTANCE = 0x08, }; /* The value identifier flags definitions */ enum LIBFVALUE_VALUE_IDENTIFIER_FLAGS { /* The identifier is not managed by the value * * if LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED is not set * the identifier is expected to be available * during the life-time of the value * * if LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED is set * a copy of the identifier will be managed by the value */ LIBFVALUE_VALUE_IDENTIFIER_FLAG_NON_MANAGED = 0x00, /* The identifier is managed by the value * This will also set LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED in the value */ LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED = 0x01, /* The identifier is not cloned, but passed as a reference */ LIBFVALUE_VALUE_IDENTIFIER_FLAG_CLONE_BY_REFERENCE = 0x10 }; /* The value data flags definitions */ enum LIBFVALUE_VALUE_DATA_FLAGS { /* The data is not managed by the value * * if LIBFVALUE_VALUE_FLAG_DATA_MANAGED is not set * the data is expected to be available * during the life-time of the value * * if LIBFVALUE_VALUE_FLAG_DATA_MANAGED is set * a copy of the data will be managed by the value */ LIBFVALUE_VALUE_DATA_FLAG_NON_MANAGED = 0x00, /* The data is managed by the value * This will also set LIBFVALUE_VALUE_FLAG_DATA_MANAGED in the value */ LIBFVALUE_VALUE_DATA_FLAG_MANAGED = 0x02, /* The data is not cloned, but passed as a reference */ LIBFVALUE_VALUE_DATA_FLAG_CLONE_BY_REFERENCE = 0x10 }; /* The value class definitions */ enum LIBFVALUE_VALUE_CLASSES { LIBFVALUE_VALUE_CLASS_UNDEFINED = 0, LIBFVALUE_VALUE_CLASS_BINARY, LIBFVALUE_VALUE_CLASS_BOOLEAN, LIBFVALUE_VALUE_CLASS_DATETIME, LIBFVALUE_VALUE_CLASS_ENUMERATION, LIBFVALUE_VALUE_CLASS_FLOATING_POINT, LIBFVALUE_VALUE_CLASS_INTEGER, LIBFVALUE_VALUE_CLASS_STRING }; /* The value type definitions */ enum LIBFVALUE_VALUE_TYPES { LIBFVALUE_VALUE_TYPE_UNDEFINED = 0, LIBFVALUE_VALUE_TYPE_NULL, LIBFVALUE_VALUE_TYPE_BINARY_DATA, LIBFVALUE_VALUE_TYPE_BOOLEAN, LIBFVALUE_VALUE_TYPE_ENUMERATION, LIBFVALUE_VALUE_TYPE_INTEGER_8BIT, LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_8BIT, LIBFVALUE_VALUE_TYPE_INTEGER_16BIT, LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_16BIT, LIBFVALUE_VALUE_TYPE_INTEGER_32BIT, LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_32BIT, LIBFVALUE_VALUE_TYPE_INTEGER_64BIT, LIBFVALUE_VALUE_TYPE_UNSIGNED_INTEGER_64BIT, LIBFVALUE_VALUE_TYPE_FLOATING_POINT_32BIT, LIBFVALUE_VALUE_TYPE_FLOATING_POINT_64BIT, LIBFVALUE_VALUE_TYPE_STRING_BYTE_STREAM, LIBFVALUE_VALUE_TYPE_STRING_UTF8, LIBFVALUE_VALUE_TYPE_STRING_UTF16, LIBFVALUE_VALUE_TYPE_STRING_UTF32, LIBFVALUE_VALUE_TYPE_FAT_DATE_TIME, LIBFVALUE_VALUE_TYPE_FILETIME, LIBFVALUE_VALUE_TYPE_FLOATINGTIME, LIBFVALUE_VALUE_TYPE_NSF_TIMEDATE, LIBFVALUE_VALUE_TYPE_HFSTIME, LIBFVALUE_VALUE_TYPE_POSIX_TIME, LIBFVALUE_VALUE_TYPE_SYSTEMTIME, LIBFVALUE_VALUE_TYPE_GUID, LIBFVALUE_VALUE_TYPE_NT_SECURITY_IDENTIFIER }; /* The binary data value format flags */ enum LIBFVALUE_BINARY_DATA_FORMAT_FLAGS { LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 = 0x00000001UL, LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 = 0x00000002UL, LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 = 0x00000003UL, LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER = 0x00000100UL, LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER = 0x00000200UL, }; /* The date time value format definition flags */ enum LIBFVALUE_DATE_TIME_FORMAT_FLAGS { /* Format the date time value in C time */ LIBFVALUE_DATE_TIME_FORMAT_TYPE_CTIME = 0x00000001UL, /* Format the date time value in ISO 8601 */ LIBFVALUE_DATE_TIME_FORMAT_TYPE_ISO8601 = 0x00000002UL, /* Format the date time value as a date only */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE = 0x00000100UL, /* Format the date time value as a time only */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME = 0x00000200UL, /* Format the date time value as a duration */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_DURATION = 0x00000400UL, /* Format the date time value with a time in milli seconds */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MILLI_SECONDS = 0x00010000UL, /* Format the date time value with a time in micro seconds */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MICRO_SECONDS = 0x00020000UL, /* Format the date time value with a time in nano seconds */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_NANO_SECONDS = 0x00040000UL, /* Add a timezone indicator */ LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIMEZONE_INDICATOR = 0x80000000UL, }; #define LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE_TIME \ ( LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME ) #define LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE_TIME_MILLI_SECONDS \ ( LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MILLI_SECONDS ) #define LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE_TIME_MICRO_SECONDS \ ( LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MICRO_SECONDS ) #define LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE_TIME_NANO_SECONDS \ ( LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME | LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_NANO_SECONDS ) /* The GUID value format definition flags */ enum LIBFVALUE_GUID_FORMAT_FLAGS { /* Format the using lower case */ LIBFVALUE_GUID_FORMAT_FLAG_USE_LOWER_CASE = 0x00000001UL, /* Format the using upper case */ LIBFVALUE_GUID_FORMAT_FLAG_USE_UPPER_CASE = 0x00000002UL, /* Format the using surrounding braces { GUID } */ LIBFVALUE_GUID_FORMAT_FLAG_USE_SURROUNDING_BRACES = 0x00000004UL }; /* The floating point value format flags */ enum LIBFVALUE_FLOATING_POINT_FORMAT_FLAGS { LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL = 0x00000001UL, LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL = 0x00000002UL }; /* The integer value format flags */ enum LIBFVALUE_INTEGER_FORMAT_FLAGS { LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL = 0x00000001UL, LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL = 0x00000002UL, LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN = 0x00000003UL, LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED = 0x00000100UL, LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED = 0x00000200UL, /* The integer has no base indicator e.g. 0x */ LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR = 0x00010000UL }; #define LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_SIGNED \ LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL | LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED #define LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED \ LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED /* The table flag definitions */ enum LIBFVALUE_TABLE_FLAGS { /* Allow a partial match of the identifier */ LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH = 0x01 }; /* The print flags definitions */ enum LIBFVALUE_PRINT_FLAGS { /* Print the value with a type description */ LIBFVALUE_PRINT_FLAG_WITH_TYPE_DESCRIPTION = 0x01 }; #endif /* !defined( HAVE_LOCAL_LIBFVALUE ) */ #endif /* !defined( LIBFVALUE_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/Makefile.in0000664000175000017500000013073413443455347017422 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = include/libewf/definitions.h \ include/libewf/features.h include/libewf/types.h \ dpkg/changelog libewf.pc libewf.spec CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libewf.pc.in \ $(srcdir)/libewf.spec.in $(top_srcdir)/dpkg/changelog.in \ $(top_srcdir)/include/libewf/definitions.h.in \ $(top_srcdir)/include/libewf/features.h.in \ $(top_srcdir)/include/libewf/types.h.in ABOUT-NLS AUTHORS \ COPYING ChangeLog INSTALL NEWS README compile config.guess \ config.rpath config.sub install-sh ltmain.sh missing ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ include \ common \ libcerror \ libcthreads \ libcdata \ libcdatetime \ libclocale \ libcnotify \ libcsplit \ libuna \ libcfile \ libcpath \ libbfio \ libfcache \ libfdata \ libfvalue \ libmfdata \ libhmac \ libewf \ libodraw \ libsmdev \ libsmraw \ ewftools \ ewf.net \ pyewf \ pyewf-python2 \ pyewf-python3 \ po \ documents \ manuals \ tests \ examples \ msvscpp DPKG_FILES = \ dpkg/changelog \ dpkg/changelog.in \ dpkg/compat \ dpkg/control \ dpkg/copyright \ dpkg/rules \ dpkg/libewf.install \ dpkg/libewf-dev.install \ dpkg/libewf-python.install \ dpkg/libewf-python3.install \ dpkg/libewf-tools.install \ dpkg/source/format GETTEXT_FILES = \ config.rpath \ po/Makevars.in PKGCONFIG_FILES = \ libewf.pc.in SETUP_PY_FILES = \ setup.py SPEC_FILES = \ libewf.spec \ libewf.spec.in EXTRA_DIST = \ $(DPKG_FILES) \ $(GETTEXT_FILES) \ $(PKGCONFIG_FILES) \ $(SETUP_PY_FILES) \ $(SPEC_FILES) MAINTAINERCLEANFILES = \ Makefile.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = \ libewf.pc all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): include/libewf/definitions.h: $(top_builddir)/config.status $(top_srcdir)/include/libewf/definitions.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ include/libewf/features.h: $(top_builddir)/config.status $(top_srcdir)/include/libewf/features.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ include/libewf/types.h: $(top_builddir)/config.status $(top_srcdir)/include/libewf/types.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ dpkg/changelog: $(top_builddir)/config.status $(top_srcdir)/dpkg/changelog.in cd $(top_builddir) && $(SHELL) ./config.status $@ libewf.pc: $(top_builddir)/config.status $(srcdir)/libewf.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libewf.spec: $(top_builddir)/config.status $(srcdir)/libewf.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile libtool: @LIBTOOL_DEPS@ cd $(srcdir) && $(SHELL) ./config.status --recheck lib: library library: (cd $(srcdir)/common && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcerror && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libclocale && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcnotify && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcsplit && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libuna && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcfile && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libbfio && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfcache && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfvalue && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libmfdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libhmac && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libewf && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) distclean: clean /bin/rm -f Makefile /bin/rm -f config.status /bin/rm -f config.cache /bin/rm -f config.log /bin/rm -f libewf.pc /bin/rm -f libewf.spec /bin/rm -f dpkg/changelog /bin/rm -f dpkg/shlibs.local.ex @for dir in ${subdirs}; do \ (cd $$dir && $(MAKE) distclean) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" splint: (cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdatetime && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcnotify && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcsplit && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libuna && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcfile && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcpath && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libbfio && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libfcache && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libfdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libfvalue && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libmfdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libhmac && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libewf && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libodraw && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libsmdev && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libsmraw && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/ewftools && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS)) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/ChangeLog0000644000175000017500000037100212366763711017120 0ustar00lordyestalordyesta00000000000000TODO * sync with experimental version * move mfdata to fdata - not possible - chunk_table_list - needs mfdata uses grouping - file_list - not supported by fdata 20140801 * bug fix in Python-bindings 20140608 * bug fix for utf16 header functions 20140602 * bug fix in ewfmount regarding logical files date and time values 20140525 * updated python.m4 20140427 * fixes to build static library with mingw and cygwin 20140406 * bug fixes in m4 files 20140228 * removed #error restriction in dependency include header files * make pyewf_handle_open more strict to catch non-string objects without the check the code will segfault on non-string objects 20140227 * bug fixes in empty block compression 20140226 * bug fix in libewf_read_io_handle_read_chunk_data error tolerance code path 20140216 * bug fix in recent process status changes 20140211 * integrating latest update for multi threaded ewfacquire changes 20140201 * changed behavior of empty-block check * worked on integrating multi threaded ewfacquire changes 20140119 * 2014 update * updated dependencies * added libcdatetime * removed borlandc files 20131230 * small updates 20131222 * moved low-level function support from compile time to run time * worked on sync with experimental version 20131210 * updated dependencies * worked on Python bindings * added libcthreads * fix in DFXML output for size values * worked on ewfmount 20130416 * bug fix in libcfile.m4 for building on MingW and Cygwin * fix in libsmdev for MinGW build 20130402 * changes to zlib.m4 for adler32 detection * moved README.mingw and README.static to wiki 20130331 * worked on libcdata integration * updated msvscpp files * updated codegear files * sync with experimental version 20130330 * updated dependencies * updates for libsmdev * added error tolerance for Logicube image with missing checksum in data section * code clean up * worked on libcdata integration 20130302 * updated types.h * fixed maximum number of segments 20130205 * changes and fixes in debug output 20130128 * worked on sync with experimental version * docstring changes in pyewf * fix for corruption scenario 20130126 * fixes in pyewf examples 20130120 * updated msvscpp files * updated codegear files * updated pyewf * worked on sync with experimental version * replace libmfcache by new libfcache 20130119 * updated configure files * updated dpkg files * updated rpm spec file * updated pyewf - fixes multiple issues * updated dependencies * worked on sync with experimental version * added pyewf/setup.py with thanks to Michael Cohen 20130105 * bug fix for 31th day of the month issue 20121209 * removed memwatch and gettext 20120819 * bug fix for not writing SHA-1 hash 20120603 * bug fix for MinGW in liberror * updates for zlib-1.2.7 20120504 * bug fix for setting media size of L01 file 20120421 * small changes to dpkg files 20120416 * added fuse destroy function to ewfmount * bug fix in libewf_utf8_string_day_of_month_copy_to_time_elements * changes to debug output 20120414 * ewfverify: fixed printing the same segment filename multiple times for CRC errors * worked on pyewf * bug fix in libewf_utf16_string_month_copy_from_time_elements * updated libuna: fix in codepage 932 20120304 * small changes to debug error output * small changes for error tolerability * updated libfvalue 20120225 * promoted to stable 20120213 * small changes to ewftools * pyewf: added -avoid-version to Makefile.am * updated macosx package maker files 20120212 * update for zlib-1.2.6 * added API functions for file entry data offset, data size and duplicate data offset * added file entry flags and media data value functions to ewf.net * updated libnotify, libodraw, libfvalue, libsmraw 20120209 * small changes 20120208 * added dpkg files 20120122 * bug fix in write finalize 20120118 * updated gettext files * updated libbfio * preparations for beta testing 20120111 * updated spec file 20120102 * 2012 update 20111231 * updated libhmac, libsmraw, libsmdev 20111228 * updated libcstring, libuna, libbfio * updated msvscpp, builder5 and codegear files 20111226 * updated libbfio 20111224 * updated libsystem, libuna, libbfio, libhmac, libfvalue, libodraw 20111221 * small fixes in ewftools 20111208 * worked on dealing with missing segment files 20111207 * worked on dealing with missing segment files 20111205 * worked on ewfrecover 20111204 * updated msvscpp files * updated builder5 files * updated codegear files 20111203 * worked on ewfrecover * code clean in ewftools * updated libcstring, libsystem * added libmfcache 20111121 * fixed bug introduced by error tollerance changes 20111120 * updated libfvalue, libmfdata * worked on error tollerance 20111117 * updated libmfdata 20111115 * code clean up * updated libmfdata 20111114 * code clean up * updated array type, list type, tree type * updated libcstring, libfvalue, libhmac 20111105 * worked on libewf_file_get_file_entry_by_utf8_path and libewf_file_get_file_entry_by_utf16_path * changes to ewfmount to deal with file names containing the path separator character / 20111103 * worked on libewf_file_get_file_entry_by_utf8_path and libewf_file_get_file_entry_by_utf16_path * code clean up changed name of file entry item flags and moved it to definitions 20111101 * small changes 20111031 * updated README.macosx * added setvbuf * updated libcstring, libsystem, libuna, libbfio, libfvalue, libhmac * added windows codepage 932 and 936 support 20111030 * updated configure.ac and m4 files * updated libhmac, libodraw, libsmraw, libfvalue, libsmdev * updated tree type * changes for libfvalue 20111023 * worked on ewf.net * bug fixes in ewfmount 20111020 * updated README.static 20111017 * worked on ewf.net file entry support * changes to m4/libuuid.m4 20111016 * added libewf_file_entry_get_offset * worked on pyewf file entry support * changed file entry date and time values to 32-bit values * worked on ewfmount LEV support * worked on ewf.net file entry support 20111015 * worked on pyewf file entry support 20111011 * fixes in comment in include header * implemented OSXFuse support * bug fix for libfuse detection 20111010 * fix in spec file * ewfmount changed EBADFD into ENODEV * checked if all functions are checked for * bug fix in include header macros 20111009 * small fixes in ewfmount * small changes in configure 20111008 * updated configure.ac and m4 files * updated libsmdev, libodraw, libsmraw, libhmac * bug fix in libsystem * improved session and tracks detection in libsmdev 20111006 * updated configure.ac and m4 files * bug fix in ewfacuire for handling -w option 20111002 * bug fix for cross compilation 20110926 * updated libuna, libbfio 20110922 * updated README files 20110918 * updated spec file * added ewfmount.1 man page * update libsmraw, libodraw, libsmdev 20110914 * prepated temporary libsmdev version 20110908 * added chunk offset grouping after chunk table section write reduced memory usage during write 20110906 * libsmdev: - worked on improved session/track support 20110905 * libsmdev: - worked on improved session/track support 20110904 * pyewf: code clean up * libsmdev: - worked on improved session/track support - reduced IO timeouts - bug fix for information value strings 20110903 * ewfverify - fix for verifying empty single files - added error tollerance for "corrupt" single files - added support for sparse data 20110901 * updated libsmraw 20110831 * updated libuna, libbfio, libhmac, libfvalue, libodraw, libsmdev * updated m4/libsmdev.m4 20110829 * bug fix in ewfmount 20110828 * updated libbfio 20110823 * updated libbfio, libfvalue * worked on ewfmount 20110822 * worked on ewfmount * updated builder5 files 20110821 * worked on ewfmount 20110820 * updated libhmac, libbfio 20110810 * moved libewf.h include to separate file for tests * updated README 20110809 * small changes 20110807 * fixed process status in export handle * fixed error clean up in header values * fixed delta segment files list clean up 20110806 * worked on improving ewfexport output and error tollerability * updated libhmac - bug fixes for Solaris build * fixed ewfexport not detecting ewf formats correctly * updated libodraw * improve handling of cached compressed zero byte empty block for older version of zlib 20110801 * configure clean up * configure added support for --with-libuna and others * updated libhmac, bug fix in MD5 fallback functions * updated .pc and .spec file * updated manuals 20110731 * code cleanup - worked on TODOs * updated libmfdata, libsmraw, libsmdev * added > 2 GiB media and segment file size, and delta file open scenarios * configure clean up 20110730 * updated README * code cleanup - worked on TODOs 20110728 * fixed issue in libewf_utf8_string_day_of_month_copy_to_time_elements * extended glob test for first letter change scenario * created test file for table2 read (corrupted table) 20110727 * updated function checks for tracks functions * updated libsmdev * update in device handle for libsmdev UTF-16 and tracks functions * libewf now prints header value parse errors in debug mode not verbose mode * ewftools: fixed status print on abort 20110726 * updated libodraw * worked on audio track support in sessions section 20110725 * worked on audio track support in sessions section * updated libodraw 20110724 * updated libhmac * code clean up * multiple bug fixes: - media size not being set for L01 - ewfverify return true while verification in correct - single file type not being set - buffer size calculation if exceeds maximum size - due to re-use of hmac handles * change seek offset behavior of single file to match POSIX * added support target path "." in ewfexport * made additional digest hash type detection more tollerable * worked on audio track support in sessions section 20110721 * updated libhmac * fix for SHA1 detection in -d argument 20110720 * updated libhmac 20110719 * updated libhmac 20110718 * updated libhmac * ewftools: worked on SHA256 support 20110717 * worked on date time value functions * worked on replacing libewf split values by libfvalue split string * added ewf_test_get_offset test to ewf_test_read * fixes to configure for MingW compilation of libhmac * update msvscpp files * worked on libhmac 20110716 * worked on date time value functions * worked on replacing libewf split values by libfvalue split string 20110715 * updated libhmac * worked on date time value functions * worked on replacing libewf split values by libfvalue split string 20110714 * worked on replacing libewf split values by libfvalue split string 20110713 * updated libsystem: worked on replacing ->segments by functions * updated libfvalue * worked on replacing libewf split values by libfvalue split string 20110712 * info handle: replaced ->segments by functions * updated libsystem: worked on replacing ->segments by functions 20110703 * worked on libhmac SHA1 fallback implementation 20110630 * worked on libhmac MD5 and SHA1 fallback implementation 20110629 * worked on libhmac MD5 fallback implementation 20110628 * changed direction of >= in ewftools to <= * updated manuals * fix for EWF_MAXIMUM_OFFSETS_IN_TABLE being applied to the ENCASE6 format instead of EWF_MAXIMUM_OFFSETS_IN_TABLE_ENCASE6 20110627 * updates to libhmac and configure.ac 20110626 * refactored ewftools to use libhmac * code clean up * ewftools: worked on SHA256 support * updated msvscpp, codegear and builder5 files 20110625 * updated autoconf/make files * changed INTLLIBS to LIBINTL * changes for: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body * updated libmfdata, libfvalue, libuna, libbfio, libodraw, libsmdev, libsmraw * code clean up * worked on libhashf to wrap message digest hash functions 20110623 * code clean up in info_handle 20110610 * small changes to debug output * Changes for LVF support * added single file entry type function 20110531 * code clean up: digest_context * updated common * updated libfvalue 20110530 * updated libfvalue 20110523 * merged 20110519 changes - libmfdata fix 20110512 * worked on issue writing smart, no compression, chunk size 2048 - changed behavior to write at least 1 chunk even if chunk size > maximu segment file size 20110510 * worked on write finalize issue - added ewfacquirestream multi segment test - fixed issue in libewf_write_io_handle_finalize_write_sections_corrections * small change to multi segment ewfacquire test * updated libodraw 20110509 * small changes 20110508 * updated libodraw * fix for retrieving empty UTF16 file entry name 20110504 * small changes 20110501 * updated include/codepage.h * fixes in debug output * changes for FTK imager format: recent versions of FTK imager now longer force media type to be 0x01 and size of the last section is no longer set 20110427 * fix for LOCALE_RETURN_NUMBER clash on Vista/Win7 20110411 * fix for LOCALE_RETURN_NUMBER clash 20110329 * fix for initial segment file rewrite * added split ewfacquire test 20110322 * updated configure.ac and libsmdev for improved STORAGE_BUS_TYPE detection 20110320 * worked on l17n 20110319 * added INTLLIBS to ewftools 20110312 * updated libuna, libbfio, libsmdev, libsmraw, libodraw * msvscpp added VSDebug build option 20110306 * updated libmfdata 20110305 * worked on table2 backup data range support 20110303 * updated libbfio, libsmdev, libsystem, libcstring - some changes for Cygwin WINAPI support * worked on libmfdata integration - update to clone function for groups - moved data range values back into initialize * fixes to ewftools * fixes to test programs * worked on audio track support - worked on write support 20110302 * worked on audio track support - worked on read support 20110218 * worked on audio track support - worked on read support 20110214 * worked on libmfdata integration - worked on backup data range support 20110211 * updated libodraw * synced with alternative branch - updates for builder5 and codegear 20110210 * worked on libmfdata integration - worked on backup data range support 20110209 * updated libodraw * worked on libmfdata integration - removed segment table data file index lookup - worked on backup data range support * imaging handle - correction of upper bound of error granularity in prompt - correction of header values retrieval on resume * fix for empty-block compression initialization 20110208 * worked on libmfdata integration - removed segment table data file index lookup 20110204 * updates for msvscpp 20110203 * worked on libmfdata integration * worked on ewftools - detailed info is no longer printed on abort - removed restrictive media size safe guard for optical discs from ewfacquire * updated libodraw 20110202 * worked on libmfdata integration 20110201 * worked on libmfdata integration * updated libsystem 20110128 * worked on libmfdata integration 20110127 * worked on libmfdata integration 20110126 * worked on libmfdata integration 20110125 * worked on libmfdata integration 20110123 * worked on libmfdata integration 20110122 * worked on libmfdata integration * worked on debug output to match other libraries 20110121 * worked on read/write tests * ewfacquire and ewfexport now allow for media size of 0 (empty) * libewf: code clean up * worked on libmfdata integration * read/write fix for offset drift after write 20110120 * worked on ewf.net 20110118 * imaging handle - fix for missing default maximum segment (file) size * ewfacquirestream: - fix for default evidence information * worked on ewf.net 20110117 * updated libsystem, libuna, libbfio, libsmdev, libsmraw, libodraw 20110114 * updated libuna, libbfio, libodraw, libsmdev, libsmraw * updated check for dependent functions * ewfacquire: corrected behaviour of -g * ewftools: worked on flush of md5 and sha1 contexts on error * worked on ewf.net 20110113 * updated macosx files * updated test scripts for SunOS 5.11 support * ewftools: code clean up 20110112 * updated libsystem * ewftools: code clean up * tests: code clean up * ewfverify: print filename with path * completed libewf_single_file_entry_get_utf16_hash_value_md5 * added test for ewfexport of single files 20110111 * updated libsmraw, libodraw * updated ewf.net * single file entry: - added get MD5 hash function * renamed wipe/clean buffer to zero buffer * ewftools: code clean up * ewfverify: worked on L01 verification * MD5 hash of single file entry is now turned into lower case by library 20110110 * updated libuna, libbfio, libfvalue, libsmraw * code clean up * export handle fixed memory leak for MD5/SHA1 context * cariage return fixes in single files * remove ewfalter from spec file * libcstring fix for FreeBSD * correction for access flags * added system codepage functions * worked on write resume improvements - resume in table2 section 20110109 * updated libodraw 20110108 * updated common * updated libcstring, libuna, libbfio, libsmraw, libsmdev, * updated open_close.c example 20110106 * updated libodraw, libsmdev, libsmraw * ewftools: code clean up * ewftools: fixed spelling error in unsuported => unsupported * ewfacquire: worked on optical disc RAW image support * ewfacquire: bug fix for setting number of error retries * test: worked on truncate equivalent * test: code clean up * test: added acquire of optical disc RAW images test 20110104 * updated libfvalue, libsmdev, libsmraw, libodraw * fixed issue in file entry introduced in 20101025 * device handle added abort for libodraw 20110103 * added restriction for calculated section header next to match stored * 2011 update * bug fix in clone single file entry 20110102 * worked on error tollerance 20101221 * updated libodraw, libsmraw * ewftools: adjustment of last sector value in output, no longer included in range * ewftools: added support for 16 and 32 sectors per chunk 20101220 * fix for linking with debug output on Cygwin * updated libodraw * updated ewfinfo manual, added -f option 20101219 * updated libcstring, libbfio, libfvalue, libmfdata, libsystem, libsmraw, libsmdev, libodraw * code clean up 20101218 * updated libodraw 20101217 * renamed libodtoc to libodraw * updated libodraw * configure fix for platforms without libdl * updated test scripts for FreeBSD support * updated msvscpp, codegear and builder5 project files for libodraw 20101216 * code clean up * worked on clone handle * updated libbfio, libfvalue, libsmraw * optimization of read loop * ewfx added safeguard for long WINAPI timezone names 20101215 * worked on implementing DFXML patch by S. Garfinkel * removed parsing of system_date from xheader 20101214 * code clean up in libewf and ewftools * updated libbfio, array type, list type, sector list * worked on clone handle * worked on implementing DFXML patch by S. Garfinkel 20101213 * fixes for bugs and anoyances in ewftools * code clean up in ewftools 20101209 * updated ewfacquire resume test to deal with missing truncate 20101208 * code clean up * updated libsmraw, fix in segment file extension * fix in ewfexport regarding raw output 20101207 * fixed inconsistency in media type in device handle for file-based input * updated common, array type, list type, sector list, liberror, libnotify, libsystem, libuna, libbfio, libmfdata, libsmraw, libsmdev * added automatic detection of mingw and apply --enable-winapi by default * code clean up 20101201 * code clean up * updated libbfio * updated sector list 20101119 * worked on removing snprintf from liberror this function has inconsistent cross-platform behaviour * updated libfvalue, libodtoc, libsmdev * fixed bug in device handle session handling 20101115 * updated libbfio, libsmdev * removed 0 return value from get_acquiry_error, get_checksum_error, get_session functions, it had not meaning * code clean up 20101113 * textual changes * updated libsmraw, libsmdev * ewfacquire: worked on TOC file support for optical discs - added libodtoc 20101111 * updated libfvalue 20101108 * write finalize now creates segment file if media size is 0 and no data was written * updated libbfio, libsystem * fix to format detection for empty EWF file 20101105 * worked on libewf .net wrapper ewf.net * added const buffer of write functions * created libewf.rc that is generated from libewf.rc.in * added zlib.rc and libewf.rc to msvscpp projects * bug fix in imaging handle due to code clean up 20101104 * worked on libewf .net wrapper ewf.net, based on smraw.net * updated libbfio, libmfdata, libsmraw * configure: added option to disable GUID/UUID support for static build * added README.static 20101102 * updated libbfio * worked on file pre-allocate support, posix_fallocate does not provide the desired results * updated liberror 20101029 * worked on file format session section * updated debug output * libewf now correct the first session sector offset on read to 0 on write to 16, only if value is 0, to mimic EnCase like behaviour * ewfacquirestream added -P option to set bytes per sector * worked on ewfacquire, ewfacquirestream and imaging_handle code clean up * worked on write chunk test * updated libbfio * worked on file pre-allocate support 20101028 * worked on ewfacquire, ewfacquirestream and imaging_handle code clean up * worked on ewfexport and export_handle code clean up 20101027 * added fix for liberror WINAPI %s to %S conversion issue 20101026 * updated configure.ac * updated include/types.h * worked on ewfacquire, ewfacquirestream and imaging_handle code clean up * fixed header values mix-up for operation system and software version introduced in 20100719 20101025 * worked on automated tests - added ewfacquire resume test * worked on TODOs * updated array type * updated libfvalue, libsmraw * moved xheader and xhash section reading into libfvalue * added support for 5 value xheader date/time value * fix for EWFX date/time value missing timezone introduced in 20100719 * fix in date/time string generation for timezone description * worked on ewfacquire code clean up 20101022 * worked on automated tests * removed dpkg files * ewfexport: reactivated DISABLED, fixed export in different chunk size for low level functions 20101021 * worked on automated tests * changed compression_type into compression_level, libewf will return compression_level if compression_type is requested * small fixes in error notification * added check for chunk data size not equal to media data size as specified in volume section 20101020 * worked on automated tests 20101019 * validated configure functions checks of: libuna, libbfio, libsmdev, libsmraw, libfvalue, libmfdata * worked on automated tests - moved existing tests into autoconf test framework * ewfacquirestream will now also default to encase6 for encase1 format * removed ewfalter from msvscpp project files * removed ewfalter from automake files * moved ewfalter to ewf_test_read_write * updated libsmraw * ewfacquire: fixed missing default maximum segment size in unattended mode * ewfexport: fixed missing default maximum segment size in unattended mode 20101018 * renamed libewf_handle_[gs]et_segment_file_size * worked on write beyond media size 20101017 * ewfacquire now allows 0 byte input file * fixed number of sector rounding errors in output issue only affects media sizes which are a non-sector multitude * worked on automated tests - improved glob test * renamed libewf_handle_[gs]et_segment_file_size 20101015 * added missing types to error include header * fix for incorrect session information 20101014 * updated codegear project files * updated liberror, libbfio, libmfdata, libsmraw * worked on pyewf - fixed multiple bugs - added error handling - removed stub of pyewf_set_notify_values - implemented pyewf_glob * added seek test * fixed complex seek scenario 20101013 * worked on optical media session detection for Linux * fixed bug in header string generation function * updated libsmdev, libbfio * added static codegear project files 20101012 * updated libsmdev * worked on optical media session detection for Linux 20101008 * updated libbfio, libsmdev * replaced sector table by sector list 20101007 * updated libbfio, libsmdev 20101005 * remerged 20101003 changes with 20101002 due to error in bzip2-ed tar file * updated codegear files * updated builder5 files * worked on UTF-16 functions * fixed small memory leak in error on open * fixed bugs in date time values formatting function * ewfexport added exporting notification for files export 20101003 * worked on UTF-16 functions 20101002 * worked on UTF-16 functions 20100930 * worked on UTF-16 functions * code clean up * updated msvscpp files * fix for non-initialized session data * worked on UTF-16 debug output 20100929 * added open/close examples * worked on UTF-16 functions 20100928 * updated liberror, libnotify, libsystem, libbfio, libfvalue, libsmraw * worked on UTF-16 functions 20100908 * code clean up * added single file entry date/time functions to the API 20100907 * updated libbfio * fixed read beyond media size issue * ewfinfo fixed issue handling empty extents * updated macosx project file * updated msvscpp files * updated codegear files 20100807 * fixed errors introduced by libsmraw update in device handle 20100806 * updated builder5 files * updated libbfio, libsystem 20100805 * worked on gettext support * updated array type * updated libcstring, libsystem, libuna, libbfio, libfvalue, libmfdata, libsmdev, libsmraw * code clean up * worked on pyewf * updated msvscpp and codegear files 20100724 * updated libmfdata, libsmraw * added support for free without close * renamed flags to access flags 20100723 * updated libbfio, libmfdata, libsmraw 20100722 * worked on libmfdata * updated include/error.h and liberror * updated libuna, libbfio, libsmraw 20100719 * code clean up * corrected CRC into checksum * refactored header and hash values, file entry name functions to UTF-8 variant * implemented array type in libewf_offset_table, added encapsulation functions * updated libuna, libbfio, libsmdev, libsmraw * small improvement to write resume * worked on integrating test scripts 20100718 * update for mingw compilation * updated libbfio 20100714 * updated libuna, libbfio, libsmdev 20100713 * updated configure.ac * updated include/error.h and liberror * updated include/codepage.h * updated array, list and tree type * updated common, libcstring, libnotify, libsystem, libuna, libbio, libsmdev, libsmraw 20100511 * updated libsmraw 20100505 * updated configure.ac and Makefile.am files * updated libuna, libbfio, libsmdev, libsmraw 20100502 * updated libcstring, liberror, libuna, libbfio, libsmdev, libsmraw * changed amount of to number of 20100501 * updated libbfio, libsmdev * worked on clean up of acinclude.m4 * updated borlandc build files * updated pyewf * fixed typo in Makefile.am * fixed incorrect comment in include header 20100430 * worked on mingw support * updated libsmraw, libsystem, libbfio, libsmdev * added WIN32_LEAN_AND_MEAN to common/common.h - disable due to use of GUID/UUID functions * worked on borlandc and codegear files 20100429 * worked on msvscpp build * libcstring fix for missing memrchr 20100418 * added libcstring * updated common, liberror, libnotify, libuna, libbfio, libsystem, libsmdev, libsmraw * email change * refactored segment table - added array type - added functions for low coupling - moved read and write function to handle and write io handle - removed libewf_internal_handle_add_segment_file 20100314 * small changes to configure.ac 20100227 * applied ewfacquire argument swap patch * updated libsmraw and libsmdev * removed old raw code * fix in ewfoutput 20100209 * fix for error parsing date time value in EWFX * worked on direct IO support - updated libsmdev - configure added detection of posix_memalign 20100202 * updated libsmdev * worked on smio handle support * fixes for when format is not set on write 20100201 * updated libsmdev, libsmraw * info_handle fix for media flags * updated libewf.3 manual * fixed missing libewf_glob_free_wide in include header 20100128 * updated libsmraw 20100126 * worked on solution for Debian 4.0 posix_fadvise break * updated libsmdev 20100124 * worked on Borland C++ Builder 5.5 support * updated common, liberror (snwprintf fix) * updated libsmdev, libsmraw * updated codegear and msvscpp files (io_*.[ch] removal) 20100123 * worked on windows support * updated libbfio, libsmdev, libsmraw * updates msvscpp and codegear files * ewftools: removed io_.[ch] file, no longer required * update for missing varadic macro support in Borland C++ Builder 5.5 20100121 * worked on maximum number of open handles * updated libsmdev, libsmraw 20100120 * updated libbfio, libsmraw * worked on maximum number of open handles 20100119 * updated libbfio * worked on maximum number of open handles 20100118 * worked on moving read error handling into libsmdev * updated libsmdev * removed acquiry error print from ewfacquirestream * moved acquiry error print from imaging handle to device handle * ewfacquirestream removed wipe on error * worked on means to set pools open handle limit in libewf * refactor file io pool from io handle to handle 20100117 * worked on moving read error handling into libsmdev * updated libsmdev 20100116 * worked on split RAW support for ewfacquire * worked on moving read error handling into libsmdev * updated libsmdev, libsmraw 20100110 * worked fix for restriction on large segment file and chunk * removed use of base offset for linen6 format * made ewfacquire more tollerant for missing device information * added digest section support for linen6 format * updated common, libsmraw 20100109 * small changes * worked on libsmraw integration into ewftools * worked fix for restriction on large segment file and chunk * fixed ewfacquire manpage 20100108 * small changes 20100106 * updated libuna, libbfio * worked on Borland C++ 5 compiler support 20100105 * worked on Borland C++ 5 compiler support * removed sprintf support 20100104 * fixes for windows build * updated libbfio 20100103 * worked on exporting LVF files 20100102 * 2010 update * updated liberror, libuna, libbfio * removed include/handle.h * worked on wide system string support in liberror 20091230 * worked on exporting LVF files 20091229 * worked on reading LVF files 20091228 * worked on windows builds * worked on Borland C++ 5 compiler support * updated libbfio 20091225 * worked on reading LVF files 20091224 * fixed debug output of file header offset * worked on reading LVF files * aplied number of headers patch for v1 api 20091223 * replaced string split by split values * worked on reading LVF files 20091222 * applied multi header patch * updated libuna, libbfio, libsystem * improved free return value * worked on reading LVF files 20091128 * updated byte stream 20091122 * deprecated the v1 API * worked on pyewf rewrite * worked on implementing log handle in ewftools * small changes * worked on reading LVF files 20091114 * moved codepage definitions to libewf_codepage.h * updated libbfio * updated MacOS-X package project file 20091109 * fix for borland c compilation * update to MSVSCPP project files 20091108 * fix for MSVSCPP compilation * fixed incorrect return value in libsystem_glob 20091031 * fix for local use of libewf 20091030 * changed endian.h into byte_stream.h * updated libuna, libbfio * updated behavior of unmanaged file io handle 20091024 * add falign in device handle, small performance improvement 20091020 * fixed overflow of chunks_section_number in write io handle 20091018 * worked on aligned empty block test * fixed error in help output of ewfacquirestream * fixed error in ewfacquirestream regarding missing strings * worked on cached zero byte emtpy block based on idea by Bas Kloet 20091017 * preperation for stable release * removed All rights reserved because it has no additional legal value what so ever 20091003 * several fixes for Debian integration based on patches by Cristian Greco * corrected license in list and array type and several of the pfftool handles * updated libuna, libbfio * updated several manpages * changes to autoconf/make scripts to not link libcrypto and libuuid to libewf * renamed debian to dpkg * remove ZLIB_WINAPI from msvscpp configuration * several fixes to configure scripts 20091001 * small changes in common * made libewf a little more tollerant in allowing the data section not to contain values, the values must be 0 otherwise libewf still enforces validity checks 20090929 * worked on CodeGear project files - disabled creation of pre compiled headers 20090928 * small changes 20090927 * worked on secondary image output * added open resume signal handling in ewfacquire * worked on CodeGear project files * several minor fixes * updated libbfio for fix of CodeGear _sopen issue which results in files being created using libbfio_file_exists check * ewfacquire now provides default media type based on device information * updated list type 20090926 * worked on initialization issue - set sectors per chunk is now read protected - fixed bug in legacy wrapper set bytes per sector * small fix in verbose output * worked on secondary image output * small cross platform fixes in ewfacquire and ewfacquirestream * moved session handling from imaging handle to ewfacquire 20090911 * updated libsystem 20090905 * updated ewfinput codepage detection with libuna version 20090904 * updated codpage definitions 20090901 * worked on Borland C++ compiler support * updated common/file_stream.h 20090829 * updated msvscpp libbfio project 20090828 * updated libuna, libbfio * the parsing of the header and hash values is now handled by the library the corresponding parse functions were removed from API v2 * all header and hash sections are now parsed for additional values * updated libbfio detection * worked on libbfio API extensions 20090824 * adjustments in ewftools io access 20090823 * minor adjustments 20090822 * updated common: narrow_string, memory * updated libnotify * bug fix in libewf_values_table 20090821 * small adjustments * fixed handling 0 entries in libewf_values_table_initialize 20090820 * worked msvscpp solution files * worked codegear project files * small corrections in include/libewf/types.h.in * fixed libsystem_file_io open mode 20090819 * updated libbfio * updated libsystem_file * moved libuna include from ewftools to libsystem * fixed some small memory leaks in ewftools * moved ewfsignal to libsystem_signal 20090817 * worked on common system library for ewftools * updated msvscpp solution files * updated libewf_date_time * updated include/libewf/codepage.h * updated libbfio 20090816 * worked on common system library for ewftools 20090815 * worked on common system library for ewftools * rewrote ewftools date and time functions * rewrote ewftools error string functions * refactored ewftools to work with libsystem 20090811 * worked on Borland C++ Builder compiler support * updated libbfio, liberror and libuna * added m4 directory support to autoconf/make files for libtool * updated list type * fixed define error in libewf_libuna.h and libewf_libbfio.h * updated libewf_notify * updated ewftools: date_time, file_io, file_stream_io, glob 20090629 * worked on implementing Borland compiler patches * updated msvscpp for libnotify 20090628 * updated libbfio * updated liberror * updated libnotify * fixed Windows 64-bit ssize_t definition issue (pointerd out by Xavier Roche) * worked on implementing Borland compiler patches by Peter Van Hove of IsoBuster - added liberror sprint functions 20090624 * updated libbfio * added allow shared read to device handle CreateFile * fixed double string conversion in device handle for WINAPI build * removed system string trim copy function * added debug output to libewf_sessions * added support for handling empty last session * added libnotify 20090614 * small fix in libewf_glob_free * worked on stable testing 20090609 * added libewf_glob_free to v2 API * disabled chunk size option in ewfexport 20090606 * fixed missing code for correctly handling acquiry and system date header values (Thanks to David Loveall) * started working on improved version of pyewf * fixed error in info_handle * fixed issue regarding date time string must required to be at least 32 bytes should be at least 20 or 25 20090528 * fixed error in marco libewf_get_header_value_case_number (thanks to Guy Voncken) * updated libbfio, implemented support for track changes function * implemented generation of common/types.h by autoconf 20090512 * updated liberror, libuna and libbfio * worked fix for ewfexport for different input and output chunk sizes for low level functions * checked use of uninitialized ->chunk_size ini ewftools handles * fixed error in ewfacquire for write resume with low level functions * fixed error in prepare write chunk for resume write 20090511 * bug fix in ewfacquire error handling code * commented out some unused code * bug fix in libewf handle open regarding base name 20090510 * updated libbfio * added libewf_get_flags_write_resume * fixed small memory leak in verification and export handles 20090509 * worked on support for missing segment files (chunks) * applied patch by aozsyn for compilation errors of API v1 with low level functions and python bindings * corrected pyewf compiler warnings * worked on detecting device removal, write finalize no longer closes segment files if the media size was known and not entirely written * ewfacquire now adds model and serial to header values * ewfacquirestream implemented -B as write size upper boundary * ewfacquirestream implemented -o as skip of an number of bytes * ewfacquire: added support for acquiry resume offset alignment, for non block boundary offsets * fixed crc buffer alignment error in write * removed get version and flags for local usage of libewf * fixed pyewf API v2 support * fixed small memory leak in ewfinfo 20090506 * fixed unsupported codepage 0 on NetBSD, system string too strict 20090504 * fixed error in device read error handling * added Darwin uuid/uuid.h support * removed check for caseless string compare from configure * added error to file_io updated system string accordingly * added 32-bit number of sectors for MacOS-X * refactored guid generate from ewfcommon to guid * fixes for winapi * added Cygwin uuid/uuid.h support * changed ewftools dll import for Cygwin * added libewf_is_dll to libewf.c, this function is not exported 20090503 * worked on usb disk support * limited EWF/ENCASE1/SMART format to max 2 TiB acquire size * encase6 format is now default * library and tools pass automated tests * fixed error in device handle seek offset not correctly returning the current offset * fixed error in device read error handling 20090502 * worked on bus type support * worked on optical disk support * worked on usb disk support * worked on Tableau support 20090501 * implemented 64-bit sector support for add crc and acquiry error and sessions in APIv2 * worked on refactoring volume type into media flags in ewftools * added set media flags function to APIv1 20090429 * update for new findings regarding volume/data section * changed APIv2 function handle_get_amount_of_sectors to have a 64-bit parameter instead of 32-bit * worked on EnCase Fastbloc write blocker support 20090427 * updated libuna * worked on EnCase 6.13 Tableau write blocker support * remove volume type functions/definitions in APIv2 and changed it to media flags 20090426 * worked on device information * updated libbfio 20090425 * worked on libbfio exists handle function update * updated libbfio * worked on GUID support for windows build * extents header value is now formatted in more table like manner * fixed hash value identifier size issue in info and verification handle * rename libewf_format to ewf_format in ewftools * worked on device information 20090424 * updated libbfio - exist handle function update 20090422 * updated configure.ac * worked on local use support * implement codepage header file like in libpff * moved typedef from handle.h to type.h include header file * worked on automatic testing of write resume 20090421 * fixes for MSVSCPP build * moved segment file size from write io handle to segment table * segment file size is now set on read 20090420 * moved write finalize function to write io handle * refactored sections correction out of write finalize function into separate functions * removed \n from error strings in libewf and ewftools * moved write initialize and resume functions to write io handle * refactored chunk offset correction for last filled/compared offset 20090419 * worked on date and time strings * changed crc_buffer from uint8_t * to void * * libewf now tracks if pool was created inside library * worked on acquiry resume * updated libbfio * added get segment file size functions to API 20090418 * changes for local use of libewf in libsmio * updated process_status to use liberror * worked on glob to use liberror * updated libuna * worked on adding set_header_codepage to ewftools * worked on error tollerance * worked on preservation of timestamps in header values * fixed error in libewf_set_header_codepage * EWFX date values now contain +/- UTC/GMT difference 20090415 * fixed == in configure.ac 20090414 * added to do to ewfexport 20090412 * refactored order of functions handles: open, close, read, write, seek * corrected LIBEWF_DLL_EXPORT in ewftools to LIBEWF_DLL_IMPORT * worked on imaging handle and ewfacquire * fixed double free in verification and export handle * updated libbfio 20090411 * fixed misplaces #endif in libewf header file * fixed smart string length in ewfinput * changed compress empty block into compression flags in ewftools 20090410 * small adjustments 20090405 * small adjustments 20090404 * implemented chunk and crc buffer alignment * fixed crc mismatch in read delta chunk * added support for delta chunks in libewf_handle_prepare_write_chunk * added chunk size restriction in libewf_write_io_handle_write_existing_chunk * updated libbfio * added APIv2 function to retrieve current segment filename * refactored file_io out of device_handle * ewfexport, ewfverify now show which files contain CRC errors when compiled with APIv2 support * worked on header codepage support in ewftools 20090403 * added configure option for static executables * change raw-access configure option to low-level-functions * fixed on raw access in ewfalter * fixed read/write write beyond file size corruption 20090402 * Worked on pyewf * Removed EWFCOMMON_BUFFER_SIZE from tests 20090401 * Fixed some small errors in API version 1 legacy support * changed compress_emtpy_block into a compression flag * changed empty block compression behavior for all compression levels * add whence SEEK_SET, SEEK_END with 0 offset support to seek_offset * refactored libewf_write to libewf_write_io_handle * added support for Cygwin US-ASCII character set to system string 20090330 * Updated caseless compare functions with WINAPI support 20090329 * removed libbfio_file_io.[ch] * worked on adding system error string support to libbfio error messages * fixed multiple errors * cleaned end of lines in error in libbfio * worked on Windows PhysicalDrive device access 20090328 * updated narrow and wide string definitions * removed HAVE_WIDE_CHARACTER_SUPPORT_FUNCTIONS * change LIBBFIO_WIDE_SYSTEM_CHARACTER_TYPE into LIBBFIO_WIDE_SYSTEM_CHARACTER_T and implemented WINAPI UNICODE system string detection * worked on removing libbfio_file_io.[ch] 20090326 * updated type.h with corrected printf format specifiers for Windows 20090325 * updated windows config 20090324 * worked on native WINAPI file access in libbfio and device_handle * fixed SetFilePointerEx offset correction for SEEK_CUR 20090323 * updated make dist for missing libbfio msvscpp files * fixes for msvscpp build * updated config_windows.h * worked on native WINAPI file access in libbfio and device_handle 20090316 * worked on refactorin libewf_write 20090315 * worked on implementig v2 api in ewftools * moved fgets to file stream IO * renamed v2 api raw read/write functions * refactored libewf_read into libewf_handle and libewf_read_io_handle * refactored libewf_write into libewf_handle and libewf_write_io_handle * worked on libewf_handle_open_pool * removed libewf_internal_handle_create_header_values, default header values are now empty 20090314 * added verion 1 api disable functionality to configure.ac for testing purposes * worked on signal handler for ewftools handles 20090313 * worked on unifying header/hash value functions ini the ewftools * worked on alteration handle 20090312 * added support for separate libbfio * updated glob.[ch] 20090310 * added segment file name size functions * changed program to system string 20090309 * added values table get identifier and value size functions 20090308 * worked on libbfio support - created libbfio_pool - refactor libbfio_handle initialization out of libbfio_pool - implemented SEEK_END in libbfio_file and libbfio_handle * implemented libbfio_pool in libewf * worked on v2 api * changed libewf_character_t into uint8_t in libewf_values_table * implemented libbfio_file_exists 20090307 * worked on libbfio support * worked on v2 api 20090304 * worked on v2 api 20090303 * worked on raw access in verification handle * worked on raw access in export handle 20090302 * worked on raw access in export handle * updated manuals 20090301 * fixed regarding additional space in date value in libewf_convert_date_xheader_value * worked on export handle * fixed empty chunk issue in libewf_read_process_chunk_data * worked on info handle * fixed offset correction error in libewf_file_io_handle_seek_offset * fixed memory leak in libewf_open introduced by legacy change * removed ewflibewf * fixed wide character type support compilation 20090228 * worked on simplifying read input function for ewfacquire(stream) * worked on device handle - moved device code in ewfacquire to device handle * added support for missing units in byte size string (defaults to mebibytes) * fixed byte size string increment for no factor definition * ewfacquire added -P option to set bytes per sector * updated manuals * added support for optical disk and memory media type in ewfacquire(stream) * if removable or optical media type are chosen ewfacquire now defaults volume type to logical * worked on info handle * worked on export handle 20090227 * worked on imaging handle - refactored read input function * worked on simplifying read input function for ewfacquire(stream) * fixed missing verbose output * worked on detection of sector size 20090225 * worked on imaging handle raw access support * worked on v2 api * fixed delcaration error in libewf_error.h * moved error functions to libewf_error.c * moved remaining function in libewf_file to libewf_support * removed libewf_file * added description of functionality of tools in usage information * renamed libewf_interface into libewf_metadata * implemented imaging handle in ewfacquirestream 20090224 * worked on imaging handle * worked on v2 api * MD5 and SHA1 digest are now set by libewf_set_hash_value function 20090223 * worked on imaging handle 20090222 * worked on locale support * worked on imaging handle * worked on v2 api 20090219 * fixed rogue free of filenames in verification handle in amount_of_files check * fixed v2 api support in verification_handle_open 20090209 * worked on support for EnCase 6.12 SHA1 hash * fixed error in unknown section debug output * added support for process identifier and extents header2 values * fixed NULL free in ewfverify 20090125 * worked on ewfverify and verification handle * fixed missing libewf memwatch flags 20090124 * fixed missing quoted in configure.ac 20090118 * Updated headers * Updated configure.ac to conform to cache value naming schema * Updated autoconf/make to use flags and library definitions * Fixed missing notify_dump_data in for debug output * debug output is only provided on verbose output * worked on ewfverify and verification handle * Merged changes for EnCase 6.11 winen file format and memory image from 20080609 beta branch * Removed byte swap from ewfverify not needed 20081207 * fix for printing GUID 20081019 * Updated liberror * Added splint make option * Worked on verification handle 20081018 * Minor adjustments * Updated liberror_definitions with encryption error definitions 20081015 * Minor adjustments 20081013 * Fixed APIv2 of libewf_check_file_signature 20081012 * Worked on UTF character suppport 20081011 * changed ewfguid into guid * removed string duplicate functions * Worked on MSVSCPP build * Worked on UTF character suppport 20081007 * small adjustments to support 20081005 * small adjustments to file io 20080928 * worked on making ewftools code more gereneric * worked on making UTF-8 strings for internal use (not for filenames) 20080927 * small adjustment in makefiles 20080922 * fixed typo in definitions and internal definitions 20080921 * updated libuna * updated configure and Makefiles * implemented liberror * renamed doc into documents * removed date_time and notify from common * changed HAVE_WINDOWS_API into WINAPI 20080917 * Small change in configure.ac 20080916 * Fixed issue in error * Updated libuna 20080915 * worked on experimental version 2 API currently requires additional configure flag - made libewf_handle_initialize and libewf_handle_free available - rewrote open and close in correspondence with handle_initialize and handle_free 20080914 * worked on separation of narrow and wide character string functions 20080913 * worked on separation of narrow and wide character string functions 20080912 * worked on improved error handling * removed error tollerance setting the code will be error tollerant if it is able to compensate or certain a value is valid * fixed issue regarding write finalize did not set data sections correctly for streamed writes due to data section cache * changed chunk offset compressed value to flags to also contain corrupted * worked on improved method of handling corrupted offset tables 20080911 * worked on improved error handling 20080910 * worked on libuna * worked on improved error handling * implemted new version of notify dump data * fixed check of libewf_string_snprintf should also check for > size * removed explicit set end of string after snprintf * worked on clean up of common 20080909 * replaced libuca with libuna * worked on improved error handling based on libuna version 20080908 * minor changes to configure.ac 20080907 * worked on refactoring functions in ewfinput, too large input is now flushed * refactored ewfcommon_determine_operating_system * ewftools: added process buffer size option - this allows performance testing using different buffer sizes * ewftools: added missing in usage information * ewfexport: added -l option * ewfexport: added calculation of MD5 adn SHA1 hash of exported data * ewfexport: fixed bug exporting with SHA1 hash * ewftools: updated manuals * ewfacquirestream: fixed issue not being able to terminate by CTRL+C due to block by reading from stding - stdin is now forced to close in the signal handler * file io pool now allows to be initialize with 0 file io handles * fixed memory leak due to section list rewrite * ewfacquire: worked on non interactive mode * fixed error in byte size calculation for values with 2 digits after the separator * added acquire unattended to automated tests (separate test cycle) * added export sha1 to automated tests (part of alter test cycle) * fixed issue where last segment file contained next section when acquired with ewfacquirestream * ewfverify: print additional available hashes 20080906 * refactored section list to use list type * refactored libewf_values_table * parse hash values will now handle MD5 hash to MD5 hash value conversion * get MD5 hash will now handle MD5 hash value to MD5 hash conversion * set MD5 hash will now handle MD5 hash to MD5 hash value conversion * get MD5 hash value will now handle MD5 hash to MD5 hash value conversion * set MD5 hash value will now handle MD5 hash value to MD5 hash conversion 20080905 * worked on refactoring code * rewrote _alloc() functions into _initialize() functions with corresponding _free() functions * worked on file io pooling * improved way to determine if a segment file has been closed after write 20080904 * worked on refactoring functions in ewfinput * combined empty block compression and other compressions in ewftools * change empty_block to empty-block the former remains to work * fixed error in UTF-8 handling (libuca) * updated MacOS-X package changed project website * updated MSVSCPP project files * fixed multiple ewfglob issues * removed secondary offset table from handle libewf now checks and corrects differences with primary offset table * integrated check for ctime in autoconf CTIME check * created libewf_handle_initialize and libewf_handle_free functions not available for api yet 20080903 * worked on integrating libuca and replacing string conversion routines * fixed missing split lines issue in libewf_header_values_parse_header_string * fixed underflow issue in libewf_string_split 20080902 * refactored process status * code clean up in ewftools * implemented ewfguid * refactored character string split to return int * changed project website * worked on integrating libuca and replacing string conversion routines * removed ewf_char.h and ewf_string.h 20080901 * refactored ewfglob 20080831 * added libewf_extern.h * Improved configure.ac 20080830 * removed errno.h include from ewftools where not used * Improved common and configure.ac * Renamed _char_t functions to _system_character functions in ewftools 20080821 * ewfalter now support single segment file as argument 20080820 * ewfverify, ewfinfo and ewfexport now support single segment file as argument * fixed bug in libewf_glob function in automatic detection of ewf type 20080810 * fixes to the python bindings based on patch by David Collett 20080809 * Synchronised branches * Fixed seek end of file based on patch by David Collett * Fixed return at wrong location in libewf_date_time_gmtime * Implemented libewf_get_offset API function * relicensed to LGPL * implement features.h * updated common with libpff 20080808 version * changed libewf_notify_set_values in libewf_file.c to notify_set_values * implemented python bindings based on patch by David Collett 20080705 * added ewfouput_error_fprint 20080704 * added fopen and fclose to configure 20080511 * minor changes 20080505 * Consistency update in API for get and set media and volume type functions * Updated configure.ac 20080501 * Fixed the package config file (.pc) (Nicolas (kwizart)) * Fixed the debian package files (Guy Voncke)n * Fixed minor issue in the manual (Guy Vonckens) * Fixed make lib (Christophe Grenier) 20080430 * Fixed in configuration for MSVCPP wide character compilation * Fixed small memory leak 20080426 * Minor changes 20080416 * Minor changes 20080412 * Fixed issue (introduced by RW fixes) in libewf_glob * Uncommented dh_makeshlibs in debian/rules 20080405 * Moved basename from segment table entry 0 to segment table * The segment filename can now be overwritten during acquiry this allows alternative segment filename paths * updated manuals * improved ewfalter test scenarios 20080403 * Fixed macosx installation path 20080330 * Fixed multiple bugs in read write mode, delta files were initiallity opened without read access * Worked on ewfalter to handle more complex RW scenarios * Changed libewf_read_chunk_data no longer to copy to buffer if buffer is the chunk cache data * Fixed unnecessary reopen of delta segement file in libewf_segment_table_create_segment_file 20080329 * Fixed wrong license in MacOS-X package 20080323 * Moved functions in libewf_file to libewf_interface and libewf_support * Renamed libewf_internal_handle to libewf_handle 20080322 * implemented endian conversion macros * fixed minor issue in libewf_debug_header_print 20080320 * performance testing * fix for %jd and %zd detection for gcc-2.95 on Debian 3.1 * fix for openssl evp and gcc-2.95 on Debian 3.1 * fixed sha.h detection error in autoconf/make scripts * updated manuals * fix for %jd and %zd detection for OpenBSD because gcc throws a warning if %jd has no parameter but fails to print the parameter * implement usage of LIBEWF_WIDE_CHARACTER_TYPE instead of HAVE_WIDE_CHARACTER_TYPE in header and source files except in common code 20080319 * refactored test write functions * refactored the conversion from offset table to table offsets from section to segment file this reduces multiple unnecessary conversion 20080318 * removed overflow from write - this seems to be a bug in EnCase 6.7.1 behavior is no longer present in EnCase 6.8, read still support overflow this will allow to convert faulty EnCase 6.7.1 EWF files 20080317 * fixed typo in configure.ac * libewf EnCase 6 >2GB segment files not compatible with EnCase 6.8 offset table overflow is no longer written by libewf * added LIBEWF_CD_SUPPORT for testing purposes - no way to detect number of sessions yet, will default to 1 section with start sector 1 * changed trailing bytes warning into verbose print 20080315 * corrected dist clean in Makefile.am * corrections for MSVCPP project * fixed binary stdout for WINDOWS version of ewfexport * fixed binary stdin for WINDOWS version of ewfacquirestream 20080314 * Fix for verbose output 20080313 * tested session section R/W functionality * made package ready for stable test 20080312 * Code clean up * ewftools implicitly link libcommon * fixed memory leak in header values for export to ewf 20080309 * Code clean up * fixed ewfcommon_determine_operating_system * fixed overflow on compression read error, buffer is no longer passed for compressed chunks * fixed raw access parameter mix up 20080308 * Code clean up * worked on seperating common code * fixed issue with byte size string and more than 1 digit after the seperator will now handle 2 digits and skip remaining * fixed issue with minimum segement file size in ewf tools also lowered values to 1.0 MiB * implemented determining session size * fixed MSVCPP project * fiexde signal handling for Windows 20080306 * Code clean up * worked on seperating common code 20080305 * Code clean up * worked on signal handling * fixed issues with date string in header * fixes for missing printf "%jd" and "%zd" under Cygwin and WIN32 * worked on seperating common code 20080304 * Code clean up * worked on signal handling * fixed error due to fclose( NULL ) in ewftools 20080303 * Code clean up * added byte size string to ewfinfo * updated manuals of ewfinfo * worked on signal handling 20080302 * Code clean up * worked on session support * ewfinfo will now output session information if present part of media information * worked on byte size string * added byte size string to ewfacquire, ewfacquirestream and ewfexport segment file size, not to acquiry size due to possible rounding errors * updated manuals of ewfacquire, ewfacquirestream and ewfexport 20080301 * Code clean up * Refactored hash and header value functions * fixed writing incorrect linen6 header 20080229 * Code clean up * safe guarded libewf set functions for read/write * made header parse more fault tollerant * rewrote UTF16 conversion routine also handle wide character strings solves issues with mbsrtowcs (handling characters like back space) 20080228 * Worked on not finalizing on error * Refactored libewf_header_values_parse_header and libewf_header_values_parse_header2 * Removed dirty value from offset table entry, reduces memory usage * worked on export to EWF * worked on handling not empty chunk cache in write existing data data in chunck cache is ignored for now, write existing is not called without a read handle * fixed logical error in write existing data 20080227 * refactored ewfdigest_hash * changed LIBEWF_VERSION into LIBEWF_VERSION_STRING and added numeric LIBEWF_VERSION * added LIBEWF_WIDE_CHARACTER_TYPE definition * Worked on not finalizing on error * Code clean up 20080225 * Worked on not finalizing on error 20080224 * Added error output to the log * refactored ewfinfo 20080223 * worked on logging of digest hashes to log file * refactored ewfacquire, ewfacquirestream, ewfexport, ewfverify * updated manuals * moved libewf_internal_handle_determine_format to header_sections 20080221 * fixed logical error in libewf_write_test_chunks_section_full changed section_amount_of_chunks > maximum_section_amount_of_chunks to >= solves >16375 chunks offset table issue 20080220 * Worked on refactoring chunk dirty to segment file type 20080219 * removed corruption detection test in libewf_segment_file_write_chunks_data no longer needed * code cleanup * refactored use internal handle in libewf_write 20080217 * added corruption detection test in libewf_segment_file_write_chunks_data needed for test 20080214 * worked on abort * worked on low memory usage * code cleanup * removed libewf_filename_get and libewf_filename_set 20080212 * fixed ewfverify the EWF file can be verified without the integrity hash as pointed out by David Loveall * fixed incorrect default segment file size in ewfacquirestream as pointed out by Dennis Schreiber * fixed missing ewfinfo -e option 20080202 * code cleanup 20080129 * small adjustment in libewf_get_format function 20080127 * corrected comment in libewf.h.in 20080126 * code clean up * implemented libewf_glob function * worked on signal abort function * fixed incorrect return value in raw read 20080119 * worked on basic multi threaded safety 20080115 * worked on refactoring write initialize * added initialize function for format specific write values * added initialize function for media values specific write values 20080114 * removed initialize write in libewf_raw_write_prepare_buffer messes up multi threaded compression aproach * removed write initialize from libewf_get_chunk_size chunk_size is calculated on set of sectors_per_chunk and bytes_per_sector * removed libewf_internal_handle_read_initialize * worked on refactoring write initialize 20080112 * removed errno from library * fixed error regarding hours in ewfoutput_timestamp_fprint 20080107 * added more verbose output for raw write * added check for read sub handle in libewf_write_buffer and libewf_raw_write_buffer 20080106 * worked on removing type definition 20080105 * Used memwatch to analyze allocation issues * Fixed memory leakage due to insufficient error clean up in libewf_segment_table_read_open * ewfacquire user input now defaults on error instead of bailing out 20080103 * Used memwatch to analyze allocation issues * Fixed memory leakage in values list and in internal handle with sector table * Fixed missing libewf_common_alloc in ewfalter * Added NULL pointer free protection against non NULL protected libewf_common_free replacements 20080102 * Updated package config file 20071230 * adjustments to summary message to configure.ac * worked on MacOS-X package 20071229 * added summary message to configure.ac * small changed to debian package files and Makefile.am 20071228 * removed libewf_error_sector_table.h * type definition consistency changes in read input function in ewftools * updated year in copyright * changed LIBEWF_SECTOR_TABLE to libewf_sector_table_t * changed LIBEWF_CHAR and EWF_CHAR into libewf_char_t and ewf_char_t * changed EWF_SESSION and EWF_SESSION_ENTRY to ewf_session_t and ewf_session_entry_t 20071227 * moved hash string length from libewf definitions to ewfstring 20071222 * changed CDROM media type into CD media type 20071209 * minor changes to debian package files * fixes for the MS Visual C++ build * added ewfalter to MSVCpp build 20071208 * pkgconfig added to spec file 20071205 * minor change in defaults 20071201 * worked on refactoring code * API changes to get and set functions 20071130 * worked on refactoring code 20071129 * worked on refactoring code * fixed error in delta chunk size 20071128 * worked on refactoring code 20071126 * minor changes 20071124 * worked on refactoring code * made buffer passthrough default behavior * ewfexport added sha1 calculation support * fixed error writing segment files > 2 Gib * reduced multiple successive crc error entries to a single * reduced multiple successive acquiry error (error2) entries to a single * ewfcommon_export_ewf added raw access write support * change string to (u)int64 conversion routines to use long long equivalents * ewfacquirestream and ewfexport added > 2 GiB segment file support * libewf_filename_create now takes string and length as parameters * ewfalter added functionality to set delta segment file path/basename 20071123 * worked on refactoring code * moved libewf_offset_table_compare after the full index build in libewf_segment_file_read_open * added chunk size to delta chunk for redundancy * removed internal handle from most functions in section * ewfexport added argument set detection for interactive mode * section read count is returned instead of section size when possible * fixed win32 support solution file and ewfglob * added section type length to section list entry * added length filename in segment file struct * fixed error in error2 section regarding debug * worked on session section * added CD-ROM media type 20071121 * worked on refactoring code * libewf no longer allows to raw read/write a chunk of 0 bytes 20071120 * worked on refactoring code 20071119 * worked on refactoring to use segment file struct in section * changed stored delta segment number to 1 ... x count instead of 0 ... x count 20071118 * refactored segment table to a table of segment file ** * refactored offset table chunk offset segment_number and file_descriptor to reference of segment file * worked on refactoring to use segment file struct in section 20071117 * changed MB to MiB, etc. * worked on refactoring offset table to table of chunk offsets * worked on IO pool * removed common alloc/realloc cleared functions * libewf_segment_file_write_open is now used by libewf_open * removed libewf_offset_table_set_values * implemented libewf_filename to reduce code duplication for wide character type * worked on refactoring the offset table to use the segment file struct 20071114 * worked on refactoring segment files functions 20071113 * worked on refactoring segment table to table of segment files * fixed error in libewf_raw_read_chunk regarding use of the right segment table * worked on refactoring offset table to table of chunnk offsets 20071112 * change default segment file size to 1500 MB (^10) about 1400 MB in (^2), 3x segment files should fit on a DVD * worked on refactoring segment table to table of segment files * removed segment number in table check from libewf_segment_file_read_sections() 20071111 * changed default wipe behavior for ewfacquire(stream) default behavior is that only remainder of the chunk is wiped instead of the entire chunk * Updated manual pages 20071110 * updated MSVSC++ project files * commented out io pool * automated delta file testing * added libewf_convert_date_xheader_value * added ctime date format to ewfinfo which is now default refactored header values dat conversion functions * ewfacquire wipes remainder of chunk on acquiry error if wipe chunk is not set * fixed error in reading error2 section 20071107 * worked on delta file 20071106 * worked on delta file delta chunk header data is now 'protected' by a CRC * ewfacquire(stream) added check if last segment file is closed before telling acquiry was completed, by moving close handle before complete notification 20071105 * refactored raw access support in ewfexport 20071104 * refactored write functions * refactored read functions * worked on raw access support for ewfexport * small fixes in ewfexport * fixed write of duplicate table(s) in finalize, introduced by MD5 move * checked usage of stderr and stdout in ewfexport * worked on raw access support in ewfexport 20071103 * refactored write functions 20071030 * fixed input handling of format in ewfexport wide string support * fixed handling problems with raw read and size returned 20071028 * fixed error in write finalize for ewfacquirestream, due to restrictive check * fixed error for handling wide character delta segment filenames * worked on read wipe chunk on error * fixed miscalculation for CRC error in last chunk in read * added function to API to add CRC errors * fixed wrong function calls in ewfoutput_crc_errors_fprint 20071027 * Worked on cleaning up ewf struct read and write functions * Cleanup of set/get functions in internal handle * Added libewf_get_amount_of_acquiry_errors * Wrote API functions to rid ewfcommon of internal_handle for acquiry and CRC errors, header and hash values * Moved duplicate code for handling header and hash values into libewf_values_table * Removed internal_handle from ewftools * ewftools no longer create human readable byte string if size <= 1024 * changed int8_t return values into int return values * changed libewf_get and libewf_set functions for API consistency * moved several get and set functions from internal handle to file * fixed error in windows retrieving digest hashes 20071016 * Worked on cleaning up ewf struct read and write functions 20071015 * Worked on file io handler * Worked on cleaning up ewf struct read and write functions * change section start to static definition in libewf_section_last_write and libewf_section_start_write 20071009 * Worked on file io handler 20070919 * Worked on implementing raw read in ewftools 20070918 * Worked on implementing raw read in ewftools 20070916 * Fixed bug in libewf_section_hash_read introduced by MD5 calculation removal * Worked on implementing raw read in ewftools - moved the string functions from ewfcommon to ewfstring - moved the user input functions from ewfcommon to ewfinput - moved the user output functions from ewfcommon to ewfoutput - updated MSVCPP project files - seperated read and crc/uncompression functions 20070915 * Worked on deb based package - added distclean make directive * Adjusted rpm based package * fixed for rogue next sections in delta segment file section list during RW * fixed libewf_debug_read_section to handle a size of size64_t - still limited to SSIZE_MAX 20070912 * fixed on error in delta file accouting for multiple rewrites * removed libewf_write_chunk, libewf_internal_handle_read_is_initialized and libewf_internal_handle_write_is_initialized * fixed write finalize after R or RW open * clean up of small to do's 20070910 * worked to allow to set the delta file path * fixed error in delta file header offset handing * worked on error regarding delta file end 20070908 * worked on remove of MD5 calculation from library - implemented MD5 calculation in ewfcommon for ewfacquire and ewfacquirestream - removed libewf_set_media_values, calculated_md5_hash and libewf_raw_update_md5 from API - removed digest context and MD5 from library - removed calculated MD5 hash and MD5 context from internal handle - added macros libewf_get_hash_value_md5 and libewf_get_hash_value_sha1 to API - added macros libewf_set_hash_value_md5 and libewf_set_hash_value_sha1 to API - removed libewf_get_md5_hash from API - removed several libewf_internal_handle_get_ and libewf_internal_handle_set_ functions * worked on write support for > 2 GiB segment file for EnCase 6.7 * added check to libewf_close to enforce libewf_write_finalize * worked on having compound reallocation functions return an integer as result - removed libewf_internal_handle_chunk_cache_realloc * worked on moving byte swap out library into ewftools - removed libewf_set_swap_byte_pairs from API 20070905 * worked on remove of MD5 calculation from library - removed MD5 calculation from read - implemented MD5 calculation in ewfcommon for ewfverify - removed hashed flags in offset table - removed libewf_calculate_md5_hash from API * worked on read support for > 2 GiB segment file for EnCase 6.7 20070830 * changed use of stdout and stderr in ewfacquirestream, ewfinfo, ewfalter * removed program: error output in ewfacquire, ewfverify * fixed duplicate write of delta chunks 20070829 * worked on read support for > 2 GiB segment file for EnCase 6.7 * worked on write support for > 2 GiB segment file for EnCase 6.7 * worked on session section support * changed use of stdout and stderr in ewfverify * added errno == 0 check in ewftools after libewf open to prevent the following output "Unable to open EWF file(s) with failure: Success." 20070828 * worked on read support for > 2 GiB segment file for EnCase 6.7 * changed off_t to off64_t for Windows > 2 GiB segment file support * worked on write support for > 2 GiB segment file for EnCase 6.7 * changed use of stdout and stderr in ewfacquire 20070827 * removed libewf_common_string_copy and libewf_common_wide_string_copy using memcpy instead * changed some int8_t return values into int return values * worked on changing libewf_get functions for API consistency * removed unused macros from internal handle * replaced libewf_set_media_values by libewf_set_sectors_per_chunk and libewf_set_bytes_per_sector 20070822 * worked on allowing the internal MD5 calculation to be disabled * changed some int8_t return values to int 20070821 * worked on ewfexport exporting ewf formatted data for delta merge * print a more detailed error in ewftools for open errors * fixed number of bytes to acquire in ewfacquire 20070819 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files * change libewf_offset_table_realloc to return integer value because function does not change pointer of offset table itself the same for libewf_fill_offset_table and libewf_offset_table_read * completed reading dirty chunks from delta segment files * fixed spelling error in unsuported => unsupported in ewftools * rewritten #ifdef to #if defined() and #ifndef to #if !defined() * refactored user input handling code from ewftools to ewfcommon * worked on ewfexport exporting ewf formatted data for delta merge ewfexport no longer exports to stdout specify '-t -' to write to stdout only for continuous raw output * added libewf_get_flags_ function for use of libewf in Phyton with ctypes 20070818 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files * completed refactoring of PRINT( "libewf and PRINT( "ewf function names * changed warning strings with 2^ values to value exceeds maximum * write optimalisation: - the data section is cached for multiple writes - refactored libewf_get_chunk_size out of ewfcommon_read_input * removed libewf_write_process_chunk_data no longer needed 20070816 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files * removed internal handle passing from libewf_section_start_read, libewf_section_start_write * changed section start allocation in libewf_section_start_read from dynamic to static 20070815 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files 20070814 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files * made macros of libewf_date_string_set_month, libewf_date_string_set_day_of_month, etc. in header values 20070813 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files 20070812 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files * moved gmtime function from libewf_common to ewfcommon * removed error string from libewf_write_finalize * moved strerror functions from libewf_common to ewfcommon * removed chunk cache passthrough 20070811 * removed external char * removed error string from libewf_check_file_signature, libewf_segment_file_read_open, libewf_segment_file_write_open * merged common code in wide and narrow functions * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files * removed segment_table_build 20070809 * fixed weird progress indiction, changed localtime into gmtime * fixed error in libewf_close comment regarding return value 20070807 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files 20070806 * worked on restructuring to improve internal structure * worked on improved rewrite using delta segment files 20070728 * worked on restructuring to improve internal structure 20070725 * worked on restructuring to improve internal structure 20070723 * worked on allowing to read raw buffers as chunks * worked on restructuring to improve internal structure 20070722 * worked on allowing to write raw buffers as chunks 20070721 * worked on allowing to write raw buffers as chunks * removed is_dll function no need * adjusted seek offset function * added libewf_segment_file to give library improved structure 20070718 * worked on allowing to write raw buffers as chunks 20070717 * worked on allowing to write raw buffers as chunks * refactored function names into static char * * ewfacquire stream made physical default instead of logical just like in ewfacquire * fixed configuration error in MSVS C++ libewf_dll project file wrong DLL compilation mode /MT * added fix for off_t being 32 it in MSVS C++ 20070716 * worked on allowing to write raw buffers as chunks * refactored function names into static char * 20070715 * worked on libtool DLL support * worked on allowing to write raw buffers as chunks * fixed reallocation bug in libewf_internal_handle_add_crc_error_chunk * refactored function names into static char * 20070714 * worked on libtool DLL support * worked on allowing to write raw buffers as chunks * refactored function names into static char * 20070713 * worked on libtool DLL support - changed macros in libewf_extern.h into LIBEWF_DLL_EXPORT and _IMPORT without the S * made libcrypto EVP interface default, use MD5 and SHA1 as fallback * refactored function names into static char * 20070710 * refactored function names into static char * * removed type from configure.ac 20070708 * worked on space in directory issue * added DLL support to configure.ac 20070707 * added fix for missing type definition u64 in linux/fs.h on some platforms * worked on issue with progress indicator, removed usage of difftime time_t B - time_t A should equal difftime without conversion to double 20070526 * removed the advertisement clause from the license 20070512 * changed default order of physical and logical in ewfacquire - makes more sense this way * updated manuals * fixed error in example of ewfacquire manual page 20070407 * minor corrections for Win32 port * fixed error in passing error retry value in ewftools * fixed memory corruption in libewf_internal_handle_set_acquiry_error_sector 20070406 * worked on next stable release * added status print to ewfacquirestream * change to print of type in notify 20070317 * worked on next stable release * changed libcrypto back to the MD5_ and SHA1_ interface still allows for EVP and Windows Crypto API 20070304 * minor type adjustments 20070303 * fixed bug regarding growth of segment file beyond maximum size 20070225 * fixed typo in libewf_handle.h * fixed cause of segmentation error in libcrypto 20070218 * added include of libewf_types to libewf_handle.h 20070210 * worked on changing size and offset types 20070208 * worked on changing size and offset types - fixed some errors while testing 20070207 * worked on changing size and offset types 20070206 * worked on changing size and offset types - updated libewf.3 20070205 * worked on changing size and offset types - fixed issue in section list after adjustments - reduces storage size and fixed issue in fill table 20070204 * worked on changing size and offset types 20070203 * worked on changing size and offset types - changed ewf_string_length, ewf_string_copy and ewf_string_compare into macro's - fixed memory leak in ewf_string_write_compressed * worked on code clean up - rewrote libewf_common_alloc and _realloc to macro's - rewrote libewf_common_read, _lseek, _write and _close to macro's - rewrote ewf_x alloc funtions to macro's - removed ewf_type specific alloc and free macro's - removed ewf_error2_sectors_realloc, was not used and resizing should be handled by libewf_common_realloc - removed ewf_table_offsets_realloc, was not used and resizing should be handled by libewf_common_realloc - removed ewf_string_realloc replaced by libewf_common_realloc - removed ewf_string_wipe replaced by libewf_common_memset - removed libewf_error_sector.c 20070131 * worked on changing size and offset types 20070130 * worked on changing size and offset types - file header now allocated statically - rewrote section type tests functions to macro's 20070129 * worked on changing size and offset types - added sys/types.h to libewf_types.h 20070128 * worked on seperate config header files for library and ewftools to fix installable header issue - removed LIBEWF_CHAR from API, wide functions were added * remove quick refences in header values - breaks compatibility with 0.2.1 version of libmodewf.c - was already broken due to new API design * moved non portable headers back to library path 20070127 * worked on seperate config header files for library and ewftools to fix installable header issue - changed functions containing CHAR_T in library to separate small and wide character functions (for trace-ability) - moved error_string print out of common function - removed open_read and open_write - moved copy from and to char_t functions out of the library into ewfcommon - CHAR_T now removed from library * implemented internal_handle to hide handle representation from outside code - added serveral API functions * renamed handle where used as internal handle to internal_handle 20070125 * worked on seperate config header files for library and ewftools to fix installable header issue 20070120 * now using openssl EVP interface instead of directly accessing MD5 functions * worked on implementation of xhash section - added hash values to handle - added get and set funtions for hash values - updated libewf.3 manual page * created a more generic digest_context and EWF digest hash to support SHA1 - replaces MD5 context and hash by digest context and hash * an option was added to allow for SHA1 calculation from ewfacquire and ewfacquirestream - updated manuals * added print of additional hashes to ewfinfo * added verification of SHA1 hash to ewfverify * seperate generic definitions from libewf_config.h 20070118 * worked on reducing the usage of header values quick references in libewf and ewftools * using equal definitions for CHAR_T as for LIBEWF_CHAR * worked on implementation of xhash section * fixed issue EWXF format not setting GUID in data section 20070117 * worked on reducing the usage of header values quick references in libewf and ewftools 20070116 * added new header values functions to libewf.3 manual * added reverse string search function * changed forward string search to macro * corrected error in split string due to new string search * changed string length function to macro * changed string compare function to macro (return type change) * changed string copy function to macro (return type change) - make sure the string is \0 terminated after copy * now using reverse search in parse xheader function for close tag * fixed error regarding the examiner_name parameter for ewfacquirestream 20070115 * adjusted creation of xheader string * added function to add user defined header value * added acquiry_software xheader value to ewfacquire and ewfacquirestream * changes to spec file to include ewfacquirestream * added function to parse xheader * added random GUID to EWFX * ewfinfo will now print extended header values * xheader: give acquiry date human readable timestamp with time zone * ewfinfo change Software used into Software version used 20070114 * worked on redesign of header values * fixed missing data issue in ewfacquirestream for large block sizes in combination with chunk cache passthrough * added manual for ewfacquirestrema and updated manuals * header values now uses a dynamic array - old pointers left in for compatibility at the moment 20070113 * changed free functions for basic types to macro's allows for optimization * made adjustments due to splint warnings - fixed error regarding buffer_size of ewf_crc_calculated being a signed interger while it should be an unsigned one - fixed error regarding parameter validation due to optimalizations in ewf_string_copy - fixed possible integer overflow in ewf_volume_calculate_chunk_size and ewf_volume_smart_calculate_chunk_size - fixed not checking the return value of close in libewf_common_close - adjusted compression level in header values from uint8_t to int8_t (for consistency) * changed API of libewf_close to return a status value - adjusted ewftools accordingly - most functions return -1 on error (for consistency) * removed STREAMED_WRITE sections * updated manuals 20070111 * fixed issue with unrestricting number of offsets * media flags are written to volume and data section 20070110 * changed libewf_set_write_media_type to set volume type * added option to set volume type in ewfacquire and ewfacquirestream * fixed error in new header types, two value lines do not contain additional tabs 20070109 * added information about unknown_md and _sn * added libewf_header_value for more generic approach to handling header values * the volume media type in EnCase uses 0x00 for a floppy image and 0x01 for a hard disk image * adjusted library for fixed/removable media type * added error granularity to read and write * added function to set and get error granularity * adjusted ewfinfo and ewfacquire to handle error granularity - not needed in ewfacquirestream cannot compensate errors in streams 20070108 * Fixed error in EWFX format header section should be xheader section * Removed setting value of unknown3 in data section 20070107 * worked on linen6 support * added EnCase6 and linen6 to automated test * added get_version function * fixed errors for handing a write of less data than chunk size * fixed error in EnCase6/linen6 header string creation * added 8192, 16384 or 32768 sectors per block size options * removed signature from hash section * fixed error in strerror for strerror fallback missing return statement * fixed error in test statement in configure.ac 20070104 * worked on automated acquirestream test * fixed error in ewfcommon_read_input for handing a write of less data than chunk size 20070103 * adjusted copyright notice * worked on EnCase6 support * corrected error in writing original EWF, EnCase1 and SMART format 20061231 * Fix for ctime_r detection not allowing for ctime fallback in configure script * Fix for incorrect handling of user provided strings in ewfacquirestream * Added missing sprintf function check and several precompiler definition changes by Christophe Grenier * configure and code now handles ctime_r 3rd argument under Solaris 20061230 * Fix for precompiler handling for gcc 2.95 in header_values * Moved GUID and operating software determination to ewfcommon * Changed autoconf detection of operating software fallback string * Added some options to ewfacquirestream * Fixed error in configure.ac regarding libuuid check * Added macros for tol and toul, with atol fallback support 20061229 * worked on read and write mode * removed chunk size buffer restriction from ewfcommon_read_chunk renamed it to ewfcommon_read_input * removed chunk cache wipe * several platforms tested 20061228 * added write remaining chunk data for streamed write to libewf_write_finalize * worked on read and write mode - added amount_of_chunks to segment table, contains the number of chunks of a segment file - removed segment_file_offset in handle write, overlap with file_offset in segment table - fill offset table while writing - removed handle->write->offset and ->amount_of_offsets - removed handle->write->create_segment_file 20061227 * added pkg-config file (still expirimental) * added a check to libewf_close to enforce libewf_write_finalize * moved libewf header files to include/libewf - should fix missing header problem * worked on read and write mode - added seek_offset - added read_buffer - added it to API and libewf man page - added ewfalter (expirimental) - rewrote read_chunk not to do its own offset checking - added write_random 20061226 * worked on read and write mode - added seek_chunk 20061225 * worked on read and write correction regarding new insight into table sections * added macro for sprintf fallback * added configure.ac check for Solaris ctime_r * rewrite of ewf_string to calculate the byte size for all lengths * rewrite of common wrapper functions to macro's (memset, memcpy, memcmp, free) - allow for compiler optimization for functions free, memset, memcpy, memcmp * worked on streamed write - added libewf_write_finalize (still expirimental) - created ewfacquirestream - added type to section_list_entry - have write functions set section_list_entries - basic streamed write mode now working - still needs more testing requiring options set by ewfacquirestream * corrected error in comment libewf_write_buffer in libewf.h 20061223 * test: full read & write on multiple platforms * test: different sized buffers for read and write * check into small segment files for a DVD image - more file handles than allowed will add support for this in the future * added make lib/library for libewf compilation only * removed multiple (same) -l from configure * added check for snprintf (djgpp seems to be missing this function) - will add fallback support to snprintf in the future * corrected file rights on source files * added libewf.spec to source package to allow rpmbuild -ta * fixed bug in reading header string 1 byte too little * libewf now warns if file exceeds the maximimum number of offsets in a table section * worked on read and write correction regarding new insight into table sections * added support for the original EWF format 20061219 * Added have config defaulting to libewf.h required for library include * several adjustments thanks to Christophe Grenier - manual/libewf.3 - libewf.spec.in - fix for 4 GiB support for native Windows compilation _lseek => _lseeki64 20061218 * added sys/types for Solaris signal.h include 20061217 * worked on testing for stable release * fix for NetBSD using zlib 1.1.4 missing compressBound function * moved factor 2 buffer size enlargement from ewf_string_uncompress into ewf_uncompress this matches behaviour of ewf_compress * added support for missing ctime_r, localtime_r and strerror_r fallback to ctime, localtime, strerror * manually added INT64_MAX definition - for platforms missing LLONG_MAX definition 20061216 * worked on testing for stable release * fixed bug for buffer passthrough exceeding the buffer boundary for compressed chunks * fixed bug for chunk cache passthrough * fixed reallocation of chunk cache for chunk cache passthrough * disabled -Wextra compiler flag for OpenBSD compilation * removed wcsftime and strftime for platform compatibility - now using snprintf based solution * fixed EnCase1 format error - contains only 1 header section * fixed handling of EnCase1 format in strict error mode * automatic generation of SPEC file thanks to Christophe Grenier 20061213 * worked on testing for stable release * fixed bug regarding too small copy of date strings * fixed bug regarding over correcting uncompressed string length 20061212 * Worked on Windows wide character support * adjusted string copy from/to char to char_t * finished first version of manpage libewf.3 20061211 * fixed typo in ewfacquire man page acquiry -> acquire * removed AC_FUNC_MALLOC and AC_FUN_REALLOC from configure.ac * fixed typo in libewf_includes.h HAVES_ -> HAVE_ * adjusted code for warnings in Windows port * changed segment number to 16 bit value in read and segment table * fixed issue with ewfgetopt * moved utf16 to/from ascii converion functions from ewf_string to libewf_string * added intermediate macros for wide character support under Windows * adjusted static string concats - MVC first executes the macro, after which it tries static string concat - gcc seems to do this in oposite order 20061209 * added stdint.h support to libewf_includes.h * changed $build to $target in configure.ac * added libewf.spec file * libewf version numbers will not contain a release number any more - no additional value other than for development * fixed bug in \r detection in parse_header_string - when string length is 0 * adjusted option order in ewfacquire help function - should be alphabetical * worked on man pages using input provided by Kees Mastwijk * corrected some small output inconsistencies 20061208 * worked on ewfinfo man page using input provided by Kees Mastwijk 20061207 * worked on calculating a GUID for write * added GUID get and set functions to libewf * added GUID check for data section * added GUID write for encase5 and linen5 format * ewfacquire now adds random GUID (uuid) for encase5 and time based GUID for linen5 - only if libuuid is present * ewfacquire added test for block or character device before determining device size * ewfcommon created generic version function - added library version information * changed version() to ewfcommon_copyright_fprint() * worked on ewfacquire man page using input provided by Kees Mastwijk 20061206 * added hypens to GUID output in ewfinfo * worked on calculating a GUID for write 20061204 * changed configure.in to configure.ac * moved CFLAGS to configure.ac * system dection code is now only used to determine the fallback string for ewfacquire - detection of available functions is now based on header detection * moved library code to ./libewf and code for the ewftools to ./ewftools and libewf.h to ./include * removed LIBEWF_H_USED_IN_PACKAGE * added defines to ewfcommon for different buffer size testing 20061201 * added optimalization definitions - for testing * implemented chunk cache passthrough * added configuration parameters for buffer passthrough and chunk cache passthrough - buffer passthrough does not seem to enhance the performance significantly - chunk cache passthrough does not seem to enhance the performance significantly * ewfacquire: ask or determine media type (fixed and removable) * added EWFX format (expirimental) - (basically EWF-E01 based format) - allows for section xheader, which contains header information in XML and is stored in an compressed string 20061130 * problem with media size calculation due to change - note: uint32_t * uint32_t = uint32_t and will not upscale to uint64_t * ewf_string: better solution for size*16 in ewf_string_uncompress - the length starts out with a factor 2 and keeps increasing by a factor 2 until string can be decompressed * moved process status and summary functions to ewfcommon * added process summary to ewfexport * read: will uncompress chunk directly to chunk sized buffers for non compressed chunks * are both the segment table and section list file descriptor value needed - can this be a single value? - the file descriptor in the section list was used as safe guard only - removed * Only use the chunk cache when the input buffer size does not suffice for reading or writing an entire chunk - the chunk cache actually reduces performance for sequential reads due to additional memcpy - completed * ewfverify: show status indicator * ewfverify: when done show time and Mb/s 20061129 * Media size is calculated when not set * Added -Wextra compile flag for addition warning values * fixed: weird floating point exception after recompilation of working versions in callback functions - this was actualy a division by zero in the callback function * read: added improved support for EnCase linen 5 format - adjusted libewf_header_values for more flexible header creation * write: removed the CRC after the offset table for the SMART format * write: added linen5 support * header values: removed trailing \r from last header value * write: fixed error regarding buffer passthrough * read: will read chunk directly to chunk sized buffers for non compressed chunks 20061128 * worked on performance enhancements * lseek is now only used if section data needs to be skipped - in libewf_sections_read_segment - in libewf_read_chunk - added segment number to offset table and file offset to segment table for basic offset tracking * found issues in documentation - EnCase1 (EWF-E01) format stores its chunks in the table sections not in the sectors section it uses an EWF-S01 alike layout - SMART in FTK Imager has a CRC at the end of the offset table * fixed read and write regarding issues in documentation * read: fixed error in recognizing FTK imager format 20061127 * worked on performance enhancements * changed ewf_crc_calculate to make use of zlib's adler32 function instead of algorithm derived of CRC algorithm by Andrew Rosen - this improves the performance significantly ;-) * changed libewf_endian functions for improved error handling * removed memcpy from chunk cache read to data for non compressed data in libewf_read_random 20061126 * worked on performance enhancements * changed iterator to 32 bit in ewf_crc_calculate saves conversion on a 32-bit platform 20061125 * worked on string and char types * changed ewf_sectors.[ch] into ewf_chunk.[ch] - chunks do not only reside in sectors sections therefore the name change * removed ewf_chunk.c - now uses ewf_string functions, moved necessary functions to libewf_string.[ch] * worked on performance enhancements * reduced CRC (de)allocations 20061124 * worked on performance enhancements * added buffer size option to ewfacquire 20061123 * worked on string and char types * added macros for static char or wchar_t type strings * note: fgets and fgetws cannot be used on the same stream after one and other * string: wide character support (wchar support) - Windows also provides tchar, tchar is a wrapper for both char and wchar_t * change char* to EWF_CHAR* or LIBEWF_CHAR* - allow for char and w_char interfacing with library - use LIBEWF_CHAR for char/w_char wrapping and EWF_CHAR for byte strings in EWF file format, CHAR_T required for wchar_t support in basic functions - make internal EWF related strings byte strings (EWF_CHAR) - make string functions safe to be char or uint8_t - use string.x for string functions * string: added length to libewf_string_search * string: added length to libewf_string_split * ewfacquire: added wchar_t support for utsname_buffer.sysname * ltree: changed ewf_tree_data_read * ewfinfo: added stored MD5 hash * ewfacquire: added print read errors on exit * all: in read and write functions add file_descriptor test - not necessary libewf_common functions do check this 20061122 * worked on string and char types * windows has: wmain for wide character arguments * moved getopt code to ewfgetopt for wmain support * moved glob code to ewfglob * changed libewf_open to match main and getopt type arguments * fixed check enable...=no validation - $withval needed to be $enableval * added CHAR_T and INT_T for wrapping character type of support functions like (w)open 20061121 * worked on string and char types * fixed: missing ewf_char.h, ewf_string.h and libewf_config_windows.h in package * changed COPYING and AUTHORS due to license issue * removed: libewf_common_string_to_uint64 and libewf_common_string_to_int64 * fixed: several compilation errors for wide character type support * added: strchr to ewfcommon for getopt support 20061119 * worked on string and char types * changed %s and %c where necessary to PRIs and PRIc 20061118 * worked on string and char types * string: removed LIBEWF_STRING type definition * string: removed string_copy_from/to_char functions * string: added wrapper PRIc for c, lc and PRIs for s, ls * common: removed strdup - no longer needed - libewf_string_duplicate takes care of this functionality * common: removed strchr - no longer needed - libewf_string_search takes care of this functionality * common: removed strncmp - no longer needed - libewf_string_compare takes care of this functionality * fixed: inconsistency in libewf.h and libewf_file.h * common: removed strlen - no longer needed - libewf_string_length takes care of this functionality 20061115 * worked on string and char types * implement libewf_string_copy_(from/to)_header functions * changed utf16/ascii convert to copy functions * libewf_string: allow to set multibyte strings from header values - still need to test this 20061114 * worked on string and char types * implemented non compressed read and write in ewf_string - for ltree tree data * fixed bug in compression buffer reallocation in ewf_string - reallocation pointer was not provided backwards * delay header and header2 conversion to parse function * moved basic ewf_header2 functions to ewf_char - ewf_header2 has become a type wrapper * string: make a more generic ewf_string (use this in ewf_header, ewf_header2, ewf_ltree) also move ASCII and UTF 20061113 * worked on string and char types * ewf_string removed several functions * moved basic ewf_header functions to ewf_char - ewf_header has become a type wrapper 20061112 * worked on string and char types * header_values: rewrite libewf_header_values_set_value to return integer with status code * moved md5hash to string function to libewf_string * moved ewf_section_fprint and ewf_header_fprint to libewf_debug 20061111 * ewfexport: added time estimate * moved byte print function to ewfcommon * added API functions to retrieve header values * string: add string copy * string: add string copy to char/w_char types 20061110 * Fixed strerror_r char * return type on Ubuntu 20061109 * Fixed several logical bugs in write_buffer - incorrect check of chunk cache passthrough - incorrect handling of buffer sizes - incorrect handling of last buffer write * Fixed bug in ewfexport adding 128 bytes - due to print output to stdout * Fixed output write libewf_write_test_segment_file_full * ewfacquire: added time estimate * libewf_common_open: added check for return values _sopen_s 20061029 * Worked on clean up of includes in libewf.h * Created API functions to get and set the header values - this moves the header values dependency out of the ewftools * Moved verbose into library, also added notify stream - windows port: allow error output stream redirection (libewf_notify) requires Visual C/C++ /MD compilation flag * Fixed a memory leak in ewf_header_read - the compressed header was not freed * Added alternative compile time method for platform determination when uname() is missing * Fixed error in handling if AES crypt provider is not available * Moved the error handling values out of the library - no longer contains read chunk function * Added basic globbing code for windows port - should suffice * Fixed memory leak of last section in libewf_read_build_index * Fixed memory leak in ewfacquire bytes_string was never freed 20061028 * Merged the libewf win32 port by George Garner with current working verion - signal handling and memory debug was added to ewfsignal - added libewf.c for MainDLL function 20061026 * moved header_values_fprint to ewfcommon * created libewf_parse_header_values * moved from_ and to_file_descriptor functions out of the library and into ewfcommon * rewrite of from_ and to_file_descriptor functions in ewfcommon and related library functions * moved swap byte pair functions back into library * fixed header value creation is date strings are missing * added function to set media type in handle 20061025 * made one type (error sector) for crc and acquiry read error sectors * Worked on Win32 native port - fix for file open - not using the right parameters for Windows - fix for crypto API calls for MD5 context - rewrote some API functions to pass buffers from the application to the library so allocation and de-allocation is handled within the same program space 20061024 * minor alterations for BSD licensed getopt * added a libewf version of getopt to ewfcommon - it is basically a rewrite of the version by The Regents of the University of California - it should suffice for platforms without getopt * prefixed functions in ewfcommon with ewfcommon - this distinguishes them from the libewf functions * created acquiry_error to move error2 and endian conversion in ewfcommon into library * fixed missing read error retry reset after sector skip * fixed 1024 kb human readable size will now become 1.0 Mb * default number of read error retries is now 2 (will result in 3 read attempts) * fixed error regarding read error retry one off 20061023 * Reduced input_file_size and input_write_size to 1 parameter: input_write_size * Renamed ewf_file_size to segment_file_size * Looked at generic character/string wrapper - for wide char support 20061022 * Fixed media type mismatch in data section in EWF file from ewfacquire for EWF-E01 format * Fixed empty section start size in EnCase (EWF-E01) format for read and write - FTK Imager * Fixed error in read with byte swap, the MD5 hash must be calculated over the non swapped data * Clean up in libewf.h * Worked on Win32 native port - added LIBEWF_EXTERN macro for DLL import/export - changed ctime to libewf_common function using the thread safe variant * Added libewf_set_write_input_size function * libewf and tools are now compilable natively on Windows 20061021 * Worked on Win32 native port - changed libewf_common_strncmp return to signed as it should be - changed strerror to libewf_common function using the thread safe variant - changed localtime to libewf_common function using the thread safe variant - requires some type casts from unsigned to signed - the libewf_common read and write function do the check if the size value exceeds INT32_MAX - rewrote ewf_md5hash_to_string() not to use snprintf - rewrote libewf_md5 to wrap multiple implementations is now libewf_md5_context - added Windows Crypto API support to libewf_md5_context * Reduced maximum amount in offset table to 32-bit value * Reduced segment values to a 16-bit value * Changed libewf_notify to use autoconf/make header check 20061020 * Worked on rewriting libewf_write - when header values are empty a default is created - better fill EWF-S01 segment file - recalculate the chunks per segment after the table section is written 20061019 * Block is only required to be wiped when offset is 0 * Worked on rewriting libewf_write - moved header values set and create to libewf_handle - removed set_parameter function * Fixed mismatch in segment size and chunks section size calculation for the EWF-S01 format * Fixed invalid number of chunks per segment for 2 GiB segment file for the EWF-S01 and EWF-E01 format * Added maximum input size check * Added a generic set function for enabling byte swap * Completed redesign write and parameter functions to fallback to a default 20061018 * fixed error catching negative remaining segment size * worked on: redesign write and parameter functions to fallback to a default * Worked on rewriting libewf_write 20061017 * fixed error handling multiple segment files - the write_buffer loop now leaves the segment file in a state of an open chunks section * changed space left function into test full functions * implemented compressBound() for determing the required size a too small compression buffer * allow for a variable buffer size in write_buffer by using a chunk cache size and offset * ewf_header_compress: is there a better way to determine the size of the compressed buffer - compressBound fixes this * done: redesign handle, refactor certain aspects to sub structs like chunk_cache * worked on: redesign write and parameter functions to fallback to a default * Worked on rewriting libewf_write 20061016 * at last done rewritting libewf_write_from_file_descriptor to use new function libewf_write_buffer * changed handle->write->chunks_per_segment and handle->write->maximum_chunks_per_segment * progressive method of number of chunks per section/segment is required for EWF-E01 fill method * calculative method of number of chunks per section/segment is required for EWF-S01 pre-write offset table size determination * Worked on rewriting libewf_write 20061015 * corrected typo in src/Makefile.am * fixed libewf.h to be used from within the libewf package and outside * fixed maximum ewf file size in ewfacquire was 1 byte too large - due to new restriction in libewf * Worked on rewriting libewf_write * fixed remainder > 9 issue - using a naive solution but adequate 20061014 * ewfinfo: move error2 list print code into library - to ewfcommon * ewfverify: move crc list print code into library - to ewfcommon * write: fixed incorrect implementation of EnCase1 header * ewfinfo: move format detection code into library - basic file format detection is now in library a small part still in ewfinfo, this because EnCase2 and EnCase3 format look a lot each other * added function to create original header format * rewritten function to create headers to 3 more generic functions - for header2 not needed yet * Worked on rewriting libewf_handle * Worked on rewriting libewf_write * Added API get function for certain information * Renamed sector_count => amount_of_sectors * Renamed chunk_count => amount_of_chunks * Renamed error_count => amount_of_errors * fixed textual error in ewf_sectors_chunk_compress 20061012 * moved EWF definitions to ewf_definitions.h * moved PRIx fixes to libewf_includes.h 20061011 * ewfinfo: add date format in ewfinfo to month in text - no interpretation differences possible ISO8601 date string support added - based on patches/adjustments by Rob Meijer * Rewritten part of header_values for new date format * Added date format support to ewfinfo * fixed a space in configure output * Worked on rewriting libewf_write * Worked on rewriting libewf_handle - introduced new read and write specific subhandles * removed compression_used from handle - no longer needed * added error_granularity_bytes to write subhandle 20061010 * Worked on rewriting includes to use libewf_includes.h * Removed __attribute__((packed)) from structs for Win32 port - they do not seem neccessary anymore * Added the header file installation - based on patches/adjustments by Rob Meijer * read: warn when maximum offsets in table of S01 format is exceeded * Worked on rewriting libewf_write 20061009 * Added libtool support - based on patches/adjustments by Rob Meijer * Changed config.h to src/libewf_config.h * Added libewf_includes.h to wrap libewf_config.h for beter autoconf/automake integration * Worked on rewriting includes to use libewf_includes.h 20061008 * Changed program banner and version information * Version released 20061007 * Fix for missing header definitions for OpenBSD * Fix for missing INTx_MAX definitions for OpenBSD * Fix for compilation warnings for SunOS - moved libewf_common.h to be first include * Bug in reallocating chunk cache - initial reallocation was removed by rewrite * change chunk cache allocated_size to 32 bit value - also chunk size in read function 20061004 * Tested ewfacquire with disk with 0 sector error - success * Bug in MacOS-X reading a floppy with bad block - read with -1 could alter current file offset (determined by lseek) Added lseek check to check and correct for offset drift 20061003 * fixed one-too-many read error retry * fixed bug not correcting bytes_to_read in read error handling - this surfaced on MacOS-X (Linux read behavior is different) * ewfacquire: minor adjustment in output - removed dot 20061002 * fixed error in libewf_section.h - this surfaced on MacOS X 20061001 * disabled lvf support * fixed error in read error handling in write functionality - this surfaced under FreeBSD 20060929 * did some refactoring of write function 20060928 * did some refactoring of write function * ewfacquire: print MD5 hash when completed - added removed index build check from libewf_data_md5hash function - this function checks if hash is set ananyway 20060927 * minor adjustment to verbose logging configure options - fixed error with variable names containing '-' * all: human readable size add .0 for single digit values - implemented * fixed bug with missing config.h for sleuthkit integration * fixed some formatting issues * did some refactoring of write function * defaulted handle values to unknowns * added function to determine header length instead of strlen - this is more appropiate 20060926 * minor adjustment to verbose logging configure options * added program version to output * did some refactoring of write function - added more checks for write_count returns * write: warn before hand if segment file amount exceeds limit - implemented * all: human readable size add .[1-9] for single digit values - implemented 20060922 * worked on ltree * fixed error in verbose output CRC value libewf_read_random - checked if bug resides in other CRC output - could not find any * changed values in volume definition 20060916 * worked on code clean up and improved error handling * ewf_verify now generates CRC error list for sectors (also for compressed chunks) * verbose and debug prints are now optional (defaults are off) 20060912 * worked on code clean up and improved error handling * worked on skip beyond media size in write 20060911 * worked on code clean up and improved error handling * changed hardcoded max values to predifined macros 20060910 * worked on code clean up and improved error handling * renamed file_read and file_write to read and write * ewfacquire: add offset and size question * write: add offset and size support in write function * added lseek to common, removed off_t from code * ewfacquire: added nice byte print for status * ewfexport: added nice byte print for status 20060908 * worked on code clean up and improved error handling * worked on ltree implementation * added simple byte order detection to UTF16 to ASCII conversion * added offset and size question to ewfexport * added size and offset to read to and write from file descriptor functions * read: look at libewf_section_volume_read: volume chunk count is 0 - compensating - check removed no longer required due to LVF support 20060906 * worked on code clean up and improved error handling * ewf tooling returns the error status no exit * worked on improving automated test scripts * corrected user input inconsistency in ewfacquire * fixed free bug with zlib_crc and calculated_crc in write * fixed pointer bug with zlib_crc in write 20060905 * worked on code clean up and improved error handling * added large file support to configure.in for converting raw images > 4 GiB to EWF files * ewfacquire added total acquire time and bytes/second 20060904 * worked on code clean up and improved error handling * fixed bug regarding setting chunk size in handle from volume - this got somehow removed due to clean up * ewfacquire: add start and finish time 20060903 * worked on code clean up and improved error handling * moved section reading and writing code to libewf_section * fixed bug in libewf_read_random when offset is too large * wraped basic library calls in preperation of thread safety of library calls * added prefix to functions in libewf_common with common_ * enhanced error handling - no program exit but a nice return * using typedefs instead of defines * due to 20060505 fix, gave all value definitions a default value * removed a large number of unrequired includes 20060902 * worked on code clean up and improved error handling * libewf_handle_cache_realloc removed from read volume section function * endian functions are prepended with libewf_endian_ * the secondairy offset table in handle for S01 format will no longer be allocated for read * started on error tollerance levels for recovery * moved file descriptor check in last_offset calculation to do one check per section list - section list was altered to be used for a single segment file only - reduces memory requirements 20060831 * worked on code clean up and improved error handling * created seperate structure for chunk cache 20060830 * worked on code clean up and improved error handling * allow to set clean value in libewf_(re)alloc_cleared functions 20060829 * worked on code clean up and improved error handling * worked on libewf_string - moved split code to it 20060828 * worked on code clean up and improved error handling * introduced and fixed new bug - reminder do not free result from localtime() 20060826 * worked on code clean up and improved error handling * fixed realloc calculation bug in file_read * moved definitions from .h files * changed headers in all files 20060824 * worked on code clean up and improved error handling * move crc check from file_read into different EWF read methods? no embedding this check in the segment types makes it more difficult to generate an CRC error list for ewfinfo 20060823 * no need for fatal warnings if code becomes re-entrant after error * added a wrapper of basic library calls * worked on code clean up and improved error handling * renamed notify.* to libewf_notify.* prevents name clashes * ewf_crc function now use a dynamic allocated CRC - this helps with error propagation * added big endian support to ascii to utf16 routine 20060822 * added byte swap (equivalent of dd conv=swab) functionality in both read and write * changed sys/types.h to inttypes.h all: check if sys/types definitions still needed in ewf_*.h files ? - not under linux will do a cross platform test anyway * started with implementing improved error handling and re-entry after error, combined with code clean up, better error control, revision of header to allow for one place to maintain acknowledgements 20060821 * read: added basic support for L01 files, which are basically EWF files * renamed ewf_file_signature to evf_file_signature - closer to the truth * ewfacquire: compensate for maximum S01 file size in ewf file size question - determine maximum - not relevant because there is a maximum of chunks within the file but the other data could grow to the 2 GiB 20060820 * ewfacquire: small change to confirmation 20060819 * lifted the 255 segment file limit on write, however it uses an (horrible) increment based naming scheme much like EnCase write: allow more than 255 segment files - completed * write: worked on SMART (EWF-S01) support * write: SMART (EWF-S01) - build in support for table2 * all: add SMART support - complete * worked on - all: due to 20060505 fix give all value definitions a default value - looks nicer * due to changes to the read and write logic the library was retested * read: error in percentage in libewf_read_random - works on FC5 * table size limitation does not seem present in EWF-E01 only in EWF-S01 * use autoconf/automake cross compilation parameters for platform determination - completed 20060818 * read: worked on SMART (EWF-S01) support * alternative read method was removed, the assumption it was based on is no longer valid read: remove alternative read method the assumption behind is fails for the SMART format - completed * renamed alternative write method to wipe block on read error write: rename the alternative write method to wipe_block_on_error (or something) - completed * read random: chunk based size check now is a buffer based size check * removed handle->chunk_crc no longer needed * for the EWF-S01 format the entries in table2 are appended to the offset table - have yet to test a file with a table2 section * write: worked on SMART (EWF-S01) support 20060817 * read: worked on SMART (EWF-S01) support 20060816 * ewfacquire: add overview to confirm user input, otherwise restart input query - completed * ewfacquire: make encase5 file option default - completed * fixed incorrect order for values in header2 on write - also in documentation 20060812 * made the number of read error retries flexible and user adjustable through ewfacquire * correction of "int result" in file_write to be C89 code compliant * new file size algorithm to fill up closer to max file size when compressing write: change algorithm to fill files upto file size - completed * added empty block compression write: always compress empty chunks - completed as an option 20060809 * fixed size bug for large images on Cygwin - fix of 20060610 not sufficient for Cygwin * fixed invalid value in printf volume read verbose messages * added autoconf/automake structure 20060708 * renamed endian.h to libewf_endian.h for compatibility issues 20060617 * put conditions around debug code in eqfacquire 20060611 * fixed - one off bug in header value end of string 20060610 * ewfacquire test on multiple platforms * added support for SMART format volume section - equals the original EWF volume section definition * fixed - type casting error in data size * fixed - missing header for encase1 format in write * fixed - bug in writing encase4 and encase5 header2 in write - error in ascii to utf16 routine * fixed - bug in writing encase4 and enacse5 header in write - logical formatting error * write: timestamp is now generated only once * write: fixed incorrect free in header values * write: fixed memory corruption bug in ewfacquire - required explicit zero of string 20060605 * fix of data corruption bug - one off * ewfacquire: sanitize input provided by user * ewfinfo/eqwfacquire ? 1970 date when no case data is provided - bug in split function regarding first empty value * removed file cache - no longer required 20060527 * started analysis of a data corruption bug 20060526 * fixed write bug when read is successful after error with small error granualirity * fixed write bug with error granularity 1 * ewfacquire: add chunk size input possibility * ewfacquire: add error granularity size input possibility * ewfacquire: memory corruption bug in user input - repaced some code - looks OK now - but hard to reproduce * fixed write bug with block size 128 error granularity 16 in test * write: improve reading of bad sectors and writing a error2 section to file for encase5 file option 20060520 * fixed media size bug - old method of calculation was still in there :-( * worked on ewfacquire read on error * added alternative write method to test acquired images against existing tooling * ewfacquire: able to produce exact media data as linen * write: what if read error is in last chunk and it is smaller than chunk size !? 20060517 * removed duplicate include from notify.c 20060516 * added media size to ewfinfo * worked on ewfacquire read on error 20060513 * minor adjustment in libewf.h - ewf_close renamed to libewf_close 20060505 * Fix for older compilers like gcc 2.95 - rewrite to older C statements 20060424 * added warning macro to allow overriding some fatal errors * allow overriding invalid CRC's * refactored crc check in ewf_section to file_read - for scope of handle and uniformity within the code * further analysis of unknown values in hash section - also found difference in signature value Encase4 and Encase5 20060423 * Fix for Solaris in definitions.h 20060422 * Fixed missing PRI definitions on OpenBSD - now defines in definitions.h * changed sprintf to snprintf * added device size determination for OpenBSD * fixed bug in header values parsing for empty first value empty * added compression level definition * ewfinfo: add compression media information in ewfinfo - Encase5 format only * write: moved compression type functionality from ewfacquire into library 20060419 * Adjusted write method - to fix filesize problem * Correction of verbose print of last chunk number * the write function works only when a data section is at the start of the file - why ? not a bug in write but in read the first offset in the segment table was filled with 0 instead of 13 which is the size of the file header 20060418 * Tested on FreeBSD 6.0 needed to add include header in ewf_sectors.h * Adjusted Make to be more generic and to work on FreeBSD 6.0 20060415 * changed u_int to uint * removed LIBEWF_ types * zlib uses a long which varies per 32 and 64 bit architecture using an intermediate variable fixes not able to read compressed images on a x86_64 architecure * Memory corruption bug in segment table filename fixed 20060414 * Fixed previous offset size * removed memcpy assignments * type fixed malloc assignments * removed (void *) from memset * reduced the number of int definions * changed printf formaters * added status indication to ewfexport using callback function in read_from_file_descriptor * added quiet option to ewfexport and ewfacquire * removed dependency on libiconv - created a naive utf16 to ascii conversion * moved header string generation code to header_values * added time string generation code to header_values * added acquire options for compression and file type to ewfacquire * code now partially fixed for x86_64 systems fixed malloc statement, printf sizes, and some type definitions * additional changes to memcpy statements made * Use header_values for write * ewfacquire fix error print on correct fixed value * ewfacquire fix for empty input values * ewfacquire fix strange image file rights * ewfacquire fix image filename weird characters - one byte off allocation problem in ewfacquire * ewfacquire allow for a default value - for fixed values * ewfacquire can now acquire devices on works on Mac OS-X/Darwin * fix write crc error in chunk on mac os x * ewfacquire add EWF file size input possibility - check upper bound 2 GiB, lower bound 1440k * fix write bug with small file size 1440k - for floppy image - this has to do if both the filesize and the ewf size are the same - write will adjust with one additional segment file 20060413 * Used LIBEWF_VERSION in executables * Added file signature function to library for integration in The SleuthKit * Added md5.h for allowing to do with different MD5 calculation code bases like the one integrated in the The SleuthKit 20060412 * Created separate file for header value logic - moved code from ewfinfo 20060411 * Nearing release of first version, so started logging relevant changes * Removed memory leak with duplicate header assignment to handle * Renamed ewfmd5sum to ewfverify - still have to enhance functionality * Renamed ewfcat to ewfexport - still have to enhance functionality * Added time parsing functionality to ewfinfo - date format is currently fixed in MM/DD/YYYY * Enhanced password and compression header value output in ewfinfo libewf-20140807/m4/0000775000175000017500000000000013443455444015663 5ustar00lordyestalordyesta00000000000000libewf-20140807/m4/libuna.m40000664000175000017500000005142013440550332017366 0ustar00lordyestalordyesta00000000000000dnl Checks for libuna or required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libuna is available dnl ac_libuna_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBUNA_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuna" = xno], [ac_cv_libuna=no], [ac_cv_libuna=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libuna"], [CFLAGS="$CFLAGS -I${ac_cv_with_libuna}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libuna}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libuna], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libuna], [libuna >= 20181006], [ac_cv_libuna=yes], [ac_cv_libuna=check]) ]) AS_IF( [test "x$ac_cv_libuna" = xyes], [ac_cv_libuna_CPPFLAGS="$pkg_cv_libuna_CFLAGS" ac_cv_libuna_LIBADD="$pkg_cv_libuna_LIBS"]) ]) AS_IF( [test "x$ac_cv_libuna" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libuna.h]) AS_IF( [test "x$ac_cv_header_libuna_h" = xno], [ac_cv_libuna=no], [dnl Check for the individual functions ac_cv_libuna=yes AC_CHECK_LIB( una, libuna_get_version, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl Base16 stream functions AC_CHECK_LIB( una, libuna_base16_stream_size_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base16_stream_copy_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base16_stream_size_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base16_stream_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base16_stream_with_index_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl Base32 stream functions AC_CHECK_LIB( una, libuna_base32_quintuplet_copy_from_base32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_quintuplet_copy_to_base32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_quintuplet_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_quintuplet_copy_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_stream_size_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_stream_copy_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_stream_size_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_stream_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base32_stream_with_index_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl Base64 stream functions AC_CHECK_LIB( una, libuna_base64_triplet_copy_from_base64_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_triplet_copy_to_base64_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_triplet_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_triplet_copy_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_stream_size_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_stream_copy_to_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_stream_size_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_stream_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_base64_stream_with_index_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl Byte stream functions AC_CHECK_LIB( una, libuna_byte_stream_size_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_byte_stream_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_byte_stream_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_byte_stream_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_byte_stream_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_byte_stream_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl UTF-8 stream functions AC_CHECK_LIB( una, libuna_utf8_stream_size_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_stream_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_stream_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_stream_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_stream_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_stream_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl UTF-16 stream functions AC_CHECK_LIB( una, libuna_utf16_stream_size_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_stream_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_stream_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_stream_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_stream_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_stream_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl UTF-32 stream functions AC_CHECK_LIB( una, libuna_utf32_stream_size_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_stream_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_stream_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_stream_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_stream_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_stream_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl UTF-8 string functions AC_CHECK_LIB( una, libuna_utf8_string_size_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_size_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_size_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_size_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_size_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf8_string_with_index_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl UTF-16 string functions AC_CHECK_LIB( una, libuna_utf16_string_size_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_size_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_size_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_size_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_size_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_size_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf16_string_with_index_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) dnl UTF-32 string functions AC_CHECK_LIB( una, libuna_utf32_string_size_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_with_index_copy_from_byte_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_size_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_with_index_copy_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_size_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_with_index_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_size_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_with_index_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_size_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_with_index_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_size_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( libuna_utf32_string_with_index_copy_from_utf8, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, libuna_utf32_string_with_index_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) ac_cv_libuna_LIBADD="-luna"]) ]) AS_IF( [test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_libuna" != xyes], [AC_MSG_FAILURE( [unable to find supported libuna in directory: $ac_cv_with_libuna], [1]) ]) ]) AS_IF( [test "x$ac_cv_libuna" = xyes], [AC_DEFINE( [HAVE_LIBUNA], [1], [Define to 1 if you have the `una' library (-luna).]) ]) AS_IF( [test "x$ac_cv_libuna" = xyes], [AC_SUBST( [HAVE_LIBUNA], [1]) ], [AC_SUBST( [HAVE_LIBUNA], [0]) ]) ]) dnl Function to detect if libuna dependencies are available AC_DEFUN([AX_LIBUNA_CHECK_LOCAL], [dnl No additional checks. ac_cv_libuna_CPPFLAGS="-I../libuna"; ac_cv_libuna_LIBADD="../libuna/libuna.la"; ac_cv_libuna=local ]) dnl Function to detect how to enable libuna AC_DEFUN([AX_LIBUNA_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libuna], [libuna], [search for libuna 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_LIBUNA_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libuna" != xyes], [AX_LIBUNA_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBUNA], [1], [Define to 1 if the local version of libuna is used.]) AC_SUBST( [HAVE_LOCAL_LIBUNA], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBUNA], [test "x$ac_cv_libuna" = xlocal]) AS_IF( [test "x$ac_cv_libuna_CPPFLAGS" != "x"], [AC_SUBST( [LIBUNA_CPPFLAGS], [$ac_cv_libuna_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libuna_LIBADD" != "x"], [AC_SUBST( [LIBUNA_LIBADD], [$ac_cv_libuna_LIBADD]) ]) AS_IF( [test "x$ac_cv_libuna" = xyes], [AC_SUBST( [ax_libuna_pc_libs_private], [-luna]) ]) AS_IF( [test "x$ac_cv_libuna" = xyes], [AC_SUBST( [ax_libuna_spec_requires], [libuna]) AC_SUBST( [ax_libuna_spec_build_requires], [libuna-devel]) ]) ]) libewf-20140807/m4/libfuse.m40000644000175000017500000001203713420017423017541 0ustar00lordyestalordyesta00000000000000dnl Checks for libfuse required headers and functions dnl dnl Version: 20180403 dnl Function to detect if libfuse is available dnl ac_libfuse_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBFUSE_CHECK_LIB], [dnl Check if parameters were provided AS_IF( [test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libfuse"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfuse}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib"], [AC_MSG_WARN([no such directory: $ac_cv_with_libfuse]) ]) ]) AS_IF( [test "x$ac_cv_with_libfuse" = xno], [ac_cv_libfuse=no], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [fuse], [fuse >= 2.6], [ac_cv_libfuse=libfuse], [ac_cv_libfuse=no]) ]) AS_IF( [test "x$ac_cv_libfuse" = xlibfuse], [ac_cv_libfuse_CPPFLAGS="$pkg_cv_fuse_CFLAGS" ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS"], [dnl Check for headers AC_CHECK_HEADERS( [fuse.h], [ac_cv_header_fuse_h=yes], [ac_cv_header_fuse_h=no]) dnl libfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set AS_IF( [test "x$ac_cv_header_fuse_h" = xno], [AS_UNSET([ac_cv_header_fuse_h]) CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" AC_CHECK_HEADERS([fuse.h]) ]) AS_IF( [test "x$ac_cv_header_fuse_h" = xno], [ac_cv_libfuse=no], [dnl Check for the individual functions ac_cv_libfuse=libfuse AC_CHECK_LIB( fuse, fuse_daemonize, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) AC_CHECK_LIB( fuse, fuse_destroy, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) AC_CHECK_LIB( fuse, fuse_mount, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) AC_CHECK_LIB( fuse, fuse_new, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) ac_cv_libfuse_LIBADD="-lfuse"; ]) ]) dnl Check for libosxfuse AS_IF( [test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno], [CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" AC_CHECK_HEADERS([osxfuse/fuse.h]) dnl libosxfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set AS_IF( [test "x$ac_cv_header_osxfuse_fuse_h" = xno], [AS_UNSET([ac_cv_header_osxfuse_fuse_h]) CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" AC_CHECK_HEADERS([osxfuse/fuse.h]) ]) AS_IF( [test "x$ac_cv_header_osxfuse_fuse_h" = xno], [ac_cv_libfuse=no], [dnl Check for the individual functions ac_cv_libfuse=libosxfuse AC_CHECK_LIB( osxfuse, fuse_daemonize, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) AC_CHECK_LIB( osxfuse, fuse_destroy, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) AC_CHECK_LIB( osxfuse, fuse_mount, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) AC_CHECK_LIB( osxfuse, fuse_new, [ac_cv_libfuse_dummy=yes], [ac_cv_libfuse=no]) ac_cv_libfuse_LIBADD="-losxfuse"; ]) ]) ]) AS_IF( [test "x$ac_cv_libfuse" = xlibfuse], [AC_DEFINE( [HAVE_LIBFUSE], [1], [Define to 1 if you have the 'fuse' library (-lfuse).]) ]) AS_IF( [test "x$ac_cv_libfuse" = xlibosxfuse], [AC_DEFINE( [HAVE_LIBOSXFUSE], [1], [Define to 1 if you have the 'osxfuse' library (-losxfuse).]) ]) AS_IF( [test "x$ac_cv_libfuse" != xno], [AC_SUBST( [HAVE_LIBFUSE], [1]) ], [AC_SUBST( [HAVE_LIBFUSE], [0]) ]) ]) dnl Function to detect how to enable libfuse AC_DEFUN([AX_LIBFUSE_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libfuse], [libfuse], [search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse], [auto-detect], [DIR]) dnl Check for a shared library version AX_LIBFUSE_CHECK_LIB AS_IF( [test "x$ac_cv_libfuse_CPPFLAGS" != "x"], [AC_SUBST( [LIBFUSE_CPPFLAGS], [$ac_cv_libfuse_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libfuse_LIBADD" != "x"], [AC_SUBST( [LIBFUSE_LIBADD], [$ac_cv_libfuse_LIBADD]) ]) AS_IF( [test "x$ac_cv_libfuse" = xlibfuse], [AC_SUBST( [ax_libfuse_pc_libs_private], [-lfuse]) ]) AS_IF( [test "x$ac_cv_libfuse" = xlibosxfuse], [AC_SUBST( [ax_libfuse_pc_libs_private], [-losxfuse]) ]) AS_IF( [test "x$ac_cv_libfuse" = xlibfuse], [AC_SUBST( [ax_libfuse_spec_requires], [fuse-libs]) AC_SUBST( [ax_libfuse_spec_build_requires], [fuse-devel]) ]) ]) libewf-20140807/m4/gettext.m40000644000175000017500000003513212076507232017605 0ustar00lordyestalordyesta00000000000000# gettext.m4 serial 63 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) libewf-20140807/m4/zlib.m40000664000175000017500000001464213440662376017075 0ustar00lordyestalordyesta00000000000000dnl Checks for zlib required headers and functions dnl dnl Version: 20190308 dnl Function to detect if zlib is available AC_DEFUN([AX_ZLIB_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_zlib" = xno], [ac_cv_zlib=no], [ac_cv_zlib=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_zlib"], [CFLAGS="$CFLAGS -I${ac_cv_with_zlib}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_zlib}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_zlib], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [zlib], [zlib >= 1.2.5], [ac_cv_zlib=zlib], [ac_cv_zlib=check]) ]) AS_IF( [test "x$ac_cv_zlib" = xzlib], [ac_cv_zlib_CPPFLAGS="$pkg_cv_zlib_CFLAGS" ac_cv_zlib_LIBADD="$pkg_cv_zlib_LIBS"]) ]) AS_IF( [test "x$ac_cv_zlib" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([zlib.h]) AS_IF( [test "x$ac_cv_header_zlib_h" = xno], [ac_cv_zlib=no], [dnl Check for the individual functions ac_cv_zlib=zlib AC_CHECK_LIB( z, zlibVersion, [], [ac_cv_zlib=no]) AS_IF( [test "x$ac_cv_lib_z_zlibVersion" = xno], [AC_MSG_FAILURE( [Missing function: zlibVersion in library: zlib.], [1]) ]) ac_cv_zlib_LIBADD="-lz"; ]) ]) ]) AS_IF( [test "x$ac_cv_zlib" = xzlib], [AC_DEFINE( [HAVE_ZLIB], [1], [Define to 1 if you have the 'zlib' library (-lz).]) ]) AS_IF( [test "x$ac_cv_zlib" != xno], [AC_SUBST( [HAVE_ZLIB], [1]) ], [AC_SUBST( [HAVE_ZLIB], [0]) ]) ]) dnl Function to detect if the adler32 function is available AC_DEFUN([AX_ZLIB_CHECK_ADLER32], [AX_COMMON_ARG_WITH( [adler32], [adler32], [specify which alder32 implementation to use, options: 'auto-detect', 'zlib' or 'local'], [auto-detect], [auto-detect]) AS_IF( [test "x$ac_cv_zlib" != xzlib], [ac_cv_adler32=local], [AC_CHECK_LIB( z, adler32, [ac_zlib_dummy=yes]) AS_IF( [test "x$ac_cv_lib_z_adler32" = xyes], [AS_IF( [test "x$ac_cv_with_adler32" != xzlib && test "x$ac_cv_with_adler32" != xauto-detect], [ac_cv_adler32=local], [AC_DEFINE( [HAVE_ZLIB_ADLER32], [1], [Define to 1 if adler32 funtion is available in zlib.]) ac_cv_adler32=zlib])], [AS_IF( [test "x$ac_cv_with_adler32" = xzlib], [AC_MSG_FAILURE( [Missing function: adler32 in library: zlib.], [1]) ]) ac_cv_adler32=local]) ]) ]) dnl Function to detect if the compress2 function is available AC_DEFUN([AX_ZLIB_CHECK_COMPRESS2], [AS_IF( [test "x$ac_cv_zlib" = xzlib], [AC_CHECK_LIB( z, compress2, [ac_zlib_dummy=yes]) AS_IF( [test "x$ac_cv_lib_z_compress2" = xyes], [AC_DEFINE( [HAVE_ZLIB_COMPRESS2], [1], [Define to 1 if compress2 funtion is available in zlib.]) ]) ]) ]) dnl Function to detect if the compressBound function is available AC_DEFUN([AX_ZLIB_CHECK_COMPRESSBOUND], [AS_IF( [test "x$ac_cv_zlib" = xzlib], [AC_CHECK_LIB( z, compressBound, [ac_zlib_dummy=yes]) AS_IF( [test "x$ac_cv_lib_z_compressBound" = xyes], [AC_DEFINE( [HAVE_ZLIB_COMPRESSBOUND], [1], [Define to 1 if compressBound funtion is available in zlib.]) ]) ]) ]) dnl Function to detect if the inflate functions are available AC_DEFUN([AX_ZLIB_CHECK_INFLATE], [AS_IF( [test "x$ac_cv_zlib" != xzlib], [ac_cv_inflate=local], [AC_CHECK_LIB( z, inflate, [ac_cv_inflate=zlib], [ac_cv_inflate=local]) AC_CHECK_LIB( z, inflateInit2, [ac_zlib_dummy=yes]) dnl Some versions of zlib provide inflateInit2_ instead of inflateInit2 AS_IF( [test "x$ac_cv_lib_z_inflateinit2" = xno], [AC_CHECK_LIB( z, inflateInit2_, [ac_zlib_dummy=yes], [ac_cv_inflate=local]) ]) AC_CHECK_LIB( z, inflateEnd, [ac_zlib_dummy=yes], [ac_cv_inflate=local]) AS_IF( [test "x$ac_cv_inflate" = xzlib], [AC_DEFINE( [HAVE_ZLIB_INFLATE], [1], [Define to 1 if you have the `inflateInit', `inflate', `inflateEnd' functions.]) ]) AS_IF( [test "x$ac_cv_lib_z_inflateinit2" != xno], [AC_DEFINE( [HAVE_ZLIB_INFLATE_INIT2], [1], [Define to 1 if you have the `inflateInit2' function.]) ]) ]) ]) dnl Function to detect if the uncompress function is available AC_DEFUN([AX_ZLIB_CHECK_UNCOMPRESS], [AS_IF( [test "x$ac_cv_zlib" != xzlib], [ac_cv_uncompress=local], [AC_CHECK_LIB( z, uncompress, [ac_cv_uncompress=zlib], [ac_cv_uncompress=local]) AS_IF( [test "x$ac_cv_uncompress" = xzlib], [AC_DEFINE( [HAVE_ZLIB_UNCOMPRESS], [1], [Define to 1 if you have the `uncompress' function.]) ]) ]) ]) dnl Function to detect how to enable zlib AC_DEFUN([AX_ZLIB_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [zlib], [zlib], [search for zlib in includedir and libdir or in the specified DIR, or no if not to use zlib], [auto-detect], [DIR]) dnl Check for a shared library version AX_ZLIB_CHECK_LIB AS_IF( [test "x$ac_cv_zlib_CPPFLAGS" != "x"], [AC_SUBST( [ZLIB_CPPFLAGS], [$ac_cv_zlib_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_zlib_LIBADD" != "x"], [AC_SUBST( [ZLIB_LIBADD], [$ac_cv_zlib_LIBADD]) ]) AS_IF( [test "x$ac_cv_zlib" = xzlib], [AC_SUBST( [ax_zlib_pc_libs_private], [-lz]) ]) AS_IF( [test "x$ac_cv_zlib" = xzlib], [AC_SUBST( [ax_zlib_spec_requires], [zlib]) AC_SUBST( [ax_zlib_spec_build_requires], [zlib-devel]) AC_SUBST( [ax_zlib_static_spec_requires], [zlib-static]) AC_SUBST( [ax_zlib_static_spec_build_requires], [zlib-static]) ]) ]) libewf-20140807/m4/lib-prefix.m40000644000175000017500000002042212076507232020156 0ustar00lordyestalordyesta00000000000000# lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) libewf-20140807/m4/libodraw.m40000664000175000017500000001574513440550332017731 0ustar00lordyestalordyesta00000000000000dnl Checks for libodraw required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libodraw is available dnl ac_libodraw_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBODRAW_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libodraw" = xno], [ac_cv_libodraw=no], [ac_cv_libodraw=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libodraw" != x && test "x$ac_cv_with_libodraw" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libodraw"], [CFLAGS="$CFLAGS -I${ac_cv_with_libodraw}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libodraw}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libodraw], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libodraw], [libodraw >= 20120630], [ac_cv_libodraw=yes], [ac_cv_libodraw=check]) ]) AS_IF( [test "x$ac_cv_libodraw" = xyes], [ac_cv_libodraw_CPPFLAGS="$pkg_cv_libodraw_CFLAGS" ac_cv_libodraw_LIBADD="$pkg_cv_libodraw_LIBS"]) ]) AS_IF( [test "x$ac_cv_libodraw" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libodraw.h]) AS_IF( [test "x$ac_cv_header_libodraw_h" = xno], [ac_cv_libodraw=no], [dnl Check for the individual functions ac_cv_libodraw=yes AC_CHECK_LIB( odraw, libodraw_get_version, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) dnl Handle functions AC_CHECK_LIB( odraw, libodraw_handle_initialize, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_free, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_signal_abort, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_open, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_open_data_files, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_close, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_read_buffer, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_seek_offset, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( odraw, libodraw_handle_open_wide, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) ]) AC_CHECK_LIB( odraw, libodraw_handle_get_bytes_per_sector, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_data_file, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_media_size, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_number_of_data_files, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_number_of_sessions, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_session, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_number_of_tracks, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_handle_get_track, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) dnl Data file functions AC_CHECK_LIB( odraw, libodraw_data_file_free, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AC_CHECK_LIB( odraw, libodraw_data_file_set_filename, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( odraw, libodraw_data_file_set_filename_wide, [ac_cv_libodraw_dummy=yes], [ac_cv_libodraw=no]) ]) ac_cv_libodraw_LIBADD="-lodraw"]) ]) AS_IF( [test "x$ac_cv_with_libodraw" != x && test "x$ac_cv_with_libodraw" != xauto-detect && test "x$ac_cv_libodraw" != xyes], [AC_MSG_FAILURE( [unable to find supported libodraw in directory: $ac_cv_with_libodraw], [1]) ]) ]) AS_IF( [test "x$ac_cv_libodraw" = xyes], [AC_DEFINE( [HAVE_LIBODRAW], [1], [Define to 1 if you have the `odraw' library (-lodraw).]) ]) AS_IF( [test "x$ac_cv_libodraw" = xyes], [AC_SUBST( [HAVE_LIBODRAW], [1]) ], [AC_SUBST( [HAVE_LIBODRAW], [0]) ]) ]) dnl Function to detect if libodraw dependencies are available AC_DEFUN([AX_LIBODRAW_CHECK_LOCAL], [AM_PROG_LEX AC_PROG_YACC ac_cv_libodraw_CPPFLAGS="-I../libodraw"; ac_cv_libodraw_LIBADD="../libodraw/libodraw.la"; ac_cv_libodraw=local ]) dnl Function to detect how to enable libodraw AC_DEFUN([AX_LIBODRAW_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libodraw], [libodraw], [search for libodraw 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_LIBODRAW_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libodraw" != xyes], [AX_LIBODRAW_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBODRAW], [1], [Define to 1 if the local version of libodraw is used.]) AC_SUBST( [HAVE_LOCAL_LIBODRAW], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBODRAW], [test "x$ac_cv_libodraw" = xlocal]) AS_IF( [test "x$ac_cv_libodraw_CPPFLAGS" != "x"], [AC_SUBST( [LIBODRAW_CPPFLAGS], [$ac_cv_libodraw_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libodraw_LIBADD" != "x"], [AC_SUBST( [LIBODRAW_LIBADD], [$ac_cv_libodraw_LIBADD]) ]) AS_IF( [test "x$ac_cv_libodraw" = xyes], [AC_SUBST( [ax_libodraw_pc_libs_private], [-lodraw]) ]) AS_IF( [test "x$ac_cv_libodraw" = xyes], [AC_SUBST( [ax_libodraw_spec_requires], [libodraw]) AC_SUBST( [ax_libodraw_spec_build_requires], [libodraw-devel]) ]) ]) libewf-20140807/m4/ltoptions.m40000644000175000017500000003426213443455336020165 0ustar00lordyestalordyesta00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libewf-20140807/m4/libcpath.m40000664000175000017500000002224313440550332017703 0ustar00lordyestalordyesta00000000000000dnl Checks for libcpath required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcpath is available dnl ac_libcpath_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCPATH_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcpath" = xno], [ac_cv_libcpath=no], [ac_cv_libcpath=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcpath"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcpath}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcpath}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcpath], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcpath], [libcpath >= 20180716], [ac_cv_libcpath=yes], [ac_cv_libcpath=check]) ]) AS_IF( [test "x$ac_cv_libcpath" = xyes && test "x$ac_cv_enable_wide_character_type" != xno], [AC_CACHE_CHECK( [whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1], [ac_cv_header_libcpath_features_h_have_wide_character_type], [AC_LANG_PUSH(C) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if !defined( LIBCPATH_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCPATH_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCPATH_HAVE_WIDE_CHARACTER_TYPE not defined #endif]] )], [ac_cv_header_libcpath_features_h_have_wide_character_type=yes], [ac_cv_header_libcpath_features_h_have_wide_character_type=no]) AC_LANG_POP(C)], [ac_cv_header_libcpath_features_h_have_wide_character_type=no]) AS_IF( [test "x$ac_cv_header_libcpath_features_h_have_wide_character_type" = xno], [ac_cv_libcpath=no]) ]) AS_IF( [test "x$ac_cv_libcpath" = xyes], [ac_cv_libcpath_CPPFLAGS="$pkg_cv_libcpath_CFLAGS" ac_cv_libcpath_LIBADD="$pkg_cv_libcpath_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcpath" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcpath.h]) AS_IF( [test "x$ac_cv_header_libcpath_h" = xno], [ac_cv_libcpath=no], [dnl Check for the individual functions ac_cv_libcpath=yes AC_CHECK_LIB( cpath, libcpath_get_version, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) dnl Path functions AC_CHECK_LIB( cpath, libcpath_path_change_directory, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_current_working_directory, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_full_path, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_sanitized_filename, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_sanitized_path, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_join, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_make_directory, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( cpath, libcpath_path_change_directory_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_current_working_directory_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_full_path_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_sanitized_filename_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_get_sanitized_path_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_join_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) AC_CHECK_LIB( cpath, libcpath_path_make_directory_wide, [ac_cv_libcpath_dummy=yes], [ac_cv_libcpath=no]) ]) ac_cv_libcpath_LIBADD="-lcpath"]) ]) AS_IF( [test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_libcpath" != xyes], [AC_MSG_FAILURE( [unable to find supported libcpath in directory: $ac_cv_with_libcpath], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcpath" = xyes], [AC_DEFINE( [HAVE_LIBCPATH], [1], [Define to 1 if you have the `cpath' library (-lcpath).]) ]) AS_IF( [test "x$ac_cv_libcpath" = xyes], [AC_SUBST( [HAVE_LIBCPATH], [1]) ], [AC_SUBST( [HAVE_LIBCPATH], [0]) ]) ]) dnl Function to detect if mkdir is available dnl Also checks how to use mkdir AC_DEFUN([AX_LIBCPATH_CHECK_FUNC_MKDIR], [AC_CHECK_FUNCS([mkdir]) AS_IF( [test "x$ac_cv_func_mkdir" = xyes], [AC_MSG_CHECKING( [how to use mkdir]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_LANG_PUSH(C) AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[mkdir( "", 0 )]] )], [AC_MSG_RESULT( [with additional mode argument]) ac_cv_cv_mkdir_mode=yes], [ac_cv_cv_mkdir_mode=no]) AS_IF( [test "x$ac_cv_cv_mkdir_mode" = xno], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[mkdir( "" )]] )], [AC_MSG_RESULT( [with single argument]) ac_cv_cv_mkdir=yes], [ac_cv_cv_mkdir=no]) ]) AC_LANG_POP(C) CFLAGS="$SAVE_CFLAGS" AS_IF( [test "x$ac_cv_cv_mkdir_mode" = xno && test "x$ac_cv_cv_mkdir" = xno], [AC_MSG_WARN( [unknown]) ac_cv_func_mkdir=no]) AS_IF( [test "x$ac_cv_func_mkdir" = xyes], [AC_DEFINE( [HAVE_MKDIR], [1], [Define to 1 if you have the mkdir function.]) ]) AS_IF( [test "x$ac_cv_cv_mkdir_mode" = xyes], [AC_DEFINE( [HAVE_MKDIR_MODE], [1], [Define to 1 if you have the mkdir function with a second mode argument.]) ]) ]) AS_IF( [test "x$ac_cv_func_mkdir" = xno], [AC_MSG_FAILURE( [Missing function: mkdir], [1]) ]) ]) dnl Function to detect if libcpath dependencies are available AC_DEFUN([AX_LIBCPATH_CHECK_LOCAL], [dnl Headers included in libcpath/libcpath_path.h AC_CHECK_HEADERS([errno.h sys/stat.h sys/syslimits.h]) dnl Path functions used in libcpath/libcpath_path.h AC_CHECK_FUNCS([chdir getcwd]) AS_IF( [test "x$ac_cv_func_chdir" != xyes], [AC_MSG_FAILURE( [Missing functions: chdir], [1]) ]) AS_IF( [test "x$ac_cv_func_getcwd" != xyes], [AC_MSG_FAILURE( [Missing functions: getcwd], [1]) ]) AX_LIBCPATH_CHECK_FUNC_MKDIR ac_cv_libcpath_CPPFLAGS="-I../libcpath"; ac_cv_libcpath_LIBADD="../libcpath/libcpath.la"; ac_cv_libcpath=local ]) dnl Function to detect how to enable libcpath AC_DEFUN([AX_LIBCPATH_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcpath], [libcpath], [search for libcpath 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_LIBCPATH_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcpath" != xyes], [AX_LIBCPATH_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCPATH], [1], [Define to 1 if the local version of libcpath is used.]) AC_SUBST( [HAVE_LOCAL_LIBCPATH], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCPATH], [test "x$ac_cv_libcpath" = xlocal]) AS_IF( [test "x$ac_cv_libcpath_CPPFLAGS" != "x"], [AC_SUBST( [LIBCPATH_CPPFLAGS], [$ac_cv_libcpath_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcpath_LIBADD" != "x"], [AC_SUBST( [LIBCPATH_LIBADD], [$ac_cv_libcpath_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcpath" = xyes], [AC_SUBST( [ax_libcpath_pc_libs_private], [-lcpath]) ]) AS_IF( [test "x$ac_cv_libcpath" = xyes], [AC_SUBST( [ax_libcpath_spec_requires], [libcpath]) AC_SUBST( [ax_libcpath_spec_build_requires], [libcpath-devel]) ]) ]) libewf-20140807/m4/lib-ld.m40000644000175000017500000000660312076507232017265 0ustar00lordyestalordyesta00000000000000# lib-ld.m4 serial 4 (gettext-0.18) dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT([$LD]) else AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) libewf-20140807/m4/libcthreads.m40000664000175000017500000002555013440550332020405 0ustar00lordyestalordyesta00000000000000dnl Checks for libcthreads required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcthreads is available dnl ac_libcthreads_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcthreads" = xno], [ac_cv_libcthreads=no], [ac_cv_libcthreads=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcthreads"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcthreads}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcthreads}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcthreads], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcthreads], [libcthreads >= 20160404], [ac_cv_libcthreads=yes], [ac_cv_libcthreads=check]) ]) AS_IF( [test "x$ac_cv_libcthreads" = xyes], [ac_cv_libcthreads_CPPFLAGS="$pkg_cv_libcthreads_CFLAGS" ac_cv_libcthreads_LIBADD="$pkg_cv_libcthreads_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcthreads" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcthreads.h]) AS_IF( [test "x$ac_cv_header_libcthreads_h" = xno], [ac_cv_libcthreads=no], [dnl Check for the individual functions ac_cv_libcthreads=yes AC_CHECK_LIB( cthreads, libcthreads_get_version, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Thread functions AC_CHECK_LIB( cthreads, libcthreads_thread_create, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_thread_join, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Thread attributes functions AC_CHECK_LIB( cthreads, libcthreads_thread_attributes_initialize, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_thread_attributes_free, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Condition functions AC_CHECK_LIB( cthreads, libcthreads_condition_initialize, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_condition_free, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_condition_broadcast, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_condition_signal, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_condition_wait, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Lock functions AC_CHECK_LIB( cthreads, libcthreads_lock_initialize, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_lock_free, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_lock_grab, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_lock_release, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Mutex functions AC_CHECK_LIB( cthreads, libcthreads_mutex_initialize, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_mutex_free, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_mutex_grab, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_mutex_try_grab, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_mutex_release, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Read/Write lock functions AC_CHECK_LIB( cthreads, libcthreads_read_write_lock_initialize, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_read_write_lock_free, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_read_write_lock_grab_for_read, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_read_write_lock_grab_for_write, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_read_write_lock_release_for_read, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_read_write_lock_release_for_write, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Queue functions AC_CHECK_LIB( cthreads, libcthreads_queue_initialize, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_queue_free, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_queue_type_pop, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_queue_pop, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_queue_try_push, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_queue_push, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_queue_push_sorted, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) dnl Thread pool functions AC_CHECK_LIB( cthreads, libcthreads_thread_pool_create, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_thread_pool_push, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_thread_pool_push_sorted, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) AC_CHECK_LIB( cthreads, libcthreads_thread_pool_join, [ac_cv_libcthreads_dummy=yes], [ac_cv_libcthreads=no]) ac_cv_libcthreads_LIBADD="-lcthreads"]) ]) AS_IF( [test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_libcthreads" != xyes], [AC_MSG_FAILURE( [unable to find supported libcthreads in directory: $ac_cv_with_libcthreads], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcthreads" = xyes], [AC_DEFINE( [HAVE_LIBCTHREADS], [1], [Define to 1 if you have the `cthreads' library (-lcthreads).]) ]) AS_IF( [test "x$ac_cv_libcthreads" = xyes], [ac_cv_libcthreads_multi_threading=libcthreads], [ac_cv_libcthreads_multi_threading=no]) AS_IF( [test "x$ac_cv_libcthreads" = xyes], [AC_SUBST( [HAVE_LIBCTHREADS], [1]) ], [AC_SUBST( [HAVE_LIBCTHREADS], [0]) ]) ]) dnl Function to detect if libcthreads dependencies are available AC_DEFUN([AX_LIBCTHREADS_CHECK_LOCAL], [AS_IF( [test "x$ac_cv_enable_winapi" = xno], [dnl Check for enabling pthread support AX_PTHREAD_CHECK_ENABLE ac_cv_libcthreads_multi_threading=$ac_cv_pthread], [ac_cv_libcthreads_multi_threading="winapi"]) AS_IF( [test "x$ac_cv_libcthreads_multi_threading" != xno], [ac_cv_libcthreads_CPPFLAGS="-I../libcthreads"; ac_cv_libcthreads_LIBADD="../libcthreads/libcthreads.la"; ac_cv_libcthreads=local], [ac_cv_libcthreads=no]) ]) dnl Function to detect how to enable libcthreads AC_DEFUN([AX_LIBCTHREADS_CHECK_ENABLE], [AX_COMMON_ARG_ENABLE( [multi-threading-support], [multi_threading_support], [enable multi-threading support], [yes]) AX_COMMON_ARG_WITH( [libcthreads], [libcthreads], [search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version], [auto-detect], [DIR]) AS_IF( [test "x$ac_cv_enable_multi_threading_support" = xno], [ac_cv_libcthreads="no" ac_cv_libcthreads_multi_threading="no"], [dnl Check for a shared library version AX_LIBCTHREADS_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcthreads" != xyes], [AX_LIBCTHREADS_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCTHREADS], [1], [Define to 1 if the local version of libcthreads is used.]) AC_SUBST( [HAVE_LOCAL_LIBCTHREADS], [1]) ]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCTHREADS], [test "x$ac_cv_libcthreads" = xlocal]) AS_IF( [test "x$ac_cv_libcthreads_CPPFLAGS" != "x"], [AC_SUBST( [LIBCTHREADS_CPPFLAGS], [$ac_cv_libcthreads_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcthreads_LIBADD" != "x"], [AC_SUBST( [LIBCTHREADS_LIBADD], [$ac_cv_libcthreads_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcthreads" != xno], [AC_DEFINE( [HAVE_MULTI_THREAD_SUPPORT], [1], [Define to 1 if multi thread support should be used.]) AC_SUBST( [HAVE_MULTI_THREAD_SUPPORT], [1]) ], [AC_SUBST( [HAVE_MULTI_THREAD_SUPPORT], [0]) ]) AS_IF( [test "x$ac_cv_libcthreads" = xyes], [AC_SUBST( [ax_libcthreads_pc_libs_private], [-lcthreads]) ]) AS_IF( [test "x$ac_cv_libcthreads" = xyes], [AC_SUBST( [ax_libcthreads_spec_requires], [libcthreads]) AC_SUBST( [ax_libcthreads_spec_build_requires], [libcthreads-devel]) ]) ]) libewf-20140807/m4/lib-link.m40000644000175000017500000010020212076507232017611 0ustar00lordyestalordyesta00000000000000# lib-link.m4 serial 21 (gettext-0.18) dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[translit([$1],[./-], [___])]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[translit([$1],[./-], [___])]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) libewf-20140807/m4/libhmac.m40000664000175000017500000002017713440550332017520 0ustar00lordyestalordyesta00000000000000dnl Checks for libhmac required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libhmac is available dnl ac_libhmac_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBHMAC_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libhmac" = xno], [ac_cv_libhmac=no], [ac_cv_libhmac=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libhmac"], [CFLAGS="$CFLAGS -I${ac_cv_with_libhmac}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libhmac}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libhmac], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libhmac], [libhmac >= 20160802], [ac_cv_libhmac=yes], [ac_cv_libhmac=check]) ]) AS_IF( [test "x$ac_cv_libhmac" = xyes], [ac_cv_libhmac_CPPFLAGS="$pkg_cv_libhmac_CFLAGS" ac_cv_libhmac_LIBADD="$pkg_cv_libhmac_LIBS"]) ]) AS_IF( [test "x$ac_cv_libhmac" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libhmac.h]) AS_IF( [test "x$ac_cv_header_libhmac_h" = xno], [ac_cv_libhmac=no], [dnl Check for the individual functions ac_cv_libhmac=yes AC_CHECK_LIB( hmac, libhmac_get_version, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) dnl MD5 functions AC_CHECK_LIB( hmac, libhmac_md5_initialize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_md5_update, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_md5_finalize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_md5_free, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) dnl SHA1 functions AC_CHECK_LIB( hmac, libhmac_sha1_initialize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha1_update, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha1_finalize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha1_free, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) dnl SHA224 functions AC_CHECK_LIB( hmac, libhmac_sha224_initialize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha224_update, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha224_finalize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha224_free, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) dnl SHA256 functions AC_CHECK_LIB( hmac, libhmac_sha256_initialize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha256_update, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha256_finalize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha256_free, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) dnl SHA512 functions AC_CHECK_LIB( hmac, libhmac_sha512_initialize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha512_update, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha512_finalize, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) AC_CHECK_LIB( hmac, libhmac_sha512_free, [ac_cv_libhmac_dummy=yes], [ac_cv_libhmac=no]) ac_cv_libhmac_LIBADD="-lhmac"]) ]) AS_IF( [test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect && test "x$ac_cv_libhmac" != xyes], [AC_MSG_FAILURE( [unable to find supported libhmac in directory: $ac_cv_with_libhmac], [1]) ]) ]) AS_IF( [test "x$ac_cv_libhmac" = xyes], [AC_DEFINE( [HAVE_LIBHMAC], [1], [Define to 1 if you have the `hmac' library (-lhmac).]) ]) AS_IF( [test "x$ac_cv_libhmac" = xyes], [ac_cv_libhmac_md5=libhmac ac_cv_libhmac_sha1=libhmac ac_cv_libhmac_sha224=libhmac ac_cv_libhmac_sha256=libhmac ac_cv_libhmac_sha512=libhmac], [ac_cv_libhmac_md5=no ac_cv_libhmac_sha1=no ac_cv_libhmac_sha224=no ac_cv_libhmac_sha256=no ac_cv_libhmac_sha512=no]) AS_IF( [test "x$ac_cv_libhmac" = xyes], [AC_SUBST( [HAVE_LIBHMAC], [1]) ], [AC_SUBST( [HAVE_LIBHMAC], [0]) ]) ]) dnl Function to detect if libhmac dependencies are available AC_DEFUN([AX_LIBHMAC_CHECK_LOCAL], [dnl Check for libcrypto (openssl) support AX_LIBCRYPTO_CHECK_ENABLE AS_IF( [test "x$ac_cv_libcrypto" != xno], [AX_LIBCRYPTO_CHECK_MD5 AX_LIBCRYPTO_CHECK_SHA1 AX_LIBCRYPTO_CHECK_SHA224 AX_LIBCRYPTO_CHECK_SHA256 AX_LIBCRYPTO_CHECK_SHA512]) dnl Fallback to local versions if necessary AS_IF( [test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_md5" = xno], [ac_cv_libhmac_md5=local], [ac_cv_libhmac_md5=$ac_cv_libcrypto_md5]) AS_IF( [test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha1" = xno], [ac_cv_libhmac_sha1=local], [ac_cv_libhmac_sha1=$ac_cv_libcrypto_sha1]) AS_IF( [test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha224" = xno], [ac_cv_libhmac_sha224=local], [ac_cv_libhmac_sha224=$ac_cv_libcrypto_sha224]) AS_IF( [test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha256" = xno], [ac_cv_libhmac_sha256=local], [ac_cv_libhmac_sha256=$ac_cv_libcrypto_sha256]) AS_IF( [test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha512" = xno], [ac_cv_libhmac_sha512=local], [ac_cv_libhmac_sha512=$ac_cv_libcrypto_sha512]) ac_cv_libhmac_CPPFLAGS="-I../libhmac"; ac_cv_libhmac_LIBADD="../libhmac/libhmac.la"; ac_cv_libhmac=local ]) dnl Function to detect how to enable libhmac AC_DEFUN([AX_LIBHMAC_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libhmac], [libhmac], [search for libhmac 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_LIBHMAC_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libhmac" != xyes], [AX_LIBHMAC_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBHMAC], [1], [Define to 1 if the local version of libhmac is used.]) AC_SUBST( [HAVE_LOCAL_LIBHMAC], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBHMAC], [test "x$ac_cv_libhmac" = xlocal]) AS_IF( [test "x$ac_cv_libhmac_CPPFLAGS" != "x"], [AC_SUBST( [LIBHMAC_CPPFLAGS], [$ac_cv_libhmac_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libhmac_LIBADD" != "x"], [AC_SUBST( [LIBHMAC_LIBADD], [$ac_cv_libhmac_LIBADD]) ]) AS_IF( [test "x$ac_cv_libhmac" = xyes], [AC_SUBST( [ax_libhmac_pc_libs_private], [-lhmac]) ]) AS_IF( [test "x$ac_cv_libhmac" = xyes], [AC_SUBST( [ax_libhmac_spec_requires], [libhmac]) AC_SUBST( [ax_libhmac_spec_build_requires], [libhmac-devel]) ]) ]) libewf-20140807/m4/python.m40000664000175000017500000004042413407162311017436 0ustar00lordyestalordyesta00000000000000dnl Functions for Python bindings dnl dnl Version: 20170830 dnl Function to check if the python binary is available dnl "python${PYTHON_VERSION} python python# python#.#" AC_DEFUN([AX_PROG_PYTHON], [AS_IF( [test "x${PYTHON_VERSION}" != x], [ax_python_progs="python${PYTHON_VERSION}"], [ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"]) AC_CHECK_PROGS( [PYTHON], [$ax_python_progs]) AS_IF( [test "x${PYTHON}" != x], [ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; AC_SUBST( [PYTHON_VERSION], [$ax_prog_python_version]) ax_prog_python_platform=`${PYTHON} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; AC_SUBST( [PYTHON_PLATFORM], [$ax_prog_python_platform]) ], [AC_MSG_ERROR( [Unable to find python]) ]) AC_SUBST( [PYTHON], [$PYTHON]) ]) dnl Function to check if the python2 binary is available dnl "python2 python2.#" AC_DEFUN([AX_PROG_PYTHON2], [ax_python2_progs="python2 python2.7 python2.6 python2.5" AC_CHECK_PROGS( [PYTHON2], [$ax_python2_progs]) AS_IF( [test "x${PYTHON2}" != x], [ax_prog_python2_version=`${PYTHON2} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; AC_SUBST( [PYTHON2_VERSION], [$ax_prog_python2_version]) ax_prog_python2_platform=`${PYTHON2} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; AC_SUBST( [PYTHON2_PLATFORM], [$ax_prog_python2_platform]) ], [AC_MSG_ERROR( [Unable to find python2]) ]) AC_SUBST( [PYTHON2], [$PYTHON2]) ]) dnl Function to check if the python3 binary is available dnl "python3 python3.#" AC_DEFUN([AX_PROG_PYTHON3], [ax_python3_progs="python3 python3.4 python3.3 python3.2 python3.1 python3.0" AC_CHECK_PROGS( [PYTHON3], [$ax_python3_progs]) AS_IF( [test "x${PYTHON3}" != x], [ax_prog_python3_version=`${PYTHON3} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; AC_SUBST( [PYTHON3_VERSION], [$ax_prog_python3_version]) ax_prog_python3_platform=`${PYTHON3} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; AC_SUBST( [PYTHON3_PLATFORM], [$ax_prog_python3_platform]) ], [AC_MSG_ERROR( [Unable to find python3]) ]) AC_SUBST( [PYTHON3], [$PYTHON3]) ]) dnl Function to check if the python-config binary is available dnl "python${PYTHON_VERSION}-config python-config" AC_DEFUN([AX_PROG_PYTHON_CONFIG], [AS_IF( [test "x${PYTHON}" != x], [AC_CHECK_PROGS( [PYTHON_CONFIG], [python${PYTHON_VERSION}-config python-config]) ]) AS_IF( [test "x${PYTHON_CONFIG}" = x], [AC_MSG_ERROR( [Unable to find python-config]) ]) AC_SUBST( [PYTHON_CONFIG], [$PYTHON_CONFIG]) ]) dnl Function to check if the python2-config binary is available AC_DEFUN([AX_PROG_PYTHON2_CONFIG], [AS_IF( [test "x${PYTHON2}" != x], [AC_CHECK_PROGS( [PYTHON2_CONFIG], [python2-config]) ]) AS_IF( [test "x${PYTHON2_CONFIG}" = x], [AC_MSG_ERROR( [Unable to find python2-config]) ]) AC_SUBST( [PYTHON2_CONFIG], [$PYTHON2_CONFIG]) ]) dnl Function to check if the python3-config binary is available AC_DEFUN([AX_PROG_PYTHON3_CONFIG], [AS_IF( [test "x${PYTHON3}" != x], [AC_CHECK_PROGS( [PYTHON3_CONFIG], [python3-config]) ]) AS_IF( [test "x${PYTHON3_CONFIG}" = x], [AC_MSG_ERROR( [Unable to find python3-config]) ]) AC_SUBST( [PYTHON3_CONFIG], [$PYTHON3_CONFIG]) ]) dnl Function to detect if a Python build environment is available AC_DEFUN([AX_PYTHON_CHECK], [AX_PROG_PYTHON AX_PROG_PYTHON_CONFIG AS_IF( [test "x${PYTHON_CONFIG}" != x], [dnl Check for Python includes PYTHON_INCLUDES=`${PYTHON_CONFIG} --includes 2>/dev/null`; AC_MSG_CHECKING( [for Python includes]) AC_MSG_RESULT( [$PYTHON_INCLUDES]) dnl Check for Python libraries PYTHON_LDFLAGS=`${PYTHON_CONFIG} --ldflags 2>/dev/null`; AC_MSG_CHECKING( [for Python libraries]) AC_MSG_RESULT( [$PYTHON_LDFLAGS]) dnl For CygWin add the -no-undefined linker flag AS_CASE( [$host_os], [cygwin*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"], [*],[]) dnl Check for the existence of Python.h BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON_INCLUDES}" AC_CHECK_HEADERS( [Python.h], [ac_cv_header_python_h=yes], [ac_cv_header_python_h=no]) CPPFLAGS="${BACKUP_CPPFLAGS}" ]) AS_IF( [test "x${ac_cv_header_python_h}" != xyes], [ac_cv_enable_python=no], [ac_cv_enable_python=$PYTHON_VERSION AC_SUBST( [PYTHON_CPPFLAGS], [$PYTHON_INCLUDES]) AC_SUBST( [PYTHON_LDFLAGS], [$PYTHON_LDFLAGS]) dnl Check for Python prefix AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python_prefix="\${prefix}"], [ax_python_prefix=`${PYTHON_CONFIG} --prefix 2>/dev/null`]) AC_SUBST( [PYTHON_PREFIX], [$ax_python_prefix]) dnl Check for Python exec-prefix AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python_exec_prefix="\${exec_prefix}"], [ax_python_exec_prefix=`${PYTHON_CONFIG} --exec-prefix 2>/dev/null`]) AC_SUBST( [PYTHON_EXEC_PREFIX], [$ax_python_exec_prefix]) dnl Check for Python library directory ax_python_pythondir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pythondir}" = x || test "x${ac_cv_with_pythondir}" = xno], [AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python_pythondir="${ax_python_prefix}/${ax_python_pythondir_suffix}"], [ax_python_pythondir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null`])], [ax_python_pythondir=$ac_cv_with_pythondir]) AC_SUBST( [pythondir], [$ax_python_pythondir]) dnl Check for Python platform specific library directory ax_python_pyexecdir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; ax_python_library_dir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python_pyexecdir="${ax_python_exec_prefix}/${ax_python_pyexecdir_suffix}"], [ax_python_pyexecdir=$ax_python_library_dir]) AC_SUBST( [pyexecdir], [$ax_python_pyexecdir]) AC_SUBST( [PYTHON_LIBRARY_DIR], [$ax_python_pyexecdir_suffix]) AC_SUBST( [PYTHON_PACKAGE_DIR], [$ax_python_library_dir]) ]) ]) dnl Function to detect if a Python 2 build environment is available AC_DEFUN([AX_PYTHON2_CHECK], [AX_PROG_PYTHON2 AX_PROG_PYTHON2_CONFIG AS_IF( [test "x${PYTHON2_CONFIG}" != x], [dnl Check for Python 2 includes PYTHON2_INCLUDES=`${PYTHON2_CONFIG} --includes 2>/dev/null`; AC_MSG_CHECKING( [for Python verison 2 includes]) AC_MSG_RESULT( [$PYTHON2_INCLUDES]) dnl Check for Python 2 libraries PYTHON2_LDFLAGS=`${PYTHON2_CONFIG} --ldflags 2>/dev/null`; AC_MSG_CHECKING( [for Python 2 libraries]) AC_MSG_RESULT( [$PYTHON2_LDFLAGS]) dnl For CygWin add the -no-undefined linker flag AS_CASE( [$host_os], [cygwin*],[PYTHON2_LDFLAGS="${PYTHON2_LDFLAGS} -no-undefined"], [*],[]) dnl Check for the existence of Python.h BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON2_INCLUDES}" AC_CHECK_HEADERS( [Python.h], [ac_cv_header_python2_h=yes], [ac_cv_header_python2_h=no]) CPPFLAGS="${BACKUP_CPPFLAGS}" ]) AS_IF( [test "x${ac_cv_header_python2_h}" != xyes], [ac_cv_enable_python2=no], [ac_cv_enable_python2=$PYTHON2_VERSION AC_SUBST( [PYTHON2_CPPFLAGS], [$PYTHON2_INCLUDES]) AC_SUBST( [PYTHON2_LDFLAGS], [$PYTHON2_LDFLAGS]) dnl Check for Python prefix AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python2_prefix="\${prefix}"], [ax_python2_prefix=`${PYTHON2_CONFIG} --prefix 2>/dev/null`]) AC_SUBST( [PYTHON2_PREFIX], [$ax_python2_prefix]) dnl Check for Python exec-prefix AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python2_exec_prefix="\${exec_prefix}"], [ax_python2_exec_prefix=`${PYTHON2_CONFIG} --exec-prefix 2>/dev/null`]) AC_SUBST( [PYTHON2_EXEC_PREFIX], [$ax_python2_exec_prefix]) dnl Check for Python 2 library directory ax_python2_pythondir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pythondir2}" = x || test "x${ac_cv_with_pythondir2}" = xno], [AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python2_pythondir="${ax_python_prefix}/${ax_python2_pythondir_suffix}"], [ax_python2_pythondir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null`])], [ax_python2_pythondir=$ac_cv_with_pythondir2]) AC_SUBST( [pythondir2], [$ax_python2_pythondir]) dnl Check for Python 2 platform specific library directory ax_python2_pyexecdir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; ax_python2_library_dir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python2_pyexecdir="${ax_python2_exec_prefix}/${ax_python2_pyexecdir_suffix}"], [ax_python2_pyexecdir=$ax_python2_library_dir]) AC_SUBST( [pyexecdir2], [$ax_python2_pyexecdir]) AC_SUBST( [PYTHON2_LIBRARY_DIR], [$ax_python2_pyexecdir_suffix]) AC_SUBST( [PYTHON2_PACKAGE_DIR], [$ax_python2_library_dir]) ]) ]) dnl Function to detect if a Python 3 build environment is available AC_DEFUN([AX_PYTHON3_CHECK], [AX_PROG_PYTHON3 AX_PROG_PYTHON3_CONFIG AS_IF( [test "x${PYTHON3_CONFIG}" != x], [dnl Check for Python 3 includes PYTHON3_INCLUDES=`${PYTHON3_CONFIG} --includes 2>/dev/null`; AC_MSG_CHECKING( [for Python verison 3 includes]) AC_MSG_RESULT( [$PYTHON3_INCLUDES]) dnl Check for Python 3 libraries PYTHON3_LDFLAGS=`${PYTHON3_CONFIG} --ldflags 2>/dev/null`; AC_MSG_CHECKING( [for Python 3 libraries]) AC_MSG_RESULT( [$PYTHON3_LDFLAGS]) dnl For CygWin add the -no-undefined linker flag AS_CASE( [$host_os], [cygwin*],[PYTHON3_LDFLAGS="${PYTHON3_LDFLAGS} -no-undefined"], [*],[]) dnl Check for the existence of Python.h BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON3_INCLUDES}" AC_CHECK_HEADERS( [Python.h], [ac_cv_header_python3_h=yes], [ac_cv_header_python3_h=no]) CPPFLAGS="${BACKUP_CPPFLAGS}" ]) AS_IF( [test "x${ac_cv_header_python3_h}" != xyes], [ac_cv_enable_python3=no], [ac_cv_enable_python3=$PYTHON3_VERSION AC_SUBST( [PYTHON3_CPPFLAGS], [$PYTHON3_INCLUDES]) AC_SUBST( [PYTHON3_LDFLAGS], [$PYTHON3_LDFLAGS]) dnl Check for Python prefix AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python3_prefix="\${prefix}"], [ax_python3_prefix=`${PYTHON3_CONFIG} --prefix 2>/dev/null`]) AC_SUBST( [PYTHON3_PREFIX], [$ax_python3_prefix]) dnl Check for Python exec-prefix AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python3_exec_prefix="\${exec_prefix}"], [ax_python3_exec_prefix=`${PYTHON3_CONFIG} --exec-prefix 2>/dev/null`]) AC_SUBST( [PYTHON3_EXEC_PREFIX], [$ax_python3_exec_prefix]) dnl Check for Python 3 library directory ax_python3_pythondir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pythondir3}" = x || test "x${ac_cv_with_pythondir3}" = xno], [AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python3_pythondir="${ax_python_prefix}/${ax_python3_pythondir_suffix}"], [ax_python3_pythondir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null`])], [ax_python3_pythondir=$ac_cv_with_pythondir3]) AC_SUBST( [pythondir3], [$ax_python3_pythondir]) dnl Check for Python 3 platform specific library directory ax_python3_pyexecdir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; ax_python3_library_dir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python3_pyexecdir="${ax_python3_exec_prefix}/${ax_python3_pyexecdir_suffix}"], [ax_python3_pyexecdir=$ax_python3_library_dir]) AC_SUBST( [pyexecdir3], [$ax_python3_pyexecdir]) AC_SUBST( [PYTHON3_LIBRARY_DIR], [$ax_python3_pyexecdir_suffix]) AC_SUBST( [PYTHON3_PACKAGE_DIR], [$ax_python3_library_dir]) ]) ]) dnl Function to determine the prefix of pythondir AC_DEFUN([AX_PYTHON_CHECK_PYPREFIX], [AX_COMMON_ARG_WITH( [pyprefix], [pyprefix], [use `python-config --prefix' to determine the prefix of pythondir instead of --prefix], [no], [no]) ]) dnl Function to detect if to enable Python AC_DEFUN([AX_PYTHON_CHECK_ENABLE], [AX_PYTHON_CHECK_PYPREFIX AX_COMMON_ARG_ENABLE( [python], [python], [build Python bindings], [no]) AX_COMMON_ARG_WITH( [pythondir], [pythondir], [use to specify the Python directory (pythondir)], [no], [no]) AX_COMMON_ARG_ENABLE( [python2], [python2], [build Python 2 bindings], [no]) AX_COMMON_ARG_WITH( [pythondir2], [pythondir2], [use to specify the Python 2 directory (pythondir2)], [no], [no]) AX_COMMON_ARG_ENABLE( [python3], [python3], [build Python 3 bindings], [no]) AX_COMMON_ARG_WITH( [pythondir3], [pythondir3], [use to specify the Python 3 directory (pythondir3)], [no], [no]) AS_IF( [test "x${ac_cv_enable_python}" != xno], [AX_PYTHON_CHECK]) AS_IF( [test "x${ac_cv_enable_python2}" != xno], [AX_PYTHON2_CHECK]) AS_IF( [test "x${ac_cv_enable_python3}" != xno], [AX_PYTHON3_CHECK]) AM_CONDITIONAL( HAVE_PYTHON, [test "x${ac_cv_enable_python}" != xno]) AM_CONDITIONAL( HAVE_PYTHON2, [test "x${ac_cv_enable_python2}" != xno]) AM_CONDITIONAL( HAVE_PYTHON3, [test "x${ac_cv_enable_python3}" != xno]) AM_CONDITIONAL( HAVE_PYTHON_TESTS, [test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno]) AS_IF( [test "x${ac_cv_enable_python}" = xno], [AS_IF( [test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno], [AS_IF( [test "x${ac_cv_enable_python2}" != xno], [ac_cv_enable_python=${ac_cv_enable_python2}], [ac_cv_enable_python=""]) AS_IF( [test "x${ac_cv_enable_python3}" != xno], [AS_IF( [test "x${ac_cv_enable_python}" != x], [ac_cv_enable_python="${ac_cv_enable_python}, "]) ac_cv_enable_python="${ac_cv_enable_python}${ac_cv_enable_python3}"]) ]) ]) ]) ]) libewf-20140807/m4/libtool.m40000644000175000017500000112530613443455336017577 0ustar00lordyestalordyesta00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libewf-20140807/m4/nls.m40000644000175000017500000000231512076507232016712 0ustar00lordyestalordyesta00000000000000# nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) libewf-20140807/m4/libclocale.m40000664000175000017500000002004613440550332020205 0ustar00lordyestalordyesta00000000000000dnl Checks for libclocale required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libclocale is available dnl ac_libclocale_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libclocale" = xno], [ac_cv_libclocale=no], [ac_cv_libclocale=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libclocale"], [CFLAGS="$CFLAGS -I${ac_cv_with_libclocale}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libclocale}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libclocale], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libclocale], [libclocale >= 20120425], [ac_cv_libclocale=yes], [ac_cv_libclocale=check]) ]) AS_IF( [test "x$ac_cv_libclocale" = xyes && test "x$ac_cv_enable_wide_character_type" != xno], [AC_CACHE_CHECK( [whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1], [ac_cv_header_libclocale_features_h_have_wide_character_type], [AC_LANG_PUSH(C) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if !defined( LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE not defined #endif]] )], [ac_cv_header_libclocale_features_h_have_wide_character_type=yes], [ac_cv_header_libclocale_features_h_have_wide_character_type=no]) AC_LANG_POP(C)], [ac_cv_header_libclocale_features_h_have_wide_character_type=no]) AS_IF( [test "x$ac_cv_header_libclocale_features_h_have_wide_character_type" = xno], [ac_cv_libclocale=no]) ]) AS_IF( [test "x$ac_cv_libclocale" = xyes], [ac_cv_libclocale_CPPFLAGS="$pkg_cv_libclocale_CFLAGS" ac_cv_libclocale_LIBADD="$pkg_cv_libclocale_LIBS"]) ]) AS_IF( [test "x$ac_cv_libclocale" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libclocale.h]) AS_IF( [test "x$ac_cv_header_libclocale_h" = xno], [ac_cv_libclocale=no], [dnl Check for the individual functions ac_cv_libclocale=yes AC_CHECK_LIB( clocale, libclocale_get_version, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) dnl Codepage functions AC_CHECK_LIB( clocale, libclocale_codepage, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) AC_CHECK_LIB( clocale, libclocale_codepage_get, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) AC_CHECK_LIB( clocale, libclocale_codepage_set, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) AC_CHECK_LIB( clocale, libclocale_codepage_copy_from_string, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( clocale, libclocale_codepage_copy_from_string_wide, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) ]) dnl Locale functions AC_CHECK_LIB( clocale, libclocale_locale_get_codepage, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) AC_CHECK_LIB( clocale, libclocale_locale_get_decimal_point, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) dnl Support functions AC_CHECK_LIB( clocale, libclocale_initialize, [ac_cv_libclocale_dummy=yes], [ac_cv_libclocale=no]) ac_cv_libclocale_LIBADD="-lclocale"]) ]) AS_IF( [test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_libclocale" != xyes], [AC_MSG_FAILURE( [unable to find supported libclocale in directory: $ac_cv_with_libclocale], [1]) ]) ]) AS_IF( [test "x$ac_cv_libclocale" = xyes], [AC_DEFINE( [HAVE_LIBCLOCALE], [1], [Define to 1 if you have the `clocale' library (-lclocale).]) ]) AS_IF( [test "x$ac_cv_libclocale" = xyes], [AC_SUBST( [HAVE_LIBCLOCALE], [1]) ], [AC_SUBST( [HAVE_LIBCLOCALE], [0]) ]) ]) dnl Function to detect whether nl_langinfo supports CODESET AC_DEFUN([AX_LIBCLOCALE_CHECK_FUNC_LANGINFO_CODESET], [AC_CHECK_FUNCS([nl_langinfo]) AS_IF( [test "x$ac_cv_func_nl_langinfo" = xyes], [AC_CACHE_CHECK( [for nl_langinfo CODESET support], [ac_cv_cv_langinfo_codeset], [AC_LANG_PUSH(C) AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[char* charset = nl_langinfo( CODESET );]] )], [ac_cv_cv_langinfo_codeset=yes], [ac_cv_cv_langinfo_codeset=no]) AC_LANG_POP(C) ]) ], [ac_cv_cv_langinfo_codeset=no]) AS_IF( [test "x$ac_cv_cv_langinfo_codeset" = xyes], [AC_DEFINE( [HAVE_LANGINFO_CODESET], [1], [Define if nl_langinfo has CODESET support.]) ]) ]) dnl Function to detect if libclocale dependencies are available AC_DEFUN([AX_LIBCLOCALE_CHECK_LOCAL], [dnl Headers included in libclocale/libclocale_locale.c AC_CHECK_HEADERS([langinfo.h locale.h]) dnl Check for environment functions in libclocale/libclocale_locale.c AC_CHECK_FUNCS([getenv]) AS_IF( [test "x$ac_cv_func_getenv" != xyes], [AC_MSG_FAILURE( [Missing function: getenv], [1]) ]) dnl Check for localization functions in libclocale/libclocale_locale.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_FUNCS([localeconv]) AS_IF( [test "x$ac_cv_func_localeconv" != xyes], [AC_MSG_FAILURE( [Missing function: localeconv], [1]) ]) ]) AC_CHECK_FUNCS([setlocale]) AS_IF( [test "x$ac_cv_func_setlocale" != xyes], [AC_MSG_FAILURE( [Missing function: setlocale], [1]) ]) AX_LIBCLOCALE_CHECK_FUNC_LANGINFO_CODESET ac_cv_libclocale_CPPFLAGS="-I../libclocale"; ac_cv_libclocale_LIBADD="../libclocale/libclocale.la"; ac_cv_libclocale=local ]) dnl Function to detect how to enable libclocale AC_DEFUN([AX_LIBCLOCALE_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libclocale], [libclocale], [search for libclocale 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_LIBCLOCALE_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libclocale" != xyes], [AX_LIBCLOCALE_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCLOCALE], [1], [Define to 1 if the local version of libclocale is used.]) AC_SUBST( [HAVE_LOCAL_LIBCLOCALE], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCLOCALE], [test "x$ac_cv_libclocale" = xlocal]) AS_IF( [test "x$ac_cv_libclocale_CPPFLAGS" != "x"], [AC_SUBST( [LIBCLOCALE_CPPFLAGS], [$ac_cv_libclocale_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libclocale_LIBADD" != "x"], [AC_SUBST( [LIBCLOCALE_LIBADD], [$ac_cv_libclocale_LIBADD]) ]) AS_IF( [test "x$ac_cv_libclocale" = xyes], [AC_SUBST( [ax_libclocale_pc_libs_private], [-lclocale]) ]) AS_IF( [test "x$ac_cv_libclocale" = xyes], [AC_SUBST( [ax_libclocale_spec_requires], [libclocale]) AC_SUBST( [ax_libclocale_spec_build_requires], [libclocale-devel]) ]) ]) libewf-20140807/m4/libfdata.m40000664000175000017500000003614013440550332017664 0ustar00lordyestalordyesta00000000000000dnl Functions for libfdata dnl dnl Version: 20190308 dnl Function to detect if libfdata is available dnl ac_libfdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBFDATA_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdata" = xno], [ac_cv_libfdata=no], [ac_cv_libfdata=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libfdata"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdata}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libfdata], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libfdata], [libfdata >= 20181009], [ac_cv_libfdata=yes], [ac_cv_libfdata=check]) ]) AS_IF( [test "x$ac_cv_libfdata" = xyes], [ac_cv_libfdata_CPPFLAGS="$pkg_cv_libfdata_CFLAGS" ac_cv_libfdata_LIBADD="$pkg_cv_libfdata_LIBS"]) ]) AS_IF( [test "x$ac_cv_libfdata" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libfdata.h]) AS_IF( [test "x$ac_cv_header_libfdata_h" = xno], [ac_cv_libfdata=no], [dnl Check for the individual functions ac_cv_libfdata=yes AC_CHECK_LIB( fdata, libfdata_get_version, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) dnl Area functions AC_CHECK_LIB( fdata, libfdata_area_initialize, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_free, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_clone, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_empty, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_resize, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_get_number_of_segments, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_get_segment_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_set_segment_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_prepend_segment, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_append_segment, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_get_element_data_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_get_element_value_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_set_element_value_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_area_get_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) dnl Balanced tree functions dnl TODO: add functions dnl List functions AC_CHECK_LIB( fdata, libfdata_list_initialize, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_free, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_clone, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_empty, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_resize, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_reverse, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_number_of_elements, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_list_element_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_element_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_set_element_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_prepend_element, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_append_element, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_append_list, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_is_element_set, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_mapped_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_set_mapped_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_mapped_size_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_set_mapped_size_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_element_by_index_with_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_set_element_by_index_with_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_append_element_with_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_element_index_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_list_element_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_element_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_cache_element_value, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_element_value_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_element_value_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_set_element_value_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_set_element_value_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_get_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_get_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_set_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_get_element_value, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_set_element_value, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) dnl List element functions AC_CHECK_LIB( fdata, libfdata_list_element_get_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_set_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_get_element_value, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_list_element_set_element_value, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) dnl Range list functions dnl TODO: add functions dnl Stream functions AC_CHECK_LIB( fdata, libfdata_stream_initialize, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_free, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_clone, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_empty, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_resize, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_reverse, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_number_of_segments, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_segment_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_set_segment_by_index, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_prepend_segment, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_append_segment, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_set_mapped_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_segment_mapped_range, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_segment_index_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_segment_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_read_buffer, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_read_buffer_at_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_write_buffer, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_seek_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_offset, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) AC_CHECK_LIB( fdata, libfdata_stream_get_size, [ac_cv_libfdata_dummy=yes], [ac_cv_libfdata=no]) dnl Tree list functions dnl TODO: add functions dnl Vector list functions dnl TODO: add functions ac_cv_libfdata_LIBADD="-lfdata"]) ]) AS_IF( [test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect && test "x$ac_cv_libfdata" != xyes], [AC_MSG_FAILURE( [unable to find supported libfdata in directory: $ac_cv_with_libfdata], [1]) ]) ]) AS_IF( [test "x$ac_cv_libfdata" = xyes], [AC_DEFINE( [HAVE_LIBFDATA], [1], [Define to 1 if you have the `fdata' library (-lfdata).]) ]) AS_IF( [test "x$ac_cv_libfdata" = xyes], [AC_SUBST( [HAVE_LIBFDATA], [1]) ], [AC_SUBST( [HAVE_LIBFDATA], [0]) ]) ]) dnl Function to detect if libfdata dependencies are available AC_DEFUN([AX_LIBFDATA_CHECK_LOCAL], [dnl No additional checks. ac_cv_libfdata_CPPFLAGS="-I../libfdata"; ac_cv_libfdata_LIBADD="../libfdata/libfdata.la"; ac_cv_libfdata=local ]) dnl Function to detect how to enable libfdata AC_DEFUN([AX_LIBFDATA_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libfdata], [libfdata], [search for libfdata 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_LIBFDATA_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libfdata" != xyes], [AX_LIBFDATA_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBFDATA], [1], [Define to 1 if the local version of libfdata is used.]) AC_SUBST( [HAVE_LOCAL_LIBFDATA], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBFDATA], [test "x$ac_cv_libfdata" = xlocal]) AS_IF( [test "x$ac_cv_libfdata_CPPFLAGS" != "x"], [AC_SUBST( [LIBFDATA_CPPFLAGS], [$ac_cv_libfdata_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libfdata_LIBADD" != "x"], [AC_SUBST( [LIBFDATA_LIBADD], [$ac_cv_libfdata_LIBADD]) ]) AS_IF( [test "x$ac_cv_libfdata" = xyes], [AC_SUBST( [ax_libfdata_pc_libs_private], [-lfdata]) ]) AS_IF( [test "x$ac_cv_libfdata" = xyes], [AC_SUBST( [ax_libfdata_spec_requires], [libfdata]) AC_SUBST( [ax_libfdata_spec_build_requires], [libfdata-devel]) ]) ]) libewf-20140807/m4/libcnotify.m40000664000175000017500000001300613440550332020254 0ustar00lordyestalordyesta00000000000000dnl Checks for libcnotify required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcnotify is available dnl ac_libcnotify_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcnotify" = xno], [ac_cv_libcnotify=no], [ac_cv_libcnotify=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcnotify"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcnotify}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcnotify}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcnotify], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcnotify], [libcnotify >= 20120425], [ac_cv_libcnotify=yes], [ac_cv_libcnotify=check]) ]) AS_IF( [test "x$ac_cv_libcnotify" = xyes], [ac_cv_libcnotify_CPPFLAGS="$pkg_cv_libcnotify_CFLAGS" ac_cv_libcnotify_LIBADD="$pkg_cv_libcnotify_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcnotify" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcnotify.h]) AS_IF( [test "x$ac_cv_header_libcnotify_h" = xno], [ac_cv_libcnotify=no], [dnl Check for the individual functions ac_cv_libcnotify=yes AC_CHECK_LIB( cnotify, libcnotify_get_version, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) dnl Print functions AC_CHECK_LIB( cnotify, libcnotify_printf, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) AC_CHECK_LIB( cnotify, libcnotify_print_data, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) AC_CHECK_LIB( cnotify, libcnotify_print_error_backtrace, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) dnl Stream functions AC_CHECK_LIB( cnotify, libcnotify_stream_set, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) AC_CHECK_LIB( cnotify, libcnotify_stream_open, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) AC_CHECK_LIB( cnotify, libcnotify_stream_close, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) dnl Verbose functions AC_CHECK_LIB( cnotify, libcnotify_verbose_set, [ac_cv_libcnotify_dummy=yes], [ac_cv_libcnotify=no]) ac_cv_libcnotify_LIBADD="-lcnotify"]) ]) AS_IF( [test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_libcnotify" != xyes], [AC_MSG_FAILURE( [unable to find supported libcnotify in directory: $ac_cv_with_libcnotify], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcnotify" = xyes], [AC_DEFINE( [HAVE_LIBCNOTIFY], [1], [Define to 1 if you have the `cnotify' library (-lcnotify).]) ]) AS_IF( [test "x$ac_cv_libcnotify" = xyes], [AC_SUBST( [HAVE_LIBCNOTIFY], [1]) ], [AC_SUBST( [HAVE_LIBCNOTIFY], [0]) ]) ]) dnl Function to detect if libcnotify dependencies are available AC_DEFUN([AX_LIBCNOTIFY_CHECK_LOCAL], [dnl Headers included in libcnotify/libcnotify_print.c AC_CHECK_HEADERS([stdarg.h varargs.h]) AS_IF( [test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes], [AC_MSG_FAILURE( [Missing headers: stdarg.h and varargs.h], [1]) ]) dnl Headers included in libcnotify/libcnotify_stream.c AC_CHECK_HEADERS([errno.h]) ac_cv_libcnotify_CPPFLAGS="-I../libcnotify"; ac_cv_libcnotify_LIBADD="../libcnotify/libcnotify.la"; ac_cv_libcnotify=local ]) dnl Function to detect how to enable libcnotify AC_DEFUN([AX_LIBCNOTIFY_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcnotify], [libcnotify], [search for libcnotify 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_LIBCNOTIFY_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcnotify" != xyes], [AX_LIBCNOTIFY_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCNOTIFY], [1], [Define to 1 if the local version of libcnotify is used.]) AC_SUBST( [HAVE_LOCAL_LIBCNOTIFY], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCNOTIFY], [test "x$ac_cv_libcnotify" = xlocal]) AS_IF( [test "x$ac_cv_libcnotify_CPPFLAGS" != "x"], [AC_SUBST( [LIBCNOTIFY_CPPFLAGS], [$ac_cv_libcnotify_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcnotify_LIBADD" != "x"], [AC_SUBST( [LIBCNOTIFY_LIBADD], [$ac_cv_libcnotify_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcnotify" = xyes], [AC_SUBST( [ax_libcnotify_pc_libs_private], [-lcnotify]) ]) AS_IF( [test "x$ac_cv_libcnotify" = xyes], [AC_SUBST( [ax_libcnotify_spec_requires], [libcnotify]) AC_SUBST( [ax_libcnotify_spec_build_requires], [libcnotify-devel]) ]) ]) libewf-20140807/m4/ltversion.m40000644000175000017500000000127313443455336020153 0ustar00lordyestalordyesta00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libewf-20140807/m4/libcdata.m40000664000175000017500000004042213440550332017657 0ustar00lordyestalordyesta00000000000000dnl Checks for libcdata required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcdata is available dnl ac_libcdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCDATA_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdata" = xno], [ac_cv_libcdata=no], [ac_cv_libcdata=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcdata"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdata}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcdata], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcdata], [libcdata >= 20190112], [ac_cv_libcdata=yes], [ac_cv_libcdata=check]) ]) AS_IF( [test "x$ac_cv_libcdata" = xyes], [ac_cv_libcdata_CPPFLAGS="$pkg_cv_libcdata_CFLAGS" ac_cv_libcdata_LIBADD="$pkg_cv_libcdata_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcdata" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcdata.h]) AS_IF( [test "x$ac_cv_header_libcdata_h" = xno], [ac_cv_libcdata=no], [dnl Check for the individual functions ac_cv_libcdata=yes AC_CHECK_LIB( cdata, libcdata_get_version, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) dnl Array functions AC_CHECK_LIB( cdata, libcdata_array_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_free, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_empty, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_clone, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_resize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_reverse, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_get_number_of_entries, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_get_entry_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_get_entry_by_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_set_entry_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_prepend_entry, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_append_entry, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_insert_entry, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_array_remove_entry, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) dnl Balanced tree functions AC_CHECK_LIB( cdata, libfdata_btree_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_free, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_get_number_of_values, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_get_value_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_get_value_by_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_insert_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_replace_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_btree_remove_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) dnl List functions AC_CHECK_LIB( cdata, libcdata_list_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_free, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_empty, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_clone, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_get_number_of_elements, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_get_first_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_get_last_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_get_element_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_get_value_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_prepend_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_prepend_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_append_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_append_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_insert_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_insert_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_remove_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) dnl List element functions AC_CHECK_LIB( cdata, libcdata_list_element_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_free, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_get_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_set_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_get_previous_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_set_previous_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_get_next_element, [ac_cv_libcdata_dummy=yes], AC_CHECK_LIB( cdata, libcdata_list_element_set_next_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_get_elements, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_list_element_set_elements, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) [ac_cv_libcdata=no]) dnl Range list functions AC_CHECK_LIB( cdata, libcdata_range_list_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_free, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_empty, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_clone, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_get_number_of_elements, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_insert_range, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_insert_range_list, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_remove_range, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_get_range_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_get_range_at_offset, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_range_is_present, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_range_list_get_spanning_range, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) dnl Tree node functions AC_CHECK_LIB( cdata, libcdata_tree_node_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_free, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_empty, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_clone, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_set_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_parent_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_set_parent_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_previous_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_set_previous_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_next_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_set_next_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_nodes, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_set_nodes, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_append_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_append_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_insert_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_insert_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_replace_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_remove_node, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_number_of_sub_nodes, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_sub_node_by_index, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, libcdata_tree_node_get_leaf_node_list, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) ac_cv_libcdata_LIBADD="-lcdata"]) ]) AS_IF( [test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_libcdata" != xyes], [AC_MSG_FAILURE( [unable to find supported libcdata in directory: $ac_cv_with_libcdata], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcdata" = xyes], [AC_DEFINE( [HAVE_LIBCDATA], [1], [Define to 1 if you have the `cdata' library (-lcdata).]) ]) AS_IF( [test "x$ac_cv_libcdata" = xyes], [AC_SUBST( [HAVE_LIBCDATA], [1]) ], [AC_SUBST( [HAVE_LIBCDATA], [0]) ]) ]) dnl Function to detect if libcdata dependencies are available AC_DEFUN([AX_LIBCDATA_CHECK_LOCAL], [dnl No additional checks. ac_cv_libcdata_CPPFLAGS="-I../libcdata"; ac_cv_libcdata_LIBADD="../libcdata/libcdata.la"; ac_cv_libcdata=local ]) dnl Function to detect how to enable libcdata AC_DEFUN([AX_LIBCDATA_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcdata], [libcdata], [search for libcdata 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_LIBCDATA_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcdata" != xyes], [AX_LIBCDATA_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCDATA], [1], [Define to 1 if the local version of libcdata is used.]) AC_SUBST( [HAVE_LOCAL_LIBCDATA], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCDATA], [test "x$ac_cv_libcdata" = xlocal]) AS_IF( [test "x$ac_cv_libcdata_CPPFLAGS" != "x"], [AC_SUBST( [LIBCDATA_CPPFLAGS], [$ac_cv_libcdata_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcdata_LIBADD" != "x"], [AC_SUBST( [LIBCDATA_LIBADD], [$ac_cv_libcdata_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcdata" = xyes], [AC_SUBST( [ax_libcdata_pc_libs_private], [-lcdata]) ]) AS_IF( [test "x$ac_cv_libcdata" = xyes], [AC_SUBST( [ax_libcdata_spec_requires], [libcdata]) AC_SUBST( [ax_libcdata_spec_build_requires], [libcdata-devel]) ]) ]) libewf-20140807/m4/libcdatetime.m40000664000175000017500000003076713440550332020555 0ustar00lordyestalordyesta00000000000000dnl Checks for libcdatetime required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcdatetime is available dnl ac_libcdatetime_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCDATETIME_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdatetime" = xno], [ac_cv_libcdatetime=no], [ac_cv_libcdatetime=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcdatetime" != x && test "x$ac_cv_with_libcdatetime" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcdatetime"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcdatetime}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdatetime}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcdatetime], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcdatetime], [libcdatetime >= 20141018], [ac_cv_libcdatetime=yes], [ac_cv_libcdatetime=check]) ]) AS_IF( [test "x$ac_cv_libcdatetime" = xyes], [ac_cv_libcdatetime_CPPFLAGS="$pkg_cv_libcdatetime_CFLAGS" ac_cv_libcdatetime_LIBADD="$pkg_cv_libcdatetime_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcdatetime" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcdatetime.h]) AS_IF( [test "x$ac_cv_header_libcdatetime_h" = xno], [ac_cv_libcdatetime=no], [dnl Check for the individual functions ac_cv_libcdatetime=yes AC_CHECK_LIB( cdatetime, libcdatetime_get_version, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) dnl Time elements functions AC_CHECK_LIB( cdatetime, libcdatetime_elements_initialize, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_free, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_copy, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_year, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_day_of_year, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_month, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_day_of_month, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_date_values, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_hours, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_minutes, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_milli_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_micro_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_nano_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_time_values, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_set_current_time_utc, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_set_current_time_localtime, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_delta_in_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_set_from_delta_in_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_get_string_size, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_copy_to_string, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_elements_copy_to_string_with_index, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) dnl Timestamp functions AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_initialize, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_free, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_copy, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_set_current_time, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_get_delta_in_seconds, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_get_string_size, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_copy_to_string, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) AC_CHECK_LIB( cdatetime, libcdatetime_timestamp_copy_to_string_with_index, [ac_cv_libcdatetime_dummy=yes], [ac_cv_libcdatetime=no]) ac_cv_libcdatetime_LIBADD="-lcdatetime"]) ]) AS_IF( [test "x$ac_cv_with_libcdatetime" != x && test "x$ac_cv_with_libcdatetime" != xauto-detect && test "x$ac_cv_libcdatetime" != xyes], [AC_MSG_FAILURE( [unable to find supported libcdatetime in directory: $ac_cv_with_libcdatetime], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcdatetime" = xyes], [AC_DEFINE( [HAVE_LIBCDATETIME], [1], [Define to 1 if you have the `cdatetime' library (-lcdatetime).]) ]) AS_IF( [test "x$ac_cv_libcdatetime" = xyes], [AC_SUBST( [HAVE_LIBCDATETIME], [1]) ], [AC_SUBST( [HAVE_LIBCDATETIME], [0]) ]) ]) dnl Function to detect if ctime_r or ctime is available dnl Also checks how to use ctime_r AC_DEFUN([AX_LIBCDATETIME_CHECK_FUNC_CTIME], [AC_CHECK_FUNCS([ctime_r]) AS_IF( [test "x$ac_cv_func_ctime_r" = xyes], [AC_MSG_CHECKING( [how to use ctime_r]) AC_LANG_PUSH(C) AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[ctime_r( NULL, NULL, 0 )]] )], [AC_MSG_RESULT( [with additional size argument]) ac_cv_cv_ctime_r_size=yes], [ac_cv_cv_ctime_r_size=no]) AS_IF( [test "x$ac_cv_cv_ctime_r_size" = xno], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[ctime_r( NULL, NULL )]] )], [AC_MSG_RESULT( [with two arguments]) ac_cv_cv_ctime_r_posix=yes], [ac_cv_cv_ctime_r_posix=no]) ]) AS_IF( [test "x$ac_cv_cv_ctime_r_posix" = xno], [CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[ctime_r( NULL, NULL )]] )], [AC_MSG_RESULT( [with two arguments and definition _POSIX_PTHREAD_SEMANTICS]) ac_cv_cv_ctime_r_posix=yes], [ac_cv_cv_ctime_r_posix=no]) ]) AC_LANG_POP(C) AS_IF( [test "x$ac_cv_cv_ctime_r_size" = xno && test "x$ac_cv_cv_ctime_r_posix" = xno], [AC_MSG_WARN( [unknown]) ac_cv_func_ctime_r=no]) AS_IF( [test "x$ac_cv_func_ctime_r" = xyes], [AC_DEFINE( [HAVE_CTIME_R], [1], [Define to 1 if you have the ctime_r function.]) ]) AS_IF( [test "x$ac_cv_cv_ctime_r_size" = xyes], [AC_DEFINE( [HAVE_CTIME_R_SIZE], [1], [Define to 1 if you have the ctime_r function with a third size argument.]) ]) ]) AS_IF( [test "x$ac_cv_func_ctime_r" = xno], [AC_CHECK_FUNCS([ctime]) AS_IF( [test "x$ac_cv_func_ctime" = xno], [AC_MSG_FAILURE( [Missing function: ctime_r and ctime], [1]) ]) ]) ]) dnl Function to detect if libcdatetime dependencies are available AC_DEFUN([AX_LIBCDATETIME_CHECK_LOCAL], [dnl Headers included in libcdatetime/libcdatetime_elements.c dnl and libcdatetime/libcdatetime_timestamp.c AC_CHECK_HEADERS([errno.h]) AC_HEADER_TIME dnl Types used in libcdatetime/libcdatetime_elements.c AC_STRUCT_TM dnl Date and time functions used in libcdatetime/libcdatetime_elements.c AC_CHECK_FUNCS([mktime]) AS_IF( [test "x$ac_cv_func_mktime" != xyes], [AC_MSG_FAILURE( [Missing function: mktime], [1]) ]) dnl Date and time functions used in libcdatetime/libcdatetime_elements.c AX_LIBCDATETIME_CHECK_FUNC_CTIME AC_CHECK_FUNCS([gmtime gmtime_r localtime localtime_r mktime time]) AS_IF( [test "x$ac_cv_func_gmtime" != xyes && test "x$ac_cv_func_gmtime_r" != xyes], [AC_MSG_FAILURE( [Missing functions: gmtime_r and gmtime], [1]) ]) AS_IF( [test "x$ac_cv_func_localtime" != xyes && test "x$ac_cv_func_localtime_r" != xyes], [AC_MSG_FAILURE( [Missing functions: localtime_r and localtime], [1]) ]) AS_IF( [test "x$ac_cv_func_mktime" != xyes], [AC_MSG_FAILURE( [Missing function: mktime], [1]) ]) AS_IF( [test "x$ac_cv_func_time" != xyes], [AC_MSG_FAILURE( [Missing function: time], [1]) ]) ac_cv_libcdatetime_CPPFLAGS="-I../libcdatetime"; ac_cv_libcdatetime_LIBADD="../libcdatetime/libcdatetime.la"; ac_cv_libcdatetime=local ]) dnl Function to detect how to enable libcdatetime AC_DEFUN([AX_LIBCDATETIME_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcdatetime], [libcdatetime], [search for libcdatetime 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_LIBCDATETIME_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcdatetime" != xyes], [AX_LIBCDATETIME_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCDATETIME], [1], [Define to 1 if the local version of libcdatetime is used.]) AC_SUBST( [HAVE_LOCAL_LIBCDATETIME], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCDATETIME], [test "x$ac_cv_libcdatetime" = xlocal]) AS_IF( [test "x$ac_cv_libcdatetime_CPPFLAGS" != "x"], [AC_SUBST( [LIBCDATETIME_CPPFLAGS], [$ac_cv_libcdatetime_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcdatetime_LIBADD" != "x"], [AC_SUBST( [LIBCDATETIME_LIBADD], [$ac_cv_libcdatetime_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcdatetime" = xyes], [AC_SUBST( [ax_libcdatetime_pc_libs_private], [-lcdatetime]) ]) AS_IF( [test "x$ac_cv_libcdatetime" = xyes], [AC_SUBST( [ax_libcdatetime_spec_requires], [libcdatetime]) AC_SUBST( [ax_libcdatetime_spec_build_requires], [libcdatetime-devel]) ]) ]) libewf-20140807/m4/progtest.m40000644000175000017500000000557312076507232017776 0ustar00lordyestalordyesta00000000000000# progtest.m4 serial 6 (gettext-0.18) dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) libewf-20140807/m4/lt~obsolete.m40000644000175000017500000001377413443455336020511 0ustar00lordyestalordyesta00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libewf-20140807/m4/libsmdev.m40000664000175000017500000002605513440550332017727 0ustar00lordyestalordyesta00000000000000dnl Checks for libsmdev required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libsmdev is available dnl ac_libsmdev_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBSMDEV_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libsmdev" = xno], [ac_cv_libsmdev=no], [ac_cv_libsmdev=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libsmdev" != x && test "x$ac_cv_with_libsmdev" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libsmdev"], [CFLAGS="$CFLAGS -I${ac_cv_with_libsmdev}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libsmdev}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libsmdev], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libsmdev], [libsmdev >= 20140406], [ac_cv_libsmdev=yes], [ac_cv_libsmdev=check]) ]) AS_IF( [test "x$ac_cv_libsmdev" = xyes], [ac_cv_libsmdev_CPPFLAGS="$pkg_cv_libsmdev_CFLAGS" ac_cv_libsmdev_LIBADD="$pkg_cv_libsmdev_LIBS"]) ]) AS_IF( [test "x$ac_cv_libsmdev" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libsmdev.h]) AS_IF( [test "x$ac_cv_header_libsmdev_h" = xno], [ac_cv_libsmdev=no], [dnl Check for the individual functions ac_cv_libsmdev=yes AC_CHECK_LIB( smdev, libsmdev_get_version, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_check_device, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( smdev, libsmdev_check_device_wide, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) ]) dnl Handle functions AC_CHECK_LIB( smdev, libsmdev_handle_initialize, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_free, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_signal_abort, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_open, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_close, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_read_buffer, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_seek_offset, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( smdev, libsmdev_handle_open_wide, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) ]) AC_CHECK_LIB( smdev, libsmdev_handle_get_bus_type, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_bytes_per_sector, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_error, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_utf8_information_value, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_utf16_information_value, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_media_size, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_media_type, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_number_of_errors, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_number_of_sessions, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_session, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_number_of_tracks, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_get_track, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_set_error_flags, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_set_error_granularity, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) AC_CHECK_LIB( smdev, libsmdev_handle_set_number_of_error_retries, [ac_cv_libsmdev_dummy=yes], [ac_cv_libsmdev=no]) ac_cv_libsmdev_LIBADD="-lsmdev"]) ]) AS_IF( [test "x$ac_cv_with_libsmdev" != x && test "x$ac_cv_with_libsmdev" != xauto-detect && test "x$ac_cv_libsmdev" != xyes], [AC_MSG_FAILURE( [unable to find supported libsmdev in directory: $ac_cv_with_libsmdev], [1]) ]) ]) AS_IF( [test "x$ac_cv_libsmdev" = xyes], [AC_DEFINE( [HAVE_LIBSMDEV], [1], [Define to 1 if you have the `smdev' library (-lsmdev).]) ]) AS_IF( [test "x$ac_cv_libsmdev" = xyes], [AC_SUBST( [HAVE_LIBSMDEV], [1]) ], [AC_SUBST( [HAVE_LIBSMDEV], [0]) ]) ]) dnl Check if winioctl.h defines STORAGE_BUS_TYPE AC_DEFUN([AX_LIBSMDEV_CHECK_HEADER_WINIOCTL_H_STORAGE_BUS_TYPE], [AC_CACHE_CHECK( [whether winioctl.h defines STORAGE_BUS_TYPE], [ac_cv_header_winioctl_h_storage_bus_type], [AC_LANG_PUSH(C) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[STORAGE_BUS_TYPE storage_bus_type; storage_bus_type = BusTypeUnknown;]] )], [ac_cv_header_winioctl_h_storage_bus_type=yes], [ac_cv_header_winioctl_h_storage_bus_type=no]) AC_LANG_POP(C)], [ac_cv_header_winioctl_h_storage_bus_type=no]) AS_IF( [test "x$ac_cv_header_winioctl_h_storage_bus_type" = xyes], [AC_DEFINE( [HAVE_WINIOCTL_H_STORAGE_BUS_TYPE], [1], [Define to 1 if STORAGE_BUS_TYPE is defined.]) ]) ]) dnl Function to detect if libsmdev dependencies are available AC_DEFUN([AX_LIBSMDEV_CHECK_LOCAL], [dnl Headers included in libsmdev/libsmdev_handle.c and libsmdev/libsmdev_support.c AC_CHECK_HEADERS([errno.h fcntl.h sys/stat.h unistd.h]) dnl Headers included in libsmdev/libsmdev_metadata.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([cygwin/fs.h linux/fs.h sys/disk.h sys/disklabel.h]) ]) dnl Headers included in libsmdev/libsmdev_ata.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([cygwin/hdreg.h linux/hdreg.h]) ]) dnl Headers included in libsmdev/libsmdev_scsi.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([scsi/scsi.h scsi/scsi_ioctl.h scsi/sg.h]) ]) dnl Headers included in libsmdev/libsmdev_optical_disk.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([linux/cdrom.h]) ]) dnl Headers included in libsmdev/libsmdev_usb.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([linux/usbdevice_fs.h linux/usb/ch9.h sys/ioctl.h]) ]) dnl File input/output functions used in libbfio/libbfio_file.h AC_CHECK_FUNCS([close fstat ftruncate lseek open read stat write]) AS_IF( [test "x$ac_cv_func_close" != xyes], [AC_MSG_FAILURE( [Missing function: close], [1]) ]) AS_IF( [test "x$ac_cv_func_fstat" != xyes], [AC_MSG_FAILURE( [Missing function: fstat], [1]) ]) AS_IF( [test "x$ac_cv_func_ftruncate" != xyes], [AC_MSG_FAILURE( [Missing function: ftruncate], [1]) ]) AS_IF( [test "x$ac_cv_func_lseek" != xyes], [AC_MSG_FAILURE( [Missing function: lseek], [1]) ]) AS_IF( [test "x$ac_cv_func_open" != xyes], [AC_MSG_FAILURE( [Missing function: open], [1]) ]) AS_IF( [test "x$ac_cv_func_read" != xyes], [AC_MSG_FAILURE( [Missing function: read], [1]) ]) AS_IF( [test "x$ac_cv_func_stat" != xyes], [AC_MSG_FAILURE( [Missing function: stat], [1]) ]) AS_IF( [test "x$ac_cv_func_write" != xyes], [AC_MSG_FAILURE( [Missing function: write], [1]) ]) dnl Check for error string functions used in libsmdev/libsmdev_error_string.c AC_FUNC_STRERROR_R() AS_IF( [test "x$ac_cv_have_decl_strerror_r" = xno], [AC_CHECK_FUNCS([strerror]) AS_IF( [test "x$ac_cv_func_strerror" != xyes], [AC_MSG_FAILURE( [Missing functions: strerror and strerror_r], [1]) ]) ]) dnl Check if winioctl.h defines STORAGE_BUS_TYPE AS_IF( [test "x$ac_cv_enable_winapi" = xyes], [AX_LIBSMDEV_CHECK_HEADER_WINIOCTL_H_STORAGE_BUS_TYPE]) ac_cv_libsmdev_CPPFLAGS="-I../libsmdev"; ac_cv_libsmdev_LIBADD="../libsmdev/libsmdev.la"; ac_cv_libsmdev=local ]) dnl Function to detect how to enable libsmdev AC_DEFUN([AX_LIBSMDEV_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libsmdev], [libsmdev], [search for libsmdev in includedir and libdir or in the specified DIR, or no if to use local version], [auto-detect], [DIR]) AX_LIBSMDEV_CHECK_LIB AS_IF( [test "x$ac_cv_libsmdev" != xyes], [AX_LIBSMDEV_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBSMDEV], [1], [Define to 1 if the local version of libsmdev is used.]) AC_SUBST( [HAVE_LOCAL_LIBSMDEV], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBSMDEV], [test "x$ac_cv_libsmdev" = xlocal]) AS_IF( [test "x$ac_cv_libsmdev_CPPFLAGS" != "x"], [AC_SUBST( [LIBSMDEV_CPPFLAGS], [$ac_cv_libsmdev_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libsmdev_LIBADD" != "x"], [AC_SUBST( [LIBSMDEV_LIBADD], [$ac_cv_libsmdev_LIBADD]) ]) AS_IF( [test "x$ac_cv_libsmdev" = xyes], [AC_SUBST( [ax_libsmdev_pc_libs_private], [-lsmdev]) ]) AS_IF( [test "x$ac_cv_libsmdev" = xyes], [AC_SUBST( [ax_libsmdev_spec_requires], [libsmdev]) AC_SUBST( [ax_libsmdev_spec_build_requires], [libsmdev-devel]) ]) ]) libewf-20140807/m4/libcfile.m40000664000175000017500000002635213440550332017673 0ustar00lordyestalordyesta00000000000000dnl Checks for libcfile required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcfile is available dnl ac_libcfile_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCFILE_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcfile" = xno], [ac_cv_libcfile=no], [ac_cv_libcfile=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcfile"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcfile}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcfile}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcfile], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcfile], [libcfile >= 20160409], [ac_cv_libcfile=yes], [ac_cv_libcfile=check]) ]) AS_IF( [test "x$ac_cv_libcfile" = xyes && test "x$ac_cv_enable_wide_character_type" != xno], [AC_CACHE_CHECK( [whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1], [ac_cv_header_libcfile_features_h_have_wide_character_type], [AC_LANG_PUSH(C) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if !defined( LIBCFILE_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCFILE_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCFILE_HAVE_WIDE_CHARACTER_TYPE not defined #endif]] )], [ac_cv_header_libcfile_features_h_have_wide_character_type=yes], [ac_cv_header_libcfile_features_h_have_wide_character_type=no]) AC_LANG_POP(C)], [ac_cv_header_libcfile_features_h_have_wide_character_type=no]) AS_IF( [test "x$ac_cv_header_libcfile_features_h_have_wide_character_type" = xno], [ac_cv_libcfile=no]) ]) AS_IF( [test "x$ac_cv_libcfile" = xyes], [ac_cv_libcfile_CPPFLAGS="$pkg_cv_libcfile_CFLAGS" ac_cv_libcfile_LIBADD="$pkg_cv_libcfile_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcfile" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcfile.h]) AS_IF( [test "x$ac_cv_header_libcfile_h" = xno], [ac_cv_libcfile=no], [dnl Check for the individual functions ac_cv_libcfile=yes AC_CHECK_LIB( cfile, libcfile_get_version, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) dnl File functions AC_CHECK_LIB( cfile, libcfile_file_initialize, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_free, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_open, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_open_with_error_code, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_close, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_read_buffer, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_read_buffer_with_error_code, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_write_buffer, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_write_buffer_with_error_code, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_seek_offset, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_resize, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_is_open, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_get_offset, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_get_size, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_is_device, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_io_control_read, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_io_control_read_with_error_code, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( cfile, libcfile_file_open_wide, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_open_wide_with_error_code, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) ]) dnl Support functions AC_CHECK_LIB( cfile, libcfile_file_exists, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_remove, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( cfile, libcfile_file_exists_wide, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) AC_CHECK_LIB( cfile, libcfile_file_remove_wide, [ac_cv_libcfile_dummy=yes], [ac_cv_libcfile=no]) ]) ac_cv_libcfile_LIBADD="-lcfile"]) ]) AS_IF( [test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_libcfile" != xyes], [AC_MSG_FAILURE( [unable to find supported libcfile in directory: $ac_cv_with_libcfile], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcfile" = xyes], [AC_DEFINE( [HAVE_LIBCFILE], [1], [Define to 1 if you have the `cfile' library (-lcfile).]) ]) AS_IF( [test "x$ac_cv_libcfile" = xyes], [AC_SUBST( [HAVE_LIBCFILE], [1]) ], [AC_SUBST( [HAVE_LIBCFILE], [0]) ]) ]) dnl Function to detect if posix_fadvise is available AC_DEFUN([AX_LIBCFILE_CHECK_FUNC_POSIX_FADVISE], [AC_CHECK_FUNCS([posix_fadvise]) AS_IF( [test "x$ac_cv_func_posix_fadvise" = xyes], [AC_MSG_CHECKING( [whether posix_fadvise can be linked]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_LANG_PUSH(C) AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if !defined( POSIX_FADV_SEQUENTIAL ) #define POSIX_FADV_SEQUENTIAL 2 #endif posix_fadvise( 0, 0, 0, POSIX_FADV_SEQUENTIAL )]] )], [ac_cv_func_posix_fadvise=yes], [ac_cv_func_posix_fadvise=no]) AC_LANG_POP(C) CFLAGS="$SAVE_CFLAGS" AS_IF( [test "x$ac_cv_func_posix_fadvise" = xyes], [AC_MSG_RESULT( [yes]) AC_DEFINE( [HAVE_POSIX_FADVISE], [1], [Define to 1 if you have the posix_fadvise function.]) ], [AC_MSG_RESULT( [no]) ]) ]) ]) dnl Function to detect if libcfile dependencies are available AC_DEFUN([AX_LIBCFILE_CHECK_LOCAL], [dnl Headers included in libcfile/libcfile_file.c and libcfile/libcfile_support.c AC_CHECK_HEADERS([errno.h stdio.h sys/stat.h]) dnl Headers included in libcfile/libcfile_file.c AC_CHECK_HEADERS([cygwin/fs.h fcntl.h linux/fs.h sys/disk.h sys/disklabel.h sys/ioctl.h unistd.h]) dnl File input/output functions used in libcfile/libcfile_file.c AC_CHECK_FUNCS([close fstat ftruncate ioctl lseek open read write]) AS_IF( [test "x$ac_cv_func_close" != xyes], [AC_MSG_FAILURE( [Missing function: close], [1]) ]) AX_LIBCFILE_CHECK_FUNC_POSIX_FADVISE AS_IF( [test "x$ac_cv_func_fstat" != xyes], [AC_MSG_FAILURE( [Missing function: fstat], [1]) ]) AS_IF( [test "x$ac_cv_func_ftruncate" != xyes], [AC_MSG_FAILURE( [Missing function: ftruncate], [1]) ]) AS_IF( [test x"$ac_cv_enable_winapi" = xno], [AS_IF( [test "x$ac_cv_func_ioctl" != xyes], [AC_MSG_FAILURE( [Missing function: ioctl], [1]) ]) ]) AS_IF( [test "x$ac_cv_func_lseek" != xyes], [AC_MSG_FAILURE( [Missing function: lseek], [1]) ]) AS_IF( [test "x$ac_cv_func_open" != xyes], [AC_MSG_FAILURE( [Missing function: open], [1]) ]) AS_IF( [test "x$ac_cv_func_read" != xyes], [AC_MSG_FAILURE( [Missing function: read], [1]) ]) AS_IF( [test "x$ac_cv_func_write" != xyes], [AC_MSG_FAILURE( [Missing function: write], [1]) ]) dnl File input/output functions used in libcfile/libcfile_support.c AC_CHECK_FUNCS([stat unlink]) AS_IF( [test "x$ac_cv_func_stat" != xyes], [AC_MSG_FAILURE( [Missing function: stat], [1]) ]) AS_IF( [test "x$ac_cv_func_unlink" != xyes], [AC_MSG_FAILURE( [Missing function: unlink], [1]) ]) ac_cv_libcfile_CPPFLAGS="-I../libcfile"; ac_cv_libcfile_LIBADD="../libcfile/libcfile.la"; ac_cv_libcfile=local ]) dnl Function to detect how to enable libcfile AC_DEFUN([AX_LIBCFILE_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcfile], [libcfile], [search for libcfile 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_LIBCFILE_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcfile" != xyes], [AX_LIBCFILE_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCFILE], [1], [Define to 1 if the local version of libcfile is used.]) AC_SUBST( [HAVE_LOCAL_LIBCFILE], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCFILE], [test "x$ac_cv_libcfile" = xlocal]) AS_IF( [test "x$ac_cv_libcfile_CPPFLAGS" != "x"], [AC_SUBST( [LIBCFILE_CPPFLAGS], [$ac_cv_libcfile_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcfile_LIBADD" != "x"], [AC_SUBST( [LIBCFILE_LIBADD], [$ac_cv_libcfile_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcfile" = xyes], [AC_SUBST( [ax_libcfile_pc_libs_private], [-lcfile]) ]) AS_IF( [test "x$ac_cv_libcfile" = xyes], [AC_SUBST( [ax_libcfile_spec_requires], [libcfile]) AC_SUBST( [ax_libcfile_spec_build_requires], [libcfile-devel]) ]) ]) libewf-20140807/m4/libmfdata.m40000644000175000017500000002231012076507232020036 0ustar00lordyestalordyesta00000000000000dnl Functions for libmfdata dnl dnl Version: 20120519 dnl Function to detect if libmfdata available dnl ac_libmfdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBMFDATA_CHECK_LIB], [dnl Check if parameters were provided AS_IF( [test "x$ac_cv_with_libmfdata" != x && test "x$ac_cv_with_libmfdata" != xno && test "x$ac_cv_with_libmfdata" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libmfdata"], [CFLAGS="$CFLAGS -I${ac_cv_with_libmfdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libmfdata}/lib"], [AC_MSG_WARN([no such directory: $ac_cv_with_libmfdata]) ]) ]) AS_IF( [test "x$ac_cv_with_libmfdata" = xno], [ac_cv_libmfdata=no], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libmfdata], [libmfdata >= 20120425], [ac_cv_libmfdata=yes], [ac_cv_libmfdata=no]) ]) AS_IF( [test "x$ac_cv_libmfdata" = xyes], [ac_cv_libmfdata_CPPFLAGS="$pkg_cv_libmfdata_CFLAGS" ac_cv_libmfdata_LIBADD="$pkg_cv_libmfdata_LIBS"], [dnl Check for headers AC_CHECK_HEADERS([libmfdata.h]) AS_IF( [test "x$ac_cv_header_libmfdata_h" = xno], [ac_cv_libmfdata=no], [ac_cv_libmfdata=yes AC_CHECK_LIB( mfdata, libmfdata_get_version, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) dnl Cache functions AC_CHECK_LIB( mfdata, libmfdata_cache_initialize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_cache_free, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_cache_clone, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) dnl File functions AC_CHECK_LIB( mfdata, libmfdata_file_set_file_value, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) dnl File list functions AC_CHECK_LIB( mfdata, libmfdata_file_list_initialize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_free, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_resize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_clone, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_get_number_of_files, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_get_file_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_get_file_value_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_set_file_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_set_file_value_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_file_list_append_file, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) dnl File functions AC_CHECK_LIB( mfdata, libmfdata_list_initialize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_free, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_resize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_clone, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_is_group, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_is_set, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_get_number_of_elements, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_get_data_range_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_get_element_value_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_get_group_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_set_data_range_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_set_backup_data_range_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_set_element_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_set_element_value_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_set_group_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_append_group, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) dnl List element functions AC_CHECK_LIB( mfdata, libmfdata_list_element_get_element_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_list_element_set_element_value, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) dnl Segment table functions AC_CHECK_LIB( mfdata, libmfdata_segment_table_initialize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_free, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_empty, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_resize, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_read_buffer, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_seek_offset, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_write_buffer, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_get_file_io_handle, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_get_maximum_segment_size, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_get_number_of_segments, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_get_value_offset, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_get_value_size, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_set_maximum_segment_size, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) AC_CHECK_LIB( mfdata, libmfdata_segment_table_set_segment_by_index, [ac_cv_libmfdata_dummy=yes], [ac_cv_libmfdata=no]) ac_cv_libmfdata_LIBADD="-lmfdata" ]) ]) ]) AS_IF( [test "x$ac_cv_libmfdata" = xyes], [AC_DEFINE( [HAVE_LIBMFDATA], [1], [Define to 1 if you have the `mfdata' library (-lmfdata).]) ]) AS_IF( [test "x$ac_cv_libmfdata" = xyes], [AC_SUBST( [HAVE_LIBMFDATA], [1]) ], [AC_SUBST( [HAVE_LIBMFDATA], [0]) ]) ]) dnl Function to detect how to enable libmfdata AC_DEFUN([AX_LIBMFDATA_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libmfdata], [libmfdata], [search for libmfdata 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_LIBMFDATA_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libmfdata" != xyes], [AC_DEFINE( [HAVE_LOCAL_LIBMFDATA], [1], [Define to 1 if the local version of libmfdata is used.]) AC_SUBST( [HAVE_LOCAL_LIBMFDATA], [1]) ac_cv_libmfdata_CPPFLAGS="-I../libmfdata"; ac_cv_libmfdata_LIBADD="../libmfdata/libmfdata.la"; ac_cv_libmfdata=local ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBMFDATA], [test "x$ac_cv_libmfdata" = xlocal]) AS_IF( [test "x$ac_cv_libmfdata_CPPFLAGS" != "x"], [AC_SUBST( [LIBMFDATA_CPPFLAGS], [$ac_cv_libmfdata_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libmfdata_LIBADD" != "x"], [AC_SUBST( [LIBMFDATA_LIBADD], [$ac_cv_libmfdata_LIBADD]) ]) AS_IF( [test "x$ac_cv_libmfdata" = xyes], [AC_SUBST( [ax_libmfdata_pc_libs_private], [-lmfdata]) ]) AS_IF( [test "x$ac_cv_libmfdata" = xyes], [AC_SUBST( [ax_libmfdata_spec_requires], [libmfdata]) AC_SUBST( [ax_libmfdata_spec_build_requires], [libmfdata-devel]) ]) ]) libewf-20140807/m4/libcrypto.m40000664000175000017500000005707713440550332020141 0ustar00lordyestalordyesta00000000000000dnl Checks for libcrypto required headers and functions dnl dnl Version: 20190304 dnl Function to detect whether openssl/evp.h can be used in combination with zlib.h AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_ZLIB_COMPATIBILE], [AC_CACHE_CHECK( [if openssl/evp.h can be used in combination with zlib.h], [ac_cv_openssl_evp_zlib_compatible], [AC_LANG_PUSH(C) AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[ ]] )], [ac_cv_openssl_evp_zlib_compatible=yes], [ac_cv_openssl_evp_zlib_compatible=no]) AC_LANG_POP(C)]) ]) dnl Function to detect if libcrypto (openssl) EVP functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP], [AC_CHECK_HEADERS([openssl/evp.h]) AS_IF( [test "x$ac_cv_header_openssl_evp_h" = xno], [ac_cv_libcrypto=no ac_cv_libcrypto_evp=no], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_ZLIB_COMPATIBILE AS_IF( [test "x$ac_cv_openssl_evp_zlib_compatible" = xyes], [ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes], [ac_cv_libcrypto=no ac_cv_libcrypto_evp=no]) ]) ]) dnl Function to detect if libcrypto (openssl) EVP MD functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD], [ac_cv_libcrypto_evp_md=yes AC_CHECK_LIB( crypto, EVP_MD_CTX_new, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_dummy=no]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes], [dnl Check for the new EVP API functions AC_CHECK_LIB( crypto, EVP_MD_CTX_free, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) ], [dnl Check for the old EVP API functions AC_CHECK_LIB( crypto, EVP_MD_CTX_init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) AC_CHECK_LIB( crypto, EVP_MD_CTX_cleanup, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) AC_CHECK_LIB( crypto, ERR_remove_thread_state, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) ]) AC_CHECK_LIB( crypto, EVP_DigestInit_ex, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) AC_CHECK_LIB( crypto, EVP_DigestUpdate, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) AC_CHECK_LIB( crypto, EVP_DigestFinal_ex, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_md=no]) AS_IF( [test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno], [AC_MSG_FAILURE( [Missing OpenSSL EVP MD support], [1]) ]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes], [AC_DEFINE( [HAVE_EVP_MD_CTX_INIT], [1], [Define to 1 if you have the `EVP_MD_CTX_init' function".]) ]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes], [AC_DEFINE( [HAVE_EVP_MD_CTX_CLEANUP], [1], [Define to 1 if you have the `EVP_MD_CTX_cleanup' function".]) ]) ]) dnl Function to detect if openssl EVP MD5 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD5], [AC_CHECK_LIB( crypto, EVP_md5, [ac_cv_libcrypto_md5=libcrypto_evp], [ac_cv_libcrypto_md5=no]) AS_IF( [test "x$ac_cv_libcrypto_md5" = xlibcrypto_evp], [AC_DEFINE( [HAVE_EVP_MD5], [1], [Define to 1 if you have the `EVP_md5' function".]) ]) ]) dnl Function to detect if openssl EVP SHA1 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA1], [AC_CHECK_LIB( crypto, EVP_sha1, [ac_cv_libcrypto_sha1=libcrypto_evp], [ac_cv_libcrypto_sha1=no]) AS_IF( [test "x$ac_cv_libcrypto_sha1" = xlibcrypto_evp], [AC_DEFINE( [HAVE_EVP_SHA1], [1], [Define to 1 if you have the `EVP_sha1' function".]) ]) ]) dnl Function to detect if openssl EVP SHA224 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA224], [AC_CHECK_LIB( crypto, EVP_sha224, [ac_cv_libcrypto_sha224=libcrypto_evp], [ac_cv_libcrypto_sha224=no]) AS_IF( [test "x$ac_cv_libcrypto_sha224" = xlibcrypto_evp], [AC_DEFINE( [HAVE_EVP_SHA224], [1], [Define to 1 if you have the `EVP_sha224' function".]) ]) ]) dnl Function to detect if openssl EVP SHA256 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA256], [AC_CHECK_LIB( crypto, EVP_sha256, [ac_cv_libcrypto_sha256=libcrypto_evp], [ac_cv_libcrypto_sha256=no]) AS_IF( [test "x$ac_cv_libcrypto_sha256" = xlibcrypto_evp], [AC_DEFINE( [HAVE_EVP_SHA256], [1], [Define to 1 if you have the `EVP_sha256' function".]) ]) ]) dnl Function to detect if openssl EVP SHA512 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA512], [AC_CHECK_LIB( crypto, EVP_sha512, [ac_cv_libcrypto_sha512=libcrypto_evp], [ac_cv_libcrypto_sha512=no]) AS_IF( [test "x$ac_cv_libcrypto_sha512" = xlibcrypto_evp], [AC_DEFINE( [HAVE_EVP_SHA512], [1], [Define to 1 if you have the `EVP_sha512' function".]) ]) ]) dnl Function to detect if openssl MD5 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_MD5], [AC_CHECK_HEADERS([openssl/md5.h]) AS_IF( [test "x$ac_cv_header_openssl_md5_h" = xno], [ac_cv_libcrypto_md5=no], [ac_cv_libcrypto_md5=libcrypto AC_CHECK_LIB( crypto, MD5_Init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_md5=no]) AC_CHECK_LIB( crypto, MD5_Update, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_md5=no]) AC_CHECK_LIB( crypto, MD5_Final, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_md5=no]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_md5" = xlibcrypto], [ac_cv_libcrypto=yes]) ]) dnl Function to detect if openssl SHA1 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_SHA1], [AC_CHECK_HEADERS([openssl/sha.h]) AS_IF( [test "x$ac_cv_header_openssl_sha_h" = xno], [ac_cv_libcrypto_sha1=no], [ac_cv_libcrypto_sha1=libcrypto AC_CHECK_LIB( crypto, SHA1_Init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha1=no]) AC_CHECK_LIB( crypto, SHA1_Update, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha1=no]) AC_CHECK_LIB( crypto, SHA1_Final, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha1=no]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha1" = xlibcrypto], [ac_cv_libcrypto=yes]) ]) dnl Function to detect if openssl SHA224 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_SHA224], [AC_CHECK_HEADERS([openssl/sha.h]) AS_IF( [test "x$ac_cv_header_openssl_sha_h" = xno], [ac_cv_libcrypto_sha224=no], [ac_cv_libcrypto_sha224=libcrypto AC_CHECK_LIB( crypto, SHA224_Init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha224=no]) AC_CHECK_LIB( crypto, SHA224_Update, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha224=no]) AC_CHECK_LIB( crypto, SHA224_Final, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha224=no]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha224" = xlibcrypto], [ac_cv_libcrypto=yes]) ]) dnl Function to detect if openssl SHA256 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_SHA256], [AC_CHECK_HEADERS([openssl/sha.h]) AS_IF( [test "x$ac_cv_header_openssl_sha_h" = xno], [ac_cv_libcrypto_sha256=no], [ac_cv_libcrypto_sha256=libcrypto AC_CHECK_LIB( crypto, SHA256_Init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha256=no]) AC_CHECK_LIB( crypto, SHA256_Update, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha256=no]) AC_CHECK_LIB( crypto, SHA256_Final, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha256=no]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha256" = xlibcrypto], [ac_cv_libcrypto=yes]) ]) dnl Function to detect if openssl SHA512 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_SHA512], [AC_CHECK_HEADERS([openssl/sha.h]) AS_IF( [test "x$ac_cv_header_openssl_sha_h" = xno], [ac_cv_libcrypto_sha512=no], [ac_cv_libcrypto_sha512=libcrypto AC_CHECK_LIB( crypto, SHA512_Init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha512=no]) AC_CHECK_LIB( crypto, SHA512_Update, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha512=no]) AC_CHECK_LIB( crypto, SHA512_Final, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_sha512=no]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha512" = xlibcrypto], [ac_cv_libcrypto=yes]) ]) dnl Function to detect if openssl EVP CIPHER functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_CIPHER], [ac_cv_libcrypto_evp_cipher=yes dnl Check if all required libcrypto (openssl) EVP CIPHER functions are available AC_CHECK_LIB( crypto, EVP_CIPHER_CTX_new, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_dummy=no]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes], [dnl Check for the new EVP API functions AC_CHECK_LIB( crypto, EVP_CIPHER_CTX_free, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) ], [dnl Check for the old EVP API functions AC_CHECK_LIB( crypto, EVP_CIPHER_CTX_init, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, EVP_CIPHER_CTX_cleanup, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, ERR_remove_thread_state, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) ]) AC_CHECK_LIB( crypto, EVP_CIPHER_CTX_set_padding, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, EVP_CipherInit_ex, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, EVP_CipherUpdate, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, EVP_CipherFinal_ex, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_evp_cipher=no]) AS_IF( [test "x$ac_cv_enable_openssl_evp_cipher" = xyes && "x$ac_cv_libcrypto_evp_cipher" = xno], [AC_MSG_FAILURE( [Missing OpenSSL EVP CIPHER support], [1]) ]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes], [AC_DEFINE( [HAVE_EVP_CIPHER_CTX_INIT], [1], [Define to 1 if you have the `EVP_CIPHER_CTX_init' function".]) ]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes], [AC_DEFINE( [HAVE_EVP_CIPHER_CTX_CLEANUP], [1], [Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function".]) ]) ]) dnl Function to detect if openssl AES-CBC and AES-ECB functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_AES], [AC_CHECK_HEADERS([openssl/aes.h]) AS_IF( [test "x$ac_cv_header_openssl_aes_h" = xno], [ac_cv_libcrypto_aes_cbc=no ac_cv_libcrypto_aes_ecb=no], [ac_cv_libcrypto_aes_cbc=libcrypto ac_cv_libcrypto_aes_ecb=libcrypto AC_CHECK_LIB( crypto, AES_set_decrypt_key, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_cbc=no, ac_cv_libcrypto_aes_ecb=no]) AC_CHECK_LIB( crypto, AES_set_encrypt_key, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_cbc=no, ac_cv_libcrypto_aes_ecb=no]) AC_CHECK_LIB( crypto, AES_cbc_encrypt, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_cbc=no]) AC_CHECK_LIB( crypto, AES_ecb_encrypt, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_ecb=no]) AS_IF( [test "x$ac_cv_lib_crypto_AES_cbc_encrypt" = xyes], [AC_DEFINE( [HAVE_AES_CBC_ENCRYPT], [1], [Define to 1 if you have the `AES_cbc_encrypt' function".]) ]) AS_IF( [test "x$ac_cv_lib_crypto_AES_ecb_encrypt" = xyes], [AC_DEFINE( [HAVE_AES_ECB_ENCRYPT], [1], [Define to 1 if you have the `AES_ecb_encrypt' function".]) ]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xno], [AS_IF( [test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno], [ac_cv_libcrypto=yes]) ]) dnl ac_cv_libcrypto_aes is deprecated but kept for backwards compatibility AS_IF( [test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno], [ac_cv_libcrypto_aes=no], [ac_cv_libcrypto_aes=libcrypto]) ]) dnl Function to detect if libcrypto (openssl) dependencies are available AC_DEFUN([AX_LIBCRYPTO_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_openssl" = xno], [ac_cv_libcrypto=no], [dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_openssl" != x && test "x$ac_cv_with_openssl" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_openssl"], [CFLAGS="$CFLAGS -I${ac_cv_with_openssl}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_openssl}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_openssl], [1]) ])], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [openssl], [openssl >= 1.0], [ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes], [ac_cv_libcrypto=no ac_cv_libcrypto_evp=no]) ]) AS_IF( [test "x$ac_cv_libcrypto" = xyes], [ac_cv_libcrypto_CPPFLAGS="$pkg_cv_openssl_CFLAGS" ac_cv_libcrypto_LIBADD="$pkg_cv_openssl_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcrypto" != xyes], [dnl Check for headers AC_CHECK_HEADERS([openssl/opensslv.h]) AX_LIBCRYPTO_CHECK_OPENSSL_EVP AS_IF( [test "x$ac_cv_libcrypto_evp" != xyes && test "$ac_cv_header_openssl_opensslv" = xyes], [ac_cv_libcrypto=yes]) ]) dnl Setup libcrypto (openssl) parameters AS_IF( [test "x$ac_cv_libcrypto" = xyes && test "x$ac_cv_libcrypto_evp" = xyes], [AC_DEFINE( [HAVE_OPENSSL_EVP_H], [1], [Define to 1 if you have the header file.]) AC_SUBST( [HAVE_OPENSSL_EVP_H], [1]) ], [AC_SUBST( [HAVE_OPENSSL_EVP_H], [0]) ]) AS_IF( [test "x$ac_cv_libcrypto" != xno], [AC_DEFINE( [HAVE_LIBCRYPTO], [1], [Define to 1 if you have the 'crypto' library (-lcrypto).]) ac_cv_libcrypto_LIBADD="-lcrypto" dnl On Cygwin also link zlib since libcrypto relies on it AS_CASE( [$host], [*cygwin*], [ac_cv_libcrypto_LIBADD="-lcrypto -lz"]) dnl Enforce the dynamic loader library to be included if available AC_CHECK_LIB( dl, dlopen, [AC_SUBST( [LIBDL_LIBADD], ["-ldl"])], []) ]) ]) ]) dnl Function to detect if libcrypto MD5 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_MD5], [ac_cv_libcrypto_md5=no dnl Check for libcrypto (openssl) EVP MD support AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_libcrypto_evp_md" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD]) dnl Check for libcrypto (openssl) EVP MD5 support AS_IF( [test "x$ac_cv_libcrypto_evp_md" = xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD5]) dnl Check for libcrypto (openssl) MD5 support AS_IF( [test "x$ac_cv_libcrypto_md5" = xno], [AX_LIBCRYPTO_CHECK_OPENSSL_MD5]) ]) dnl Function to detect if libcrypto SHA1 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_SHA1], [ac_cv_libcrypto_sha1=no dnl Check for libcrypto (openssl) EVP MD support AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD]) dnl Check for libcrypto (openssl) EVP SHA1 support AS_IF( [test "x$ac_cv_libcrypto_evp_md" = xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA1]) dnl Check for libcrypto (openssl) SHA1 support AS_IF( [test "x$ac_cv_libcrypto_sha1" = xno], [AX_LIBCRYPTO_CHECK_OPENSSL_SHA1]) ]) dnl Function to detect if libcrypto SHA224 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_SHA224], [ac_cv_libcrypto_sha224=no dnl Check for libcrypto (openssl) EVP MD support AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD]) dnl Check for libcrypto (openssl) EVP SHA224 support AS_IF( [test "x$ac_cv_libcrypto_evp_md" = xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA224]) dnl Check for libcrypto (openssl) SHA224 support AS_IF( [test "x$ac_cv_libcrypto_sha224" = xno], [AX_LIBCRYPTO_CHECK_OPENSSL_SHA224]) ]) dnl Function to detect if libcrypto SHA256 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_SHA256], [ac_cv_libcrypto_sha256=no dnl Check for libcrypto (openssl) EVP MD support AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD]) dnl Check for libcrypto (openssl) EVP SHA256 support AS_IF( [test "x$ac_cv_libcrypto_evp_md" = xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA256]) dnl Check for libcrypto (openssl) SHA256 support AS_IF( [test "x$ac_cv_libcrypto_sha256" = xno], [AX_LIBCRYPTO_CHECK_OPENSSL_SHA256]) ]) dnl Function to detect if libcrypto SHA512 functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_SHA512], [ac_cv_libcrypto_sha512=no dnl Check for libcrypto (openssl) EVP MD support AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_MD]) dnl Check for libcrypto (openssl) EVP SHA512 support AS_IF( [test "x$ac_cv_libcrypto_evp_md" = xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_SHA512]) dnl Check for libcrypto (openssl) SHA512 support AS_IF( [test "x$ac_cv_libcrypto_sha512" = xno], [AX_LIBCRYPTO_CHECK_OPENSSL_SHA512]) ]) dnl Function to detect if libcrypto AES-CBC and AES-ECB functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_AES], [dnl Check for libcrypto (openssl) EVP CIPHER AES-CBC and AES-ECB support AX_LIBCRYPTO_CHECK_AES_CBC AX_LIBCRYPTO_CHECK_AES_ECB dnl ac_cv_libcrypto_aes is deprecated but kept for backwards compatibility AS_IF( [test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno], [ac_cv_libcrypto_aes=no], [ac_cv_libcrypto_aes=libcrypto_evp]) dnl Check for libcrypto (openssl) AES-CBC and AES-ECB support AS_IF( [test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno], [AX_LIBCRYPTO_CHECK_OPENSSL_AES]) ]) dnl Function to detect if libcrypto AES-CBC functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_AES_CBC], [AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_CIPHER]) AS_IF( [test "x$ac_cv_libcrypto_evp_cipher" != xyes], [ac_cv_libcrypto_aes_cbc=no], [ac_cv_libcrypto_aes_cbc=libcrypto_evp AC_CHECK_LIB( crypto, EVP_aes_128_cbc, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_cbc=no]) AC_CHECK_LIB( crypto, EVP_aes_192_cbc, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_cbc=no]) AC_CHECK_LIB( crypto, EVP_aes_256_cbc, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_cbc=no]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_192_cbc" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_cbc" = xyes], [AC_DEFINE( [HAVE_EVP_CRYPTO_AES_CBC], [1], [Define to 1 if you have the `EVP_aes_128_cbc', `EVP_aes_192_cbc' and `EVP_aes_256_cbc' functions".]) ]) ]) ]) dnl Function to detect if libcrypto AES-ECB functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_AES_ECB], [AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_CIPHER]) AS_IF( [test "x$ac_cv_libcrypto_evp_cipher" != xyes], [ac_cv_libcrypto_aes_ecb=no], [ac_cv_libcrypto_aes_ecb=libcrypto_evp AC_CHECK_LIB( crypto, EVP_aes_128_ecb, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_ecb=no]) AC_CHECK_LIB( crypto, EVP_aes_192_ecb, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_ecb=no]) AC_CHECK_LIB( crypto, EVP_aes_256_ecb, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_ecb=no]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_aes_128_ecb" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_192_ecb" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_ecb" = xyes], [AC_DEFINE( [HAVE_EVP_CRYPTO_AES_ECB], [1], [Define to 1 if you have the `EVP_aes_128_ecb', `EVP_aes_192_ecb' and `EVP_aes_256_ecb' functions".]) ]) ]) ]) dnl Function to detect if libcrypto AES-XTS functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_AES_XTS], [AS_IF( [test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes], [AX_LIBCRYPTO_CHECK_OPENSSL_EVP_CIPHER]) AS_IF( [test "x$ac_cv_libcrypto_evp_cipher" != xyes], [ac_cv_libcrypto_aes_xts=no], [ac_cv_libcrypto_aes_xts=libcrypto_evp AC_CHECK_LIB( crypto, EVP_aes_128_xts, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_xts=no]) AC_CHECK_LIB( crypto, EVP_aes_256_xts, [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_xts=no]) AS_IF( [test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes], [AC_DEFINE( [HAVE_EVP_CRYPTO_AES_XTS], [1], [Define to 1 if you have the `EVP_aes_128_xts' and `EVP_aes_256_xts' functions".]) ]) ]) ]) dnl Function to detect how to enable libcrypto (openssl) AC_DEFUN([AX_LIBCRYPTO_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [openssl], [openssl], [search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL], [auto-detect], [DIR]) AX_COMMON_ARG_ENABLE( [openssl-evp-cipher], [openssl_evp_cipher], [enable OpenSSL EVP CIPHER support, or no to disable], [auto-detect]) AX_COMMON_ARG_ENABLE( [openssl-evp-md], [openssl_evp_md], [enable OpenSSL EVP MD support, or no to disable], [auto-detect]) dnl Check for a shared library version AX_LIBCRYPTO_CHECK_LIB AS_IF( [test "x$ac_cv_libcrypto_CPPFLAGS" != "x"], [AC_SUBST( [LIBCRYPTO_CPPFLAGS], [$ac_cv_libcrypto_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcrypto_LIBADD" != "x"], [AC_SUBST( [LIBCRYPTO_LIBADD], [$ac_cv_libcrypto_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcrypto" != xno], [AC_SUBST( [ax_libcrypto_pc_libs_private], [-lcrypto]) ]) AS_IF( [test "x$ac_cv_libcrypto" != xno], [AC_SUBST( [ax_libcrypto_spec_requires], [openssl]) AC_SUBST( [ax_libcrypto_spec_build_requires], [openssl-devel]) ]) ]) libewf-20140807/m4/libuuid.m40000664000175000017500000001122013440550335017546 0ustar00lordyestalordyesta00000000000000dnl Functions for libuuid dnl dnl Version: 20190308 dnl Function to detect if libuuid is available AC_DEFUN([AX_LIBUUID_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuuid" = xno], [ac_cv_libuuid=no], [ac_cv_libuuid=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libuuid" != x && test "x$ac_cv_with_libuuid" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libuuid"], [CFLAGS="$CFLAGS -I${ac_cv_with_libuuid}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libuuid}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libuuid], [1]) ]) ], [AS_IF( [test "x$ac_cv_enable_winapi" = xyes], [ac_cv_libuuid=librpcrt4 ac_cv_libuuid_LIBADD=-lrpcrt4], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [uuid], [uuid >= 2.20], [ac_cv_libuuid=libuuid], [ac_cv_libuuid=check]) ]) AS_IF( [test "x$ac_cv_libuuid" = xlibuuid], [ac_cv_libuuid_CPPFLAGS="$pkg_cv_libuuid_CFLAGS" ac_cv_libuuid_LIBADD="$pkg_cv_libuuid_LIBS"]) ]) ]) AS_IF( [test "x$ac_cv_libuuid" = xcheck], [AS_IF( [test "x$ac_cv_libuuid" = xuuid], [ac_cv_libuuid_CPPFLAGS="$pkg_cv_uuid_CFLAGS" ac_cv_libuuid_LIBADD="$pkg_cv_uuid_LIBS"], [dnl Check for headers AC_CHECK_HEADERS([uuid/uuid.h]) AS_IF( [test "x$ac_cv_header_uuid_uuid_h" != xno], [AC_CHECK_FUNC( [uuid_generate], [ac_cv_libuuid=native], [AC_CHECK_LIB( [uuid], [uuid_generate], [ac_cv_libuuid=libuuid ac_cv_libuuid_LIBADD="-luuid"], [ac_cv_libuuid=no]) ]) ]) ]) AS_IF( [test "x$ac_cv_libuuid" != xno], [AC_DEFINE( [HAVE_GUID_SUPPORT], [1], [Define to 1 if GUID/UUID support is available.]) ]) AS_IF( [test "x$ac_cv_libuuid" = xnative], [AC_CHECK_FUNC( [uuid_generate_random], [AC_DEFINE( [HAVE_UUID_GENERATE_RANDOM], [1], [Define to 1 if uuid_generate_random funtion is available.]) ]) AC_CHECK_FUNC( [uuid_generate_time], [AC_DEFINE( [HAVE_UUID_GENERATE_TIME], [1], [Define to 1 if uuid_generate_time funtion is available.]) ]) ]) AS_IF( [test "x$ac_cv_libuuid" = xlibuuid], [AC_CHECK_LIB( [uuid], [uuid_generate_random], [AC_DEFINE( [HAVE_UUID_GENERATE_RANDOM], [1], [Define to 1 if uuid_generate_random funtion is available in libuuid.]) ]) AC_CHECK_LIB( [uuid], [uuid_generate_time], [AC_DEFINE( [HAVE_UUID_GENERATE_TIME], [1], [Define to 1 if uuid_generate_time funtion is available in libuuid.]) ]) ]) ]) ]) AS_IF( [test "x$ac_cv_libuuid" = xlibrpcrt4], [AC_DEFINE( [HAVE_LIBUUID], [1], [Define to 1 if you have the 'librpcrt4' library (-lrpcrt4).]) ]) AS_IF( [test "x$ac_cv_libuuid" = xlibuuid], [AC_DEFINE( [HAVE_LIBUUID], [1], [Define to 1 if you have the 'libuuid' library (-luuid).]) ]) AS_IF( [test "x$ac_cv_libuuid" != xno], [AC_SUBST( [HAVE_LIBUUID], [1]) ], [AC_SUBST( [HAVE_LIBUUID], [0]) ]) ]) dnl Function to detect how to enable libuuid AC_DEFUN([AX_LIBUUID_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libuuid], [libuuid], [search for libuuid in includedir and libdir or in the specified DIR, or no if not to use libuuid], [auto-detect], [DIR]) dnl Check for a shared library version AX_LIBUUID_CHECK_LIB AS_IF( [test "x$ac_cv_libuuid_CPPFLAGS" != "x"], [AC_SUBST( [LIBUUID_CPPFLAGS], [$ac_cv_libuuid_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libuuid_LIBADD" != "x"], [AC_SUBST( [LIBUUID_LIBADD], [$ac_cv_libuuid_LIBADD]) ]) AS_IF( [test "x$ac_cv_libuuid" = xlibuuid], [AC_SUBST( [ax_libuuid_pc_libs_private], [-luuid]) ]) AS_IF( [test "x$ac_cv_libuuid" = xlibuuid], [AC_SUBST( [ax_libuuid_spec_requires], [libuuid]) AC_SUBST( [ax_libuuid_spec_build_requires], [libuuid-devel]) ]) ]) libewf-20140807/m4/po.m40000644000175000017500000004461612076507232016546 0ustar00lordyestalordyesta00000000000000# po.m4 serial 17 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <]], [[printf( "%jd" ); ]] )], [ac_cv_cv_have_printf_jd=no], [ac_cv_cv_have_printf_jd=yes]) dnl Second try to see if compilation and linkage with a parameter succeeds AS_IF( [test "x$ac_cv_cv_have_printf_jd" = xyes], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[printf( "%jd", (off_t) 10 ); ]] )], [ac_cv_cv_have_printf_jd=yes], [ac_cv_cv_have_printf_jd=no]) ]) dnl Third try to see if the program runs correctly AS_IF( [test "x$ac_cv_cv_have_printf_jd" = xyes], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[char string[ 3 ]; if( snprintf( string, 3, "%jd", (off_t) 10 ) < 0 ) return( 1 ); if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ]] )], [ac_cv_cv_have_printf_jd=yes], [ac_cv_cv_have_printf_jd=no], [ac_cv_cv_have_printf_jd=undetermined]) ]) AC_LANG_POP(C) CFLAGS="$SAVE_CFLAGS" AS_IF( [test "x$ac_cv_cv_have_printf_jd" = xyes], [AC_MSG_RESULT( [yes]) AC_DEFINE( [HAVE_PRINTF_JD], [1], [Define to 1 whether printf supports the conversion specifier "%jd".]) ], [AC_MSG_RESULT( [$ac_cv_cv_have_printf_jd]) ]) ]) dnl Function to detect whether printf conversion specifier "%zd" is available AC_DEFUN([AX_COMMON_CHECK_FUNC_PRINTF_ZD], [ AC_MSG_CHECKING( [whether printf supports the conversion specifier "%zd"]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_LANG_PUSH(C) dnl First try to see if compilation and linkage without a parameter succeeds AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[printf( "%zd" ); ]] )], [ac_cv_cv_have_printf_zd=no], [ac_cv_cv_have_printf_zd=yes]) dnl Second try to see if compilation and linkage with a parameter succeeds AS_IF( [test "x$ac_cv_cv_have_printf_zd" = xyes], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[printf( "%zd", (size_t) 10 ); ]] )], [ac_cv_cv_have_printf_zd=yes], [ac_cv_cv_have_printf_zd=no]) ]) dnl Third try to see if the program runs correctly AS_IF( [test "x$ac_cv_cv_have_printf_zd" = xyes], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[char string[ 3 ]; if( snprintf( string, 3, "%zd", (size_t) 10 ) < 0 ) return( 1 ); if( ( string[ 0 ] != '1' ) || ( string[ 1 ] != '0' ) ) return( 1 ); ]] )], [ac_cv_cv_have_printf_zd=yes], [ac_cv_cv_have_printf_zd=no], [ac_cv_cv_have_printf_zd=undetermined]) ]) AC_LANG_POP(C) CFLAGS="$SAVE_CFLAGS" AS_IF( [test "x$ac_cv_cv_have_printf_zd" = xyes], [AC_MSG_RESULT( [yes]) AC_DEFINE( [HAVE_PRINTF_ZD], [1], [Define to 1 whether printf supports the conversion specifier "%zd".]) ], [AC_MSG_RESULT( [$ac_cv_cv_have_printf_zd]) ]) ]) dnl Function to detect if common dependencies are available AC_DEFUN([AX_COMMON_CHECK_LOCAL], [ dnl Headers included in common/common.h AS_IF( [test "x$ac_cv_enable_winapi" = xyes], [AC_CHECK_HEADERS([windows.h]) AS_IF( [test "x$ac_cv_header_windows_h" = xno], [AC_MSG_FAILURE( [Missing header: windows.h header is required to compile with winapi support], [1]) ]) ]) AS_IF( [test "x$ac_cv_enable_winapi" = xno], [AC_CHECK_HEADERS([libintl.h]) ]) dnl Headers included in common/types.h AC_CHECK_HEADERS([limits.h]) dnl Headers included in common/memory.h and common/narrow_string.h AC_CHECK_HEADERS([stdlib.h string.h]) dnl Headers included in common/wide_string.h AC_CHECK_HEADERS([wchar.h wctype.h]) dnl File stream functions used in common/file_stream.h AC_CHECK_FUNCS([fclose feof fgets fopen fread fseeko fseeko64 fwrite vfprintf]) AS_IF( [test "x$ac_cv_func_fclose" != xyes], [AC_MSG_FAILURE( [Missing function: fclose], [1]) ]) AS_IF( [test "x$ac_cv_func_feof" != xyes], [AC_MSG_FAILURE( [Missing function: feof], [1]) ]) AS_IF( [test "x$ac_cv_func_fgets" != xyes], [AC_MSG_FAILURE( [Missing function: fgets], [1]) ]) AS_IF( [test "x$ac_cv_func_fopen" != xyes], [AC_MSG_FAILURE( [Missing function: fopen], [1]) ]) AS_IF( [test "x$ac_cv_func_fread" != xyes], [AC_MSG_FAILURE( [Missing function: fread], [1]) ]) AS_IF( [test "x$ac_cv_func_fseeko" != xyes && test "x$ac_cv_func_fseeko64" != xyes], [AC_MSG_FAILURE( [Missing function: fseeko and fseeko64], [1]) ]) AS_IF( [test "x$ac_cv_func_fwrite" != xyes], [AC_MSG_FAILURE( [Missing function: fwrite], [1]) ]) AS_IF( [test "x$ac_cv_func_vfprintf" != xyes], [AC_MSG_FAILURE( [Missing function: vfprintf], [1]) ]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_FUNCS([fgetws]) AS_IF( [test "x$ac_cv_func_fgetws" != xyes], [AC_MSG_FAILURE( [Missing function: fgetws], [1]) ]) ]) dnl Memory functions used in common/memory.h AC_CHECK_FUNCS([free malloc memcmp memcpy memset realloc]) AS_IF( [test "x$ac_cv_func_free" != xyes], [AC_MSG_FAILURE( [Missing function: free], [1]) ]) AS_IF( [test "x$ac_cv_func_malloc" != xyes], [AC_MSG_FAILURE( [Missing function: malloc], [1]) ]) AS_IF( [test "x$ac_cv_func_memcmp" != xyes], [AC_MSG_FAILURE( [Missing function: memcmp], [1]) ]) AS_IF( [test "x$ac_cv_func_memcpy" != xyes], [AC_MSG_FAILURE( [Missing function: memcpy], [1]) ]) AS_IF( [test "x$ac_cv_func_memset" != xyes], [AC_MSG_FAILURE( [Missing function: memset], [1]) ]) AS_IF( [test "x$ac_cv_func_realloc" != xyes], [AC_MSG_FAILURE( [Missing function: realloc], [1]) ]) dnl Narrow character string functions used in common/narrow_string.h AC_CHECK_FUNCS([memchr memrchr snprintf sscanf strcasecmp strchr strlen strncasecmp strncmp strncpy strnicmp strrchr strstr vsnprintf]) 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_vsnprintf" != xyes], [AC_MSG_FAILURE( [Missing function: vsnprintf], [1]) ]) dnl Wide character string functions used in common/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 Check for printf conversion specifier support AX_COMMON_CHECK_FUNC_PRINTF_JD AX_COMMON_CHECK_FUNC_PRINTF_ZD ]) libewf-20140807/m4/libcerror.m40000664000175000017500000001416413440550332020103 0ustar00lordyestalordyesta00000000000000dnl Checks for libcerror required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcerror is available dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCERROR_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcerror" = xno], [ac_cv_libcerror=no], [ac_cv_libcerror=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcerror"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcerror}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcerror}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcerror], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcerror], [libcerror >= 20120425], [ac_cv_libcerror=yes], [ac_cv_libcerror=check]) ]) AS_IF( [test "x$ac_cv_libcerror" = xyes], [ac_cv_libcerror_CPPFLAGS="$pkg_cv_libcerror_CFLAGS" ac_cv_libcerror_LIBADD="$pkg_cv_libcerror_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcerror" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcerror.h]) AS_IF( [test "x$ac_cv_header_libcerror_h" = xno], [ac_cv_libcerror=no], [dnl Check for the individual functions ac_cv_libcerror=yes AC_CHECK_LIB( cerror, libcerror_get_version, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) dnl Error functions AC_CHECK_LIB( cerror, libcerror_error_free, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) AC_CHECK_LIB( cerror, libcerror_error_set, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) AC_CHECK_LIB( cerror, libcerror_error_matches, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) AC_CHECK_LIB( cerror, libcerror_error_fprint, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) AC_CHECK_LIB( cerror, libcerror_error_sprint, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) AC_CHECK_LIB( cerror, libcerror_error_backtrace_fprint, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) AC_CHECK_LIB( cerror, libcerror_error_backtrace_sprint, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) dnl System error functions AC_CHECK_LIB( cerror, libcerror_system_set_error, [ac_cv_libcerror_dummy=yes], [ac_cv_libcerror=no]) ac_cv_libcerror_LIBADD="-lcerror"]) ]) AS_IF( [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_libcerror" != xyes], [AC_MSG_FAILURE( [unable to find supported libcerror in directory: $ac_cv_with_libcerror], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcerror" = xyes], [AC_DEFINE( [HAVE_LIBCERROR], [1], [Define to 1 if you have the `cerror' library (-lcerror).]) ]) AS_IF( [test "x$ac_cv_libcerror" = xyes], [AC_SUBST( [HAVE_LIBCERROR], [1]) ], [AC_SUBST( [HAVE_LIBCERROR], [0]) ]) ]) dnl Function to detect if libcerror dependencies are available AC_DEFUN([AX_LIBCERROR_CHECK_LOCAL], [dnl Headers included in libcerror/libcerror_error.c AC_CHECK_HEADERS([stdarg.h varargs.h]) AS_IF( [test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes], [AC_MSG_FAILURE( [Missing headers: stdarg.h and varargs.h], [1]) ]) dnl Wide character string functions used in libcerror/libcerror_error.c AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_FUNCS([wcstombs]) AS_IF( [test "x$ac_cv_func_wcstombs" != xyes], [AC_MSG_FAILURE( [Missing function: wcstombs], [1]) ]) ]) dnl Check for error string functions used in libcerror/libcerror_system.c AC_FUNC_STRERROR_R() AS_IF( [test "x$ac_cv_have_decl_strerror_r" != xyes], [AC_CHECK_FUNCS([strerror]) AS_IF( [test "x$ac_cv_func_strerror" != xyes], [AC_MSG_FAILURE( [Missing functions: strerror_r and strerror], [1]) ]) ]) ac_cv_libcerror_CPPFLAGS="-I../libcerror"; ac_cv_libcerror_LIBADD="../libcerror/libcerror.la"; ac_cv_libcerror=local ]) dnl Function to detect how to enable libcerror AC_DEFUN([AX_LIBCERROR_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcerror], [libcerror], [search for libcerror 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_LIBCERROR_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcerror" != xyes], [AX_LIBCERROR_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCERROR], [1], [Define to 1 if the local version of libcerror is used.]) AC_SUBST( [HAVE_LOCAL_LIBCERROR], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCERROR], [test "x$ac_cv_libcerror" = xlocal]) AS_IF( [test "x$ac_cv_libcerror_CPPFLAGS" != "x"], [AC_SUBST( [LIBCERROR_CPPFLAGS], [$ac_cv_libcerror_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcerror_LIBADD" != "x"], [AC_SUBST( [LIBCERROR_LIBADD], [$ac_cv_libcerror_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcerror" = xyes], [AC_SUBST( [ax_libcerror_pc_libs_private], [-lcerror]) ]) AS_IF( [test "x$ac_cv_libcerror" = xyes], [AC_SUBST( [ax_libcerror_spec_requires], [libcerror]) AC_SUBST( [ax_libcerror_spec_build_requires], [libcerror-devel]) ]) ]) libewf-20140807/m4/iconv.m40000644000175000017500000001653712076507232017247 0ustar00lordyestalordyesta00000000000000# iconv.m4 serial 11 (gettext-0.18.1) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_TRY_RUN([ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi ]) libewf-20140807/m4/libsmraw.m40000664000175000017500000001444513440550332017742 0ustar00lordyestalordyesta00000000000000dnl Checks for libsmraw required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libsmraw is available dnl ac_libsmraw_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBSMRAW_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libsmraw" = xno], [ac_cv_libsmraw=no], [ac_cv_libsmraw=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libsmraw" != x && test "x$ac_cv_with_libsmraw" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libsmraw"], [CFLAGS="$CFLAGS -I${ac_cv_with_libsmraw}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libsmraw}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libsmraw], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libsmraw], [libsmraw >= 20120630], [ac_cv_libsmraw=yes], [ac_cv_libsmraw=check]) ]) AS_IF( [test "x$ac_cv_libsmraw" = xyes], [ac_cv_libsmraw_CPPFLAGS="$pkg_cv_libsmraw_CFLAGS" ac_cv_libsmraw_LIBADD="$pkg_cv_libsmraw_LIBS"]) ]) AS_IF( [test "x$ac_cv_libsmraw" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libsmraw.h]) AS_IF( [test "x$ac_cv_header_libsmraw_h" = xno], [ac_cv_libsmraw=no], [dnl Check for the individual functions ac_cv_libsmraw=yes AC_CHECK_LIB( smraw, libsmraw_get_version, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) dnl Handle functions AC_CHECK_LIB( smraw, libsmraw_handle_initialize, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_free, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_signal_abort, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_open, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_close, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_read_buffer, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_seek_offset, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_write_buffer, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( smraw, libsmraw_handle_open_wide, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) ]) AC_CHECK_LIB( smraw, libsmraw_handle_get_media_size, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_get_bytes_per_sector, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_get_utf8_information_value [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_get_utf16_information_value [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_set_maximum_segment_size, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_set_media_size, [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_set_utf8_integrity_hash_value [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) AC_CHECK_LIB( smraw, libsmraw_handle_set_utf16_integrity_hash_value [ac_cv_libsmraw_dummy=yes], [ac_cv_libsmraw=no]) ac_cv_libsmraw_LIBADD="-lsmraw"]) ]) AS_IF( [test "x$ac_cv_with_libsmraw" != x && test "x$ac_cv_with_libsmraw" != xauto-detect && test "x$ac_cv_libsmraw" != xyes], [AC_MSG_FAILURE( [unable to find supported libsmraw in directory: $ac_cv_with_libsmraw], [1]) ]) ]) AS_IF( [test "x$ac_cv_libsmraw" = xyes], [AC_DEFINE( [HAVE_LIBSMRAW], [1], [Define to 1 if you have the `smraw' library (-lsmraw).]) ]) AS_IF( [test "x$ac_cv_libsmraw" = xyes], [AC_SUBST( [HAVE_LIBSMRAW], [1]) ], [AC_SUBST( [HAVE_LIBSMRAW], [0]) ]) ]) dnl Function to detect how to enable libsmraw AC_DEFUN([AX_LIBSMRAW_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libsmraw], [libsmraw], [search for libsmraw in includedir and libdir or in the specified DIR, or no if to use local version], [auto-detect], [DIR]) AX_LIBSMRAW_CHECK_LIB AS_IF( [test "x$ac_cv_libsmraw" != xyes], [AC_DEFINE( [HAVE_LOCAL_LIBSMRAW], [1], [Define to 1 if the local version of libsmraw is used.]) AC_SUBST( [HAVE_LOCAL_LIBSMRAW], [1]) ac_cv_libsmraw_CPPFLAGS="-I../libsmraw"; ac_cv_libsmraw_LIBADD="../libsmraw/libsmraw.la"; ac_cv_libsmraw=local ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBSMRAW], [test "x$ac_cv_libsmraw" = xlocal]) AS_IF( [test "x$ac_cv_libsmraw_CPPFLAGS" != "x"], [AC_SUBST( [LIBSMRAW_CPPFLAGS], [$ac_cv_libsmraw_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libsmraw_LIBADD" != "x"], [AC_SUBST( [LIBSMRAW_LIBADD], [$ac_cv_libsmraw_LIBADD]) ]) AS_IF( [test "x$ac_cv_libsmraw" = xyes], [AC_SUBST( [ax_libsmraw_pc_libs_private], [-lsmraw]) ]) AS_IF( [test "x$ac_cv_libsmraw" = xyes], [AC_SUBST( [ax_libsmraw_spec_requires], [libsmraw]) AC_SUBST( [ax_libsmraw_spec_build_requires], [libsmraw-devel]) ]) ]) libewf-20140807/m4/ltsugar.m40000644000175000017500000001044013443455336017603 0ustar00lordyestalordyesta00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libewf-20140807/m4/libfcache.m40000664000175000017500000001553113440550332020017 0ustar00lordyestalordyesta00000000000000dnl Checks for libfcache required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libfcache is available dnl ac_libfcache_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBFCACHE_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfcache" = xno], [ac_cv_libfcache=no], [ac_cv_libfcache=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libfcache"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfcache}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfcache}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libfcache], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libfcache], [libfcache >= 20181010], [ac_cv_libfcache=yes], [ac_cv_libfcache=check]) ]) AS_IF( [test "x$ac_cv_libfcache" = xyes], [ac_cv_libfcache_CPPFLAGS="$pkg_cv_libfcache_CFLAGS" ac_cv_libfcache_LIBADD="$pkg_cv_libfcache_LIBS"]) ]) AS_IF( [test "x$ac_cv_libfcache" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libfcache.h]) AS_IF( [test "x$ac_cv_header_libfcache_h" = xno], [ac_cv_libfcache=no], [dnl Check for the individual functions ac_cv_libfcache=yes AC_CHECK_LIB( fcache, libfcache_get_version, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) dnl Cache functions AC_CHECK_LIB( fcache, libfcache_cache_initialize, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_free, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_clone, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_clear, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_get_number_of_entries, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_get_number_of_cache_values, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_get_value_by_identifier, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_get_value_by_index, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_set_value_by_identifier, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_set_value_by_index, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) dnl Cache value functions AC_CHECK_LIB( fcache, libfcache_cache_value_clear, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_value_get_identifier, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_value_set_identifier, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_value_get_value, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, libfcache_cache_value_set_value, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) dnl Date time functions AC_CHECK_LIB( fcache, libfcache_date_time_get_timestamp, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) ac_cv_libfcache_LIBADD="-lfcache"]) ]) AS_IF( [test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect && test "x$ac_cv_libfcache" != xyes], [AC_MSG_FAILURE( [unable to find supported libfcache in directory: $ac_cv_with_libfcache], [1]) ]) ]) AS_IF( [test "x$ac_cv_libfcache" = xyes], [AC_DEFINE( [HAVE_LIBFCACHE], [1], [Define to 1 if you have the `fcache' library (-lfcache).]) ]) AS_IF( [test "x$ac_cv_libfcache" = xyes], [AC_SUBST( [HAVE_LIBFCACHE], [1]) ], [AC_SUBST( [HAVE_LIBFCACHE], [0]) ]) ]) dnl Function to detect if libfcache dependencies are available AC_DEFUN([AX_LIBFCACHE_CHECK_LOCAL], [dnl Types used in libfcache/libfcache_date_time.h AC_STRUCT_TM dnl Headers included in libfcache/libfcache_date_time.h AC_HEADER_TIME dnl Date and time functions used in libfcache/libfcache_date_time.h AC_CHECK_FUNCS([clock_gettime time]) AS_IF( [test "x$ac_cv_func_time" != xyes], [AC_MSG_FAILURE( [Missing function: time], [1]) ]) ac_cv_libfcache_CPPFLAGS="-I../libfcache"; ac_cv_libfcache_LIBADD="../libfcache/libfcache.la"; ac_cv_libfcache=local ]) dnl Function to detect how to enable libfcache AC_DEFUN([AX_LIBFCACHE_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libfcache], [libfcache], [search for libfcache 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_LIBFCACHE_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libfcache" != xyes], [AX_LIBFCACHE_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBFCACHE], [1], [Define to 1 if the local version of libfcache is used.]) AC_SUBST( [HAVE_LOCAL_LIBFCACHE], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBFCACHE], [test "x$ac_cv_libfcache" = xlocal]) AS_IF( [test "x$ac_cv_libfcache_CPPFLAGS" != "x"], [AC_SUBST( [LIBFCACHE_CPPFLAGS], [$ac_cv_libfcache_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libfcache_LIBADD" != "x"], [AC_SUBST( [LIBFCACHE_LIBADD], [$ac_cv_libfcache_LIBADD]) ]) AS_IF( [test "x$ac_cv_libfcache" = xyes], [AC_SUBST( [ax_libfcache_pc_libs_private], [-lfcache]) ]) AS_IF( [test "x$ac_cv_libfcache" = xyes], [AC_SUBST( [ax_libfcache_spec_requires], [libfcache]) AC_SUBST( [ax_libfcache_spec_build_requires], [libfcache-devel]) ]) ]) libewf-20140807/m4/libcsplit.m40000664000175000017500000001633013440550332020102 0ustar00lordyestalordyesta00000000000000dnl Checks for libcsplit required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libcsplit is available dnl ac_libcsplit_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBCSPLIT_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcsplit" = xno], [ac_cv_libcsplit=no], [ac_cv_libcsplit=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libcsplit"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcsplit}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcsplit}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libcsplit], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcsplit], [libcsplit >= 20120701], [ac_cv_libcsplit=yes], [ac_cv_libcsplit=check]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xyes && test "x$ac_cv_enable_wide_character_type" != xno], [AC_CACHE_CHECK( [whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1], [ac_cv_header_libcsplit_features_h_have_wide_character_type], [AC_LANG_PUSH(C) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if !defined( LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE not defined #endif]] )], [ac_cv_header_libcsplit_features_h_have_wide_character_type=yes], [ac_cv_header_libcsplit_features_h_have_wide_character_type=no]) AC_LANG_POP(C)], [ac_cv_header_libcsplit_features_h_have_wide_character_type=no]) AS_IF( [test "x$ac_cv_header_libcsplit_features_h_have_wide_character_type" = xno], [ac_cv_libcsplit=no]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xyes], [ac_cv_libcsplit_CPPFLAGS="$pkg_cv_libcsplit_CFLAGS" ac_cv_libcsplit_LIBADD="$pkg_cv_libcsplit_LIBS"]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libcsplit.h]) AS_IF( [test "x$ac_cv_header_libcsplit_h" = xno], [ac_cv_libcsplit=no], [dnl Check for the individual functions ac_cv_libcsplit=yes AC_CHECK_LIB( csplit, libcsplit_get_version, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) dnl Narrow string functions AC_CHECK_LIB( csplit, libcsplit_narrow_string_split, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) dnl Narrow split string functions AC_CHECK_LIB( csplit, libcsplit_narrow_split_string_free, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_narrow_split_string_get_string, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_narrow_split_string_get_number_of_segments, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_narrow_split_string_get_segment_by_index, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_narrow_split_string_set_segment_by_index, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) dnl Wide string functions AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( csplit, libcsplit_wide_string_split, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) dnl Wide split string functions AC_CHECK_LIB( csplit, libcsplit_wide_split_string_free, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_wide_split_string_get_string, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_wide_split_string_get_number_of_segments, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_wide_split_string_get_segment_by_index, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) AC_CHECK_LIB( csplit, libcsplit_wide_split_string_set_segment_by_index, [ac_cv_libcsplit_dummy=yes], [ac_cv_libcsplit=no]) ]) ac_cv_libcsplit_LIBADD="-lcsplit"]) ]) AS_IF( [test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_libcsplit" != xyes], [AC_MSG_FAILURE( [unable to find supported libcsplit in directory: $ac_cv_with_libcsplit], [1]) ]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xyes], [AC_DEFINE( [HAVE_LIBCSPLIT], [1], [Define to 1 if you have the `csplit' library (-lcsplit).]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xyes], [AC_SUBST( [HAVE_LIBCSPLIT], [1]) ], [AC_SUBST( [HAVE_LIBCSPLIT], [0]) ]) ]) dnl Function to detect if libcsplit dependencies are available AC_DEFUN([AX_LIBCSPLIT_CHECK_LOCAL], [dnl No additional checks. ac_cv_libcsplit_CPPFLAGS="-I../libcsplit"; ac_cv_libcsplit_LIBADD="../libcsplit/libcsplit.la"; ac_cv_libcsplit=local ]) dnl Function to detect how to enable libcsplit AC_DEFUN([AX_LIBCSPLIT_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libcsplit], [libcsplit], [search for libcsplit 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_LIBCSPLIT_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libcsplit" != xyes], [AX_LIBCSPLIT_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBCSPLIT], [1], [Define to 1 if the local version of libcsplit is used.]) AC_SUBST( [HAVE_LOCAL_LIBCSPLIT], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBCSPLIT], [test "x$ac_cv_libcsplit" = xlocal]) AS_IF( [test "x$ac_cv_libcsplit_CPPFLAGS" != "x"], [AC_SUBST( [LIBCSPLIT_CPPFLAGS], [$ac_cv_libcsplit_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libcsplit_LIBADD" != "x"], [AC_SUBST( [LIBCSPLIT_LIBADD], [$ac_cv_libcsplit_LIBADD]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xyes], [AC_SUBST( [ax_libcsplit_pc_libs_private], [-lcsplit]) ]) AS_IF( [test "x$ac_cv_libcsplit" = xyes], [AC_SUBST( [ax_libcsplit_spec_requires], [libcsplit]) AC_SUBST( [ax_libcsplit_spec_build_requires], [libcsplit-devel]) ]) ]) libewf-20140807/m4/stdcxx11.m40000664000175000017500000001103212273173456017601 0ustar00lordyestalordyesta00000000000000# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXXFLAGS to enable support. # # The first argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The second argument, if specified 'mandatory' or if left unspecified, # indicates that baseline C++11 support is required and that the macro # should error out if no mode with that support is found. If specified # 'optional', then configuration proceeds regardless, after defining # HAVE_CXX11 if and only if a supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 3 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; ]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl m4_if([$1], [], [], [$1], [ext], [], [$1], [noext], [], [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], [$2], [optional], [ax_cxx_compile_cxx11_required=false], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++11 features by default, ax_cv_cxx_compile_cxx11, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [ax_cv_cxx_compile_cxx11=yes], [ax_cv_cxx_compile_cxx11=no])]) if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi m4_if([$1], [noext], [], [dnl if test x$ac_success = xno; then for switch in -std=gnu++11 -std=gnu++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) m4_if([$1], [ext], [], [dnl if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) fi else if test x$ac_success = xno; then HAVE_CXX11=0 AC_MSG_NOTICE([No compiler with C++11 support was found]) else HAVE_CXX11=1 AC_DEFINE(HAVE_CXX11,1, [define if the compiler supports basic C++11 syntax]) fi AC_SUBST(HAVE_CXX11) AM_CONDITIONAL([HAVE_CXX11], [0]) fi ]) libewf-20140807/m4/intlmacosx.m40000664000175000017500000000457512076507232020313 0ustar00lordyestalordyesta00000000000000# intlmacosx.m4 serial 3 (gettext-0.18) dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) libewf-20140807/m4/types.m40000664000175000017500000000401213407162311017252 0ustar00lordyestalordyesta00000000000000dnl Functions for type definitions dnl dnl Version: 20180727 dnl Function to detect if type definitions are available AC_DEFUN([AX_TYPES_CHECK_LOCAL], [AS_IF( [test "x$ac_cv_enable_winapi" = xyes], [ac_cv_enable_wide_character_type=yes]) AS_IF( [test "x$ac_cv_enable_wide_character_type" = xyes], [AC_DEFINE( [HAVE_WIDE_CHARACTER_TYPE], [1], [Define to 1 if wide character type should be used.]) AC_SUBST( [HAVE_WIDE_CHARACTER_TYPE], [1]) ], [AC_SUBST( [HAVE_WIDE_CHARACTER_TYPE], [0]) ]) AC_CHECK_HEADERS([sys/types.h inttypes.h stdint.h wchar.h]) AS_IF( [test "x$ac_cv_header_sys_types_h" = xyes], [AC_SUBST( [HAVE_SYS_TYPES_H], [1])], [AC_SUBST( [HAVE_SYS_TYPES_H], [0]) ]) AS_IF( [test "x$ac_cv_header_inttypes_h" = xyes], [AC_SUBST( [HAVE_INTTYPES_H], [1])], [AC_SUBST( [HAVE_INTTYPES_H], [0]) ]) AS_IF( [test "x$ac_cv_header_stdint_h" = xyes], [AC_SUBST( [HAVE_STDINT_H], [1])], [AC_SUBST( [HAVE_STDINT_H], [0]) ]) AS_IF( [test "x$ac_cv_header_wchar_h" = xyes], [AC_SUBST( [HAVE_WCHAR_H], [1]) ], [AC_SUBST( [HAVE_WCHAR_H], [0]) ]) AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_CHECK_TYPE( [size32_t], [AC_SUBST( [HAVE_SIZE32_T], [1])], [AC_SUBST( [HAVE_SIZE32_T], [0]) ]) AC_CHECK_TYPE( [ssize32_t], [AC_SUBST( [HAVE_SSIZE32_T], [1])], [AC_SUBST( [HAVE_SSIZE32_T], [0]) ]) AC_CHECK_TYPE( [size64_t], [AC_SUBST( [HAVE_SIZE64_T], [1])], [AC_SUBST( [HAVE_SIZE64_T], [0]) ]) AC_CHECK_TYPE( [ssize64_t], [AC_SUBST( [HAVE_SSIZE64_T], [1])], [AC_SUBST( [HAVE_SSIZE64_T], [0]) ]) AC_CHECK_TYPE( [off64_t], [AC_SUBST( [HAVE_OFF64_T], [1])], [AC_SUBST( [HAVE_OFF64_T], [0]) ]) AC_CHECK_TYPE([ssize_t]) AC_CHECK_TYPE([u64]) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([off_t]) AC_CHECK_SIZEOF([size_t]) AS_IF( [test "x$ac_cv_header_wchar_h" = xyes], [AC_CHECK_SIZEOF([wchar_t])]) ]) libewf-20140807/m4/libbfio.m40000664000175000017500000002465013440550332017527 0ustar00lordyestalordyesta00000000000000dnl Checks for libbfio required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libbfio is available dnl ac_libbfio_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBBFIO_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libbfio" = xno], [ac_cv_libbfio=no], [ac_cv_libbfio=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libbfio"], [CFLAGS="$CFLAGS -I${ac_cv_with_libbfio}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libbfio}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libbfio], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libbfio], [libbfio >= 20160108], [ac_cv_libbfio=yes], [ac_cv_libbfio=check]) ]) AS_IF( [test "x$ac_cv_libbfio" = xyes && test "x$ac_cv_enable_wide_character_type" != xno], [AC_CACHE_CHECK( [whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1], [ac_cv_header_libbfio_features_h_have_wide_character_type], [AC_LANG_PUSH(C) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if !defined( LIBBFIO_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBBFIO_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBBFIO_HAVE_WIDE_CHARACTER_TYPE not defined #endif]] )], [ac_cv_header_libbfio_features_h_have_wide_character_type=yes], [ac_cv_header_libbfio_features_h_have_wide_character_type=no]) AC_LANG_POP(C)], [ac_cv_header_libbfio_features_h_have_wide_character_type=no]) AS_IF( [test "x$ac_cv_header_libbfio_features_h_have_wide_character_type" = xno], [ac_cv_libbfio=no]) ]) AS_IF( [test "x$ac_cv_libbfio" = xyes], [ac_cv_libbfio_CPPFLAGS="$pkg_cv_libbfio_CFLAGS" ac_cv_libbfio_LIBADD="$pkg_cv_libbfio_LIBS"]) ]) AS_IF( [test "x$ac_cv_libbfio" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libbfio.h]) AS_IF( [test "x$ac_cv_header_libbfio_h" = xno], [ac_cv_libbfio=no], [dnl Check for the individual functions ac_cv_libbfio=yes AC_CHECK_LIB( bfio, libbfio_get_version, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) dnl Handle functions AC_CHECK_LIB( bfio, libbfio_handle_free, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_open, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_close, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_exists, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_read_buffer, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_write_buffer, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_seek_offset, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_is_open, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_get_offset, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_get_size, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_set_track_offsets_read, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_get_number_of_offsets_read, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_handle_get_offset_read, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) dnl File functions AC_CHECK_LIB( bfio, libbfio_file_initialize, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_file_get_name_size, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_file_get_name, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_file_set_name, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AS_IF( [test "x$ac_cv_enable_wide_character_type" != xno], [AC_CHECK_LIB( bfio, libbfio_file_get_name_size_wide, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_file_get_name_wide, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_file_set_name_wide, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) ]) dnl Pool functions AC_CHECK_LIB( bfio, libbfio_pool_initialize, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_free, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_clone, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_get_number_of_handles, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_get_handle, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_set_handle, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_append_handle, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_remove_handle, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_get_maximum_number_of_open_handles, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_set_maximum_number_of_open_handles, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_open, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_reopen, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_close, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_close_all, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_read_buffer, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_write_buffer, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_seek_offset, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_get_offset, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, libbfio_pool_get_size, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) ac_cv_libbfio_LIBADD="-lbfio"]) ]) AS_IF( [test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_libbfio" != xyes], [AC_MSG_FAILURE( [unable to find supported libbfio in directory: $ac_cv_with_libbfio], [1]) ]) ]) AS_IF( [test "x$ac_cv_libbfio" = xyes], [AC_DEFINE( [HAVE_LIBBFIO], [1], [Define to 1 if you have the `bfio' library (-lbfio).]) ]) AS_IF( [test "x$ac_cv_libbfio" = xyes], [AC_SUBST( [HAVE_LIBBFIO], [1]) ], [AC_SUBST( [HAVE_LIBBFIO], [0]) ]) ]) dnl Function to detect if libbfio dependencies are available AC_DEFUN([AX_LIBBFIO_CHECK_LOCAL], [dnl No additional checks. ac_cv_libbfio_CPPFLAGS="-I../libbfio"; ac_cv_libbfio_LIBADD="../libbfio/libbfio.la"; ac_cv_libbfio=local ]) dnl Function to detect how to enable libbfio AC_DEFUN([AX_LIBBFIO_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libbfio], [libbfio], [search for libbfio 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_LIBBFIO_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libbfio" != xyes], [AX_LIBBFIO_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBBFIO], [1], [Define to 1 if the local version of libbfio is used.]) AC_SUBST( [HAVE_LOCAL_LIBBFIO], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBBFIO], [test "x$ac_cv_libbfio" = xlocal]) AS_IF( [test "x$ac_cv_libbfio_CPPFLAGS" != "x"], [AC_SUBST( [LIBBFIO_CPPFLAGS], [$ac_cv_libbfio_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libbfio_LIBADD" != "x"], [AC_SUBST( [LIBBFIO_LIBADD], [$ac_cv_libbfio_LIBADD]) ]) AS_IF( [test "x$ac_cv_libbfio" = xyes], [AC_SUBST( [ax_libbfio_pc_libs_private], [-lbfio]) ]) AS_IF( [test "x$ac_cv_libbfio" = xyes], [AC_SUBST( [ax_libbfio_spec_requires], [libbfio]) AC_SUBST( [ax_libbfio_spec_build_requires], [libbfio-devel]) ]) ]) libewf-20140807/m4/libfvalue.m40000664000175000017500000004651713440550332020100 0ustar00lordyestalordyesta00000000000000dnl Checks for libfvalue required headers and functions dnl dnl Version: 20190308 dnl Function to detect if libfvalue is available dnl ac_libfvalue_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBFVALUE_CHECK_LIB], [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfvalue" = xno], [ac_cv_libfvalue=no], [ac_cv_libfvalue=check dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect], [AS_IF( [test -d "$ac_cv_with_libfvalue"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfvalue}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfvalue}/lib"], [AC_MSG_FAILURE( [no such directory: $ac_cv_with_libfvalue], [1]) ]) ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libfvalue], [libfvalue >= 20160131], [ac_cv_libfvalue=yes], [ac_cv_libfvalue=check]) ]) AS_IF( [test "x$ac_cv_libfvalue" = xyes], [ac_cv_libfvalue_CPPFLAGS="$pkg_cv_libfvalue_CFLAGS" ac_cv_libfvalue_LIBADD="$pkg_cv_libfvalue_LIBS"]) ]) AS_IF( [test "x$ac_cv_libfvalue" = xcheck], [dnl Check for headers AC_CHECK_HEADERS([libfvalue.h]) AS_IF( [test "x$ac_cv_header_libfvalue_h" = xno], [ac_cv_libfvalue=no], [dnl Check for the individual functions ac_cv_libfvalue=yes AC_CHECK_LIB( fvalue, libfvalue_get_version, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl Data handle functions AC_CHECK_LIB( fvalue, libfvalue_data_handle_initialize, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_free, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_clone, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_clear, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_get_data, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_set_data, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_get_data_flags, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_set_data_flags, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_get_number_of_value_entries, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_get_value_entry, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_set_value_entry, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_data_handle_append_value_entry, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl Integer functions AC_CHECK_LIB( fvalue, libfvalue_string_size_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf8_string_copy_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf8_string_with_index_copy_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf8_string_copy_to_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf8_string_with_index_copy_to_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf16_string_copy_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf16_string_with_index_copy_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf16_string_copy_to_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf16_string_with_index_copy_to_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf32_string_copy_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf32_string_with_index_copy_from_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf32_string_copy_to_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf32_string_with_index_copy_to_integer, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl String functions AC_CHECK_LIB( fvalue, libfvalue_utf8_string_split, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_utf16_string_split, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl Split string functions AC_CHECK_LIB( fvalue, libfvalue_split_utf8_string_free, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf8_string_get_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf8_string_get_number_of_segments, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf8_string_get_segment_by_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf16_string_free, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf16_string_get_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf16_string_get_number_of_segments, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_split_utf16_string_get_segment_by_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl Table functions AC_CHECK_LIB( fvalue, libfvalue_table_initialize, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_free, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_resize, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_clone, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_get_number_of_values, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_get_index_by_identifier, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_get_value_by_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_get_value_by_identifier, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_set_value_by_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_set_value, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_table_copy_from_utf8_xml_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl Value functions AC_CHECK_LIB( fvalue, libfvalue_value_initialize, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_free, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_clone, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_clear, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_type, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_identifier, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_set_identifier, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_data_handle, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_has_data, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_data_size, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_data, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_set_data, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_data, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_format_flags, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_set_format_flags, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_number_of_value_entries, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_value_entry, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_set_value_entry, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_append_value_entry, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_boolean, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_boolean, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_8bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_8bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_16bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_16bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_32bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_32bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_64bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_64bit, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_float, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_float, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_double, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_double, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_utf8_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_utf8_string_size, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_utf8_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_utf8_string_with_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_utf16_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_utf16_string_size, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_utf16_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_utf16_string_with_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_from_utf32_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_get_utf32_string_size, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_utf32_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_copy_to_utf32_string_with_index, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_read_from_file_stream, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_write_to_file_stream, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) dnl Value type functions AC_CHECK_LIB( fvalue, libfvalue_value_type_initialize, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_type_initialize_with_data_handle, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_type_set_data_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_type_append_data_string, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) AC_CHECK_LIB( fvalue, libfvalue_value_type_set_data_strings_array, [ac_cv_libfvalue_dummy=yes], [ac_cv_libfvalue=no]) ac_cv_libfvalue_LIBADD="-lfvalue"]) ]) AS_IF( [test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect && test "x$ac_cv_libfvalue" != xyes], [AC_MSG_FAILURE( [unable to find supported libfvalue in directory: $ac_cv_with_libfvalue], [1]) ]) ]) AS_IF( [test "x$ac_cv_libfvalue" = xyes], [AC_DEFINE( [HAVE_LIBFVALUE], [1], [Define to 1 if you have the `fvalue' library (-lfvalue).]) ]) AS_IF( [test "x$ac_cv_libfvalue" = xyes], [AC_SUBST( [HAVE_LIBFVALUE], [1]) ], [AC_SUBST( [HAVE_LIBFVALUE], [0]) ]) ]) dnl Function to detect if libfvalue dependencies are available AC_DEFUN([AX_LIBFVALUE_CHECK_LOCAL], [dnl No additional checks. ac_cv_libfvalue_CPPFLAGS="-I../libfvalue"; ac_cv_libfvalue_LIBADD="../libfvalue/libfvalue.la"; ac_cv_libfvalue=local ]) dnl Function to detect how to enable libfvalue AC_DEFUN([AX_LIBFVALUE_CHECK_ENABLE], [AX_COMMON_ARG_WITH( [libfvalue], [libfvalue], [search for libfvalue 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_LIBFVALUE_CHECK_LIB dnl Check if the dependencies for the local library version AS_IF( [test "x$ac_cv_libfvalue" != xyes], [AX_LIBFVALUE_CHECK_LOCAL AC_DEFINE( [HAVE_LOCAL_LIBFVALUE], [1], [Define to 1 if the local version of libfvalue is used.]) AC_SUBST( [HAVE_LOCAL_LIBFVALUE], [1]) ]) AM_CONDITIONAL( [HAVE_LOCAL_LIBFVALUE], [test "x$ac_cv_libfvalue" = xlocal]) AS_IF( [test "x$ac_cv_libfvalue_CPPFLAGS" != "x"], [AC_SUBST( [LIBFVALUE_CPPFLAGS], [$ac_cv_libfvalue_CPPFLAGS]) ]) AS_IF( [test "x$ac_cv_libfvalue_LIBADD" != "x"], [AC_SUBST( [LIBFVALUE_LIBADD], [$ac_cv_libfvalue_LIBADD]) ]) AS_IF( [test "x$ac_cv_libfvalue" = xyes], [AC_SUBST( [ax_libfvalue_pc_libs_private], [-lfvalue]) ]) AS_IF( [test "x$ac_cv_libfvalue" = xyes], [AC_SUBST( [ax_libfvalue_spec_requires], [libfvalue]) AC_SUBST( [ax_libfvalue_spec_build_requires], [libfvalue-devel]) ]) ]) libewf-20140807/libcerror/0000775000175000017500000000000013443455444017326 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcerror/libcerror_system.c0000664000175000017500000003615313443450027023061 0ustar00lordyestalordyesta00000000000000/* * System functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STRING_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #include #elif defined( HAVE_VARARGS_H ) #include #else #error Missing headers stdarg.h and varargs.h #endif #include "libcerror_definitions.h" #include "libcerror_error.h" #include "libcerror_system.h" #include "libcerror_types.h" #if defined( WINAPI ) /* The make language identifier macro for the WINAPI FormatMessage function */ #if !defined( MAKELANGID ) #define MAKELANGID( primary_language_identifier, sub_language_identifier ) \ ( ( ( (WORD) ( sub_language_identifier ) ) << 10 ) | (WORD) ( primary_language_identifier ) ) #endif #if !defined( LANG_NEUTRAL ) #define LANG_NEUTRAL 0 #endif #if !defined( SUBLANG_DEFAULT ) #define SUBLANG_DEFAULT 1 #endif #endif /* defined( WINAPI ) */ #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of FormatMessageA * Returns the number of printed characters without the end-of-string character or 0 on error */ DWORD libcerror_FormatMessageA( DWORD flags, LPCVOID source, DWORD message_identifier, DWORD language_identifier, LPCSTR string, DWORD string_size, va_list *argument_list ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD print_count = 0; if( string == NULL ) { return( 0 ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "FormatMessageA" ); if( function != NULL ) { print_count = function( flags, source, message_identifier, language_identifier, string, string_size, argument_list ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { print_count = 0; } return( print_count ); } /* Cross Windows safe version of FormatMessageW * Returns the number of printed characters without the end-of-string character or 0 on error */ DWORD libcerror_FormatMessageW( DWORD flags, LPCVOID source, DWORD message_identifier, DWORD language_identifier, LPWSTR string, DWORD string_size, va_list *argument_list ) { FARPROC function = NULL; HMODULE library_handle = NULL; DWORD print_count = 0; if( string == NULL ) { return( 0 ); } library_handle = LoadLibrary( _SYSTEM_STRING( "kernel32.dll" ) ); if( library_handle == NULL ) { return( 0 ); } function = GetProcAddress( library_handle, (LPCSTR) "FormatMessageW" ); if( function != NULL ) { print_count = function( flags, source, message_identifier, language_identifier, string, string_size, argument_list ); } /* This call should be after using the function * in most cases kernel32.dll will still be available after free */ if( FreeLibrary( library_handle ) != TRUE ) { print_count = 0; } return( print_count ); } #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ #if defined( WINAPI ) #if ( WINVER <= 0x0500 ) #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #define libcerror_system_FormatMessage libcerror_FormatMessageW #else #define libcerror_system_FormatMessage libcerror_FormatMessageA #endif #else #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #define libcerror_system_FormatMessage FormatMessageW #else #define libcerror_system_FormatMessage FormatMessageA #endif #endif /* ( WINVER <= 0x0500 ) */ /* Retrieves a descriptive string of the error number * This function uses the WINAPI functions for Windows XP or later * Returns the string_length if successful or -1 on error */ int libcerror_system_copy_string_from_error_number( system_character_t *string, size_t string_size, uint32_t error_number ) { DWORD print_count = 0; if( string == NULL ) { return( -1 ); } if( string_size > (size_t) INT_MAX ) { return( -1 ); } print_count = libcerror_system_FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD) error_number, MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), string, (DWORD) string_size, NULL ); if( print_count == 0 ) { return( -1 ); } return( (int) print_count ); } #elif defined( HAVE_STRERROR_R ) #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #error Missing wide character strerror_r function #endif /* Retrieves a descriptive string of the error number * This function uses the POSIX strerror_r function or equivalent * Returns the string_length if successful or -1 on error */ int libcerror_system_copy_string_from_error_number( system_character_t *string, size_t string_size, uint32_t error_number ) { size_t string_length = 0; if( string == NULL ) { return( -1 ); } if( string_size > (size_t) INT_MAX ) { return( -1 ); } #if defined( STRERROR_R_CHAR_P ) if( strerror_r( (int) error_number, string, string_size ) == NULL ) #else if( strerror_r( (int) error_number, string, string_size ) != 0 ) #endif { return( -1 ); } string[ string_size - 1 ] = (system_character_t) 0; string_length = system_string_length( string ); return( (int) string_length ); } #elif defined( HAVE_STRERROR ) #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #error Missing wide character strerror function #endif /* Retrieves a descriptive string of the error number * This function uses the POSIX strerror function or equivalent * Returns the string_length if successful or -1 on error */ int libcerror_system_copy_string_from_error_number( system_character_t *string, size_t string_size, uint32_t error_number ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) const wchar_t *static_error_string = NULL; #else const char *static_error_string = NULL; #endif size_t static_error_string_length = 0; if( string == NULL ) { return( -1 ); } if( string_size > (size_t) INT_MAX ) { return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) static_error_string = _wcserror( (int) error_number ); #else static_error_string = strerror( (int) error_number ); #endif if( static_error_string == NULL ) { return( -1 ); } static_error_string_length = system_string_length( static_error_string ); if( system_string_copy( string, static_error_string, static_error_string_length ) == NULL ) { return( -1 ); } string[ static_error_string_length ] = 0; return( (int) static_error_string_length ); } #else #error Missing error to string system function #endif #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, error, error_domain, error_code, system_error_code, type, argument ) \ function( error, error_domain, error_code, system_error_code, type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, error, error_domain, error_code, system_error_code, type, argument ) \ function( error, error_domain, error_code, system_error_code, va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* Sets an error and adds a system specific error string if possible * Creates the error if necessary * The error domain and code are set only the first time and the error message is appended for back tracing */ void VARARGS( libcerror_system_set_error, libcerror_error_t **error, int error_domain, int error_code, uint32_t system_error_code, const char *, format_string ) { va_list argument_list; libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; system_character_t *system_format_string = NULL; void *reallocation = NULL; size_t error_string_size = 0; size_t format_string_length = 0; size_t message_size = 0; size_t next_message_size = LIBCERROR_MESSAGE_INCREMENT_SIZE; size_t string_index = 0; int message_index = 0; int print_count = 0; if( error == NULL ) { return; } if( format_string == NULL ) { return; } format_string_length = narrow_string_length( format_string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcerror_error_get_system_format_string( format_string, format_string_length, &system_format_string ); if( system_format_string == NULL ) { return; } #else system_format_string = (system_character_t *) format_string; #endif if( *error == NULL ) { if( libcerror_error_initialize( error, error_domain, error_code ) != 1 ) { goto on_error; } } internal_error = (libcerror_internal_error_t *) *error; if( libcerror_error_resize( internal_error ) != 1 ) { goto on_error; } if( format_string_length > next_message_size ) { next_message_size = ( ( format_string_length / LIBCERROR_MESSAGE_INCREMENT_SIZE ) + 1 ) * LIBCERROR_MESSAGE_INCREMENT_SIZE; } message_index = internal_error->number_of_messages - 1; error_string = internal_error->messages[ message_index ]; do { if( next_message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { next_message_size = LIBCERROR_MESSAGE_MAXIMUM_SIZE; } reallocation = memory_reallocate( error_string, sizeof( system_character_t ) * next_message_size ); if( reallocation == NULL ) { memory_free( error_string ); goto on_error; } error_string = (system_character_t *) reallocation; message_size = next_message_size; /* argument_list cannot be reused in successive calls to vsnprintf */ VASTART( argument_list, const char *, format_string ); print_count = system_string_vsnprintf( error_string, message_size, system_format_string, argument_list ); VAEND( argument_list ); if( print_count <= -1 ) { next_message_size += LIBCERROR_MESSAGE_INCREMENT_SIZE; } else if( ( (size_t) print_count >= message_size ) || ( error_string[ print_count ] != (system_character_t) 0 ) ) { next_message_size = (size_t) ( print_count + 1 ); print_count = -1; } else { error_string_size = (size_t) print_count + 1; } if( message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { break; } } while( print_count <= -1 ); if( message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 4 ] = (system_character_t) '.'; error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 3 ] = (system_character_t) '.'; error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 2 ] = (system_character_t) '.'; error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 1 ] = 0; error_string_size = (size_t) LIBCERROR_MESSAGE_MAXIMUM_SIZE; } internal_error->messages[ message_index ] = error_string; internal_error->sizes[ message_index ] = error_string_size; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) memory_free( system_format_string ); system_format_string = NULL; #endif message_size = internal_error->sizes[ message_index ]; if( message_size < LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { /* TODO move to separate helper function */ string_index = internal_error->sizes[ message_index ] - 1; if( ( internal_error->messages[ message_index ] != NULL ) && ( ( internal_error->messages[ message_index ] )[ string_index - 1 ] == (system_character_t) '.' ) ) { string_index -= 1; } reallocation = memory_reallocate( internal_error->messages[ message_index ], sizeof( system_character_t ) * ( message_size + 13 + 512 ) ); if( reallocation == NULL ) { memory_free( internal_error->messages[ message_index ] ); internal_error->messages[ message_index ] = NULL; goto on_error; } internal_error->messages[ message_index ] = (system_character_t *) reallocation; if( system_string_copy( &( ( internal_error->messages[ message_index ] )[ string_index ] ), _SYSTEM_STRING( " with error: " ), 13 ) == NULL ) { memory_free( internal_error->messages[ message_index ] ); internal_error->messages[ message_index ] = NULL; goto on_error; } internal_error->sizes[ message_index ] += 13; string_index += 13; print_count = libcerror_system_copy_string_from_error_number( &( ( internal_error->messages[ message_index ] )[ string_index ] ), 512, system_error_code ); if( print_count == -1 ) { goto on_error; } message_size += (size_t) print_count; internal_error->sizes[ message_index ] += print_count; } if( internal_error->sizes[ message_index ] >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { internal_error->messages[ message_index ][ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 4 ] = (system_character_t) '.'; internal_error->messages[ message_index ][ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 3 ] = (system_character_t) '.'; internal_error->messages[ message_index ][ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 2 ] = (system_character_t) '.'; internal_error->messages[ message_index ][ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 1 ] = 0; internal_error->sizes[ message_index ] = (size_t) LIBCERROR_MESSAGE_MAXIMUM_SIZE; } return; on_error: #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_format_string != NULL ) { memory_free( system_format_string ); } #endif return; } #undef VARARGS #undef VASTART #undef VAEND libewf-20140807/libcerror/libcerror_error.c0000664000175000017500000004577113443450027022674 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #include #include #include #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #include #elif defined( HAVE_VARARGS_H ) #include #else #error Missing headers stdarg.h and varargs.h #endif #include #include "libcerror_definitions.h" #include "libcerror_error.h" #include "libcerror_types.h" /* Creates an error * Returns 1 if successful or -1 on error */ int libcerror_error_initialize( libcerror_error_t **error, int error_domain, int error_code ) { libcerror_internal_error_t *internal_error = NULL; if( error == NULL ) { return( -1 ); } if( *error != NULL ) { return( -1 ); } internal_error = memory_allocate_structure( libcerror_internal_error_t ); if( internal_error == NULL ) { return( -1 ); } internal_error->domain = error_domain; internal_error->code = error_code; internal_error->number_of_messages = 0; internal_error->messages = NULL; internal_error->sizes = NULL; *error = (libcerror_error_t *) internal_error; return( 1 ); } /* Free an error and its elements */ void libcerror_error_free( libcerror_error_t **error ) { libcerror_internal_error_t *internal_error = NULL; int message_index = 0; if( error == NULL ) { return; } if( *error != NULL ) { internal_error = (libcerror_internal_error_t *) *error; if( internal_error->messages != NULL ) { for( message_index = 0; message_index < internal_error->number_of_messages; message_index++ ) { if( internal_error->messages[ message_index ] != NULL ) { memory_free( internal_error->messages[ message_index ] ); } } memory_free( internal_error->messages ); } if( internal_error->sizes != NULL ) { memory_free( internal_error->sizes ); } memory_free( *error ); *error = NULL; } } /* Resizes an error * Returns 1 if successful or -1 on error */ int libcerror_error_resize( libcerror_internal_error_t *internal_error ) { void *reallocation = NULL; int message_index = 0; int number_of_messages = 0; if( internal_error == NULL ) { return( -1 ); } message_index = internal_error->number_of_messages; number_of_messages = internal_error->number_of_messages + 1; reallocation = memory_reallocate( internal_error->messages, sizeof( system_character_t * ) * number_of_messages ); if( reallocation == NULL ) { return( -1 ); } internal_error->messages = (system_character_t **) reallocation; internal_error->messages[ message_index ] = NULL; reallocation = memory_reallocate( internal_error->sizes, sizeof( size_t ) * number_of_messages ); if( reallocation == NULL ) { return( -1 ); } internal_error->sizes = (size_t *) reallocation; internal_error->sizes[ message_index ] = 0; internal_error->number_of_messages += 1; return( 1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) /* Retrieves the format string as a system string */ void libcerror_error_get_system_format_string( const char *format_string, size_t format_string_length, system_character_t **system_format_string ) { void *reallocation = NULL; size_t next_format_string_length = 0; int print_count = 0; #if defined( __BORLANDC__ ) || defined( _MSC_VER ) size_t string_index = 0; #endif if( format_string == NULL ) { return; } if( format_string_length > (size_t) SSIZE_MAX ) { return; } if( system_format_string == NULL ) { return; } next_format_string_length = format_string_length + 1; do { if( next_format_string_length >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { next_format_string_length = LIBCERROR_MESSAGE_MAXIMUM_SIZE; } reallocation = memory_reallocate( *system_format_string, sizeof( system_character_t ) * next_format_string_length ); if( reallocation == NULL ) { memory_free( *system_format_string ); *system_format_string = NULL; return; } *system_format_string = (system_character_t *) reallocation; format_string_length = next_format_string_length; #if defined( __BORLANDC__ ) || defined( _MSC_VER ) print_count = wide_string_snwprintf( *system_format_string, format_string_length, L"%S", format_string ); #else print_count = wide_string_snwprintf( *system_format_string, format_string_length, L"%s", format_string ); #endif if( print_count <= -1 ) { next_format_string_length += LIBCERROR_MESSAGE_INCREMENT_SIZE; } else if( ( (size_t) print_count > format_string_length ) || ( ( *system_format_string )[ print_count ] != 0 ) ) { next_format_string_length = (size_t) print_count; print_count = -1; } if( next_format_string_length >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { /* TODO handle similar to error string */ memory_free( *system_format_string ); *system_format_string = NULL; return; } } while( print_count <= -1 ); #if defined( __BORLANDC__ ) || defined( _MSC_VER ) /* Rewrite %s to %S */ string_index = 0; while( string_index < format_string_length ) { if( ( *system_format_string )[ string_index ] == 0 ) { break; } else if( ( *system_format_string )[ string_index ] == (system_character_t) '%' ) { string_index++; if( ( *system_format_string )[ string_index ] == (system_character_t) 's' ) { ( *system_format_string )[ string_index ] = (system_character_t) 'S'; } } string_index++; } #endif /* defined( __BORLANDC__ ) || defined( _MSC_VER ) */ } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, error, error_domain, error_code, type, argument ) \ function( error, error_domain, error_code, type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, error, error_domain, error_code, type, argument ) \ function( error, error_domain, error_code, va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* defined( HAVE_STDARG_H ) || defined( WINAPI ) */ /* Sets an error * Creates the error if necessary * The error domain and code are set only the first time and the error message is appended for back tracing */ void VARARGS( libcerror_error_set, libcerror_error_t **error, int error_domain, int error_code, const char *, format_string ) { va_list argument_list; libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; system_character_t *system_format_string = NULL; void *reallocation = NULL; size_t error_string_size = 0; size_t format_string_length = 0; size_t message_size = 0; size_t next_message_size = LIBCERROR_MESSAGE_INCREMENT_SIZE; int message_index = 0; int print_count = 0; if( error == NULL ) { return; } if( format_string == NULL ) { return; } format_string_length = narrow_string_length( format_string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcerror_error_get_system_format_string( format_string, format_string_length, &system_format_string ); if( system_format_string == NULL ) { return; } #else system_format_string = (system_character_t *) format_string; #endif if( *error == NULL ) { if( libcerror_error_initialize( error, error_domain, error_code ) != 1 ) { goto on_error; } } internal_error = (libcerror_internal_error_t *) *error; if( libcerror_error_resize( internal_error ) != 1 ) { goto on_error; } if( format_string_length > next_message_size ) { next_message_size = ( ( format_string_length / LIBCERROR_MESSAGE_INCREMENT_SIZE ) + 1 ) * LIBCERROR_MESSAGE_INCREMENT_SIZE; } message_index = internal_error->number_of_messages - 1; error_string = internal_error->messages[ message_index ]; do { if( next_message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { next_message_size = LIBCERROR_MESSAGE_MAXIMUM_SIZE; } reallocation = memory_reallocate( error_string, sizeof( system_character_t ) * next_message_size ); if( reallocation == NULL ) { memory_free( error_string ); goto on_error; } error_string = (system_character_t *) reallocation; message_size = next_message_size; /* argument_list cannot be reused in successive calls to vsnprintf */ VASTART( argument_list, const char *, format_string ); print_count = system_string_vsnprintf( error_string, message_size, system_format_string, argument_list ); VAEND( argument_list ); if( print_count <= -1 ) { next_message_size += LIBCERROR_MESSAGE_INCREMENT_SIZE; } else if( ( (size_t) print_count >= message_size ) || ( error_string[ print_count ] != (system_character_t) 0 ) ) { next_message_size = (size_t) ( print_count + 1 ); print_count = -1; } else { error_string_size = (size_t) print_count + 1; } if( message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { break; } } while( print_count <= -1 ); if( message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) { error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 4 ] = (system_character_t) '.'; error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 3 ] = (system_character_t) '.'; error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 2 ] = (system_character_t) '.'; error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 1 ] = 0; error_string_size = (size_t) LIBCERROR_MESSAGE_MAXIMUM_SIZE; } internal_error->messages[ message_index ] = error_string; internal_error->sizes[ message_index ] = error_string_size; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) memory_free( system_format_string ); system_format_string = NULL; #endif return; on_error: #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( system_format_string != NULL ) { memory_free( system_format_string ); } #endif return; } #undef VARARGS #undef VASTART #undef VAEND /* Determines if an error equals a certain error code of a domain * Returns 1 if error matches or 0 if not */ int libcerror_error_matches( libcerror_error_t *error, int error_domain, int error_code ) { if( error == NULL ) { return( 0 ); } if( ( ( (libcerror_internal_error_t *) error )->domain == error_domain ) && ( ( (libcerror_internal_error_t *) error )->code == error_code ) ) { return( 1 ); } return( 0 ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcerror_error_fprint( libcerror_error_t *error, FILE *stream ) { libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; int message_index = 0; int print_count = 0; #if defined( WINAPI ) const char *format_string = "%" PRIs_SYSTEM "\r\n"; #else const char *format_string = "%" PRIs_SYSTEM "\n"; #endif if( error == NULL ) { return( -1 ); } internal_error = (libcerror_internal_error_t *) error; if( internal_error->messages == NULL ) { return( -1 ); } if( stream == NULL ) { return( -1 ); } message_index = internal_error->number_of_messages - 1; error_string = internal_error->messages[ message_index ]; if( error_string != NULL ) { print_count = fprintf( stream, format_string, error_string ); if( print_count <= -1 ) { return( -1 ); } } return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcerror_error_sprint( libcerror_error_t *error, char *string, size_t size ) { libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; size_t print_count = 0; size_t message_index = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) size_t error_string_size = 0; #endif if( error == NULL ) { return( -1 ); } internal_error = (libcerror_internal_error_t *) error; if( internal_error->messages == NULL ) { return( -1 ); } if( internal_error->sizes == NULL ) { return( -1 ); } if( string == NULL ) { return( -1 ); } #if INT_MAX < SSIZE_MAX if( size > (size_t) INT_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { return( -1 ); } message_index = internal_error->number_of_messages - 1; error_string = internal_error->messages[ message_index ]; if( error_string != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( _MSC_VER ) if( wcstombs_s( &print_count, string, size, error_string, _TRUNCATE ) != 0 ) { return( -1 ); } #else print_count = wcstombs( string, error_string, size ); if( print_count == (size_t) -1 ) { return( -1 ); } #endif /* defined( _MSC_VER ) */ if( print_count >= size ) { return( -1 ); } #else error_string_size = internal_error->sizes[ message_index ]; if( size < ( error_string_size + 1 ) ) { return( -1 ); } if( narrow_string_copy( string, error_string, error_string_size ) == NULL ) { return( -1 ); } print_count = error_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ } if( print_count > (size_t) INT_MAX ) { return( -1 ); } return( (int) print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcerror_error_backtrace_fprint( libcerror_error_t *error, FILE *stream ) { libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; int message_index = 0; int print_count = 0; int total_print_count = 0; #if defined( WINAPI ) const char *format_string = "%" PRIs_SYSTEM "\r\n"; #else const char *format_string = "%" PRIs_SYSTEM "\n"; #endif if( error == NULL ) { return( -1 ); } internal_error = (libcerror_internal_error_t *) error; if( internal_error->messages == NULL ) { return( -1 ); } if( stream == NULL ) { return( -1 ); } for( message_index = 0; message_index < internal_error->number_of_messages; message_index++ ) { error_string = internal_error->messages[ message_index ]; if( error_string != NULL ) { print_count = fprintf( stream, format_string, error_string ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; } } return( total_print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcerror_error_backtrace_sprint( libcerror_error_t *error, char *string, size_t size ) { libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; size_t string_index = 0; int message_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) size_t print_count = 0; #else size_t error_string_size = 0; #endif if( error == NULL ) { return( -1 ); } internal_error = (libcerror_internal_error_t *) error; if( internal_error->messages == NULL ) { return( -1 ); } if( internal_error->sizes == NULL ) { return( -1 ); } if( string == NULL ) { return( -1 ); } #if INT_MAX < SSIZE_MAX if( size > (size_t) INT_MAX ) #else if( size > (size_t) SSIZE_MAX ) #endif { return( -1 ); } for( message_index = 0; message_index < internal_error->number_of_messages; message_index++ ) { error_string = internal_error->messages[ message_index ]; if( error_string != NULL ) { if( string_index > 0 ) { #if defined( WINAPI ) if( ( string_index + 2 ) >= size ) { return( -1 ); } string[ string_index++ ] = (system_character_t) '\r'; #else if( ( string_index + 1 ) >= size ) { return( -1 ); } #endif /* defined( WINAPI ) */ string[ string_index++ ] = (system_character_t) '\n'; string[ string_index ] = (system_character_t) 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( _MSC_VER ) if( wcstombs_s( &print_count, &( string[ string_index ] ), size - string_index, error_string, _TRUNCATE ) != 0 ) { return( -1 ); } #else print_count = wcstombs( &( string[ string_index ] ), error_string, size - string_index ); if( print_count == (size_t) -1 ) { return( -1 ); } #endif /*defined( _MSC_VER ) */ string_index += print_count; if( string_index >= size ) { return( -1 ); } if( string[ string_index - 1 ] == 0 ) { string_index--; } #else error_string_size = internal_error->sizes[ message_index ]; if( size < ( string_index + error_string_size + 1 ) ) { return( -1 ); } if( narrow_string_copy( &( string[ string_index ] ), error_string, error_string_size ) == NULL ) { return( -1 ); } string_index += error_string_size - 1; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ } } string_index++; if( string_index > (size_t) INT_MAX ) { return( -1 ); } return( (int) string_index ); } libewf-20140807/libcerror/libcerror_extern.h0000664000175000017500000000242213443450027023037 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2008-2018, 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( _LIBCERROR_INTERNAL_EXTERN_H ) #define _LIBCERROR_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if !defined( HAVE_LOCAL_LIBCERROR ) #include #define LIBCERROR_EXTERN_VARIABLE LIBCERROR_EXTERN #else #define LIBCERROR_EXTERN /* extern */ #define LIBCERROR_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCERROR_INTERNAL_EXTERN_H ) */ libewf-20140807/libcerror/Makefile.am0000664000175000017500000000113513443450027021352 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCERROR AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common noinst_LTLIBRARIES = libcerror.la libcerror_la_SOURCES = \ libcerror_definitions.h \ libcerror_extern.h \ libcerror_error.c libcerror_error.h \ libcerror_support.c libcerror_support.h \ libcerror_system.c libcerror_system.h \ libcerror_types.h \ libcerror_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcerror ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcerror_la_SOURCES) libewf-20140807/libcerror/libcerror_error.h0000664000175000017500000000550213443450027022665 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2018, 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( _LIBCERROR_INTERNAL_ERROR_H ) #define _LIBCERROR_INTERNAL_ERROR_H #include #include #include #include "libcerror_extern.h" #include "libcerror_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcerror_internal_error libcerror_internal_error_t; struct libcerror_internal_error { /* The error domain */ int domain; /* The error code */ int code; /* The number of messages */ int number_of_messages; /* A dynamic array containing the message strings */ system_character_t **messages; /* A dynamic array containing the message string sizes * without the end-of-string character */ size_t *sizes; }; int libcerror_error_initialize( libcerror_error_t **error, int error_domain, int error_code ); LIBCERROR_EXTERN \ void libcerror_error_free( libcerror_error_t **error ); int libcerror_error_resize( libcerror_internal_error_t *internal_error ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) void libcerror_error_get_system_format_string( const char *format_string, size_t format_string_length, system_character_t **system_format_string ); #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ LIBCERROR_EXTERN \ void libcerror_error_set( libcerror_error_t **error, int error_domain, int error_code, const char *format_string, ... ); LIBCERROR_EXTERN \ int libcerror_error_matches( libcerror_error_t *error, int error_domain, int error_code ); LIBCERROR_EXTERN \ int libcerror_error_fprint( libcerror_error_t *error, FILE *stream ); LIBCERROR_EXTERN \ int libcerror_error_sprint( libcerror_error_t *error, char *string, size_t size ); LIBCERROR_EXTERN \ int libcerror_error_backtrace_fprint( libcerror_error_t *error, FILE *stream ); LIBCERROR_EXTERN \ int libcerror_error_backtrace_sprint( libcerror_error_t *error, char *string, size_t size ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCERROR_INTERNAL_ERROR_H ) */ libewf-20140807/libcerror/libcerror_support.h0000664000175000017500000000233013443450027023244 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2018, 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( _LIBCERROR_SUPPORT_H ) #define _LIBCERROR_SUPPORT_H #include #include #include "libcerror_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCERROR ) LIBCERROR_EXTERN \ const char *libcerror_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCERROR ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCERROR_SUPPORT_H ) */ libewf-20140807/libcerror/libcerror_types.h0000664000175000017500000000276413443450027022707 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2008-2018, 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( _LIBCERROR_INTERNAL_TYPES_H ) #define _LIBCERROR_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror * The definitions in are copied here * for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) /* The following type definitions hide internal data structures */ typedef intptr_t libcerror_error_t; /* Currently not supported #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libcerror_error {} libcerror_error_t; #else typedef intptr_t libcerror_error_t; #endif */ #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCERROR_INTERNAL_TYPES_H ) */ libewf-20140807/libcerror/libcerror_definitions.h0000664000175000017500000001671713443450027024061 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2008-2018, 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( LIBCERROR_INTERNAL_DEFINITIONS_H ) #define LIBCERROR_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if !defined( HAVE_LOCAL_LIBCERROR ) #include /* The definitions in are copied here * for local use of libcerror */ #else #define LIBCERROR_VERSION 20181117 /* The libcerror version string */ #define LIBCERROR_VERSION_STRING "20181117" /* The error domains */ enum LIBCERROR_ERROR_DOMAINS { LIBCERROR_ERROR_DOMAIN_ARGUMENTS = (int) 'a', LIBCERROR_ERROR_DOMAIN_CONVERSION = (int) 'c', LIBCERROR_ERROR_DOMAIN_COMPRESSION = (int) 'C', LIBCERROR_ERROR_DOMAIN_ENCRYPTION = (int) 'E', LIBCERROR_ERROR_DOMAIN_IO = (int) 'I', LIBCERROR_ERROR_DOMAIN_INPUT = (int) 'i', LIBCERROR_ERROR_DOMAIN_MEMORY = (int) 'm', LIBCERROR_ERROR_DOMAIN_OUTPUT = (int) 'o', LIBCERROR_ERROR_DOMAIN_RUNTIME = (int) 'r', }; /* The argument error codes * to signify errors regarding arguments passed to a function */ enum LIBCERROR_ARGUMENT_ERROR { LIBCERROR_ARGUMENT_ERROR_GENERIC = 0, /* The argument contains an invalid value */ LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE = 1, /* The argument contains a value less than zero */ LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO = 2, /* The argument contains a value zero or less */ LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS = 3, /* The argument contains a value that exceeds the maximum * for the specific type */ LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM = 4, /* The argument contains a value that is too small */ LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL = 5, /* The argument contains a value that is too large */ LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE = 6, /* The argument contains a value that is out of bound */ LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS = 7, /* The argument contains a value that is not supported */ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE = 8, /* The argument contains a value that conficts with another argument */ LIBCERROR_ARGUMENT_ERROR_CONFLICTING_VALUE = 9 }; /* The conversion error codes * to signify errors regarding conversions */ enum LIBCERROR_CONVERSION_ERROR { LIBCERROR_CONVERSION_ERROR_GENERIC = 0, /* The conversion failed on the input */ LIBCERROR_CONVERSION_ERROR_INPUT_FAILED = 1, /* The conversion failed on the output */ LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED = 2 }; /* The compression error codes * to signify errors regarding compression */ enum LIBCERROR_COMPRESSION_ERROR { LIBCERROR_COMPRESSION_ERROR_GENERIC = 0, /* The compression failed */ LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED = 1, /* The decompression failed */ LIBCERROR_COMPRESSION_ERROR_DECOMPRESS_FAILED = 2 }; /* The encryption error codes * to signify errors regarding encryption */ enum LIBCERROR_ENCRYPTION_ERROR { LIBCERROR_ENCRYPTION_ERROR_GENERIC = 0, /* The encryption failed */ LIBCERROR_ENCRYPTION_ERROR_ENCRYPT_FAILED = 1, /* The decryption failed */ LIBCERROR_ENCRYPTION_ERROR_DECRYPT_FAILED = 2 }; /* The input/output error codes * to signify errors regarding input/output */ enum LIBCERROR_IO_ERROR { LIBCERROR_IO_ERROR_GENERIC = 0, /* The open failed */ LIBCERROR_IO_ERROR_OPEN_FAILED = 1, /* The close failed */ LIBCERROR_IO_ERROR_CLOSE_FAILED = 2, /* The seek failed */ LIBCERROR_IO_ERROR_SEEK_FAILED = 3, /* The read failed */ LIBCERROR_IO_ERROR_READ_FAILED = 4, /* The write failed */ LIBCERROR_IO_ERROR_WRITE_FAILED = 5, /* Access denied */ LIBCERROR_IO_ERROR_ACCESS_DENIED = 6, /* The resource is invalid i.e. a missing file */ LIBCERROR_IO_ERROR_INVALID_RESOURCE = 7, /* The ioctl failed */ LIBCERROR_IO_ERROR_IOCTL_FAILED = 8, /* The unlink failed */ LIBCERROR_IO_ERROR_UNLINK_FAILED = 9 }; /* The input error codes * to signify errors regarding handing input data */ enum LIBCERROR_INPUT_ERROR { LIBCERROR_INPUT_ERROR_GENERIC = 0, /* The input contains invalid data */ LIBCERROR_INPUT_ERROR_INVALID_DATA = 1, /* The input contains an unsupported signature */ LIBCERROR_INPUT_ERROR_SIGNATURE_MISMATCH = 2, /* A checksum in the input did not match */ LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH = 3, /* A value in the input did not match a previously * read value or calculated value */ LIBCERROR_INPUT_ERROR_VALUE_MISMATCH = 4 }; /* The memory error codes * to signify errors regarding memory */ enum LIBCERROR_MEMORY_ERROR { LIBCERROR_MEMORY_ERROR_GENERIC = 0, /* There is insufficient memory available */ LIBCERROR_MEMORY_ERROR_INSUFFICIENT = 1, /* The memory failed to be copied */ LIBCERROR_MEMORY_ERROR_COPY_FAILED = 2, /* The memory failed to be set */ LIBCERROR_MEMORY_ERROR_SET_FAILED = 3 }; /* The output error codes */ enum LIBCERROR_OUTPUT_ERROR { LIBCERROR_OUTPUT_ERROR_GENERIC = 0, /* There is insuficient space to write the output */ LIBCERROR_OUTPUT_ERROR_INSUFFICIENT_SPACE = 1 }; /* The runtime error codes * to signify errors regarding runtime processing */ enum LIBCERROR_RUNTIME_ERROR { LIBCERROR_RUNTIME_ERROR_GENERIC = 0, /* The value is missing */ LIBCERROR_RUNTIME_ERROR_VALUE_MISSING = 1, /* The value was already set */ LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET = 2, /* The creation and/or initialization of an internal structure failed */ LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED = 3, /* The resize of an internal structure failed */ LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED = 4, /* The free and/or finalization of an internal structure failed */ LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED = 5, /* The value could not be determined */ LIBCERROR_RUNTIME_ERROR_GET_FAILED = 6, /* The value could not be set */ LIBCERROR_RUNTIME_ERROR_SET_FAILED = 7, /* The value could not be appended/prepended */ LIBCERROR_RUNTIME_ERROR_APPEND_FAILED = 8, /* The value could not be copied */ LIBCERROR_RUNTIME_ERROR_COPY_FAILED = 9, /* The value could not be removed */ LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED = 10, /* The value could not be printed */ LIBCERROR_RUNTIME_ERROR_PRINT_FAILED = 11, /* The value was out of bounds */ LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS = 12, /* The value exceeds the maximum for its specific type */ LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM = 13, /* The value is unsupported */ LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE = 14, /* An aborted was requested */ LIBCERROR_RUNTIME_ERROR_ABORT_REQUESTED = 15 }; #endif /* !defined( HAVE_LOCAL_LIBCERROR ) */ #define LIBCERROR_MESSAGE_INCREMENT_SIZE 64 #define LIBCERROR_MESSAGE_MAXIMUM_SIZE 4096 #endif /* !defined( LIBCERROR_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libcerror/libcerror_unused.h0000664000175000017500000000255613443450027023045 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2008-2018, 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( _LIBCERROR_INTERNAL_UNUSED_H ) #define _LIBCERROR_INTERNAL_UNUSED_H #include #if !defined( LIBCERROR_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCERROR_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCERROR_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCERROR_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCERROR_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCERROR_INTERNAL_UNUSED_H ) */ libewf-20140807/libcerror/Makefile.in0000664000175000017500000010020513443455347021373 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcerror ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcerror_la_LIBADD = am__libcerror_la_SOURCES_DIST = libcerror_definitions.h \ libcerror_extern.h libcerror_error.c libcerror_error.h \ libcerror_support.c libcerror_support.h libcerror_system.c \ libcerror_system.h libcerror_types.h libcerror_unused.h @HAVE_LOCAL_LIBCERROR_TRUE@am_libcerror_la_OBJECTS = \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_error.lo \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_support.lo \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_system.lo libcerror_la_OBJECTS = $(am_libcerror_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCERROR_TRUE@am_libcerror_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcerror_error.Plo \ ./$(DEPDIR)/libcerror_support.Plo \ ./$(DEPDIR)/libcerror_system.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcerror_la_SOURCES) DIST_SOURCES = $(am__libcerror_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCERROR_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCERROR_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCERROR_TRUE@ -I$(top_srcdir)/common @HAVE_LOCAL_LIBCERROR_TRUE@noinst_LTLIBRARIES = libcerror.la @HAVE_LOCAL_LIBCERROR_TRUE@libcerror_la_SOURCES = \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_definitions.h \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_extern.h \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_error.c libcerror_error.h \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_support.c libcerror_support.h \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_system.c libcerror_system.h \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_types.h \ @HAVE_LOCAL_LIBCERROR_TRUE@ libcerror_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcerror/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcerror/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcerror.la: $(libcerror_la_OBJECTS) $(libcerror_la_DEPENDENCIES) $(EXTRA_libcerror_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcerror_la_rpath) $(libcerror_la_OBJECTS) $(libcerror_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcerror_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcerror_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcerror_system.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcerror_error.Plo -rm -f ./$(DEPDIR)/libcerror_support.Plo -rm -f ./$(DEPDIR)/libcerror_system.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcerror ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcerror_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcerror/libcerror_support.c0000664000175000017500000000221013443450027023234 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include "libcerror_definitions.h" #include "libcerror_support.h" #if !defined( HAVE_LOCAL_LIBCERROR ) /* Returns the library version as a string */ const char *libcerror_get_version( void ) { return( (const char *) LIBCERROR_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCERROR ) */ libewf-20140807/libcerror/libcerror_system.h0000664000175000017500000000375413443450027023067 0ustar00lordyestalordyesta00000000000000/* * System functions * * Copyright (C) 2008-2018, 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( _LIBCERROR_SYSTEM_H ) #define _LIBCERROR_SYSTEM_H #include #include #include #include "libcerror_extern.h" #include "libcerror_types.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( WINAPI ) && ( WINVER <= 0x0500 ) DWORD libcerror_FormatMessageA( DWORD flags, LPCVOID source, DWORD message_identifier, DWORD language_identifier, LPCSTR string, DWORD string_size, va_list *argument_list ); DWORD libcerror_FormatMessageW( DWORD flags, LPCVOID source, DWORD message_identifier, DWORD language_identifier, LPWSTR string, DWORD string_size, va_list *argument_list ); #endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ int libcerror_system_copy_string_from_error_number( system_character_t *string, size_t string_size, uint32_t error_number ); LIBCERROR_EXTERN \ void libcerror_system_set_error( libcerror_error_t **error, int error_domain, int error_code, uint32_t system_error_code, const char *format_string, ... ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCERROR_SYSTEM_H ) */ libewf-20140807/libcnotify/0000775000175000017500000000000013443455445017506 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcnotify/libcnotify_libcerror.h0000664000175000017500000000252713443450036024061 0ustar00lordyestalordyesta00000000000000/* * The internal libcerror header * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_LIBCERROR_H ) #define _LIBCNOTIFY_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif #endif libewf-20140807/libcnotify/libcnotify_unused.h0000664000175000017500000000256613443450036023404 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_INTERNAL_UNUSED_H ) #define _LIBCNOTIFY_INTERNAL_UNUSED_H #include #if !defined( LIBCNOTIFY_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCNOTIFY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCNOTIFY_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCNOTIFY_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCNOTIFY_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCNOTIFY_INTERNAL_UNUSED_H ) */ libewf-20140807/libcnotify/libcnotify_support.h0000664000175000017500000000236413443450036023611 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_SUPPORT_H ) #define _LIBCNOTIFY_SUPPORT_H #include #include #include #include "libcnotify_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCNOTIFY ) LIBCNOTIFY_EXTERN \ const char *libcnotify_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCNOTIFY ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCNOTIFY_SUPPORT_H ) */ libewf-20140807/libcnotify/libcnotify_support.c0000664000175000017500000000221613443450036023600 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include "libcnotify_definitions.h" #include "libcnotify_support.h" #if !defined( HAVE_LOCAL_LIBCNOTIFY ) /* Returns the library version as a string */ const char *libcnotify_get_version( void ) { return( (const char *) LIBCNOTIFY_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCNOTIFY ) */ libewf-20140807/libcnotify/Makefile.am0000664000175000017500000000126413443450036021534 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCNOTIFY AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libcnotify.la libcnotify_la_SOURCES = \ libcnotify_definitions.h \ libcnotify_extern.h \ libcnotify_libcerror.h \ libcnotify_print.c libcnotify_print.h \ libcnotify_stream.c libcnotify_stream.h \ libcnotify_support.c libcnotify_support.h \ libcnotify_unused.h \ libcnotify_verbose.c libcnotify_verbose.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcnotify ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcnotify_la_SOURCES) libewf-20140807/libcnotify/libcnotify_print.c0000664000175000017500000001771113443450036023226 0ustar00lordyestalordyesta00000000000000/* * Notification print functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #include #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #include #elif defined( HAVE_VARARGS_H ) #include #else #error Missing headers stdarg.h and varargs.h #endif #include "libcnotify_definitions.h" #include "libcnotify_libcerror.h" #include "libcnotify_print.h" #include "libcnotify_stream.h" extern FILE *libcnotify_stream; #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, type, argument ) \ function( type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, type, argument ) \ function( va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* Print a formatted string on the notify stream * Returns the number of printed characters if successful or -1 on error */ int VARARGS( libcnotify_printf, const char *, format ) { va_list argument_list; int print_count = 0; if( libcnotify_stream == NULL ) { return( 0 ); } VASTART( argument_list, char *, format ); #if defined( HAVE_GLIB_H ) g_logv( G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, argument_list ); #else /* TODO handle narrow and wide streams * for multi platform support */ print_count = file_stream_vfprintf( libcnotify_stream, format, argument_list ); #endif VAEND( argument_list ); if( print_count <= -1 ) { return( -1 ); } return( print_count ); } #undef VARARGS #undef VASTART #undef VAEND /* Prints the data as a character on the notify stream * Returns the number of printed characters if successful or -1 on error */ int libcnotify_print_data_as_character( uint8_t data ) { int print_count = 0; if( ( data >= 0x20 ) && ( data <= 0x7e ) ) { print_count = libcnotify_printf( "%c", (char) data ); } else { print_count = libcnotify_printf( "." ); } return( print_count ); } /* Prints the first 16 bytes of data as a characters on the notify stream * Returns the number of printed characters if successful or -1 on error */ int libcnotify_print_data_as_characters( const uint8_t *data, size_t data_size, size_t data_offset ) { int print_count = 0; int total_print_count = 0; if( data == NULL ) { return( -1 ); } while( data_offset < data_size ) { print_count = libcnotify_print_data_as_character( data[ data_offset++ ] ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; if( ( data_offset % 16 == 0 ) || ( data_offset == data_size ) ) { break; } if( data_offset % 8 == 0 ) { print_count = libcnotify_printf( " " ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; } } return( total_print_count ); } /* Prints the first 16 bytes of data as a hexadecimal values on the notify stream * Returns the number of printed characters if successful or -1 on error */ int libcnotify_print_data_as_hexadecimal( const uint8_t *data, size_t data_size, size_t data_offset ) { int print_count = 0; int total_print_count = 0; if( data == NULL ) { return( -1 ); } while( data_offset < data_size ) { print_count = libcnotify_printf( "%.2" PRIx8 " ", data[ data_offset++ ] ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; if( data_offset % 16 == 0 ) { break; } else if( data_offset % 8 == 0 ) { print_count = libcnotify_printf( " " ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; } } while( data_offset % 16 != 0 ) { data_offset++; print_count = libcnotify_printf( " " ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; if( ( data_offset % 8 == 0 ) && ( data_offset % 16 != 0 ) ) { print_count = libcnotify_printf( " " ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; } } return( total_print_count ); } /* Prints the data on the notify stream * Returns the number of printed characters if successful or -1 on error */ int libcnotify_print_data( const uint8_t *data, size_t data_size, uint8_t print_data_flags ) { size_t data_offset = 0; int in_group = 0; int print_count = 0; int total_print_count = 0; if( libcnotify_stream == NULL ) { return( 0 ); } if( data == NULL ) { return( -1 ); } if( data_size > (size_t) SSIZE_MAX ) { return( -1 ); } while( data_offset < data_size ) { if( ( ( print_data_flags & LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA ) != 0 ) && ( data_size >= 32 ) && ( data_offset >= 16 ) && ( data_offset <= ( data_size - 32 ) ) ) { if( ( memory_compare( &( data[ data_offset - 16 ] ), &( data[ data_offset ] ), 16 ) == 0 ) && ( memory_compare( &( data[ data_offset + 16 ] ), &( data[ data_offset ] ), 16 ) == 0 ) ) { if( in_group == 0 ) { print_count = libcnotify_printf( "...\n" ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; in_group = 1; } data_offset += 16; continue; } in_group = 0; } if( data_offset % 16 == 0 ) { print_count = libcnotify_printf( "%.8" PRIzx ": ", data_offset ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; } print_count = libcnotify_print_data_as_hexadecimal( data, data_size, data_offset ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; print_count = libcnotify_printf( " " ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; print_count = libcnotify_print_data_as_characters( data, data_size, data_offset ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; print_count = libcnotify_printf( "\n" ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; data_offset += 16; } print_count = libcnotify_printf( "\n" ); if( print_count <= -1 ) { return( -1 ); } total_print_count += print_count; return( total_print_count ); } /* Prints the backtrace of the error on the notify stream * Returns the number of printed characters if successful or -1 on error */ int libcnotify_print_error_backtrace( libcerror_error_t *error ) { int print_count = 0; if( libcnotify_stream == NULL ) { return( 0 ); } print_count = libcerror_error_backtrace_fprint( error, libcnotify_stream ); return( print_count ); } libewf-20140807/libcnotify/libcnotify_verbose.c0000664000175000017500000000211013443450036023522 0ustar00lordyestalordyesta00000000000000/* * Verbose functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include "libcnotify_verbose.h" /* Value to indicate if the verbose notification is active */ int libcnotify_verbose = 0; /* Sets the verbose notification */ void libcnotify_verbose_set( int verbose ) { libcnotify_verbose = verbose; } libewf-20140807/libcnotify/libcnotify_stream.h0000664000175000017500000000264113443450036023366 0ustar00lordyestalordyesta00000000000000/* * Notification stream functions * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_STREAM_H ) #define _LIBCNOTIFY_STREAM_H #include #include #include #include "libcnotify_extern.h" #include "libcnotify_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif LIBCNOTIFY_EXTERN \ int libcnotify_stream_set( FILE *stream, libcerror_error_t **error ); LIBCNOTIFY_EXTERN \ int libcnotify_stream_open( const char *filename, libcerror_error_t **error ); LIBCNOTIFY_EXTERN \ int libcnotify_stream_close( libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCNOTIFY_STREAM_H ) */ libewf-20140807/libcnotify/libcnotify_extern.h0000664000175000017500000000257513443450036023406 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_INTERNAL_EXTERN_H ) #define _LIBCNOTIFY_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if !defined( HAVE_LOCAL_LIBCNOTIFY ) /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_EXPORT * before including libcnotify/extern.h */ #if defined( _WIN32 ) && defined( DLL_EXPORT ) #define LIBCNOTIFY_DLL_EXPORT #endif #include #else #define LIBCNOTIFY_EXTERN /* extern */ #endif /* !defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBCNOTIFY_INTERNAL_EXTERN_H ) */ libewf-20140807/libcnotify/libcnotify_stream.c0000664000175000017500000000766413443450036023373 0ustar00lordyestalordyesta00000000000000/* * Notification stream functions * * Copyright (C) 2008-2018, 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 . */ #include #include #include #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif #include "libcnotify_libcerror.h" #include "libcnotify_stream.h" /* The notification stream */ FILE *libcnotify_stream = NULL; /* Value to indicate if the notification stream * was opened by the library */ int libcnotify_stream_opened_in_library = 0; /* Set the stream * Returns 1 if successful or -1 on error */ int libcnotify_stream_set( FILE *stream, libcerror_error_t **error ) { static char *function = "libcnotify_stream_set"; if( libcnotify_stream_opened_in_library != 0 ) { if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to close notify stream.", function ); return( -1 ); } } libcnotify_stream = stream; return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libcnotify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libcnotify_stream_open"; if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( libcnotify_stream_opened_in_library != 0 ) { if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to close notify stream.", function ); return( -1 ); } } libcnotify_stream = file_stream_open( filename, FILE_STREAM_OPEN_APPEND ); if( libcnotify_stream == NULL ) { switch( errno ) { case EACCES: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_ACCESS_DENIED, "%s: access denied to file: %s.", function, filename ); break; case ENOENT: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_INVALID_RESOURCE, "%s: no such file: %s.", function, filename ); break; default: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %s.", function, filename ); break; } return( -1 ); } libcnotify_stream_opened_in_library = 1; return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libcnotify_stream_close( libcerror_error_t **error ) { static char *function = "libcnotify_stream_close"; if( libcnotify_stream_opened_in_library != 0 ) { if( file_stream_close( libcnotify_stream ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to close stream.", function ); return( -1 ); } libcnotify_stream = NULL; libcnotify_stream_opened_in_library = 0; } return( 0 ); } libewf-20140807/libcnotify/Makefile.in0000664000175000017500000010115313443455347021555 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcnotify ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcnotify_la_LIBADD = am__libcnotify_la_SOURCES_DIST = libcnotify_definitions.h \ libcnotify_extern.h libcnotify_libcerror.h libcnotify_print.c \ libcnotify_print.h libcnotify_stream.c libcnotify_stream.h \ libcnotify_support.c libcnotify_support.h libcnotify_unused.h \ libcnotify_verbose.c libcnotify_verbose.h @HAVE_LOCAL_LIBCNOTIFY_TRUE@am_libcnotify_la_OBJECTS = \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_print.lo \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_stream.lo \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_support.lo \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_verbose.lo libcnotify_la_OBJECTS = $(am_libcnotify_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCNOTIFY_TRUE@am_libcnotify_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcnotify_print.Plo \ ./$(DEPDIR)/libcnotify_stream.Plo \ ./$(DEPDIR)/libcnotify_support.Plo \ ./$(DEPDIR)/libcnotify_verbose.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcnotify_la_SOURCES) DIST_SOURCES = $(am__libcnotify_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCNOTIFY_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCNOTIFY_TRUE@noinst_LTLIBRARIES = libcnotify.la @HAVE_LOCAL_LIBCNOTIFY_TRUE@libcnotify_la_SOURCES = \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_definitions.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_extern.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_libcerror.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_print.c libcnotify_print.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_stream.c libcnotify_stream.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_support.c libcnotify_support.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_unused.h \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ libcnotify_verbose.c libcnotify_verbose.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcnotify/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcnotify/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcnotify.la: $(libcnotify_la_OBJECTS) $(libcnotify_la_DEPENDENCIES) $(EXTRA_libcnotify_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcnotify_la_rpath) $(libcnotify_la_OBJECTS) $(libcnotify_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnotify_print.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnotify_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnotify_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcnotify_verbose.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcnotify_print.Plo -rm -f ./$(DEPDIR)/libcnotify_stream.Plo -rm -f ./$(DEPDIR)/libcnotify_support.Plo -rm -f ./$(DEPDIR)/libcnotify_verbose.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcnotify ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcnotify_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcnotify/libcnotify_print.h0000664000175000017500000000327413443450036023232 0ustar00lordyestalordyesta00000000000000/* * Notification print functions * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_PRINT_H ) #define _LIBCNOTIFY_PRINT_H #include #include #include "libcnotify_extern.h" #include "libcnotify_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif LIBCNOTIFY_EXTERN \ int libcnotify_printf( const char *format, ... ); int libcnotify_print_data_as_character( uint8_t data ); int libcnotify_print_data_as_characters( const uint8_t *data, size_t data_size, size_t data_offset ); int libcnotify_print_data_as_hexadecimal( const uint8_t *data, size_t data_size, size_t data_offset ); LIBCNOTIFY_EXTERN \ int libcnotify_print_data( const uint8_t *data, size_t data_size, uint8_t print_data_flags ); LIBCNOTIFY_EXTERN \ int libcnotify_print_error_backtrace( libcerror_error_t *error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCNOTIFY_PRINT_H ) */ libewf-20140807/libcnotify/libcnotify_verbose.h0000664000175000017500000000234213443450036023536 0ustar00lordyestalordyesta00000000000000/* * Verbose functions * * Copyright (C) 2008-2018, 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( _LIBCNOTIFY_VERBOSE_H ) #define _LIBCNOTIFY_VERBOSE_H #include #include #include "libcnotify_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( __CYGWIN__ ) extern int libcnotify_verbose; #else int libcnotify_verbose; #endif LIBCNOTIFY_EXTERN \ void libcnotify_verbose_set( int verbose ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCNOTIFY_VERBOSE_H ) */ libewf-20140807/libcnotify/libcnotify_definitions.h0000664000175000017500000000273213443450036024407 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2008-2018, 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( LIBCNOTIFY_INTERNAL_DEFINITIONS_H ) #define LIBCNOTIFY_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if !defined( HAVE_LOCAL_LIBCNOTIFY ) #include /* The definitions in are copied here * for local use of libcnotify */ #else #define LIBCNOTIFY_VERSION 20180102 /* The libcnotify version string */ #define LIBCNOTIFY_VERSION_STRING "20180102" /* The print data flags */ enum LIBCNOTIFY_NOTIFY_PRINT_DATA_FLAGS { LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA = 0x01, }; #endif /* !defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif libewf-20140807/ltmain.sh0000644000175000017500000117106713443455336017176 0ustar00lordyestalordyesta00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program 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 General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libewf-20140807/compile0000755000175000017500000001632713443455347016732 0ustar00lordyestalordyesta00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libewf-20140807/config.rpath0000754000175000017500000004401211705465021017640 0ustar00lordyestalordyesta00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2010 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux* | k*bsd*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) library_names_spec='$libname.a' ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd1*) ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; nto-qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libewf-20140807/libewf.pc.in0000664000175000017500000000143413440663046017542 0ustar00lordyestalordyesta00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libewf Description: Library to access the Expert Witness Compression Format (EWF) Version: @VERSION@ Libs: -L${libdir} -lewf 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_libcrypto_pc_libs_private@ @ax_libcsplit_pc_libs_private@ @ax_libcthreads_pc_libs_private@ @ax_libfcache_pc_libs_private@ @ax_libfdata_pc_libs_private@ @ax_libfguid_pc_libs_private@ @ax_libfvalue_pc_libs_private@ @ax_libhmac_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ @ax_zlib_pc_libs_private@ Cflags: -I${includedir} libewf-20140807/po/0000775000175000017500000000000013443455447015764 5ustar00lordyestalordyesta00000000000000libewf-20140807/po/en@quot.header0000644000175000017500000000226311705465021020536 0ustar00lordyestalordyesta00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # libewf-20140807/po/Rules-quot0000644000175000017500000000340011705465021017746 0ustar00lordyestalordyesta00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header libewf-20140807/po/POTFILES.in0000644000175000017500000000007311426476153017533 0ustar00lordyestalordyesta00000000000000# List of source files which contain translatable strings. libewf-20140807/po/remove-potcdate.sin0000644000175000017500000000066011705465021021561 0ustar00lordyestalordyesta00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } libewf-20140807/po/Makevars.in0000644000175000017500000000342011426477165020062 0ustar00lordyestalordyesta00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = @PACKAGE@ # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Joachim Metz # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = @PACKAGE_BUGREPORT@ # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = libewf-20140807/po/ChangeLog0000644000175000017500000000006213154427377017532 0ustar00lordyestalordyesta000000000000002017-09-08 gettextize libewf-20140807/po/en@boldquot.header0000644000175000017500000000247111705465021021400 0ustar00lordyestalordyesta00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # libewf-20140807/po/quot.sed0000644000175000017500000000023111705465021017427 0ustar00lordyestalordyesta00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g libewf-20140807/po/Makevars0000664000175000017500000000342013443455443017453 0ustar00lordyestalordyesta00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = libewf # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Joachim Metz # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = joachim.metz@gmail.com # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = libewf-20140807/po/insert-header.sin0000644000175000017500000000124011705465021021210 0ustar00lordyestalordyesta00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } libewf-20140807/po/Makefile.in.in0000644000175000017500000003744211705465021020432 0ustar00lordyestalordyesta00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/po/boldquot.sed0000644000175000017500000000033111705465021020271 0ustar00lordyestalordyesta00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g libewf-20140807/ewftools/0000775000175000017500000000000013443455446017207 5ustar00lordyestalordyesta00000000000000libewf-20140807/ewftools/mount_file_system.h0000664000175000017500000000775613421020222023114 0ustar00lordyestalordyesta00000000000000/* * Mount file system * * Copyright (C) 2006-2019, 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( _MOUNT_FILE_SYSTEM_H ) #define _MOUNT_FILE_SYSTEM_H #include #include #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct mount_file_system mount_file_system_t; struct mount_file_system { /* The mounted timestamp */ uint64_t mounted_timestamp; /* The path prefix */ system_character_t *path_prefix; /* The path prefix size */ size_t path_prefix_size; /* The handle */ libewf_handle_t *ewf_handle; }; int mount_file_system_initialize( mount_file_system_t **file_system, libcerror_error_t **error ); int mount_file_system_free( mount_file_system_t **file_system, libcerror_error_t **error ); int mount_file_system_signal_abort( mount_file_system_t *file_system, libcerror_error_t **error ); int mount_file_system_set_handle( mount_file_system_t *file_system, libewf_handle_t *ewf_handle, libcerror_error_t **error ); int mount_file_system_get_handle( mount_file_system_t *file_system, libewf_handle_t **ewf_handle, libcerror_error_t **error ); int mount_file_system_set_path_prefix( mount_file_system_t *file_system, const system_character_t *path_prefix, size_t path_prefix_size, libcerror_error_t **error ); int mount_file_system_get_mounted_timestamp( mount_file_system_t *file_system, uint64_t *mounted_timestamp, libcerror_error_t **error ); int mount_file_system_get_number_of_handles( mount_file_system_t *file_system, int *number_of_handles, libcerror_error_t **error ); int mount_file_system_get_handle_by_index( mount_file_system_t *file_system, int handle_index, libewf_handle_t **ewf_handle, libcerror_error_t **error ); int mount_file_system_get_handle_by_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, libewf_handle_t **ewf_handle, libcerror_error_t **error ); int mount_file_system_get_path_from_handle_index( mount_file_system_t *file_system, int handle_index, system_character_t *path, size_t path_size, libcerror_error_t **error ); int mount_file_system_get_file_entry_path_from_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, system_character_t **file_entry_path, size_t *file_entry_path_size, libcerror_error_t **error ); int mount_file_system_get_file_entry_by_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, libewf_file_entry_t **ewf_file_entry, libcerror_error_t **error ); int mount_file_system_get_filename_from_name( mount_file_system_t *file_system, const system_character_t *name, size_t name_length, system_character_t **filename, size_t *filename_size, libcerror_error_t **error ); int mount_file_system_get_filename_from_file_entry( mount_file_system_t *file_system, libewf_file_entry_t *ewf_file_entry, system_character_t **filename, size_t *filename_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _MOUNT_FILE_SYSTEM_H ) */ libewf-20140807/ewftools/device_handle.h0000664000175000017500000001716713421024433022126 0ustar00lordyestalordyesta00000000000000/* * Device handle * * 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( _DEVICE_HANDLE_H ) #define _DEVICE_HANDLE_H #include #include #include "ewftools_libcerror.h" #include "ewftools_libodraw.h" #include "ewftools_libsmdev.h" #include "ewftools_libsmraw.h" #include "storage_media_buffer.h" #if defined( __cplusplus ) extern "C" { #endif /* The device handle type definitions */ enum DEVICE_HANDLE_TYPES { DEVICE_HANDLE_TYPE_DEVICE = (uint8_t) 'd', DEVICE_HANDLE_TYPE_FILE = (uint8_t) 'f', DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE = (uint8_t) 'o' }; /* The media type definitions */ enum DEVICE_HANDLE_MEDIA_TYPES { DEVICE_HANDLE_MEDIA_TYPE_REMOVABLE = 0x00, DEVICE_HANDLE_MEDIA_TYPE_FIXED = 0x01, DEVICE_HANDLE_MEDIA_TYPE_OPTICAL = 0x03, DEVICE_HANDLE_MEDIA_TYPE_MEMORY = 0x10 }; /* The (optical disc) track type definitions */ enum DEVICE_HANDLE_TRACK_TYPES { DEVICE_HANDLE_TRACK_TYPE_UNKNOWN, DEVICE_HANDLE_TRACK_TYPE_AUDIO, DEVICE_HANDLE_TRACK_TYPE_CDG, DEVICE_HANDLE_TRACK_TYPE_MODE1_2048, DEVICE_HANDLE_TRACK_TYPE_MODE1_2352, DEVICE_HANDLE_TRACK_TYPE_MODE2_2048, DEVICE_HANDLE_TRACK_TYPE_MODE2_2324, DEVICE_HANDLE_TRACK_TYPE_MODE2_2336, DEVICE_HANDLE_TRACK_TYPE_MODE2_2352, DEVICE_HANDLE_TRACK_TYPE_CDI_2336, DEVICE_HANDLE_TRACK_TYPE_CDI_2352, }; typedef struct device_handle device_handle_t; struct device_handle { /* The user input buffer */ system_character_t *input_buffer; /* The device handle type */ uint8_t type; /* The TOC filename */ system_character_t *toc_filename; /* The TOC filename size */ size_t toc_filename_size; /* libodraw input handle */ libodraw_handle_t *odraw_input_handle; /* libsmdev input handle */ libsmdev_handle_t *smdev_input_handle; /* libsmraw input handle */ libsmraw_handle_t *smraw_input_handle; /* The number of error retries */ uint8_t number_of_error_retries; /* Value to indicate the buffer should be zeroed on error */ uint8_t zero_buffer_on_error; /* The notification output stream */ FILE *notify_stream; }; const char *device_handle_get_track_type( uint8_t track_type ); int device_handle_initialize( device_handle_t **device_handle, libcerror_error_t **error ); int device_handle_free( device_handle_t **device_handle, libcerror_error_t **error ); int device_handle_signal_abort( device_handle_t *device_handle, libcerror_error_t **error ); int device_handle_open_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_open_smdev_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_open_odraw_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_open_smraw_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_close( device_handle_t *device_handle, libcerror_error_t **error ); ssize_t device_handle_read_buffer( device_handle_t *device_handle, uint8_t *buffer, size_t read_size, libcerror_error_t **error ); off64_t device_handle_seek_offset( device_handle_t *device_handle, off64_t offset, int whence, libcerror_error_t **error ); int device_handle_prompt_for_string( device_handle_t *device_handle, 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 system_character_t *request_string, libcerror_error_t **error ); int device_handle_prompt_for_zero_buffer_on_error( device_handle_t *device_handle, const system_character_t *request_string, libcerror_error_t **error ); int device_handle_get_type( device_handle_t *device_handle, uint8_t *type, libcerror_error_t **error ); int device_handle_get_media_size( device_handle_t *device_handle, size64_t *media_size, libcerror_error_t **error ); int device_handle_get_media_type( device_handle_t *device_handle, uint8_t *media_type, libcerror_error_t **error ); int device_handle_get_bytes_per_sector( device_handle_t *device_handle, uint32_t *bytes_per_sector, libcerror_error_t **error ); int device_handle_get_information_value( device_handle_t *device_handle, const uint8_t *information_value_identifier, size_t information_value_identifier_length, system_character_t *information_value, size_t information_value_size, libcerror_error_t **error ); int device_handle_get_number_of_sessions( device_handle_t *device_handle, int *number_of_sessions, libcerror_error_t **error ); int device_handle_get_session( device_handle_t *device_handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ); int device_handle_get_number_of_tracks( device_handle_t *device_handle, int *number_of_tracks, libcerror_error_t **error ); int device_handle_get_track( device_handle_t *device_handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, libcerror_error_t **error ); int device_handle_set_string( device_handle_t *device_handle, 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 system_character_t *string, libcerror_error_t **error ); int device_handle_set_error_values( device_handle_t *device_handle, size_t error_granularity, libcerror_error_t **error ); int device_handle_get_number_of_read_errors( device_handle_t *device_handle, int *number_of_errors, libcerror_error_t **error ); int device_handle_get_read_error( device_handle_t *device_handle, int index, off64_t *offset, size64_t *size, libcerror_error_t **error ); int device_handle_media_information_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ); int device_handle_read_errors_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ); int device_handle_sessions_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ); int device_handle_tracks_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/process_status.h0000664000175000017500000000641413421024433022426 0ustar00lordyestalordyesta00000000000000/* * Process status functions * * 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( _PROCESS_STATUS_H ) #define _PROCESS_STATUS_H #include #include #include "ewftools_libcdatetime.h" #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif enum PROCESS_STATUS { PROCESS_STATUS_ABORTED = (int) 'a', PROCESS_STATUS_COMPLETED = (int) 'c', PROCESS_STATUS_FAILED = (int) 'f' }; typedef struct process_status process_status_t; struct process_status { /* The status process string */ const system_character_t *status_process_string; /* The status update string */ const system_character_t *status_update_string; /* The status summary string */ const system_character_t *status_summary_string; /* The ouput stream */ FILE *output_stream; /* Value to indicate if the status information should be printed to the output stream */ uint8_t print_status_information; /* The start time elements */ libcdatetime_elements_t *start_time_elements; /* The current time elements */ libcdatetime_elements_t *current_time_elements; /* The last time elements */ libcdatetime_elements_t *last_time_elements; /* The last bytes total */ size64_t last_bytes_total; /* The last percentage */ int8_t last_percentage; }; int process_status_initialize( process_status_t **process_status, 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 ); int process_status_free( process_status_t **process_status, libcerror_error_t **error ); int process_status_start( process_status_t *process_status, libcerror_error_t **error ); int process_status_update( process_status_t *process_status, size64_t bytes_read, size64_t bytes_total, libcerror_error_t **error ); int process_status_update_unknown_total( process_status_t *process_status, size64_t bytes_read, libcerror_error_t **error ); int process_status_stop( process_status_t *process_status, size64_t bytes_total, int status, libcerror_error_t **error ); void process_status_timestamp_fprint( FILE *stream, int64_t number_of_seconds ); void process_status_bytes_per_second_fprint( FILE *stream, size64_t bytes, time_t seconds ); void process_status_bytes_fprint( FILE *stream, size64_t bytes ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/info_handle.c0000664000175000017500000031267513440663046021631 0ustar00lordyestalordyesta00000000000000/* * Info handle * * 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 . */ #include #include #include #include #include #include #include #if defined( HAVE_SYS_UTSNAME_H ) #include #endif #include "byte_size_string.h" #include "digest_hash.h" #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libcsplit.h" #include "ewftools_libewf.h" #include "guid.h" #include "info_handle.h" #include "platform.h" #define INFO_HANDLE_VALUE_SIZE 512 #define INFO_HANDLE_VALUE_IDENTIFIER_SIZE 64 #define INFO_HANDLE_NOTIFY_STREAM stdout #if !defined( USE_LIBEWF_GET_HASH_VALUE_MD5 ) && !defined( USE_LIBEWF_GET_MD5_HASH ) #define USE_LIBEWF_GET_HASH_VALUE_MD5 #endif /* Initializes the info handle * Returns 1 if successful or -1 on error */ int info_handle_initialize( info_handle_t **info_handle, libcerror_error_t **error ) { static char *function = "info_handle_initialize"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( *info_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid info handle value already set.", function ); return( -1 ); } *info_handle = memory_allocate_structure( info_handle_t ); if( *info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create info handle.", function ); goto on_error; } if( memory_set( *info_handle, 0, sizeof( info_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear info handle.", function ); goto on_error; } if( libewf_handle_initialize( &( ( *info_handle )->input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize input handle.", function ); goto on_error; } ( *info_handle )->output_format = INFO_HANDLE_OUTPUT_FORMAT_TEXT; ( *info_handle )->date_format = LIBEWF_DATE_FORMAT_CTIME; ( *info_handle )->header_codepage = LIBEWF_CODEPAGE_ASCII; ( *info_handle )->notify_stream = INFO_HANDLE_NOTIFY_STREAM; return( 1 ); on_error: if( *info_handle != NULL ) { memory_free( *info_handle ); *info_handle = NULL; } return( -1 ); } /* Frees the info handle and its elements * Returns 1 if successful or -1 on error */ int info_handle_free( info_handle_t **info_handle, libcerror_error_t **error ) { static char *function = "info_handle_free"; int result = 1; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( *info_handle != NULL ) { if( ( *info_handle )->input_handle != NULL ) { if( libewf_handle_free( &( ( *info_handle )->input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free input handle.", function ); result = -1; } } memory_free( *info_handle ); *info_handle = NULL; } return( result ); } /* Signals the info handle to abort * Returns 1 if successful or -1 on error */ int info_handle_signal_abort( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_signal_abort"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle != NULL ) { if( libewf_handle_signal_abort( info_handle->input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal input handle to abort.", function ); return( -1 ); } } return( 1 ); } /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int info_handle_set_maximum_number_of_open_handles( info_handle_t *info_handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { static char *function = "info_handle_set_maximum_number_of_open_handles"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( libewf_handle_set_maximum_number_of_open_handles( info_handle->input_handle, maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in input handle.", function ); return( -1 ); } return( 1 ); } /* Opens the input of the info handle * Returns 1 if successful or -1 on error */ int info_handle_open_input( info_handle_t *info_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { system_character_t **libewf_filenames = NULL; static char *function = "info_handle_open_input"; size_t first_filename_length = 0; int filename_index = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of filenames.", function ); return( -1 ); } if( number_of_filenames == 1 ) { first_filename_length = system_string_length( filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #else if( libewf_glob( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to resolve filename(s).", function ); goto on_error; } filenames = (system_character_t * const *) libewf_filenames; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( info_handle->input_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #else if( libewf_handle_open( info_handle->input_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file(s).", function ); goto on_error; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\n" ); for( filename_index = 0; filename_index < number_of_filenames; filename_index++ ) { fprintf( info_handle->notify_stream, "\t\t\t%" PRIs_SYSTEM "\n", filenames[ filename_index ] ); } fprintf( info_handle->notify_stream, "\t\t\n" ); } if( info_handle->header_codepage != LIBEWF_CODEPAGE_ASCII ) { if( libewf_handle_set_header_codepage( info_handle->input_handle, info_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); goto on_error; } } if( libewf_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, error ) != 1 ) #else if( libewf_glob_free( libewf_filenames, number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free globbed filenames.", function ); return( -1 ); } libewf_filenames = NULL; } return( 1 ); on_error: if( libewf_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, NULL ); #else libewf_glob_free( libewf_filenames, number_of_filenames, NULL ); #endif } return( -1 ); } /* Closes the info handle * Returns the 0 if succesful or -1 on error */ int info_handle_close( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_close"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } if( libewf_handle_close( info_handle->input_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close input handle.", function ); return( -1 ); } return( 0 ); } /* Sets the output format * Returns 1 if successful or -1 on error */ int info_handle_set_output_format( info_handle_t *info_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "info_handle_set_output_format"; size_t string_length = 0; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 4 ) { if( system_string_compare( string, _SYSTEM_STRING( "text" ), 4 ) == 0 ) { info_handle->output_format = INFO_HANDLE_OUTPUT_FORMAT_TEXT; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "dfxml" ), 5 ) == 0 ) { info_handle->output_format = INFO_HANDLE_OUTPUT_FORMAT_DFXML; info_handle->date_format = LIBEWF_DATE_FORMAT_ISO8601; result = 1; } } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine output format.", function ); return( -1 ); } return( result ); } /* Sets the date format * Returns 1 if successful, 0 if unsupported value or -1 on error */ int info_handle_set_date_format( info_handle_t *info_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "info_handle_set_date_format"; size_t string_length = 0; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 2 ) { if( system_string_compare( string, _SYSTEM_STRING( "dm" ), 2 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_DAYMONTH; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "md" ), 3 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_MONTHDAY; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "ctime" ), 5 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_CTIME; result = 1; } } else if( string_length == 7 ) { if( system_string_compare( string, _SYSTEM_STRING( "iso8601" ), 7 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_ISO8601; result = 1; } } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine date format.", function ); return( -1 ); } return( result ); } /* Sets the header codepage * Returns 1 if successful or -1 on error */ int info_handle_set_header_codepage( info_handle_t *info_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "info_handle_set_header_codepage"; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } result = ewfinput_determine_header_codepage( string, &( info_handle->header_codepage ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine header codepage.", function ); return( -1 ); } else if( result != 0 ) { if( info_handle->input_handle != NULL ) { if( libewf_handle_set_header_codepage( info_handle->input_handle, info_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); return( -1 ); } } } return( result ); } /* Prints a section header to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_header_fprint( info_handle_t *info_handle, const char *identifier, const char *description, libcerror_error_t **error ) { static char *function = "info_handle_section_header_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t<%s>\n", identifier ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "%s\n", description ); } return( 1 ); } /* Prints a section footer to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_footer_fprint( info_handle_t *info_handle, const char *identifier, libcerror_error_t **error ) { static char *function = "info_handle_section_footer_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\n", identifier ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\n" ); } return( 1 ); } /* Prints a string value to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_value_string_fprint( info_handle_t *info_handle, const char *identifier, size_t identifier_length, const char *description, size_t description_length, const system_character_t *value_string, libcerror_error_t **error ) { static char *function = "info_handle_section_value_string_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { if( identifier_length == 12 ) { if( narrow_string_compare( identifier, "acquiry_date", 12 ) == 0 ) { identifier = "acquisition_date"; } } else if( identifier_length == 16 ) { if( narrow_string_compare( identifier, "acquiry_software", 16 ) == 0 ) { identifier = "acquisition_software"; } } else if( identifier_length == 24 ) { if( narrow_string_compare( identifier, "acquiry_operating_system", 24 ) == 0 ) { identifier = "acquisition_system"; } else if( narrow_string_compare( identifier, "acquiry_software_version", 24 ) == 0 ) { identifier = "acquisition_version"; } } fprintf( info_handle->notify_stream, "\t\t\t<%s>%" PRIs_SYSTEM "\n", identifier, value_string, identifier ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t%s:", description ); description_length += 1; while( description_length < 24 ) { fprintf( info_handle->notify_stream, "\t" ); description_length += 8; } fprintf( info_handle->notify_stream, "%" PRIs_SYSTEM "\n", value_string ); } return( 1 ); } /* Prints a 32-bit value to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_value_32bit_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, uint32_t value_32bit, libcerror_error_t **error ) { static char *function = "info_handle_section_value_32bit_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t<%s>%" PRIu32 "\n", identifier, value_32bit, identifier ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t%s:", description ); description_length += 1; while( description_length < 24 ) { fprintf( info_handle->notify_stream, "\t" ); description_length += 8; } fprintf( info_handle->notify_stream, "%" PRIu32 "\n", value_32bit ); } return( 1 ); } /* Prints a 64-bit value to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_value_64bit_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, uint64_t value_64bit, libcerror_error_t **error ) { static char *function = "info_handle_section_value_64bit_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t<%s>%" PRIu64 "\n", identifier, value_64bit, identifier ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t%s:", description ); description_length += 1; while( description_length < 24 ) { fprintf( info_handle->notify_stream, "\t" ); description_length += 8; } fprintf( info_handle->notify_stream, "%" PRIu64 "\n", value_64bit ); } return( 1 ); } /* Prints a 64-bit size value to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_value_size_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, size64_t value_size, libcerror_error_t **error ) { system_character_t value_size_string[ 16 ]; static char *function = "info_handle_section_value_size_fprint"; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t<%s>%" PRIu64 "\n", identifier, value_size, identifier ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t%s:", description ); description_length += 1; while( description_length < 24 ) { fprintf( info_handle->notify_stream, "\t" ); description_length += 8; } result = byte_size_string_create( value_size_string, 16, value_size, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); if( result == 1 ) { fprintf( info_handle->notify_stream, "%" PRIs_SYSTEM " (%" PRIu64 " bytes)\n", value_size_string, value_size ); } else { fprintf( info_handle->notify_stream, "%" PRIu64 " bytes\n", value_size ); } } return( 1 ); } /* Prints a boolean value to a stream * Returns 1 if successful or -1 on error */ int info_handle_section_value_boolean_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, int value_boolean, libcerror_error_t **error ) { static char *function = "info_handle_section_value_boolean_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { if( value_boolean != 0 ) { fprintf( info_handle->notify_stream, "\t\t\t<%s>yes\n", identifier, identifier ); } else { fprintf( info_handle->notify_stream, "\t\t\t<%s>no\n", identifier, identifier ); } } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t%s:", description ); description_length += 1; while( description_length < 24 ) { fprintf( info_handle->notify_stream, "\t" ); description_length += 8; } if( value_boolean != 0 ) { fprintf( info_handle->notify_stream, "yes\n" ); } else { fprintf( info_handle->notify_stream, "no\n" ); } } return( 1 ); } /* Prints a header value to a stream * Returns 1 if successful or -1 on error */ int info_handle_header_value_fprint( info_handle_t *info_handle, const char *identifier, size_t identifier_length, const char *description, size_t description_length, libcerror_error_t **error ) { 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; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) identifier, identifier_length, (uint16_t *) header_value, header_value_size, error ); #else result = libewf_handle_get_utf8_header_value( info_handle->input_handle, (uint8_t *) identifier, identifier_length, (uint8_t *) header_value, header_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, identifier ); return( -1 ); } else if( result != 0 ) { if( info_handle_section_value_string_fprint( info_handle, identifier, identifier_length, description, description_length, header_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: %s.", function, identifier ); return( -1 ); } } return( 1 ); } /* Prints the header values to a stream * Returns 1 if successful or -1 on error */ int info_handle_header_values_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { char header_value_identifier[ INFO_HANDLE_VALUE_IDENTIFIER_SIZE ]; const char *description = NULL; static char *function = "info_handle_header_values_fprint"; size_t description_length = 0; size_t header_value_identifier_size = INFO_HANDLE_VALUE_IDENTIFIER_SIZE; uint32_t header_value_iterator = 0; uint32_t number_of_values = 0; int result = 1; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } if( libewf_handle_set_header_values_date_format( info_handle->input_handle, info_handle->date_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header values date format.", function ); return( -1 ); } if( libewf_handle_get_number_of_header_values( info_handle->input_handle, &number_of_values, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of header values.", function ); return( -1 ); } if( info_handle_section_header_fprint( info_handle, "acquiry_information", "Acquiry information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: acquiry_information.", function ); result = -1; } if( number_of_values == 0 ) { if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\tNo information found in file.\n" ); } } else { for( header_value_iterator = 0; header_value_iterator < number_of_values; header_value_iterator++ ) { if( libewf_handle_get_header_value_identifier_size( info_handle->input_handle, header_value_iterator, &header_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the header identifier size for index: %" PRIu32 ".", function, header_value_iterator ); result = -1; continue; } if( header_value_identifier_size > INFO_HANDLE_VALUE_IDENTIFIER_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: header identifier size value out of bounds for index: %" PRIu32 ".", function, header_value_iterator ); result = -1; continue; } if( libewf_handle_get_header_value_identifier( info_handle->input_handle, header_value_iterator, (uint8_t *) header_value_identifier, header_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the header identifier for index: %" PRIu32 ".", function, header_value_iterator ); result = -1; continue; } description = NULL; description_length = 0; if( header_value_identifier_size == 6 ) { if( narrow_string_compare( header_value_identifier, "model", 5 ) == 0 ) { description = "Model"; description_length = 5; } else if( narrow_string_compare( header_value_identifier, "notes", 5 ) == 0 ) { description = "Notes"; description_length = 5; } } else if( header_value_identifier_size == 11 ) { /* TODO figure out what this value represents */ if( narrow_string_compare( header_value_identifier, "unknown_dc", 10 ) == 0 ) { description = "Unknown value dc"; description_length = 16; } } else if( header_value_identifier_size == 12 ) { if( narrow_string_compare( header_value_identifier, "case_number", 11 ) == 0 ) { description = "Case number"; description_length = 11; } else if( narrow_string_compare( header_value_identifier, "description", 11 ) == 0 ) { description = "Description"; description_length = 11; } else if( narrow_string_compare( header_value_identifier, "system_date", 11 ) == 0 ) { description = "System date"; description_length = 11; } } else if( header_value_identifier_size == 13 ) { if( narrow_string_compare( header_value_identifier, "acquiry_date", 12 ) == 0 ) { description = "Acquisition date"; description_length = 16; } else if( narrow_string_compare( header_value_identifier, "device_label", 12 ) == 0 ) { description = "Device label"; description_length = 12; } } else if( header_value_identifier_size == 14 ) { if( narrow_string_compare( header_value_identifier, "examiner_name", 13 ) == 0 ) { description = "Examiner name"; description_length = 13; } else if( narrow_string_compare( header_value_identifier, "serial_number", 13 ) == 0 ) { description = "Serial number"; description_length = 13; } } else if( header_value_identifier_size == 16 ) { if( narrow_string_compare( header_value_identifier, "evidence_number", 15 ) == 0 ) { description = "Evidence number"; description_length = 15; } } else if( header_value_identifier_size == 17 ) { if( narrow_string_compare( header_value_identifier, "acquiry_software", 16 ) == 0 ) { description = "Software used"; description_length = 13; } } else if( header_value_identifier_size == 19 ) { if( narrow_string_compare( header_value_identifier, "process_identifier", 18 ) == 0 ) { description = "Process identifier"; description_length = 18; } } else if( header_value_identifier_size == 25 ) { if( narrow_string_compare( header_value_identifier, "acquiry_operating_system", 24 ) == 0 ) { description = "Operating system used"; description_length = 21; } else if( narrow_string_compare( header_value_identifier, "acquiry_software_version", 24 ) == 0 ) { description = "Software version used"; description_length = 21; } } if( description == NULL ) { if( header_value_identifier_size == 8 ) { if( narrow_string_compare( header_value_identifier, "extents", 7 ) == 0 ) { if( info_handle_header_value_extents_fprint( info_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header value: extents.", function ); result = -1; } } } else if( header_value_identifier_size == 9 ) { if( narrow_string_compare( header_value_identifier, "password", 8 ) == 0 ) { if( info_handle_header_value_password_fprint( info_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header value: password.", function ); result = -1; } } } else if( header_value_identifier_size == 18 ) { if( narrow_string_compare( header_value_identifier, "compression_level", 17 ) == 0 ) { if( info_handle_header_value_compression_level_fprint( info_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header value: compression_level.", function ); result = -1; } } } else { description = header_value_identifier; description_length = header_value_identifier_size - 1; } } if( description != NULL ) { if( info_handle_header_value_fprint( info_handle, header_value_identifier, header_value_identifier_size - 1, description, description_length, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print header value: %s.", function, header_value_identifier ); result = -1; } } } } if( info_handle_section_footer_fprint( info_handle, "acquiry_information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: acquiry_information.", function ); result = -1; } return( result ); } /* Prints the password header value to a stream * Returns 1 if successful or -1 on error */ int info_handle_header_value_password_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { 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; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) "password", 8, (uint16_t *) header_value, header_value_size, error ); #else result = libewf_handle_get_utf8_header_value( info_handle->input_handle, (uint8_t *) "password", 8, (uint8_t *) header_value, header_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: password.", function ); return( -1 ); } else if( result == 0 ) { if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\tPassword:\t\tN/A\n" ); } } else { if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\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_SYSTEM ")\n", header_value ); } } return( 1 ); } /* Prints the compression level header value to a stream * Returns 1 if successful or -1 on error */ int info_handle_header_value_compression_level_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; 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; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) "compression_level", 16, (uint16_t *) header_value, header_value_size, error ); #else result = libewf_handle_get_utf8_header_value( info_handle->input_handle, (uint8_t *) "compression_level", 16, (uint8_t *) header_value, header_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: compression_level.", function ); return( -1 ); } else if( result != 0 ) { if( system_string_compare( header_value, _SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE ), 1 ) == 0 ) { value_string = _SYSTEM_STRING( "no compression" ); } else if( system_string_compare( header_value, _SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST ), 1 ) == 0 ) { value_string = _SYSTEM_STRING( "good (fast) compression" ); } else if( system_string_compare( header_value, _SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST ), 1 ) == 0 ) { value_string = _SYSTEM_STRING( "best compression" ); } else { value_string = _SYSTEM_STRING( "unknown compression" ); } if( info_handle_section_value_string_fprint( info_handle, "compression_level", 16, "Compression level", 16, value_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: compression_level.", function ); return( -1 ); } } return( 1 ); } /* Prints the extents header value to a stream * Returns 1 if successful or -1 on error */ int info_handle_header_value_extents_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; 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; size_t string_segment_size = 0; int number_of_segments = 0; int result = 0; int segment_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *extents_elements = NULL; #else libcsplit_narrow_split_string_t *extents_elements = NULL; #endif if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) "extents", 7, (uint16_t *) header_value, header_value_size, error ); #else result = libewf_handle_get_utf8_header_value( info_handle->input_handle, (uint8_t *) "extents", 7, (uint8_t *) header_value, header_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: extents.", function ); goto on_error; } else if( result != 0 ) { /* Need the effective length of the string */ header_value_length = system_string_length( header_value ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( header_value, header_value_length + 1, (wchar_t) ' ', &extents_elements, error ) != 1 ) #else if( libcsplit_narrow_string_split( header_value, header_value_length + 1, (char) ' ', &extents_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( extents_elements, &number_of_segments, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_number_of_segments( extents_elements, &number_of_segments, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); return( -1 ); } if( ( number_of_segments % 4 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported number of segments.", function ); goto on_error; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( extents_elements, 0, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( extents_elements, 0, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: 0.", function ); goto on_error; } if( string_segment != NULL ) { fprintf( info_handle->notify_stream, "\tExtents:\t\t%" PRIs_SYSTEM "\n", string_segment ); } } if( number_of_segments > 1 ) { if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t\n" ); } for( segment_index = 1; segment_index < number_of_segments; segment_index++ ) { if( ( segment_index % 4 ) == 1 ) { fprintf( info_handle->notify_stream, "\t\t\t\t" ); if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "" ); } } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( extents_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( extents_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment != NULL ) { fprintf( info_handle->notify_stream, "%" PRIs_SYSTEM "", string_segment ); } if( ( segment_index % 4 ) != 0 ) { fprintf( info_handle->notify_stream, " " ); } else { if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "" ); } fprintf( info_handle->notify_stream, "\n" ); } } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t\n" ); } } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &extents_elements, error ) != 1 ) #else if( libcsplit_narrow_split_string_free( &extents_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split string.", function ); goto on_error; } } return( 1 ); on_error: if( extents_elements != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &extents_elements, NULL ); #else libcsplit_narrow_split_string_free( &extents_elements, NULL ); #endif } return( -1 ); } /* Prints the media information to a stream * Returns 1 if successful or -1 on error */ int info_handle_media_information_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { system_character_t guid_string[ 48 ]; uint8_t guid[ GUID_SIZE ]; 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; uint32_t value_32bit = 0; uint8_t compression_flags = 0; uint8_t format = 0; uint8_t media_type = 0; uint8_t media_flags = 0; int8_t compression_level = 0; int is_corrupted = 0; int is_encrypted = 0; int result = 1; /* experimental version only 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; */ if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } /* experimental version only is_encrypted = libewf_handle_segment_files_encrypted( info_handle->input_handle, error ); if( is_encrypted == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if segment files are encrypted.", function ); result = -1; } */ if( info_handle_section_header_fprint( info_handle, "ewf_information", "EWF information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: ewf_information.", function ); result = -1; } if( libewf_handle_get_format( info_handle->input_handle, &format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve format.", function ); return( -1 ); } switch( format ) { case LIBEWF_FORMAT_EWF: value_string = _SYSTEM_STRING( "original EWF" ); break; case LIBEWF_FORMAT_SMART: value_string = _SYSTEM_STRING( "SMART" ); break; case LIBEWF_FORMAT_FTK: value_string = _SYSTEM_STRING( "FTK Imager" ); break; case LIBEWF_FORMAT_ENCASE1: value_string = _SYSTEM_STRING( "EnCase 1" ); break; case LIBEWF_FORMAT_ENCASE2: value_string = _SYSTEM_STRING( "EnCase 2" ); break; case LIBEWF_FORMAT_ENCASE3: value_string = _SYSTEM_STRING( "EnCase 3" ); break; case LIBEWF_FORMAT_ENCASE4: value_string = _SYSTEM_STRING( "EnCase 4" ); break; case LIBEWF_FORMAT_ENCASE5: value_string = _SYSTEM_STRING( "EnCase 5" ); break; case LIBEWF_FORMAT_ENCASE6: value_string = _SYSTEM_STRING( "EnCase 6" ); break; /* experimental version only case LIBEWF_FORMAT_ENCASE7: value_string = _SYSTEM_STRING( "EnCase 7" ); break; */ case LIBEWF_FORMAT_LINEN5: value_string = _SYSTEM_STRING( "linen 5" ); break; case LIBEWF_FORMAT_LINEN6: value_string = _SYSTEM_STRING( "linen 6" ); break; /* experimental version only case LIBEWF_FORMAT_LINEN7: value_string = _SYSTEM_STRING( "linen 7" ); break; */ case LIBEWF_FORMAT_EWFX: value_string = _SYSTEM_STRING( "EWFX (extended EWF)" ); break; case LIBEWF_FORMAT_LOGICAL_ENCASE5: value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 5" ); break; case LIBEWF_FORMAT_LOGICAL_ENCASE6: value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 6" ); break; case LIBEWF_FORMAT_LOGICAL_ENCASE7: value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 7" ); break; /* experimental version only case LIBEWF_FORMAT_V2_ENCASE7: value_string = _SYSTEM_STRING( "EnCase 7 (version 2)" ); break; case LIBEWF_FORMAT_V2_LOGICAL_ENCASE7: value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 7 (version 2)" ); break; */ case LIBEWF_FORMAT_UNKNOWN: default: value_string = _SYSTEM_STRING( "unknown" ); break; } if( info_handle_section_value_string_fprint( info_handle, "file_format", 11, "File format", 11, value_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: file_format.", function ); result = -1; } /* experimental version only if( ( format == LIBEWF_FORMAT_V2_ENCASE7 ) || ( format == LIBEWF_FORMAT_V2_LOGICAL_ENCASE7 ) ) { if( libewf_handle_get_segment_file_version( info_handle->input_handle, &major_version, &minor_version, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file version.", function ); result = -1; } else { if( major_version <= 9 ) { segment_file_version[ 0 ] += major_version; } if( minor_version <= 9 ) { segment_file_version[ 2 ] += minor_version; } if( info_handle_section_value_string_fprint( info_handle, "segment_file_version", 20, "Segment file version", 20, segment_file_version, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: segment_file_version.", function ); result = -1; } } } */ if( is_encrypted == 0 ) { if( libewf_handle_get_sectors_per_chunk( info_handle->input_handle, &value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sectors per chunk.", function ); result = -1; } else { if( info_handle_section_value_32bit_fprint( info_handle, "sectors_per_chunk", "Sectors per chunk", 17, value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section 32-bit value: sectors_per_chunk.", function ); result = -1; } } if( libewf_handle_get_error_granularity( info_handle->input_handle, &value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve error granularity.", function ); result = -1; } else if( value_32bit != 0 ) { if( info_handle_section_value_32bit_fprint( info_handle, "error_granularity", "Error granularity", 17, value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section 32-bit value: error_granularity.", function ); result = -1; } } } /* experimental version only if( libewf_handle_get_compression_method( info_handle->input_handle, &compression_method, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve compression method.", function ); result = -1; } else */ { /* experimental version only if( compression_method == LIBEWF_COMPRESSION_METHOD_DEFLATE ) */ { value_string = _SYSTEM_STRING( "deflate" ); } /* experimental version only else if( compression_method == LIBEWF_COMPRESSION_METHOD_BZIP2 ) { value_string = _SYSTEM_STRING( "bzip2" ); } */ if( info_handle_section_value_string_fprint( info_handle, "compression_method", 18, "Compression method", 18, value_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: compression_method.", function ); result = -1; } } if( is_encrypted == 0 ) { if( libewf_handle_get_compression_values( info_handle->input_handle, &compression_level, &compression_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve compression values.", function ); result = -1; } else { if( compression_level == LIBEWF_COMPRESSION_NONE ) { value_string = _SYSTEM_STRING( "no compression" ); } else if( compression_level == LIBEWF_COMPRESSION_FAST ) { value_string = _SYSTEM_STRING( "good (fast) compression" ); } else if( compression_level == LIBEWF_COMPRESSION_BEST ) { value_string = _SYSTEM_STRING( "best compression" ); } else { value_string = _SYSTEM_STRING( "unknown compression" ); } if( info_handle_section_value_string_fprint( info_handle, "compression_level", 17, "Compression level", 17, value_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: compression_level.", function ); result = -1; } } } if( libewf_handle_get_segment_file_set_identifier( info_handle->input_handle, guid, GUID_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment file set identifier.", function ); result = -1; } else if( ( guid[ 0 ] != 0 ) || ( guid[ 1 ] != 0 ) || ( guid[ 2 ] != 0 ) || ( guid[ 3 ] != 0 ) || ( guid[ 4 ] != 0 ) || ( guid[ 5 ] != 0 ) || ( guid[ 6 ] != 0 ) || ( guid[ 7 ] != 0 ) || ( guid[ 8 ] != 0 ) || ( guid[ 9 ] != 0 ) || ( guid[ 10 ] != 0 ) || ( guid[ 11 ] != 0 ) || ( guid[ 12 ] != 0 ) || ( guid[ 13 ] != 0 ) || ( guid[ 14 ] != 0 ) || ( guid[ 15 ] != 0 ) ) { if( guid_to_string( guid, GUID_SIZE, _BYTE_STREAM_ENDIAN_LITTLE, guid_string, 48, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create GUID string.", function ); result = -1; } else { if( info_handle_section_value_string_fprint( info_handle, "set_identifier", 14, "Set identifier", 14, guid_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: set_identifier.", function ); result = -1; } } } is_corrupted = libewf_handle_segment_files_corrupted( info_handle->input_handle, error ); if( is_corrupted == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if segment files are corrupted.", function ); result = -1; } else if( is_corrupted != 0 ) { if( info_handle_section_value_boolean_fprint( info_handle, "is_corrupted", "Is corrupted", 12, is_corrupted, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section boolean value: is_corrupted.", function ); result = -1; } } if( is_encrypted != 0 ) { if( info_handle_section_value_boolean_fprint( info_handle, "is_encrypted", "Is encrypted", 12, is_encrypted, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section boolean value: is_encrypted.", function ); result = -1; } } if( info_handle_section_footer_fprint( info_handle, "ewf_information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: ewf_information.", function ); result = -1; } /* TODO improved this check once encryption support has been implemented */ if( is_encrypted != 0 ) { return( result ); } if( info_handle_section_header_fprint( info_handle, "media_information", "Media information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: media_information.", function ); result = -1; } if( ( format != LIBEWF_FORMAT_EWF ) && ( format != LIBEWF_FORMAT_SMART ) ) { if( libewf_handle_get_media_type( info_handle->input_handle, &media_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media type.", function ); result = -1; } else { if( media_type == LIBEWF_MEDIA_TYPE_REMOVABLE ) { value_string = _SYSTEM_STRING( "removable disk" ); } else if( media_type == LIBEWF_MEDIA_TYPE_FIXED ) { value_string = _SYSTEM_STRING( "fixed disk" ); } else if( media_type == LIBEWF_MEDIA_TYPE_SINGLE_FILES ) { value_string = _SYSTEM_STRING( "single files" ); } else if( media_type == LIBEWF_MEDIA_TYPE_OPTICAL ) { value_string = _SYSTEM_STRING( "optical disk (CD/DVD/BD)" ); } else if( media_type == LIBEWF_MEDIA_TYPE_MEMORY ) { value_string = _SYSTEM_STRING( "memory (RAM)" ); } else { value_string = _SYSTEM_STRING( "unknown" ); } if( info_handle_section_value_string_fprint( info_handle, "media_type", 10, "Media type", 10, value_string, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: media_type.", function ); result = -1; } } if( libewf_handle_get_media_flags( info_handle->input_handle, &media_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media flags.", function ); result = -1; } else { #if defined( HAVE_VERBOSE_OUTPUT ) if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\tMedia flags:\t\t0x%02" PRIx8 "\n", media_flags ); } #endif if( info_handle_section_value_boolean_fprint( info_handle, "is_physical", "Is physical", 10, media_flags & LIBEWF_MEDIA_FLAG_PHYSICAL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section boolean value: is_physical.", function ); result = -1; } if( ( media_flags & LIBEWF_MEDIA_FLAG_FASTBLOC ) != 0 ) { if( info_handle_section_value_string_fprint( info_handle, "write_blocked", 13, "Write blocked", 13, _SYSTEM_STRING( "Fastbloc" ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: write_blocked.", function ); result = -1; } } if( ( media_flags & LIBEWF_MEDIA_FLAG_TABLEAU ) != 0 ) { if( info_handle_section_value_string_fprint( info_handle, "write_blocked", 13, "Write blocked", 13, _SYSTEM_STRING( "Tableau" ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section value string: write_blocked.", function ); result = -1; } } } } if( format != LIBEWF_FORMAT_LVF ) { if( libewf_handle_get_bytes_per_sector( info_handle->input_handle, &value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); result = -1; } else { if( info_handle_section_value_32bit_fprint( info_handle, "bytes_per_sector", "Bytes per sector", 16, value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section 32-bit value: bytes_per_sector.", function ); result = -1; } } if( libewf_handle_get_number_of_sectors( info_handle->input_handle, &value_64bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sectors.", function ); result = -1; } else { if( info_handle_section_value_64bit_fprint( info_handle, "number_of_sectors", "Number of sectors", 17, value_64bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section 64-bit value: number_of_sectors.", function ); result = -1; } } #if defined( HAVE_DEBUG_OUTPUT ) if( libewf_handle_get_chunk_size( info_handle->input_handle, &value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); result = -1; } else { if( info_handle_section_value_32bit_fprint( info_handle, "chunk_size", "Chunk size", 10, value_32bit, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section 32-bit value: number_of_sectors.", function ); result = -1; } } #endif } if( libewf_handle_get_media_size( info_handle->input_handle, &media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); result = -1; } else { if( info_handle_section_value_size_fprint( info_handle, "media_size", "Media size", 10, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section 64-bit value: media_size.", function ); result = -1; } } if( info_handle_section_footer_fprint( info_handle, "media_information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: media_information.", function ); result = -1; } return( result ); } /* Prints a hash value to a stream * Returns 1 if successful or -1 on error */ int info_handle_hash_value_fprint( info_handle_t *info_handle, const char *identifier, size_t identifier_length, libcerror_error_t **error ) { 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; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( info_handle->input_handle, (uint8_t *) identifier, identifier_length, (uint16_t *) hash_value, hash_value_size, error ); #else result = libewf_handle_get_utf8_hash_value( info_handle->input_handle, (uint8_t *) identifier, identifier_length, (uint8_t *) hash_value, hash_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve hash value: %s.", function, identifier ); return( -1 ); } else if( result != 0 ) { if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { if( identifier_length == 3 ) { if( narrow_string_compare( identifier, "MD5", 3 ) == 0 ) { identifier = "md5"; } } else if( identifier_length == 4 ) { if( narrow_string_compare( identifier, "SHA1", 4 ) == 0 ) { identifier = "sha1"; } } fprintf( info_handle->notify_stream, "\t\t%" PRIs_SYSTEM "\n", identifier, hash_value ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t%s:\t\t\t%" PRIs_SYSTEM "\n", identifier, hash_value ); } } return( 1 ); } /* Prints the hash values to a stream * Returns 1 if successful or -1 on error */ int info_handle_hash_values_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { char hash_value_identifier[ INFO_HANDLE_VALUE_IDENTIFIER_SIZE ]; static char *function = "info_handle_hash_values_fprint"; size_t hash_value_identifier_size = INFO_HANDLE_VALUE_IDENTIFIER_SIZE; uint32_t number_of_values = 0; uint32_t hash_value_iterator = 0; uint8_t print_section_header = 1; int result = 1; #if defined( USE_LIBEWF_GET_MD5_HASH ) digest_hash_t md5_hash[ DIGEST_HASH_SIZE_MD5 ]; system_character_t *stored_md5_hash_string = NULL; #endif if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } #if defined( USE_LIBEWF_GET_MD5_HASH ) result = libewf_handle_get_md5_hash( handle, md5_hash, DIGEST_HASH_SIZE_MD5, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve MD5 hash.", function ); return; } else if( result == 1 ) { stored_md5_hash_string = system_string_allocate( DIGEST_HASH_STRING_SIZE_MD5 ); if( stored_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create MD5 hash string.", function ); return; } if( digest_hash_copy_to_string( md5_hash, DIGEST_HASH_SIZE_MD5, stored_md5_hash_string, DIGEST_HASH_STRING_SIZE_MD5, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set MD5 hash string.", function ); memory_free( stored_md5_hash_string ); return; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { if( print_section_header != 0 ) { if( info_handle_section_header_fprint( info_handle, "digest_hash_information", "Digest hash information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: digest_hash_information.", function ); result = -1; } print_section_header = 0; } } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\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_SYSTEM "\n", stored_md5_hash_string ); } memory_free( stored_md5_hash_string ); } #endif if( libewf_handle_get_number_of_hash_values( info_handle->input_handle, &number_of_values, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of hash values.", function ); return( -1 ); } for( hash_value_iterator = 0; hash_value_iterator < number_of_values; hash_value_iterator++ ) { if( libewf_handle_get_hash_value_identifier_size( info_handle->input_handle, hash_value_iterator, &hash_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the hash value identifier size for index: %" PRIu32 ".", function, hash_value_iterator ); result = -1; continue; } if( hash_value_identifier_size > INFO_HANDLE_VALUE_IDENTIFIER_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: hash value identifier size value out of bounds for index: %" PRIu32 ".", function, hash_value_iterator ); result = -1; continue; } if( libewf_handle_get_hash_value_identifier( info_handle->input_handle, hash_value_iterator, (uint8_t *) hash_value_identifier, hash_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the hash value identifier for index: %" PRIu32 ".", function, hash_value_iterator ); result = -1; continue; } #if defined( USE_LIBEWF_GET_MD5_HASH ) if( hash_value_identifier_size == 4 ) { if( narrow_string_compare( hash_value_identifier, "MD5", 3 ) == 0 ) { continue; } } #endif if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { if( print_section_header != 0 ) { if( info_handle_section_header_fprint( info_handle, "digest_hash_information", "Digest hash information", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: digest_hash_information.", function ); result = -1; } print_section_header = 0; } } if( info_handle_hash_value_fprint( info_handle, hash_value_identifier, hash_value_identifier_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hash value: %s.", function, hash_value_identifier ); result = -1; } } if( print_section_header == 0 ) { if( info_handle_section_footer_fprint( info_handle, "digest_hash_information.", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: digest_hash_information.", function ); result = -1; } } return( result ); } /* Prints the acquiry errors to a stream * Returns 1 if successful or -1 on error */ int info_handle_acquiry_errors_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_acquiry_errors_fprint"; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; uint32_t bytes_per_sector = 0; uint32_t number_of_errors = 0; uint32_t error_iterator = 0; int result = 1; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } if( libewf_handle_get_bytes_per_sector( info_handle->input_handle, &bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); return( -1 ); } if( libewf_handle_get_number_of_acquiry_errors( info_handle->input_handle, &number_of_errors, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of acquiry errors.", function ); return( -1 ); } if( number_of_errors > 0 ) { if( info_handle_section_header_fprint( info_handle, "acquisition_read_errors", "Read errors during acquiry", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: acquisition_read_errors.", function ); result = -1; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\ttotal number: %" PRIu32 "\n", number_of_errors ); } for( error_iterator = 0; error_iterator < number_of_errors; error_iterator++ ) { if( libewf_handle_get_acquiry_error( info_handle->input_handle, error_iterator, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the acquiry error: %" PRIu32 ".", function, error_iterator ); start_sector = 0; number_of_sectors = 0; result = -1; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t\n", start_sector * bytes_per_sector, number_of_sectors * bytes_per_sector ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { last_sector = start_sector + number_of_sectors; if( number_of_sectors != 0 ) { last_sector -= 1; } fprintf( info_handle->notify_stream, "\tat sector(s): %" PRIu64 " - %" PRIu64 " number: %" PRIu64 "\n", start_sector, last_sector, number_of_sectors ); } } if( info_handle_section_footer_fprint( info_handle, "acquisition_read_errors", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: acquisition_read_errors.", function ); result = -1; } } return( result ); } /* Prints the sessions to a stream * Returns 1 if successful or -1 on error */ int info_handle_sessions_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_sessions_fprint"; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; uint32_t bytes_per_sector = 0; uint32_t number_of_sessions = 0; uint32_t session_iterator = 0; int result = 1; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } if( libewf_handle_get_bytes_per_sector( info_handle->input_handle, &bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); return( -1 ); } if( libewf_handle_get_number_of_sessions( info_handle->input_handle, &number_of_sessions, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of sessions.", function ); return( -1 ); } if( number_of_sessions > 0 ) { if( info_handle_section_header_fprint( info_handle, "sessions", "Sessions", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: sessions.", function ); result = -1; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\ttotal number: %" PRIu32 "\n", number_of_sessions ); } for( session_iterator = 0; session_iterator < number_of_sessions; session_iterator++ ) { if( libewf_handle_get_session( info_handle->input_handle, session_iterator, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the session: %" PRIu32 ".", function, session_iterator ); start_sector = 0; number_of_sectors = 0; result = -1; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t\n", start_sector * bytes_per_sector, number_of_sectors * bytes_per_sector ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { last_sector = start_sector + number_of_sectors; if( number_of_sectors != 0 ) { last_sector -= 1; } fprintf( info_handle->notify_stream, "\tat sector(s): %" PRIu64 " - %" PRIu64 " number: %" PRIu64 "\n", start_sector, last_sector, number_of_sectors ); } } if( info_handle_section_footer_fprint( info_handle, "sessions", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: sessions.", function ); result = -1; } } return( result ); } /* Prints the tracks to a stream * Returns 1 if successful or -1 on error */ int info_handle_tracks_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_tracks_fprint"; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; uint32_t bytes_per_sector = 0; uint32_t number_of_tracks = 0; uint32_t track_iterator = 0; int result = 1; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } if( libewf_handle_get_bytes_per_sector( info_handle->input_handle, &bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); return( -1 ); } if( libewf_handle_get_number_of_tracks( info_handle->input_handle, &number_of_tracks, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of tracks.", function ); return( -1 ); } if( number_of_tracks > 0 ) { if( info_handle_section_header_fprint( info_handle, "tracks", "Tracks", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: tracks.", function ); result = -1; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\ttotal number: %" PRIu32 "\n", number_of_tracks ); } for( track_iterator = 0; track_iterator < number_of_tracks; track_iterator++ ) { if( libewf_handle_get_track( info_handle->input_handle, track_iterator, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the track: %" PRIu32 ".", function, track_iterator ); start_sector = 0; number_of_sectors = 0; result = -1; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t\n", start_sector * bytes_per_sector, number_of_sectors * bytes_per_sector ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { last_sector = start_sector + number_of_sectors; if( number_of_sectors != 0 ) { last_sector -= 1; } fprintf( info_handle->notify_stream, "\tat sector(s): %" PRIu64 " - %" PRIu64 " number: %" PRIu64 "\n", start_sector, last_sector, number_of_sectors ); } } if( info_handle_section_footer_fprint( info_handle, "tracks", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: tracks.", function ); result = -1; } } return( result ); } /* Prints the single files to a stream * Returns 1 if successful or -1 on error */ int info_handle_single_files_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { libewf_file_entry_t *file_entry = NULL; static char *function = "info_handle_single_files_fprint"; int result = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( info_handle->input_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid info handle - missing input handle.", function ); return( -1 ); } result = libewf_handle_get_root_file_entry( info_handle->input_handle, &file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve root file entry.", function ); return( -1 ); } else if( result == 0 ) { return( 1 ); } if( info_handle_section_header_fprint( info_handle, "single_files", "Single files", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section header: single_files.", function ); result = -1; } if( info_handle_file_entry_fprint( info_handle, file_entry, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print root file entry.", function ); result = -1; } if( info_handle_section_footer_fprint( info_handle, "single_files", error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print section footer: single_files.", function ); result = -1; } if( libewf_file_entry_free( &file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free root file entry.", function ); result = -1; } return( result ); } /* Prints the (single) file entry to a stream * Returns 1 if successful or -1 on error */ int info_handle_file_entry_fprint( info_handle_t *info_handle, libewf_file_entry_t *file_entry, int indentation_level, libcerror_error_t **error ) { 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; int indentation_iterator = 0; int number_of_sub_file_entries = 0; int result = 0; int sub_file_entry_index = 0; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t 0 ) { name = system_string_allocate( name_size ); if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( file_entry, (uint16_t *) name, name_size, error ); #else result = libewf_file_entry_get_utf8_name( file_entry, (uint8_t *) name, name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the name.", function ); goto on_error; } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\t" ); for( indentation_iterator = 1; indentation_iterator <= indentation_level; indentation_iterator++ ) { fprintf( info_handle->notify_stream, " " ); } } fprintf( info_handle->notify_stream, "%" PRIs_SYSTEM "", name ); memory_free( name ); name = NULL; if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, "\n" ); } } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\">\n" ); } if( libewf_file_entry_get_number_of_sub_file_entries( file_entry, &number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); return( -1 ); } for( sub_file_entry_index = 0; sub_file_entry_index < number_of_sub_file_entries; sub_file_entry_index++ ) { if( libewf_file_entry_get_sub_file_entry( file_entry, sub_file_entry_index, &sub_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to free retrieve sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } if( info_handle_file_entry_fprint( info_handle, sub_file_entry, indentation_level + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } if( libewf_file_entry_free( &sub_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { fprintf( info_handle->notify_stream, "\t\t\t\n" ); } return( 1 ); on_error: if( sub_file_entry != NULL ) { libewf_file_entry_free( &sub_file_entry, NULL ); } if( name != NULL ) { memory_free( name ); } return( -1 ); } /* Prints the DFXML header to a stream * Returns 1 if successful or -1 on error */ int info_handle_dfxml_header_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_dfxml_header_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } fprintf( info_handle->notify_stream, "\n" ); /* TODO what about DTD or XSD ? */ fprintf( info_handle->notify_stream, "\n" ); fprintf( info_handle->notify_stream, "\t\n" "\t\tDisk Image\n" "\t\n" ); fprintf( info_handle->notify_stream, "\t\n" "\t\tewfinfo\n" "\t\t%s\n", LIBEWF_VERSION_STRING ); if( dfxml_build_environment_fprint( info_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print build environment.", function ); return( -1 ); } if( dfxml_execution_environment_fprint( info_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print execution environment.", function ); return( -1 ); } fprintf( info_handle->notify_stream, "\t\n" "\t\n" ); return( 1 ); } /* Prints the DFXML footer to a stream * Returns 1 if successful or -1 on error */ int info_handle_dfxml_footer_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { static char *function = "info_handle_dfxml_footer_fprint"; if( info_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid info handle.", function ); return( -1 ); } fprintf( info_handle->notify_stream, "\t\n" "\n" "\n" ); return( 1 ); } /* Prints the DFXML build environment to a stream * Returns 1 if successful or -1 on error */ int dfxml_build_environment_fprint( FILE *stream, libcerror_error_t **error ) { static char *function = "dfxml_build_environment_fprint"; #if defined( _MSC_VER ) || defined( __BORLANDC__ ) const char *compiler_name = NULL; const char *version_string = NULL; #endif if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } fprintf( stream, "\t\t\n" ); #if defined( _MSC_VER ) #if _MSC_VER == 600 compiler_name = "Microsoft C"; version_string = "6.0"; #elif _MSC_VER == 700 compiler_name = "Microsoft C/C++"; version_string = "7.0"; #elif _MSC_VER >= 800 compiler_name = "Microsoft Visual C/C++"; #if _MSC_VER == 800 version_string = "1.0"; #elif _MSC_VER == 900 version_string = "2.0"; /* TODO what about 3.0 ? */ #elif _MSC_VER == 1000 version_string = "4.0"; #elif _MSC_VER == 1100 version_string = "5.0"; #elif _MSC_VER == 1200 version_string = "6.0"; #elif _MSC_VER == 1300 version_string = "7.0"; #elif _MSC_VER == 1310 version_string = "7.1"; #elif _MSC_VER == 1400 version_string = "8.0"; #elif _MSC_VER == 1500 version_string = "9.0"; #elif _MSC_VER == 1600 version_string = "10.0"; #endif #endif if( ( compiler_name == NULL ) || ( version_string == NULL ) ) { fprintf( stream, "\t\t\tMSC %d\n", _MSC_VER ); } else { fprintf( stream, "\t\t\t%s %s (MSC %d)\n", compiler_name, version_string, _MSC_VER ); } #elif defined( __BORLANDC__ ) #if __BORLANDC__ >= 0x0520 compiler_name = "Borland C++ Builder"; #if __BORLANDC__ == 0x0520 version_string = "1.0"; /* TODO what about 2.0 ? */ #elif __BORLANDC__ == 0x0530 version_string = "3.0"; #elif __BORLANDC__ == 0x0540 version_string = "4.0"; #elif __BORLANDC__ == 0x0550 version_string = "5.0"; #elif __BORLANDC__ == 0x0560 version_string = "6.0"; #endif /* TODO what about codegear ? */ #endif if( ( compiler_name == NULL ) || ( version_string == NULL ) ) { fprintf( stream, "\t\t\tBORLANDC 0x%04x\n", __BORLANDC__ ); } else { fprintf( stream, "\t\t\t%s %s (BORLANDC 0x%04x)\n", compiler_name, version_string, __BORLANDC__ ); } #elif defined( __GNUC__ ) #if defined( __CYGWIN__ ) fprintf( stream, "\t\t\tCygwin\n" ); #endif #if defined( __MINGW64_VERSION_MAJOR ) && defined( __MINGW64_VERSION_MINOR ) fprintf( stream, "\t\t\tMinGW64 %d.%d\n", __MINGW64_VERSION_MAJOR, __MINGW64_VERSION_MINOR ); #elif defined( __MINGW32_MAJOR_VERSION ) && defined( __MINGW32_MINOR_VERSION ) fprintf( stream, "\t\t\tMinGW32 %d.%d\n", __MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION ); #endif #if defined( __GNUC_MINOR__ ) fprintf( stream, "\t\t\tGCC %d.%d\n", __GNUC__, __GNUC_MINOR__ ); #else fprintf( stream, "\t\t\tGCC %d\n", __GNUC__ ); #endif #endif fprintf( stream, "\t\t\t" __DATE__ " " __TIME__ "\n" ); fprintf( stream, "\t\t\t\n", LIBEWF_VERSION_STRING ); /* TODO add other libraries */ fprintf( stream, "\t\t\n" ); return( 1 ); } /* Prints the DFXML execution environment to a stream * Returns 1 if successful or -1 on error */ int dfxml_execution_environment_fprint( FILE *stream, libcerror_error_t **error ) { #if defined( HAVE_UNAME ) && !defined( WINAPI ) struct utsname utsname_buffer; #endif #if defined( WINAPI ) system_character_t operating_system[ 32 ]; #endif static char *function = "dfxml_execution_environment_fprint"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } /* TODO what about execution environment on other platforms ? */ fprintf( stream, "\t\t\n" ); #if defined( WINAPI ) if( platform_get_operating_system( operating_system, 32, NULL ) == 1 ) { fprintf( stream, "\t\t\t%" PRIs_SYSTEM "\n", operating_system ); } #elif defined( HAVE_UNAME ) if( uname( &utsname_buffer ) == 0 ) { fprintf( stream, "\t\t\t%s\n" "\t\t\t%s\n" "\t\t\t%s\n" "\t\t\t%s\n" "\t\t\t%s\n", utsname_buffer.sysname, utsname_buffer.release, utsname_buffer.version, utsname_buffer.nodename, utsname_buffer.machine ); } #endif /* TODO * X * getuid() * getpwuid( getuid() )->pw_name */ fprintf( stream, "\t\t\n" ); return( 1 ); } libewf-20140807/ewftools/ewftools_libcdatetime.h0000664000175000017500000000277513440663046023735 0ustar00lordyestalordyesta00000000000000/* * The libcdatetime header wrapper * * Copyright (C) 2006-2018, 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_LIBCDATETIME_H ) #define _EWFTOOLS_LIBCDATETIME_H #include /* Define HAVE_LOCAL_LIBCDATETIME for local use of libcdatetime */ #if defined( HAVE_LOCAL_LIBCDATETIME ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATETIME_DLL_IMPORT * before including libcdatetime.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBCDATETIME_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATETIME ) */ #endif /* !defined( _EWFTOOLS_LIBCDATETIME_H ) */ libewf-20140807/ewftools/digest_hash.h0000664000175000017500000000231113421024433021617 0ustar00lordyestalordyesta00000000000000/* * Crypographic digest hash * * 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( _DIGEST_HASH_H ) #define _DIGEST_HASH_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int digest_hash_copy_to_string( const uint8_t *digest_hash, size_t digest_hash_size, system_character_t *string, size_t string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/mount_file_system.c0000664000175000017500000012006313421020222023072 0ustar00lordyestalordyesta00000000000000/* * Mount file system * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_SYS_STAT_H ) #include #endif #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "ewftools_libcerror.h" #include "ewftools_libcpath.h" #include "ewftools_libewf.h" #include "ewftools_libuna.h" #include "mount_file_system.h" /* Creates a file system * Make sure the value file_system is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int mount_file_system_initialize( mount_file_system_t **file_system, libcerror_error_t **error ) { #if defined( WINAPI ) FILETIME filetime; SYSTEMTIME systemtime; #elif defined( HAVE_CLOCK_GETTIME ) struct timespec time_structure; #endif static char *function = "mount_file_system_initialize"; #if defined( WINAPI ) DWORD error_code = 0; #else int64_t timestamp = 0; #endif if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( *file_system != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file system value already set.", function ); return( -1 ); } *file_system = memory_allocate_structure( mount_file_system_t ); if( *file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file system.", function ); goto on_error; } if( memory_set( *file_system, 0, sizeof( mount_file_system_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file system.", function ); memory_free( *file_system ); *file_system = NULL; return( -1 ); } #if defined( WINAPI ) if( memory_set( &systemtime, 0, sizeof( SYSTEMTIME ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear systemtime.", function ); goto on_error; } GetSystemTime( &systemtime ); if( SystemTimeToFileTime( &systemtime, &filetime ) == 0 ) { error_code = GetLastError(); libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, error_code, "%s: unable to retrieve FILETIME of current time.", function ); goto on_error; } ( *file_system )->mounted_timestamp = ( (uint64_t) filetime.dwHighDateTime << 32 ) | filetime.dwLowDateTime; #elif defined( HAVE_CLOCK_GETTIME ) if( clock_gettime( CLOCK_REALTIME, &time_structure ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current time structure.", function ); goto on_error; } timestamp = ( (int64_t) time_structure.tv_sec * 1000000000 ) + time_structure.tv_nsec; ( *file_system )->mounted_timestamp = (uint64_t) timestamp; #else timestamp = (int64_t) time( NULL ); if( timestamp == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve current time.", function ); goto on_error; } timestamp *= 1000000000; ( *file_system )->mounted_timestamp = (uint64_t) timestamp; #endif /* defined( HAVE_CLOCK_GETTIME ) */ return( 1 ); on_error: if( *file_system != NULL ) { memory_free( *file_system ); *file_system = NULL; } return( -1 ); } /* Frees a file system * Returns 1 if successful or -1 on error */ int mount_file_system_free( mount_file_system_t **file_system, libcerror_error_t **error ) { static char *function = "mount_file_system_free"; int result = 1; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( *file_system != NULL ) { if( ( *file_system )->path_prefix != NULL ) { memory_free( ( *file_system )->path_prefix ); } memory_free( *file_system ); *file_system = NULL; } return( result ); } /* Signals the file system to abort * Returns 1 if successful or -1 on error */ int mount_file_system_signal_abort( mount_file_system_t *file_system, libcerror_error_t **error ) { static char *function = "mount_file_system_signal_abort"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( file_system->ewf_handle != NULL ) { if( libewf_handle_signal_abort( file_system->ewf_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal handle to abort.", function ); return( -1 ); } } return( 1 ); } /* Sets the handle * Returns 1 if successful or -1 on error */ int mount_file_system_set_handle( mount_file_system_t *file_system, libewf_handle_t *ewf_handle, libcerror_error_t **error ) { static char *function = "mount_file_system_set_handle"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } file_system->ewf_handle = ewf_handle; return( 1 ); } /* Retrieves the handle * Returns 1 if successful or -1 on error */ int mount_file_system_get_handle( mount_file_system_t *file_system, libewf_handle_t **ewf_handle, libcerror_error_t **error ) { static char *function = "mount_file_system_get_handle"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( ewf_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } *ewf_handle = file_system->ewf_handle; return( 1 ); } /* Sets the path prefix * Returns 1 if successful or -1 on error */ int mount_file_system_set_path_prefix( mount_file_system_t *file_system, const system_character_t *path_prefix, size_t path_prefix_size, libcerror_error_t **error ) { static char *function = "mount_file_system_set_path_prefix"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( file_system->path_prefix != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file system - path prefix value already set.", function ); return( -1 ); } if( path_prefix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path prefix.", function ); return( -1 ); } if( path_prefix_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing path prefix.", function ); goto on_error; } if( path_prefix_size > (size_t) ( SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path prefix size value exceeds maximum.", function ); goto on_error; } file_system->path_prefix = system_string_allocate( path_prefix_size ); if( file_system->path_prefix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create path prefix string.", function ); goto on_error; } if( system_string_copy( file_system->path_prefix, path_prefix, path_prefix_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy path prefix.", function ); goto on_error; } file_system->path_prefix[ path_prefix_size - 1 ] = 0; file_system->path_prefix_size = path_prefix_size; return( 1 ); on_error: if( file_system->path_prefix != NULL ) { memory_free( file_system->path_prefix ); file_system->path_prefix = NULL; } file_system->path_prefix_size = 0; return( -1 ); } /* Retrieves the mounted timestamp * On Windows the timestamp is an unsigned 64-bit FILETIME timestamp * otherwise the timestamp is a signed 64-bit POSIX date and time value in number of nanoseconds * Returns 1 if successful or -1 on error */ int mount_file_system_get_mounted_timestamp( mount_file_system_t *file_system, uint64_t *mounted_timestamp, libcerror_error_t **error ) { static char *function = "mount_file_system_get_mounted_timestamp"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( mounted_timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mounted timestamp.", function ); return( -1 ); } *mounted_timestamp = file_system->mounted_timestamp; return( 1 ); } /* Retrieves the number of handles * Returns 1 if successful or -1 on error */ int mount_file_system_get_number_of_handles( mount_file_system_t *file_system, int *number_of_handles, libcerror_error_t **error ) { static char *function = "mount_file_system_get_number_of_handles"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( number_of_handles == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of handles.", function ); return( -1 ); } *number_of_handles = 1; return( 1 ); } /* Retrieves a specific handle * Returns 1 if successful or -1 on error */ int mount_file_system_get_handle_by_index( mount_file_system_t *file_system, int handle_index, libewf_handle_t **ewf_handle, libcerror_error_t **error ) { static char *function = "mount_file_system_get_handle_by_index"; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( ( handle_index < 0 ) || ( handle_index >= 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid handle index value out of bounds.", function ); return( -1 ); } if( ewf_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } *ewf_handle = file_system->ewf_handle; return( 1 ); } /* Retrieves the handle for a specific path * Returns 1 if successful, 0 if no such handle or -1 on error */ int mount_file_system_get_handle_by_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, libewf_handle_t **ewf_handle, libcerror_error_t **error ) { static char *function = "mount_file_system_get_handle_by_path"; system_character_t character = 0; size_t path_index = 0; int handle_index = 0; int number_of_handles = 0; int result = 0; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( file_system->path_prefix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file system - missing path prefix.", function ); return( -1 ); } if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( ewf_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } path_length = system_string_length( path ); if( ( path_length == 1 ) && ( path[ 0 ] == file_system->path_prefix[ 0 ] ) ) { *ewf_handle = NULL; return( 1 ); } if( ( path_length < file_system->path_prefix_size ) || ( path_length > ( file_system->path_prefix_size + 3 ) ) ) { return( 0 ); } #if defined( WINAPI ) result = system_string_compare_no_case( path, file_system->path_prefix, file_system->path_prefix_size - 1 ); #else result = system_string_compare( path, file_system->path_prefix, file_system->path_prefix_size - 1 ); #endif if( result != 0 ) { return( 0 ); } handle_index = 0; path_index = file_system->path_prefix_size - 1; while( path_index < path_length ) { character = path[ path_index++ ]; if( ( character < (system_character_t) '0' ) || ( character > (system_character_t) '9' ) ) { return( 0 ); } handle_index *= 10; handle_index += character - (system_character_t) '0'; } handle_index -= 1; if( mount_file_system_get_number_of_handles( file_system, &number_of_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of handles.", function ); return( -1 ); } if( ( handle_index < 0 ) || ( handle_index >= number_of_handles ) ) { return( 0 ); } *ewf_handle = file_system->ewf_handle; return( 1 ); } /* Retrieves the path from a handle index. * Returns 1 if successful or -1 on error */ int mount_file_system_get_path_from_handle_index( mount_file_system_t *file_system, int handle_index, system_character_t *path, size_t path_size, libcerror_error_t **error ) { static char *function = "mount_file_system_get_path_from_handle_index"; size_t path_index = 0; size_t required_path_size = 0; int handle_number = 0; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( file_system->path_prefix == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file system - missing path prefix.", function ); return( -1 ); } if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } required_path_size = file_system->path_prefix_size; handle_number = handle_index + 1; while( handle_number > 0 ) { required_path_size++; handle_number /= 10; } if( path_size <= required_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid path size value too small.", function ); return( -1 ); } if( system_string_copy( path, file_system->path_prefix, file_system->path_prefix_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy path prefix.", function ); return( -1 ); } path_index = required_path_size - 1; handle_number = handle_index + 1; path[ path_index-- ] = 0; while( handle_number > 0 ) { path[ path_index-- ] = (system_character_t) '0' + ( handle_number % 10 ); handle_number /= 10; } return( 1 ); } /* Retrieves the file entry path from the path * Returns 1 if successful or -1 on error */ int mount_file_system_get_ewf_file_entry_path_from_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, system_character_t **ewf_file_entry_path, size_t *ewf_file_entry_path_size, libcerror_error_t **error ) { system_character_t *safe_ewf_file_entry_path = NULL; static char *function = "mount_file_system_get_ewf_file_entry_path_from_path"; libuna_unicode_character_t unicode_character = 0; system_character_t character = 0; system_character_t escape_character = 0; system_character_t hex_digit = 0; system_character_t hex_value = 0; size_t ewf_file_entry_path_index = 0; size_t path_index = 0; size_t safe_ewf_file_entry_path_size = 0; int result = 0; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path length.", function ); return( -1 ); } if( path_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid path length value exceeds maximum.", function ); return( -1 ); } if( ewf_file_entry_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry path.", function ); return( -1 ); } if( ewf_file_entry_path_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry path size.", function ); return( -1 ); } if( path[ 0 ] != (system_character_t) LIBCPATH_SEPARATOR ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported path - path is not absolute.", function ); return( -1 ); } *ewf_file_entry_path = NULL; *ewf_file_entry_path_size = 0; safe_ewf_file_entry_path_size = path_length + 1; if( safe_ewf_file_entry_path_size > (size_t) ( SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid file entry path size value exceeds maximum.", function ); goto on_error; } safe_ewf_file_entry_path = system_string_allocate( safe_ewf_file_entry_path_size ); if( safe_ewf_file_entry_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file entry path.", function ); goto on_error; } #if defined( WINAPI ) escape_character = (system_character_t) '^'; #else escape_character = (system_character_t) '\\'; #endif while( path_index < path_length ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_unicode_character_copy_from_utf16( &unicode_character, (libuna_utf16_character_t *) path, path_length, &path_index, error ); #else result = libuna_unicode_character_copy_from_utf8( &unicode_character, (libuna_utf8_character_t *) path, path_length, &path_index, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from path.", function ); goto on_error; } /* On Windows replaces: * ^^ by ^ * ^x5c by \ * ^x## by values <= 0x1f and 0x7f * * On other platforms replaces: * \\ by \ * \x2f by / * \x## by values <= 0x1f and 0x7f * / by \ */ if( unicode_character == (libuna_unicode_character_t) escape_character ) { if( ( path_index + 1 ) > path_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid path index value out of bounds.", function ); goto on_error; } character = path[ path_index++ ]; #if defined( WINAPI ) if( ( character != escape_character ) && ( character != (system_character_t) 'X' ) && ( character != (system_character_t) 'x' ) ) #else if( ( character != escape_character ) && ( character != (system_character_t) 'x' ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported path - invalid character: %" PRIc_SYSTEM " after escape character.", function, character ); goto on_error; } if( character == escape_character ) { if( ( ewf_file_entry_path_index + 1 ) > safe_ewf_file_entry_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file entry path index value out of bounds.", function ); goto on_error; } safe_ewf_file_entry_path[ ewf_file_entry_path_index++ ] = escape_character; } else { if( ( path_index + 2 ) > path_length ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid path index value out of bounds.", function ); goto on_error; } hex_digit = path[ path_index++ ]; if( ( hex_digit >= (system_character_t) '0' ) && ( hex_digit <= (system_character_t) '9' ) ) { hex_value = hex_digit - (system_character_t) '0'; } #if defined( WINAPI ) else if( ( hex_digit >= (system_character_t) 'A' ) && ( hex_digit <= (system_character_t) 'F' ) ) { hex_value = hex_digit - (system_character_t) 'A' + 10; } #endif else if( ( hex_digit >= (system_character_t) 'a' ) && ( hex_digit <= (system_character_t) 'f' ) ) { hex_value = hex_digit - (system_character_t) 'a' + 10; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported path - invalid hexadecimal character: %" PRIc_SYSTEM " after escape character.", function, hex_digit ); goto on_error; } hex_value <<= 4; hex_digit = path[ path_index++ ]; if( ( hex_digit >= (system_character_t) '0' ) && ( hex_digit <= (system_character_t) '9' ) ) { hex_value |= hex_digit - (system_character_t) '0'; } #if defined( WINAPI ) else if( ( hex_digit >= (system_character_t) 'A' ) && ( hex_digit <= (system_character_t) 'F' ) ) { hex_value = hex_digit - (system_character_t) 'A' + 10; } #endif else if( ( hex_digit >= (system_character_t) 'a' ) && ( hex_digit <= (system_character_t) 'f' ) ) { hex_value |= hex_digit - (system_character_t) 'a' + 10; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported path - invalid hexadecimal character: %" PRIc_SYSTEM " after escape character.", function, hex_digit ); goto on_error; } #if defined( WINAPI ) if( ( hex_value == 0 ) || ( ( hex_value > 0x1f ) && ( hex_value != 0x5c ) && ( hex_value != 0x7f ) ) ) #else if( ( hex_value == 0 ) || ( ( hex_value > 0x1f ) && ( hex_value != 0x2f ) && ( hex_value != 0x7f ) ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid escaped character value out of bounds.", function ); goto on_error; } if( ( ewf_file_entry_path_index + 1 ) > safe_ewf_file_entry_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file entry path index value out of bounds.", function ); goto on_error; } safe_ewf_file_entry_path[ ewf_file_entry_path_index++ ] = hex_value; } } #if !defined( WINAPI ) else if( unicode_character == (system_character_t) '/' ) { if( ( ewf_file_entry_path_index + 1 ) > safe_ewf_file_entry_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file entry path index value out of bounds.", function ); goto on_error; } safe_ewf_file_entry_path[ ewf_file_entry_path_index++ ] = (system_character_t) '\\'; } #endif else { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_unicode_character_copy_to_utf16( unicode_character, (libuna_utf16_character_t *) safe_ewf_file_entry_path, safe_ewf_file_entry_path_size, &ewf_file_entry_path_index, error ); #else result = libuna_unicode_character_copy_to_utf8( unicode_character, (libuna_utf8_character_t *) safe_ewf_file_entry_path, safe_ewf_file_entry_path_size, &ewf_file_entry_path_index, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character to file entry path.", function ); goto on_error; } } } if( ewf_file_entry_path_index >= safe_ewf_file_entry_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file entry path index value out of bounds.", function ); goto on_error; } safe_ewf_file_entry_path[ ewf_file_entry_path_index ] = 0; *ewf_file_entry_path = safe_ewf_file_entry_path; *ewf_file_entry_path_size = safe_ewf_file_entry_path_size; return( 1 ); on_error: if( safe_ewf_file_entry_path != NULL ) { memory_free( safe_ewf_file_entry_path ); } return( -1 ); } /* Retrieves the file entry of a specific path * Returns 1 if successful, 0 if no such file entry or -1 on error */ int mount_file_system_get_file_entry_by_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, libewf_file_entry_t **ewf_file_entry, libcerror_error_t **error ) { system_character_t *ewf_file_entry_path = NULL; static char *function = "mount_file_system_get_file_entry_by_path"; size_t ewf_file_entry_path_length = 0; size_t ewf_file_entry_path_size = 0; int result = 0; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( mount_file_system_get_ewf_file_entry_path_from_path( file_system, path, path_length, &ewf_file_entry_path, &ewf_file_entry_path_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry path from path.", function ); goto on_error; } if( ewf_file_entry_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing file entry path.", function ); goto on_error; } ewf_file_entry_path_length = system_string_length( ewf_file_entry_path ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_get_file_entry_by_utf16_path( file_system->ewf_handle, (uint16_t *) ewf_file_entry_path, ewf_file_entry_path_length, ewf_file_entry, error ); #else result = libewf_file_get_file_entry_by_utf8_path( file_system->ewf_handle, (uint8_t *) ewf_file_entry_path, ewf_file_entry_path_length, ewf_file_entry, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry.", function ); goto on_error; } memory_free( ewf_file_entry_path ); return( result ); on_error: if( ewf_file_entry_path != NULL ) { memory_free( ewf_file_entry_path ); } return( -1 ); } /* Retrieves a filename from the name * Returns 1 if successful or -1 on error */ int mount_file_system_get_filename_from_name( mount_file_system_t *file_system, const system_character_t *name, size_t name_length, system_character_t **filename, size_t *filename_size, libcerror_error_t **error ) { system_character_t *safe_filename = NULL; static char *function = "mount_file_system_get_filename_from_name"; libuna_unicode_character_t unicode_character = 0; system_character_t escape_character = 0; system_character_t hex_digit = 0; size_t filename_index = 0; size_t name_index = 0; size_t safe_filename_size = 0; int result = 0; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( name_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid name length value exceeds maximum.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( filename_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename size.", function ); return( -1 ); } *filename = NULL; *filename_size = 0; safe_filename_size = ( name_length * 4 ) + 1; if( safe_filename_size > (size_t) ( SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid filename size value exceeds maximum.", function ); goto on_error; } safe_filename = system_string_allocate( safe_filename_size ); if( safe_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create filename.", function ); goto on_error; } #if defined( WINAPI ) escape_character = (system_character_t) '^'; #else escape_character = (system_character_t) '\\'; #endif while( name_index < name_length ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_unicode_character_copy_from_utf16( &unicode_character, (libuna_utf16_character_t *) name, name_length, &name_index, error ); #else result = libuna_unicode_character_copy_from_utf8( &unicode_character, (libuna_utf8_character_t *) name, name_length, &name_index, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character from name.", function ); goto on_error; } if( unicode_character == 0 ) { break; } /* On Windows replaces: * values <= 0x1f and 0x7f by ^x## * \ by ^x5c * ^ by ^^ * * On other platforms replaces: * values <= 0x1f and 0x7f by \x## * / by \x2f * \ by \\ */ #if defined( WINAPI ) if( ( unicode_character <= 0x1f ) || ( unicode_character == 0x5c ) || ( unicode_character == 0x7f ) ) #else if( ( unicode_character <= 0x1f ) || ( unicode_character == 0x2f ) || ( unicode_character == 0x7f ) ) #endif { if( ( filename_index + 4 ) > safe_filename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid filename index value out of bounds.", function ); goto on_error; } safe_filename[ filename_index++ ] = escape_character; safe_filename[ filename_index++ ] = (system_character_t) 'x'; hex_digit = unicode_character >> 4; if( hex_digit <= 0x09 ) { safe_filename[ filename_index++ ] = (system_character_t) '0' + hex_digit; } else { safe_filename[ filename_index++ ] = (system_character_t) 'a' + hex_digit - 10; } hex_digit = unicode_character & 0x0f; if( hex_digit <= 0x09 ) { safe_filename[ filename_index++ ] = (system_character_t) '0' + hex_digit; } else { safe_filename[ filename_index++ ] = (system_character_t) 'a' + hex_digit - 10; } } else if( unicode_character == (libuna_unicode_character_t) escape_character ) { if( ( filename_index + 2 ) > safe_filename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid filename index value out of bounds.", function ); goto on_error; } safe_filename[ filename_index++ ] = escape_character; safe_filename[ filename_index++ ] = escape_character; } else { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_unicode_character_copy_to_utf16( unicode_character, (libuna_utf16_character_t *) safe_filename, safe_filename_size, &filename_index, error ); #else result = libuna_unicode_character_copy_to_utf8( unicode_character, (libuna_utf8_character_t *) safe_filename, safe_filename_size, &filename_index, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, "%s: unable to copy Unicode character to filename.", function ); goto on_error; } } } if( filename_index >= safe_filename_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid filename index value out of bounds.", function ); goto on_error; } safe_filename[ filename_index ] = 0; *filename = safe_filename; *filename_size = safe_filename_size; return( 1 ); on_error: if( safe_filename != NULL ) { memory_free( safe_filename ); } return( -1 ); } /* Retrieves the filename from a file entry * Returns 1 if successful or -1 on error */ int mount_file_system_get_filename_from_file_entry( mount_file_system_t *file_system, libewf_file_entry_t *ewf_file_entry, system_character_t **filename, size_t *filename_size, libcerror_error_t **error ) { system_character_t *file_entry_name = NULL; static char *function = "mount_file_system_get_filename_from_file_entry"; size_t file_entry_name_size = 0; int result = 0; if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name_size( ewf_file_entry, &file_entry_name_size, error ); #else result = libewf_file_entry_get_utf8_name_size( ewf_file_entry, &file_entry_name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry name size.", function ); goto on_error; } if( ( file_entry_name_size == 0 ) || ( file_entry_name_size > SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid file entry name size value out of bounds.", function ); goto on_error; } file_entry_name = system_string_allocate( file_entry_name_size ); if( file_entry_name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file entry name string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( ewf_file_entry, (uint16_t *) file_entry_name, file_entry_name_size, error ); #else result = libewf_file_entry_get_utf8_name( ewf_file_entry, (uint8_t *) file_entry_name, file_entry_name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry name.", function ); goto on_error; } if( mount_file_system_get_filename_from_name( file_system, file_entry_name, file_entry_name_size - 1, filename, filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve a filename from the file entry name.", function ); goto on_error; } memory_free( file_entry_name ); return( 1 ); on_error: if( file_entry_name != NULL ) { memory_free( file_entry_name ); } return( -1 ); } libewf-20140807/ewftools/ewftools_libcfile.h0000664000175000017500000000266713440663046023060 0ustar00lordyestalordyesta00000000000000/* * The libcfile header wrapper * * Copyright (C) 2006-2018, 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_LIBCFILE_H ) #define _EWFTOOLS_LIBCFILE_H #include /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile */ #if defined( HAVE_LOCAL_LIBCFILE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCFILE_DLL_IMPORT * before including libcfile.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBCFILE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCFILE ) */ #endif /* !defined( _EWFTOOLS_LIBCFILE_H ) */ libewf-20140807/ewftools/ewftools_libsmraw.h0000664000175000017500000000257713421020221023104 0ustar00lordyestalordyesta00000000000000/* * The internal libsmraw header * * Copyright (C) 2006-2017, 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_LIBSMRAW_H ) #define _EWFTOOLS_LIBSMRAW_H #include #if defined( HAVE_LOCAL_LIBSMRAW ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBSMRAW_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBSMRAW_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBSMRAW ) */ #endif /* !defined( _EWFTOOLS_LIBSMRAW_H ) */ libewf-20140807/ewftools/ewftools_signal.c0000664000175000017500000001303513440662654022552 0ustar00lordyestalordyesta00000000000000/* * Signal handling functions * * Copyright (C) 2006-2019, 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 . */ #include #include #if defined( HAVE_SIGNAL_H ) #include #endif #if defined( _MSC_VER ) #include #endif #include "ewftools_libcerror.h" #include "ewftools_signal.h" #if defined( WINAPI ) void (*ewftools_signal_signal_handler)( ewftools_signal_t ) = NULL; /* Signal handler for Ctrl+C or Ctrl+Break signals */ BOOL WINAPI ewftools_signal_handler( unsigned long signal ) { static char *function = "ewftools_signal_handler"; switch( signal ) { /* use Ctrl+C or Ctrl+Break to simulate SERVICE_CONTROL_STOP in debug mode */ case CTRL_BREAK_EVENT: case CTRL_C_EVENT: if( ewftools_signal_signal_handler != NULL ) { ewftools_signal_signal_handler( signal ); } return( TRUE ); default: break; } return( FALSE ); } #if defined( _MSC_VER ) /* Initialize memory usage and leakage debugging */ void ewftools_signal_initialize_memory_debug( void ) { int flag = 0; /* Get the current state of the flag and store it in a temporary variable */ flag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); /* Turn on client block identifiers and automatic leak detection */ flag |= ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); /* Set the new state for the flag */ _CrtSetDbgFlag( flag ); } #endif /* defined( _MSC_VER ) */ /* Attaches a signal handler for Ctrl+C or Ctrl+Break signals * Returns 1 if successful or -1 on error */ int ewftools_signal_attach( void (*signal_handler)( ewftools_signal_t ), libcerror_error_t **error ) { static char *function = "ewftools_signal_attach"; if( signal_handler == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid signal handler.", function ); return( -1 ); } ewftools_signal_signal_handler = signal_handler; if( SetConsoleCtrlHandler( ewftools_signal_handler, TRUE ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to attach signal handler.", function ); return( -1 ); } if( SetConsoleCtrlHandler( NULL, FALSE ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to attach break signal.", function ); return( -1 ); } #if defined( _MSC_VER ) ewftools_signal_initialize_memory_debug(); #endif SetErrorMode( SEM_FAILCRITICALERRORS ); #if defined( LOCALE_SUPPORT ) /* Allow subsequent threads to have their own locale. * If the application is single threaded this call has * no practical effect. */ _configthreadlocale( _ENABLE_PER_THREAD_LOCALE ); /* Set the current thread locale to the user default * ANSI code page. */ setlocale( LC_ALL, "" ); /* Set the the code page used by multibyte functions * to use the same code page as the previous call to setlocale. */ _setmbcp( _MB_CP_LOCALE ); #endif /* defined( LOCALE_SUPPORT ) */ return( 1 ); } /* Detaches a signal handler for Ctrl+C or Ctrl+Break signals * Returns 1 if successful or -1 on error */ int ewftools_signal_detach( libcerror_error_t **error ) { static char *function = "ewftools_signal_detach"; if( SetConsoleCtrlHandler( ewftools_signal_handler, FALSE ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to detach signal handler.", function ); return( -1 ); } ewftools_signal_signal_handler = NULL; return( 1 ); } #else /* Attaches a signal handler for SIGINT * Returns 1 if successful or -1 on error */ int ewftools_signal_attach( void (*signal_handler)( ewftools_signal_t ), libcerror_error_t **error ) { static char *function = "ewftools_signal_attach"; if( signal_handler == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid signal handler.", function ); return( -1 ); } if( signal( SIGINT, signal_handler ) == SIG_ERR ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to attach signal handler.", function ); return( -1 ); } return( 1 ); } /* Detaches a signal handler for SIGINT * Returns 1 if successful or -1 on error */ int ewftools_signal_detach( libcerror_error_t **error ) { static char *function = "ewftools_signal_detach"; if( signal( SIGINT, SIG_DFL ) == SIG_ERR ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to detach signal handler.", function ); return( -1 ); } return( 1 ); } #endif /* defined( WINAPI ) */ libewf-20140807/ewftools/device_handle.c0000664000175000017500000021036213421024433022111 0ustar00lordyestalordyesta00000000000000/* * Device handle * * 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 . */ #include #include #include #include #include #include #include "byte_size_string.h" #include "device_handle.h" #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "ewftools_libodraw.h" #include "ewftools_libsmdev.h" #include "ewftools_libsmraw.h" #include "ewftools_system_string.h" #include "storage_media_buffer.h" #define DEVICE_HANDLE_INPUT_BUFFER_SIZE 64 #define DEVICE_HANDLE_STRING_SIZE 1024 #define DEVICE_HANDLE_VALUE_SIZE 512 #define DEVICE_HANDLE_NOTIFY_STREAM stdout /* Retrieves the track type * Returns a string represenation of the track type */ const char *device_handle_get_track_type( uint8_t track_type ) { switch( track_type ) { case DEVICE_HANDLE_TRACK_TYPE_AUDIO: return( "audio" ); case DEVICE_HANDLE_TRACK_TYPE_CDG: return( "CD+G" ); case DEVICE_HANDLE_TRACK_TYPE_MODE1_2048: return( "mode1/2048" ); case DEVICE_HANDLE_TRACK_TYPE_MODE1_2352: return( "mode1/2352" ); case DEVICE_HANDLE_TRACK_TYPE_MODE2_2048: return( "mode2/2048" ); case DEVICE_HANDLE_TRACK_TYPE_MODE2_2324: return( "mode2/2324" ); case DEVICE_HANDLE_TRACK_TYPE_MODE2_2336: return( "mode2/2336" ); case DEVICE_HANDLE_TRACK_TYPE_MODE2_2352: return( "mode2/2352" ); case DEVICE_HANDLE_TRACK_TYPE_CDI_2336: return( "CDI/2336" ); case DEVICE_HANDLE_TRACK_TYPE_CDI_2352: return( "CDI/2352" ); default: break; } return( "UNKNOWN" ); } /* Creates a device handle * Make sure the value device_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int device_handle_initialize( device_handle_t **device_handle, libcerror_error_t **error ) { static char *function = "device_handle_initialize"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( *device_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid device handle value already set.", function ); return( -1 ); } *device_handle = memory_allocate_structure( device_handle_t ); if( *device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create device handle.", function ); goto on_error; } if( memory_set( *device_handle, 0, sizeof( device_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear device handle.", function ); memory_free( *device_handle ); *device_handle = NULL; return( -1 ); } ( *device_handle )->input_buffer = system_string_allocate( DEVICE_HANDLE_INPUT_BUFFER_SIZE ); if( ( *device_handle )->input_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create input buffer.", function ); goto on_error; } if( memory_set( ( *device_handle )->input_buffer, 0, sizeof( system_character_t ) * DEVICE_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear device handle.", function ); goto on_error; } ( *device_handle )->number_of_error_retries = 2; ( *device_handle )->notify_stream = DEVICE_HANDLE_NOTIFY_STREAM; return( 1 ); on_error: if( *device_handle != NULL ) { if( ( *device_handle )->input_buffer != NULL ) { memory_free( ( *device_handle )->input_buffer ); } memory_free( *device_handle ); *device_handle = NULL; } return( -1 ); } /* Frees a device handle * Returns 1 if successful or -1 on error */ int device_handle_free( device_handle_t **device_handle, libcerror_error_t **error ) { static char *function = "device_handle_free"; int result = 1; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( *device_handle != NULL ) { memory_free( ( *device_handle )->input_buffer ); if( ( *device_handle )->toc_filename != NULL ) { memory_free( ( *device_handle )->toc_filename ); } if( ( *device_handle )->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( ( *device_handle )->smdev_input_handle != NULL ) { if( libsmdev_handle_free( &( ( *device_handle )->smdev_input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free device input handle.", function ); result = -1; } } } else if( ( *device_handle )->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( ( *device_handle )->odraw_input_handle != NULL ) { if( libodraw_handle_free( &( ( *device_handle )->odraw_input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free optical disc raw input handle.", function ); result = -1; } } } else if( ( *device_handle )->type == DEVICE_HANDLE_TYPE_FILE ) { if( ( *device_handle )->smraw_input_handle != NULL ) { if( libsmraw_handle_free( &( ( *device_handle )->smraw_input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free raw input handle.", function ); result = -1; } } } memory_free( *device_handle ); *device_handle = NULL; } return( result ); } /* Signals the device handle to abort * Returns 1 if successful or -1 on error */ int device_handle_signal_abort( device_handle_t *device_handle, libcerror_error_t **error ) { static char *function = "device_handle_signal_abort"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( device_handle->smdev_input_handle != NULL ) { if( libsmdev_handle_signal_abort( device_handle->smdev_input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal device input handle to abort.", function ); return( -1 ); } } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( device_handle->odraw_input_handle != NULL ) { if( libodraw_handle_signal_abort( device_handle->odraw_input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal optical disc raw input handle to abort.", function ); return( -1 ); } } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( device_handle->smraw_input_handle != NULL ) { if( libsmraw_handle_signal_abort( device_handle->smraw_input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal raw input handle to abort.", function ); return( -1 ); } } } return( 1 ); } /* Opens the input of the device handle * Returns 1 if successful or -1 on error */ int device_handle_open_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { static char *function = "device_handle_open_input"; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames == 1 ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmdev_check_device_wide( filenames[ 0 ], error ); #else result = libsmdev_check_device( filenames[ 0 ], error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if filename is a device.", function ); return( -1 ); } } if( result != 0 ) { device_handle->type = DEVICE_HANDLE_TYPE_DEVICE; } else if( device_handle->toc_filename != NULL ) { device_handle->type = DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE; } else { device_handle->type = DEVICE_HANDLE_TYPE_FILE; } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( device_handle_open_smdev_input( device_handle, filenames, number_of_filenames, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open device input.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( device_handle_open_odraw_input( device_handle, filenames, number_of_filenames, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open optical disc raw input.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( device_handle_open_smraw_input( device_handle, filenames, number_of_filenames, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open raw input.", function ); return( -1 ); } } return( 1 ); } /* Opens the device input of the device handle * Returns 1 if successful or -1 on error */ int device_handle_open_smdev_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { static char *function = "device_handle_open_smdev_input"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->smdev_input_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid device handle - device input handle already set.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of filenames value out of bounds.", function ); goto on_error; } if( libsmdev_handle_initialize( &( device_handle->smdev_input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create device input handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libsmdev_handle_open_wide( device_handle->smdev_input_handle, filenames[ 0 ], LIBSMDEV_OPEN_READ, error ) != 1 ) #else if( libsmdev_handle_open( device_handle->smdev_input_handle, filenames[ 0 ], LIBSMDEV_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open device input handle.", function ); goto on_error; } return( 1 ); on_error: if( device_handle->smdev_input_handle != NULL ) { libsmdev_handle_free( &( device_handle->smdev_input_handle ), NULL ); } return( -1 ); } /* Opens the optical disc raw input of the device handle * Returns 1 if successful or -1 on error */ int device_handle_open_odraw_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { libodraw_data_file_t *data_file = NULL; static char *function = "device_handle_open_odraw_input"; size_t filename_length = 0; int data_file_index = 0; int number_of_data_files = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( device_handle->odraw_input_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid device handle - optical disc raw input handle already set.", function ); return( -1 ); } if( libodraw_handle_initialize( &( device_handle->odraw_input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create optical disc raw input handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libodraw_handle_open_wide( device_handle->odraw_input_handle, device_handle->toc_filename, LIBODRAW_OPEN_READ, error ) != 1 ) #else if( libodraw_handle_open( device_handle->odraw_input_handle, device_handle->toc_filename, LIBODRAW_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open optical disc raw table of contents file.", function ); goto on_error; } if( libodraw_handle_get_number_of_data_files( device_handle->odraw_input_handle, &number_of_data_files, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of optical disc raw data files.", function ); goto on_error; } if( number_of_filenames != number_of_data_files ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of filenames does not match number of data files.", function ); goto on_error; } for( data_file_index = 0; data_file_index < number_of_data_files; data_file_index++ ) { if( filenames[ data_file_index ] == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing filename: %d.", function, data_file_index ); return( -1 ); } filename_length = system_string_length( filenames[ data_file_index ] ); if( libodraw_handle_get_data_file( device_handle->odraw_input_handle, data_file_index, &data_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve optical disc raw data file: %d.", function, data_file_index ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libodraw_data_file_set_filename_wide( data_file, filenames[ data_file_index ], filename_length, error ) != 1 ) #else if( libodraw_data_file_set_filename( data_file, filenames[ data_file_index ], filename_length, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set filename in optical disc raw data file: %d.", function, data_file_index ); goto on_error; } if( libodraw_data_file_free( &data_file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free optical disc raw data file: %d.", function, data_file_index ); goto on_error; } } if( libodraw_handle_open_data_files( device_handle->odraw_input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open optical disc raw data files.", function ); goto on_error; } return( 1 ); on_error: if( data_file != NULL ) { libodraw_data_file_free( &data_file, error ); } if( device_handle->odraw_input_handle != NULL ) { libodraw_handle_free( &( device_handle->odraw_input_handle ), NULL ); } return( -1 ); } /* Opens the raw input of the device handle * Returns 1 if successful or -1 on error */ int device_handle_open_smraw_input( device_handle_t *device_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { static char *function = "device_handle_open_smraw_input"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( device_handle->smraw_input_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid device handle - raw input handle already set.", function ); return( -1 ); } if( libsmraw_handle_initialize( &( device_handle->smraw_input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create raw input handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libsmraw_handle_open_wide( device_handle->smraw_input_handle, (wchar_t * const *) filenames, number_of_filenames, LIBSMDEV_OPEN_READ, error ) != 1 ) #else if( libsmraw_handle_open( device_handle->smraw_input_handle, (char * const *) filenames, number_of_filenames, LIBSMDEV_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open raw input handle.", function ); goto on_error; } return( 1 ); on_error: if( device_handle->smraw_input_handle != NULL ) { libsmraw_handle_free( &( device_handle->smraw_input_handle ), NULL ); } return( -1 ); } /* Closes the device handle * Returns the 0 if succesful or -1 on error */ int device_handle_close( device_handle_t *device_handle, libcerror_error_t **error ) { static char *function = "device_handle_close"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_close( device_handle->smdev_input_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_close( device_handle->odraw_input_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( libsmraw_handle_close( device_handle->smraw_input_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close raw input handle.", function ); return( -1 ); } } return( 0 ); } /* Reads a buffer from the input of the device handle * Returns the number of bytes written or -1 on error */ ssize_t device_handle_read_buffer( device_handle_t *device_handle, uint8_t *buffer, size_t read_size, libcerror_error_t **error ) { static char *function = "device_handle_read_buffer"; ssize_t read_count = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { read_count = libsmdev_handle_read_buffer( device_handle->smdev_input_handle, buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { read_count = libodraw_handle_read_buffer( device_handle->odraw_input_handle, buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { read_count = libsmraw_handle_read_buffer( device_handle->smraw_input_handle, buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer from raw input handle.", function ); return( -1 ); } } return( read_count ); } /* Seeks the offset in the input file * Returns the new offset if successful or -1 on error */ off64_t device_handle_seek_offset( device_handle_t *device_handle, off64_t offset, int whence, libcerror_error_t **error ) { static char *function = "device_handle_seek_offset"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { offset = libsmdev_handle_seek_offset( device_handle->smdev_input_handle, offset, whence, error ); if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { offset = libodraw_handle_seek_offset( device_handle->odraw_input_handle, offset, whence, error ); if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { offset = libsmraw_handle_seek_offset( device_handle->smraw_input_handle, offset, whence, error ); if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in raw input handle.", function ); return( -1 ); } } return( offset ); } /* Prompts the user for a string * Returns 1 if successful, 0 if no input was provided or -1 on error */ int device_handle_prompt_for_string( device_handle_t *device_handle, const system_character_t *request_string, system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { static char *function = "device_handle_prompt_for_string"; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; *internal_string_size = 0; } *internal_string_size = DEVICE_HANDLE_STRING_SIZE; *internal_string = system_string_allocate( *internal_string_size ); if( *internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create internal string.", function ); goto on_error; } if( memory_set( *internal_string, 0, *internal_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear internal string.", function ); goto on_error; } result = ewfinput_get_string_variable( device_handle->notify_stream, request_string, *internal_string, *internal_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string variable.", function ); goto on_error; } return( result ); on_error: if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; } *internal_string_size = 0; return( -1 ); } /* Prompts the user for the number of error retries * Returns 1 if successful, 0 if no input was provided or -1 on error */ int device_handle_prompt_for_number_of_error_retries( device_handle_t *device_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "device_handle_prompt_for_number_of_error_retries"; uint64_t size_variable = 0; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } result = ewfinput_get_size_variable( device_handle->notify_stream, device_handle->input_buffer, DEVICE_HANDLE_INPUT_BUFFER_SIZE, request_string, 0, 255, device_handle->number_of_error_retries, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } else if( result != 0 ) { device_handle->number_of_error_retries = (uint8_t) size_variable; } return( result ); } /* Prompts the user for the zero buffer on error * Returns 1 if successful, 0 if no input was provided or -1 on error */ int device_handle_prompt_for_zero_buffer_on_error( device_handle_t *device_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "device_handle_prompt_for_zero_buffer_on_error"; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( ewfinput_get_fixed_string_variable( device_handle->notify_stream, device_handle->input_buffer, DEVICE_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_yes_no, 2, 1, &fixed_string_variable, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } result = ewfinput_determine_yes_no( fixed_string_variable, &( device_handle->zero_buffer_on_error ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine zero buffer on error.", function ); return( -1 ); } return( result ); } /* Retrieves the type * Returns 1 if successful or -1 on error */ int device_handle_get_type( device_handle_t *device_handle, uint8_t *type, libcerror_error_t **error ) { static char *function = "device_handle_get_type"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid type.", function ); return( -1 ); } *type = device_handle->type; return( 1 ); } /* Retrieves the media size * Returns 1 if successful or -1 on error */ int device_handle_get_media_size( device_handle_t *device_handle, size64_t *media_size, libcerror_error_t **error ) { static char *function = "device_handle_get_media_size"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_media_size( device_handle->smdev_input_handle, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size from device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_get_media_size( device_handle->odraw_input_handle, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size from optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( libsmraw_handle_get_media_size( device_handle->smraw_input_handle, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size from raw input handle.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the media type * Returns 1 if successful or -1 on error */ int device_handle_get_media_type( device_handle_t *device_handle, uint8_t *media_type, libcerror_error_t **error ) { static char *function = "device_handle_get_media_type"; uint8_t smdev_media_type = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( media_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media type.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_media_type( device_handle->smdev_input_handle, &smdev_media_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media type.", function ); return( -1 ); } switch( smdev_media_type ) { case LIBSMDEV_MEDIA_TYPE_REMOVABLE: *media_type = DEVICE_HANDLE_MEDIA_TYPE_REMOVABLE; break; case LIBSMDEV_MEDIA_TYPE_FIXED: *media_type = DEVICE_HANDLE_MEDIA_TYPE_FIXED; break; case LIBSMDEV_MEDIA_TYPE_OPTICAL: *media_type = DEVICE_HANDLE_MEDIA_TYPE_OPTICAL; break; case LIBSMDEV_MEDIA_TYPE_MEMORY: *media_type = DEVICE_HANDLE_MEDIA_TYPE_MEMORY; break; } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { *media_type = DEVICE_HANDLE_MEDIA_TYPE_OPTICAL; } return( 1 ); } /* Retrieves the number of bytes per sector * Returns 1 if successful or -1 on error */ int device_handle_get_bytes_per_sector( device_handle_t *device_handle, uint32_t *bytes_per_sector, libcerror_error_t **error ) { static char *function = "device_handle_get_bytes_per_sector"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_bytes_per_sector( device_handle->smdev_input_handle, bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector from device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_get_bytes_per_sector( device_handle->odraw_input_handle, bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector from optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( libsmraw_handle_get_bytes_per_sector( device_handle->smraw_input_handle, bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector from raw input handle.", function ); return( -1 ); } if( *bytes_per_sector == 0 ) { *bytes_per_sector = 512; } } return( 1 ); } /* Retrieves the information value by identifier * Returns 1 if successful, 0 if value not present or -1 on error */ int device_handle_get_information_value( device_handle_t *device_handle, const uint8_t *information_value_identifier, size_t information_value_identifier_length, system_character_t *information_value, size_t information_value_size, libcerror_error_t **error ) { static char *function = "device_handle_get_information_value"; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmdev_handle_get_utf16_information_value( device_handle->smdev_input_handle, information_value_identifier, information_value_identifier_length, (uint16_t *) information_value, information_value_size, error ); #else result = libsmdev_handle_get_utf8_information_value( device_handle->smdev_input_handle, information_value_identifier, information_value_identifier_length, (uint8_t *) information_value, information_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve information value: %s from device input handle.", function, (char *) information_value_identifier ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { result = 0; } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmraw_handle_get_utf16_information_value( device_handle->smraw_input_handle, information_value_identifier, information_value_identifier_length, (uint16_t *) information_value, information_value_size, error ); #else result = libsmraw_handle_get_utf8_information_value( device_handle->smraw_input_handle, information_value_identifier, information_value_identifier_length, (uint8_t *) information_value, information_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve information value: %s from raw input handle.", function, (char *) information_value_identifier ); return( -1 ); } } return( result ); } /* Retrieves the number of sessions * Returns 1 if successful or -1 on error */ int device_handle_get_number_of_sessions( device_handle_t *device_handle, int *number_of_sessions, libcerror_error_t **error ) { static char *function = "device_handle_get_number_of_sessions"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_number_of_sessions( device_handle->smdev_input_handle, number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sessions from device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_get_number_of_sessions( device_handle->odraw_input_handle, number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sessions from optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( number_of_sessions == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sessions raw input handle.", function ); return( -1 ); } *number_of_sessions = 0; } return( 1 ); } /* Retrieves the information of a session * Returns 1 if successful or -1 on error */ int device_handle_get_session( device_handle_t *device_handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, libcerror_error_t **error ) { static char *function = "device_handle_get_session"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_session( device_handle->smdev_input_handle, index, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %d from device input handle.", function, index ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_get_session( device_handle->odraw_input_handle, index, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %d from optical disc raw input handle.", function, index ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid index value out of bounds.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of tracks * Returns 1 if successful or -1 on error */ int device_handle_get_number_of_tracks( device_handle_t *device_handle, int *number_of_tracks, libcerror_error_t **error ) { static char *function = "device_handle_get_number_of_tracks"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_number_of_tracks( device_handle->smdev_input_handle, number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of tracks from device input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_get_number_of_tracks( device_handle->odraw_input_handle, number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of tracks from optical disc raw input handle.", function ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { if( number_of_tracks == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of tracks raw input handle.", function ); return( -1 ); } *number_of_tracks = 0; } return( 1 ); } /* Retrieves the information of a track * Returns 1 if successful or -1 on error */ int device_handle_get_track( device_handle_t *device_handle, int index, uint64_t *start_sector, uint64_t *number_of_sectors, uint8_t *type, libcerror_error_t **error ) { static char *function = "device_handle_get_track"; uint64_t data_file_start_sector = 0; int data_file_index = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_track( device_handle->smdev_input_handle, index, start_sector, number_of_sectors, type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %d from device input handle.", function, index ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) { if( libodraw_handle_get_track( device_handle->odraw_input_handle, index, start_sector, number_of_sectors, type, &data_file_index, &data_file_start_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %d from optical disc raw input handle.", function, index ); return( -1 ); } } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid index value out of bounds.", function ); return( -1 ); } return( 1 ); } /* Sets a string * Returns 1 if successful or -1 on error */ int device_handle_set_string( device_handle_t *device_handle, const system_character_t *string, system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { static char *function = "device_handle_set_string"; size_t string_length = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; *internal_string_size = 0; } string_length = system_string_length( string ); if( string_length > 0 ) { *internal_string = system_string_allocate( string_length + 1 ); if( *internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create internal string.", function ); goto on_error; } if( system_string_copy( *internal_string, string, string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string.", function ); goto on_error; } ( *internal_string )[ string_length ] = 0; *internal_string_size = string_length + 1; } return( 1 ); on_error: if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; } *internal_string_size = 0; return( -1 ); } /* Sets the number of error retries * Returns 1 if successful or -1 on error */ int device_handle_set_number_of_error_retries( device_handle_t *device_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "device_handle_set_number_of_error_retries"; size_t string_length = 0; uint64_t size_variable = 0; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( string, string_length + 1, &size_variable, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine number of error retries.", function ); return( -1 ); } if( size_variable > (uint64_t) UINT8_MAX ) { result = 0; } else { device_handle->number_of_error_retries = (uint8_t) size_variable; } return( result ); } /* Sets the error values * Returns 1 if successful or -1 on error */ int device_handle_set_error_values( device_handle_t *device_handle, size_t error_granularity, libcerror_error_t **error ) { static char *function = "device_handle_set_error_values"; uint8_t error_flags = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_set_number_of_error_retries( device_handle->smdev_input_handle, device_handle->number_of_error_retries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set number of error retries in device input handle.", function ); return( -1 ); } if( libsmdev_handle_set_error_granularity( device_handle->smdev_input_handle, error_granularity, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set error granularity in device input handle.", function ); return( -1 ); } if( device_handle->zero_buffer_on_error != 0 ) { error_flags = LIBSMDEV_ERROR_FLAG_ZERO_ON_ERROR; } if( libsmdev_handle_set_error_flags( device_handle->smdev_input_handle, error_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set error flags in device input handle.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the number of read errors * Returns 1 if successful or -1 on error */ int device_handle_get_number_of_read_errors( device_handle_t *device_handle, int *number_of_read_errors, libcerror_error_t **error ) { static char *function = "device_handle_get_number_of_read_errors"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_number_of_errors( device_handle->smdev_input_handle, number_of_read_errors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of read errors.", function ); return( -1 ); } } else if( ( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) || ( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) ) { if( number_of_read_errors == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of read errors.", function ); return( -1 ); } *number_of_read_errors = 0; } return( 1 ); } /* Retrieves the information of a read error * Returns 1 if successful or -1 on error */ int device_handle_get_read_error( device_handle_t *device_handle, int index, off64_t *offset, size64_t *size, libcerror_error_t **error ) { static char *function = "device_handle_get_read_error"; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { if( libsmdev_handle_get_error( device_handle->smdev_input_handle, index, offset, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve read error: %d.", function, index ); return( -1 ); } } else if( ( device_handle->type == DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE ) || ( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid index value out of bounds.", function ); return( -1 ); } return( 1 ); } /* Print the media information to a stream * Returns 1 if successful or -1 on error */ int device_handle_media_information_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ) { uint8_t media_information_value[ 64 ]; system_character_t byte_size_string[ 16 ]; static char *function = "device_handle_media_information_fprint"; size64_t media_size = 0; uint32_t bytes_per_sector = 0; uint8_t bus_type = 0; uint8_t media_type = 0; int result = 0; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { fprintf( stream, "Device information:\n" ); if( libsmdev_handle_get_bus_type( device_handle->smdev_input_handle, &bus_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bus type.", function ); return( -1 ); } fprintf( stream, "Bus type:\t\t\t\t" ); switch( bus_type ) { case LIBSMDEV_BUS_TYPE_ATA: fprintf( stream, "ATA/ATAPI" ); break; case LIBSMDEV_BUS_TYPE_FIREWIRE: fprintf( stream, "FireWire (IEEE1394)" ); break; case LIBSMDEV_BUS_TYPE_SCSI: fprintf( stream, "SCSI" ); break; case LIBSMDEV_BUS_TYPE_USB: fprintf( stream, "USB" ); break; } fprintf( stream, "\n" ); result = libsmdev_handle_get_utf8_information_value( device_handle->smdev_input_handle, (uint8_t *) "vendor", 6, media_information_value, 64, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media information value: vendor.", function ); return( -1 ); } else if( result == 0 ) { media_information_value[ 0 ] = 0; } fprintf( stream, "Vendor:\t\t\t\t\t%s\n", (char *) media_information_value ); result = libsmdev_handle_get_utf8_information_value( device_handle->smdev_input_handle, (uint8_t *) "model", 5, media_information_value, 64, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media information value: model.", function ); return( -1 ); } else if( result == 0 ) { media_information_value[ 0 ] = 0; } fprintf( stream, "Model:\t\t\t\t\t%s\n", (char *) media_information_value ); result = libsmdev_handle_get_utf8_information_value( device_handle->smdev_input_handle, (uint8_t *) "serial_number", 13, media_information_value, 64, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media information value: serial_number.", function ); return( -1 ); } else if( result == 0 ) { media_information_value[ 0 ] = 0; } fprintf( stream, "Serial:\t\t\t\t\t%s\n", (char *) media_information_value ); fprintf( stream, "\n" ); } fprintf( stream, "Storage media information:\n" ); fprintf( stream, "Type:\t\t\t\t\t" ); switch( device_handle->type ) { case DEVICE_HANDLE_TYPE_DEVICE: fprintf( stream, "Device" ); break; case DEVICE_HANDLE_TYPE_OPTICAL_DISC_FILE: fprintf( stream, "Optical disc RAW image" ); break; case DEVICE_HANDLE_TYPE_FILE: fprintf( stream, "RAW image" ); break; default: fprintf( stream, "unknown" ); break; } fprintf( stream, "\n" ); if( device_handle_get_media_type( device_handle, &media_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media type.", function ); return( -1 ); } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { fprintf( stream, "Media type:\t\t\t\t" ); switch( media_type ) { case DEVICE_HANDLE_MEDIA_TYPE_REMOVABLE: fprintf( stream, "Removable" ); break; case DEVICE_HANDLE_MEDIA_TYPE_FIXED: fprintf( stream, "Fixed" ); break; case DEVICE_HANDLE_MEDIA_TYPE_OPTICAL: fprintf( stream, "Optical" ); break; case DEVICE_HANDLE_MEDIA_TYPE_MEMORY: fprintf( stream, "Memory" ); break; default: fprintf( stream, "unknown" ); break; } fprintf( stream, "\n" ); } if( device_handle_get_media_size( device_handle, &media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); return( -1 ); } result = byte_size_string_create( byte_size_string, 16, media_size, BYTE_SIZE_STRING_UNIT_MEGABYTE, NULL ); if( result == 1 ) { fprintf( stream, "Media size:\t\t\t\t%" PRIs_SYSTEM " (%" PRIu64 " bytes)\n", byte_size_string, media_size ); } else { fprintf( stream, "Media size:\t\t\t\t%" PRIu64 " bytes\n", media_size ); } if( device_handle_get_bytes_per_sector( device_handle, &bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); return( -1 ); } fprintf( stream, "Bytes per sector:\t\t\t%" PRIu32 "\n", bytes_per_sector ); if( media_type == DEVICE_HANDLE_MEDIA_TYPE_OPTICAL ) { if( device_handle_sessions_fprint( device_handle, stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print sessions.", function ); return( -1 ); } if( device_handle_tracks_fprint( device_handle, stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print tracks.", function ); return( -1 ); } } else { fprintf( stream, "\n" ); } return( 1 ); } /* Print the read errors to a stream * Returns 1 if successful or -1 on error */ int device_handle_read_errors_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ) { static char *function = "device_handle_read_errors_fprint"; off64_t read_error_offset = 0; size64_t read_error_size = 0; uint32_t bytes_per_sector = 0; int number_of_read_errors = 0; int read_error_index = 0; int result = 1; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( device_handle_get_bytes_per_sector( device_handle, &bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); return( -1 ); } if( bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid bytes per sector returned.", function ); return( -1 ); } if( device_handle_get_number_of_read_errors( device_handle, &number_of_read_errors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of read errors.", function ); return( -1 ); } if( number_of_read_errors > 0 ) { fprintf( stream, "Errors reading device:\n" ); fprintf( stream, "\ttotal number: %d\n", number_of_read_errors ); for( read_error_index = 0; read_error_index < number_of_read_errors; read_error_index++ ) { if( device_handle_get_read_error( device_handle, read_error_index, &read_error_offset, &read_error_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve read error: %d.", function, read_error_index ); result = -1; } else { fprintf( stream, "\tat sector(s): %" PRIi64 " - %" PRIi64 " number: %" PRIu64 " (offset: 0x%08" PRIx64 " of size: %" PRIu64 ")\n", read_error_offset / bytes_per_sector, ( read_error_offset + read_error_size ) / bytes_per_sector, read_error_size / bytes_per_sector, read_error_offset, read_error_size ); } } fprintf( stream, "\n" ); } return( result ); } /* Print the sessions to a stream * Returns 1 if successful or -1 on error */ int device_handle_sessions_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ) { static char *function = "device_handle_sessions_fprint"; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; int number_of_sessions = 0; int session_index = 0; int result = 1; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( device_handle_get_number_of_sessions( device_handle, &number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sessions.", function ); return( -1 ); } if( number_of_sessions > 0 ) { fprintf( stream, "Sessions:\n" ); fprintf( stream, "\ttotal number: %d\n", number_of_sessions ); for( session_index = 0; session_index < number_of_sessions; session_index++ ) { if( device_handle_get_session( device_handle, session_index, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %d.", function, session_index ); start_sector = 0; number_of_sectors = 0; result = -1; } last_sector = start_sector + number_of_sectors; if( number_of_sectors != 0 ) { last_sector -= 1; } fprintf( stream, "\tat sector(s): %" PRIu64 " - %" PRIu64 " number: %" PRIu64 "\n", start_sector, last_sector, number_of_sectors ); } fprintf( stream, "\n" ); } return( result ); } /* Print the tracks to a stream * Returns 1 if successful or -1 on error */ int device_handle_tracks_fprint( device_handle_t *device_handle, FILE *stream, libcerror_error_t **error ) { static char *function = "device_handle_tracks_fprint"; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; uint8_t type = 0; int number_of_tracks = 0; int track_index = 0; int result = 1; if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( device_handle_get_number_of_tracks( device_handle, &number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of tracks.", function ); return( -1 ); } if( number_of_tracks > 0 ) { fprintf( stream, "Tracks:\n" ); fprintf( stream, "\ttotal number: %d\n", number_of_tracks ); for( track_index = 0; track_index < number_of_tracks; track_index++ ) { if( device_handle_get_track( device_handle, track_index, &start_sector, &number_of_sectors, &type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %d.", function, track_index ); start_sector = 0; number_of_sectors = 0; type = 0; result = -1; } fprintf( stream, "\t" ); fprintf( stream, "type: %s", device_handle_get_track_type( type ) ); last_sector = start_sector + number_of_sectors; if( number_of_sectors != 0 ) { last_sector -= 1; } fprintf( stream, " at sector(s): %" PRIu64 " - %" PRIu64 " number: %" PRIu64 "\n", start_sector, last_sector, number_of_sectors ); } fprintf( stream, "\n" ); } return( result ); } libewf-20140807/ewftools/verification_handle.h0000664000175000017500000002037713421024433023346 0ustar00lordyestalordyesta00000000000000/* * Verification handle * * 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( _VERIFICATION_HANDLE_H ) #define _VERIFICATION_HANDLE_H #include #include #include "digest_hash.h" #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "log_handle.h" #include "storage_media_buffer.h" #if defined( __cplusplus ) extern "C" { #endif enum VERIFICATION_HANDLE_INPUT_FORMATS { VERIFICATION_HANDLE_INPUT_FORMAT_FILES = (int) 'f', VERIFICATION_HANDLE_INPUT_FORMAT_RAW = (int) 'r' }; typedef struct verification_handle verification_handle_t; struct verification_handle { /* The input format */ uint8_t input_format; /* The header codepage */ int header_codepage; /* Value to indicate if the chunk should be zeroed on error */ uint8_t zero_chunk_on_error; /* Value to indicate if the MD5 digest hash should be calculated */ uint8_t calculate_md5; /* The MD5 digest context */ libhmac_md5_context_t *md5_context; /* Value to indicate the MD5 digest context was initialized */ uint8_t md5_context_initialized; /* The calculated MD5 digest hash string */ system_character_t *calculated_md5_hash_string; /* Value to indicate a stored MD5 digest hash is available */ int stored_md5_hash_available; /* The stored MD5 digest hash string */ system_character_t *stored_md5_hash_string; /* Value to indicate if the SHA1 digest hash should be calculated */ uint8_t calculate_sha1; /* The SHA1 digest context */ libhmac_sha1_context_t *sha1_context; /* Value to indicate the SHA1 digest context was initialized */ uint8_t sha1_context_initialized; /* The calculated SHA1 digest hash string */ system_character_t *calculated_sha1_hash_string; /* Value to indicate a stored SHA1 digest hash is available */ int stored_sha1_hash_available; /* The stored SHA1 digest hash string */ system_character_t *stored_sha1_hash_string; /* Value to indicate if the SHA256 digest hash should be calculated */ uint8_t calculate_sha256; /* The SHA256 digest context */ libhmac_sha256_context_t *sha256_context; /* Value to indicate the SHA256 digest context was initialized */ uint8_t sha256_context_initialized; /* The calculated SHA256 digest hash string */ system_character_t *calculated_sha256_hash_string; /* Value to indicate a stored SHA256 digest hash is available */ int stored_sha256_hash_available; /* The stored SHA256 digest 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 */ uint8_t use_chunk_data_functions; /* The libewf input handle */ libewf_handle_t *input_handle; /* The chunk size */ size32_t chunk_size; /* The number of bytes per sector */ uint32_t bytes_per_sector; /* The last offset read */ off64_t last_offset_read; /* The process buffer size */ size_t process_buffer_size; /* The notification output stream */ FILE *notify_stream; /* Value to indicate if abort was signalled */ int abort; }; int verification_handle_initialize( verification_handle_t **verification_handle, uint8_t calculate_md5, uint8_t use_chunk_data_functions, libcerror_error_t **error ); int verification_handle_free( verification_handle_t **verification_handle, libcerror_error_t **error ); int verification_handle_signal_abort( verification_handle_t *verification_handle, libcerror_error_t **error ); int verification_handle_set_maximum_number_of_open_handles( verification_handle_t *verification_handle, int maximum_number_of_open_handles, libcerror_error_t **error ); int verification_handle_open_input( verification_handle_t *verification_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int verification_handle_close( verification_handle_t *verification_handle, libcerror_error_t **error ); ssize_t verification_handle_prepare_read_buffer( verification_handle_t *verification_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ); ssize_t verification_handle_read_buffer( verification_handle_t *verification_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ); int verification_handle_initialize_integrity_hash( verification_handle_t *verification_handle, libcerror_error_t **error ); int verification_handle_update_integrity_hash( verification_handle_t *verification_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); int verification_handle_finalize_integrity_hash( verification_handle_t *verification_handle, libcerror_error_t **error ); int verification_handle_verify_input( verification_handle_t *verification_handle, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ); int verification_handle_verify_single_files( verification_handle_t *verification_handle, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ); int verification_handle_verify_file_entry( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ); int verification_handle_verify_sub_file_entries( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ); int verification_handle_get_integrity_hash_from_input( verification_handle_t *verification_handle, libcerror_error_t **error ); int verification_handle_get_integrity_hash_from_file_entry( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, libcerror_error_t **error ); int verification_handle_set_header_codepage( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_format( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_process_buffer_size( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_additional_digest_types( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_zero_chunk_on_error( verification_handle_t *verification_handle, uint8_t zero_chunk_on_error, libcerror_error_t **error ); int verification_handle_append_read_error( verification_handle_t *verification_handle, off64_t start_offset, size_t number_of_bytes, libcerror_error_t **error ); int verification_handle_hash_values_fprint( verification_handle_t *verification_handle, FILE *stream, libcerror_error_t **error ); int verification_handle_additional_hash_values_fprint( verification_handle_t *verification_handle, FILE *stream, libcerror_error_t **error ); int verification_handle_checksum_errors_fprint( verification_handle_t *verification_handle, FILE *stream, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/ewftools_signal.h0000664000175000017500000000331313440662654022555 0ustar00lordyestalordyesta00000000000000/* * Signal handling functions * * Copyright (C) 2006-2019, 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_SIGNAL_H ) #define _EWFTOOLS_SIGNAL_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_SIGNAL_H ) && !defined( WINAPI ) #error missing signal functions #endif #if defined( WINAPI ) typedef unsigned long ewftools_signal_t; #else typedef int ewftools_signal_t; #endif /* defined( WINAPI ) */ #if defined( WINAPI ) BOOL WINAPI ewftools_signal_handler( ewftools_signal_t signal ); #if defined( _MSC_VER ) void ewftools_signal_initialize_memory_debug( void ); #endif /* defined( _MSC_VER ) */ #endif /* defined( WINAPI ) */ int ewftools_signal_attach( void (*signal_handler)( ewftools_signal_t ), libcerror_error_t **error ); int ewftools_signal_detach( libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_SIGNAL_H ) */ libewf-20140807/ewftools/mount_fuse.c0000664000175000017500000006347513421020222021526 0ustar00lordyestalordyesta00000000000000/* * Mount tool fuse functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_UNISTD_H ) #include #endif #include "ewftools_libcerror.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_unused.h" #include "mount_fuse.h" #include "mount_handle.h" extern mount_handle_t *ewfmount_mount_handle; #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) #if ( SIZEOF_OFF_T != 8 ) && ( SIZEOF_OFF_T != 4 ) #error Size of off_t not supported #endif /* Sets the values in a stat info structure * The time values are a signed 64-bit POSIX date and time value in number of nanoseconds * Returns 1 if successful or -1 on error */ int mount_fuse_set_stat_info( struct stat *stat_info, size64_t size, uint16_t file_mode, int64_t access_time, int64_t inode_change_time, int64_t modification_time, libcerror_error_t **error ) { static char *function = "mount_fuse_set_stat_info"; if( stat_info == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stat info.", function ); return( -1 ); } #if SIZEOF_OFF_T <= 4 if( size > (size64_t) UINT32_MAX ) #else if( size > (size64_t) INT64_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } stat_info->st_size = (off_t) size; stat_info->st_mode = file_mode; if( ( file_mode & 0x4000 ) != 0 ) { stat_info->st_nlink = 2; } else { stat_info->st_nlink = 1; } #if defined( HAVE_GETEUID ) stat_info->st_uid = geteuid(); #endif #if defined( HAVE_GETEGID ) stat_info->st_gid = getegid(); #endif stat_info->st_atime = access_time / 1000000000; stat_info->st_ctime = inode_change_time / 1000000000; stat_info->st_mtime = modification_time / 1000000000; #if defined( STAT_HAVE_NSEC ) stat_info->st_atime_nsec = access_time % 1000000000; stat_info->st_ctime_nsec = inode_change_time % 1000000000; stat_info->st_mtime_nsec = modification_time % 1000000000; #endif return( 1 ); } /* Fills a directory entry * Returns 1 if successful or -1 on error */ int mount_fuse_filldir( void *buffer, fuse_fill_dir_t filler, const char *name, struct stat *stat_info, mount_file_entry_t *file_entry, libcerror_error_t **error ) { static char *function = "mount_fuse_filldir"; size64_t file_size = 0; uint64_t access_time = 0; uint64_t inode_change_time = 0; uint64_t modification_time = 0; uint16_t file_mode = 0; if( filler == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filler.", function ); return( -1 ); } if( file_entry != NULL ) { if( mount_file_entry_get_size( file_entry, &file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry size.", function ); return( -1 ); } if( mount_file_entry_get_file_mode( file_entry, &file_mode, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file mode.", function ); return( -1 ); } if( mount_file_entry_get_access_time( file_entry, &access_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access time.", function ); return( -1 ); } if( mount_file_entry_get_modification_time( file_entry, &modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve modification time.", function ); return( -1 ); } if( mount_file_entry_get_inode_change_time( file_entry, &inode_change_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve inode change time.", function ); return( -1 ); } } if( memory_set( stat_info, 0, sizeof( struct stat ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear stat info.", function ); return( -1 ); } if( mount_fuse_set_stat_info( stat_info, file_size, file_mode, (int64_t) access_time, (int64_t) inode_change_time, (int64_t) modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stat info.", function ); return( -1 ); } if( filler( buffer, name, stat_info, 0 ) == 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set directory entry.", function ); return( -1 ); } return( 1 ); } /* Opens a file or directory * Returns 0 if successful or a negative errno value otherwise */ int mount_fuse_open( const char *path, struct fuse_file_info *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_fuse_open"; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -EINVAL; goto on_error; } if( file_info->fh != (uint64_t) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file information - file handle already set.", function ); result = -EINVAL; goto on_error; } if( ( file_info->flags & 0x03 ) != O_RDONLY ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: write access currently not supported.", function ); result = -EACCES; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, (mount_file_entry_t **) &( file_info->fh ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %s.", function, path ); result = -ENOENT; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Reads a buffer of data at the specified offset * Returns number of bytes read if successful or a negative errno value otherwise */ int mount_fuse_read( const char *path, char *buffer, size_t size, off_t offset, struct fuse_file_info *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_fuse_read"; ssize_t read_count = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( size > (size_t) INT_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); result = -EINVAL; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -EINVAL; goto on_error; } if( file_info->fh == (uint64_t) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file information - missing file handle.", function ); result = -EINVAL; goto on_error; } read_count = mount_file_entry_read_buffer_at_offset( (mount_file_entry_t *) file_info->fh, (void *) buffer, size, (off64_t) offset, &error ); if( read_count < 0 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from file entry.", function ); result = -EIO; goto on_error; } return( (int) read_count ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Releases a file entry * Returns 0 if successful or a negative errno value otherwise */ int mount_fuse_release( const char *path, struct fuse_file_info *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_fuse_release"; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -EINVAL; goto on_error; } if( file_info->fh != (uint64_t) NULL ) { if( mount_file_entry_free( (mount_file_entry_t **) &( file_info->fh ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file entry.", function ); result = -ENOENT; goto on_error; } } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Opens a directory * Returns 0 if successful or a negative errno value otherwise */ int mount_fuse_opendir( const char *path, struct fuse_file_info *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_fuse_opendir"; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -EINVAL; goto on_error; } if( file_info->fh != (uint64_t) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file information - file handle already set.", function ); result = -EINVAL; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, (mount_file_entry_t **) &( file_info->fh ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %s.", function, path ); result = -ENOENT; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Reads a directory * Returns 0 if successful or a negative errno value otherwise */ int mount_fuse_readdir( const char *path, void *buffer, fuse_fill_dir_t filler, off_t offset EWFTOOLS_ATTRIBUTE_UNUSED, struct fuse_file_info *file_info EWFTOOLS_ATTRIBUTE_UNUSED ) { struct stat *stat_info = NULL; libcerror_error_t *error = NULL; mount_file_entry_t *parent_file_entry = NULL; mount_file_entry_t *sub_file_entry = NULL; static char *function = "mount_fuse_readdir"; char *name = NULL; size_t name_size = 0; int number_of_sub_file_entries = 0; int result = 0; int sub_file_entry_index = 0; EWFTOOLS_UNREFERENCED_PARAMETER( offset ) #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -EINVAL; goto on_error; } if( file_info->fh == (uint64_t) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file information - missing file handle.", function ); result = -EINVAL; goto on_error; } stat_info = memory_allocate_structure( struct stat ); if( stat_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create stat info.", function ); result = errno; goto on_error; } if( mount_fuse_filldir( buffer, filler, ".", stat_info, (mount_file_entry_t *) file_info->fh, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set self directory entry.", function ); result = -EIO; goto on_error; } result = mount_file_entry_get_parent_file_entry( (mount_file_entry_t *) file_info->fh, &parent_file_entry, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve parent file entry.", function ); result = -EIO; goto on_error; } if( mount_fuse_filldir( buffer, filler, "..", stat_info, parent_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent directory entry.", function ); result = -EIO; goto on_error; } if( mount_file_entry_free( &parent_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free parent file entry.", function ); result = -EIO; goto on_error; } if( mount_file_entry_get_number_of_sub_file_entries( (mount_file_entry_t *) file_info->fh, &number_of_sub_file_entries, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); result = -EIO; goto on_error; } for( sub_file_entry_index = 0; sub_file_entry_index < number_of_sub_file_entries; sub_file_entry_index++ ) { if( mount_file_entry_get_sub_file_entry_by_index( (mount_file_entry_t *) file_info->fh, sub_file_entry_index, &sub_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d.", function, sub_file_entry_index ); result = -EIO; goto on_error; } if( mount_file_entry_get_name_size( sub_file_entry, &name_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d name size.", function, sub_file_entry_index ); result = -EIO; goto on_error; } name = narrow_string_allocate( name_size ); if( name == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sub file entry: %d name.", function ); result = -EIO; goto on_error; } if( mount_file_entry_get_name( sub_file_entry, name, name_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d name.", function, sub_file_entry_index ); result = -EIO; goto on_error; } if( mount_fuse_filldir( buffer, filler, name, stat_info, sub_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set directory entry.", function ); result = -EIO; goto on_error; } memory_free( name ); name = NULL; if( mount_file_entry_free( &sub_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub file entry: %d.", function, sub_file_entry_index ); result = -EIO; goto on_error; } } memory_free( stat_info ); return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( name != NULL ) { memory_free( name ); } if( sub_file_entry != NULL ) { mount_file_entry_free( &sub_file_entry, NULL ); } if( parent_file_entry != NULL ) { mount_file_entry_free( &parent_file_entry, NULL ); } if( stat_info != NULL ) { memory_free( stat_info ); } return( result ); } /* Releases a directory entry * Returns 0 if successful or a negative errno value otherwise */ int mount_fuse_releasedir( const char *path, struct fuse_file_info *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_fuse_releasedir"; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -EINVAL; goto on_error; } if( file_info->fh != (uint64_t) NULL ) { file_info->fh = (uint64_t) NULL; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Retrieves the file stat info * Returns 0 if successful or a negative errno value otherwise */ int mount_fuse_getattr( const char *path, struct stat *stat_info ) { libcerror_error_t *error = NULL; mount_file_entry_t *file_entry = NULL; static char *function = "mount_fuse_getattr"; size64_t file_size = 0; uint64_t access_time = 0; uint64_t inode_change_time = 0; uint64_t modification_time = 0; uint16_t file_mode = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %s\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -EINVAL; goto on_error; } if( stat_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stat info.", function ); result = -EINVAL; goto on_error; } if( memory_set( stat_info, 0, sizeof( struct stat ) ) == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear stat info.", function ); result = errno; goto on_error; } result = mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, &file_entry, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value for: %s.", function, path ); result = -ENOENT; goto on_error; } else if( result == 0 ) { return( -ENOENT ); } if( mount_file_entry_get_size( file_entry, &file_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry size.", function ); result = -EIO; goto on_error; } if( mount_file_entry_get_file_mode( file_entry, &file_mode, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file mode.", function ); result = -EIO; goto on_error; } if( mount_file_entry_get_access_time( file_entry, &access_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access time.", function ); result = -EIO; goto on_error; } if( mount_file_entry_get_modification_time( file_entry, &modification_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve modification time.", function ); result = -EIO; goto on_error; } if( mount_file_entry_get_inode_change_time( file_entry, &inode_change_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve inode change time.", function ); result = -EIO; goto on_error; } if( mount_fuse_set_stat_info( stat_info, file_size, file_mode, (int64_t) access_time, (int64_t) inode_change_time, (int64_t) modification_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stat info.", function ); result = -EIO; goto on_error; } if( mount_file_entry_free( &file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file entry.", function ); result = -EIO; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( file_entry != NULL ) { mount_file_entry_free( &file_entry, NULL ); } return( result ); } /* Cleans up when fuse is done */ void mount_fuse_destroy( void *private_data EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "mount_fuse_destroy"; EWFTOOLS_UNREFERENCED_PARAMETER( private_data ) #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s\n", function ); } #endif if( ewfmount_mount_handle != NULL ) { if( mount_handle_free( &ewfmount_mount_handle, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free mount handle.", function ); goto on_error; } } return; on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return; } #endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) */ libewf-20140807/ewftools/ewftools_libbfio.h0000664000175000017500000000332013440663046022700 0ustar00lordyestalordyesta00000000000000/* * The libbfio header wrapper * * Copyright (C) 2006-2018, 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_LIBBFIO_H ) #define _EWFTOOLS_LIBBFIO_H #include /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio */ #if defined( HAVE_LOCAL_LIBBFIO ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT * before including libbfio.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBBFIO_DLL_IMPORT #endif #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) #error Multi-threading support requires libbfio with multi-threading support #endif #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ #endif /* !defined( _EWFTOOLS_LIBBFIO_H ) */ libewf-20140807/ewftools/verification_handle.c0000664000175000017500000027211413421024433023337 0ustar00lordyestalordyesta00000000000000/* * Verification handle * * 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 . */ #include #include #include #include #include #include #include "byte_size_string.h" #include "digest_hash.h" #include "ewfcommon.h" #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libcpath.h" #include "ewftools_libcsplit.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "log_handle.h" #include "process_status.h" #include "storage_media_buffer.h" #include "verification_handle.h" #define VERIFICATION_HANDLE_VALUE_SIZE 64 #define VERIFICATION_HANDLE_VALUE_IDENTIFIER_SIZE 32 #define VERIFICATION_HANDLE_NOTIFY_STREAM stdout /* Creates a verification handle * Make sure the value verification_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int verification_handle_initialize( verification_handle_t **verification_handle, uint8_t calculate_md5, uint8_t use_chunk_data_functions, libcerror_error_t **error ) { static char *function = "verification_handle_initialize"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( *verification_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid verification handle value already set.", function ); return( -1 ); } *verification_handle = memory_allocate_structure( verification_handle_t ); if( *verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create verification handle.", function ); goto on_error; } if( memory_set( *verification_handle, 0, sizeof( verification_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear verification handle.", function ); memory_free( *verification_handle ); *verification_handle = NULL; return( -1 ); } if( libewf_handle_initialize( &( ( *verification_handle )->input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize input handle.", function ); goto on_error; } #ifdef TODO /* TODO: have application determine limit value and set to value - 4 */ if( libewf_handle_set_maximum_number_of_open_handles( ( *verification_handle )->input_handle, 1000, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles.", function ); goto on_error; } #endif if( calculate_md5 != 0 ) { ( *verification_handle )->calculated_md5_hash_string = system_string_allocate( 33 ); if( ( *verification_handle )->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated MD5 digest hash string.", function ); goto on_error; } } ( *verification_handle )->stored_md5_hash_string = system_string_allocate( 33 ); if( ( *verification_handle )->stored_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create stored MD5 digest hash string.", function ); goto on_error; } ( *verification_handle )->stored_sha1_hash_string = system_string_allocate( 41 ); if( ( *verification_handle )->stored_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create stored SHA1 digest hash string.", function ); goto on_error; } ( *verification_handle )->stored_sha256_hash_string = system_string_allocate( 65 ); if( ( *verification_handle )->stored_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create stored SHA256 digest hash string.", function ); goto on_error; } ( *verification_handle )->input_format = VERIFICATION_HANDLE_INPUT_FORMAT_RAW; ( *verification_handle )->calculate_md5 = calculate_md5; ( *verification_handle )->use_chunk_data_functions = use_chunk_data_functions; ( *verification_handle )->header_codepage = LIBEWF_CODEPAGE_ASCII; ( *verification_handle )->process_buffer_size = EWFCOMMON_PROCESS_BUFFER_SIZE; ( *verification_handle )->notify_stream = VERIFICATION_HANDLE_NOTIFY_STREAM; return( 1 ); on_error: if( *verification_handle != NULL ) { if( ( *verification_handle )->stored_sha1_hash_string != NULL ) { memory_free( ( *verification_handle )->stored_sha1_hash_string ); } if( ( *verification_handle )->calculated_sha1_hash_string != NULL ) { memory_free( ( *verification_handle )->calculated_sha1_hash_string ); } if( ( *verification_handle )->stored_md5_hash_string != NULL ) { memory_free( ( *verification_handle )->stored_md5_hash_string ); } if( ( *verification_handle )->calculated_md5_hash_string != NULL ) { memory_free( ( *verification_handle )->calculated_md5_hash_string ); } if( ( *verification_handle )->input_handle != NULL ) { libewf_handle_free( &( ( *verification_handle )->input_handle ), NULL ); } memory_free( *verification_handle ); *verification_handle = NULL; } return( -1 ); } /* Frees a verification handle * Returns 1 if successful or -1 on error */ int verification_handle_free( verification_handle_t **verification_handle, libcerror_error_t **error ) { static char *function = "verification_handle_free"; int result = 1; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( *verification_handle != NULL ) { if( ( ( *verification_handle )->input_handle != NULL ) && ( libewf_handle_free( &( ( *verification_handle )->input_handle ), error ) != 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free input handle.", function ); result = -1; } if( ( *verification_handle )->md5_context != NULL ) { if( libhmac_md5_free( &( ( *verification_handle )->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free MD5 context.", function ); result = -1; } } if( ( *verification_handle )->calculated_md5_hash_string != NULL ) { memory_free( ( *verification_handle )->calculated_md5_hash_string ); } if( ( *verification_handle )->stored_md5_hash_string != NULL ) { memory_free( ( *verification_handle )->stored_md5_hash_string ); } if( ( *verification_handle )->sha1_context != NULL ) { if( libhmac_sha1_free( &( ( *verification_handle )->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA1 context.", function ); result = -1; } } if( ( *verification_handle )->calculated_sha1_hash_string != NULL ) { memory_free( ( *verification_handle )->calculated_sha1_hash_string ); } if( ( *verification_handle )->stored_sha1_hash_string != NULL ) { memory_free( ( *verification_handle )->stored_sha1_hash_string ); } if( ( *verification_handle )->sha256_context != NULL ) { if( libhmac_sha256_free( &( ( *verification_handle )->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA256 context.", function ); result = -1; } } if( ( *verification_handle )->calculated_sha256_hash_string != NULL ) { memory_free( ( *verification_handle )->calculated_sha256_hash_string ); } if( ( *verification_handle )->stored_sha256_hash_string != NULL ) { memory_free( ( *verification_handle )->stored_sha256_hash_string ); } memory_free( *verification_handle ); *verification_handle = NULL; } return( result ); } /* Signals the verification handle to abort * Returns 1 if successful or -1 on error */ int verification_handle_signal_abort( verification_handle_t *verification_handle, libcerror_error_t **error ) { static char *function = "verification_handle_signal_abort"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->input_handle != NULL ) { if( libewf_handle_signal_abort( verification_handle->input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal input handle to abort.", function ); return( -1 ); } } verification_handle->abort = 1; return( 1 ); } /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int verification_handle_set_maximum_number_of_open_handles( verification_handle_t *verification_handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { static char *function = "verification_handle_set_maximum_number_of_open_handles"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( libewf_handle_set_maximum_number_of_open_handles( verification_handle->input_handle, maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in input handle.", function ); return( -1 ); } return( 1 ); } /* Opens the input of the verification handle * Returns 1 if successful or -1 on error */ int verification_handle_open_input( verification_handle_t *verification_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { system_character_t **libewf_filenames = NULL; static char *function = "verification_handle_open_input"; size_t first_filename_length = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of filenames.", function ); return( -1 ); } if( number_of_filenames == 1 ) { first_filename_length = system_string_length( filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #else if( libewf_glob( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to resolve filename(s).", function ); goto on_error; } filenames = (system_character_t * const *) libewf_filenames; } if( verification_handle->header_codepage != LIBEWF_CODEPAGE_ASCII ) { if( libewf_handle_set_header_codepage( verification_handle->input_handle, verification_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); goto on_error; } } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( verification_handle->input_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #else if( libewf_handle_open( verification_handle->input_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open files.", function ); goto on_error; } if( libewf_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, error ) != 1 ) #else if( libewf_glob_free( libewf_filenames, number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free globbed filenames.", function ); return( -1 ); } libewf_filenames = NULL; } if( libewf_handle_get_chunk_size( verification_handle->input_handle, &( verification_handle->chunk_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); goto on_error; } if( libewf_handle_get_bytes_per_sector( verification_handle->input_handle, &( verification_handle->bytes_per_sector ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); goto on_error; } return( 1 ); on_error: if( libewf_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, NULL ); #else libewf_glob_free( libewf_filenames, number_of_filenames, NULL ); #endif libewf_filenames = NULL; } return( -1 ); } /* Closes the verification handle * Returns the 0 if succesful or -1 on error */ int verification_handle_close( verification_handle_t *verification_handle, libcerror_error_t **error ) { static char *function = "verification_handle_close"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( libewf_handle_close( verification_handle->input_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close input handle.", function ); return( -1 ); } return( 0 ); } /* Prepares a buffer after reading the input of the verification handle * Returns the resulting buffer size or -1 on error */ ssize_t verification_handle_prepare_read_buffer( verification_handle_t *verification_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ) { static char *function = "verification_handle_prepare_read_buffer"; ssize_t process_count = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->raw_buffer_data_size = storage_media_buffer->raw_buffer_size; process_count = libewf_handle_prepare_read_chunk( verification_handle->input_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_data_size, storage_media_buffer->raw_buffer, &( storage_media_buffer->raw_buffer_data_size ), storage_media_buffer->is_compressed, storage_media_buffer->checksum, storage_media_buffer->process_checksum, error ); if( process_count == -1 ) { libcerror_error_free( error ); /* Wipe the chunk if nescessary */ if( verification_handle->zero_chunk_on_error != 0 ) { if( ( storage_media_buffer->is_compressed != 0 ) && ( memory_set( storage_media_buffer->raw_buffer, 0, storage_media_buffer->raw_buffer_size ) == NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero raw buffer.", function ); return( -1 ); } if( memory_set( storage_media_buffer->compression_buffer, 0, storage_media_buffer->compression_buffer_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero compression buffer.", function ); return( -1 ); } } process_count = verification_handle->chunk_size; /* Append a read error */ if( verification_handle_append_read_error( verification_handle, verification_handle->last_offset_read, process_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append read error.", function ); return( -1 ); } } if( storage_media_buffer->is_compressed == 0 ) { storage_media_buffer->data_in_compression_buffer = 1; } else { storage_media_buffer->data_in_compression_buffer = 0; } } else { process_count = (ssize_t) storage_media_buffer->raw_buffer_data_size; } verification_handle->last_offset_read += process_count; return( process_count ); } /* Reads a buffer from the input of the verification handle * Returns the number of bytes written or -1 on error */ ssize_t verification_handle_read_buffer( verification_handle_t *verification_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ) { static char *function = "verification_handle_read_buffer"; ssize_t read_count = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { read_count = libewf_handle_read_chunk( verification_handle->input_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_size, &( storage_media_buffer->is_compressed ), &( storage_media_buffer->compression_buffer[ storage_media_buffer->raw_buffer_size ] ), &( storage_media_buffer->checksum ), &( storage_media_buffer->process_checksum ), error ); } else { read_count = libewf_handle_read_buffer( verification_handle->input_handle, storage_media_buffer->raw_buffer, read_size, error ); } if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->compression_buffer_data_size = (size_t) read_count; } else { storage_media_buffer->raw_buffer_data_size = (size_t) read_count; } return( read_count ); } /* Initializes the integrity hash(es) * Returns 1 if successful or -1 on error */ int verification_handle_initialize_integrity_hash( verification_handle_t *verification_handle, libcerror_error_t **error ) { static char *function = "verification_handle_initialize_integrity_hash"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->calculate_md5 != 0 ) { if( libhmac_md5_initialize( &( verification_handle->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize MD5 context.", function ); goto on_error; } verification_handle->md5_context_initialized = 1; } if( verification_handle->calculate_sha1 != 0 ) { if( libhmac_sha1_initialize( &( verification_handle->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize SHA1 context.", function ); goto on_error; } verification_handle->sha1_context_initialized = 1; } if( verification_handle->calculate_sha256 != 0 ) { if( libhmac_sha256_initialize( &( verification_handle->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize SHA256 context.", function ); goto on_error; } verification_handle->sha256_context_initialized = 1; } return( 1 ); on_error: if( verification_handle->sha1_context != NULL ) { libhmac_sha1_free( &( verification_handle->sha1_context ), NULL ); } if( verification_handle->md5_context != NULL ) { libhmac_md5_free( &( verification_handle->md5_context ), NULL ); } return( -1 ); } /* Updates the integrity hash(es) * Returns 1 if successful or -1 on error */ int verification_handle_update_integrity_hash( verification_handle_t *verification_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { static char *function = "verification_handle_update_integrity_hash"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( ( buffer_size == 0 ) || ( buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid buffer size value out of bounds.", function ); return( -1 ); } if( verification_handle->calculate_md5 != 0 ) { if( libhmac_md5_update( verification_handle->md5_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update MD5 digest hash.", function ); return( -1 ); } } if( verification_handle->calculate_sha1 != 0 ) { if( libhmac_sha1_update( verification_handle->sha1_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update SHA1 digest hash.", function ); return( -1 ); } } if( verification_handle->calculate_sha256 != 0 ) { if( libhmac_sha256_update( verification_handle->sha256_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update SHA256 digest hash.", function ); return( -1 ); } } return( 1 ); } /* Finalizes the integrity hash(es) * Returns 1 if successful or -1 on error */ int verification_handle_finalize_integrity_hash( verification_handle_t *verification_handle, libcerror_error_t **error ) { uint8_t calculated_md5_hash[ LIBHMAC_MD5_HASH_SIZE ]; uint8_t calculated_sha1_hash[ LIBHMAC_SHA1_HASH_SIZE ]; uint8_t calculated_sha256_hash[ LIBHMAC_SHA256_HASH_SIZE ]; static char *function = "verification_handle_finalize_integrity_hash"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->calculate_md5 != 0 ) { if( verification_handle->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing calculated MD5 hash string.", function ); return( -1 ); } if( libhmac_md5_finalize( verification_handle->md5_context, calculated_md5_hash, LIBHMAC_MD5_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize MD5 hash.", function ); return( -1 ); } if( libhmac_md5_free( &( verification_handle->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free MD5 context.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_md5_hash, LIBHMAC_MD5_HASH_SIZE, verification_handle->calculated_md5_hash_string, 33, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBEWF_RUNTIME_ERROR_SET_FAILED, "%s: unable to set calculated MD5 hash string.", function ); return( -1 ); } } if( verification_handle->calculate_sha1 != 0 ) { if( verification_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing calculated SHA1 hash string.", function ); return( -1 ); } if( libhmac_sha1_finalize( verification_handle->sha1_context, calculated_sha1_hash, LIBHMAC_SHA1_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize SHA1 hash.", function ); return( -1 ); } if( libhmac_sha1_free( &( verification_handle->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA1 context.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_sha1_hash, LIBHMAC_SHA1_HASH_SIZE, verification_handle->calculated_sha1_hash_string, 41, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create calculated SHA1 hash string.", function ); return( -1 ); } } if( verification_handle->calculate_sha256 != 0 ) { if( verification_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing calculated SHA256 hash string.", function ); return( -1 ); } if( libhmac_sha256_finalize( verification_handle->sha256_context, calculated_sha256_hash, LIBHMAC_SHA256_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize SHA256 hash.", function ); return( -1 ); } if( libhmac_sha256_free( &( verification_handle->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA256 context.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_sha256_hash, LIBHMAC_SHA256_HASH_SIZE, verification_handle->calculated_sha256_hash_string, 65, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create calculated SHA256 hash string.", function ); return( -1 ); } } return( 1 ); } /* Verifies the input * Returns 1 if successful, 0 if not or -1 on error */ int verification_handle_verify_input( verification_handle_t *verification_handle, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ) { process_status_t *process_status = NULL; storage_media_buffer_t *storage_media_buffer = NULL; uint8_t *data = NULL; static char *function = "verification_handle_verify_input"; size64_t media_size = 0; size64_t verify_count = 0; size_t data_size = 0; size_t process_buffer_size = 0; size_t read_size = 0; ssize_t process_count = 0; ssize_t read_count = 0; uint32_t number_of_checksum_errors = 0; uint8_t storage_media_buffer_mode = 0; int is_corrupted = 0; int md5_hash_compare = 0; int sha1_hash_compare = 0; int sha256_hash_compare = 0; int status = PROCESS_STATUS_COMPLETED; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk size.", function ); return( -1 ); } if( verification_handle->chunk_size > (size32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk size value exceeds maximum.", function ); return( -1 ); } if( verification_handle->process_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid process buffer size value exceeds maximum.", function ); return( -1 ); } if( libewf_handle_get_media_size( verification_handle->input_handle, &media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); goto on_error; } if( verification_handle->use_chunk_data_functions != 0 ) { process_buffer_size = verification_handle->chunk_size; storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA; } else { if( verification_handle->process_buffer_size == 0 ) { process_buffer_size = verification_handle->chunk_size; } else { process_buffer_size = verification_handle->process_buffer_size; } storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_BUFFERED; } if( storage_media_buffer_initialize( &storage_media_buffer, storage_media_buffer_mode, process_buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create storage media buffer.", function ); goto on_error; } if( verification_handle_initialize_integrity_hash( verification_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize integrity hash(es).", function ); goto on_error; } if( process_status_initialize( &process_status, _SYSTEM_STRING( "Verify" ), _SYSTEM_STRING( "verified" ), _SYSTEM_STRING( "Read" ), verification_handle->notify_stream, print_status_information, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create process status.", function ); goto on_error; } if( process_status_start( process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to start process status.", function ); goto on_error; } while( verify_count < media_size ) { read_size = process_buffer_size; if( ( media_size - verify_count ) < read_size ) { read_size = (size_t) ( media_size - verify_count ); } read_count = verification_handle_read_buffer( verification_handle, storage_media_buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read data.", function ); goto on_error; } if( read_count == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unexpected end of data.", function ); goto on_error; } process_count = verification_handle_prepare_read_buffer( verification_handle, storage_media_buffer, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare buffer after read.", function ); goto on_error; } if( process_count > (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: more bytes read than requested.", function ); goto on_error; } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { /* Set the chunk data size in the compression buffer */ if( storage_media_buffer->data_in_compression_buffer == 1 ) { storage_media_buffer->compression_buffer_data_size = (ssize_t) process_count; } } verify_count += (size64_t) process_count; if( storage_media_buffer_get_data( storage_media_buffer, &data, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine storage media buffer data.", function ); goto on_error; } if( verification_handle_update_integrity_hash( verification_handle, data, process_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to update integrity hash(es).", function ); goto on_error; } if( process_status_update( process_status, verify_count, media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update process status.", function ); goto on_error; } if( verification_handle->abort != 0 ) { break; } } if( storage_media_buffer_free( &storage_media_buffer, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free storage media buffer.", function ); goto on_error; } if( verification_handle_finalize_integrity_hash( verification_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize integrity hash(es).", function ); goto on_error; } if( verification_handle_get_integrity_hash_from_input( verification_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to retrieve integrity hash(es) from input.", function ); goto on_error; } if( verification_handle->abort != 0 ) { status = PROCESS_STATUS_ABORTED; } if( process_status_stop( process_status, verify_count, status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to stop process status.", function ); goto on_error; } if( process_status_free( &process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free process status.", function ); goto on_error; } if( verification_handle->abort == 0 ) { fprintf( verification_handle->notify_stream, "\n" ); if( verification_handle_checksum_errors_fprint( verification_handle, verification_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print checksum errors.", function ); goto on_error; } if( verification_handle_hash_values_fprint( verification_handle, verification_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hash values.", function ); goto on_error; } if( verification_handle_additional_hash_values_fprint( verification_handle, verification_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print additional hash values.", function ); goto on_error; } fprintf( verification_handle->notify_stream, "\n" ); if( log_handle != NULL ) { if( verification_handle_checksum_errors_fprint( verification_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print checksum errors in log handle.", function ); goto on_error; } if( verification_handle_hash_values_fprint( verification_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hash values in log handle.", function ); goto on_error; } if( verification_handle_additional_hash_values_fprint( verification_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print additional hash values in log handle.", function ); goto on_error; } } } is_corrupted = libewf_handle_segment_files_corrupted( verification_handle->input_handle, error ); if( is_corrupted == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if segment files are corrupted.", function ); return( -1 ); } if( libewf_handle_get_number_of_checksum_errors( verification_handle->input_handle, &number_of_checksum_errors, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of checksum errors.", function ); return( -1 ); } if( ( verification_handle->calculate_md5 != 0 ) && ( verification_handle->stored_md5_hash_available != 0 ) ) { md5_hash_compare = system_string_compare( verification_handle->stored_md5_hash_string, verification_handle->calculated_md5_hash_string, 33 ); } if( ( verification_handle->calculate_sha1 != 0 ) && ( verification_handle->stored_sha1_hash_available != 0 ) ) { sha1_hash_compare = system_string_compare( verification_handle->stored_sha1_hash_string, verification_handle->calculated_sha1_hash_string, 41 ); } if( ( verification_handle->calculate_sha256 != 0 ) && ( verification_handle->stored_sha256_hash_available != 0 ) ) { sha256_hash_compare = system_string_compare( verification_handle->stored_sha256_hash_string, verification_handle->calculated_sha256_hash_string, 65 ); } /* Note that a set of EWF files can be verified without an integrity hash */ if( ( is_corrupted == 0 ) && ( number_of_checksum_errors == 0 ) && ( md5_hash_compare == 0 ) && ( sha1_hash_compare == 0 ) && ( sha256_hash_compare == 0 ) ) { return( 1 ); } return( 0 ); on_error: if( process_status != NULL ) { process_status_stop( process_status, verify_count, PROCESS_STATUS_FAILED, NULL ); process_status_free( &process_status, NULL ); } if( storage_media_buffer != NULL ) { storage_media_buffer_free( &storage_media_buffer, NULL ); } return( -1 ); } /* Verifies single files * Returns 1 if successful, 0 if not or -1 on error */ int verification_handle_verify_single_files( verification_handle_t *verification_handle, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ) { libewf_file_entry_t *file_entry = NULL; process_status_t *process_status = NULL; static char *function = "verification_handle_verify_single_files"; uint32_t number_of_checksum_errors = 0; int result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( libewf_handle_get_root_file_entry( verification_handle->input_handle, &file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve root file entry.", function ); goto on_error; } if( process_status_initialize( &process_status, _SYSTEM_STRING( "Verify" ), _SYSTEM_STRING( "verified" ), _SYSTEM_STRING( "Read" ), verification_handle->notify_stream, print_status_information, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create process status.", function ); goto on_error; } if( process_status_start( process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to start process status.", function ); goto on_error; } result = verification_handle_verify_file_entry( verification_handle, file_entry, _SYSTEM_STRING( "" ), 0, log_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to verify root file entry.", function ); goto on_error; } if( process_status_stop( process_status, 0, PROCESS_STATUS_COMPLETED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to stop process status.", function ); goto on_error; } if( process_status_free( &process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free process status.", function ); goto on_error; } if( libewf_file_entry_free( &file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free root file entry.", function ); goto on_error; } if( libewf_handle_get_number_of_checksum_errors( verification_handle->input_handle, &number_of_checksum_errors, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of checksum errors.", function ); return( -1 ); } if( ( result != 0 ) && ( number_of_checksum_errors == 0 ) ) { return( 1 ); } return( 0 ); on_error: if( process_status != NULL ) { process_status_stop( process_status, 0, PROCESS_STATUS_FAILED, NULL ); process_status_free( &process_status, NULL ); } if( file_entry != NULL ) { libewf_file_entry_free( &file_entry, NULL ); } return( -1 ); } /* Verifies a (single) file entry * Returns 1 if successful, 0 if not or -1 on error */ int verification_handle_verify_file_entry( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ) { 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; size_t name_size = 0; size_t process_buffer_size = 0; size_t read_size = 0; size_t target_path_size = 0; ssize_t read_count = 0; uint8_t file_entry_type = 0; int md5_hash_compare = 0; int result = 0; int return_value = 0; int sha1_hash_compare = 0; int sha256_hash_compare = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk size.", function ); return( -1 ); } if( verification_handle->chunk_size > (size32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid chunk size value exceeds maximum.", function ); return( -1 ); } if( verification_handle->process_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid process buffer size value exceeds maximum.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name_size( file_entry, &name_size, error ); #else result = libewf_file_entry_get_utf8_name_size( file_entry, &name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the name.", function ); goto on_error; } if( name_size > 0 ) { name = system_string_allocate( name_size ); if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( file_entry, (uint16_t *) name, name_size, error ); #else result = libewf_file_entry_get_utf8_name( file_entry, (uint8_t *) name, name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the name.", function ); memory_free( name ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_join_wide( &target_path, &target_path_size, file_entry_path, file_entry_path_length, name, name_size - 1, error ) != 1 ) #else if( libcpath_path_join( &target_path, &target_path_size, file_entry_path, file_entry_path_length, name, name_size - 1, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create target path.", function ); memory_free( name ); goto on_error; } memory_free( name ); } else { target_path = (system_character_t *) file_entry_path; target_path_size = file_entry_path_length + 1; } if( libewf_file_entry_get_type( file_entry, &file_entry_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry type.", function ); goto on_error; } /* TODO what about NTFS streams ? */ if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_FILE ) { fprintf( verification_handle->notify_stream, "Single file: %" PRIs_SYSTEM "\n", target_path ); if( log_handle != NULL ) { log_handle_printf( log_handle, "Single file: %" PRIs_SYSTEM "\n", target_path ); } if( libewf_file_entry_get_size( file_entry, &file_entry_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry data size.", function ); goto on_error; } if( verification_handle_initialize_integrity_hash( verification_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize integrity hash(es).", function ); goto on_error; } result = 1; if( file_entry_data_size > 0 ) { if( verification_handle->process_buffer_size == 0 ) { process_buffer_size = verification_handle->chunk_size; } else { process_buffer_size = verification_handle->process_buffer_size; } /* This function in not necessary for normal use * but it was added for testing */ if( libewf_file_entry_seek_offset( file_entry, 0, SEEK_SET, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek the start of the file entry data.", function ); goto on_error; } file_entry_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * process_buffer_size ); if( file_entry_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file entry data.", function ); goto on_error; } while( file_entry_data_size > 0 ) { if( file_entry_data_size >= process_buffer_size ) { read_size = process_buffer_size; } else { read_size = (size_t) file_entry_data_size; } read_count = libewf_file_entry_read_buffer( file_entry, file_entry_data, read_size, error ); if( read_count == (ssize_t) -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read file entry data.", function ); goto on_error; } else if( read_count != (ssize_t) read_size ) { result = 0; break; } file_entry_data_size -= read_size; if( verification_handle_update_integrity_hash( verification_handle, file_entry_data, read_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to update integrity hash(es).", function ); goto on_error; } } memory_free( file_entry_data ); file_entry_data = NULL; } if( verification_handle_finalize_integrity_hash( verification_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize integrity hash(es).", function ); goto on_error; } if( result != 0 ) { if( verification_handle_get_integrity_hash_from_file_entry( verification_handle, file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to retrieve integrity hash(es) from file entry.", function ); goto on_error; } if( verification_handle_hash_values_fprint( verification_handle, verification_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hash values.", function ); goto on_error; } if( log_handle != NULL ) { if( verification_handle_hash_values_fprint( verification_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hash values in log handle.", function ); goto on_error; } } if( ( verification_handle->calculate_md5 != 0 ) && ( verification_handle->stored_md5_hash_available != 0 ) ) { md5_hash_compare = system_string_compare( verification_handle->stored_md5_hash_string, verification_handle->calculated_md5_hash_string, 33 ); } if( ( verification_handle->calculate_sha1 != 0 ) && ( verification_handle->stored_sha1_hash_available != 0 ) ) { sha1_hash_compare = system_string_compare( verification_handle->stored_sha1_hash_string, verification_handle->calculated_sha1_hash_string, 41 ); } if( ( verification_handle->calculate_sha256 != 0 ) && ( verification_handle->stored_sha256_hash_available != 0 ) ) { sha256_hash_compare = system_string_compare( verification_handle->stored_sha256_hash_string, verification_handle->calculated_sha256_hash_string, 65 ); } } if( ( result != 0 ) && ( md5_hash_compare == 0 ) && ( sha1_hash_compare == 0 ) && ( sha256_hash_compare == 0 ) ) { return_value = 1; } else { fprintf( verification_handle->notify_stream, "FAILED\n" ); if( log_handle != NULL ) { log_handle_printf( log_handle, "FAILED\n" ); } return_value = 0; } fprintf( verification_handle->notify_stream, "\n" ); } else if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_DIRECTORY ) { return_value = verification_handle_verify_sub_file_entries( verification_handle, file_entry, target_path, target_path_size - 1, log_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to verify sub file entries.", function ); return( -1 ); } } if( target_path != file_entry_path ) { memory_free( target_path ); } return( return_value ); on_error: if( file_entry_data != NULL ) { memory_free( file_entry_data ); } if( ( target_path != NULL ) && ( target_path != file_entry_path ) ) { memory_free( target_path ); } return( -1 ); } /* Verifies a (single) file entry sub file entries * Returns 1 if successful, 0 if not or -1 on error */ int verification_handle_verify_sub_file_entries( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ) { libewf_file_entry_t *sub_file_entry = NULL; static char *function = "verification_handle_verify_sub_file_entries"; int number_of_sub_file_entries = 0; int result = 1; int sub_file_entry_index = 0; int sub_file_entry_result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( libewf_file_entry_get_number_of_sub_file_entries( file_entry, &number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); return( -1 ); } for( sub_file_entry_index = 0; sub_file_entry_index < number_of_sub_file_entries; sub_file_entry_index++ ) { if( libewf_file_entry_get_sub_file_entry( file_entry, sub_file_entry_index, &sub_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to free retrieve sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } sub_file_entry_result = verification_handle_verify_file_entry( verification_handle, sub_file_entry, file_entry_path, file_entry_path_length, log_handle, error ); if( sub_file_entry_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to verify sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } if( sub_file_entry_result == 0 ) { result = 0; } if( libewf_file_entry_free( &sub_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } } return( result ); on_error: if( sub_file_entry != NULL ) { libewf_file_entry_free( &sub_file_entry, NULL ); } return( -1 ); } /* Retrieves the integrity hash(es) from the input * Returns 1 if successful or -1 on error */ int verification_handle_get_integrity_hash_from_input( verification_handle_t *verification_handle, libcerror_error_t **error ) { #if defined( USE_LIBEWF_GET_MD5_HASH ) uint8_t stored_md5_hash[ DIGEST_HASH_SIZE_MD5 ]; #endif static char *function = "verification_handle_get_integrity_hash_from_input"; int result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->stored_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing stored MD5 hash string.", function ); return( -1 ); } if( verification_handle->stored_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing stored SHA1 hash string.", function ); return( -1 ); } if( verification_handle->stored_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing stored SHA256 hash string.", function ); return( -1 ); } #if defined( USE_LIBEWF_GET_MD5_HASH ) result = libewf_handle_get_md5_hash( verification_handle->input_handle, md5_hash, DIGEST_HASH_SIZE_MD5, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine stored MD5 hash string.", function ); return( -1 ); } verification_handle->stored_md5_hash_available = result; if( digest_hash_copy_to_string( md5_hash, DIGEST_HASH_SIZE_MD5, verification_handle->stored_md5_hash_string, 33 ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBEWF_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stored MD5 hash string.", function ); return( -1 ); } #else #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) "MD5", 3, (uint16_t *) verification_handle->stored_md5_hash_string, 33, error ); #else result = libewf_handle_get_utf8_hash_value( verification_handle->input_handle, (uint8_t *) "MD5", 3, (uint8_t *) verification_handle->stored_md5_hash_string, 33, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine stored MD5 hash string.", function ); return( -1 ); } verification_handle->stored_md5_hash_available = result; #endif #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) "SHA1", 4, (uint16_t *) verification_handle->stored_sha1_hash_string, 41, error ); #else result = libewf_handle_get_utf8_hash_value( verification_handle->input_handle, (uint8_t *) "SHA1", 4, (uint8_t *) verification_handle->stored_sha1_hash_string, 41, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine stored SHA1 hash string.", function ); return( -1 ); } verification_handle->stored_sha1_hash_available = result; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) "SHA256", 6, (uint16_t *) verification_handle->stored_sha256_hash_string, 65, error ); #else result = libewf_handle_get_utf8_hash_value( verification_handle->input_handle, (uint8_t *) "SHA256", 6, (uint8_t *) verification_handle->stored_sha256_hash_string, 65, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine stored SHA256 hash string.", function ); return( -1 ); } verification_handle->stored_sha256_hash_available = result; return( 1 ); } /* Retrieves the integrity hash(es) from a (single) file entry * Returns 1 if successful or -1 on error */ int verification_handle_get_integrity_hash_from_file_entry( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, libcerror_error_t **error ) { static char *function = "verification_handle_get_integrity_hash_from_file_entry"; int result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->stored_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid verification handle - missing stored MD5 hash string.", function ); return( -1 ); } #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, 33, error ); #else result = libewf_file_entry_get_utf8_hash_value_md5( file_entry, (uint8_t *) verification_handle->stored_md5_hash_string, 33, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine stored MD5 hash string.", function ); return( -1 ); } verification_handle->stored_md5_hash_available = result; verification_handle->stored_sha1_hash_available = 0; verification_handle->stored_sha256_hash_available = 0; return( 1 ); } /* Sets the header codepage * Returns 1 if successful or -1 on error */ int verification_handle_set_header_codepage( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "verification_handle_set_header_codepage"; int result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } result = ewfinput_determine_header_codepage( string, &( verification_handle->header_codepage ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine header codepage.", function ); return( -1 ); } else if( result != 0 ) { if( verification_handle->input_handle != NULL ) { if( libewf_handle_set_header_codepage( verification_handle->input_handle, verification_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); return( -1 ); } } } return( result ); } /* Sets the format * Returns 1 if successful, 0 if unsupported value or -1 on error */ int verification_handle_set_format( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "verification_handle_set_format"; size_t string_length = 0; int result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 3 ) { if( system_string_compare( string, _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { verification_handle->input_format = VERIFICATION_HANDLE_INPUT_FORMAT_RAW; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "files" ), 5 ) == 0 ) { verification_handle->input_format = VERIFICATION_HANDLE_INPUT_FORMAT_FILES; result = 1; } } return( result ); } /* Sets the process buffer size * Returns 1 if successful, 0 if unsupported value or -1 on error */ int verification_handle_set_process_buffer_size( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "verification_handle_set_process_buffer_size"; size_t string_length = 0; uint64_t size_variable = 0; int result = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine process buffer size.", function ); return( -1 ); } else if( result != 0 ) { if( size_variable > (uint64_t) SSIZE_MAX ) { result = 0; } else { verification_handle->process_buffer_size = (size_t) size_variable; } } return( result ); } /* Sets the additional digest types * Returns 1 if successful or -1 on error */ int verification_handle_set_additional_digest_types( verification_handle_t *verification_handle, const system_character_t *string, libcerror_error_t **error ) { 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; uint8_t calculate_sha1 = 0; uint8_t calculate_sha256 = 0; int number_of_segments = 0; int result = 0; int segment_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; #endif if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } string_length = system_string_length( string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, (wchar_t) ',', &string_elements, error ) != 1 ) #else if( libcsplit_narrow_string_split( string, string_length + 1, (char) ',', &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); goto on_error; } for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } if( string_segment_size == 5 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha1" ), 4 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA1" ), 4 ) == 0 ) { calculate_sha1 = 1; } } else if( string_segment_size == 6 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "sha_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } } else if( string_segment_size == 7 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha256" ), 6 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA256" ), 6 ) == 0 ) { calculate_sha256 = 1; } } else if( string_segment_size == 8 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "sha_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } } } if( ( calculate_sha1 != 0 ) && ( verification_handle->calculate_sha1 == 0 ) ) { verification_handle->calculated_sha1_hash_string = system_string_allocate( 41 ); if( verification_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated SHA1 digest hash string.", function ); goto on_error; } verification_handle->calculate_sha1 = 1; } if( ( calculate_sha256 != 0 ) && ( verification_handle->calculate_sha256 == 0 ) ) { verification_handle->calculated_sha256_hash_string = system_string_allocate( 65 ); if( verification_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated SHA256 digest hash string.", function ); goto on_error; } verification_handle->calculate_sha256 = 1; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) #else if( libcsplit_narrow_split_string_free( &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split string.", function ); goto on_error; } return( result ); on_error: if( string_elements != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); #else libcsplit_narrow_split_string_free( &string_elements, NULL ); #endif } return( -1 ); } /* Sets the zero chunk on error * Returns 1 if successful or -1 on error */ int verification_handle_set_zero_chunk_on_error( verification_handle_t *verification_handle, uint8_t zero_chunk_on_error, libcerror_error_t **error ) { static char *function = "verification_handle_set_zero_chunk_on_error"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( libewf_handle_set_read_zero_chunk_on_error( verification_handle->input_handle, zero_chunk_on_error, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set zero chunk on error in input handle.", function ); return( -1 ); } verification_handle->zero_chunk_on_error = zero_chunk_on_error; return( 1 ); } /* Appends a read error to the output handle * Returns 1 if successful or -1 on error */ int verification_handle_append_read_error( verification_handle_t *verification_handle, off64_t start_offset, size_t number_of_bytes, libcerror_error_t **error ) { static char *function = "verification_handle_append_read_error"; uint64_t start_sector = 0; uint64_t number_of_sectors = 0; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( verification_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing bytes per sector.", function ); return( -1 ); } start_sector = start_offset / verification_handle->bytes_per_sector; number_of_sectors = number_of_bytes / verification_handle->bytes_per_sector; if( ( number_of_bytes % verification_handle->bytes_per_sector ) != 0 ) { number_of_sectors += 1; } if( libewf_handle_append_checksum_error( verification_handle->input_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append checksum error.", function ); return( -1 ); } return( 1 ); } /* Print the hash values to a stream * Returns 1 if successful or -1 on error */ int verification_handle_hash_values_fprint( verification_handle_t *verification_handle, FILE *stream, libcerror_error_t **error ) { static char *function = "verification_handle_hash_values_fprint"; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( verification_handle->calculate_md5 != 0 ) { if( verification_handle->stored_md5_hash_available == 0 ) { fprintf( stream, "MD5 hash stored in file:\t\tN/A\n" ); } else { fprintf( stream, "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_SYSTEM "\n", verification_handle->calculated_md5_hash_string ); } if( verification_handle->calculate_sha1 != 0 ) { if( verification_handle->stored_sha1_hash_available == 0 ) { fprintf( stream, "SHA1 hash stored in file:\t\tN/A\n" ); } else { fprintf( stream, "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_SYSTEM "\n", verification_handle->calculated_sha1_hash_string ); } if( verification_handle->calculate_sha256 != 0 ) { if( verification_handle->stored_sha256_hash_available == 0 ) { fprintf( stream, "SHA256 hash stored in file:\t\tN/A\n" ); } else { fprintf( stream, "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_SYSTEM "\n", verification_handle->calculated_sha256_hash_string ); } return( 1 ); } /* Print the additional hash values to a stream * Returns 1 if successful or -1 on error */ int verification_handle_additional_hash_values_fprint( verification_handle_t *verification_handle, FILE *stream, libcerror_error_t **error ) { char hash_value_identifier[ VERIFICATION_HANDLE_VALUE_IDENTIFIER_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; size_t hash_value_size = VERIFICATION_HANDLE_VALUE_SIZE; uint32_t number_of_values = 0; uint32_t hash_value_iterator = 0; uint8_t print_header = 1; int result = 1; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( libewf_handle_get_number_of_hash_values( verification_handle->input_handle, &number_of_values, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of hash values.", function ); return( -1 ); } for( hash_value_iterator = 0; hash_value_iterator < number_of_values; hash_value_iterator++ ) { if( libewf_handle_get_hash_value_identifier_size( verification_handle->input_handle, hash_value_iterator, &hash_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the hash value identifier size for index: %" PRIu32 ".", function, hash_value_iterator ); result = -1; continue; } if( hash_value_identifier_size > VERIFICATION_HANDLE_VALUE_IDENTIFIER_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: hash value identifier size value out of bounds for index: %" PRIu32 ".", function, hash_value_iterator ); result = -1; continue; } if( libewf_handle_get_hash_value_identifier( verification_handle->input_handle, hash_value_iterator, (uint8_t *) hash_value_identifier, hash_value_identifier_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the hash identifier for index: %" PRIu32 ".", function, hash_value_iterator ); result = -1; continue; } if( verification_handle->calculate_md5 != 0 ) { if( hash_value_identifier_size == 4 ) { if( narrow_string_compare( hash_value_identifier, "MD5", 3 ) == 0 ) { continue; } } } if( verification_handle->calculate_sha1 != 0 ) { if( hash_value_identifier_size == 5 ) { if( narrow_string_compare( hash_value_identifier, "SHA1", 4 ) == 0 ) { continue; } } } if( verification_handle->calculate_sha256 != 0 ) { if( hash_value_identifier_size == 7 ) { if( narrow_string_compare( hash_value_identifier, "SHA256", 6 ) == 0 ) { continue; } } } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_size - 1, (uint16_t *) hash_value, hash_value_size, error ) != 1 ) #else if( libewf_handle_get_utf8_hash_value( verification_handle->input_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_size - 1, (uint8_t *) hash_value, hash_value_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the hash value for identifier: %s.", function, hash_value_identifier ); result = -1; } else { if( print_header != 0 ) { fprintf( stream, "\nAdditional hash values:\n" ); print_header = 0; } fprintf( stream, "%s:\t%" PRIs_SYSTEM "\n", hash_value_identifier, hash_value ); } } return( result ); } /* Print the checksum errors to a stream * Returns 1 if successful or -1 on error */ int verification_handle_checksum_errors_fprint( verification_handle_t *verification_handle, FILE *stream, libcerror_error_t **error ) { 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; uint64_t start_sector = 0; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint32_t number_of_errors = 0; uint32_t error_index = 0; int result = 0; int return_value = 1; if( verification_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid verification handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( libewf_handle_get_number_of_checksum_errors( verification_handle->input_handle, &number_of_errors, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of checksum errors.", function ); goto on_error; } if( number_of_errors > 0 ) { fprintf( stream, "Sector validation errors:\n" ); fprintf( stream, "\ttotal number: %" PRIu32 "\n", number_of_errors ); for( error_index = 0; error_index < number_of_errors; error_index++ ) { if( libewf_handle_get_checksum_error( verification_handle->input_handle, error_index, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the checksum error: %" PRIu32 ".", function, error_index ); start_sector = 0; number_of_sectors = 0; return_value = -1; continue; } last_sector = start_sector + number_of_sectors - 1; fprintf( stream, "\tat sector(s): %" PRIu64 " - %" PRIu64 " (number: %" PRIu64 ")", start_sector, last_sector, number_of_sectors ); fprintf( stream, " in segment file(s):" ); start_sector *= verification_handle->bytes_per_sector; last_sector *= verification_handle->bytes_per_sector; while( start_sector <= last_sector ) { if( libewf_handle_seek_offset( verification_handle->input_handle, (off64_t) start_sector, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, start_sector ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result= libewf_handle_get_filename_size_wide( verification_handle->input_handle, &filename_size, error ); #else result = libewf_handle_get_filename_size( verification_handle->input_handle, &filename_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename size.", function ); goto on_error; } else if( result != 0 ) { filename = system_string_allocate( filename_size ); if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create filename.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_get_filename_wide( verification_handle->input_handle, filename, filename_size, error ) != 1 ) #else if( libewf_handle_get_filename( verification_handle->input_handle, filename, filename_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename.", function ); goto on_error; } if( last_filename == NULL ) { fprintf( stream, " %" PRIs_SYSTEM "", filename ); last_filename = filename; last_filename_size = filename_size; } else if( ( last_filename_size != filename_size ) || ( memory_compare( last_filename, filename, filename_size ) != 0 ) ) { fprintf( stream, ", %" PRIs_SYSTEM "", filename ); memory_free( last_filename ); last_filename = filename; last_filename_size = filename_size; } else { memory_free( filename ); } filename = NULL; filename_size = 0; } start_sector += verification_handle->chunk_size; } if( last_filename != NULL ) { memory_free( last_filename ); last_filename = NULL; last_filename_size = 0; } fprintf( stream, "\n" ); } fprintf( stream, "\n" ); } return( return_value ); on_error: if( last_filename != NULL ) { memory_free( last_filename ); } if( filename != NULL ) { memory_free( filename ); } return( -1 ); } libewf-20140807/ewftools/imaging_handle.h0000664000175000017500000003247213421024433022276 0ustar00lordyestalordyesta00000000000000/* * Imaging handle * * 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( _IMAGING_HANDLE_H ) #define _IMAGING_HANDLE_H #include #include #include #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "storage_media_buffer.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct imaging_handle imaging_handle_t; struct imaging_handle { /* The user input buffer */ system_character_t *input_buffer; /* The target filename */ system_character_t *target_filename; /* The target filename size */ size_t target_filename_size; /* The secondary target filename */ system_character_t *secondary_target_filename; /* The secondary target filename size */ size_t secondary_target_filename_size; /* The header codepage */ int header_codepage; /* The case number */ system_character_t *case_number; /* The case number size */ size_t case_number_size; /* The description */ system_character_t *description; /* The description size */ size_t description_size; /* The evidence number */ system_character_t *evidence_number; /* The evidence number size */ size_t evidence_number_size; /* The examiner name */ system_character_t *examiner_name; /* The examiner name size */ size_t examiner_name_size; /* The notes */ system_character_t *notes; /* The notes size */ size_t notes_size; /* The compression method */ uint16_t compression_method; /* The compression level */ int8_t compression_level; /* The compression flags */ uint8_t compression_flags; /* The EWF format */ uint8_t ewf_format; /* The media type */ uint8_t media_type; /* The media flags */ uint8_t media_flags; /* The number of bytes per sector */ uint32_t bytes_per_sector; /* The number of sectors per chunk */ uint32_t sectors_per_chunk; /* The error granularity number of sectors */ uint32_t sector_error_granularity; /* The maximum segment size */ size64_t maximum_segment_size; /* The acquiry offset */ uint64_t acquiry_offset; /* The acquiry size */ uint64_t acquiry_size; /* Value to indicate if the MD5 digest hash should be calculated */ uint8_t calculate_md5; /* The MD5 digest context */ libhmac_md5_context_t *md5_context; /* Value to indicate the MD5 digest context was initialized */ uint8_t md5_context_initialized; /* The calculated MD5 digest hash string */ system_character_t *calculated_md5_hash_string; /* Value to indicate if the SHA1 digest hash should be calculated */ uint8_t calculate_sha1; /* The SHA1 digest context */ libhmac_sha1_context_t *sha1_context; /* Value to indicate the SHA1 digest context was initialized */ uint8_t sha1_context_initialized; /* The calculated SHA1 digest hash string */ system_character_t *calculated_sha1_hash_string; /* Value to indicate if the SHA256 digest hash should be calculated */ uint8_t calculate_sha256; /* The SHA256 digest context */ libhmac_sha256_context_t *sha256_context; /* Value to indicate the SHA256 digest context was initialized */ uint8_t sha256_context_initialized; /* Value to indicate if the chunk data instead of the buffered read and write functions should be used */ uint8_t use_chunk_data_functions; /* The calculated SHA256 digest hash string */ system_character_t *calculated_sha256_hash_string; /* The libewf output handle */ libewf_handle_t *output_handle; /* The secondary libewf output handle */ libewf_handle_t *secondary_output_handle; /* The input media size */ size64_t input_media_size; /* The process buffer size */ size_t process_buffer_size; /* The notification output stream */ FILE *notify_stream; /* Value to indicate if abort was signalled */ int abort; }; int imaging_handle_initialize( imaging_handle_t **imaging_handle, uint8_t calculate_md5, uint8_t use_chunk_data_functions, libcerror_error_t **error ); int imaging_handle_free( imaging_handle_t **imaging_handle, libcerror_error_t **error ); int imaging_handle_signal_abort( imaging_handle_t *imaging_handle, libcerror_error_t **error ); int imaging_handle_open_output( imaging_handle_t *imaging_handle, const system_character_t *filename, uint8_t resume, libcerror_error_t **error ); int imaging_handle_open_secondary_output( imaging_handle_t *imaging_handle, const system_character_t *filename, uint8_t resume, libcerror_error_t **error ); int imaging_handle_close( imaging_handle_t *imaging_handle, libcerror_error_t **error ); ssize_t imaging_handle_prepare_read_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ); ssize_t imaging_handle_read_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ); ssize_t imaging_handle_prepare_write_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ); ssize_t imaging_handle_write_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, size_t write_size, libcerror_error_t **error ); off64_t imaging_handle_seek_offset( imaging_handle_t *imaging_handle, off64_t offset, libcerror_error_t **error ); int imaging_handle_get_offset( imaging_handle_t *imaging_handle, off64_t *offset, libcerror_error_t **error ); int imaging_handle_swap_byte_pairs( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ); int imaging_handle_initialize_integrity_hash( imaging_handle_t *imaging_handle, libcerror_error_t **error ); int imaging_handle_update_integrity_hash( imaging_handle_t *imaging_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); int imaging_handle_finalize_integrity_hash( imaging_handle_t *imaging_handle, libcerror_error_t **error ); int imaging_handle_get_chunk_size( imaging_handle_t *imaging_handle, size32_t *chunk_size, libcerror_error_t **error ); int imaging_handle_prompt_for_string( imaging_handle_t *imaging_handle, 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 system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_compression_level( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_format( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_media_type( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_media_flags( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_bytes_per_sector( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_sectors_per_chunk( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_sector_error_granularity( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_maximum_segment_size( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_acquiry_offset( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_acquiry_size( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_get_output_values( imaging_handle_t *imaging_handle, libcerror_error_t **error ); int imaging_handle_set_string( imaging_handle_t *imaging_handle, 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 system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_format( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_media_type( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_media_flags( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_bytes_per_sector( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_sectors_per_chunk( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_sector_error_granularity( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_maximum_segment_size( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_acquiry_offset( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_acquiry_size( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_header_codepage( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_process_buffer_size( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_additional_digest_types( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_output_values( imaging_handle_t *imaging_handle, 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, system_character_t **header_value, size_t *header_value_size, libcerror_error_t **error ); int imaging_handle_set_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_length, 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, system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ); int imaging_handle_append_read_error( imaging_handle_t *imaging_handle, off64_t start_offset, size64_t number_of_bytes, libcerror_error_t **error ); int imaging_handle_append_session( imaging_handle_t *imaging_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); int imaging_handle_append_track( imaging_handle_t *imaging_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ); ssize_t imaging_handle_finalize( imaging_handle_t *imaging_handle, libcerror_error_t **error ); int imaging_handle_print_parameters( imaging_handle_t *imaging_handle, off64_t resume_acquiry_offset, uint8_t read_error_retries, uint8_t zero_block_on_read_error, uint8_t resume_acquiry, libcerror_error_t **error ); int imaging_handle_print_hashes( imaging_handle_t *imaging_handle, FILE *stream, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/ewftools_unused.h0000664000175000017500000000277113440662654022612 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2006-2019, 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_UNUSED_H ) #define _EWFTOOLS_UNUSED_H #include #if !defined( EWFTOOLS_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define EWFTOOLS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define EWFTOOLS_ATTRIBUTE_UNUSED #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ #endif /* !defined( EWFTOOLS_ATTRIBUTE_UNUSED ) */ #if defined( _MSC_VER ) #define EWFTOOLS_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define EWFTOOLS_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif /* defined( _MSC_VER ) */ #endif /* !defined( _EWFTOOLS_UNUSED_H ) */ libewf-20140807/ewftools/mount_dokan.h0000664000175000017500000001244513421020221021653 0ustar00lordyestalordyesta00000000000000/* * Mount tool dokan functions * * Copyright (C) 2006-2019, 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( _MOUNT_DOKAN_H ) #define _MOUNT_DOKAN_H #include #include #if defined( HAVE_LIBDOKAN ) #include #endif #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "mount_file_entry.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_LIBDOKAN ) int mount_dokan_set_file_information( BY_HANDLE_FILE_INFORMATION *file_information, size64_t size, uint16_t file_mode, uint64_t creation_time, uint64_t access_time, uint64_t modification_time, libcerror_error_t **error ); int mount_dokan_set_find_data( WIN32_FIND_DATAW *find_data, size64_t size, uint16_t file_mode, uint64_t creation_time, uint64_t access_time, uint64_t modification_time, libcerror_error_t **error ); int mount_dokan_filldir( PFillFindData fill_find_data, DOKAN_FILE_INFO *file_info, wchar_t *name, size_t name_size, WIN32_FIND_DATAW *find_data, mount_file_entry_t *file_entry, libcerror_error_t **error ); #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) int __stdcall mount_dokan_CreateFile( const wchar_t *path, DWORD desired_access, DWORD share_mode, DWORD creation_disposition, DWORD attribute_flags, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_OpenDirectory( const wchar_t *path, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_CloseFile( const wchar_t *path, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_ReadFile( const wchar_t *path, void *buffer, DWORD number_of_bytes_to_read, DWORD *number_of_bytes_read, LONGLONG offset, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_FindFiles( const wchar_t *path, PFillFindData fill_find_data, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_GetFileInformation( const wchar_t *path, BY_HANDLE_FILE_INFORMATION *file_information, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_GetVolumeInformation( wchar_t *volume_name, DWORD volume_name_size, DWORD *volume_serial_number, DWORD *maximum_filename_length, DWORD *file_system_flags, wchar_t *file_system_name, DWORD file_system_name_size, DOKAN_FILE_INFO *file_info ); int __stdcall mount_dokan_Unmount( DOKAN_FILE_INFO *file_info ); #else NTSTATUS __stdcall mount_dokan_ZwCreateFile( const wchar_t *path, DOKAN_IO_SECURITY_CONTEXT *security_context, ACCESS_MASK desired_access, ULONG file_attributes, ULONG share_access, ULONG creation_disposition, ULONG creation_options, DOKAN_FILE_INFO *file_info ); NTSTATUS __stdcall mount_dokan_CloseFile( const wchar_t *path, DOKAN_FILE_INFO *file_info ); NTSTATUS __stdcall mount_dokan_ReadFile( const wchar_t *path, void *buffer, DWORD number_of_bytes_to_read, DWORD *number_of_bytes_read, LONGLONG offset, DOKAN_FILE_INFO *file_info ); NTSTATUS __stdcall mount_dokan_FindFiles( const wchar_t *path, PFillFindData fill_find_data, DOKAN_FILE_INFO *file_info ); NTSTATUS __stdcall mount_dokan_GetFileInformation( const wchar_t *path, BY_HANDLE_FILE_INFORMATION *file_information, DOKAN_FILE_INFO *file_info ); NTSTATUS __stdcall mount_dokan_GetVolumeInformation( wchar_t *volume_name, DWORD volume_name_size, DWORD *volume_serial_number, DWORD *maximum_filename_length, DWORD *file_system_flags, wchar_t *file_system_name, DWORD file_system_name_size, DOKAN_FILE_INFO *file_info ); #endif /* ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) */ #endif /* defined( HAVE_LIBDOKAN ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _MOUNT_DOKAN_H ) */ libewf-20140807/ewftools/mount_file_entry.c0000664000175000017500000006615613421020221022722 0ustar00lordyestalordyesta00000000000000/* * Mount file entry * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_SYS_STAT_H ) #include #endif #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "mount_file_entry.h" #include "mount_file_system.h" #if !defined( S_IFDIR ) #define S_IFDIR 0x4000 #endif #if !defined( S_IFREG ) #define S_IFREG 0x8000 #endif /* Creates a file entry * Make sure the value file_entry is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int mount_file_entry_initialize( mount_file_entry_t **file_entry, mount_file_system_t *file_system, const system_character_t *name, size_t name_length, int type, libewf_handle_t *ewf_handle, libewf_file_entry_t *ewf_file_entry, libcerror_error_t **error ) { static char *function = "mount_file_entry_initialize"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( *file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file entry value already set.", function ); return( -1 ); } if( file_system == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file system.", function ); return( -1 ); } if( name_length > (size_t) ( SSIZE_MAX - 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid name length value exceeds maximum.", function ); return( -1 ); } *file_entry = memory_allocate_structure( mount_file_entry_t ); if( *file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file entry.", function ); goto on_error; } if( memory_set( *file_entry, 0, sizeof( mount_file_entry_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear file entry.", function ); memory_free( *file_entry ); *file_entry = NULL; return( -1 ); } ( *file_entry )->file_system = file_system; if( name != NULL ) { ( *file_entry )->name = system_string_allocate( name_length + 1 ); if( ( *file_entry )->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name string.", function ); goto on_error; } if( name_length > 0 ) { if( system_string_copy( ( *file_entry )->name, name, name_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy name.", function ); goto on_error; } } ( *file_entry )->name[ name_length ] = 0; ( *file_entry )->name_size = name_length + 1; } ( *file_entry )->type = type; ( *file_entry )->ewf_handle = ewf_handle; ( *file_entry )->ewf_file_entry = ewf_file_entry; return( 1 ); on_error: if( *file_entry != NULL ) { if( ( *file_entry )->name != NULL ) { memory_free( ( *file_entry )->name ); } memory_free( *file_entry ); *file_entry = NULL; } return( -1 ); } /* Frees a file entry * Returns 1 if successful or -1 on error */ int mount_file_entry_free( mount_file_entry_t **file_entry, libcerror_error_t **error ) { static char *function = "mount_file_entry_free"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( *file_entry != NULL ) { if( ( *file_entry )->name != NULL ) { memory_free( ( *file_entry )->name ); } memory_free( *file_entry ); *file_entry = NULL; } return( 1 ); } /* Retrieves the parent file entry * Returns 1 if successful, 0 if no such file entry or -1 on error */ int mount_file_entry_get_parent_file_entry( mount_file_entry_t *file_entry, mount_file_entry_t **parent_file_entry, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_parent_file_entry"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( parent_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid parent file entry.", function ); return( -1 ); } if( *parent_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid parent file entry value already set.", function ); return( -1 ); } /* TODO implement get_parent function */ return( 1 ); } /* Retrieves the creation date and time * On Windows the timestamp is an unsigned 64-bit FILETIME timestamp * otherwise the timestamp is a signed 64-bit POSIX date and time value in number of nanoseconds * Returns 1 if successful or -1 on error */ int mount_file_entry_get_creation_time( mount_file_entry_t *file_entry, uint64_t *creation_time, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_creation_time"; int32_t posix_time = 0; #if defined( WINAPI ) uint64_t filetime = 0; #endif if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { if( libewf_file_entry_get_creation_time( file_entry->ewf_file_entry, (uint32_t *) &posix_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve creation time from file entry.", function ); return( -1 ); } #if defined( WINAPI ) if( posix_time != 0 ) { /* Convert the POSIX nanoseconds timestamp into a FILETIME timestamp */ filetime = (uint64_t) ( ( (int64_t) posix_time * 10000000 ) + 116444736000000000L ); } *creation_time = filetime; #else *creation_time = (uint64_t) posix_time * 1000000000; #endif } else { if( mount_file_system_get_mounted_timestamp( file_entry->file_system, creation_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mounted timestamp.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the access date and time * On Windows the timestamp is an unsigned 64-bit FILETIME timestamp * otherwise the timestamp is a signed 64-bit POSIX date and time value in number of nanoseconds * Returns 1 if successful or -1 on error */ int mount_file_entry_get_access_time( mount_file_entry_t *file_entry, uint64_t *access_time, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_access_time"; int32_t posix_time = 0; #if defined( WINAPI ) uint64_t filetime = 0; #endif if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { if( libewf_file_entry_get_access_time( file_entry->ewf_file_entry, (uint32_t *) &posix_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access time from file entry.", function ); return( -1 ); } #if defined( WINAPI ) if( posix_time != 0 ) { /* Convert the POSIX nanoseconds timestamp into a FILETIME timestamp */ filetime = (uint64_t) ( ( (int64_t) posix_time * 10000000 ) + 116444736000000000L ); } *access_time = filetime; #else *access_time = (uint64_t) posix_time * 1000000000; #endif } else { if( mount_file_system_get_mounted_timestamp( file_entry->file_system, access_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mounted timestamp.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the modification date and time * On Windows the timestamp is an unsigned 64-bit FILETIME timestamp * otherwise the timestamp is a signed 64-bit POSIX date and time value in number of nanoseconds * Returns 1 if successful or -1 on error */ int mount_file_entry_get_modification_time( mount_file_entry_t *file_entry, uint64_t *modification_time, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_modification_time"; int32_t posix_time = 0; #if defined( WINAPI ) uint64_t filetime = 0; #endif if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { if( libewf_file_entry_get_modification_time( file_entry->ewf_file_entry, (uint32_t *) &posix_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve modification time from file entry.", function ); return( -1 ); } #if defined( WINAPI ) if( posix_time != 0 ) { /* Convert the POSIX nanoseconds timestamp into a FILETIME timestamp */ filetime = (uint64_t) ( ( (int64_t) posix_time * 10000000 ) + 116444736000000000L ); } *modification_time = filetime; #else *modification_time = (uint64_t) posix_time * 1000000000; #endif } else { if( mount_file_system_get_mounted_timestamp( file_entry->file_system, modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mounted timestamp.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the inode change date and time * On Windows the timestamp is an unsigned 64-bit FILETIME timestamp * otherwise the timestamp is a signed 64-bit POSIX date and time value in number of nanoseconds * Returns 1 if successful or -1 on error */ int mount_file_entry_get_inode_change_time( mount_file_entry_t *file_entry, uint64_t *inode_change_time, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_inode_change_time"; int32_t posix_time = 0; #if defined( WINAPI ) uint64_t filetime = 0; #endif if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { if( libewf_file_entry_get_entry_modification_time( file_entry->ewf_file_entry, (uint32_t *) &posix_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry modification time from file entry.", function ); return( -1 ); } #if defined( WINAPI ) if( posix_time != 0 ) { /* Convert the POSIX nanoseconds timestamp into a FILETIME timestamp */ filetime = (uint64_t) ( ( (int64_t) posix_time * 10000000 ) + 116444736000000000L ); } *inode_change_time = filetime; #else *inode_change_time = (uint64_t) posix_time * 1000000000; #endif } else { if( mount_file_system_get_mounted_timestamp( file_entry->file_system, inode_change_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mounted timestamp.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the file mode * Returns 1 if successful or -1 on error */ int mount_file_entry_get_file_mode( mount_file_entry_t *file_entry, uint16_t *file_mode, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_file_mode"; int number_of_sub_file_entries = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_mode == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file mode.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { /* TODO improve this check */ if( libewf_file_entry_get_number_of_sub_file_entries( file_entry->ewf_file_entry, &number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); return( -1 ); } if( number_of_sub_file_entries != 0 ) { *file_mode = S_IFDIR | 0555; } else { *file_mode = S_IFREG | 0444; } } else { if( file_entry->ewf_handle == NULL ) { *file_mode = S_IFDIR | 0555; } else { *file_mode = S_IFREG | 0444; } } return( 1 ); } /* Retrieves the size of the name * The returned size includes the end of string character * Returns 1 if successful or -1 on error */ int mount_file_entry_get_name_size( mount_file_entry_t *file_entry, size_t *string_size, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_name_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } *string_size = file_entry->name_size; return( 1 ); } /* Retrieves the name * The size should include the end of string character * Returns 1 if successful or -1 on error */ int mount_file_entry_get_name( mount_file_entry_t *file_entry, system_character_t *string, size_t string_size, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_name"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file entry - missing name.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( string_size < file_entry->name_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: invalid string size value too small.", function ); return( -1 ); } if( system_string_copy( string, file_entry->name, file_entry->name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy name.", function ); return( -1 ); } string[ file_entry->name_size - 1 ] = 0; return( 1 ); } /* Retrieves the number of sub file entries * Returns 1 if successful or -1 on error */ int mount_file_entry_get_number_of_sub_file_entries( mount_file_entry_t *file_entry, int *number_of_sub_file_entries, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_number_of_sub_file_entries"; int number_of_handles = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( number_of_sub_file_entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sub file entries.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { if( libewf_file_entry_get_number_of_sub_file_entries( file_entry->ewf_file_entry, number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); return( -1 ); } } else { if( file_entry->ewf_handle == NULL ) { if( mount_file_system_get_number_of_handles( file_entry->file_system, &number_of_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of handles.", function ); return( -1 ); } if( ( number_of_handles < 0 ) || ( number_of_handles > 99 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported number of handles.", function ); return( -1 ); } *number_of_sub_file_entries = number_of_handles; } } return( 1 ); } /* Retrieves the sub file entry for the specific index * Returns 1 if successful or -1 on error */ int mount_file_entry_get_sub_file_entry_by_index( mount_file_entry_t *file_entry, int sub_file_entry_index, mount_file_entry_t **sub_file_entry, libcerror_error_t **error ) { system_character_t path[ 32 ]; libewf_file_entry_t *sub_ewf_file_entry = NULL; libewf_handle_t *ewf_handle = NULL; system_character_t *filename = NULL; static char *function = "mount_file_entry_get_sub_file_entry_by_index"; size_t filename_size = 0; int number_of_sub_file_entries = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( sub_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub file entry.", function ); return( -1 ); } if( *sub_file_entry != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sub file entry value already set.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { /* TODO replace by libewf_file_entry_get_sub_file_entry_by_index */ if( libewf_file_entry_get_sub_file_entry( file_entry->ewf_file_entry, sub_file_entry_index, &sub_ewf_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d from file entry.", function, sub_file_entry_index ); goto on_error; } if( sub_ewf_file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } if( mount_file_system_get_filename_from_file_entry( file_entry->file_system, sub_ewf_file_entry, &filename, &filename_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename of sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } } else { if( mount_file_entry_get_number_of_sub_file_entries( file_entry, &number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); goto on_error; } if( ( sub_file_entry_index < 0 ) || ( sub_file_entry_index >= number_of_sub_file_entries ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sub file entry index value out of bounds.", function ); goto on_error; } if( mount_file_system_get_path_from_handle_index( file_entry->file_system, sub_file_entry_index, path, 32, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve path for file entry: %d.", function, sub_file_entry_index ); goto on_error; } if( mount_file_system_get_handle_by_index( file_entry->file_system, sub_file_entry_index, &ewf_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle: %d from file system.", function, sub_file_entry_index ); goto on_error; } if( ewf_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing handle: %d.", function, sub_file_entry_index ); goto on_error; } filename = &( path[ 1 ] ); filename_size = system_string_length( path ); } if( mount_file_entry_initialize( sub_file_entry, file_entry->file_system, filename, filename_size - 1, file_entry->type, ewf_handle, sub_ewf_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } if( ( filename != NULL ) && ( filename != &( path[ 1 ] ) ) ) { memory_free( filename ); } return( 1 ); on_error: if( ( filename != NULL ) && ( filename != &( path[ 1 ] ) ) ) { memory_free( filename ); } if( sub_file_entry != NULL ) { libewf_file_entry_free( &sub_ewf_file_entry, NULL ); } return( -1 ); } /* Reads data at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t mount_file_entry_read_buffer_at_offset( mount_file_entry_t *file_entry, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ) { static char *function = "mount_file_entry_read_buffer_at_offset"; ssize_t read_count = 0; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { read_count = libewf_file_entry_read_random( file_entry->ewf_file_entry, buffer, buffer_size, offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer at offset: %" PRIi64 " (0x%08" PRIx64 ") from file entry.", function, offset, offset ); return( -1 ); } } else { read_count = libewf_handle_read_random( file_entry->ewf_handle, buffer, buffer_size, offset, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer at offset: %" PRIi64 " (0x%08" PRIx64 ") from handle.", function, offset, offset ); return( -1 ); } } return( read_count ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int mount_file_entry_get_size( mount_file_entry_t *file_entry, size64_t *size, libcerror_error_t **error ) { static char *function = "mount_file_entry_get_size"; if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( file_entry->type == MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY ) { if( libewf_file_entry_get_size( file_entry->ewf_file_entry, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size from file entry.", function ); return( -1 ); } } else if( file_entry->ewf_handle != NULL ) { if( libewf_handle_get_media_size( file_entry->ewf_handle, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size from handle.", function ); return( -1 ); } } else { if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } *size = 0; } return( 1 ); } libewf-20140807/ewftools/storage_media_buffer.h0000644000175000017500000000531713421020222023470 0ustar00lordyestalordyesta00000000000000/* * Storage media buffer * * 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( _STORAGE_MEDIA_BUFFER_H ) #define _STORAGE_MEDIA_BUFFER_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif enum STORAGE_MEDIA_BUFFER_MODES { STORAGE_MEDIA_BUFFER_MODE_BUFFERED = 0, STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA = 1 }; typedef struct storage_media_buffer storage_media_buffer_t; struct storage_media_buffer { /* The mode */ uint8_t mode; /* The raw buffer */ uint8_t *raw_buffer; /* The raw buffer size */ size_t raw_buffer_size; /* The size of the data in the raw buffer */ size_t raw_buffer_data_size; /* Value to indicate if the compression buffer * contains uncompressed data */ int8_t data_in_compression_buffer; /* Value to indicate if the data is compressed */ int8_t is_compressed; /* The compression buffer */ uint8_t *compression_buffer; /* The compression buffer size */ size_t compression_buffer_size; /* The size of the data in the compression buffer */ size_t compression_buffer_data_size; /* The process count after read or write prepare */ size_t process_count; /* The checksum buffer */ uint8_t *checksum_buffer; /* Value to indicate if the checksum should be processed * read or written */ int8_t process_checksum; /* The checksum of the data within the buffer */ uint32_t checksum; }; int storage_media_buffer_initialize( storage_media_buffer_t **buffer, uint8_t mode, size_t size, libcerror_error_t **error ); int storage_media_buffer_free( storage_media_buffer_t **buffer, libcerror_error_t **error ); int storage_media_buffer_resize( storage_media_buffer_t *buffer, size_t size, libcerror_error_t **error ); int storage_media_buffer_get_data( storage_media_buffer_t *buffer, uint8_t **data, size_t *data_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/mount_fuse.h0000664000175000017500000000531113421020222021514 0ustar00lordyestalordyesta00000000000000/* * Mount tool fuse functions * * Copyright (C) 2006-2019, 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( _MOUNT_FUSE_H ) #define _MOUNT_FUSE_H #include #include #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) #define FUSE_USE_VERSION 26 #if defined( HAVE_LIBFUSE ) #include #elif defined( HAVE_LIBOSXFUSE ) #include #endif #endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) */ #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "mount_file_entry.h" #include "mount_handle.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) int mount_fuse_set_stat_info( struct stat *stat_info, size64_t size, uint16_t file_mode, int64_t access_time, int64_t inode_change_time, int64_t modification_time, libcerror_error_t **error ); int mount_fuse_filldir( void *buffer, fuse_fill_dir_t filler, const char *name, struct stat *stat_info, mount_file_entry_t *file_entry, libcerror_error_t **error ); int mount_fuse_open( const char *path, struct fuse_file_info *file_info ); int mount_fuse_read( const char *path, char *buffer, size_t size, off_t offset, struct fuse_file_info *file_info ); int mount_fuse_release( const char *path, struct fuse_file_info *file_info ); int mount_fuse_opendir( const char *path, struct fuse_file_info *file_info ); int mount_fuse_readdir( const char *path, void *buffer, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *file_info ); int mount_fuse_releasedir( const char *path, struct fuse_file_info *file_info ); int mount_fuse_getattr( const char *path, struct stat *stat_info ); void mount_fuse_destroy( void *private_data ); #endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _MOUNT_FUSE_H ) */ libewf-20140807/ewftools/mount_handle.h0000664000175000017500000000544413421020222022014 0ustar00lordyestalordyesta00000000000000/* * Mount handle * * Copyright (C) 2006-2019, 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( _MOUNT_HANDLE_H ) #define _MOUNT_HANDLE_H #include #include #include #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "mount_file_entry.h" #include "mount_file_system.h" #if defined( __cplusplus ) extern "C" { #endif enum MOUNT_HANDLE_INPUT_FORMATS { MOUNT_HANDLE_INPUT_FORMAT_FILES = (int) 'f', MOUNT_HANDLE_INPUT_FORMAT_RAW = (int) 'r' }; typedef struct mount_handle mount_handle_t; struct mount_handle { /* The file system */ mount_file_system_t *file_system; /* The input format */ uint8_t input_format; /* The maximum number of open handles */ int maximum_number_of_open_handles; /* The notification output stream */ FILE *notify_stream; }; int mount_handle_initialize( mount_handle_t **mount_handle, libcerror_error_t **error ); int mount_handle_free( mount_handle_t **mount_handle, libcerror_error_t **error ); int mount_handle_signal_abort( mount_handle_t *mount_handle, libcerror_error_t **error ); int mount_handle_set_format( mount_handle_t *mount_handle, const system_character_t *string, libcerror_error_t **error ); int mount_handle_set_maximum_number_of_open_handles( mount_handle_t *mount_handle, int maximum_number_of_open_handles, libcerror_error_t **error ); int mount_handle_set_path_prefix( mount_handle_t *mount_handle, const system_character_t *path_prefix, size_t path_prefix_size, libcerror_error_t **error ); int mount_handle_open( mount_handle_t *mount_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int mount_handle_close( mount_handle_t *mount_handle, libcerror_error_t **error ); int mount_handle_get_file_entry_by_path( mount_handle_t *mount_handle, const system_character_t *path, mount_file_entry_t **file_entry, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _MOUNT_HANDLE_H ) */ libewf-20140807/ewftools/Makefile.am0000664000175000017500000002535513421024433021235 0ustar00lordyestalordyesta00000000000000AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCDATETIME_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ @LIBFDATA_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @LIBMFDATA_CPPFLAGS@ \ @LIBCRYPTO_CPPFLAGS@ \ @LIBHMAC_CPPFLAGS@ \ @LIBODRAW_CPPFLAGS@ \ @LIBSMDEV_CPPFLAGS@ \ @LIBSMRAW_CPPFLAGS@ \ @LIBFUSE_CPPFLAGS@ \ @LIBEWF_DLL_IMPORT@ AM_LDFLAGS = @STATIC_LDFLAGS@ bin_PROGRAMS = \ ewfacquire \ ewfacquirestream \ ewfdebug \ ewfexport \ ewfinfo \ ewfmount \ ewfrecover \ ewfverify ewfacquire_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ device_handle.c device_handle.h \ ewfacquire.c \ ewfcommon.h \ ewfinput.c ewfinput.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ imaging_handle.c imaging_handle.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfacquire_LDADD = \ @LIBODRAW_LIBADD@ \ @LIBSMDEV_LIBADD@ \ @LIBSMRAW_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ @LIBCDATA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfacquirestream_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfacquirestream.c \ ewfcommon.h \ ewfinput.c ewfinput.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ imaging_handle.c imaging_handle.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfacquirestream_LDADD = \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfdebug_SOURCES = \ byte_size_string.c byte_size_string.h \ ewfdebug.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h ewfdebug_LDADD = \ @LIBUNA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfexport_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfcommon.h \ ewfexport.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libcfile.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ export_handle.c export_handle.h \ guid.c guid.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfexport_LDADD = \ @LIBSMRAW_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ @LIBCDATA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfinfo_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfinfo.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ info_handle.c info_handle.h \ platform.c platform.h ewfinfo_LDADD = \ @LIBUUID_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfmount_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfmount.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libewf.h \ ewftools_libfvalue.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ mount_dokan.c mount_dokan.h \ mount_file_entry.c mount_file_entry.h \ mount_file_system.c mount_file_system.h \ mount_fuse.c mount_fuse.h \ mount_handle.c mount_handle.h \ platform.c platform.h ewfmount_LDADD = \ @LIBFUSE_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ ../libewf/libewf.la \ @LIBCTHREADS_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfrecover_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfcommon.h \ ewfrecover.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libcfile.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ export_handle.c export_handle.h \ guid.c guid.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfrecover_LDADD = \ @LIBSMRAW_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ @LIBCDATA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfverify_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfcommon.h \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ ewfverify.c \ log_handle.c log_handle.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h \ verification_handle.c verification_handle.h ewfverify_LDADD = \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on ewfacquire ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfacquire_SOURCES) @echo "Running splint on ewfacquirestream ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfacquirestream_SOURCES) @echo "Running splint on ewfdebug ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfdebug_SOURCES) @echo "Running splint on ewfexport ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfexport_SOURCES) @echo "Running splint on ewfinfo ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfinfo_SOURCES) @echo "Running splint on ewfmount ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfmount_SOURCES) @echo "Running splint on ewfrecover ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfrecover_SOURCES) @echo "Running splint on ewfverify ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfverify_SOURCES) libewf-20140807/ewftools/ewfacquire.c0000664000175000017500000021646413421024433021503 0ustar00lordyestalordyesta00000000000000/* * Reads data from a file or device and writes it in EWF format * * 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 . */ #include #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif #include "byte_size_string.h" #include "device_handle.h" #include "ewfcommon.h" #include "ewfinput.h" #include "ewftools_getopt.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "imaging_handle.h" #include "log_handle.h" #include "process_status.h" #include "storage_media_buffer.h" #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) #define EWFACQUIRE_2_TIB 0x20000000000UL #else #define EWFACQUIRE_2_TIB 0x20000000000ULL #endif #define EWFACQUIRE_INPUT_BUFFER_SIZE 64 device_handle_t *ewfacquire_device_handle = NULL; imaging_handle_t *ewfacquire_imaging_handle = NULL; int ewfacquire_abort = 0; /* Prints the executable usage information to the stream */ void ewfacquire_usage_fprint( FILE *stream ) { 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; if( stream == NULL ) { return; } result = byte_size_string_create( default_segment_file_size_string, 16, EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); if( result == 1 ) { result = byte_size_string_create( minimum_segment_file_size_string, 16, EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { result = byte_size_string_create( maximum_32bit_segment_file_size_string, 16, EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { result = byte_size_string_create( maximum_64bit_segment_file_size_string, 16, EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } fprintf( stream, "Use ewfacquire to acquire data from a file or device and store it in the EWF\n" "format (Expert Witness Compression Format).\n\n" ); fprintf( stream, "Usage: ewfacquire [ -A codepage ] [ -b number_of_sectors ]\n" " [ -B number_of_bytes ] [ -c compression_values ]\n" " [ -C case_number ] [ -d digest_type ] [ -D description ]\n" " [ -e examiner_name ] [ -E evidence_number ] [ -f format ]\n" " [ -g number_of_sectors ] [ -l log_filename ]\n" " [ -m media_type ] [ -M media_flags ] [ -N notes ]\n" " [ -o offset ] [ -p process_buffer_size ]\n" " [ -P bytes_per_sector ] [ -r read_error_retries ]\n" " [ -S segment_file_size ] [ -t target ] [ -T toc_file ]\n" " [ -2 secondary_target ] [ -hqRsuvVwx ] source\n\n" ); fprintf( stream, "\tsource: the source file(s) or device\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-b: specify the number of sectors to read at once (per chunk),\n" "\t options: 16, 32, 64 (default), 128, 256, 512, 1024, 2048, 4096,\n" "\t 8192, 16384 or 32768\n" ); fprintf( stream, "\t-B: specify the number of bytes to acquire (default is all bytes)\n" ); fprintf( stream, "\t-c: specify the compression values as: level or method:level\n" "\t compression method options: deflate (default), bzip2\n" "\t (bzip2 is only supported by EWF2 formats)\n" "\t compression level options: none (default), empty-block,\n" "\t fast or best\n" ); fprintf( stream, "\t-C: specify the case number (default is case_number).\n" ); fprintf( stream, "\t-d: calculate additional digest (hash) types besides md5, options:\n" "\t sha1, sha256\n" ); fprintf( stream, "\t-D: specify the description (default is description).\n" ); fprintf( stream, "\t-e: specify the examiner name (default is examiner_name).\n" ); fprintf( stream, "\t-E: specify the evidence number (default is evidence_number).\n" ); fprintf( stream, "\t-f: specify the EWF file format to write to, options: ewf, smart,\n" "\t ftk, encase2, encase3, encase4, encase5, encase6 (default),\n" "\t encase7, encase7-v2, linen5, linen6, linen7, ewfx\n" ); fprintf( stream, "\t-g specify the number of sectors to be used as error granularity\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-l: logs acquiry errors and the digest (hash) to the log_filename\n" ); fprintf( stream, "\t-m: specify the media type, options: fixed (default), removable,\n" "\t optical, memory\n" ); fprintf( stream, "\t-M: specify the media flags, options: logical, physical (default)\n" ); fprintf( stream, "\t-N: specify the notes (default is notes).\n" ); fprintf( stream, "\t-o: specify the offset to start to acquire (default is 0)\n" ); fprintf( stream, "\t-p: specify the process buffer size (default is the chunk size)\n" ); fprintf( stream, "\t-P: specify the number of bytes per sector (default is 512)\n" "\t (use this to override the automatic bytes per sector detection)\n" ); fprintf( stream, "\t-q: quiet shows minimal status information\n" ); fprintf( stream, "\t-r: specify the number of retries when a read error occurs (default\n" "\t is 2)\n" ); fprintf( stream, "\t-R: resume acquiry at a safe point\n" ); fprintf( stream, "\t-s: swap byte pairs of the media data (from AB to BA)\n" "\t (use this for big to little endian conversion and vice versa)\n" ); if( result == 1 ) { 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, maximum_32bit_segment_file_size_string ); } else { fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIu32 ")\n" "\t (minimum is %" PRIu32 ", maximum is %" PRIu64 " for encase6\n" "\t and encase7 format and %" PRIu32 " for other formats)\n", (uint32_t) EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE, (uint32_t) EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT, (uint32_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ); } fprintf( stream, "\t-t: specify the target file (without extension) to write to\n" ); fprintf( stream, "\t-T: specify the file containing the table of contents (TOC) of\n" "\t an optical disc. The TOC file must be in the CUE format.\n" ); fprintf( stream, "\t-u: unattended mode (disables user interaction)\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); fprintf( stream, "\t-w: zero sectors on read error (mimic EnCase like behavior)\n" ); fprintf( stream, "\t-x: use the chunk data instead of the buffered read and write\n" "\t functions.\n" ); fprintf( stream, "\t-2: specify the secondary target file (without extension) to write\n" "\t to\n" ); } /* Signal handler for ewfacquire */ void ewfacquire_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfacquire_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfacquire_abort = 1; if( ewfacquire_device_handle != NULL ) { if( device_handle_signal_abort( ewfacquire_device_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal device handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } if( ewfacquire_imaging_handle != NULL ) { if( imaging_handle_signal_abort( ewfacquire_imaging_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal imaging handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* Prints an overview of the acquiry parameters and asks the for confirmation * Returns 1 if confirmed by user, 0 otherwise or -1 on error */ int8_t ewfacquire_confirm_acquiry_parameters( FILE *stream, system_character_t *input_buffer, size_t input_buffer_size, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; int8_t input_confirmed = -1; int result = 0; if( stream == NULL ) { return( -1 ); } /* Ask for confirmation */ while( input_confirmed == -1 ) { result = ewfinput_get_fixed_string_variable( stream, input_buffer, input_buffer_size, _SYSTEM_STRING( "Continue acquiry with these values" ), ewfinput_yes_no, 2, 0, &fixed_string_variable, error ); if( result == -1 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } libcerror_error_free( error ); fprintf( stream, "Unable to determine answer.\n" ); } else { result = ewfinput_determine_yes_no( fixed_string_variable, (uint8_t *) &input_confirmed, error ); if( result != 1 ) { if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } libcerror_error_free( error ); fprintf( stream, "Selected option not supported, please try again or terminate using Ctrl^C.\n" ); input_confirmed = -1; } } } fprintf( stream, "\n" ); return( input_confirmed ); } /* Determines the sessions and tracks of an optical disc using the device handle * and appends them to the imaging handle, if the device is a file * a single session is simulated * Returns 1 if successful or -1 on error */ int ewfacquire_determine_sessions( imaging_handle_t *imaging_handle, device_handle_t *device_handle, libcerror_error_t **error ) { static char *function = "ewfacquire_determine_sessions"; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; uint8_t type = 0; int has_audio_tracks = 0; int number_of_sessions = 0; int number_of_tracks = 0; int session_index = 0; int track_index = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid imaging handle - missing bytes per sector.", function ); return( -1 ); } if( device_handle_get_number_of_sessions( device_handle, &number_of_sessions, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sessions.", function ); return( -1 ); } if( number_of_sessions != 0 ) { for( session_index = 0; session_index < number_of_sessions; session_index++ ) { if( device_handle_get_session( device_handle, session_index, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve session: %d from device handle.", function, session_index ); return( -1 ); } if( imaging_handle_append_session( imaging_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session: %d to imaging handle.", function, session_index ); return( -1 ); } } } else { if( device_handle_get_type( device_handle, &type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve device handle type.", function ); return( -1 ); } if( type != DEVICE_HANDLE_TYPE_FILE ) { fprintf( stderr, "Unable to determine number of session on optical disc - defaulting to single session.\n" ); } number_of_sectors = imaging_handle->input_media_size / imaging_handle->bytes_per_sector; if( number_of_sectors > (uint64_t) UINT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of sectors value out of bounds.", function ); return( -1 ); } if( imaging_handle_append_session( ewfacquire_imaging_handle, (uint64_t) 0, (uint64_t) number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to append session to imaging handle.", function ); return( -1 ); } } if( device_handle_get_number_of_tracks( device_handle, &number_of_tracks, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of tracks.", function ); return( -1 ); } if( number_of_tracks != 0 ) { for( track_index = 0; track_index < number_of_tracks; track_index++ ) { if( device_handle_get_track( device_handle, track_index, &start_sector, &number_of_sectors, &type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve track: %d from device handle.", function, track_index ); return( -1 ); } if( type == DEVICE_HANDLE_TRACK_TYPE_AUDIO ) { if( imaging_handle_append_track( imaging_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track: %d to imaging handle.", function, track_index ); return( -1 ); } has_audio_tracks = 1; } } } if( has_audio_tracks != 0 ) { fprintf( stdout, "WARNING: the EWF format does not support audio tracks.\n" " audio track data will be filled with 0-byte values\n\n" ); } return( 1 ); } /* Reads the input * Returns 1 if successful or -1 on error */ int ewfacquire_read_input( imaging_handle_t *imaging_handle, device_handle_t *device_handle, off64_t resume_acquiry_offset, uint8_t swap_byte_pairs, uint8_t print_status_information, uint8_t use_chunk_data_functions, log_handle_t *log_handle, libcerror_error_t **error ) { process_status_t *process_status = NULL; storage_media_buffer_t *storage_media_buffer = NULL; uint8_t *data = NULL; static char *function = "ewfacquire_read_input"; off64_t read_error_offset = 0; size64_t acquiry_count = 0; size64_t read_error_size = 0; size_t data_size = 0; size_t process_buffer_size = 0; size_t read_size = 0; ssize_t read_count = 0; ssize_t process_count = 0; ssize_t write_count = 0; uint32_t chunk_size = 0; uint8_t storage_media_buffer_mode = 0; int number_of_read_errors = 0; int read_error_iterator = 0; int status = PROCESS_STATUS_COMPLETED; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->process_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid imaging handle - process buffer size value exceeds maximum.", function ); return( -1 ); } if( imaging_handle->acquiry_size > (ssize64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid imaging handle - acquire size value exceeds maximum.", function ); return( -1 ); } if( device_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid device handle.", function ); return( -1 ); } if( ( imaging_handle->acquiry_size > imaging_handle->input_media_size ) || ( imaging_handle->acquiry_size > (ssize64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid acquire size value out of bounds.", function ); return( -1 ); } if( imaging_handle->acquiry_offset > 0 ) { if( ( imaging_handle->acquiry_offset > (uint64_t) imaging_handle->input_media_size ) || ( ( imaging_handle->acquiry_size + imaging_handle->acquiry_offset ) > (uint64_t) imaging_handle->input_media_size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: unable to acquire beyond media size.", function ); goto on_error; } if( device_handle_seek_offset( device_handle, imaging_handle->acquiry_offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to find acquiry offset.", function ); goto on_error; } } if( resume_acquiry_offset > 0 ) { if( ( imaging_handle->acquiry_offset + (uint64_t) resume_acquiry_offset ) > (uint64_t) imaging_handle->input_media_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: unable to resume acquire beyond media size.", function ); goto on_error; } if( device_handle_seek_offset( device_handle, resume_acquiry_offset, SEEK_CUR, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to find acquiry offset.", function ); goto on_error; } if( imaging_handle_seek_offset( imaging_handle, 0, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek imaging offset.", function ); goto on_error; } } if( imaging_handle_get_chunk_size( imaging_handle, &chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); goto on_error; } if( chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk size.", function ); goto on_error; } if( use_chunk_data_functions != 0 ) { process_buffer_size = (size_t) chunk_size; storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA; } else { if( imaging_handle->process_buffer_size == 0 ) { process_buffer_size = (size_t) chunk_size; } else { process_buffer_size = imaging_handle->process_buffer_size; } storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_BUFFERED; } if( storage_media_buffer_initialize( &storage_media_buffer, storage_media_buffer_mode, process_buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create storage media buffer.", function ); goto on_error; } if( imaging_handle_initialize_integrity_hash( imaging_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize integrity hash(es).", function ); goto on_error; } if( process_status_initialize( &process_status, _SYSTEM_STRING( "Acquiry" ), _SYSTEM_STRING( "acquired" ), _SYSTEM_STRING( "Written" ), stdout, print_status_information, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create process status", function ); goto on_error; } if( process_status_start( process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to start process status", function ); goto on_error; } while( acquiry_count < (size64_t) imaging_handle->acquiry_size ) { read_size = process_buffer_size; if( ( (size64_t) imaging_handle->acquiry_size - acquiry_count ) < (size64_t) read_size ) { read_size = (size_t) ( (ssize64_t) imaging_handle->acquiry_size - acquiry_count ); } if( (off64_t) acquiry_count >= resume_acquiry_offset ) { read_count = device_handle_read_buffer( device_handle, storage_media_buffer->raw_buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading data from input.", function ); goto on_error; } if( read_count == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unexpected end of input.", function ); goto on_error; } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->data_in_compression_buffer = 0; } storage_media_buffer->raw_buffer_data_size = (size_t) read_count; /* Swap byte pairs */ if( swap_byte_pairs == 1 ) { if( imaging_handle_swap_byte_pairs( imaging_handle, storage_media_buffer, read_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to swap byte pairs.", function ); goto on_error; } } } else { /* Align with resume acquiry offset if necessary */ if( ( resume_acquiry_offset - (off64_t) acquiry_count ) < (off64_t) read_size ) { read_size = (size_t) ( resume_acquiry_offset - acquiry_count ); } read_count = imaging_handle_read_buffer( imaging_handle, storage_media_buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read data.", function ); goto on_error; } if( read_count == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unexpected end of data.", function ); goto on_error; } process_count = imaging_handle_prepare_read_buffer( imaging_handle, storage_media_buffer, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare buffer after read.", function ); goto on_error; } if( process_count > (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: more bytes read than requested.", function, process_count, read_size ); goto on_error; } read_count = process_count; if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { /* Set the chunk data size in the compression buffer */ if( storage_media_buffer->data_in_compression_buffer == 1 ) { storage_media_buffer->compression_buffer_data_size = (size_t) process_count; } } } /* Digest hashes are calcultated after swap */ if( storage_media_buffer_get_data( storage_media_buffer, &data, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve storage media buffer data.", function ); goto on_error; } if( imaging_handle_update_integrity_hash( imaging_handle, data, read_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to update integrity hash(es).", function ); goto on_error; } if( (off64_t) acquiry_count >= resume_acquiry_offset ) { process_count = imaging_handle_prepare_write_buffer( imaging_handle, storage_media_buffer, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare buffer before write.", function ); goto on_error; } write_count = imaging_handle_write_buffer( imaging_handle, storage_media_buffer, process_count, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data to file.", function ); goto on_error; } } acquiry_count += read_count; if( process_status_update( process_status, acquiry_count, imaging_handle->acquiry_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update process status.", function ); goto on_error; } if( ewfacquire_abort != 0 ) { break; } } if( storage_media_buffer_free( &storage_media_buffer, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free storage media buffer.", function ); goto on_error; } if( imaging_handle_finalize_integrity_hash( imaging_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize integrity hash(es).", function ); goto on_error; } if( (off64_t) acquiry_count >= resume_acquiry_offset ) { if( device_handle_get_number_of_read_errors( device_handle, &number_of_read_errors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of read errors.", function ); goto on_error; } for( read_error_iterator = 0; read_error_iterator < number_of_read_errors; read_error_iterator++ ) { if( device_handle_get_read_error( device_handle, read_error_iterator, &read_error_offset, &read_error_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve read error: %d.", function, read_error_iterator ); goto on_error; } if( imaging_handle_append_read_error( imaging_handle, read_error_offset, read_error_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append read error: %d to imaging handle.", function, read_error_iterator ); goto on_error; } } write_count = imaging_handle_finalize( imaging_handle, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize.", function ); goto on_error; } acquiry_count += write_count; } if( ewfacquire_abort != 0 ) { status = PROCESS_STATUS_ABORTED; } if( process_status_stop( process_status, acquiry_count, status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to stop process status", function ); goto on_error; } if( process_status_free( &process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free process status", function ); goto on_error; } if( ewfacquire_abort == 0 ) { if( device_handle_read_errors_fprint( device_handle, imaging_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print device read errors.", function ); goto on_error; } if( imaging_handle_print_hashes( imaging_handle, imaging_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hashes.", function ); goto on_error; } if( log_handle != NULL ) { if( device_handle_read_errors_fprint( device_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print device read errors in log handle.", function ); goto on_error; } if( imaging_handle_print_hashes( imaging_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hashes in log handle.", function ); goto on_error; } } } return( 1 ); on_error: if( process_status != NULL ) { process_status_stop( process_status, (size64_t) write_count, PROCESS_STATUS_FAILED, NULL ); process_status_free( &process_status, NULL ); } if( storage_media_buffer != NULL ) { storage_media_buffer_free( &storage_media_buffer, NULL ); } return( -1 ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { 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; 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; system_integer_t option = 0; off64_t resume_acquiry_offset = 0; size_t string_length = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t resume_acquiry = 0; uint8_t swap_byte_pairs = 0; uint8_t use_chunk_data_functions = 0; uint8_t verbose = 0; uint8_t zero_buffer_on_error = 0; int8_t acquiry_parameters_confirmed = 0; int interactive_mode = 1; int result = 0; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } while( ( option = ewftools_getopt( argc, argv, _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 (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); ewfacquire_usage_fprint( stdout ); goto on_error; case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; case (system_integer_t) 'B': option_size = optarg; break; case (system_integer_t) 'c': option_compression_values = optarg; break; case (system_integer_t) 'C': option_case_number = optarg; break; case (system_integer_t) 'd': option_additional_digest_types = optarg; break; case (system_integer_t) 'D': option_description = optarg; break; case (system_integer_t) 'e': option_examiner_name = optarg; break; case (system_integer_t) 'E': option_evidence_number = optarg; break; case (system_integer_t) 'f': option_format = optarg; break; case (system_integer_t) 'g': option_sector_error_granularity = optarg; break; case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); ewfacquire_usage_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'l': log_filename = optarg; break; case (system_integer_t) 'm': option_media_type = optarg; break; case (system_integer_t) 'M': option_media_flags = optarg; break; case (system_integer_t) 'N': option_notes = optarg; break; case (system_integer_t) 'o': option_offset = optarg; break; case (system_integer_t) 'p': option_process_buffer_size = optarg; break; case (system_integer_t) 'P': option_bytes_per_sector = optarg; break; case (system_integer_t) 'q': print_status_information = 0; break; case (system_integer_t) 'r': option_number_of_error_retries = optarg; break; case (system_integer_t) 'R': resume_acquiry = 1; break; case (system_integer_t) 's': swap_byte_pairs = 1; break; case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; case (system_integer_t) 't': option_target_filename = optarg; break; case (system_integer_t) 'T': option_toc_filename = optarg; break; case (system_integer_t) 'u': interactive_mode = 0; break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'w': zero_buffer_on_error = 1; break; case (system_integer_t) 'x': use_chunk_data_functions = 1; break; case (system_integer_t) '2': option_secondary_target_filename = optarg; break; } } if( optind == argc ) { ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Missing source file or device.\n" ); ewfacquire_usage_fprint( stdout ); goto on_error; } ewftools_output_version_fprint( stdout, program ); libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif /* Check if to read from stdin */ if( system_string_compare( argv[ optind ], _SYSTEM_STRING( "-" ), 1 ) == 0 ) { fprintf( stderr, "Reading from stdin not supported.\n" ); goto on_error; } if( ( option_target_filename != NULL ) && ( option_secondary_target_filename != NULL ) ) { string_length = system_string_length( option_secondary_target_filename ); if( system_string_length( option_target_filename ) == string_length ) { if( system_string_compare( option_target_filename, option_secondary_target_filename, string_length ) == 0 ) { fprintf( stderr, "Primary and secondary target cannot be the same.\n" ); goto on_error; } } } if( device_handle_initialize( &ewfacquire_device_handle, &error ) != 1 ) { fprintf( stderr, "Unable to create device handle.\n" ); goto on_error; } if( option_toc_filename != NULL ) { if( device_handle_set_string( ewfacquire_device_handle, option_toc_filename, &( ewfacquire_device_handle->toc_filename ), &( ewfacquire_device_handle->toc_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set table of contents (TOC) filename.\n" ); goto on_error; } } if( option_number_of_error_retries != NULL ) { result = device_handle_set_number_of_error_retries( ewfacquire_device_handle, option_sectors_per_chunk, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set number of error retries.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported number of error retries defaulting to: %" PRIu8 ".\n", ewfacquire_device_handle->number_of_error_retries ); } } if( zero_buffer_on_error != 0 ) { ewfacquire_device_handle->zero_buffer_on_error = 1; } /* Open the input file or device size */ if( device_handle_open_input( ewfacquire_device_handle, &( argv[ optind ] ), argc - optind, &error ) != 1 ) { fprintf( stderr, "Unable to open file(s) or device.\n" ); goto on_error; } if( device_handle_media_information_fprint( ewfacquire_device_handle, stdout, &error ) != 1 ) { fprintf( stderr, "Unable to print media information.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } /* Create the imaging handle and set the desired values */ if( imaging_handle_initialize( &ewfacquire_imaging_handle, calculate_md5, use_chunk_data_functions, &error ) != 1 ) { fprintf( stderr, "Unable to create imaging handle.\n" ); goto on_error; } if( device_handle_get_media_size( ewfacquire_device_handle, &( ewfacquire_imaging_handle->input_media_size ), &error ) != 1 ) { fprintf( stderr, "Unable to retrieve media size.\n" ); goto on_error; } if( option_header_codepage != NULL ) { result = imaging_handle_set_header_codepage( ewfacquire_imaging_handle, option_header_codepage, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set header codepage.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); } } if( option_target_filename != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_target_filename, &( ewfacquire_imaging_handle->target_filename ), &( ewfacquire_imaging_handle->target_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target filename.\n" ); goto on_error; } } else if( interactive_mode == 0 ) { /* Make sure the target filename is set in unattended mode */ if( imaging_handle_set_string( ewfacquire_imaging_handle, _SYSTEM_STRING( "image" ), &( ewfacquire_imaging_handle->target_filename ), &( ewfacquire_imaging_handle->target_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target filename.\n" ); goto on_error; } } if( option_secondary_target_filename != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_secondary_target_filename, &( ewfacquire_imaging_handle->secondary_target_filename ), &( ewfacquire_imaging_handle->secondary_target_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set secondary target filename.\n" ); goto on_error; } } if( option_case_number != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_case_number, &( ewfacquire_imaging_handle->case_number ), &( ewfacquire_imaging_handle->case_number_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set case number.\n" ); goto on_error; } } if( option_description != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_description, &( ewfacquire_imaging_handle->description ), &( ewfacquire_imaging_handle->description_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set description.\n" ); goto on_error; } } if( option_evidence_number != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_evidence_number, &( ewfacquire_imaging_handle->evidence_number ), &( ewfacquire_imaging_handle->evidence_number_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set evidence number.\n" ); goto on_error; } } if( option_examiner_name != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_examiner_name, &( ewfacquire_imaging_handle->examiner_name ), &( ewfacquire_imaging_handle->examiner_name_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set examiner name.\n" ); goto on_error; } } if( option_notes != NULL ) { if( imaging_handle_set_string( ewfacquire_imaging_handle, option_notes, &( ewfacquire_imaging_handle->notes ), &( ewfacquire_imaging_handle->notes_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set notes.\n" ); goto on_error; } } if( option_format != NULL ) { result = imaging_handle_set_format( ewfacquire_imaging_handle, option_format, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set format.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported EWF format defaulting to: encase6.\n" ); } } if( option_compression_values != NULL ) { result = imaging_handle_set_compression_values( ewfacquire_imaging_handle, option_compression_values, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set compression values.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported compression values defaulting to method: deflate with level: none.\n" ); } } if( option_media_type != NULL ) { result = imaging_handle_set_media_type( ewfacquire_imaging_handle, option_media_type, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set media type.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported media type defaulting to: fixed.\n" ); } } else { if( device_handle_get_media_type( ewfacquire_device_handle, &( ewfacquire_imaging_handle->media_type ), &error ) != 1 ) { fprintf( stderr, "Unable to retrieve media type from device.\n" ); goto on_error; } } if( option_media_flags != NULL ) { result = imaging_handle_set_media_flags( ewfacquire_imaging_handle, option_media_flags, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set media flags.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported media flags defaulting to: physical.\n" ); } } if( option_bytes_per_sector != NULL ) { result = imaging_handle_set_bytes_per_sector( ewfacquire_imaging_handle, option_bytes_per_sector, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set bytes per sector.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported bytes per sector defaulting to: %" PRIu32 ".\n", ewfacquire_imaging_handle->bytes_per_sector ); } } else { if( device_handle_get_bytes_per_sector( ewfacquire_device_handle, &( ewfacquire_imaging_handle->bytes_per_sector ), &error ) != 1 ) { fprintf( stderr, "Unable to retrieve bytes per sector from device.\n" ); goto on_error; } } if( option_sectors_per_chunk != NULL ) { result = imaging_handle_set_sectors_per_chunk( ewfacquire_imaging_handle, option_sectors_per_chunk, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set sectors per chunk.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported sectors per chunk defaulting to: %" PRIu32 ".\n", ewfacquire_imaging_handle->sectors_per_chunk ); } } if( option_sector_error_granularity != NULL ) { result = imaging_handle_set_sector_error_granularity( ewfacquire_imaging_handle, option_sector_error_granularity, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set sector error granularity.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported sector error granularity defaulting to: %" PRIu32 ".\n", ewfacquire_imaging_handle->sector_error_granularity ); } } if( option_maximum_segment_size != NULL ) { result = imaging_handle_set_maximum_segment_size( ewfacquire_imaging_handle, option_maximum_segment_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set maximum segment size.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported maximum segment size defaulting to: %" PRIu64 ".\n", ewfacquire_imaging_handle->maximum_segment_size ); } } if( option_offset != NULL ) { result = imaging_handle_set_acquiry_offset( ewfacquire_imaging_handle, option_offset, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set acquiry offset.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfacquire_imaging_handle->acquiry_offset >= ewfacquire_imaging_handle->input_media_size ) ) { ewfacquire_imaging_handle->acquiry_offset = 0; fprintf( stderr, "Unsupported acquiry offset defaulting to: 0.\n" ); } } if( option_size != NULL ) { result = imaging_handle_set_acquiry_size( ewfacquire_imaging_handle, option_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set acquiry size.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfacquire_imaging_handle->acquiry_size > ( ewfacquire_imaging_handle->input_media_size - ewfacquire_imaging_handle->acquiry_offset ) ) ) { ewfacquire_imaging_handle->acquiry_size = 0; fprintf( stderr, "Unsupported acquiry size defaulting to: all bytes.\n" ); } } if( option_process_buffer_size != NULL ) { result = imaging_handle_set_process_buffer_size( ewfacquire_imaging_handle, option_process_buffer_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set process buffer size.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported process buffer size defaulting to: chunk size.\n" ); } } if( option_additional_digest_types != NULL ) { result = imaging_handle_set_additional_digest_types( ewfacquire_imaging_handle, option_additional_digest_types, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set additional digest types.\n" ); goto on_error; } } /* Initialize values */ if( ewfacquire_imaging_handle->acquiry_size == 0 ) { ewfacquire_imaging_handle->acquiry_size = ewfacquire_imaging_handle->input_media_size - ewfacquire_imaging_handle->acquiry_offset; } /* Request the necessary case data */ while( ( interactive_mode != 0 ) && ( acquiry_parameters_confirmed == 0 ) ) { fprintf( stdout, "Acquiry parameters required, please provide the necessary input\n" ); if( resume_acquiry != 0 ) { request_string = _SYSTEM_STRING( "Image path and filename with extension" ); } else if( option_target_filename == NULL ) { request_string = _SYSTEM_STRING( "Image path and filename without extension" ); } if( request_string != NULL ) { do { result = imaging_handle_prompt_for_string( ewfacquire_imaging_handle, request_string, &( ewfacquire_imaging_handle->target_filename ), &( ewfacquire_imaging_handle->target_filename_size ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine target.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stdout, "Target is required, please try again or terminate using Ctrl^C.\n" ); } } while( result != 1 ); } if( resume_acquiry != 0 ) { if( ewftools_signal_attach( ewfacquire_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); goto on_error; } if( imaging_handle_open_output( ewfacquire_imaging_handle, ewfacquire_imaging_handle->target_filename, resume_acquiry, &error ) != 1 ) { fprintf( stdout, "Unable to resume acquire - starting from scratch.\n" ); #if defined( HAVE_VERBOSE_OUTPUT ) libcnotify_print_error_backtrace( error ); #endif libcerror_error_free( &error ); resume_acquiry = 0; } if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); goto on_error; } } if( resume_acquiry != 0 ) { if( imaging_handle_get_output_values( ewfacquire_imaging_handle, &error ) != 1 ) { fprintf( stdout, "Unable to determine previous acquiry parameters.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); imaging_handle_close( ewfacquire_imaging_handle, NULL ); resume_acquiry = 0; } } if( resume_acquiry != 0 ) { if( imaging_handle_get_offset( ewfacquire_imaging_handle, &resume_acquiry_offset, &error ) != 1 ) { fprintf( stdout, "Unable to determine resume acquiry offset.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); imaging_handle_close( ewfacquire_imaging_handle, NULL ); resume_acquiry = 0; } fprintf( stdout, "Resuming acquire at offset: %" PRIi64 ".\n", resume_acquiry_offset ); } if( resume_acquiry == 0 ) { if( option_case_number == NULL ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, _SYSTEM_STRING( "Case number" ), &( ewfacquire_imaging_handle->case_number ), &( ewfacquire_imaging_handle->case_number_size ), &error ) == -1 ) { fprintf( stdout, "Unable to determine case number.\n" ); goto on_error; } } if( option_description == NULL ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, _SYSTEM_STRING( "Description" ), &( ewfacquire_imaging_handle->description ), &( ewfacquire_imaging_handle->description_size ), &error ) == -1 ) { fprintf( stdout, "Unable to determine description.\n" ); goto on_error; } } if( option_evidence_number == NULL ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, _SYSTEM_STRING( "Evidence number" ), &( ewfacquire_imaging_handle->evidence_number ), &( ewfacquire_imaging_handle->evidence_number_size ), &error ) == -1 ) { fprintf( stdout, "Unable to determine evidence number.\n" ); goto on_error; } } if( option_examiner_name == NULL ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, _SYSTEM_STRING( "Examiner name" ), &( ewfacquire_imaging_handle->examiner_name ), &( ewfacquire_imaging_handle->examiner_name_size ), &error ) == -1 ) { fprintf( stdout, "Unable to determine examiner name.\n" ); goto on_error; } } if( option_notes == NULL ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, _SYSTEM_STRING( "Notes" ), &( ewfacquire_imaging_handle->notes ), &( ewfacquire_imaging_handle->notes_size ), &error ) == -1 ) { fprintf( stdout, "Unable to determine notes.\n" ); goto on_error; } } if( option_media_type == NULL ) { result = imaging_handle_prompt_for_media_type( ewfacquire_imaging_handle, _SYSTEM_STRING( "Media type" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine media type.\n" ); goto on_error; } } if( option_media_flags == NULL ) { result = imaging_handle_prompt_for_media_flags( ewfacquire_imaging_handle, _SYSTEM_STRING( "Media characteristics" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine media flags.\n" ); goto on_error; } } if( option_format == NULL ) { result = imaging_handle_prompt_for_format( ewfacquire_imaging_handle, _SYSTEM_STRING( "Use EWF file format" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine format.\n" ); goto on_error; } } if( option_compression_values== NULL ) { result = imaging_handle_prompt_for_compression_method( ewfacquire_imaging_handle, _SYSTEM_STRING( "Compression method" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine compression method.\n" ); goto on_error; } result = imaging_handle_prompt_for_compression_level( ewfacquire_imaging_handle, _SYSTEM_STRING( "Compression level" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine compression level.\n" ); goto on_error; } } } if( ( resume_acquiry == 0 ) || ( ewfacquire_imaging_handle->acquiry_size != ewfacquire_imaging_handle->input_media_size ) ) { if( option_offset == NULL ) { result = imaging_handle_prompt_for_acquiry_offset( ewfacquire_imaging_handle, _SYSTEM_STRING( "Start to acquire at offset" ), &error ); if( result == -1 ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); fprintf( stderr, "Unable to determine acquiry offset defaulting to: %" PRIu64 ".\n", ewfacquire_imaging_handle->acquiry_offset ); } } } if( resume_acquiry == 0 ) { if( option_size == NULL ) { result = imaging_handle_prompt_for_acquiry_size( ewfacquire_imaging_handle, _SYSTEM_STRING( "The number of bytes to acquire" ), &error ); if( result == -1 ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); fprintf( stderr, "Unable to determine acquiry size defaulting to: %" PRIu64 ".\n", ewfacquire_imaging_handle->acquiry_size ); } } if( option_maximum_segment_size == NULL ) { result = imaging_handle_prompt_for_maximum_segment_size( ewfacquire_imaging_handle, _SYSTEM_STRING( "Evidence segment file size in bytes" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine maximum segment size.\n" ); goto on_error; } if( ( ewfacquire_imaging_handle->maximum_segment_size < EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE ) || ( ( ewfacquire_imaging_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) && ( ewfacquire_imaging_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT ) ) || ( ( ewfacquire_imaging_handle->ewf_format != LIBEWF_FORMAT_ENCASE6 ) && ( ewfacquire_imaging_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ) ) ) { ewfacquire_imaging_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; fprintf( stderr, "Unsupported maximum segment size defaulting to: %" PRIu64 ".\n", ewfacquire_imaging_handle->maximum_segment_size ); } } if( option_bytes_per_sector == NULL ) { result = imaging_handle_prompt_for_bytes_per_sector( ewfacquire_imaging_handle, _SYSTEM_STRING( "The number of bytes per sector" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine bytes per sector.\n" ); goto on_error; } } if( option_sectors_per_chunk == NULL ) { result = imaging_handle_prompt_for_sectors_per_chunk( ewfacquire_imaging_handle, _SYSTEM_STRING( "The number of sectors to read at once" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine sectors per chunk.\n" ); goto on_error; } } if( option_sector_error_granularity == NULL ) { result = imaging_handle_prompt_for_sector_error_granularity( ewfacquire_imaging_handle, _SYSTEM_STRING( "The number of sectors to be used as error granularity" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine sector error granularity.\n" ); goto on_error; } if( ewfacquire_imaging_handle->sector_error_granularity > ewfacquire_imaging_handle->sectors_per_chunk ) { ewfacquire_imaging_handle->sector_error_granularity = ewfacquire_imaging_handle->sectors_per_chunk; fprintf( stderr, "Unsupported sector error granularity defaulting to: %" PRIu32 ".\n", ewfacquire_imaging_handle->sector_error_granularity ); } } } if( option_number_of_error_retries == NULL ) { result = device_handle_prompt_for_number_of_error_retries( ewfacquire_device_handle, _SYSTEM_STRING( "The number of retries when a read error occurs" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine number of error retries.\n" ); goto on_error; } } if( zero_buffer_on_error == 0 ) { result = device_handle_prompt_for_zero_buffer_on_error( ewfacquire_device_handle, _SYSTEM_STRING( "Wipe sectors on read error (mimic EnCase like behavior)" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine zero buffer on error.\n" ); goto on_error; } } fprintf( stdout, "\n" ); fprintf( stdout, "The following acquiry parameters were provided:\n" ); if( imaging_handle_print_parameters( ewfacquire_imaging_handle, resume_acquiry_offset, ewfacquire_device_handle->number_of_error_retries, ewfacquire_device_handle->zero_buffer_on_error, resume_acquiry, &error ) != 1 ) { fprintf( stderr, "Unable to print acquiry parameters.\n" ); goto on_error; } /* Check if user is content with the acquiry parameters */ acquiry_parameters_confirmed = ewfacquire_confirm_acquiry_parameters( stdout, input_buffer, EWFACQUIRE_INPUT_BUFFER_SIZE, &error ); if( acquiry_parameters_confirmed == -1 ) { fprintf( stdout, "Unable to determine if acquiry parameters are correct aborting.\n" ); goto on_error; } /* Reset all parameters provided as command line arguments */ else if( acquiry_parameters_confirmed == 0 ) { option_case_number = NULL; option_compression_values = NULL; option_description = NULL; option_evidence_number = NULL; option_examiner_name = NULL; option_format = NULL; option_maximum_segment_size = NULL; option_media_flags = NULL; option_media_type = NULL; option_notes = NULL; option_number_of_error_retries = NULL; option_offset = NULL; option_sectors_per_chunk = NULL; option_sector_error_granularity = NULL; option_size = NULL; option_target_filename = NULL; option_toc_filename = NULL; zero_buffer_on_error = 0; if( resume_acquiry != 0 ) { if( imaging_handle_close( ewfacquire_imaging_handle, &error ) != 0 ) { fprintf( stdout, "Unable to close output file(s).\n" ); goto on_error; } } } else if( ewfacquire_imaging_handle->acquiry_size > EWFACQUIRE_2_TIB ) { if( ( ewfacquire_imaging_handle->ewf_format != LIBEWF_FORMAT_ENCASE6 ) && ( ewfacquire_imaging_handle->ewf_format != LIBEWF_FORMAT_EWFX ) ) { fprintf( stdout, "Cannot acquire more than 2 TiB in selected EWF file format.\n" ); acquiry_parameters_confirmed = 0; } } } if( ewfacquire_abort != 0 ) { goto on_abort; } if( resume_acquiry == 0 ) { result = device_handle_get_information_value( ewfacquire_device_handle, (uint8_t *) "model", 5, media_information_model, 64, &error ); if( result == -1 ) { fprintf( stdout, "Unable to retrieve model.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( result != 1 ) { media_information_model[ 0 ] = 0; } result = device_handle_get_information_value( ewfacquire_device_handle, (uint8_t *) "serial_number", 13, media_information_serial_number, 64, &error ); if( result == -1 ) { fprintf( stdout, "Unable to retrieve serial number.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( result != 1 ) { media_information_serial_number[ 0 ] = 0; } if( imaging_handle_open_output( ewfacquire_imaging_handle, ewfacquire_imaging_handle->target_filename, resume_acquiry, &error ) != 1 ) { fprintf( stderr, "Unable to open output file(s).\n" ); goto on_error; } if( ewfacquire_imaging_handle->secondary_target_filename != NULL ) { if( imaging_handle_open_secondary_output( ewfacquire_imaging_handle, ewfacquire_imaging_handle->secondary_target_filename, resume_acquiry, &error ) != 1 ) { fprintf( stderr, "Unable to open secondary output file(s).\n" ); goto on_error; } } if( device_handle_set_error_values( ewfacquire_device_handle, ewfacquire_imaging_handle->sector_error_granularity * ewfacquire_imaging_handle->bytes_per_sector, &error ) != 1 ) { fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } if( imaging_handle_set_output_values( ewfacquire_imaging_handle, program, _SYSTEM_STRING( LIBEWF_VERSION_STRING ), media_information_model, media_information_serial_number, &error ) != 1 ) { fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } if( ewfacquire_imaging_handle->media_type == DEVICE_HANDLE_MEDIA_TYPE_OPTICAL ) { if( ewfacquire_determine_sessions( ewfacquire_imaging_handle, ewfacquire_device_handle, &error ) != 1 ) { fprintf( stderr, "Unable to determine sessions.\n" ); goto on_error; } } } if( ewftools_signal_attach( ewfacquire_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_filename != NULL ) { if( log_handle_initialize( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to create log handle.\n" ); goto on_error; } if( log_handle_open( log_handle, log_filename, &error ) != 1 ) { fprintf( stderr, "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } } result = ewfacquire_read_input( ewfacquire_imaging_handle, ewfacquire_device_handle, resume_acquiry_offset, swap_byte_pairs, print_status_information, use_chunk_data_functions, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to acquire input.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { if( log_handle_close( log_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close log handle.\n" ); goto on_error; } if( log_handle_free( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free log handle.\n" ); goto on_error; } } on_abort: if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( imaging_handle_close( ewfacquire_imaging_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close output file(s).\n" ); goto on_error; } if( imaging_handle_free( &ewfacquire_imaging_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free imaging handle.\n" ); goto on_error; } if( device_handle_close( ewfacquire_device_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close input file or device.\n" ); goto on_error; } if( device_handle_free( &ewfacquire_device_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free device handle.\n" ); goto on_error; } if( ewfacquire_abort != 0 ) { fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } if( result != 1 ) { fprintf( stdout, "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { log_handle_close( log_handle, NULL ); log_handle_free( &log_handle, NULL ); } if( ewfacquire_imaging_handle != NULL ) { imaging_handle_close( ewfacquire_imaging_handle, NULL ); imaging_handle_free( &ewfacquire_imaging_handle, NULL ); } if( ewfacquire_device_handle != NULL ) { device_handle_close( ewfacquire_device_handle, NULL ); device_handle_free( &ewfacquire_device_handle, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/ewftools/mount_handle.c0000664000175000017500000004016413421020222022005 0ustar00lordyestalordyesta00000000000000/* * Mount handle * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #include #include "ewftools_libcerror.h" #include "ewftools_libcpath.h" #include "ewftools_libewf.h" #include "mount_file_entry.h" #include "mount_file_system.h" #include "mount_handle.h" /* Creates a mount handle * Make sure the value mount_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int mount_handle_initialize( mount_handle_t **mount_handle, libcerror_error_t **error ) { static char *function = "mount_handle_initialize"; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( *mount_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid info handle value already set.", function ); return( -1 ); } *mount_handle = memory_allocate_structure( mount_handle_t ); if( *mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create mount handle.", function ); goto on_error; } if( memory_set( *mount_handle, 0, sizeof( mount_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear mount handle.", function ); goto on_error; } if( mount_file_system_initialize( &( ( *mount_handle )->file_system ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize file system.", function ); goto on_error; } ( *mount_handle )->input_format = MOUNT_HANDLE_INPUT_FORMAT_RAW; return( 1 ); on_error: if( *mount_handle != NULL ) { memory_free( *mount_handle ); *mount_handle = NULL; } return( -1 ); } /* Frees a mount handle * Returns 1 if successful or -1 on error */ int mount_handle_free( mount_handle_t **mount_handle, libcerror_error_t **error ) { static char *function = "mount_handle_free"; int result = 1; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( *mount_handle != NULL ) { if( mount_file_system_free( &( ( *mount_handle )->file_system ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file system.", function ); result = -1; } memory_free( *mount_handle ); *mount_handle = NULL; } return( result ); } /* Signals the mount handle to abort * Returns 1 if successful or -1 on error */ int mount_handle_signal_abort( mount_handle_t *mount_handle, libcerror_error_t **error ) { static char *function = "mount_handle_signal_abort"; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( mount_file_system_signal_abort( mount_handle->file_system, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal file system to abort.", function ); return( -1 ); } return( 1 ); } /* Sets the format * Returns 1 if successful, 0 if unsupported value or -1 on error */ int mount_handle_set_format( mount_handle_t *mount_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "mount_handle_set_format"; size_t string_length = 0; int result = 0; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 3 ) { if( system_string_compare( string, _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { mount_handle->input_format = MOUNT_HANDLE_INPUT_FORMAT_RAW; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "files" ), 5 ) == 0 ) { mount_handle->input_format = MOUNT_HANDLE_INPUT_FORMAT_FILES; result = 1; } } return( result ); } /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int mount_handle_set_maximum_number_of_open_handles( mount_handle_t *mount_handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { static char *function = "mount_handle_set_maximum_number_of_open_handles"; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } mount_handle->maximum_number_of_open_handles = maximum_number_of_open_handles; return( 1 ); } /* Sets the path prefix * Returns 1 if successful or -1 on error */ int mount_handle_set_path_prefix( mount_handle_t *mount_handle, const system_character_t *path_prefix, size_t path_prefix_size, libcerror_error_t **error ) { static char *function = "mount_handle_set_path_prefix"; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( mount_file_system_set_path_prefix( mount_handle->file_system, path_prefix, path_prefix_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set path prefix.", function ); return( -1 ); } return( 1 ); } /* Opens the mount handle * Returns 1 if successful or -1 on error */ int mount_handle_open( mount_handle_t *mount_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { libewf_handle_t *ewf_handle = NULL; system_character_t **globbed_filenames = NULL; static char *function = "mount_handle_open"; size_t filename_length = 0; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of filenames.", function ); return( -1 ); } if( number_of_filenames == 1 ) { filename_length = system_string_length( filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], filename_length, LIBEWF_FORMAT_UNKNOWN, &globbed_filenames, &number_of_filenames, error ) != 1 ) #else if( libewf_glob( filenames[ 0 ], filename_length, LIBEWF_FORMAT_UNKNOWN, &globbed_filenames, &number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to resolve filename(s).", function ); goto on_error; } filenames = (system_character_t * const *) globbed_filenames; } if( libewf_handle_initialize( &ewf_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize handle.", function ); goto on_error; } if( libewf_handle_set_maximum_number_of_open_handles( ewf_handle, mount_handle->maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in handle.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( ewf_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #else if( libewf_handle_open( ewf_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file(s).", function ); goto on_error; } if( mount_file_system_set_handle( mount_handle->file_system, ewf_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set handle in file system.", function ); goto on_error; } if( globbed_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( globbed_filenames, number_of_filenames, error ) != 1 ) #else if( libewf_glob_free( globbed_filenames, number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free globbed filenames.", function ); goto on_error; } } return( 1 ); on_error: if( ewf_handle != NULL ) { libewf_handle_free( &ewf_handle, NULL ); } if( globbed_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( globbed_filenames, number_of_filenames, NULL ); #else libewf_glob_free( globbed_filenames, number_of_filenames, NULL ); #endif } return( -1 ); } /* Closes the mount handle * Returns the 0 if succesful or -1 on error */ int mount_handle_close( mount_handle_t *mount_handle, libcerror_error_t **error ) { libewf_handle_t *ewf_handle = NULL; static char *function = "mount_handle_close"; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( mount_file_system_get_handle( mount_handle->file_system, &ewf_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle from file system.", function ); goto on_error; } if( mount_file_system_set_handle( mount_handle->file_system, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set handle in file system.", function ); ewf_handle = NULL; goto on_error; } if( libewf_handle_close( ewf_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close handle.", function ); goto on_error; } if( libewf_handle_free( &ewf_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free handle.", function ); goto on_error; } return( 0 ); on_error: if( ewf_handle != NULL ) { libewf_handle_free( &ewf_handle, NULL ); } return( -1 ); } /* Retrieves a file entry for a specific path * Returns 1 if successful, 0 if no such file entry or -1 on error */ int mount_handle_get_file_entry_by_path( mount_handle_t *mount_handle, const system_character_t *path, mount_file_entry_t **file_entry, libcerror_error_t **error ) { libewf_file_entry_t *ewf_file_entry = NULL; libewf_handle_t *ewf_handle = NULL; const system_character_t *filename = NULL; static char *function = "mount_handle_get_file_entry_by_path"; size_t filename_length = 0; size_t path_index = 0; size_t path_length = 0; int file_entry_type = 0; int result = 0; if( mount_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mount handle.", function ); return( -1 ); } if( path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); return( -1 ); } path_length = system_string_length( path ); if( path_length == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid path length value out of bounds.", function ); goto on_error; } if( ( path_length >= 2 ) && ( path[ path_length - 1 ] == LIBCPATH_SEPARATOR ) ) { path_length--; } path_index = path_length; while( path_index > 0 ) { if( path[ path_index ] == LIBCPATH_SEPARATOR ) { break; } path_index--; } /* Ignore the name of the root item */ if( path_length == 0 ) { filename = _SYSTEM_STRING( "" ); filename_length = 0; } else { filename = &( path[ path_index + 1 ] ); filename_length = path_length - ( path_index + 1 ); } if( mount_handle->input_format == MOUNT_HANDLE_INPUT_FORMAT_FILES ) { result = mount_file_system_get_file_entry_by_path( mount_handle->file_system, path, path_length, &ewf_file_entry, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry.", function ); goto on_error; } file_entry_type = MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY; } else { result = mount_file_system_get_handle_by_path( mount_handle->file_system, path, path_length, &ewf_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve handle.", function ); goto on_error; } file_entry_type = MOUNT_FILE_ENTRY_TYPE_HANDLE; } if( result != 0 ) { if( mount_file_entry_initialize( file_entry, mount_handle->file_system, filename, filename_length, file_entry_type, ewf_handle, ewf_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize file entry.", function ); goto on_error; } } return( result ); on_error: if( ewf_file_entry != NULL ) { libewf_file_entry_free( &ewf_file_entry, NULL ); } return( -1 ); } libewf-20140807/ewftools/ewfexport.c0000664000175000017500000010061713421037364021372 0ustar00lordyestalordyesta00000000000000/* * Export media data from EWF files to a file * * 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 . */ #include #include #include #include #include #if defined( HAVE_SYS_RESOURCE_H ) #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 #include "byte_size_string.h" #include "ewfcommon.h" #include "ewfinput.h" #include "ewftools_getopt.h" #include "ewftools_glob.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "export_handle.h" #include "log_handle.h" #include "platform.h" #include "storage_media_buffer.h" #define EWFEXPORT_INPUT_BUFFER_SIZE 64 export_handle_t *ewfexport_export_handle = NULL; int ewfexport_abort = 0; /* Prints the executable usage information to the stream */ void usage_fprint( FILE *stream ) { 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; if( stream == NULL ) { return; } result = byte_size_string_create( default_segment_file_size_string, 16, EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); if( result == 1 ) { result = byte_size_string_create( minimum_segment_file_size_string, 16, EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { result = byte_size_string_create( maximum_32bit_segment_file_size_string, 16, EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { result = byte_size_string_create( maximum_64bit_segment_file_size_string, 16, EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } fprintf( stream, "Use ewfexport to export data from the EWF format (Expert Witness Compression\n" "Format) to raw data or another EWF format.\n\n" ); fprintf( stream, "Usage: ewfexport [ -A codepage ] [ -b number_of_sectors ]\n" " [ -B number_of_bytes ] [ -c compression_values ]\n" " [ -d digest_type ] [ -f format ] [ -l log_filename ]\n" " [ -o offset ] [ -p process_buffer_size ]\n" " [ -S segment_file_size ] [ -t target ] [ -hqsuvVwx ] ewf_files\n\n" ); fprintf( stream, "\tewf_files: the first or the entire set of EWF segment files\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-b: specify the number of sectors to read at once (per chunk),\n" "\t options: 16, 32, 64 (default), 128, 256, 512, 1024, 2048,\n" "\t 4096, 8192, 16384 or 32768 (not used for raw and files\n" "\t formats)\n" ); fprintf( stream, "\t-B: specify the number of bytes to export (default is all bytes)\n" ); fprintf( stream, "\t-c: specify the compression values as: level or method:level\n" "\t compression method options: deflate (default), bzip2\n" "\t (bzip2 is only supported by EWF2 formats)\n" "\t compression level options: none (default), empty-block,\n" "\t fast or best\n" ); fprintf( stream, "\t-d: calculate additional digest (hash) types besides md5,\n" "\t options: sha1, sha256 (not used for raw and files format)\n" ); fprintf( stream, "\t-f: specify the output format to write to, options:\n" "\t raw (default), files (restricted to logical volume files), ewf,\n" "\t smart, encase1, encase2, encase3, encase4, encase5, encase6,\n" "\t encase7, encase7-v2, linen5, linen6, linen7, ewfx\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-l: logs export errors and the digest (hash) to the log_filename\n" ); fprintf( stream, "\t-o: specify the offset to start the export (default is 0)\n" ); fprintf( stream, "\t-p: specify the process buffer size (default is the chunk size)\n" ); fprintf( stream, "\t-q: quiet shows minimal status information\n" ); fprintf( stream, "\t-s: swap byte pairs of the media data (from AB to BA)\n" "\t (use this for big to little endian conversion and vice\n" "\t versa)\n" ); if( result == 1 ) { 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, maximum_64bit_segment_file_size_string, maximum_32bit_segment_file_size_string ); } else { fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIu32 ")\n" "\t (minimum is %" PRIu32 ", maximum is %" PRIu64 " for raw, encase6 and\n" "\t enccase7 format and %" PRIu32 " for other formats)\n" "\t (not used for files format)\n", (uint32_t) EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE, (uint32_t) EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT, (uint32_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ); } fprintf( stream, "\t-t: specify the target file to export to, use - for stdout\n" "\t (default is export) stdout is only supported for the raw\n" "\t format\n" ); fprintf( stream, "\t-u: unattended mode (disables user interaction)\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); fprintf( stream, "\t-w: zero sectors on checksum error (mimic EnCase like behavior)\n" ); fprintf( stream, "\t-x: use the chunk data instead of the buffered read and write\n" "\t functions.\n" ); } /* Signal handler for ewfexport */ void ewfexport_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfexport_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfexport_abort = 1; if( ewfexport_export_handle != NULL ) { if( export_handle_signal_abort( ewfexport_export_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal export handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* The main program */ #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( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif system_character_t acquiry_operating_system[ 32 ]; system_character_t * const *argv_filenames = NULL; libcerror_error_t *error = NULL; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif 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; system_integer_t option = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t swap_byte_pairs = 0; uint8_t use_chunk_data_functions = 0; uint8_t verbose = 0; uint8_t zero_chunk_on_error = 0; int interactive_mode = 1; int number_of_filenames = 0; int result = 1; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } #if defined( WINAPI ) && !defined( __CYGWIN__ ) #if defined( _MSC_VER ) if( _setmode( _fileno( stdout ), _O_BINARY ) == -1 ) #else if( setmode( _fileno( stdout ), _O_BINARY ) == -1 ) #endif { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to set stdout to binary mode.\n" ); goto on_error; } #endif while( ( option = ewftools_getopt( argc, argv, _SYSTEM_STRING( "A:b:B:c:d:f:hl:o:p:qsS:t:uvVwx" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); usage_fprint( stderr ); goto on_error; case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; case (system_integer_t) 'B': option_size = optarg; break; case (system_integer_t) 'c': option_compression_values = optarg; break; case (system_integer_t) 'd': option_additional_digest_types = optarg; break; case (system_integer_t) 'f': option_format = optarg; break; case (system_integer_t) 'h': ewftools_output_version_fprint( stderr, program ); usage_fprint( stderr ); return( EXIT_SUCCESS ); case (system_integer_t) 'l': log_filename = optarg; break; case (system_integer_t) 'o': option_offset = optarg; break; case (system_integer_t) 'p': option_process_buffer_size = optarg; break; case (system_integer_t) 'q': print_status_information = 0; break; case (system_integer_t) 's': swap_byte_pairs = 1; break; case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; case (system_integer_t) 't': option_target_path = optarg; break; case (system_integer_t) 'u': interactive_mode = 0; break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_version_fprint( stderr, program ); ewftools_output_copyright_fprint( stderr ); return( EXIT_SUCCESS ); case (system_integer_t) 'w': zero_chunk_on_error = 1; break; case (system_integer_t) 'x': use_chunk_data_functions = 1; break; } } if( optind == argc ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Missing EWF image file(s).\n" ); usage_fprint( stderr ); goto on_error; } ewftools_output_version_fprint( stderr, program ); libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif #if !defined( HAVE_GLOB_H ) if( ewftools_glob_initialize( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to initialize glob.\n" ); goto on_error; } if( ewftools_glob_resolve( glob, &( argv[ optind ] ), argc - optind, &error ) != 1 ) { fprintf( stderr, "Unable to resolve glob.\n" ); goto on_error; } if( ewftools_glob_get_results( glob, &number_of_filenames, (system_character_t ***) &argv_filenames, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve glob results.\n" ); goto on_error; } #else argv_filenames = &( argv[ optind ] ); number_of_filenames = argc - optind; #endif if( export_handle_initialize( &ewfexport_export_handle, calculate_md5, use_chunk_data_functions, &error ) != 1 ) { fprintf( stderr, "Unable to create export handle.\n" ); goto on_error; } #if defined( HAVE_GETRLIMIT ) if( getrlimit( RLIMIT_NOFILE, &limit_data ) != 0 ) { fprintf( stderr, "Unable to determine limit: number of open file descriptors.\n" ); } if( limit_data.rlim_max > (rlim_t) INT_MAX ) { limit_data.rlim_max = (rlim_t) INT_MAX; } if( limit_data.rlim_max > 0 ) { limit_data.rlim_max /= 2; } if( export_handle_set_maximum_number_of_open_handles( ewfexport_export_handle, (int) limit_data.rlim_max, &error ) != 1 ) { fprintf( stderr, "Unable to set maximum number of open file handles.\n" ); goto on_error; } #endif if( ewftools_signal_attach( ewfexport_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } result = export_handle_open_input( ewfexport_export_handle, argv_filenames, number_of_filenames, &error ); if( ewfexport_abort != 0 ) { goto on_abort; } if( result != 1 ) { fprintf( stderr, "Unable to open EWF file(s).\n" ); goto on_error; } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_free( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } #endif if( option_header_codepage != NULL ) { result = export_handle_set_header_codepage( ewfexport_export_handle, option_header_codepage, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set header codepage.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); } } if( option_target_path != NULL ) { if( export_handle_set_string( ewfexport_export_handle, option_target_path, &( ewfexport_export_handle->target_path ), &( ewfexport_export_handle->target_path_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target path.\n" ); goto on_error; } } else if( interactive_mode == 0 ) { /* Make sure the target filename is set in unattended mode */ if( export_handle_set_string( ewfexport_export_handle, _SYSTEM_STRING( "export" ), &( ewfexport_export_handle->target_path ), &( ewfexport_export_handle->target_path_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target path.\n" ); goto on_error; } } if( option_format != NULL ) { result = export_handle_set_output_format( ewfexport_export_handle, option_format, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set output format.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported output format defaulting to: raw.\n" ); } } if( option_compression_values != NULL ) { result = export_handle_set_compression_values( ewfexport_export_handle, option_compression_values, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set compression values.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported compression values defaulting to method: deflate with level: none.\n" ); } } if( option_sectors_per_chunk != NULL ) { result = export_handle_set_sectors_per_chunk( ewfexport_export_handle, option_sectors_per_chunk, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set sectors per chunk.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported sectors per chunk defaulting to: %" PRIu32 ".\n", ewfexport_export_handle->sectors_per_chunk ); } } if( option_maximum_segment_size != NULL ) { result = export_handle_set_maximum_segment_size( ewfexport_export_handle, option_maximum_segment_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set maximum segment size.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported maximum segment size defaulting to: %" PRIu64 ".\n", ewfexport_export_handle->maximum_segment_size ); } } if( option_offset != NULL ) { result = export_handle_set_export_offset( ewfexport_export_handle, option_offset, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set export offset.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfexport_export_handle->export_offset >= ewfexport_export_handle->input_media_size ) ) { ewfexport_export_handle->export_offset = 0; fprintf( stderr, "Unsupported export offset defaulting to: 0.\n" ); } } if( option_size != NULL ) { result = export_handle_set_export_size( ewfexport_export_handle, option_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set export size.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfexport_export_handle->export_size > ( ewfexport_export_handle->input_media_size - ewfexport_export_handle->export_offset ) ) ) { ewfexport_export_handle->export_size = 0; fprintf( stderr, "Unsupported export size defaulting to: all bytes.\n" ); } } if( option_process_buffer_size != NULL ) { result = export_handle_set_process_buffer_size( ewfexport_export_handle, option_process_buffer_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set process buffer size.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported process buffer size defaulting to: chunk size.\n" ); } } if( option_additional_digest_types != NULL ) { result = export_handle_set_additional_digest_types( ewfexport_export_handle, option_additional_digest_types, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set additional digest types.\n" ); goto on_error; } } /* Initialize values */ if( ewfexport_export_handle->export_size == 0 ) { ewfexport_export_handle->export_size = ewfexport_export_handle->input_media_size - ewfexport_export_handle->export_offset; } /* Request the necessary case data */ if( interactive_mode != 0 ) { if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } fprintf( stderr, "Information for export required, please provide the necessary input\n" ); if( option_format == NULL ) { result = export_handle_prompt_for_output_format( ewfexport_export_handle, _SYSTEM_STRING( "Export to format" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine output format.\n" ); goto on_error; } } if( option_target_path == NULL ) { if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { request_string = _SYSTEM_STRING( "Target path and filename without extension" ); } else if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_FILES ) { request_string = _SYSTEM_STRING( "Target path" ); } else if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { request_string = _SYSTEM_STRING( "Target path and filename without extension or - for stdout" ); } } if( request_string != NULL ) { do { result = export_handle_prompt_for_string( ewfexport_export_handle, request_string, &( ewfexport_export_handle->target_path ), &( ewfexport_export_handle->target_path_size ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine target.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stdout, "Target is required, please try again or terminate using Ctrl^C.\n" ); } } while( result != 1 ); } if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( option_compression_values == NULL ) { result = export_handle_prompt_for_compression_method( ewfexport_export_handle, _SYSTEM_STRING( "Compression method" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine compression method.\n" ); goto on_error; } result = export_handle_prompt_for_compression_level( ewfexport_export_handle, _SYSTEM_STRING( "Compression level" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine compression level.\n" ); goto on_error; } } if( option_maximum_segment_size == NULL ) { result = export_handle_prompt_for_maximum_segment_size( ewfexport_export_handle, _SYSTEM_STRING( "Evidence segment file size in bytes" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine maximum segment size.\n" ); goto on_error; } if( ( ewfexport_export_handle->maximum_segment_size < EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE ) || ( ( ewfexport_export_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) && ( ewfexport_export_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT ) ) || ( ( ewfexport_export_handle->ewf_format != LIBEWF_FORMAT_ENCASE6 ) && ( ewfexport_export_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ) ) ) { ewfexport_export_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; fprintf( stderr, "Unsupported maximum segment size defaulting to: %" PRIu64 ".\n", ewfexport_export_handle->maximum_segment_size ); } } if( option_sectors_per_chunk == NULL ) { result = export_handle_prompt_for_sectors_per_chunk( ewfexport_export_handle, _SYSTEM_STRING( "The number of sectors to read at once" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine sectors per chunk.\n" ); goto on_error; } } } 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 ] == (system_character_t) '-' ) && ( ( ewfexport_export_handle->target_path )[ 1 ] == 0 ) ) { /* No need for segment files when exporting to stdout */ } else if( option_maximum_segment_size == NULL ) { result = export_handle_prompt_for_maximum_segment_size( ewfexport_export_handle, _SYSTEM_STRING( "Evidence segment file size in bytes (0 is unlimited)" ), &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine maximum segment size.\n" ); goto on_error; } if( ( ewfexport_export_handle->maximum_segment_size != 0 ) && ( ewfexport_export_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT ) ) { ewfexport_export_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; fprintf( stderr, "Unsupported maximum segment size defaulting to: %" PRIu64 ".\n", ewfexport_export_handle->maximum_segment_size ); } } } if( ( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) || ( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) ) { if( option_offset == NULL ) { result = export_handle_prompt_for_export_offset( ewfexport_export_handle, _SYSTEM_STRING( "Start export at offset" ), &error ); if( result == -1 ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); fprintf( stderr, "Unable to determine export offset defaulting to: %" PRIu64 ".\n", ewfexport_export_handle->export_offset ); } } if( option_size == NULL ) { result = export_handle_prompt_for_export_size( ewfexport_export_handle, _SYSTEM_STRING( "Number of bytes to export" ), &error ); if( result == -1 ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); fprintf( stderr, "Unable to determine export size defaulting to: %" PRIu64 ".\n", ewfexport_export_handle->export_size ); } } } if( ewftools_signal_attach( ewfexport_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } else { if( ewfexport_export_handle->maximum_segment_size == 0 ) { if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( ewfexport_export_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) { ewfexport_export_handle->maximum_segment_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT; } else { ewfexport_export_handle->maximum_segment_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT; } } else if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { ewfexport_export_handle->maximum_segment_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT; } } } fprintf( stderr, "\n" ); if( log_filename != NULL ) { if( log_handle_initialize( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to create log handle.\n" ); goto on_error; } if( log_handle_open( log_handle, log_filename, &error ) != 1 ) { fprintf( stderr, "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } } if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_FILES ) { result = export_handle_export_single_files( ewfexport_export_handle, ewfexport_export_handle->target_path, print_status_information, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to export single files.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } else { if( export_handle_open_output( ewfexport_export_handle, ewfexport_export_handle->target_path, &error ) != 1 ) { fprintf( stderr, "Unable to open output.\n" ); goto on_error; } if( platform_get_operating_system( acquiry_operating_system, 32, &error ) != 1 ) { fprintf( stderr, "Unable to determine operating system.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); acquiry_operating_system[ 0 ] = 0; } acquiry_software_version = _SYSTEM_STRING( LIBEWF_VERSION_STRING ); if( export_handle_set_output_values( ewfexport_export_handle, acquiry_operating_system, program, acquiry_software_version, zero_chunk_on_error, 0, &error ) != 1 ) { fprintf( stderr, "Unable to set output values.\n" ); goto on_error; } result = export_handle_export_input( ewfexport_export_handle, swap_byte_pairs, print_status_information, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to export input.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } if( log_handle != NULL ) { if( log_handle_close( log_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } if( log_handle_free( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free log handle.\n" ); goto on_error; } } on_abort: if( export_handle_close( ewfexport_export_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close export handle.\n" ); goto on_error; } if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( export_handle_free( &ewfexport_export_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free export handle.\n" ); goto on_error; } if( ewfexport_abort != 0 ) { fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } if( result != 1 ) { fprintf( stdout, "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { log_handle_close( log_handle, NULL ); log_handle_free( &log_handle, NULL ); } if( ewfexport_export_handle != NULL ) { export_handle_close( ewfexport_export_handle, NULL ); export_handle_free( &ewfexport_export_handle, NULL ); } #if !defined( HAVE_GLOB_H ) if( glob != NULL ) { ewftools_glob_free( &glob, NULL ); } #endif return( EXIT_FAILURE ); } libewf-20140807/ewftools/guid.c0000664000175000017500000002020313421024433020260 0ustar00lordyestalordyesta00000000000000/* * GUID functions * * 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 . */ #include #include #include #include #include #include #if defined( WINAPI ) #include #elif defined( HAVE_UUID_UUID_H ) #include #endif #include "ewftools_libcerror.h" #include "guid.h" #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) /* Determines the GUID * Returns 1 if successful or -1 on error */ int guid_generate( uint8_t *guid, size_t guid_size, uint8_t guid_type, libcerror_error_t **error ) { #if defined( WINAPI ) UUID uuid = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } }; #endif static char *function = "guid_generate"; if( guid == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid GUID.", function ); return( -1 ); } if( guid_size < GUID_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: GUID too small.", function ); return( -1 ); } if( guid_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid GUID size value exceeds maximum.", function ); return( -1 ); } if( ( guid_type != GUID_TYPE_RANDOM ) && ( guid_type != GUID_TYPE_TIME ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported GUID type.", function ); return( -1 ); } if( guid_type == GUID_TYPE_RANDOM ) { #if defined( WINAPI ) UuidCreate( &uuid ); #elif defined( HAVE_UUID_GENERATE_RANDOM ) uuid_generate_random( guid ); #endif } if( guid_type == GUID_TYPE_TIME ) { #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 /* No support for the time type GUID */ #elif defined( WINAPI ) && _WIN32_WINNT >= 0x0500 UuidCreateSequential( &uuid ); #elif defined( HAVE_UUID_GENERATE_TIME ) uuid_generate_time( guid ); #endif } #if defined( WINAPI ) byte_stream_copy_from_uint32_little_endian( guid, uuid.Data1 ); guid += 4; byte_stream_copy_from_uint16_little_endian( guid, uuid.Data2 ); guid += 2; byte_stream_copy_from_uint16_little_endian( guid, uuid.Data3 ); guid += 2; guid[ 0 ] = uuid.Data4[ 0 ]; guid[ 1 ] = uuid.Data4[ 1 ]; guid[ 2 ] = uuid.Data4[ 2 ]; guid[ 3 ] = uuid.Data4[ 3 ]; guid[ 4 ] = uuid.Data4[ 4 ]; guid[ 5 ] = uuid.Data4[ 5 ]; guid[ 6 ] = uuid.Data4[ 6 ]; guid[ 7 ] = uuid.Data4[ 7 ]; #endif return( 1 ); } #endif /* Converts the GUID into a string * Returns 1 if successful or -1 on error */ int guid_to_string( uint8_t *guid, size_t guid_size, int byte_order, system_character_t *string, size_t string_size, libcerror_error_t **error ) { static char *function = "guid_to_string"; int print_count = 0; if( guid == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid guid.", function ); return( -1 ); } if( guid_size < GUID_SIZE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: GUID too small.", function ); return( -1 ); } if( guid_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid GUID size value exceeds maximum.", function ); return( -1 ); } if( ( byte_order != _BYTE_STREAM_ENDIAN_BIG ) && ( byte_order != _BYTE_STREAM_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported byte order.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size < 37 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string too small.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } /* Create the GUID string * It is stored as uint32 - uint16 - uint16 - 8 byte array */ if( byte_order == _BYTE_STREAM_ENDIAN_BIG ) { print_count = system_string_sprintf( string, string_size, _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 ], guid[ 8 ], guid[ 9 ], guid[ 10 ], guid[ 11 ], guid[ 12 ], guid[ 13 ], guid[ 14 ], guid[ 15 ] ); } else if( byte_order == _BYTE_STREAM_ENDIAN_LITTLE ) { print_count = system_string_sprintf( string, string_size, _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 ], guid[ 8 ], guid[ 9 ], guid[ 10 ], guid[ 11 ], guid[ 12 ], guid[ 13 ], guid[ 14 ], guid[ 15 ] ); } if( ( print_count < 0 ) || ( (size_t) print_count > string_size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set string.", function ); return( -1 ); } return( 1 ); } libewf-20140807/ewftools/ewftools_system_string.h0000664000175000017500000000317213440663046024211 0ustar00lordyestalordyesta00000000000000/* * System character string functions * * Copyright (C) 2006-2019, 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_SYSTEM_STRING_H ) #define _EWFTOOLS_SYSTEM_STRING_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int ewftools_system_string_decimal_copy_to_64_bit( const system_character_t *string, size_t string_size, uint64_t *value_64bit, libcerror_error_t **error ); int ewftools_string_size_to_utf8_string( const system_character_t *string, size_t string_size, size_t *utf8_string_size, libcerror_error_t **error ); int ewftools_string_copy_to_utf8_string( const system_character_t *string, size_t string_size, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_SYSTEM_STRING_H ) */ libewf-20140807/ewftools/log_handle.h0000664000175000017500000000315213421024433021435 0ustar00lordyestalordyesta00000000000000/* * Log handle * * 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( _LOG_HANDLE_H ) #define _LOG_HANDLE_H #include #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct log_handle log_handle_t; struct log_handle { /* The log stream */ FILE *log_stream; }; int log_handle_initialize( log_handle_t **log_handle, libcerror_error_t **error ); int log_handle_free( log_handle_t **log_handle, libcerror_error_t **error ); int log_handle_open( log_handle_t *log_handle, const system_character_t *filename, libcerror_error_t **error ); int log_handle_close( log_handle_t *log_handle, libcerror_error_t **error ); void log_handle_printf( log_handle_t *log_handle, char *format, ... ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/process_status.c0000664000175000017500000005274013421024433022424 0ustar00lordyestalordyesta00000000000000/* * Process status functions * * 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 . */ #include #include #include #include #if defined( TIME_WITH_SYS_TIME ) #include #include #elif defined( HAVE_SYS_TIME_H ) #include #else #include #endif #include "byte_size_string.h" #include "ewftools_libcdatetime.h" #include "ewftools_libcerror.h" #include "ewftools_libcnotify.h" #include "process_status.h" /* Creates process status information * Make sure the value X is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int process_status_initialize( process_status_t **process_status, 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 ) { static char *function = "process_status_initialize"; if( process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid process status.", function ); return( -1 ); } if( *process_status != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid process status value already set.", function ); return( -1 ); } *process_status = memory_allocate_structure( process_status_t ); if( *process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create process status.", function ); goto on_error; } if( memory_set( *process_status, 0, sizeof( process_status_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear process status.", function ); memory_free( *process_status ); *process_status = NULL; return( -1 ); } if( libcdatetime_elements_initialize( &( ( *process_status )->start_time_elements ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create start time elements.", function ); goto on_error; } if( libcdatetime_elements_initialize( &( ( *process_status )->current_time_elements ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create current time elements.", function ); goto on_error; } if( libcdatetime_elements_initialize( &( ( *process_status )->last_time_elements ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create last time elements.", function ); goto on_error; } ( *process_status )->status_process_string = status_process_string; ( *process_status )->status_update_string = status_update_string; ( *process_status )->status_summary_string = status_summary_string; ( *process_status )->output_stream = output_stream; ( *process_status )->print_status_information = print_status_information; return( 1 ); on_error: if( *process_status != NULL ) { memory_free( *process_status ); *process_status = NULL; } return( -1 ); } /* Frees process status information * Returns 1 if successful or -1 on error */ int process_status_free( process_status_t **process_status, libcerror_error_t **error ) { static char *function = "process_status_free"; int result = 1; if( process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid process status.", function ); return( -1 ); } if( *process_status != NULL ) { if( libcdatetime_elements_free( &( ( *process_status )->start_time_elements ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free start time elements.", function ); result = -1; } if( libcdatetime_elements_free( &( ( *process_status )->current_time_elements ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free current time elements.", function ); result = -1; } if( libcdatetime_elements_free( &( ( *process_status )->last_time_elements ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free last time elements.", function ); result = -1; } memory_free( *process_status ); *process_status = NULL; } return( result ); } /* Starts the process status information * Returns 1 if successful or -1 on error */ int process_status_start( process_status_t *process_status, libcerror_error_t **error ) { system_character_t time_string[ 32 ]; static char *function = "process_status_start"; if( process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid process status.", function ); return( -1 ); } process_status->last_percentage = -1; if( libcdatetime_elements_set_current_time_localtime( process_status->start_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set start time elements to current time.", function ); return( -1 ); } if( libcdatetime_elements_copy( process_status->current_time_elements, process_status->start_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy start time elements to current.", function ); return( -1 ); } if( libcdatetime_elements_copy( process_status->last_time_elements, process_status->start_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy start time elements to last.", function ); return( -1 ); } if( ( process_status->output_stream != NULL ) && ( process_status->print_status_information != 0 ) && ( process_status->status_process_string != NULL ) ) { if( libcdatetime_elements_copy_to_string( process_status->start_time_elements, (uint8_t *) time_string, 32, LIBCDATETIME_STRING_FORMAT_TYPE_CTIME | LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME, NULL ) == 1 ) { fprintf( process_status->output_stream, "%" PRIs_SYSTEM " started at: %" PRIs_SYSTEM "\n", process_status->status_process_string, time_string ); } else { fprintf( process_status->output_stream, "%" PRIs_SYSTEM " started.\n", process_status->status_process_string ); } fprintf( process_status->output_stream, "This could take a while.\n\n" ); } return( 1 ); } /* Updates the process status information * Returns 1 if successful or -1 on error */ int process_status_update( process_status_t *process_status, size64_t bytes_read, size64_t bytes_total, libcerror_error_t **error ) { static char *function = "process_status_update"; int64_t number_of_seconds = 0; int64_t remaining_number_of_seconds = 0; int64_t total_number_of_seconds = 0; int8_t new_percentage = 0; if( process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid process status.", function ); return( -1 ); } if( ( process_status->output_stream != NULL ) && ( process_status->print_status_information != 0 ) && ( process_status->status_update_string != NULL ) ) { if( ( bytes_total > 0 ) && ( bytes_read > 0 ) ) { new_percentage = (int8_t) ( ( bytes_read * 100 ) / bytes_total ); } if( libcdatetime_elements_set_current_time_localtime( process_status->current_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current time elements to current time.", function ); return( -1 ); } if( libcdatetime_elements_get_delta_in_seconds( process_status->current_time_elements, process_status->last_time_elements, &number_of_seconds, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine delta between last and current time.", function ); return( -1 ); } /* Estimate the remaining time */ if( number_of_seconds > 3 ) { if( libcdatetime_elements_copy( process_status->last_time_elements, process_status->current_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy current time elements to last.", function ); return( -1 ); } if( libcdatetime_elements_get_delta_in_seconds( process_status->last_time_elements, process_status->start_time_elements, &number_of_seconds, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine delta between last and start time.", function ); return( -1 ); } process_status->last_percentage = new_percentage; fprintf( process_status->output_stream, "Status: at %" PRIu8 "%%.\n", new_percentage ); fprintf( process_status->output_stream, " %" PRIs_SYSTEM "", process_status->status_update_string ); process_status_bytes_fprint( process_status->output_stream, bytes_read ); fprintf( process_status->output_stream, " of total" ); process_status_bytes_fprint( process_status->output_stream, bytes_total ); fprintf( process_status->output_stream, ".\n" ); if( new_percentage > 0 ) { total_number_of_seconds = ( ( number_of_seconds * 100 ) / new_percentage ); remaining_number_of_seconds = total_number_of_seconds - number_of_seconds; /* Negative time means nearly finished */ if( remaining_number_of_seconds < 0 ) { remaining_number_of_seconds = 0; } fprintf( process_status->output_stream, " completion" ); process_status_timestamp_fprint( process_status->output_stream, remaining_number_of_seconds ); process_status_bytes_per_second_fprint( process_status->output_stream, bytes_total, total_number_of_seconds ); } fprintf( process_status->output_stream, ".\n\n" ); } } return( 1 ); } /* Updates the process status information when the total number of bytes is unknown * Returns 1 if successful or -1 on error */ int process_status_update_unknown_total( process_status_t *process_status, size64_t bytes_read, libcerror_error_t **error ) { static char *function = "process_status_update_unknown_total"; int64_t number_of_seconds = 0; if( process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid process status.", function ); return( -1 ); } if( ( process_status->output_stream != NULL ) && ( process_status->print_status_information != 0 ) && ( process_status->status_update_string != NULL ) ) { if( libcdatetime_elements_set_current_time_localtime( process_status->current_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set current time elements to current time.", function ); return( -1 ); } if( libcdatetime_elements_get_delta_in_seconds( process_status->current_time_elements, process_status->last_time_elements, &number_of_seconds, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine delta between last and current time.", function ); return( -1 ); } if( number_of_seconds > 3 ) { if( libcdatetime_elements_copy( process_status->last_time_elements, process_status->current_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy current time elements to last.", function ); return( -1 ); } if( libcdatetime_elements_get_delta_in_seconds( process_status->last_time_elements, process_status->start_time_elements, &number_of_seconds, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine delta between last and start time.", function ); return( -1 ); } process_status->last_bytes_total = bytes_read; fprintf( process_status->output_stream, "Status: %" PRIs_SYSTEM "", process_status->status_update_string ); process_status_bytes_fprint( process_status->output_stream, bytes_read ); fprintf( process_status->output_stream, "\n" ); fprintf( process_status->output_stream, " " ); process_status_timestamp_fprint( process_status->output_stream, number_of_seconds ); process_status_bytes_per_second_fprint( process_status->output_stream, bytes_read, number_of_seconds ); fprintf( process_status->output_stream, ".\n\n" ); } } return( 1 ); } /* Stops the process status information * Returns 1 if successful or -1 on error */ int process_status_stop( process_status_t *process_status, size64_t bytes_total, int status, libcerror_error_t **error ) { system_character_t time_string[ 32 ]; static char *function = "process_status_start"; const system_character_t *status_string = NULL; int64_t total_number_of_seconds = 0; if( process_status == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid process status.", function ); return( -1 ); } if( ( status != PROCESS_STATUS_ABORTED ) && ( status != PROCESS_STATUS_COMPLETED ) && ( status != PROCESS_STATUS_FAILED ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported status.", function ); return( -1 ); } if( libcdatetime_elements_set_current_time_localtime( process_status->last_time_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last time elements to current time.", function ); return( -1 ); } if( ( process_status->output_stream != NULL ) && ( process_status->print_status_information != 0 ) && ( process_status->status_process_string != NULL ) ) { if( status == PROCESS_STATUS_ABORTED ) { status_string = _SYSTEM_STRING( "aborted" ); } else if( status == PROCESS_STATUS_COMPLETED ) { status_string = _SYSTEM_STRING( "completed" ); } else if( status == PROCESS_STATUS_FAILED ) { status_string = _SYSTEM_STRING( "failed" ); } fprintf( process_status->output_stream, "%" PRIs_SYSTEM " %" PRIs_SYSTEM "", process_status->status_process_string, status_string ); if( libcdatetime_elements_copy_to_string( process_status->last_time_elements, (uint8_t *) time_string, 32, LIBCDATETIME_STRING_FORMAT_TYPE_CTIME | LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME, NULL ) == 1 ) { fprintf( process_status->output_stream, " at: %" PRIs_SYSTEM "\n", time_string ); } else { fprintf( process_status->output_stream, ".\n" ); } if( ( status == PROCESS_STATUS_COMPLETED ) && ( process_status->status_summary_string != NULL ) && ( bytes_total > 0 ) ) { fprintf( process_status->output_stream, "\n" ); if( libcdatetime_elements_get_delta_in_seconds( process_status->last_time_elements, process_status->start_time_elements, &total_number_of_seconds, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine delta between last and start time.", function ); return( -1 ); } fprintf( process_status->output_stream, "%" PRIs_SYSTEM ":", process_status->status_summary_string ); process_status_bytes_fprint( process_status->output_stream, bytes_total ); process_status_timestamp_fprint( process_status->output_stream, total_number_of_seconds ); process_status_bytes_per_second_fprint( process_status->output_stream, bytes_total, total_number_of_seconds ); fprintf( process_status->output_stream, ".\n" ); } } return( 1 ); } /* Prints a time stamp (with a leading space) to a stream */ void process_status_timestamp_fprint( FILE *stream, int64_t number_of_seconds ) { libcdatetime_elements_t *time_elements = NULL; libcerror_error_t *error = NULL; uint16_t day_of_year = 0; uint8_t hours = 0; uint8_t minutes = 0; uint8_t seconds = 0; if( stream == NULL ) { return; } if( libcdatetime_elements_initialize( &time_elements, &error ) != 1 ) { goto on_error; } if( libcdatetime_elements_set_from_delta_in_seconds( time_elements, number_of_seconds, &error ) != 1 ) { goto on_error; } if( libcdatetime_elements_get_day_of_year( time_elements, &day_of_year, &error ) != 1 ) { goto on_error; } if( libcdatetime_elements_get_time_values( time_elements, &hours, &minutes, &seconds, &error ) != 1 ) { goto on_error; } fprintf( stream, " in" ); if( day_of_year > 0 ) { fprintf( stream, " %" PRIu16 " day(s), %" PRIu8 " hour(s), %" PRIu8 " minute(s) and", day_of_year, hours, minutes ); } else if( hours > 0 ) { fprintf( stream, " %" PRIu8 " hour(s), %" PRIu8 " minute(s) and", hours, minutes ); } else if( minutes > 0 ) { fprintf( stream, " %" PRIu8 " minute(s) and", minutes ); } fprintf( stream, " %" PRIu8 " second(s)", seconds ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( time_elements != NULL ) { libcdatetime_elements_free( &time_elements, NULL ); } } /* Prints the number of bytes per second (with a leading space) to a stream */ void process_status_bytes_per_second_fprint( FILE *stream, size64_t bytes, time_t seconds ) { system_character_t bytes_per_second_string[ 16 ]; size64_t bytes_per_second = 0; int result = 0; if( stream == NULL ) { return; } if( seconds == 0 ) { return; } if( seconds > 0 ) { bytes_per_second = bytes / seconds; if( bytes_per_second > 1024 ) { result = byte_size_string_create( bytes_per_second_string, 10, bytes_per_second, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } fprintf( stream, " with" ); if( result == 1 ) { fprintf( stream, " %" PRIs_SYSTEM "/s (%" PRIu64 " bytes/second)", bytes_per_second_string, bytes_per_second ); } else { fprintf( stream, " %" PRIu64 " bytes/second", bytes_per_second ); } } } /* Prints the number of bytes (with a leading space) to a stream * Creates a human readable version of the number of bytes if possible */ void process_status_bytes_fprint( FILE *stream, size64_t bytes ) { system_character_t bytes_string[ 16 ]; int result = 0; if( stream == NULL ) { return; } if( bytes > 1024 ) { result = byte_size_string_create( bytes_string, 10, bytes, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { fprintf( stream, " %" PRIs_SYSTEM " (%" PRIi64 " bytes)", bytes_string, bytes ); } else { fprintf( stream, " %" PRIi64 " bytes", bytes ); } } libewf-20140807/ewftools/ewftools_i18n.h0000664000175000017500000000227113440662654022061 0ustar00lordyestalordyesta00000000000000/* * Internationalization (i18n) functions * * Copyright (C) 2006-2019, 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_I18N_H ) #define _EWFTOOLS_I18N_H #include #if defined( HAVE_LIBINTL_H ) #include #endif #if defined( __cplusplus ) extern "C" { #endif /* TODO for now do nothing i18n-like #define _( string ) \ gettext( string ) */ #define _( string ) \ string #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_I18N_H ) */ libewf-20140807/ewftools/ewfinput.h0000664000175000017500000001041213421024433021177 0ustar00lordyestalordyesta00000000000000/* * User input functions for the ewftools * * 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( _EWFINPUT_H ) #define _EWFINPUT_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #define EWFINPUT_COMPRESSION_METHODS_AMOUNT 1 #define EWFINPUT_COMPRESSION_METHODS_DEFAULT 0 #define EWFINPUT_COMPRESSION_LEVELS_AMOUNT 4 #define EWFINPUT_COMPRESSION_LEVELS_DEFAULT 0 #define EWFINPUT_FORMAT_TYPES_AMOUNT 12 #define EWFINPUT_FORMAT_TYPES_DEFAULT 8 #define EWFINPUT_MEDIA_TYPES_AMOUNT 4 #define EWFINPUT_MEDIA_TYPES_DEFAULT 0 #define EWFINPUT_MEDIA_FLAGS_AMOUNT 2 #define EWFINPUT_MEDIA_FLAGS_DEFAULT 1 #define EWFINPUT_SECTOR_PER_BLOCK_SIZES_AMOUNT 12 #define EWFINPUT_SECTOR_PER_BLOCK_SIZES_DEFAULT 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 system_character_t *string, uint8_t *ewf_format, libcerror_error_t **error ); int ewfinput_determine_sectors_per_chunk( const system_character_t *string, uint32_t *sectors_per_chunk, libcerror_error_t **error ); int ewfinput_determine_compression_method( const system_character_t *string, uint16_t *compression_method, libcerror_error_t **error ); int ewfinput_determine_compression_values( const system_character_t *string, int8_t *compression_level, uint8_t *compression_flags, libcerror_error_t **error ); int ewfinput_determine_media_type( const system_character_t *string, uint8_t *media_type, libcerror_error_t **error ); int ewfinput_determine_media_flags( const system_character_t *string, uint8_t *media_flags, libcerror_error_t **error ); int ewfinput_determine_header_codepage( const system_character_t *string, int *header_codepage, libcerror_error_t **error ); int ewfinput_determine_yes_no( const system_character_t *string, uint8_t *yes_no_value, libcerror_error_t **error ); int ewfinput_get_string_variable( FILE *stream, 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, system_character_t *input_buffer, size_t input_buffer_size, 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 ); int ewfinput_get_byte_size_variable( FILE *stream, system_character_t *input_buffer, size_t input_buffer_size, 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 ); int ewfinput_get_fixed_string_variable( FILE *stream, system_character_t *input_buffer, size_t input_buffer_size, const system_character_t *request_string, system_character_t **values, uint8_t number_of_values, uint8_t default_value, system_character_t **fixed_string_variable, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/ewftools_find.h0000664000175000017500000000621213440662654022221 0ustar00lordyestalordyesta00000000000000/* * Find functions * * Copyright (C) 2006-2019, 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_FIND_H ) #define _EWFTOOLS_FIND_H #include #include #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #include #elif defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif #if defined( __cplusplus ) extern "C" { #endif /* The find data structure type */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #define ewftools_find_data_t struct _wffblk #else #define ewftools_find_data_t struct _wfinddata_t #endif #else #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #define ewftools_find_data_t struct ffblk #else #define ewftools_find_data_t struct _finddata_t #endif #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ /* The find first function */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( __BORLANDC__ ) #if __BORLANDC__ <= 0x0520 #define ewftools_find_first( filter, fileinfo ) \ _wfindfirst( filter, fileinfo, 0 ) #else #define ewftools_find_first( filter, fileinfo ) \ __wfindfirst( filter, fileinfo ) #endif #else #define ewftools_find_first( filter, fileinfo ) \ _wfindfirst( filter, fileinfo ) #endif #else #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #define ewftools_find_first( filter, fileinfo ) \ findfirst( filter, fileinfo, 0 ) #else #define ewftools_find_first( filter, fileinfo ) \ _findfirst( filter, fileinfo ) #endif #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ /* The find next function */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( __BORLANDC__ ) #if __BORLANDC__ <= 0x0520 #define ewftools_find_next( handle, fileinfo ) \ _wfindnext( fileinfo ) #else #define ewftools_find_next( handle, fileinfo ) \ __wfindnext( handle, fileinfo ) #endif #else #define ewftools_find_next( handle, fileinfo ) \ _wfindnext( handle, fileinfo ) #endif #else #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #define ewftools_find_next( handle, fileinfo ) \ findnext( fileinfo ) #else #define ewftools_find_next( handle, fileinfo ) \ _findnext( handle, fileinfo ) #endif #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ /* The find close function */ #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 #define ewftools_find_close( handle ) \ 0 #else #define ewftools_find_close( handle ) \ _findclose( handle ) #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_FIND_H ) */ libewf-20140807/ewftools/ewftools_libewf.h0000664000175000017500000000170713440663046022551 0ustar00lordyestalordyesta00000000000000/* * The libewf header wrapper * * Copyright (C) 2006-2018, 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_LIBEWF_H ) #define _EWFTOOLS_LIBEWF_H #include #include #endif /* !defined( _EWFTOOLS_LIBEWF_H ) */ libewf-20140807/ewftools/ewftools_glob.c0000664000175000017500000003214713440662654022225 0ustar00lordyestalordyesta00000000000000/* * Globbing functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif #include "ewftools_find.h" #include "ewftools_glob.h" #include "ewftools_libcerror.h" /* TODO rename */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( _MSC_VER ) #define ewftools_path_make( path, path_size, drive, directory, filename, extension ) \ _wmakepath_s( path, path_size, drive, directory, filename, extension ) #define ewftools_path_split( path, drive, drive_size, directory, directory_size, filename, filename_size, extension, extension_size ) \ _wsplitpath_s( path, drive, drive_size, directory, directory_size, filename, filename_size, extension, extension_size ) #else #define ewftools_path_make( path, path_size, drive, directory, filename, extension ) \ _wmakepath( path, drive, directory, filename, extension ) #define ewftools_path_split( path, drive, drive_size, directory, directory_size, filename, filename_size, extension, extension_size ) \ _wsplitpath( path, drive, directory, filename, extension ) #endif #else #if defined( _MSC_VER ) #define ewftools_path_make( path, path_size, drive, directory, filename, extension ) \ _makepath_s( path, path_size, drive, directory, filename, extension ) #define ewftools_path_split( path, drive, drive_size, directory, directory_size, filename, filename_size, extension, extension_size ) \ _splitpath_s( path, drive, drive_size, directory, directory_size, filename, filename_size, extension, extension_size ) #else #define ewftools_path_make( path, path_size, drive, directory, filename, extension ) \ _makepath( path, drive, directory, filename, extension ) #define ewftools_path_split( path, drive, drive_size, directory, directory_size, filename, filename_size, extension, extension_size ) \ _splitpath( path, drive, directory, filename, extension ) #endif #endif #if !defined( HAVE_GLOB_H ) /* Creates a glob * Make sure the value glob is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int ewftools_glob_initialize( ewftools_glob_t **glob, libcerror_error_t **error ) { static char *function = "ewftools_glob_initialize"; if( glob == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid glob.", function ); return( -1 ); } if( *glob != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid glob value already set.", function ); return( -1 ); } *glob = memory_allocate_structure( ewftools_glob_t ); if( *glob == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create glob.", function ); goto on_error; } if( memory_set( *glob, 0, sizeof( ewftools_glob_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear glob.", function ); goto on_error; } return( 1 ); on_error: if( *glob != NULL ) { memory_free( *glob ); *glob = NULL; } return( -1 ); } /* Frees a glob * Returns 1 if successful or -1 on error */ int ewftools_glob_free( ewftools_glob_t **glob, libcerror_error_t **error ) { static char *function = "ewftools_glob_free"; int result_iterator = 0; if( glob == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid glob.", function ); return( -1 ); } if( *glob != NULL ) { if( ( *glob )->results != NULL ) { for( result_iterator = 0; result_iterator < ( *glob )->number_of_results; result_iterator++ ) { if( ( *glob )->results[ result_iterator ] != NULL ) { memory_free( ( *glob )->results[ result_iterator ] ); } } memory_free( ( *glob )->results ); } memory_free( *glob ); *glob = NULL; } return( 1 ); } /* Resizes the glob * Returns 1 if successful or -1 on error */ int ewftools_glob_resize( ewftools_glob_t *glob, int new_number_of_results, libcerror_error_t **error ) { void *reallocation = NULL; static char *function = "ewftools_glob_resize"; size_t previous_size = 0; size_t new_size = 0; if( glob == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid glob.", function ); return( -1 ); } if( glob->number_of_results >= new_number_of_results ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: new number of results less equal than current.", function ); return( -1 ); } previous_size = sizeof( system_character_t * ) * glob->number_of_results; new_size = sizeof( system_character_t * ) * new_number_of_results; if( ( previous_size > (size_t) SSIZE_MAX ) || ( new_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } reallocation = memory_reallocate( glob->results, new_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to reallocate glob results.", function ); return( -1 ); } glob->results = (system_character_t **) reallocation; if( memory_set( &( glob->results[ glob->number_of_results ] ), 0, new_size - previous_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear glob.", function ); return( -1 ); } glob->number_of_results = new_number_of_results; return( 1 ); } /* Resolves filenames with wildcards (globs) * Returns 1 if successful or -1 on error */ int ewftools_glob_resolve( ewftools_glob_t *glob, system_character_t * const patterns[], int number_of_patterns, libcerror_error_t **error ) { #if defined( HAVE_IO_H ) || defined( WINAPI ) ewftools_find_data_t find_data; system_character_t find_path[ _MAX_PATH ]; system_character_t find_drive[ _MAX_DRIVE ]; system_character_t find_directory[ _MAX_DIR ]; system_character_t find_name[ _MAX_FNAME ]; system_character_t find_extension[ _MAX_EXT ]; intptr_t find_handle = 0; #endif static char *function = "ewftools_glob_resolve"; size_t find_path_length = 0; int globs_found = 0; int iterator = 0; if( glob == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid glob.", function ); return( -1 ); } for( iterator = 0; iterator < number_of_patterns; iterator++ ) { if( patterns[ iterator ] == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing pattern value.", function ); return( -1 ); } #if defined( _MSC_VER ) if( ewftools_path_split( patterns[ iterator ], find_drive, _MAX_DRIVE, find_directory, _MAX_DIR, find_name, _MAX_FNAME, find_extension, _MAX_EXT ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to split path.", function ); return( -1 ); } #else ewftools_path_split( patterns[ iterator ], find_drive, _MAX_DRIVE, find_directory, _MAX_DIR, find_name, _MAX_FNAME, find_extension, _MAX_EXT ); #endif find_handle = ewftools_find_first( patterns[ iterator ], &find_data ); if( find_handle != -1 ) { do { if( ewftools_glob_resize( glob, glob->number_of_results + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize glob.", function ); return( -1 ); } #if defined( _MSC_VER ) if( ewftools_path_make( find_path, _MAX_PATH, find_drive, find_directory, find_data.name, _SYSTEM_STRING( "" ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to make path.", function ); return( -1 ); } #elif defined( __BORLANDC__ ) && __BORLANDC__ <= 0x0520 ewftools_path_make( find_path, _MAX_PATH, find_drive, find_directory, find_data.ff_name, _SYSTEM_STRING( "" ) ); #else ewftools_path_make( find_path, _MAX_PATH, find_drive, find_directory, find_data.name, _SYSTEM_STRING( "" ) ); #endif find_path_length = system_string_length( find_path ); glob->results[ glob->number_of_results - 1 ] = system_string_allocate( find_path_length + 1 ); if( glob->results[ glob->number_of_results - 1 ] == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create glob result.", function ); return( -1 ); } if( system_string_copy( glob->results[ glob->number_of_results - 1 ], find_path, find_path_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set glob result.", function ); memory_free( glob->results[ glob->number_of_results - 1 ] ); glob->results[ glob->number_of_results - 1 ] = NULL; return( -1 ); } ( glob->results[ glob->number_of_results - 1 ] )[ find_path_length ] = 0; globs_found++; if( globs_found > (int32_t) UINT16_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: too many globs found.", function ); return( -1 ); } } while( ewftools_find_next( find_handle, &find_data ) == 0 ); if( errno != ENOENT ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: error finding next file entry.", function ); return( -1 ); } if( ewftools_find_close( find_handle ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: error closing find handle.", function ); return( -1 ); } } else if( errno != ENOENT ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: error finding file entry.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the glob results * Returns 1 if successful or -1 on error */ int ewftools_glob_get_results( ewftools_glob_t *glob, int *number_of_results, system_character_t ***results, libcerror_error_t **error ) { static char *function = "ewftools_glob_resize"; if( glob == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid glob.", function ); return( -1 ); } if( number_of_results == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of results.", function ); return( -1 ); } if( results == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid results.", function ); return( -1 ); } *number_of_results = glob->number_of_results; *results = glob->results; return( 1 ); } #endif /* !defined( HAVE_GLOB_H ) */ libewf-20140807/ewftools/ewftools_getopt.c0000664000175000017500000001066113440662654022601 0ustar00lordyestalordyesta00000000000000/* * GetOpt functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "ewftools_getopt.h" #include "ewftools_libcnotify.h" #if !defined( HAVE_GETOPT ) /* The option index * Start with argument 1 (argument 0 is the program name) */ int optind = 1; /* The current option argument */ system_character_t *optarg = NULL; /* Value to indicate the current option */ system_integer_t optopt = 0; /* The next option in a group */ system_character_t *next_option = NULL; /* Get the program options * Function for platforms that do not have the getopt function * Returns the option character processed, or -1 on error, * ? if the option was not in the options string, : if the option argument was missing */ system_integer_t ewftools_getopt( int argument_count, system_character_t * const argument_values[], const system_character_t *options_string ) { system_character_t *argument_value = NULL; system_character_t *option_value = NULL; static char *function = "ewftools_getopt"; size_t options_string_length = 0; if( next_option != NULL ) { argument_value = next_option; next_option = NULL; } else if( optind >= argument_count ) { return( (system_integer_t) -1 ); } else { argument_value = argument_values[ optind ]; /* Check if the argument value is not an empty string */ if( *argument_value == (system_character_t) '\0' ) { return( (system_integer_t) -1 ); } /* Check if the first character is a option marker '-' */ if( *argument_value != (system_character_t) '-' ) { return( (system_integer_t) -1 ); } argument_value++; /* Check if long options are provided '--' */ if( *argument_value == (system_character_t) '-' ) { optind++; return( (system_integer_t) -1 ); } } options_string_length = system_string_length( options_string ); optopt = *argument_value; option_value = system_string_search_character( options_string, optopt, options_string_length ); argument_value++; /* Check if an argument was specified or that the option was not found * in the option string */ if( ( optopt == (system_integer_t) ':' ) || ( option_value == NULL ) ) { if( *argument_value == (system_character_t) '\0' ) { optind++; } if( ( *options_string != (system_character_t) ':' ) && ( optopt != (system_integer_t) '?' ) ) { libcnotify_printf( "%s: no such option: %" PRIc_SYSTEM ".\n", function, optopt ); } return( (system_integer_t) '?' ); } option_value++; /* Check if no option argument is required */ if( *option_value != (system_character_t) ':' ) { optarg = NULL; if( *argument_value == (system_character_t) '\0' ) { optind++; } else { /* Multiple options are grouped */ next_option = argument_value; } } /* Check if the argument is right after the option flag with no space in between */ else if( *argument_value != (system_character_t) '\0' ) { optarg = argument_value; optind++; } else { optind++; /* Check if the argument was provided as the next argument value */ if( argument_count <= optind ) { if( *option_value == ':' ) { return( (system_integer_t) ':' ); } libcnotify_printf( "%s: option: %" PRIc_SYSTEM " requires an argument.\n", function, optopt ); return( (system_integer_t) '?' ); } optarg = argument_values[ optind ]; optind++; } return( optopt ); } #endif /* !defined( HAVE_GETOPT ) */ libewf-20140807/ewftools/platform.c0000664000175000017500000001401213421020222021145 0ustar00lordyestalordyesta00000000000000/* * Platform functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #if defined( HAVE_SYS_UTSNAME_H ) #include #endif #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libuna.h" #include "platform.h" #if !defined( LIBEWF_OPERATING_SYSTEM ) #define LIBEWF_OPERATING_SYSTEM "Unknown" #endif /* Determines the operating system string * Returns 1 if successful or -1 on error */ int platform_get_operating_system( system_character_t *operating_system_string, size_t operating_system_string_size, libcerror_error_t **error ) { #if defined( HAVE_UNAME ) && !defined( WINAPI ) struct utsname utsname_buffer; #endif char *operating_system = NULL; static char *function = "platform_get_operating_system"; size_t operating_system_size = 0; #if defined( WINAPI ) DWORD windows_version = 0; DWORD windows_major_version = 0; DWORD windows_minor_version = 0; /* DWORD windows_build_number = 0; */ #endif if( operating_system_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid operating system string.", function ); return( -1 ); } #if defined( WINAPI ) operating_system = "Windows"; windows_version = GetVersion(); windows_major_version = (DWORD) ( LOBYTE( LOWORD( windows_version ) ) ); windows_minor_version = (DWORD) ( HIBYTE( LOWORD( windows_version ) ) ); /* if( windows_version < 0x80000000 ) { windows_build_number = (DWORD)( HIWORD( windows_version ) ); } */ if( windows_major_version == 3 ) { if( windows_version < 0x80000000 ) { if( windows_minor_version == 51 ) { operating_system = "Windows NT 3.51"; } } } else if( windows_major_version == 4 ) { if( windows_version < 0x80000000 ) { if( windows_minor_version == 0 ) { operating_system = "Windows NT 4"; } } else { if( windows_minor_version == 0 ) { operating_system = "Windows 95"; } else if( windows_minor_version == 10 ) { operating_system = "Windows 98"; } else if( windows_minor_version == 90 ) { operating_system = "Windows ME"; } } } else if( windows_major_version == 5 ) { if( windows_version < 0x80000000 ) { if( windows_minor_version == 0 ) { operating_system = "Windows 2000"; } else if( windows_minor_version == 1 ) { operating_system = "Windows XP"; } else if( windows_minor_version == 2 ) { operating_system = "Windows 2003"; } } } else if( windows_major_version == 6 ) { if( windows_version < 0x80000000 ) { if( windows_minor_version == 0 ) { operating_system = "Windows Vista/2008"; } else if( windows_minor_version == 1 ) { operating_system = "Windows 7"; } } } #elif defined( HAVE_UNAME ) /* Determine the operating system */ if( uname( &utsname_buffer ) == 0 ) { operating_system = utsname_buffer.sysname; } else { operating_system = "Undetermined"; } #else /* Have configure determine the operating system */ operating_system = LIBEWF_OPERATING_SYSTEM; #endif operating_system_size = 1 + narrow_string_length( operating_system ); if( operating_system_string_size < operating_system_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: operating system string too small.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if SIZEOF_WCHAR_T == 4 if( libuna_utf32_string_copy_from_utf8( (libuna_utf32_character_t *) operating_system_string, operating_system_string_size, (libuna_utf8_character_t *) operating_system, operating_system_size, error ) != 1 ) #elif SIZEOF_WCHAR_T == 2 if( libuna_utf16_string_copy_from_utf8( (libuna_utf16_character_t *) operating_system_string, operating_system_string_size, (libuna_utf8_character_t *) operating_system, operating_system_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set string.", function ); return( -1 ); } #else if( libclocale_codepage == 0 ) { if( operating_system_string_size < operating_system_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string too small.", function ); return( -1 ); } if( memory_copy( operating_system_string, operating_system, operating_system_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set string.", function ); return( -1 ); } } else { if( libuna_byte_stream_copy_from_utf8( (uint8_t *) operating_system_string, operating_system_string_size, libclocale_codepage, (libuna_utf8_character_t *) operating_system, operating_system_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set string.", function ); return( -1 ); } } #endif return( 1 ); } libewf-20140807/ewftools/ewfacquirestream.c0000664000175000017500000013064313421037364022720 0ustar00lordyestalordyesta00000000000000/* * Reads data from a stdin and writes it in EWF format * * 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 . */ #include #include #include #include #include #include #include #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif #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" #include "ewftools_getopt.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "imaging_handle.h" #include "log_handle.h" #include "process_status.h" #include "storage_media_buffer.h" imaging_handle_t *ewfacquirestream_imaging_handle = NULL; int ewfacquirestream_abort = 0; /* Prints the executable usage information to the stream */ void usage_fprint( FILE *stream ) { 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; if( stream == NULL ) { return; } result = byte_size_string_create( default_segment_file_size_string, 16, EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); if( result == 1 ) { result = byte_size_string_create( minimum_segment_file_size_string, 16, EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { result = byte_size_string_create( maximum_32bit_segment_file_size_string, 16, EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } if( result == 1 ) { result = byte_size_string_create( maximum_64bit_segment_file_size_string, 16, EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); } fprintf( stream, "Use ewfacquirestream to acquire data from a pipe and store it in the EWF format\n" "(Expert Witness Compression Format).\n\n" ); fprintf( stream, "Usage: ewfacquirestream [ -A codepage ] [ -b number_of_sectors ]\n" " [ -B number_of_bytes ] [ -c compression_values ]\n" " [ -C case_number ] [ -d digest_type ]\n" " [ -D description ] [ -e examiner_name ]\n" " [ -E evidence_number ] [ -f format ]\n" " [ -l log_filename ] [ -m media_type ]\n" " [ -M media_flags ] [ -N notes ]\n" " [ -o offset ] [ -p process_buffer_size ]\n" " [ -P bytes_per_sector ] [ -S segment_file_size ]\n" " [ -t target ] [ -2 secondary_target ]\n" " [ -hqsvVx ]\n\n" ); fprintf( stream, "\tReads data from stdin\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-b: specify the number of sectors to read at once (per chunk), options:\n" "\t 16, 32, 64 (default), 128, 256, 512, 1024, 2048, 4096, 8192, 16384\n" "\t or 32768\n" ); fprintf( stream, "\t-B: specify the number of bytes to acquire (default is all bytes)\n" ); fprintf( stream, "\t-c: specify the compression values as: level or method:level\n" "\t compression method options: deflate (default), bzip2\n" "\t (bzip2 is only supported by EWF2 formats)\n" "\t compression level options: none (default), empty-block,\n" "\t fast or best\n" ); fprintf( stream, "\t-C: specify the case number (default is case_number).\n" ); fprintf( stream, "\t-d: calculate additional digest (hash) types besides md5, options:\n" "\t sha1, sha256\n" ); fprintf( stream, "\t-D: specify the description (default is description).\n" ); fprintf( stream, "\t-e: specify the examiner name (default is examiner_name).\n" ); fprintf( stream, "\t-E: specify the evidence number (default is evidence_number).\n" ); fprintf( stream, "\t-f: specify the EWF file format to write to, options: ftk, encase2,\n" "\t encase3, encase4, encase5, encase6 (default), encase7, linen5,\n" "\t linen6, linen7, ewfx\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-l: logs acquiry errors and the digest (hash) to the log_filename\n" ); fprintf( stream, "\t-m: specify the media type, options: fixed (default), removable,\n" "\t optical, memory\n" ); fprintf( stream, "\t-M: specify the media flags, options: logical, physical (default)\n" ); fprintf( stream, "\t-N: specify the notes (default is notes).\n" ); fprintf( stream, "\t-o: specify the offset to start to acquire (default is 0)\n" ); fprintf( stream, "\t-p: specify the process buffer size (default is the chunk size)\n" ); fprintf( stream, "\t-P: specify the number of bytes per sector (default is 512)\n" ); fprintf( stream, "\t-q: quiet shows minimal status information\n" ); fprintf( stream, "\t-s: swap byte pairs of the media data (from AB to BA)\n" "\t (use this for big to little endian conversion and vice versa)\n" ); if( result == 1 ) { 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, maximum_32bit_segment_file_size_string ); } else { fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIu32 ")\n" "\t (minimum is %" PRIu32 ", maximum is %" PRIu64 " for encase6 and\n" "\t encase7 format and %" PRIu32 " for other formats)\n", (uint32_t) EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE, (uint32_t) EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT, (uint32_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ); } fprintf( stream, "\t-t: specify the target file (without extension) to write to (default\n" "\t is image)\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); fprintf( stream, "\t-x: use the chunk data instead of the buffered read and write functions.\n" ); fprintf( stream, "\t-2: specify the secondary target file (without extension) to write to\n" ); } /* Signal handler for ewfacquire */ void ewfacquirestream_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfacquirestream_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfacquirestream_abort = 1; if( ewfacquirestream_imaging_handle != NULL ) { if( imaging_handle_signal_abort( ewfacquirestream_imaging_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal imaging handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* Reads a chunk of data from the file descriptor into the buffer * Returns the number of bytes read, 0 if at end of input or -1 on error */ ssize_t ewfacquirestream_read_chunk( libewf_handle_t *handle, int input_file_descriptor, uint8_t *buffer, size_t buffer_size, size32_t chunk_size, ssize64_t total_read_count, uint8_t read_error_retries, libcerror_error_t **error ) { static char *function = "ewfacquirestream_read_chunk"; ssize_t read_count = 0; ssize_t buffer_offset = 0; size_t read_size = 0; size_t bytes_to_read = 0; int32_t read_number_of_errors = 0; uint32_t read_error_offset = 0; if( handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid handle.", function ); return( -1 ); } if( input_file_descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid input file descriptor.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid chunk size value zero or less.", function ); return( -1 ); } if( total_read_count <= -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid total read count value less than zero.", function ); return( -1 ); } while( buffer_size > 0 ) { /* Determine the number of bytes to read from the input * Read as much as possible in chunk sizes */ if( buffer_size < (size_t) chunk_size ) { read_size = buffer_size; } else { read_size = chunk_size; } bytes_to_read = read_size; while( read_number_of_errors <= read_error_retries ) { #if defined( WINAPI ) && !defined( __CYGWIN__ ) read_count = _read( input_file_descriptor, &( buffer[ buffer_offset + read_error_offset ] ), bytes_to_read ); #else read_count = read( input_file_descriptor, &( buffer[ buffer_offset + read_error_offset ] ), bytes_to_read ); #endif #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: read buffer at: %" PRIu64 " of size: %" PRIzd ".\n", function, total_read_count, read_count ); } #endif if( read_count <= -1 ) { if( ( errno == ESPIPE ) || ( errno == EPERM ) || ( errno == ENXIO ) || ( errno == ENODEV ) ) { if( errno == ESPIPE ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading data: invalid seek.", function ); } else if( errno == EPERM ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading data: operation not permitted.", function ); } else if( errno == ENXIO ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading data: no such device or address.", function ); } else if( errno == ENODEV ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading data: no such device.", function ); } else { libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, errno, "%s: error reading data.", function ); } return( -1 ); } } else { /* The last read is OK, correct read_count */ if( read_count == (ssize_t) bytes_to_read ) { read_count = read_error_offset + bytes_to_read; } /* The entire read is OK */ if( read_count == (ssize_t) read_size ) { break; } /* If no end of input can be determined */ /* If some bytes were read it is possible that the end of the input reached */ if( read_count > 0 ) { return( (ssize32_t) ( buffer_offset + read_count ) ); } /* No bytes were read */ if( read_count == 0 ) { return( 0 ); } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: read error at offset %" PRIjd " after reading %" PRIzd " bytes.\n", function, total_read_count, read_count ); } #endif /* There was a read error at a certain offset */ read_error_offset += (uint32_t) read_count; bytes_to_read -= read_count; } read_number_of_errors++; if( read_number_of_errors > read_error_retries ) { return( 0 ); } } buffer_size -= read_count; buffer_offset += read_count; /* At the end of the input */ if( ewfacquirestream_abort != 0 ) { break; } } return( buffer_offset ); } /* Reads the input * Returns 1 if successful or -1 on error */ int ewfacquirestream_read_input( imaging_handle_t *imaging_handle, int input_file_descriptor, uint8_t swap_byte_pairs, uint8_t read_error_retries, uint8_t print_status_information, uint8_t use_chunk_data_functions, log_handle_t *log_handle, libcerror_error_t **error ) { process_status_t *process_status = NULL; storage_media_buffer_t *storage_media_buffer = NULL; uint8_t *data = NULL; static char *function = "ewfacquirestream_read_input"; size64_t acquiry_count = 0; size32_t chunk_size = 0; size_t data_size = 0; size_t process_buffer_size = 0; size_t read_size = 0; ssize_t read_count = 0; ssize_t process_count = 0; ssize_t write_count = 0; uint8_t storage_media_buffer_mode = 0; int status = PROCESS_STATUS_COMPLETED; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->process_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid imaging handle - process buffer size value exceeds maximum.", function ); return( -1 ); } if( input_file_descriptor == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file descriptor.", function ); return( -1 ); } if( imaging_handle_get_chunk_size( imaging_handle, &chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); goto on_error; } if( chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing chunk size.", function ); return( -1 ); } if( use_chunk_data_functions != 0 ) { process_buffer_size = (size_t) chunk_size; storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA; } else { if( imaging_handle->process_buffer_size == 0 ) { process_buffer_size = (size_t) chunk_size; } else { process_buffer_size = imaging_handle->process_buffer_size; } storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_BUFFERED; } if( storage_media_buffer_initialize( &storage_media_buffer, storage_media_buffer_mode, process_buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create storage media buffer.", function ); goto on_error; } if( imaging_handle_initialize_integrity_hash( imaging_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize integrity hash(es).", function ); goto on_error; } if( process_status_initialize( &process_status, _SYSTEM_STRING( "Acquiry" ), _SYSTEM_STRING( "acquired" ), _SYSTEM_STRING( "Written" ), stdout, print_status_information, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create process status.", function ); goto on_error; } if( process_status_start( process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to start process status.", function ); goto on_error; } while( ( imaging_handle->acquiry_size == 0 ) || ( acquiry_count < (size64_t) imaging_handle->acquiry_size ) ) { read_size = process_buffer_size; /* Align with acquiry offset if necessary */ if( ( imaging_handle->acquiry_offset != 0 ) && ( imaging_handle->acquiry_offset < (uint64_t) read_size ) ) { read_size = (size_t) imaging_handle->acquiry_offset; } else if( ( imaging_handle->acquiry_size != 0 ) && ( ( (size64_t) imaging_handle->acquiry_size - acquiry_count ) < (size64_t) read_size ) ) { read_size = (size_t) ( (ssize64_t) imaging_handle->acquiry_size - acquiry_count ); } /* Read a chunk from the file descriptor */ read_count = ewfacquirestream_read_chunk( imaging_handle->output_handle, input_file_descriptor, storage_media_buffer->raw_buffer, storage_media_buffer->raw_buffer_size, (size32_t) read_size, acquiry_count, read_error_retries, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: error reading data from input.", function ); goto on_error; } if( read_count == 0 ) { break; } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->data_in_compression_buffer = 0; } storage_media_buffer->raw_buffer_data_size = (size_t) read_count; /* Skip a certain number of bytes if necessary */ if( (size64_t) imaging_handle->acquiry_offset > acquiry_count ) { imaging_handle->acquiry_offset -= read_count; continue; } /* Swap byte pairs */ if( swap_byte_pairs == 1 ) { if( imaging_handle_swap_byte_pairs( imaging_handle, storage_media_buffer, read_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to swap byte pairs.", function ); goto on_error; } } /* Digest hashes are calcultated after swap */ if( storage_media_buffer_get_data( storage_media_buffer, &data, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve storage media buffer data.", function ); goto on_error; } if( imaging_handle_update_integrity_hash( imaging_handle, data, read_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to update integrity hash(es).", function ); goto on_error; } process_count = imaging_handle_prepare_write_buffer( imaging_handle, storage_media_buffer, error ); if( process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare buffer before write.", function ); goto on_error; } write_count = imaging_handle_write_buffer( imaging_handle, storage_media_buffer, process_count, error ); if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data to file.", function ); goto on_error; } acquiry_count += read_count; if( process_status_update_unknown_total( process_status, acquiry_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update process status.", function ); goto on_error; } if( ewfacquirestream_abort != 0 ) { break; } } if( storage_media_buffer_free( &storage_media_buffer, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free storage media buffer.", function ); goto on_error; } if( imaging_handle_finalize_integrity_hash( imaging_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize integrity hash(es).", function ); goto on_error; } write_count = imaging_handle_finalize( imaging_handle, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize write.", function ); goto on_error; } acquiry_count += write_count; if( ewfacquirestream_abort != 0 ) { status = PROCESS_STATUS_ABORTED; } if( process_status_stop( process_status, acquiry_count, status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to stop process status.", function ); goto on_error; } if( process_status_free( &process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free process status.", function ); goto on_error; } if( ewfacquirestream_abort == 0 ) { if( imaging_handle_print_hashes( imaging_handle, imaging_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hashes.", function ); goto on_error; } if( log_handle != NULL ) { if( imaging_handle_print_hashes( imaging_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print hashes in log handle.", function ); goto on_error; } } } return( 1 ); on_error: if( process_status != NULL ) { process_status_stop( process_status, (size64_t) write_count, PROCESS_STATUS_FAILED, NULL ); process_status_free( &process_status, NULL ); } if( storage_media_buffer != NULL ) { storage_media_buffer_free( &storage_media_buffer, NULL ); } return( -1 ); } /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { libcerror_error_t *error = 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_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; system_integer_t option = 0; size_t string_length = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t read_error_retries = 2; uint8_t resume_acquiry = 0; uint8_t swap_byte_pairs = 0; uint8_t use_chunk_data_functions = 0; uint8_t verbose = 0; int result = 0; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } #if defined( WINAPI ) && !defined( __CYGWIN__ ) #if defined( _MSC_VER ) if( _setmode( _fileno( stdin ), _O_BINARY ) == -1 ) #else if( setmode( _fileno( stdin ), _O_BINARY ) == -1 ) #endif { ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Unable to set stdin to binary mode.\n" ); usage_fprint( stdout ); goto on_error; } #endif while( ( option = ewftools_getopt( argc, argv, _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 (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( stdout ); goto on_error; case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; case (system_integer_t) 'B': option_size = optarg; break; case (system_integer_t) 'c': option_compression_values = optarg; break; case (system_integer_t) 'C': option_case_number = optarg; break; case (system_integer_t) 'd': option_additional_digest_types = optarg; break; case (system_integer_t) 'D': option_description = optarg; break; case (system_integer_t) 'e': option_examiner_name = optarg; break; case (system_integer_t) 'E': option_evidence_number = optarg; break; case (system_integer_t) 'f': option_format = optarg; break; case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); usage_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'l': log_filename = optarg; break; case (system_integer_t) 'm': option_media_type = optarg; break; case (system_integer_t) 'M': option_media_flags = optarg; break; case (system_integer_t) 'N': option_notes = optarg; break; case (system_integer_t) 'o': option_offset = optarg; break; case (system_integer_t) 'p': option_process_buffer_size = optarg; break; case (system_integer_t) 'P': option_bytes_per_sector = optarg; break; case (system_integer_t) 'q': print_status_information = 0; break; case (system_integer_t) 's': swap_byte_pairs = 1; break; case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; case (system_integer_t) 't': option_target_filename = optarg; break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'x': use_chunk_data_functions = 1; break; case (system_integer_t) '2': option_secondary_target_filename = optarg; break; } } ewftools_output_version_fprint( stdout, program ); libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif if( ( option_target_filename != NULL ) && ( option_secondary_target_filename != NULL ) ) { string_length = system_string_length( option_secondary_target_filename ); if( system_string_length( option_target_filename ) == string_length ) { if( system_string_compare( option_target_filename, option_secondary_target_filename, string_length ) == 0 ) { fprintf( stderr, "Primary and secondary target cannot be the same.\n" ); goto on_error; } } } if( imaging_handle_initialize( &ewfacquirestream_imaging_handle, calculate_md5, use_chunk_data_functions, &error ) != 1 ) { fprintf( stderr, "Unable to create imaging handle.\n" ); goto on_error; } if( option_header_codepage != NULL ) { result = imaging_handle_set_header_codepage( ewfacquirestream_imaging_handle, option_header_codepage, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set header codepage.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); } } if( option_target_filename != NULL ) { if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_target_filename, &( ewfacquirestream_imaging_handle->target_filename ), &( ewfacquirestream_imaging_handle->target_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target filename.\n" ); goto on_error; } } else { /* Make sure the target filename is set */ if( imaging_handle_set_string( ewfacquirestream_imaging_handle, _SYSTEM_STRING( "image" ), &( ewfacquirestream_imaging_handle->target_filename ), &( ewfacquirestream_imaging_handle->target_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target filename.\n" ); goto on_error; } } if( option_secondary_target_filename != NULL ) { if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_secondary_target_filename, &( ewfacquirestream_imaging_handle->secondary_target_filename ), &( ewfacquirestream_imaging_handle->secondary_target_filename_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set secondary target filename.\n" ); goto on_error; } } if( option_case_number == NULL ) { option_case_number = _SYSTEM_STRING( "case_number" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_case_number, &( ewfacquirestream_imaging_handle->case_number ), &( ewfacquirestream_imaging_handle->case_number_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set case number.\n" ); goto on_error; } if( option_description == NULL ) { option_description = _SYSTEM_STRING( "description" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_description, &( ewfacquirestream_imaging_handle->description ), &( ewfacquirestream_imaging_handle->description_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set description.\n" ); goto on_error; } if( option_evidence_number == NULL ) { option_evidence_number = _SYSTEM_STRING( "evidence_number" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_evidence_number, &( ewfacquirestream_imaging_handle->evidence_number ), &( ewfacquirestream_imaging_handle->evidence_number_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set evidence number.\n" ); goto on_error; } if( option_examiner_name == NULL ) { option_examiner_name = _SYSTEM_STRING( "examiner_name" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_examiner_name, &( ewfacquirestream_imaging_handle->examiner_name ), &( ewfacquirestream_imaging_handle->examiner_name_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set examiner name.\n" ); goto on_error; } if( option_notes == NULL ) { option_notes = _SYSTEM_STRING( "notes" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, option_notes, &( ewfacquirestream_imaging_handle->notes ), &( ewfacquirestream_imaging_handle->notes_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set notes.\n" ); goto on_error; } if( option_format != NULL ) { result = imaging_handle_set_format( ewfacquirestream_imaging_handle, option_format, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set format.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfacquirestream_imaging_handle->ewf_format == LIBEWF_FORMAT_EWF ) || ( ewfacquirestream_imaging_handle->ewf_format == LIBEWF_FORMAT_ENCASE1 ) || ( ewfacquirestream_imaging_handle->ewf_format == LIBEWF_FORMAT_SMART ) ) { ewfacquirestream_imaging_handle->ewf_format = LIBEWF_FORMAT_ENCASE6; fprintf( stderr, "Unsupported EWF format defaulting to: encase6.\n" ); } } if( option_compression_values != NULL ) { result = imaging_handle_set_compression_values( ewfacquirestream_imaging_handle, option_compression_values, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set compression values.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported compression values defaulting to method: deflate with level: none.\n" ); } } if( option_media_type != NULL ) { result = imaging_handle_set_media_type( ewfacquirestream_imaging_handle, option_media_type, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set media type.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported media type defaulting to: fixed.\n" ); } } if( option_media_flags != NULL ) { result = imaging_handle_set_media_flags( ewfacquirestream_imaging_handle, option_media_flags, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set media flags.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported media flags defaulting to: physical.\n" ); } } if( option_bytes_per_sector != NULL ) { result = imaging_handle_set_bytes_per_sector( ewfacquirestream_imaging_handle, option_bytes_per_sector, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set bytes per sector.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported bytes per sector defaulting to: %" PRIu32 ".\n", ewfacquirestream_imaging_handle->bytes_per_sector ); } } if( option_sectors_per_chunk != NULL ) { result = imaging_handle_set_sectors_per_chunk( ewfacquirestream_imaging_handle, option_sectors_per_chunk, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set sectors per chunk.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported sectors per chunk defaulting to: %" PRIu32 ".\n", ewfacquirestream_imaging_handle->sectors_per_chunk ); } } if( option_maximum_segment_size != NULL ) { result = imaging_handle_set_maximum_segment_size( ewfacquirestream_imaging_handle, option_maximum_segment_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set maximum segment size.\n" ); goto on_error; } else if( result == 0 ) { ewfacquirestream_imaging_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; fprintf( stderr, "Unsupported maximum segment size defaulting to: %" PRIu64 ".\n", ewfacquirestream_imaging_handle->maximum_segment_size ); } } if( option_offset != NULL ) { result = imaging_handle_set_acquiry_offset( ewfacquirestream_imaging_handle, option_offset, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set acquiry offset.\n" ); goto on_error; } else if( result == 0 ) { ewfacquirestream_imaging_handle->acquiry_offset = 0; fprintf( stderr, "Unsupported acquiry offset defaulting to: 0.\n" ); } } if( option_size != NULL ) { result = imaging_handle_set_acquiry_size( ewfacquirestream_imaging_handle, option_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set acquiry size.\n" ); goto on_error; } else if( result == 0 ) { ewfacquirestream_imaging_handle->acquiry_size = 0; fprintf( stderr, "Unsupported acquiry size defaulting to: all bytes.\n" ); } } if( option_process_buffer_size != NULL ) { result = imaging_handle_set_process_buffer_size( ewfacquirestream_imaging_handle, option_process_buffer_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set process buffer size.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported process buffer size defaulting to: chunk size.\n" ); } } if( option_additional_digest_types != NULL ) { result = imaging_handle_set_additional_digest_types( ewfacquirestream_imaging_handle, option_additional_digest_types, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set additional digest types.\n" ); goto on_error; } } fprintf( stdout, "Using the following acquiry parameters:\n" ); if( imaging_handle_print_parameters( ewfacquirestream_imaging_handle, 0, read_error_retries, 0, 0, &error ) != 1 ) { fprintf( stderr, "Unable to print acquiry parameters.\n" ); goto on_error; } if( imaging_handle_open_output( ewfacquirestream_imaging_handle, ewfacquirestream_imaging_handle->target_filename, resume_acquiry, &error ) != 1 ) { fprintf( stderr, "Unable to open output.\n" ); goto on_error; } if( ewfacquirestream_imaging_handle->secondary_target_filename != NULL ) { if( imaging_handle_open_secondary_output( ewfacquirestream_imaging_handle, ewfacquirestream_imaging_handle->secondary_target_filename, resume_acquiry, &error ) != 1 ) { fprintf( stderr, "Unable to open secondary output.\n" ); goto on_error; } } if( imaging_handle_set_output_values( ewfacquirestream_imaging_handle, program, _SYSTEM_STRING( LIBEWF_VERSION_STRING ), NULL, NULL, &error ) != 1 ) { fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } if( ewftools_signal_attach( ewfacquirestream_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_filename != NULL ) { if( log_handle_initialize( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to create log handle.\n" ); goto on_error; } if( log_handle_open( log_handle, log_filename, &error ) != 1 ) { fprintf( stderr, "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } } result = ewfacquirestream_read_input( ewfacquirestream_imaging_handle, 0, swap_byte_pairs, read_error_retries, print_status_information, use_chunk_data_functions, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to read input.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { if( log_handle_close( log_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close log handle.\n" ); goto on_error; } if( log_handle_free( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free log handle.\n" ); goto on_error; } } if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( imaging_handle_close( ewfacquirestream_imaging_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close output.\n" ); goto on_error; } if( imaging_handle_free( &ewfacquirestream_imaging_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free imaging handle.\n" ); goto on_error; } if( ewfacquirestream_abort != 0 ) { fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } if( result != 1 ) { fprintf( stdout, "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { log_handle_close( log_handle, NULL ); log_handle_free( &log_handle, NULL ); } if( ewfacquirestream_imaging_handle != NULL ) { imaging_handle_close( ewfacquirestream_imaging_handle, NULL ); imaging_handle_free( &ewfacquirestream_imaging_handle, NULL ); } return( EXIT_FAILURE ); } libewf-20140807/ewftools/ewfrecover.c0000664000175000017500000004027613421037364021522 0ustar00lordyestalordyesta00000000000000/* * Exports corrupt EWF files to new files * * 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 . */ #include #include #include #include #include #if defined( HAVE_SYS_RESOURCE_H ) #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 #include "ewfcommon.h" #include "ewfinput.h" #include "ewftools_getopt.h" #include "ewftools_glob.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "export_handle.h" #include "log_handle.h" #include "platform.h" #include "storage_media_buffer.h" #define EWFRECOVER_INPUT_BUFFER_SIZE 64 export_handle_t *ewfrecover_export_handle = NULL; int ewfrecover_abort = 0; /* Prints the executable usage information to the stream */ void usage_fprint( FILE *stream ) { if( stream == NULL ) { return; } fprintf( stream, "Use ewfrecover to recover data from corrupt EWF (Expert Witness\n" "Compression Format) files.\n\n" ); fprintf( stream, "Usage: ewfrecover [ -A codepage ]\n" " [ -l log_filename ]\n" " [ -p process_buffer_size ]\n" " [ -t target ] [ -hquvVx ] ewf_files\n\n" ); fprintf( stream, "\tewf_files: the first or the entire set of EWF segment files\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-l: logs recover errors and the digest (hash) to the\n" "\t log_filename\n" ); fprintf( stream, "\t-p: specify the process buffer size (default is the chunk size)\n" ); fprintf( stream, "\t-q: quiet shows minimal status information\n" ); fprintf( stream, "\t-t: specify the target file to recover to (default is recover)\n" ); fprintf( stream, "\t-u: unattended mode (disables user interaction)\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); fprintf( stream, "\t-x: use the chunk data instead of the buffered read and write\n" "\t functions.\n" ); } /* Signal handler for ewfrecover */ void ewfrecover_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfrecover_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfrecover_abort = 1; if( ewfrecover_export_handle != NULL ) { if( export_handle_signal_abort( ewfrecover_export_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal export handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* The main program */ #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( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif system_character_t acquiry_operating_system[ 32 ]; system_character_t * const *argv_filenames = NULL; libcerror_error_t *error = NULL; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif 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; system_integer_t option = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t use_chunk_data_functions = 0; uint8_t verbose = 0; int number_of_filenames = 0; int result = 1; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } #if defined( WINAPI ) && !defined( __CYGWIN__ ) #if defined( _MSC_VER ) if( _setmode( _fileno( stdout ), _O_BINARY ) == -1 ) #else if( setmode( _fileno( stdout ), _O_BINARY ) == -1 ) #endif { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to set stdout to binary mode.\n" ); usage_fprint( stdout ); goto on_error; } #endif while( ( option = ewftools_getopt( argc, argv, _SYSTEM_STRING( "A:f:hl:p:qt:uvVx" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); usage_fprint( stderr ); goto on_error; case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'h': ewftools_output_version_fprint( stderr, program ); usage_fprint( stderr ); return( EXIT_SUCCESS ); case (system_integer_t) 'l': log_filename = optarg; break; case (system_integer_t) 'p': option_process_buffer_size = optarg; break; case (system_integer_t) 'q': print_status_information = 0; break; case (system_integer_t) 't': option_target_path = optarg; break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_version_fprint( stderr, program ); ewftools_output_copyright_fprint( stderr ); return( EXIT_SUCCESS ); case (system_integer_t) 'x': use_chunk_data_functions = 1; break; } } if( optind == argc ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Missing EWF image file(s).\n" ); usage_fprint( stderr ); goto on_error; } ewftools_output_version_fprint( stderr, program ); libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif #if !defined( HAVE_GLOB_H ) if( ewftools_glob_initialize( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to initialize glob.\n" ); goto on_error; } if( ewftools_glob_resolve( glob, &( argv[ optind ] ), argc - optind, &error ) != 1 ) { fprintf( stderr, "Unable to resolve glob.\n" ); goto on_error; } if( ewftools_glob_get_results( glob, &number_of_filenames, (system_character_t ***) &argv_filenames, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve glob results.\n" ); goto on_error; } #else argv_filenames = &( argv[ optind ] ); number_of_filenames = argc - optind; #endif if( export_handle_initialize( &ewfrecover_export_handle, calculate_md5, use_chunk_data_functions, &error ) != 1 ) { fprintf( stderr, "Unable to create export handle.\n" ); goto on_error; } #if defined( HAVE_GETRLIMIT ) if( getrlimit( RLIMIT_NOFILE, &limit_data ) != 0 ) { fprintf( stderr, "Unable to determine limit: number of open file descriptors.\n" ); } if( limit_data.rlim_max > (rlim_t) INT_MAX ) { limit_data.rlim_max = (rlim_t) INT_MAX; } if( limit_data.rlim_max > 0 ) { limit_data.rlim_max /= 2; } if( export_handle_set_maximum_number_of_open_handles( ewfrecover_export_handle, (int) limit_data.rlim_max, &error ) != 1 ) { fprintf( stderr, "Unable to set maximum number of open file handles.\n" ); goto on_error; } #endif if( ewftools_signal_attach( ewfrecover_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } result = export_handle_open_input( ewfrecover_export_handle, argv_filenames, number_of_filenames, &error ); if( ewfrecover_abort != 0 ) { goto on_abort; } if( result != 1 ) { fprintf( stderr, "Unable to open EWF file(s).\n" ); goto on_error; } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_free( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } #endif result = export_handle_input_is_corrupted( ewfrecover_export_handle, &error ); if( result == -1 ) { fprintf( stderr, "Unable to determine if EWF file(s) are corrupted.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "EWF file(s) are not corrupted.\n" ); goto on_error; } ewfrecover_export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_EWF; ewfrecover_export_handle->export_size = ewfrecover_export_handle->input_media_size; if( option_header_codepage != NULL ) { result = export_handle_set_header_codepage( ewfrecover_export_handle, option_header_codepage, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set header codepage.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); } } if( option_target_path != NULL ) { if( export_handle_set_string( ewfrecover_export_handle, option_target_path, &( ewfrecover_export_handle->target_path ), &( ewfrecover_export_handle->target_path_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target path.\n" ); goto on_error; } } else { /* Make sure the target filename is set in unattended mode */ if( export_handle_set_string( ewfrecover_export_handle, _SYSTEM_STRING( "recover" ), &( ewfrecover_export_handle->target_path ), &( ewfrecover_export_handle->target_path_size ), &error ) != 1 ) { fprintf( stderr, "Unable to set target filename.\n" ); goto on_error; } } if( option_process_buffer_size != NULL ) { result = export_handle_set_process_buffer_size( ewfrecover_export_handle, option_process_buffer_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set process buffer size.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfrecover_export_handle->process_buffer_size > (size_t) SSIZE_MAX ) ) { ewfrecover_export_handle->process_buffer_size = 0; fprintf( stderr, "Unsupported process buffer size defaulting to: chunk size.\n" ); } } /* Initialize values */ if( log_filename != NULL ) { if( log_handle_initialize( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to create log handle.\n" ); goto on_error; } if( log_handle_open( log_handle, log_filename, &error ) != 1 ) { fprintf( stderr, "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } } if( export_handle_open_output( ewfrecover_export_handle, ewfrecover_export_handle->target_path, &error ) != 1 ) { fprintf( stderr, "Unable to open output.\n" ); goto on_error; } if( platform_get_operating_system( acquiry_operating_system, 32, &error ) != 1 ) { fprintf( stderr, "Unable to determine operating system.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); acquiry_operating_system[ 0 ] = 0; } acquiry_software_version = _SYSTEM_STRING( LIBEWF_VERSION_STRING ); if( export_handle_set_output_values( ewfrecover_export_handle, acquiry_operating_system, program, acquiry_software_version, 0, 1, &error ) != 1 ) { fprintf( stderr, "Unable to set output values.\n" ); goto on_error; } result = export_handle_export_input( ewfrecover_export_handle, 0, print_status_information, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to recover input.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { if( log_handle_close( log_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } if( log_handle_free( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free log handle.\n" ); goto on_error; } } on_abort: if( export_handle_close( ewfrecover_export_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close export handle.\n" ); goto on_error; } if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( export_handle_free( &ewfrecover_export_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free export handle.\n" ); goto on_error; } if( ewfrecover_abort != 0 ) { fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } if( result != 1 ) { fprintf( stdout, "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { log_handle_close( log_handle, NULL ); log_handle_free( &log_handle, NULL ); } if( ewfrecover_export_handle != NULL ) { export_handle_close( ewfrecover_export_handle, NULL ); export_handle_free( &ewfrecover_export_handle, NULL ); } #if !defined( HAVE_GLOB_H ) if( glob != NULL ) { ewftools_glob_free( &glob, NULL ); } #endif return( EXIT_FAILURE ); } libewf-20140807/ewftools/mount_dokan.c0000664000175000017500000011042713421020221021645 0ustar00lordyestalordyesta00000000000000/* * Mount tool dokan functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include "ewftools_libcerror.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_unused.h" #include "mount_dokan.h" #include "mount_file_entry.h" #include "mount_handle.h" extern mount_handle_t *ewfmount_mount_handle; #if defined( HAVE_LIBDOKAN ) #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) #define MOUNT_DOKAN_ERROR_BAD_ARGUMENTS -ERROR_BAD_ARGUMENTS #define MOUNT_DOKAN_ERROR_FILE_NOT_FOUND -ERROR_FILE_NOT_FOUND #define MOUNT_DOKAN_ERROR_GENERIC_FAILURE -ERROR_GEN_FAILURE #define MOUNT_DOKAN_ERROR_READ_FAULT -ERROR_READ_FAULT #else #define MOUNT_DOKAN_ERROR_BAD_ARGUMENTS STATUS_UNSUCCESSFUL #define MOUNT_DOKAN_ERROR_FILE_NOT_FOUND STATUS_OBJECT_NAME_NOT_FOUND #define MOUNT_DOKAN_ERROR_GENERIC_FAILURE STATUS_UNSUCCESSFUL #define MOUNT_DOKAN_ERROR_READ_FAULT STATUS_UNEXPECTED_IO_ERROR #endif /* ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) */ /* Sets the values in a file information structure * The time values contain an unsigned 64-bit FILETIME timestamp * Returns 1 if successful or -1 on error */ int mount_dokan_set_file_information( BY_HANDLE_FILE_INFORMATION *file_information, size64_t size, uint16_t file_mode, uint64_t creation_time, uint64_t access_time, uint64_t modification_time, libcerror_error_t **error ) { static char *function = "mount_dokan_set_file_information"; if( file_information == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); return( -1 ); } if( size > 0 ) { file_information->nFileSizeHigh = (DWORD) ( size >> 32 ); file_information->nFileSizeLow = (DWORD) ( size & 0xffffffffUL ); } if( ( file_mode & 0x4000 ) != 0 ) { file_information->dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; } else { file_information->dwFileAttributes = FILE_ATTRIBUTE_NORMAL; } file_information->ftCreationTime.dwLowDateTime = (uint32_t) ( creation_time & 0x00000000ffffffffULL ); file_information->ftCreationTime.dwHighDateTime = creation_time >> 32; file_information->ftLastAccessTime.dwLowDateTime = (uint32_t) ( access_time & 0x00000000ffffffffULL ); file_information->ftLastAccessTime.dwHighDateTime = access_time >> 32; file_information->ftLastWriteTime.dwLowDateTime = (uint32_t) ( modification_time & 0x00000000ffffffffULL ); file_information->ftLastWriteTime.dwHighDateTime = modification_time >> 32; return( 1 ); } /* Sets the values in a find data structure * The time values contain an unsigned 64-bit FILETIME timestamp * Returns 1 if successful or -1 on error */ int mount_dokan_set_find_data( WIN32_FIND_DATAW *find_data, size64_t size, uint16_t file_mode, uint64_t creation_time, uint64_t access_time, uint64_t modification_time, libcerror_error_t **error ) { static char *function = "mount_dokan_set_find_data"; if( find_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid find data.", function ); return( -1 ); } if( size > 0 ) { find_data->nFileSizeHigh = (DWORD) ( size >> 32 ); find_data->nFileSizeLow = (DWORD) ( size & 0xffffffffUL ); } if( ( file_mode & 0x4000 ) != 0 ) { find_data->dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; } else { find_data->dwFileAttributes = FILE_ATTRIBUTE_NORMAL; } find_data->ftCreationTime.dwLowDateTime = (uint32_t) ( creation_time & 0x00000000ffffffffULL ); find_data->ftCreationTime.dwHighDateTime = creation_time >> 32; find_data->ftLastAccessTime.dwLowDateTime = (uint32_t) ( access_time & 0x00000000ffffffffULL ); find_data->ftLastAccessTime.dwHighDateTime = access_time >> 32; find_data->ftLastWriteTime.dwLowDateTime = (uint32_t) ( modification_time & 0x00000000ffffffffULL ); find_data->ftLastWriteTime.dwHighDateTime = modification_time >> 32; return( 1 ); } /* Fills a directory entry * Returns 1 if successful or -1 on error */ int mount_dokan_filldir( PFillFindData fill_find_data, DOKAN_FILE_INFO *file_info, wchar_t *name, size_t name_size, WIN32_FIND_DATAW *find_data, mount_file_entry_t *file_entry, libcerror_error_t **error ) { static char *function = "mount_dokan_filldir"; size64_t file_size = 0; uint64_t access_time = 0; uint64_t creation_time = 0; uint64_t modification_time = 0; uint16_t file_mode = 0; if( fill_find_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid fill find data.", function ); return( -1 ); } if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid name.", function ); return( -1 ); } if( name_size > (size_t) MAX_PATH ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid name size value out of bounds.", function ); return( -1 ); } if( file_entry != NULL ) { if( mount_file_entry_get_size( file_entry, &file_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry size.", function ); return( -1 ); } if( mount_file_entry_get_file_mode( file_entry, &file_mode, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file mode.", function ); return( -1 ); } if( mount_file_entry_get_creation_time( file_entry, &creation_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve creation time.", function ); return( -1 ); } if( mount_file_entry_get_access_time( file_entry, &access_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access time.", function ); return( -1 ); } if( mount_file_entry_get_modification_time( file_entry, &modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve modification time.", function ); return( -1 ); } } if( memory_set( find_data, 0, sizeof( WIN32_FIND_DATAW ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear find data.", function ); return( -1 ); } if( wide_string_copy( find_data->cFileName, name, name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy filename.", function ); return( -1 ); } if( name_size <= (size_t) 14 ) { if( wide_string_copy( find_data->cAlternateFileName, name, name_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy alternate filename.", function ); return( -1 ); } } if( mount_dokan_set_find_data( find_data, file_size, file_mode, creation_time, access_time, modification_time, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set find data.", function ); return( -1 ); } if( fill_find_data( find_data, file_info ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set directory entry.", function ); return( -1 ); } return( 1 ); } #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) /* Opens a file or directory * Returns 0 if successful or an error code otherwise */ int __stdcall mount_dokan_CreateFile( const wchar_t *path, DWORD desired_access, DWORD share_mode EWFTOOLS_ATTRIBUTE_UNUSED, DWORD creation_disposition, DWORD attribute_flags EWFTOOLS_ATTRIBUTE_UNUSED, DOKAN_FILE_INFO *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_dokan_CreateFile"; int result = 0; EWFTOOLS_UNREFERENCED_PARAMETER( share_mode ) EWFTOOLS_UNREFERENCED_PARAMETER( attribute_flags ) #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = -ERROR_BAD_ARGUMENTS; goto on_error; } if( ( desired_access & GENERIC_WRITE ) != 0 ) { return( -ERROR_WRITE_PROTECT ); } /* Ignore the share_mode */ if( creation_disposition == CREATE_NEW ) { return( -ERROR_FILE_EXISTS ); } else if( creation_disposition == CREATE_ALWAYS ) { return( -ERROR_ALREADY_EXISTS ); } else if( creation_disposition == OPEN_ALWAYS ) { return( -ERROR_FILE_NOT_FOUND ); } else if( creation_disposition == TRUNCATE_EXISTING ) { return( -ERROR_FILE_NOT_FOUND ); } else if( creation_disposition != OPEN_EXISTING ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid creation disposition.", function ); result = -ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = -ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info->Context != (ULONG64) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file information - context already set.", function ); result = -ERROR_BAD_ARGUMENTS; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, (mount_file_entry_t **) &( file_info->Context ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %ls.", function, path ); result = -ERROR_FILE_NOT_FOUND; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } #else /* Opens a file or directory * Returns 0 if successful or an error code otherwise */ NTSTATUS __stdcall mount_dokan_ZwCreateFile( const wchar_t *path, DOKAN_IO_SECURITY_CONTEXT *security_context EWFTOOLS_ATTRIBUTE_UNUSED, ACCESS_MASK desired_access, ULONG file_attributes EWFTOOLS_ATTRIBUTE_UNUSED, ULONG share_access EWFTOOLS_ATTRIBUTE_UNUSED, ULONG creation_disposition, ULONG creation_options EWFTOOLS_ATTRIBUTE_UNUSED, DOKAN_FILE_INFO *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_dokan_ZwCreateFile"; int result = 0; EWFTOOLS_UNREFERENCED_PARAMETER( security_context ) EWFTOOLS_UNREFERENCED_PARAMETER( file_attributes ) EWFTOOLS_UNREFERENCED_PARAMETER( share_access ) EWFTOOLS_UNREFERENCED_PARAMETER( creation_options ) if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = STATUS_UNSUCCESSFUL; goto on_error; } if( ( desired_access & GENERIC_WRITE ) != 0 ) { return( STATUS_MEDIA_WRITE_PROTECTED ); } /* Ignore the share_mode */ if( creation_disposition == FILE_CREATE ) { return( STATUS_OBJECT_NAME_COLLISION ); } else if( ( creation_disposition != FILE_OPEN ) && ( creation_disposition != FILE_OPEN_IF ) ) { return( STATUS_ACCESS_DENIED ); } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = STATUS_UNSUCCESSFUL; goto on_error; } if( file_info->Context != (ULONG64) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file information - context already set.", function ); result = STATUS_UNSUCCESSFUL; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, (mount_file_entry_t **) &( file_info->Context ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %ls.", function, path ); result = STATUS_OBJECT_NAME_NOT_FOUND; goto on_error; } return( STATUS_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } #endif /* ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) /* Opens a directory * Returns 0 if successful or an error code otherwise */ int __stdcall mount_dokan_OpenDirectory( const wchar_t *path, DOKAN_FILE_INFO *file_info ) { libcerror_error_t *error = NULL; static char *function = "mount_dokan_OpenDirectory"; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info->Context != (ULONG64) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid file information - context already set.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, (mount_file_entry_t **) &( file_info->Context ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %ls.", function, path ); result = MOUNT_DOKAN_ERROR_FILE_NOT_FOUND; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } #endif /* ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) */ /* Closes a file or direcotry * Returns 0 if successful or an error code otherwise */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) int __stdcall mount_dokan_CloseFile( const wchar_t *path, DOKAN_FILE_INFO *file_info ) #else NTSTATUS __stdcall mount_dokan_CloseFile( const wchar_t *path, DOKAN_FILE_INFO *file_info ) #endif { libcerror_error_t *error = NULL; static char *function = "mount_dokan_CloseFile"; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info->Context != (ULONG64) NULL ) { if( mount_file_entry_free( (mount_file_entry_t **) &( file_info->Context ), &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file entry.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Reads a buffer of data at the specified offset * Returns 0 if successful or an error code otherwise */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) int __stdcall mount_dokan_ReadFile( const wchar_t *path, void *buffer, DWORD number_of_bytes_to_read, DWORD *number_of_bytes_read, LONGLONG offset, DOKAN_FILE_INFO *file_info ) #else NTSTATUS __stdcall mount_dokan_ReadFile( const wchar_t *path, void *buffer, DWORD number_of_bytes_to_read, DWORD *number_of_bytes_read, LONGLONG offset, DOKAN_FILE_INFO *file_info ) #endif { libcerror_error_t *error = NULL; static char *function = "mount_dokan_ReadFile"; ssize_t read_count = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( number_of_bytes_to_read > (DWORD) INT32_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of bytes to read value exceeds maximum.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( number_of_bytes_read == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of bytes read.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file information.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( file_info->Context == (ULONG64) NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid file information - missing context.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } read_count = mount_file_entry_read_buffer_at_offset( (mount_file_entry_t *) file_info->Context, buffer, (size_t) number_of_bytes_to_read, (off64_t) offset, &error ); if( read_count < 0 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read from mount handle.", function ); result = MOUNT_DOKAN_ERROR_READ_FAULT; goto on_error; } if( read_count > (size_t) INT32_MAX ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid read count value exceeds maximum.", function ); result = MOUNT_DOKAN_ERROR_READ_FAULT; goto on_error; } /* Dokan does not require the read function to return ERROR_HANDLE_EOF */ *number_of_bytes_read = (DWORD) read_count; return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } /* Reads a directory * Returns 0 if successful or an error code otherwise */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) int __stdcall mount_dokan_FindFiles( const wchar_t *path, PFillFindData fill_find_data, DOKAN_FILE_INFO *file_info ) #else NTSTATUS __stdcall mount_dokan_FindFiles( const wchar_t *path, PFillFindData fill_find_data, DOKAN_FILE_INFO *file_info ) #endif { WIN32_FIND_DATAW find_data; libcerror_error_t *error = NULL; mount_file_entry_t *file_entry = NULL; mount_file_entry_t *parent_file_entry = NULL; mount_file_entry_t *sub_file_entry = NULL; wchar_t *name = NULL; static char *function = "mount_dokan_FindFiles"; size_t name_size = 0; int number_of_sub_file_entries = 0; int result = 0; int sub_file_entry_index = 0; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, &file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %ls.", function, path ); result = MOUNT_DOKAN_ERROR_FILE_NOT_FOUND; goto on_error; } if( mount_dokan_filldir( fill_find_data, file_info, L".", 2, &find_data, file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set find data.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } result = mount_file_entry_get_parent_file_entry( file_entry, &parent_file_entry, &error ); if( result == -1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve parent file entry.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_dokan_filldir( fill_find_data, file_info, L"..", 3, &find_data, parent_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set find data.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_free( &parent_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free parent file entry.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_number_of_sub_file_entries( file_entry, &number_of_sub_file_entries, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } for( sub_file_entry_index = 0; sub_file_entry_index < number_of_sub_file_entries; sub_file_entry_index++ ) { if( mount_file_entry_get_sub_file_entry_by_index( file_entry, sub_file_entry_index, &sub_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d.", function, sub_file_entry_index ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_name_size( sub_file_entry, &name_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d name size.", function, sub_file_entry_index ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } name = wide_string_allocate( name_size ); if( name == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create sub file entry: %d name.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_name( sub_file_entry, name, name_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub file entry: %d name.", function, sub_file_entry_index ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_dokan_filldir( fill_find_data, file_info, name, name_size, &find_data, sub_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set find data for sub file entry: %d.", function, sub_file_entry_index ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } memory_free( name ); name = NULL; if( mount_file_entry_free( &sub_file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub file entry: %d.", function, sub_file_entry_index ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } } if( mount_file_entry_free( &file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file entry.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( name != NULL ) { memory_free( name ); } if( sub_file_entry != NULL ) { mount_file_entry_free( &sub_file_entry, NULL ); } if( parent_file_entry != NULL ) { mount_file_entry_free( &parent_file_entry, NULL ); } if( file_entry != NULL ) { mount_file_entry_free( &file_entry, NULL ); } return( result ); } /* Retrieves the file information * Returns 0 if successful or an error code otherwise */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) int __stdcall mount_dokan_GetFileInformation( const wchar_t *path, BY_HANDLE_FILE_INFORMATION *file_information, DOKAN_FILE_INFO *file_info EWFTOOLS_ATTRIBUTE_UNUSED ) #else NTSTATUS __stdcall mount_dokan_GetFileInformation( const wchar_t *path, BY_HANDLE_FILE_INFORMATION *file_information, DOKAN_FILE_INFO *file_info EWFTOOLS_ATTRIBUTE_UNUSED ) #endif { libcerror_error_t *error = NULL; mount_file_entry_t *file_entry = NULL; static char *function = "mount_dokan_GetFileInformation"; size64_t file_size = 0; uint64_t access_time = 0; uint64_t creation_time = 0; uint64_t modification_time = 0; uint16_t file_mode = 0; int result = 0; EWFTOOLS_UNREFERENCED_PARAMETER( file_info ) #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, path ); } #endif if( path == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid path.", function ); result = MOUNT_DOKAN_ERROR_BAD_ARGUMENTS; goto on_error; } if( mount_handle_get_file_entry_by_path( ewfmount_mount_handle, path, &file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry for path: %ls.", function, path ); result = MOUNT_DOKAN_ERROR_FILE_NOT_FOUND; goto on_error; } if( file_entry != NULL ) { if( mount_file_entry_get_size( file_entry, &file_size, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry size.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_file_mode( file_entry, &file_mode, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file mode.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_creation_time( file_entry, &creation_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve creation time.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_access_time( file_entry, &access_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve access time.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_get_modification_time( file_entry, &modification_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve modification time.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } } if( mount_dokan_set_file_information( file_information, file_size, file_mode, creation_time, access_time, modification_time, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set file information.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } if( mount_file_entry_free( &file_entry, &error ) != 1 ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file entry.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( file_entry != NULL ) { mount_file_entry_free( &file_entry, NULL ); } return( result ); } /* Retrieves the volume information * Returns 0 if successful or an error code otherwise */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) int __stdcall mount_dokan_GetVolumeInformation( wchar_t *volume_name, DWORD volume_name_size, DWORD *volume_serial_number, DWORD *maximum_filename_length, DWORD *file_system_flags, wchar_t *file_system_name, DWORD file_system_name_size, DOKAN_FILE_INFO *file_info EWFTOOLS_ATTRIBUTE_UNUSED ) #else NTSTATUS __stdcall mount_dokan_GetVolumeInformation( wchar_t *volume_name, DWORD volume_name_size, DWORD *volume_serial_number, DWORD *maximum_filename_length, DWORD *file_system_flags, wchar_t *file_system_name, DWORD file_system_name_size, DOKAN_FILE_INFO *file_info EWFTOOLS_ATTRIBUTE_UNUSED ) #endif { libcerror_error_t *error = NULL; const wchar_t *name = NULL; static char *function = "mount_dokan_GetVolumeInformation"; size_t name_size = 0; int result = 0; EWFTOOLS_UNREFERENCED_PARAMETER( file_info ) #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: %ls\n", function, volume_name ); } #endif name = L"EWF"; name_size = 1 + wide_string_length( name ); if( ( volume_name != NULL ) && ( volume_name_size > (DWORD) name_size ) ) { /* Using wcsncpy seems to cause strange behavior here */ if( memory_copy( volume_name, name, name_size * sizeof( wchar_t ) ) == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy volume name.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } } if( volume_serial_number != NULL ) { /* If this value contains 0 it can crash the system is this an issue in Dokan? */ *volume_serial_number = 0x19831116; } if( maximum_filename_length != NULL ) { *maximum_filename_length = 256; } if( file_system_flags != NULL ) { *file_system_flags = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_READ_ONLY_VOLUME; } name = L"Dokan"; name_size = 1 + wide_string_length( name ); if( ( file_system_name != NULL ) && ( file_system_name_size > (DWORD) name_size ) ) { /* Using wcsncpy seems to cause strange behavior here */ if( memory_copy( file_system_name, name, name_size * sizeof( wchar_t ) ) == NULL ) { libcerror_error_set( &error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy file system name.", function ); result = MOUNT_DOKAN_ERROR_GENERIC_FAILURE; goto on_error; } } return( 0 ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } return( result ); } #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) /* Unmounts the volume * Returns 0 if successful or an error code otherwise */ int __stdcall mount_dokan_Unmount( DOKAN_FILE_INFO *file_info EWFTOOLS_ATTRIBUTE_UNUSED ) { static char *function = "mount_dokan_Unmount"; EWFTOOLS_UNREFERENCED_PARAMETER( file_info ) #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s\n", function ); } #endif return( 0 ); } #endif /* ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) */ #endif /* defined( HAVE_LIBDOKAN ) */ libewf-20140807/ewftools/ewftools_glob.h0000664000175000017500000000364613440662654022234 0ustar00lordyestalordyesta00000000000000/* * Globbing functions * * Copyright (C) 2006-2019, 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_GLOB_H ) #define _EWFTOOLS_GLOB_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_GLOB_H ) typedef struct ewftools_glob ewftools_glob_t; struct ewftools_glob { /* The number of globs resolved */ int number_of_results; /* The resolved globs */ system_character_t **results; }; int ewftools_glob_initialize( ewftools_glob_t **glob, libcerror_error_t **error ); int ewftools_glob_free( ewftools_glob_t **glob, libcerror_error_t **error ); int ewftools_glob_resize( ewftools_glob_t *glob, int new_number_of_results, libcerror_error_t **error ); int ewftools_glob_resolve( ewftools_glob_t *glob, system_character_t * const patterns[], int number_of_patterns, libcerror_error_t **error ); int ewftools_glob_get_results( ewftools_glob_t *glob, int *number_of_results, system_character_t ***results, libcerror_error_t **error ); #endif /* !defined( HAVE_GLOB_H ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_GLOB_H ) */ libewf-20140807/ewftools/export_handle.h0000664000175000017500000003011513421024433022174 0ustar00lordyestalordyesta00000000000000/* * Export handle * * 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( _EXPORT_HANDLE_H ) #define _EXPORT_HANDLE_H #include #include #include "digest_hash.h" #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "ewftools_libsmraw.h" #include "log_handle.h" #include "storage_media_buffer.h" #if defined( __cplusplus ) extern "C" { #endif enum EXPORT_HANDLE_OUTPUT_FORMATS { EXPORT_HANDLE_OUTPUT_FORMAT_EWF = (int) 'e', EXPORT_HANDLE_OUTPUT_FORMAT_FILES = (int) 'f', EXPORT_HANDLE_OUTPUT_FORMAT_RAW = (int) 'r' }; typedef struct export_handle export_handle_t; struct export_handle { /* The user input buffer */ system_character_t *input_buffer; /* The target path */ system_character_t *target_path; /* The target path size */ size_t target_path_size; /* The compression method */ uint16_t compression_method; /* The compression level */ int8_t compression_level; /* The compression flags */ uint8_t compression_flags; /* The output format */ uint8_t output_format; /* The EWF format */ uint8_t ewf_format; /* The number of sectors per chunk */ uint32_t sectors_per_chunk; /* The maximum segment size */ size64_t maximum_segment_size; /* The export offset */ uint64_t export_offset; /* The export size */ uint64_t export_size; /* The header codepage */ int header_codepage; /* Value to indicate if the MD5 digest hash should be calculated */ uint8_t calculate_md5; /* The MD5 digest context */ libhmac_md5_context_t *md5_context; /* Value to indicate the MD5 digest context was initialized */ uint8_t md5_context_initialized; /* The calculated MD5 digest hash string */ system_character_t *calculated_md5_hash_string; /* Value to indicate if the SHA1 digest hash should be calculated */ uint8_t calculate_sha1; /* The SHA1 digest context */ libhmac_sha1_context_t *sha1_context; /* Value to indicate the SHA1 digest context was initialized */ uint8_t sha1_context_initialized; /* The calculated SHA1 digest hash string */ system_character_t *calculated_sha1_hash_string; /* Value to indicate if the SHA256 digest hash should be calculated */ uint8_t calculate_sha256; /* The SHA256 digest context */ libhmac_sha256_context_t *sha256_context; /* Value to indicate the SHA256 digest context was initialized */ uint8_t sha256_context_initialized; /* The calculated SHA256 digest 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 */ uint8_t use_chunk_data_functions; /* The libewf input handle */ libewf_handle_t *input_handle; /* The libsmraw output handle */ libsmraw_handle_t *raw_output_handle; /* Value to indicate if stdout should be used */ uint8_t use_stdout; /* The libewf output handle */ libewf_handle_t *ewf_output_handle; /* The input chunk size */ size32_t input_chunk_size; /* The number of bytes per sector */ uint32_t bytes_per_sector; /* The input media size */ size64_t input_media_size; /* The last offset of the input data */ off64_t input_offset; /* Value to indicate if the write is compressed */ int write_compressed; /* Value to indicate if the chunk should be zeroed on error */ int zero_chunk_on_error; /* The process buffer size */ size_t process_buffer_size; /* The notification output stream */ FILE *notify_stream; /* Value to indicate if abort was signalled */ int abort; }; int export_handle_initialize( export_handle_t **export_handle, uint8_t calculate_md5, uint8_t use_chunk_data_functions, libcerror_error_t **error ); int export_handle_free( export_handle_t **export_handle, libcerror_error_t **error ); int export_handle_signal_abort( export_handle_t *export_handle, libcerror_error_t **error ); int export_handle_set_maximum_number_of_open_handles( export_handle_t *export_handle, int maximum_number_of_open_handles, libcerror_error_t **error ); int export_handle_open_input( export_handle_t *export_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int export_handle_open_output( export_handle_t *export_handle, const system_character_t *filename, libcerror_error_t **error ); int export_handle_close( export_handle_t *export_handle, libcerror_error_t **error ); ssize_t export_handle_prepare_read_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ); ssize_t export_handle_read_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ); ssize_t export_handle_prepare_write_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ); ssize_t export_handle_write_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, size_t write_size, libcerror_error_t **error ); off64_t export_handle_seek_offset( export_handle_t *export_handle, off64_t offset, libcerror_error_t **error ); int export_handle_swap_byte_pairs( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ); int export_handle_initialize_integrity_hash( export_handle_t *export_handle, libcerror_error_t **error ); int export_handle_update_integrity_hash( export_handle_t *export_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ); int export_handle_finalize_integrity_hash( export_handle_t *export_handle, libcerror_error_t **error ); int export_handle_input_is_corrupted( export_handle_t *export_handle, libcerror_error_t **error ); int export_handle_get_output_chunk_size( export_handle_t *export_handle, size32_t *chunk_size, libcerror_error_t **error ); int export_handle_prompt_for_string( export_handle_t *export_handle, 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 system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_compression_level( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_output_format( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_sectors_per_chunk( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_maximum_segment_size( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_export_offset( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_export_size( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ); int export_handle_set_string( export_handle_t *export_handle, 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 system_character_t *string, libcerror_error_t **error ); int export_handle_set_output_format( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_sectors_per_chunk( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_maximum_segment_size( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_export_offset( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_export_size( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_header_codepage( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_process_buffer_size( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_additional_digest_types( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ); int export_handle_set_output_values( export_handle_t *export_handle, 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 ); int export_handle_set_hash_value( export_handle_t *export_handle, char *hash_value_identifier, size_t hash_value_identifier_length, system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ); int export_handle_append_read_error( export_handle_t *export_handle, off64_t start_offset, size_t number_of_bytes, libcerror_error_t **error ); ssize_t export_handle_finalize( export_handle_t *export_handle, libcerror_error_t **error ); int export_handle_export_input( export_handle_t *export_handle, uint8_t swap_byte_pairs, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ); int export_handle_export_single_files( export_handle_t *export_handle, const system_character_t *export_path, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ); int export_handle_export_file_entry( export_handle_t *export_handle, libewf_file_entry_t *file_entry, 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 ); int export_handle_export_file_entry_data( export_handle_t *export_handle, libewf_file_entry_t *file_entry, 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 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 ); int export_handle_hash_values_fprint( export_handle_t *export_handle, FILE *stream, libcerror_error_t **error ); int export_handle_checksum_errors_fprint( export_handle_t *export_handle, FILE *stream, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/mount_file_entry.h0000664000175000017500000000746613421020222022727 0ustar00lordyestalordyesta00000000000000/* * Mount file entry * * Copyright (C) 2006-2019, 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( _MOUNT_FILE_ENTRY_H ) #define _MOUNT_FILE_ENTRY_H #include #include #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "mount_file_system.h" #if defined( __cplusplus ) extern "C" { #endif enum MOUNT_FILE_ENTRY_TYPES { MOUNT_FILE_ENTRY_TYPE_UNKNOWN, MOUNT_FILE_ENTRY_TYPE_FILE_ENTRY, MOUNT_FILE_ENTRY_TYPE_HANDLE }; typedef struct mount_file_entry mount_file_entry_t; struct mount_file_entry { /* The file system */ mount_file_system_t *file_system; /* The name */ system_character_t *name; /* The name size */ size_t name_size; /* The type */ int type; /* The handle */ libewf_handle_t *ewf_handle; /* The file entry */ libewf_file_entry_t *ewf_file_entry; }; int mount_file_entry_initialize( mount_file_entry_t **file_entry, mount_file_system_t *file_system, const system_character_t *name, size_t name_length, int type, libewf_handle_t *ewf_handle, libewf_file_entry_t *ewf_file_entry, libcerror_error_t **error ); int mount_file_entry_free( mount_file_entry_t **file_entry, libcerror_error_t **error ); int mount_file_entry_get_parent_file_entry( mount_file_entry_t *file_entry, mount_file_entry_t **parent_file_entry, libcerror_error_t **error ); int mount_file_entry_get_creation_time( mount_file_entry_t *file_entry, uint64_t *creation_time, libcerror_error_t **error ); int mount_file_entry_get_access_time( mount_file_entry_t *file_entry, uint64_t *access_time, libcerror_error_t **error ); int mount_file_entry_get_modification_time( mount_file_entry_t *file_entry, uint64_t *modification_time, libcerror_error_t **error ); int mount_file_entry_get_inode_change_time( mount_file_entry_t *file_entry, uint64_t *inode_change_time, libcerror_error_t **error ); int mount_file_entry_get_file_mode( mount_file_entry_t *file_entry, uint16_t *file_mode, libcerror_error_t **error ); int mount_file_entry_get_name_size( mount_file_entry_t *file_entry, size_t *string_size, libcerror_error_t **error ); int mount_file_entry_get_name( mount_file_entry_t *file_entry, system_character_t *string, size_t string_size, libcerror_error_t **error ); int mount_file_entry_get_number_of_sub_file_entries( mount_file_entry_t *file_entry, int *number_of_sub_entries, libcerror_error_t **error ); int mount_file_entry_get_sub_file_entry_by_index( mount_file_entry_t *file_entry, int sub_file_entry_index, mount_file_entry_t **sub_file_entry, libcerror_error_t **error ); ssize_t mount_file_entry_read_buffer_at_offset( mount_file_entry_t *file_entry, void *buffer, size_t buffer_size, off64_t offset, libcerror_error_t **error ); int mount_file_entry_get_size( mount_file_entry_t *file_entry, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _MOUNT_FILE_ENTRY_H ) */ libewf-20140807/ewftools/byte_size_string.c0000664000175000017500000002460413421024433022724 0ustar00lordyestalordyesta00000000000000/* * Byte size string functions * * 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 . */ #include #include #include #include #include #include "byte_size_string.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" /* Creates a human readable byte size string * Returns 1 if successful or -1 on error */ int byte_size_string_create( system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t size, int units, libcerror_error_t **error ) { 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; uint64_t last_factored_size = 0; int8_t factor = 0; int8_t remainder = -1; int decimal_point = 0; if( byte_size_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte size string.", function ); return( -1 ); } /* Minimum of 4 digits and separator, space, 3 letter unit, end of string */ if( byte_size_string_length < 9 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: byte size string too small.", function ); return( -1 ); } if( ( size < 1024 ) || ( units == BYTE_SIZE_STRING_UNIT_MEGABYTE ) ) { units_string = _SYSTEM_STRING( "B" ); } else if( units == BYTE_SIZE_STRING_UNIT_MEBIBYTE ) { units_string = _SYSTEM_STRING( "iB" ); } factored_size = size; if( factored_size >= (uint64_t) units ) { while( factored_size >= (uint64_t) units ) { last_factored_size = factored_size; factored_size /= units; factor++; } if( factored_size < 10 ) { last_factored_size %= units; remainder = (int8_t) ( last_factored_size / 100 ); } } if( factor > 8 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: factor size greater than 8 unsupported.", function ); return( -1 ); } switch( factor ) { case 0: factor_string = _SYSTEM_STRING( "" ); break; case 1: factor_string = _SYSTEM_STRING( "K" ); break; case 2: factor_string = _SYSTEM_STRING( "M" ); break; case 3: factor_string = _SYSTEM_STRING( "G" ); break; case 4: factor_string = _SYSTEM_STRING( "T" ); break; case 5: factor_string = _SYSTEM_STRING( "P" ); break; case 6: factor_string = _SYSTEM_STRING( "E" ); break; case 7: factor_string = _SYSTEM_STRING( "Z" ); break; case 8: factor_string = _SYSTEM_STRING( "Y" ); break; } if( remainder > 9 ) { remainder = 9; } if( remainder >= 0 ) { if( libclocale_locale_get_decimal_point( &decimal_point, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve locale decimal point.", function ); return( -1 ); } print_count = system_string_sprintf( byte_size_string, byte_size_string_length, _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, (system_character_t) decimal_point, remainder, factor_string, units_string ); } else { print_count = system_string_sprintf( byte_size_string, byte_size_string_length, _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu64 ) _SYSTEM_STRING( " %" ) _SYSTEM_STRING( PRIs_SYSTEM ) _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIs_SYSTEM ), factored_size, factor_string, units_string ); } if( ( print_count < 0 ) || ( (size_t) print_count > byte_size_string_length ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set byte size string.", function ); return( -1 ); } return( 1 ); } /* Converts a human readable byte size string into a value * Returns 1 if successful or -1 on error */ int byte_size_string_convert( const system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t *size, libcerror_error_t **error ) { static char *function = "byte_size_string_convert"; size_t byte_size_string_iterator = 0; uint64_t byte_size = 0; int8_t factor = 0; int8_t remainder = -1; int decimal_point = 0; int units = 0; if( byte_size_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte size string.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( libclocale_locale_get_decimal_point( &decimal_point, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve locale decimal point.", function ); return( -1 ); } while( byte_size_string_iterator < byte_size_string_length ) { 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 ] - (system_character_t) '0' ); byte_size_string_iterator++; } 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 ] >= (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 ] - (system_character_t) '0' ); byte_size_string_iterator++; } remainder *= 10; 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 ] - (system_character_t) '0' ); byte_size_string_iterator++; } /* Ignore more than 2 digits after separator */ while( byte_size_string_iterator < byte_size_string_length ) { 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 ] == (system_character_t) ' ' ) { byte_size_string_iterator++; } switch( byte_size_string[ byte_size_string_iterator ] ) { case 'k': case 'K': factor = 1; break; case 'm': case 'M': factor = 2; break; case 'g': case 'G': factor = 3; break; case 't': case 'T': factor = 4; break; case 'p': case 'P': factor = 5; break; case 'e': case 'E': factor = 6; break; case 'z': case 'Z': factor = 7; break; case 'y': case 'Y': factor = 8; break; } if( factor < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid factor.", function ); return( -1 ); } else if( factor > 1 ) { byte_size_string_iterator++; } if( byte_size_string_iterator >= byte_size_string_length ) { units = BYTE_SIZE_STRING_UNIT_MEBIBYTE; } 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 ] == (system_character_t) 'B' ) { units = BYTE_SIZE_STRING_UNIT_MEGABYTE; byte_size_string_iterator++; } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid units.", function ); return( -1 ); } if( factor > 0 ) { if( remainder > 0 ) { byte_size *= units; factor--; byte_size += ( remainder * 10 ); } for( ; factor > 0; factor-- ) { byte_size *= units; } } #if defined( HAVE_VERBOSE_OUTPUT ) else if( remainder >= 0 ) { libcnotify_printf( "%s: ignoring byte value remainder.\n", function ); } #endif #if defined( HAVE_VERBOSE_OUTPUT ) if( ( byte_size_string[ byte_size_string_iterator ] != 0 ) && ( 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", function ); } #endif *size = byte_size; return( 1 ); } libewf-20140807/ewftools/ewfinfo.c0000664000175000017500000004330613440663046021010 0ustar00lordyestalordyesta00000000000000/* * Shows information stored in an EWF file * * 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 . */ #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_GLOB_H ) #include #endif #include "byte_size_string.h" #include "ewfinput.h" #include "ewftools_getopt.h" #include "ewftools_glob.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "guid.h" #include "info_handle.h" info_handle_t *ewfinfo_info_handle = NULL; int ewfinfo_abort = 0; /* Prints the executable usage information */ void usage_fprint( FILE *stream ) { if( stream == NULL ) { return; } fprintf( stream, "Use ewfinfo to determine information about the EWF format (Expert Witness\n" "Compression Format).\n\n" ); fprintf( stream, "Usage: ewfinfo [ -A codepage ] [ -d date_format ] [ -f format ]\n" " [ -ehimvVx ] ewf_files\n\n" ); fprintf( stream, "\tewf_files: the first or the entire set of EWF segment files\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-d: specify the date format, options: ctime (default),\n" "\t dm (day/month), md (month/day), iso8601\n" ); fprintf( stream, "\t-e: only show EWF read error information\n" ); fprintf( stream, "\t-f: specify the output format, options: text (default),\n" "\t dfxml\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-i: only show EWF acquiry information\n" ); fprintf( stream, "\t-m: only show EWF media information\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); } /* Signal handler for ewfinfo */ void ewfinfo_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfinfo_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfinfo_abort = 1; if( ( ewfinfo_info_handle != NULL ) && ( info_handle_signal_abort( ewfinfo_info_handle, &error ) != 1 ) ) { libcnotify_printf( "%s: unable to signal info handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* The main program */ #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( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif system_character_t * const *argv_filenames = NULL; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif libcerror_error_t *error = NULL; 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" ); system_integer_t option = 0; uint8_t verbose = 0; char info_option = 'a'; int number_of_filenames = 0; int print_header = 1; int result = 0; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } while( ( option = ewftools_getopt( argc, argv, _SYSTEM_STRING( "A:d:ef:himvV" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( stdout ); goto on_error; case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'd': option_date_format = optarg; break; case (system_integer_t) 'e': if( info_option != 'a' ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Conflicting options: %" PRIc_SYSTEM " and %c\n", option, info_option ); usage_fprint( stdout ); goto on_error; } info_option = 'e'; break; case (system_integer_t) 'f': option_output_format = optarg; break; case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); usage_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'i': if( info_option != 'a' ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Conflicting options: %" PRIc_SYSTEM " and %c\n", option, info_option ); usage_fprint( stdout ); goto on_error; } info_option = 'i'; break; case (system_integer_t) 'm': if( info_option != 'a' ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Conflicting options: %" PRIc_SYSTEM " and %c\n", option, info_option ); usage_fprint( stdout ); goto on_error; } info_option = 'm'; break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); } } if( optind == argc ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Missing EWF image file(s).\n" ); usage_fprint( stdout ); goto on_error; } libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif if( info_handle_initialize( &ewfinfo_info_handle, &error ) != 1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to create info handle.\n" ); goto on_error; } if( option_output_format != NULL ) { result = info_handle_set_output_format( ewfinfo_info_handle, option_output_format, &error ); if( result == -1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to set output format.\n" ); goto on_error; } else if( result == 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; fprintf( stderr, "Unsupported output format defaulting to: text.\n" ); } } if( ewfinfo_info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { if( info_handle_dfxml_header_fprint( ewfinfo_info_handle, &error ) != 1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to print header.\n" ); goto on_error; } } else if( ewfinfo_info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { ewftools_output_version_fprint( stdout, program ); print_header = 0; } if( ( option_output_format == NULL ) && ( option_date_format != NULL ) ) { result = info_handle_set_date_format( ewfinfo_info_handle, option_date_format, &error ); if( result == -1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to set date format.\n" ); goto on_error; } else if( result == 0 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unsupported date format defaulting to: ctime.\n" ); } } if( option_header_codepage != NULL ) { result = info_handle_set_header_codepage( ewfinfo_info_handle, option_header_codepage, &error ); if( result == -1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to set header codepage in info handle.\n" ); goto on_error; } else if( result == 0 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); } } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_initialize( &glob, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to initialize glob.\n" ); goto on_error; } if( ewftools_glob_resolve( glob, &( argv[ optind ] ), argc - optind, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to resolve glob.\n" ); goto on_error; } if( ewftools_glob_get_results( glob, &number_of_filenames, (system_character_t ***) &argv_filenames, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve glob results.\n" ); goto on_error; } #else argv_filenames = &( argv[ optind ] ); number_of_filenames = argc - optind; #endif #if defined( HAVE_GETRLIMIT ) if( getrlimit( RLIMIT_NOFILE, &limit_data ) != 0 ) { fprintf( stderr, "Unable to determine limit: number of open file descriptors.\n" ); } if( limit_data.rlim_max > (rlim_t) INT_MAX ) { limit_data.rlim_max = (rlim_t) INT_MAX; } if( limit_data.rlim_max > 0 ) { limit_data.rlim_max /= 2; } if( info_handle_set_maximum_number_of_open_handles( ewfinfo_info_handle, (int) limit_data.rlim_max, &error ) != 1 ) { fprintf( stderr, "Unable to set maximum number of open file handles.\n" ); goto on_error; } #endif if( ewftools_signal_attach( ewfinfo_signal_handler, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } result = info_handle_open_input( ewfinfo_info_handle, argv_filenames, number_of_filenames, &error ); if( ewfinfo_abort != 0 ) { goto on_abort; } if( result != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to open EWF file(s).\n" ); goto on_error; } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_free( &glob, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } #endif if( ( info_option == 'a' ) || ( info_option == 'i' ) ) { if( info_handle_header_values_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print header values.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } if( ( info_option == 'a' ) || ( info_option == 'm' ) ) { if( info_handle_media_information_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print media information.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( info_handle_hash_values_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print hash values.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( info_handle_sessions_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print sessions.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( info_handle_tracks_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print tracks.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } if( ( info_option == 'a' ) || ( info_option == 'e' ) ) { if( info_handle_acquiry_errors_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print acquiry errors.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } if( info_handle_single_files_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print single files.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( ewfinfo_info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_DFXML ) { if( info_handle_dfxml_footer_fprint( ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to print footer.\n" ); goto on_error; } } on_abort: if( info_handle_close( ewfinfo_info_handle, &error ) != 0 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to close info handle.\n" ); goto on_error; } if( ewftools_signal_detach( &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( info_handle_free( &ewfinfo_info_handle, &error ) != 1 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stderr, "Unable to free info handle.\n" ); goto on_error; } if( ewfinfo_abort != 0 ) { if( print_header != 0 ) { ewftools_output_version_fprint( stderr, program ); print_header = 0; } fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( ewfinfo_info_handle != NULL ) { info_handle_free( &ewfinfo_info_handle, NULL ); } #if !defined( HAVE_GLOB_H ) if( glob != NULL ) { ewftools_glob_free( &glob, NULL ); } #endif return( EXIT_FAILURE ); } libewf-20140807/ewftools/imaging_handle.c0000664000175000017500000042764613421024433022304 0ustar00lordyestalordyesta00000000000000/* * Imaging handle * * 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 . */ #include #include #include #include #include #include #if defined( WINAPI ) #include #elif defined( HAVE_UUID_UUID_H ) #include #endif #include "byte_size_string.h" #include "digest_hash.h" #include "ewfcommon.h" #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libcnotify.h" #include "ewftools_libcsplit.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "ewftools_system_string.h" #include "guid.h" #include "imaging_handle.h" #include "platform.h" #include "storage_media_buffer.h" #define IMAGING_HANDLE_INPUT_BUFFER_SIZE 64 #define IMAGING_HANDLE_STRING_SIZE 1024 #define IMAGING_HANDLE_NOTIFY_STREAM stdout /* Creates an imaging handle * Make sure the value imaging_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int imaging_handle_initialize( imaging_handle_t **imaging_handle, uint8_t calculate_md5, uint8_t use_chunk_data_functions, libcerror_error_t **error ) { static char *function = "imaging_handle_initialize"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( *imaging_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid imaging handle value already set.", function ); return( -1 ); } *imaging_handle = memory_allocate_structure( imaging_handle_t ); if( *imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create imaging handle.", function ); goto on_error; } if( memory_set( *imaging_handle, 0, sizeof( imaging_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear imaging handle.", function ); memory_free( *imaging_handle ); *imaging_handle = NULL; return( -1 ); } ( *imaging_handle )->input_buffer = system_string_allocate( IMAGING_HANDLE_INPUT_BUFFER_SIZE ); if( ( *imaging_handle )->input_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create input buffer.", function ); goto on_error; } if( memory_set( ( *imaging_handle )->input_buffer, 0, sizeof( system_character_t ) * IMAGING_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear imaging handle.", function ); goto on_error; } if( libewf_handle_initialize( &( ( *imaging_handle )->output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize output handle.", function ); goto on_error; } if( calculate_md5 != 0 ) { ( *imaging_handle )->calculated_md5_hash_string = system_string_allocate( 33 ); if( ( *imaging_handle )->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated MD5 digest hash string.", function ); goto on_error; } } ( *imaging_handle )->calculate_md5 = calculate_md5; ( *imaging_handle )->use_chunk_data_functions = use_chunk_data_functions; ( *imaging_handle )->compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; ( *imaging_handle )->compression_level = LIBEWF_COMPRESSION_NONE; ( *imaging_handle )->ewf_format = LIBEWF_FORMAT_ENCASE6; ( *imaging_handle )->media_type = LIBEWF_MEDIA_TYPE_FIXED; ( *imaging_handle )->media_flags = LIBEWF_MEDIA_FLAG_PHYSICAL; ( *imaging_handle )->bytes_per_sector = 512; ( *imaging_handle )->sectors_per_chunk = 64; ( *imaging_handle )->sector_error_granularity = 64; ( *imaging_handle )->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; ( *imaging_handle )->header_codepage = LIBEWF_CODEPAGE_ASCII; ( *imaging_handle )->process_buffer_size = EWFCOMMON_PROCESS_BUFFER_SIZE; ( *imaging_handle )->notify_stream = IMAGING_HANDLE_NOTIFY_STREAM; return( 1 ); on_error: if( *imaging_handle != NULL ) { if( ( *imaging_handle )->calculated_sha1_hash_string != NULL ) { memory_free( ( *imaging_handle )->calculated_sha1_hash_string ); } if( ( *imaging_handle )->calculated_md5_hash_string != NULL ) { memory_free( ( *imaging_handle )->calculated_md5_hash_string ); } if( ( *imaging_handle )->output_handle != NULL ) { libewf_handle_free( &( ( *imaging_handle )->output_handle ), NULL ); } if( ( *imaging_handle )->input_buffer != NULL ) { memory_free( ( *imaging_handle )->input_buffer ); } memory_free( *imaging_handle ); *imaging_handle = NULL; } return( -1 ); } /* Frees an imaging handle * Returns 1 if successful or -1 on error */ int imaging_handle_free( imaging_handle_t **imaging_handle, libcerror_error_t **error ) { static char *function = "imaging_handle_free"; int result = 1; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( *imaging_handle != NULL ) { memory_free( ( *imaging_handle )->input_buffer ); if( ( *imaging_handle )->target_filename != NULL ) { memory_free( ( *imaging_handle )->target_filename ); } if( ( *imaging_handle )->secondary_target_filename != NULL ) { memory_free( ( *imaging_handle )->secondary_target_filename ); } if( ( *imaging_handle )->case_number != NULL ) { memory_free( ( *imaging_handle )->case_number ); } if( ( *imaging_handle )->description != NULL ) { memory_free( ( *imaging_handle )->description ); } if( ( *imaging_handle )->evidence_number != NULL ) { memory_free( ( *imaging_handle )->evidence_number ); } if( ( *imaging_handle )->examiner_name != NULL ) { memory_free( ( *imaging_handle )->examiner_name ); } if( ( *imaging_handle )->notes != NULL ) { memory_free( ( *imaging_handle )->notes ); } if( ( *imaging_handle )->md5_context != NULL ) { if( libhmac_md5_free( &( ( *imaging_handle )->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free MD5 context.", function ); result = -1; } } if( ( *imaging_handle )->calculated_md5_hash_string != NULL ) { memory_free( ( *imaging_handle )->calculated_md5_hash_string ); } if( ( *imaging_handle )->sha1_context != NULL ) { if( libhmac_sha1_free( &( ( *imaging_handle )->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA1 context.", function ); result = -1; } } if( ( *imaging_handle )->calculated_sha1_hash_string != NULL ) { memory_free( ( *imaging_handle )->calculated_sha1_hash_string ); } if( ( *imaging_handle )->sha256_context != NULL ) { if( libhmac_sha256_free( &( ( *imaging_handle )->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA256 context.", function ); result = -1; } } if( ( *imaging_handle )->calculated_sha256_hash_string != NULL ) { memory_free( ( *imaging_handle )->calculated_sha256_hash_string ); } if( libewf_handle_free( &( ( *imaging_handle )->output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free output handle.", function ); result = -1; } if( ( *imaging_handle )->secondary_output_handle != NULL ) { if( libewf_handle_free( &( ( *imaging_handle )->secondary_output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free secondary output handle.", function ); result = -1; } } memory_free( *imaging_handle ); *imaging_handle = NULL; } return( result ); } /* Signals the imaging handle to abort * Returns 1 if successful or -1 on error */ int imaging_handle_signal_abort( imaging_handle_t *imaging_handle, libcerror_error_t **error ) { static char *function = "imaging_handle_signal_abort"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( libewf_handle_signal_abort( imaging_handle->output_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal output handle to abort.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_signal_abort( imaging_handle->output_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal secondary output handle to abort.", function ); return( -1 ); } } return( 1 ); } /* Opens the output of the imaging handle * Returns 1 if successful or -1 on error */ int imaging_handle_open_output( imaging_handle_t *imaging_handle, const system_character_t *filename, uint8_t resume, libcerror_error_t **error ) { 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; int number_of_filenames = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } filenames[ 0 ] = (system_character_t *) filename; number_of_filenames = 1; if( resume != 0 ) { first_filename_length = system_string_length( filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #else if( libewf_glob( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to resolve filename(s).", function ); return( -1 ); } access_flags = LIBEWF_OPEN_WRITE_RESUME; } else { libewf_filenames = filenames; access_flags = LIBEWF_OPEN_WRITE; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( imaging_handle->output_handle, libewf_filenames, number_of_filenames, access_flags, error ) != 1 ) #else if( libewf_handle_open( imaging_handle->output_handle, libewf_filenames, number_of_filenames, access_flags, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); if( libewf_filenames != filenames ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, NULL ); #else libewf_glob_free( libewf_filenames, number_of_filenames, NULL ); #endif } return( -1 ); } if( libewf_filenames != filenames ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, error ) != 1 ) #else if( libewf_glob_free( libewf_filenames, number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free globbed filenames.", function ); return( -1 ); } } return( 1 ); } /* Opens the secondary output of the imaging handle * Returns 1 if successful or -1 on error */ int imaging_handle_open_secondary_output( imaging_handle_t *imaging_handle, const system_character_t *filename, uint8_t resume, libcerror_error_t **error ) { 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; int number_of_filenames = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid imaging handle - secondary output handle already set.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } filenames[ 0 ] = (system_character_t *) filename; number_of_filenames = 1; if( resume != 0 ) { first_filename_length = system_string_length( filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #else if( libewf_glob( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to resolve filename(s).", function ); return( -1 ); } access_flags = LIBEWF_OPEN_WRITE_RESUME; } else { libewf_filenames = filenames; access_flags = LIBEWF_OPEN_WRITE; } if( libewf_handle_initialize( &( imaging_handle->secondary_output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize secondary output handle.", function ); if( libewf_filenames != filenames ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, NULL ); #else libewf_glob_free( libewf_filenames, number_of_filenames, NULL ); #endif } return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( imaging_handle->secondary_output_handle, libewf_filenames, number_of_filenames, access_flags, error ) != 1 ) #else if( libewf_handle_open( imaging_handle->secondary_output_handle, libewf_filenames, number_of_filenames, access_flags, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); libewf_handle_free( &( imaging_handle->secondary_output_handle ), NULL ); if( libewf_filenames != filenames ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, NULL ); #else libewf_glob_free( libewf_filenames, number_of_filenames, NULL ); #endif } return( -1 ); } if( libewf_filenames != filenames ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, error ) != 1 ) #else if( libewf_glob_free( libewf_filenames, number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free globbed filenames.", function ); libewf_handle_free( &( imaging_handle->secondary_output_handle ), NULL ); return( -1 ); } } return( 1 ); } /* Closes the imaging handle * Returns the 0 if succesful or -1 on error */ int imaging_handle_close( imaging_handle_t *imaging_handle, libcerror_error_t **error ) { static char *function = "imaging_handle_close"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( libewf_handle_close( imaging_handle->output_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close output handle.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_close( imaging_handle->secondary_output_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close secondary output handle.", function ); return( -1 ); } } return( 0 ); } /* Prepares a buffer after reading the input of the imaging handle * Returns the resulting buffer size or -1 on error */ ssize_t imaging_handle_prepare_read_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ) { static char *function = "imaging_handle_prepare_read_buffer"; ssize_t process_count = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->raw_buffer_data_size = storage_media_buffer->raw_buffer_size; process_count = libewf_handle_prepare_read_chunk( imaging_handle->output_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_data_size, storage_media_buffer->raw_buffer, &( storage_media_buffer->raw_buffer_data_size ), storage_media_buffer->is_compressed, storage_media_buffer->checksum, storage_media_buffer->process_checksum, error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->is_compressed == 0 ) { storage_media_buffer->data_in_compression_buffer = 1; } else { storage_media_buffer->data_in_compression_buffer = 0; } } else { process_count = (ssize_t) storage_media_buffer->raw_buffer_data_size; } storage_media_buffer->process_count = process_count; return( process_count ); } /* Reads a buffer from the input of the imaging handle * Returns the number of bytes written or -1 on error */ ssize_t imaging_handle_read_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ) { static char *function = "imaging_handle_read_buffer"; ssize_t read_count = 0; ssize_t secondary_read_count = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { read_count = libewf_handle_read_chunk( imaging_handle->output_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_size, &( storage_media_buffer->is_compressed ), &( storage_media_buffer->compression_buffer[ storage_media_buffer->raw_buffer_size ] ), &( storage_media_buffer->checksum ), &( storage_media_buffer->process_checksum ), error ); } else { read_count = libewf_handle_read_buffer( imaging_handle->output_handle, storage_media_buffer->raw_buffer, read_size, error ); } if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read storage media buffer.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { secondary_read_count = libewf_handle_read_chunk( imaging_handle->secondary_output_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_size, &( storage_media_buffer->is_compressed ), &( storage_media_buffer->compression_buffer[ storage_media_buffer->raw_buffer_size ] ), &( storage_media_buffer->checksum ), &( storage_media_buffer->process_checksum ), error ); } else { secondary_read_count = libewf_handle_read_buffer( imaging_handle->secondary_output_handle, storage_media_buffer->raw_buffer, read_size, error ); } if( secondary_read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read storage media buffer from secondary output handle.", function ); return( -1 ); } } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->compression_buffer_data_size = (ssize_t) read_count; } else { storage_media_buffer->raw_buffer_data_size = (ssize_t) read_count; } return( read_count ); } /* Prepares a buffer before writing the output of the imaging handle * Returns the resulting buffer size or -1 on error */ ssize_t imaging_handle_prepare_write_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ) { static char *function = "imaging_handle_prepare_write_buffer"; ssize_t process_count = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->compression_buffer_data_size = storage_media_buffer->compression_buffer_size; process_count = libewf_handle_prepare_write_chunk( imaging_handle->output_handle, storage_media_buffer->raw_buffer, storage_media_buffer->raw_buffer_data_size, storage_media_buffer->compression_buffer, &( storage_media_buffer->compression_buffer_data_size ), &( storage_media_buffer->is_compressed ), &( storage_media_buffer->checksum ), &( storage_media_buffer->process_checksum ), error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to prepare storage media buffer before writing.", function ); return( -1 ); } } else { process_count = storage_media_buffer->raw_buffer_data_size; } storage_media_buffer->process_count = process_count; return( process_count ); } /* Writes a buffer to the output of the imaging handle * Returns the number of bytes written or -1 on error */ ssize_t imaging_handle_write_buffer( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, size_t write_size, libcerror_error_t **error ) { uint8_t *raw_write_buffer = NULL; static char *function = "imaging_handle_write_buffer"; size_t raw_write_buffer_size = 0; ssize_t secondary_write_count = 0; ssize_t write_count = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( write_size == 0 ) { return( 0 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { if( storage_media_buffer->is_compressed == 0 ) { raw_write_buffer = storage_media_buffer->raw_buffer; raw_write_buffer_size = storage_media_buffer->raw_buffer_data_size; } else { raw_write_buffer = storage_media_buffer->compression_buffer; raw_write_buffer_size = storage_media_buffer->compression_buffer_data_size; } if( write_size != raw_write_buffer_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: mismatch in write size and number of bytes in storage media buffer.", function ); return( -1 ); } write_count = libewf_handle_write_chunk( imaging_handle->output_handle, raw_write_buffer, raw_write_buffer_size, storage_media_buffer->raw_buffer_data_size, storage_media_buffer->is_compressed, storage_media_buffer->checksum_buffer, storage_media_buffer->checksum, storage_media_buffer->process_checksum, error ); } else { write_count = libewf_handle_write_buffer( imaging_handle->output_handle, storage_media_buffer->raw_buffer, write_size, error ); } if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write storage media buffer.", function ); if( ( error != NULL ) && ( libcerror_error_matches( *error, LIBCERROR_ERROR_DOMAIN_OUTPUT, LIBCERROR_OUTPUT_ERROR_INSUFFICIENT_SPACE ) == 0 ) ) { return( -1 ); } /* TODO ask for alternative segment file location and try again */ return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { secondary_write_count = libewf_handle_write_chunk( imaging_handle->secondary_output_handle, raw_write_buffer, raw_write_buffer_size, storage_media_buffer->raw_buffer_data_size, storage_media_buffer->is_compressed, storage_media_buffer->checksum_buffer, storage_media_buffer->checksum, storage_media_buffer->process_checksum, error ); } else { secondary_write_count = libewf_handle_write_buffer( imaging_handle->secondary_output_handle, storage_media_buffer->raw_buffer, write_size, error ); } if( secondary_write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write storage media buffer to secondary output handle.", function ); if( ( error != NULL ) && ( libcerror_error_matches( *error, LIBCERROR_ERROR_DOMAIN_OUTPUT, LIBCERROR_OUTPUT_ERROR_INSUFFICIENT_SPACE ) == 0 ) ) { return( -1 ); } /* TODO ask for alternative segment file location and try again */ return( -1 ); } } return( write_count ); } /* Seeks the offset in the input file * Returns the new offset if successful or -1 on error */ off64_t imaging_handle_seek_offset( imaging_handle_t *imaging_handle, off64_t offset, libcerror_error_t **error ) { static char *function = "imaging_handle_seek_offset"; off64_t secondary_offset = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } offset = libewf_handle_seek_offset( imaging_handle->output_handle, offset, SEEK_SET, error ); if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in output handle.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { secondary_offset = libewf_handle_seek_offset( imaging_handle->secondary_output_handle, offset, SEEK_SET, error ); if( secondary_offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset in secondary output handle.", function ); return( -1 ); } } return( offset ); } /* Retrieves the offset size * Returns 1 if successful or -1 on error */ int imaging_handle_get_offset( imaging_handle_t *imaging_handle, off64_t *offset, libcerror_error_t **error ) { static char *function = "imaging_handle_get_offset"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } if( libewf_handle_get_offset( imaging_handle->output_handle, offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve offset.", function ); return( -1 ); } return( 1 ); } /* Swaps the byte order of byte pairs within a buffer of a certain size * Returns 1 if successful, -1 on error */ int imaging_handle_swap_byte_pairs( imaging_handle_t *imaging_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ) { uint8_t *data = NULL; static char *function = "imaging_handle_swap_byte_pairs"; size_t data_size = 0; size_t iterator = 0; uint8_t byte = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( ( read_size == 0 ) || ( read_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid read size value out of bounds.", function ); return( -1 ); } /* If the last bit is set the value is odd */ if( ( read_size & 0x01 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid read size value is odd.", function ); return( -1 ); } if( storage_media_buffer_get_data( storage_media_buffer, &data, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve storage media buffer data.", function ); return( -1 ); } if( read_size != data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: mismatch in read size and data size.", function ); return( -1 ); } for( iterator = 0; iterator < read_size; iterator += 2 ) { byte = data[ iterator ]; data[ iterator ] = data[ iterator + 1 ]; data[ iterator + 1 ] = byte; } return( 1 ); } /* Initializes the integrity hash(es) * Returns 1 if successful or -1 on error */ int imaging_handle_initialize_integrity_hash( imaging_handle_t *imaging_handle, libcerror_error_t **error ) { static char *function = "imaging_handle_initialize_integrity_hash"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->calculate_md5 != 0 ) { if( libhmac_md5_initialize( &( imaging_handle->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize MD5 context.", function ); goto on_error; } imaging_handle->md5_context_initialized = 1; } if( imaging_handle->calculate_sha1 != 0 ) { if( libhmac_sha1_initialize( &( imaging_handle->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize SHA1 context.", function ); goto on_error; } imaging_handle->sha1_context_initialized = 1; } if( imaging_handle->calculate_sha256 != 0 ) { if( libhmac_sha256_initialize( &( imaging_handle->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize SHA256 context.", function ); goto on_error; } imaging_handle->sha256_context_initialized = 1; } return( 1 ); on_error: if( imaging_handle->sha1_context != NULL ) { libhmac_sha1_free( &( imaging_handle->sha1_context ), NULL ); } if( imaging_handle->md5_context != NULL ) { libhmac_md5_free( &( imaging_handle->md5_context ), NULL ); } return( -1 ); } /* Updates the integrity hash(es) * Returns 1 if successful or -1 on error */ int imaging_handle_update_integrity_hash( imaging_handle_t *imaging_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { static char *function = "imaging_handle_update_integrity_hash"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( ( buffer_size == 0 ) || ( buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid buffer size value out of bounds.", function ); return( -1 ); } if( imaging_handle->calculate_md5 != 0 ) { if( libhmac_md5_update( imaging_handle->md5_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update MD5 digest hash.", function ); return( -1 ); } } if( imaging_handle->calculate_sha1 != 0 ) { if( libhmac_sha1_update( imaging_handle->sha1_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update SHA1 digest hash.", function ); return( -1 ); } } if( imaging_handle->calculate_sha256 != 0 ) { if( libhmac_sha256_update( imaging_handle->sha256_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update SHA256 digest hash.", function ); return( -1 ); } } return( 1 ); } /* Finalizes the integrity hash(es) * Returns 1 if successful or -1 on error */ int imaging_handle_finalize_integrity_hash( imaging_handle_t *imaging_handle, libcerror_error_t **error ) { uint8_t calculated_md5_hash[ LIBHMAC_MD5_HASH_SIZE ]; uint8_t calculated_sha1_hash[ LIBHMAC_SHA1_HASH_SIZE ]; uint8_t calculated_sha256_hash[ LIBHMAC_SHA256_HASH_SIZE ]; static char *function = "imaging_handle_finalize_integrity_hash"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->calculate_md5 != 0 ) { if( imaging_handle->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid imaging handle - missing calculated MD5 hash string.", function ); return( -1 ); } if( libhmac_md5_finalize( imaging_handle->md5_context, calculated_md5_hash, LIBHMAC_MD5_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize MD5 hash.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_md5_hash, LIBHMAC_MD5_HASH_SIZE, imaging_handle->calculated_md5_hash_string, 33, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBEWF_RUNTIME_ERROR_SET_FAILED, "%s: unable to set calculated MD5 hash string.", function ); return( -1 ); } } if( imaging_handle->calculate_sha1 != 0 ) { if( imaging_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid imaging handle - missing calculated SHA1 hash string.", function ); return( -1 ); } if( libhmac_sha1_finalize( imaging_handle->sha1_context, calculated_sha1_hash, LIBHMAC_SHA1_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize SHA1 hash.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_sha1_hash, LIBHMAC_SHA1_HASH_SIZE, imaging_handle->calculated_sha1_hash_string, 41, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create calculated SHA1 hash string.", function ); return( -1 ); } } if( imaging_handle->calculate_sha256 != 0 ) { if( imaging_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid imaging handle - missing calculated SHA256 hash string.", function ); return( -1 ); } if( libhmac_sha256_finalize( imaging_handle->sha256_context, calculated_sha256_hash, LIBHMAC_SHA256_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize SHA256 hash.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_sha256_hash, LIBHMAC_SHA256_HASH_SIZE, imaging_handle->calculated_sha256_hash_string, 65, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create calculated SHA256 hash string.", function ); return( -1 ); } } return( 1 ); } /* Retrieves the chunk size * Returns 1 if successful or -1 on error */ int imaging_handle_get_chunk_size( imaging_handle_t *imaging_handle, size32_t *chunk_size, libcerror_error_t **error ) { static char *function = "imaging_handle_get_chunk_size"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( chunk_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk size.", function ); return( -1 ); } if( libewf_handle_get_chunk_size( imaging_handle->output_handle, chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); return( -1 ); } return( 1 ); } /* Prompts the user for a string * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_string( imaging_handle_t *imaging_handle, const system_character_t *request_string, system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_string"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; *internal_string_size = 0; } *internal_string_size = IMAGING_HANDLE_STRING_SIZE; *internal_string = system_string_allocate( *internal_string_size ); if( *internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create internal string.", function ); goto on_error; } if( memory_set( *internal_string, 0, *internal_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear internal string.", function ); goto on_error; } result = ewfinput_get_string_variable( imaging_handle->notify_stream, request_string, *internal_string, *internal_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string variable.", function ); goto on_error; } return( result ); on_error: if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; } *internal_string_size = 0; return( -1 ); } /* Prompts the user for the compression method * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_compression_method( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { 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; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } /* experimental version only if( imaging_handle->ewf_format != LIBEWF_FORMAT_V2_ENCASE7 ) */ { compression_methods_amount = 1; } /* experimental version only else { compression_methods_amount = EWFINPUT_COMPRESSION_METHODS_AMOUNT; } */ result = ewfinput_get_fixed_string_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_compression_methods, compression_methods_amount, EWFINPUT_COMPRESSION_METHODS_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_compression_method( fixed_string_variable, &( imaging_handle->compression_method ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression method.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the compression level * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_compression_level( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_compression_level"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_get_fixed_string_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_compression_levels, EWFINPUT_COMPRESSION_LEVELS_AMOUNT, EWFINPUT_COMPRESSION_LEVELS_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_compression_values( fixed_string_variable, &( imaging_handle->compression_level ), &( imaging_handle->compression_flags ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression values.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the format * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_format( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_format"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_get_fixed_string_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_format_types, EWFINPUT_FORMAT_TYPES_AMOUNT, EWFINPUT_FORMAT_TYPES_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_ewf_format( fixed_string_variable, &( imaging_handle->ewf_format ), error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine format.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the media type * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_media_type( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_media_type"; uint8_t default_value = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_REMOVABLE ) { default_value = 1; } else if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_OPTICAL ) { default_value = 2; } else if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_MEMORY ) { default_value = 3; } else { default_value = EWFINPUT_MEDIA_TYPES_DEFAULT; } result = ewfinput_get_fixed_string_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_media_types, EWFINPUT_MEDIA_TYPES_AMOUNT, default_value, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_media_type( fixed_string_variable, &( imaging_handle->media_type ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media type.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the media flags * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_media_flags( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_media_flags"; uint8_t default_value = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( ( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_REMOVABLE ) || ( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_OPTICAL ) ) { default_value = 0; } else { default_value = 1; } result = ewfinput_get_fixed_string_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_media_flags, EWFINPUT_MEDIA_FLAGS_AMOUNT, default_value, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_media_flags( fixed_string_variable, &( imaging_handle->media_flags ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media flags.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the bytes per sector * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_bytes_per_sector( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_bytes_per_sector"; uint64_t size_variable = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_get_size_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, 1, UINT32_MAX, imaging_handle->bytes_per_sector, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } else if( result != 0 ) { imaging_handle->bytes_per_sector = (uint32_t) size_variable; } return( result ); } /* Prompts the user for the number of sectors per chunk * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_sectors_per_chunk( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_sectors_per_chunk"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_get_fixed_string_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_sector_per_block_sizes, EWFINPUT_SECTOR_PER_BLOCK_SIZES_AMOUNT, EWFINPUT_SECTOR_PER_BLOCK_SIZES_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_sectors_per_chunk( fixed_string_variable, &( imaging_handle->sectors_per_chunk ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sectors per chunk.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the sector error granularity * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_sector_error_granularity( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_sector_error_granularity"; uint64_t size_variable = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_get_size_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, 1, imaging_handle->sectors_per_chunk, (uint64_t) imaging_handle->sectors_per_chunk, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } else if( result != 0 ) { imaging_handle->sector_error_granularity = (uint32_t) size_variable; } else { imaging_handle->sector_error_granularity = imaging_handle->sectors_per_chunk; } return( result ); } /* Prompts the user for the maximum segment size * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_maximum_segment_size( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_maximum_segment_size"; uint64_t default_size = 0; uint64_t size_variable = 0; uint64_t maximum_size = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) { maximum_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT; } else { maximum_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT; } if( default_size == 0 ) { default_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; } result = ewfinput_get_byte_size_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE, maximum_size, default_size, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } imaging_handle->maximum_segment_size = size_variable; return( result ); } /* Prompts the user for the acquiry offset * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_acquiry_offset( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_acquiry_offset"; uint64_t input_size_variable = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_get_size_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, 0, imaging_handle->input_media_size, imaging_handle->acquiry_offset, &input_size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } imaging_handle->acquiry_offset = input_size_variable; return( result ); } /* Prompts the user for the acquiry size * Returns 1 if successful, 0 if no input was provided or -1 on error */ int imaging_handle_prompt_for_acquiry_size( imaging_handle_t *imaging_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_acquiry_size"; uint64_t default_input_size = 0; uint64_t input_size_variable = 0; uint64_t maximum_input_size = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } maximum_input_size = imaging_handle->input_media_size - imaging_handle->acquiry_offset; if( ( imaging_handle->acquiry_size == 0 ) || ( imaging_handle->acquiry_size > maximum_input_size ) ) { default_input_size = maximum_input_size; } else { default_input_size = imaging_handle->acquiry_size; } result = ewfinput_get_size_variable( imaging_handle->notify_stream, imaging_handle->input_buffer, IMAGING_HANDLE_INPUT_BUFFER_SIZE, request_string, 0, maximum_input_size, default_input_size, &input_size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } imaging_handle->acquiry_size = input_size_variable; return( result ); } /* Retrieves the output values of the imaging handle * Returns 1 if successful or -1 on error */ int imaging_handle_get_output_values( imaging_handle_t *imaging_handle, libcerror_error_t **error ) { static char *function = "imaging_handle_get_output_values"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle_get_header_value( imaging_handle, (uint8_t *) "case_number", 11, &( imaging_handle->case_number ), &( imaging_handle->case_number_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: case_number.", function ); return( -1 ); } if( imaging_handle_get_header_value( imaging_handle, (uint8_t *) "description", 11, &( imaging_handle->description ), &( imaging_handle->description_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: description.", function ); return( -1 ); } if( imaging_handle_get_header_value( imaging_handle, (uint8_t *) "evidence_number", 15, &( imaging_handle->evidence_number ), &( imaging_handle->evidence_number_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: evidence_number.", function ); return( -1 ); } if( imaging_handle_get_header_value( imaging_handle, (uint8_t *) "examiner_name", 13, &( imaging_handle->examiner_name ), &( imaging_handle->examiner_name_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: examiner_name.", function ); return( -1 ); } if( imaging_handle_get_header_value( imaging_handle, (uint8_t *) "notes", 5, &( imaging_handle->notes ), &( imaging_handle->notes_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: notes.", function ); return( -1 ); } if( libewf_handle_get_bytes_per_sector( imaging_handle->output_handle, &( imaging_handle->bytes_per_sector ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector.", function ); return( -1 ); } if( libewf_handle_get_media_size( imaging_handle->output_handle, &( imaging_handle->acquiry_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); return( -1 ); } if( libewf_handle_get_media_type( imaging_handle->output_handle, &( imaging_handle->media_type ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media type.", function ); return( -1 ); } if( libewf_handle_get_media_flags( imaging_handle->output_handle, &( imaging_handle->media_flags ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media flags.", function ); return( -1 ); } if( libewf_handle_get_compression_values( imaging_handle->output_handle, &( imaging_handle->compression_level ), &( imaging_handle->compression_flags ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve compression values.", function ); return( -1 ); } if( libewf_handle_get_format( imaging_handle->output_handle, &( imaging_handle->ewf_format ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve format.", function ); return( -1 ); } if( libewf_handle_get_maximum_segment_size( imaging_handle->output_handle, &( imaging_handle->maximum_segment_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve maximum segment size.", function ); return( -1 ); } if( libewf_handle_get_sectors_per_chunk( imaging_handle->output_handle, &( imaging_handle->sectors_per_chunk ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sectors per chunk.", function ); return( -1 ); } if( libewf_handle_get_error_granularity( imaging_handle->output_handle, &( imaging_handle->sector_error_granularity ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve error granularity.", function ); return( -1 ); } return( 1 ); } /* Sets a string * Returns 1 if successful or -1 on error */ int imaging_handle_set_string( imaging_handle_t *imaging_handle, const system_character_t *string, system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { static char *function = "imaging_handle_set_string"; size_t string_length = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; *internal_string_size = 0; } string_length = system_string_length( string ); if( string_length > 0 ) { *internal_string = system_string_allocate( string_length + 1 ); if( *internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create internal string.", function ); goto on_error; } if( system_string_copy( *internal_string, string, string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string.", function ); goto on_error; } ( *internal_string )[ string_length ] = 0; *internal_string_size = string_length + 1; } return( 1 ); on_error: if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; } *internal_string_size = 0; return( -1 ); } /* Sets the compression values * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_compression_values( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { 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; int number_of_segments = 0; int result = 0; int segment_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; #endif if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } string_length = system_string_length( string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, (wchar_t) ':', &string_elements, error ) != 1 ) #else if( libcsplit_narrow_string_split( string, string_length + 1, (char) ':', &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); return( -1 ); } if( ( number_of_segments != 1 ) && ( number_of_segments != 2 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of segments is out of bounds.", function ); return( -1 ); } if( number_of_segments == 2 ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } result = ewfinput_determine_compression_method( string_segment, &( imaging_handle->compression_method ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression method.", function ); goto on_error; } /* experimental version only if( imaging_handle->ewf_format != LIBEWF_FORMAT_V2_ENCASE7 ) */ { if( imaging_handle->compression_method != LIBEWF_COMPRESSION_METHOD_DEFLATE ) { imaging_handle->compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; result = 0; } } segment_index++; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } result = ewfinput_determine_compression_values( string_segment, &( imaging_handle->compression_level ), &( imaging_handle->compression_flags ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression values.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) #else if( libcsplit_narrow_split_string_free( &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split string.", function ); goto on_error; } return( result ); on_error: if( string_elements != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); #else libcsplit_narrow_split_string_free( &string_elements, NULL ); #endif } return( -1 ); } /* Sets the format * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_format( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_format"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_determine_ewf_format( string, &( imaging_handle->ewf_format ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine format.", function ); return( -1 ); } return( result ); } /* Sets the media type * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_media_type( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_media_type"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_determine_media_type( string, &( imaging_handle->media_type ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media type.", function ); return( -1 ); } return( result ); } /* Sets the media flags * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_media_flags( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_media_flags"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_determine_media_flags( string, &( imaging_handle->media_flags ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine media flags.", function ); return( -1 ); } return( result ); } /* Sets the bytes per sector * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_bytes_per_sector( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_bytes_per_sector"; size_t string_length = 0; uint64_t size_variable = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine bytes per sector.", function ); return( -1 ); } else if( result != 0 ) { if( size_variable > (uint64_t) UINT32_MAX ) { result = 0; } else { imaging_handle->bytes_per_sector = (uint32_t) size_variable; } } return( result ); } /* Sets the number of sectors per chunk * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_sectors_per_chunk( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_sectors_per_chunk"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_determine_sectors_per_chunk( string, &( imaging_handle->sectors_per_chunk ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sectors per chunk.", function ); return( -1 ); } return( result ); } /* Sets the sector error granularity * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_sector_error_granularity( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_sector_error_granularity"; size_t string_length = 0; uint64_t size_variable = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sector error granularity.", function ); return( -1 ); } else if( result != 0 ) { if( ( size_variable > (uint64_t) UINT32_MAX ) || ( size_variable > imaging_handle->sectors_per_chunk ) ) { size_variable = imaging_handle->sectors_per_chunk; result = 0; } imaging_handle->sector_error_granularity = (uint32_t) size_variable; } return( result ); } /* Sets the maximum segment file size * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_maximum_segment_size( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_maximum_segment_size"; size_t string_length = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &( imaging_handle->maximum_segment_size ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine maximum segment size.", function ); return( -1 ); } else if( result != 0 ) { if( imaging_handle->maximum_segment_size < EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE ) { result = 0; } else if( imaging_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) { if( imaging_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT ) { result = 0; } } else { if( imaging_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ) { result = 0; } } if( result == 0 ) { imaging_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; } } return( result ); } /* Sets the acquiry offset * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_acquiry_offset( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_acquiry_offset"; size_t string_length = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string[ 0 ] != (system_character_t) '-' ) { string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( string, string_length + 1, &( imaging_handle->acquiry_offset ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine acquiry offset.", function ); return( -1 ); } result = 1; } return( result ); } /* Sets the acquiry size * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_acquiry_size( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_acquiry_size"; size_t string_length = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string[ 0 ] != (system_character_t) '-' ) { string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( string, string_length + 1, &( imaging_handle->acquiry_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine acquiry size.", function ); return( -1 ); } result = 1; } return( result ); } /* Sets the header codepage * Returns 1 if successful or -1 on error */ int imaging_handle_set_header_codepage( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_header_codepage"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } result = ewfinput_determine_header_codepage( string, &imaging_handle->header_codepage, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine header codepage.", function ); return( -1 ); } return( result ); } /* Sets the process buffer size * Returns 1 if successful, 0 if unsupported value or -1 on error */ int imaging_handle_set_process_buffer_size( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_process_buffer_size"; size_t string_length = 0; uint64_t size_variable = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine process buffer size.", function ); return( -1 ); } else if( result != 0 ) { if( size_variable > (uint64_t) SSIZE_MAX ) { imaging_handle->process_buffer_size = 0; result = 0; } else { imaging_handle->process_buffer_size = (size_t) size_variable; } } return( result ); } /* Sets the additional digest types * Returns 1 if successful or -1 on error */ int imaging_handle_set_additional_digest_types( imaging_handle_t *imaging_handle, const system_character_t *string, libcerror_error_t **error ) { 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; uint8_t calculate_sha1 = 0; uint8_t calculate_sha256 = 0; int number_of_segments = 0; int result = 0; int segment_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; #endif if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } string_length = system_string_length( string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, (wchar_t) ',', &string_elements, error ) != 1 ) #else if( libcsplit_narrow_string_split( string, string_length + 1, (char) ',', &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); goto on_error; } for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } if( string_segment_size == 5 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha1" ), 4 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA1" ), 4 ) == 0 ) { calculate_sha1 = 1; } } else if( string_segment_size == 6 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "sha_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } } else if( string_segment_size == 7 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha256" ), 6 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA256" ), 6 ) == 0 ) { calculate_sha256 = 1; } } else if( string_segment_size == 8 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "sha_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } } } if( ( calculate_sha1 != 0 ) && ( imaging_handle->calculate_sha1 == 0 ) ) { imaging_handle->calculated_sha1_hash_string = system_string_allocate( 41 ); if( imaging_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated SHA1 digest hash string.", function ); goto on_error; } imaging_handle->calculate_sha1 = 1; } if( ( calculate_sha256 != 0 ) && ( imaging_handle->calculate_sha256 == 0 ) ) { imaging_handle->calculated_sha256_hash_string = system_string_allocate( 65 ); if( imaging_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated SHA256 digest hash string.", function ); goto on_error; } imaging_handle->calculate_sha256 = 1; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) #else if( libcsplit_narrow_split_string_free( &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split string.", function ); goto on_error; } return( result ); on_error: if( string_elements != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); #else libcsplit_narrow_split_string_free( &string_elements, NULL ); #endif } return( -1 ); } /* TODO refactor into a function that sets all the output values * for a single output handle, repeat it for the secondary output handle if necessary * this requires to unfold imaging_handle_set_header_value */ /* Sets the output values of the imaging handle * Returns 1 if successful or -1 on error */ int imaging_handle_set_output_values( imaging_handle_t *imaging_handle, system_character_t *acquiry_software, system_character_t *acquiry_software_version, system_character_t *model, system_character_t *serial_number, libcerror_error_t **error ) { system_character_t acquiry_operating_system[ 32 ]; #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) uint8_t guid[ GUID_SIZE ]; uint8_t guid_type = 0; #endif static char *function = "imaging_handle_set_output_values"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->case_number != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "case_number", 11, imaging_handle->case_number, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: case_number.", function ); return( -1 ); } } if( imaging_handle->description != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "description", 11, imaging_handle->description, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: description.", function ); return( -1 ); } } if( imaging_handle->evidence_number != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "evidence_number", 15, imaging_handle->evidence_number, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: evidence_number.", function ); return( -1 ); } } if( imaging_handle->examiner_name != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "examiner_name", 13, imaging_handle->examiner_name, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: examiner_name.", function ); return( -1 ); } } if( imaging_handle->notes != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "notes", 5, imaging_handle->notes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: notes.", function ); return( -1 ); } } /* Password is not used within libewf */ /* Acquiry date, system date and compression level will be generated automatically when set to NULL */ /* Set acquiry operating system, software and software version */ if( platform_get_operating_system( acquiry_operating_system, 32, error ) != 1 ) { #if defined( HAVE_DEBUG_OUTPUT ) libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve operating system.", function ); if( ( error != NULL ) && ( *error != NULL ) ) { libcnotify_print_error_backtrace( *error ); } #endif libcerror_error_free( error ); } else { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "acquiry_operating_system", 24, acquiry_operating_system, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry_operating_system.", function ); return( -1 ); } } if( acquiry_software != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "acquiry_software", 16, acquiry_software, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry_software.", function ); return( -1 ); } } if( acquiry_software_version != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "acquiry_software_version", 24, acquiry_software_version, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry_software_version.", function ); return( -1 ); } } if( model != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "model", 5, model, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: model.", function ); return( -1 ); } } if( serial_number != NULL ) { if( imaging_handle_set_header_value( imaging_handle, (uint8_t *) "serial_number", 13, serial_number, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: serial_number.", function ); return( -1 ); } } if( libewf_handle_set_header_codepage( imaging_handle->output_handle, imaging_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); return( -1 ); } if( libewf_handle_set_bytes_per_sector( imaging_handle->output_handle, imaging_handle->bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set bytes per sector.", function ); return( -1 ); } if( libewf_handle_set_media_size( imaging_handle->output_handle, imaging_handle->acquiry_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media size.", function ); return( -1 ); } if( libewf_handle_set_media_type( imaging_handle->output_handle, imaging_handle->media_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media type.", function ); return( -1 ); } if( libewf_handle_set_media_flags( imaging_handle->output_handle, imaging_handle->media_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media flags.", function ); return( -1 ); } /* Format needs to be set before segment file size and compression values */ if( libewf_handle_set_format( imaging_handle->output_handle, imaging_handle->ewf_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set format.", function ); return( -1 ); } /* experimental version only if( libewf_handle_set_compression_method( imaging_handle->output_handle, imaging_handle->compression_method, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compression method.", function ); return( -1 ); } */ if( libewf_handle_set_compression_values( imaging_handle->output_handle, imaging_handle->compression_level, imaging_handle->compression_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compression values.", function ); return( -1 ); } if( libewf_handle_set_maximum_segment_size( imaging_handle->output_handle, imaging_handle->maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size.", function ); return( -1 ); } if( libewf_handle_set_sectors_per_chunk( imaging_handle->output_handle, imaging_handle->sectors_per_chunk, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sectors per chunk.", function ); return( -1 ); } if( ( imaging_handle->sector_error_granularity == 0 ) || ( imaging_handle->sector_error_granularity >= imaging_handle->sectors_per_chunk ) ) { imaging_handle->sector_error_granularity = imaging_handle->sectors_per_chunk; } if( libewf_handle_set_error_granularity( imaging_handle->output_handle, imaging_handle->sector_error_granularity, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set error granularity.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_set_header_codepage( imaging_handle->secondary_output_handle, imaging_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_bytes_per_sector( imaging_handle->secondary_output_handle, imaging_handle->bytes_per_sector, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set bytes per sector in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_media_size( imaging_handle->secondary_output_handle, imaging_handle->acquiry_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media size in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_media_type( imaging_handle->secondary_output_handle, imaging_handle->media_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media type in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_media_flags( imaging_handle->secondary_output_handle, imaging_handle->media_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media flags in secondary output handle.", function ); return( -1 ); } /* Format needs to be set before segment file size and compression values */ if( libewf_handle_set_format( imaging_handle->secondary_output_handle, imaging_handle->ewf_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set format in secondary output handle.", function ); return( -1 ); } /* experimental version only if( libewf_handle_set_compression_method( imaging_handle->secondary_output_handle, imaging_handle->compression_method, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compression method in secondary output handle.", function ); return( -1 ); } */ if( libewf_handle_set_compression_values( imaging_handle->secondary_output_handle, imaging_handle->compression_level, imaging_handle->compression_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compression values in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_maximum_segment_size( imaging_handle->secondary_output_handle, imaging_handle->maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_sectors_per_chunk( imaging_handle->secondary_output_handle, imaging_handle->sectors_per_chunk, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sectors per chunk in secondary output handle.", function ); return( -1 ); } if( libewf_handle_set_error_granularity( imaging_handle->secondary_output_handle, imaging_handle->sector_error_granularity, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set error granularity in secondary output handle.", function ); return( -1 ); } } #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) if( ( imaging_handle->ewf_format == LIBEWF_FORMAT_ENCASE5 ) || ( imaging_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) || ( imaging_handle->ewf_format == LIBEWF_FORMAT_EWFX ) ) { guid_type = GUID_TYPE_RANDOM; } else if( ( imaging_handle->ewf_format == LIBEWF_FORMAT_LINEN5 ) || ( imaging_handle->ewf_format == LIBEWF_FORMAT_LINEN6 ) ) { guid_type = GUID_TYPE_TIME; } if( guid_type != 0 ) { /* Set GUID if necessary */ if( guid_generate( guid, GUID_SIZE, guid_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to generate GUID for set identifier.", function ); return( -1 ); } if( libewf_handle_set_segment_file_set_identifier( imaging_handle->output_handle, guid, GUID_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file set identifier.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_set_segment_file_set_identifier( imaging_handle->secondary_output_handle, guid, GUID_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file set identifier in secondary output handle.", function ); return( -1 ); } } } #endif return( 1 ); } /* Retrieves the header value * Returns 1 if successful or -1 on error */ int imaging_handle_get_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_size, system_character_t **header_value, size_t *header_value_size, libcerror_error_t **error ) { static char *function = "imaging_handle_get_header_value"; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( header_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header value.", function ); return( -1 ); } if( header_value_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header value size.", function ); return( -1 ); } if( *header_value != NULL ) { memory_free( *header_value ); *header_value = NULL; *header_value_size = 0; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value_size( imaging_handle->output_handle, identifier, identifier_size, header_value_size, error ); #else result = libewf_handle_get_utf8_header_value_size( imaging_handle->output_handle, identifier, identifier_size, header_value_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); return( -1 ); } if( ( result != 0 ) && ( *header_value_size > 0 ) ) { *header_value = system_string_allocate( *header_value_size ); if( *header_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create header value: %s.", function, (char *) identifier ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( imaging_handle->output_handle, identifier, identifier_size, (uint16_t *) *header_value, *header_value_size, error ); #else result = libewf_handle_get_utf8_header_value( imaging_handle->output_handle, identifier, identifier_size, (uint8_t *) *header_value, *header_value_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve header value: %s.", function, (char *) identifier ); goto on_error; } } return( 1 ); on_error: if( *header_value != NULL ) { memory_free( *header_value ); *header_value = NULL; } *header_value_size = 0; return( -1 ); } /* Sets the header value in the output handle * Returns 1 if successful or -1 on error */ int imaging_handle_set_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_length, const system_character_t *header_value, libcerror_error_t **error ) { static char *function = "imaging_handle_set_header_value"; size_t header_value_length = 0; int result = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( header_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header value.", function ); return( -1 ); } header_value_length = system_string_length( header_value ); if( header_value_length > 0 ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( imaging_handle->output_handle, identifier, identifier_length, (uint16_t *) header_value, header_value_length, error ); #else result = libewf_handle_set_utf8_header_value( imaging_handle->output_handle, identifier, identifier_length, (uint8_t *) header_value, header_value_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s.", function, (char *) identifier ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( imaging_handle->secondary_output_handle, identifier, identifier_length, (uint16_t *) header_value, header_value_length, error ); #else result = libewf_handle_set_utf8_header_value( imaging_handle->secondary_output_handle, identifier, identifier_length, (uint8_t *) header_value, header_value_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: %s in secondary output handle.", function, (char *) identifier ); return( -1 ); } } } return( 1 ); } /* Sets the hash value in the output handle * Returns 1 if successful or -1 on error */ int imaging_handle_set_hash_value( imaging_handle_t *imaging_handle, char *hash_value_identifier, size_t hash_value_identifier_length, system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ) { uint8_t *utf8_hash_value = NULL; static char *function = "imaging_handle_set_hash_value"; size_t utf8_hash_value_size = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( ewftools_string_size_to_utf8_string( hash_value, hash_value_length + 1, &utf8_hash_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine UTF-8 hash value size.", function ); goto on_error; } utf8_hash_value = (uint8_t *) memory_allocate( sizeof( uint8_t ) * utf8_hash_value_size ); if( utf8_hash_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create UTF-8 hash value.", function ); goto on_error; } if( ewftools_string_copy_to_utf8_string( hash_value, hash_value_length + 1, utf8_hash_value, utf8_hash_value_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set UTF-8 hash value.", function ); goto on_error; } if( libewf_handle_set_utf8_hash_value( imaging_handle->output_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, utf8_hash_value, utf8_hash_value_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s.", function, hash_value_identifier ); goto on_error; } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_set_utf8_hash_value( imaging_handle->secondary_output_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, utf8_hash_value, utf8_hash_value_size - 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s in secondary output handle.", function, hash_value_identifier ); goto on_error; } } memory_free( utf8_hash_value ); return( 1 ); on_error: if( utf8_hash_value != NULL ) { memory_free( utf8_hash_value ); } return( -1 ); } /* Appends a read error to the output handle * Returns 1 if successful or -1 on error */ int imaging_handle_append_read_error( imaging_handle_t *imaging_handle, off64_t start_offset, size64_t number_of_bytes, libcerror_error_t **error ) { static char *function = "imaging_handle_append_read_error"; uint64_t number_of_sectors = 0; uint64_t start_sector = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid imaging handle - invalid bytes per sector value out of bounds.", function ); return( -1 ); } start_sector = start_offset / imaging_handle->bytes_per_sector; number_of_sectors = number_of_bytes / imaging_handle->bytes_per_sector; if( ( number_of_bytes % imaging_handle->bytes_per_sector ) != 0 ) { number_of_sectors += 1; } if( libewf_handle_append_acquiry_error( imaging_handle->output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append acquiry error.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_append_acquiry_error( imaging_handle->secondary_output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append acquiry error to secondary output handle.", function ); return( -1 ); } } return( 1 ); } /* Appends a session to the output handle * Returns 1 if successful or -1 on error */ int imaging_handle_append_session( imaging_handle_t *imaging_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { static char *function = "imaging_handle_append_session"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( libewf_handle_append_session( imaging_handle->output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_append_session( imaging_handle->secondary_output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append session to secondary output handle.", function ); return( -1 ); } } return( 1 ); } /* Appends a track to the output handle * Returns 1 if successful or -1 on error */ int imaging_handle_append_track( imaging_handle_t *imaging_handle, uint64_t start_sector, uint64_t number_of_sectors, libcerror_error_t **error ) { static char *function = "imaging_handle_append_track"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( libewf_handle_append_track( imaging_handle->output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { if( libewf_handle_append_track( imaging_handle->secondary_output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append track to secondary output handle.", function ); return( -1 ); } } return( 1 ); } /* Finalizes the imaging handle * Returns the number of input bytes written or -1 on error */ ssize_t imaging_handle_finalize( imaging_handle_t *imaging_handle, libcerror_error_t **error ) { static char *function = "imaging_handle_finalize"; ssize_t secondary_write_count = 0; ssize_t write_count = 0; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->calculate_md5 != 0 ) { if( imaging_handle_set_hash_value( imaging_handle, "MD5", 3, imaging_handle->calculated_md5_hash_string, 32, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: MD5.", function ); return( -1 ); } } if( imaging_handle->calculate_sha1 != 0 ) { if( imaging_handle_set_hash_value( imaging_handle, "SHA1", 4, imaging_handle->calculated_sha1_hash_string, 40, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA1.", function ); return( -1 ); } } if( imaging_handle->calculate_sha256 != 0 ) { if( imaging_handle_set_hash_value( imaging_handle, "SHA256", 6, imaging_handle->calculated_sha256_hash_string, 64, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA256.", function ); return( -1 ); } } write_count = libewf_handle_write_finalize( imaging_handle->output_handle, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize output handle.", function ); return( -1 ); } if( imaging_handle->secondary_output_handle != NULL ) { secondary_write_count = libewf_handle_write_finalize( imaging_handle->secondary_output_handle, error ); if( secondary_write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize secondary output handle.", function ); return( -1 ); } } return( write_count ); } /* Prints an overview of the parameters * Returns 1 if successful or -1 on error */ int imaging_handle_print_parameters( imaging_handle_t *imaging_handle, off64_t resume_acquiry_offset, uint8_t read_error_retries, uint8_t zero_block_on_read_error, uint8_t resume_acquiry, libcerror_error_t **error ) { 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; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( imaging_handle->notify_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid imaging handle - missing notify stream.", function ); return( -1 ); } if( imaging_handle->target_filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid imaging handle - missing target filename.", function ); return( -1 ); } fprintf( imaging_handle->notify_stream, "Image path and filename:\t\t%" PRIs_SYSTEM "", imaging_handle->target_filename ); if( resume_acquiry == 0 ) { if( imaging_handle->ewf_format == LIBEWF_FORMAT_SMART ) { fprintf( imaging_handle->notify_stream, ".s01" ); } else if( ( imaging_handle->ewf_format == LIBEWF_FORMAT_EWF ) || ( imaging_handle->ewf_format == LIBEWF_FORMAT_EWFX ) ) { fprintf( imaging_handle->notify_stream, ".e01" ); } else { fprintf( imaging_handle->notify_stream, ".E01" ); } } fprintf( imaging_handle->notify_stream, "\n" ); if( imaging_handle->secondary_target_filename != NULL ) { fprintf( imaging_handle->notify_stream, "Secondary copy:\t\t\t\t%" PRIs_SYSTEM "", imaging_handle->secondary_target_filename ); if( resume_acquiry == 0 ) { if( imaging_handle->ewf_format == LIBEWF_FORMAT_SMART ) { fprintf( imaging_handle->notify_stream, "s01" ); } else if( ( imaging_handle->ewf_format == LIBEWF_FORMAT_EWF ) || ( imaging_handle->ewf_format == LIBEWF_FORMAT_EWFX ) ) { fprintf( imaging_handle->notify_stream, "e01" ); } else { fprintf( imaging_handle->notify_stream, "E01" ); } } fprintf( imaging_handle->notify_stream, "\n" ); } fprintf( imaging_handle->notify_stream, "Case number:\t\t\t\t" ); if( imaging_handle->case_number != NULL ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM "", imaging_handle->case_number ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Description:\t\t\t\t" ); if( imaging_handle->description != NULL ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM "", imaging_handle->description ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Evidence number:\t\t\t" ); if( imaging_handle->evidence_number != NULL ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM "", imaging_handle->evidence_number ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Examiner name:\t\t\t\t" ); if( imaging_handle->examiner_name != NULL ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM "", imaging_handle->examiner_name ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Notes:\t\t\t\t\t" ); if( imaging_handle->notes != NULL ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM "", imaging_handle->notes ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Media type:\t\t\t\t" ); if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_FIXED ) { fprintf( imaging_handle->notify_stream, "fixed disk" ); } else if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_REMOVABLE ) { fprintf( imaging_handle->notify_stream, "removable disk" ); } else if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_OPTICAL ) { fprintf( imaging_handle->notify_stream, "optical disk (CD/DVD/BD)" ); } else if( imaging_handle->media_type == LIBEWF_MEDIA_TYPE_MEMORY ) { fprintf( imaging_handle->notify_stream, "memory (RAM)" ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Is physical:\t\t\t\t" ); if( ( imaging_handle->media_flags & LIBEWF_MEDIA_FLAG_PHYSICAL ) != 0 ) { fprintf( imaging_handle->notify_stream, "yes" ); } else { fprintf( imaging_handle->notify_stream, "no" ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "EWF file format:\t\t\t" ); switch( imaging_handle->ewf_format ) { case LIBEWF_FORMAT_EWF: fprintf( imaging_handle->notify_stream, "original EWF (.e01)" ); break; case LIBEWF_FORMAT_ENCASE1: fprintf( imaging_handle->notify_stream, "EnCase 1 (.E01)" ); break; case LIBEWF_FORMAT_ENCASE2: fprintf( imaging_handle->notify_stream, "EnCase 2 (.E01)" ); break; case LIBEWF_FORMAT_ENCASE3: fprintf( imaging_handle->notify_stream, "EnCase 3 (.E01)" ); break; case LIBEWF_FORMAT_ENCASE4: fprintf( imaging_handle->notify_stream, "EnCase 4 (.E01)" ); break; case LIBEWF_FORMAT_ENCASE5: fprintf( imaging_handle->notify_stream, "EnCase 5 (.E01)" ); break; case LIBEWF_FORMAT_ENCASE6: fprintf( imaging_handle->notify_stream, "EnCase 6 (.E01)" ); break; /* experimental version only case LIBEWF_FORMAT_ENCASE7: fprintf( imaging_handle->notify_stream, "EnCase 7 (.E01)" ); break; */ case LIBEWF_FORMAT_SMART: fprintf( imaging_handle->notify_stream, "SMART (.s01)" ); break; case LIBEWF_FORMAT_FTK: fprintf( imaging_handle->notify_stream, "FTK Imager (.E01)" ); break; case LIBEWF_FORMAT_LINEN5: fprintf( imaging_handle->notify_stream, "linen 5 (.E01)" ); break; case LIBEWF_FORMAT_LINEN6: fprintf( imaging_handle->notify_stream, "linen 6 (.E01)" ); break; /* experimental version only case LIBEWF_FORMAT_LINEN7: fprintf( imaging_handle->notify_stream, "linen 7 (.E01)" ); break; case LIBEWF_FORMAT_V2_ENCASE7: fprintf( imaging_handle->notify_stream, "EnCase 7 (.Ex01)" ); break; */ case LIBEWF_FORMAT_EWFX: fprintf( imaging_handle->notify_stream, "extended EWF (ewfx) (.e01)" ); break; } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Compression method:\t\t\t" ); /* experimental version only if( imaging_handle->compression_method == LIBEWF_COMPRESSION_METHOD_DEFLATE ) */ { fprintf( imaging_handle->notify_stream, "deflate" ); } /* experimental version only else if( imaging_handle->compression_method == LIBEWF_COMPRESSION_METHOD_BZIP2 ) { fprintf( imaging_handle->notify_stream, "bzip2" ); } */ fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Compression level:\t\t\t" ); if( imaging_handle->compression_level == LIBEWF_COMPRESSION_FAST ) { fprintf( imaging_handle->notify_stream, "fast" ); } else if( imaging_handle->compression_level == LIBEWF_COMPRESSION_BEST ) { fprintf( imaging_handle->notify_stream, "best" ); } else if( imaging_handle->compression_level == LIBEWF_COMPRESSION_NONE ) { if( ( imaging_handle->compression_flags & LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION ) != 0 ) { fprintf( imaging_handle->notify_stream, "empty-block" ); } else { fprintf( imaging_handle->notify_stream, "none" ); } } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Acquiry start offset:\t\t\t%" PRIi64 "\n", imaging_handle->acquiry_offset ); if( resume_acquiry != 0 ) { fprintf( imaging_handle->notify_stream, "Resuming acquiry at offset:\t\t%" PRIi64 "\n", resume_acquiry_offset ); } fprintf( imaging_handle->notify_stream, "Number of bytes to acquire:\t\t" ); if( imaging_handle->acquiry_size == 0 ) { fprintf( imaging_handle->notify_stream, "%" PRIu64 " (until end of input)", imaging_handle->acquiry_size ); } else { result = byte_size_string_create( acquiry_size_string, 16, imaging_handle->acquiry_size, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); if( result == 1 ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM " (%" PRIu64 " bytes)", acquiry_size_string, imaging_handle->acquiry_size ); } else { fprintf( imaging_handle->notify_stream, "%" PRIu64 " bytes", imaging_handle->acquiry_size ); } } fprintf( imaging_handle->notify_stream, "\n" ); result = byte_size_string_create( maximum_segment_size_string, 16, imaging_handle->maximum_segment_size, BYTE_SIZE_STRING_UNIT_MEBIBYTE, NULL ); fprintf( imaging_handle->notify_stream, "Evidence segment file size:\t\t" ); if( result == 1 ) { fprintf( imaging_handle->notify_stream, "%" PRIs_SYSTEM " (%" PRIu64 " bytes)", maximum_segment_size_string, imaging_handle->maximum_segment_size ); } else { fprintf( imaging_handle->notify_stream, "%" PRIu64 " bytes", imaging_handle->maximum_segment_size ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "Bytes per sector:\t\t\t%" PRIu32 "\n", imaging_handle->bytes_per_sector ); fprintf( imaging_handle->notify_stream, "Block size:\t\t\t\t%" PRIu32 " sectors\n", imaging_handle->sectors_per_chunk ); fprintf( imaging_handle->notify_stream, "Error granularity:\t\t\t%" PRIu32 " sectors\n", imaging_handle->sector_error_granularity ); fprintf( imaging_handle->notify_stream, "Retries on read error:\t\t\t%" PRIu8 "\n", read_error_retries ); fprintf( imaging_handle->notify_stream, "Zero sectors on read error:\t\t" ); if( zero_block_on_read_error == 0 ) { fprintf( imaging_handle->notify_stream, "no" ); } else { fprintf( imaging_handle->notify_stream, "yes" ); } fprintf( imaging_handle->notify_stream, "\n" ); fprintf( imaging_handle->notify_stream, "\n" ); return( 1 ); } /* Prints the hashes * Returns 1 if successful or -1 on error */ int imaging_handle_print_hashes( imaging_handle_t *imaging_handle, FILE *stream, libcerror_error_t **error ) { static char *function = "imaging_handle_print_hashes"; if( imaging_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid imaging stream.", function ); return( -1 ); } if( imaging_handle->calculate_md5 != 0 ) { fprintf( stream, "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_SYSTEM "\n", imaging_handle->calculated_sha1_hash_string ); } if( imaging_handle->calculate_sha256 != 0 ) { fprintf( stream, "SHA256 hash calculated over data:\t%" PRIs_SYSTEM "\n", imaging_handle->calculated_sha256_hash_string ); } return( 1 ); } libewf-20140807/ewftools/ewftools_libfvalue.h0000664000175000017500000000333613440662654023256 0ustar00lordyestalordyesta00000000000000/* * The libfvalue header wrapper * * Copyright (C) 2006-2019, 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_LIBFVALUE_H ) #define _EWFTOOLS_LIBFVALUE_H #include /* Define HAVE_LOCAL_LIBFVALUE for local use of libfvalue */ #if defined( HAVE_LOCAL_LIBFVALUE ) #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBFVALUE_DLL_IMPORT * before including libfvalue.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFVALUE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFVALUE ) */ #endif /* !defined( _EWFTOOLS_LIBFVALUE_H ) */ libewf-20140807/ewftools/log_handle.c0000644000175000017500000001346213421020221021422 0ustar00lordyestalordyesta00000000000000/* * Log handle * * Copyright (C) 2006-2017, 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 . */ #include #include #include #include #include #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #include #elif defined( HAVE_VARARGS_H ) #include #else #error Missing headers stdarg.h and varargs.h #endif #include "ewftools_libcerror.h" #include "log_handle.h" /* Creates a log handle * Make sure the value log_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int log_handle_initialize( log_handle_t **log_handle, libcerror_error_t **error ) { static char *function = "log_handle_initialize"; if( log_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid log handle.", function ); return( -1 ); } if( *log_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid log handle value already set.", function ); return( -1 ); } *log_handle = memory_allocate_structure( log_handle_t ); if( *log_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create log handle.", function ); goto on_error; } if( memory_set( *log_handle, 0, sizeof( log_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear log handle.", function ); goto on_error; } return( 1 ); on_error: if( *log_handle != NULL ) { memory_free( *log_handle ); *log_handle = NULL; } return( -1 ); } /* Frees a log handle * Returns 1 if successful or -1 on error */ int log_handle_free( log_handle_t **log_handle, libcerror_error_t **error ) { static char *function = "log_handle_free"; if( log_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid log handle.", function ); return( -1 ); } if( *log_handle != NULL ) { memory_free( *log_handle ); *log_handle = NULL; } return( 1 ); } /* Opens the log handle * Returns 1 if successful or -1 on error */ int log_handle_open( log_handle_t *log_handle, const system_character_t *filename, libcerror_error_t **error ) { static char *function = "log_handle_open"; if( log_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid log handle.", function ); return( -1 ); } if( filename != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) log_handle->log_stream = file_stream_open_wide( filename, _SYSTEM_STRING( FILE_STREAM_OPEN_APPEND ) ); #else log_handle->log_stream = file_stream_open( filename, FILE_STREAM_OPEN_APPEND ); #endif if( log_handle->log_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file.", function ); return( -1 ); } } return( 1 ); } /* Closes the log handle * Returns the 0 if succesful or -1 on error */ int log_handle_close( log_handle_t *log_handle, libcerror_error_t **error ) { static char *function = "log_handle_close"; if( log_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid log handle.", function ); return( -1 ); } if( log_handle->log_stream != NULL ) { if( file_stream_close( log_handle->log_stream ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close log stream.", function ); return( -1 ); } log_handle->log_stream = NULL; } return( 0 ); } #if defined( HAVE_STDARG_H ) || defined( WINAPI ) #define VARARGS( function, type, argument ) \ function( log_handle_t *log_handle, type argument, ... ) #define VASTART( argument_list, type, name ) \ va_start( argument_list, name ) #define VAEND( argument_list ) \ va_end( argument_list ) #elif defined( HAVE_VARARGS_H ) #define VARARGS( function, type, argument ) \ function( log_handle_t *log_handle, va_alist ) va_dcl #define VASTART( argument_list, type, name ) \ { type name; va_start( argument_list ); name = va_arg( argument_list, type ) #define VAEND( argument_list ) \ va_end( argument_list ); } #endif /* Print a formatted string on the notify stream */ void VARARGS( log_handle_printf, char *, format ) { va_list argument_list; if( ( log_handle != NULL ) && ( log_handle->log_stream != NULL ) ) { VASTART( argument_list, char *, format ); vfprintf( log_handle->log_stream, format, argument_list ); VAEND( argument_list ); } } #undef VARARGS #undef VASTART #undef VAEND libewf-20140807/ewftools/ewftools_libhmac.h0000664000175000017500000000267613440663046022706 0ustar00lordyestalordyesta00000000000000/* * The libhmac header wrapper * * Copyright (C) 2006-2018, 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_LIBHMAC_H ) #define _EWFTOOLS_LIBHMAC_H #include #if defined( HAVE_LOCAL_LIBHMAC ) #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBHMAC_DLL_IMPORT * before including libhmac.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBHMAC_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBHMAC ) */ #endif /* !defined( _EWFTOOLS_LIBHMAC_H ) */ libewf-20140807/ewftools/ewftools_system_string.c0000664000175000017500000002071513440663046024206 0ustar00lordyestalordyesta00000000000000/* * Character string functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #include #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libuna.h" #include "ewftools_system_string.h" /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error */ int ewftools_system_string_decimal_copy_to_64_bit( const system_character_t *string, size_t string_size, uint64_t *value_64bit, libcerror_error_t **error ) { static char *function = "ewftools_system_string_decimal_copy_to_64_bit"; size_t string_index = 0; system_character_t character_value = 0; uint8_t maximum_string_index = 20; int8_t sign = 1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( value_64bit == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value 64-bit.", function ); return( -1 ); } *value_64bit = 0; if( string[ string_index ] == (system_character_t) '-' ) { string_index++; maximum_string_index++; sign = -1; } else if( string[ string_index ] == (system_character_t) '+' ) { string_index++; maximum_string_index++; } while( string_index < string_size ) { if( string[ string_index ] == 0 ) { break; } if( string_index > (size_t) maximum_string_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, "%s: string too large.", function ); return( -1 ); } *value_64bit *= 10; if( ( string[ string_index ] >= (system_character_t) '0' ) && ( string[ string_index ] <= (system_character_t) '9' ) ) { character_value = (system_character_t) ( string[ string_index ] - (system_character_t) '0' ); } else { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: unsupported character value: %" PRIc_SYSTEM " at index: %d.", function, string[ string_index ], string_index ); return( -1 ); } *value_64bit += character_value; string_index++; } if( sign == -1 ) { *value_64bit *= (uint64_t) -1; } return( 1 ); } /* Determines the UTF-8 string size from the system string * Returns 1 if successful or -1 on error */ int ewftools_string_size_to_utf8_string( const system_character_t *string, size_t string_size, size_t *utf8_string_size, libcerror_error_t **error ) { static char *function = "ewftools_string_size_to_utf8_string"; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( utf8_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string size.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if SIZEOF_WCHAR_T == 4 if( libuna_utf8_string_size_from_utf32( (libuna_utf32_character_t *) string, string_size, utf8_string_size, error ) != 1 ) #elif SIZEOF_WCHAR_T == 2 if( libuna_utf8_string_size_from_utf16( (libuna_utf16_character_t *) string, string_size, utf8_string_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine UTF-8 string size.", function ); return( -1 ); } #else if( libclocale_codepage == 0 ) { *utf8_string_size = 1 + system_string_length( string ); } else { if( libuna_utf8_string_size_from_byte_stream( (uint8_t *) string, string_size, libclocale_codepage, utf8_string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to determine UTF-8 string size.", function ); return( -1 ); } } #endif return( 1 ); } /* Copies the UTF-8 string size from the system string * Returns 1 if successful or -1 on error */ int ewftools_string_copy_to_utf8_string( const system_character_t *string, size_t string_size, uint8_t *utf8_string, size_t utf8_string_size, libcerror_error_t **error ) { static char *function = "ewftools_string_copy_to_utf8_string"; if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid UTF-8 string.", function ); return( -1 ); } if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if SIZEOF_WCHAR_T == 4 if( libuna_utf8_string_copy_from_utf32( (libuna_utf8_character_t *) utf8_string, utf8_string_size, (libuna_utf32_character_t *) string, string_size, error ) != 1 ) #elif SIZEOF_WCHAR_T == 2 if( libuna_utf8_string_copy_from_utf16( (libuna_utf8_character_t *) utf8_string, utf8_string_size, (libuna_utf16_character_t *) string, string_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set UTF-8 string.", function ); return( -1 ); } #else if( libclocale_codepage == 0 ) { if( utf8_string_size < string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: UTF-8 string too small.", function ); return( -1 ); } if( memory_copy( utf8_string, string, string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to set string.", function ); return( -1 ); } } else if( libuna_utf8_string_copy_from_byte_stream( (libuna_utf8_character_t *) utf8_string, utf8_string_size, (uint8_t *) string, string_size, libclocale_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to set UTF-8 string.", function ); return( -1 ); } #endif return( 1 ); } libewf-20140807/ewftools/ewfmount.c0000664000175000017500000004244713421020220021200 0ustar00lordyestalordyesta00000000000000/* * Mounts an Expert Witness Compression Format (EWF) image file * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #include #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_UNISTD_H ) #include #endif #if defined( HAVE_SYS_RESOURCE_H ) #include #endif #include "ewftools_getopt.h" #include "ewftools_glob.h" #include "ewftools_i18n.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "mount_dokan.h" #include "mount_fuse.h" #include "mount_handle.h" mount_handle_t *ewfmount_mount_handle = NULL; int ewfmount_abort = 0; /* Prints usage information */ void usage_fprint( FILE *stream ) { if( stream == NULL ) { return; } fprintf( stream, "Use ewfmount to mount an Expert Witness Compression Format (EWF) image file\n\n" ); fprintf( stream, "Usage: ewfmount [ -f format ] [ -X extended_options ] [ -hvV ] image mount_point\n\n" ); fprintf( stream, "\timage: an Expert Witness Compression Format (EWF) image file\n\n" ); fprintf( stream, "\tmount_point: the directory to serve as mount point\n\n" ); fprintf( stream, "\t-f: specify the input format, options: raw (default), files (restricted to\n" "\t logical volume files)\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-v: verbose output to stderr, while ewfmount will remain running in the\n" "\t foreground\n" ); fprintf( stream, "\t-V: print version\n" ); fprintf( stream, "\t-X: extended options to pass to sub system\n" ); } /* Signal handler for ewfmount */ void ewfmount_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfmount_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfmount_abort = 1; if( ewfmount_mount_handle != NULL ) { if( mount_handle_signal_abort( ewfmount_mount_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal mount handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* The main program */ #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( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif system_character_t * const *sources = NULL; libewf_error_t *error = NULL; system_character_t *mount_point = NULL; system_character_t *option_extended_options = NULL; system_character_t *option_format = NULL; const system_character_t *path_prefix = NULL; char *program = _SYSTEM_STRING( "ewfmount" ); system_integer_t option = 0; size_t path_prefix_size = 0; int number_of_sources = 0; int result = 0; int verbose = 0; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) struct fuse_operations ewfmount_fuse_operations; struct fuse_args ewfmount_fuse_arguments = FUSE_ARGS_INIT(0, NULL); struct fuse_chan *ewfmount_fuse_channel = NULL; struct fuse *ewfmount_fuse_handle = NULL; #elif defined( HAVE_LIBDOKAN ) DOKAN_OPERATIONS ewfmount_dokan_operations; DOKAN_OPTIONS ewfmount_dokan_options; #endif libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } ewftools_output_version_fprint( stdout, program ); while( ( option = ewftools_getopt( argc, argv, _SYSTEM_STRING( "f:hvVX:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( stdout ); return( EXIT_FAILURE ); case (system_integer_t) 'f': option_format = optarg; break; case (system_integer_t) 'h': usage_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'X': option_extended_options = optarg; break; } } if( optind == argc ) { fprintf( stderr, "Missing source image(s).\n" ); usage_fprint( stdout ); return( EXIT_FAILURE ); } if( ( optind + 1 ) == argc ) { fprintf( stderr, "Missing mount point.\n" ); usage_fprint( stdout ); return( EXIT_FAILURE ); } mount_point = argv[ argc - 1 ]; libcnotify_verbose_set( verbose ); libewf_notify_set_stream( stderr, NULL ); libewf_notify_set_verbose( verbose ); #if !defined( HAVE_GLOB_H ) if( ewftools_glob_initialize( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to initialize glob.\n" ); goto on_error; } if( ewftools_glob_resolve( glob, &( argv[ optind ] ), argc - optind - 1, &error ) != 1 ) { fprintf( stderr, "Unable to resolve glob.\n" ); goto on_error; } if( ewftools_glob_get_results( glob, &number_of_sources, (system_character_t ***) &sources, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve glob results.\n" ); goto on_error; } #else sources = &( argv[ optind ] ); number_of_sources = argc - optind - 1; #endif if( mount_handle_initialize( &ewfmount_mount_handle, &error ) != 1 ) { fprintf( stderr, "Unable to initialize mount handle.\n" ); goto on_error; } if( option_format != NULL ) { result = mount_handle_set_format( ewfmount_mount_handle, option_format, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set format.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported input format defaulting to: raw.\n" ); } } #if defined( HAVE_GETRLIMIT ) if( getrlimit( RLIMIT_NOFILE, &limit_data ) != 0 ) { fprintf( stderr, "Unable to determine limit: number of open file descriptors.\n" ); } if( limit_data.rlim_max > (rlim_t) INT_MAX ) { limit_data.rlim_max = (rlim_t) INT_MAX; } if( limit_data.rlim_max > 0 ) { limit_data.rlim_max /= 2; } if( mount_handle_set_maximum_number_of_open_handles( ewfmount_mount_handle, (int) limit_data.rlim_max, &error ) != 1 ) { fprintf( stderr, "Unable to set maximum number of open file handles.\n" ); goto on_error; } #endif /* defined( HAVE_GETRLIMIT ) */ #if defined( WINAPI ) path_prefix = _SYSTEM_STRING( "\\EWF" ); #else path_prefix = _SYSTEM_STRING( "/ewf" ); #endif path_prefix_size = 1 + system_string_length( path_prefix ); if( mount_handle_set_path_prefix( ewfmount_mount_handle, path_prefix, path_prefix_size, &error ) != 1 ) { fprintf( stderr, "Unable to set path prefix.\n" ); goto on_error; } if( mount_handle_open( ewfmount_mount_handle, sources, number_of_sources, &error ) != 1 ) { fprintf( stderr, "Unable to open source image(s)\n" ); goto on_error; } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_free( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } #endif #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) if( option_extended_options != NULL ) { /* This argument is required but ignored */ if( fuse_opt_add_arg( &ewfmount_fuse_arguments, "" ) != 0 ) { fprintf( stderr, "Unable add fuse arguments.\n" ); goto on_error; } if( fuse_opt_add_arg( &ewfmount_fuse_arguments, "-o" ) != 0 ) { fprintf( stderr, "Unable add fuse arguments.\n" ); goto on_error; } if( fuse_opt_add_arg( &ewfmount_fuse_arguments, option_extended_options ) != 0 ) { fprintf( stderr, "Unable add fuse arguments.\n" ); goto on_error; } } if( memory_set( &ewfmount_fuse_operations, 0, sizeof( struct fuse_operations ) ) == NULL ) { fprintf( stderr, "Unable to clear fuse operations.\n" ); goto on_error; } ewfmount_fuse_operations.open = &mount_fuse_open; ewfmount_fuse_operations.read = &mount_fuse_read; ewfmount_fuse_operations.release = &mount_fuse_release; ewfmount_fuse_operations.opendir = &mount_fuse_opendir; ewfmount_fuse_operations.readdir = &mount_fuse_readdir; ewfmount_fuse_operations.releasedir = &mount_fuse_releasedir; ewfmount_fuse_operations.getattr = &mount_fuse_getattr; ewfmount_fuse_operations.destroy = &mount_fuse_destroy; ewfmount_fuse_channel = fuse_mount( mount_point, &ewfmount_fuse_arguments ); if( ewfmount_fuse_channel == NULL ) { fprintf( stderr, "Unable to create fuse channel.\n" ); goto on_error; } ewfmount_fuse_handle = fuse_new( ewfmount_fuse_channel, &ewfmount_fuse_arguments, &ewfmount_fuse_operations, sizeof( struct fuse_operations ), ewfmount_mount_handle ); if( ewfmount_fuse_handle == NULL ) { fprintf( stderr, "Unable to create fuse handle.\n" ); goto on_error; } if( verbose == 0 ) { if( fuse_daemonize( 0 ) != 0 ) { fprintf( stderr, "Unable to daemonize fuse.\n" ); goto on_error; } } result = fuse_loop( ewfmount_fuse_handle ); if( result != 0 ) { fprintf( stderr, "Unable to run fuse loop.\n" ); goto on_error; } fuse_destroy( ewfmount_fuse_handle ); fuse_opt_free_args( &ewfmount_fuse_arguments ); return( EXIT_SUCCESS ); #elif defined( HAVE_LIBDOKAN ) if( memory_set( &ewfmount_dokan_operations, 0, sizeof( DOKAN_OPERATIONS ) ) == NULL ) { fprintf( stderr, "Unable to clear dokan operations.\n" ); goto on_error; } if( memory_set( &ewfmount_dokan_options, 0, sizeof( DOKAN_OPTIONS ) ) == NULL ) { fprintf( stderr, "Unable to clear dokan options.\n" ); goto on_error; } ewfmount_dokan_options.Version = DOKAN_VERSION; ewfmount_dokan_options.ThreadCount = 0; ewfmount_dokan_options.MountPoint = mount_point; if( verbose != 0 ) { ewfmount_dokan_options.Options |= DOKAN_OPTION_STDERR; #if defined( HAVE_DEBUG_OUTPUT ) ewfmount_dokan_options.Options |= DOKAN_OPTION_DEBUG; #endif } /* This will only affect the drive properties ewfmount_dokan_options.Options |= DOKAN_OPTION_REMOVABLE; */ #if ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) ewfmount_dokan_options.Options |= DOKAN_OPTION_KEEP_ALIVE; ewfmount_dokan_operations.CreateFile = &mount_dokan_CreateFile; ewfmount_dokan_operations.OpenDirectory = &mount_dokan_OpenDirectory; ewfmount_dokan_operations.CreateDirectory = NULL; ewfmount_dokan_operations.Cleanup = NULL; ewfmount_dokan_operations.CloseFile = &mount_dokan_CloseFile; ewfmount_dokan_operations.ReadFile = &mount_dokan_ReadFile; ewfmount_dokan_operations.WriteFile = NULL; ewfmount_dokan_operations.FlushFileBuffers = NULL; ewfmount_dokan_operations.GetFileInformation = &mount_dokan_GetFileInformation; ewfmount_dokan_operations.FindFiles = &mount_dokan_FindFiles; ewfmount_dokan_operations.FindFilesWithPattern = NULL; ewfmount_dokan_operations.SetFileAttributes = NULL; ewfmount_dokan_operations.SetFileTime = NULL; ewfmount_dokan_operations.DeleteFile = NULL; ewfmount_dokan_operations.DeleteDirectory = NULL; ewfmount_dokan_operations.MoveFile = NULL; ewfmount_dokan_operations.SetEndOfFile = NULL; ewfmount_dokan_operations.SetAllocationSize = NULL; ewfmount_dokan_operations.LockFile = NULL; ewfmount_dokan_operations.UnlockFile = NULL; ewfmount_dokan_operations.GetFileSecurity = NULL; ewfmount_dokan_operations.SetFileSecurity = NULL; ewfmount_dokan_operations.GetDiskFreeSpace = NULL; ewfmount_dokan_operations.GetVolumeInformation = &mount_dokan_GetVolumeInformation; ewfmount_dokan_operations.Unmount = &mount_dokan_Unmount; #else ewfmount_dokan_operations.ZwCreateFile = &mount_dokan_ZwCreateFile; ewfmount_dokan_operations.Cleanup = NULL; ewfmount_dokan_operations.CloseFile = &mount_dokan_CloseFile; ewfmount_dokan_operations.ReadFile = &mount_dokan_ReadFile; ewfmount_dokan_operations.WriteFile = NULL; ewfmount_dokan_operations.FlushFileBuffers = NULL; ewfmount_dokan_operations.GetFileInformation = &mount_dokan_GetFileInformation; ewfmount_dokan_operations.FindFiles = &mount_dokan_FindFiles; ewfmount_dokan_operations.FindFilesWithPattern = NULL; ewfmount_dokan_operations.SetFileAttributes = NULL; ewfmount_dokan_operations.SetFileTime = NULL; ewfmount_dokan_operations.DeleteFile = NULL; ewfmount_dokan_operations.DeleteDirectory = NULL; ewfmount_dokan_operations.MoveFile = NULL; ewfmount_dokan_operations.SetEndOfFile = NULL; ewfmount_dokan_operations.SetAllocationSize = NULL; ewfmount_dokan_operations.LockFile = NULL; ewfmount_dokan_operations.UnlockFile = NULL; ewfmount_dokan_operations.GetFileSecurity = NULL; ewfmount_dokan_operations.SetFileSecurity = NULL; ewfmount_dokan_operations.GetDiskFreeSpace = NULL; ewfmount_dokan_operations.GetVolumeInformation = &mount_dokan_GetVolumeInformation; ewfmount_dokan_operations.Unmounted = NULL; ewfmount_dokan_operations.FindStreams = NULL; ewfmount_dokan_operations.Mounted = NULL; #endif /* ( DOKAN_VERSION >= 600 ) && ( DOKAN_VERSION < 800 ) */ result = DokanMain( &ewfmount_dokan_options, &ewfmount_dokan_operations ); switch( result ) { case DOKAN_SUCCESS: break; case DOKAN_ERROR: fprintf( stderr, "Unable to run dokan main: generic error\n" ); break; case DOKAN_DRIVE_LETTER_ERROR: fprintf( stderr, "Unable to run dokan main: bad drive letter\n" ); break; case DOKAN_DRIVER_INSTALL_ERROR: fprintf( stderr, "Unable to run dokan main: unable to load driver\n" ); break; case DOKAN_START_ERROR: fprintf( stderr, "Unable to run dokan main: driver error\n" ); break; case DOKAN_MOUNT_ERROR: fprintf( stderr, "Unable to run dokan main: unable to assign drive letter\n" ); break; case DOKAN_MOUNT_POINT_ERROR: fprintf( stderr, "Unable to run dokan main: mount point error\n" ); break; default: fprintf( stderr, "Unable to run dokan main: unknown error: %d\n", result ); break; } return( EXIT_SUCCESS ); #else fprintf( stderr, "No sub system to mount EWF format.\n" ); return( EXIT_FAILURE ); #endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) */ on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) if( ewfmount_fuse_handle != NULL ) { fuse_destroy( ewfmount_fuse_handle ); } fuse_opt_free_args( &ewfmount_fuse_arguments ); #endif if( ewfmount_mount_handle != NULL ) { mount_handle_free( &ewfmount_mount_handle, NULL ); } #if !defined( HAVE_GLOB_H ) if( glob != NULL ) { ewftools_glob_free( &glob, NULL ); } #endif return( EXIT_FAILURE ); } libewf-20140807/ewftools/export_handle.c0000664000175000017500000045064713421024433022207 0ustar00lordyestalordyesta00000000000000/* * Export handle * * 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 . */ #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 #elif defined( HAVE_UUID_UUID_H ) #include #endif #include "byte_size_string.h" #include "digest_hash.h" #include "ewfcommon.h" #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libcfile.h" #include "ewftools_libcpath.h" #include "ewftools_libcsplit.h" #include "ewftools_libewf.h" #include "ewftools_libsmraw.h" #include "ewftools_libhmac.h" #include "ewftools_system_string.h" #include "export_handle.h" #include "guid.h" #include "process_status.h" #define EXPORT_HANDLE_BUFFER_SIZE 8192 #define EXPORT_HANDLE_INPUT_BUFFER_SIZE 64 #define EXPORT_HANDLE_STRING_SIZE 1024 #define EXPORT_HANDLE_NOTIFY_STREAM stderr /* Creates an export handle * Make sure the value export_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int export_handle_initialize( export_handle_t **export_handle, uint8_t calculate_md5, uint8_t use_chunk_data_functions, libcerror_error_t **error ) { static char *function = "export_handle_initialize"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( *export_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid export handle value already set.", function ); return( -1 ); } *export_handle = memory_allocate_structure( export_handle_t ); if( *export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create export handle.", function ); goto on_error; } if( memory_set( *export_handle, 0, sizeof( export_handle_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear export handle.", function ); memory_free( *export_handle ); *export_handle = NULL; return( -1 ); } if( libewf_handle_initialize( &( ( *export_handle )->input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create input handle.", function ); goto on_error; } ( *export_handle )->input_buffer = system_string_allocate( EXPORT_HANDLE_INPUT_BUFFER_SIZE ); if( ( *export_handle )->input_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create input buffer.", function ); goto on_error; } if( memory_set( ( *export_handle )->input_buffer, 0, sizeof( system_character_t ) * EXPORT_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear export handle.", function ); goto on_error; } if( calculate_md5 != 0 ) { ( *export_handle )->calculated_md5_hash_string = system_string_allocate( 33 ); if( ( *export_handle )->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated MD5 digest hash string.", function ); goto on_error; } } ( *export_handle )->calculate_md5 = calculate_md5; ( *export_handle )->use_chunk_data_functions = use_chunk_data_functions; ( *export_handle )->compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; ( *export_handle )->compression_level = LIBEWF_COMPRESSION_NONE; ( *export_handle )->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_RAW; ( *export_handle )->ewf_format = LIBEWF_FORMAT_ENCASE6; ( *export_handle )->sectors_per_chunk = 64; ( *export_handle )->header_codepage = LIBEWF_CODEPAGE_ASCII; ( *export_handle )->process_buffer_size = EWFCOMMON_PROCESS_BUFFER_SIZE; ( *export_handle )->notify_stream = EXPORT_HANDLE_NOTIFY_STREAM; return( 1 ); on_error: if( *export_handle != NULL ) { if( ( *export_handle )->calculated_sha1_hash_string != NULL ) { memory_free( ( *export_handle )->calculated_sha1_hash_string ); } if( ( *export_handle )->calculated_md5_hash_string != NULL ) { memory_free( ( *export_handle )->calculated_md5_hash_string ); } if( ( *export_handle )->input_buffer != NULL ) { memory_free( ( *export_handle )->input_buffer ); } memory_free( *export_handle ); *export_handle = NULL; } return( -1 ); } /* Frees an export handle * Returns 1 if successful or -1 on error */ int export_handle_free( export_handle_t **export_handle, libcerror_error_t **error ) { static char *function = "export_handle_free"; int result = 1; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( *export_handle != NULL ) { memory_free( ( *export_handle )->input_buffer ); if( ( *export_handle )->target_path != NULL ) { memory_free( ( *export_handle )->target_path ); } if( ( *export_handle )->input_handle != NULL ) { if( libewf_handle_free( &( ( *export_handle )->input_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free input handle.", function ); result = -1; } } if( ( *export_handle )->ewf_output_handle != NULL ) { if( libewf_handle_free( &( ( *export_handle )->ewf_output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free ewf output handle.", function ); result = -1; } } if( ( *export_handle )->raw_output_handle != NULL ) { if( libsmraw_handle_free( &( ( *export_handle )->raw_output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free raw output handle.", function ); result = -1; } } if( ( *export_handle )->md5_context != NULL ) { if( libhmac_md5_free( &( ( *export_handle )->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free MD5 context.", function ); result = -1; } } if( ( *export_handle )->calculated_md5_hash_string != NULL ) { memory_free( ( *export_handle )->calculated_md5_hash_string ); } if( ( *export_handle )->sha1_context != NULL ) { if( libhmac_sha1_free( &( ( *export_handle )->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA1 context.", function ); result = -1; } } if( ( *export_handle )->calculated_sha1_hash_string != NULL ) { memory_free( ( *export_handle )->calculated_sha1_hash_string ); } if( ( *export_handle )->sha256_context != NULL ) { if( libhmac_sha256_free( &( ( *export_handle )->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free SHA256 context.", function ); result = -1; } } if( ( *export_handle )->calculated_sha256_hash_string != NULL ) { memory_free( ( *export_handle )->calculated_sha256_hash_string ); } memory_free( *export_handle ); *export_handle = NULL; } return( result ); } /* Signals the export handle to abort * Returns 1 if successful or -1 on error */ int export_handle_signal_abort( export_handle_t *export_handle, libcerror_error_t **error ) { static char *function = "export_handle_signal_abort"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->input_handle != NULL ) { if( libewf_handle_signal_abort( export_handle->input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal input handle to abort.", function ); return( -1 ); } } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( libewf_handle_signal_abort( export_handle->ewf_output_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal ewf output handle to abort.", function ); return( -1 ); } } else if( ( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) && ( export_handle->use_stdout == 0 ) ) { if( libsmraw_handle_signal_abort( export_handle->raw_output_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to signal raw output handle to abort.", function ); return( -1 ); } } export_handle->abort = 1; return( 1 ); } /* Sets the maximum number of (concurrent) open file handles * Returns 1 if successful or -1 on error */ int export_handle_set_maximum_number_of_open_handles( export_handle_t *export_handle, int maximum_number_of_open_handles, libcerror_error_t **error ) { static char *function = "export_handle_set_maximum_number_of_open_handles"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( libewf_handle_set_maximum_number_of_open_handles( export_handle->input_handle, maximum_number_of_open_handles, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum number of open handles in input handle.", function ); return( -1 ); } return( 1 ); } /* Opens the input of the export handle * Returns 1 if successful or -1 on error */ int export_handle_open_input( export_handle_t *export_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { system_character_t **libewf_filenames = NULL; static char *function = "export_handle_open_input"; size_t first_filename_length = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( filenames == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filenames.", function ); return( -1 ); } if( number_of_filenames <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid number of filenames.", function ); return( -1 ); } if( number_of_filenames == 1 ) { first_filename_length = system_string_length( filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #else if( libewf_glob( filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &libewf_filenames, &number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to resolve filename(s).", function ); return( -1 ); } filenames = (system_character_t * const *) libewf_filenames; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( export_handle->input_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #else if( libewf_handle_open( export_handle->input_handle, filenames, number_of_filenames, LIBEWF_OPEN_READ, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file(s).", function ); if( libewf_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, NULL ); #else libewf_glob_free( libewf_filenames, number_of_filenames, NULL ); #endif } return( -1 ); } if( libewf_filenames != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, error ) != 1 ) #else if( libewf_glob_free( libewf_filenames, number_of_filenames, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free globbed filenames.", function ); return( -1 ); } } if( libewf_handle_set_header_codepage( export_handle->input_handle, export_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); return( -1 ); } if( libewf_handle_get_chunk_size( export_handle->input_handle, &( export_handle->input_chunk_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); return( -1 ); } if( libewf_handle_get_media_size( export_handle->input_handle, &( export_handle->input_media_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); return( -1 ); } return( 1 ); } /* Opens the output of the export handle * Returns 1 if successful or -1 on error */ int export_handle_open_output( export_handle_t *export_handle, const system_character_t *filename, libcerror_error_t **error ) { system_character_t *filenames[ 1 ] = { NULL }; static char *function = "export_handle_open_output"; size_t filename_length = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( ( export_handle->output_format != EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) && ( export_handle->output_format != EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported output format.", function ); return( -1 ); } if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid filename.", function ); return( -1 ); } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_output_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid export handle - ewf output handle already set.", function ); return( -1 ); } if( libewf_handle_initialize( &( export_handle->ewf_output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create ewf output handle.", function ); return( -1 ); } filenames[ 0 ] = (system_character_t *) filename; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( export_handle->ewf_output_handle, filenames, 1, LIBEWF_OPEN_WRITE, error ) != 1 ) #else if( libewf_handle_open( export_handle->ewf_output_handle, filenames, 1, LIBEWF_OPEN_WRITE, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); libewf_handle_free( &( export_handle->ewf_output_handle ), NULL ); return( -1 ); } } else if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { filename_length = system_string_length( filename ); if( ( filename_length == 1 ) && ( system_string_compare( filename, _SYSTEM_STRING( "-" ), 1 ) == 0 ) ) { export_handle->use_stdout = 1; } else { if( export_handle->raw_output_handle != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid export handle - raw output handle already set.", function ); return( -1 ); } if( libsmraw_handle_initialize( &( export_handle->raw_output_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create raw output handle.", function ); return( -1 ); } filenames[ 0 ] = (system_character_t *) filename; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libsmraw_handle_open_wide( export_handle->raw_output_handle, filenames, 1, LIBSMRAW_OPEN_WRITE, error ) != 1 ) #else if( libsmraw_handle_open( export_handle->raw_output_handle, filenames, 1, LIBSMRAW_OPEN_WRITE, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); libsmraw_handle_free( &( export_handle->raw_output_handle ), NULL ); return( -1 ); } } } return( 1 ); } /* Closes the export handle * Returns the 0 if succesful or -1 on error */ int export_handle_close( export_handle_t *export_handle, libcerror_error_t **error ) { static char *function = "export_handle_close"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( libewf_handle_close( export_handle->input_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close input handle.", function ); return( -1 ); } if( export_handle->ewf_output_handle != NULL ) { if( libewf_handle_close( export_handle->ewf_output_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close ewf output handle.", function ); return( -1 ); } } if( export_handle->raw_output_handle != NULL ) { if( libsmraw_handle_close( export_handle->raw_output_handle, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close raw output handle.", function ); return( -1 ); } } return( 0 ); } /* Prepares a buffer after reading the input of the export handle * Returns the resulting buffer size or -1 on error */ ssize_t export_handle_prepare_read_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ) { static char *function = "export_handle_prepare_read_buffer"; ssize_t process_count = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->raw_buffer_data_size = storage_media_buffer->raw_buffer_size; process_count = libewf_handle_prepare_read_chunk( export_handle->input_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_data_size, storage_media_buffer->raw_buffer, &( storage_media_buffer->raw_buffer_data_size ), storage_media_buffer->is_compressed, storage_media_buffer->checksum, storage_media_buffer->process_checksum, error ); if( process_count == -1 ) { libcerror_error_free( error ); /* Wipe the chunk if nescessary */ if( export_handle->zero_chunk_on_error != 0 ) { if( ( storage_media_buffer->is_compressed != 0 ) && ( memory_set( storage_media_buffer->compression_buffer, 0, storage_media_buffer->compression_buffer_size ) == NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero compression buffer.", function ); return( -1 ); } if( memory_set( storage_media_buffer->raw_buffer, 0, storage_media_buffer->raw_buffer_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to zero raw buffer.", function ); return( -1 ); } } process_count = export_handle->input_chunk_size; /* Appends a read error */ if( export_handle_append_read_error( export_handle, export_handle->input_offset, process_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append read error.", function ); return( -1 ); } } if( storage_media_buffer->is_compressed == 0 ) { storage_media_buffer->data_in_compression_buffer = 1; } else { storage_media_buffer->data_in_compression_buffer = 0; } export_handle->input_offset += process_count; } else { process_count = (ssize_t) storage_media_buffer->raw_buffer_data_size; } return( process_count ); } /* Reads a buffer from the input of the export handle * Returns the number of bytes written or -1 on error */ ssize_t export_handle_read_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ) { static char *function = "export_handle_read_buffer"; ssize_t read_count = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { read_count = libewf_handle_read_chunk( export_handle->input_handle, storage_media_buffer->compression_buffer, storage_media_buffer->compression_buffer_size, &( storage_media_buffer->is_compressed ), &( storage_media_buffer->compression_buffer[ storage_media_buffer->raw_buffer_size ] ), &( storage_media_buffer->checksum ), &( storage_media_buffer->process_checksum ), error ); } else { read_count = libewf_handle_read_buffer( export_handle->input_handle, storage_media_buffer->raw_buffer, read_size, error ); } if( read_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read storage media buffer.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->compression_buffer_data_size = (size_t) read_count; } else { storage_media_buffer->raw_buffer_data_size = (size_t) read_count; } return( read_count ); } /* Prepares a buffer before writing the output of the export handle * Returns the resulting buffer size or -1 on error */ ssize_t export_handle_prepare_write_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, libcerror_error_t **error ) { static char *function = "export_handle_prepare_write_buffer"; ssize_t process_count = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_output_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing ewf output handle.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { storage_media_buffer->compression_buffer_data_size = storage_media_buffer->compression_buffer_size; process_count = libewf_handle_prepare_write_chunk( export_handle->ewf_output_handle, storage_media_buffer->raw_buffer, storage_media_buffer->raw_buffer_data_size, storage_media_buffer->compression_buffer, &( storage_media_buffer->compression_buffer_data_size ), &( storage_media_buffer->is_compressed ), &( storage_media_buffer->checksum ), &( storage_media_buffer->process_checksum ), error ); if( process_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to prepare storage media buffer before writing.", function ); return( -1 ); } } else { process_count = (ssize_t) storage_media_buffer->raw_buffer_data_size; } } else if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { process_count = (ssize_t) storage_media_buffer->raw_buffer_data_size; } return( process_count ); } /* Writes a buffer to the output of the export handle * Returns the number of bytes written or -1 on error */ ssize_t export_handle_write_buffer( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, size_t write_size, libcerror_error_t **error ) { static char *function = "export_handle_write_buffer"; size_t raw_write_buffer_size = 0; ssize_t write_count = 0; uint8_t *raw_write_buffer = NULL; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( write_size == 0 ) { return( 0 ); } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_output_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing ewf output handle.", function ); return( -1 ); } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { if( storage_media_buffer->is_compressed == 0 ) { raw_write_buffer = storage_media_buffer->raw_buffer; raw_write_buffer_size = storage_media_buffer->raw_buffer_data_size; } else { raw_write_buffer = storage_media_buffer->compression_buffer; raw_write_buffer_size = storage_media_buffer->compression_buffer_data_size; } if( write_size != raw_write_buffer_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: mismatch in write size and number of bytes in storage media buffer.", function ); return( -1 ); } write_count = libewf_handle_write_chunk( export_handle->ewf_output_handle, raw_write_buffer, raw_write_buffer_size, storage_media_buffer->raw_buffer_data_size, storage_media_buffer->is_compressed, storage_media_buffer->checksum_buffer, storage_media_buffer->checksum, storage_media_buffer->process_checksum, error ); } else { write_count = libewf_handle_write_buffer( export_handle->ewf_output_handle, storage_media_buffer->raw_buffer, write_size, error ); } if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write storage media buffer.", function ); return( -1 ); } } else if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { if( export_handle->use_stdout != 0 ) { #if defined( WINAPI ) && !defined( __CYGWIN__ ) write_count = _write( 1, storage_media_buffer->raw_buffer, write_size ); #else write_count = write( 1, storage_media_buffer->raw_buffer, write_size ); #endif } else { write_count = libsmraw_handle_write_buffer( export_handle->raw_output_handle, storage_media_buffer->raw_buffer, write_size, error ); } if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to write storage media buffer.", function ); return( -1 ); } } return( write_count ); } /* Seeks the offset * Returns the resulting offset or -1 on error */ off64_t export_handle_seek_offset( export_handle_t *export_handle, off64_t offset, libcerror_error_t **error ) { static char *function = "export_handle_seek_offset"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( libewf_handle_seek_offset( export_handle->input_handle, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } return( offset ); } /* Swaps the byte order of byte pairs within a buffer of a certain size * Returns 1 if successful, -1 on error */ int export_handle_swap_byte_pairs( export_handle_t *export_handle, storage_media_buffer_t *storage_media_buffer, size_t read_size, libcerror_error_t **error ) { uint8_t *data = NULL; static char *function = "export_handle_swap_byte_pairs"; size_t data_offset = 0; size_t data_size = 0; uint8_t byte = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( storage_media_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid storage media buffer.", function ); return( -1 ); } if( ( read_size == 0 ) || ( read_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid read size value out of bounds.", function ); return( -1 ); } /* If the last bit is set the value is odd */ if( ( read_size & 0x01 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid read size value is odd.", function ); return( -1 ); } if( storage_media_buffer_get_data( storage_media_buffer, &data, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve storage media buffer data.", function ); return( -1 ); } if( read_size != data_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: mismatch in read size and data size.", function ); return( -1 ); } for( data_offset = 0; data_offset < read_size; data_offset += 2 ) { byte = data[ data_offset ]; data[ data_offset ] = data[ data_offset + 1 ]; data[ data_offset + 1 ] = byte; } return( 1 ); } /* Initializes the integrity hash(es) * Returns 1 if successful or -1 on error */ int export_handle_initialize_integrity_hash( export_handle_t *export_handle, libcerror_error_t **error ) { static char *function = "export_handle_initialize_integrity_hash"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->calculate_md5 != 0 ) { if( libhmac_md5_initialize( &( export_handle->md5_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create MD5 context.", function ); goto on_error; } export_handle->md5_context_initialized = 1; } if( export_handle->calculate_sha1 != 0 ) { if( libhmac_sha1_initialize( &( export_handle->sha1_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create SHA1 context.", function ); goto on_error; } export_handle->sha1_context_initialized = 1; } if( export_handle->calculate_sha256 != 0 ) { if( libhmac_sha256_initialize( &( export_handle->sha256_context ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create SHA256 context.", function ); goto on_error; } export_handle->sha256_context_initialized = 1; } return( 1 ); on_error: if( export_handle->sha1_context != NULL ) { libhmac_sha1_free( &( export_handle->sha1_context ), NULL ); } if( export_handle->md5_context != NULL ) { libhmac_md5_free( &( export_handle->md5_context ), NULL ); } return( -1 ); } /* Updates the integrity hash(es) * Returns 1 if successful or -1 on error */ int export_handle_update_integrity_hash( export_handle_t *export_handle, uint8_t *buffer, size_t buffer_size, libcerror_error_t **error ) { static char *function = "export_handle_update_integrity_hash"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( ( buffer_size == 0 ) || ( buffer_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid buffer size value out of bounds.", function ); return( -1 ); } if( export_handle->calculate_md5 != 0 ) { if( libhmac_md5_update( export_handle->md5_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update MD5 digest hash.", function ); return( -1 ); } } if( export_handle->calculate_sha1 != 0 ) { if( libhmac_sha1_update( export_handle->sha1_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update SHA1 digest hash.", function ); return( -1 ); } } if( export_handle->calculate_sha256 != 0 ) { if( libhmac_sha256_update( export_handle->sha256_context, buffer, buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update SHA256 digest hash.", function ); return( -1 ); } } return( 1 ); } /* Finalizes the integrity hash(es) * Returns 1 if successful or -1 on error */ int export_handle_finalize_integrity_hash( export_handle_t *export_handle, libcerror_error_t **error ) { uint8_t calculated_md5_hash[ LIBHMAC_MD5_HASH_SIZE ]; uint8_t calculated_sha1_hash[ LIBHMAC_SHA1_HASH_SIZE ]; uint8_t calculated_sha256_hash[ LIBHMAC_SHA256_HASH_SIZE ]; static char *function = "export_handle_finalize_integrity_hash"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->calculate_md5 != 0 ) { if( export_handle->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing calculated MD5 hash string.", function ); return( -1 ); } if( libhmac_md5_finalize( export_handle->md5_context, calculated_md5_hash, LIBHMAC_MD5_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize MD5 hash.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_md5_hash, LIBHMAC_MD5_HASH_SIZE, export_handle->calculated_md5_hash_string, 33, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBEWF_RUNTIME_ERROR_SET_FAILED, "%s: unable to set calculated MD5 hash string.", function ); return( -1 ); } } if( export_handle->calculate_sha1 != 0 ) { if( export_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing calculated SHA1 hash string.", function ); return( -1 ); } if( libhmac_sha1_finalize( export_handle->sha1_context, calculated_sha1_hash, LIBHMAC_SHA1_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize SHA1 hash.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_sha1_hash, LIBHMAC_SHA1_HASH_SIZE, export_handle->calculated_sha1_hash_string, 41, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create calculated SHA1 hash string.", function ); return( -1 ); } } if( export_handle->calculate_sha256 != 0 ) { if( export_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing calculated SHA256 hash string.", function ); return( -1 ); } if( libhmac_sha256_finalize( export_handle->sha256_context, calculated_sha256_hash, LIBHMAC_SHA256_HASH_SIZE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize SHA256 hash.", function ); return( -1 ); } if( digest_hash_copy_to_string( calculated_sha256_hash, LIBHMAC_SHA256_HASH_SIZE, export_handle->calculated_sha256_hash_string, 41, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create calculated SHA256 hash string.", function ); return( -1 ); } } return( 1 ); } /* Determines if the input is corrupted * Returns 1 if corrupted, 0 if not or -1 on error */ int export_handle_input_is_corrupted( export_handle_t *export_handle, libcerror_error_t **error ) { static char *function = "export_handle_get_output_chunk_size"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = libewf_handle_segment_files_corrupted( export_handle->input_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if segment files are corrupted.", function ); return( -1 ); } return( result ); } /* Retrieves the chunk size * Returns 1 if successful or -1 on error */ int export_handle_get_output_chunk_size( export_handle_t *export_handle, size32_t *chunk_size, libcerror_error_t **error ) { static char *function = "export_handle_get_output_chunk_size"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( chunk_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid chunk size.", function ); return( -1 ); } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_output_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing ewf output handle.", function ); return( -1 ); } if( libewf_handle_get_chunk_size( export_handle->ewf_output_handle, chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve chunk size.", function ); return( -1 ); } } else if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { *chunk_size = export_handle->input_chunk_size; } return( 1 ); } /* Prompts the user for a string * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_string( export_handle_t *export_handle, const system_character_t *request_string, system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_string"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; *internal_string_size = 0; } *internal_string_size = EXPORT_HANDLE_STRING_SIZE; *internal_string = system_string_allocate( *internal_string_size ); if( *internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create internal string.", function ); goto on_error; } if( memory_set( *internal_string, 0, *internal_string_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear internal string.", function ); goto on_error; } result = ewfinput_get_string_variable( export_handle->notify_stream, request_string, *internal_string, *internal_string_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string variable.", function ); goto on_error; } return( result ); on_error: if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; } *internal_string_size = 0; return( -1 ); } /* Prompts the user for the compression method * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_compression_method( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { 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; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } /* experimental version only if( export_handle->ewf_format != LIBEWF_FORMAT_V2_ENCASE7 ) */ { compression_methods_amount = 1; } /* experimental version only else { compression_methods_amount = EWFINPUT_COMPRESSION_METHODS_AMOUNT; } */ result = ewfinput_get_fixed_string_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_compression_methods, compression_methods_amount, EWFINPUT_COMPRESSION_METHODS_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_compression_method( fixed_string_variable, &( export_handle->compression_method ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression method.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the compression level * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_compression_level( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "export_handle_prompt_for_compression_level"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = ewfinput_get_fixed_string_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_compression_levels, EWFINPUT_COMPRESSION_LEVELS_AMOUNT, EWFINPUT_COMPRESSION_LEVELS_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_compression_values( fixed_string_variable, &( export_handle->compression_level ), &( export_handle->compression_flags ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression values.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the output format * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_output_format( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { 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; 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 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = ewfinput_get_fixed_string_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, format_types, 17, 0, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = 0; fixed_string_variable_length = system_string_length( fixed_string_variable ); if( fixed_string_variable_length == 3 ) { if( system_string_compare( fixed_string_variable, _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_RAW; result = 1; } } else if( fixed_string_variable_length == 5 ) { if( system_string_compare( fixed_string_variable, _SYSTEM_STRING( "files" ), 5 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_FILES; result = 1; } } if( result == 0 ) { result = ewfinput_determine_ewf_format( fixed_string_variable, &( export_handle->ewf_format ), error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine format.", function ); return( -1 ); } export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_EWF; } } return( result ); } /* Prompts the user for the number of sectors per chunk * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_sectors_per_chunk( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { system_character_t *fixed_string_variable = NULL; static char *function = "export_handle_prompt_for_sectors_per_chunk"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = ewfinput_get_fixed_string_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, ewfinput_sector_per_block_sizes, EWFINPUT_SECTOR_PER_BLOCK_SIZES_AMOUNT, EWFINPUT_SECTOR_PER_BLOCK_SIZES_DEFAULT, &fixed_string_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve fixed string variable.", function ); return( -1 ); } else if( result != 0 ) { result = ewfinput_determine_sectors_per_chunk( fixed_string_variable, &( export_handle->sectors_per_chunk ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sectors per chunk.", function ); return( -1 ); } } return( result ); } /* Prompts the user for the maximum segment size * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_maximum_segment_size( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_maximum_segment_size"; uint64_t default_input_size = 0; uint64_t input_size_variable = 0; uint64_t maximum_input_size = 0; uint64_t minimum_input_size = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } maximum_input_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT; if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_format != LIBEWF_FORMAT_ENCASE6 ) { maximum_input_size = EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT; } minimum_input_size = EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE; if( default_input_size == 0 ) { default_input_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; } } result = ewfinput_get_byte_size_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, minimum_input_size, maximum_input_size, default_input_size, &input_size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve byte size variable.", function ); return( -1 ); } export_handle->maximum_segment_size = input_size_variable; return( result ); } /* Prompts the user for the export offset * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_export_offset( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_export_offset"; uint64_t input_size_variable = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = ewfinput_get_size_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, 0, export_handle->input_media_size, export_handle->export_offset, &input_size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } export_handle->export_offset = input_size_variable; return( result ); } /* Prompts the user for the export size * Returns 1 if successful, 0 if no input was provided or -1 on error */ int export_handle_prompt_for_export_size( export_handle_t *export_handle, const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_export_size"; uint64_t default_input_size = 0; uint64_t input_size_variable = 0; uint64_t maximum_input_size = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } maximum_input_size = export_handle->input_media_size - export_handle->export_offset; if( ( export_handle->export_size == 0 ) || ( export_handle->export_size > maximum_input_size ) ) { default_input_size = maximum_input_size; } else { default_input_size = export_handle->export_size; } result = ewfinput_get_size_variable( export_handle->notify_stream, export_handle->input_buffer, EXPORT_HANDLE_INPUT_BUFFER_SIZE, request_string, 0, maximum_input_size, default_input_size, &input_size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size variable.", function ); return( -1 ); } export_handle->export_size = input_size_variable; return( result ); } /* Sets a string * Returns 1 if successful or -1 on error */ int export_handle_set_string( export_handle_t *export_handle, const system_character_t *string, system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { static char *function = "export_handle_set_string"; size_t string_length = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( internal_string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; *internal_string_size = 0; } string_length = system_string_length( string ); if( string_length > 0 ) { *internal_string = system_string_allocate( string_length + 1 ); if( *internal_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create internal string.", function ); goto on_error; } if( system_string_copy( *internal_string, string, string_length ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy string.", function ); goto on_error; } ( *internal_string )[ string_length ] = 0; *internal_string_size = string_length + 1; } return( 1 ); on_error: if( *internal_string != NULL ) { memory_free( *internal_string ); *internal_string = NULL; } *internal_string_size = 0; return( -1 ); } /* Sets the compression values * Returns 1 if successful, 0 if unsupported value or -1 on error */ int export_handle_set_compression_values( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { 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; int number_of_segments = 0; int result = 0; int segment_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; #endif if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } string_length = system_string_length( string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, (wchar_t) ':', &string_elements, error ) != 1 ) #else if( libcsplit_narrow_string_split( string, string_length + 1, (char) ':', &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); return( -1 ); } if( ( number_of_segments != 1 ) && ( number_of_segments != 2 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of segments is out of bounds.", function ); return( -1 ); } if( number_of_segments == 2 ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } result = ewfinput_determine_compression_method( string_segment, &( export_handle->compression_method ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression method.", function ); goto on_error; } /* experimental version only if( export_handle->ewf_format != LIBEWF_FORMAT_V2_ENCASE7 ) */ { if( export_handle->compression_method != LIBEWF_COMPRESSION_METHOD_DEFLATE ) { export_handle->compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; result = 0; } } segment_index++; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } result = ewfinput_determine_compression_values( string_segment, &( export_handle->compression_level ), &( export_handle->compression_flags ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine compression values.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) #else if( libcsplit_narrow_split_string_free( &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split string.", function ); goto on_error; } return( result ); on_error: if( string_elements != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); #else libcsplit_narrow_split_string_free( &string_elements, NULL ); #endif } return( -1 ); } /* Sets the output format * Returns 1 if successful, 0 if unsupported value or -1 on error */ int export_handle_set_output_format( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_output_format"; size_t string_length = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 3 ) { if( system_string_compare( string, _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_RAW; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "files" ), 5 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_FILES; result = 1; } } if( result == 0 ) { result = ewfinput_determine_ewf_format( string, &( export_handle->ewf_format ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine format.", function ); return( -1 ); } } return( result ); } /* Sets the number of sectors per chunk * Returns 1 if successful, 0 if unsupported value or -1 on error */ int export_handle_set_sectors_per_chunk( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_sectors_per_chunk"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = ewfinput_determine_sectors_per_chunk( string, &( export_handle->sectors_per_chunk ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine sectors per chunk.", function ); return( -1 ); } return( result ); } /* Sets the maximum segment file size * Returns 1 if successful, 0 if unsupported value or -1 on error */ int export_handle_set_maximum_segment_size( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_maximum_segment_size"; size_t string_length = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &( export_handle->maximum_segment_size ), error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine maximum segment size.", function ); return( -1 ); } if( result != 0 ) { if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( ( export_handle->maximum_segment_size < EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE ) || ( ( export_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) && ( export_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT ) ) || ( ( export_handle->ewf_format != LIBEWF_FORMAT_ENCASE6 ) && ( export_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT ) ) ) { export_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; result = 0; } } else if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { if( ( ( export_handle->maximum_segment_size != 0 ) && ( export_handle->maximum_segment_size >= (uint64_t) EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT ) ) ) { export_handle->maximum_segment_size = EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE; result = 0; } } } return( result ); } /* Sets the export offset * Returns 1 if successful or -1 on error */ int export_handle_set_export_offset( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_export_offset"; size_t string_length = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string[ 0 ] != (system_character_t) '-' ) { string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( string, string_length + 1, &( export_handle->export_offset ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine export offset.", function ); return( -1 ); } result = 1; } return( result ); } /* Sets the export size * Returns 1 if successful or -1 on error */ int export_handle_set_export_size( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_export_size"; size_t string_length = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string[ 0 ] != (system_character_t) '-' ) { string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( string, string_length + 1, &( export_handle->export_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine export size.", function ); return( -1 ); } result = 1; } return( result ); } /* Sets the header codepage * Returns 1 if successful or -1 on error */ int export_handle_set_header_codepage( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_header_codepage"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } result = ewfinput_determine_header_codepage( string, &export_handle->header_codepage, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine header codepage.", function ); return( -1 ); } return( result ); } /* Sets the process buffer size * Returns 1 if successful, 0 if unsupported value or -1 on error */ int export_handle_set_process_buffer_size( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_process_buffer_size"; size_t string_length = 0; uint64_t size_variable = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } string_length = system_string_length( string ); result = byte_size_string_convert( string, string_length, &size_variable, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine process buffer size.", function ); return( -1 ); } else if( result != 0 ) { if( size_variable > (uint64_t) SSIZE_MAX ) { export_handle->process_buffer_size = 0; result = 0; } else { export_handle->process_buffer_size = (size_t) size_variable; } } return( result ); } /* Sets the additional digest types * Returns 1 if successful or -1 on error */ int export_handle_set_additional_digest_types( export_handle_t *export_handle, const system_character_t *string, libcerror_error_t **error ) { 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; uint8_t calculate_sha1 = 0; uint8_t calculate_sha256 = 0; int number_of_segments = 0; int result = 0; int segment_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; #endif if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } string_length = system_string_length( string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, (wchar_t) ',', &string_elements, error ) != 1 ) #else if( libcsplit_narrow_string_split( string, string_length + 1, (char) ',', &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split string.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_number_of_segments( string_elements, &number_of_segments, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); goto on_error; } for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #else if( libcsplit_narrow_split_string_get_segment_by_index( string_elements, segment_index, &string_segment, &string_segment_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve string segment: %d.", function, segment_index ); goto on_error; } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string segment: %d.", function, segment_index ); goto on_error; } if( string_segment_size == 5 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha1" ), 4 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA1" ), 4 ) == 0 ) { calculate_sha1 = 1; } } else if( string_segment_size == 6 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "sha_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } } else if( string_segment_size == 7 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha256" ), 6 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA256" ), 6 ) == 0 ) { calculate_sha256 = 1; } } else if( string_segment_size == 8 ) { if( system_string_compare( string_segment, _SYSTEM_STRING( "sha-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "sha_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } else if( system_string_compare( string_segment, _SYSTEM_STRING( "SHA_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } } } if( ( calculate_sha1 != 0 ) && ( export_handle->calculate_sha1 == 0 ) ) { export_handle->calculated_sha1_hash_string = system_string_allocate( 41 ); if( export_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated SHA1 digest hash string.", function ); goto on_error; } export_handle->calculate_sha1 = 1; } if( ( calculate_sha256 != 0 ) && ( export_handle->calculate_sha256 == 0 ) ) { export_handle->calculated_sha256_hash_string = system_string_allocate( 65 ); if( export_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create calculated SHA256 digest hash string.", function ); goto on_error; } export_handle->calculate_sha256 = 1; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) #else if( libcsplit_narrow_split_string_free( &string_elements, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free split string.", function ); goto on_error; } return( result ); on_error: if( string_elements != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); #else libcsplit_narrow_split_string_free( &string_elements, NULL ); #endif } return( -1 ); } /* Sets the output values of the export handle * Returns 1 if successful or -1 on error */ int export_handle_set_output_values( export_handle_t *export_handle, 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 ) { #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) uint8_t guid[ GUID_SIZE ]; uint8_t guid_type = 0; #endif static char *function = "export_handle_set_output_values"; size_t value_string_length = 0; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( libewf_handle_get_bytes_per_sector( export_handle->input_handle, &( export_handle->bytes_per_sector ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve bytes per sector from input handle.", function ); return( -1 ); } if( libewf_handle_set_read_zero_chunk_on_error( export_handle->input_handle, zero_chunk_on_error, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set zero chunk on error in input handle.", function ); return( -1 ); } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_output_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing ewf output handle.", function ); return( -1 ); } if( libewf_handle_copy_header_values( export_handle->ewf_output_handle, export_handle->input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy header values.", function ); return( -1 ); } /* Set acquiry operating system, software and software version */ if( acquiry_operating_system != NULL ) { value_string_length = system_string_length( acquiry_operating_system ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_operating_system", 24, (uint16_t *) acquiry_operating_system, value_string_length, error ); #else result = libewf_handle_set_utf8_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_operating_system", 24, (uint8_t *) acquiry_operating_system, value_string_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry operating system.", function ); return( -1 ); } } value_string_length = system_string_length( acquiry_software ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_software", 16, (uint16_t *) acquiry_software, value_string_length, error ); #else result = libewf_handle_set_utf8_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_software", 16, (uint8_t *) acquiry_software, value_string_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry software.", function ); return( -1 ); } value_string_length = system_string_length( acquiry_software_version ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_software_version", 24, (uint16_t *) acquiry_software_version, value_string_length, error ); #else result = libewf_handle_set_utf8_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_software_version", 24, (uint8_t *) acquiry_software_version, value_string_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header value: acquiry software version.", function ); return( -1 ); } if( libewf_handle_set_header_codepage( export_handle->ewf_output_handle, export_handle->header_codepage, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set header codepage.", function ); return( -1 ); } if( libewf_handle_copy_media_values( export_handle->ewf_output_handle, export_handle->input_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to copy media values.", function ); return( -1 ); } if( copy_input_values == 0 ) { if( libewf_handle_set_media_size( export_handle->ewf_output_handle, (size64_t) export_handle->export_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media size.", function ); return( -1 ); } } /* Format needs to be set before segment file size and compression values */ if( copy_input_values != 0 ) { if( libewf_handle_get_format( export_handle->input_handle, &( export_handle->ewf_format ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve format.", function ); return( -1 ); } } if( libewf_handle_set_format( export_handle->ewf_output_handle, export_handle->ewf_format, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set format.", function ); return( -1 ); } if( copy_input_values != 0 ) { /* experimental version only if( libewf_handle_get_compression_method( export_handle->input_handle, &( export_handle->compression_method ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve compression method.", function ); return( -1 ); } */ if( libewf_handle_get_compression_values( export_handle->input_handle, &( export_handle->compression_level ), &( export_handle->compression_flags ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve compression values.", function ); return( -1 ); } } /* experimental version only if( export_handle->ewf_format != LIBEWF_FORMAT_V2_ENCASE7 ) { if( export_handle->compression_method != LIBEWF_COMPRESSION_METHOD_DEFLATE ) { export_handle->compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; } } if( libewf_handle_set_compression_method( export_handle->ewf_output_handle, export_handle->compression_method, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compression method.", function ); return( -1 ); } */ if( libewf_handle_set_compression_values( export_handle->ewf_output_handle, export_handle->compression_level, export_handle->compression_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set compression values.", function ); return( -1 ); } if( ( export_handle->compression_level != LIBEWF_COMPRESSION_NONE ) || ( ( export_handle->compression_flags & LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION ) != 0 ) ) { export_handle->write_compressed = 1; } else { export_handle->write_compressed = 0; } if( copy_input_values != 0 ) { if( libewf_handle_get_maximum_segment_size( export_handle->input_handle, &( export_handle->maximum_segment_size ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve maximum segment size.", function ); return( -1 ); } } if( libewf_handle_set_maximum_segment_size( export_handle->ewf_output_handle, export_handle->maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size.", function ); return( -1 ); } if( copy_input_values == 0 ) { if( libewf_handle_set_sectors_per_chunk( export_handle->ewf_output_handle, export_handle->sectors_per_chunk, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sectors per chunk in output handle.", function ); return( -1 ); } #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) if( ( export_handle->ewf_format == LIBEWF_FORMAT_ENCASE5 ) || ( export_handle->ewf_format == LIBEWF_FORMAT_ENCASE6 ) || ( export_handle->ewf_format == LIBEWF_FORMAT_EWFX ) ) { guid_type = GUID_TYPE_RANDOM; } else if( ( export_handle->ewf_format == LIBEWF_FORMAT_LINEN5 ) || ( export_handle->ewf_format == LIBEWF_FORMAT_LINEN6 ) ) { guid_type = GUID_TYPE_TIME; } if( guid_type != 0 ) { /* Sets the GUID if necessary */ if( guid_generate( guid, GUID_SIZE, guid_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to generate GUID for set identifier.", function ); return( -1 ); } if( libewf_handle_set_segment_file_set_identifier( export_handle->ewf_output_handle, guid, 16, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment file set identifier.", function ); return( -1 ); } } #endif } } else if( ( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) && ( export_handle->use_stdout == 0 ) ) { if( libsmraw_handle_set_media_size( export_handle->raw_output_handle, (size64_t) export_handle->export_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set media size.", function ); return( -1 ); } if( libsmraw_handle_set_maximum_segment_size( export_handle->raw_output_handle, export_handle->maximum_segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set maximum segment size.", function ); return( -1 ); } } return( 1 ); } /* Sets the hash value in the output handle * Returns 1 if successful or -1 on error */ int export_handle_set_hash_value( export_handle_t *export_handle, char *hash_value_identifier, size_t hash_value_identifier_length, system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ) { static char *function = "export_handle_set_hash_value"; int result = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_hash_value( export_handle->ewf_output_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, (uint16_t *) hash_value, hash_value_length, error ); #else result = libewf_handle_set_utf8_hash_value( export_handle->ewf_output_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, (uint8_t *) hash_value, hash_value_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: %s.", function, hash_value_identifier ); return( -1 ); } } else if( ( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) && ( export_handle->use_stdout == 0 ) ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmraw_handle_set_utf16_integrity_hash_value( export_handle->raw_output_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, (uint16_t *) hash_value, hash_value_length, error ); #else result = libsmraw_handle_set_utf8_integrity_hash_value( export_handle->raw_output_handle, (uint8_t *) hash_value_identifier, hash_value_identifier_length, (uint8_t *) hash_value, hash_value_length, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set integrity hash value: %s.", function, hash_value_identifier ); return( -1 ); } } return( 1 ); } /* Appends a read error to the output handle * Returns 1 if successful or -1 on error */ int export_handle_append_read_error( export_handle_t *export_handle, off64_t start_offset, size_t number_of_bytes, libcerror_error_t **error ) { static char *function = "export_handle_append_read_error"; uint64_t start_sector = 0; uint64_t number_of_sectors = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->bytes_per_sector == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid export handle - invalid bytes per sector value out of bounds.", function ); return( -1 ); } start_sector = start_offset / export_handle->bytes_per_sector; number_of_sectors = number_of_bytes / export_handle->bytes_per_sector; if( ( number_of_bytes % export_handle->bytes_per_sector ) != 0 ) { number_of_sectors += 1; } if( export_handle->use_chunk_data_functions != 0 ) { if( libewf_handle_append_checksum_error( export_handle->input_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append checksum error.", function ); return( -1 ); } } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { if( export_handle->ewf_output_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing ewf output handle.", function ); return( -1 ); } if( libewf_handle_append_acquiry_error( export_handle->ewf_output_handle, start_sector, number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append acquiry error.", function ); return( -1 ); } } return( 1 ); } /* Finalizes the export handle * Returns the number of input bytes written or -1 on error */ ssize_t export_handle_finalize( export_handle_t *export_handle, libcerror_error_t **error ) { static char *function = "export_handle_finalize"; ssize_t write_count = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->calculate_md5 != 0 ) { if( export_handle_set_hash_value( export_handle, "MD5", 3, export_handle->calculated_md5_hash_string, 32, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: MD5.", function ); return( -1 ); } } if( export_handle->calculate_sha1 != 0 ) { if( export_handle_set_hash_value( export_handle, "SHA1", 4, export_handle->calculated_sha1_hash_string, 40, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA1.", function ); return( -1 ); } } if( export_handle->calculate_sha256 != 0 ) { if( export_handle_set_hash_value( export_handle, "SHA256", 6, export_handle->calculated_sha256_hash_string, 64, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set hash value: SHA256.", function ); return( -1 ); } } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { write_count = libewf_handle_write_finalize( export_handle->ewf_output_handle, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize EWF file(s).", function ); return( -1 ); } } return( write_count ); } /* Exports the input * Returns 1 if successful or -1 on error */ int export_handle_export_input( export_handle_t *export_handle, uint8_t swap_byte_pairs, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ) { process_status_t *process_status = NULL; storage_media_buffer_t *storage_media_buffer = NULL; storage_media_buffer_t *output_storage_media_buffer = NULL; uint8_t *data = NULL; uint8_t *input_buffer = NULL; static char *function = "export_handle_export_input"; size64_t export_count = 0; size64_t media_size = 0; size32_t output_chunk_size = 0; size_t process_buffer_size = 0; size_t data_size = 0; size_t read_size = 0; size_t write_size = 0; ssize_t read_count = 0; ssize_t read_process_count = 0; ssize_t write_count = 0; ssize_t write_process_count = 0; uint8_t storage_media_buffer_mode = 0; int status = PROCESS_STATUS_COMPLETED; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->input_chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing input chunk size.", function ); return( -1 ); } if( export_handle->input_chunk_size > (size32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid input chunk size value exceeds maximum.", function ); return( -1 ); } if( export_handle->process_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid export handle - process buffer size value exceeds maximum.", function ); return( -1 ); } if( libewf_handle_get_media_size( export_handle->input_handle, &media_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve media size.", function ); goto on_error; } if( ( export_handle->export_size > media_size ) || ( export_handle->export_size > (ssize64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid export handle - export size value out of bounds.", function ); return( -1 ); } if( export_handle->export_offset > 0 ) { if( ( export_handle->export_offset >= (uint64_t) media_size ) || ( ( export_handle->export_size + export_handle->export_offset ) > (uint64_t) media_size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); goto on_error; } if( export_handle_seek_offset( export_handle, export_handle->export_offset, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); goto on_error; } } if( export_handle->use_chunk_data_functions != 0 ) { if( export_handle_get_output_chunk_size( export_handle, &output_chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the output chunk size.", function ); goto on_error; } if( output_chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid output chunk size.", function ); goto on_error; } process_buffer_size = (size_t) export_handle->input_chunk_size; storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA; } else { if( export_handle->process_buffer_size == 0 ) { process_buffer_size = (size_t) export_handle->input_chunk_size; } else { process_buffer_size = export_handle->process_buffer_size; } storage_media_buffer_mode = STORAGE_MEDIA_BUFFER_MODE_BUFFERED; } if( storage_media_buffer_initialize( &storage_media_buffer, storage_media_buffer_mode, process_buffer_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create storage media buffer.", function ); goto on_error; } if( export_handle->use_chunk_data_functions != 0 ) { if( storage_media_buffer_initialize( &output_storage_media_buffer, STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA, output_chunk_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create output storage media buffer.", function ); goto on_error; } } if( export_handle_initialize_integrity_hash( export_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize integrity hash(es).", function ); goto on_error; } if( process_status_initialize( &process_status, _SYSTEM_STRING( "Export" ), _SYSTEM_STRING( "exported" ), _SYSTEM_STRING( "Written" ), stderr, print_status_information, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create process status.", function ); goto on_error; } if( process_status_start( process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to start process status.", function ); goto on_error; } while( export_count < (size64_t) export_handle->export_size ) { read_size = process_buffer_size; if( ( media_size - export_count ) < read_size ) { read_size = (size_t) ( media_size - export_count ); } read_count = export_handle_read_buffer( export_handle, storage_media_buffer, read_size, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read data.", function ); goto on_error; } if( read_count == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unexpected end of data.", function ); goto on_error; } read_process_count = export_handle_prepare_read_buffer( export_handle, storage_media_buffer, error ); if( read_process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare buffer after read.", function ); goto on_error; } if( read_process_count > (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: more bytes read than requested.", function ); goto on_error; } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { /* Set the chunk data size in the compression buffer */ if( storage_media_buffer->data_in_compression_buffer == 1 ) { storage_media_buffer->compression_buffer_data_size = (size_t) read_process_count; } } /* Swap byte pairs */ if( swap_byte_pairs == 1 ) { if( export_handle_swap_byte_pairs( export_handle, storage_media_buffer, read_process_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_CONVERSION, LIBCERROR_CONVERSION_ERROR_GENERIC, "%s: unable to swap byte pairs.", function ); goto on_error; } } if( storage_media_buffer_get_data( storage_media_buffer, &data, &data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve storage media buffer data.", function ); goto on_error; } /* Digest hashes are calcultated after swap */ if( export_handle_update_integrity_hash( export_handle, data, read_process_count, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to update integrity hash(es).", function ); goto on_error; } export_count += read_process_count; while( read_process_count > 0 ) { if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { if( read_process_count > (ssize_t) output_chunk_size ) { write_size = output_chunk_size; } else { write_size = (size_t) read_process_count; } if( ( output_storage_media_buffer->raw_buffer_data_size + write_size ) > output_chunk_size ) { write_size = output_chunk_size - output_storage_media_buffer->raw_buffer_data_size; } if( storage_media_buffer->data_in_compression_buffer == 1 ) { input_buffer = storage_media_buffer->compression_buffer; } else { input_buffer = storage_media_buffer->raw_buffer; } if( memory_copy( &( output_storage_media_buffer->raw_buffer[ output_storage_media_buffer->raw_buffer_data_size ] ), input_buffer, write_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy data from input buffer to output raw buffer.", function ); goto on_error; } output_storage_media_buffer->raw_buffer_data_size += write_size; /* Make sure the output chunk is filled upto the output chunk size */ if( ( export_count < (size64_t) export_handle->export_size ) && ( output_storage_media_buffer->raw_buffer_data_size < output_chunk_size ) ) { continue; } write_process_count = export_handle_prepare_write_buffer( export_handle, output_storage_media_buffer, error ); } else { write_process_count = export_handle_prepare_write_buffer( export_handle, storage_media_buffer, error ); } if( write_process_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to prepare buffer before write.", function ); goto on_error; } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { write_count = export_handle_write_buffer( export_handle, output_storage_media_buffer, write_process_count, error ); } else { write_count = export_handle_write_buffer( export_handle, storage_media_buffer, write_process_count, error ); } if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write data to file.", function ); goto on_error; } if( storage_media_buffer->mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { output_storage_media_buffer->raw_buffer_data_size = 0; } read_process_count -= write_process_count; } if( process_status_update( process_status, export_count, export_handle->export_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to update process status.", function ); goto on_error; } if( export_handle->abort != 0 ) { break; } } if( output_storage_media_buffer != NULL ) { if( storage_media_buffer_free( &output_storage_media_buffer, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free output storage media buffer.", function ); goto on_error; } } if( storage_media_buffer_free( &storage_media_buffer, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free input storage media buffer.", function ); goto on_error; } if( export_handle_finalize_integrity_hash( export_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to finalize integrity hash(es).", function ); goto on_error; } write_count = export_handle_finalize( export_handle, error ); if( write_count == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to finalize.", function ); goto on_error; } if( export_handle->abort != 0 ) { status = PROCESS_STATUS_ABORTED; } if( process_status_stop( process_status, export_count, status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to stop process status.", function ); goto on_error; } if( process_status_free( &process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free process status.", function ); goto on_error; } if( export_handle->abort == 0 ) { if( export_handle_hash_values_fprint( export_handle, export_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print export hash values.", function ); goto on_error; } if( export_handle_checksum_errors_fprint( export_handle, export_handle->notify_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print export errors.", function ); goto on_error; } if( log_handle != NULL ) { if( export_handle_hash_values_fprint( export_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print export has values in log handle.", function ); goto on_error; } if( export_handle_checksum_errors_fprint( export_handle, log_handle->log_stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, "%s: unable to print export errors in log handle.", function ); goto on_error; } } } return( 1 ); on_error: if( process_status != NULL ) { process_status_stop( process_status, export_count, PROCESS_STATUS_FAILED, NULL ); process_status_free( &process_status, NULL ); } if( output_storage_media_buffer != NULL ) { storage_media_buffer_free( &output_storage_media_buffer, NULL ); } if( storage_media_buffer != NULL ) { storage_media_buffer_free( &storage_media_buffer, NULL ); } return( -1 ); } /* Exports the single files * Returns 1 if successful, 0 if not or -1 on error */ int export_handle_export_single_files( export_handle_t *export_handle, const system_character_t *export_path, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ) { libewf_file_entry_t *file_entry = NULL; process_status_t *process_status = NULL; system_character_t *sanitized_name = NULL; static char *function = "export_handle_export_single_files"; size_t export_path_length = 0; size_t sanitized_name_size = 0; int result = 0; int status = PROCESS_STATUS_COMPLETED; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export path.", function ); return( -1 ); } export_path_length = system_string_length( export_handle->target_path ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_get_sanitized_path_wide( export_handle->target_path, export_path_length, &sanitized_name, &sanitized_name_size, error ) != 1 ) #else if( libcpath_path_get_sanitized_path( export_handle->target_path, export_path_length, &sanitized_name, &sanitized_name_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable sanitize export path.", function ); goto on_error; } result = libewf_handle_get_root_file_entry( export_handle->input_handle, &file_entry, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve root file entry.", function ); goto on_error; } if( process_status_initialize( &process_status, _SYSTEM_STRING( "Export" ), _SYSTEM_STRING( "exported" ), _SYSTEM_STRING( "Written" ), stderr, print_status_information, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create process status.", function ); goto on_error; } if( process_status_start( process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to start process status.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_make_directory_wide( sanitized_name, error ) != 1 ) #else if( libcpath_path_make_directory( sanitized_name, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to create directory: %" PRIs_SYSTEM "", function, sanitized_name ); goto on_error; } log_handle_printf( log_handle, "Created directory: %" PRIs_SYSTEM ".\n", sanitized_name ); result = export_handle_export_file_entry( export_handle, file_entry, sanitized_name, sanitized_name_size, sanitized_name_size - 1, log_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to export root file entry.", function ); goto on_error; } memory_free( sanitized_name ); sanitized_name = NULL; if( export_handle->abort != 0 ) { status = PROCESS_STATUS_ABORTED; } if( process_status_stop( process_status, 0, status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to stop process status.", function ); goto on_error; } if( process_status_free( &process_status, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free process status.", function ); goto on_error; } if( libewf_file_entry_free( &file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free root file entry.", function ); goto on_error; } return( 1 ); on_error: if( process_status != NULL ) { process_status_stop( process_status, 0, PROCESS_STATUS_FAILED, NULL ); process_status_free( &process_status, NULL ); } if( file_entry != NULL ) { libewf_file_entry_free( &file_entry, NULL ); } if( sanitized_name != NULL ) { memory_free( sanitized_name ); } return( -1 ); } /* Exports a (single) file entry * Returns 1 if successful, 0 if not or -1 on error */ int export_handle_export_file_entry( export_handle_t *export_handle, libewf_file_entry_t *file_entry, 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 ) { 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; size_t sanitized_name_size = 0; size_t target_path_size = 0; uint8_t file_entry_type = 0; int result = 0; int return_value = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( file_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file entry.", function ); return( -1 ); } if( libewf_file_entry_get_type( file_entry, &file_entry_type, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry type.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name_size( file_entry, &name_size, error ); #else result = libewf_file_entry_get_utf8_name_size( file_entry, &name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the name.", function ); goto on_error; } if( name_size > 1 ) { name = system_string_allocate( name_size ); if( name == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create name.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( file_entry, (uint16_t *) name, name_size, error ); #else result = libewf_file_entry_get_utf8_name( file_entry, (uint8_t *) name, name_size, error ); #endif if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the name.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_get_sanitized_filename_wide( name, name_size - 1, &sanitized_name, &sanitized_name_size, error ) != 1 ) #else if( libcpath_path_get_sanitized_filename( name, name_size - 1, &sanitized_name, &sanitized_name_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable sanitize name.", function ); goto on_error; } memory_free( name ); name = NULL; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_join_wide( &target_path, &target_path_size, export_path, export_path_size - 1, sanitized_name, sanitized_name_size - 1, error ) != 1 ) #else if( libcpath_path_join( &target_path, &target_path_size, export_path, export_path_size - 1, sanitized_name, sanitized_name_size - 1, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create target path.", function ); goto on_error; } memory_free( sanitized_name ); sanitized_name = NULL; if( target_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid target path.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libcfile_file_exists_wide( target_path, error ); #else result = libcfile_file_exists( target_path, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, "%s: unable to determine if %" PRIs_SYSTEM " exists.", function, target_path ); goto on_error; } else if( result != 0 ) { log_handle_printf( log_handle, "Skipping file entry it already exists.\n" ); } else if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_FILE ) { if( file_entry_path_index >= target_path_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: file entry path index value out of bounds.", function ); return( -1 ); } /* TODO what about NTFS streams ? */ fprintf( export_handle->notify_stream, "Single file: %" PRIs_SYSTEM "\n", &( target_path[ file_entry_path_index ] ) ); return_value = export_handle_export_file_entry_data( export_handle, file_entry, target_path, error ); if( return_value == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to export file entry data.", function ); goto on_error; } if( return_value == 0 ) { fprintf( export_handle->notify_stream, "FAILED\n" ); if( log_handle != NULL ) { log_handle_printf( log_handle, "FAILED\n" ); } } fprintf( export_handle->notify_stream, "\n" ); } else if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_DIRECTORY ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_make_directory_wide( target_path, error ) != 1 ) #else if( libcpath_path_make_directory( target_path, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to create directory: %" PRIs_SYSTEM "", function, target_path ); goto on_error; } log_handle_printf( log_handle, "Created directory: %" PRIs_SYSTEM ".\n", target_path ); } } else { log_handle_printf( log_handle, "Skipping file entry without a name.\n" ); target_path = (system_character_t *) export_path; target_path_size = export_path_size; } if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_DIRECTORY ) { result = export_handle_export_file_entry_sub_file_entries( export_handle, file_entry, target_path, target_path_size, file_entry_path_index, log_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to export sub file entries.", function ); goto on_error; } else if( result == 0 ) { return_value = 0; } } if( target_path != export_path ) { memory_free( target_path ); } return( return_value ); on_error: if( ( target_path != NULL ) && ( target_path != export_path ) ) { memory_free( target_path ); } if( sanitized_name != NULL ) { memory_free( sanitized_name ); } if( name != NULL ) { memory_free( name ); } return( -1 ); } /* Exports the data of a (single) file entry * Returns 1 if successful, 0 if not or -1 on error */ int export_handle_export_file_entry_data( export_handle_t *export_handle, libewf_file_entry_t *file_entry, const system_character_t *export_path, libcerror_error_t **error ) { libcfile_file_t *file = NULL; uint8_t *file_entry_data = NULL; static char *function = "export_handle_export_file_entry_data"; size64_t file_entry_data_size = 0; size_t process_buffer_size = EXPORT_HANDLE_BUFFER_SIZE; size_t read_size = 0; ssize_t read_count = 0; ssize_t write_count = 0; int result = 1; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( export_handle->input_chunk_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing input chunk size.", function ); return( -1 ); } if( export_handle->input_chunk_size > (size32_t) INT32_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid input chunk size value exceeds maximum.", function ); return( -1 ); } if( export_handle->process_buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid export handle - process buffer size value exceeds maximum.", function ); return( -1 ); } if( export_path == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export path.", function ); return( -1 ); } if( libcfile_file_initialize( &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create file.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcfile_file_open_wide( file, export_path, LIBCFILE_OPEN_WRITE, error ) != 1 ) #else if( libcfile_file_open( file, export_path, LIBCFILE_OPEN_WRITE, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open file: %" PRIs_SYSTEM ".", function, export_path ); goto on_error; } /* Export the file entry data */ if( libewf_file_entry_get_size( file_entry, &file_entry_data_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve file entry data size.", function ); goto on_error; } /* If there is no file entry data an empty file is written */ if( file_entry_data_size > 0 ) { if( export_handle->process_buffer_size == 0 ) { process_buffer_size = export_handle->input_chunk_size; } else { process_buffer_size = export_handle->process_buffer_size; } /* This function in not necessary for normal use * but it was added for testing */ if( libewf_file_entry_seek_offset( file_entry, 0, SEEK_SET, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to seek the start of the file entry data.", function ); goto on_error; } file_entry_data = (uint8_t *) memory_allocate( sizeof( uint8_t ) * process_buffer_size ); if( file_entry_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create file entry data.", function ); goto on_error; } while( file_entry_data_size > 0 ) { if( file_entry_data_size >= EXPORT_HANDLE_BUFFER_SIZE ) { read_size = EXPORT_HANDLE_BUFFER_SIZE; } else { read_size = (size_t) file_entry_data_size; } read_count = libewf_file_entry_read_buffer( file_entry, file_entry_data, read_size, error ); if( read_count == (ssize_t) -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read file entry data.", function ); goto on_error; } else if( read_count != (ssize_t) read_size ) { result = 0; break; } file_entry_data_size -= read_size; write_count = libcfile_file_write_buffer( file, file_entry_data, read_size, error ); if( write_count != (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write file entry data.", function ); goto on_error; } } memory_free( file_entry_data ); file_entry_data = NULL; } if( libcfile_file_close( file, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, "%s: unable to close file.", function ); goto on_error; } if( libcfile_file_free( &file, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free file.", function ); goto on_error; } return( result ); on_error: if( file_entry_data != NULL ) { memory_free( file_entry_data ); } if( file != NULL ) { libcfile_file_free( &file, NULL ); } return( -1 ); } /* Exports a (single) file entry sub file entries * Returns 1 if successful, 0 if not or -1 on error */ int export_handle_export_file_entry_sub_file_entries( export_handle_t *export_handle, libewf_file_entry_t *file_entry, 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 ) { libewf_file_entry_t *sub_file_entry = NULL; static char *function = "export_handle_export_file_entry_sub_file_entries"; int number_of_sub_file_entries = 0; int result = 0; int return_value = 1; int sub_file_entry_index = 0; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( libewf_file_entry_get_number_of_sub_file_entries( file_entry, &number_of_sub_file_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub file entries.", function ); goto on_error; } for( sub_file_entry_index = 0; sub_file_entry_index < number_of_sub_file_entries; sub_file_entry_index++ ) { if( libewf_file_entry_get_sub_file_entry( file_entry, sub_file_entry_index, &sub_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to free retrieve sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } result = export_handle_export_file_entry( export_handle, sub_file_entry, export_path, export_path_size, file_entry_path_index, log_handle, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GENERIC, "%s: unable to export sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } else if( result == 0 ) { return_value = 0; } if( libewf_file_entry_free( &sub_file_entry, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub file entry: %d.", function, sub_file_entry_index ); goto on_error; } } return( return_value ); on_error: if( sub_file_entry != NULL ) { libewf_file_entry_free( &sub_file_entry, NULL ); } return( -1 ); } /* Print the hash values to a stream * Returns 1 if successful or -1 on error */ int export_handle_hash_values_fprint( export_handle_t *export_handle, FILE *stream, libcerror_error_t **error ) { static char *function = "export_handle_hash_values_fprint"; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( export_handle->calculate_md5 != 0 ) { if( export_handle->calculated_md5_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing calculated MD5 hash string.", function ); return( -1 ); } fprintf( stream, "MD5 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", export_handle->calculated_md5_hash_string ); } if( export_handle->calculate_sha1 != 0 ) { if( export_handle->calculated_sha1_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing calculated SHA1 hash string.", function ); return( -1 ); } fprintf( stream, "SHA1 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", export_handle->calculated_sha1_hash_string ); } if( export_handle->calculate_sha256 != 0 ) { if( export_handle->calculated_sha256_hash_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid export handle - missing calculated SHA256 hash string.", function ); return( -1 ); } fprintf( stream, "SHA256 hash calculated over data:\t%" PRIs_SYSTEM "\n", export_handle->calculated_sha256_hash_string ); } return( 1 ); } /* Print the checksum errors to a stream * Returns 1 if successful or -1 on error */ int export_handle_checksum_errors_fprint( export_handle_t *export_handle, FILE *stream, libcerror_error_t **error ) { 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; uint64_t start_sector = 0; uint64_t last_sector = 0; uint64_t number_of_sectors = 0; uint32_t number_of_errors = 0; uint32_t error_index = 0; int result = 0; int return_value = 1; if( export_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid export handle.", function ); return( -1 ); } if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( libewf_handle_get_number_of_checksum_errors( export_handle->input_handle, &number_of_errors, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the number of checksum errors.", function ); goto on_error; } if( number_of_errors > 0 ) { fprintf( stream, "Read errors during export:\n" ); fprintf( stream, "\ttotal number: %" PRIu32 "\n", number_of_errors ); for( error_index = 0; error_index < number_of_errors; error_index++ ) { if( libewf_handle_get_checksum_error( export_handle->input_handle, error_index, &start_sector, &number_of_sectors, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve the checksum error: %" PRIu32 ".", function, error_index ); start_sector = 0; number_of_sectors = 0; return_value = -1; } last_sector = start_sector + number_of_sectors - 1; fprintf( stream, "\tat sector(s): %" PRIu64 " - %" PRIu64 " (number: %" PRIu64 ")", start_sector, last_sector, number_of_sectors ); fprintf( stream, " in segment file(s):" ); start_sector *= export_handle->bytes_per_sector; last_sector *= export_handle->bytes_per_sector; while( start_sector <= last_sector ) { if( libewf_handle_seek_offset( export_handle->input_handle, (off64_t) start_sector, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset: %" PRIi64 ".", function, start_sector ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_filename_size_wide( export_handle->input_handle, &filename_size, error ); #else result = libewf_handle_get_filename_size( export_handle->input_handle, &filename_size, error ); #endif if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename size.", function ); goto on_error; } else if( result != 0 ) { filename = system_string_allocate( filename_size ); if( filename == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create filename.", function ); goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_get_filename_wide( export_handle->input_handle, filename, filename_size, error ) != 1 ) #else if( libewf_handle_get_filename( export_handle->input_handle, filename, filename_size, error ) != 1 ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve filename.", function ); goto on_error; } if( last_filename == NULL ) { fprintf( stream, " %" PRIs_SYSTEM "", filename ); last_filename = filename; last_filename_size = filename_size; } else if( ( last_filename_size != filename_size ) || ( memory_compare( last_filename, filename, filename_size ) != 0 ) ) { fprintf( stream, ", %" PRIs_SYSTEM "", filename ); memory_free( last_filename ); last_filename = filename; last_filename_size = filename_size; } else { memory_free( filename ); } } start_sector += export_handle->input_chunk_size; } if( last_filename != NULL ) { memory_free( last_filename ); last_filename = NULL; last_filename_size = 0; } fprintf( stream, "\n" ); } fprintf( stream, "\n" ); } return( return_value ); on_error: if( last_filename != NULL ) { memory_free( last_filename ); } if( filename != NULL ) { memory_free( filename ); } return( -1 ); } libewf-20140807/ewftools/ewftools_libodraw.h0000664000175000017500000000263713421020221023064 0ustar00lordyestalordyesta00000000000000/* * The internal libodraw header * * Copyright (C) 2006-2017, 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_LIBODRAW_H ) #define _EWFTOOLS_LIBODRAW_H #include #if defined( HAVE_LOCAL_LIBODRAW ) #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBODRAW_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBODRAW_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBODRAW ) */ #endif /* !defined( _EWFTOOLS_LIBODRAW_H ) */ libewf-20140807/ewftools/info_handle.h0000664000175000017500000001413613440663046021625 0ustar00lordyestalordyesta00000000000000/* * Info handle * * 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( _INFO_HANDLE_H ) #define _INFO_HANDLE_H #include #include #include #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #if defined( __cplusplus ) extern "C" { #endif enum INFO_HANDLE_OUTPUT_FORMAT_TYPES { INFO_HANDLE_OUTPUT_FORMAT_TEXT = (uint8_t) 't', INFO_HANDLE_OUTPUT_FORMAT_DFXML = (uint8_t) 'x' }; typedef struct info_handle info_handle_t; struct info_handle { /* The output format */ uint8_t output_format; /* The date format */ uint8_t date_format; /* The header codepage */ int header_codepage; /* The libewf input handle */ libewf_handle_t *input_handle; /* The notification output stream */ FILE *notify_stream; }; int info_handle_initialize( info_handle_t **info_handle, libcerror_error_t **error ); int info_handle_free( info_handle_t **info_handle, libcerror_error_t **error ); int info_handle_signal_abort( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_set_maximum_number_of_open_handles( info_handle_t *info_handle, int maximum_number_of_open_handles, libcerror_error_t **error ); int info_handle_open_input( info_handle_t *info_handle, system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int info_handle_close( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_set_output_format( info_handle_t *info_handle, const system_character_t *string, libcerror_error_t **error ); int info_handle_set_date_format( info_handle_t *info_handle, const system_character_t *string, libcerror_error_t **error ); int info_handle_set_header_codepage( info_handle_t *info_handle, const system_character_t *string, libcerror_error_t **error ); int info_handle_section_header_fprint( info_handle_t *info_handle, const char *identifier, const char *description, libcerror_error_t **error ); int info_handle_section_footer_fprint( info_handle_t *info_handle, const char *identifier, libcerror_error_t **error ); int info_handle_section_value_string_fprint( info_handle_t *info_handle, const char *identifier, size_t identifier_length, const char *description, size_t description_length, const system_character_t *value_string, libcerror_error_t **error ); int info_handle_section_value_32bit_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, uint32_t value_32bit, libcerror_error_t **error ); int info_handle_section_value_64bit_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, uint64_t value_64bit, libcerror_error_t **error ); int info_handle_section_value_size_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, size64_t value_size, libcerror_error_t **error ); int info_handle_section_value_boolean_fprint( info_handle_t *info_handle, const char *identifier, const char *description, size_t description_length, int value_boolean, libcerror_error_t **error ); int info_handle_header_value_fprint( info_handle_t *info_handle, const char *identifier, size_t identifier_length, const char *description, size_t description_length, libcerror_error_t **error ); int info_handle_header_values_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_header_value_password_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_header_value_compression_level_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_header_value_extents_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_media_information_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_hash_value_fprint( info_handle_t *info_handle, const char *identifier, size_t identifier_length, libcerror_error_t **error ); int info_handle_hash_values_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_acquiry_errors_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_sessions_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_tracks_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_single_files_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_file_entry_fprint( info_handle_t *info_handle, libewf_file_entry_t *file_entry, int indentation_level, libcerror_error_t **error ); int info_handle_dfxml_header_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int info_handle_dfxml_footer_fprint( info_handle_t *info_handle, libcerror_error_t **error ); int dfxml_build_environment_fprint( FILE *stream, libcerror_error_t **error ); int dfxml_execution_environment_fprint( FILE *stream, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/digest_hash.c0000664000175000017500000000645313421024433021625 0ustar00lordyestalordyesta00000000000000/* * Crypographic digest hash * * 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 . */ #include #include #include "digest_hash.h" #include "ewftools_libcerror.h" /* Converts the EWF digest hash to a printable string * Returns 1 if successful or -1 on error */ int digest_hash_copy_to_string( const uint8_t *digest_hash, size_t digest_hash_size, system_character_t *string, size_t string_size, libcerror_error_t **error ) { static char *function = "digest_hash_copy_to_string"; size_t string_iterator = 0; size_t digest_hash_iterator = 0; uint8_t digest_digit = 0; if( digest_hash == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid digest hash.", function ); return( -1 ); } if( digest_hash_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid digest hash size value exceeds maximum.", function ); return( -1 ); } if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } /* The string requires space for 2 characters per digest hash digit and a end of string */ if( string_size < ( ( 2 * digest_hash_size ) + 1 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, "%s: string too small.", function ); return( -1 ); } for( digest_hash_iterator = 0; digest_hash_iterator < digest_hash_size; digest_hash_iterator++ ) { digest_digit = digest_hash[ digest_hash_iterator ] / 16; if( digest_digit <= 9 ) { string[ string_iterator++ ] = (system_character_t) ( (uint8_t) '0' + digest_digit ); } else { 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++ ] = (system_character_t) ( (uint8_t) '0' + digest_digit ); } else { string[ string_iterator++ ] = (system_character_t) ( (uint8_t) 'a' + ( digest_digit - 10 ) ); } } string[ string_iterator ] = 0; return( 1 ); } libewf-20140807/ewftools/ewftools_libclocale.h0000664000175000017500000000273413440663046023373 0ustar00lordyestalordyesta00000000000000/* * The libclocale header wrapper * * Copyright (C) 2006-2018, 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_LIBCLOCALE_H ) #define _EWFTOOLS_LIBCLOCALE_H #include /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale */ #if defined( HAVE_LOCAL_LIBCLOCALE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT * before including libclocale.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBCLOCALE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ #endif /* !defined( _EWFTOOLS_LIBCLOCALE_H ) */ libewf-20140807/ewftools/ewftools_getopt.h0000664000175000017500000000341513440662654022605 0ustar00lordyestalordyesta00000000000000/* * GetOpt functions * * Copyright (C) 2006-2019, 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_GETOPT_H ) #define _EWFTOOLS_GETOPT_H #include #include /* unistd.h is included here to export getopt, optarg, optind and optopt */ #if defined( HAVE_UNISTD_H ) #include #endif #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_GETOPT ) #define ewftools_getopt( argument_count, argument_values, options_string ) \ getopt( argument_count, argument_values, options_string ) #else #if !defined( __CYGWIN__ ) extern int optind; extern system_character_t *optarg; extern system_integer_t optopt; #else int optind; system_character_t *optarg; system_integer_t optopt; #endif /* !defined( __CYGWIN__ ) */ system_integer_t ewftools_getopt( int argument_count, system_character_t * const argument_values[], const system_character_t *options_string ); #endif /* defined( HAVE_GETOPT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_GETOPT_H ) */ libewf-20140807/ewftools/ewfinput.c0000664000175000017500000012343313421024433021202 0ustar00lordyestalordyesta00000000000000/* * User input functions for the ewftools * * 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 . */ #include #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_STRING_H ) || defined( WINAPI ) #include #endif #include "byte_size_string.h" #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libewf.h" #include "ewftools_system_string.h" /* Input selection defintions */ 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 system_character_t *string, uint8_t *ewf_format, libcerror_error_t **error ) { static char *function = "ewfinput_determine_ewf_format"; size_t string_length = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( ewf_format == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid libewf format.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 3 ) { if( system_string_compare( string, _SYSTEM_STRING( "ewf" ), 3 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_EWF; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "ftk" ), 3 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_FTK; result = 1; } } else if( string_length == 4 ) { if( system_string_compare( string, _SYSTEM_STRING( "ewfx" ), 4 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_EWFX; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "smart" ), 5 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_SMART; result = 1; } } else if( string_length == 6 ) { if( system_string_compare( string, _SYSTEM_STRING( "linen" ), 5 ) == 0 ) { if( string[ 5 ] == (system_character_t) '5' ) { *ewf_format = LIBEWF_FORMAT_LINEN5; result = 1; } else if( string[ 5 ] == (system_character_t) '6' ) { *ewf_format = LIBEWF_FORMAT_LINEN6; result = 1; } } } else if( string_length == 7 ) { if( system_string_compare( string, _SYSTEM_STRING( "encase" ), 6 ) == 0 ) { if( string[ 6 ] == (system_character_t) '1' ) { *ewf_format = LIBEWF_FORMAT_ENCASE1; result = 1; } else if( string[ 6 ] == (system_character_t) '2' ) { *ewf_format = LIBEWF_FORMAT_ENCASE2; result = 1; } else if( string[ 6 ] == (system_character_t) '3' ) { *ewf_format = LIBEWF_FORMAT_ENCASE3; result = 1; } else if( string[ 6 ] == (system_character_t) '4' ) { *ewf_format = LIBEWF_FORMAT_ENCASE4; result = 1; } else if( string[ 6 ] == (system_character_t) '5' ) { *ewf_format = LIBEWF_FORMAT_ENCASE5; result = 1; } else if( string[ 6 ] == (system_character_t) '6' ) { *ewf_format = LIBEWF_FORMAT_ENCASE6; result = 1; } } } return( result ); } /* Determines the sectors per chunk value from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_sectors_per_chunk( const system_character_t *string, uint32_t *sectors_per_chunk, libcerror_error_t **error ) { static char *function = "ewfinput_determine_sectors_per_chunk"; size_t string_length = 0; int result = -1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( sectors_per_chunk == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sectors per chunk.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 2 ) { if( system_string_compare( string, _SYSTEM_STRING( "16" ), 2 ) == 0 ) { *sectors_per_chunk = 16; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "32" ), 2 ) == 0 ) { *sectors_per_chunk = 32; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "64" ), 2 ) == 0 ) { *sectors_per_chunk = 64; result = 1; } } else if( string_length == 3 ) { if( system_string_compare( string, _SYSTEM_STRING( "128" ), 3 ) == 0 ) { *sectors_per_chunk = 128; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "256" ), 3 ) == 0 ) { *sectors_per_chunk = 256; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "512" ), 3 ) == 0 ) { *sectors_per_chunk = 512; result = 1; } } else if( string_length == 4 ) { if( system_string_compare( string, _SYSTEM_STRING( "1024" ), 4 ) == 0 ) { *sectors_per_chunk = 1024; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "2048" ), 4 ) == 0 ) { *sectors_per_chunk = 2048; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "4096" ), 4 ) == 0 ) { *sectors_per_chunk = 4096; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "8192" ), 4 ) == 0 ) { *sectors_per_chunk = 8192; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "16384" ), 5 ) == 0 ) { *sectors_per_chunk = 16384; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "32768" ), 5 ) == 0 ) { *sectors_per_chunk = 32768; result = 1; } } return( result ); } /* Determines the compression method from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_compression_method( const system_character_t *string, uint16_t *compression_method, libcerror_error_t **error ) { static char *function = "ewfinput_determine_compression_method"; size_t string_length = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( compression_method == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compression method.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 7 ) { if( system_string_compare( string, _SYSTEM_STRING( "deflate" ), 7 ) == 0 ) { *compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; result = 1; } } return( result ); } /* Determines the compression values from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_compression_values( const system_character_t *string, int8_t *compression_level, uint8_t *compression_flags, libcerror_error_t **error ) { static char *function = "ewfinput_determine_compression_values"; size_t string_length = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( compression_level == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compression level.", function ); return( -1 ); } if( compression_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid compression flags.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 4 ) { if( system_string_compare( string, _SYSTEM_STRING( "none" ), 4 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_NONE; *compression_flags = 0; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "fast" ), 4 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_FAST; *compression_flags = 0; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "best" ), 4 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_BEST; *compression_flags = 0; result = 1; } } else if( string_length == 11 ) { if( system_string_compare( string, _SYSTEM_STRING( "empty-block" ), 11 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_NONE; *compression_flags = LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "empty_block" ), 11 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_NONE; *compression_flags = LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION; result = 1; } } return( result ); } /* Determines the media type value from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_media_type( const system_character_t *string, uint8_t *media_type, libcerror_error_t **error ) { static char *function = "ewfinput_determine_media_type"; size_t string_length = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( media_type == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media type.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "fixed" ), 5 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_FIXED; result = 1; } } else if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "memory" ), 6 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_MEMORY; result = 1; } } else if( string_length == 7 ) { if( system_string_compare( string, _SYSTEM_STRING( "optical" ), 7 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_OPTICAL; result = 1; } } else if( string_length == 9 ) { if( system_string_compare( string, _SYSTEM_STRING( "removable" ), 9 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_REMOVABLE; result = 1; } } return( result ); } /* Determines the media flags value from a string * Returns 1 if successful or -1 on error */ int ewfinput_determine_media_flags( const system_character_t *string, uint8_t *media_flags, libcerror_error_t **error ) { static char *function = "ewfinput_determine_media_flags"; int result = -1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( media_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid media flags.", function ); return( -1 ); } if( system_string_compare( string, _SYSTEM_STRING( "logical" ), 7 ) == 0 ) { *media_flags &= ~LIBEWF_MEDIA_FLAG_PHYSICAL; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "physical" ), 8 ) == 0 ) { *media_flags |= LIBEWF_MEDIA_FLAG_PHYSICAL; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "fastbloc" ), 8 ) == 0 ) { *media_flags |= LIBEWF_MEDIA_FLAG_FASTBLOC; result = 1; } else if( system_string_compare( string, _SYSTEM_STRING( "tableau" ), 8 ) == 0 ) { *media_flags |= LIBEWF_MEDIA_FLAG_TABLEAU; result = 1; } return( result ); } /* Determines the codepage from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_header_codepage( const system_character_t *string, int *header_codepage, libcerror_error_t **error ) { static char *function = "ewfinput_determine_header_codepage"; size_t string_length = 0; int result = -1; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( header_codepage == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid header codepage.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 5 ) { if( system_string_compare( string, _SYSTEM_STRING( "ascii" ), 5 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ASCII; result = 1; } } #if defined( HAVE_ISO_CODEPAGES ) if( ( string_length == 10 ) || ( string_length == 11 ) ) { if( system_string_compare( string, _SYSTEM_STRING( "iso" ), 3 ) == 0 ) { if( ( string[ 3 ] != '-' ) && ( string[ 3 ] != '_' ) ) { } else if( system_string_compare( &( string[ 4 ] ), _SYSTEM_STRING( "8859" ), 4 ) == 0 ) { if( ( string[ 8 ] != '-' ) && ( string[ 8 ] != '_' ) ) { } else if( string_length == 10 ) { if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "1" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_1; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "2" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_2; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "3" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_3; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "4" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_4; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "5" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_5; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "6" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_6; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "7" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_7; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "8" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_8; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "9" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_9; result = 1; } } else if( string_length == 11 ) { if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "10" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_10; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "11" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_11; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "13" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_13; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "14" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_14; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "15" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_15; result = 1; } else if( system_string_compare( &( string[ 9 ] ), _SYSTEM_STRING( "16" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_16; result = 1; } } } } } #endif if( ( string_length == 11 ) || ( string_length == 12 ) ) { if( system_string_compare( string, _SYSTEM_STRING( "windows" ), 7 ) == 0 ) { if( ( string[ 7 ] != '-' ) && ( string[ 7 ] != '_' ) ) { } else if( string_length == 11 ) { if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "874" ), 3 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_874; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "932" ), 3 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_932; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "936" ), 3 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_936; result = 1; } } else if( string_length == 12 ) { if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1250" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1250; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1251" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1251; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1252" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1252; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1253" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1253; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1253" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1253; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1254" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1254; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1255" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1255; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1256" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1256; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1257" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1257; result = 1; } else if( system_string_compare( &( string[ 8 ] ), _SYSTEM_STRING( "1258" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1258; result = 1; } } } } return( result ); } /* Determines the yes or no value from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_yes_no( const system_character_t *string, uint8_t *yes_no_value, libcerror_error_t **error ) { static char *function = "ewfinput_determine_yes_no"; size_t string_length = 0; int result = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( yes_no_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid yes no value.", function ); return( -1 ); } string_length = system_string_length( string ); if( string_length == 2 ) { if( system_string_compare( string, _SYSTEM_STRING( "no" ), 2 ) == 0 ) { *yes_no_value = 0; result = 1; } } else if( string_length == 3 ) { if( system_string_compare( string, _SYSTEM_STRING( "yes" ), 3 ) == 0 ) { *yes_no_value = 1; result = 1; } } return( result ); } /* Retrieves a string variable * Returns 1 if successful, 0 if no input was provided or -1 on error */ int ewfinput_get_string_variable( FILE *stream, const system_character_t *request_string, system_character_t *string_variable, size_t string_variable_size, libcerror_error_t **error ) { 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; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid output stream.", function ); return( -1 ); } if( request_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid request string.", function ); return( -1 ); } if( string_variable == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string variable.", function ); return( -1 ); } #if SIZEOF_SIZE_T > SIZEOF_INT if( string_variable_size > (size_t) INT_MAX ) #else if( string_variable_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string variable size value exceeds maximum.", function ); return( -1 ); } /* Safe guard the end of the input string */ string_variable[ string_variable_size - 1 ] = 0; while( 1 ) { fprintf( stream, "%" PRIs_SYSTEM ": ", request_string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, string_variable, (int) ( string_variable_size - 1 ) ); #else result_string = file_stream_get_string( stdin, string_variable, (int) ( string_variable_size - 1 ) ); #endif if( result_string != NULL ) { end_of_input = system_string_search_character( string_variable, (system_character_t) '\n', string_variable_size ); /* Input was larger than size of buffer */ if( end_of_input == NULL ) { /* Flush the stdin stream */ while( end_of_input == NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, string_variable, (int) ( string_variable_size - 1 ) ); #else result_string = file_stream_get_string( stdin, string_variable, (int) ( string_variable_size - 1 ) ); #endif end_of_input = system_string_search_character( string_variable, (system_character_t) '\n', string_variable_size ); } return( -1 ); } input_length = (ssize_t) ( end_of_input - string_variable ); if( input_length < 0 ) { return( -1 ); } /* Make sure the string is terminated with an end of string character */ string_variable[ input_length ] = 0; break; } else { fprintf( stream, "Error reading input, please try again or terminate using Ctrl^C.\n" ); } } if( input_length == 0 ) { return( 0 ); } return( 1 ); } /* Retrieves a size variable * Returns 1 if successful, 0 if no input was provided or -1 on error */ int ewfinput_get_size_variable( FILE *stream, system_character_t *input_buffer, size_t input_buffer_size, 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 ) { 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; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid output stream.", function ); return( -1 ); } if( input_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid input buffer.", function ); return( -1 ); } #if SIZEOF_SIZE_T > SIZEOF_INT if( input_buffer_size > (size_t) INT_MAX ) #else if( input_buffer_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid input buffer size value exceeds maximum.", function ); return( -1 ); } if( request_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid request string.", function ); return( -1 ); } if( size_variable == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size variable.", function ); return( -1 ); } /* Safe guard the end of the input buffer */ input_buffer[ input_buffer_size - 1 ] = 0; while( 1 ) { fprintf( stream, "%" PRIs_SYSTEM " (%" PRIu64 " <= value <= %" PRIu64 ") [%" PRIu64 "]: ", request_string, minimum_size, maximum_size, default_size ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, (int)( input_buffer_size - 1 ) ); #else result_string = file_stream_get_string( stdin, input_buffer, (int)( input_buffer_size - 1 ) ); #endif if( result_string != NULL ) { end_of_input = system_string_search_character( input_buffer, (system_character_t) '\n', input_buffer_size ); /* Input was larger than size of buffer */ if( end_of_input == NULL ) { /* Flush the stdin stream */ while( end_of_input == NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #else result_string = file_stream_get_string( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #endif end_of_input = system_string_search_character( input_buffer, (system_character_t) '\n', input_buffer_size ); } return( -1 ); } input_length = (ssize_t) ( end_of_input - input_buffer ); if( input_length < 0 ) { return( -1 ); } else if( input_length == 0 ) { *size_variable = default_size; return( 0 ); } if( ewftools_system_string_decimal_copy_to_64_bit( input_buffer, input_length, size_variable, NULL ) != 1 ) { fprintf( stream, "Unable to convert value into number, please try again or terminate using Ctrl^C.\n" ); } else if( ( *size_variable >= minimum_size ) && ( *size_variable <= maximum_size ) ) { break; } else { fprintf( stream, "Value not within specified range, please try again or terminate using Ctrl^C.\n" ); } } else { fprintf( stream, "Error reading input, please try again or terminate using Ctrl^C.\n" ); } } return( 1 ); } /* Retrieves a byte size variable * Returns 1 if successful, 0 if no input was provided or -1 on error */ int ewfinput_get_byte_size_variable( FILE *stream, system_character_t *input_buffer, size_t input_buffer_size, 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 ) { system_character_t minimum_size_string[ 16 ]; system_character_t maximum_size_string[ 16 ]; system_character_t default_size_string[ 16 ]; 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; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid output stream.", function ); return( -1 ); } if( input_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid input buffer.", function ); return( -1 ); } #if SIZEOF_SIZE_T > SIZEOF_INT if( input_buffer_size > (size_t) INT_MAX ) #else if( input_buffer_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid input buffer size value exceeds maximum.", function ); return( -1 ); } if( request_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid request string.", function ); return( -1 ); } if( byte_size_variable == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid byte size variable.", function ); return( -1 ); } if( byte_size_string_create( minimum_size_string, 16, minimum_size, BYTE_SIZE_STRING_UNIT_MEBIBYTE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create minimum byte size string.", function ); return( -1 ); } if( byte_size_string_create( default_size_string, 16, default_size, BYTE_SIZE_STRING_UNIT_MEBIBYTE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create default byte size string.", function ); return( -1 ); } if( byte_size_string_create( maximum_size_string, 16, maximum_size, BYTE_SIZE_STRING_UNIT_MEBIBYTE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to create maximum byte size string.", function ); return( -1 ); } /* Safe guard the end of the input buffer */ input_buffer[ input_buffer_size - 1 ] = 0; while( 1 ) { fprintf( stream, "%" PRIs_SYSTEM " (%" PRIs_SYSTEM " <= value <= %" PRIs_SYSTEM ") [%" PRIs_SYSTEM "]: ", request_string, minimum_size_string, maximum_size_string, default_size_string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #else result_string = file_stream_get_string( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #endif if( result_string != NULL ) { end_of_input = system_string_search_character( input_buffer, (system_character_t) '\n', input_buffer_size ); /* Input was larger than size of buffer */ if( end_of_input == NULL ) { /* Flush the stdin stream */ while( end_of_input == NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #else result_string = file_stream_get_string( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #endif end_of_input = system_string_search_character( input_buffer, (system_character_t) '\n', input_buffer_size ); } return( -1 ); } input_length = (ssize_t) ( end_of_input - input_buffer ); if( input_length < 0 ) { return( -1 ); } else if( input_length == 0 ) { *byte_size_variable = default_size; return( 0 ); } if( byte_size_string_convert( input_buffer, (size_t) input_length, byte_size_variable, NULL ) != 1 ) { fprintf( stream, "Invalid value, please try again or terminate using Ctrl^C.\n" ); } else if( ( *byte_size_variable >= minimum_size ) && ( *byte_size_variable <= maximum_size ) ) { break; } else { fprintf( stream, "Value not within specified range, please try again or terminate using Ctrl^C.\n" ); } } else { fprintf( stream, "Error reading input, please try again or terminate using Ctrl^C.\n" ); } } return( 1 ); } /* Retrieves a fixed value string variable * Returns 1 if successful, 0 if no input was provided or -1 on error */ int ewfinput_get_fixed_string_variable( FILE *stream, system_character_t *input_buffer, size_t input_buffer_size, const system_character_t *request_string, system_character_t **values, uint8_t number_of_values, uint8_t default_value, system_character_t **fixed_string_variable, libcerror_error_t **error ) { 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; uint8_t value_iterator = 0; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid output stream.", function ); return( -1 ); } if( input_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid input buffer.", function ); return( -1 ); } #if SIZEOF_SIZE_T > SIZEOF_INT if( input_buffer_size > (size_t) INT_MAX ) #else if( input_buffer_size > (size_t) SSIZE_MAX ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid input buffer size value exceeds maximum.", function ); return( -1 ); } if( request_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid request string.", function ); return( -1 ); } if( default_value >= number_of_values ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: default value exceeds number of values.", function ); return( -1 ); } if( fixed_string_variable == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid fixed string variable.", function ); return( -1 ); } while( 1 ) { fprintf( stream, "%" PRIs_SYSTEM " (", request_string ); for( value_iterator = 0; value_iterator < number_of_values; value_iterator++ ) { if( value_iterator > 0 ) { fprintf( stream, ", " ); } fprintf( stream, "%" PRIs_SYSTEM "", values[ value_iterator ] ); } fprintf( stream, ") [%" PRIs_SYSTEM "]: ", values[ default_value ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #else result_string = file_stream_get_string( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #endif if( result_string != NULL ) { end_of_input = system_string_search_character( input_buffer, (system_character_t) '\n', input_buffer_size ); /* Input was larger than size of buffer */ if( end_of_input == NULL ) { /* Flush the stdin stream */ while( end_of_input == NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #else result_string = file_stream_get_string( stdin, input_buffer, (int) ( input_buffer_size - 1 ) ); #endif end_of_input = system_string_search_character( input_buffer, (system_character_t) '\n', input_buffer_size ); } return( -1 ); } input_length = (ssize_t) ( end_of_input - input_buffer ); if( input_length < 0 ) { return( -1 ); } else if( input_length == 0 ) { *fixed_string_variable = values[ default_value ]; return( 0 ); } for( value_iterator = 0; value_iterator < number_of_values; value_iterator++ ) { value_length = system_string_length( values[ value_iterator ] ); if( ( value_length == (size_t) input_length ) && ( system_string_compare( input_buffer, values[ value_iterator ], value_length ) == 0 ) ) { break; } } if( value_iterator < number_of_values ) { *fixed_string_variable = values[ value_iterator ]; break; } fprintf( stream, "Selected option not supported, please try again or terminate using Ctrl^C.\n" ); } else { fprintf( stream, "Error reading input, please try again or terminate using Ctrl^C.\n" ); } } return( 1 ); } libewf-20140807/ewftools/Makefile.in0000664000175000017500000015166313443455347021270 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = ewfacquire$(EXEEXT) ewfacquirestream$(EXEEXT) \ ewfdebug$(EXEEXT) ewfexport$(EXEEXT) ewfinfo$(EXEEXT) \ ewfmount$(EXEEXT) ewfrecover$(EXEEXT) ewfverify$(EXEEXT) subdir = ewftools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_ewfacquire_OBJECTS = byte_size_string.$(OBJEXT) \ digest_hash.$(OBJEXT) device_handle.$(OBJEXT) \ ewfacquire.$(OBJEXT) ewfinput.$(OBJEXT) \ ewftools_getopt.$(OBJEXT) ewftools_output.$(OBJEXT) \ ewftools_signal.$(OBJEXT) ewftools_system_string.$(OBJEXT) \ guid.$(OBJEXT) imaging_handle.$(OBJEXT) log_handle.$(OBJEXT) \ platform.$(OBJEXT) process_status.$(OBJEXT) \ storage_media_buffer.$(OBJEXT) ewfacquire_OBJECTS = $(am_ewfacquire_OBJECTS) ewfacquire_DEPENDENCIES = ../libewf/libewf.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_ewfacquirestream_OBJECTS = byte_size_string.$(OBJEXT) \ digest_hash.$(OBJEXT) ewfacquirestream.$(OBJEXT) \ ewfinput.$(OBJEXT) ewftools_getopt.$(OBJEXT) \ ewftools_output.$(OBJEXT) ewftools_signal.$(OBJEXT) \ ewftools_system_string.$(OBJEXT) guid.$(OBJEXT) \ imaging_handle.$(OBJEXT) log_handle.$(OBJEXT) \ platform.$(OBJEXT) process_status.$(OBJEXT) \ storage_media_buffer.$(OBJEXT) ewfacquirestream_OBJECTS = $(am_ewfacquirestream_OBJECTS) ewfacquirestream_DEPENDENCIES = ../libewf/libewf.la am_ewfdebug_OBJECTS = byte_size_string.$(OBJEXT) ewfdebug.$(OBJEXT) \ ewfinput.$(OBJEXT) ewftools_getopt.$(OBJEXT) \ ewftools_glob.$(OBJEXT) ewftools_output.$(OBJEXT) \ ewftools_signal.$(OBJEXT) ewftools_system_string.$(OBJEXT) ewfdebug_OBJECTS = $(am_ewfdebug_OBJECTS) ewfdebug_DEPENDENCIES = ../libewf/libewf.la am_ewfexport_OBJECTS = byte_size_string.$(OBJEXT) \ digest_hash.$(OBJEXT) ewfexport.$(OBJEXT) ewfinput.$(OBJEXT) \ ewftools_getopt.$(OBJEXT) ewftools_glob.$(OBJEXT) \ ewftools_output.$(OBJEXT) ewftools_signal.$(OBJEXT) \ ewftools_system_string.$(OBJEXT) export_handle.$(OBJEXT) \ guid.$(OBJEXT) log_handle.$(OBJEXT) platform.$(OBJEXT) \ process_status.$(OBJEXT) storage_media_buffer.$(OBJEXT) ewfexport_OBJECTS = $(am_ewfexport_OBJECTS) ewfexport_DEPENDENCIES = ../libewf/libewf.la am_ewfinfo_OBJECTS = byte_size_string.$(OBJEXT) digest_hash.$(OBJEXT) \ ewfinfo.$(OBJEXT) ewfinput.$(OBJEXT) ewftools_getopt.$(OBJEXT) \ ewftools_glob.$(OBJEXT) ewftools_output.$(OBJEXT) \ ewftools_signal.$(OBJEXT) ewftools_system_string.$(OBJEXT) \ guid.$(OBJEXT) info_handle.$(OBJEXT) platform.$(OBJEXT) ewfinfo_OBJECTS = $(am_ewfinfo_OBJECTS) ewfinfo_DEPENDENCIES = ../libewf/libewf.la am_ewfmount_OBJECTS = byte_size_string.$(OBJEXT) digest_hash.$(OBJEXT) \ ewfmount.$(OBJEXT) ewfinput.$(OBJEXT) \ ewftools_getopt.$(OBJEXT) ewftools_glob.$(OBJEXT) \ ewftools_output.$(OBJEXT) ewftools_signal.$(OBJEXT) \ ewftools_system_string.$(OBJEXT) guid.$(OBJEXT) \ mount_dokan.$(OBJEXT) mount_file_entry.$(OBJEXT) \ mount_file_system.$(OBJEXT) mount_fuse.$(OBJEXT) \ mount_handle.$(OBJEXT) platform.$(OBJEXT) ewfmount_OBJECTS = $(am_ewfmount_OBJECTS) ewfmount_DEPENDENCIES = ../libewf/libewf.la am_ewfrecover_OBJECTS = byte_size_string.$(OBJEXT) \ digest_hash.$(OBJEXT) ewfrecover.$(OBJEXT) ewfinput.$(OBJEXT) \ ewftools_getopt.$(OBJEXT) ewftools_glob.$(OBJEXT) \ ewftools_output.$(OBJEXT) ewftools_signal.$(OBJEXT) \ ewftools_system_string.$(OBJEXT) export_handle.$(OBJEXT) \ guid.$(OBJEXT) log_handle.$(OBJEXT) platform.$(OBJEXT) \ process_status.$(OBJEXT) storage_media_buffer.$(OBJEXT) ewfrecover_OBJECTS = $(am_ewfrecover_OBJECTS) ewfrecover_DEPENDENCIES = ../libewf/libewf.la am_ewfverify_OBJECTS = byte_size_string.$(OBJEXT) \ digest_hash.$(OBJEXT) ewfinput.$(OBJEXT) \ ewftools_getopt.$(OBJEXT) ewftools_glob.$(OBJEXT) \ ewftools_output.$(OBJEXT) ewftools_signal.$(OBJEXT) \ ewftools_system_string.$(OBJEXT) ewfverify.$(OBJEXT) \ log_handle.$(OBJEXT) process_status.$(OBJEXT) \ storage_media_buffer.$(OBJEXT) verification_handle.$(OBJEXT) ewfverify_OBJECTS = $(am_ewfverify_OBJECTS) ewfverify_DEPENDENCIES = ../libewf/libewf.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/byte_size_string.Po \ ./$(DEPDIR)/device_handle.Po ./$(DEPDIR)/digest_hash.Po \ ./$(DEPDIR)/ewfacquire.Po ./$(DEPDIR)/ewfacquirestream.Po \ ./$(DEPDIR)/ewfdebug.Po ./$(DEPDIR)/ewfexport.Po \ ./$(DEPDIR)/ewfinfo.Po ./$(DEPDIR)/ewfinput.Po \ ./$(DEPDIR)/ewfmount.Po ./$(DEPDIR)/ewfrecover.Po \ ./$(DEPDIR)/ewftools_getopt.Po ./$(DEPDIR)/ewftools_glob.Po \ ./$(DEPDIR)/ewftools_output.Po ./$(DEPDIR)/ewftools_signal.Po \ ./$(DEPDIR)/ewftools_system_string.Po ./$(DEPDIR)/ewfverify.Po \ ./$(DEPDIR)/export_handle.Po ./$(DEPDIR)/guid.Po \ ./$(DEPDIR)/imaging_handle.Po ./$(DEPDIR)/info_handle.Po \ ./$(DEPDIR)/log_handle.Po ./$(DEPDIR)/mount_dokan.Po \ ./$(DEPDIR)/mount_file_entry.Po \ ./$(DEPDIR)/mount_file_system.Po ./$(DEPDIR)/mount_fuse.Po \ ./$(DEPDIR)/mount_handle.Po ./$(DEPDIR)/platform.Po \ ./$(DEPDIR)/process_status.Po \ ./$(DEPDIR)/storage_media_buffer.Po \ ./$(DEPDIR)/verification_handle.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ewfacquire_SOURCES) $(ewfacquirestream_SOURCES) \ $(ewfdebug_SOURCES) $(ewfexport_SOURCES) $(ewfinfo_SOURCES) \ $(ewfmount_SOURCES) $(ewfrecover_SOURCES) $(ewfverify_SOURCES) DIST_SOURCES = $(ewfacquire_SOURCES) $(ewfacquirestream_SOURCES) \ $(ewfdebug_SOURCES) $(ewfexport_SOURCES) $(ewfinfo_SOURCES) \ $(ewfmount_SOURCES) $(ewfrecover_SOURCES) $(ewfverify_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCDATETIME_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ @LIBFDATA_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @LIBMFDATA_CPPFLAGS@ \ @LIBCRYPTO_CPPFLAGS@ \ @LIBHMAC_CPPFLAGS@ \ @LIBODRAW_CPPFLAGS@ \ @LIBSMDEV_CPPFLAGS@ \ @LIBSMRAW_CPPFLAGS@ \ @LIBFUSE_CPPFLAGS@ \ @LIBEWF_DLL_IMPORT@ AM_LDFLAGS = @STATIC_LDFLAGS@ ewfacquire_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ device_handle.c device_handle.h \ ewfacquire.c \ ewfcommon.h \ ewfinput.c ewfinput.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ imaging_handle.c imaging_handle.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfacquire_LDADD = \ @LIBODRAW_LIBADD@ \ @LIBSMDEV_LIBADD@ \ @LIBSMRAW_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ @LIBCDATA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfacquirestream_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfacquirestream.c \ ewfcommon.h \ ewfinput.c ewfinput.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ imaging_handle.c imaging_handle.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfacquirestream_LDADD = \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfdebug_SOURCES = \ byte_size_string.c byte_size_string.h \ ewfdebug.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h ewfdebug_LDADD = \ @LIBUNA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfexport_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfcommon.h \ ewfexport.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libcfile.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ export_handle.c export_handle.h \ guid.c guid.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfexport_LDADD = \ @LIBSMRAW_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ @LIBCDATA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfinfo_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfinfo.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcsplit.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ info_handle.c info_handle.h \ platform.c platform.h ewfinfo_LDADD = \ @LIBUUID_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfmount_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfmount.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libewf.h \ ewftools_libfvalue.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ guid.c guid.h \ mount_dokan.c mount_dokan.h \ mount_file_entry.c mount_file_entry.h \ mount_file_system.c mount_file_system.h \ mount_fuse.c mount_fuse.h \ mount_handle.c mount_handle.h \ platform.c platform.h ewfmount_LDADD = \ @LIBFUSE_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ ../libewf/libewf.la \ @LIBCTHREADS_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfrecover_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfcommon.h \ ewfrecover.c \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libcfile.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ export_handle.c export_handle.h \ guid.c guid.h \ log_handle.c log_handle.h \ platform.c platform.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h ewfrecover_LDADD = \ @LIBSMRAW_LIBADD@ \ @LIBUUID_LIBADD@ \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @LIBFDATA_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ @LIBCDATA_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ ewfverify_SOURCES = \ byte_size_string.c byte_size_string.h \ digest_hash.c digest_hash.h \ ewfcommon.h \ ewfinput.c ewfinput.h \ ewftools_find.h \ ewftools_getopt.c ewftools_getopt.h \ ewftools_glob.c ewftools_glob.h \ ewftools_i18n.h \ ewftools_libbfio.h \ ewftools_libcdatetime.h \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ ewftools_libsmdev.h \ ewftools_libsmraw.h \ ewftools_libuna.h \ ewftools_output.c ewftools_output.h \ ewftools_signal.c ewftools_signal.h \ ewftools_system_string.c ewftools_system_string.h \ ewftools_unused.h \ ewfverify.c \ log_handle.c log_handle.h \ process_status.c process_status.h \ storage_media_buffer.c storage_media_buffer.h \ verification_handle.c verification_handle.h ewfverify_LDADD = \ @LIBHMAC_LIBADD@ \ @LIBCRYPTO_LIBADD@ \ @LIBDL_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBCDATETIME_LIBADD@ \ ../libewf/libewf.la \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBINTL@ MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ewftools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu ewftools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ewfacquire$(EXEEXT): $(ewfacquire_OBJECTS) $(ewfacquire_DEPENDENCIES) $(EXTRA_ewfacquire_DEPENDENCIES) @rm -f ewfacquire$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfacquire_OBJECTS) $(ewfacquire_LDADD) $(LIBS) ewfacquirestream$(EXEEXT): $(ewfacquirestream_OBJECTS) $(ewfacquirestream_DEPENDENCIES) $(EXTRA_ewfacquirestream_DEPENDENCIES) @rm -f ewfacquirestream$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfacquirestream_OBJECTS) $(ewfacquirestream_LDADD) $(LIBS) ewfdebug$(EXEEXT): $(ewfdebug_OBJECTS) $(ewfdebug_DEPENDENCIES) $(EXTRA_ewfdebug_DEPENDENCIES) @rm -f ewfdebug$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfdebug_OBJECTS) $(ewfdebug_LDADD) $(LIBS) ewfexport$(EXEEXT): $(ewfexport_OBJECTS) $(ewfexport_DEPENDENCIES) $(EXTRA_ewfexport_DEPENDENCIES) @rm -f ewfexport$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfexport_OBJECTS) $(ewfexport_LDADD) $(LIBS) ewfinfo$(EXEEXT): $(ewfinfo_OBJECTS) $(ewfinfo_DEPENDENCIES) $(EXTRA_ewfinfo_DEPENDENCIES) @rm -f ewfinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfinfo_OBJECTS) $(ewfinfo_LDADD) $(LIBS) ewfmount$(EXEEXT): $(ewfmount_OBJECTS) $(ewfmount_DEPENDENCIES) $(EXTRA_ewfmount_DEPENDENCIES) @rm -f ewfmount$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfmount_OBJECTS) $(ewfmount_LDADD) $(LIBS) ewfrecover$(EXEEXT): $(ewfrecover_OBJECTS) $(ewfrecover_DEPENDENCIES) $(EXTRA_ewfrecover_DEPENDENCIES) @rm -f ewfrecover$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfrecover_OBJECTS) $(ewfrecover_LDADD) $(LIBS) ewfverify$(EXEEXT): $(ewfverify_OBJECTS) $(ewfverify_DEPENDENCIES) $(EXTRA_ewfverify_DEPENDENCIES) @rm -f ewfverify$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ewfverify_OBJECTS) $(ewfverify_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byte_size_string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digest_hash.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfacquire.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfacquirestream.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfdebug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfexport.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfinfo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfinput.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfmount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfrecover.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewftools_getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewftools_glob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewftools_output.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewftools_signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewftools_system_string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewfverify.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imaging_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_dokan.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_file_entry.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_file_system.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_fuse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/platform.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_status.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/storage_media_buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verification_handle.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/byte_size_string.Po -rm -f ./$(DEPDIR)/device_handle.Po -rm -f ./$(DEPDIR)/digest_hash.Po -rm -f ./$(DEPDIR)/ewfacquire.Po -rm -f ./$(DEPDIR)/ewfacquirestream.Po -rm -f ./$(DEPDIR)/ewfdebug.Po -rm -f ./$(DEPDIR)/ewfexport.Po -rm -f ./$(DEPDIR)/ewfinfo.Po -rm -f ./$(DEPDIR)/ewfinput.Po -rm -f ./$(DEPDIR)/ewfmount.Po -rm -f ./$(DEPDIR)/ewfrecover.Po -rm -f ./$(DEPDIR)/ewftools_getopt.Po -rm -f ./$(DEPDIR)/ewftools_glob.Po -rm -f ./$(DEPDIR)/ewftools_output.Po -rm -f ./$(DEPDIR)/ewftools_signal.Po -rm -f ./$(DEPDIR)/ewftools_system_string.Po -rm -f ./$(DEPDIR)/ewfverify.Po -rm -f ./$(DEPDIR)/export_handle.Po -rm -f ./$(DEPDIR)/guid.Po -rm -f ./$(DEPDIR)/imaging_handle.Po -rm -f ./$(DEPDIR)/info_handle.Po -rm -f ./$(DEPDIR)/log_handle.Po -rm -f ./$(DEPDIR)/mount_dokan.Po -rm -f ./$(DEPDIR)/mount_file_entry.Po -rm -f ./$(DEPDIR)/mount_file_system.Po -rm -f ./$(DEPDIR)/mount_fuse.Po -rm -f ./$(DEPDIR)/mount_handle.Po -rm -f ./$(DEPDIR)/platform.Po -rm -f ./$(DEPDIR)/process_status.Po -rm -f ./$(DEPDIR)/storage_media_buffer.Po -rm -f ./$(DEPDIR)/verification_handle.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on ewfacquire ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfacquire_SOURCES) @echo "Running splint on ewfacquirestream ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfacquirestream_SOURCES) @echo "Running splint on ewfdebug ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfdebug_SOURCES) @echo "Running splint on ewfexport ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfexport_SOURCES) @echo "Running splint on ewfinfo ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfinfo_SOURCES) @echo "Running splint on ewfmount ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfmount_SOURCES) @echo "Running splint on ewfrecover ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfrecover_SOURCES) @echo "Running splint on ewfverify ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(ewfverify_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/ewftools/ewftools_output.h0000664000175000017500000000266413421020221022621 0ustar00lordyestalordyesta00000000000000/* * Output functions * * Copyright (C) 2006-2019, 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_OUTPUT_H ) #define _EWFTOOLS_OUTPUT_H #include #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int ewftools_output_initialize( int stdio_mode, libcerror_error_t **error ); void ewftools_output_copyright_fprint( FILE *stream ); void ewftools_output_version_fprint( FILE *stream, const system_character_t *program ); void ewftools_output_version_detailed_fprint( FILE *stream, const system_character_t *program ); #if defined( __cplusplus ) } #endif #endif /* !defined( _EWFTOOLS_OUTPUT_H ) */ libewf-20140807/ewftools/ewftools_libcpath.h0000664000175000017500000000257513440663046023073 0ustar00lordyestalordyesta00000000000000/* * The libcpath header wrapper * * Copyright (C) 2006-2018, 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_LIBCPATH_H ) #define _EWFTOOLS_LIBCPATH_H #include /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath */ #if defined( HAVE_LOCAL_LIBCPATH ) #include #include #else /* If libtool DLL support is enabled set LIBCPATH_DLL_IMPORT * before including libcpath.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBCPATH_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCPATH ) */ #endif /* !defined( _EWFTOOLS_LIBCPATH_H ) */ libewf-20140807/ewftools/byte_size_string.h0000664000175000017500000000275213421024433022731 0ustar00lordyestalordyesta00000000000000/* * Byte size string functions * * 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( _BYTE_SIZE_STRING_H ) #define _BYTE_SIZE_STRING_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif enum BYTE_SIZE_STRING_UNITS { BYTE_SIZE_STRING_UNIT_MEGABYTE = 1000, BYTE_SIZE_STRING_UNIT_MEBIBYTE = 1024 }; int byte_size_string_create( 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 system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/ewfdebug.c0000664000175000017500000002465213421037364021143 0ustar00lordyestalordyesta00000000000000/* * Debugs EWF files * * 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 . */ #include #include #include #include #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif #if defined( HAVE_GLOB_H ) #include #endif #include "ewfinput.h" #include "ewftools_getopt.h" #include "ewftools_glob.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" libewf_handle_t *ewfdebug_input_handle = NULL; int ewfdebug_abort = 0; /* Prints the executable usage information to the stream * */ void usage_fprint( FILE *stream ) { if( stream == NULL ) { return; } fprintf( stream, "Use ewfdebug to analyze EWF file(s).\n\n" ); fprintf( stream, "Usage: ewfdebug [ -A codepage ] [ -hqvV ] ewf_files\n\n" ); fprintf( stream, "\tewf_files: the first or the entire set of EWF segment files\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-q: quiet shows minimal status information\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); } /* Signal handler for ewfdebug */ void ewfdebug_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfdebug_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfdebug_abort = 1; if( ( ewfdebug_input_handle != NULL ) && ( libewf_handle_signal_abort( ewfdebug_input_handle, &error ) != 1 ) ) { libcnotify_printf( "%s: unable to signal input handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); return; } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* The main program */ #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( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif libcerror_error_t *error = NULL; system_character_t * const *argv_filenames = NULL; system_character_t **ewf_filenames = NULL; system_character_t *option_header_codepage = NULL; system_character_t *program = _SYSTEM_STRING( "ewfdebug" ); system_integer_t option = 0; size_t first_filename_length = 0; uint8_t verbose = 0; int number_of_filenames = 0; int header_codepage = LIBEWF_CODEPAGE_ASCII; int result = 0; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } while( ( option = ewftools_getopt( argc, argv, _SYSTEM_STRING( "A:hqvV" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); usage_fprint( stdout ); return( EXIT_FAILURE ); case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); usage_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'q': break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); } } if( optind == argc ) { ewftools_output_version_fprint( stdout, program ); fprintf( stderr, "Missing EWF image file(s).\n" ); usage_fprint( stdout ); goto on_error; } ewftools_output_version_fprint( stdout, program ); libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif if( option_header_codepage != NULL ) { if( ewfinput_determine_header_codepage( option_header_codepage, &header_codepage, &error ) != 1 ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); header_codepage = LIBEWF_CODEPAGE_ASCII; } } if( ewftools_signal_attach( ewfdebug_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_initialize( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to initialize glob.\n" ); goto on_error; } if( ewftools_glob_resolve( glob, &( argv[ optind ] ), argc - optind, &error ) != 1 ) { fprintf( stderr, "Unable to resolve glob.\n" ); goto on_error; } if( ewftools_glob_get_results( glob, &number_of_filenames, (system_character_t ***) &argv_filenames, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve glob results.\n" ); goto on_error; } #else argv_filenames = &( argv[ optind ] ); number_of_filenames = argc - optind; #endif if( number_of_filenames == 1 ) { first_filename_length = system_string_length( argv_filenames[ 0 ] ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( argv_filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &ewf_filenames, &number_of_filenames, &error ) != 1 ) #else if( libewf_glob( argv_filenames[ 0 ], first_filename_length, LIBEWF_FORMAT_UNKNOWN, &ewf_filenames, &number_of_filenames, &error ) != 1 ) #endif { fprintf( stderr, "Unable to resolve ewf file(s).\n" ); goto on_error; } argv_filenames = (system_character_t * const *) ewf_filenames; } if( libewf_handle_initialize( &ewfdebug_input_handle, &error ) != 1 ) { fprintf( stderr, "Unable to initialize input handle.\n" ); 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, &error ) != 1 ) { fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } #endif if( ewf_filenames != NULL ) { for( ; number_of_filenames > 0; number_of_filenames-- ) { memory_free( ewf_filenames[ number_of_filenames - 1 ] ); } memory_free( ewf_filenames ); } if( ( ewfdebug_abort == 0 ) && ( result != 1 ) ) { fprintf( stderr, "Unable to open EWF file(s).\n" ); libewf_handle_close( ewfdebug_input_handle, NULL ); libewf_handle_free( &ewfdebug_input_handle, NULL ); return( EXIT_FAILURE ); } /* TODO */ if( libewf_handle_close( ewfdebug_input_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close EWF file(s).\n" ); libewf_handle_free( &ewfdebug_input_handle, NULL ); return( EXIT_FAILURE ); } if( libewf_handle_free( &ewfdebug_input_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free input handle.\n" ); return( EXIT_FAILURE ); } if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( ewfdebug_abort != 0 ) { fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, "Debug completed.\n" ); return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } #if !defined( HAVE_GLOB_H ) if( glob != NULL ) { ewftools_glob_free( &glob, NULL ); } #endif return( EXIT_FAILURE ); } libewf-20140807/ewftools/ewftools_libcnotify.h0000664000175000017500000000273113440663046023441 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2006-2018, 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_LIBCNOTIFY_H ) #define _EWFTOOLS_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _EWFTOOLS_LIBCNOTIFY_H ) */ libewf-20140807/ewftools/ewftools_libcsplit.h0000644000175000017500000000266413421020221023244 0ustar00lordyestalordyesta00000000000000/* * The internal libcsplit 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_LIBCSPLIT_H ) #define _EWFTOOLS_LIBCSPLIT_H #include /* Define HAVE_LOCAL_LIBCSPLIT for local use of libcsplit */ #if defined( HAVE_LOCAL_LIBCSPLIT ) #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCSPLIT_DLL_IMPORT * before including libcsplit.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCSPLIT_DLL_IMPORT #endif #include #endif #endif libewf-20140807/ewftools/ewfverify.c0000664000175000017500000003645713421024433021360 0ustar00lordyestalordyesta00000000000000/* * Verifies the integrity of the media data within the EWF file * * 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 . */ #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_GLOB_H ) #include #endif #include "byte_size_string.h" #include "digest_hash.h" #include "ewfcommon.h" #include "ewftools_getopt.h" #include "ewftools_glob.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" #include "ewftools_unused.h" #include "log_handle.h" #include "verification_handle.h" verification_handle_t *ewfverify_verification_handle = NULL; int ewfverify_abort = 0; /* Prints the executable usage information to the stream */ void usage_fprint( FILE *stream ) { if( stream == NULL ) { return; } fprintf( stream, "Use ewfverify to verify data stored in the EWF format (Expert Witness\n" "Compression Format).\n\n" ); fprintf( stream, "Usage: ewfverify [ -A codepage ] [ -d digest_type ] [ -f format ]\n" " [ -l log_filename ] [ -p process_buffer_size ]\n" " [ -hqvVwx ] ewf_files\n\n" ); fprintf( stream, "\tewf_files: the first or the entire set of EWF segment files\n\n" ); fprintf( stream, "\t-A: codepage of header section, options: ascii (default),\n" "\t windows-874, windows-932, windows-936, windows-949,\n" "\t windows-950, windows-1250, windows-1251, windows-1252,\n" "\t windows-1253, windows-1254, windows-1255, windows-1256,\n" "\t windows-1257 or windows-1258\n" ); fprintf( stream, "\t-d: calculate additional digest (hash) types besides md5,\n" "\t options: sha1, sha256\n" ); fprintf( stream, "\t-f: specify the input format, options: raw (default),\n" "\t files (restricted to logical volume files)\n" ); fprintf( stream, "\t-h: shows this help\n" ); fprintf( stream, "\t-l: logs verification errors and the digest (hash) to the\n" "\t log_filename\n" ); fprintf( stream, "\t-p: specify the process buffer size (default is the chunk size)\n" ); fprintf( stream, "\t-q: quiet shows minimal status information\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); fprintf( stream, "\t-w: zero sectors on checksum error (mimic EnCase like behavior)\n" ); fprintf( stream, "\t-x: use the chunk data instead of the buffered read and write\n" "\t functions.\n" ); } /* Signal handler for ewfverify */ void ewfverify_signal_handler( ewftools_signal_t signal EWFTOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; static char *function = "ewfverify_signal_handler"; EWFTOOLS_UNREFERENCED_PARAMETER( signal ) ewfverify_abort = 1; if( ewfverify_verification_handle != NULL ) { if( verification_handle_signal_abort( ewfverify_verification_handle, &error ) != 1 ) { libcnotify_printf( "%s: unable to signal verification handle to abort.\n", function ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } /* Force stdin to close otherwise any function reading it will remain blocked */ #if defined( WINAPI ) && !defined( __CYGWIN__ ) if( _close( 0 ) != 0 ) #else if( close( 0 ) != 0 ) #endif { libcnotify_printf( "%s: unable to close stdin.\n", function ); } } /* The main program */ #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( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif libcerror_error_t *error = NULL; system_character_t * const *argv_filenames = NULL; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif 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; system_integer_t option = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t use_chunk_data_functions = 0; uint8_t verbose = 0; uint8_t zero_chunk_on_error = 0; int number_of_filenames = 0; int result = 0; libcnotify_stream_set( stderr, NULL ); libcnotify_verbose_set( 1 ); if( libclocale_initialize( "ewftools", &error ) != 1 ) { fprintf( stderr, "Unable to initialize locale values.\n" ); goto on_error; } if( ewftools_output_initialize( _IONBF, &error ) != 1 ) { ewftools_output_version_fprint( stderr, program ); fprintf( stderr, "Unable to initialize output settings.\n" ); goto on_error; } ewftools_output_version_fprint( stdout, program ); while( ( option = ewftools_getopt( argc, argv, _SYSTEM_STRING( "A:d:f:hl:p:qvVwx" ) ) ) != (system_integer_t) -1 ) { switch( option ) { case (system_integer_t) '?': default: fprintf( stderr, "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( stdout ); goto on_error; case (system_integer_t) 'A': option_header_codepage = optarg; break; case (system_integer_t) 'd': option_additional_digest_types = optarg; break; case (system_integer_t) 'f': option_format = optarg; break; case (system_integer_t) 'h': usage_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'l': log_filename = optarg; break; case (system_integer_t) 'p': option_process_buffer_size = optarg; break; case (system_integer_t) 'q': print_status_information = 0; break; case (system_integer_t) 'v': verbose = 1; break; case (system_integer_t) 'V': ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); case (system_integer_t) 'w': zero_chunk_on_error = 1; break; case (system_integer_t) 'x': use_chunk_data_functions = 1; break; } } if( optind == argc ) { fprintf( stderr, "Missing EWF image file(s).\n" ); usage_fprint( stdout ); goto on_error; } libcnotify_verbose_set( verbose ); #if !defined( HAVE_LOCAL_LIBEWF ) libewf_notify_set_verbose( verbose ); libewf_notify_set_stream( stderr, NULL ); #endif if( verification_handle_initialize( &ewfverify_verification_handle, calculate_md5, use_chunk_data_functions, &error ) != 1 ) { fprintf( stderr, "Unable to create verification handle.\n" ); goto on_error; } if( option_header_codepage != NULL ) { result = verification_handle_set_header_codepage( ewfverify_verification_handle, option_header_codepage, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set header codepage.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported header codepage defaulting to: ascii.\n" ); } } if( option_format != NULL ) { result = verification_handle_set_format( ewfverify_verification_handle, option_format, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set format.\n" ); goto on_error; } else if( result == 0 ) { fprintf( stderr, "Unsupported input format defaulting to: raw.\n" ); } } if( option_process_buffer_size != NULL ) { result = verification_handle_set_process_buffer_size( ewfverify_verification_handle, option_process_buffer_size, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set process buffer size.\n" ); goto on_error; } else if( ( result == 0 ) || ( ewfverify_verification_handle->process_buffer_size > (size_t) SSIZE_MAX ) ) { ewfverify_verification_handle->process_buffer_size = 0; fprintf( stderr, "Unsupported process buffer size defaulting to: chunk size.\n" ); } } if( option_additional_digest_types != NULL ) { result = verification_handle_set_additional_digest_types( ewfverify_verification_handle, option_additional_digest_types, &error ); if( result == -1 ) { fprintf( stderr, "Unable to set additional digest types.\n" ); goto on_error; } } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_initialize( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to initialize glob.\n" ); goto on_error; } if( ewftools_glob_resolve( glob, &( argv[ optind ] ), argc - optind, &error ) != 1 ) { fprintf( stderr, "Unable to resolve glob.\n" ); goto on_error; } if( ewftools_glob_get_results( glob, &number_of_filenames, (system_character_t ***) &argv_filenames, &error ) != 1 ) { fprintf( stderr, "Unable to retrieve glob results.\n" ); goto on_error; } #else argv_filenames = &( argv[ optind ] ); number_of_filenames = argc - optind; #endif #if defined( HAVE_GETRLIMIT ) if( getrlimit( RLIMIT_NOFILE, &limit_data ) != 0 ) { fprintf( stderr, "Unable to determine limit: number of open file descriptors.\n" ); } if( limit_data.rlim_max > (rlim_t) INT_MAX ) { limit_data.rlim_max = (rlim_t) INT_MAX; } if( limit_data.rlim_max > 0 ) { limit_data.rlim_max /= 2; } if( verification_handle_set_maximum_number_of_open_handles( ewfverify_verification_handle, (int) limit_data.rlim_max, &error ) != 1 ) { fprintf( stderr, "Unable to set maximum number of open file handles.\n" ); goto on_error; } #endif if( ewftools_signal_attach( ewfverify_signal_handler, &error ) != 1 ) { fprintf( stderr, "Unable to attach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } result = verification_handle_open_input( ewfverify_verification_handle, argv_filenames, number_of_filenames, &error ); if( ewfverify_abort != 0 ) { goto on_abort; } if( result != 1 ) { fprintf( stderr, "Unable to open EWF image file(s).\n" ); goto on_error; } #if !defined( HAVE_GLOB_H ) if( ewftools_glob_free( &glob, &error ) != 1 ) { fprintf( stderr, "Unable to free glob.\n" ); goto on_error; } #endif if( verification_handle_set_zero_chunk_on_error( ewfverify_verification_handle, zero_chunk_on_error, &error ) != 1 ) { fprintf( stderr, "Unable to set zero on chunk error.\n" ); goto on_error; } if( log_filename != NULL ) { if( log_handle_initialize( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to create log handle.\n" ); goto on_error; } if( log_handle_open( log_handle, log_filename, &error ) != 1 ) { fprintf( stderr, "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; } } if( ewfverify_verification_handle->input_format == VERIFICATION_HANDLE_INPUT_FORMAT_FILES ) { result = verification_handle_verify_single_files( ewfverify_verification_handle, print_status_information, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to verify single files.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } else { result = verification_handle_verify_input( ewfverify_verification_handle, print_status_information, log_handle, &error ); if( result != 1 ) { fprintf( stderr, "Unable to verify input.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } } if( log_handle != NULL ) { if( log_handle_close( log_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close log handle.\n" ); goto on_error; } if( log_handle_free( &log_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free log handle.\n" ); goto on_error; } } on_abort: if( ewftools_signal_detach( &error ) != 1 ) { fprintf( stderr, "Unable to detach signal handler.\n" ); libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( verification_handle_close( ewfverify_verification_handle, &error ) != 0 ) { fprintf( stderr, "Unable to close verification handle.\n" ); goto on_error; } if( verification_handle_free( &ewfverify_verification_handle, &error ) != 1 ) { fprintf( stderr, "Unable to free verification handle.\n" ); goto on_error; } if( ewfverify_abort != 0 ) { fprintf( stdout, "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); } if( result != 1 ) { fprintf( stdout, "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); on_error: if( error != NULL ) { libcnotify_print_error_backtrace( error ); libcerror_error_free( &error ); } if( log_handle != NULL ) { log_handle_close( log_handle, NULL ); log_handle_free( &log_handle, NULL ); } if( ewfverify_verification_handle != NULL ) { verification_handle_close( ewfverify_verification_handle, NULL ); verification_handle_free( &ewfverify_verification_handle, NULL ); } #if !defined( HAVE_GLOB_H ) if( glob != NULL ) { ewftools_glob_free( &glob, NULL ); } #endif return( EXIT_FAILURE ); } libewf-20140807/ewftools/ewftools_output.c0000664000175000017500000001333313421020221022607 0ustar00lordyestalordyesta00000000000000/* * Output functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include #include #if defined( HAVE_ZLIB ) || defined( ZLIB_DLL ) #include #endif #if defined( HAVE_OPENSSL_OPENSSLV_H ) || defined( HAVE_LIBCRYPTO ) #include #endif #if defined( HAVE_UUID_UUID_H ) #include #endif #include "ewftools_i18n.h" #include "ewftools_libbfio.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" #include "ewftools_libewf.h" #include "ewftools_libfvalue.h" #include "ewftools_libhmac.h" #include "ewftools_libodraw.h" #include "ewftools_libsmdev.h" #include "ewftools_libsmraw.h" #include "ewftools_libuna.h" #include "ewftools_output.h" /* Initializes output settings * Returns 1 if successful or -1 on error */ int ewftools_output_initialize( int stdio_mode, libcerror_error_t **error ) { static char *function = "ewftools_output_initialize"; if( ( stdio_mode != _IOFBF ) && ( stdio_mode != _IOLBF ) && ( stdio_mode != _IONBF ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported standard IO mode.", function ); return( -1 ); } #if !defined( __BORLANDC__ ) if( setvbuf( stdout, NULL, stdio_mode, 0 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set IO mode of stdout.", function ); return( -1 ); } if( setvbuf( stderr, NULL, stdio_mode, 0 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set IO mode of stderr.", function ); return( -1 ); } #endif /* !defined( __BORLANDC__ ) */ return( 1 ); } /* Prints the executable version information */ void ewftools_output_copyright_fprint( FILE *stream ) { if( stream == NULL ) { return; } /* TRANSLATORS: This is a proper name. */ fprintf( stream, _( "Copyright (C) 2006-2019, %s.\n" ), _( "Joachim Metz" ) ); fprintf( stream, _( "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" ) ); /* TRANSLATORS: The placeholder indicates the bug-reporting address * for this package. Please add _another line_ saying * "Report translation bugs to <...>\n" with the address for translation * bugs (typically your translation team's web or email address). */ fprintf( stream, _( "Report bugs to <%s>.\n" ), PACKAGE_BUGREPORT ); } /* Prints the version information to a stream */ void ewftools_output_version_fprint( FILE *stream, const system_character_t *program ) { static char *function = "ewftools_output_version_fprint"; if( stream == NULL ) { libcnotify_printf( "%s: invalid stream.\n", function ); return; } if( program == NULL ) { libcnotify_printf( "%s: invalid program name.\n", function ); return; } fprintf( stream, "%" PRIs_SYSTEM " %s\n\n", program, LIBEWF_VERSION_STRING ); } /* Prints the detailed version information to a stream */ void ewftools_output_version_detailed_fprint( FILE *stream, const system_character_t *program ) { static char *function = "ewftools_output_version_detailed_fprint"; if( stream == NULL ) { libcnotify_printf( "%s: invalid stream.\n", function ); return; } if( program == NULL ) { libcnotify_printf( "%s: invalid program name.\n", function ); return; } fprintf( stream, "%" PRIs_SYSTEM " %s (libewf %s", program, LIBEWF_VERSION_STRING, LIBEWF_VERSION_STRING ); #if defined( HAVE_LIBUNA ) || defined( HAVE_LOCAL_LIBUNA ) fprintf( stream, ", libuna %s", LIBUNA_VERSION_STRING ); #endif #if defined( HAVE_LIBBFIO ) || defined( HAVE_LOCAL_LIBBFIO ) fprintf( stream, ", libbfio %s", LIBBFIO_VERSION_STRING ); #endif #if defined( HAVE_LIBFVALUE ) || defined( HAVE_LOCAL_LIBFVALUE ) fprintf( stream, ", libfvalue %s", LIBFVALUE_VERSION_STRING ); #endif #if defined( HAVE_LIBZ ) fprintf( stream, ", zlib %s", ZLIB_VERSION ); #endif #if defined( HAVE_LIBHMAC ) || defined( HAVE_LOCAL_LIBHMAC ) fprintf( stream, ", libhmac %s", LIBHMAC_VERSION_STRING ); #if defined( HAVE_LIBCRYPTO ) fprintf( stream, " (libcrypto %s)", SHLIB_VERSION_NUMBER ); #endif #endif #if defined( HAVE_LIBODRAW ) || defined( HAVE_LOCAL_LIBODRAW ) fprintf( stream, ", libodraw %s", LIBODRAW_VERSION_STRING ); #endif #if defined( HAVE_LIBSMDEV ) || defined( HAVE_LOCAL_LIBSMDEV ) fprintf( stream, ", libsmdev %s", LIBSMDEV_VERSION_STRING ); #endif #if defined( HAVE_LIBSMRAW ) || defined( HAVE_LOCAL_LIBSMRAW ) fprintf( stream, ", libsmraw %s", LIBSMRAW_VERSION_STRING ); #endif #if defined( HAVE_LIBUUID ) fprintf( stream, ", libuuid" ); #endif fprintf( stream, ")\n\n" ); } libewf-20140807/ewftools/ewftools_libsmdev.h0000664000175000017500000000257713421020221023071 0ustar00lordyestalordyesta00000000000000/* * The internal libsmdev header * * Copyright (C) 2006-2017, 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_LIBSMDEV_H ) #define _EWFTOOLS_LIBSMDEV_H #include #if defined( HAVE_LOCAL_LIBSMDEV ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBSMDEV_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBSMDEV_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBSMDEV ) */ #endif /* !defined( _EWFTOOLS_LIBSMDEV_H ) */ libewf-20140807/ewftools/ewftools_libuna.h0000664000175000017500000000336113440663046022551 0ustar00lordyestalordyesta00000000000000/* * The libuna header wrapper * * Copyright (C) 2006-2018, 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_LIBUNA_H ) #define _EWFTOOLS_LIBUNA_H #include /* Define HAVE_LOCAL_LIBUNA for local use of libuna */ #if defined( HAVE_LOCAL_LIBUNA ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT * before including libuna.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBUNA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBUNA ) */ #endif /* !defined( _EWFTOOLS_LIBUNA_H ) */ libewf-20140807/ewftools/platform.h0000664000175000017500000000230113421020222021150 0ustar00lordyestalordyesta00000000000000/* * Platform functions * * Copyright (C) 2006-2019, 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( _PLATFORM_H ) #define _PLATFORM_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif int platform_get_operating_system( system_character_t *operating_system_string, size_t operating_system_string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _PLATFORM_H ) */ libewf-20140807/ewftools/storage_media_buffer.c0000644000175000017500000001756713421020222023475 0ustar00lordyestalordyesta00000000000000/* * Storage media buffer * * 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 . */ #include #include #include "ewftools_libcerror.h" #include "storage_media_buffer.h" /* Creates a storage media buffer * Make sure the value buffer is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int storage_media_buffer_initialize( storage_media_buffer_t **buffer, uint8_t mode, size_t size, libcerror_error_t **error ) { static char *function = "storage_media_buffer_initialize"; size_t raw_buffer_size = 0; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( *buffer != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid buffer value already set.", function ); return( -1 ); } if( ( mode != STORAGE_MEDIA_BUFFER_MODE_BUFFERED ) && ( mode != STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unusupported mode.", function ); return( -1 ); } if( size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } *buffer = memory_allocate_structure( storage_media_buffer_t ); if( *buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create buffer.", function ); goto on_error; } if( memory_set( *buffer, 0, sizeof( storage_media_buffer_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear buffer.", function ); memory_free( *buffer ); *buffer = NULL; return( -1 ); } if( size > 0 ) { raw_buffer_size = size; if( mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { /* Add 4 bytes to allow for write checksum buffer alignment */ raw_buffer_size += 4; } /* TODO can low level functions and direct IO be combined ? */ #if defined( memory_allocate_aligned ) if( memory_allocate_aligned( (void **) &( ( *buffer )->raw_buffer ), raw_buffer_size, 512 ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create aligned raw buffer.", function ); goto on_error; } #else ( *buffer )->raw_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * raw_buffer_size ); if( ( *buffer )->raw_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create raw buffer.", function ); goto on_error; } #endif /* defined( memory_allocate_aligned ) */ ( *buffer )->raw_buffer_size = size; if( mode == STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) { ( *buffer )->checksum_buffer = &( ( ( *buffer )->raw_buffer )[ size ] ); ( *buffer )->compression_buffer = (uint8_t *) memory_allocate( sizeof( uint8_t ) * ( size * 2 ) ); if( ( *buffer )->compression_buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create compression buffer.", function ); goto on_error; } ( *buffer )->compression_buffer_size = size * 2; } } ( *buffer )->mode = mode; return( 1 ); on_error: if( *buffer != NULL ) { if( ( *buffer )->raw_buffer != NULL ) { memory_free( ( *buffer )->raw_buffer ); } memory_free( *buffer ); *buffer = NULL; } return( -1 ); } /* Frees a storage media buffer * Returns 1 if successful or -1 on error */ int storage_media_buffer_free( storage_media_buffer_t **buffer, libcerror_error_t **error ) { static char *function = "storage_media_buffer_free"; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( *buffer != NULL ) { if( ( *buffer )->raw_buffer != NULL ) { memory_free( ( *buffer )->raw_buffer ); } if( ( *buffer )->compression_buffer != NULL ) { memory_free( ( *buffer )->compression_buffer ); } memory_free( *buffer ); *buffer = NULL; } return( 1 ); } /* Resizes a buffer * Returns 1 if successful or -1 on error */ int storage_media_buffer_resize( storage_media_buffer_t *buffer, size_t size, libcerror_error_t **error ) { void *reallocation = NULL; static char *function = "storage_media_buffer_resize"; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( size > buffer->raw_buffer_size ) { reallocation = memory_reallocate( buffer->raw_buffer, sizeof( uint8_t ) * size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to reallocate read buffer.", function ); return( -1 ); } buffer->raw_buffer = (uint8_t *) reallocation; buffer->raw_buffer_size = size; buffer->raw_buffer_data_size = 0; /* The compression buffer is cleared */ if( buffer->compression_buffer != NULL ) { memory_free( buffer->compression_buffer ); buffer->compression_buffer = NULL; buffer->compression_buffer_size = 0; buffer->compression_buffer_data_size = 0; } } return( 1 ); } /* Retrieves the reference to the actual data and its size * Returns 1 if successful or -1 on error */ int storage_media_buffer_get_data( storage_media_buffer_t *buffer, uint8_t **data, size_t *data_size, libcerror_error_t **error ) { static char *function = "storage_media_buffer_get_data"; if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data.", function ); return( -1 ); } if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } if( ( buffer->mode != STORAGE_MEDIA_BUFFER_MODE_CHUNK_DATA ) || ( buffer->data_in_compression_buffer == 0 ) ) { *data = buffer->raw_buffer; *data_size = buffer->raw_buffer_data_size; } else { *data = buffer->compression_buffer; *data_size = buffer->compression_buffer_data_size; } return( 1 ); } libewf-20140807/ewftools/ewfcommon.h0000644000175000017500000000257313421020220021325 0ustar00lordyestalordyesta00000000000000/* * Common functions for the ewftools * * 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( _EWFCOMMON_H ) #define _EWFCOMMON_H #include #include #include #define EWFCOMMON_DEFAULT_SEGMENT_FILE_SIZE LIBEWF_DEFAULT_SEGMENT_FILE_SIZE #define EWFCOMMON_MINIMUM_SEGMENT_FILE_SIZE ( 1024 * 1024 ) #define EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_32BIT INT32_MAX #define EWFCOMMON_MAXIMUM_SEGMENT_FILE_SIZE_64BIT INT64_MAX /* This definition is intended for automated testing of variable process buffer sizes */ #if !defined( EWFCOMMON_PROCESS_BUFFER_SIZE ) #define EWFCOMMON_PROCESS_BUFFER_SIZE 0 #endif #endif libewf-20140807/ewftools/guid.h0000664000175000017500000000271513421024433020275 0ustar00lordyestalordyesta00000000000000/* * GUID functions * * 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( _GUID_H ) #define _GUID_H #include #include #include "ewftools_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #define GUID_SIZE 16 enum GUID_TYPES { GUID_TYPE_RANDOM = (uint8_t) 'r', GUID_TYPE_TIME = (uint8_t) 't' }; #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) int guid_generate( uint8_t *guid, size_t guid_size, uint8_t guid_type, libcerror_error_t **error ); #endif int guid_to_string( uint8_t *guid, size_t guid_size, int byte_order, system_character_t *string, size_t string_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif libewf-20140807/ewftools/ewftools_libcerror.h0000664000175000017500000000270713440663046023265 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2006-2018, 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_LIBCERROR_H ) #define _EWFTOOLS_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _EWFTOOLS_LIBCERROR_H ) */ libewf-20140807/libfdata/0000775000175000017500000000000013443455445017112 5ustar00lordyestalordyesta00000000000000libewf-20140807/libfdata/libfdata_segments_array.h0000664000175000017500000000533213443450051024123 0ustar00lordyestalordyesta00000000000000/* * The segments array functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_SEGMENTS_ARRAY_H ) #define _LIBFDATA_SEGMENTS_ARRAY_H #include #include #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" int libfdata_segments_array_get_segment_by_index( libcdata_array_t *segments_array, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); int libfdata_segments_array_set_segment_by_index( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, size64_t *data_size, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); int libfdata_segments_array_prepend_segment( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, size64_t *data_size, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); int libfdata_segments_array_append_segment( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, size64_t *data_size, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); int libfdata_segments_array_calculate_mapped_ranges( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, libcerror_error_t **error ); int libfdata_segments_array_get_data_range_at_offset( libcdata_array_t *segments_array, off64_t value_offset, off64_t *segment_data_offset, libfdata_range_t **segment_data_range, libcerror_error_t **error ); #if defined( __cplusplus ) extern "C" { #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_SEGMENTS_ARRAY_H ) */ libewf-20140807/libfdata/libfdata_cache.c0000664000175000017500000000317413443450051022140 0ustar00lordyestalordyesta00000000000000/* * Cache functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include "libfdata_cache.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #if !defined( HAVE_LOCAL_LIBFDATA ) /* Creates a cache * Make sure the value cache is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_cache_initialize( libfdata_cache_t **cache, int maximum_cache_entries, libcerror_error_t **error ) { return( libfcache_cache_initialize( (libfcache_cache_t **) cache, maximum_cache_entries, error ) ); } /* Frees a cache * Returns 1 if successful or -1 on error */ int libfdata_cache_free( libfdata_cache_t **cache, libcerror_error_t **error ) { return( libfcache_cache_free( (libfcache_cache_t **) cache, error ) ); } #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ libewf-20140807/libfdata/libfdata_support.c0000664000175000017500000000222613443450051022606 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_support.h" #if !defined( HAVE_LOCAL_LIBFDATA ) /* Returns the library version as a string */ const char *libfdata_get_version( void ) { return( (const char *) LIBFDATA_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ libewf-20140807/libfdata/libfdata_btree_node.c0000664000175000017500000012735313443450051023211 0ustar00lordyestalordyesta00000000000000/* * The balanced tree node functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_btree_node.h" #include "libfdata_btree_range.h" #include "libfdata_definitions.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_types.h" /* Creates a node * Make sure the value node is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_btree_node_initialize( libfdata_btree_node_t **node, int level, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_initialize"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node value already set.", function ); return( -1 ); } if( level < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid level value less than zero.", function ); return( -1 ); } internal_tree_node = memory_allocate_structure( libfdata_internal_btree_node_t ); if( internal_tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create node.", function ); goto on_error; } if( memory_set( internal_tree_node, 0, sizeof( libfdata_internal_btree_node_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear node.", function ); memory_free( internal_tree_node ); return( -1 ); } internal_tree_node->level = level; internal_tree_node->flags = LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; *node = (libfdata_btree_node_t *) internal_tree_node; return( 1 ); on_error: if( internal_tree_node != NULL ) { memory_free( internal_tree_node ); } return( -1 ); } /* Frees a node * Returns 1 if successful or -1 on error */ int libfdata_btree_node_free( libfdata_btree_node_t **node, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_free"; int result = 1; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { internal_tree_node = (libfdata_internal_btree_node_t *) *node; *node = NULL; if( internal_tree_node->sub_node_ranges_array != NULL ) { if( libcdata_array_free( &( internal_tree_node->sub_node_ranges_array ), (int (*)(intptr_t **, libcerror_error_t **error)) &libfdata_btree_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the sub node ranges array.", function ); result = -1; } } if( internal_tree_node->leaf_value_ranges_array != NULL ) { if( libcdata_array_free( &( internal_tree_node->leaf_value_ranges_array ), (int (*)(intptr_t **, libcerror_error_t **error)) &libfdata_btree_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the leaf value ranges array.", function ); result = -1; } } memory_free( internal_tree_node ); } return( result ); } /* Node functions */ /* Retrieves the level * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_level( libfdata_btree_node_t *node, int *level, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_level"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( level == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid level.", function ); return( -1 ); } *level = internal_tree_node->level; return( 1 ); } /* Determines if the node is a branch node * Returns 1 if a branch node, 0 if not or -1 on error */ int libfdata_btree_node_is_branch( libfdata_btree_node_t *node, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_is_branch"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH ) != 0 ) { return( 1 ); } return( 0 ); } /* Determines if the node is a leaf node * Returns 1 if a leaf node, 0 if not or -1 on error */ int libfdata_btree_node_is_leaf( libfdata_btree_node_t *node, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_is_leaf"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_LEAF ) != 0 ) { return( 1 ); } return( 0 ); } /* Determines if the node is a root node * Returns 1 if a root node, 0 if not or -1 on error */ int libfdata_btree_node_is_root( libfdata_btree_node_t *node, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_is_root"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->level == 0 ) { return( 1 ); } return( 0 ); } /* Sub node data range functions */ /* Retrieves the number of sub nodes * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_number_of_sub_nodes( libfdata_btree_node_t *node, int *number_of_sub_nodes, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_number_of_sub_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->sub_node_ranges_array == NULL ) { if( number_of_sub_nodes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sub nodes.", function ); return( -1 ); } *number_of_sub_nodes = 0; } else { if( libcdata_array_get_number_of_entries( internal_tree_node->sub_node_ranges_array, number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub node ranges array.", function ); return( -1 ); } } return( 1 ); } /* Retrieves a specific sub node data range * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_sub_node_data_range_by_index( libfdata_btree_node_t *node, int sub_node_index, libfdata_btree_range_t **sub_node_data_range, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_sub_node_data_range_by_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->sub_node_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing sub node ranges array.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree_node->sub_node_ranges_array, sub_node_index, (intptr_t **) sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub node ranges array.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Retrieves a sub node data range for a specific mapped index * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_sub_node_data_range_by_mapped_index( libfdata_btree_node_t *node, int mapped_index, libfdata_btree_range_t **sub_node_data_range, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_sub_node_data_range_by_mapped_index"; int number_of_sub_nodes = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->sub_node_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing sub node ranges array.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - unsupported flags calculate mapped ranges is set.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested index: %d\n", function, mapped_index ); } #endif if( libcdata_array_get_number_of_entries( internal_tree_node->sub_node_ranges_array, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub node ranges array.", function ); return( -1 ); } for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_node_ranges_array, sub_node_index, (intptr_t **) sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub node ranges array.", function, sub_node_index ); return( -1 ); } if( *sub_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub node: %d data range.", function, sub_node_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped range: %d - %d\n", function, ( *sub_node_data_range )->mapped_first_leaf_value_index, ( *sub_node_data_range )->mapped_last_leaf_value_index ); } #endif if( ( mapped_index >= ( *sub_node_data_range )->mapped_first_leaf_value_index ) && ( mapped_index <= ( *sub_node_data_range )->mapped_last_leaf_value_index ) ) { break; } } if( sub_node_index >= number_of_sub_nodes ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node data range.", function ); return( -1 ); } return( 1 ); } /* Retrieves a sub node data range for a specific key * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_node_get_sub_node_data_range_by_key( libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *sub_node_index, libfdata_btree_range_t **sub_node_data_range, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_sub_node_data_range_by_key"; int number_of_sub_nodes = 0; int result = 0; int search_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->sub_node_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing sub node ranges array.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - unsupported flags calculate mapped ranges is set.", function ); return( -1 ); } if( sub_node_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node index.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_tree_node->sub_node_ranges_array, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub node ranges array.", function ); return( -1 ); } for( search_node_index = 0; search_node_index < number_of_sub_nodes; search_node_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_node_ranges_array, search_node_index, (intptr_t **) sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub node ranges array.", function, search_node_index ); return( -1 ); } if( *sub_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub node: %d data range.", function, search_node_index ); return( -1 ); } if( key_value_compare_function == NULL ) { if( key_value == ( *sub_node_data_range )->key_value ) { *sub_node_index = search_node_index; return( 1 ); } } else { result = key_value_compare_function( key_value, ( *sub_node_data_range )->key_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare key value with sub node data range key value: %d.", function, search_node_index ); return( -1 ); } else if( ( result == LIBFDATA_COMPARE_EQUAL ) || ( result == LIBFDATA_COMPARE_GREATER_EQUAL ) || ( result == LIBFDATA_COMPARE_LESS_EQUAL ) ) { *sub_node_index = search_node_index; return( 1 ); } else if( result == LIBFDATA_COMPARE_LESS ) { break; } else if( result != LIBFDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, result ); return( -1 ); } } } *sub_node_data_range = NULL; return( 0 ); } /* Retrieves a specific sub node * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_sub_node_by_index( libfdata_btree_node_t *node, int sub_node_index, int *sub_node_data_file_index, off64_t *sub_node_data_offset, size64_t *sub_node_data_size, uint32_t *sub_node_data_flags, intptr_t **key_value, libcerror_error_t **error ) { libfdata_btree_range_t *data_range = NULL; static char *function = "libfdata_btree_node_get_sub_node_by_index"; if( libfdata_btree_node_get_sub_node_data_range_by_index( node, sub_node_index, &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node: %d data range.", function, sub_node_index ); return( -1 ); } if( libfdata_btree_range_get( data_range, sub_node_data_file_index, sub_node_data_offset, sub_node_data_size, sub_node_data_flags, key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values from sub node: %d data range.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Sets the offset and size of a specific sub node * Returns 1 if successful or -1 on error */ int libfdata_btree_node_set_sub_node_by_index( libfdata_btree_node_t *node, int sub_node_index, int sub_node_data_file_index, off64_t sub_node_data_offset, size64_t sub_node_data_size, uint32_t sub_node_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; libfdata_btree_range_t *data_range = NULL; static char *function = "libfdata_btree_node_set_sub_node_by_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->sub_node_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sub node index value out of bounds.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree_node->sub_node_ranges_array, sub_node_index, (intptr_t **) &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub node ranges array.", function, sub_node_index ); return( -1 ); } if( libfdata_btree_range_set( data_range, sub_node_data_file_index, sub_node_data_offset, sub_node_data_size, sub_node_data_flags, key_value, free_key_value, key_value_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub node: %d data range.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Appends a sub node offset and size * Returns 1 if successful or -1 on error */ int libfdata_btree_node_append_sub_node( libfdata_btree_node_t *node, int *sub_node_index, int sub_node_data_file_index, off64_t sub_node_data_offset, size64_t sub_node_data_size, uint32_t sub_node_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; libfdata_btree_range_t *data_range = NULL; static char *function = "libfdata_btree_node_append_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_LEAF ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - unsupported flags is leaf is set.", function ); return( -1 ); } if( internal_tree_node->sub_node_ranges_array == NULL ) { if( libcdata_array_initialize( &( internal_tree_node->sub_node_ranges_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub node ranges array.", function ); goto on_error; } } if( libfdata_btree_range_initialize( &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data range.", function ); goto on_error; } if( libfdata_btree_range_set( data_range, sub_node_data_file_index, sub_node_data_offset, sub_node_data_size, sub_node_data_flags, key_value, free_key_value, key_value_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_tree_node->sub_node_ranges_array, sub_node_index, (intptr_t *) data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data range to sub node ranges array.", function ); goto on_error; } internal_tree_node->flags |= LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH; return( 1 ); on_error: if( data_range != NULL ) { libfdata_btree_range_free( &data_range, NULL ); } return( -1 ); } /* Branch leaf values functions */ /* Retrieves the number of leaf values in the branch * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_number_of_leaf_values_in_branch( libfdata_btree_node_t *node, int *number_of_leaf_values, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_number_of_leaf_values_in_branch"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( number_of_leaf_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of leaf values.", function ); return( -1 ); } *number_of_leaf_values = internal_tree_node->branch_number_of_leaf_values; return( 1 ); } /* Leaf value data range functions */ /* Retrieves the number of leaf values * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_number_of_leaf_values( libfdata_btree_node_t *node, int *number_of_leaf_values, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_number_of_leaf_values"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->leaf_value_ranges_array == NULL ) { if( number_of_leaf_values == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of leaf values.", function ); return( -1 ); } *number_of_leaf_values = 0; } else { if( libcdata_array_get_number_of_entries( internal_tree_node->leaf_value_ranges_array, number_of_leaf_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from leaf value ranges array.", function ); return( -1 ); } } return( 1 ); } /* Retrieves a specific leaf value data range * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_leaf_value_data_range_by_index( libfdata_btree_node_t *node, int leaf_value_index, libfdata_btree_range_t **leaf_value_data_range, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_leaf_value_data_range_by_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->leaf_value_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing leaf value ranges array.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree_node->leaf_value_ranges_array, leaf_value_index, (intptr_t **) leaf_value_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from leaf value ranges array.", function, leaf_value_index ); return( -1 ); } return( 1 ); } /* Retrieves a leaf value data range for a specific mapped index * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( libfdata_btree_node_t *node, int mapped_index, libfdata_btree_range_t **leaf_value_data_range, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_leaf_value_data_range_by_mapped_index"; int number_of_leaf_values = 0; int leaf_value_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->leaf_value_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing leaf value ranges array.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - unsupported flags calculate mapped ranges is set.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested index: %d\n", function, mapped_index ); } #endif if( libcdata_array_get_number_of_entries( internal_tree_node->leaf_value_ranges_array, &number_of_leaf_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from leaf value ranges array.", function ); return( -1 ); } for( leaf_value_index = 0; leaf_value_index < number_of_leaf_values; leaf_value_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->leaf_value_ranges_array, leaf_value_index, (intptr_t **) leaf_value_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from leaf value ranges array.", function, leaf_value_index ); return( -1 ); } if( *leaf_value_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing leaf value: %d data range.", function, leaf_value_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped range: %d\n", function, ( *leaf_value_data_range )->mapped_first_leaf_value_index ); } #endif if( ( mapped_index == ( *leaf_value_data_range )->mapped_first_leaf_value_index ) && ( ( *leaf_value_data_range )->mapped_number_of_leaf_values == 1 ) ) { break; } } if( leaf_value_index >= number_of_leaf_values ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range.", function ); return( -1 ); } return( 1 ); } /* Retrieves a leaf value data range for a specific key * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_node_get_leaf_value_data_range_by_key( libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), libfdata_btree_range_t **leaf_value_data_range, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; static char *function = "libfdata_btree_node_get_leaf_value_data_range_by_key"; int number_of_leaf_values = 0; int leaf_value_index = 0; int result = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->leaf_value_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing leaf value ranges array.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - unsupported flags calculate mapped ranges is set.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_tree_node->leaf_value_ranges_array, &number_of_leaf_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from leaf value ranges array.", function ); return( -1 ); } for( leaf_value_index = 0; leaf_value_index < number_of_leaf_values; leaf_value_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->leaf_value_ranges_array, leaf_value_index, (intptr_t **) leaf_value_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from leaf value ranges array.", function, leaf_value_index ); return( -1 ); } if( *leaf_value_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing leaf value: %d data range.", function, leaf_value_index ); return( -1 ); } if( key_value_compare_function == NULL ) { if( key_value == ( *leaf_value_data_range )->key_value ) { return( 1 ); } } else { result = key_value_compare_function( key_value, ( *leaf_value_data_range )->key_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare key value with leaf value data range key value: %d.", function, leaf_value_index ); return( -1 ); } else if( result == LIBFDATA_COMPARE_EQUAL ) { return( 1 ); } else if( result == LIBFDATA_COMPARE_LESS ) { return( 0 ); } else if( result != LIBFDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, result ); return( -1 ); } } } return( 0 ); } /* Retrieves a specific leaf value * Returns 1 if successful or -1 on error */ int libfdata_btree_node_get_leaf_value_by_index( libfdata_btree_node_t *node, int leaf_value_index, int *leaf_value_data_file_index, off64_t *leaf_value_data_offset, size64_t *leaf_value_data_size, uint32_t *leaf_value_data_flags, intptr_t **key_value, libcerror_error_t **error ) { libfdata_btree_range_t *data_range = NULL; static char *function = "libfdata_btree_node_get_leaf_value_by_index"; if( libfdata_btree_node_get_leaf_value_data_range_by_index( node, leaf_value_index, &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range.", function ); return( -1 ); } if( libfdata_btree_range_get( data_range, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values from leaf value data range.", function ); return( -1 ); } return( 1 ); } /* Retrieves a leaf value for a specific key * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_node_get_leaf_value_by_key( libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *leaf_value_data_file_index, off64_t *leaf_value_data_offset, size64_t *leaf_value_data_size, uint32_t *leaf_value_data_flags, libcerror_error_t **error ) { libfdata_btree_range_t *data_range = NULL; intptr_t *data_range_key_value = NULL; static char *function = "libfdata_btree_node_get_leaf_value_by_key"; if( libfdata_btree_node_get_leaf_value_data_range_by_key( node, key_value, key_value_compare_function, &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range.", function ); return( -1 ); } if( libfdata_btree_range_get( data_range, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, &data_range_key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values from leaf value data range.", function ); return( -1 ); } return( 1 ); } /* Sets the offset and size of a specific leaf value * Returns 1 if successful or -1 on error */ int libfdata_btree_node_set_leaf_value_by_index( libfdata_btree_node_t *node, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; libfdata_btree_range_t *data_range = NULL; static char *function = "libfdata_btree_node_set_leaf_value_by_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( internal_tree_node->leaf_value_ranges_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid leaf value index value out of bounds.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree_node->leaf_value_ranges_array, leaf_value_index, (intptr_t **) &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from leaf value ranges array.", function, leaf_value_index ); return( -1 ); } if( libfdata_btree_range_set( data_range, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, key_value, free_key_value, key_value_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set leaf value: %d data range.", function, leaf_value_index ); return( -1 ); } return( 1 ); } /* Appends a leaf value offset and size * Returns 1 if successful or -1 on error */ int libfdata_btree_node_append_leaf_value( libfdata_btree_node_t *node, int *leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ) { libfdata_internal_btree_node_t *internal_tree_node = NULL; libfdata_btree_range_t *data_range = NULL; static char *function = "libfdata_btree_node_append_leaf_value"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_btree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - unsupported flags is branch is set.", function ); return( -1 ); } if( internal_tree_node->leaf_value_ranges_array == NULL ) { if( libcdata_array_initialize( &( internal_tree_node->leaf_value_ranges_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create leaf value ranges array.", function ); goto on_error; } } if( libfdata_btree_range_initialize( &data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data range.", function ); goto on_error; } if( libfdata_btree_range_set( data_range, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, key_value, free_key_value, key_value_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_tree_node->leaf_value_ranges_array, leaf_value_index, (intptr_t *) data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data range to leaf value ranges array.", function ); goto on_error; } internal_tree_node->flags |= LIBFDATA_BTREE_NODE_FLAG_IS_LEAF; return( 1 ); on_error: if( data_range != NULL ) { libfdata_btree_range_free( &data_range, NULL ); } return( -1 ); } libewf-20140807/libfdata/libfdata_list_element.c0000664000175000017500000004560313443450051023564 0ustar00lordyestalordyesta00000000000000/* * The list element functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_list.h" #include "libfdata_list_element.h" #include "libfdata_range.h" #include "libfdata_types.h" /* Creates an element * Make sure the value element is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_list_element_initialize( libfdata_list_element_t **element, libfdata_list_t *list, int element_index, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_initialize"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } if( *element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid element value already set.", function ); return( -1 ); } if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } internal_element = memory_allocate_structure( libfdata_internal_list_element_t ); if( internal_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create element.", function ); goto on_error; } if( memory_set( internal_element, 0, sizeof( libfdata_internal_list_element_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear element.", function ); memory_free( internal_element ); return( -1 ); } if( libfdata_range_initialize( &( internal_element->data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create data range.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_element->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); goto on_error; } internal_element->list = list; internal_element->element_index = element_index; *element = (libfdata_list_element_t *) internal_element; return( 1 ); on_error: if( internal_element != NULL ) { if( internal_element->data_range != NULL ) { libfdata_range_free( &( internal_element->data_range ), NULL ); } memory_free( internal_element ); } return( -1 ); } /* Frees an element * Returns 1 if successful or -1 on error */ int libfdata_list_element_free( libfdata_list_element_t **element, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_free"; int result = 1; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } if( *element != NULL ) { internal_element = (libfdata_internal_list_element_t *) *element; *element = NULL; if( libfdata_range_free( &( internal_element->data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data range.", function ); result = -1; } memory_free( internal_element ); } return( result ); } /* Clones (duplicates) the element * Returns 1 if successful or -1 on error */ int libfdata_list_element_clone( libfdata_list_element_t **destination_element, libfdata_list_element_t *source_element, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_destination_element = NULL; libfdata_internal_list_element_t *internal_source_element = NULL; static char *function = "libfdata_list_element_clone"; if( destination_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination element.", function ); return( -1 ); } if( *destination_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination element already set.", function ); return( -1 ); } if( source_element == NULL ) { *destination_element = NULL; return( 1 ); } internal_source_element = (libfdata_internal_list_element_t *) source_element; internal_destination_element = memory_allocate_structure( libfdata_internal_list_element_t ); if( internal_destination_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination element.", function ); goto on_error; } if( memory_set( internal_destination_element, 0, sizeof( libfdata_internal_list_element_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination element.", function ); memory_free( internal_destination_element ); return( -1 ); } if( libfdata_range_clone( &( internal_destination_element->data_range ), internal_source_element->data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data range.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_destination_element->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve destination timestamp.", function ); goto on_error; } internal_destination_element->list = internal_source_element->list; internal_destination_element->element_index = internal_source_element->element_index; internal_destination_element->mapped_size = internal_source_element->mapped_size; *destination_element = (libfdata_list_element_t *) internal_destination_element; return( 1 ); on_error: if( internal_destination_element != NULL ) { if( internal_destination_element->data_range != NULL ) { libfdata_range_free( &( internal_destination_element->data_range ), NULL ); } memory_free( internal_destination_element ); } return( -1 ); } /* Retrieves the element index * Returns 1 if successful or -1 on error */ int libfdata_list_element_get_element_index( libfdata_list_element_t *element, int *element_index, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_get_element_index"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } *element_index = internal_element->element_index; return( 1 ); } /* Sets the element index * Returns 1 if successful or -1 on error */ int libfdata_list_element_set_element_index( libfdata_list_element_t *element, int element_index, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_set_element_index"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element index value less than zero.", function ); return( -1 ); } internal_element->element_index = element_index; return( 1 ); } /* Retrieves the time stamp * Returns 1 if successful or -1 on error */ int libfdata_list_element_get_timestamp( libfdata_list_element_t *element, int64_t *timestamp, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_get_timestamp"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid time stamp.", function ); return( -1 ); } *timestamp = internal_element->timestamp; return( 1 ); } /* Data range functions */ /* Retrieves the data range * Returns 1 if successful or -1 on error */ int libfdata_list_element_get_data_range( libfdata_list_element_t *element, int *file_index, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_get_data_range"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( libfdata_range_get( internal_element->data_range, file_index, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range.", function ); return( -1 ); } return( 1 ); } /* Sets the data range * Returns 1 if successful or -1 on error */ int libfdata_list_element_set_data_range( libfdata_list_element_t *element, int file_index, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_set_data_range"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid file index less than zero.", function ); return( -1 ); } if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid offset value less than zero.", function ); return( -1 ); } if( size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } if( libfdata_range_set( internal_element->data_range, file_index, offset, size, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range.", function ); return( -1 ); } if( libfcache_date_time_get_timestamp( &( internal_element->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); return( -1 ); } return( 1 ); } /* Mapped range functions */ /* Retrieves the mapped size * Returns 1 if successful, 0 if not set or -1 on error */ int libfdata_list_element_get_mapped_size( libfdata_list_element_t *element, size64_t *mapped_size, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_get_mapped_size"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( mapped_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mapped size.", function ); return( -1 ); } if( ( internal_element->flags & LIBFDATA_LIST_ELEMENT_FLAG_HAS_MAPPED_SIZE ) == 0 ) { return( 0 ); } *mapped_size = internal_element->mapped_size; return( 1 ); } /* Sets the mapped size * Returns 1 if successful or -1 on error */ int libfdata_list_element_set_mapped_size( libfdata_list_element_t *element, size64_t mapped_size, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_set_mapped_size"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( mapped_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid mapped size value exceeds maximum.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tmapped size: %" PRIu64 "\n", function, internal_element->element_index, mapped_size ); libcnotify_printf( "\n" ); } #endif internal_element->mapped_size = mapped_size; internal_element->flags |= LIBFDATA_LIST_ELEMENT_FLAG_HAS_MAPPED_SIZE; if( libfdata_list_set_calculate_mapped_ranges_flag( internal_element->list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set the calculate mapped ranges flag in list.", function ); return( -1 ); } return( 1 ); } /* Element value functions */ /* Retrieves the element value * Returns 1 if successful or -1 on error */ int libfdata_list_element_get_element_value( libfdata_list_element_t *element, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_get_element_value"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( libfdata_list_get_element_value( internal_element->list, file_io_handle, cache, element, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } return( 1 ); } /* Sets the element value * * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list element * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_list_element_set_element_value( libfdata_list_element_t *element, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_list_element_t *internal_element = NULL; static char *function = "libfdata_list_element_set_element_value"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } internal_element = (libfdata_internal_list_element_t *) element; if( libfdata_list_set_element_value( internal_element->list, file_io_handle, cache, element, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set element value.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libfdata/libfdata_mapped_range.h0000664000175000017500000000371513443450051023525 0ustar00lordyestalordyesta00000000000000/* * The (data) mapped range functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_MAPPED_RANGE_H ) #define _LIBFDATA_MAPPED_RANGE_H #include #include #include "libfdata_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_mapped_range libfdata_mapped_range_t; struct libfdata_mapped_range { /* The (start) offset */ off64_t offset; /* The size */ size64_t size; }; int libfdata_mapped_range_initialize( libfdata_mapped_range_t **mapped_range, libcerror_error_t **error ); int libfdata_mapped_range_free( libfdata_mapped_range_t **mapped_range, libcerror_error_t **error ); int libfdata_mapped_range_clone( libfdata_mapped_range_t **destination_mapped_range, libfdata_mapped_range_t *source_mapped_range, libcerror_error_t **error ); int libfdata_mapped_range_get( libfdata_mapped_range_t *mapped_range, off64_t *offset, size64_t *size, libcerror_error_t **error ); int libfdata_mapped_range_set( libfdata_mapped_range_t *mapped_range, off64_t offset, size64_t size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_MAPPED_RANGE_H ) */ libewf-20140807/libfdata/libfdata_extern.h0000664000175000017500000000240613443450051022404 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_EXTERN_H ) #define _LIBFDATA_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata */ #if !defined( HAVE_LOCAL_LIBFDATA ) #include #define LIBFDATA_EXTERN_VARIABLE LIBFDATA_EXTERN #else #define LIBFDATA_EXTERN /* extern */ #define LIBFDATA_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ #endif /* !defined( _LIBFDATA_INTERNAL_EXTERN_H ) */ libewf-20140807/libfdata/libfdata_list.c0000664000175000017500000032400313443450051022045 0ustar00lordyestalordyesta00000000000000/* * The list functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_list.h" #include "libfdata_list_element.h" #include "libfdata_mapped_range.h" #include "libfdata_range.h" #include "libfdata_types.h" #include "libfdata_unused.h" /* Creates a list * Make sure the value list is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the list * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_list_initialize( libfdata_list_t **list, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_initialize"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid list value already set.", function ); return( -1 ); } if( ( flags & 0xfe ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function ); return( -1 ); } internal_list = memory_allocate_structure( libfdata_internal_list_t ); if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create list.", function ); goto on_error; } if( memory_set( internal_list, 0, sizeof( libfdata_internal_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear list.", function ); memory_free( internal_list ); return( -1 ); } if( libcdata_array_initialize( &( internal_list->elements_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create elements array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_list->mapped_ranges_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped ranges array.", function ); goto on_error; } internal_list->flags |= flags; internal_list->data_handle = data_handle; internal_list->free_data_handle = free_data_handle; internal_list->clone_data_handle = clone_data_handle; internal_list->read_element_data = read_element_data; internal_list->write_element_data = write_element_data; *list = (libfdata_list_t *) internal_list; return( 1 ); on_error: if( internal_list != NULL ) { if( internal_list->elements_array != NULL ) { libcdata_array_free( &( internal_list->elements_array ), NULL, NULL ); } memory_free( internal_list ); } return( -1 ); } /* Frees a list * Returns 1 if successful or -1 on error */ int libfdata_list_free( libfdata_list_t **list, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_free"; int result = 1; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *list != NULL ) { internal_list = (libfdata_internal_list_t *) *list; *list = NULL; if( libcdata_array_free( &( internal_list->elements_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the elements array.", function ); result = -1; } if( libcdata_array_free( &( internal_list->mapped_ranges_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the mapped ranges array.", function ); result = -1; } if( ( internal_list->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_list->data_handle != NULL ) { if( internal_list->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - missing free data handle function.", function ); result = -1; } else if( internal_list->free_data_handle( &( internal_list->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_list ); } return( result ); } /* Clones (duplicates) the list * Returns 1 if successful or -1 on error */ int libfdata_list_clone( libfdata_list_t **destination_list, libfdata_list_t *source_list, libcerror_error_t **error ) { libfdata_internal_list_t *internal_destination_list = NULL; libfdata_internal_list_t *internal_source_list = NULL; static char *function = "libfdata_list_clone"; if( destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination list.", function ); return( -1 ); } if( *destination_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination list value already set.", function ); return( -1 ); } if( source_list == NULL ) { *destination_list = NULL; return( 1 ); } internal_source_list = (libfdata_internal_list_t *) source_list; internal_destination_list = memory_allocate_structure( libfdata_internal_list_t ); if( internal_destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination list.", function ); goto on_error; } if( memory_set( internal_destination_list, 0, sizeof( libfdata_internal_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination list.", function ); memory_free( internal_destination_list ); return( -1 ); } if( internal_source_list->data_handle != NULL ) { if( internal_source_list->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source list - missing free data handle function.", function ); goto on_error; } if( internal_source_list->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source list - missing clone data handle function.", function ); goto on_error; } if( internal_source_list->clone_data_handle( &( internal_destination_list->data_handle ), internal_source_list->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone data handle.", function ); goto on_error; } } /* TODO set destination list in destination elements */ if( libcdata_array_clone( &( internal_destination_list->elements_array ), internal_source_list->elements_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_list_element_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination elements array.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_list->mapped_ranges_array ), internal_source_list->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination mapped ranges array.", function ); goto on_error; } internal_destination_list->flags = internal_source_list->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; internal_destination_list->free_data_handle = internal_source_list->free_data_handle; internal_destination_list->clone_data_handle = internal_source_list->clone_data_handle; internal_destination_list->read_element_data = internal_source_list->read_element_data; internal_destination_list->write_element_data = internal_source_list->write_element_data; *destination_list = (libfdata_list_t *) internal_destination_list; return( 1 ); on_error: if( internal_destination_list != NULL ) { if( internal_destination_list->elements_array != NULL ) { libcdata_array_free( &( internal_destination_list->elements_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, NULL ); } if( ( internal_destination_list->data_handle != NULL ) && ( internal_source_list->free_data_handle != NULL ) ) { internal_source_list->free_data_handle( &( internal_destination_list->data_handle ), NULL ); } memory_free( internal_destination_list ); } return( -1 ); } /* Sets the calculate mapped ranges flag * Returns 1 if successful or -1 on error */ int libfdata_list_set_calculate_mapped_ranges_flag( libfdata_list_t *list, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_set_calculate_mapped_ranges_flag"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* List elements functions */ /* Empties the list * Returns 1 if successful or -1 on error */ int libfdata_list_empty( libfdata_list_t *list, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_empty"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_empty( internal_list->elements_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to empty elements array.", function ); return( -1 ); } if( libcdata_array_empty( internal_list->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty mapped ranges array.", function ); return( -1 ); } internal_list->size = 0; return( 1 ); } /* Resizes the list * Returns 1 if successful or -1 on error */ int libfdata_list_resize( libfdata_list_t *list, int number_of_elements, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_resize"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_resize( internal_list->elements_array, number_of_elements, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize elements array.", function ); return( -1 ); } if( libcdata_array_resize( internal_list->mapped_ranges_array, number_of_elements, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize mapped ranges array.", function ); return( -1 ); } internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Reverses the order of the elements * Returns 1 if successful or -1 on error */ int libfdata_list_reverse( libfdata_list_t *list, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_reverse"; int element_index = 0; int number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_reverse( internal_list->elements_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to reverse elements array.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_list->elements_array, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from elements array.", function ); return( -1 ); } for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libfdata_list_element_set_element_index( list_element, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element: %d index.", function, element_index ); return( -1 ); } } internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Retrieves the number of elements of the list * Returns 1 if successful or -1 on error */ int libfdata_list_get_number_of_elements( libfdata_list_t *list, int *number_of_elements, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_get_number_of_elements"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_number_of_entries( internal_list->elements_array, number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from elements array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific list element * Returns 1 if successful or -1 on error */ int libfdata_list_get_list_element_by_index( libfdata_list_t *list, int element_index, libfdata_list_element_t **element, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_get_list_element_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } internal_list->current_element_index = element_index; return( 1 ); } /* Retrieves the data range of a specific element * Returns 1 if successful or -1 on error */ int libfdata_list_get_element_by_index( libfdata_list_t *list, int element_index, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_element_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libfdata_list_element_get_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element: %d.", function, element_index ); return( -1 ); } internal_list->current_element_index = element_index; return( 1 ); } /* Sets the data range of a specific element * Returns 1 if successful or -1 on error */ int libfdata_list_set_element_by_index( libfdata_list_t *list, int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_set_element_by_index"; off64_t previous_element_offset = 0; size64_t mapped_size = 0; size64_t previous_element_size = 0; uint32_t previous_element_flags = 0; int previous_element_file_index = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) off64_t mapped_range_offset = 0; size64_t mapped_range_size = 0; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( list_element == NULL ) { if( libfdata_list_element_initialize( &list_element, list, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_list->elements_array, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in elements array.", function, element_index ); libfdata_list_element_free( &list_element, NULL ); return( -1 ); } } else { result = libfdata_list_element_get_mapped_size( list_element, &mapped_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mapped size of list element: %d.", function, element_index ); return( -1 ); } else if( result == 0 ) { if( libfdata_list_element_get_data_range( list_element, &previous_element_file_index, &previous_element_offset, &previous_element_size, &previous_element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); return( -1 ); } } } if( libfdata_list_element_set_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element: %d.", function, element_index ); return( -1 ); } /* Make sure the list has a mapped range entry for every element */ if( libcdata_array_get_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, element_index ); return( -1 ); } if( mapped_range == NULL ) { if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in mapped ranges array.", function, element_index ); libfdata_mapped_range_free( &mapped_range, NULL ); return( -1 ); } internal_list->size += element_size; internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; } /* If the size of the element is mapped or if the element size did not change * there is no need to recalculate the mapped range */ else if( ( mapped_size == 0 ) && ( previous_element_size != element_size ) ) { internal_list->size -= previous_element_size; internal_list->size += element_size; internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_index, element_file_index, element_offset, element_offset + element_size, element_size ); if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) == 0 ) { if( libfdata_mapped_range_get( mapped_range, &mapped_range_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, element_index ); return( -1 ); } libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_index, mapped_range_offset, mapped_range_offset + mapped_range_size, mapped_range_size ); } libcnotify_printf( "\n" ); } #endif internal_list->current_element_index = element_index; return( 1 ); } /* Prepends an element data range * Returns 1 if successful or -1 on error */ int libfdata_list_prepend_element( libfdata_list_t *list, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_prepend_element"; off64_t mapped_offset = 0; int element_index = 0; int mapped_range_index = -1; int number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); goto on_error; } mapped_offset = internal_list->mapped_offset + (off64_t) internal_list->size; if( libfdata_mapped_range_set( mapped_range, mapped_offset, element_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range values.", function ); goto on_error; } if( libcdata_array_append_entry( internal_list->mapped_ranges_array, &mapped_range_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append mapped range to array.", function ); goto on_error; } if( libfdata_list_element_initialize( &list_element, list, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libfdata_list_element_set_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element.", function ); goto on_error; } if( libcdata_array_prepend_entry( internal_list->elements_array, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend list element to elements array.", function ); goto on_error; } mapped_range_index = -1; mapped_range = NULL; if( libcdata_array_get_number_of_entries( internal_list->elements_array, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from elements array.", function ); goto on_error; } for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); list_element = NULL; goto on_error; } if( libfdata_list_element_set_element_index( list_element, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element: %d index.", function, element_index ); list_element = NULL; goto on_error; } } internal_list->current_element_index = 0; internal_list->size += element_size; internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); on_error: if( list_element != NULL ) { libfdata_list_element_free( &list_element, NULL ); } if( mapped_range_index != -1 ) { libcdata_array_set_entry_by_index( internal_list->mapped_ranges_array, mapped_range_index, NULL, NULL ); } if( mapped_range != NULL ) { libfdata_mapped_range_free( &mapped_range, NULL ); } return( -1 ); } /* Appends an element data range * Returns 1 if successful or -1 on error */ int libfdata_list_append_element( libfdata_list_t *list, int *element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_append_element"; off64_t mapped_offset = 0; int mapped_range_index = -1; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); goto on_error; } mapped_offset = internal_list->mapped_offset + (off64_t) internal_list->size; if( libfdata_mapped_range_set( mapped_range, mapped_offset, element_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range values.", function ); goto on_error; } if( libcdata_array_append_entry( internal_list->mapped_ranges_array, &mapped_range_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append mapped range to array.", function ); goto on_error; } if( libfdata_list_element_initialize( &list_element, list, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libfdata_list_element_set_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element.", function ); goto on_error; } if( libcdata_array_append_entry( internal_list->elements_array, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append list element to elements array.", function ); goto on_error; } mapped_range_index = -1; mapped_range = NULL; if( libfdata_list_element_set_element_index( list_element, *element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element index.", function ); list_element = NULL; goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, *element_index, element_file_index, element_offset, element_offset + element_size, element_size ); libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, *element_index, mapped_offset, mapped_offset + element_size, element_size ); libcnotify_printf( "\n" ); } #endif internal_list->current_element_index = *element_index; internal_list->size += element_size; return( 1 ); on_error: if( list_element != NULL ) { libfdata_list_element_free( &list_element, NULL ); } if( mapped_range_index != -1 ) { libcdata_array_set_entry_by_index( internal_list->mapped_ranges_array, mapped_range_index, NULL, NULL ); } if( mapped_range != NULL ) { libfdata_mapped_range_free( &mapped_range, NULL ); } return( -1 ); } /* Appends the element of the source list to the list * The source list is emptied if successful * Returns 1 if successful or -1 on error */ int libfdata_list_append_list( libfdata_list_t *list, libfdata_list_t *source_list, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_internal_list_t *internal_source_list = NULL; libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_append_list"; off64_t mapped_range_offset = 0; size64_t mapped_range_size = 0; int element_index = 0; int new_number_of_elements = 0; int number_of_elements = 0; int result = 1; int source_element_index = 0; int source_number_of_elements = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( source_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source list.", function ); return( -1 ); } internal_source_list = (libfdata_internal_list_t *) source_list; if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_list_calculate_mapped_ranges( internal_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); goto on_error; } } if( ( internal_source_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_list_calculate_mapped_ranges( internal_source_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges of source list.", function ); goto on_error; } } if( ( internal_list->mapped_offset != 0 ) || ( internal_source_list->mapped_offset != 0 ) ) { if( ( (size64_t) internal_list->mapped_offset + internal_list->size ) != (size64_t) internal_source_list->mapped_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid source mapped offset value out of bounds.", function ); goto on_error; } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: appending source list with mapped offset: %" PRIi64 " and size: %" PRIu64 " to list with mapped offset: %" PRIi64 " and size: %" PRIu64 "\n", function, internal_source_list->mapped_offset, internal_source_list->size, internal_list->mapped_offset, internal_list->size ); } #endif if( libcdata_array_get_number_of_entries( internal_list->elements_array, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from elements array.", function ); goto on_error; } if( libcdata_array_get_number_of_entries( internal_source_list->elements_array, &source_number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from source list elements array.", function ); goto on_error; } element_index = number_of_elements; new_number_of_elements = number_of_elements + source_number_of_elements; if( libcdata_array_resize( internal_list->elements_array, new_number_of_elements, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize elements array.", function ); goto on_error; } if( libcdata_array_resize( internal_list->mapped_ranges_array, new_number_of_elements, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize mapped ranges array.", function ); goto on_error; } for( source_element_index = 0; source_element_index < source_number_of_elements; source_element_index++ ) { if( libcdata_array_get_entry_by_index( internal_source_list->elements_array, source_element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from source list elements array.", function, source_element_index ); goto on_error; } if( libcdata_array_set_entry_by_index( internal_list->elements_array, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in elements array.", function, element_index ); goto on_error; } if( libcdata_array_get_entry_by_index( internal_source_list->mapped_ranges_array, source_element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from source list mapped ranges array.", function, source_element_index ); goto on_error; } if( libcdata_array_set_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in mapped ranges array.", function, element_index ); goto on_error; } element_index++; } element_index = number_of_elements; number_of_elements = new_number_of_elements; new_number_of_elements = 0; if( libcdata_array_empty( internal_source_list->elements_array, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to empty source list elements array.", function ); result = -1; } if( libcdata_array_empty( internal_source_list->mapped_ranges_array, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to empty source list mapped ranges array.", function ); result = -1; } internal_source_list->size = 0; while( element_index < number_of_elements ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); goto on_error; } ( (libfdata_internal_list_element_t *) list_element )->list = list; ( (libfdata_internal_list_element_t *) list_element )->element_index = element_index; if( libcdata_array_get_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, element_index ); goto on_error; } if( libfdata_mapped_range_get( mapped_range, &mapped_range_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, element_index ); goto on_error; } if( libfdata_mapped_range_set( mapped_range, internal_list->size, mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set values of mapped range: %d.", function, element_index ); goto on_error; } internal_list->size += mapped_range_size; element_index++; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); on_error: if( new_number_of_elements != 0 ) { libcdata_array_resize( internal_list->mapped_ranges_array, number_of_elements, NULL, NULL ); libcdata_array_resize( internal_list->elements_array, number_of_elements, NULL, NULL ); } return( -1 ); } /* Determines if a specific element is set * Returns 1 if element is set, 0 if not or -1 on error */ int libfdata_list_is_element_set( libfdata_list_t *list, int element_index, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_is_element_set"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( list_element == NULL ) { return( 0 ); } internal_list->current_element_index = element_index; return( 1 ); } /* Mapped range functions */ /* Retrieves the mapped offset * Returns 1 if successful, 0 if not set or -1 on error */ int libfdata_list_get_mapped_offset( libfdata_list_t *list, off64_t *mapped_offset, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_get_mapped_offset"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( mapped_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mapped offset.", function ); return( -1 ); } if( ( internal_list->flags & LIBFDATA_LIST_FLAG_HAS_MAPPED_OFFSET ) == 0 ) { return( 0 ); } *mapped_offset = internal_list->mapped_offset; return( 1 ); } /* Sets the mapped offset * Returns 1 if successful or -1 on error */ int libfdata_list_set_mapped_offset( libfdata_list_t *list, off64_t mapped_offset, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_set_mapped_offset"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( mapped_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped offset: %" PRIi64 "\n", function, mapped_offset ); libcnotify_printf( "\n" ); } #endif internal_list->mapped_offset = mapped_offset; internal_list->flags |= LIBFDATA_LIST_FLAG_HAS_MAPPED_OFFSET | LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Retrieves the mapped size of a specific element * Returns 1 if successful, 0 if not set or -1 on error */ int libfdata_list_get_mapped_size_by_index( libfdata_list_t *list, int element_index, size64_t *mapped_size, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_mapped_size_by_index"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } result = libfdata_list_element_get_mapped_size( list_element, mapped_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mapped size of element: %d.", function, element_index ); return( -1 ); } internal_list->current_element_index = element_index; return( result ); } /* Sets the mapped size of a specific element * Returns 1 if successful or -1 on error */ int libfdata_list_set_mapped_size_by_index( libfdata_list_t *list, int element_index, size64_t mapped_size, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_set_mapped_size_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libfdata_list_element_set_mapped_size( list_element, mapped_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped size of element: %d.", function, element_index ); return( -1 ); } internal_list->current_element_index = element_index; return( 1 ); } /* Retrieves the data range with its mapped size of a specific element * Returns 1 if successful, 0 if the element has no mapped size or -1 on error */ int libfdata_list_get_element_by_index_with_mapped_size( libfdata_list_t *list, int element_index, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, size64_t *mapped_size, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_element_by_index_with_mapped_size"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libfdata_list_element_get_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element: %d.", function, element_index ); return( -1 ); } result = libfdata_list_element_get_mapped_size( list_element, mapped_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mapped size of list element: %d.", function, element_index ); return( -1 ); } internal_list->current_element_index = element_index; return( result ); } /* Sets the data range of a specific element with its mapped size * Returns 1 if successful or -1 on error */ int libfdata_list_set_element_by_index_with_mapped_size( libfdata_list_t *list, int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, size64_t mapped_size, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_set_element_by_index_with_mapped_size"; off64_t previous_element_offset = 0; size64_t previous_element_size = 0; size64_t previous_mapped_size = 0; uint32_t previous_element_flags = 0; int previous_element_file_index = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) off64_t mapped_range_offset = 0; size64_t mapped_range_size = 0; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( list_element == NULL ) { if( libfdata_list_element_initialize( &list_element, list, element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_list->elements_array, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in elements array.", function, element_index ); libfdata_list_element_free( &list_element, NULL ); return( -1 ); } } else { result = libfdata_list_element_get_mapped_size( list_element, &previous_mapped_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mapped size of list element: %d.", function, element_index ); return( -1 ); } else if( result == 0 ) { if( libfdata_list_element_get_data_range( list_element, &previous_element_file_index, &previous_element_offset, &previous_element_size, &previous_element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); return( -1 ); } } } if( libfdata_list_element_set_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element: %d.", function, element_index ); return( -1 ); } if( libfdata_list_element_set_mapped_size( list_element, mapped_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped size of list element.", function ); return( -1 ); } /* Make sure the list has a mapped range entry for every element */ if( libcdata_array_get_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, element_index ); return( -1 ); } if( mapped_range == NULL ) { if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in mapped ranges array.", function, element_index ); libfdata_mapped_range_free( &mapped_range, NULL ); return( -1 ); } internal_list->size += mapped_size; internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; } else if( previous_mapped_size != mapped_size ) { if( previous_mapped_size != 0 ) { internal_list->size -= previous_mapped_size; } else { internal_list->size -= previous_element_size; } if( mapped_size != 0 ) { internal_list->size += mapped_size; } else { internal_list->size += element_size; } internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_index, element_file_index, element_offset, element_offset + element_size, element_size ); if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) == 0 ) { if( libfdata_mapped_range_get( mapped_range, &mapped_range_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, element_index ); return( -1 ); } libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_index, mapped_range_offset, mapped_range_offset + mapped_range_size, mapped_range_size ); } libcnotify_printf( "\n" ); } #endif internal_list->current_element_index = element_index; return( 1 ); } /* Appends an element data range with its mapped size * Returns 1 if successful or -1 on error */ int libfdata_list_append_element_with_mapped_size( libfdata_list_t *list, int *element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, size64_t mapped_size, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_append_element_with_mapped_size"; off64_t mapped_offset = 0; int mapped_range_index = -1; uint8_t list_flags = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); goto on_error; } mapped_offset = internal_list->mapped_offset + (off64_t) internal_list->size; if( libfdata_mapped_range_set( mapped_range, mapped_offset, mapped_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range values.", function ); goto on_error; } if( libcdata_array_append_entry( internal_list->mapped_ranges_array, &mapped_range_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append mapped range to array.", function ); goto on_error; } if( libfdata_list_element_initialize( &list_element, list, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libfdata_list_element_set_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range of list element.", function ); goto on_error; } list_flags = internal_list->flags; if( libfdata_list_element_set_mapped_size( list_element, mapped_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped size of list element.", function ); goto on_error; } /* Setting the mapped size in the list element will set the calculate mapped ranges flag in the list * Reset the flag if it was not set before setting the mapped size in the list element */ if( ( list_flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) == 0 ) { internal_list->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } if( libcdata_array_append_entry( internal_list->elements_array, element_index, (intptr_t *) list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append list element to elements array.", function ); goto on_error; } mapped_range_index = -1; mapped_range = NULL; if( libfdata_list_element_set_element_index( list_element, *element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set list element index.", function ); list_element = NULL; goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, *element_index, element_file_index, element_offset, element_offset + element_size, element_size ); libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, *element_index, mapped_offset, mapped_offset + mapped_size, mapped_size ); libcnotify_printf( "\n" ); } #endif internal_list->current_element_index = *element_index; internal_list->size += mapped_size; return( 1 ); on_error: if( list_element != NULL ) { libfdata_list_element_free( &list_element, NULL ); } if( mapped_range_index != -1 ) { libcdata_array_set_entry_by_index( internal_list->mapped_ranges_array, mapped_range_index, NULL, NULL ); } if( mapped_range != NULL ) { libfdata_mapped_range_free( &mapped_range, NULL ); } return( -1 ); } /* Calculates the mapped ranges * Returns 1 if successful or -1 on error */ int libfdata_list_calculate_mapped_ranges( libfdata_internal_list_t *internal_list, libcerror_error_t **error ) { libfdata_list_element_t *list_element = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_calculate_mapped_ranges"; off64_t mapped_offset = 0; off64_t element_offset = 0; size64_t element_size = 0; size64_t mapped_size = 0; uint32_t element_flags = 0; int element_file_index = -1; int element_index = -1; int number_of_elements = 0; int result = 0; if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( internal_list->elements_array, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of elements from elements array.", function ); return( -1 ); } mapped_offset = internal_list->mapped_offset; for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_list->mapped_ranges_array, element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, element_index ); return( -1 ); } if( libfdata_list_element_get_data_range( list_element, &element_file_index, &element_offset, &element_size, &element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, element_index ); return( -1 ); } result = libfdata_list_element_get_mapped_size( list_element, &mapped_size, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mapped size of list element: %d.", function, element_index ); return( -1 ); } else if( result == 0 ) { mapped_size = element_size; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_index, element_file_index, element_offset, element_offset + element_size, element_size ); libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_index, mapped_offset, mapped_offset + mapped_size, mapped_size ); } #endif if( libfdata_mapped_range_set( mapped_range, mapped_offset, mapped_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range: %d values.", function, element_index ); return( -1 ); } mapped_offset += (off64_t) mapped_size; } internal_list->size = (size64_t) mapped_offset - internal_list->mapped_offset; internal_list->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( 1 ); } /* Retrieves the element index for a specific offset * The element_data_offset value is set to the offset relative to the start of the element * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_list_get_element_index_at_offset( libfdata_list_t *list, off64_t offset, int *element_index, off64_t *element_data_offset, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_list_get_element_index_at_offset"; off64_t list_offset = 0; off64_t mapped_range_end_offset = 0; off64_t mapped_range_start_offset = 0; size64_t mapped_range_size = 0; int initial_element_index = 0; int number_of_elements = 0; int result = 0; int search_element_index = 0; #if defined( HAVE_DEBUG_OUTPUT ) libfdata_list_element_t *element = NULL; off64_t element_offset = 0; size64_t element_size = 0; uint32_t element_flags = 0; int element_file_index = -1; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid offset value less than zero.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element_data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element data offset.", function ); return( -1 ); } if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_list_calculate_mapped_ranges( internal_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested offset: 0x%08" PRIx64 "\n", function, offset ); } #endif if( internal_list->size == 0 ) { return( 0 ); } if( offset < internal_list->mapped_offset ) { return( 0 ); } list_offset = offset - internal_list->mapped_offset; if( (size64_t) list_offset >= internal_list->size ) { return( 0 ); } if( libcdata_array_get_number_of_entries( internal_list->mapped_ranges_array, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from mapped ranges array.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: number of elements: %d\n", function, number_of_elements ); } #endif /* This assumes a fairly even distribution of the sizes of the elements */ initial_element_index = (int) ( ( number_of_elements * list_offset ) / internal_list->size ); /* Look for the corresponding element upwards in the array */ for( search_element_index = initial_element_index; search_element_index < number_of_elements; search_element_index++ ) { if( libcdata_array_get_entry_by_index( internal_list->mapped_ranges_array, search_element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, search_element_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, &mapped_range_start_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, search_element_index ); return( -1 ); } mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; if( mapped_range_end_offset < mapped_range_start_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element: %d - mapped range value out of bounds.", function, search_element_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, search_element_index, mapped_range_start_offset, mapped_range_end_offset, mapped_range_size ); } #endif /* Check if the offset is in the mapped range */ if( ( offset >= mapped_range_start_offset ) && ( offset < mapped_range_end_offset ) ) { offset -= mapped_range_start_offset; break; } /* Check if the offset is out of bounds */ if( offset < mapped_range_start_offset ) { search_element_index = number_of_elements; break; } } if( search_element_index >= number_of_elements ) { /* Look for the corresponding element downwards in the array */ for( search_element_index = initial_element_index; search_element_index >= 0; search_element_index-- ) { if( libcdata_array_get_entry_by_index( internal_list->mapped_ranges_array, search_element_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, search_element_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, &mapped_range_start_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, search_element_index ); return( -1 ); } mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; if( mapped_range_end_offset < mapped_range_start_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element: %d - mapped range value out of bounds.", function, search_element_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, search_element_index, mapped_range_start_offset, mapped_range_end_offset, mapped_range_size ); } #endif /* Check if the offset is in the mapped range */ if( ( offset >= mapped_range_start_offset ) && ( offset < mapped_range_end_offset ) ) { offset -= mapped_range_start_offset; break; } /* Check if the offset is out of bounds */ if( offset > mapped_range_start_offset ) { search_element_index--; break; } } } if( ( search_element_index >= 0 ) && ( search_element_index < number_of_elements ) ) { if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } *element_data_offset = offset; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, search_element_index, (intptr_t **) &element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, search_element_index ); return( -1 ); } if( libfdata_list_element_get_data_range( element, &element_file_index, &element_offset, &element_size, &element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, search_element_index ); return( -1 ); } libcnotify_printf( "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, search_element_index, element_file_index, element_offset, element_offset + element_size, element_size ); } #endif internal_list->current_element_index = search_element_index; result = 1; } if( result == 1 ) { *element_index = search_element_index; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); } /* Retrieves the list element for a specific offset * The element_data_offset value is set to the offset relative to the start of the element * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_list_get_list_element_at_offset( libfdata_list_t *list, off64_t offset, int *element_index, off64_t *element_data_offset, libfdata_list_element_t **element, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_get_list_element_at_offset"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid offset value less than zero.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } result = libfdata_list_get_element_index_at_offset( list, offset, element_index, element_data_offset, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index at offset: 0x%08" PRIx64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, *element_index, (intptr_t **) element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, *element_index ); return( -1 ); } } return( result ); } /* Retrieves the data range of an element at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_list_get_element_at_offset( libfdata_list_t *list, off64_t offset, int *element_index, off64_t *element_data_offset, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_element_at_offset"; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } result = libfdata_list_get_element_index_at_offset( list, offset, element_index, element_data_offset, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index at offset: 0x%08" PRIx64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { if( libcdata_array_get_entry_by_index( internal_list->elements_array, *element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, *element_index ); return( -1 ); } if( libfdata_list_element_get_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element: %d.", function, *element_index ); return( -1 ); } } return( result ); } /* List element value functions */ /* Caches the element value * Returns 1 if successful or -1 on error */ int libfdata_list_cache_element_value( libfdata_list_t *list, libfdata_cache_t *cache, int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, int64_t element_timestamp, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_cache_element_value"; int cache_entry_index = -1; int number_of_cache_entries = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } if( internal_list->calculate_cache_entry_index == NULL ) { cache_entry_index = element_index % number_of_cache_entries; } else { cache_entry_index = internal_list->calculate_cache_entry_index( element_index, element_file_index, element_offset, element_size, element_flags, number_of_cache_entries ); } if( libfcache_cache_set_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, element_file_index, element_offset, element_timestamp, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache entry: %d.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Retrieves the element value * Returns 1 if successful or -1 on error */ int libfdata_list_get_element_value( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_list_element_t *element, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_get_element_value"; size64_t element_size = 0; off64_t cache_value_offset = (off64_t) -1; off64_t element_offset = 0; int64_t cache_value_timestamp = 0; int64_t element_timestamp = 0; uint32_t element_flags = 0; int cache_entry_index = -1; int cache_value_file_index = -1; int element_file_index = -1; int element_index = -1; int number_of_cache_entries = 0; int result = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( internal_list->read_element_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - missing read element data function.", function ); return( -1 ); } if( libfdata_list_element_get_data_range( element, &element_file_index, &element_offset, &element_size, &element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( libfdata_list_element_get_element_index( element, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from list element.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { if( internal_list->calculate_cache_entry_index == NULL ) { cache_entry_index = element_index % number_of_cache_entries; } else { cache_entry_index = internal_list->calculate_cache_entry_index( element_index, element_file_index, element_offset, element_size, element_flags, number_of_cache_entries ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfdata_list_element_get_timestamp( element, &element_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from list element.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( element_file_index == cache_value_file_index ) && ( element_offset == cache_value_offset ) && ( element_timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading element data at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, element_offset, element_offset, element_size ); } #endif if( internal_list->read_element_data( internal_list->data_handle, file_io_handle, element, cache, element_file_index, element_offset, element_size, element_flags, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read element data at offset: 0x%08" PRIx64 ".", function, element_offset ); return( -1 ); } if( internal_list->calculate_cache_entry_index == NULL ) { cache_entry_index = element_index % number_of_cache_entries; } else { cache_entry_index = internal_list->calculate_cache_entry_index( element_index, element_file_index, element_offset, element_size, element_flags, number_of_cache_entries ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfdata_list_element_get_timestamp( element, &element_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from list element.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( element_file_index != cache_value_file_index ) || ( element_offset != cache_value_offset ) || ( element_timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing cache value.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, element_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value of a specific element * Returns 1 if successful or -1 on error */ int libfdata_list_get_element_value_by_index( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_element_value_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libfdata_list_get_element_value( list, file_io_handle, cache, list_element, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } internal_list->current_element_index = element_index; return( 1 ); } /* Retrieves the value an element at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_list_get_element_value_at_offset( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, int *element_index, off64_t *element_data_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_element_value_at_offset"; int result = 0; if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } result = libfdata_list_get_list_element_at_offset( list, offset, element_index, element_data_offset, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element at offset: 0x%08" PRIx64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { if( libfdata_list_get_element_value( list, file_io_handle, cache, list_element, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element: %d value.", function, *element_index ); return( -1 ); } } return( result ); } /* Sets the value of a specific element * * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_list_set_element_value( libfdata_list_t *list, intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, libfdata_cache_t *cache, libfdata_list_element_t *element, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { static char *function = "libfdata_list_set_element_value"; size64_t element_size = 0; off64_t element_offset = 0; int64_t element_timestamp = 0; uint32_t element_flags = 0; int element_file_index = -1; int element_index = -1; LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) if( libfdata_list_element_get_data_range( element, &element_file_index, &element_offset, &element_size, &element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from list element.", function ); return( -1 ); } if( libfdata_list_element_get_element_index( element, &element_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index from list element.", function ); return( -1 ); } if( libfdata_list_element_get_timestamp( element, &element_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from list element.", function ); return( -1 ); } if( libfdata_list_cache_element_value( list, cache, element_index, element_file_index, element_offset, element_size, element_flags, element_timestamp, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to cache element value.", function ); return( -1 ); } return( 1 ); } /* Sets the value of a specific element * * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_list_set_element_value_by_index( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_set_element_value_by_index"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( libcdata_array_get_entry_by_index( internal_list->elements_array, element_index, (intptr_t **) &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from elements array.", function, element_index ); return( -1 ); } if( libfdata_list_set_element_value( list, file_io_handle, cache, list_element, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set element value.", function ); return( -1 ); } internal_list->current_element_index = element_index; return( 1 ); } /* Sets the value of an element at a specific offset * * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_list_set_element_value_at_offset( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_set_element_value_at_offset"; off64_t element_data_offset = 0; int element_index = 0; int result = 0; result = libfdata_list_get_list_element_at_offset( list, offset, &element_index, &element_data_offset, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element at offset: 0x%08" PRIx64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { if( libfdata_list_set_element_value( list, file_io_handle, cache, list_element, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value of element: %d.", function, element_index ); return( -1 ); } } return( result ); } /* Retrieves the size of the list * Returns 1 if successful or -1 on error */ int libfdata_list_get_size( libfdata_list_t *list, size64_t *size, libcerror_error_t **error ) { libfdata_internal_list_t *internal_list = NULL; static char *function = "libfdata_list_get_size"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libfdata_internal_list_t *) list; if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_list_calculate_mapped_ranges( internal_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); return( -1 ); } } *size = internal_list->size; return( 1 ); } libewf-20140807/libfdata/libfdata_libcdata.h0000664000175000017500000000301613443450051022640 0ustar00lordyestalordyesta00000000000000/* * The libcdata header wrapper * * Copyright (C) 2010-2018, 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( _LIBFDATA_LIBCDATA_H ) #define _LIBFDATA_LIBCDATA_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT * before including libcdata.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCDATA_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBFDATA_LIBCDATA_H ) */ libewf-20140807/libfdata/libfdata_notify.h0000664000175000017500000000307313443450051022410 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_NOTIFY_H ) #define _LIBFDATA_NOTIFY_H #include #include #include #include "libfdata_extern.h" #include "libfdata_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFDATA ) LIBFDATA_EXTERN \ void libfdata_notify_set_verbose( int verbose ); LIBFDATA_EXTERN \ int libfdata_notify_set_stream( FILE *stream, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_notify_stream_open( const char *filename, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_notify_stream_close( libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_NOTIFY_H ) */ libewf-20140807/libfdata/libfdata_range_list.h0000664000175000017500000001357713443450051023241 0ustar00lordyestalordyesta00000000000000/* * The range list functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_RANGE_LIST_H ) #define _LIBFDATA_INTERNAL_RANGE_LIST_H #include #include #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_range_list libfdata_internal_range_list_t; struct libfdata_internal_range_list { /* The (list) elements range list */ libcdata_range_list_t *elements_range_list; /* The flags */ uint8_t flags; /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The read element data function */ int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, uint8_t read_flags, libcerror_error_t **error ); /* The write element data function */ int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, uint8_t write_flags, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_range_list_initialize( libfdata_range_list_t **range_list, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_range_list_free( libfdata_range_list_t **range_list, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_range_list_clone( libfdata_range_list_t **destination_range_list, libfdata_range_list_t *source_range_list, libcerror_error_t **error ); /* List elements functions */ LIBFDATA_EXTERN \ int libfdata_range_list_empty( libfdata_range_list_t *range_list, libcerror_error_t **error ); /* Mapped range functions */ LIBFDATA_EXTERN \ int libfdata_range_list_get_list_element_at_offset( libfdata_range_list_t *range_list, off64_t offset, off64_t *element_data_offset, libfdata_list_element_t **element, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_range_list_get_element_at_offset( libfdata_range_list_t *range_list, off64_t offset, off64_t *element_data_offset, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_range_list_insert_element( libfdata_range_list_t *range_list, off64_t offset, size64_t size, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ); /* List element value functions */ LIBFDATA_EXTERN \ int libfdata_range_list_get_element_value_at_offset( libfdata_range_list_t *range_list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, off64_t *element_data_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_range_list_set_element_value_at_offset( libfdata_range_list_t *range_list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_RANGE_LIST_H ) */ libewf-20140807/libfdata/Makefile.am0000664000175000017500000000272213443450051021135 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBFDATA AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libfdata.la libfdata_la_SOURCES = \ libfdata_area.c libfdata_area.h \ libfdata_btree.c libfdata_btree.h \ libfdata_btree_node.c libfdata_btree_node.h \ libfdata_btree_range.c libfdata_btree_range.h \ libfdata_cache.c libfdata_cache.h \ libfdata_definitions.h \ libfdata_error.c libfdata_error.h \ libfdata_extern.h \ libfdata_inline.h \ libfdata_libcdata.h \ libfdata_libcerror.h \ libfdata_libcnotify.h \ libfdata_libfcache.h \ libfdata_list.c libfdata_list.h \ libfdata_list_element.c libfdata_list_element.h \ libfdata_mapped_range.c libfdata_mapped_range.h \ libfdata_notify.c libfdata_notify.h \ libfdata_range.c libfdata_range.h \ libfdata_range_list.c libfdata_range_list.h \ libfdata_segments_array.c libfdata_segments_array.h \ libfdata_stream.c libfdata_stream.h \ libfdata_support.c libfdata_support.h \ libfdata_tree.c libfdata_tree.h \ libfdata_tree_node.c libfdata_tree_node.h \ libfdata_types.h \ libfdata_unused.h \ libfdata_vector.c libfdata_vector.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libfdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdata_la_SOURCES) libewf-20140807/libfdata/libfdata_error.c0000664000175000017500000000554013443450051022225 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_error.h" #include "libfdata_libcerror.h" #if !defined( HAVE_LOCAL_LIBFDATA ) /* Free an error and its elements */ void libfdata_error_free( libfdata_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libfdata_error_fprint( libfdata_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libfdata_error_sprint( libfdata_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libfdata_error_backtrace_fprint( libfdata_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libfdata_error_backtrace_sprint( libfdata_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ libewf-20140807/libfdata/libfdata_list.h0000664000175000017500000002756013443450051022062 0ustar00lordyestalordyesta00000000000000/* * The list functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_LIST_H ) #define _LIBFDATA_INTERNAL_LIST_H #include #include #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_list libfdata_internal_list_t; struct libfdata_internal_list { /* The current (most recently used) element index */ int current_element_index; /* The mapped offset */ off64_t mapped_offset; /* The (list) size */ size64_t size; /* The (list) elements array */ libcdata_array_t *elements_array; /* The mapped ranges array */ libcdata_array_t *mapped_ranges_array; /* The flags */ uint8_t flags; /* The calculate cache entry index value */ int (*calculate_cache_entry_index)( int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, int number_of_cache_entries ); /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The read element data function */ int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ); /* The write element data function */ int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_list_initialize( libfdata_list_t **list, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_free( libfdata_list_t **list, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_clone( libfdata_list_t **destination_list, libfdata_list_t *source_list, libcerror_error_t **error ); int libfdata_list_set_calculate_mapped_ranges_flag( libfdata_list_t *list, libcerror_error_t **error ); /* List elements functions */ LIBFDATA_EXTERN \ int libfdata_list_empty( libfdata_list_t *list, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_resize( libfdata_list_t *list, int number_of_elements, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_reverse( libfdata_list_t *list, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_number_of_elements( libfdata_list_t *list, int *number_of_elements, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_list_element_by_index( libfdata_list_t *list, int element_index, libfdata_list_element_t **element, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_element_by_index( libfdata_list_t *list, int element_index, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_set_element_by_index( libfdata_list_t *list, int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_prepend_element( libfdata_list_t *list, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_append_element( libfdata_list_t *list, int *element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_append_list( libfdata_list_t *list, libfdata_list_t *source_list, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_is_element_set( libfdata_list_t *list, int element_index, libcerror_error_t **error ); /* Mapped range functions */ LIBFDATA_EXTERN \ int libfdata_list_get_mapped_offset( libfdata_list_t *list, off64_t *mapped_offset, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_set_mapped_offset( libfdata_list_t *list, off64_t mapped_offset, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_mapped_size_by_index( libfdata_list_t *list, int element_index, size64_t *mapped_size, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_set_mapped_size_by_index( libfdata_list_t *list, int element_index, size64_t mapped_size, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_element_by_index_with_mapped_size( libfdata_list_t *list, int element_index, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, size64_t *mapped_size, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_set_element_by_index_with_mapped_size( libfdata_list_t *list, int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, size64_t mapped_size, libcerror_error_t **error ); /* TODO libfdata_list_prepend_element_with_mapped_size */ LIBFDATA_EXTERN \ int libfdata_list_append_element_with_mapped_size( libfdata_list_t *list, int *element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, size64_t mapped_size, libcerror_error_t **error ); int libfdata_list_calculate_mapped_ranges( libfdata_internal_list_t *internal_list, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_element_index_at_offset( libfdata_list_t *list, off64_t offset, int *element_index, off64_t *element_data_offset, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_list_element_at_offset( libfdata_list_t *list, off64_t offset, int *element_index, off64_t *element_data_offset, libfdata_list_element_t **element, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_element_at_offset( libfdata_list_t *list, off64_t offset, int *element_index, off64_t *element_data_offset, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, libcerror_error_t **error ); /* TODO add libfdata_list_set_element_at_offset */ /* List element value functions */ LIBFDATA_EXTERN \ int libfdata_list_cache_element_value( libfdata_list_t *list, libfdata_cache_t *cache, int element_index, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, int64_t element_timestamp, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); int libfdata_list_get_element_value( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_list_element_t *element, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_element_value_by_index( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_get_element_value_at_offset( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, int *element_index, off64_t *element_data_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); int libfdata_list_set_element_value( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_list_element_t *element, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_set_element_value_by_index( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_set_element_value_at_offset( libfdata_list_t *list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); /* IO functions */ LIBFDATA_EXTERN \ int libfdata_list_get_size( libfdata_list_t *list, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_LIST_H ) */ libewf-20140807/libfdata/libfdata_btree_range.c0000664000175000017500000002155413443450051023354 0ustar00lordyestalordyesta00000000000000/* * The balanced tree range functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_btree_range.h" #include "libfdata_definitions.h" #include "libfdata_libcerror.h" #include "libfdata_range.h" #include "libfdata_types.h" /* Creates a tree range * Make sure the value range is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_btree_range_initialize( libfdata_btree_range_t **range, libcerror_error_t **error ) { static char *function = "libfdata_btree_range_initialize"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree range.", function ); return( -1 ); } if( *range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid tree range value already set.", function ); return( -1 ); } *range = memory_allocate_structure( libfdata_btree_range_t ); if( *range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create tree range.", function ); goto on_error; } if( memory_set( *range, 0, sizeof( libfdata_btree_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear tree range.", function ); goto on_error; } ( *range )->file_index = -1; ( *range )->offset = (off64_t) -1; return( 1 ); on_error: if( *range != NULL ) { memory_free( *range ); *range = NULL; } return( -1 ); } /* Frees a tree range * Returns 1 if successful or -1 on error */ int libfdata_btree_range_free( libfdata_btree_range_t **range, libcerror_error_t **error ) { static char *function = "libfdata_btree_range_free"; int result = 1; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree range.", function ); return( -1 ); } if( *range != NULL ) { if( ( *range )->key_value != NULL ) { if( ( ( *range )->key_value_flags & LIBFDATA_KEY_VALUE_FLAG_MANAGED ) != 0 ) { if( ( *range )->free_key_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree range - missing free key value function.", function ); result = -1; } else if( ( *range )->free_key_value( &( ( *range )->key_value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free key value.", function ); result = -1; } } } memory_free( *range ); *range = NULL; } return( result ); } /* Clones (duplicates) the range * Returns 1 if successful or -1 on error */ int libfdata_btree_range_clone( libfdata_btree_range_t **destination_range, libfdata_btree_range_t *source_range, libcerror_error_t **error ) { static char *function = "libfdata_btree_range_clone"; if( destination_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range.", function ); return( -1 ); } if( *destination_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination range value already set.", function ); return( -1 ); } if( source_range == NULL ) { *destination_range = NULL; return( 1 ); } *destination_range = memory_allocate_structure( libfdata_btree_range_t ); if( *destination_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination range.", function ); goto on_error; } if( memory_copy( *destination_range, source_range, sizeof( libfdata_btree_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination range.", function ); goto on_error; } ( *destination_range )->key_value = NULL; return( 1 ); on_error: if( *destination_range != NULL ) { memory_free( *destination_range ); *destination_range = NULL; } return( -1 ); } /* Retrieves the tree range values * Returns 1 if successful or -1 on error */ int libfdata_btree_range_get( libfdata_btree_range_t *range, int *data_file_index, off64_t *data_offset, size64_t *data_size, uint32_t *data_flags, intptr_t **key_value, libcerror_error_t **error ) { static char *function = "libfdata_btree_range_get"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree range.", function ); return( -1 ); } if( data_file_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data file index.", function ); return( -1 ); } if( data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data offset.", function ); return( -1 ); } if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } if( data_flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data flags.", function ); return( -1 ); } if( key_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid key value.", function ); return( -1 ); } *data_file_index = range->file_index; *data_offset = range->offset; *data_size = range->size; *data_flags = range->flags; *key_value = range->key_value; return( 1 ); } /* Sets the tree range values * Returns 1 if successful or -1 on error */ int libfdata_btree_range_set( libfdata_btree_range_t *range, int data_file_index, off64_t data_offset, size64_t data_size, uint32_t data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ) { static char *function = "libfdata_range_set"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree range.", function ); return( -1 ); } if( free_key_value != NULL ) { if( ( range->key_value_flags & LIBFDATA_KEY_VALUE_FLAG_MANAGED ) != 0 ) { if( range->key_value != NULL ) { if( range->free_key_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing free key value function.", function ); return( -1 ); } if( range->free_key_value( &( range->key_value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free key value.", function ); return( -1 ); } } range->key_value_flags &= ~( LIBFDATA_KEY_VALUE_FLAG_MANAGED ); } } range->file_index = data_file_index; range->offset = data_offset; range->size = data_size; range->flags = data_flags; range->key_value = key_value; range->free_key_value = free_key_value; range->key_value_flags |= key_value_flags; return( 1 ); } libewf-20140807/libfdata/libfdata_area.h0000664000175000017500000001624113443450051022011 0ustar00lordyestalordyesta00000000000000/* * The area functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_AREA_H ) #define _LIBFDATA_INTERNAL_AREA_H #include #include #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_area libfdata_internal_area_t; struct libfdata_internal_area { /* The element data size */ size64_t element_data_size; /* The (area) size */ size64_t size; /* The segments array */ libcdata_array_t *segments_array; /* The mapped ranges array */ libcdata_array_t *mapped_ranges_array; /* The timestamp */ int64_t timestamp; /* The flags */ uint8_t flags; /* The calculate cache entry index value */ int (*calculate_cache_entry_index)( int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, int number_of_cache_entries ); /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The read element data function */ int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_area_t *area, libfdata_cache_t *cache, off64_t element_value_offset, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ); /* The write element data function */ int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_area_t *area, libfdata_cache_t *cache, off64_t element_value_offset, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_area_initialize( libfdata_area_t **area, size64_t element_data_size, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_area_t *area, libfdata_cache_t *cache, off64_t element_value_offset, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_area_t *area, libfdata_cache_t *cache, off64_t element_value_offset, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_free( libfdata_area_t **area, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_clone( libfdata_area_t **destination_area, libfdata_area_t *source_area, libcerror_error_t **error ); /* Segment functions */ LIBFDATA_EXTERN \ int libfdata_area_empty( libfdata_area_t *area, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_resize( libfdata_area_t *area, int number_of_segments, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_get_number_of_segments( libfdata_area_t *area, int *number_of_segments, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_get_segment_by_index( libfdata_area_t *area, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_set_segment_by_index( libfdata_area_t *area, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_prepend_segment( libfdata_area_t *area, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_append_segment( libfdata_area_t *area, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); /* Area element functions */ LIBFDATA_EXTERN \ int libfdata_area_get_element_data_size( libfdata_area_t *area, size64_t *element_data_size, libcerror_error_t **error ); /* Area element value functions */ LIBFDATA_EXTERN \ int libfdata_area_get_element_value_at_offset( libfdata_area_t *area, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t element_value_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_area_set_element_value_at_offset( libfdata_area_t *area, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t element_value_offset, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); /* IO functions */ LIBFDATA_EXTERN \ int libfdata_area_get_size( libfdata_area_t *area, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_AREA_H ) */ libewf-20140807/libfdata/libfdata_tree_node.h0000664000175000017500000002274413443450051023052 0ustar00lordyestalordyesta00000000000000/* * The tree node functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_TREE_NODE_H ) #define _LIBFDATA_INTERNAL_TREE_NODE_H #include #include #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_range.h" #include "libfdata_tree.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif #define libfdata_tree_node_calculate_branch_node_cache_entry_index( node_offset, number_of_cache_entries ) \ ( number_of_cache_entries > 4 ) ? ( node_offset % ( number_of_cache_entries / 4 ) ) : ( node_offset % number_of_cache_entries ) #define libfdata_tree_node_calculate_leaf_node_cache_entry_index( node_offset, number_of_cache_entries ) \ ( number_of_cache_entries > 4 ) ? ( number_of_cache_entries / 4 ) + ( node_offset % ( ( number_of_cache_entries * 3 ) / 4 ) ) : ( node_offset % number_of_cache_entries ) typedef struct libfdata_internal_tree_node libfdata_internal_tree_node_t; struct libfdata_internal_tree_node { /* The tree reference */ libfdata_tree_t *tree; /* The parent (tree) node reference */ libfdata_tree_node_t *parent_node; /* The node data range */ libfdata_range_t *node_data_range; /* The sub nodes data range */ libfdata_range_t *sub_nodes_data_range; /* The timestamp */ int64_t timestamp; /* The flags */ uint8_t flags; /* The sub nodes (array) */ libcdata_array_t *sub_nodes; /* The number of leaf nodes */ int number_of_leaf_nodes; /* The number of deleted leaf nodes */ int number_of_deleted_leaf_nodes; /* The relative first leaf node index */ int first_leaf_node_index; /* The relative first deleted leaf node index */ int first_deleted_leaf_node_index; }; int libfdata_tree_node_initialize( libfdata_tree_node_t **node, libfdata_tree_t *tree, libfdata_tree_node_t *parent_node, libcerror_error_t **error ); int libfdata_tree_node_free( libfdata_tree_node_t **node, libcerror_error_t **error ); int libfdata_tree_node_free_single( libfdata_tree_node_t **node, libcerror_error_t **error ); int libfdata_tree_node_set_parent_node( libfdata_tree_node_t *node, libfdata_tree_node_t *parent_node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_is_root( libfdata_tree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_get_data_range( libfdata_tree_node_t *node, int *node_file_index, off64_t *node_offset, size64_t *node_size, uint32_t *node_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_data_range( libfdata_tree_node_t *node, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_sub_nodes_data_range_is_set( libfdata_tree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_get_sub_nodes_data_range( libfdata_tree_node_t *node, int *sub_nodes_file_index, off64_t *sub_nodes_offset, size64_t *sub_nodes_size, uint32_t *sub_nodes_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_sub_nodes_data_range( libfdata_tree_node_t *node, int sub_nodes_file_index, off64_t sub_nodes_offset, size64_t sub_nodes_size, uint32_t sub_nodes_flags, libcerror_error_t **error ); int libfdata_tree_node_get_timestamp( libfdata_tree_node_t *node, int64_t *timestamp, libcerror_error_t **error ); int libfdata_tree_node_get_first_leaf_node_index( libfdata_tree_node_t *node, int *first_leaf_node_index, int *deleted_first_leaf_node_index, libcerror_error_t **error ); int libfdata_tree_node_set_first_leaf_node_index( libfdata_tree_node_t *node, int first_leaf_node_index, int deleted_first_leaf_node_index, libcerror_error_t **error ); /* Node value functions */ LIBFDATA_EXTERN \ int libfdata_tree_node_get_node_value( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t **node_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_node_value( libfdata_tree_node_t *node, libfdata_cache_t *cache, intptr_t *node_value, int (*free_node_value)( intptr_t **node_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); /* Sub node functions */ LIBFDATA_EXTERN \ int libfdata_tree_node_resize_sub_nodes( libfdata_tree_node_t *node, int number_of_sub_nodes, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_get_number_of_sub_nodes( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_sub_nodes, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_get_sub_node_by_index( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int sub_node_index, libfdata_tree_node_t **sub_node, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_sub_node_by_index( libfdata_tree_node_t *node, int sub_node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_append_sub_node( libfdata_tree_node_t *node, int *sub_node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_insert_sub_node( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *sub_node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, int (*node_value_compare_function)( intptr_t *first_node_value, intptr_t *second_node_value, libcerror_error_t **error ), uint8_t insert_flags, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_split_sub_nodes( libfdata_tree_node_t *node, int number_of_splits, libcerror_error_t **error ); /* Deleted node functions */ LIBFDATA_EXTERN \ int libfdata_tree_node_is_deleted( libfdata_tree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_deleted( libfdata_tree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_deleted_sub_node( libfdata_tree_node_t *node, int sub_node_index, libcerror_error_t **error ); /* Leaf node functions */ int libfdata_tree_node_set_calculate_leaf_node_values( libfdata_tree_node_t *node, libcerror_error_t **error ); int libfdata_tree_node_read_leaf_node_values( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_is_leaf( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_leaf( libfdata_tree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_node_set_leaf_sub_node( libfdata_tree_node_t *node, int sub_node_index, libcerror_error_t **error ); int libfdata_tree_node_get_number_of_leaf_nodes( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ); int libfdata_tree_node_get_leaf_node_by_index( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_node_index, libfdata_tree_node_t **leaf_node, uint8_t read_flags, libcerror_error_t **error ); int libfdata_tree_node_get_number_of_deleted_leaf_nodes( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_deleted_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ); int libfdata_tree_node_get_deleted_leaf_node_by_index( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int deleted_leaf_node_index, libfdata_tree_node_t **deleted_leaf_node, uint8_t read_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_TREE_NODE_H ) */ libewf-20140807/libfdata/libfdata_types.h0000664000175000017500000000457113443450051022250 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_TYPES_H ) #define _LIBFDATA_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata * The definitions in are copied here * for local use of libfdata */ #if defined( HAVE_LOCAL_LIBFDATA ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libfdata_area {} libfdata_area_t; typedef struct libfdata_btree {} libfdata_btree_t; typedef struct libfdata_btree_node {} libfdata_btree_node_t; typedef struct libfdata_cache {} libfdata_cache_t; typedef struct libfdata_list {} libfdata_list_t; typedef struct libfdata_list_element {} libfdata_list_element_t; typedef struct libfdata_range_list {} libfdata_range_list_t; typedef struct libfdata_stream {} libfdata_stream_t; typedef struct libfdata_tree {} libfdata_tree_t; typedef struct libfdata_tree_node {} libfdata_tree_node_t; typedef struct libfdata_vector {} libfdata_vector_t; #else typedef intptr_t libfdata_area_t; typedef intptr_t libfdata_btree_t; typedef intptr_t libfdata_btree_node_t; typedef intptr_t libfdata_cache_t; typedef intptr_t libfdata_list_t; typedef intptr_t libfdata_list_element_t; typedef intptr_t libfdata_range_list_t; typedef intptr_t libfdata_stream_t; typedef intptr_t libfdata_tree_t; typedef intptr_t libfdata_tree_node_t; typedef intptr_t libfdata_vector_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBFDATA ) */ #endif /* !defined( _LIBFDATA_INTERNAL_TYPES_H ) */ libewf-20140807/libfdata/libfdata_area.c0000664000175000017500000011200713443450051022001 0ustar00lordyestalordyesta00000000000000/* * The area functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_area.h" #include "libfdata_definitions.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_mapped_range.h" #include "libfdata_range.h" #include "libfdata_segments_array.h" #include "libfdata_types.h" #include "libfdata_unused.h" /* Creates an area * Make sure the value area is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the area * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_area_initialize( libfdata_area_t **area, size64_t element_data_size, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_area_t *area, libfdata_cache_t *cache, off64_t element_value_offset, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_area_t *area, libfdata_cache_t *cache, off64_t element_value_offset, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_initialize"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } if( *area != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid area value already set.", function ); return( -1 ); } if( element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid element data size value zero or less.", function ); return( -1 ); } internal_area = memory_allocate_structure( libfdata_internal_area_t ); if( internal_area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create area.", function ); goto on_error; } if( memory_set( internal_area, 0, sizeof( libfdata_internal_area_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear area.", function ); memory_free( internal_area ); return( -1 ); } if( libcdata_array_initialize( &( internal_area->segments_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segments array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_area->mapped_ranges_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped ranges array.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_area->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); goto on_error; } internal_area->element_data_size = element_data_size; internal_area->flags |= flags; internal_area->data_handle = data_handle; internal_area->free_data_handle = free_data_handle; internal_area->clone_data_handle = clone_data_handle; internal_area->read_element_data = read_element_data; internal_area->write_element_data = write_element_data; *area = (libfdata_area_t *) internal_area; return( 1 ); on_error: if( internal_area != NULL ) { if( internal_area->segments_array != NULL ) { libcdata_array_free( &( internal_area->segments_array ), NULL, NULL ); } memory_free( internal_area ); } return( -1 ); } /* Frees an area * Returns 1 if successful or -1 on error */ int libfdata_area_free( libfdata_area_t **area, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_free"; int result = 1; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } if( *area != NULL ) { internal_area = (libfdata_internal_area_t *) *area; *area = NULL; if( libcdata_array_free( &( internal_area->segments_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free segments array.", function ); result = -1; } if( libcdata_array_free( &( internal_area->mapped_ranges_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free mapped ranges array.", function ); result = -1; } if( ( internal_area->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_area->data_handle != NULL ) { if( internal_area->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid area - missing free data handle function.", function ); result = -1; } else if( internal_area->free_data_handle( &( internal_area->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_area ); } return( result ); } /* Clones (duplicates) the area * Returns 1 if successful or -1 on error */ int libfdata_area_clone( libfdata_area_t **destination_area, libfdata_area_t *source_area, libcerror_error_t **error ) { libfdata_internal_area_t *internal_destination_area = NULL; libfdata_internal_area_t *internal_source_area = NULL; static char *function = "libfdata_area_clone"; if( destination_area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination area.", function ); return( -1 ); } if( *destination_area != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination area value already set.", function ); return( -1 ); } if( source_area == NULL ) { *destination_area = source_area; return( 1 ); } internal_source_area = (libfdata_internal_area_t *) source_area; /* TODO refactor to use libfdata_area_initialize this requires libcdata_array_copy_elements function */ internal_destination_area = memory_allocate_structure( libfdata_internal_area_t ); if( internal_destination_area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination area.", function ); goto on_error; } if( memory_set( internal_destination_area, 0, sizeof( libfdata_internal_area_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination area.", function ); memory_free( internal_destination_area ); return( -1 ); } if( internal_source_area->data_handle != NULL ) { if( internal_source_area->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source area - missing free data handle function.", function ); goto on_error; } if( internal_source_area->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source area - missing clone data handle function.", function ); goto on_error; } if( internal_source_area->clone_data_handle( &( internal_destination_area->data_handle ), internal_source_area->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data handle.", function ); goto on_error; } } if( libcdata_array_clone( &( internal_destination_area->segments_array ), internal_source_area->segments_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segments array.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_area->mapped_ranges_array ), internal_source_area->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination mapped ranges array.", function ); goto on_error; } internal_destination_area->element_data_size = internal_source_area->element_data_size; internal_destination_area->timestamp = internal_source_area->timestamp; internal_destination_area->flags = internal_source_area->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; internal_destination_area->data_handle = internal_source_area->data_handle; internal_destination_area->free_data_handle = internal_source_area->free_data_handle; internal_destination_area->clone_data_handle = internal_source_area->clone_data_handle; internal_destination_area->read_element_data = internal_source_area->read_element_data; internal_destination_area->write_element_data = internal_source_area->write_element_data; *destination_area = (libfdata_area_t *) internal_destination_area; return( 1 ); on_error: if( internal_destination_area != NULL ) { if( internal_destination_area->segments_array != NULL ) { libcdata_array_free( &( internal_destination_area->segments_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, NULL ); } if( ( internal_destination_area->data_handle != NULL ) && ( internal_source_area->free_data_handle != NULL ) ) { internal_source_area->free_data_handle( &( internal_destination_area->data_handle ), NULL ); } memory_free( internal_destination_area ); } return( -1 ); } /* Segment functions */ /* Empties the area * Returns 1 if successful or -1 on error */ int libfdata_area_empty( libfdata_area_t *area, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_empty"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libcdata_array_empty( internal_area->segments_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty segments array.", function ); return( -1 ); } if( libcdata_array_empty( internal_area->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty mapped ranges array.", function ); return( -1 ); } internal_area->size = 0; return( 1 ); } /* Resizes the area * Returns 1 if successful or -1 on error */ int libfdata_area_resize( libfdata_area_t *area, int number_of_segments, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_resize"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libcdata_array_resize( internal_area->segments_array, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize segments array.", function ); return( -1 ); } if( libcdata_array_resize( internal_area->mapped_ranges_array, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize mapped ranges array.", function ); return( -1 ); } internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Retrieves the number of segments of the area * Returns 1 if successful or -1 on error */ int libfdata_area_get_number_of_segments( libfdata_area_t *area, int *number_of_segments, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_get_number_of_segments"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libcdata_array_get_number_of_entries( internal_area->segments_array, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from segments array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the offset and size of a specific segment * Returns 1 if successful or -1 on error */ int libfdata_area_get_segment_by_index( libfdata_area_t *area, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_get_segment_by_index"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libfdata_segments_array_get_segment_by_index( internal_area->segments_array, segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d.", function, segment_index ); return( -1 ); } return( 1 ); } /* Sets the offset and size of a specific segment * Returns 1 if successful or -1 on error */ int libfdata_area_set_segment_by_index( libfdata_area_t *area, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_set_segment_by_index"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libfdata_segments_array_set_segment_by_index( internal_area->segments_array, internal_area->mapped_ranges_array, &( internal_area->size ), segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment: %d.", function, segment_index ); return( -1 ); } internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Prepends a segment * Returns 1 if successful or -1 on error */ int libfdata_area_prepend_segment( libfdata_area_t *area, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_prepend_segment"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libfdata_segments_array_prepend_segment( internal_area->segments_array, internal_area->mapped_ranges_array, &( internal_area->size ), segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend segment.", function ); return( -1 ); } internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Appends a segment * Returns 1 if successful or -1 on error */ int libfdata_area_append_segment( libfdata_area_t *area, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_append_segment"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( libfdata_segments_array_append_segment( internal_area->segments_array, internal_area->mapped_ranges_array, &( internal_area->size ), segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment.", function ); return( -1 ); } internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Area element functions */ /* Retrieves the element data size of the area * Returns 1 if successful or -1 on error */ int libfdata_area_get_element_data_size( libfdata_area_t *area, size64_t *element_data_size, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_get_element_data_size"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( element_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element data size.", function ); return( -1 ); } *element_data_size = internal_area->element_data_size; return( 1 ); } /* Area element value functions */ /* Retrieves the value an element at a specific offset * Returns 1 if successful or -1 on error */ int libfdata_area_get_element_value_at_offset( libfdata_area_t *area, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t element_value_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libfdata_internal_area_t *internal_area = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_area_get_element_value_at_offset"; off64_t cache_value_offset = (off64_t) -1; off64_t element_data_offset = (off64_t) -1; int64_t cache_value_timestamp = 0; uint32_t element_data_flags = 0; int cache_entry_index = -1; int cache_value_file_index = -1; int element_data_file_index = -1; int element_index = -1; int number_of_cache_entries = 0; int result = 0; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( internal_area->read_element_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid area - missing read element data function.", function ); return( -1 ); } if( internal_area->element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid area - element data size value out of bounds.", function ); return( -1 ); } if( ( internal_area->size == 0 ) || ( internal_area->size > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid area - size value out of bounds.", function ); return( -1 ); } if( ( (size64_t) element_value_offset > internal_area->size ) || ( (size64_t) element_value_offset > ( internal_area->size - internal_area->element_data_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element value offset value out of bounds.", function ); return( -1 ); } if( libfdata_segments_array_get_data_range_at_offset( internal_area->segments_array, element_value_offset, &element_data_offset, &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", function, element_value_offset ); return( -1 ); } if( segment_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment data range.", function ); return( -1 ); } element_data_file_index = segment_data_range->file_index; element_data_offset += segment_data_range->offset; element_data_flags = segment_data_range->flags; if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } element_index = (int) ( element_value_offset / internal_area->element_data_size ); if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { if( internal_area->calculate_cache_entry_index == NULL ) { cache_entry_index = element_index % number_of_cache_entries; } else { cache_entry_index = internal_area->calculate_cache_entry_index( element_index, element_data_file_index, element_data_offset, internal_area->element_data_size, element_data_flags, number_of_cache_entries ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( element_data_file_index == cache_value_file_index ) && ( element_data_offset == cache_value_offset ) && ( internal_area->timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (%d out of %d)\n", function, (intptr_t) cache, cache_entry_index, number_of_cache_entries ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading element data at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, element_data_offset, element_data_offset, internal_area->element_data_size ); } #endif if( internal_area->read_element_data( internal_area->data_handle, file_io_handle, area, cache, element_value_offset, element_data_file_index, element_data_offset, internal_area->element_data_size, element_data_flags, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read element data at offset: 0x%08" PRIx64 ".", function, element_data_offset ); return( -1 ); } if( internal_area->calculate_cache_entry_index == NULL ) { cache_entry_index = element_index % number_of_cache_entries; } else { cache_entry_index = internal_area->calculate_cache_entry_index( element_index, element_data_file_index, element_data_offset, internal_area->element_data_size, element_data_flags, number_of_cache_entries ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( element_data_file_index != cache_value_file_index ) || ( element_data_offset != cache_value_offset ) || ( internal_area->timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing cache value.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, element_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } return( 1 ); } /* Sets the value of a specific element * * If the flag LIBFDATA_AREA_ELEMENT_VALUE_FLAG_MANAGED is set the area * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_area_set_element_value_at_offset( libfdata_area_t *area, intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, libfdata_cache_t *cache, off64_t element_value_offset, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_area_set_element_value_at_offset"; off64_t element_data_offset = (off64_t) -1; uint32_t element_data_flags = 0; int cache_entry_index = -1; int element_data_file_index = -1; int element_index = -1; int number_of_cache_entries = 0; LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( internal_area->element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid area - element data size value out of bounds.", function ); return( -1 ); } if( ( internal_area->size == 0 ) || ( internal_area->size > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid area - size value out of bounds.", function ); return( -1 ); } if( ( (size64_t) element_value_offset > internal_area->size ) || ( (size64_t) element_value_offset > ( internal_area->size - internal_area->element_data_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element value offset value out of bounds.", function ); return( -1 ); } if( libfdata_segments_array_get_data_range_at_offset( internal_area->segments_array, element_value_offset, &element_data_offset, &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", function, element_value_offset ); return( -1 ); } if( segment_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment data range.", function ); return( -1 ); } element_data_file_index = segment_data_range->file_index; element_data_offset += segment_data_range->offset; element_data_flags = segment_data_range->flags; if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } element_index = (int) ( element_value_offset / internal_area->element_data_size ); if( internal_area->calculate_cache_entry_index == NULL ) { cache_entry_index = element_index % number_of_cache_entries; } else { cache_entry_index = internal_area->calculate_cache_entry_index( element_index, element_data_file_index, element_data_offset, internal_area->element_data_size, element_data_flags, number_of_cache_entries ); } if( libfcache_cache_set_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, element_data_file_index, element_data_offset, internal_area->timestamp, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache entry: %d.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int libfdata_area_get_size( libfdata_area_t *area, size64_t *size, libcerror_error_t **error ) { libfdata_internal_area_t *internal_area = NULL; static char *function = "libfdata_area_get_size"; if( area == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid area.", function ); return( -1 ); } internal_area = (libfdata_internal_area_t *) area; if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( ( internal_area->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_segments_array_calculate_mapped_ranges( internal_area->segments_array, internal_area->mapped_ranges_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); return( -1 ); } internal_area->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } *size = internal_area->size; return( 1 ); } libewf-20140807/libfdata/libfdata_range.h0000664000175000017500000000405613443450051022176 0ustar00lordyestalordyesta00000000000000/* * The range functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_RANGE_H ) #define _LIBFDATA_RANGE_H #include #include #include "libfdata_libcerror.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_range libfdata_range_t; struct libfdata_range { /* The file index */ int file_index; /* The offset */ off64_t offset; /* The size */ size64_t size; /* The flags */ uint32_t flags; }; int libfdata_range_initialize( libfdata_range_t **range, libcerror_error_t **error ); int libfdata_range_free( libfdata_range_t **range, libcerror_error_t **error ); int libfdata_range_clone( libfdata_range_t **destination_range, libfdata_range_t *source_range, libcerror_error_t **error ); int libfdata_range_get( libfdata_range_t *range, int *file_index, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); int libfdata_range_get_size( libfdata_range_t *range, size64_t *size, libcerror_error_t **error ); int libfdata_range_set( libfdata_range_t *range, int file_index, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_RANGE_H ) */ libewf-20140807/libfdata/libfdata_vector.c0000664000175000017500000013614413443450051022403 0ustar00lordyestalordyesta00000000000000/* * The vector functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_mapped_range.h" #include "libfdata_range.h" #include "libfdata_segments_array.h" #include "libfdata_types.h" #include "libfdata_unused.h" #include "libfdata_vector.h" /* Creates a vector * Make sure the value vector is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the vector * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_vector_initialize( libfdata_vector_t **vector, size64_t element_data_size, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_vector_t *vector, libfdata_cache_t *cache, int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_vector_t *vector, libfdata_cache_t *cache, int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_initialize"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } if( *vector != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid vector value already set.", function ); return( -1 ); } if( element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, "%s: invalid element data size value zero or less.", function ); return( -1 ); } internal_vector = memory_allocate_structure( libfdata_internal_vector_t ); if( internal_vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create vector.", function ); goto on_error; } if( memory_set( internal_vector, 0, sizeof( libfdata_internal_vector_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear vector.", function ); memory_free( internal_vector ); return( -1 ); } if( libcdata_array_initialize( &( internal_vector->segments_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segments array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_vector->mapped_ranges_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped ranges array.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_vector->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); goto on_error; } internal_vector->element_data_size = element_data_size; internal_vector->flags |= flags; internal_vector->data_handle = data_handle; internal_vector->free_data_handle = free_data_handle; internal_vector->clone_data_handle = clone_data_handle; internal_vector->read_element_data = read_element_data; internal_vector->write_element_data = write_element_data; *vector = (libfdata_vector_t *) internal_vector; return( 1 ); on_error: if( internal_vector != NULL ) { if( internal_vector->segments_array != NULL ) { libcdata_array_free( &( internal_vector->segments_array ), NULL, NULL ); } memory_free( internal_vector ); } return( -1 ); } /* Frees a vector * Returns 1 if successful or -1 on error */ int libfdata_vector_free( libfdata_vector_t **vector, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_free"; int result = 1; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } if( *vector != NULL ) { internal_vector = (libfdata_internal_vector_t *) *vector; *vector = NULL; if( libcdata_array_free( &( internal_vector->segments_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the segments array.", function ); result = -1; } if( libcdata_array_free( &( internal_vector->mapped_ranges_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the mapped ranges array.", function ); result = -1; } if( ( internal_vector->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_vector->data_handle != NULL ) { if( internal_vector->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid vector - missing free data handle function.", function ); result = -1; } else if( internal_vector->free_data_handle( &( internal_vector->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_vector ); } return( result ); } /* Clones (duplicates) the vector * Returns 1 if successful or -1 on error */ int libfdata_vector_clone( libfdata_vector_t **destination_vector, libfdata_vector_t *source_vector, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_destination_vector = NULL; libfdata_internal_vector_t *internal_source_vector = NULL; static char *function = "libfdata_vector_clone"; if( destination_vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination vector.", function ); return( -1 ); } if( *destination_vector != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination vector value already set.", function ); return( -1 ); } if( source_vector == NULL ) { *destination_vector = source_vector; return( 1 ); } internal_source_vector = (libfdata_internal_vector_t *) source_vector; internal_destination_vector = memory_allocate_structure( libfdata_internal_vector_t ); if( internal_destination_vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination vector.", function ); goto on_error; } if( memory_set( internal_destination_vector, 0, sizeof( libfdata_internal_vector_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination vector.", function ); memory_free( internal_destination_vector ); return( -1 ); } if( internal_source_vector->data_handle != NULL ) { if( internal_source_vector->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source vector - missing free data handle function.", function ); goto on_error; } if( internal_source_vector->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source vector - missing clone data handle function.", function ); goto on_error; } if( internal_source_vector->clone_data_handle( &( internal_destination_vector->data_handle ), internal_source_vector->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data handle.", function ); goto on_error; } } if( libcdata_array_clone( &( internal_destination_vector->segments_array ), internal_source_vector->segments_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segments array.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_vector->mapped_ranges_array ), internal_source_vector->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination mapped ranges array.", function ); goto on_error; } internal_destination_vector->element_data_size = internal_source_vector->element_data_size; internal_destination_vector->timestamp = internal_source_vector->timestamp; internal_destination_vector->flags = internal_source_vector->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; internal_destination_vector->data_handle = internal_source_vector->data_handle; internal_destination_vector->free_data_handle = internal_source_vector->free_data_handle; internal_destination_vector->clone_data_handle = internal_source_vector->clone_data_handle; internal_destination_vector->read_element_data = internal_source_vector->read_element_data; internal_destination_vector->write_element_data = internal_source_vector->write_element_data; *destination_vector = (libfdata_vector_t *) internal_destination_vector; return( 1 ); on_error: if( internal_destination_vector != NULL ) { if( internal_destination_vector->segments_array != NULL ) { libcdata_array_free( &( internal_destination_vector->segments_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, NULL ); } if( ( internal_destination_vector->data_handle != NULL ) && ( internal_source_vector->free_data_handle != NULL ) ) { internal_source_vector->free_data_handle( &( internal_destination_vector->data_handle ), NULL ); } memory_free( internal_destination_vector ); } return( -1 ); } /* Segment functions */ /* Empties the vector * Returns 1 if successful or -1 on error */ int libfdata_vector_empty( libfdata_vector_t *vector, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_empty"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libcdata_array_empty( internal_vector->segments_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty segments array.", function ); return( -1 ); } if( libcdata_array_empty( internal_vector->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty mapped ranges array.", function ); return( -1 ); } internal_vector->size = 0; return( 1 ); } /* Resizes the segments * Returns 1 if successful or -1 on error */ int libfdata_vector_resize( libfdata_vector_t *vector, int number_of_segments, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_resize"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libcdata_array_resize( internal_vector->segments_array, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize segments array.", function ); return( -1 ); } if( libcdata_array_resize( internal_vector->mapped_ranges_array, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize mapped ranges array.", function ); return( -1 ); } internal_vector->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Retrieves the number of segments of the vector * Returns 1 if successful or -1 on error */ int libfdata_vector_get_number_of_segments( libfdata_vector_t *vector, int *number_of_segments, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_get_number_of_segments"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libcdata_array_get_number_of_entries( internal_vector->segments_array, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from segments array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the offset and size of a specific segment * Returns 1 if successful or -1 on error */ int libfdata_vector_get_segment_by_index( libfdata_vector_t *vector, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_get_segment_by_index"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libfdata_segments_array_get_segment_by_index( internal_vector->segments_array, segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d.", function, segment_index ); return( -1 ); } return( 1 ); } /* Sets the offset and size of a specific segment * Returns 1 if successful or -1 on error */ int libfdata_vector_set_segment_by_index( libfdata_vector_t *vector, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_set_segment_by_index"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libfdata_segments_array_set_segment_by_index( internal_vector->segments_array, internal_vector->mapped_ranges_array, &( internal_vector->size ), segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment: %d.", function, segment_index ); return( -1 ); } internal_vector->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Prepends a segment * Returns 1 if successful or -1 on error */ int libfdata_vector_prepend_segment( libfdata_vector_t *vector, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_prepend_segment"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libfdata_segments_array_prepend_segment( internal_vector->segments_array, internal_vector->mapped_ranges_array, &( internal_vector->size ), segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend segment.", function ); return( -1 ); } internal_vector->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Appends a segment * Returns 1 if successful or -1 on error */ int libfdata_vector_append_segment( libfdata_vector_t *vector, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_append_segment"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( libfdata_segments_array_append_segment( internal_vector->segments_array, internal_vector->mapped_ranges_array, &( internal_vector->size ), segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment.", function ); return( -1 ); } return( 1 ); } /* Vector element functions */ /* Retrieves the element data size of the vector * Returns 1 if successful or -1 on error */ int libfdata_vector_get_element_data_size( libfdata_vector_t *vector, size64_t *element_data_size, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_get_element_data_size"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( element_data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element data size.", function ); return( -1 ); } *element_data_size = internal_vector->element_data_size; return( 1 ); } /* Retrieves the number of elements of the vector * Returns 1 if successful or -1 on error */ int libfdata_vector_get_number_of_elements( libfdata_vector_t *vector, int *number_of_elements, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_get_number_of_elements"; size64_t safe_number_of_elements = 0; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( internal_vector->element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - element data size value out of bounds.", function ); return( -1 ); } if( number_of_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of elements.", function ); return( -1 ); } safe_number_of_elements = internal_vector->size / internal_vector->element_data_size; if( ( internal_vector->size % internal_vector->element_data_size ) != 0 ) { safe_number_of_elements++; } if( safe_number_of_elements > (size64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of elements value out of bounds.", function ); return( -1 ); } *number_of_elements = (int) safe_number_of_elements; return( 1 ); } /* Mapped range functions */ /* Retrieves the element index for a specific offset * Returns 1 if successful or -1 on error */ int libfdata_vector_get_element_index_at_offset( libfdata_vector_t *vector, off64_t element_value_offset, int *element_index, off64_t *element_data_offset, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_vector_get_element_index_at_offset"; off64_t mapped_range_end_offset = 0; off64_t mapped_range_start_offset = 0; off64_t segment_data_offset = 0; size64_t mapped_range_size = 0; uint64_t calculated_element_index = 0; int initial_segment_index = 0; int number_of_segments = 0; int segment_index = 0; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) libfdata_range_t *segment_data_range = NULL; off64_t segment_offset = 0; size64_t segment_size = 0; uint32_t segment_flags = 0; int segment_file_index = -1; #endif if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( internal_vector->element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - element data size value out of bounds.", function ); return( -1 ); } if( internal_vector->size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - size value out of bounds.", function ); return( -1 ); } if( element_value_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid element value offset value less than zero.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element_data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element data offset.", function ); return( -1 ); } if( ( internal_vector->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_segments_array_calculate_mapped_ranges( internal_vector->segments_array, internal_vector->mapped_ranges_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges from segments array.", function ); return( -1 ); } internal_vector->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested offset: 0x%08" PRIx64 "\n", function, element_value_offset ); } #endif if( internal_vector->size == 0 ) { return( 0 ); } if( libcdata_array_get_number_of_entries( internal_vector->mapped_ranges_array, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from mapped ranges array.", function ); return( -1 ); } /* This assumes a fairly even distribution of the sizes of the segments */ initial_segment_index = (int) ( ( number_of_segments * element_value_offset ) / internal_vector->size ); /* Look for the corresponding segment upwards in the array */ for( segment_index = initial_segment_index; segment_index < number_of_segments; segment_index++ ) { if( libcdata_array_get_entry_by_index( internal_vector->mapped_ranges_array, segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, segment_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, &mapped_range_start_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, segment_index ); return( -1 ); } mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; if( mapped_range_end_offset < mapped_range_start_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment: %d - mapped range value out of bounds.", function, segment_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, segment_index, mapped_range_start_offset, mapped_range_end_offset, mapped_range_size ); } #endif /* Check if the element value offset is in the mapped range */ if( ( element_value_offset >= mapped_range_start_offset ) && ( element_value_offset < mapped_range_end_offset ) ) { break; } /* Check if the element value offset is out of bounds */ if( element_value_offset < mapped_range_start_offset ) { segment_index = number_of_segments; break; } } if( segment_index >= number_of_segments ) { /* Look for the corresponding segment downwards in the array */ for( segment_index = initial_segment_index; segment_index >= 0; segment_index-- ) { if( libcdata_array_get_entry_by_index( internal_vector->mapped_ranges_array, segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, segment_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, &mapped_range_start_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, segment_index ); return( -1 ); } mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; if( mapped_range_end_offset < mapped_range_start_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment: %d - mapped range value out of bounds.", function, segment_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, segment_index, mapped_range_start_offset, mapped_range_end_offset, mapped_range_size ); } #endif /* Check if the element value offset is in the mapped range */ if( ( element_value_offset >= mapped_range_start_offset ) && ( element_value_offset < mapped_range_end_offset ) ) { break; } /* Check if the element value offset is out of bounds */ if( element_value_offset > mapped_range_start_offset ) { segment_index = -1; break; } segment_data_offset += (off64_t) mapped_range_size; } } if( ( segment_index >= 0 ) && ( segment_index < number_of_segments ) ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libcdata_array_get_entry_by_index( internal_vector->segments_array, segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, segment_index ); return( -1 ); } libcnotify_printf( "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, segment_index, segment_file_index, segment_offset, segment_offset + segment_size, segment_size ); } #endif calculated_element_index = (uint64_t) element_value_offset / internal_vector->element_data_size; if( calculated_element_index > (uint64_t) INT_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid element index value exceeds maximum.", function ); return( -1 ); } /* The element data offset is relative from the start of the vector element not the underlying segment */ *element_index = (int) calculated_element_index; *element_data_offset = element_value_offset % internal_vector->element_data_size; result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); } /* Vector element value functions */ /* Retrieves the value of a specific element * Returns 1 if successful or -1 on error */ int libfdata_vector_get_element_value_by_index( libfdata_vector_t *vector, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libfdata_internal_vector_t *internal_vector = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_vector_get_element_value_by_index"; off64_t cache_value_offset = (off64_t) -1; off64_t element_data_offset = 0; int64_t cache_value_timestamp = 0; uint32_t element_data_flags = 0; int cache_value_file_index = -1; int element_data_file_index = -1; int result = 0; #if defined( HAVE_DEBUG_OUTPUT ) const char *hit_or_miss = NULL; #endif if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( internal_vector->read_element_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid vector - missing read element data function.", function ); return( -1 ); } if( internal_vector->element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - element data size value out of bounds.", function ); return( -1 ); } if( ( internal_vector->size == 0 ) || ( internal_vector->size > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - size value out of bounds.", function ); return( -1 ); } if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } element_data_offset = (off64_t) ( element_index * internal_vector->element_data_size ); if( (size64_t) element_data_offset > internal_vector->size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( libfdata_segments_array_get_data_range_at_offset( internal_vector->segments_array, element_data_offset, &element_data_offset, &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", function, element_data_offset ); return( -1 ); } if( segment_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment data range.", function ); return( -1 ); } element_data_file_index = segment_data_range->file_index; element_data_offset += segment_data_range->offset; element_data_flags = segment_data_range->flags; if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { result = libfcache_cache_get_value_by_identifier( (libfcache_cache_t *) cache, element_data_file_index, element_data_offset, internal_vector->timestamp, &cache_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from cache.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { hit_or_miss = "miss"; } else { hit_or_miss = "hit"; } libcnotify_printf( "%s: cache: 0x%08" PRIjx " %s\n", function, (intptr_t) cache, hit_or_miss ); } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading element data at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, element_data_offset, element_data_offset, internal_vector->element_data_size ); } #endif if( internal_vector->read_element_data( internal_vector->data_handle, file_io_handle, vector, cache, element_index, element_data_file_index, element_data_offset, internal_vector->element_data_size, element_data_flags, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read element data at offset: 0x%08" PRIx64 ".", function, element_data_offset ); return( -1 ); } if( libfcache_cache_get_value_by_identifier( (libfcache_cache_t *) cache, element_data_file_index, element_data_offset, internal_vector->timestamp, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from cache.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } if( ( element_data_file_index != cache_value_file_index ) || ( element_data_offset != cache_value_offset ) || ( internal_vector->timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid cache value - identifier value out of bounds.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, element_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value.", function ); return( -1 ); } return( 1 ); } /* Retrieves the value an element at a specific offset * Returns 1 if successful or -1 on error */ int libfdata_vector_get_element_value_at_offset( libfdata_vector_t *vector, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t element_value_offset, off64_t *element_data_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { static char *function = "libfdata_vector_get_element_value_at_offset"; int element_index = 0; if( libfdata_vector_get_element_index_at_offset( vector, element_value_offset, &element_index, element_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element index at offset: 0x%08" PRIx64 ".", function, element_value_offset ); return( -1 ); } if( libfdata_vector_get_element_value_by_index( vector, file_io_handle, cache, element_index, element_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element: %d value.", function, element_index ); return( -1 ); } return( 1 ); } /* Sets the value of a specific element * * If the flag LIBFDATA_VECTOR_ELEMENT_VALUE_FLAG_MANAGED is set the vector * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_vector_set_element_value_by_index( libfdata_vector_t *vector, intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, libfdata_cache_t *cache, int element_index, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_vector_set_element_value_by_index"; off64_t element_data_offset = 0; LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( internal_vector->element_data_size == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - element data size value out of bounds.", function ); return( -1 ); } if( ( internal_vector->size == 0 ) || ( internal_vector->size > (off64_t) INT64_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid vector - size value out of bounds.", function ); return( -1 ); } if( element_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } element_data_offset = (off64_t) ( element_index * internal_vector->element_data_size ); if( (size64_t) element_data_offset > internal_vector->size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( libfdata_segments_array_get_data_range_at_offset( internal_vector->segments_array, element_data_offset, &element_data_offset, &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", function, element_data_offset ); return( -1 ); } if( segment_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing segment data range.", function ); return( -1 ); } element_data_offset += segment_data_range->offset; if( libfcache_cache_set_value_by_identifier( (libfcache_cache_t *) cache, segment_data_range->file_index, element_data_offset, internal_vector->timestamp, element_value, free_element_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache.", function ); return( -1 ); } return( 1 ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int libfdata_vector_get_size( libfdata_vector_t *vector, size64_t *size, libcerror_error_t **error ) { libfdata_internal_vector_t *internal_vector = NULL; static char *function = "libfdata_vector_get_size"; if( vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid vector.", function ); return( -1 ); } internal_vector = (libfdata_internal_vector_t *) vector; if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( ( internal_vector->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_segments_array_calculate_mapped_ranges( internal_vector->segments_array, internal_vector->mapped_ranges_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); return( -1 ); } internal_vector->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } *size = internal_vector->size; return( 1 ); } libewf-20140807/libfdata/libfdata_stream.h0000664000175000017500000002251613443450051022376 0ustar00lordyestalordyesta00000000000000/* * The stream functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_STREAM_H ) #define _LIBFDATA_INTERNAL_STREAM_H #include #include #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_mapped_range.h" #include "libfdata_range.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_stream libfdata_internal_stream_t; struct libfdata_internal_stream { /* The current segment index */ int current_segment_index; /* The current offset */ off64_t current_offset; /* The (current) segment data offset */ off64_t segment_data_offset; /* The (stream) size */ size64_t size; /* The mapped (stream) size */ size64_t mapped_size; /* The segments array */ libcdata_array_t *segments_array; /* The mapped ranges array */ libcdata_array_t *mapped_ranges_array; /* The flags */ uint8_t flags; /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The create segment function */ int (*create_segment)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); /* The read segment data function */ ssize_t (*read_segment_data)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t read_flags, libcerror_error_t **error ); /* The write segment data function */ ssize_t (*write_segment_data)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, const uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t write_flags, libcerror_error_t **error ); /* The seek segment offset function */ off64_t (*seek_segment_offset)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, off64_t segment_offset, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_stream_initialize( libfdata_stream_t **stream, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*create_segment)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ), ssize_t (*read_segment_data)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t read_flags, libcerror_error_t **error ), ssize_t (*write_segment_data)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, const uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t write_flags, libcerror_error_t **error ), off64_t (*seek_segment_offset)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, off64_t segment_offset, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_free( libfdata_stream_t **stream, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_clone( libfdata_stream_t **destination_stream, libfdata_stream_t *source_stream, libcerror_error_t **error ); /* Segment functions */ LIBFDATA_EXTERN \ int libfdata_stream_empty( libfdata_stream_t *stream, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_resize( libfdata_stream_t *stream, int number_of_segments, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_reverse( libfdata_stream_t *stream, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_get_number_of_segments( libfdata_stream_t *stream, int *number_of_segments, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_get_segment_by_index( libfdata_stream_t *stream, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_set_segment_by_index( libfdata_stream_t *stream, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_prepend_segment( libfdata_stream_t *stream, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_append_segment( libfdata_stream_t *stream, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_set_mapped_size( libfdata_stream_t *stream, size64_t mapped_size, libcerror_error_t **error ); /* Mapped range functions */ LIBFDATA_EXTERN \ int libfdata_stream_get_segment_mapped_range( libfdata_stream_t *stream, int segment_index, off64_t *mapped_range_offset, size64_t *mapped_range_size, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_get_segment_index_at_offset( libfdata_stream_t *stream, off64_t offset, int *segment_index, off64_t *segment_data_offset, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_get_segment_at_offset( libfdata_stream_t *stream, off64_t offset, int *segment_index, off64_t *segment_data_offset, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); /* IO functions */ LIBFDATA_EXTERN \ ssize_t libfdata_stream_read_buffer( libfdata_stream_t *stream, intptr_t *file_io_handle, uint8_t *buffer, size_t buffer_size, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ ssize_t libfdata_stream_read_buffer_at_offset( libfdata_stream_t *stream, intptr_t *file_io_handle, uint8_t *buffer, size_t buffer_size, off64_t offset, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ ssize_t libfdata_stream_write_buffer( libfdata_stream_t *stream, intptr_t *file_io_handle, const uint8_t *buffer, size_t buffer_size, uint8_t write_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ off64_t libfdata_stream_seek_offset( libfdata_stream_t *stream, off64_t offset, int whence, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_get_offset( libfdata_stream_t *stream, off64_t *offset, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_stream_get_size( libfdata_stream_t *stream, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_STREAM_H ) */ libewf-20140807/libfdata/libfdata_vector.h0000664000175000017500000001720413443450051022403 0ustar00lordyestalordyesta00000000000000/* * The vector functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_VECTOR_H ) #define _LIBFDATA_INTERNAL_VECTOR_H #include #include #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_vector libfdata_internal_vector_t; struct libfdata_internal_vector { /* The element data size */ size64_t element_data_size; /* The (vector) size */ size64_t size; /* The segments array */ libcdata_array_t *segments_array; /* The mapped ranges array */ libcdata_array_t *mapped_ranges_array; /* The timestamp */ int64_t timestamp; /* The flags */ uint8_t flags; /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The read element data function */ int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_vector_t *vector, libfdata_cache_t *cache, int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ); /* The write element data function */ int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_vector_t *vector, libfdata_cache_t *cache, int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_vector_initialize( libfdata_vector_t **vector, size64_t element_data_size, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_vector_t *vector, libfdata_cache_t *cache, int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_vector_t *vector, libfdata_cache_t *cache, int element_index, int element_data_file_index, off64_t element_data_offset, size64_t element_data_size, uint32_t element_data_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_free( libfdata_vector_t **vector, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_clone( libfdata_vector_t **destination_vector, libfdata_vector_t *source_vector, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_empty( libfdata_vector_t *vector, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_resize( libfdata_vector_t *vector, int number_of_segments, libcerror_error_t **error ); /* Segment functions */ LIBFDATA_EXTERN \ int libfdata_vector_get_number_of_segments( libfdata_vector_t *vector, int *number_of_segments, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_get_segment_by_index( libfdata_vector_t *vector, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_set_segment_by_index( libfdata_vector_t *vector, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_prepend_segment( libfdata_vector_t *vector, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_append_segment( libfdata_vector_t *vector, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ); /* Vector element functions */ LIBFDATA_EXTERN \ int libfdata_vector_get_element_data_size( libfdata_vector_t *vector, size64_t *element_data_size, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_get_number_of_elements( libfdata_vector_t *vector, int *number_of_elements, libcerror_error_t **error ); /* Mapped range functions */ LIBFDATA_EXTERN \ int libfdata_vector_get_element_index_at_offset( libfdata_vector_t *vector, off64_t element_value_offset, int *element_index, off64_t *element_data_offset, libcerror_error_t **error ); /* Vector element value functions */ LIBFDATA_EXTERN \ int libfdata_vector_get_element_value_by_index( libfdata_vector_t *vector, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_get_element_value_at_offset( libfdata_vector_t *vector, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t element_value_offset, off64_t *element_data_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_vector_set_element_value_by_index( libfdata_vector_t *vector, intptr_t *file_io_handle, libfdata_cache_t *cache, int element_index, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); /* IO functions */ LIBFDATA_EXTERN \ int libfdata_vector_get_size( libfdata_vector_t *vector, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_VECTOR_H ) */ libewf-20140807/libfdata/libfdata_btree.h0000664000175000017500000002470213443450051022203 0ustar00lordyestalordyesta00000000000000/* * The balanced tree functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_BTREE_H ) #define _LIBFDATA_INTERNAL_BTREE_H #include #include #include "libfdata_btree_node.h" #include "libfdata_btree_range.h" #include "libfdata_extern.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_btree libfdata_internal_btree_t; struct libfdata_internal_btree { /* The root node data range */ libfdata_btree_range_t *root_node_data_range; /* The timestamp */ int64_t timestamp; /* The flags */ uint8_t flags; /* The calculate node cache entry index value */ int (*calculate_node_cache_entry_index)( libfdata_btree_t *tree, libfdata_cache_t *cache, int level, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, int *cache_entry_index, libcerror_error_t **error ); /* The calculate leaf value cache entry index value */ int (*calculate_leaf_value_cache_entry_index)( libfdata_btree_t *tree, libfdata_cache_t *cache, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, int *cache_entry_index, libcerror_error_t **error ); /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The read node function */ int (*read_node)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_btree_node_t *node, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, intptr_t *key_value, uint8_t read_flags, libcerror_error_t **error ); /* The read leaf value function */ int (*read_leaf_value)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_btree_t *tree, libfdata_cache_t *cache, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, uint8_t read_flags, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_btree_initialize( libfdata_btree_t **tree, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_node)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_btree_node_t *node, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, intptr_t *key_value, uint8_t read_flags, libcerror_error_t **error ), int (*read_leaf_value)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_btree_t *tree, libfdata_cache_t *cache, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_free( libfdata_btree_t **tree, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_clone( libfdata_btree_t **destination_tree, libfdata_btree_t *source_tree, libcerror_error_t **error ); /* Cache entry functions */ int libfdata_btree_calculate_node_cache_entry_index( libfdata_btree_t *tree, libfdata_cache_t *cache, int level, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, int *cache_entry_index, libcerror_error_t **error ); int libfdata_btree_calculate_leaf_value_cache_entry_index( libfdata_btree_t *tree, libfdata_cache_t *cache, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, int *cache_entry_index, libcerror_error_t **error ); /* Root node functions */ LIBFDATA_EXTERN \ int libfdata_btree_get_root_node( libfdata_btree_t *tree, int *node_data_file_index, off64_t *node_data_offset, size64_t *node_data_size, uint32_t *node_data_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_set_root_node( libfdata_btree_t *tree, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, libcerror_error_t **error ); /* Leaf value functions */ int libfdata_btree_read_leaf_value( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *leaf_value_data_range, intptr_t **leaf_value, uint8_t read_flags, libcerror_error_t **error ); int libfdata_btree_read_node( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int level, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ); int libfdata_btree_read_sub_tree( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int level, int mapped_first_leaf_value_index, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ); int libfdata_btree_get_leaf_node_by_index( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int level, int leaf_value_index, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ); int libfdata_btree_get_leaf_node_by_key( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int maximum_node_level, int current_node_level, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *node_index, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ); int libfdata_btree_get_next_leaf_node_by_key( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int node_index, libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *next_node_index, libfdata_btree_node_t **next_node, uint8_t read_flags, libcerror_error_t **error ); int libfdata_btree_get_previous_leaf_node_by_key( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int node_index, libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *previous_node_index, libfdata_btree_node_t **previous_node, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_get_number_of_leaf_values( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_values, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_get_leaf_value_by_index( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_value_index, intptr_t **value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_set_leaf_value_by_index( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_value_index, intptr_t *leaf_value, int (*free_leaf_value)( intptr_t **leaf_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_get_leaf_value_by_key( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), uint8_t search_flags, intptr_t **value, uint8_t read_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_BTREE_H ) */ libewf-20140807/libfdata/libfdata_tree.h0000664000175000017500000001471213443450051022041 0ustar00lordyestalordyesta00000000000000/* * The tree functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_TREE_H ) #define _LIBFDATA_INTERNAL_TREE_H #include #include #include "libfdata_extern.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_tree libfdata_internal_tree_t; struct libfdata_internal_tree { /* The root node */ libfdata_tree_node_t *root_node; /* The flags */ uint8_t flags; /* The calculate cache entry index value */ int (*calculate_cache_entry_index)( int node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, int number_of_cache_entries ); /* The data handle */ intptr_t *data_handle; /* The free data handle function */ int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ); /* The clone (duplicate) data handle function */ int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ); /* The read node function */ int (*read_node)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_tree_node_t *node, libfdata_cache_t *cache, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, uint8_t read_flags, libcerror_error_t **error ); /* The read sub nodes function */ int (*read_sub_nodes)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_tree_node_t *node, libfdata_cache_t *cache, int sub_nodes_file_index, off64_t sub_nodes_offset, size64_t sub_nodes_size, uint32_t sub_nodes_flags, uint8_t read_flags, libcerror_error_t **error ); }; LIBFDATA_EXTERN \ int libfdata_tree_initialize( libfdata_tree_t **tree, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_node)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_tree_node_t *node, libfdata_cache_t *cache, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, uint8_t read_flags, libcerror_error_t **error ), int (*read_sub_nodes)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_tree_node_t *node, libfdata_cache_t *cache, int sub_nodes_file_index, off64_t sub_nodes_offset, size64_t sub_nodes_size, uint32_t sub_nodes_flags, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_free( libfdata_tree_t **tree, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_clone( libfdata_tree_t **destination_tree, libfdata_tree_t *source_tree, libcerror_error_t **error ); /* Node value functions */ int libfdata_tree_get_node_value( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_tree_node_t *node, intptr_t **node_value, uint8_t read_flags, libcerror_error_t **error ); int libfdata_tree_set_node_value( libfdata_tree_t *tree, libfdata_cache_t *cache, libfdata_tree_node_t *node, intptr_t *node_value, int (*free_node_value)( intptr_t **node_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ); /* Sub node functions */ int libfdata_tree_read_sub_nodes( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_tree_node_t *node, uint8_t read_flags, libcerror_error_t **error ); /* Root node functions */ LIBFDATA_EXTERN \ int libfdata_tree_get_root_node( libfdata_tree_t *tree, libfdata_tree_node_t **root_node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_set_root_node( libfdata_tree_t *tree, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ); /* Leaf node functions */ LIBFDATA_EXTERN \ int libfdata_tree_get_number_of_leaf_nodes( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_get_leaf_node_by_index( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_node_index, libfdata_tree_node_t **leaf_node, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_get_number_of_deleted_leaf_nodes( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_deleted_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_tree_get_deleted_leaf_node_by_index( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int deleted_leaf_node_index, libfdata_tree_node_t **deleted_leaf_node, uint8_t read_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_TREE_H ) */ libewf-20140807/libfdata/libfdata_support.h0000664000175000017500000000232013443450051022606 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_SUPPORT_H ) #define _LIBFDATA_SUPPORT_H #include #include #include "libfdata_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFDATA ) LIBFDATA_EXTERN \ const char *libfdata_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_SUPPORT_H ) */ libewf-20140807/libfdata/libfdata_libfcache.h0000664000175000017500000000264313443450051023002 0ustar00lordyestalordyesta00000000000000/* * The libfcache header wrapper * * Copyright (C) 2010-2018, 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( _LIBFDATA_LIBFCACHE_H ) #define _LIBFDATA_LIBFCACHE_H #include /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache */ #if defined( HAVE_LOCAL_LIBFCACHE ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBFCACHE_DLL_IMPORT * before including libfcache.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBFCACHE_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBFCACHE ) */ #endif /* !defined( _LIBFDATA_LIBFCACHE_H ) */ libewf-20140807/libfdata/libfdata_libcerror.h0000664000175000017500000000264013443450051023062 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2010-2018, 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( _LIBFDATA_LIBCERROR_H ) #define _LIBFDATA_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBFDATA_LIBCERROR_H ) */ libewf-20140807/libfdata/libfdata_range_list.c0000664000175000017500000007423513443450051023232 0ustar00lordyestalordyesta00000000000000/* * The range list functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_list.h" #include "libfdata_list_element.h" #include "libfdata_range_list.h" #include "libfdata_types.h" /* Creates a range list * Make sure the value range_list is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the range list * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_range_list_initialize( libfdata_range_list_t **range_list, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, uint8_t read_flags, libcerror_error_t **error ), int (*write_element_data)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_list_element_t *list_element, libfdata_cache_t *cache, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, uint8_t write_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libfdata_range_list_initialize"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( *range_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid range list value already set.", function ); return( -1 ); } if( ( flags & 0xfe ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function ); return( -1 ); } internal_range_list = memory_allocate_structure( libfdata_internal_range_list_t ); if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create range list.", function ); goto on_error; } if( memory_set( internal_range_list, 0, sizeof( libfdata_internal_range_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear range list.", function ); memory_free( internal_range_list ); return( -1 ); } if( libcdata_range_list_initialize( &( internal_range_list->elements_range_list ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create elements range list.", function ); goto on_error; } internal_range_list->flags |= flags; internal_range_list->data_handle = data_handle; internal_range_list->free_data_handle = free_data_handle; internal_range_list->clone_data_handle = clone_data_handle; internal_range_list->read_element_data = read_element_data; internal_range_list->write_element_data = write_element_data; *range_list = (libfdata_range_list_t *) internal_range_list; return( 1 ); on_error: if( internal_range_list != NULL ) { if( internal_range_list->elements_range_list != NULL ) { libcdata_range_list_free( &( internal_range_list->elements_range_list ), NULL, NULL ); } memory_free( internal_range_list ); } return( -1 ); } /* Frees a range list * Returns 1 if successful or -1 on error */ int libfdata_range_list_free( libfdata_range_list_t **range_list, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libfdata_range_list_free"; int result = 1; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *range_list != NULL ) { internal_range_list = (libfdata_internal_range_list_t *) *range_list; *range_list = NULL; if( libcdata_range_list_free( &( internal_range_list->elements_range_list ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the elements range list.", function ); result = -1; } if( ( internal_range_list->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_range_list->data_handle != NULL ) { if( internal_range_list->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid range list - missing free data handle function.", function ); result = -1; } else if( internal_range_list->free_data_handle( &( internal_range_list->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_range_list ); } return( result ); } /* Clones (duplicates) the range list * Returns 1 if successful or -1 on error */ int libfdata_range_list_clone( libfdata_range_list_t **destination_range_list, libfdata_range_list_t *source_range_list, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_destination_range_list = NULL; libfdata_internal_range_list_t *internal_source_range_list = NULL; static char *function = "libfdata_range_list_clone"; if( destination_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range list.", function ); return( -1 ); } if( *destination_range_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination range list value already set.", function ); return( -1 ); } if( source_range_list == NULL ) { *destination_range_list = NULL; return( 1 ); } internal_source_range_list = (libfdata_internal_range_list_t *) source_range_list; internal_destination_range_list = memory_allocate_structure( libfdata_internal_range_list_t ); if( internal_destination_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination range list.", function ); goto on_error; } if( memory_set( internal_destination_range_list, 0, sizeof( libfdata_internal_range_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination range list.", function ); memory_free( internal_destination_range_list ); return( -1 ); } if( internal_source_range_list->data_handle != NULL ) { if( internal_source_range_list->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source range list - missing free data handle function.", function ); goto on_error; } if( internal_source_range_list->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source range list - missing clone data handle function.", function ); goto on_error; } if( internal_source_range_list->clone_data_handle( &( internal_destination_range_list->data_handle ), internal_source_range_list->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data handle.", function ); goto on_error; } } if( libcdata_range_list_clone( &( internal_destination_range_list->elements_range_list ), internal_source_range_list->elements_range_list, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_list_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination elements range list.", function ); goto on_error; } internal_destination_range_list->flags = internal_source_range_list->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; internal_destination_range_list->free_data_handle = internal_source_range_list->free_data_handle; internal_destination_range_list->clone_data_handle = internal_source_range_list->clone_data_handle; internal_destination_range_list->read_element_data = internal_source_range_list->read_element_data; internal_destination_range_list->write_element_data = internal_source_range_list->write_element_data; *destination_range_list = (libfdata_range_list_t *) internal_destination_range_list; return( 1 ); on_error: if( internal_destination_range_list != NULL ) { if( ( internal_destination_range_list->data_handle != NULL ) && ( internal_source_range_list->free_data_handle != NULL ) ) { internal_source_range_list->free_data_handle( &( internal_destination_range_list->data_handle ), NULL ); } memory_free( internal_destination_range_list ); } return( -1 ); } /* List elements functions */ /* Empties the range list * Returns 1 if successful or -1 on error */ int libfdata_range_list_empty( libfdata_range_list_t *range_list, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libfdata_range_list_empty"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libfdata_internal_range_list_t *) range_list; if( libcdata_range_list_empty( internal_range_list->elements_range_list, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to empty elements range list.", function ); return( -1 ); } return( 1 ); } /* Mapped range functions */ /* Retrieves the list element for a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_range_list_get_list_element_at_offset( libfdata_range_list_t *range_list, off64_t offset, off64_t *element_data_offset, libfdata_list_element_t **element, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; libfdata_list_t *list = NULL; static char *function = "libfdata_range_list_get_list_element_at_offset"; off64_t mapped_range_offset = 0; size64_t mapped_range_size = 0; int element_index = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libfdata_internal_range_list_t *) range_list; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested offset: 0x%08" PRIx64 "\n", function, offset ); } #endif result = libcdata_range_list_get_range_at_offset( internal_range_list->elements_range_list, (uint64_t) offset, (uint64_t *) &mapped_range_offset, (uint64_t *) &mapped_range_size, (intptr_t **) &list, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, mapped_range_offset, mapped_range_offset + mapped_range_size, mapped_range_size ); } #endif result = libfdata_list_get_list_element_at_offset( list, offset, &element_index, element_data_offset, element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element from list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - element missing for offset: %" PRIi64 ".", function, offset ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); } /* Retrieves the data range of an element at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_range_list_get_element_at_offset( libfdata_range_list_t *range_list, off64_t offset, off64_t *element_data_offset, int *element_file_index, off64_t *element_offset, size64_t *element_size, uint32_t *element_flags, libcerror_error_t **error ) { libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_list_get_element_at_offset"; int result = 0; result = libfdata_range_list_get_list_element_at_offset( range_list, offset, element_data_offset, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element at offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { if( libfdata_list_element_get_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range of list element at offset: %" PRIi64 ".", function, offset ); return( -1 ); } } return( result ); } /* Inserts an element data range based on its mapped range * Returns 1 if successful or -1 on error */ int libfdata_range_list_insert_element( libfdata_range_list_t *range_list, off64_t offset, size64_t size, int element_file_index, off64_t element_offset, size64_t element_size, uint32_t element_flags, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; libfdata_list_t *list = NULL; libfdata_list_element_t *list_element = NULL; static char *function = "libfdata_range_list_insert_element"; off64_t element_data_offset = 0; off64_t mapped_range_offset = 0; size64_t element_mapped_size = 0; size64_t mapped_range_size = 0; int element_index = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libfdata_internal_range_list_t *) range_list; if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } if( size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: file index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, element_file_index, element_offset, element_offset + element_size, element_size ); libcnotify_printf( "%s: requested range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, offset, offset + size, size ); } #endif result = libcdata_range_list_get_range_at_offset( internal_range_list->elements_range_list, (uint64_t) offset, (uint64_t *) &mapped_range_offset, (uint64_t *) &mapped_range_size, (intptr_t **) &list, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, mapped_range_offset, mapped_range_offset + mapped_range_size, mapped_range_size ); } #endif result = libfdata_list_get_list_element_at_offset( list, offset, &element_index, &element_data_offset, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element from list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - element missing for offset: %" PRIi64 ".", function, offset ); return( -1 ); } if( element_data_offset != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } if( libfdata_list_element_get_mapped_size( list_element, &element_mapped_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve mapped size from list element at offset: %" PRIi64 ".", function, offset ); return( -1 ); } if( size != element_mapped_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid size value out of bounds.", function ); return( -1 ); } if( libfdata_list_element_set_data_range( list_element, element_file_index, element_offset, element_size, element_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set data range in list element at offset: %" PRIi64 ".", function, offset ); return( -1 ); } } else { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: no mapped range found.\n", function ); } #endif if( libfdata_list_initialize( &list, internal_range_list->data_handle, internal_range_list->free_data_handle, internal_range_list->clone_data_handle, internal_range_list->read_element_data, internal_range_list->write_element_data, LIBFDATA_DATA_HANDLE_FLAG_NON_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list.", function ); return( -1 ); } if( libfdata_list_set_mapped_offset( list, offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped offset in list.", function ); libfdata_list_free( &list, NULL ); return( -1 ); } if( libfdata_list_append_element_with_mapped_size( list, &element_index, element_file_index, element_offset, element_size, element_flags, size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append element to list.", function ); libfdata_list_free( &list, NULL ); return( -1 ); } if( libcdata_range_list_insert_range( internal_range_list->elements_range_list, (uint64_t) offset, (uint64_t) size, (intptr_t *) list, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, (int (*)(intptr_t *, intptr_t *, libcerror_error_t **)) &libfdata_list_append_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert range in elements range list.", function ); libfdata_list_free( &list, NULL ); return( -1 ); } list = NULL; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( 1 ); } /* List element value functions */ /* Retrieves the value an element at a specific offset * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_range_list_get_element_value_at_offset( libfdata_range_list_t *range_list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, off64_t *element_data_offset, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; libfdata_list_t *list = NULL; static char *function = "libfdata_range_list_get_element_value_at_offset"; off64_t mapped_range_offset = 0; size64_t mapped_range_size = 0; int element_index = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libfdata_internal_range_list_t *) range_list; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested offset: 0x%08" PRIx64 "\n", function, offset ); } #endif result = libcdata_range_list_get_range_at_offset( internal_range_list->elements_range_list, (uint64_t) offset, (uint64_t *) &mapped_range_offset, (uint64_t *) &mapped_range_size, (intptr_t **) &list, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, mapped_range_offset, mapped_range_offset + mapped_range_size, mapped_range_size ); } #endif result = libfdata_list_get_element_value_at_offset( list, file_io_handle, cache, offset, &element_index, element_data_offset, element_value, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve element value from list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - element value missing for offset: %" PRIi64 ".", function, offset ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); } /* Sets the value of an element at a specific offset * * If the flag LIBFDATA_RANGE_LIST_VALUE_FLAG_MANAGED is set the list * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_range_list_set_element_value_at_offset( libfdata_range_list_t *range_list, intptr_t *file_io_handle, libfdata_cache_t *cache, off64_t offset, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_range_list_t *internal_range_list = NULL; libfdata_list_t *list = NULL; static char *function = "libfdata_range_list_set_element_value_at_offset"; off64_t mapped_range_offset = 0; size64_t mapped_range_size = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libfdata_internal_range_list_t *) range_list; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested offset: 0x%08" PRIx64 "\n", function, offset ); } #endif result = libcdata_range_list_get_range_at_offset( internal_range_list->elements_range_list, (uint64_t) offset, (uint64_t *) &mapped_range_offset, (uint64_t *) &mapped_range_size, (intptr_t **) &list, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, mapped_range_offset, mapped_range_offset + mapped_range_size, mapped_range_size ); } #endif result = libfdata_list_set_element_value_at_offset( list, file_io_handle, cache, offset, element_value, free_element_value, write_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set element value in list for offset: %" PRIi64 ".", function, offset ); return( -1 ); } else if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - element value missing for offset: %" PRIi64 ".", function, offset ); return( -1 ); } } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); } libewf-20140807/libfdata/libfdata_btree_range.h0000664000175000017500000000543513443450051023361 0ustar00lordyestalordyesta00000000000000/* * The balanced tree range functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_BTREE_RANGE_H ) #define _LIBFDATA_BTREE_RANGE_H #include #include #include "libfdata_extern.h" #include "libfdata_libcerror.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_btree_range libfdata_btree_range_t; struct libfdata_btree_range { /* The file index */ int file_index; /* The offset */ off64_t offset; /* The size */ size64_t size; /* The flags */ uint32_t flags; /* The key value */ intptr_t *key_value; /* The free key value function */ int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ); /* The key value flags */ uint8_t key_value_flags; /* The mapped first leaf value index */ int mapped_first_leaf_value_index; /* The mapped last leaf value index */ int mapped_last_leaf_value_index; /* The mapped number of leaf values */ int mapped_number_of_leaf_values; }; int libfdata_btree_range_initialize( libfdata_btree_range_t **range, libcerror_error_t **error ); int libfdata_btree_range_free( libfdata_btree_range_t **range, libcerror_error_t **error ); int libfdata_btree_range_clone( libfdata_btree_range_t **destination_range, libfdata_btree_range_t *source_range, libcerror_error_t **error ); int libfdata_btree_range_get( libfdata_btree_range_t *range, int *data_file_index, off64_t *data_offset, size64_t *data_size, uint32_t *data_flags, intptr_t **key_value, libcerror_error_t **error ); int libfdata_btree_range_set( libfdata_btree_range_t *range, int data_file_index, off64_t data_offset, size64_t data_size, uint32_t data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_BTREE_RANGE_H ) */ libewf-20140807/libfdata/libfdata_tree.c0000664000175000017500000007370613443450051022044 0ustar00lordyestalordyesta00000000000000/* * The tree functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_tree.h" #include "libfdata_tree_node.h" #include "libfdata_types.h" /* Creates a tree * Make sure the value tree is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the tree * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_tree_initialize( libfdata_tree_t **tree, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_node)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_tree_node_t *node, libfdata_cache_t *cache, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, uint8_t read_flags, libcerror_error_t **error ), int (*read_sub_nodes)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_tree_node_t *node, libfdata_cache_t *cache, int sub_nodes_file_index, off64_t sub_nodes_offset, size64_t sub_nodes_size, uint32_t sub_nodes_flags, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_initialize"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( *tree != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid tree value already set.", function ); return( -1 ); } if( read_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read node function.", function ); return( -1 ); } if( read_sub_nodes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid read sub nodes function.", function ); return( -1 ); } internal_tree = memory_allocate_structure( libfdata_internal_tree_t ); if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create tree.", function ); goto on_error; } if( memory_set( internal_tree, 0, sizeof( libfdata_internal_tree_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear tree.", function ); goto on_error; } internal_tree->flags |= flags; internal_tree->data_handle = data_handle; internal_tree->free_data_handle = free_data_handle; internal_tree->clone_data_handle = clone_data_handle; internal_tree->read_node = read_node; internal_tree->read_sub_nodes = read_sub_nodes; *tree = (libfdata_tree_t *) internal_tree; return( 1 ); on_error: if( internal_tree != NULL ) { memory_free( internal_tree ); } return( -1 ); } /* Frees a tree * Returns 1 if successful or -1 on error */ int libfdata_tree_free( libfdata_tree_t **tree, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_free"; int result = 1; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( *tree != NULL ) { internal_tree = (libfdata_internal_tree_t *) *tree; *tree = NULL; if( internal_tree->root_node != NULL ) { if( libfdata_tree_node_free( &( internal_tree->root_node ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free root node.", function ); result = -1; } } if( ( internal_tree->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_tree->data_handle != NULL ) { if( internal_tree->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - missing free data handle function.", function ); result = -1; } else if( internal_tree->free_data_handle( &( internal_tree->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_tree ); } return( result ); } /* Clones (duplicates) the tree * Returns 1 if successful or -1 on error */ int libfdata_tree_clone( libfdata_tree_t **destination_tree, libfdata_tree_t *source_tree, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_source_tree = NULL; libfdata_tree_node_t *source_tree_root_node = NULL; intptr_t *destination_data_handle = NULL; static char *function = "libfdata_tree_clone"; off64_t node_offset = 0; size64_t node_size = 0; uint32_t node_flags = 0; int node_file_index = -1; if( destination_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination tree.", function ); return( -1 ); } if( *destination_tree != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination tree value already set.", function ); return( -1 ); } if( source_tree == NULL ) { *destination_tree = NULL; return( 1 ); } internal_source_tree = (libfdata_internal_tree_t *) source_tree; if( internal_source_tree->data_handle != NULL ) { if( internal_source_tree->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source tree - missing free data handle function.", function ); goto on_error; } if( internal_source_tree->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source tree - missing clone data handle function.", function ); goto on_error; } if( internal_source_tree->clone_data_handle( &destination_data_handle, internal_source_tree->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone data handle.", function ); goto on_error; } } if( libfdata_tree_initialize( destination_tree, destination_data_handle, internal_source_tree->free_data_handle, internal_source_tree->clone_data_handle, internal_source_tree->read_node, internal_source_tree->read_sub_nodes, LIBFDATA_DATA_HANDLE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination tree.", function ); goto on_error; } destination_data_handle = NULL; if( libfdata_tree_get_root_node( source_tree, &source_tree_root_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve source tree root node.", function ); goto on_error; } if( libfdata_tree_node_get_data_range( source_tree_root_node, &node_file_index, &node_offset, &node_size, &node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve source tree root node data range.", function ); goto on_error; } if( libfdata_tree_set_root_node( *destination_tree, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set destination tree root node.", function ); goto on_error; } /* TODO or clone all the tree nodes ? */ return( 1 ); on_error: if( *destination_tree != NULL ) { libfdata_tree_free( destination_tree, NULL ); } if( destination_data_handle != NULL ) { internal_source_tree->free_data_handle( &destination_data_handle, NULL ); } return( -1 ); } /* Retrieves the node value of the node * Returns 1 if successful or -1 on error */ int libfdata_tree_get_node_value( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_tree_node_t *node, intptr_t **node_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_get_node_value"; size64_t node_size = 0; off64_t cache_value_offset = (off64_t) -1; off64_t node_offset = 0; int64_t cache_value_timestamp = 0; int64_t node_timestamp = 0; uint32_t node_flags = 0; int cache_entry_index = -1; int cache_value_file_index = -1; int node_file_index = -1; int number_of_cache_entries = 0; int result = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( internal_tree->read_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing read node function.", function ); return( -1 ); } if( libfdata_tree_node_get_data_range( node, &node_file_index, &node_offset, &node_size, &node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from tree node.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { if( ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { cache_entry_index = libfdata_tree_node_calculate_leaf_node_cache_entry_index( node_offset, number_of_cache_entries ); } else { cache_entry_index = libfdata_tree_node_calculate_branch_node_cache_entry_index( node_offset, number_of_cache_entries ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfdata_tree_node_get_timestamp( node, &node_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from tree node.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( node_file_index == cache_value_file_index ) && ( node_offset == cache_value_offset ) && ( node_timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (entry: %d, want: %" PRIi64 ", got: %" PRIi64 ")\n", function, (intptr_t) cache, cache_entry_index, node_offset, cache_value_offset ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (entry: %d)\n", function, (intptr_t) cache, cache_entry_index ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading node at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, node_offset, node_offset, node_size ); } #endif if( internal_tree->read_node( internal_tree->data_handle, file_io_handle, node, cache, node_file_index, node_offset, node_size, node_flags, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read node at offset: 0x%08" PRIx64 ".", function, node_offset ); return( -1 ); } if( ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { cache_entry_index = libfdata_tree_node_calculate_leaf_node_cache_entry_index( node_offset, number_of_cache_entries ); } else { cache_entry_index = libfdata_tree_node_calculate_branch_node_cache_entry_index( node_offset, number_of_cache_entries ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfdata_tree_node_get_timestamp( node, &node_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve time stamp from tree node.", function ); return( -1 ); } if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( node_file_index != cache_value_file_index ) || ( node_offset != cache_value_offset ) || ( node_timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing cache value.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, node_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } return( 1 ); } /* Sets the node value of the node * * If the flag LIBFDATA_TREE_NODE_VALUE_FLAG_MANAGED is set the tree * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_tree_set_node_value( libfdata_tree_t *tree, libfdata_cache_t *cache, libfdata_tree_node_t *node, intptr_t *node_value, int (*free_node_value)( intptr_t **node_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { static char *function = "libfdata_tree_set_node_value"; size64_t node_size = 0; off64_t node_offset = 0; int64_t node_timestamp = 0; uint32_t node_flags = 0; int cache_entry_index = -1; int node_file_index = -1; int number_of_cache_entries = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( libfdata_tree_node_get_data_range( node, &node_file_index, &node_offset, &node_size, &node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from tree node.", function ); return( -1 ); } if( libfdata_tree_node_get_timestamp( node, &node_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve timestamp from tree node.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } if( ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { cache_entry_index = libfdata_tree_node_calculate_leaf_node_cache_entry_index( node_offset, number_of_cache_entries ); } else { cache_entry_index = libfdata_tree_node_calculate_branch_node_cache_entry_index( node_offset, number_of_cache_entries ); } if( libfcache_cache_set_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, node_file_index, node_offset, node_timestamp, node_value, free_node_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in cache entry: %d.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Reads the sub nodes of the node * Returns 1 if successful or -1 on error */ int libfdata_tree_read_sub_nodes( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_tree_node_t *node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_read_sub_nodes"; off64_t sub_nodes_offset = 0; size64_t sub_nodes_size = 0; uint32_t sub_nodes_flags = 0; int sub_nodes_file_index = -1; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( internal_tree->read_sub_nodes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing read sub nodes function.", function ); return( -1 ); } if( libfdata_tree_node_get_sub_nodes_data_range( node, &sub_nodes_file_index, &sub_nodes_offset, &sub_nodes_size, &sub_nodes_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub nodes data range.", function ); return( -1 ); } if( internal_tree->read_sub_nodes( internal_tree->data_handle, file_io_handle, node, cache, sub_nodes_file_index, sub_nodes_offset, sub_nodes_size, sub_nodes_flags, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read sub nodes at offset: 0x%08" PRIx64 ".", function, sub_nodes_offset ); return( -1 ); } return( 1 ); } /* Retrieves the offset and size of the root node * Returns 1 if successful or -1 on error */ int libfdata_tree_get_root_node( libfdata_tree_t *tree, libfdata_tree_node_t **root_node, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_get_root_node"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( root_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid root node.", function ); return( -1 ); } *root_node = internal_tree->root_node; return( 1 ); } /* Sets the root node * Returns 1 if successful or -1 on error */ int libfdata_tree_set_root_node( libfdata_tree_t *tree, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_set_root_node"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( internal_tree->root_node == NULL ) { if( libfdata_tree_node_initialize( &( internal_tree->root_node ), tree, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create root node.", function ); return( -1 ); } } if( libfdata_tree_node_set_data_range( internal_tree->root_node, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set root node data range.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of leaf nodes in the tree * Returns 1 if successful or -1 on error */ int libfdata_tree_get_number_of_leaf_nodes( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_get_number_of_leaf_nodes"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( libfdata_tree_node_get_number_of_leaf_nodes( internal_tree->root_node, file_io_handle, cache, number_of_leaf_nodes, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf nodes from root node.", function ); return( -1 ); } return( 1 ); } /* Retrieves a leaf nodes at a specific index * Returns 1 if successful or -1 on error */ int libfdata_tree_get_leaf_node_by_index( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_node_index, libfdata_tree_node_t **leaf_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_get_leaf_node_by_index"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( libfdata_tree_node_get_leaf_node_by_index( internal_tree->root_node, file_io_handle, cache, leaf_node_index, leaf_node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node: %d from root node.", function, leaf_node_index ); return( -1 ); } return( 1 ); } /* Retrieves the number of deleted leaf nodes in the tree * Returns 1 if successful or -1 on error */ int libfdata_tree_get_number_of_deleted_leaf_nodes( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_deleted_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_get_number_of_deleted_leaf_nodes"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( libfdata_tree_node_get_number_of_deleted_leaf_nodes( internal_tree->root_node, file_io_handle, cache, number_of_deleted_leaf_nodes, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of deleted leaf nodes from root node.", function ); return( -1 ); } return( 1 ); } /* Retrieves a deleted leaf nodes at a specific index * Returns 1 if successful or -1 on error */ int libfdata_tree_get_deleted_leaf_node_by_index( libfdata_tree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int deleted_leaf_node_index, libfdata_tree_node_t **deleted_leaf_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_t *internal_tree = NULL; static char *function = "libfdata_tree_get_deleted_leaf_node_by_index"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_tree_t *) tree; if( libfdata_tree_node_get_deleted_leaf_node_by_index( internal_tree->root_node, file_io_handle, cache, deleted_leaf_node_index, deleted_leaf_node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of deleted leaf node: %d from root node.", function, deleted_leaf_node_index ); return( -1 ); } return( 1 ); } libewf-20140807/libfdata/libfdata_tree_node.c0000664000175000017500000024774613443450051023060 0ustar00lordyestalordyesta00000000000000/* * The tree node functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_definitions.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_range.h" #include "libfdata_tree_node.h" #include "libfdata_types.h" /* Creates a node * Make sure the value node is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_tree_node_initialize( libfdata_tree_node_t **node, libfdata_tree_t *tree, libfdata_tree_node_t *parent_node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_initialize"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node value already set.", function ); return( -1 ); } if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree_node = memory_allocate_structure( libfdata_internal_tree_node_t ); if( internal_tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create node.", function ); goto on_error; } if( memory_set( internal_tree_node, 0, sizeof( libfdata_internal_tree_node_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear node.", function ); memory_free( internal_tree_node ); return( -1 ); } if( libfdata_range_initialize( &( internal_tree_node->node_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create node data range.", function ); goto on_error; } if( libfdata_range_initialize( &( internal_tree_node->sub_nodes_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub nodes data range.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_tree_node->sub_nodes ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub nodes array.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_tree_node->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); goto on_error; } internal_tree_node->tree = tree; internal_tree_node->parent_node = parent_node; internal_tree_node->flags = LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; *node = (libfdata_tree_node_t *) internal_tree_node; return( 1 ); on_error: if( internal_tree_node != NULL ) { if( internal_tree_node->sub_nodes != NULL ) { libcdata_array_free( &( internal_tree_node->sub_nodes ), NULL, NULL ); } if( internal_tree_node->sub_nodes_data_range != NULL ) { libfdata_range_free( &( internal_tree_node->sub_nodes_data_range ), NULL ); } if( internal_tree_node->node_data_range != NULL ) { libfdata_range_free( &( internal_tree_node->node_data_range ), NULL ); } memory_free( internal_tree_node ); } return( -1 ); } /* Frees a node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_free( libfdata_tree_node_t **node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_free"; int result = 1; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { internal_tree_node = (libfdata_internal_tree_node_t *) *node; *node = NULL; if( internal_tree_node->node_data_range != NULL ) { if( libfdata_range_free( &( internal_tree_node->node_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free node data range.", function ); result = -1; } } if( internal_tree_node->sub_nodes_data_range != NULL ) { if( libfdata_range_free( &( internal_tree_node->sub_nodes_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub nodes data range.", function ); result = -1; } } if( libcdata_array_free( &( internal_tree_node->sub_nodes ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the sub nodes array.", function ); result = -1; } memory_free( internal_tree_node ); } return( result ); } /* Frees a node, but not its sub nodes * Returns 1 if successful or -1 on error */ int libfdata_tree_node_free_single( libfdata_tree_node_t **node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_free_single"; int result = 1; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { internal_tree_node = (libfdata_internal_tree_node_t *) node; *node = NULL; if( libcdata_array_free( &( internal_tree_node->sub_nodes ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the sub nodes array.", function ); result = -1; } memory_free( internal_tree_node ); } return( result ); } /* Sets the parent node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_parent_node( libfdata_tree_node_t *node, libfdata_tree_node_t *parent_node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_parent_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; internal_tree_node->parent_node = parent_node; return( 1 ); } /* Determines if the node is a root node * Returns 1 if a root node, 0 if not or -1 on error */ int libfdata_tree_node_is_root( libfdata_tree_node_t *node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_is_root"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( internal_tree_node->parent_node == NULL ) { return( 1 ); } return( 0 ); } /* Retrieves the data offset and size * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_data_range( libfdata_tree_node_t *node, int *node_file_index, off64_t *node_offset, size64_t *node_size, uint32_t *node_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_data_range"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( libfdata_range_get( internal_tree_node->node_data_range, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node data range.", function ); return( -1 ); } return( 1 ); } /* Sets the data offset and size * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_data_range( libfdata_tree_node_t *node, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_data_range"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is virtual.", function ); return( -1 ); } if( libfdata_range_set( internal_tree_node->node_data_range, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set node data range.", function ); return( -1 ); } if( libfcache_date_time_get_timestamp( &( internal_tree_node->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); return( -1 ); } return( 1 ); } /* Determines if the sub nodes data range has been set * Returns 1 if sub nodes have been set, 0 if not or -1 on error */ int libfdata_tree_node_sub_nodes_data_range_is_set( libfdata_tree_node_t *node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_sub_nodes_data_range_is_set"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { return( 1 ); } return( 0 ); } /* Retrieves the sub nodes data range * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_sub_nodes_data_range( libfdata_tree_node_t *node, int *sub_nodes_file_index, off64_t *sub_nodes_offset, size64_t *sub_nodes_size, uint32_t *sub_nodes_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_sub_nodes_data_range"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - sub nodes range has not been set.", function ); return( -1 ); } if( libfdata_range_get( internal_tree_node->sub_nodes_data_range, sub_nodes_file_index, sub_nodes_offset, sub_nodes_size, sub_nodes_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub nodes data range.", function ); return( -1 ); } return( 1 ); } /* Sets the sub nodes data range * The sub nodes data range cannot be set after the sub nodes have been read * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_sub_nodes_data_range( libfdata_tree_node_t *node, int sub_nodes_file_index, off64_t sub_nodes_offset, size64_t sub_nodes_size, uint32_t sub_nodes_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_sub_nodes_data_range"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is virtual.", function ); return( -1 ); } if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - sub nodes range has already been read.", function ); return( -1 ); } if( libfdata_range_set( internal_tree_node->sub_nodes_data_range, sub_nodes_file_index, sub_nodes_offset, sub_nodes_size, sub_nodes_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub nodes data range.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET; return( 1 ); } /* Retrieves the time stamp * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_timestamp( libfdata_tree_node_t *node, int64_t *timestamp, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_timestamp"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( timestamp == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node time stamp.", function ); return( -1 ); } *timestamp = internal_tree_node->timestamp; return( 1 ); } /* Retrieves the first leaf node index * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_first_leaf_node_index( libfdata_tree_node_t *node, int *first_leaf_node_index, int *deleted_first_leaf_node_index, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_first_leaf_node_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( first_leaf_node_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first leaf node index.", function ); return( -1 ); } if( deleted_first_leaf_node_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first deleted leaf node index.", function ); return( -1 ); } *first_leaf_node_index = internal_tree_node->first_leaf_node_index; *deleted_first_leaf_node_index = internal_tree_node->first_deleted_leaf_node_index; return( 1 ); } /* Sets the first leaf node index * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_first_leaf_node_index( libfdata_tree_node_t *node, int first_leaf_node_index, int first_deleted_leaf_node_index, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_first_leaf_node_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( first_leaf_node_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid first leaf node index value less than zero.", function ); return( -1 ); } if( first_deleted_leaf_node_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid first deleted leaf node index value less than zero.", function ); return( -1 ); } internal_tree_node->first_leaf_node_index = first_leaf_node_index; internal_tree_node->first_deleted_leaf_node_index = first_deleted_leaf_node_index; return( 1 ); } /* Retrieves the node value * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_node_value( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t **node_value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_node_value"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, cache, node, node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; return( 1 ); } /* Sets the node value * * If the flag LIBFDATA_TREE_NODE_VALUE_FLAG_MANAGED is set the node * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_node_value( libfdata_tree_node_t *node, libfdata_cache_t *cache, intptr_t *node_value, int (*free_node_value)( intptr_t **node_value, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_node_value"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( libfdata_tree_set_node_value( internal_tree_node->tree, cache, node, node_value, free_node_value, flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set node value.", function ); return( -1 ); } return( 1 ); } /* Resizes the sub nodes * Returns 1 if successful or -1 on error */ int libfdata_tree_node_resize_sub_nodes( libfdata_tree_node_t *node, int number_of_sub_nodes, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_resize_sub_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( libcdata_array_resize( internal_tree_node->sub_nodes, number_of_sub_nodes, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize sub nodes array.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of sub nodes * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_number_of_sub_nodes( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_sub_nodes, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; intptr_t *node_value = NULL; static char *function = "libfdata_tree_node_get_number_of_sub_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) { /* Make sure the node data is read before the sub nodes */ if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) { if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, cache, node, &node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; } if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { if( libfdata_tree_read_sub_nodes( internal_tree_node->tree, file_io_handle, cache, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read sub nodes.", function ); return( -1 ); } } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; } if( libcdata_array_get_number_of_entries( internal_tree_node->sub_nodes, number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub nodes array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific sub node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_sub_node_by_index( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int sub_node_index, libfdata_tree_node_t **sub_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; intptr_t *node_value = NULL; static char *function = "libfdata_tree_node_get_sub_node_by_index"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) { /* Make sure the node data is read before the sub nodes */ if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) { if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, cache, node, &node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; } if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { if( libfdata_tree_read_sub_nodes( internal_tree_node->tree, file_io_handle, cache, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read sub nodes.", function ); return( -1 ); } } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; } if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Sets the offset and size of a specific sub node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_sub_node_by_index( libfdata_tree_node_t *node, int sub_node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; static char *function = "libfdata_tree_node_set_sub_node_by_index"; off64_t previous_node_offset = 0; size64_t previous_node_size = 0; uint32_t previous_node_flags = 0; int previous_node_file_index = -1; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } if( sub_node == NULL ) { if( libfdata_tree_node_initialize( &sub_node, internal_tree_node->tree, node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub node.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t *) sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub node: %d in sub nodes array.", function, sub_node_index ); libfdata_tree_node_free( &sub_node, NULL ); return( -1 ); } } else { if( libfdata_tree_node_get_data_range( sub_node, &previous_node_file_index, &previous_node_offset, &previous_node_size, &previous_node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node: %d data range.", function, sub_node_index ); return( -1 ); } } if( libfdata_tree_node_set_data_range( sub_node, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub node: %d data range.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Appends a sub node offset and size * Returns 1 if successful or -1 on error */ int libfdata_tree_node_append_sub_node( libfdata_tree_node_t *node, int *sub_node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; static char *function = "libfdata_tree_node_append_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( libfdata_tree_node_initialize( &sub_node, internal_tree_node->tree, node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub node.", function ); goto on_error; } if( libfdata_tree_node_set_data_range( sub_node, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub node data range.", function ); goto on_error; } if( libcdata_array_append_entry( internal_tree_node->sub_nodes, sub_node_index, (intptr_t *) sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append sub node to sub nodes array.", function ); goto on_error; } return( 1 ); on_error: if( sub_node != NULL ) { libfdata_tree_node_free( &sub_node, NULL ); } return( -1 ); } /* Inserts a sub node offset and size * * Uses the node_value_compare_function to determine the order of the sub nodes * The node_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate entry. * Only allowing unique entries can be enforced by setting the flag LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the node already exists or -1 on error */ int libfdata_tree_node_insert_sub_node( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *sub_node_index, int node_file_index, off64_t node_offset, size64_t node_size, uint32_t node_flags, int (*node_value_compare_function)( intptr_t *first_node_value, intptr_t *second_node_value, libcerror_error_t **error ), uint8_t insert_flags, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_t *insert_cache = NULL; libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *insert_sub_node = NULL; libfdata_tree_node_t *sub_node = NULL; intptr_t *insert_sub_node_value = NULL; intptr_t *sub_node_value = NULL; static char *function = "libfdata_tree_node_insert_sub_node"; int number_of_sub_nodes = 0; int result = 0; int sub_node_iterator = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( sub_node_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node index.", function ); return( -1 ); } if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( node_value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node value compare function.", function ); return( -1 ); } if( ( insert_flags & ~( LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_SUB_NODE_VALUES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported insert flags: 0x%02" PRIx8 ".", function, insert_flags ); return( -1 ); } if( libfdata_tree_node_initialize( &insert_sub_node, internal_tree_node->tree, node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create insert sub node.", function ); goto on_error; } if( libfdata_tree_node_set_data_range( insert_sub_node, node_file_index, node_offset, node_size, node_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set insert sub node data range.", function ); goto on_error; } if( libcdata_array_get_number_of_entries( internal_tree_node->sub_nodes, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub nodes array.", function ); goto on_error; } if( libfcache_cache_initialize( &insert_cache, 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create insert cache.", function ); goto on_error; } if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, (libfdata_cache_t *) insert_cache, insert_sub_node, &insert_sub_node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve insert sub node value.", function ); goto on_error; } for( sub_node_iterator = 0; sub_node_iterator < number_of_sub_nodes; sub_node_iterator++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_iterator, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_iterator ); goto on_error; } if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, cache, sub_node, &sub_node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node value: %d.", function, sub_node_iterator ); goto on_error; } result = node_value_compare_function( insert_sub_node_value, sub_node_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare sub node value: %d.", function, sub_node_iterator ); goto on_error; } else if( result == LIBFDATA_COMPARE_EQUAL ) { if( ( insert_flags & LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_SUB_NODE_VALUES ) != 0 ) { if( libfcache_cache_free( &insert_cache, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the insert cache.", function ); goto on_error; } if( libfdata_tree_node_free( &insert_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the insert sub node.", function ); goto on_error; } return( 0 ); } } else if( result == LIBFDATA_COMPARE_LESS ) { break; } else if( result != LIBFDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported node value compare function return value: %d.", function, result ); goto on_error; } } if( libfcache_cache_free( &insert_cache, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the insert cache.", function ); goto on_error; } if( ( number_of_sub_nodes > 0 ) && ( result == LIBCDATA_COMPARE_LESS ) ) { *sub_node_index = sub_node_iterator; if( libcdata_array_resize( internal_tree_node->sub_nodes, number_of_sub_nodes + 1, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize sub nodes array.", function ); goto on_error; } for( sub_node_iterator = number_of_sub_nodes; sub_node_iterator > *sub_node_index; sub_node_iterator-- ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_iterator - 1, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node: %d from sub nodes array.", function, sub_node_iterator - 1 ); goto on_error; } if( libcdata_array_set_entry_by_index( internal_tree_node->sub_nodes, sub_node_iterator, (intptr_t *) sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub node: %d in sub nodes array.", function, sub_node_iterator ); goto on_error; } } if( libcdata_array_set_entry_by_index( internal_tree_node->sub_nodes, *sub_node_index, (intptr_t *) insert_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set insert sub node: %d in sub nodes array.", function, *sub_node_index ); goto on_error; } } else { *sub_node_index = number_of_sub_nodes; if( libcdata_array_resize( internal_tree_node->sub_nodes, number_of_sub_nodes + 1, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize sub nodes array.", function ); goto on_error; } if( libcdata_array_set_entry_by_index( internal_tree_node->sub_nodes, *sub_node_index, (intptr_t *) insert_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set insert sub node: %d in sub nodes array.", function, *sub_node_index ); goto on_error; } } return( 1 ); on_error: if( insert_cache != NULL ) { libfcache_cache_free( &insert_cache, NULL ); } if( insert_sub_node != NULL ) { libfdata_tree_node_free( &insert_sub_node, NULL ); } return( -1 ); } /* Splits the sub nodes * Returns 1 if successful or -1 on error */ int libfdata_tree_node_split_sub_nodes( libfdata_tree_node_t *node, int number_of_splits, libcerror_error_t **error ) { libcdata_array_t *virtual_sub_nodes_array = NULL; libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; libfdata_tree_node_t *virtual_sub_node = NULL; static char *function = "libfdata_tree_node_split_sub_nodes"; int number_of_split_sub_nodes = 0; int number_of_sub_nodes = 0; int result = 1; int last_sub_node_index = 0; int split_sub_node_index = 0; int sub_node_index = 0; int virtual_sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - node is a leaf.", function ); return( -1 ); } if( number_of_splits < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of splits value less than zero.", function ); return( -1 ); } if( number_of_splits == 0 ) { return( 1 ); } if( libcdata_array_get_number_of_entries( internal_tree_node->sub_nodes, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub nodes array.", function ); return( -1 ); } number_of_split_sub_nodes = number_of_sub_nodes / number_of_splits; if( number_of_split_sub_nodes < 2 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: number of sub nodes too small to split in: %d.", function, number_of_splits ); return( -1 ); } if( libcdata_array_initialize( &virtual_sub_nodes_array, number_of_splits, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create virtual sub nodes array.", function ); return( -1 ); } for( virtual_sub_node_index = 0; virtual_sub_node_index < number_of_splits; virtual_sub_node_index++ ) { if( libfdata_tree_node_initialize( &virtual_sub_node, internal_tree_node->tree, node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create virtual sub node: %d.", function, virtual_sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } ( (libfdata_internal_tree_node_t *) virtual_sub_node )->flags |= LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL; if( libcdata_array_set_entry_by_index( virtual_sub_nodes_array, virtual_sub_node_index, (intptr_t *) virtual_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set virtual sub node: %d in virtual sub nodes array.", function, virtual_sub_node_index ); libfdata_tree_node_free( &virtual_sub_node, NULL ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } last_sub_node_index = ( number_of_split_sub_nodes * ( virtual_sub_node_index + 1 ) ) - 1; if( virtual_sub_node_index == ( number_of_splits - 1 ) ) { last_sub_node_index += number_of_sub_nodes % number_of_splits; } if( last_sub_node_index > number_of_sub_nodes ) { last_sub_node_index = number_of_sub_nodes - 1; } if( libcdata_array_resize( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->sub_nodes, last_sub_node_index + 1 - sub_node_index, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize sub nodes array of virtual sub node: %d.", function, virtual_sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } split_sub_node_index = 0; while( sub_node_index <= last_sub_node_index ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } if( split_sub_node_index == 0 ) { if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub node: %d.", function, sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } if( ( (libfdata_internal_tree_node_t *) sub_node )->node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid sub node: %d - missing node data range.", function, sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } /* The node data range of a virtual node cannot be set by the set_data_range function */ if( libfdata_tree_node_get_data_range( sub_node, &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->file_index ), &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->offset ), &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->size ), &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->flags ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set virtual sub node data range.", function ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } } if( libcdata_array_set_entry_by_index( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->sub_nodes, split_sub_node_index, (intptr_t *) sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in sub nodes array of virtual sub node: %d.", function, split_sub_node_index, virtual_sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } if( libfdata_tree_node_set_parent_node( sub_node, virtual_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent node in sub node: %d.", function, split_sub_node_index ); libcdata_array_free( &virtual_sub_nodes_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, NULL ); result = -1; break; } sub_node_index++; split_sub_node_index++; } virtual_sub_node = NULL; } if( result != 1 ) { /* Set the parent values in the sub nodes back to their orginal value */ for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); continue; } if( libfdata_tree_node_set_parent_node( sub_node, node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent node in sub node: %d.", function, sub_node_index ); continue; } } return( -1 ); } if( libcdata_array_free( &( internal_tree_node->sub_nodes ), NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the sub nodes array.", function ); result = -1; } internal_tree_node->sub_nodes = virtual_sub_nodes_array; return( result ); } /* Determines if the node is deleted * Returns 1 if deleted, 0 if not or -1 on error */ int libfdata_tree_node_is_deleted( libfdata_tree_node_t *node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_is_deleted"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_DELETED ) != 0 ) ) { return( 1 ); } return( 0 ); } /* Marks a node as deleted * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_deleted( libfdata_tree_node_t *node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_deleted"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; /* TODO add deleted branch node support */ if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: invalid node - currently only deleted leaf nodes are supported.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_IS_DELETED; if( libfdata_tree_node_set_calculate_leaf_node_values( node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set calculate leaf node values.", function ); return( -1 ); } return( 1 ); } /* Makes a deleted node of a specific sub node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_deleted_sub_node( libfdata_tree_node_t *node, int sub_node_index, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; static char *function = "libfdata_tree_node_set_deleted_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub node: %d.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_set_deleted( sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set deleted in sub node: %d.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Sets the flag to calculate the leaf node values and propagates this up to its parent node * Returns 1 if the successful or -1 on error */ int libfdata_tree_node_set_calculate_leaf_node_values( libfdata_tree_node_t *node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_calculate_leaf_node_values"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( internal_tree_node->parent_node != NULL ) { if( libfdata_tree_node_set_calculate_leaf_node_values( internal_tree_node->parent_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set calculate leaf node values in parent node.", function ); return( -1 ); } } internal_tree_node->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Reads the leaf node values * Returns 1 if the successful or -1 on error */ int libfdata_tree_node_read_leaf_node_values( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; intptr_t *node_value = NULL; static char *function = "libfdata_tree_node_read_leaf_node_values"; int number_of_deleted_leaf_nodes = 0; int number_of_leaf_nodes = 0; int number_of_sub_nodes = 0; int result = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) { /* Make sure the node data is read before the sub nodes */ if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) { if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, cache, node, &node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; } if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { if( libfdata_tree_read_sub_nodes( internal_tree_node->tree, file_io_handle, cache, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read sub nodes.", function ); return( -1 ); } } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; } internal_tree_node->number_of_leaf_nodes = 0; internal_tree_node->number_of_deleted_leaf_nodes = 0; if( libcdata_array_get_number_of_entries( internal_tree_node->sub_nodes, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub nodes array.", function ); return( -1 ); } for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_get_number_of_leaf_nodes( sub_node, file_io_handle, cache, &number_of_leaf_nodes, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf nodes from sub node: %d.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_get_number_of_deleted_leaf_nodes( sub_node, file_io_handle, cache, &number_of_deleted_leaf_nodes, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of deleted leaf nodes from sub node: %d.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_set_first_leaf_node_index( sub_node, internal_tree_node->number_of_leaf_nodes, internal_tree_node->number_of_deleted_leaf_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set first leaf node index in sub node: %d.", function, sub_node_index ); return( -1 ); } if( ( number_of_leaf_nodes == 0 ) && ( number_of_deleted_leaf_nodes == 0 ) ) { /* It is possible to have branch nodes without leaf nodes */ result = libfdata_tree_node_is_leaf( sub_node, file_io_handle, cache, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if sub node: %d is a leaf.", function, sub_node_index ); return( -1 ); } else if( result != 0 ) { result = libfdata_tree_node_is_deleted( sub_node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if sub node: %d is deleted.", function, sub_node_index ); return( -1 ); } else if( result == 0 ) { internal_tree_node->number_of_leaf_nodes++; } else { internal_tree_node->number_of_deleted_leaf_nodes++; } } } else { internal_tree_node->number_of_leaf_nodes += number_of_leaf_nodes; internal_tree_node->number_of_deleted_leaf_nodes += number_of_deleted_leaf_nodes; } } return( 1 ); } /* Determines if the node is a leaf node * Returns 1 if a leaf node, 0 if not or -1 on error */ int libfdata_tree_node_is_leaf( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; intptr_t *node_value = NULL; static char *function = "libfdata_tree_node_is_leaf"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) { /* Make sure the node data is read before the sub nodes */ if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) { if( libfdata_tree_get_node_value( internal_tree_node->tree, file_io_handle, cache, node, &node_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; } if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { if( libfdata_tree_read_sub_nodes( internal_tree_node->tree, file_io_handle, cache, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read sub nodes.", function ); return( -1 ); } } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; } if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) { return( 1 ); } return( 0 ); } /* Makes a leaf node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_leaf( libfdata_tree_node_t *node, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_set_leaf"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - sub nodes range was set.", function ); return( -1 ); } internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_IS_LEAF; if( libfdata_tree_node_set_calculate_leaf_node_values( node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set calculate leaf node values.", function ); return( -1 ); } return( 1 ); } /* Makes a leaf node of a specific sub node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_set_leaf_sub_node( libfdata_tree_node_t *node, int sub_node_index, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; static char *function = "libfdata_tree_node_set_leaf_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub node: %d.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_set_leaf( sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set leaf in sub node: %d.", function, sub_node_index ); return( -1 ); } return( 1 ); } /* Retrieves the number of leaf nodes * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_number_of_leaf_nodes( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_number_of_leaf_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( number_of_leaf_nodes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of leaf nodes.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_tree_node_read_leaf_node_values( node, file_io_handle, cache, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } *number_of_leaf_nodes = internal_tree_node->number_of_leaf_nodes; return( 1 ); } /* Retrieves a specific leaf node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_leaf_node_by_index( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_node_index, libfdata_tree_node_t **leaf_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; static char *function = "libfdata_tree_node_get_leaf_node_by_index"; int first_deleted_leaf_node_index = 0; int first_leaf_node_index = 0; int number_of_leaf_nodes = 0; int number_of_sub_nodes = 0; int result = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( leaf_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid leaf node.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_tree_node_read_leaf_node_values( node, file_io_handle, cache, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } if( libcdata_array_get_number_of_entries( internal_tree_node->sub_nodes, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub nodes array.", function ); return( -1 ); } for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_get_number_of_leaf_nodes( sub_node, file_io_handle, cache, &number_of_leaf_nodes, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf nodes from sub node: %d.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_get_first_leaf_node_index( sub_node, &first_leaf_node_index, &first_deleted_leaf_node_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first leaf node index from sub node: %d.", function, sub_node_index ); return( -1 ); } if( number_of_leaf_nodes == 0 ) { /* It is possible to have branch nodes without leaf nodes */ result = libfdata_tree_node_is_leaf( sub_node, file_io_handle, cache, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if sub node: %d is a leaf.", function, sub_node_index ); return( -1 ); } else if( result != 0 ) { result = libfdata_tree_node_is_deleted( sub_node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if sub node: %d is deleted.", function, sub_node_index ); return( -1 ); } else if( result == 0 ) { if( leaf_node_index == first_leaf_node_index ) { *leaf_node = sub_node; break; } } } } else if( ( leaf_node_index >= first_leaf_node_index ) && ( leaf_node_index < ( first_leaf_node_index + number_of_leaf_nodes ) ) ) { /* Note that the first_leaf_node_index is relative for a branch */ if( libfdata_tree_node_get_leaf_node_by_index( sub_node, file_io_handle, cache, leaf_node_index - first_leaf_node_index, leaf_node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node: %d from sub node: %d.", function, leaf_node_index - first_leaf_node_index, sub_node_index ); return( -1 ); } break; } } if( sub_node_index >= number_of_sub_nodes ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sub node index value out of bounds.", function ); return( -1 ); } return( 1 ); } /* Retrieves the number of deleted leaf nodes * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_number_of_deleted_leaf_nodes( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_deleted_leaf_nodes, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; static char *function = "libfdata_tree_node_get_number_of_deleted_leaf_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( number_of_deleted_leaf_nodes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of deleted leaf nodes.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_tree_node_read_leaf_node_values( node, file_io_handle, cache, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } *number_of_deleted_leaf_nodes = internal_tree_node->number_of_deleted_leaf_nodes; return( 1 ); } /* Retrieves a specific deleted leaf node * Returns 1 if successful or -1 on error */ int libfdata_tree_node_get_deleted_leaf_node_by_index( libfdata_tree_node_t *node, intptr_t *file_io_handle, libfdata_cache_t *cache, int deleted_leaf_node_index, libfdata_tree_node_t **deleted_leaf_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_tree_node_t *internal_tree_node = NULL; libfdata_tree_node_t *sub_node = NULL; static char *function = "libfdata_tree_node_get_deleted_leaf_node_by_index"; int first_deleted_leaf_node_index = 0; int first_leaf_node_index = 0; int number_of_deleted_leaf_nodes = 0; int number_of_sub_nodes = 0; int result = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_tree_node = (libfdata_internal_tree_node_t *) node; if( deleted_leaf_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid deleted leaf node.", function ); return( -1 ); } if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_tree_node_read_leaf_node_values( node, file_io_handle, cache, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value.", function ); return( -1 ); } internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } if( libcdata_array_get_number_of_entries( internal_tree_node->sub_nodes, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from sub nodes array.", function ); return( -1 ); } for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_array_get_entry_by_index( internal_tree_node->sub_nodes, sub_node_index, (intptr_t **) &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from sub nodes array.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_get_number_of_deleted_leaf_nodes( sub_node, file_io_handle, cache, &number_of_deleted_leaf_nodes, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf nodes from sub node: %d.", function, sub_node_index ); return( -1 ); } if( libfdata_tree_node_get_first_leaf_node_index( sub_node, &first_leaf_node_index, &first_deleted_leaf_node_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first leaf node index from sub node: %d.", function, sub_node_index ); return( -1 ); } if( number_of_deleted_leaf_nodes == 0 ) { /* It is possible to have branch nodes without leaf nodes */ result = libfdata_tree_node_is_leaf( sub_node, file_io_handle, cache, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if sub node: %d is a leaf.", function, sub_node_index ); return( -1 ); } else if( result != 0 ) { result = libfdata_tree_node_is_deleted( sub_node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if sub node: %d is deleted.", function, sub_node_index ); return( -1 ); } else if( result != 0 ) { if( deleted_leaf_node_index == first_deleted_leaf_node_index ) { *deleted_leaf_node = sub_node; break; } } } } else if( ( deleted_leaf_node_index >= first_deleted_leaf_node_index ) && ( deleted_leaf_node_index < ( first_deleted_leaf_node_index + number_of_deleted_leaf_nodes ) ) ) { /* Note that the first_deleted_leaf_node_index is relative for a branch */ if( libfdata_tree_node_get_deleted_leaf_node_by_index( sub_node, file_io_handle, cache, deleted_leaf_node_index - first_deleted_leaf_node_index, deleted_leaf_node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve deleted leaf node: %d from sub node: %d.", function, deleted_leaf_node_index - first_deleted_leaf_node_index, sub_node_index ); return( -1 ); } break; } } if( sub_node_index >= number_of_sub_nodes ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sub node index value out of bounds.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libfdata/libfdata_libcnotify.h0000664000175000017500000000266213443450051023245 0ustar00lordyestalordyesta00000000000000/* * The libcnotify header wrapper * * Copyright (C) 2010-2018, 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( _LIBFDATA_LIBCNOTIFY_H ) #define _LIBFDATA_LIBCNOTIFY_H #include /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify */ #if defined( HAVE_LOCAL_LIBCNOTIFY ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT * before including libcnotify.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCNOTIFY_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ #endif /* !defined( _LIBFDATA_LIBCNOTIFY_H ) */ libewf-20140807/libfdata/libfdata_notify.c0000664000175000017500000000530413443450051022402 0ustar00lordyestalordyesta00000000000000/* * Notification functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include #endif #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_notify.h" #if !defined( HAVE_LOCAL_LIBFDATA ) /* Sets the verbose notification */ void libfdata_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libfdata_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libfdata_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libfdata_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libfdata_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libfdata_notify_stream_close( libcerror_error_t **error ) { static char *function = "libfdata_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ libewf-20140807/libfdata/libfdata_btree_node.h0000664000175000017500000001672213443450051023213 0ustar00lordyestalordyesta00000000000000/* * The balanced tree node functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_BTREE_NODE_H ) #define _LIBFDATA_INTERNAL_BTREE_NODE_H #include #include #include "libfdata_btree_range.h" #include "libfdata_extern.h" #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_btree_node libfdata_internal_btree_node_t; struct libfdata_internal_btree_node { /* The (node) level */ int level; /* The sub node (data) ranges array */ libcdata_array_t *sub_node_ranges_array; /* The number of leaf values in the branch */ int branch_number_of_leaf_values; /* The leaf value (data) ranges array */ libcdata_array_t *leaf_value_ranges_array; /* The flags */ uint8_t flags; }; int libfdata_btree_node_initialize( libfdata_btree_node_t **node, int level, libcerror_error_t **error ); int libfdata_btree_node_free( libfdata_btree_node_t **node, libcerror_error_t **error ); /* Node functions */ LIBFDATA_EXTERN \ int libfdata_btree_node_get_level( libfdata_btree_node_t *node, int *level, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_is_branch( libfdata_btree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_is_leaf( libfdata_btree_node_t *node, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_is_root( libfdata_btree_node_t *node, libcerror_error_t **error ); /* Sub node data range functions */ LIBFDATA_EXTERN \ int libfdata_btree_node_get_number_of_sub_nodes( libfdata_btree_node_t *node, int *number_of_sub_nodes, libcerror_error_t **error ); int libfdata_btree_node_get_sub_node_data_range_by_index( libfdata_btree_node_t *node, int sub_node_index, libfdata_btree_range_t **sub_node_data_range, libcerror_error_t **error ); int libfdata_btree_node_get_sub_node_data_range_by_mapped_index( libfdata_btree_node_t *node, int mapped_index, libfdata_btree_range_t **sub_node_data_range, libcerror_error_t **error ); int libfdata_btree_node_get_sub_node_data_range_by_key( libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *sub_node_index, libfdata_btree_range_t **sub_node_data_range, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_get_sub_node_by_index( libfdata_btree_node_t *node, int sub_node_index, int *sub_node_data_file_index, off64_t *sub_node_data_offset, size64_t *sub_node_data_size, uint32_t *sub_node_data_flags, intptr_t **key_value, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_set_sub_node_by_index( libfdata_btree_node_t *node, int sub_node_index, int sub_node_data_file_index, off64_t sub_node_data_offset, size64_t sub_node_data_size, uint32_t sub_node_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_append_sub_node( libfdata_btree_node_t *node, int *sub_node_index, int sub_node_data_file_index, off64_t sub_node_data_offset, size64_t sub_node_data_size, uint32_t sub_node_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ); /* Branch leaf values functions */ int libfdata_btree_node_get_number_of_leaf_values_in_branch( libfdata_btree_node_t *node, int *number_of_leaf_values, libcerror_error_t **error ); /* Leaf value data range functions */ LIBFDATA_EXTERN \ int libfdata_btree_node_get_number_of_leaf_values( libfdata_btree_node_t *node, int *number_of_leaf_values, libcerror_error_t **error ); int libfdata_btree_node_get_leaf_value_data_range_by_index( libfdata_btree_node_t *node, int leaf_value_index, libfdata_btree_range_t **leaf_value_data_range, libcerror_error_t **error ); int libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( libfdata_btree_node_t *node, int mapped_index, libfdata_btree_range_t **leaf_value_data_range, libcerror_error_t **error ); int libfdata_btree_node_get_leaf_value_data_range_by_key( libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), libfdata_btree_range_t **leaf_value_data_range, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_get_leaf_value_by_index( libfdata_btree_node_t *node, int leaf_value_index, int *leaf_value_data_file_index, off64_t *leaf_value_data_offset, size64_t *leaf_value_data_size, uint32_t *leaf_value_data_flags, intptr_t **key_value, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_get_leaf_value_by_key( libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *leaf_value_data_file_index, off64_t *leaf_value_data_offset, size64_t *leaf_value_data_size, uint32_t *leaf_value_data_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_set_leaf_value_by_index( libfdata_btree_node_t *node, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_btree_node_append_leaf_value( libfdata_btree_node_t *node, int *leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, int (*free_key_value)( intptr_t **key_value, libcerror_error_t **error ), uint8_t key_value_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_BTREE_NODE_H ) */ libewf-20140807/libfdata/libfdata_list_element.h0000664000175000017500000000761713443450051023574 0ustar00lordyestalordyesta00000000000000/* * The list element functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_LIST_ELEMENT_H ) #define _LIBFDATA_INTERNAL_LIST_ELEMENT_H #include #include #include "libfdata_extern.h" #include "libfdata_libcerror.h" #include "libfdata_libfcache.h" #include "libfdata_range.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libfdata_internal_list_element libfdata_internal_list_element_t; struct libfdata_internal_list_element { /* The list reference */ libfdata_list_t *list; /* The (list) element index */ int element_index; /* The (element) data range */ libfdata_range_t *data_range; /* The (element) mapped size */ size64_t mapped_size; /* The timestamp */ int64_t timestamp; /* The flags */ uint8_t flags; }; int libfdata_list_element_initialize( libfdata_list_element_t **element, libfdata_list_t *list, int element_index, libcerror_error_t **error ); int libfdata_list_element_free( libfdata_list_element_t **element, libcerror_error_t **error ); int libfdata_list_element_clone( libfdata_list_element_t **destination_element, libfdata_list_element_t *source_element, libcerror_error_t **error ); int libfdata_list_element_get_element_index( libfdata_list_element_t *element, int *element_index, libcerror_error_t **error ); int libfdata_list_element_set_element_index( libfdata_list_element_t *element, int element_index, libcerror_error_t **error ); int libfdata_list_element_get_timestamp( libfdata_list_element_t *element, int64_t *timestamp, libcerror_error_t **error ); /* Data range functions */ int libfdata_list_element_get_data_range( libfdata_list_element_t *element, int *file_index, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ); int libfdata_list_element_set_data_range( libfdata_list_element_t *element, int file_index, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ); /* Mapped range functions */ LIBFDATA_EXTERN \ int libfdata_list_element_get_mapped_size( libfdata_list_element_t *element, size64_t *mapped_size, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_element_set_mapped_size( libfdata_list_element_t *element, size64_t mapped_size, libcerror_error_t **error ); /* Element value functions */ LIBFDATA_EXTERN \ int libfdata_list_element_get_element_value( libfdata_list_element_t *element, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t **element_value, uint8_t read_flags, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_list_element_set_element_value( libfdata_list_element_t *element, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t *element_value, int (*free_element_value)( intptr_t **element_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_LIST_ELEMENT_H ) */ libewf-20140807/libfdata/libfdata_inline.h0000664000175000017500000000211713443450051022354 0ustar00lordyestalordyesta00000000000000/* * The internal inline definition * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_INLINE_H ) #define _LIBFDATA_INTERNAL_INLINE_H #include #if defined( _MSC_VER ) #define LIBFDATA_INLINE _inline #elif defined( __BORLANDC__ ) #define LIBFDATA_INLINE /* inline */ #else #define LIBFDATA_INLINE inline #endif #endif libewf-20140807/libfdata/libfdata_btree.c0000664000175000017500000022427313443450051022203 0ustar00lordyestalordyesta00000000000000/* * The balanced tree functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_btree.h" #include "libfdata_btree_node.h" #include "libfdata_btree_range.h" #include "libfdata_definitions.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_libfcache.h" #include "libfdata_types.h" #include "libfdata_unused.h" /* Creates a tree * Make sure the value tree is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the tree * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_btree_initialize( libfdata_btree_t **tree, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*read_node)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_btree_node_t *node, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, intptr_t *key_value, uint8_t read_flags, libcerror_error_t **error ), int (*read_leaf_value)( intptr_t *data_handle, intptr_t *file_io_handle, libfdata_btree_t *tree, libfdata_cache_t *cache, int leaf_value_index, int leaf_value_data_file_index, off64_t leaf_value_data_offset, size64_t leaf_value_data_size, uint32_t leaf_value_data_flags, intptr_t *key_value, uint8_t read_flags, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_btree_t *internal_tree = NULL; static char *function = "libfdata_btree_initialize"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( *tree != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid tree value already set.", function ); return( -1 ); } internal_tree = memory_allocate_structure( libfdata_internal_btree_t ); if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create tree.", function ); goto on_error; } if( memory_set( internal_tree, 0, sizeof( libfdata_internal_btree_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear tree.", function ); goto on_error; } if( libfdata_btree_range_initialize( &( internal_tree->root_node_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create root node data range.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_tree->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); goto on_error; } internal_tree->flags |= flags; internal_tree->calculate_node_cache_entry_index = &libfdata_btree_calculate_node_cache_entry_index; internal_tree->calculate_leaf_value_cache_entry_index = &libfdata_btree_calculate_leaf_value_cache_entry_index; internal_tree->data_handle = data_handle; internal_tree->free_data_handle = free_data_handle; internal_tree->clone_data_handle = clone_data_handle; internal_tree->read_node = read_node; internal_tree->read_leaf_value = read_leaf_value; *tree = (libfdata_btree_t *) internal_tree; return( 1 ); on_error: if( internal_tree != NULL ) { if( internal_tree->root_node_data_range != NULL ) { libfdata_btree_range_free( &( internal_tree->root_node_data_range ), NULL ); } memory_free( internal_tree ); } return( -1 ); } /* Frees a tree * Returns 1 if successful or -1 on error */ int libfdata_btree_free( libfdata_btree_t **tree, libcerror_error_t **error ) { libfdata_internal_btree_t *internal_tree = NULL; static char *function = "libfdata_btree_free"; int result = 1; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( *tree != NULL ) { internal_tree = (libfdata_internal_btree_t *) *tree; *tree = NULL; if( libfdata_btree_range_free( &( internal_tree->root_node_data_range ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free root node data range.", function ); result = -1; } if( ( internal_tree->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_tree->data_handle != NULL ) { if( internal_tree->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid list - missing free data handle function.", function ); result = -1; } else if( internal_tree->free_data_handle( &( internal_tree->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_tree ); } return( result ); } /* Clones (duplicates) the tree * Returns 1 if successful or -1 on error */ int libfdata_btree_clone( libfdata_btree_t **destination_tree, libfdata_btree_t *source_tree, libcerror_error_t **error ) { libfdata_internal_btree_t *internal_destination_tree = NULL; libfdata_internal_btree_t *internal_source_tree = NULL; intptr_t *destination_data_handle = NULL; static char *function = "libfdata_btree_clone"; if( destination_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination tree.", function ); return( -1 ); } if( *destination_tree != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination tree value already set.", function ); return( -1 ); } if( source_tree == NULL ) { *destination_tree = NULL; return( 1 ); } internal_source_tree = (libfdata_internal_btree_t *) source_tree; if( internal_source_tree->data_handle != NULL ) { if( internal_source_tree->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source tree - missing free data handle function.", function ); goto on_error; } if( internal_source_tree->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source tree - missing clone data handle function.", function ); goto on_error; } if( internal_source_tree->clone_data_handle( &destination_data_handle, internal_source_tree->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone data handle.", function ); goto on_error; } } internal_destination_tree = memory_allocate_structure( libfdata_internal_btree_t ); if( internal_destination_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination tree.", function ); goto on_error; } if( memory_set( internal_destination_tree, 0, sizeof( libfdata_internal_btree_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination tree.", function ); memory_free( internal_destination_tree ); return( -1 ); } if( internal_source_tree->data_handle != NULL ) { if( internal_source_tree->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source tree - missing free data handle function.", function ); goto on_error; } if( internal_source_tree->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source tree - missing clone data handle function.", function ); goto on_error; } if( internal_source_tree->clone_data_handle( &( internal_destination_tree->data_handle ), internal_source_tree->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to clone data handle.", function ); goto on_error; } } if( libfdata_btree_range_clone( &( internal_destination_tree->root_node_data_range ), internal_source_tree->root_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination root node data range.", function ); goto on_error; } if( libfcache_date_time_get_timestamp( &( internal_destination_tree->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve destination timestamp.", function ); goto on_error; } *destination_tree = (libfdata_btree_t *) internal_destination_tree; return( 1 ); on_error: if( internal_destination_tree != NULL ) { if( internal_destination_tree->root_node_data_range != NULL ) { libfdata_btree_range_free( &( internal_destination_tree->root_node_data_range ), NULL ); } if( ( internal_destination_tree->data_handle != NULL ) && ( internal_source_tree->free_data_handle != NULL ) ) { internal_source_tree->free_data_handle( &( internal_destination_tree->data_handle ), NULL ); } memory_free( internal_destination_tree ); } return( -1 ); } /* Cache entry functions */ /* Calculated the node cache entry index * Returns 1 if successful or -1 on error */ int libfdata_btree_calculate_node_cache_entry_index( libfdata_btree_t *tree, libfdata_cache_t *cache, int level LIBFDATA_ATTRIBUTE_UNUSED, int node_data_file_index LIBFDATA_ATTRIBUTE_UNUSED, off64_t node_data_offset, size64_t node_data_size LIBFDATA_ATTRIBUTE_UNUSED, uint32_t node_data_flags LIBFDATA_ATTRIBUTE_UNUSED, int *cache_entry_index, libcerror_error_t **error ) { static char *function = "libfdata_btree_calculate_node_cache_entry_index"; int number_of_cache_entries = 0; LIBFDATA_UNREFERENCED_PARAMETER( level ); LIBFDATA_UNREFERENCED_PARAMETER( node_data_file_index ); LIBFDATA_UNREFERENCED_PARAMETER( node_data_size ); LIBFDATA_UNREFERENCED_PARAMETER( node_data_flags ); if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( cache_entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache entry index.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } /* TODO improve cache entry index calculation */ if( number_of_cache_entries <= 4 ) { *cache_entry_index = node_data_offset % number_of_cache_entries; } else if( level == 0 ) { *cache_entry_index = 0; } else { *cache_entry_index = 1; /* Use 3/4 of the cache for the nodes */ number_of_cache_entries = ( ( number_of_cache_entries - 1 ) / 4 ) * 3; *cache_entry_index += node_data_offset % number_of_cache_entries; } return( 1 ); } /* Calculated the leaf value cache entry index * Returns 1 if successful or -1 on error */ int libfdata_btree_calculate_leaf_value_cache_entry_index( libfdata_btree_t *tree, libfdata_cache_t *cache, int leaf_value_index LIBFDATA_ATTRIBUTE_UNUSED, int leaf_value_data_file_index LIBFDATA_ATTRIBUTE_UNUSED, off64_t leaf_value_data_offset, size64_t leaf_value_data_size LIBFDATA_ATTRIBUTE_UNUSED, uint32_t leaf_value_data_flags LIBFDATA_ATTRIBUTE_UNUSED, int *cache_entry_index, libcerror_error_t **error ) { static char *function = "libfdata_btree_calculate_leaf_value_cache_entry_index"; int number_of_cache_entries = 0; LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_index ); LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_data_file_index ); LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_data_size ); LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_data_flags ); if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( cache_entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid cache entry index.", function ); return( -1 ); } if( libfcache_cache_get_number_of_entries( (libfcache_cache_t *) cache, &number_of_cache_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of cache entries.", function ); return( -1 ); } if( number_of_cache_entries <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of cache entries value out of bounds.", function ); return( -1 ); } /* TODO improve cache entry index calculation */ if( number_of_cache_entries <= 4 ) { *cache_entry_index = leaf_value_data_offset % number_of_cache_entries; } else { /* Use 1/4 of the cache for the leaf values */ *cache_entry_index = ( ( number_of_cache_entries - 1 ) / 4 ) * 3; number_of_cache_entries = ( number_of_cache_entries - 1 ) / 4; *cache_entry_index += leaf_value_data_offset % number_of_cache_entries; } return( 1 ); } /* Root node functions */ /* Retrieves the root node * Returns 1 if successful or -1 on error */ int libfdata_btree_get_root_node( libfdata_btree_t *tree, int *node_data_file_index, off64_t *node_data_offset, size64_t *node_data_size, uint32_t *node_data_flags, libcerror_error_t **error ) { libfdata_internal_btree_t *internal_tree = NULL; static char *function = "libfdata_btree_get_root_node"; intptr_t *key_value = NULL; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_btree_t *) tree; if( libfdata_btree_range_get( internal_tree->root_node_data_range, node_data_file_index, node_data_offset, node_data_size, node_data_flags, &key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve root node data range.", function ); return( -1 ); } return( 1 ); } /* Sets the root node * Returns 1 if successful or -1 on error */ int libfdata_btree_set_root_node( libfdata_btree_t *tree, int node_data_file_index, off64_t node_data_offset, size64_t node_data_size, uint32_t node_data_flags, libcerror_error_t **error ) { libfdata_internal_btree_t *internal_tree = NULL; intptr_t *key_value = NULL; static char *function = "libfdata_btree_set_root_node"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_btree_t *) tree; if( node_data_file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid node data file index less than zero.", function ); return( -1 ); } if( node_data_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid node data offset value less than zero.", function ); return( -1 ); } if( node_data_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid node data size value exceeds maximum.", function ); return( -1 ); } if( libfdata_btree_range_set( internal_tree->root_node_data_range, node_data_file_index, node_data_offset, node_data_size, node_data_flags, key_value, NULL, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set root node data range.", function ); return( -1 ); } if( libfcache_date_time_get_timestamp( &( internal_tree->timestamp ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache timestamp.", function ); return( -1 ); } return( 1 ); } /* Leaf value functions */ /* Reads the leaf value identified by the data range * Returns 1 if successful or -1 on error */ int libfdata_btree_read_leaf_value( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *leaf_value_data_range, intptr_t **leaf_value, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; intptr_t *key_value = NULL; static char *function = "libfdata_btree_read_leaf_value"; size64_t leaf_value_data_size = 0; off64_t cache_value_offset = 0; off64_t leaf_value_data_offset = 0; int64_t cache_value_timestamp = 0; uint32_t leaf_value_data_flags = 0; int cache_entry_index = -1; int cache_value_file_index = -1; int leaf_value_data_file_index = -1; int leaf_value_index = -1; int result = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( internal_tree->read_leaf_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing read leaf value function.", function ); return( -1 ); } if( leaf_value_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree leaf value data range.", function ); return( -1 ); } leaf_value_index = leaf_value_data_range->mapped_first_leaf_value_index; if( libfdata_btree_range_get( leaf_value_data_range, &leaf_value_data_file_index, &leaf_value_data_offset, &leaf_value_data_size, &leaf_value_data_flags, &key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range values.", function ); return( -1 ); } if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { if( internal_tree->calculate_leaf_value_cache_entry_index( (libfdata_btree_t *) internal_tree, cache, leaf_value_index, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, &cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate cache entry index.", function ); return( -1 ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( leaf_value_data_file_index == cache_value_file_index ) && ( leaf_value_data_offset == cache_value_offset ) && ( internal_tree->timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (entry: %d, want: %" PRIi64 ", got: %" PRIi64 ")\n", function, (intptr_t) cache, cache_entry_index, leaf_value_data_offset, cache_value_offset ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (entry: %d)\n", function, (intptr_t) cache, cache_entry_index ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading leaf value at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, leaf_value_data_offset, leaf_value_data_offset, leaf_value_data_size ); } #endif if( internal_tree->read_leaf_value( internal_tree->data_handle, file_io_handle, (libfdata_btree_t *) internal_tree, cache, leaf_value_index, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, key_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read leaf value at offset: %" PRIi64 ".", function, leaf_value_data_offset ); return( -1 ); } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); return( -1 ); } if( cache_value != NULL ) { if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); return( -1 ); } } if( ( leaf_value_data_file_index != cache_value_file_index ) || ( leaf_value_data_offset != cache_value_offset ) || ( internal_tree->timestamp != cache_value_timestamp ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing cache value.", function ); return( -1 ); } } if( libfcache_cache_value_get_value( cache_value, leaf_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value.", function ); return( -1 ); } return( 1 ); } /* Reads the node identified by the data range * Returns 1 if successful or -1 on error */ int libfdata_btree_read_node( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int level, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ) { libfcache_cache_value_t *cache_value = NULL; intptr_t *key_value = NULL; static char *function = "libfdata_btree_read_node"; size64_t node_data_size = 0; off64_t cache_value_offset = 0; off64_t node_data_offset = 0; int64_t cache_value_timestamp = 0; uint32_t node_data_flags = 0; int cache_entry_index = -1; int cache_value_file_index = -1; int node_data_file_index = -1; int result = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( internal_tree->read_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing read node function.", function ); return( -1 ); } if( node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree node data range.", function ); return( -1 ); } if( level < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid level value out of bounds.", function ); return( -1 ); } if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } *node = NULL; if( libfdata_btree_range_get( node_data_range, &node_data_file_index, &node_data_offset, &node_data_size, &node_data_flags, &key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node data range values.", function ); goto on_error; } if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) { if( internal_tree->calculate_node_cache_entry_index( (libfdata_btree_t *) internal_tree, cache, level, node_data_file_index, node_data_offset, node_data_size, node_data_flags, &cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate cache entry index.", function ); goto on_error; } if( libfcache_cache_get_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, &cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache entry: %d from cache.", function, cache_entry_index ); goto on_error; } if( cache_value != NULL ) { if( libfcache_cache_value_get_identifier( cache_value, &cache_value_file_index, &cache_value_offset, &cache_value_timestamp, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve cache value identifier.", function ); goto on_error; } } if( ( node_data_file_index == cache_value_file_index ) && ( node_data_offset == cache_value_offset ) && ( internal_tree->timestamp == cache_value_timestamp ) ) { result = 1; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( result == 0 ) { libcnotify_printf( "%s: cache: 0x%08" PRIjx " miss (entry: %d, want: %" PRIi64 ", got: %" PRIi64 ")\n", function, (intptr_t) cache, cache_entry_index, node_data_offset, cache_value_offset ); } else { libcnotify_printf( "%s: cache: 0x%08" PRIjx " hit (entry: %d)\n", function, (intptr_t) cache, cache_entry_index ); } } #endif } if( result == 0 ) { #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: reading node at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", function, node_data_offset, node_data_offset, node_data_size ); } #endif if( libfdata_btree_node_initialize( node, level, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create node at level: %d.", function, level ); goto on_error; } if( internal_tree->read_node( internal_tree->data_handle, file_io_handle, *node, node_data_file_index, node_data_offset, node_data_size, node_data_flags, key_value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read node at offset: %" PRIi64 ".", function, node_data_offset ); goto on_error; } if( ( read_flags & LIBFDATA_READ_FLAG_NO_CACHE ) == 0 ) { if( internal_tree->calculate_node_cache_entry_index( (libfdata_btree_t *) internal_tree, cache, level, node_data_file_index, node_data_offset, node_data_size, node_data_flags, &cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate cache entry index.", function ); goto on_error; } if( libfcache_cache_set_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, node_data_file_index, node_data_offset, internal_tree->timestamp, (intptr_t *) *node, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_btree_node_free, LIBFCACHE_CACHE_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set node in cache entry: %d.", function, cache_entry_index ); goto on_error; } } } else { if( libfcache_cache_value_get_value( cache_value, (intptr_t **) node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node value from cache.", function ); *node = NULL; goto on_error; } if( ( read_flags & LIBFDATA_READ_FLAG_NO_CACHE ) != 0 ) { /* Remove the node from the cache */ if( libfcache_cache_value_clear( cache_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to clear cache entry.", function ); *node = NULL; goto on_error; } } } return( 1 ); on_error: if( *node != NULL ) { libfdata_btree_node_free( node, NULL ); } return( -1 ); } /* Reads the sub tree * Returns 1 if successful or -1 on error */ int libfdata_btree_read_sub_tree( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int level, int mapped_first_leaf_value_index, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_range_t *leaf_value_data_range = NULL; libfdata_btree_range_t *sub_node_data_range = NULL; libfdata_btree_node_t *sub_node = NULL; intptr_t *key_value = NULL; static char *function = "libfdata_btree_read_sub_tree"; off64_t node_data_offset = 0; size64_t node_data_size = 0; uint32_t node_data_flags = 0; int branch_number_of_leaf_values = 0; int cache_entry_index = -1; int leaf_value_index = 0; int node_data_file_index = -1; int number_of_leaf_values = 0; int number_of_sub_nodes = 0; int result = 0; int sub_node_index = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( level < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid level value out of bounds.", function ); return( -1 ); } if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } /* Note that the node data range can be cached out later in the function. */ if( libfdata_btree_range_get( node_data_range, &node_data_file_index, &node_data_offset, &node_data_size, &node_data_flags, &key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve data range from tree node.", function ); goto on_error; } /* Make sure to not have the node cached here to prevent it from * being freed during recursing the sub tree. */ if( libfdata_btree_read_node( internal_tree, file_io_handle, cache, node_data_range, level, node, read_flags | LIBFDATA_READ_FLAG_NO_CACHE, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read node.", function ); goto on_error; } if( *node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); goto on_error; } if( ( ( (libfdata_internal_btree_node_t *) *node )->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { result = libfdata_btree_node_is_leaf( *node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if node is a leaf node.", function, sub_node_index ); goto on_error; } else if( result != 0 ) { if( libfdata_btree_node_get_number_of_leaf_values( *node, &number_of_leaf_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf values.", function ); goto on_error; } for( leaf_value_index = 0; leaf_value_index < number_of_leaf_values; leaf_value_index++ ) { if( libfdata_btree_node_get_leaf_value_data_range_by_index( *node, leaf_value_index, &leaf_value_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value: %d data range.", function, leaf_value_index ); goto on_error; } if( leaf_value_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing leaf value: %d data range.", function, leaf_value_index ); goto on_error; } leaf_value_data_range->mapped_first_leaf_value_index = mapped_first_leaf_value_index; leaf_value_data_range->mapped_last_leaf_value_index = -1; leaf_value_data_range->mapped_number_of_leaf_values = 1; mapped_first_leaf_value_index++; } branch_number_of_leaf_values = number_of_leaf_values; /* TODO*/ level++; } else { if( libfdata_btree_node_get_number_of_sub_nodes( *node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); goto on_error; } level++; for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libfdata_btree_node_get_sub_node_data_range_by_index( *node, sub_node_index, &sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node: %d data range.", function, sub_node_index ); goto on_error; } if( sub_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing sub node: %d data range.", function, sub_node_index ); goto on_error; } if( libfdata_btree_read_sub_tree( internal_tree, file_io_handle, cache, sub_node_data_range, level, mapped_first_leaf_value_index, &sub_node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read sub node: %d sub tree.", function, sub_node_index ); goto on_error; } if( libfdata_btree_node_get_number_of_leaf_values_in_branch( sub_node, &number_of_leaf_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf values in branch.", function ); goto on_error; } sub_node_data_range->mapped_first_leaf_value_index = mapped_first_leaf_value_index; mapped_first_leaf_value_index += number_of_leaf_values; sub_node_data_range->mapped_last_leaf_value_index = mapped_first_leaf_value_index - 1; sub_node_data_range->mapped_number_of_leaf_values = number_of_leaf_values; branch_number_of_leaf_values += number_of_leaf_values; } } ( (libfdata_internal_btree_node_t *) *node )->branch_number_of_leaf_values = branch_number_of_leaf_values; ( (libfdata_internal_btree_node_t *) *node )->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } if( internal_tree->calculate_node_cache_entry_index( (libfdata_btree_t *) internal_tree, cache, level, node_data_file_index, node_data_offset, node_data_size, node_data_flags, &cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate cache entry index.", function ); goto on_error; } if( libfcache_cache_set_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, node_data_file_index, node_data_offset, internal_tree->timestamp, (intptr_t *) *node, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_btree_node_free, LIBFCACHE_CACHE_VALUE_FLAG_MANAGED, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set node in cache entry: %d.", function, cache_entry_index ); goto on_error; } return( 1 ); on_error: if( *node != NULL ) { libfdata_btree_node_free( node, NULL ); } return( -1 ); } /* Retrieves a leaf node the contains a specific leaf value index * Returns 1 if successful or -1 on error */ int libfdata_btree_get_leaf_node_by_index( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int level, int leaf_value_index, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_range_t *sub_node_data_range = NULL; static char *function = "libfdata_btree_get_leaf_node_by_index"; int result = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node data range.", function ); return( -1 ); } if( level < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid level value out of bounds.", function ); return( -1 ); } if( leaf_value_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid leaf value index value out of bounds.", function ); return( -1 ); } if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } if( libfdata_btree_read_sub_tree( internal_tree, file_io_handle, cache, node_data_range, level, node_data_range->mapped_first_leaf_value_index, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read node sub tree.", function ); return( -1 ); } if( *node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } result = libfdata_btree_node_is_leaf( *node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if node is a leaf node.", function ); return( -1 ); } else if( result != 0 ) { return( 1 ); } if( libfdata_btree_node_get_sub_node_data_range_by_mapped_index( *node, leaf_value_index, &sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node data range for leaf value: %d..", function, leaf_value_index ); return( -1 ); } *node = NULL; if( libfdata_btree_get_leaf_node_by_index( internal_tree, file_io_handle, cache, sub_node_data_range, level + 1, leaf_value_index, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node for leaf value: %d.", function, leaf_value_index ); return( -1 ); } return( 1 ); } /* Retrieves a leaf node for a specific key value * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_get_leaf_node_by_key( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int maximum_node_level, int current_node_level, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *node_index, libfdata_btree_node_t **node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_range_t *sub_node_data_range = NULL; static char *function = "libfdata_btree_get_leaf_node_by_key"; int result = 0; int sub_node_index = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node data range.", function ); return( -1 ); } if( maximum_node_level < -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid maximum node level value out of bounds.", function ); return( -1 ); } if( current_node_level < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid current node level value out of bounds.", function ); return( -1 ); } if( node_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node index.", function ); return( -1 ); } if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } if( libfdata_btree_read_sub_tree( internal_tree, file_io_handle, cache, node_data_range, current_node_level, node_data_range->mapped_first_leaf_value_index, node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read node sub tree.", function ); return( -1 ); } if( *node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } result = libfdata_btree_node_is_leaf( *node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if node is a leaf node.", function ); return( -1 ); } else if( result != 0 ) { return( 1 ); } if( ( maximum_node_level != LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED ) && ( current_node_level >= maximum_node_level ) ) { return( 1 ); } result = libfdata_btree_node_get_sub_node_data_range_by_key( *node, key_value, key_value_compare_function, &sub_node_index, &sub_node_data_range, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node data range by key.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } *node_index = sub_node_index; *node = NULL; result = libfdata_btree_get_leaf_node_by_key( internal_tree, file_io_handle, cache, sub_node_data_range, maximum_node_level, current_node_level + 1, key_value, key_value_compare_function, node_index, node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node by key.", function ); return( -1 ); } return( result ); } /* Retrieves the next leaf node for a specific key value * * This function will try to determine the next node based * on the node_index and node values. * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_get_next_leaf_node_by_key( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int node_index, libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *next_node_index, libfdata_btree_node_t **next_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_node_t *branch_node = NULL; libfdata_btree_range_t *sub_node_data_range = NULL; static char *function = "libfdata_btree_get_next_leaf_node_by_key"; int branch_node_index = 0; int branch_node_level = 0; int node_level = 0; int number_of_sub_nodes = 0; int result = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( node_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid node index value out of bounds.", function ); return( -1 ); } if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } if( libfdata_btree_node_get_level( node, &node_level, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node level.", function ); return( -1 ); } if( node_level == 0 ) { return( 0 ); } branch_node_level = node_level; while( branch_node_level > 0 ) { branch_node_level--; result = libfdata_btree_get_leaf_node_by_key( internal_tree, file_io_handle, cache, node_data_range, branch_node_level, 0, key_value, key_value_compare_function, &branch_node_index, &branch_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve branch node at level: %d.", function, branch_node_level ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfdata_btree_node_get_number_of_sub_nodes( branch_node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( ( node_index < 0 ) || ( node_index >= number_of_sub_nodes ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid node index value out of bounds.", function ); return( -1 ); } node_index++; if( node_index < number_of_sub_nodes ) { if( libfdata_btree_node_get_sub_node_data_range_by_index( branch_node, node_index, &sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next sub node: %d data range.", function, node_index ); return( -1 ); } result = libfdata_btree_get_leaf_node_by_key( internal_tree, file_io_handle, cache, sub_node_data_range, LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED, branch_node_level + 1, key_value, key_value_compare_function, next_node_index, next_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve branch node at level: %d.", function, branch_node_level ); return( -1 ); } return( result ); } /* If no next leaf node is available try the next branch */ node_index = branch_node_index; } return( 0 ); } /* Retrieves the previous leaf node for a specific key value * * This function will try to determine the previous node based * on the node_index and node values. * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_get_previous_leaf_node_by_key( libfdata_internal_btree_t *internal_tree, intptr_t *file_io_handle, libfdata_cache_t *cache, libfdata_btree_range_t *node_data_range, int node_index, libfdata_btree_node_t *node, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), int *previous_node_index, libfdata_btree_node_t **previous_node, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_node_t *branch_node = NULL; libfdata_btree_range_t *sub_node_data_range = NULL; static char *function = "libfdata_btree_get_previous_leaf_node_by_key"; int branch_node_index = 0; int branch_node_level = 0; int node_level = 0; int number_of_sub_nodes = 0; int result = 0; if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( node_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid node index value out of bounds.", function ); return( -1 ); } if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing node.", function ); return( -1 ); } if( libfdata_btree_node_get_level( node, &node_level, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve node level.", function ); return( -1 ); } if( node_level == 0 ) { return( 0 ); } branch_node_level = node_level; while( branch_node_level > 0 ) { branch_node_level--; result = libfdata_btree_get_leaf_node_by_key( internal_tree, file_io_handle, cache, node_data_range, branch_node_level, 0, key_value, key_value_compare_function, &branch_node_index, &branch_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve branch node at level: %d.", function, branch_node_level ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfdata_btree_node_get_number_of_sub_nodes( branch_node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( ( node_index < 0 ) || ( node_index >= number_of_sub_nodes ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid node index value out of bounds.", function ); return( -1 ); } node_index--; if( node_index >= 0 ) { if( libfdata_btree_node_get_sub_node_data_range_by_index( branch_node, node_index, &sub_node_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous sub node: %d data range.", function, node_index ); return( -1 ); } result = libfdata_btree_get_leaf_node_by_key( internal_tree, file_io_handle, cache, sub_node_data_range, LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED, branch_node_level + 1, key_value, key_value_compare_function, previous_node_index, previous_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve branch node at level: %d.", function, branch_node_level ); return( -1 ); } return( result ); } /* If no previous leaf node is available try the previous branch */ node_index = branch_node_index; } return( 0 ); } /* Retrieves the number of leaf values in the tree * Returns 1 if successful or -1 on error */ int libfdata_btree_get_number_of_leaf_values( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int *number_of_values, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_node_t *root_node = NULL; libfdata_internal_btree_t *internal_tree = NULL; static char *function = "libfdata_btree_get_number_of_leaf_values"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_btree_t *) tree; if( internal_tree->root_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing root node data range.", function ); return( -1 ); } if( libfdata_btree_read_sub_tree( internal_tree, file_io_handle, cache, internal_tree->root_node_data_range, 0, 0, &root_node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read root node sub tree.", function ); return( -1 ); } if( libfdata_btree_node_get_number_of_leaf_values_in_branch( root_node, number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of leaf values in branch.", function ); return( -1 ); } return( 1 ); } /* Retrieves a leaf value at a specific index * Returns 1 if successful or -1 on error */ int libfdata_btree_get_leaf_value_by_index( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, int leaf_value_index, intptr_t **value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_node_t *node = NULL; libfdata_btree_range_t *leaf_value_data_range = NULL; libfdata_internal_btree_t *internal_tree = NULL; static char *function = "libfdata_btree_get_leaf_value_by_index"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_btree_t *) tree; if( internal_tree->root_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing root node data range.", function ); return( -1 ); } if( libfdata_btree_get_leaf_node_by_index( internal_tree, file_io_handle, cache, internal_tree->root_node_data_range, 0, leaf_value_index, &node, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node.", function ); return( -1 ); } if( libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( node, leaf_value_index, &leaf_value_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range.", function ); return( -1 ); } if( libfdata_btree_read_leaf_value( internal_tree, file_io_handle, cache, leaf_value_data_range, value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read leaf value.", function ); return( -1 ); } return( 1 ); } /* Sets a specific leaf value * * If the flag LIBFDATA_BTREE_LEAF_VALUE_FLAG_MANAGED is set the vector * takes over management of the value and the value is freed when * no longer needed. * * Returns 1 if successful or -1 on error */ int libfdata_btree_set_leaf_value_by_index( libfdata_btree_t *tree, intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, libfdata_cache_t *cache, int leaf_value_index, intptr_t *leaf_value, int (*free_leaf_value)( intptr_t **leaf_value, libcerror_error_t **error ), uint8_t write_flags, libcerror_error_t **error ) { libfdata_btree_node_t *node = NULL; libfdata_btree_range_t *leaf_value_data_range = NULL; libfdata_internal_btree_t *internal_tree = NULL; intptr_t *key_value = NULL; static char *function = "libfdata_btree_set_leaf_value_by_index"; off64_t leaf_value_data_offset = 0; size64_t leaf_value_data_size = 0; uint32_t leaf_value_data_flags = 0; int cache_entry_index = -1; int leaf_value_data_file_index = -1; LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_btree_t *) tree; if( internal_tree->root_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing root node data range.", function ); return( -1 ); } if( libfdata_btree_get_leaf_node_by_index( internal_tree, file_io_handle, cache, internal_tree->root_node_data_range, 0, leaf_value_index, &node, 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node.", function ); return( -1 ); } if( libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( node, leaf_value_index, &leaf_value_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range.", function ); return( -1 ); } if( libfdata_btree_range_get( leaf_value_data_range, &leaf_value_data_file_index, &leaf_value_data_offset, &leaf_value_data_size, &leaf_value_data_flags, &key_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range values.", function ); return( -1 ); } if( internal_tree->calculate_leaf_value_cache_entry_index( (libfdata_btree_t *) internal_tree, cache, leaf_value_index, leaf_value_data_file_index, leaf_value_data_offset, leaf_value_data_size, leaf_value_data_flags, &cache_entry_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate cache entry index.", function ); return( -1 ); } if( libfcache_cache_set_value_by_index( (libfcache_cache_t *) cache, cache_entry_index, leaf_value_data_file_index, leaf_value_data_offset, internal_tree->timestamp, leaf_value, free_leaf_value, write_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set leaf value in cache entry: %d.", function, cache_entry_index ); return( -1 ); } return( 1 ); } /* Retrieves a leaf value for a specific key value * * Uses the key_value_compare_function to determine the similarity of the key values * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libfdata_btree_get_leaf_value_by_key( libfdata_btree_t *tree, intptr_t *file_io_handle, libfdata_cache_t *cache, intptr_t *key_value, int (*key_value_compare_function)( intptr_t *first_key_value, intptr_t *second_key_value, libcerror_error_t **error ), uint8_t search_flags, intptr_t **value, uint8_t read_flags, libcerror_error_t **error ) { libfdata_btree_node_t *leaf_node = NULL; libfdata_btree_range_t *leaf_value_data_range = NULL; libfdata_internal_btree_t *internal_tree = NULL; static char *function = "libfdata_btree_get_leaf_value_by_key"; int leaf_node_index = 0; int leaf_node_level = 0; int node_index = 0; int result = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libfdata_internal_btree_t *) tree; if( internal_tree->root_node_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid tree - missing root node data range.", function ); return( -1 ); } if( ( search_flags & ~( LIBFDATA_BTREE_SEARCH_FLAG_SCAN_PREVIOUS_NODE | LIBFDATA_BTREE_SEARCH_FLAG_SCAN_NEXT_NODE ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported search flags.", function ); return( -1 ); } result = libfdata_btree_get_leaf_node_by_key( internal_tree, file_io_handle, cache, internal_tree->root_node_data_range, LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED, 0, key_value, key_value_compare_function, &node_index, &leaf_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node.", function ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfdata_btree_node_get_level( leaf_node, &leaf_node_level, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf node level.", function ); return( -1 ); } result = libfdata_btree_node_get_leaf_value_data_range_by_key( leaf_node, key_value, key_value_compare_function, &leaf_value_data_range, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve leaf value data range.", function ); return( -1 ); } if( ( result == 0 ) && ( ( search_flags & LIBFDATA_BTREE_SEARCH_FLAG_SCAN_PREVIOUS_NODE ) != 0 ) ) { result = libfdata_btree_get_previous_leaf_node_by_key( internal_tree, file_io_handle, cache, internal_tree->root_node_data_range, node_index, leaf_node, key_value, key_value_compare_function, &leaf_node_index, &leaf_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous leaf node.", function ); return( -1 ); } else if( result != 0 ) { result = libfdata_btree_node_get_leaf_value_data_range_by_key( leaf_node, key_value, key_value_compare_function, &leaf_value_data_range, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous leaf value data range.", function ); return( -1 ); } } } if( ( result == 0 ) && ( ( search_flags & LIBFDATA_BTREE_SEARCH_FLAG_SCAN_NEXT_NODE ) != 0 ) ) { result = libfdata_btree_get_next_leaf_node_by_key( internal_tree, file_io_handle, cache, internal_tree->root_node_data_range, node_index, leaf_node, key_value, key_value_compare_function, &leaf_node_index, &leaf_node, read_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next leaf node.", function ); return( -1 ); } else if( result != 0 ) { result = libfdata_btree_node_get_leaf_value_data_range_by_key( leaf_node, key_value, key_value_compare_function, &leaf_value_data_range, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next leaf value data range.", function ); return( -1 ); } } } if( result != 0 ) { if( libfdata_btree_read_leaf_value( internal_tree, file_io_handle, cache, leaf_value_data_range, value, read_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read leaf value.", function ); return( -1 ); } } return( result ); } libewf-20140807/libfdata/libfdata_unused.h0000664000175000017500000000254613443450051022407 0ustar00lordyestalordyesta00000000000000/* * The internal unused definition * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_UNUSED_H ) #define _LIBFDATA_INTERNAL_UNUSED_H #include #if !defined( LIBFDATA_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBFDATA_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBFDATA_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBFDATA_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBFDATA_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBFDATA_INTERNAL_UNUSED_H ) */ libewf-20140807/libfdata/libfdata_error.h0000664000175000017500000000340513443450051022230 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_ERROR_H ) #define _LIBFDATA_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBFDATA ) #include #endif #include "libfdata_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFDATA ) LIBFDATA_EXTERN \ void libfdata_error_free( libfdata_error_t **error ); LIBFDATA_EXTERN \ int libfdata_error_fprint( libfdata_error_t *error, FILE *stream ); LIBFDATA_EXTERN \ int libfdata_error_sprint( libfdata_error_t *error, char *string, size_t size ); LIBFDATA_EXTERN \ int libfdata_error_backtrace_fprint( libfdata_error_t *error, FILE *stream ); LIBFDATA_EXTERN \ int libfdata_error_backtrace_sprint( libfdata_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_ERROR_H ) */ libewf-20140807/libfdata/Makefile.in0000664000175000017500000011312313443455350021153 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libfdata ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfdata_la_LIBADD = am__libfdata_la_SOURCES_DIST = libfdata_area.c libfdata_area.h \ libfdata_btree.c libfdata_btree.h libfdata_btree_node.c \ libfdata_btree_node.h libfdata_btree_range.c \ libfdata_btree_range.h libfdata_cache.c libfdata_cache.h \ libfdata_definitions.h libfdata_error.c libfdata_error.h \ libfdata_extern.h libfdata_inline.h libfdata_libcdata.h \ libfdata_libcerror.h libfdata_libcnotify.h \ libfdata_libfcache.h libfdata_list.c libfdata_list.h \ libfdata_list_element.c libfdata_list_element.h \ libfdata_mapped_range.c libfdata_mapped_range.h \ libfdata_notify.c libfdata_notify.h libfdata_range.c \ libfdata_range.h libfdata_range_list.c libfdata_range_list.h \ libfdata_segments_array.c libfdata_segments_array.h \ libfdata_stream.c libfdata_stream.h libfdata_support.c \ libfdata_support.h libfdata_tree.c libfdata_tree.h \ libfdata_tree_node.c libfdata_tree_node.h libfdata_types.h \ libfdata_unused.h libfdata_vector.c libfdata_vector.h @HAVE_LOCAL_LIBFDATA_TRUE@am_libfdata_la_OBJECTS = libfdata_area.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_node.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_range.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_cache.lo libfdata_error.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list_element.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_mapped_range.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_notify.lo libfdata_range.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_range_list.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_segments_array.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_stream.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_support.lo libfdata_tree.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_tree_node.lo \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_vector.lo libfdata_la_OBJECTS = $(am_libfdata_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBFDATA_TRUE@am_libfdata_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libfdata_area.Plo \ ./$(DEPDIR)/libfdata_btree.Plo \ ./$(DEPDIR)/libfdata_btree_node.Plo \ ./$(DEPDIR)/libfdata_btree_range.Plo \ ./$(DEPDIR)/libfdata_cache.Plo ./$(DEPDIR)/libfdata_error.Plo \ ./$(DEPDIR)/libfdata_list.Plo \ ./$(DEPDIR)/libfdata_list_element.Plo \ ./$(DEPDIR)/libfdata_mapped_range.Plo \ ./$(DEPDIR)/libfdata_notify.Plo ./$(DEPDIR)/libfdata_range.Plo \ ./$(DEPDIR)/libfdata_range_list.Plo \ ./$(DEPDIR)/libfdata_segments_array.Plo \ ./$(DEPDIR)/libfdata_stream.Plo \ ./$(DEPDIR)/libfdata_support.Plo ./$(DEPDIR)/libfdata_tree.Plo \ ./$(DEPDIR)/libfdata_tree_node.Plo \ ./$(DEPDIR)/libfdata_vector.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libfdata_la_SOURCES) DIST_SOURCES = $(am__libfdata_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBFDATA_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBFDATA_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBFDATA_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ @HAVE_LOCAL_LIBFDATA_TRUE@ @LIBFCACHE_CPPFLAGS@ \ @HAVE_LOCAL_LIBFDATA_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBFDATA_TRUE@noinst_LTLIBRARIES = libfdata.la @HAVE_LOCAL_LIBFDATA_TRUE@libfdata_la_SOURCES = \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_area.c libfdata_area.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree.c libfdata_btree.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_node.c libfdata_btree_node.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_range.c libfdata_btree_range.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_cache.c libfdata_cache.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_definitions.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_error.c libfdata_error.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_extern.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_inline.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libcdata.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libcerror.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libcnotify.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libfcache.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list.c libfdata_list.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list_element.c libfdata_list_element.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_mapped_range.c libfdata_mapped_range.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_notify.c libfdata_notify.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_range.c libfdata_range.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_range_list.c libfdata_range_list.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_segments_array.c libfdata_segments_array.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_stream.c libfdata_stream.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_support.c libfdata_support.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_tree.c libfdata_tree.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_tree_node.c libfdata_tree_node.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_types.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_unused.h \ @HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_vector.c libfdata_vector.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libfdata/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libfdata/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfdata.la: $(libfdata_la_OBJECTS) $(libfdata_la_DEPENDENCIES) $(EXTRA_libfdata_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libfdata_la_rpath) $(libfdata_la_OBJECTS) $(libfdata_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_area.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_btree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_btree_node.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_btree_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_cache.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_list_element.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_mapped_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_range_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_segments_array.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_tree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_tree_node.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_vector.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libfdata_area.Plo -rm -f ./$(DEPDIR)/libfdata_btree.Plo -rm -f ./$(DEPDIR)/libfdata_btree_node.Plo -rm -f ./$(DEPDIR)/libfdata_btree_range.Plo -rm -f ./$(DEPDIR)/libfdata_cache.Plo -rm -f ./$(DEPDIR)/libfdata_error.Plo -rm -f ./$(DEPDIR)/libfdata_list.Plo -rm -f ./$(DEPDIR)/libfdata_list_element.Plo -rm -f ./$(DEPDIR)/libfdata_mapped_range.Plo -rm -f ./$(DEPDIR)/libfdata_notify.Plo -rm -f ./$(DEPDIR)/libfdata_range.Plo -rm -f ./$(DEPDIR)/libfdata_range_list.Plo -rm -f ./$(DEPDIR)/libfdata_segments_array.Plo -rm -f ./$(DEPDIR)/libfdata_stream.Plo -rm -f ./$(DEPDIR)/libfdata_support.Plo -rm -f ./$(DEPDIR)/libfdata_tree.Plo -rm -f ./$(DEPDIR)/libfdata_tree_node.Plo -rm -f ./$(DEPDIR)/libfdata_vector.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libfdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdata_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libfdata/libfdata_cache.h0000664000175000017500000000272513443450051022146 0ustar00lordyestalordyesta00000000000000/* * Cache functions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_CACHE_H ) #define _LIBFDATA_INTERNAL_CACHE_H #include #include #include "libfdata_extern.h" #include "libfdata_libcerror.h" #include "libfdata_types.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBFDATA ) LIBFDATA_EXTERN \ int libfdata_cache_initialize( libfdata_cache_t **cache, int maximum_cache_entries, libcerror_error_t **error ); LIBFDATA_EXTERN \ int libfdata_cache_free( libfdata_cache_t **cache, libcerror_error_t **error ); #endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBFDATA_INTERNAL_CACHE_H ) */ libewf-20140807/libfdata/libfdata_stream.c0000664000175000017500000017550013443450051022373 0ustar00lordyestalordyesta00000000000000/* * The stream functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #if defined( HAVE_UNISTD_H ) #include #endif #include "libfdata_definitions.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_mapped_range.h" #include "libfdata_range.h" #include "libfdata_segments_array.h" #include "libfdata_stream.h" #include "libfdata_types.h" #include "libfdata_unused.h" /* Creates a stream * Make sure the value stream is referencing, is set to NULL * * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the stream * takes over management of the data handle and the data handle is freed when * no longer needed * * Returns 1 if successful or -1 on error */ int libfdata_stream_initialize( libfdata_stream_t **stream, intptr_t *data_handle, int (*free_data_handle)( intptr_t **data_handle, libcerror_error_t **error ), int (*clone_data_handle)( intptr_t **destination_data_handle, intptr_t *source_data_handle, libcerror_error_t **error ), int (*create_segment)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ), ssize_t (*read_segment_data)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t read_flags, libcerror_error_t **error ), ssize_t (*write_segment_data)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, const uint8_t *segment_data, size_t segment_data_size, uint32_t segment_flags, uint8_t write_flags, libcerror_error_t **error ), off64_t (*seek_segment_offset)( intptr_t *data_handle, intptr_t *file_io_handle, int segment_index, int segment_file_index, off64_t segment_offset, libcerror_error_t **error ), uint8_t flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_initialize"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( *stream != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid stream value already set.", function ); return( -1 ); } if( ( flags & 0xfe ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported flags: 0x%02" PRIx8 ".", function ); return( -1 ); } internal_stream = memory_allocate_structure( libfdata_internal_stream_t ); if( internal_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create stream.", function ); goto on_error; } if( memory_set( internal_stream, 0, sizeof( libfdata_internal_stream_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear stream.", function ); memory_free( internal_stream ); return( -1 ); } if( libcdata_array_initialize( &( internal_stream->segments_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segments array.", function ); goto on_error; } if( libcdata_array_initialize( &( internal_stream->mapped_ranges_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped ranges array.", function ); goto on_error; } internal_stream->flags |= flags; internal_stream->data_handle = data_handle; internal_stream->free_data_handle = free_data_handle; internal_stream->clone_data_handle = clone_data_handle; internal_stream->create_segment = create_segment; internal_stream->read_segment_data = read_segment_data; internal_stream->write_segment_data = write_segment_data; internal_stream->seek_segment_offset = seek_segment_offset; *stream = (libfdata_stream_t *) internal_stream; return( 1 ); on_error: if( internal_stream != NULL ) { if( internal_stream->segments_array != NULL ) { libcdata_array_free( &( internal_stream->segments_array ), NULL, NULL ); } memory_free( internal_stream ); } return( -1 ); } /* Frees a stream * Returns 1 if successful or -1 on error */ int libfdata_stream_free( libfdata_stream_t **stream, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_free"; int result = 1; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } if( *stream != NULL ) { internal_stream = (libfdata_internal_stream_t *) *stream; *stream = NULL; if( libcdata_array_free( &( internal_stream->segments_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the segments array.", function ); result = -1; } if( libcdata_array_free( &( internal_stream->mapped_ranges_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free the mapped ranges array.", function ); result = -1; } if( ( internal_stream->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) { if( internal_stream->data_handle != NULL ) { if( internal_stream->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source stream - missing free data handle function.", function ); result = -1; } else if( internal_stream->free_data_handle( &( internal_stream->data_handle ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free data handle.", function ); result = -1; } } } memory_free( internal_stream ); } return( result ); } /* Clones (duplicates) the stream * Returns 1 if successful or -1 on error */ int libfdata_stream_clone( libfdata_stream_t **destination_stream, libfdata_stream_t *source_stream, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_destination_stream = NULL; libfdata_internal_stream_t *internal_source_stream = NULL; static char *function = "libfdata_stream_clone"; if( destination_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination stream.", function ); return( -1 ); } if( *destination_stream != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: destination stream already set.", function ); return( -1 ); } if( source_stream == NULL ) { *destination_stream = NULL; return( 1 ); } internal_source_stream = (libfdata_internal_stream_t *) source_stream; internal_destination_stream = memory_allocate_structure( libfdata_internal_stream_t ); if( internal_destination_stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination stream.", function ); goto on_error; } if( memory_set( internal_destination_stream, 0, sizeof( libfdata_internal_stream_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear destination stream.", function ); memory_free( internal_destination_stream ); return( -1 ); } if( internal_source_stream->data_handle != NULL ) { if( internal_source_stream->free_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source stream - missing free data handle function.", function ); goto on_error; } if( internal_source_stream->clone_data_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid source stream - missing clone data handle function.", function ); goto on_error; } if( internal_source_stream->clone_data_handle( &( internal_destination_stream->data_handle ), internal_source_stream->data_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination data handle.", function ); goto on_error; } } if( libcdata_array_clone( &( internal_destination_stream->segments_array ), internal_source_stream->segments_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination segments array.", function ); goto on_error; } if( libcdata_array_clone( &( internal_destination_stream->mapped_ranges_array ), internal_source_stream->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination mapped ranges array.", function ); goto on_error; } internal_destination_stream->flags = internal_source_stream->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; internal_destination_stream->free_data_handle = internal_source_stream->free_data_handle; internal_destination_stream->clone_data_handle = internal_source_stream->clone_data_handle; internal_destination_stream->create_segment = internal_source_stream->create_segment; internal_destination_stream->read_segment_data = internal_source_stream->read_segment_data; internal_destination_stream->write_segment_data = internal_source_stream->write_segment_data; internal_destination_stream->seek_segment_offset = internal_source_stream->seek_segment_offset; *destination_stream = (libfdata_stream_t *) internal_destination_stream; return( 1 ); on_error: if( internal_destination_stream != NULL ) { if( internal_destination_stream->segments_array != NULL ) { libcdata_array_free( &( internal_destination_stream->segments_array ), (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, NULL ); } if( ( internal_destination_stream->data_handle != NULL ) && ( internal_source_stream->free_data_handle != NULL ) ) { internal_source_stream->free_data_handle( &( internal_destination_stream->data_handle ), NULL ); } memory_free( internal_destination_stream ); } return( -1 ); } /* Segment functions */ /* Empties the stream * Returns 1 if successful or -1 on error */ int libfdata_stream_empty( libfdata_stream_t *stream, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_empty"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libcdata_array_empty( internal_stream->segments_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty segments array.", function ); return( -1 ); } if( libcdata_array_empty( internal_stream->mapped_ranges_array, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty mapped ranges array.", function ); return( -1 ); } internal_stream->size = 0; return( 1 ); } /* Resizes the stream * Returns 1 if successful or -1 on error */ int libfdata_stream_resize( libfdata_stream_t *stream, int number_of_segments, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_resize"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libcdata_array_resize( internal_stream->segments_array, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize segments array.", function ); return( -1 ); } if( libcdata_array_resize( internal_stream->mapped_ranges_array, number_of_segments, (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize mapped ranges array.", function ); return( -1 ); } internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Reverses the order of the segments * Returns 1 if successful or -1 on error */ int libfdata_stream_reverse( libfdata_stream_t *stream, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_reverse"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libcdata_array_reverse( internal_stream->segments_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to reverse segments array.", function ); return( -1 ); } internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Retrieves the number of segments * Returns 1 if successful or -1 on error */ int libfdata_stream_get_number_of_segments( libfdata_stream_t *stream, int *number_of_segments, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_get_number_of_segments"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libcdata_array_get_number_of_entries( internal_stream->segments_array, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from segments array.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libfdata_stream_get_segment_by_index( libfdata_stream_t *stream, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_get_segment_by_index"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libfdata_segments_array_get_segment_by_index( internal_stream->segments_array, segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d.", function, segment_index ); return( -1 ); } return( 1 ); } /* Sets a specific segment * Returns 1 if successful or -1 on error */ int libfdata_stream_set_segment_by_index( libfdata_stream_t *stream, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_set_segment_by_index"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libfdata_segments_array_set_segment_by_index( internal_stream->segments_array, internal_stream->mapped_ranges_array, &( internal_stream->size ), segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment: %d.", function, segment_index ); return( -1 ); } internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Prepends a segment * Returns 1 if successful or -1 on error */ int libfdata_stream_prepend_segment( libfdata_stream_t *stream, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_prepend_segment"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libfdata_segments_array_prepend_segment( internal_stream->segments_array, internal_stream->mapped_ranges_array, &( internal_stream->size ), segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend segment.", function ); return( -1 ); } internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; return( 1 ); } /* Appends a segment * Returns 1 if successful or -1 on error */ int libfdata_stream_append_segment( libfdata_stream_t *stream, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_append_segment"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libfdata_segments_array_append_segment( internal_stream->segments_array, internal_stream->mapped_ranges_array, &( internal_stream->size ), segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment.", function ); return( -1 ); } return( 1 ); } /* Sets the mapped size * The mapped size cannot be larger than the stream size * A value of 0 is equivalent for the stream size * Returns 1 if successful or -1 on error */ int libfdata_stream_set_mapped_size( libfdata_stream_t *stream, size64_t mapped_size, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_set_mapped_size"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( mapped_size > internal_stream->size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid mapped size value out of bounds.", function ); return( -1 ); } internal_stream->mapped_size = mapped_size; return( 1 ); } /* Mapped range functions */ /* Retrieves the mapped range of a specific segment * Returns 1 if successful or -1 on error */ int libfdata_stream_get_segment_mapped_range( libfdata_stream_t *stream, int segment_index, off64_t *mapped_range_offset, size64_t *mapped_range_size, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_stream_get_segment_mapped_range"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( libcdata_array_get_entry_by_index( internal_stream->mapped_ranges_array, segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, segment_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, mapped_range_offset, mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, segment_index ); return( -1 ); } return( 1 ); } /* Retrieves the segment index for a specific offset * The segment_data_offset value is set to the offset relative to the start of the segment * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_stream_get_segment_index_at_offset( libfdata_stream_t *stream, off64_t offset, int *segment_index, off64_t *segment_data_offset, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; libfdata_mapped_range_t *mapped_range = NULL; static char *function = "libfdata_stream_get_segment_index_at_offset"; off64_t mapped_range_end_offset = 0; off64_t mapped_range_start_offset = 0; size64_t mapped_range_size = 0; size64_t stream_size = 0; int initial_segment_index = 0; int number_of_segments = 0; int result = 0; int search_segment_index = 0; #if defined( HAVE_DEBUG_OUTPUT ) libfdata_range_t *segment_data_range = NULL; off64_t segment_offset = 0; size64_t segment_size = 0; uint32_t segment_flags = 0; int segment_file_index = -1; #endif if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid offset value less than zero.", function ); return( -1 ); } if( segment_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment index.", function ); return( -1 ); } if( segment_data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment data offset.", function ); return( -1 ); } if( ( internal_stream->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_segments_array_calculate_mapped_ranges( internal_stream->segments_array, internal_stream->mapped_ranges_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); return( -1 ); } internal_stream->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: requested offset: 0x%08" PRIx64 "\n", function, offset ); } #endif if( internal_stream->mapped_size != 0 ) { stream_size = internal_stream->mapped_size; } else { stream_size = internal_stream->size; } if( stream_size == 0 ) { return( 0 ); } if( libcdata_array_get_number_of_entries( internal_stream->mapped_ranges_array, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from mapped ranges array.", function ); return( -1 ); } /* This assumes a fairly even distribution of the sizes of the segments */ initial_segment_index = (int) ( ( number_of_segments * offset ) / stream_size ); /* Look for the corresponding segment upwards in the array */ for( search_segment_index = initial_segment_index; search_segment_index < number_of_segments; search_segment_index++ ) { if( libcdata_array_get_entry_by_index( internal_stream->mapped_ranges_array, search_segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, search_segment_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, &mapped_range_start_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, search_segment_index ); return( -1 ); } mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; if( mapped_range_end_offset < mapped_range_start_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment: %d - mapped range value out of bounds.", function, search_segment_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, search_segment_index, mapped_range_start_offset, mapped_range_end_offset, mapped_range_size ); } #endif /* Check if the offset is in the mapped range */ if( ( offset >= mapped_range_start_offset ) && ( offset < mapped_range_end_offset ) ) { offset -= mapped_range_start_offset; break; } /* Check if the offset is out of bounds */ if( offset < mapped_range_start_offset ) { search_segment_index = number_of_segments; break; } } if( search_segment_index >= number_of_segments ) { /* Look for the corresponding segment downwards in the array */ for( search_segment_index = initial_segment_index; search_segment_index >= 0; search_segment_index-- ) { if( libcdata_array_get_entry_by_index( internal_stream->mapped_ranges_array, search_segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, search_segment_index ); return( -1 ); } if( libfdata_mapped_range_get( mapped_range, &mapped_range_start_offset, &mapped_range_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to retrieve values from mapped range: %d.", function, search_segment_index ); return( -1 ); } mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; if( mapped_range_end_offset < mapped_range_start_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment: %d - mapped range value out of bounds.", function, search_segment_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, search_segment_index, mapped_range_start_offset, mapped_range_end_offset, mapped_range_size ); } #endif /* Check if the offset is in the mapped range */ if( ( offset >= mapped_range_start_offset ) && ( offset < mapped_range_end_offset ) ) { offset -= mapped_range_start_offset; break; } /* Check if the offset is out of bounds */ if( offset > mapped_range_start_offset ) { search_segment_index--; break; } } } if( ( search_segment_index >= 0 ) && ( search_segment_index < number_of_segments ) ) { if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid offset value out of bounds.", function ); return( -1 ); } *segment_data_offset = offset; #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { if( libcdata_array_get_entry_by_index( internal_stream->segments_array, search_segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, search_segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, search_segment_index ); return( -1 ); } libcnotify_printf( "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, search_segment_index, segment_file_index, segment_offset, segment_offset + segment_size, segment_size ); } #endif result = 1; } if( result == 1 ) { *segment_index = search_segment_index; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( result ); } /* Retrieves the segment for a specific offset * The segment_data_offset value is set to the offset relative to the start of the segment * Returns 1 if successful, 0 if not or -1 on error */ int libfdata_stream_get_segment_at_offset( libfdata_stream_t *stream, off64_t offset, int *segment_index, off64_t *segment_data_offset, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_stream_get_segment_at_offset"; int result = 0; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( segment_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment index.", function ); return( -1 ); } result = libfdata_stream_get_segment_index_at_offset( stream, offset, segment_index, segment_data_offset, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment index at offset: 0x%08" PRIx64 ".", function, offset ); return( -1 ); } else if( result != 0 ) { if( libcdata_array_get_entry_by_index( internal_stream->segments_array, *segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, *segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, *segment_index ); return( -1 ); } } return( result ); } /* IO functions */ /* Reads data from the current offset into a buffer * Returns the number of bytes read or -1 on error */ ssize_t libfdata_stream_read_buffer( libfdata_stream_t *stream, intptr_t *file_io_handle, uint8_t *buffer, size_t buffer_size, uint8_t read_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_stream_read_buffer"; off64_t result_offset = 0; off64_t segment_offset = 0; size64_t segment_size = 0; size64_t segment_data_size = 0; size64_t stream_size = 0; size_t buffer_offset = 0; size_t read_size = 0; ssize_t read_count = 0; uint32_t segment_flags = 0; int segment_file_index = 0; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( internal_stream->read_segment_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid stream - missing read segment data function.", function ); return( -1 ); } if( internal_stream->seek_segment_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid stream - missing seek segment offset function.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( internal_stream->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - current offset value out of bounds.", function ); return( -1 ); } if( internal_stream->mapped_size != 0 ) { stream_size = internal_stream->mapped_size; } else { stream_size = internal_stream->size; } /* Bail out early for requests to read empty buffers and beyond the end of the stream */ if( ( buffer_size == 0 ) || ( (size64_t) internal_stream->current_offset >= stream_size ) ) { return( 0 ); } if( (size64_t) ( internal_stream->current_offset + buffer_size ) > stream_size ) { buffer_size = (size_t) ( stream_size - internal_stream->current_offset ); } if( libcdata_array_get_entry_by_index( internal_stream->segments_array, internal_stream->current_segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, internal_stream->current_segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, internal_stream->current_segment_index ); return( -1 ); } if( ( internal_stream->segment_data_offset < 0 ) || ( (size64_t) internal_stream->segment_data_offset >= segment_size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - segment data offset value out of bounds.", function ); return( -1 ); } segment_offset += internal_stream->segment_data_offset; segment_data_size = segment_size - internal_stream->segment_data_offset; result_offset = internal_stream->seek_segment_offset( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, segment_file_index, segment_offset, error ); if( result_offset != segment_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek segment: %d offset: %" PRIi64 ".", function, internal_stream->current_segment_index, segment_offset ); return( -1 ); } while( buffer_size > 0 ) { if( (size64_t) buffer_size <= segment_data_size ) { read_size = buffer_size; } else { read_size = (size_t) segment_data_size; } if( read_size == 0 ) { break; } read_count = internal_stream->read_segment_data( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, segment_file_index, &( buffer[ buffer_offset ]), read_size, segment_flags, read_flags, error ); if( read_count != (ssize_t) read_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read segment: %d data at offset: 0x%08" PRIx64 ".", function, internal_stream->current_segment_index, segment_offset ); return( -1 ); } internal_stream->current_offset += read_size; internal_stream->segment_data_offset += read_size; segment_offset += read_size; segment_data_size -= read_size; buffer_size -= read_size; buffer_offset += read_size; if( (size64_t) internal_stream->current_offset >= stream_size ) { break; } if( (size64_t) internal_stream->segment_data_offset >= segment_size ) { if( (size64_t) internal_stream->segment_data_offset > segment_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - segment data offset value out of bounds.", function ); return( -1 ); } internal_stream->current_segment_index++; internal_stream->segment_data_offset = 0; if( libcdata_array_get_entry_by_index( internal_stream->segments_array, internal_stream->current_segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, internal_stream->current_segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, internal_stream->current_segment_index ); return( -1 ); } segment_data_size = segment_size; result_offset = internal_stream->seek_segment_offset( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, segment_file_index, segment_offset, error ); if( result_offset != segment_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek segment: %d offset: %" PRIi64 ".", function, internal_stream->current_segment_index, segment_offset ); return( -1 ); } } } return( (ssize_t) buffer_offset ); } /* Reads data at a specific offset into a buffer * Returns the number of bytes read or -1 on error */ ssize_t libfdata_stream_read_buffer_at_offset( libfdata_stream_t *stream, intptr_t *file_io_handle, uint8_t *buffer, size_t buffer_size, off64_t offset, uint8_t read_flags, libcerror_error_t **error ) { static char *function = "libfdata_stream_read_buffer_at_offset"; ssize_t read_count = 0; if( libfdata_stream_seek_offset( stream, offset, SEEK_SET, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek offset.", function ); return( -1 ); } read_count = libfdata_stream_read_buffer( stream, file_io_handle, buffer, buffer_size, read_flags, error ); if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, "%s: unable to read buffer.", function ); return( -1 ); } return( read_count ); } /* Writes data in the buffer to the current offset * Returns the number of bytes written or -1 on error */ ssize_t libfdata_stream_write_buffer( libfdata_stream_t *stream, intptr_t *file_io_handle, const uint8_t *buffer, size_t buffer_size, uint8_t write_flags, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_stream_write_buffer"; off64_t result_offset = 0; off64_t segment_offset = 0; size64_t segment_size = 0; size64_t segment_data_size = 0; size_t buffer_offset = 0; size_t write_size = 0; ssize_t write_count = 0; uint32_t segment_flags = 0; int number_of_segments = 0; int result = 0; int segment_file_index = 0; int segment_index = 0; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( internal_stream->create_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid stream - missing create segment function.", function ); return( -1 ); } if( internal_stream->write_segment_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid stream - missing write segment data function.", function ); return( -1 ); } if( internal_stream->seek_segment_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid stream - missing seek segment offset function.", function ); return( -1 ); } if( buffer == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid buffer.", function ); return( -1 ); } if( buffer_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid buffer size value exceeds maximum.", function ); return( -1 ); } if( internal_stream->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - current offset value out of bounds.", function ); return( -1 ); } /* Bail out early for requests to write empty buffers */ if( buffer_size == 0 ) { return( 0 ); } if( libcdata_array_get_number_of_entries( internal_stream->segments_array, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from segments array.", function ); return( -1 ); } if( (size64_t) internal_stream->current_offset < internal_stream->size ) { if( libcdata_array_get_entry_by_index( internal_stream->segments_array, internal_stream->current_segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, internal_stream->current_segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, internal_stream->current_segment_index ); return( -1 ); } if( ( internal_stream->segment_data_offset < 0 ) || ( (size64_t) internal_stream->segment_data_offset >= segment_size ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - segment data offset value out of bounds.", function ); return( -1 ); } segment_offset += internal_stream->segment_data_offset; segment_data_size = segment_size - internal_stream->segment_data_offset; } else while( (size64_t) internal_stream->current_offset >= internal_stream->size ) { if( internal_stream->current_segment_index < number_of_segments ) { internal_stream->current_segment_index++; } internal_stream->segment_data_offset = 0; result = internal_stream->create_segment( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment: %d.", function, internal_stream->current_segment_index ); return( -1 ); } else if( result == 0 ) { return( 0 ); } if( libfdata_stream_append_segment( stream, &segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment to stream.", function ); return( -1 ); } if( internal_stream->current_segment_index != segment_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } number_of_segments++; segment_data_size = segment_size; } result_offset = internal_stream->seek_segment_offset( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, segment_file_index, segment_offset, error ); if( result_offset != segment_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek segment: %d offset: %" PRIi64 ".", function, internal_stream->current_segment_index, segment_offset ); return( -1 ); } while( buffer_size > 0 ) { if( (size64_t) buffer_size <= segment_data_size ) { write_size = buffer_size; } else { write_size = (size_t) segment_data_size; } if( write_size == 0 ) { break; } write_count = internal_stream->write_segment_data( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, segment_file_index, &( buffer[ buffer_offset ] ), write_size, segment_flags, write_flags, error ); if( write_count != (ssize_t) write_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, "%s: unable to write segment: %d data at offset: 0x%08" PRIx64 ".", function, internal_stream->current_segment_index, segment_offset + internal_stream->segment_data_offset ); return( -1 ); } internal_stream->current_offset += write_size; internal_stream->segment_data_offset += write_size; segment_offset += write_size; segment_data_size -= write_size; buffer_size -= write_size; buffer_offset += write_size; if( (size64_t) internal_stream->segment_data_offset >= segment_size ) { if( (size64_t) internal_stream->segment_data_offset > segment_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - segment data offset value out of bounds.", function ); return( -1 ); } internal_stream->current_segment_index++; internal_stream->segment_data_offset = 0; if( internal_stream->current_segment_index < number_of_segments ) { if( libcdata_array_get_entry_by_index( internal_stream->segments_array, internal_stream->current_segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, internal_stream->current_segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, internal_stream->current_segment_index ); return( -1 ); } } else { result = internal_stream->create_segment( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment: %d.", function, internal_stream->current_segment_index ); return( -1 ); } else if( result == 0 ) { break; } if( libfdata_stream_append_segment( stream, &segment_index, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append segment to stream.", function ); return( -1 ); } if( internal_stream->current_segment_index != segment_index ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } number_of_segments++; } segment_data_size = segment_size; result_offset = internal_stream->seek_segment_offset( internal_stream->data_handle, file_io_handle, internal_stream->current_segment_index, segment_file_index, segment_offset, error ); if( result_offset != segment_offset ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, "%s: unable to seek segment: %d offset: %" PRIi64 ".", function, internal_stream->current_segment_index, segment_offset ); return( -1 ); } } } return( (ssize_t) buffer_offset ); } /* Seeks a certain offset of the data * Returns the offset if seek is successful or -1 on error */ off64_t libfdata_stream_seek_offset( libfdata_stream_t *stream, off64_t offset, int whence, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_seek_offset"; off64_t segment_data_offset = 0; size64_t stream_size = 0; int segment_index = 0; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( internal_stream->current_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid stream - current offset value out of bounds.", function ); return( -1 ); } if( ( whence != SEEK_CUR ) && ( whence != SEEK_END ) && ( whence != SEEK_SET ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported whence.", function ); return( -1 ); } if( internal_stream->mapped_size != 0 ) { stream_size = internal_stream->mapped_size; } else { stream_size = internal_stream->size; } if( whence == SEEK_CUR ) { offset += internal_stream->current_offset; } else if( whence == SEEK_END ) { offset += (off64_t) stream_size; } #if defined( HAVE_VERBOSE_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: seeking offset: %" PRIi64 ".\n", function, offset ); } #endif if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: offset value out of bounds.", function ); return( -1 ); } if( offset < (off64_t) stream_size ) { if( libfdata_stream_get_segment_index_at_offset( stream, offset, &segment_index, &segment_data_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment index at offset: 0x%08" PRIx64 ".", function, offset ); return( -1 ); } } else { if( libcdata_array_get_number_of_entries( internal_stream->segments_array, &segment_index, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from segments array.", function ); return( -1 ); } segment_data_offset = 0; } internal_stream->current_segment_index = segment_index; internal_stream->current_offset = offset; internal_stream->segment_data_offset = segment_data_offset; return( offset ); } /* Retrieves the offset * Returns 1 if successful or -1 on error */ int libfdata_stream_get_offset( libfdata_stream_t *stream, off64_t *offset, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_get_data_offset"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } *offset = internal_stream->current_offset; return( 1 ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int libfdata_stream_get_size( libfdata_stream_t *stream, size64_t *size, libcerror_error_t **error ) { libfdata_internal_stream_t *internal_stream = NULL; static char *function = "libfdata_stream_get_size"; if( stream == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid stream.", function ); return( -1 ); } internal_stream = (libfdata_internal_stream_t *) stream; if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( ( internal_stream->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) { if( libfdata_segments_array_calculate_mapped_ranges( internal_stream->segments_array, internal_stream->mapped_ranges_array, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to calculate mapped ranges.", function ); return( -1 ); } internal_stream->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); } if( internal_stream->mapped_size != 0 ) { *size = internal_stream->mapped_size; } else { *size = internal_stream->size; } return( 1 ); } libewf-20140807/libfdata/libfdata_segments_array.c0000664000175000017500000005143113443450051024117 0ustar00lordyestalordyesta00000000000000/* * The segments array functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_libcdata.h" #include "libfdata_libcerror.h" #include "libfdata_libcnotify.h" #include "libfdata_mapped_range.h" #include "libfdata_range.h" #include "libfdata_segments_array.h" /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libfdata_segments_array_get_segment_by_index( libcdata_array_t *segments_array, int segment_index, int *segment_file_index, off64_t *segment_offset, size64_t *segment_size, uint32_t *segment_flags, libcerror_error_t **error ) { libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_segments_array_get_segment_by_index"; if( libcdata_array_get_entry_by_index( segments_array, segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, segment_index ); return( -1 ); } return( 1 ); } /* Sets the offset and size of a specific segment * Returns 1 if successful or -1 on error */ int libfdata_segments_array_set_segment_by_index( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, size64_t *data_size, int segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_mapped_range_t *mapped_range = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_segments_array_set_segment_by_index"; off64_t previous_segment_offset = 0; size64_t previous_segment_size = 0; uint32_t previous_segment_flags = 0; int previous_segment_file_index = 0; if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } if( segment_file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment file index value out of bounds.", function ); return( -1 ); } if( segment_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment offset value out of bounds.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( segments_array, segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, segment_index ); return( -1 ); } if( segment_data_range == NULL ) { if( libfdata_range_initialize( &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment data range.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( segments_array, segment_index, (intptr_t *) segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d to segments array.", function, segment_index ); libfdata_range_free( &segment_data_range, NULL ); return( -1 ); } } else { if( libfdata_range_get( segment_data_range, &previous_segment_file_index, &previous_segment_offset, &previous_segment_size, &previous_segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, segment_index ); return( -1 ); } *data_size -= previous_segment_size; } if( libfdata_range_set( segment_data_range, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment data range values.", function ); return( -1 ); } /* Make sure there is a mapped range entry for every segment */ if( libcdata_array_get_entry_by_index( mapped_ranges_array, segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, segment_index ); return( -1 ); } if( mapped_range == NULL ) { if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); return( -1 ); } if( libcdata_array_set_entry_by_index( mapped_ranges_array, segment_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set entry: %d in mapped ranges array.", function, segment_index ); libfdata_mapped_range_free( &mapped_range, NULL ); return( -1 ); } } *data_size += segment_size; return( 1 ); } /* Prepends a segment * Returns 1 if successful or -1 on error */ int libfdata_segments_array_prepend_segment( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, size64_t *data_size, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_mapped_range_t *mapped_range = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_segments_array_prepend_segment"; int mapped_range_index = -1; if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } if( segment_file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment file index value out of bounds.", function ); return( -1 ); } if( segment_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment offset value out of bounds.", function ); return( -1 ); } if( segment_size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment size value out of bounds.", function ); return( -1 ); } if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); goto on_error; } if( libfdata_mapped_range_set( mapped_range, (off64_t) *data_size, segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range values.", function ); goto on_error; } if( libcdata_array_append_entry( mapped_ranges_array, &mapped_range_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append mapped range to array.", function ); goto on_error; } if( libfdata_range_initialize( &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment data range.", function ); goto on_error; } if( libfdata_range_set( segment_data_range, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment data range values.", function ); goto on_error; } if( libcdata_array_prepend_entry( segments_array, (intptr_t *) segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend data range to segments array.", function ); goto on_error; } *data_size += segment_size; return( 1 ); on_error: if( segment_data_range != NULL ) { libfdata_range_free( &segment_data_range, NULL ); } if( mapped_range_index != -1 ) { libcdata_array_set_entry_by_index( mapped_ranges_array, mapped_range_index, NULL, NULL ); } if( mapped_range != NULL ) { libfdata_mapped_range_free( &mapped_range, NULL ); } return( -1 ); } /* Appends a segment * Returns 1 if successful or -1 on error */ int libfdata_segments_array_append_segment( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, size64_t *data_size, int *segment_index, int segment_file_index, off64_t segment_offset, size64_t segment_size, uint32_t segment_flags, libcerror_error_t **error ) { libfdata_mapped_range_t *mapped_range = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_segments_array_append_segment"; int mapped_range_index = -1; if( data_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid data size.", function ); return( -1 ); } if( segment_file_index < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment file index value out of bounds.", function ); return( -1 ); } if( segment_offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment offset value out of bounds.", function ); return( -1 ); } if( libfdata_mapped_range_initialize( &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create mapped range.", function ); goto on_error; } if( libfdata_mapped_range_set( mapped_range, (off64_t) *data_size, segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range values.", function ); goto on_error; } if( libcdata_array_append_entry( mapped_ranges_array, &mapped_range_index, (intptr_t *) mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append mapped range to array.", function ); goto on_error; } if( libfdata_range_initialize( &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create segment data range.", function ); goto on_error; } if( libfdata_range_set( segment_data_range, segment_file_index, segment_offset, segment_size, segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set segment data range values.", function ); goto on_error; } if( libcdata_array_append_entry( segments_array, segment_index, (intptr_t *) segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append data range to segments array.", function ); goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, *segment_index, segment_file_index, segment_offset, segment_offset + segment_size, segment_size ); libcnotify_printf( "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, *segment_index, *data_size, *data_size + segment_size, segment_size ); libcnotify_printf( "\n" ); } #endif *data_size += segment_size; return( 1 ); on_error: if( segment_data_range != NULL ) { libfdata_range_free( &segment_data_range, NULL ); } if( mapped_range_index != -1 ) { libcdata_array_set_entry_by_index( mapped_ranges_array, mapped_range_index, NULL, NULL ); } if( mapped_range != NULL ) { libfdata_mapped_range_free( &mapped_range, NULL ); } return( -1 ); } /* Calculates the mapped ranges from the segments * Returns 1 if successful or -1 on error */ int libfdata_segments_array_calculate_mapped_ranges( libcdata_array_t *segments_array, libcdata_array_t *mapped_ranges_array, libcerror_error_t **error ) { libfdata_mapped_range_t *mapped_range = NULL; libfdata_range_t *segment_data_range = NULL; static char *function = "libfdata_segments_array_calculate_mapped_ranges"; off64_t mapped_offset = 0; off64_t segment_offset = 0; size64_t segment_size = 0; uint32_t segment_flags = 0; int number_of_segments = 0; int segment_file_index = 0; int segment_index = 0; if( libcdata_array_get_number_of_entries( segments_array, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of entries from segments array.", function ); return( -1 ); } for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { if( libcdata_array_get_entry_by_index( segments_array, segment_index, (intptr_t **) &segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from segments array.", function, segment_index ); return( -1 ); } if( libcdata_array_get_entry_by_index( mapped_ranges_array, segment_index, (intptr_t **) &mapped_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve entry: %d from mapped ranges array.", function, segment_index ); return( -1 ); } if( libfdata_range_get( segment_data_range, &segment_file_index, &segment_offset, &segment_size, &segment_flags, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment: %d data range values.", function, segment_index ); return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, segment_index, segment_file_index, segment_offset, segment_offset + segment_size, segment_size ); libcnotify_printf( "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", function, segment_index, mapped_offset, mapped_offset + segment_size, segment_size ); } #endif if( libfdata_mapped_range_set( mapped_range, mapped_offset, segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set mapped range: %d values.", function, segment_index ); return( -1 ); } mapped_offset += (off64_t) segment_size; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( "\n" ); } #endif return( 1 ); } /* Retrieves the segment data range for a specific offset * Returns 1 if successful or -1 on error */ int libfdata_segments_array_get_data_range_at_offset( libcdata_array_t *segments_array, off64_t value_offset, off64_t *segment_data_offset, libfdata_range_t **segment_data_range, libcerror_error_t **error ) { static char *function = "libfdata_segments_array_get_data_range_at_offset"; size64_t segment_size = 0; int number_of_segments = 0; int segment_index = 0; if( segment_data_offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment data offset.", function ); return( -1 ); } if( segment_data_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid segment data range.", function ); return( -1 ); } if( libcdata_array_get_number_of_entries( segments_array, &number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of segments.", function ); return( -1 ); } if( number_of_segments <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of segments value out of bounds.", function ); return( -1 ); } for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { if( libcdata_array_get_entry_by_index( segments_array, segment_index, (intptr_t **) segment_data_range, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve segment data range: %d from array.", function, segment_index ); return( -1 ); } if( libfdata_range_get_size( *segment_data_range, &segment_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve size from segment data range: %d.", function, segment_index ); return( -1 ); } /* TODO what about compressed data ranges */ if( (size64_t) value_offset < segment_size ) { *segment_data_offset = value_offset; break; } value_offset -= segment_size; } if( segment_index >= number_of_segments ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } return( 1 ); } libewf-20140807/libfdata/libfdata_mapped_range.c0000664000175000017500000001525413443450051023521 0ustar00lordyestalordyesta00000000000000/* * The (data) mapped range functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_libcerror.h" #include "libfdata_mapped_range.h" /* Creates a mapped range * Make sure the value mapped_range is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_mapped_range_initialize( libfdata_mapped_range_t **mapped_range, libcerror_error_t **error ) { static char *function = "libfdata_mapped_range_initialize"; if( mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mapped range.", function ); return( -1 ); } if( *mapped_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid mapped range value already set.", function ); return( -1 ); } *mapped_range = memory_allocate_structure( libfdata_mapped_range_t ); if( *mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create mapped range.", function ); goto on_error; } if( memory_set( *mapped_range, 0, sizeof( libfdata_mapped_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear mapped range.", function ); goto on_error; } ( *mapped_range )->offset = (off64_t) -1; return( 1 ); on_error: if( *mapped_range != NULL ) { memory_free( *mapped_range ); *mapped_range = NULL; } return( -1 ); } /* Frees a mapped range * Returns 1 if successful or -1 on error */ int libfdata_mapped_range_free( libfdata_mapped_range_t **mapped_range, libcerror_error_t **error ) { static char *function = "libfdata_mapped_range_free"; if( mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mapped range.", function ); return( -1 ); } if( *mapped_range != NULL ) { memory_free( *mapped_range ); *mapped_range = NULL; } return( 1 ); } /* Clones (duplicates) the mapped range * Returns 1 if successful or -1 on error */ int libfdata_mapped_range_clone( libfdata_mapped_range_t **destination_mapped_range, libfdata_mapped_range_t *source_mapped_range, libcerror_error_t **error ) { static char *function = "libfdata_mapped_range_clone"; if( destination_mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination mapped range.", function ); return( -1 ); } if( *destination_mapped_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination mapped range value already set.", function ); return( -1 ); } if( source_mapped_range == NULL ) { *destination_mapped_range = NULL; return( 1 ); } *destination_mapped_range = memory_allocate_structure( libfdata_mapped_range_t ); if( *destination_mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination mapped range.", function ); goto on_error; } if( memory_copy( *destination_mapped_range, source_mapped_range, sizeof( libfdata_mapped_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination mapped range.", function ); goto on_error; } return( 1 ); on_error: if( *destination_mapped_range != NULL ) { memory_free( *destination_mapped_range ); *destination_mapped_range = NULL; } return( -1 ); } /* Retrieves the mapped range values * Returns 1 if successful or -1 on error */ int libfdata_mapped_range_get( libfdata_mapped_range_t *mapped_range, off64_t *offset, size64_t *size, libcerror_error_t **error ) { static char *function = "libfdata_mapped_range_get"; if( mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mapped range.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } *offset = mapped_range->offset; *size = mapped_range->size; return( 1 ); } /* Sets the mapped range values * Returns 1 if successful or -1 on error */ int libfdata_mapped_range_set( libfdata_mapped_range_t *mapped_range, off64_t offset, size64_t size, libcerror_error_t **error ) { static char *function = "libfdata_mapped_range_set"; if( mapped_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid mapped range.", function ); return( -1 ); } if( offset < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid offset value less than zero.", function ); return( -1 ); } if( size > (size64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } mapped_range->offset = offset; mapped_range->size = size; return( 1 ); } libewf-20140807/libfdata/libfdata_definitions.h0000664000175000017500000001550213443450051023413 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2010-2018, 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( _LIBFDATA_INTERNAL_DEFINITIONS_H ) #define _LIBFDATA_INTERNAL_DEFINITIONS_H #include /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata */ #if !defined( HAVE_LOCAL_LIBFDATA ) #include /* The definitions in are copied here * for local use of libfdata */ #else #define LIBFDATA_VERSION 20181124 /* The libfdata version string */ #define LIBFDATA_VERSION_STRING "20181124" /* The library flag definitions */ enum LIBFDATA_FLAGS { /* The data is not managed by the library */ LIBFDATA_FLAG_DATA_NON_MANAGED = 0x00, /* The data is managed by the library */ LIBFDATA_FLAG_DATA_MANAGED = 0x01, /* The mapped ranges need to be calculated */ LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES = 0x80 }; /* The area element value flag definitions */ enum LIBFDATA_AREA_ELEMENT_VALUE_FLAGS { LIBFDATA_AREA_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_AREA_ELEMENT_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The balanced tree leaf value flag definitions */ enum LIBFDATA_BTREE_LEAF_VALUE_FLAGS { LIBFDATA_BTREE_LEAF_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_BTREE_LEAF_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The data handle flag definitions */ enum LIBFDATA_DATA_HANDLE_FLAGS { LIBFDATA_DATA_HANDLE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_DATA_HANDLE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The key value flag definitions */ enum LIBFDATA_KEY_VALUE_FLAGS { LIBFDATA_KEY_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_KEY_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The list element value flag definitions */ enum LIBFDATA_LIST_ELEMENT_VALUE_FLAGS { LIBFDATA_LIST_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The range list value flag definitions */ enum LIBFDATA_RANGE_LIST_VALUE_FLAGS { LIBFDATA_RANGE_LIST_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_RANGE_LIST_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The tree node value flag definitions */ enum LIBFDATA_TREE_NODE_VALUE_FLAGS { LIBFDATA_TREE_NODE_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_TREE_NODE_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The vector element value flag definitions */ enum LIBFDATA_VECTOR_ELEMENT_VALUE_FLAGS { LIBFDATA_VECTOR_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, LIBFDATA_VECTOR_ELEMENT_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED }; /* The comparison function definitions */ enum LIBFDATA_COMPARE_DEFINITIONS { /* The first value is less than the second value */ LIBFDATA_COMPARE_LESS, /* The first value is less equal than the second value */ LIBFDATA_COMPARE_LESS_EQUAL, /* The first and second values are equal */ LIBFDATA_COMPARE_EQUAL, /* The first value is greater than the second value */ LIBFDATA_COMPARE_GREATER, /* The first value is greater equal than the second value */ LIBFDATA_COMPARE_GREATER_EQUAL }; /* The range flag definitions */ enum LIBFDATA_RANGE_FLAGS { /* The range is sparse */ LIBFDATA_RANGE_FLAG_IS_SPARSE = 0x00000001UL, /* The range is compressed */ LIBFDATA_RANGE_FLAG_IS_COMPRESSED = 0x00000002UL, /* User defined flags */ LIBFDATA_RANGE_FLAG_USER_DEFINED_1 = 0x00000100UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_2 = 0x00000200UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_3 = 0x00000400UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_4 = 0x00000800UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_5 = 0x00001000UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_6 = 0x00002000UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_7 = 0x00004000UL, LIBFDATA_RANGE_FLAG_USER_DEFINED_8 = 0x00008000UL, }; #define LIBFDATA_RANGE_FLAG_MAXIMUM \ LIBFDATA_RANGE_FLAG_USER_DEFINED_8 /* The read flag definitions */ enum LIBFDATA_READ_FLAGS { /* Flag to indicate cached data should be ignored */ LIBFDATA_READ_FLAG_IGNORE_CACHE = 0x01, /* Internal flag to indicate data should not be cached */ LIBFDATA_READ_FLAG_NO_CACHE = 0x80 }; /* The btree search flag definitions */ enum LIBFDATA_BTREE_SEARCH_FLAGS { /* Flag to additionally scan the previous node */ LIBFDATA_BTREE_SEARCH_FLAG_SCAN_PREVIOUS_NODE = 0x01, /* Flag to additionally scan the next node */ LIBFDATA_BTREE_SEARCH_FLAG_SCAN_NEXT_NODE = 0x02 }; /* The tree node flag definitions */ enum LIBFDATA_TREE_NODE_FLAGS { /* The node is a leaf */ LIBFDATA_TREE_NODE_FLAG_IS_LEAF = 0x02, /* The node is virtual */ LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL = 0x04, /* The node is deleted */ LIBFDATA_TREE_NODE_FLAG_IS_DELETED = 0x08, /* The sub nodes data range was set */ LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET = 0x10, /* The sub nodes have been read */ LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ = 0x20, /* The node data has been read (at least once) */ LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ = 0x40 }; /* The tree node insert flag definitions */ enum LIBFDATA_TREE_NODE_INSERT_FLAGS { /* Allow duplicate sub node values */ LIBFDATA_TREE_NODE_INSERT_FLAG_NON_UNIQUE_SUB_NODE_VALUES = 0x00, /* Only allow unique sub node values, no duplicates */ LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_SUB_NODE_VALUES = 0x01 }; #endif /* The btree node flag definitions */ enum LIBFDATA_BTREE_NODE_FLAGS { /* The node is a branch */ LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH = 0x02, /* The node is a leaf */ LIBFDATA_BTREE_NODE_FLAG_IS_LEAF = 0x04 }; #define LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED -1 /* The list flag definitions */ enum LIBFDATA_LIST_FLAGS { LIBFDATA_LIST_FLAG_HAS_MAPPED_OFFSET = 0x10 }; /* The list element flag definitions */ enum LIBFDATA_LIST_ELEMENT_FLAGS { LIBFDATA_LIST_ELEMENT_FLAG_HAS_MAPPED_SIZE = 0x10 }; #endif libewf-20140807/libfdata/libfdata_range.c0000664000175000017500000001575713443450051022203 0ustar00lordyestalordyesta00000000000000/* * The range functions * * Copyright (C) 2010-2018, 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 . */ #include #include #include #include "libfdata_libcerror.h" #include "libfdata_range.h" /* Creates a range * Make sure the value range is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libfdata_range_initialize( libfdata_range_t **range, libcerror_error_t **error ) { static char *function = "libfdata_range_initialize"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( *range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid range value already set.", function ); return( -1 ); } *range = memory_allocate_structure( libfdata_range_t ); if( *range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create range.", function ); goto on_error; } if( memory_set( *range, 0, sizeof( libfdata_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear range.", function ); goto on_error; } ( *range )->file_index = -1; ( *range )->offset = (off64_t) -1; return( 1 ); on_error: if( *range != NULL ) { memory_free( *range ); *range = NULL; } return( -1 ); } /* Frees a range * Returns 1 if successful or -1 on error */ int libfdata_range_free( libfdata_range_t **range, libcerror_error_t **error ) { static char *function = "libfdata_range_free"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( *range != NULL ) { memory_free( *range ); *range = NULL; } return( 1 ); } /* Clones (duplicates) the range * Returns 1 if successful or -1 on error */ int libfdata_range_clone( libfdata_range_t **destination_range, libfdata_range_t *source_range, libcerror_error_t **error ) { static char *function = "libfdata_range_clone"; if( destination_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range.", function ); return( -1 ); } if( *destination_range != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination range value already set.", function ); return( -1 ); } if( source_range == NULL ) { *destination_range = NULL; return( 1 ); } *destination_range = memory_allocate_structure( libfdata_range_t ); if( *destination_range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination range.", function ); goto on_error; } if( memory_copy( *destination_range, source_range, sizeof( libfdata_range_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination range.", function ); goto on_error; } return( 1 ); on_error: if( *destination_range != NULL ) { memory_free( *destination_range ); *destination_range = NULL; } return( -1 ); } /* Retrieves the range values * Returns 1 if successful or -1 on error */ int libfdata_range_get( libfdata_range_t *range, int *file_index, off64_t *offset, size64_t *size, uint32_t *flags, libcerror_error_t **error ) { static char *function = "libfdata_range_get"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( file_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid file index.", function ); return( -1 ); } if( offset == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid offset.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } if( flags == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid flags.", function ); return( -1 ); } *file_index = range->file_index; *offset = range->offset; *size = range->size; *flags = range->flags; return( 1 ); } /* Retrieves the size * Returns 1 if successful or -1 on error */ int libfdata_range_get_size( libfdata_range_t *range, size64_t *size, libcerror_error_t **error ) { static char *function = "libfdata_range_get_size"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } if( size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid size.", function ); return( -1 ); } *size = range->size; return( 1 ); } /* Sets the range values * Returns 1 if successful or -1 on error */ int libfdata_range_set( libfdata_range_t *range, int file_index, off64_t offset, size64_t size, uint32_t flags, libcerror_error_t **error ) { static char *function = "libfdata_range_set"; if( range == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range.", function ); return( -1 ); } range->file_index = file_index; range->offset = offset; range->size = size; range->flags = flags; return( 1 ); } libewf-20140807/libcdata/0000775000175000017500000000000013443455444017106 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcdata/libcdata_array.c0000664000175000017500000014112513443450020022200 0ustar00lordyestalordyesta00000000000000/* * Array functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_array.h" #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_types.h" /* Creates an array * Make sure the value array is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_array_initialize( libcdata_array_t **array, int number_of_entries, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_initialize"; size_t entries_size = 0; int number_of_allocated_entries = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } if( *array != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid array value already set.", function ); return( -1 ); } if( number_of_entries < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of entries value less than zero.", function ); return( -1 ); } internal_array = memory_allocate_structure( libcdata_internal_array_t ); if( internal_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create array.", function ); goto on_error; } if( memory_set( internal_array, 0, sizeof( libcdata_internal_array_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear array.", function ); memory_free( internal_array ); return( -1 ); } /* Pre-allocate in blocks of 16 entries */ if( number_of_entries >= (int) ( INT_MAX - 16 ) ) { number_of_allocated_entries = INT_MAX; } else { number_of_allocated_entries = ( number_of_entries & ~( 15 ) ) + 16; } #if SIZEOF_INT <= SIZEOF_SIZE_T if( (size_t) number_of_allocated_entries > (size_t) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #else if( number_of_allocated_entries > (int) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of allocated entries value exceeds maximum.", function ); goto on_error; } entries_size = sizeof( intptr_t * ) * number_of_allocated_entries; if( entries_size > (size_t) LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid entries size value exceeds maximum.", function ); goto on_error; } internal_array->entries = (intptr_t **) memory_allocate( entries_size ); if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create array entries.", function ); goto on_error; } if( memory_set( internal_array->entries, 0, entries_size ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear array entries.", function ); goto on_error; } internal_array->number_of_allocated_entries = number_of_allocated_entries; internal_array->number_of_entries = number_of_entries; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_initialize( &( internal_array->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *array = (libcdata_array_t *) internal_array; return( 1 ); on_error: if( internal_array != NULL ) { if( internal_array->entries != NULL ) { memory_free( internal_array->entries ); } memory_free( internal_array ); } return( -1 ); } /* Frees an array * The entries are freed using the entry_free_function * Returns 1 if successful or -1 on error */ int libcdata_array_free( libcdata_array_t **array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_free"; int result = 1; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } if( *array != NULL ) { internal_array = (libcdata_internal_array_t *) *array; *array = NULL; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_free( &( internal_array->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( internal_array->entries != NULL ) { if( libcdata_internal_array_clear( internal_array, entry_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear array.", function ); result = -1; } memory_free( internal_array->entries ); } memory_free( internal_array ); } return( result ); } /* Empties an array and frees its entries * The entries are freed using the entry_free_function * If the entry_free_function fails for a specific entry it is not freed and kept in the array * * Returns 1 if successful or -1 on error */ int libcdata_array_empty( libcdata_array_t *array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_empty"; int result = 1; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_internal_array_clear( internal_array, entry_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear array.", function ); result = -1; } else { internal_array->number_of_entries = 0; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); } /* Clears an array and frees its entries * The entries are freed using the entry_free_function * If the entry_free_function fails for a specific entry it is not freed and kept in the array * * This function is not multi-thread safe acquire write lock before call * Returns 1 if successful or -1 on error */ int libcdata_internal_array_clear( libcdata_internal_array_t *internal_array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ) { static char *function = "libcdata_internal_array_clear"; int entry_free_result = 0; int entry_iterator = 0; int result = 1; if( internal_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } for( entry_iterator = 0; entry_iterator < internal_array->number_of_entries; entry_iterator++ ) { if( internal_array->entries[ entry_iterator ] != NULL ) { if( entry_free_function == NULL ) { entry_free_result = 1; } else { entry_free_result = entry_free_function( &( internal_array->entries[ entry_iterator ] ), error ); } if( entry_free_result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free array entry: %d.", function, entry_iterator ); result = -1; } else { internal_array->entries[ entry_iterator ] = NULL; } } } return( result ); } /* Clears an array and frees its entries * The entries are freed using the entry_free_function * If the entry_free_function fails for a specific entry it is not freed and kept in the array * * Returns 1 if successful or -1 on error */ int libcdata_array_clear( libcdata_array_t *array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_clear"; int result = 1; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_internal_array_clear( internal_array, entry_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to clear array.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); } /* Clones the array and its entries * * The entries are cloned using the entry_clone_function * On error the entries are freed using the entry_free_function * * Returns 1 if successful or -1 on error */ int libcdata_array_clone( libcdata_array_t **destination_array, libcdata_array_t *source_array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), int (*entry_clone_function)( intptr_t **destination_entry, intptr_t *source_entry, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_array_t *internal_destination_array = NULL; libcdata_internal_array_t *internal_source_array = NULL; static char *function = "libcdata_array_clone"; int entry_iterator = 0; if( destination_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination array.", function ); return( -1 ); } if( *destination_array != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination array already set.", function ); return( -1 ); } if( entry_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry free function.", function ); return( -1 ); } if( entry_clone_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry clone function.", function ); return( -1 ); } if( source_array == NULL ) { *destination_array = NULL; return( 1 ); } internal_source_array = (libcdata_internal_array_t *) source_array; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_source_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_array_initialize( (libcdata_array_t **) &internal_destination_array, internal_source_array->number_of_entries, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination array.", function ); goto on_error; } if( internal_destination_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination array.", function ); goto on_error; } if( internal_source_array->entries != NULL ) { for( entry_iterator = 0; entry_iterator < internal_source_array->number_of_entries; entry_iterator++ ) { if( internal_source_array->entries[ entry_iterator ] != NULL ) { if( entry_clone_function( &( internal_destination_array->entries[ entry_iterator ] ), internal_source_array->entries[ entry_iterator ], error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination array entry: %d.", function, entry_iterator ); goto on_error; } } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_source_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); libcdata_array_free( (libcdata_array_t **) &internal_destination_array, entry_free_function, NULL ); return( -1 ); } #endif *destination_array = (libcdata_array_t *) internal_destination_array; return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_source_array->read_write_lock, NULL ); #endif if( internal_destination_array != NULL ) { libcdata_array_free( (libcdata_array_t **) &internal_destination_array, entry_free_function, NULL ); } return( -1 ); } /* Resizes an array * This function is not multi-thread safe acquire write lock before call * Returns 1 if successful or -1 on error */ int libcdata_internal_array_resize( libcdata_internal_array_t *internal_array, int number_of_entries, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ) { void *reallocation = NULL; static char *function = "libcdata_internal_array_resize"; size_t entries_size = 0; int entry_iterator = 0; int number_of_allocated_entries = 0; int result = 1; if( internal_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( number_of_entries < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of entries value less than zero.", function ); return( -1 ); } if( number_of_entries > internal_array->number_of_allocated_entries ) { /* Pre-allocate in blocks of 16 entries */ if( number_of_entries >= (int) ( INT_MAX - 16 ) ) { number_of_allocated_entries = INT_MAX; } else { number_of_allocated_entries = ( number_of_entries & ~( 15 ) ) + 16; } #if SIZEOF_INT <= SIZEOF_SIZE_T if( (size_t) number_of_allocated_entries > (size_t) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #else if( number_of_allocated_entries > (int) ( SSIZE_MAX / sizeof( intptr_t * ) ) ) #endif { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid number of allocated entries value exceeds maximum.", function ); return( -1 ); } entries_size = sizeof( intptr_t * ) * number_of_allocated_entries; if( entries_size > (size_t) LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid entries size value exceeds maximum.", function ); return( -1 ); } reallocation = memory_reallocate( internal_array->entries, entries_size ); if( reallocation == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to resize array entries.", function ); return( -1 ); } internal_array->entries = (intptr_t **) reallocation; /* Cannot use memset reliably here. The loop below will be removed * when memset is used and the code is optimized. Therefore the loop * is not executed when memset fails. */ for( entry_iterator = internal_array->number_of_allocated_entries; entry_iterator < number_of_allocated_entries; entry_iterator++ ) { internal_array->entries[ entry_iterator ] = NULL; } internal_array->number_of_allocated_entries = number_of_allocated_entries; internal_array->number_of_entries = number_of_entries; } else if( number_of_entries > internal_array->number_of_entries ) { internal_array->number_of_entries = number_of_entries; } else if( internal_array->entries != NULL ) { for( entry_iterator = number_of_entries; entry_iterator < internal_array->number_of_entries; entry_iterator++ ) { if( internal_array->entries[ entry_iterator ] != NULL ) { if( entry_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry free function.", function ); return( -1 ); } if( entry_free_function( &( internal_array->entries[ entry_iterator ] ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free array entry: %d.", function, entry_iterator ); result = -1; } internal_array->entries[ entry_iterator ] = NULL; } } internal_array->number_of_entries = number_of_entries; } return( result ); } /* Resizes an array * Returns 1 if successful or -1 on error */ int libcdata_array_resize( libcdata_array_t *array, int number_of_entries, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_resize"; int result = 1; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( libcdata_internal_array_resize( internal_array, number_of_entries, entry_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize array.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); } /* Reverses the order of the entries in the array * Returns 1 if successful or -1 on error */ int libcdata_array_reverse( libcdata_array_t *array, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; intptr_t *entry = NULL; static char *function = "libcdata_array_reverse"; int entry_iterator = 0; int reverse_entry_iterator = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_array->number_of_entries > 1 ) { reverse_entry_iterator = internal_array->number_of_entries - 1; while( entry_iterator < reverse_entry_iterator ) { entry = internal_array->entries[ reverse_entry_iterator ]; internal_array->entries[ reverse_entry_iterator ] = internal_array->entries[ entry_iterator ]; internal_array->entries[ entry_iterator ] = entry; entry_iterator++; reverse_entry_iterator--; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the number of entries in the array * Returns 1 if successful or -1 on error */ int libcdata_array_get_number_of_entries( libcdata_array_t *array, int *number_of_entries, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_get_number_of_entries"; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( number_of_entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of entries.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *number_of_entries = internal_array->number_of_entries; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves a specific entry from the array * Returns 1 if successful or -1 on error */ int libcdata_array_get_entry_by_index( libcdata_array_t *array, int entry_index, intptr_t **entry, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_get_entry_by_index"; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( ( entry_index < 0 ) || ( entry_index >= internal_array->number_of_entries ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid entry index value out of bounds.", function ); return( -1 ); } if( entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *entry = internal_array->entries[ entry_index ]; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves a specific entry from the array * * Uses the entry_compare_function to determine the similarity of the entries * The entry_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libcdata_array_get_entry_by_value( libcdata_array_t *array, intptr_t *entry, int (*entry_compare_function)( intptr_t *first_entry, intptr_t *second_entry, libcerror_error_t **error ), intptr_t **existing_entry, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_get_entry_by_value"; int compare_result = 0; int entry_index = 0; int result = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( entry_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry compare function.", function ); return( -1 ); } if( existing_entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid existing entry.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif for( entry_index = 0; entry_index < internal_array->number_of_entries; entry_index++ ) { compare_result = entry_compare_function( entry, internal_array->entries[ entry_index ], error ); if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare entry: %d.", function, entry_index ); result = -1; break; } else if( compare_result == LIBCDATA_COMPARE_EQUAL ) { *existing_entry = internal_array->entries[ entry_index ]; result = 1; break; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); } /* Sets a specific entry in the array * Returns 1 if successful or -1 on error */ int libcdata_array_set_entry_by_index( libcdata_array_t *array, int entry_index, intptr_t *entry, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_set_entry_by_index"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) intptr_t *backup_entry = NULL; #endif if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( ( entry_index < 0 ) || ( entry_index >= internal_array->number_of_entries ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid entry index value out of bounds.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_entry = internal_array->entries[ entry_index ]; #endif internal_array->entries[ entry_index ] = entry; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_array->entries[ entry_index ] = backup_entry; return( -1 ); #endif } /* Prepends an entry * Returns 1 if successful or -1 on error */ int libcdata_array_prepend_entry( libcdata_array_t *array, intptr_t *entry, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_prepend_entry"; int entry_iterator = 0; int result = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif result = libcdata_internal_array_resize( internal_array, internal_array->number_of_entries + 1, NULL, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize array.", function ); result = -1; } else { for( entry_iterator = internal_array->number_of_entries - 1; entry_iterator > 0; entry_iterator-- ) { internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; } internal_array->entries[ entry_iterator ] = entry; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { for( entry_iterator = 0; entry_iterator < ( internal_array->number_of_entries - 1 ); entry_iterator++ ) { internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator + 1 ]; } internal_array->entries[ entry_iterator ] = NULL; internal_array->number_of_entries -= 1; } return( -1 ); #endif } /* Appends an entry * Sets the entry index to the newly appended entry * Returns 1 if successful or -1 on error */ int libcdata_array_append_entry( libcdata_array_t *array, int *entry_index, intptr_t *entry, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_append_entry"; int result = 0; int safe_entry_index = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry index.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif safe_entry_index = internal_array->number_of_entries; result = libcdata_internal_array_resize( internal_array, internal_array->number_of_entries + 1, NULL, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize array.", function ); result = -1; } else { internal_array->entries[ safe_entry_index ] = entry; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif if( result == 1 ) { *entry_index = safe_entry_index; } return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { internal_array->entries[ safe_entry_index ] = NULL; internal_array->number_of_entries -= 1; } return( -1 ); #endif } /* Inserts an entry in the array * * Uses the entry_compare_function to determine the order of the entries * The entry_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate entry. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * entry_index is set when the entry was successfully inserted * * Returns 1 if successful, 0 if the entry already exists or -1 on error */ int libcdata_array_insert_entry( libcdata_array_t *array, int *entry_index, intptr_t *entry, int (*entry_compare_function)( intptr_t *first_entry, intptr_t *second_entry, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_tree_node_insert_node"; int compare_result = 0; int entry_iterator = 0; int result = 0; int safe_entry_index = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( entry_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry index.", function ); return( -1 ); } if( entry_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry compare function.", function ); return( -1 ); } if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported insert flags: 0x%02" PRIx8 ".", function, insert_flags ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif compare_result = LIBCDATA_COMPARE_GREATER; result = 1; for( entry_iterator = 0; entry_iterator < internal_array->number_of_entries; entry_iterator++ ) { compare_result = entry_compare_function( entry, internal_array->entries[ entry_iterator ], error ); if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare entry: %d.", function, entry_iterator ); result = -1; } else if( compare_result == LIBCDATA_COMPARE_EQUAL ) { if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) { result = 0; } } else if( compare_result == LIBCDATA_COMPARE_LESS ) { result = 1; break; } else if( compare_result != LIBCDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported entry compare function return value: %d.", function, compare_result ); result = -1; } if( result != 1 ) { break; } } if( result == 1 ) { result = libcdata_internal_array_resize( internal_array, internal_array->number_of_entries + 1, NULL, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, "%s: unable to resize array.", function ); result = -1; } else { safe_entry_index = entry_iterator; if( compare_result == LIBCDATA_COMPARE_LESS ) { for( entry_iterator = internal_array->number_of_entries - 1; entry_iterator > safe_entry_index; entry_iterator-- ) { internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; } } internal_array->entries[ safe_entry_index ] = entry; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif if( result == 1 ) { *entry_index = safe_entry_index; } return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { for( entry_iterator = safe_entry_index; entry_iterator < ( internal_array->number_of_entries - 1 ); entry_iterator++ ) { internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator + 1 ]; } internal_array->entries[ entry_iterator ] = NULL; internal_array->number_of_entries -= 1; } return( -1 ); #endif } /* Removes an entry * Returns 1 if successful or -1 on error */ int libcdata_array_remove_entry( libcdata_array_t *array, int entry_index, intptr_t **entry, libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; intptr_t *safe_entry = NULL; static char *function = "libcdata_array_remove_entry"; int entry_iterator = 0; if( array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid array.", function ); return( -1 ); } internal_array = (libcdata_internal_array_t *) array; if( internal_array->entries == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid array - missing entries.", function ); return( -1 ); } if( ( entry_index < 0 ) || ( entry_index >= internal_array->number_of_entries ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid entry index value out of bounds.", function ); return( -1 ); } if( entry == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid entry.", function ); return( -1 ); } *entry = NULL; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif safe_entry = internal_array->entries[ entry_index ]; for( entry_iterator = entry_index; entry_iterator < ( internal_array->number_of_entries - 1 ); entry_iterator++ ) { internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator + 1 ]; } internal_array->entries[ entry_iterator ] = NULL; internal_array->number_of_entries -= 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif *entry = safe_entry; return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_array->number_of_entries += 1; for( entry_iterator = ( internal_array->number_of_entries - 1 ); entry_iterator > entry_index; entry_iterator-- ) { internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; } internal_array->entries[ entry_index ] = safe_entry; return( -1 ); #endif } libewf-20140807/libcdata/libcdata_btree_node.c0000664000175000017500000011076213443450020023173 0ustar00lordyestalordyesta00000000000000/* * Balanced tree node functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_array.h" #include "libcdata_btree_node.h" #include "libcdata_btree_values_list.h" #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_list.h" #include "libcdata_list_element.h" #include "libcdata_tree_node.h" #include "libcdata_types.h" /* Retrieves the sub node for the specific value * * Uses the value_compare_function to determine the similarity of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * If value_compare_function is NULL the pointer of the value is used to check for a match * * Returns 1 if successful, 0 if the value does not exist or -1 on error * If there was no possible sub match values_list_element is set to NULL * it there is a possible sub match values_list_element is set but 0 is returned * If the node is a leaf node sub_node is not set to NULL */ int libcdata_btree_node_get_sub_node_by_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **sub_node, libcdata_list_element_t **values_list_element, libcerror_error_t **error ) { libcdata_list_t *values_list = NULL; libcdata_list_element_t *safe_values_list_element = NULL; libcdata_tree_node_t *safe_sub_node = NULL; intptr_t *values_list_value = NULL; static char *function = "libcdata_btree_node_get_sub_node_by_value"; int number_of_sub_nodes = 0; int number_of_values_list_elements = 0; int result = 0; int sub_node_index = 0; int values_list_element_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node.", function ); return( -1 ); } if( values_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list element.", function ); return( -1 ); } *sub_node = NULL; *values_list_element = NULL; if( libcdata_tree_node_get_value( node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); return( -1 ); } if( values_list != NULL ) { if( libcdata_list_get_number_of_elements( values_list, &number_of_values_list_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values list elements.", function ); return( -1 ); } } if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( ( number_of_sub_nodes != 0 ) && ( ( number_of_values_list_elements + 1 ) != number_of_sub_nodes ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of values list elements value out of bounds.", function ); return( -1 ); } if( number_of_values_list_elements == 0 ) { return( 0 ); } if( libcdata_list_get_first_element( values_list, &safe_values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first values list element.", function ); return( -1 ); } if( number_of_sub_nodes != 0 ) { if( libcdata_tree_node_get_sub_node_by_index( node, 0, &safe_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node: 0.", function ); return( -1 ); } } for( values_list_element_index = 0; values_list_element_index < number_of_values_list_elements; values_list_element_index++ ) { if( libcdata_list_element_get_value( safe_values_list_element, &values_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from values list element: %d.", function, values_list_element_index ); return( -1 ); } if( values_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid values list element: %d - missing value.", function, values_list_element_index ); return( -1 ); } if( value_compare_function != NULL ) { result = value_compare_function( value, values_list_value, error ); } else if( value == values_list_value ) { result = LIBCDATA_COMPARE_EQUAL; } else { result = LIBCDATA_COMPARE_GREATER; } if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare value with values list value: %d.", function, values_list_element_index ); return( -1 ); } else if( result == LIBCDATA_COMPARE_EQUAL ) { *sub_node = safe_sub_node; *values_list_element = safe_values_list_element; return( 1 ); } else if( result == LIBCDATA_COMPARE_LESS ) { break; } else if( result != LIBCDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, result ); return( -1 ); } if( libcdata_list_element_get_next_element( safe_values_list_element, &safe_values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from values list element: %d.", function, values_list_element_index ); return( -1 ); } if( number_of_sub_nodes != 0 ) { if( libcdata_tree_node_get_next_node( safe_sub_node, &safe_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node from sub node: %d.", function, sub_node_index ); return( -1 ); } sub_node_index++; } } *sub_node = safe_sub_node; *values_list_element = safe_values_list_element; return( 0 ); } /* Retrieves the upper node for the specific value * * Uses the value_compare_function to determine the similarity of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if the value does not exist or -1 on error */ int libcdata_btree_node_get_upper_node_by_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **upper_node, libcdata_list_element_t **values_list_element, libcerror_error_t **error ) { libcdata_list_element_t *sub_values_list_element = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_btree_node_get_upper_node_by_value"; int result = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( upper_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid upper node.", function ); return( -1 ); } if( values_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list element.", function ); return( -1 ); } *upper_node = NULL; *values_list_element = NULL; result = libcdata_btree_node_get_sub_node_by_value( node, value, value_compare_function, &sub_node, &sub_values_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node by value.", function ); return( -1 ); } else if( sub_node != NULL ) { result = libcdata_btree_node_get_upper_node_by_value( sub_node, value, value_compare_function, upper_node, values_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve upper node in sub node.", function ); return( -1 ); } } else if( result != 0 ) { *values_list_element = sub_values_list_element; } if( *upper_node == NULL ) { *upper_node = node; } return( result ); } /* Appends a value into a tree node * Returns 1 if successful or -1 on error */ int libcdata_btree_node_append_value( libcdata_tree_node_t *node, intptr_t *value, libcerror_error_t **error ) { libcdata_list_t *values_list = NULL; static char *function = "libcdata_btree_node_append_value"; if( libcdata_tree_node_get_value( node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); return( -1 ); } if( values_list == NULL ) { if( libcdata_list_initialize( &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create values list.", function ); return( -1 ); } if( libcdata_tree_node_set_value( node, (intptr_t *) values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set values list.", function ); libcdata_list_free( &values_list, NULL, NULL ); return( -1 ); } } if( libcdata_list_append_value( values_list, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value to values list.", function ); return( -1 ); } return( 1 ); } /* Inserts a value into a tree node * The tree node must be the most upper node (leaf) * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if the value already exists or -1 on error */ int libcdata_btree_node_insert_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_list_t *values_list = NULL; static char *function = "libcdata_btree_node_insert_value"; int number_of_sub_nodes = 0; int result = 0; if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( number_of_sub_nodes != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: cannot insert value in node with sub nodes.", function ); return( -1 ); } if( libcdata_tree_node_get_value( node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); return( -1 ); } if( values_list == NULL ) { if( libcdata_list_initialize( &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create values list.", function ); return( -1 ); } if( libcdata_tree_node_set_value( node, (intptr_t *) values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set values list.", function ); libcdata_list_free( &values_list, NULL, NULL ); return( -1 ); } } result = libcdata_list_insert_value( values_list, value, value_compare_function, LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert value in values list.", function ); return( -1 ); } return( result ); } /* Replaces a value in the tree node * The tree node must be the most upper node (leaf) in the first call * Returns 1 if successful or -1 on error */ int libcdata_btree_node_replace_value( libcdata_tree_node_t *node, intptr_t *value, intptr_t *replacement_value, libcerror_error_t **error ) { libcdata_list_element_t *values_list_element = NULL; libcdata_tree_node_t *parent_node = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_btree_node_replace_value"; int result = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } if( replacement_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid replacement value.", function ); return( -1 ); } result = libcdata_btree_node_get_sub_node_by_value( node, value, NULL, &sub_node, &values_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node by value.", function ); return( -1 ); } else if( result != 0 ) { if( libcdata_list_element_set_value( values_list_element, replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in values list element.", function ); return( -1 ); } } if( libcdata_tree_node_get_parent_node( node, &parent_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve parent node.", function ); return( -1 ); } if( parent_node != NULL ) { if( libcdata_btree_node_replace_value( parent_node, value, replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to replace value in parent node.", function ); return( -1 ); } } return( 1 ); } /* Flattens a tree node and its sub node * Returns 1 if successful or -1 on error */ int libcdata_btree_node_flatten_node( libcdata_tree_node_t **node, libcerror_error_t **error ) { libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_btree_node_flatten_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( libcdata_tree_node_get_first_sub_node( *node, &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first sub node.", function ); return( -1 ); } if( libcdata_tree_node_remove_node( *node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove sub node from node.", function ); return( -1 ); } if( libcdata_tree_node_replace_node( *node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to replace node with sub node.", function ); libcdata_tree_node_append_node( *node, sub_node, NULL ); return( -1 ); } if( libcdata_tree_node_free( node, (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_values_list_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free node.", function ); return( -1 ); } *node = sub_node; return( 1 ); } /* Removes a sub node from the B-tree node * Returns 1 if successful or -1 on error */ int libcdata_btree_node_remove_sub_node( libcdata_tree_node_t *node, libcdata_tree_node_t **sub_node, libcerror_error_t **error ) { static char *function = "libcdata_btree_node_remove_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node.", function ); return( -1 ); } if( libcdata_tree_node_remove_node( node, *sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove sub node from node.", function ); return( -1 ); } if( libcdata_tree_node_free( sub_node, (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_values_list_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub node.", function ); return( -1 ); } return( 1 ); } /* Removes a value from the tree node * The tree node must be the most upper node (leaf) in the first call * Returns 1 if successful, 0 if no such value or -1 on error */ int libcdata_btree_node_remove_value( libcdata_tree_node_t *node, intptr_t *value, intptr_t *replacement_value, libcerror_error_t **error ) { libcdata_list_t *sub_node_values_list = NULL; libcdata_list_t *values_list = NULL; libcdata_list_element_t *values_list_element = NULL; libcdata_tree_node_t *parent_node = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_btree_node_remove_value"; int number_of_sub_nodes = 0; int number_of_values_list_elements = 0; int result = 0; int sub_node_number_of_sub_nodes = 0; int sub_node_number_of_values_list_elements = 0; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } result = libcdata_btree_node_get_sub_node_by_value( node, value, NULL, &sub_node, &values_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node by value.", function ); return( -1 ); } if( libcdata_tree_node_get_value( node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); return( -1 ); } if( libcdata_list_get_number_of_elements( values_list, &number_of_values_list_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values list elements.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( sub_node != NULL ) { if( libcdata_tree_node_get_value( sub_node, (intptr_t **) &sub_node_values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node values list.", function ); return( -1 ); } if( libcdata_list_get_number_of_elements( sub_node_values_list, &sub_node_number_of_values_list_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub node number of values list elements.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( sub_node, &sub_node_number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } /* If the sub node is empty remove it */ if( ( sub_node_number_of_sub_nodes == 0 ) && ( sub_node_number_of_values_list_elements == 0 ) ) { if( libcdata_btree_node_remove_sub_node( node, &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove remaining sub node from node.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( values_list_element == NULL ) { if( libcdata_list_get_last_element( values_list, &values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve last values list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( values_list_element, &replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from last values list element.", function ); return( -1 ); } } if( values_list_element != NULL ) { if( libcdata_btree_values_list_remove_element( values_list, &values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove element from values list.", function ); return( -1 ); } if( libcdata_list_get_number_of_elements( values_list, &number_of_values_list_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values list elements.", function ); return( -1 ); } } } } if( number_of_sub_nodes != 0 ) { if( ( number_of_values_list_elements + 1 ) != number_of_sub_nodes ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid number of values list elements value out of bounds.", function ); return( -1 ); } /* If one sub node remains flatten the node */ if( number_of_sub_nodes == 1 ) { if( libcdata_btree_node_flatten_node( &node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to flatten node.", function ); return( -1 ); } if( libcdata_tree_node_get_value( node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); return( -1 ); } } /* If the sub node contains more than one values list elements * use the replacement value determined in the sub node */ else if( values_list_element != NULL ) { if( replacement_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid replacement value.", function ); return( -1 ); } if( libcdata_list_element_set_value( values_list_element, replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in values list element.", function ); return( -1 ); } } } /* In a leaf node remove the values list element from the list */ else if( values_list_element != NULL ) { if( libcdata_btree_values_list_replace_element_with_previous( values_list, &values_list_element, &replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to replace values list element with previous.", function ); return( -1 ); } } if( libcdata_tree_node_get_parent_node( node, &parent_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve parent node.", function ); return( -1 ); } if( parent_node != NULL ) { if( libcdata_btree_node_remove_value( parent_node, value, replacement_value, error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove value from parent node.", function ); return( -1 ); } } return( result ); } /* Splits the node * Returns 1 if successful or -1 on error */ int libcdata_btree_node_split( libcdata_tree_node_t *node, libcerror_error_t **error ) { libcdata_list_t *split_values_list = NULL; libcdata_list_t *values_list = NULL; libcdata_list_element_t *values_list_element = NULL; libcdata_tree_node_t *sub_node = NULL; intptr_t *values_list_value = NULL; static char *function = "libcdata_btree_node_split"; int number_of_split_values_list_elements = 0; int number_of_sub_nodes = 0; int number_of_values_list_elements = 0; int split_values_list_element_index = 0; int sub_node_index = 0; int values_list_element_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); goto on_error; } if( number_of_sub_nodes != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: cannot split node with sub nodes.", function ); goto on_error; } if( libcdata_tree_node_get_value( node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); goto on_error; } /* Split to have about 25 values per sub node */ number_of_split_values_list_elements = 25; if( libcdata_list_initialize( &split_values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create split values list.", function ); goto on_error; } if( libcdata_tree_node_set_value( node, (intptr_t *) split_values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set split values list.", function ); goto on_error; } if( libcdata_list_get_number_of_elements( values_list, &number_of_values_list_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values list elements.", function ); goto on_error; } if( libcdata_list_get_first_element( values_list, &values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first values list element.", function ); goto on_error; } for( values_list_element_index = 0; values_list_element_index < number_of_values_list_elements; values_list_element_index++ ) { if( libcdata_list_element_get_value( values_list_element, &values_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from values list element: %d.", function, values_list_element_index ); goto on_error; } if( values_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid values list element: %d - missing value.", function, values_list_element_index ); goto on_error; } if( sub_node == NULL ) { if( libcdata_tree_node_initialize( &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub node: %d.", function, sub_node_index ); goto on_error; } } if( libcdata_btree_node_append_value( sub_node, values_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value: %d to sub node: %d.", function, values_list_element_index, sub_node_index ); goto on_error; } if( values_list_element_index >= split_values_list_element_index ) { if( ( values_list_element_index + 1 ) < number_of_values_list_elements ) { if( libcdata_list_append_value( split_values_list, values_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value: %d to sub nodes values list.", function, values_list_element_index ); goto on_error; } } split_values_list_element_index += number_of_split_values_list_elements; if( libcdata_tree_node_append_node( node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append sub node: %d to node.", function, sub_node_index ); goto on_error; } sub_node = NULL; sub_node_index++; } if( libcdata_list_element_get_next_element( values_list_element, &values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from values list element: %d.", function, values_list_element_index ); goto on_error; } } if( sub_node != NULL ) { if( libcdata_tree_node_append_node( node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append sub node: %d to node.", function, sub_node_index ); goto on_error; } sub_node = NULL; sub_node_index++; } split_values_list = NULL; if( libcdata_list_free( &values_list, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free values list.", function ); goto on_error; } return( 1 ); on_error: if( sub_node != NULL ) { libcdata_tree_node_remove_node( node, sub_node, NULL ); libcdata_tree_node_free( &sub_node, NULL, NULL ); } if( split_values_list != NULL ) { libcdata_tree_node_empty( node, NULL, NULL ); libcdata_tree_node_set_value( node, (intptr_t *) values_list, NULL ); libcdata_list_free( &split_values_list, NULL, NULL ); } return( -1 ); } libewf-20140807/libcdata/libcdata_tree_node.c0000664000175000017500000030423113443450020023025 0ustar00lordyestalordyesta00000000000000/* * Tree functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_list.h" #include "libcdata_tree_node.h" #include "libcdata_types.h" /* Creates a tree node * Make sure the value node is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_tree_node_initialize( libcdata_tree_node_t **node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_initialize"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node value already set.", function ); return( -1 ); } internal_node = memory_allocate_structure( libcdata_internal_tree_node_t ); if( internal_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create node.", function ); goto on_error; } if( memory_set( internal_node, 0, sizeof( libcdata_internal_tree_node_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear node.", function ); memory_free( internal_node ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_initialize( &( internal_node->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *node = (libcdata_tree_node_t *) internal_node; return( 1 ); on_error: if( internal_node != NULL ) { memory_free( internal_node ); } return( -1 ); } /* Frees a tree node, its sub nodes * Uses the value_free_function to free the value * Returns 1 if successful or -1 on error */ int libcdata_tree_node_free( libcdata_tree_node_t **node, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_free"; int result = 1; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( *node != NULL ) { internal_node = (libcdata_internal_tree_node_t *) *node; if( ( internal_node->parent_node != NULL ) || ( internal_node->previous_node != NULL ) || ( internal_node->next_node != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node - connected to other nodes.", function ); return( -1 ); } *node = NULL; if( libcdata_tree_node_empty( (libcdata_tree_node_t *) internal_node, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty node.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_free( &( internal_node->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( internal_node->value != NULL ) { if( value_free_function != NULL ) { if( value_free_function( &( internal_node->value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value.", function ); result = -1; } internal_node->value = NULL; } } memory_free( internal_node ); } return( result ); } /* Empties a tree node and frees its sub nodes * Uses the value_free_function to free the value of the sub nodes * Returns 1 if successful or -1 on error */ int libcdata_tree_node_empty( libcdata_tree_node_t *tree_node, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *next_node = NULL; libcdata_tree_node_t *parent_node = NULL; libcdata_tree_node_t *previous_node = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_tree_node_empty"; int number_of_sub_nodes = 0; int result = 1; int sub_node_index = 0; if( tree_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) tree_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif number_of_sub_nodes = internal_node->number_of_sub_nodes; sub_node = internal_node->first_sub_node; for( sub_node_index = 0; sub_node_index < number_of_sub_nodes; sub_node_index++ ) { if( libcdata_tree_node_get_nodes( sub_node, &parent_node, &previous_node, &next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of sub node: %d.", function, sub_node_index ); goto on_error; } if( previous_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid sub node: %d - previous node is set.", function, sub_node_index ); goto on_error; } internal_node->first_sub_node = next_node; if( internal_node->last_sub_node == sub_node ) { internal_node->last_sub_node = next_node; } internal_node->number_of_sub_nodes -= 1; if( next_node != NULL ) { if( libcdata_tree_node_set_previous_node( next_node, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of sub node: %d.", function, sub_node_index + 1 ); goto on_error; } } if( libcdata_tree_node_set_nodes( sub_node, NULL, NULL, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set nodes of sub node: %d.", function, sub_node_index ); goto on_error; } if( libcdata_tree_node_free( &sub_node, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub node: %d.", function, sub_node_index ); result = -1; } sub_node = next_node; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, NULL ); #endif return( -1 ); } /* Clones the tree node and its sub nodes * * The values are cloned using the value_clone_function * On error the values are freed using the value_free_function * * Returns 1 if successful or -1 on error */ int libcdata_tree_node_clone( libcdata_tree_node_t **destination_node, libcdata_tree_node_t *source_node, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_destination_node = NULL; libcdata_internal_tree_node_t *internal_source_node = NULL; libcdata_tree_node_t *destination_sub_node = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_tree_node_clone"; int sub_node_index = 0; if( destination_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination tree node.", function ); return( -1 ); } if( *destination_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination tree node already set.", function ); return( -1 ); } if( value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value free function.", function ); return( -1 ); } if( value_clone_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value clone function.", function ); return( -1 ); } if( source_node == NULL ) { *destination_node = NULL; return( 1 ); } internal_source_node = (libcdata_internal_tree_node_t *) source_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_source_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_tree_node_initialize( (libcdata_tree_node_t **) &internal_destination_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination tree node.", function ); goto on_error; } if( internal_destination_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination tree node.", function ); goto on_error; } if( value_clone_function( &( internal_destination_node->value ), internal_source_node->value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination tree node value.", function ); goto on_error; } /* Clone the sub nodes */ sub_node = internal_source_node->first_sub_node; for( sub_node_index = 0; sub_node_index < internal_source_node->number_of_sub_nodes; sub_node_index++ ) { if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected in source sub node: %d.", function, sub_node_index ); goto on_error; } if( libcdata_tree_node_clone( &destination_sub_node, sub_node, value_free_function, value_clone_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_COPY_FAILED, "%s: unable to create destination sub node: %d.", function, sub_node_index ); goto on_error; } if( libcdata_internal_tree_node_append_node( internal_destination_node, destination_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append sub node: %d to destination tree node.", function, sub_node_index ); goto on_error; } destination_sub_node = NULL; if( libcdata_tree_node_get_next_node( sub_node, &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node of sub node: %d.", function, sub_node_index ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_source_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); libcdata_tree_node_free( &destination_sub_node, value_free_function, NULL ); return( -1 ); } #endif *destination_node = (libcdata_tree_node_t *) internal_destination_node; return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_source_node->read_write_lock, NULL ); #endif if( destination_sub_node != NULL ) { libcdata_tree_node_free( &destination_sub_node, value_free_function, NULL ); } if( internal_destination_node != NULL ) { libcdata_tree_node_free( (libcdata_tree_node_t **) &internal_destination_node, value_free_function, NULL ); } return( -1 ); } /* Retrieves the value from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_value( libcdata_tree_node_t *node, intptr_t **value, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_value"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *value = internal_node->value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the value in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_set_value( libcdata_tree_node_t *node, intptr_t *value, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_value"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) intptr_t *backup_value = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_value = internal_node->value; #endif internal_node->value = value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_node->value = backup_value; return( -1 ); #endif } /* Retrieves the parent node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_parent_node( libcdata_tree_node_t *node, libcdata_tree_node_t **parent_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_parent_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( parent_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid parent node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *parent_node = internal_node->parent_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the parent node in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_set_parent_node( libcdata_tree_node_t *node, libcdata_tree_node_t *parent_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_parent_node"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_parent_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_parent_node = internal_node->parent_node; #endif internal_node->parent_node = parent_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_node->parent_node = backup_parent_node; return( -1 ); #endif } /* Retrieves the previous node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_previous_node( libcdata_tree_node_t *node, libcdata_tree_node_t **previous_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_previous_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( previous_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid previous node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *previous_node = internal_node->previous_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the previous node in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_set_previous_node( libcdata_tree_node_t *node, libcdata_tree_node_t *previous_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_previous_node"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_previous_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_previous_node = internal_node->previous_node; #endif internal_node->previous_node = previous_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_node->previous_node = backup_previous_node; return( -1 ); #endif } /* Retrieves the next node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_next_node( libcdata_tree_node_t *node, libcdata_tree_node_t **next_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_next_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( next_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid next node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *next_node = internal_node->next_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the next node in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_set_next_node( libcdata_tree_node_t *node, libcdata_tree_node_t *next_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_next_node"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_next_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_next_node = internal_node->next_node ; #endif internal_node->next_node = next_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_node->next_node = backup_next_node; return( -1 ); #endif } /* Retrieves the nodes from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t **parent_node, libcdata_tree_node_t **previous_node, libcdata_tree_node_t **next_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( parent_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid parent node.", function ); return( -1 ); } if( previous_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid previous node.", function ); return( -1 ); } if( next_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid next node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *parent_node = internal_node->parent_node; *previous_node = internal_node->previous_node; *next_node = internal_node->next_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the nodes in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_set_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t *parent_node, libcdata_tree_node_t *previous_node, libcdata_tree_node_t *next_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_nodes"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_next_node = NULL; libcdata_tree_node_t *backup_parent_node = NULL; libcdata_tree_node_t *backup_previous_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_parent_node = internal_node->parent_node; backup_previous_node = internal_node->previous_node; backup_next_node = internal_node->next_node; #endif internal_node->parent_node = parent_node; internal_node->previous_node = previous_node; internal_node->next_node = next_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_node->parent_node = backup_parent_node; internal_node->previous_node = backup_previous_node; internal_node->next_node = backup_next_node; return( -1 ); #endif } /* Retrieves the first sub node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_first_sub_node( libcdata_tree_node_t *node, libcdata_tree_node_t **first_sub_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_first_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first sub node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *first_sub_node = internal_node->first_sub_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the first sub node in the tree node * Returns 1 if successful or -1 on error */ int libcdata_internal_tree_node_set_first_sub_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *first_sub_node, libcerror_error_t **error ) { libcdata_tree_node_t *backup_first_sub_node = NULL; libcdata_tree_node_t *backup_previous_node = NULL; static char *function = "libcdata_internal_tree_node_set_first_sub_node"; if( internal_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( first_sub_node != NULL ) { if( libcdata_tree_node_get_previous_node( first_sub_node, &backup_previous_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous node of sub node.", function ); return( -1 ); } } backup_first_sub_node = internal_node->first_sub_node; if( first_sub_node != NULL ) { if( libcdata_tree_node_set_previous_node( first_sub_node, internal_node->first_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of sub node.", function ); goto on_error; } } if( internal_node->first_sub_node != NULL ) { if( libcdata_tree_node_set_next_node( internal_node->first_sub_node, first_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of first sub node.", function ); goto on_error; } } internal_node->first_sub_node = first_sub_node; return( 1 ); on_error: if( first_sub_node != NULL ) { libcdata_tree_node_set_previous_node( first_sub_node, backup_previous_node, NULL ); } if( backup_first_sub_node != NULL ) { libcdata_tree_node_set_next_node( backup_first_sub_node, NULL, NULL ); } internal_node->first_sub_node = backup_first_sub_node; return( -1 ); } /* Retrieves the last sub node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_last_sub_node( libcdata_tree_node_t *node, libcdata_tree_node_t **last_sub_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_last_sub_node"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid last sub node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *last_sub_node = internal_node->last_sub_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the last sub node in the tree node * Returns 1 if successful or -1 on error */ int libcdata_internal_tree_node_set_last_sub_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *last_sub_node, libcerror_error_t **error ) { libcdata_tree_node_t *backup_last_sub_node = NULL; libcdata_tree_node_t *backup_previous_node = NULL; static char *function = "libcdata_internal_tree_node_set_last_sub_node"; if( internal_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( last_sub_node != NULL ) { if( libcdata_tree_node_get_previous_node( last_sub_node, &backup_previous_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous node of sub node.", function ); return( -1 ); } } backup_last_sub_node = internal_node->last_sub_node; if( last_sub_node != NULL ) { if( libcdata_tree_node_set_previous_node( last_sub_node, internal_node->last_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of sub node.", function ); goto on_error; } } if( internal_node->last_sub_node != NULL ) { if( libcdata_tree_node_set_next_node( internal_node->last_sub_node, last_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of last sub node.", function ); goto on_error; } } internal_node->last_sub_node = last_sub_node; return( 1 ); on_error: if( last_sub_node != NULL ) { libcdata_tree_node_set_previous_node( last_sub_node, backup_previous_node, NULL ); } if( backup_last_sub_node != NULL ) { libcdata_tree_node_set_next_node( backup_last_sub_node, NULL, NULL ); } internal_node->last_sub_node = backup_last_sub_node; return( -1 ); } /* Retrieves the sub nodes from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_sub_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t **first_sub_node, libcdata_tree_node_t **last_sub_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_sub_get_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid first sub node.", function ); return( -1 ); } if( last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid last sub node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *first_sub_node = internal_node->first_sub_node; *last_sub_node = internal_node->last_sub_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the sub nodes in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_set_sub_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t *first_sub_node, libcdata_tree_node_t *last_sub_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_sub_nodes"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_first_sub_node = NULL; libcdata_tree_node_t *backup_last_sub_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_sub_node = internal_node->first_sub_node; backup_last_sub_node = internal_node->last_sub_node; #endif internal_node->first_sub_node = first_sub_node; internal_node->last_sub_node = last_sub_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_node->first_sub_node = backup_first_sub_node; internal_node->last_sub_node = backup_last_sub_node; return( -1 ); #endif } /* Appends a sub tree node to the node * Returns 1 if successful or -1 on error */ int libcdata_internal_tree_node_append_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *node_to_append, libcerror_error_t **error ) { libcdata_tree_node_t *to_append_next_node = NULL; libcdata_tree_node_t *to_append_parent_node = NULL; libcdata_tree_node_t *to_append_previous_node = NULL; static char *function = "libcdata_internal_tree_node_append_node"; if( internal_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( node_to_append == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node to append.", function ); return( -1 ); } if( libcdata_tree_node_get_nodes( node_to_append, &to_append_parent_node, &to_append_previous_node, &to_append_next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of node to append.", function ); return( -1 ); } if( ( to_append_parent_node != NULL ) || ( to_append_previous_node != NULL ) || ( to_append_next_node != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node to append - node is already part of a tree.", function ); return( -1 ); } if( internal_node->number_of_sub_nodes == 0 ) { if( internal_node->first_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: corruption detected - first sub node already set.", function ); return( -1 ); } if( internal_node->last_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: corruption detected - last sub node already set.", function ); return( -1 ); } internal_node->first_sub_node = node_to_append; internal_node->last_sub_node = node_to_append; } else { if( internal_node->first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first sub node.", function ); return( -1 ); } if( internal_node->last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last sub node.", function ); return( -1 ); } if( libcdata_tree_node_set_next_node( internal_node->last_sub_node, node_to_append, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of last sub node.", function ); return( -1 ); } if( libcdata_tree_node_set_previous_node( node_to_append, internal_node->last_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of node to append.", function ); return( -1 ); } internal_node->last_sub_node = node_to_append; } if( libcdata_tree_node_set_parent_node( node_to_append, (libcdata_tree_node_t *) internal_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent node of node to append.", function ); return( -1 ); } internal_node->number_of_sub_nodes += 1; return( 1 ); } /* Appends a tree node to the node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_append_node( libcdata_tree_node_t *node, libcdata_tree_node_t *node_to_append, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *to_append_next_node = NULL; libcdata_tree_node_t *to_append_parent_node = NULL; libcdata_tree_node_t *to_append_previous_node = NULL; static char *function = "libcdata_tree_node_append_node"; int result = 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_first_sub_node = NULL; libcdata_tree_node_t *backup_last_sub_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( internal_node->number_of_sub_nodes == 0 ) { if( internal_node->first_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first sub node already set.", function ); return( -1 ); } if( internal_node->last_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last sub node already set.", function ); return( -1 ); } } else { if( internal_node->first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first sub node.", function ); return( -1 ); } if( internal_node->last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last sub node.", function ); return( -1 ); } } if( libcdata_tree_node_get_nodes( node_to_append, &to_append_parent_node, &to_append_previous_node, &to_append_next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of node to append.", function ); return( -1 ); } if( ( to_append_parent_node != NULL ) || ( to_append_previous_node != NULL ) || ( to_append_next_node != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node to append - node is already part of a tree.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_sub_node = internal_node->first_sub_node; backup_last_sub_node = internal_node->last_sub_node; #endif result = libcdata_tree_node_set_parent_node( node_to_append, node, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent node of node to append.", function ); result = -1; } if( result == 1 ) { result = libcdata_tree_node_set_previous_node( node_to_append, internal_node->last_sub_node, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of node to append.", function ); libcdata_tree_node_set_parent_node( node_to_append, NULL, NULL ); result = -1; } } if( result == 1 ) { if( internal_node->last_sub_node != NULL ) { result = libcdata_tree_node_set_next_node( internal_node->last_sub_node, node_to_append, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of last sub node.", function ); libcdata_tree_node_set_parent_node( node_to_append, NULL, NULL ); libcdata_tree_node_set_previous_node( node_to_append, NULL, NULL ); result = -1; } } } if( result == 1 ) { if( internal_node->first_sub_node == NULL ) { internal_node->first_sub_node = node_to_append; } internal_node->last_sub_node = node_to_append; internal_node->number_of_sub_nodes += 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: libcdata_tree_node_set_parent_node( node_to_append, NULL, NULL ); libcdata_tree_node_set_previous_node( node_to_append, NULL, NULL ); internal_node->first_sub_node = backup_first_sub_node; internal_node->last_sub_node = backup_last_sub_node; internal_node->number_of_sub_nodes -= 1; return( -1 ); #endif } /* Appends a value to the node * Creates a new sub tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_append_value( libcdata_tree_node_t *node, intptr_t *value, libcerror_error_t **error ) { libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_tree_node_append_value"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( libcdata_tree_node_initialize( &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub node.", function ); goto on_error; } if( libcdata_tree_node_set_value( sub_node, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set value in sub node.", function ); goto on_error; } if( libcdata_tree_node_append_node( node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append sub node to node.", function ); goto on_error; } return( 1 ); on_error: if( sub_node != NULL ) { libcdata_tree_node_free( &sub_node, NULL, NULL ); } return( -1 ); } /* Retrieves the node which the sub node should be inserted before * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * On return sub_node will be set to NULL if the sub node should be inserted at the end of the list. * * Returns 1 if successful, 0 if a sub node containing the value already exists or -1 on error */ int libcdata_internal_tree_node_insert_node_find_sub_node( libcdata_internal_tree_node_t *internal_node, intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, int *sub_node_index, libcdata_tree_node_t **sub_node, libcerror_error_t **error ) { libcdata_tree_node_t *sub_tree_node = NULL; intptr_t *sub_node_value = NULL; static char *function = "libcdata_internal_tree_node_insert_node_find_sub_node"; int compare_result = 0; int result = 1; int safe_sub_node_index = 0; if( internal_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported insert flags: 0x%02" PRIx8 ".", function, insert_flags ); return( -1 ); } if( sub_node_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node index.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node.", function ); return( -1 ); } sub_tree_node = internal_node->first_sub_node; for( safe_sub_node_index = 0; safe_sub_node_index < internal_node->number_of_sub_nodes; safe_sub_node_index++ ) { if( libcdata_tree_node_get_value( sub_tree_node, &sub_node_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value of sub node: %d.", function, safe_sub_node_index ); return( -1 ); } compare_result = value_compare_function( value_to_insert, sub_node_value, error ); if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare sub node: %d.", function, safe_sub_node_index ); return( -1 ); } else if( compare_result == LIBCDATA_COMPARE_EQUAL ) { if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) { result = 0; break; } } else if( compare_result == LIBCDATA_COMPARE_LESS ) { break; } else if( compare_result != LIBCDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, result ); return( -1 ); } if( libcdata_tree_node_get_next_node( sub_tree_node, &sub_tree_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node of sub node: %d.", function, safe_sub_node_index ); return( -1 ); } } if( ( compare_result == LIBCDATA_COMPARE_EQUAL ) || ( compare_result == LIBCDATA_COMPARE_LESS ) ) { *sub_node_index = safe_sub_node_index; *sub_node = sub_tree_node; } else { *sub_node_index = internal_node->number_of_sub_nodes; *sub_node = NULL; } return( result ); } /* Inserts the node before the sub node * If sub_node is NULL the node is inserted before or as the first sub node in the list * Returns 1 if successful, or -1 on error */ int libcdata_internal_tree_node_insert_node_before_sub_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *sub_node, libcdata_tree_node_t *node_to_insert, libcerror_error_t **error ) { libcdata_tree_node_t *backup_first_sub_node = NULL; libcdata_tree_node_t *backup_last_sub_node = NULL; libcdata_tree_node_t *previous_node = NULL; static char *function = "libcdata_internal_tree_node_insert_node_before_sub_node"; if( internal_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( node_to_insert == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node to insert.", function ); return( -1 ); } backup_first_sub_node = internal_node->first_sub_node; backup_last_sub_node = internal_node->last_sub_node; if( sub_node != NULL ) { if( libcdata_tree_node_get_previous_node( sub_node, &previous_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous node from sub node.", function ); return( -1 ); } } if( internal_node->number_of_sub_nodes == 0 ) { internal_node->first_sub_node = node_to_insert; internal_node->last_sub_node = node_to_insert; } else if( sub_node == NULL ) { if( libcdata_internal_tree_node_set_last_sub_node( internal_node, node_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last sub node.", function ); goto on_error; } } else { if( libcdata_tree_node_set_nodes( node_to_insert, (libcdata_tree_node_t *) internal_node, previous_node, sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent, previous and next node of node to insert.", function ); goto on_error; } if( internal_node->first_sub_node == sub_node ) { internal_node->first_sub_node = node_to_insert; } else { if( libcdata_tree_node_set_next_node( previous_node, node_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of previous node.", function ); goto on_error; } } if( libcdata_tree_node_set_previous_node( sub_node, node_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of sub node.", function ); goto on_error; } } if( libcdata_tree_node_set_parent_node( node_to_insert, (libcdata_tree_node_t *) internal_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set parent node of node to insert.", function ); goto on_error; } internal_node->number_of_sub_nodes += 1; return( 1 ); on_error: if( node_to_insert != NULL ) { libcdata_tree_node_set_nodes( node_to_insert, NULL, NULL, NULL, NULL ); } if( previous_node != NULL ) { libcdata_tree_node_set_next_node( previous_node, sub_node, NULL ); } if( sub_node != NULL ) { libcdata_tree_node_set_previous_node( sub_node, previous_node, NULL ); } internal_node->first_sub_node = backup_first_sub_node; internal_node->last_sub_node = backup_last_sub_node; return( -1 ); } /* Inserts a sub node in the node * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the node already exists or -1 on error */ int libcdata_tree_node_insert_node( libcdata_tree_node_t *node, libcdata_tree_node_t *node_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *next_node = NULL; libcdata_tree_node_t *parent_node = NULL; libcdata_tree_node_t *previous_node = NULL; libcdata_tree_node_t *sub_node = NULL; intptr_t *value_to_insert = NULL; static char *function = "libcdata_tree_node_insert_node"; int result = 1; int sub_node_index = 0; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_first_sub_node = NULL; libcdata_tree_node_t *backup_last_sub_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( internal_node->number_of_sub_nodes == 0 ) { if( internal_node->first_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first sub node already set.", function ); return( -1 ); } if( internal_node->last_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last sub node already set.", function ); return( -1 ); } } else { if( internal_node->first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first sub node.", function ); return( -1 ); } if( internal_node->last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last sub node.", function ); return( -1 ); } } if( node_to_insert == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node to insert.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported insert flags: 0x%02" PRIx8 ".", function, insert_flags ); return( -1 ); } if( libcdata_tree_node_get_nodes( node_to_insert, &parent_node, &previous_node, &next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of node to insert.", function ); return( -1 ); } if( ( parent_node != NULL ) || ( previous_node != NULL ) || ( next_node != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid node to insert - node is already part of a tree.", function ); return( -1 ); } if( libcdata_tree_node_get_value( node_to_insert, &value_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from node to insert.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_sub_node = internal_node->first_sub_node; backup_last_sub_node = internal_node->last_sub_node; #endif result = libcdata_internal_tree_node_insert_node_find_sub_node( internal_node, value_to_insert, value_compare_function, insert_flags, &sub_node_index, &sub_node, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to find sub node in tree node.", function ); result = -1; } else if( result == 1 ) { if( sub_node != NULL ) { if( libcdata_tree_node_get_nodes( sub_node, &parent_node, &previous_node, &next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of sub node: %d.", function, sub_node_index ); result = -1; } } if( result == 1 ) { if( libcdata_internal_tree_node_insert_node_before_sub_node( internal_node, sub_node, node_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert node before tree sub node.", function ); result = -1; } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { if( node_to_insert != NULL ) { libcdata_tree_node_set_nodes( node_to_insert, NULL, NULL, NULL, NULL ); } if( previous_node != NULL ) { libcdata_tree_node_set_next_node( previous_node, sub_node, NULL ); } if( sub_node != NULL ) { libcdata_tree_node_set_previous_node( sub_node, previous_node, NULL ); } internal_node->first_sub_node = backup_first_sub_node; internal_node->last_sub_node = backup_last_sub_node; internal_node->number_of_sub_nodes -= 1; } return( -1 ); #endif } /* Inserts a value in the node * * Creates a new sub tree node * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the node already exists or -1 on error */ int libcdata_tree_node_insert_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ) { libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_tree_node_insert_value"; int result = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } if( libcdata_tree_node_initialize( &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create sub node.", function ); goto on_error; } if( libcdata_tree_node_set_value( sub_node, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to set value in sub node.", function ); goto on_error; } result = libcdata_tree_node_insert_node( node, sub_node, value_compare_function, insert_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert node.", function ); goto on_error; } else if( result == 0 ) { if( libcdata_tree_node_free( &sub_node, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free sub node.", function ); goto on_error; } } return( result ); on_error: if( sub_node != NULL ) { libcdata_tree_node_free( &sub_node, NULL, NULL ); } return( -1 ); } /* Replaces a tree node with another tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_replace_node( libcdata_tree_node_t *node, libcdata_tree_node_t *replacement_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *backup_parent_first_sub_node = NULL; libcdata_tree_node_t *backup_parent_last_sub_node = NULL; libcdata_tree_node_t *next_node = NULL; libcdata_tree_node_t *parent_first_sub_node = NULL; libcdata_tree_node_t *parent_last_sub_node = NULL; libcdata_tree_node_t *parent_node = NULL; libcdata_tree_node_t *previous_node = NULL; libcdata_tree_node_t *replacement_next_node = NULL; libcdata_tree_node_t *replacement_parent_node = NULL; libcdata_tree_node_t *replacement_previous_node = NULL; static char *function = "libcdata_tree_node_replace_node"; int result = 1; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( replacement_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid replacement node.", function ); return( -1 ); } if( replacement_node == node ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: cannot replace node with itself.", function ); return( -1 ); } if( libcdata_tree_node_get_nodes( replacement_node, &replacement_parent_node, &replacement_previous_node, &replacement_next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of replacement node.", function ); return( -1 ); } if( ( replacement_parent_node != NULL ) || ( replacement_previous_node != NULL ) || ( replacement_next_node != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid replacement node - already part of a tree.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif parent_node = internal_node->parent_node; previous_node = internal_node->previous_node; next_node = internal_node->next_node; if( parent_node != NULL ) { if( libcdata_tree_node_get_sub_nodes( parent_node, &parent_first_sub_node, &parent_last_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve sub nodes of parent node.", function ); result = -1; } } if( result == 1 ) { if( libcdata_tree_node_set_nodes( replacement_node, parent_node, previous_node, next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set nodes of replacement node.", function ); result = -1; } } if( result == 1 ) { if( parent_node != NULL ) { backup_parent_first_sub_node = parent_first_sub_node; backup_parent_last_sub_node = parent_last_sub_node; if( parent_first_sub_node == node ) { parent_first_sub_node = replacement_node; } if( parent_last_sub_node == node ) { parent_last_sub_node = replacement_node; } if( libcdata_tree_node_set_sub_nodes( parent_node, parent_first_sub_node, parent_last_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set sub nodes of parent node.", function ); libcdata_tree_node_set_nodes( replacement_node, NULL, NULL, NULL, NULL ); result = -1; } } } if( result == 1 ) { if( previous_node != NULL ) { if( libcdata_tree_node_set_next_node( previous_node, replacement_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of previous node.", function ); libcdata_tree_node_set_nodes( replacement_node, NULL, NULL, NULL, NULL ); if( parent_node != NULL ) { libcdata_tree_node_set_sub_nodes( parent_node, backup_parent_first_sub_node, backup_parent_last_sub_node, NULL ); } result = -1; } } } if( result == 1 ) { if( next_node != NULL ) { if( libcdata_tree_node_set_previous_node( next_node, replacement_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of next node.", function ); libcdata_tree_node_set_nodes( replacement_node, NULL, NULL, NULL, NULL ); if( parent_node != NULL ) { libcdata_tree_node_set_sub_nodes( parent_node, backup_parent_first_sub_node, backup_parent_last_sub_node, NULL ); } if( previous_node != NULL ) { libcdata_tree_node_set_next_node( previous_node, node, NULL ); } result = -1; } } } if( result == 1 ) { internal_node->parent_node = NULL; internal_node->previous_node = NULL; internal_node->next_node = NULL; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { libcdata_tree_node_set_nodes( replacement_node, NULL, NULL, NULL, NULL ); if( parent_node != NULL ) { libcdata_tree_node_set_sub_nodes( parent_node, backup_parent_first_sub_node, backup_parent_last_sub_node, NULL ); } if( previous_node != NULL ) { libcdata_tree_node_set_next_node( previous_node, node, NULL ); } if( next_node != NULL ) { libcdata_tree_node_set_previous_node( next_node, node, NULL ); } internal_node->parent_node = parent_node; internal_node->previous_node = previous_node; internal_node->next_node = next_node; } return( -1 ); #endif } /* Removes a sub tree node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_remove_node( libcdata_tree_node_t *node, libcdata_tree_node_t *sub_node_to_remove, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *next_node = NULL; libcdata_tree_node_t *parent_node = NULL; libcdata_tree_node_t *previous_node = NULL; static char *function = "libcdata_tree_node_remove_node"; int result = 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_tree_node_t *backup_first_sub_node = NULL; libcdata_tree_node_t *backup_last_sub_node = NULL; #endif if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( internal_node->number_of_sub_nodes == 0 ) { if( internal_node->first_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first sub node already set.", function ); return( -1 ); } if( internal_node->last_sub_node != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last sub node already set.", function ); return( -1 ); } } else { if( internal_node->first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first sub node.", function ); return( -1 ); } if( internal_node->last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last sub node.", function ); return( -1 ); } } if( sub_node_to_remove == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node to remove.", function ); return( -1 ); } if( internal_node->number_of_sub_nodes == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing number of sub nodes.", function ); return( -1 ); } if( internal_node->first_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing first sub node.", function ); return( -1 ); } if( internal_node->last_sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing last sub node.", function ); return( -1 ); } if( libcdata_tree_node_get_nodes( sub_node_to_remove, &parent_node, &previous_node, &next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve nodes of node to remove.", function ); return( -1 ); } if( parent_node != node ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid node to remove - parent node mismatch.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_sub_node = internal_node->first_sub_node; backup_last_sub_node = internal_node->last_sub_node; #endif result = libcdata_tree_node_set_nodes( sub_node_to_remove, NULL, NULL, NULL, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set nodes of node to remove.", function ); result = -1; } if( result == 1 ) { if( next_node != NULL ) { if( libcdata_tree_node_set_previous_node( next_node, previous_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous node of next node.", function ); libcdata_tree_node_set_nodes( sub_node_to_remove, parent_node, previous_node, next_node, NULL ); result = -1; } } } if( result == 1 ) { if( previous_node != NULL ) { if( libcdata_tree_node_set_next_node( previous_node, next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next node of previous node.", function ); libcdata_tree_node_set_nodes( sub_node_to_remove, parent_node, previous_node, next_node, NULL ); if( next_node != NULL ) { libcdata_tree_node_set_previous_node( next_node, sub_node_to_remove, NULL ); } result = -1; } } } if( result == 1 ) { if( internal_node->first_sub_node == sub_node_to_remove ) { internal_node->first_sub_node = next_node; } if( internal_node->last_sub_node == sub_node_to_remove ) { internal_node->last_sub_node = previous_node; } internal_node->number_of_sub_nodes -= 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { libcdata_tree_node_set_nodes( sub_node_to_remove, parent_node, previous_node, next_node, NULL ); if( next_node != NULL ) { libcdata_tree_node_set_previous_node( next_node, sub_node_to_remove, NULL ); } if( previous_node != NULL ) { libcdata_tree_node_set_next_node( previous_node, sub_node_to_remove, NULL ); } internal_node->first_sub_node = backup_first_sub_node; internal_node->last_sub_node = backup_last_sub_node; internal_node->number_of_sub_nodes += 1; } return( -1 ); #endif } /* Retrieves the number of sub nodes in the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_number_of_sub_nodes( libcdata_tree_node_t *node, int *number_of_sub_nodes, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_get_number_of_sub_nodes"; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( number_of_sub_nodes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of sub nodes.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *number_of_sub_nodes = internal_node->number_of_sub_nodes; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves a specific sub node from the tree node * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_sub_node_by_index( libcdata_tree_node_t *node, int sub_node_index, libcdata_tree_node_t **sub_node, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *safe_sub_node = NULL; static char *function = "libcdata_tree_node_get_sub_node_by_index"; int result = -1; int sub_node_iterator = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( ( sub_node_index < 0 ) || ( sub_node_index >= internal_node->number_of_sub_nodes ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid sub node index value out of bounds.", function ); return( -1 ); } if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid sub node.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif /* Check if the sub nodes should be searched front to back * or back to front */ if( sub_node_index < ( internal_node->number_of_sub_nodes / 2 ) ) { safe_sub_node = internal_node->first_sub_node; for( sub_node_iterator = 0; sub_node_iterator < internal_node->number_of_sub_nodes; sub_node_iterator++ ) { if( sub_node_iterator == sub_node_index ) { result = 1; break; } if( libcdata_tree_node_get_next_node( safe_sub_node, &safe_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node of sub node: %d.", function, sub_node_iterator ); goto on_error; } } } else { safe_sub_node = internal_node->last_sub_node; for( sub_node_iterator = ( internal_node->number_of_sub_nodes - 1 ); sub_node_iterator >= 0; sub_node_iterator-- ) { if( sub_node_iterator == sub_node_index ) { result = 1; break; } if( libcdata_tree_node_get_previous_node( safe_sub_node, &safe_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous node of sub node: %d.", function, sub_node_iterator ); goto on_error; } } } *sub_node = safe_sub_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves a list of all the leaf nodes * Returns 1 if successful or -1 on error */ int libcdata_tree_node_get_leaf_node_list( libcdata_tree_node_t *node, libcdata_list_t **leaf_node_list, libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_tree_node_get_leaf_node_list"; int leaf_node_list_created_in_node = 0; int sub_node_index = 0; if( node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid node.", function ); return( -1 ); } internal_node = (libcdata_internal_tree_node_t *) node; if( leaf_node_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid leaf node list.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( *leaf_node_list == NULL ) { if( libcdata_list_initialize( leaf_node_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create leaf node list.", function ); goto on_error; } leaf_node_list_created_in_node = 1; } /* Traverse the sub nodes */ if( internal_node->number_of_sub_nodes == 0 ) { if( internal_node->value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid node - missing value.", function ); goto on_error; } if( libcdata_list_append_value( *leaf_node_list, internal_node->value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append tree node to leaf node list.", function ); goto on_error; } } else { sub_node = internal_node->first_sub_node; for( sub_node_index = 0; sub_node_index < internal_node->number_of_sub_nodes; sub_node_index++ ) { if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected for sub node: %d.", function, sub_node_index ); goto on_error; } if( libcdata_tree_node_get_leaf_node_list( sub_node, leaf_node_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: unable to traverse sub node: %d.", function, sub_node_index ); goto on_error; } if( libcdata_tree_node_get_next_node( sub_node, &sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next node of sub node: %d.", function, sub_node_index ); goto on_error; } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); on_error: if( leaf_node_list_created_in_node != 0 ) { if( *leaf_node_list == NULL ) { libcdata_list_initialize( leaf_node_list, NULL ); } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, NULL ); #endif return( -1 ); } libewf-20140807/libcdata/libcdata_libcthreads.h0000664000175000017500000000360713443450020023355 0ustar00lordyestalordyesta00000000000000/* * The libcthreads header wrapper * * Copyright (C) 2006-2019, 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( _LIBCDATA_LIBCTHREADS_H ) #define _LIBCDATA_LIBCTHREADS_H #include #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) #define HAVE_LIBCDATA_MULTI_THREAD_SUPPORT #endif #if defined( HAVE_LIBCDATA_MULTI_THREAD_SUPPORT ) /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads */ #if defined( HAVE_LOCAL_LIBCTHREADS ) #include #include #include #include #include #include #include #include #include #include #else /* If libtool DLL support is enabled set LIBCTHREADS_DLL_IMPORT * before including libcthreads.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCTHREADS_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCTHREADS ) */ #endif /* defined( HAVE_LIBCDATA_MULTI_THREAD_SUPPORT ) */ #endif /* !defined( _LIBCDATA_LIBCTHREADS_H ) */ libewf-20140807/libcdata/libcdata_range_list_value.h0000664000175000017500000000534713443450020024417 0ustar00lordyestalordyesta00000000000000/* * Range list value * * Copyright (C) 2006-2019, 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( _LIBCDATA_RANGE_LIST_VALUE_H ) #define _LIBCDATA_RANGE_LIST_VALUE_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdata_range_list_value libcdata_range_list_value_t; struct libcdata_range_list_value { /* The (range) start value */ uint64_t start; /* The (range) end */ uint64_t end; /* The (range) size */ uint64_t size; /* The value */ intptr_t *value; }; int libcdata_range_list_value_initialize( libcdata_range_list_value_t **range_list_value, libcerror_error_t **error ); int libcdata_range_list_value_free( libcdata_range_list_value_t **range_list_value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_range_list_value_clone( libcdata_range_list_value_t **destination_range_list_value, libcdata_range_list_value_t *source_range_list_value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_range_list_value_merge( libcdata_range_list_value_t *destination_range_list_value, libcdata_range_list_value_t *source_range_list_value, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_range_list_value_check_range_overlap( libcdata_range_list_value_t *range_list_value, uint64_t range_start, uint64_t range_end, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_RANGE_LIST_VALUE_H ) */ libewf-20140807/libcdata/libcdata_unused.h0000664000175000017500000000260213443450020022366 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2006-2019, 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( _LIBCDATA_UNUSED_H ) #define _LIBCDATA_UNUSED_H #include #if !defined( LIBCDATA_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCDATA_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCDATA_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCDATA_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCDATA_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCDATA_UNUSED_H ) */ libewf-20140807/libcdata/libcdata_range_list.h0000664000175000017500000002750213443450020023220 0ustar00lordyestalordyesta00000000000000/* * Range list * * Copyright (C) 2006-2019, 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( _LIBCDATA_RANGE_LIST_H ) #define _LIBCDATA_RANGE_LIST_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_range_list_value.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdata_internal_range_list libcdata_internal_range_list_t; struct libcdata_internal_range_list { /* The number of elements */ int number_of_elements; /* The first element */ libcdata_list_element_t *first_element; /* The last element */ libcdata_list_element_t *last_element; /* The current list element */ libcdata_list_element_t *current_element; /* The current list element index */ int current_element_index; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBCDATA_EXTERN \ int libcdata_range_list_initialize( libcdata_range_list_t **range_list, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_free( libcdata_range_list_t **range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_range_list_free_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t **range_list_element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_empty( libcdata_range_list_t *range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_clone( libcdata_range_list_t **destination_range_list, libcdata_range_list_t *source_range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_get_number_of_elements( libcdata_range_list_t *range_list, int *number_of_elements, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_get_first_element( libcdata_range_list_t *range_list, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_range_list_set_first_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_get_last_element( libcdata_range_list_t *range_list, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_range_list_set_last_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ); int libcdata_internal_range_list_append_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ); int libcdata_internal_range_list_append_value( libcdata_internal_range_list_t *internal_range_list, libcdata_range_list_value_t *value, libcerror_error_t **error ); int libcdata_internal_range_list_remove_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcerror_error_t **error ); int libcdata_internal_range_list_remove_range_value( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t **range_list_element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_range_list_insert_range_find_element( libcdata_internal_range_list_t *internal_range_list, uint64_t range_start, uint64_t range_end, int *element_index, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_range_list_check_range_overlap( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, libcerror_error_t **error ); int libcdata_internal_range_list_insert_range_before_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, intptr_t *value, libcdata_list_element_t **new_range_list_element, libcerror_error_t **error ); int libcdata_internal_range_list_insert_element_after_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_list_element_t *element, libcerror_error_t **error ); int libcdata_internal_range_list_insert_value_after_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *value, libcerror_error_t **error ); int libcdata_internal_range_list_merge_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, intptr_t *value, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_range_list_merge_overlapping_ranges( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcdata_range_list_t *backup_range_list, libcerror_error_t **error ); int libcdata_internal_range_list_insert_range_merge( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, intptr_t *value, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcdata_range_list_t *backup_range_list, libcerror_error_t **error ); int libcdata_internal_range_list_insert_range_revert_merge( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_t *backup_range_list, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_insert_range( libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_insert_range_list( libcdata_range_list_t *range_list, libcdata_range_list_t *source_range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_range_list_remove_shrink_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *range_list_value, uint64_t range_start, uint64_t range_end, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_split_function)( intptr_t **destination_value, intptr_t *source_value, uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_range_list_remove_split_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *range_list_value, uint64_t range_start, uint64_t range_end, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_split_function)( intptr_t **destination_value, intptr_t *source_value, uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_remove_range( libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_split_function)( intptr_t **destination_value, intptr_t *source_value, uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_range_list_get_element_by_index( libcdata_internal_range_list_t *internal_range_list, int element_index, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_range_list_get_element_at_offset( libcdata_internal_range_list_t *internal_range_list, uint64_t range_offset, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_range_list_get_value_by_index( libcdata_internal_range_list_t *internal_range_list, int element_index, libcdata_range_list_value_t **range_list_value, libcerror_error_t **error ); int libcdata_internal_range_list_get_value_at_offset( libcdata_internal_range_list_t *internal_range_list, uint64_t range_offset, libcdata_range_list_value_t **range_list_value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_get_range_by_index( libcdata_range_list_t *range_list, int element_index, uint64_t *range_start, uint64_t *range_size, intptr_t **value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_get_range_at_offset( libcdata_range_list_t *range_list, uint64_t range_offset, uint64_t *range_start, uint64_t *range_size, intptr_t **value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_range_is_present( libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_range_list_get_spanning_range( libcdata_range_list_t *range_list, uint64_t *range_start, uint64_t *range_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_RANGE_LIST_H ) */ libewf-20140807/libcdata/Makefile.am0000664000175000017500000000210413443450020021120 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCDATA AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libcdata.la libcdata_la_SOURCES = \ libcdata_array.c libcdata_array.h \ libcdata_btree.c libcdata_btree.h \ libcdata_btree_node.c libcdata_btree_node.h \ libcdata_btree_values_list.c libcdata_btree_values_list.h \ libcdata_definitions.h \ libcdata_error.c libcdata_error.h \ libcdata_extern.h \ libcdata_libcerror.h \ libcdata_libcthreads.h \ libcdata_list.c libcdata_list.h \ libcdata_list_element.c libcdata_list_element.h \ libcdata_range_list.c libcdata_range_list.h \ libcdata_range_list_value.c libcdata_range_list_value.h \ libcdata_support.c libcdata_support.h \ libcdata_tree_node.c libcdata_tree_node.h \ libcdata_types.h \ libcdata_unused.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcdata_la_SOURCES) libewf-20140807/libcdata/libcdata_range_list.c0000664000175000017500000034641613443450020023223 0ustar00lordyestalordyesta00000000000000/* * Range list * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_list_element.h" #include "libcdata_range_list.h" #include "libcdata_range_list_value.h" #include "libcdata_types.h" #include "libcdata_unused.h" /* Creates a range list * Make sure the value range_list is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_range_list_initialize( libcdata_range_list_t **range_list, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libcdata_range_list_initialize"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( *range_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid range list value already set.", function ); return( -1 ); } internal_range_list = memory_allocate_structure( libcdata_internal_range_list_t ); if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create range list.", function ); goto on_error; } if( memory_set( internal_range_list, 0, sizeof( libcdata_internal_range_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear range list.", function ); memory_free( internal_range_list ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_initialize( &( internal_range_list->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *range_list = (libcdata_range_list_t *) internal_range_list; return( 1 ); on_error: if( internal_range_list != NULL ) { memory_free( internal_range_list ); } return( -1 ); } /* Frees a range list including the elements * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_range_list_free( libcdata_range_list_t **range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libcdata_range_list_free"; int result = 1; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( *range_list != NULL ) { internal_range_list = (libcdata_internal_range_list_t *) *range_list; *range_list = NULL; if( libcdata_range_list_empty( (libcdata_range_list_t *) internal_range_list, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty range list.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_free( &( internal_range_list->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif memory_free( internal_range_list ); } return( result ); } /* Frees a range list element * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_free_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t **range_list_element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_free_element"; int result = 1; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( range_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list element.", function ); return( -1 ); } if( *range_list_element != NULL ) { if( libcdata_list_element_get_value( *range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from range list element.", function ); return( -1 ); } if( libcdata_range_list_value_free( &range_list_value, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free range list value.", function ); result = -1; } if( libcdata_list_element_free( range_list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free list element.", function ); result = -1; } } return( result ); } /* Empties a range list and frees the elements * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_range_list_empty( libcdata_range_list_t *range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_list_element_t *next_element = NULL; static char *function = "libcdata_range_list_empty"; int element_index = 0; int number_of_elements = 0; int result = 1; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_range_list->number_of_elements > 0 ) { number_of_elements = internal_range_list->number_of_elements; list_element = internal_range_list->first_element; for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_list_element_get_next_element( list_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, element_index ); result = -1; break; } internal_range_list->first_element = next_element; if( internal_range_list->last_element == list_element ) { internal_range_list->last_element = next_element; } internal_range_list->number_of_elements -= 1; if( next_element != NULL ) { if( libcdata_list_element_set_previous_element( next_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of list element: %d.", function, element_index + 1 ); result = -1; } } if( libcdata_list_element_set_next_element( list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of list element: %d.", function, element_index ); result = -1; } if( libcdata_internal_range_list_free_element( internal_range_list, &list_element, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free range list element: %d.", function, element_index ); result = -1; } list_element = next_element; } internal_range_list->current_element = NULL; internal_range_list->current_element_index = 0; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); result = -1; } #endif return( result ); } /* Clones the range list * * The values are cloned using the value_clone_function * On error the values are freed using the value_free_function * * Returns 1 if successful or -1 on error */ int libcdata_range_list_clone( libcdata_range_list_t **destination_range_list, libcdata_range_list_t *source_range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination, intptr_t *source, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_source_list_element = NULL; libcdata_internal_range_list_t *internal_destination_range_list = NULL; libcdata_internal_range_list_t *internal_source_range_list = NULL; libcdata_range_list_value_t *destination_range_list_value = NULL; static char *function = "libcdata_range_list_clone"; int element_index = 0; if( destination_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range list.", function ); return( -1 ); } if( *destination_range_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination range list value already set.", function ); return( -1 ); } if( source_range_list == NULL ) { *destination_range_list = NULL; return( 1 ); } internal_source_range_list = (libcdata_internal_range_list_t *) source_range_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_source_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_range_list_initialize( (libcdata_range_list_t **) &internal_destination_range_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination range list.", function ); goto on_error; } if( internal_destination_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination range list.", function ); goto on_error; } if( internal_source_range_list->first_element != NULL ) { internal_source_list_element = (libcdata_internal_list_element_t *) internal_source_range_list->first_element; for( element_index = 0; element_index < internal_source_range_list->number_of_elements; element_index++ ) { if( internal_source_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing source list element: %d.", function, element_index ); goto on_error; } if( libcdata_range_list_value_clone( &destination_range_list_value, (libcdata_range_list_value_t *) internal_source_list_element->value, value_free_function, value_clone_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination range list value: %d.", function, element_index ); goto on_error; } if( libcdata_internal_range_list_append_value( internal_destination_range_list, destination_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to append value: %d to destination range list.", function, element_index ); goto on_error; } destination_range_list_value = NULL; internal_source_list_element = (libcdata_internal_list_element_t *) internal_source_list_element->next_element; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_source_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); libcdata_range_list_free( (libcdata_range_list_t **) &internal_destination_range_list, value_free_function, NULL ); return( -1 ); } #endif *destination_range_list = (libcdata_range_list_t *) internal_destination_range_list; return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_source_range_list->read_write_lock, NULL ); #endif if( destination_range_list_value != NULL ) { libcdata_range_list_value_free( &destination_range_list_value, value_free_function, NULL ); } if( internal_destination_range_list != NULL ) { libcdata_range_list_free( (libcdata_range_list_t **) &internal_destination_range_list, value_free_function, NULL ); } return( -1 ); } /* Retrieves the number of elements in the range list * Returns 1 if successful or -1 on error */ int libcdata_range_list_get_number_of_elements( libcdata_range_list_t *range_list, int *number_of_elements, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libcdata_range_list_get_number_of_elements"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( number_of_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of elements.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *number_of_elements = internal_range_list->number_of_elements; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the first elements in the range list * Returns 1 if successful or -1 on error */ int libcdata_range_list_get_first_element( libcdata_range_list_t *range_list, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libcdata_range_list_get_first_element"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *element = internal_range_list->first_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the first element in the range list * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_set_first_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_next_element = NULL; static char *function = "libcdata_internal_range_list_set_first_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( element != NULL ) { if( libcdata_list_element_get_next_element( element, &backup_next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element of element.", function ); return( -1 ); } } backup_first_element = internal_range_list->first_element; if( element != NULL ) { if( libcdata_list_element_set_next_element( element, internal_range_list->first_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of element.", function ); goto on_error; } } if( internal_range_list->first_element != NULL ) { if( libcdata_list_element_set_previous_element( internal_range_list->first_element, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of first element.", function ); goto on_error; } } internal_range_list->first_element = element; return( 1 ); on_error: if( element != NULL ) { libcdata_list_element_set_next_element( element, backup_next_element, NULL ); } if( backup_first_element != NULL ) { libcdata_list_element_set_next_element( backup_first_element, NULL, NULL ); } internal_range_list->first_element = backup_first_element; return( -1 ); } /* Retrieves the last elements in the range list * Returns 1 if successful or -1 on error */ int libcdata_range_list_get_last_element( libcdata_range_list_t *range_list, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libcdata_range_list_get_last_element"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *element = internal_range_list->last_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the last element in the list * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_set_last_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_list_element_t *backup_last_element = NULL; libcdata_list_element_t *backup_previous_element = NULL; static char *function = "libcdata_internal_range_list_set_last_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( element != NULL ) { if( libcdata_list_element_get_previous_element( element, &backup_previous_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element of element.", function ); return( -1 ); } } backup_last_element = internal_range_list->last_element; if( element != NULL ) { if( libcdata_list_element_set_previous_element( element, internal_range_list->last_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of element.", function ); goto on_error; } } if( internal_range_list->last_element != NULL ) { if( libcdata_list_element_set_next_element( internal_range_list->last_element, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of last element.", function ); goto on_error; } } internal_range_list->last_element = element; return( 1 ); on_error: if( element != NULL ) { libcdata_list_element_set_previous_element( element, backup_previous_element, NULL ); } if( backup_last_element != NULL ) { libcdata_list_element_set_next_element( backup_last_element, NULL, NULL ); } internal_range_list->last_element = backup_last_element; return( -1 ); } /* Append a list element to the list * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_append_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ) { static char *function = "libcdata_internal_range_list_append_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } if( internal_range_list->first_element == NULL ) { internal_range_list->first_element = element; } if( libcdata_internal_range_list_set_last_element( internal_range_list, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last element.", function ); return( -1 ); } internal_range_list->number_of_elements += 1; return( 1 ); } /* Append a value to the list * Creates a new list element * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_append_value( libcdata_internal_range_list_t *internal_range_list, libcdata_range_list_value_t *value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_internal_range_list_append_value"; if( libcdata_list_element_initialize( &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libcdata_list_element_set_value( list_element, (intptr_t *) value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set value of list element.", function ); goto on_error; } if( libcdata_internal_range_list_append_element( internal_range_list, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append element to range list.", function ); goto on_error; } return( 1 ); on_error: if( list_element != NULL ) { libcdata_list_element_free( &list_element, NULL, NULL ); } return( -1 ); } /* Removes an element from the range list * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_remove_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcerror_error_t **error ) { libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_internal_range_list_remove_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( libcdata_list_element_get_elements( range_list_element, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from range list element.", function ); return( -1 ); } if( range_list_element == internal_range_list->first_element ) { internal_range_list->first_element = next_element; } if( range_list_element == internal_range_list->last_element ) { internal_range_list->last_element = previous_element; } if( next_element != NULL ) { if( libcdata_list_element_set_previous_element( next_element, previous_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of next element.", function ); return( -1 ); } } if( previous_element != NULL ) { if( libcdata_list_element_set_next_element( previous_element, next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of previous element.", function ); return( -1 ); } } if( libcdata_list_element_set_elements( range_list_element, NULL, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous and next element of range list element.", function ); return( -1 ); } internal_range_list->current_element = NULL; internal_range_list->current_element_index = 0; internal_range_list->number_of_elements -= 1; return( 1 ); } /* Removes an element from the range list and frees the element * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_remove_range_value( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t **range_list_element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_remove_range_value"; int result = 1; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( range_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list element.", function ); return( -1 ); } if( libcdata_internal_range_list_remove_element( internal_range_list, *range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove range list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( *range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range list value from range list element.", function ); return( -1 ); } if( libcdata_list_element_free( range_list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free range list element.", function ); result = -1; } if( libcdata_range_list_value_free( &range_list_value, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free range list value.", function ); result = -1; } return( result ); } /* Retrieves the element which the range should be inserted before or merged within * * On return element will be set to NULL if the range should be inserted at the end of the list. * * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_insert_range_find_element( libcdata_internal_range_list_t *internal_range_list, uint64_t range_start, uint64_t range_end LIBCDATA_ATTRIBUTE_UNUSED, int *element_index, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_list_element_t *current_element = NULL; libcdata_list_element_t *previous_element = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_insert_range_find_element"; int current_element_index = 0; int last_element_index = 0; LIBCDATA_UNREFERENCED_PARAMETER( range_end ) if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } current_element = internal_range_list->last_element; current_element_index = internal_range_list->number_of_elements; if( internal_range_list->number_of_elements > 0 ) { /* Check the last element first, most often the list will be filled linear */ current_element_index--; if( libcdata_list_element_get_value( current_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, current_element_index ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, current_element_index ); return( -1 ); } if( range_start > range_list_value->end ) { current_element = NULL; current_element_index++; } else if( internal_range_list->number_of_elements > 1 ) { last_element_index = current_element_index; if( ( current_element_index != internal_range_list->current_element_index ) && ( internal_range_list->current_element != NULL ) ) { /* Check the current element */ current_element = internal_range_list->current_element; current_element_index = internal_range_list->current_element_index; if( libcdata_list_element_get_value( current_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, current_element_index ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, current_element_index ); return( -1 ); } } if( range_start > range_list_value->end ) { while( current_element_index < last_element_index ) { if( libcdata_list_element_get_next_element( current_element, ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, current_element_index ); return( -1 ); } current_element_index++; if( libcdata_list_element_get_value( current_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, current_element_index ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, current_element_index ); return( -1 ); } if( range_start <= range_list_value->end ) { break; } } } else { while( current_element_index > 0 ) { previous_element = current_element; if( libcdata_list_element_get_previous_element( current_element, ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element: %d.", function, current_element_index ); return( -1 ); } current_element_index--; if( libcdata_list_element_get_value( current_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, current_element_index ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, current_element_index ); return( -1 ); } if( range_start > range_list_value->end ) { current_element = previous_element; current_element_index++; break; } } } } } if( current_element != NULL ) { internal_range_list->current_element = current_element; internal_range_list->current_element_index = current_element_index; } *element = current_element; *element_index = current_element_index; return( 1 ); } /* Checks if the range overlaps with the value of the range list element * Returns 1 if the range overlaps, 0 if not or -1 on error */ int libcdata_internal_range_list_check_range_overlap( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, libcerror_error_t **error ) { libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_check_range_overlap"; int result = 0; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( range_list_element != NULL ) { if( libcdata_list_element_get_value( range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from range list element.", function ); return( -1 ); } result = libcdata_range_list_value_check_range_overlap( range_list_value, range_start, range_end, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if range overlaps with range list value.", function ); return( -1 ); } } return( result ); } /* Inserts the range before the range list element * If range_list_element is NULL the element is inserted before or as the first element in the list * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_insert_range_before_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, intptr_t *value, libcdata_list_element_t **new_range_list_element, libcerror_error_t **error ) { libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_last_element = NULL; libcdata_list_element_t *new_element = NULL; libcdata_list_element_t *previous_element = NULL; libcdata_range_list_value_t *new_range_list_value = NULL; static char *function = "libcdata_internal_range_list_insert_range_before_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( new_range_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid new range list element.", function ); return( -1 ); } if( range_list_element != NULL ) { if( libcdata_list_element_get_previous_element( range_list_element, &previous_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from range list element.", function ); return( -1 ); } } if( libcdata_range_list_value_initialize( &new_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create range list value.", function ); goto on_error; } backup_first_element = internal_range_list->first_element; backup_last_element = internal_range_list->last_element; if( new_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value.", function ); goto on_error; } new_range_list_value->start = range_start; new_range_list_value->size = range_end - range_start; new_range_list_value->end = range_end; new_range_list_value->value = value; if( libcdata_list_element_initialize( &new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libcdata_list_element_set_value( new_element, (intptr_t *) new_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in list element.", function ); goto on_error; } if( internal_range_list->number_of_elements == 0 ) { internal_range_list->first_element = new_element; internal_range_list->last_element = new_element; } else if( range_list_element == NULL ) { if( libcdata_internal_range_list_set_last_element( internal_range_list, new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last element.", function ); goto on_error; } } else { if( libcdata_list_element_set_elements( new_element, previous_element, range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous and next element of element.", function ); goto on_error; } if( internal_range_list->first_element == range_list_element ) { internal_range_list->first_element = new_element; } else { if( libcdata_list_element_set_next_element( previous_element, new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of previous element.", function ); goto on_error; } } if( libcdata_list_element_set_previous_element( range_list_element, new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of range list element.", function ); goto on_error; } } internal_range_list->current_element = NULL; internal_range_list->current_element_index = 0; internal_range_list->number_of_elements += 1; *new_range_list_element = new_element; return( 1 ); on_error: if( new_element != NULL ) { libcdata_list_element_set_elements( new_element, NULL, NULL, NULL ); libcdata_list_element_free( &new_element, NULL, NULL ); } if( new_range_list_value != NULL ) { libcdata_range_list_value_free( &new_range_list_value, NULL, NULL ); } if( previous_element != NULL ) { libcdata_list_element_set_next_element( previous_element, range_list_element, NULL ); } if( range_list_element != NULL ) { libcdata_list_element_set_previous_element( range_list_element, previous_element, NULL ); } internal_range_list->first_element = backup_first_element; internal_range_list->last_element = backup_last_element; return( -1 ); } /* Inserts the element in the range list after the range list element * If range_list_element is NULL the element is inserted as the first element in the list * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_insert_element_after_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_internal_range_list_insert_element_after_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( libcdata_list_element_get_elements( element, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from list element.", function ); return( -1 ); } if( ( previous_element != NULL ) || ( next_element != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: list element already part of a list.", function ); return( -1 ); } if( internal_range_list->number_of_elements == 0 ) { if( internal_range_list->first_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid range list - first element already set.", function ); return( -1 ); } if( internal_range_list->last_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid range list - last element already set.", function ); return( -1 ); } internal_range_list->first_element = element; internal_range_list->last_element = element; } else { if( internal_range_list->first_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid range list - missing first element.", function ); return( -1 ); } if( internal_range_list->last_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid range list - missing last element.", function ); return( -1 ); } if( range_list_element == NULL ) { if( libcdata_internal_range_list_set_first_element( internal_range_list, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set first element.", function ); return( -1 ); } } else { if( libcdata_list_element_get_next_element( range_list_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from range list element.", function ); return( -1 ); } if( libcdata_list_element_set_elements( element, range_list_element, next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous and next element of list element.", function ); return( -1 ); } if( range_list_element == internal_range_list->last_element ) { internal_range_list->last_element = element; } else if( next_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: invalid range list element - missing next element.", function ); return( -1 ); } else { if( libcdata_list_element_set_previous_element( next_element, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of next element.", function ); return( -1 ); } } if( libcdata_list_element_set_next_element( range_list_element, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of range list element.", function ); return( -1 ); } } } internal_range_list->number_of_elements += 1; return( 1 ); } /* Inserts the range list value in the range list after the range list element * If range_list_element is NULL the value is inserted before the first element in the list * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_insert_value_after_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_internal_range_list_insert_value_after_element"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( libcdata_list_element_initialize( &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libcdata_list_element_set_value( list_element, (intptr_t *) value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set value in list element.", function ); goto on_error; } if( libcdata_internal_range_list_insert_element_after_element( internal_range_list, range_list_element, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert element after range list element.", function ); goto on_error; } list_element = NULL; return( 1 ); on_error: if( list_element != NULL ) { libcdata_list_element_free( &list_element, NULL, NULL ); } return( -1 ); } /* Merges the range into the range list element * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_merge_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, intptr_t *value, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_merge_range"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( libcdata_list_element_get_value( range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from range list element.", function ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value.", function ); return( -1 ); } if( range_list_value->value != NULL ) { if( value_merge_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value merge function.", function ); return( -1 ); } } if( range_list_value->value == NULL ) { range_list_value->value = value; } else { if( value_merge_function( range_list_value->value, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to merge value.", function ); return( -1 ); } } if( range_start < range_list_value->start ) { range_list_value->size += range_list_value->start - range_start; range_list_value->start = range_start; } if( range_end > range_list_value->end ) { range_list_value->size += range_end - range_list_value->end; range_list_value->end = range_end; } return( 1 ); } /* Merges successive overlapping ranges * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_merge_overlapping_ranges( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcdata_range_list_t *backup_range_list, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; libcdata_list_element_t *next_element = NULL; libcdata_range_list_value_t *next_range_list_value = NULL; static char *function = "libcdata_internal_range_list_merge_overlapping_ranges"; int result = 0; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( libcdata_list_element_get_next_element( range_list_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from range list element.", function ); return( -1 ); } while( next_element != NULL ) { list_element = next_element; if( libcdata_list_element_get_next_element( list_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element.", function ); return( -1 ); } if( libcdata_list_element_get_value( list_element, (intptr_t **) &next_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from next element.", function ); return( -1 ); } if( next_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing next range list value.", function ); return( -1 ); } result = libcdata_internal_range_list_check_range_overlap( internal_range_list, range_list_element, next_range_list_value->start, next_range_list_value->end, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if next range overlaps with range list element.", function ); return( -1 ); } else if( result == 0 ) { break; } if( libcdata_internal_range_list_append_value( (libcdata_internal_range_list_t *) backup_range_list, next_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to append value to backup range list.", function ); return( -1 ); } if( libcdata_internal_range_list_remove_element( internal_range_list, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove list element.", function ); return( -1 ); } if( libcdata_list_element_free( &list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free list element.", function ); return( -1 ); } if( libcdata_internal_range_list_merge_range( internal_range_list, range_list_element, next_range_list_value->start, next_range_list_value->end, next_range_list_value->value, value_merge_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to merge next range with range list element.", function ); return( -1 ); } } return( 1 ); } /* Inserts a range by merging the range into the range list element and successive overlapping ranges * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_insert_range_merge( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, uint64_t range_start, uint64_t range_end, intptr_t *value, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcdata_range_list_t *backup_range_list, libcerror_error_t **error ) { libcdata_range_list_value_t *backup_range_list_value = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_insert_range_merge"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( libcdata_list_element_get_value( range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from range list element.", function ); goto on_error; } if( libcdata_range_list_value_initialize( &backup_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create backup range list value.", function ); goto on_error; } backup_range_list_value->start = range_list_value->start; backup_range_list_value->end = range_list_value->end; backup_range_list_value->size = range_list_value->size; if( libcdata_internal_range_list_append_value( (libcdata_internal_range_list_t *) backup_range_list, backup_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to append value to backup range list.", function ); goto on_error; } backup_range_list_value = NULL; if( libcdata_internal_range_list_merge_range( internal_range_list, range_list_element, range_start, range_end, value, value_merge_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to merge range with range list element.", function ); goto on_error; } if( libcdata_internal_range_list_merge_overlapping_ranges( internal_range_list, range_list_element, value_merge_function, backup_range_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to merge range list element with overlapping ranges.", function ); goto on_error; } return( 1 ); on_error: if( backup_range_list_value != NULL ) { libcdata_range_list_value_free( &backup_range_list_value, NULL, NULL ); } return( -1 ); } /* Reverts a previously merge of the range list element and successive overlapping ranges * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_insert_range_revert_merge( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_t *backup_range_list, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_backup_range_list = NULL; libcdata_list_element_t *backup_range_list_element = NULL; libcdata_range_list_value_t *backup_range_list_value = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_insert_range_revert_merge"; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( backup_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid backup range list.", function ); return( -1 ); } internal_backup_range_list = (libcdata_internal_range_list_t *) backup_range_list; if( internal_backup_range_list->first_element == NULL ) { return( 1 ); } if( libcdata_list_element_get_value( internal_backup_range_list->first_element, (intptr_t **) &backup_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from first backup range list element.", function ); return( -1 ); } if( libcdata_list_element_get_value( range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from range list element.", function ); return( -1 ); } range_list_value->start = backup_range_list_value->start; range_list_value->end = backup_range_list_value->end; range_list_value->size = backup_range_list_value->size; while( internal_backup_range_list->first_element != NULL ) { if( libcdata_list_element_get_next_element( internal_backup_range_list->first_element, &backup_range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from first backup range list element.", function ); return( -1 ); } if( backup_range_list_element == NULL ) { break; } if( libcdata_internal_range_list_remove_element( internal_backup_range_list, backup_range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove backup range list element.", function ); return( -1 ); } if( libcdata_internal_range_list_insert_element_after_element( internal_range_list, range_list_element, backup_range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert element after range list element.", function ); return( -1 ); } backup_range_list_element = NULL; } return( 1 ); } /* Inserts a range * * The values are merged using the value_merge_function. * If the source value is NULL the merge function is not called. * * After a merge and on error the values are freed using * the value_free_function * * Returns 1 if successful, 0 if the range was merged or -1 on error */ int libcdata_range_list_insert_range( libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_list_element_t *new_element = NULL; libcdata_range_list_t *backup_range_list = NULL; static char *function = "libcdata_range_list_insert_range"; uint64_t range_end = 0; int element_index = 0; int result = 1; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( range_start > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range start value exceeds maximum.", function ); return( -1 ); } if( range_size > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range size value exceeds maximum.", function ); return( -1 ); } range_end = range_start + range_size; if( range_end < range_start ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range end value out of bounds.", function ); return( -1 ); } if( libcdata_range_list_initialize( &backup_range_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create backup range list.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); libcdata_range_list_free( &backup_range_list, NULL, NULL ); return( -1 ); } #endif if( libcdata_internal_range_list_insert_range_find_element( internal_range_list, range_start, range_end, &element_index, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to find element in list.", function ); result = -1; } if( result == 1 ) { result = libcdata_internal_range_list_check_range_overlap( internal_range_list, list_element, range_start, range_end, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to determine if range overlaps with range list element: %d.", function, element_index ); result = -1; } } if( result == 0 ) { result = 1; if( libcdata_internal_range_list_insert_range_before_element( internal_range_list, list_element, range_start, range_end, value, &new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert range before range list element.", function ); result = -1; } } else if( result != -1 ) { result = 0; if( libcdata_internal_range_list_insert_range_merge( internal_range_list, list_element, range_start, range_end, value, value_merge_function, backup_range_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to merge range with list element: %d.", function, element_index ); result = -1; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif libcdata_range_list_free( &backup_range_list, value_free_function, NULL ); return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 0 ) { libcdata_internal_range_list_insert_range_revert_merge( internal_range_list, list_element, backup_range_list, NULL ); } else if( result == 1 ) { libcdata_internal_range_list_remove_range_value( internal_range_list, &new_element, NULL, NULL ); } libcdata_range_list_free( &backup_range_list, NULL, NULL ); return( -1 ); #endif } /* Inserts a range list * * The values are merged using the value_merge_function. * If the source value is NULL the merge function is not called. * * After a merge and on error the values are freed using * the value_free_function * * The values in the source_range_list are not affected. * * Returns 1 if successful, or -1 on error */ int libcdata_range_list_insert_range_list( libcdata_range_list_t *range_list, libcdata_range_list_t *source_range_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_list_element_t *source_list_element = NULL; libcdata_range_list_value_t *source_range_list_value = NULL; static char *function = "libcdata_range_list_insert_range_list"; int element_index = 0; int number_of_elements = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( source_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source range list.", function ); return( -1 ); } if( libcdata_range_list_get_number_of_elements( source_range_list, &number_of_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of source list elements.", function ); return( -1 ); } if( libcdata_range_list_get_first_element( source_range_list, &source_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve first element from source list.", function ); return( -1 ); } for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_list_element_get_value( source_list_element, (intptr_t **) &source_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from source list element: %d.", function, element_index ); return( -1 ); } result = libcdata_range_list_insert_range( range_list, source_range_list_value->start, source_range_list_value->size, source_range_list_value->value, value_free_function, value_merge_function, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert source range list value: %d to range list.", function, element_index ); return( -1 ); } if( libcdata_list_element_get_next_element( source_list_element, &source_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from source list element: %d.", function, element_index ); return( -1 ); } } return( 1 ); } /* Shrinks a range * * A range that either overlaps the start or the end of the range list element * is removed by shrining the range of the range list element. * * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_remove_shrink_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *range_list_value, uint64_t range_start, uint64_t range_end, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_split_function)( intptr_t **destination_value, intptr_t *source_value, uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ) { intptr_t *split_value = NULL; static char *function = "libcdata_internal_range_list_remove_shrink_range"; uint64_t split_offset = 0; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( range_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list element.", function ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } if( ( range_start > range_list_value->start ) && ( range_end < range_list_value->end ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range value out of bounds.", function ); return( -1 ); } if( range_list_value->value != NULL ) { if( value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value free function.", function ); return( -1 ); } if( value_split_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value split function.", function ); return( -1 ); } } if( range_start <= range_list_value->start ) { split_offset = range_end; } else { split_offset = range_start; } if( range_list_value->value != NULL ) { if( value_split_function( &split_value, range_list_value->value, split_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split value range offset: %" PRIu64 ".", function, split_offset ); goto on_error; } if( value_free_function( &( range_list_value->value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to free value.", function ); range_list_value->value = split_value; goto on_error; } range_list_value->value = split_value; } if( split_offset > range_list_value->start ) { range_list_value->start = split_offset; range_list_value->size = range_list_value->end - split_offset; } else { range_list_value->end = split_offset; range_list_value->size = split_offset - range_list_value->start; } return( 1 ); on_error: return( -1 ); } /* Splits a range * * A range that either overlaps a part of the range list element * is removed by splitting the range of the range list element. * * Returns 1 if successful, or -1 on error */ int libcdata_internal_range_list_remove_split_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *range_list_value, uint64_t range_start, uint64_t range_end, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_split_function)( intptr_t **destination_value, intptr_t *source_value, uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_range_list_value_t *split_range_list_value = NULL; static char *function = "libcdata_internal_range_list_remove_split_range"; uint64_t split_offset = 0; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( range_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list element.", function ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } if( ( range_start <= range_list_value->start ) || ( range_end >= range_list_value->end ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range value out of bounds.", function ); return( -1 ); } if( range_list_value->value != NULL ) { if( value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value free function.", function ); return( -1 ); } if( value_split_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value split function.", function ); return( -1 ); } } split_offset = range_end; if( libcdata_range_list_value_initialize( &split_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create range list value.", function ); goto on_error; } if( split_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value.", function ); goto on_error; } if( range_list_value->value != NULL ) { if( value_split_function( &( split_range_list_value->value ), range_list_value->value, split_offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split value at range offset: %" PRIu64 ".", function, split_offset ); goto on_error; } } split_range_list_value->start = split_offset; split_range_list_value->size = range_list_value->end - split_offset; split_range_list_value->end = range_list_value->end; range_list_value->size = split_offset - range_list_value->start; range_list_value->end = split_offset; if( libcdata_internal_range_list_insert_value_after_element( internal_range_list, range_list_element, split_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert range list value after range list element.", function ); goto on_error; } split_range_list_value = NULL; if( libcdata_internal_range_list_remove_shrink_range( internal_range_list, range_list_element, range_list_value, range_start, range_end, value_free_function, value_split_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to shrink range.", function ); goto on_error; } return( 1 ); on_error: if( split_range_list_value != NULL ) { libcdata_range_list_value_free( &split_range_list_value, value_free_function, NULL ); } return( -1 ); } /* Removes a range * * The values are split using the value_merge_function. * If the source value is NULL the split function is not called. * On return destination_value of the value_merge_function * should contain data greater equal to the split_range_offset. * * After a split and on error the values are freed using * the value_free_function * * Returns 1 if successful, or -1 on error */ int libcdata_range_list_remove_range( libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_split_function)( intptr_t **destination_value, intptr_t *source_value, uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_remove_range"; uint64_t next_range_start = 0; uint64_t range_end = 0; int result = 1; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( range_start > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range start value exceeds maximum.", function ); return( -1 ); } if( range_size > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range size value exceeds maximum.", function ); return( -1 ); } range_end = range_start + range_size; if( range_end < range_start ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range end value out of bounds.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif while( range_start < range_end ) { result = libcdata_internal_range_list_get_element_at_offset( internal_range_list, range_start, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element for range offset: %" PRIu64 ".", function, range_start ); goto on_error; } else if( result == 0 ) { /* The specified range is not defined in the range list */ if( list_element == NULL ) { break; } } if( libcdata_list_element_get_value( list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element for range offset: %" PRIu64 ".", function, range_start ); goto on_error; } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element for range offset: %" PRIu64 ".", function, range_start ); goto on_error; } if( result == 0 ) { /* The specified range is not defined in the range list */ if( range_list_value->start >= range_end ) { break; } range_start = range_list_value->start; } next_range_start = range_list_value->end; if( ( range_start <= range_list_value->start ) && ( range_end >= range_list_value->end ) ) { if( libcdata_internal_range_list_remove_range_value( internal_range_list, &list_element, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove range value.", function ); goto on_error; } } else if( ( range_start > range_list_value->start ) && ( range_end < range_list_value->end ) ) { if( libcdata_internal_range_list_remove_split_range( internal_range_list, list_element, range_list_value, range_start, range_end, value_free_function, value_split_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to split range.", function ); goto on_error; } } else { if( libcdata_internal_range_list_remove_shrink_range( internal_range_list, list_element, range_list_value, range_start, range_end, value_free_function, value_split_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to shrink range.", function ); goto on_error; } } range_start = next_range_start; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_write( internal_range_list->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves a specific element from the range list * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_get_element_by_index( libcdata_internal_range_list_t *internal_range_list, int element_index, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_list_element_t *current_element = NULL; static char *function = "libcdata_internal_range_list_get_element_by_index"; int current_element_index = 0; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( ( element_index < 0 ) || ( element_index >= internal_range_list->number_of_elements ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } current_element = internal_range_list->current_element; current_element_index = internal_range_list->current_element_index; if( ( current_element != NULL ) && ( current_element_index != element_index ) ) { if( element_index < current_element_index ) { if( ( current_element_index - element_index ) < ( internal_range_list->number_of_elements / 2 ) ) { while( current_element_index > element_index ) { if( libcdata_list_element_get_previous_element( current_element, ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element: %d.", function, current_element_index ); return( -1 ); } current_element_index--; } } } else { if( ( element_index - current_element_index ) < ( internal_range_list->number_of_elements / 2 ) ) { while( current_element_index < element_index ) { if( libcdata_list_element_get_next_element( current_element, ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, current_element_index ); return( -1 ); } current_element_index++; } } } } if( ( current_element == NULL ) || ( current_element_index != element_index ) ) { if( element_index < ( internal_range_list->number_of_elements / 2 ) ) { current_element = internal_range_list->first_element; for( current_element_index = 0; current_element_index < element_index; current_element_index++ ) { if( libcdata_list_element_get_next_element( current_element, ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, current_element_index ); return( -1 ); } } } else { current_element = internal_range_list->last_element; for( current_element_index = ( internal_range_list->number_of_elements - 1 ); current_element_index > element_index; current_element_index-- ) { if( libcdata_list_element_get_previous_element( current_element, ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element: %d.", function, current_element_index ); return( -1 ); } } } } if( current_element != NULL ) { internal_range_list->current_element = current_element; internal_range_list->current_element_index = current_element_index; } *element = current_element; return( 1 ); } /* Retrieves the element that contains the range offset * If the function returns element can be set to contain the element * containing the next range list value. * Returns 1 if successful, 0 if not found or -1 on error */ int libcdata_internal_range_list_get_element_at_offset( libcdata_internal_range_list_t *internal_range_list, uint64_t range_offset, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_list_element_t *range_list_element = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_internal_range_list_get_element_at_offset"; int element_index = 0; if( internal_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } if( range_offset > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range offset value exceeds maximum.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } /* TODO add optimization using current element */ range_list_element = internal_range_list->first_element; for( element_index = 0; element_index < internal_range_list->number_of_elements; element_index++ ) { if( libcdata_list_element_get_value( range_list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, element_index ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, element_index ); return( -1 ); } if( range_offset < range_list_value->start ) { break; } if( ( range_offset >= range_list_value->start ) && ( range_offset < range_list_value->end ) ) { *element = range_list_element; return( 1 ); } if( libcdata_list_element_get_next_element( range_list_element, &range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, element_index ); return( -1 ); } } *element = NULL; return( 0 ); } /* Retrieves a specific value from the range list * Returns 1 if successful or -1 on error */ int libcdata_internal_range_list_get_value_by_index( libcdata_internal_range_list_t *internal_range_list, int element_index, libcdata_range_list_value_t **range_list_value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_internal_range_list_get_value_by_index"; if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } if( libcdata_internal_range_list_get_element_by_index( internal_range_list, element_index, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d.", function, element_index ); return( -1 ); } if( libcdata_list_element_get_value( list_element, (intptr_t **) range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, element_index ); return( -1 ); } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value: %d .", function, element_index ); return( -1 ); } return( 1 ); } /* Retrieves the value that contains the range offset * Returns 1 if successful, 0 if no value was found or -1 on error */ int libcdata_internal_range_list_get_value_at_offset( libcdata_internal_range_list_t *internal_range_list, uint64_t range_offset, libcdata_range_list_value_t **range_list_value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_internal_range_list_get_value_at_offset"; int result = 0; if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } result = libcdata_internal_range_list_get_element_at_offset( internal_range_list, range_offset, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element for range offset: %" PRIu64 ".", function, range_offset ); return( -1 ); } else if( result != 0 ) { if( libcdata_list_element_get_value( list_element, (intptr_t **) range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element for range offset: %" PRIu64 ".", function, range_offset ); return( -1 ); } if( *range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value for range offset: %" PRIu64 ".", function, range_offset ); return( -1 ); } } return( result ); } /* Retrieves a specific range * Returns 1 if successful or -1 on error */ int libcdata_range_list_get_range_by_index( libcdata_range_list_t *range_list, int element_index, uint64_t *range_start, uint64_t *range_size, intptr_t **value, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_get_range_by_index"; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range start.", function ); return( -1 ); } if( range_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range size.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_internal_range_list_get_value_by_index( internal_range_list, element_index, &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range list value: %d.", function, element_index ); goto on_error; } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value: %d.", function, element_index ); goto on_error; } *range_start = range_list_value->start; *range_size = range_list_value->size; *value = range_list_value->value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves a range for a specific range offset * Returns 1 if successful, 0 if no range was found or -1 on error */ int libcdata_range_list_get_range_at_offset( libcdata_range_list_t *range_list, uint64_t range_offset, uint64_t *range_start, uint64_t *range_size, intptr_t **value, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_get_range_at_offset"; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range start.", function ); return( -1 ); } if( range_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range size.", function ); return( -1 ); } if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif result = libcdata_internal_range_list_get_value_at_offset( internal_range_list, range_offset, &range_list_value, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range list value for range offset: %" PRIu64 ".", function, range_offset ); goto on_error; } else if( result != 0 ) { if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value for range offset: %" PRIu64 ".", function, range_offset ); goto on_error; } *range_start = range_list_value->start; *range_size = range_list_value->size; *value = range_list_value->value; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, NULL ); #endif return( -1 ); } /* Determines if a certain range is present * Returns 1 if present, 0 if not present or -1 on error */ int libcdata_range_list_range_is_present( libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_range_is_present"; uint64_t range_end = 0; int element_index = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( range_start > (uint64_t) INT64_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid range start value exceeds maximum.", function ); return( -1 ); } if( range_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid size value exceeds maximum.", function ); return( -1 ); } range_end = range_start + range_size; if( range_end < range_start ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range end value out of bounds.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif /* TODO add optimization using current element */ list_element = internal_range_list->first_element; for( element_index = 0; element_index < internal_range_list->number_of_elements; element_index++ ) { if( libcdata_list_element_get_value( list_element, (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, element_index ); goto on_error; } if( range_end < range_list_value->start ) { break; } if( ( range_start >= range_list_value->start ) && ( range_end <= range_list_value->end ) ) { result = 1; break; } if( libcdata_list_element_get_next_element( list_element, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, element_index ); goto on_error; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves the range spanning the ranges in the range list * Returns 1 if present, 0 if not present or -1 on error */ int libcdata_range_list_get_spanning_range( libcdata_range_list_t *range_list, uint64_t *range_start, uint64_t *range_size, libcerror_error_t **error ) { libcdata_range_list_value_t *range_list_value = NULL; libcdata_internal_range_list_t *internal_range_list = NULL; static char *function = "libcdata_range_list_get_spanning_range"; int element_index = 0; int result = 0; if( range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list.", function ); return( -1 ); } internal_range_list = (libcdata_internal_range_list_t *) range_list; if( range_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range start.", function ); return( -1 ); } if( range_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range size.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( internal_range_list->number_of_elements > 0 ) { if( libcdata_internal_range_list_get_value_by_index( internal_range_list, 0, &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range list value: 0.", function ); goto on_error; } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value: 0.", function ); goto on_error; } *range_start = range_list_value->start; if( internal_range_list->number_of_elements > 1 ) { element_index = internal_range_list->number_of_elements - 1; if( libcdata_internal_range_list_get_value_by_index( internal_range_list, element_index, &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve range list value: %d.", function, element_index ); goto on_error; } if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value: %d.", function, element_index ); goto on_error; } } *range_size = range_list_value->end - *range_start; result = 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( result ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_range_list->read_write_lock, NULL ); #endif return( -1 ); } libewf-20140807/libcdata/libcdata_extern.h0000664000175000017500000000240613443450020022372 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2006-2019, 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( _LIBCDATA_INTERNAL_EXTERN_H ) #define _LIBCDATA_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if !defined( HAVE_LOCAL_LIBCDATA ) #include #define LIBCDATA_EXTERN_VARIABLE LIBCDATA_EXTERN #else #define LIBCDATA_EXTERN /* extern */ #define LIBCDATA_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBCDATA_INTERNAL_EXTERN_H ) */ libewf-20140807/libcdata/libcdata_support.c0000664000175000017500000000220213443450020022566 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include "libcdata_definitions.h" #include "libcdata_support.h" #if !defined( HAVE_LOCAL_LIBCDATA ) /* Returns the library version as a string */ const char *libcdata_get_version( void ) { return( (const char *) LIBCDATA_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ libewf-20140807/libcdata/libcdata_list_element.h0000664000175000017500000000744113443450020023555 0ustar00lordyestalordyesta00000000000000/* * List element functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_LIST_ELEMENT_H ) #define _LIBCDATA_LIST_ELEMENT_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdata_internal_list_element libcdata_internal_list_element_t; struct libcdata_internal_list_element { /* The list the element is part of */ intptr_t *parent_list; /* The previous list element */ libcdata_list_element_t *previous_element; /* The next list element */ libcdata_list_element_t *next_element; /* The value */ intptr_t *value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBCDATA_EXTERN \ int libcdata_list_element_initialize( libcdata_list_element_t **element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_free( libcdata_list_element_t **element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_list_element_get_parent_list( libcdata_list_element_t *element, intptr_t **parent_list, libcerror_error_t **error ); int libcdata_list_element_set_parent_list( libcdata_list_element_t *element, intptr_t *parent_list, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_get_previous_element( libcdata_list_element_t *element, libcdata_list_element_t **previous_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_set_previous_element( libcdata_list_element_t *element, libcdata_list_element_t *previous_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_get_next_element( libcdata_list_element_t *element, libcdata_list_element_t **next_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_set_next_element( libcdata_list_element_t *element, libcdata_list_element_t *next_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_get_elements( libcdata_list_element_t *element, libcdata_list_element_t **previous_element, libcdata_list_element_t **next_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_set_elements( libcdata_list_element_t *element, libcdata_list_element_t *previous_element, libcdata_list_element_t *next_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_get_value( libcdata_list_element_t *element, intptr_t **value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_element_set_value( libcdata_list_element_t *element, intptr_t *value, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_LIST_ELEMENT_H ) */ libewf-20140807/libcdata/libcdata_btree_values_list.c0000664000175000017500000001220513443450020024571 0ustar00lordyestalordyesta00000000000000/* * Balanced tree values list functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_btree_values_list.h" #include "libcdata_libcerror.h" #include "libcdata_list.h" #include "libcdata_list_element.h" #include "libcdata_types.h" /* Frees a B-tree values list * Returns 1 if successful or -1 on error */ int libcdata_btree_values_list_free( libcdata_list_t **values_list, libcerror_error_t **error ) { static char *function = "libcdata_btree_values_list_free"; int result = 1; if( values_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list.", function ); return( -1 ); } if( libcdata_list_free( values_list, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free values list.", function ); result = -1; } return( result ); } /* Removes an element from the values list * Returns 1 if successful or -1 on error */ int libcdata_btree_values_list_remove_element( libcdata_list_t *values_list, libcdata_list_element_t **values_list_element, libcerror_error_t **error ) { static char *function = "libcdata_btree_values_list_remove_element"; if( values_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list.", function ); return( -1 ); } if( values_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list element.", function ); return( -1 ); } if( libcdata_list_remove_element( values_list, *values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove element from values list.", function ); return( -1 ); } if( libcdata_list_element_free( values_list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free element.", function ); return( -1 ); } return( 1 ); } /* Replaces the values list element with the previous element * If available replacement_value is set to the value of the previous element * Returns 1 if successful or -1 on error */ int libcdata_btree_values_list_replace_element_with_previous( libcdata_list_t *values_list, libcdata_list_element_t **values_list_element, intptr_t **replacement_value, libcerror_error_t **error ) { libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_btree_values_list_replace_element_with_previous"; if( values_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list.", function ); return( -1 ); } if( values_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid values list element.", function ); return( -1 ); } if( libcdata_list_element_get_previous_element( *values_list_element, &previous_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from values list element.", function ); return( -1 ); } if( previous_element != NULL ) { if( libcdata_list_element_get_value( previous_element, replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from previous element.", function ); return( -1 ); } } if( libcdata_btree_values_list_remove_element( values_list, values_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove element from values list.", function ); return( -1 ); } *values_list_element = previous_element; return( 1 ); } libewf-20140807/libcdata/libcdata_range_list_value.c0000664000175000017500000002463113443450020024407 0ustar00lordyestalordyesta00000000000000/* * Range list value * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_libcerror.h" #include "libcdata_range_list_value.h" /* Creates a range list value * Make sure the value range_list_value is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_range_list_value_initialize( libcdata_range_list_value_t **range_list_value, libcerror_error_t **error ) { static char *function = "libcdata_range_list_value_initialize"; if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } if( *range_list_value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid range list value value already set.", function ); return( -1 ); } *range_list_value = memory_allocate_structure( libcdata_range_list_value_t ); if( *range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create range list value.", function ); goto on_error; } if( memory_set( *range_list_value, 0, sizeof( libcdata_range_list_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear range list value.", function ); goto on_error; } return( 1 ); on_error: if( *range_list_value != NULL ) { memory_free( *range_list_value ); *range_list_value = NULL; } return( -1 ); } /* Frees a range list value * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_range_list_value_free( libcdata_range_list_value_t **range_list_value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { static char *function = "libcdata_range_list_value_free"; int result = 1; if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } if( *range_list_value != NULL ) { if( value_free_function != NULL ) { if( value_free_function( &( ( *range_list_value )->value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value.", function ); result = -1; } } memory_free( *range_list_value ); *range_list_value = NULL; } return( result ); } /* Clones the range list value * * The values are cloned using the value_clone_function * On error the values are freed using the value_free_function * * Returns 1 if successful or -1 on error */ int libcdata_range_list_value_clone( libcdata_range_list_value_t **destination_range_list_value, libcdata_range_list_value_t *source_range_list_value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { static char *function = "libcdata_range_list_value_clone"; if( destination_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range list value.", function ); return( -1 ); } if( *destination_range_list_value != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination range list value value already set.", function ); return( -1 ); } if( value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value free function.", function ); return( -1 ); } if( value_clone_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value clone function.", function ); return( -1 ); } if( source_range_list_value == NULL ) { *destination_range_list_value = NULL; return( 1 ); } *destination_range_list_value = memory_allocate_structure( libcdata_range_list_value_t ); if( *destination_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create destination range list value.", function ); goto on_error; } if( memory_copy( *destination_range_list_value, source_range_list_value, sizeof( libcdata_range_list_value_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, "%s: unable to copy source to destination range list value.", function ); memory_free( *destination_range_list_value ); *destination_range_list_value = NULL; return( -1 ); } ( *destination_range_list_value )->value = NULL; if( value_clone_function( &( ( *destination_range_list_value )->value ), source_range_list_value->value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination value.", function ); goto on_error; } return( 1 ); on_error: if( *destination_range_list_value != NULL ) { if( ( *destination_range_list_value )->value != NULL ) { value_free_function( &( ( *destination_range_list_value )->value ), NULL ); } memory_free( *destination_range_list_value ); *destination_range_list_value = NULL; } return( -1 ); } /* Merges the range list values * * The values are merged using the value_merge_function. * If the source value is NULL the merge function is not called. * * Returns 1 if successful or -1 on error */ int libcdata_range_list_value_merge( libcdata_range_list_value_t *destination_range_list_value, libcdata_range_list_value_t *source_range_list_value, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { static char *function = "libcdata_range_list_value_merge"; if( destination_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination range list value.", function ); return( -1 ); } if( source_range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid source range list value.", function ); return( -1 ); } if( source_range_list_value->value != NULL ) { if( destination_range_list_value->value == NULL ) { destination_range_list_value->value = source_range_list_value->value; } else { if( value_merge_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value merge function.", function ); return( -1 ); } if( value_merge_function( destination_range_list_value->value, source_range_list_value->value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to merge source with destination value.", function ); return( -1 ); } } } if( destination_range_list_value->start > source_range_list_value->start ) { /* Merge a preceding range */ destination_range_list_value->size += destination_range_list_value->start - source_range_list_value->start; destination_range_list_value->start = source_range_list_value->start; } if( destination_range_list_value->end < source_range_list_value->end ) { /* Merge a successive range */ destination_range_list_value->size += source_range_list_value->end - destination_range_list_value->end; destination_range_list_value->end = source_range_list_value->end; } return( 1 ); } /* Checks if the range overlaps with the range list value * Returns 1 if the range overlaps, 0 if not or -1 on error */ int libcdata_range_list_value_check_range_overlap( libcdata_range_list_value_t *range_list_value, uint64_t range_start, uint64_t range_end, libcerror_error_t **error ) { static char *function = "libcdata_range_list_value_check_range_overlap"; if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid range list value.", function ); return( -1 ); } /* Check if the range overlaps the existing range entirely */ if( ( range_start < range_list_value->start ) && ( range_end > range_list_value->end ) ) { return( 1 ); } /* Check if the range overlaps at the end of the existing range */ if( ( range_start >= range_list_value->start ) && ( range_start <= range_list_value->end ) ) { return( 1 ); } /* Check if the range overlaps at the beginning of the existing range */ if( ( range_end >= range_list_value->start ) && ( range_end <= range_list_value->end ) ) { return( 1 ); } return( 0 ); } libewf-20140807/libcdata/libcdata_libcerror.h0000664000175000017500000000264013443450020023050 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2006-2019, 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( _LIBCDATA_LIBCERROR_H ) #define _LIBCDATA_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCDATA_LIBCERROR_H ) */ libewf-20140807/libcdata/libcdata_error.c0000664000175000017500000000554013443450020022213 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_error.h" #include "libcdata_libcerror.h" #if !defined( HAVE_LOCAL_LIBCDATA ) /* Free an error and its elements */ void libcdata_error_free( libcdata_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcdata_error_fprint( libcdata_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcdata_error_sprint( libcdata_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcdata_error_backtrace_fprint( libcdata_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcdata_error_backtrace_sprint( libcdata_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ libewf-20140807/libcdata/libcdata_error.h0000664000175000017500000000340513443450020022216 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_INTERNAL_ERROR_H ) #define _LIBCDATA_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBCDATA ) #include #endif #include "libcdata_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCDATA ) LIBCDATA_EXTERN \ void libcdata_error_free( libcdata_error_t **error ); LIBCDATA_EXTERN \ int libcdata_error_fprint( libcdata_error_t *error, FILE *stream ); LIBCDATA_EXTERN \ int libcdata_error_sprint( libcdata_error_t *error, char *string, size_t size ); LIBCDATA_EXTERN \ int libcdata_error_backtrace_fprint( libcdata_error_t *error, FILE *stream ); LIBCDATA_EXTERN \ int libcdata_error_backtrace_sprint( libcdata_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_INTERNAL_ERROR_H ) */ libewf-20140807/libcdata/libcdata_support.h0000664000175000017500000000232013443450020022574 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_SUPPORT_H ) #define _LIBCDATA_SUPPORT_H #include #include #include "libcdata_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCDATA ) LIBCDATA_EXTERN \ const char *libcdata_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_SUPPORT_H ) */ libewf-20140807/libcdata/libcdata_btree_node.h0000664000175000017500000000562213443450020023176 0ustar00lordyestalordyesta00000000000000/* * Balanced tree node functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_BTREE_NODE_H ) #define _LIBCDATA_BTREE_NODE_H #include #include #include "libcdata_libcerror.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif int libcdata_btree_node_get_sub_node_by_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **sub_node, libcdata_list_element_t **values_list_element, libcerror_error_t **error ); int libcdata_btree_node_get_upper_node_by_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **upper_node, libcdata_list_element_t **values_list_element, libcerror_error_t **error ); int libcdata_btree_node_append_value( libcdata_tree_node_t *node, intptr_t *value, libcerror_error_t **error ); int libcdata_btree_node_insert_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_btree_node_replace_value( libcdata_tree_node_t *node, intptr_t *value, intptr_t *replacement_value, libcerror_error_t **error ); int libcdata_btree_node_flatten_node( libcdata_tree_node_t **node, libcerror_error_t **error ); int libcdata_btree_node_remove_sub_node( libcdata_tree_node_t *node, libcdata_tree_node_t **sub_node, libcerror_error_t **error ); int libcdata_btree_node_remove_value( libcdata_tree_node_t *node, intptr_t *value, intptr_t *replacement_value, libcerror_error_t **error ); int libcdata_btree_node_split( libcdata_tree_node_t *node, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_BTREE_NODE_H ) */ libewf-20140807/libcdata/libcdata_list.c0000664000175000017500000017732013443450020022043 0ustar00lordyestalordyesta00000000000000/* * List functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_list.h" #include "libcdata_list_element.h" #include "libcdata_types.h" /* Creates a list * Make sure the value list is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_list_initialize( libcdata_list_t **list, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; static char *function = "libcdata_list_initialize"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid list value already set.", function ); return( -1 ); } internal_list = memory_allocate_structure( libcdata_internal_list_t ); if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create list.", function ); goto on_error; } if( memory_set( internal_list, 0, sizeof( libcdata_internal_list_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear list.", function ); memory_free( internal_list ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_initialize( &( internal_list->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *list = (libcdata_list_t *) internal_list; return( 1 ); on_error: if( internal_list != NULL ) { memory_free( internal_list ); } return( -1 ); } /* Frees a list including the elements * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_list_free( libcdata_list_t **list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; static char *function = "libcdata_list_free"; int result = 1; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( *list != NULL ) { internal_list = (libcdata_internal_list_t *) *list; *list = NULL; if( libcdata_list_empty( (libcdata_list_t*) internal_list, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to empty list.", function ); result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_free( &( internal_list->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif memory_free( internal_list ); } return( result ); } /* Empties a list and frees the elements * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_list_empty( libcdata_list_t *list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_list_element_t *next_element = NULL; static char *function = "libcdata_list_empty"; int element_index = 0; int number_of_elements = 0; int result = 1; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif if( internal_list->number_of_elements > 0 ) { number_of_elements = internal_list->number_of_elements; list_element = internal_list->first_element; for( element_index = 0; element_index < number_of_elements; element_index++ ) { if( libcdata_list_element_get_next_element( list_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, element_index ); result = -1; break; } internal_list->first_element = next_element; if( internal_list->last_element == list_element ) { internal_list->last_element = next_element; } internal_list->number_of_elements -= 1; if( next_element != NULL ) { if( libcdata_list_element_set_previous_element( next_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of list element: %d.", function, element_index + 1 ); result = -1; } } if( libcdata_list_element_set_next_element( list_element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of list element: %d.", function, element_index ); result = -1; } if( libcdata_list_element_free( &list_element, value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free list element: %d.", function, element_index ); result = -1; } list_element = next_element; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); result = -1; } #endif return( result ); } /* Clones the list and its elements * * The values are cloned using the value_clone_function * On error the values are freed using the value_free_function * * Returns 1 if successful or -1 on error */ int libcdata_list_clone( libcdata_list_t **destination_list, libcdata_list_t *source_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_list_t *internal_destination_list = NULL; libcdata_internal_list_t *internal_source_list = NULL; libcdata_internal_list_element_t *internal_source_list_element = NULL; intptr_t *destination_value = NULL; static char *function = "libcdata_list_clone"; int element_index = 0; if( destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid destination list.", function ); return( -1 ); } if( *destination_list != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid destination list already set.", function ); return( -1 ); } if( value_free_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value free function.", function ); return( -1 ); } if( value_clone_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value clone function.", function ); return( -1 ); } if( source_list == NULL ) { *destination_list = NULL; return( 1 ); } internal_source_list = (libcdata_internal_list_t *) source_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_source_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( libcdata_list_initialize( (libcdata_list_t **) &internal_destination_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination list.", function ); goto on_error; } if( internal_destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing destination list.", function ); goto on_error; } if( internal_source_list->first_element != NULL ) { internal_source_list_element = (libcdata_internal_list_element_t *) internal_source_list->first_element; for( element_index = 0; element_index < internal_source_list->number_of_elements; element_index++ ) { if( internal_source_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing source list element: %d.", function, element_index ); goto on_error; } if( value_clone_function( &destination_value, internal_source_list_element->value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create destination value: %d.", function, element_index ); goto on_error; } if( libcdata_list_append_value( (libcdata_list_t *) internal_destination_list, destination_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value: %d to destination list.", function, element_index ); goto on_error; } destination_value = NULL; internal_source_list_element = (libcdata_internal_list_element_t *) internal_source_list_element->next_element; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_source_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); libcdata_list_free( (libcdata_list_t **) &internal_destination_list, value_free_function, error ); return( -1 ); } #endif *destination_list = (libcdata_list_t *) internal_destination_list; return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_source_list->read_write_lock, NULL ); #endif if( destination_value != NULL ) { value_free_function( &destination_value, NULL ); } if( internal_destination_list != NULL ) { libcdata_list_free( (libcdata_list_t **) &internal_destination_list, value_free_function, error ); } return( -1 ); } /* Retrieves the number of elements in the list * Returns 1 if successful or -1 on error */ int libcdata_list_get_number_of_elements( libcdata_list_t *list, int *number_of_elements, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; static char *function = "libcdata_list_get_number_of_elements"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( number_of_elements == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of elements.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *number_of_elements = internal_list->number_of_elements; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Retrieves the first elements in the list * Returns 1 if successful or -1 on error */ int libcdata_list_get_first_element( libcdata_list_t *list, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; static char *function = "libcdata_list_get_first_element"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *element = internal_list->first_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the first element in the list * Returns 1 if successful or -1 on error */ int libcdata_internal_list_set_first_element( libcdata_internal_list_t *internal_list, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_list_element_t *backup_first_element = NULL; static char *function = "libcdata_internal_list_set_first_element"; if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } backup_first_element = internal_list->first_element; if( element != NULL ) { if( libcdata_list_element_set_next_element( element, internal_list->first_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of element.", function ); goto on_error; } } if( internal_list->first_element != NULL ) { if( libcdata_list_element_set_previous_element( internal_list->first_element, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of first element.", function ); goto on_error; } } internal_list->first_element = element; return( 1 ); on_error: if( element != NULL ) { libcdata_list_element_set_next_element( element, NULL, NULL ); } if( backup_first_element != NULL ) { libcdata_list_element_set_next_element( backup_first_element, NULL, NULL ); } internal_list->first_element = backup_first_element; return( -1 ); } /* Retrieves the last elements in the list * Returns 1 if successful or -1 on error */ int libcdata_list_get_last_element( libcdata_list_t *list, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; static char *function = "libcdata_list_get_last_element"; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *element = internal_list->last_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the last element in the list * Returns 1 if successful or -1 on error */ int libcdata_internal_list_set_last_element( libcdata_internal_list_t *internal_list, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_list_element_t *backup_last_element = NULL; static char *function = "libcdata_internal_list_set_last_element"; if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } backup_last_element = internal_list->last_element; if( element != NULL ) { if( libcdata_list_element_set_previous_element( element, internal_list->last_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of element.", function ); goto on_error; } } if( internal_list->last_element != NULL ) { if( libcdata_list_element_set_next_element( internal_list->last_element, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of last element.", function ); goto on_error; } } internal_list->last_element = element; return( 1 ); on_error: if( element != NULL ) { libcdata_list_element_set_previous_element( element, NULL, NULL ); } if( backup_last_element != NULL ) { libcdata_list_element_set_next_element( backup_last_element, NULL, NULL ); } internal_list->last_element = backup_last_element; return( -1 ); } /* Retrieves a specific element from the list * Returns 1 if successful or -1 on error */ int libcdata_list_get_element_by_index( libcdata_list_t *list, int element_index, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_list_get_element_by_index"; int element_iterator = 0; if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( ( element_index < 0 ) || ( element_index >= internal_list->number_of_elements ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid element index value out of bounds.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif if( element_index < ( internal_list->number_of_elements / 2 ) ) { list_element = internal_list->first_element; for( element_iterator = 0; element_iterator < element_index; element_iterator++ ) { if( list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected in element: %d.", function, element_iterator ); goto on_error; } if( libcdata_list_element_get_next_element( list_element, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, element_index ); goto on_error; } } } else { list_element = internal_list->last_element; for( element_iterator = ( internal_list->number_of_elements - 1 ); element_iterator > element_index; element_iterator-- ) { if( list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected in element: %d.", function, element_iterator ); goto on_error; } if( libcdata_list_element_get_previous_element( list_element, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element: %d.", function, element_index ); goto on_error; } } } if( list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing list element.", function ); goto on_error; } *element = list_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_list->read_write_lock, NULL ); #endif return( -1 ); } /* Retrieves a specific value from the list * Returns 1 if successful or -1 on error */ int libcdata_list_get_value_by_index( libcdata_list_t *list, int element_index, intptr_t **value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_list_get_value_by_index"; if( libcdata_list_get_element_by_index( list, element_index, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve list element: %d from list.", function, element_index ); return( -1 ); } if( libcdata_list_element_get_value( list_element, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, element_index ); return( -1 ); } return( 1 ); } /* Prepends a list element to the list * Returns 1 if successful or -1 on error */ int libcdata_list_prepend_element( libcdata_list_t *list, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_list_prepend_element"; int result = 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_last_element = NULL; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( internal_list->number_of_elements == 0 ) { if( internal_list->first_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first element already set.", function ); return( -1 ); } if( internal_list->last_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last element already set.", function ); return( -1 ); } } else { if( internal_list->first_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first element.", function ); return( -1 ); } if( internal_list->last_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last element.", function ); return( -1 ); } } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } if( libcdata_list_element_get_elements( element, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from list element.", function ); return( -1 ); } if( ( previous_element != NULL ) || ( next_element != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: list element already part of a list.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_element = internal_list->first_element; backup_last_element = internal_list->last_element; #endif result = libcdata_list_element_set_next_element( element, internal_list->first_element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of list element.", function ); result = -1; } if( result == 1 ) { if( internal_list->first_element != NULL ) { result = libcdata_list_element_set_previous_element( internal_list->first_element, element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of first element.", function ); libcdata_list_element_set_next_element( element, NULL, NULL ); result = -1; } } } if( result == 1 ) { internal_list->first_element = element; if( internal_list->last_element == NULL ) { internal_list->last_element = element; } internal_list->number_of_elements += 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { libcdata_list_element_set_next_element( element, NULL, NULL ); libcdata_list_element_set_previous_element( backup_first_element, NULL, NULL ); internal_list->first_element = backup_first_element; internal_list->last_element = backup_last_element; internal_list->number_of_elements -= 1; } return( -1 ); #endif } /* Prepends a value to the list * Creates a new list element * Returns 1 if successful or -1 on error */ int libcdata_list_prepend_value( libcdata_list_t *list, intptr_t *value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; static char *function = "libcdata_list_prepend_value"; if( libcdata_list_element_initialize( &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libcdata_list_prepend_element( list, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to prepend element to list.", function ); goto on_error; } if( libcdata_list_element_set_value( list_element, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set value of list element.", function ); goto on_error; } return( 1 ); on_error: if( list_element != NULL ) { libcdata_list_element_free( &list_element, NULL, NULL ); } return( -1 ); } /* Appends a list element to the list * Returns 1 if successful or -1 on error */ int libcdata_list_append_element( libcdata_list_t *list, libcdata_list_element_t *element, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_list_append_element"; int result = 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_last_element = NULL; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( internal_list->number_of_elements == 0 ) { if( internal_list->first_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first element already set.", function ); return( -1 ); } if( internal_list->last_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last element already set.", function ); return( -1 ); } } else { if( internal_list->first_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first element.", function ); return( -1 ); } if( internal_list->last_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last element.", function ); return( -1 ); } } if( libcdata_list_element_get_elements( element, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from list element.", function ); return( -1 ); } if( ( previous_element != NULL ) || ( next_element != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: list element already part of a list.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_element = internal_list->first_element; backup_last_element = internal_list->last_element; #endif result = libcdata_list_element_set_previous_element( element, internal_list->last_element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of list element.", function ); result = -1; } if( result == 1 ) { if( internal_list->last_element != NULL ) { result = libcdata_list_element_set_next_element( internal_list->last_element, element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of last element.", function ); libcdata_list_element_set_previous_element( element, NULL, NULL ); result = -1; } } } if( result == 1 ) { if( internal_list->first_element == NULL ) { internal_list->first_element = element; } internal_list->last_element = element; internal_list->number_of_elements += 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { libcdata_list_element_set_previous_element( element, NULL, NULL ); libcdata_list_element_set_next_element( backup_last_element, NULL, NULL ); internal_list->first_element = backup_first_element; internal_list->last_element = backup_last_element; internal_list->number_of_elements -= 1; } return( -1 ); #endif } /* Appends a value to the list * Creates a new list element * Returns 1 if successful or -1 on error */ int libcdata_list_append_value( libcdata_list_t *list, intptr_t *value, libcerror_error_t **error ) { libcdata_list_element_t *element = NULL; static char *function = "libcdata_list_append_value"; if( libcdata_list_element_initialize( &element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); goto on_error; } if( libcdata_list_element_set_value( element, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set value of list element.", function ); goto on_error; } if( libcdata_list_append_element( list, element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append element to list.", function ); goto on_error; } return( 1 ); on_error: if( element != NULL ) { libcdata_list_element_free( &element, NULL, NULL ); } return( -1 ); } /* Retrieves the element which the element should be inserted before * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * On return element will be set to NULL if the element should be inserted at the end of the list. * * Returns 1 if successful, 0 if a list element containing the value already exists or -1 on error */ int libcdata_internal_list_insert_element_find_element( libcdata_internal_list_t *internal_list, intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, int *element_index, libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; intptr_t *list_element_value = NULL; static char *function = "libcdata_internal_list_insert_element_find_element"; int compare_result = 0; int result = 1; int safe_element_index = 0; if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported insert flags: 0x%02" PRIx8 ".", function, insert_flags ); return( -1 ); } if( element_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element index.", function ); return( -1 ); } if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element.", function ); return( -1 ); } list_element = internal_list->first_element; compare_result = LIBCDATA_COMPARE_GREATER; for( safe_element_index = 0; safe_element_index < internal_list->number_of_elements; safe_element_index++ ) { if( libcdata_list_element_get_value( list_element, &list_element_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, safe_element_index ); return( -1 ); } compare_result = value_compare_function( value_to_insert, list_element_value, error ); if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to compare list element: %d.", function, safe_element_index ); return( -1 ); } else if( compare_result == LIBCDATA_COMPARE_EQUAL ) { if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) { result = 0; break; } } else if( compare_result == LIBCDATA_COMPARE_LESS ) { break; } else if( compare_result != LIBCDATA_COMPARE_GREATER ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported value compare function return value: %d.", function, compare_result ); return( -1 ); } if( libcdata_list_element_get_next_element( list_element, &list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, safe_element_index ); return( -1 ); } } if( ( compare_result == LIBCDATA_COMPARE_EQUAL ) || ( compare_result == LIBCDATA_COMPARE_LESS ) ) { *element_index = safe_element_index; *element = list_element; } else { *element_index = internal_list->number_of_elements; *element = NULL; } return( result ); } /* Inserts the element before the list element * If list_element is NULL the element is inserted before or as the first element in the list * Returns 1 if successful, or -1 on error */ int libcdata_internal_list_insert_element_before_element( libcdata_internal_list_t *internal_list, libcdata_list_element_t *list_element, libcdata_list_element_t *element_to_insert, libcerror_error_t **error ) { libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_last_element = NULL; libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_internal_list_insert_element_before_element"; if( internal_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } if( element_to_insert == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element to insert.", function ); return( -1 ); } backup_first_element = internal_list->first_element; backup_last_element = internal_list->last_element; if( list_element != NULL ) { if( libcdata_list_element_get_previous_element( list_element, &previous_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element.", function ); return( -1 ); } } if( internal_list->number_of_elements == 0 ) { internal_list->first_element = element_to_insert; internal_list->last_element = element_to_insert; } else if( list_element == NULL ) { if( libcdata_internal_list_set_last_element( internal_list, element_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set last list element.", function ); goto on_error; } } else { if( libcdata_list_element_set_elements( element_to_insert, previous_element, list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous and next element of element to insert.", function ); goto on_error; } if( internal_list->first_element == list_element ) { internal_list->first_element = element_to_insert; } else { if( libcdata_list_element_set_next_element( previous_element, element_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of previous list element.", function ); goto on_error; } } if( libcdata_list_element_set_previous_element( list_element, element_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of list element.", function ); goto on_error; } } internal_list->number_of_elements += 1; return( 1 ); on_error: if( element_to_insert != NULL ) { libcdata_list_element_set_elements( element_to_insert, NULL, NULL, NULL ); } if( previous_element != NULL ) { libcdata_list_element_set_next_element( previous_element, list_element, NULL ); } if( list_element != NULL ) { libcdata_list_element_set_previous_element( list_element, previous_element, NULL ); } internal_list->first_element = backup_first_element; internal_list->last_element = backup_last_element; return( -1 ); } /* Inserts a list element into the list * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the list element already exists or -1 on error */ int libcdata_list_insert_element( libcdata_list_t *list, libcdata_list_element_t *element_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; intptr_t *value_to_insert = NULL; static char *function = "libcdata_list_insert_element"; int element_index = 0; int result = 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_last_element = NULL; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( internal_list->number_of_elements == 0 ) { if( internal_list->first_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first element already set.", function ); return( -1 ); } if( internal_list->last_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last element already set.", function ); return( -1 ); } } else { if( internal_list->first_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first element.", function ); return( -1 ); } if( internal_list->last_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last element.", function ); return( -1 ); } } if( element_to_insert == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element to insert.", function ); return( -1 ); } if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value compare function.", function ); return( -1 ); } if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: unsupported insert flags: 0x%02" PRIx8 ".", function, insert_flags ); return( -1 ); } if( libcdata_list_element_get_elements( element_to_insert, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from element to insert.", function ); return( -1 ); } if( ( previous_element != NULL ) || ( next_element != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid element to insert - already part of a list.", function ); return( -1 ); } if( libcdata_list_element_get_value( element_to_insert, &value_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from element to insert.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_element = internal_list->first_element; backup_last_element = internal_list->last_element; #endif result = libcdata_internal_list_insert_element_find_element( internal_list, value_to_insert, value_compare_function, insert_flags, &element_index, &list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to find element in list.", function ); result = -1; } else if( result == 1 ) { if( list_element != NULL ) { if( libcdata_list_element_get_elements( list_element, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from list element: %d.", function, element_index ); result = -1; } } if( result == 1 ) { if( libcdata_internal_list_insert_element_before_element( internal_list, list_element, element_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert element before list element.", function ); result = -1; } } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { libcdata_list_element_set_elements( element_to_insert, NULL, NULL, NULL ); if( list_element != NULL ) { libcdata_list_element_set_elements( list_element, previous_element, next_element, NULL ); } else if( backup_last_element != NULL ) { libcdata_list_element_set_next_element( backup_last_element, NULL, NULL ); } internal_list->first_element = backup_first_element; internal_list->last_element = backup_last_element; internal_list->number_of_elements -= 1; } return( -1 ); #endif } /* Inserts a value to the list * * Creates a new list element * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the list element already exists or -1 on error */ int libcdata_list_insert_value( libcdata_list_t *list, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ) { libcdata_list_element_t *element = NULL; static char *function = "libcdata_list_insert_value"; int result = 1; if( libcdata_list_element_initialize( &element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create list element.", function ); return( -1 ); } if( libcdata_list_element_set_value( element, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set value of list element.", function ); goto on_error; } result = libcdata_list_insert_element( list, element, value_compare_function, insert_flags, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert element to list.", function ); goto on_error; } else if( result == 0 ) { if( libcdata_list_element_free( &element, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free list element.", function ); goto on_error; } } return( result ); on_error: if( element != NULL ) { libcdata_list_element_free( &element, NULL, NULL ); } return( -1 ); } /* Removes a list element from the list * Returns 1 if successful or -1 on error */ int libcdata_list_remove_element( libcdata_list_t *list, libcdata_list_element_t *element_to_remove, libcerror_error_t **error ) { libcdata_internal_list_t *internal_list = NULL; libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; static char *function = "libcdata_list_remove_element"; int result = 1; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_first_element = NULL; libcdata_list_element_t *backup_last_element = NULL; #endif if( list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list.", function ); return( -1 ); } internal_list = (libcdata_internal_list_t *) list; if( internal_list->number_of_elements == 0 ) { if( internal_list->first_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - first element already set.", function ); return( -1 ); } if( internal_list->last_element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - last element already set.", function ); return( -1 ); } } else { if( internal_list->first_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing first element.", function ); return( -1 ); } if( internal_list->last_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: corruption detected - missing last element.", function ); return( -1 ); } } if( element_to_remove == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid element to remove.", function ); return( -1 ); } if( libcdata_list_element_get_elements( element_to_remove, &previous_element, &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous and next element from element to remove.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_first_element = internal_list->first_element; backup_last_element = internal_list->last_element; #endif result = libcdata_list_element_set_elements( element_to_remove, NULL, NULL, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous and next element of element to remove.", function ); result = -1; } if( result == 1 ) { if( next_element != NULL ) { result = libcdata_list_element_set_previous_element( next_element, previous_element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set previous element of next element.", function ); libcdata_list_element_set_elements( element_to_remove, previous_element, next_element, NULL ); result = -1; } } } if( result == 1 ) { if( previous_element != NULL ) { result = libcdata_list_element_set_next_element( previous_element, next_element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set next element of previous element.", function ); if( next_element != NULL ) { libcdata_list_element_set_previous_element( next_element, element_to_remove, NULL ); } libcdata_list_element_set_elements( element_to_remove, previous_element, next_element, NULL ); result = -1; } } } if( result == 1 ) { if( element_to_remove == internal_list->first_element ) { internal_list->first_element = next_element; } if( element_to_remove == internal_list->last_element ) { internal_list->last_element = previous_element; } internal_list->number_of_elements -= 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( result ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: if( result == 1 ) { libcdata_list_element_set_elements( element_to_remove, previous_element, next_element, NULL ); if( next_element != NULL ) { libcdata_list_element_set_previous_element( next_element, element_to_remove, NULL ); } if( previous_element != NULL ) { libcdata_list_element_set_next_element( previous_element, element_to_remove, NULL ); } internal_list->first_element = backup_first_element; internal_list->last_element = backup_last_element; internal_list->number_of_elements += 1; } return( -1 ); #endif } libewf-20140807/libcdata/libcdata_tree_node.h0000664000175000017500000002025713443450020023035 0ustar00lordyestalordyesta00000000000000/* * Tree functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_TREE_NODE_H ) #define _LIBCDATA_TREE_NODE_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdata_internal_tree_node libcdata_internal_tree_node_t; struct libcdata_internal_tree_node { /* The parent node */ libcdata_tree_node_t *parent_node; /* The previous node */ libcdata_tree_node_t *previous_node; /* The next node */ libcdata_tree_node_t *next_node; /* The first sub node */ libcdata_tree_node_t *first_sub_node; /* The last sub node */ libcdata_tree_node_t *last_sub_node; /* The number of sub nodes */ int number_of_sub_nodes; /* The node value */ intptr_t *value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBCDATA_EXTERN \ int libcdata_tree_node_initialize( libcdata_tree_node_t **node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_free( libcdata_tree_node_t **node, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_empty( libcdata_tree_node_t *node, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_clone( libcdata_tree_node_t **destination_node, libcdata_tree_node_t *source_node, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_value( libcdata_tree_node_t *node, intptr_t **value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_set_value( libcdata_tree_node_t *node, intptr_t *value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_parent_node( libcdata_tree_node_t *node, libcdata_tree_node_t **parent_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_set_parent_node( libcdata_tree_node_t *node, libcdata_tree_node_t *parent_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_previous_node( libcdata_tree_node_t *node, libcdata_tree_node_t **previous_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_set_previous_node( libcdata_tree_node_t *node, libcdata_tree_node_t *previous_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_next_node( libcdata_tree_node_t *node, libcdata_tree_node_t **next_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_set_next_node( libcdata_tree_node_t *node, libcdata_tree_node_t *next_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t **parent_node, libcdata_tree_node_t **previous_node, libcdata_tree_node_t **next_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_set_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t *parent_node, libcdata_tree_node_t *previous_node, libcdata_tree_node_t *next_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_first_sub_node( libcdata_tree_node_t *node, libcdata_tree_node_t **first_sub_node, libcerror_error_t **error ); int libcdata_internal_tree_node_set_first_sub_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *first_sub_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_last_sub_node( libcdata_tree_node_t *node, libcdata_tree_node_t **last_sub_node, libcerror_error_t **error ); int libcdata_internal_tree_node_set_last_sub_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *last_sub_node, libcerror_error_t **error ); int libcdata_tree_node_get_sub_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t **first_sub_node, libcdata_tree_node_t **last_sub_node, libcerror_error_t **error ); int libcdata_tree_node_set_sub_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t *first_sub_node, libcdata_tree_node_t *last_sub_node, libcerror_error_t **error ); int libcdata_internal_tree_node_append_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *node_to_append, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_append_node( libcdata_tree_node_t *node, libcdata_tree_node_t *node_to_append, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_append_value( libcdata_tree_node_t *node, intptr_t *value, libcerror_error_t **error ); int libcdata_internal_tree_node_insert_node_find_sub_node( libcdata_internal_tree_node_t *internal_node, intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, int *sub_node_index, libcdata_tree_node_t **sub_node, libcerror_error_t **error ); int libcdata_internal_tree_node_insert_node_before_sub_node( libcdata_internal_tree_node_t *internal_node, libcdata_tree_node_t *sub_node, libcdata_tree_node_t *node_to_insert, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_insert_node( libcdata_tree_node_t *node, libcdata_tree_node_t *node_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_insert_value( libcdata_tree_node_t *node, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_replace_node( libcdata_tree_node_t *node, libcdata_tree_node_t *replacement_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_remove_node( libcdata_tree_node_t *node, libcdata_tree_node_t *sub_node_to_remove, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_number_of_sub_nodes( libcdata_tree_node_t *node, int *number_of_sub_nodes, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_sub_node_by_index( libcdata_tree_node_t *node, int sub_node_index, libcdata_tree_node_t **sub_node, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_tree_node_get_leaf_node_list( libcdata_tree_node_t *node, libcdata_list_t **leaf_node_list, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_TREE_NODE_H ) */ libewf-20140807/libcdata/libcdata_list.h0000664000175000017500000001312413443450020022037 0ustar00lordyestalordyesta00000000000000/* * List functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_LIST_H ) #define _LIBCDATA_LIST_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdata_internal_list libcdata_internal_list_t; struct libcdata_internal_list { /* The number of elements */ int number_of_elements; /* The first element */ libcdata_list_element_t *first_element; /* The last element */ libcdata_list_element_t *last_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBCDATA_EXTERN \ int libcdata_list_initialize( libcdata_list_t **list, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_free( libcdata_list_t **list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_empty( libcdata_list_t *list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_clone( libcdata_list_t **destination_list, libcdata_list_t *source_list, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), int (*value_clone_function)( intptr_t **destination_value, intptr_t *source_value, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_get_number_of_elements( libcdata_list_t *list, int *number_of_elements, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_get_first_element( libcdata_list_t *list, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_list_set_first_element( libcdata_internal_list_t *internal_list, libcdata_list_element_t *element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_get_last_element( libcdata_list_t *list, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_list_set_last_element( libcdata_internal_list_t *internal_list, libcdata_list_element_t *element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_get_element_by_index( libcdata_list_t *list, int element_index, libcdata_list_element_t **element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_get_value_by_index( libcdata_list_t *list, int element_index, intptr_t **value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_prepend_element( libcdata_list_t *list, libcdata_list_element_t *element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_prepend_value( libcdata_list_t *list, intptr_t *value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_append_element( libcdata_list_t *list, libcdata_list_element_t *element, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_append_value( libcdata_list_t *list, intptr_t *value, libcerror_error_t **error ); int libcdata_internal_list_insert_element_find_element( libcdata_internal_list_t *internal_list, intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, int *element_index, libcdata_list_element_t **element, libcerror_error_t **error ); int libcdata_internal_list_insert_element_before_element( libcdata_internal_list_t *internal_list, libcdata_list_element_t *list_element, libcdata_list_element_t *element_to_insert, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_insert_element( libcdata_list_t *list, libcdata_list_element_t *element_to_insert, int (*value_compare_function)( intptr_t *first, intptr_t *second, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_insert_value( libcdata_list_t *list, intptr_t *value, int (*value_compare_function)( intptr_t *first, intptr_t *second, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_list_remove_element( libcdata_list_t *list, libcdata_list_element_t *element_to_remove, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_LIST_H ) */ libewf-20140807/libcdata/libcdata_types.h0000664000175000017500000000367213443450020022237 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2006-2019, 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( _LIBCDATA_INTERNAL_TYPES_H ) #define _LIBCDATA_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata * The definitions in are copied here * for local use of libcdata */ #if defined( HAVE_LOCAL_LIBCDATA ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libcdata_array {} libcdata_array_t; typedef struct libcdata_btree {} libcdata_btree_t; typedef struct libcdata_list {} libcdata_list_t; typedef struct libcdata_list_element {} libcdata_list_element_t; typedef struct libcdata_range_list {} libcdata_range_list_t; typedef struct libcdata_tree_node {} libcdata_tree_node_t; #else typedef intptr_t libcdata_array_t; typedef intptr_t libcdata_btree_t; typedef intptr_t libcdata_list_t; typedef intptr_t libcdata_list_element_t; typedef intptr_t libcdata_range_list_t; typedef intptr_t libcdata_tree_node_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ #endif /* !defined( _LIBCDATA_INTERNAL_TYPES_H ) */ libewf-20140807/libcdata/libcdata_list_element.c0000664000175000017500000005645013443450020023554 0ustar00lordyestalordyesta00000000000000/* * List element functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_list_element.h" #include "libcdata_types.h" /* Creates a list element * Make sure the value element is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_list_element_initialize( libcdata_list_element_t **element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_initialize"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } if( *element != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid element value already set.", function ); return( -1 ); } internal_element = memory_allocate_structure( libcdata_internal_list_element_t ); if( internal_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create list element.", function ); goto on_error; } if( memory_set( internal_element, 0, sizeof( libcdata_internal_list_element_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear list element.", function ); memory_free( internal_element ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_initialize( &( internal_element->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *element = (libcdata_list_element_t *) internal_element; return( 1 ); on_error: if( internal_element != NULL ) { memory_free( internal_element ); } return( -1 ); } /* Frees a list element * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error */ int libcdata_list_element_free( libcdata_list_element_t **element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_free"; int result = 1; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } if( *element != NULL ) { internal_element = (libcdata_internal_list_element_t *) *element; if( ( internal_element->previous_element != NULL ) || ( internal_element->next_element != NULL ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: list element part of a list.", function ); return( -1 ); } *element = NULL; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_free( &( internal_element->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( value_free_function != NULL ) { if( value_free_function( &( internal_element->value ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free value.", function ); result = -1; } } memory_free( internal_element ); } return( result ); } /* Retrieves the parent list from the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_get_parent_list( libcdata_list_element_t *element, intptr_t **parent_list, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_get_parent_list"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; if( parent_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid parent list.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *parent_list = internal_element->parent_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the parent list in the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_set_parent_list( libcdata_list_element_t *element, intptr_t *parent_list, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_parent_list"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) intptr_t *backup_parent_list = NULL; #endif if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_parent_list = internal_element->parent_list; #endif internal_element->parent_list = parent_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_element->parent_list = backup_parent_list; return( -1 ); #endif } /* Retrieves the previous element from the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_get_previous_element( libcdata_list_element_t *element, libcdata_list_element_t **previous_element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_get_previous_element"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; if( previous_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid previous element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *previous_element = internal_element->previous_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the previous element in the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_set_previous_element( libcdata_list_element_t *element, libcdata_list_element_t *previous_element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_previous_element"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_previous_element = NULL; #endif if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_previous_element = internal_element->previous_element; #endif internal_element->previous_element = previous_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_element->previous_element = backup_previous_element; return( -1 ); #endif } /* Retrieves the next element from the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_get_next_element( libcdata_list_element_t *element, libcdata_list_element_t **next_element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_get_next_element"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; if( next_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid next element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *next_element = internal_element->next_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the next element in the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_set_next_element( libcdata_list_element_t *element, libcdata_list_element_t *next_element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_next_element"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_next_element = NULL; #endif if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_next_element = internal_element->next_element; #endif internal_element->next_element = next_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_element->next_element = backup_next_element; return( -1 ); #endif } /* Retrieves the previous and next element from the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_get_elements( libcdata_list_element_t *element, libcdata_list_element_t **previous_element, libcdata_list_element_t **next_element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_get_elements"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; if( previous_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid previous element.", function ); return( -1 ); } if( next_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid next element.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *previous_element = internal_element->previous_element; *next_element = internal_element->next_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the previous and next element in the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_set_elements( libcdata_list_element_t *element, libcdata_list_element_t *previous_element, libcdata_list_element_t *next_element, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_elements"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcdata_list_element_t *backup_next_element = NULL; libcdata_list_element_t *backup_previous_element = NULL; #endif if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_previous_element = internal_element->previous_element; backup_next_element = internal_element->next_element; #endif internal_element->previous_element = previous_element; internal_element->next_element = next_element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_element->previous_element = backup_previous_element; internal_element->next_element = backup_next_element; return( -1 ); #endif } /* Retrieves the value from the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_get_value( libcdata_list_element_t *element, intptr_t **value, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_get_value"; if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; if( value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value.", function ); return( -1 ); } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } #endif *value = internal_element->value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for reading.", function ); return( -1 ); } #endif return( 1 ); } /* Sets the value in the list element * Returns 1 if successful or -1 on error */ int libcdata_list_element_set_value( libcdata_list_element_t *element, intptr_t *value, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_value"; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) intptr_t *backup_value = NULL; #endif if( element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid list element.", function ); return( -1 ); } internal_element = (libcdata_internal_list_element_t *) element; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } backup_value = internal_element->value; #endif internal_element->value = value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_element->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to release read/write lock for writing.", function ); goto on_error; } #endif return( 1 ); #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) on_error: internal_element->value = backup_value; return( -1 ); #endif } libewf-20140807/libcdata/Makefile.in0000664000175000017500000010617013443455347021162 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcdata ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcdata_la_LIBADD = am__libcdata_la_SOURCES_DIST = libcdata_array.c libcdata_array.h \ libcdata_btree.c libcdata_btree.h libcdata_btree_node.c \ libcdata_btree_node.h libcdata_btree_values_list.c \ libcdata_btree_values_list.h libcdata_definitions.h \ libcdata_error.c libcdata_error.h libcdata_extern.h \ libcdata_libcerror.h libcdata_libcthreads.h libcdata_list.c \ libcdata_list.h libcdata_list_element.c \ libcdata_list_element.h libcdata_range_list.c \ libcdata_range_list.h libcdata_range_list_value.c \ libcdata_range_list_value.h libcdata_support.c \ libcdata_support.h libcdata_tree_node.c libcdata_tree_node.h \ libcdata_types.h libcdata_unused.h @HAVE_LOCAL_LIBCDATA_TRUE@am_libcdata_la_OBJECTS = libcdata_array.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_node.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_values_list.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_error.lo libcdata_list.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_list_element.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_range_list.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_range_list_value.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_support.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_tree_node.lo libcdata_la_OBJECTS = $(am_libcdata_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCDATA_TRUE@am_libcdata_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcdata_array.Plo \ ./$(DEPDIR)/libcdata_btree.Plo \ ./$(DEPDIR)/libcdata_btree_node.Plo \ ./$(DEPDIR)/libcdata_btree_values_list.Plo \ ./$(DEPDIR)/libcdata_error.Plo ./$(DEPDIR)/libcdata_list.Plo \ ./$(DEPDIR)/libcdata_list_element.Plo \ ./$(DEPDIR)/libcdata_range_list.Plo \ ./$(DEPDIR)/libcdata_range_list_value.Plo \ ./$(DEPDIR)/libcdata_support.Plo \ ./$(DEPDIR)/libcdata_tree_node.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcdata_la_SOURCES) DIST_SOURCES = $(am__libcdata_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCDATA_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCDATA_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCDATA_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCDATA_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBCDATA_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ @HAVE_LOCAL_LIBCDATA_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBCDATA_TRUE@noinst_LTLIBRARIES = libcdata.la @HAVE_LOCAL_LIBCDATA_TRUE@libcdata_la_SOURCES = \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_array.c libcdata_array.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree.c libcdata_btree.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_node.c libcdata_btree_node.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_values_list.c libcdata_btree_values_list.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_definitions.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_error.c libcdata_error.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_extern.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_libcerror.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_libcthreads.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_list.c libcdata_list.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_list_element.c libcdata_list_element.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_range_list.c libcdata_range_list.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_range_list_value.c libcdata_range_list_value.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_support.c libcdata_support.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_tree_node.c libcdata_tree_node.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_types.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_unused.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcdata/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcdata/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcdata.la: $(libcdata_la_OBJECTS) $(libcdata_la_DEPENDENCIES) $(EXTRA_libcdata_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcdata_la_rpath) $(libcdata_la_OBJECTS) $(libcdata_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_array.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_btree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_btree_node.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_btree_values_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_list_element.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_range_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_range_list_value.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_tree_node.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcdata_array.Plo -rm -f ./$(DEPDIR)/libcdata_btree.Plo -rm -f ./$(DEPDIR)/libcdata_btree_node.Plo -rm -f ./$(DEPDIR)/libcdata_btree_values_list.Plo -rm -f ./$(DEPDIR)/libcdata_error.Plo -rm -f ./$(DEPDIR)/libcdata_list.Plo -rm -f ./$(DEPDIR)/libcdata_list_element.Plo -rm -f ./$(DEPDIR)/libcdata_range_list.Plo -rm -f ./$(DEPDIR)/libcdata_range_list_value.Plo -rm -f ./$(DEPDIR)/libcdata_support.Plo -rm -f ./$(DEPDIR)/libcdata_tree_node.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcdata_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcdata/libcdata_btree_values_list.h0000664000175000017500000000316213443450020024600 0ustar00lordyestalordyesta00000000000000/* * Balanced tree values list functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_BTREE_VALUES_LIST_H ) #define _LIBCDATA_BTREE_VALUES_LIST_H #include #include #include "libcdata_libcerror.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif int libcdata_btree_values_list_free( libcdata_list_t **values_list, libcerror_error_t **error ); int libcdata_btree_values_list_remove_element( libcdata_list_t *values_list, libcdata_list_element_t **values_list_element, libcerror_error_t **error ); int libcdata_btree_values_list_replace_element_with_previous( libcdata_list_t *values_list, libcdata_list_element_t **values_list_element, intptr_t **replacement_value, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_BTREE_VALUES_LIST_H ) */ libewf-20140807/libcdata/libcdata_array.h0000664000175000017500000001216113443450020022202 0ustar00lordyestalordyesta00000000000000/* * Array functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_ARRAY_H ) #define _LIBCDATA_ARRAY_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcdata_internal_array libcdata_internal_array_t; struct libcdata_internal_array { /* The number of allocated entries */ int number_of_allocated_entries; /* The number of entries */ int number_of_entries; /* The entries */ intptr_t **entries; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBCDATA_EXTERN \ int libcdata_array_initialize( libcdata_array_t **array, int number_of_entries, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_free( libcdata_array_t **array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_empty( libcdata_array_t *array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_array_clear( libcdata_internal_array_t *internal_array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_clear( libcdata_array_t *array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_clone( libcdata_array_t **destination_array, libcdata_array_t *source_array, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), int (*entry_clone_function)( intptr_t **destination_entry, intptr_t *source_entry, libcerror_error_t **error ), libcerror_error_t **error ); int libcdata_internal_array_resize( libcdata_internal_array_t *internal_array, int number_of_entries, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_resize( libcdata_array_t *array, int number_of_entries, int (*entry_free_function)( intptr_t **entry, libcerror_error_t **error ), libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_reverse( libcdata_array_t *array, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_get_number_of_entries( libcdata_array_t *array, int *number_of_entries, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_get_entry_by_index( libcdata_array_t *array, int entry_index, intptr_t **entry, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_get_entry_by_value( libcdata_array_t *array, intptr_t *entry, int (*entry_compare_function)( intptr_t *first_entry, intptr_t *second_entry, libcerror_error_t **error ), intptr_t **existing_entry, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_set_entry_by_index( libcdata_array_t *array, int entry_index, intptr_t *entry, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_prepend_entry( libcdata_array_t *array, intptr_t *entry, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_append_entry( libcdata_array_t *array, int *entry_index, intptr_t *entry, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_insert_entry( libcdata_array_t *array, int *entry_index, intptr_t *entry, int (*entry_compare_function)( intptr_t *first_entry, intptr_t *second_entry, libcerror_error_t **error ), uint8_t insert_flags, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_array_remove_entry( libcdata_array_t *array, int entry_index, intptr_t **entry, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_ARRAY_H ) */ libewf-20140807/libcdata/libcdata_btree.h0000664000175000017500000000732013443450020022166 0ustar00lordyestalordyesta00000000000000/* * Balanced tree type functions * * Copyright (C) 2006-2019, 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( _LIBCDATA_BTREE_H ) #define _LIBCDATA_BTREE_H #include #include #include "libcdata_extern.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_types.h" #if defined( __cplusplus ) extern "C" { #endif /* The balanced tree uses the list and tree node * The value of a tree node contains a list where each value in the list corresponds with either a sub node or a leaf value * The values array is used for sequential access to the leaf values */ typedef struct libcdata_internal_btree libcdata_internal_btree_t; struct libcdata_internal_btree { /* The values array */ libcdata_array_t *values_array; /* The root node */ libcdata_tree_node_t *root_node; /* The maximum number of values */ int maximum_number_of_values; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) /* The read/write lock */ libcthreads_read_write_lock_t *read_write_lock; #endif }; LIBCDATA_EXTERN \ int libcdata_btree_initialize( libcdata_btree_t **tree, int maximum_number_of_sub_nodes, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_btree_free( libcdata_btree_t **tree, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ); /* TODO clone function */ LIBCDATA_EXTERN \ int libcdata_btree_get_number_of_values( libcdata_btree_t *tree, int *number_of_values, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_btree_get_value_by_index( libcdata_btree_t *tree, int value_index, intptr_t **value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_btree_get_value_by_value( libcdata_btree_t *tree, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **upper_node, intptr_t **existing_value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_btree_insert_value( libcdata_btree_t *tree, int *value_index, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **upper_node, intptr_t **existing_value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_btree_replace_value( libcdata_btree_t *tree, libcdata_tree_node_t *upper_node, int *value_index, intptr_t *value, int *replacement_value_index, intptr_t *replacement_value, libcerror_error_t **error ); LIBCDATA_EXTERN \ int libcdata_btree_remove_value( libcdata_btree_t *tree, libcdata_tree_node_t *upper_node, int *value_index, intptr_t *value, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCDATA_BTREE_H ) */ libewf-20140807/libcdata/libcdata_definitions.h0000664000175000017500000000410513443450020023376 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2006-2019, 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( LIBCDATA_INTERNAL_DEFINITIONS_H ) #define LIBCDATA_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata */ #if !defined( HAVE_LOCAL_LIBCDATA ) #include /* The definitions in are copied here * for local use of libcdata */ #else #define LIBCDATA_VERSION 20190112 /* The libcdata version string */ #define LIBCDATA_VERSION_STRING "20190112" /* The comparison function definitions */ enum LIBCDATA_COMPARE_DEFINITIONS { /* The first value is less than the second value */ LIBCDATA_COMPARE_LESS, /* The first and second values are equal */ LIBCDATA_COMPARE_EQUAL, /* The first value is greater than the second value */ LIBCDATA_COMPARE_GREATER }; /* The insert flag definitions */ enum LIBCDATA_INSERT_FLAGS { /* Allow duplicate entries */ LIBCDATA_INSERT_FLAG_NON_UNIQUE_ENTRIES = 0x00, /* Only allow unique entries, no duplicates */ LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES = 0x01 }; #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ /* Limiting the maximum size of the array entries to 128 MiB */ #define LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT 128 * 1024 * 1024 #endif /* !defined( LIBCDATA_INTERNAL_DEFINITIONS_H ) */ libewf-20140807/libcdata/libcdata_btree.c0000664000175000017500000005333213443450020022165 0ustar00lordyestalordyesta00000000000000/* * Balanced tree type functions * * Copyright (C) 2006-2019, 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 . */ #include #include #include #include "libcdata_array.h" #include "libcdata_btree.h" #include "libcdata_btree_node.h" #include "libcdata_btree_values_list.h" #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" #include "libcdata_list.h" #include "libcdata_list_element.h" #include "libcdata_tree_node.h" #include "libcdata_types.h" /* Creates a tree * Make sure the value tree is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcdata_btree_initialize( libcdata_btree_t **tree, int maximum_number_of_values, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; static char *function = "libcdata_btree_initialize"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( *tree != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid tree value already set.", function ); return( -1 ); } if( maximum_number_of_values <= 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid maximum number of values value out of bounds.", function ); return( -1 ); } internal_tree = memory_allocate_structure( libcdata_internal_btree_t ); if( internal_tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create tree.", function ); goto on_error; } if( memory_set( internal_tree, 0, sizeof( libcdata_internal_btree_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear tree.", function ); memory_free( internal_tree ); return( -1 ); } if( libcdata_array_initialize( &( internal_tree->values_array ), 0, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create values array.", function ); goto on_error; } if( libcdata_tree_node_initialize( &( internal_tree->root_node ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to create root node.", function ); goto on_error; } internal_tree->maximum_number_of_values = maximum_number_of_values; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_initialize( &( internal_tree->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif *tree = (libcdata_btree_t *) internal_tree; return( 1 ); on_error: if( internal_tree != NULL ) { if( internal_tree->values_array != NULL ) { libcdata_array_free( &( internal_tree->values_array ), NULL, NULL ); } memory_free( internal_tree ); } return( -1 ); } /* Frees a tree, its sub nodes * Uses the value_free_function to free the value * Returns 1 if successful or -1 on error */ int libcdata_btree_free( libcdata_btree_t **tree, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; static char *function = "libcdata_btree_free"; int result = 1; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } if( *tree != NULL ) { internal_tree = (libcdata_internal_btree_t *) *tree; *tree = NULL; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_free( &( internal_tree->read_write_lock ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free read/write lock.", function ); result = -1; } #endif if( libcdata_tree_node_free( &( internal_tree->root_node ), (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_values_list_free, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free root node.", function ); result = -1; } if( libcdata_array_free( &( internal_tree->values_array ), value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, "%s: unable to free values array.", function ); result = -1; } memory_free( internal_tree ); } return( result ); } /* TODO add clone function ? */ /* Retrieves the number of values in the tree * Returns 1 if successful or -1 on error */ int libcdata_btree_get_number_of_values( libcdata_btree_t *tree, int *number_of_values, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; static char *function = "libcdata_btree_get_number_of_values"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libcdata_internal_btree_t *) tree; if( libcdata_array_get_number_of_entries( internal_tree->values_array, number_of_values, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values array entries.", function ); return( -1 ); } return( 1 ); } /* Retrieves a specific value * Returns 1 if successful or -1 on error */ int libcdata_btree_get_value_by_index( libcdata_btree_t *tree, int value_index, intptr_t **value, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; static char *function = "libcdata_btree_get_value_by_index"; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libcdata_internal_btree_t *) tree; if( libcdata_array_get_entry_by_index( internal_tree->values_array, value_index, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from array.", function, value_index ); return( -1 ); } return( 1 ); } /* Retrieves a value from the tree * * Uses the value_compare_function to determine the similarity of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if no such value or -1 on error */ int libcdata_btree_get_value_by_value( libcdata_btree_t *tree, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **upper_node, intptr_t **existing_value, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; libcdata_list_element_t *existing_list_element = NULL; static char *function = "libcdata_btree_get_value_by_value"; int result = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libcdata_internal_btree_t *) tree; result = libcdata_btree_node_get_upper_node_by_value( internal_tree->root_node, value, value_compare_function, upper_node, &existing_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve upper node by value.", function ); return( -1 ); } else if( result != 0 ) { if( libcdata_list_element_get_value( existing_list_element, existing_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from values list element.", function ); return( -1 ); } } else { if( existing_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid existing value.", function ); return( -1 ); } *existing_value = NULL; } return( result ); } /* Inserts a value into a tree * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * * Returns 1 if successful, 0 if the value already exists or -1 on error */ int libcdata_btree_insert_value( libcdata_btree_t *tree, int *value_index, intptr_t *value, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), libcdata_tree_node_t **upper_node, intptr_t **existing_value, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; libcdata_list_t *values_list = NULL; libcdata_list_element_t *existing_list_element = NULL; static char *function = "libcdata_btree_insert_value"; int number_of_values_list_elements = 0; int result = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libcdata_internal_btree_t *) tree; if( upper_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid upper node.", function ); return( -1 ); } if( value_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value index.", function ); return( -1 ); } if( existing_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid existing value.", function ); return( -1 ); } result = libcdata_btree_node_get_upper_node_by_value( internal_tree->root_node, value, value_compare_function, upper_node, &existing_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve upper node in root node.", function ); return( -1 ); } else if( result != 0 ) { if( libcdata_list_element_get_value( existing_list_element, existing_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from values list element.", function ); return( -1 ); } return( 0 ); } *existing_value = NULL; if( libcdata_btree_node_insert_value( *upper_node, value, value_compare_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to insert value in upper node.", function ); return( -1 ); } if( libcdata_tree_node_get_value( *upper_node, (intptr_t **) &values_list, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve values list.", function ); return( -1 ); } if( libcdata_list_get_number_of_elements( values_list, &number_of_values_list_elements, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of values list elements.", function ); return( -1 ); } if( number_of_values_list_elements >= internal_tree->maximum_number_of_values ) { if( libcdata_btree_node_split( *upper_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to split upper node.", function ); return( -1 ); } /* TODO do merge of upper node with its parent node */ /* TODO loop until number_of_values_list_elements < internal_tree->maximum_number_of_values */ /* Make sure existing list element updated after the split */ result = libcdata_btree_node_get_sub_node_by_value( *upper_node, value, value_compare_function, upper_node, &existing_list_element, error ); if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve split sub node by value.", function ); return( -1 ); } result = libcdata_btree_node_get_sub_node_by_value( *upper_node, value, value_compare_function, upper_node, &existing_list_element, error ); if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve split sub node by value.", function ); return( -1 ); } } if( libcdata_array_append_entry( internal_tree->values_array, value_index, value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to append value to values array.", function ); return( -1 ); } return( 1 ); } /* Replaces a value in the tree * Returns 1 if successful or -1 on error */ int libcdata_btree_replace_value( libcdata_btree_t *tree, libcdata_tree_node_t *upper_node, int *value_index, intptr_t *value, int *replacement_value_index, intptr_t *replacement_value, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; intptr_t *check_value = NULL; static char *function = "libcdata_btree_replace_value"; int number_of_sub_nodes = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libcdata_internal_btree_t *) tree; if( upper_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid upper node.", function ); return( -1 ); } if( value_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value index.", function ); return( -1 ); } if( replacement_value_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value index.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( upper_node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( number_of_sub_nodes != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: cannot replace upper node with sub nodes.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree->values_array, *value_index, &check_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from array.", function, *value_index ); return( -1 ); } if( value != check_value ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value: %d value out of bounds.", function, *value_index ); return( -1 ); } if( libcdata_btree_node_replace_value( upper_node, value, replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to replace value: %d.", function, *value_index ); return( -1 ); } if( libcdata_array_set_entry_by_index( internal_tree->values_array, *value_index, replacement_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to set value: %d in values array.", function, *value_index ); return( -1 ); } *replacement_value_index = *value_index; *value_index = -1; return( 1 ); } /* Removes a value from the tree * Returns 1 if successful or -1 on error */ int libcdata_btree_remove_value( libcdata_btree_t *tree, libcdata_tree_node_t *upper_node, int *value_index, intptr_t *value, libcerror_error_t **error ) { libcdata_internal_btree_t *internal_tree = NULL; intptr_t *check_value = NULL; static char *function = "libcdata_btree_remove_value"; int number_of_sub_nodes = 0; if( tree == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid tree.", function ); return( -1 ); } internal_tree = (libcdata_internal_btree_t *) tree; if( upper_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid upper node.", function ); return( -1 ); } if( value_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid value index.", function ); return( -1 ); } if( libcdata_tree_node_get_number_of_sub_nodes( upper_node, &number_of_sub_nodes, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve number of sub nodes.", function ); return( -1 ); } if( number_of_sub_nodes != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, "%s: cannot replace upper node with sub nodes.", function ); return( -1 ); } if( libcdata_array_get_entry_by_index( internal_tree->values_array, *value_index, &check_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value: %d from array.", function, *value_index ); return( -1 ); } if( value != check_value ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid value: %d value out of bounds.", function, *value_index ); return( -1 ); } if( libcdata_btree_node_remove_value( upper_node, value, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, "%s: unable to remove value: %d from upper node.", function, *value_index ); return( -1 ); } /* TODO reshuffle values array ? * Better to mark and ignore deleted items, otherwise index values need to be updated as well */ if( libcdata_array_set_entry_by_index( internal_tree->values_array, *value_index, NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, "%s: unable to set value: %d in values array.", function, *value_index ); return( -1 ); } *value_index = -1; return( 1 ); } libewf-20140807/acinclude.m40000664000175000017500000000747313420655453017544 0ustar00lordyestalordyesta00000000000000dnl Function to detect if libewf dependencies are available AC_DEFUN([AX_LIBEWF_CHECK_LOCAL], [dnl Check for type definitions dnl Type used in libewf/libewf_date_time_values.h, libewf/libewf_date_time.h dnl and libewf/libewf_header_values.c AC_STRUCT_TM dnl Check for headers dnl Headers included in libewf/libewf_date_time.h AC_HEADER_TIME dnl Check for functions dnl Date and time functions used in libewf/libewf_date_time.h AC_CHECK_FUNCS([localtime localtime_r mktime]) AS_IF( [test "x$ac_cv_func_localtime" != xyes && test "x$ac_cv_func_localtime_r" != xyes], [AC_MSG_FAILURE( [Missing functions: localtime and localtime_r], [1]) ]) AS_IF( [test "x$ac_cv_func_mktime" != xyes], [AC_MSG_FAILURE( [Missing function: mktime], [1]) ]) dnl Check for internationalization functions in libewf/libewf_i18n.c AC_CHECK_FUNCS([bindtextdomain]) ]) dnl Function to detect whether version 1 API support should be enabled AC_DEFUN([AX_LIBEWF_CHECK_ENABLE_V1_API], [AX_COMMON_ARG_ENABLE( [v1-api], [v1_api], [enable version 1 API], [no]) AS_IF( [test "x$ac_cv_enable_v1_api" != xno], [AC_DEFINE( [HAVE_V1_API], [1], [Define to 1 if the version 1 API should be available.]) AC_SUBST( [HAVE_V1_API], [1]) ac_cv_enable_v1_api=yes], [AC_SUBST( [HAVE_V1_API], [0]) ]) AM_CONDITIONAL( HAVE_V1_API, [test "x$ac_cv_enable_v1_api" != xno]) ]) dnl Function to determine the host operating system AC_DEFUN([AX_LIBEWF_CHECK_HOST_OPERATING_SYSTEM], [ac_libewf_determine_operating_system_target_string="$target"; AS_IF( [test "x$ac_libewf_determine_operating_system_target_string" = x], [ac_libewf_determine_operating_system_target_string="$host"]) AS_IF( [test "x$ac_libewf_determine_operating_system_target_string" = x], [ac_libewf_determine_operating_system_target_string="$build"]) AS_CASE( [$ac_libewf_determine_operating_system_target_string], [*cygwin*], [ac_libewf_operating_system="Cygwin";], [*darwin*], [ac_libewf_operating_system="Darwin";], [*freebsd*], [ac_libewf_operating_system="FreeBSD";], [*netbsd*], [ac_libewf_operating_system="NetBSD";], [*openbsd*], [ac_libewf_operating_system="OpenBSD";], [*linux*], [ac_libewf_operating_system="Linux";], [*mingw*], [ac_libewf_operating_system="MingW";], [*solaris*], [ac_libewf_operating_system="SunOS";], [*], [ac_libewf_operating_system="Unknown";]) AC_DEFINE_UNQUOTED( LIBEWF_OPERATING_SYSTEM, "$ac_libewf_operating_system", [Defines the fallback operating system string.]) ]) dnl Function to detect if ewftools dependencies are available AC_DEFUN([AX_EWFTOOLS_CHECK_LOCAL], [dnl Headers used in ewftools AC_CHECK_HEADERS([signal.h sys/signal.h unistd.h]) dnl Functions used in ewftools AC_CHECK_FUNCS([close getopt setvbuf]) AS_IF( [test "x$ac_cv_func_close" != xyes], [AC_MSG_FAILURE( [Missing function: close], [1]) ]) dnl Check for the host operation system will be used as a fall back in the ewftools AX_LIBEWF_CHECK_HOST_OPERATING_SYSTEM dnl Headers included in ewftools/ewftools_glob.h AC_CHECK_HEADERS([errno.h glob.h]) AS_IF( [test "x$ac_cv_header_glob_h" = xno], [AC_CHECK_HEADERS([io.h]) ]) dnl Headers included in ewftools/log_handle.c AC_CHECK_HEADERS([stdarg.h varargs.h]) AS_IF( [test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes], [AC_MSG_FAILURE( [Missing headers: stdarg.h and varargs.h], [1]) ]) dnl Check if tools should be build as static executables AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES dnl Check if DLL support is needed AS_IF( [test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno], [AS_CASE( [$host], [*cygwin* | *mingw*], [AC_SUBST( [LIBEWF_DLL_IMPORT], ["-DLIBEWF_DLL_IMPORT"]) ]) ]) ]) libewf-20140807/libcsplit/0000775000175000017500000000000013443455445017331 5ustar00lordyestalordyesta00000000000000libewf-20140807/libcsplit/libcsplit_types.h0000664000175000017500000000322113443450041022674 0ustar00lordyestalordyesta00000000000000/* * The internal type definitions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_INTERNAL_TYPES_H ) #define _LIBCSPLIT_INTERNAL_TYPES_H #include #include /* Define HAVE_LOCAL_LIBCSPLIT for local use of libcsplit * The definitions in are copied here * for local use of libcsplit */ #if defined( HAVE_LOCAL_LIBCSPLIT ) /* The following type definitions hide internal data structures */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libcsplit_narrow_split_string {} libcsplit_narrow_split_string_t; typedef struct libcsplit_wide_split_string {} libcsplit_wide_split_string_t; #else typedef intptr_t libcsplit_narrow_split_string_t; typedef intptr_t libcsplit_wide_split_string_t; #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ #endif /* defined( HAVE_LOCAL_LIBCSPLIT ) */ #endif /* !defined( _LIBCSPLIT_INTERNAL_TYPES_H ) */ libewf-20140807/libcsplit/libcsplit_wide_string.h0000664000175000017500000000270113443450041024050 0ustar00lordyestalordyesta00000000000000/* * Wide character string functions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_WIDE_STRING_H ) #define _LIBCSPLIT_WIDE_STRING_H #include #include #include "libcsplit_extern.h" #include "libcsplit_libcerror.h" #include "libcsplit_types.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_WIDE_CHARACTER_TYPE ) LIBCSPLIT_EXTERN \ int libcsplit_wide_string_split( const wchar_t *string, size_t string_size, wchar_t delimiter, libcsplit_wide_split_string_t **split_string, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCSPLIT_WIDE_STRING_H ) */ libewf-20140807/libcsplit/libcsplit_error.h0000664000175000017500000000343413443450041022667 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_INTERNAL_ERROR_H ) #define _LIBCSPLIT_INTERNAL_ERROR_H #include #include #include #if !defined( HAVE_LOCAL_LIBCSPLIT ) #include #endif #include "libcsplit_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCSPLIT ) LIBCSPLIT_EXTERN \ void libcsplit_error_free( libcsplit_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_error_fprint( libcsplit_error_t *error, FILE *stream ); LIBCSPLIT_EXTERN \ int libcsplit_error_sprint( libcsplit_error_t *error, char *string, size_t size ); LIBCSPLIT_EXTERN \ int libcsplit_error_backtrace_fprint( libcsplit_error_t *error, FILE *stream ); LIBCSPLIT_EXTERN \ int libcsplit_error_backtrace_sprint( libcsplit_error_t *error, char *string, size_t size ); #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCSPLIT_INTERNAL_ERROR_H ) */ libewf-20140807/libcsplit/libcsplit_support.h0000664000175000017500000000233013443450041023244 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_SUPPORT_H ) #define _LIBCSPLIT_SUPPORT_H #include #include #include "libcsplit_extern.h" #if defined( __cplusplus ) extern "C" { #endif #if !defined( HAVE_LOCAL_LIBCSPLIT ) LIBCSPLIT_EXTERN \ const char *libcsplit_get_version( void ); #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCSPLIT_SUPPORT_H ) */ libewf-20140807/libcsplit/libcsplit_narrow_split_string.c0000664000175000017500000003313213443450041025640 0ustar00lordyestalordyesta00000000000000/* * Split narrow string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include #include "libcsplit_libcerror.h" #include "libcsplit_narrow_split_string.h" #include "libcsplit_types.h" /* Creates a split string * Make sure the value split_string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcsplit_narrow_split_string_initialize( libcsplit_narrow_split_string_t **split_string, const char *string, size_t string_size, int number_of_segments, libcerror_error_t **error ) { libcsplit_internal_narrow_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_narrow_split_string_initialize"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string value already set.", function ); return( -1 ); } if( number_of_segments < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of segments less than zero.", function ); return( -1 ); } internal_split_string = memory_allocate_structure( libcsplit_internal_narrow_split_string_t ); if( internal_split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create split string.", function ); goto on_error; } if( memory_set( internal_split_string, 0, sizeof( libcsplit_internal_narrow_split_string_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear split string.", function ); memory_free( internal_split_string ); return( -1 ); } if( ( string != NULL ) && ( string_size > 0 ) ) { internal_split_string->string = narrow_string_allocate( string_size ); if( internal_split_string->string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); goto on_error; } if( memory_copy( internal_split_string->string, string, sizeof( char ) * ( string_size - 1 ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to copy string.", function ); goto on_error; } internal_split_string->string[ string_size - 1 ] = 0; internal_split_string->string_size = string_size; } if( number_of_segments > 0 ) { internal_split_string->segments = (char **) memory_allocate( sizeof( char * ) * number_of_segments ); if( internal_split_string->segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segments.", function ); goto on_error; } if( memory_set( internal_split_string->segments, 0, sizeof( char * ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segments.", function ); goto on_error; } internal_split_string->segment_sizes = (size_t *) memory_allocate( sizeof( size_t ) * number_of_segments ); if( internal_split_string->segment_sizes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment sizes.", function ); goto on_error; } if( memory_set( internal_split_string->segment_sizes, 0, sizeof( size_t ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment sizes.", function ); goto on_error; } } internal_split_string->number_of_segments = number_of_segments; *split_string = (libcsplit_narrow_split_string_t *) internal_split_string; return( 1 ); on_error: if( internal_split_string != NULL ) { if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } memory_free( internal_split_string ); } return( -1 ); } /* Frees a split string * Returns 1 if successful or -1 on error */ int libcsplit_narrow_split_string_free( libcsplit_narrow_split_string_t **split_string, libcerror_error_t **error ) { libcsplit_internal_narrow_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_narrow_split_string_free"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { internal_split_string = (libcsplit_internal_narrow_split_string_t *) *split_string; *split_string = NULL; if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } memory_free( internal_split_string ); } return( 1 ); } /* Retrieves the string * Returns 1 if successful or -1 on error */ int libcsplit_narrow_split_string_get_string( libcsplit_narrow_split_string_t *split_string, char **string, size_t *string_size, libcerror_error_t **error ) { libcsplit_internal_narrow_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_narrow_split_string_get_string"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_narrow_split_string_t *) split_string; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } *string = internal_split_string->string; *string_size = internal_split_string->string_size; return( 1 ); } /* Retrieves the number of segments * Returns 1 if successful or -1 on error */ int libcsplit_narrow_split_string_get_number_of_segments( libcsplit_narrow_split_string_t *split_string, int *number_of_segments, libcerror_error_t **error ) { libcsplit_internal_narrow_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_narrow_split_string_get_number_of_segments"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_narrow_split_string_t *) split_string; if( number_of_segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of segments.", function ); return( -1 ); } *number_of_segments = internal_split_string->number_of_segments; return( 1 ); } /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libcsplit_narrow_split_string_get_segment_by_index( libcsplit_narrow_split_string_t *split_string, int segment_index, char **string_segment, size_t *string_segment_size, libcerror_error_t **error ) { libcsplit_internal_narrow_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_narrow_split_string_get_segment_by_index"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_narrow_split_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string segment.", function ); return( -1 ); } if( string_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string segment size.", function ); return( -1 ); } *string_segment = internal_split_string->segments[ segment_index ]; *string_segment_size = internal_split_string->segment_sizes[ segment_index ]; return( 1 ); } /* Sets a specific segment * Returns 1 if successful or -1 on error */ int libcsplit_narrow_split_string_set_segment_by_index( libcsplit_narrow_split_string_t *split_string, int segment_index, char *string_segment, size_t string_segment_size, libcerror_error_t **error ) { libcsplit_internal_narrow_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_narrow_split_string_set_segment_by_index"; size_t string_segment_offset = 0; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_narrow_split_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( string_segment_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string segment size value exceeds maximum.", function ); return( -1 ); } if( string_segment == NULL ) { if( string_segment_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment size value out of bounds.", function ); return( -1 ); } } else { if( string_segment < internal_split_string->string ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment value out of bounds.", function ); return( -1 ); } string_segment_offset = (size_t) ( string_segment - internal_split_string->string ); if( string_segment_offset >= internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment value out of bounds.", function ); return( -1 ); } string_segment_offset += string_segment_size; if( string_segment_offset > internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment value out of bounds.", function ); return( -1 ); } } internal_split_string->segments[ segment_index ] = string_segment; internal_split_string->segment_sizes[ segment_index ] = string_segment_size; return( 1 ); } libewf-20140807/libcsplit/libcsplit_narrow_split_string.h0000664000175000017500000000544313443450041025651 0ustar00lordyestalordyesta00000000000000/* * Split narrow string functions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_INTERNAL_NARROW_SPLIT_STRING_H ) #define _LIBCSPLIT_INTERNAL_NARROW_SPLIT_STRING_H #include #include #include "libcsplit_extern.h" #include "libcsplit_libcerror.h" #include "libcsplit_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libcsplit_internal_narrow_split_string libcsplit_internal_narrow_split_string_t; struct libcsplit_internal_narrow_split_string { /* The number of string segments */ int number_of_segments; /* The string */ char *string; /* The string size */ size_t string_size; /* The segments */ char **segments; /* The segment sizes */ size_t *segment_sizes; }; int libcsplit_narrow_split_string_initialize( libcsplit_narrow_split_string_t **split_string, const char *string, size_t string_size, int number_of_segments, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_narrow_split_string_free( libcsplit_narrow_split_string_t **split_string, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_narrow_split_string_get_string( libcsplit_narrow_split_string_t *split_string, char **string, size_t *string_size, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_narrow_split_string_get_number_of_segments( libcsplit_narrow_split_string_t *split_string, int *number_of_segments, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_narrow_split_string_get_segment_by_index( libcsplit_narrow_split_string_t *split_string, int segment_index, char **string_segment, size_t *string_segment_size, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_narrow_split_string_set_segment_by_index( libcsplit_narrow_split_string_t *split_string, int segment_index, char *string_segment, size_t string_segment_size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCSPLIT_INTERNAL_NARROW_SPLIT_STRING_H ) */ libewf-20140807/libcsplit/Makefile.am0000664000175000017500000000152113443450041021347 0ustar00lordyestalordyesta00000000000000if HAVE_LOCAL_LIBCSPLIT AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libcsplit.la libcsplit_la_SOURCES = \ libcsplit_definitions.h \ libcsplit_error.c libcsplit_error.h \ libcsplit_extern.h \ libcsplit_narrow_split_string.c libcsplit_narrow_split_string.h \ libcsplit_narrow_string.c libcsplit_narrow_string.h \ libcsplit_libcerror.h \ libcsplit_support.c libcsplit_support.h \ libcsplit_types.h \ libcsplit_unused.h \ libcsplit_wide_split_string.c libcsplit_wide_split_string.h \ libcsplit_wide_string.c libcsplit_wide_string.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcsplit ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcsplit_la_SOURCES) libewf-20140807/libcsplit/libcsplit_wide_split_string.c0000664000175000017500000003317213443450041025264 0ustar00lordyestalordyesta00000000000000/* * Split wide string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include #include "libcsplit_libcerror.h" #include "libcsplit_wide_split_string.h" #include "libcsplit_types.h" #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Creates a split string * Make sure the value split_string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcsplit_wide_split_string_initialize( libcsplit_wide_split_string_t **split_string, const wchar_t *string, size_t string_size, int number_of_segments, libcerror_error_t **error ) { libcsplit_internal_wide_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_wide_split_string_initialize"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string value already set.", function ); return( -1 ); } if( number_of_segments < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, "%s: invalid number of segments less than zero.", function ); return( -1 ); } internal_split_string = memory_allocate_structure( libcsplit_internal_wide_split_string_t ); if( internal_split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create split string.", function ); goto on_error; } if( memory_set( internal_split_string, 0, sizeof( libcsplit_internal_wide_split_string_t ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear split string.", function ); memory_free( internal_split_string ); return( -1 ); } if( ( string != NULL ) && ( string_size > 0 ) ) { internal_split_string->string = wide_string_allocate( string_size ); if( internal_split_string->string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create string.", function ); goto on_error; } if( memory_copy( internal_split_string->string, string, sizeof( wchar_t ) * ( string_size - 1 ) ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to copy string.", function ); goto on_error; } internal_split_string->string[ string_size - 1 ] = 0; internal_split_string->string_size = string_size; } if( number_of_segments > 0 ) { internal_split_string->segments = (wchar_t **) memory_allocate( sizeof( wchar_t * ) * number_of_segments ); if( internal_split_string->segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segments.", function ); goto on_error; } if( memory_set( internal_split_string->segments, 0, sizeof( wchar_t * ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segments.", function ); goto on_error; } internal_split_string->segment_sizes = (size_t *) memory_allocate( sizeof( size_t ) * number_of_segments ); if( internal_split_string->segment_sizes == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_INSUFFICIENT, "%s: unable to create segment sizes.", function ); goto on_error; } if( memory_set( internal_split_string->segment_sizes, 0, sizeof( size_t ) * number_of_segments ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_SET_FAILED, "%s: unable to clear segment sizes.", function ); goto on_error; } } internal_split_string->number_of_segments = number_of_segments; *split_string = (libcsplit_wide_split_string_t *) internal_split_string; return( 1 ); on_error: if( internal_split_string != NULL ) { if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } memory_free( internal_split_string ); } return( -1 ); } /* Frees a split string * Returns 1 if successful or -1 on error */ int libcsplit_wide_split_string_free( libcsplit_wide_split_string_t **split_string, libcerror_error_t **error ) { libcsplit_internal_wide_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_wide_split_string_free"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { internal_split_string = (libcsplit_internal_wide_split_string_t *) *split_string; *split_string = NULL; if( internal_split_string->string != NULL ) { memory_free( internal_split_string->string ); } if( internal_split_string->segments != NULL ) { memory_free( internal_split_string->segments ); } if( internal_split_string->segment_sizes != NULL ) { memory_free( internal_split_string->segment_sizes ); } memory_free( internal_split_string ); } return( 1 ); } /* Retrieves the string * Returns 1 if successful or -1 on error */ int libcsplit_wide_split_string_get_string( libcsplit_wide_split_string_t *split_string, wchar_t **string, size_t *string_size, libcerror_error_t **error ) { libcsplit_internal_wide_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_wide_split_string_get_string"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_wide_split_string_t *) split_string; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string size.", function ); return( -1 ); } *string = internal_split_string->string; *string_size = internal_split_string->string_size; return( 1 ); } /* Retrieves the number of segments * Returns 1 if successful or -1 on error */ int libcsplit_wide_split_string_get_number_of_segments( libcsplit_wide_split_string_t *split_string, int *number_of_segments, libcerror_error_t **error ) { libcsplit_internal_wide_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_wide_split_string_get_number_of_segments"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_wide_split_string_t *) split_string; if( number_of_segments == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid number of segments.", function ); return( -1 ); } *number_of_segments = internal_split_string->number_of_segments; return( 1 ); } /* Retrieves a specific segment * Returns 1 if successful or -1 on error */ int libcsplit_wide_split_string_get_segment_by_index( libcsplit_wide_split_string_t *split_string, int segment_index, wchar_t **string_segment, size_t *string_segment_size, libcerror_error_t **error ) { libcsplit_internal_wide_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_wide_split_string_get_segment_by_index"; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_wide_split_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( string_segment == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string segment.", function ); return( -1 ); } if( string_segment_size == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string segment size.", function ); return( -1 ); } *string_segment = internal_split_string->segments[ segment_index ]; *string_segment_size = internal_split_string->segment_sizes[ segment_index ]; return( 1 ); } /* Sets a specific segment * Returns 1 if successful or -1 on error */ int libcsplit_wide_split_string_set_segment_by_index( libcsplit_wide_split_string_t *split_string, int segment_index, wchar_t *string_segment, size_t string_segment_size, libcerror_error_t **error ) { libcsplit_internal_wide_split_string_t *internal_split_string = NULL; static char *function = "libcsplit_wide_split_string_set_segment_by_index"; size_t string_segment_offset = 0; if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } internal_split_string = (libcsplit_internal_wide_split_string_t *) split_string; if( ( segment_index < 0 ) || ( segment_index >= internal_split_string->number_of_segments ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid segment index value out of bounds.", function ); return( -1 ); } if( string_segment_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string segment size value exceeds maximum.", function ); return( -1 ); } if( string_segment == NULL ) { if( string_segment_size != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment size value out of bounds.", function ); return( -1 ); } } else { if( string_segment < internal_split_string->string ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment value out of bounds.", function ); return( -1 ); } string_segment_offset = (size_t) ( string_segment - internal_split_string->string ); if( string_segment_offset >= internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment value out of bounds.", function ); return( -1 ); } string_segment_offset += string_segment_size; if( string_segment_offset > internal_split_string->string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string segment value out of bounds.", function ); return( -1 ); } } internal_split_string->segments[ segment_index ] = string_segment; internal_split_string->segment_sizes[ segment_index ] = string_segment_size; return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libcsplit/libcsplit_narrow_string.h0000664000175000017500000000255413443450041024436 0ustar00lordyestalordyesta00000000000000/* * Narrow character string functions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_NARROW_STRING_H ) #define _LIBCSPLIT_NARROW_STRING_H #include #include #include "libcsplit_extern.h" #include "libcsplit_libcerror.h" #include "libcsplit_types.h" #if defined( __cplusplus ) extern "C" { #endif LIBCSPLIT_EXTERN \ int libcsplit_narrow_string_split( const char *string, size_t string_size, char delimiter, libcsplit_narrow_split_string_t **split_string, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCSPLIT_NARROW_STRING_H ) */ libewf-20140807/libcsplit/libcsplit_unused.h0000664000175000017500000000261213443450041023036 0ustar00lordyestalordyesta00000000000000/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_UNUSED_H ) #define _LIBCSPLIT_UNUSED_H #include #if !defined( LIBCSPLIT_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCSPLIT_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCSPLIT_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCSPLIT_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCSPLIT_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCSPLIT_UNUSED_H ) */ libewf-20140807/libcsplit/libcsplit_wide_string.c0000664000175000017500000001410013443450041024037 0ustar00lordyestalordyesta00000000000000/* * Wide character string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libcsplit_libcerror.h" #include "libcsplit_wide_split_string.h" #include "libcsplit_wide_string.h" #include "libcsplit_types.h" #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Splits a wide character string * Make sure the value split_string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcsplit_wide_string_split( const wchar_t *string, size_t string_size, wchar_t delimiter, libcsplit_wide_split_string_t **split_string, libcerror_error_t **error ) { wchar_t *segment_start = NULL; wchar_t *segment_end = NULL; wchar_t *string_end = NULL; wchar_t *string_start = NULL; static char *function = "libcsplit_wide_string_split"; ssize_t segment_length = 0; int number_of_segments = 0; int segment_index = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string already set.", function ); return( -1 ); } /* An empty string has no segments */ if( ( string_size == 0 ) || ( string[ 0 ] == 0 ) ) { return( 1 ); } /* Determine the number of segments */ segment_start = (wchar_t *) string; string_end = (wchar_t *) &( string[ string_size - 1 ] ); do { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end > string_end ) { break; } segment_index++; if( segment_end == NULL ) { break; } if( segment_end == segment_start ) { segment_start++; } else if( segment_end != string ) { segment_start = segment_end + 1; } } while( segment_end != NULL ); number_of_segments = segment_index; if( libcsplit_wide_split_string_initialize( split_string, string, string_size, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize split string.", function ); goto on_error; } /* Do not bother with strings that do not need splitting */ if( number_of_segments == 0 ) { return( 1 ); } /* Determine the segments * empty segments are stored as strings only containing the end of character */ if( libcsplit_wide_split_string_get_string( *split_string, &string_start, &string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve split string.", function ); goto on_error; } if( string_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string start.", function ); goto on_error; } if( string_size < 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string size value out of bounds.", function ); goto on_error; } segment_start = string_start; string_end = &( string_start[ string_size - 1 ] ); for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end == NULL ) { segment_length = (ssize_t) ( string_end - segment_start ); } else { segment_length = (ssize_t) ( segment_end - segment_start ); } if( segment_length >= 0 ) { segment_start[ segment_length ] = 0; if( libcsplit_wide_split_string_set_segment_by_index( *split_string, segment_index, segment_start, segment_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set split string segment: %d.", function, segment_index ); goto on_error; } } if( segment_end == NULL ) { break; } if( segment_end == string_start ) { segment_start++; } else { segment_start = segment_end + 1; } } return( 1 ); on_error: if( *split_string != NULL ) { libcsplit_wide_split_string_free( split_string, NULL ); } return( -1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ libewf-20140807/libcsplit/libcsplit_narrow_string.c0000664000175000017500000001375713443450041024440 0ustar00lordyestalordyesta00000000000000/* * Narrow character string functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libcsplit_libcerror.h" #include "libcsplit_narrow_split_string.h" #include "libcsplit_narrow_string.h" #include "libcsplit_types.h" /* Splits a narrow character string * Make sure the value split_string is referencing, is set to NULL * Returns 1 if successful or -1 on error */ int libcsplit_narrow_string_split( const char *string, size_t string_size, char delimiter, libcsplit_narrow_split_string_t **split_string, libcerror_error_t **error ) { char *segment_start = NULL; char *segment_end = NULL; char *string_end = NULL; char *string_start = NULL; static char *function = "libcsplit_narrow_string_split"; ssize_t segment_length = 0; int number_of_segments = 0; int segment_index = 0; if( string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid string.", function ); return( -1 ); } if( string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, "%s: invalid string size value exceeds maximum.", function ); return( -1 ); } if( split_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, "%s: invalid split string.", function ); return( -1 ); } if( *split_string != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, "%s: invalid split string already set.", function ); return( -1 ); } /* An empty string has no segments */ if( ( string_size == 0 ) || ( string[ 0 ] == 0 ) ) { return( 1 ); } /* Determine the number of segments */ segment_start = (char *) string; string_end = (char *) &( string[ string_size - 1 ] ); do { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end > string_end ) { break; } segment_index++; if( segment_end == NULL ) { break; } if( segment_end == segment_start ) { segment_start++; } else if( segment_end != string ) { segment_start = segment_end + 1; } } while( segment_end != NULL ); number_of_segments = segment_index; if( libcsplit_narrow_split_string_initialize( split_string, string, string_size, number_of_segments, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, "%s: unable to initialize split string.", function ); goto on_error; } /* Do not bother with strings that do not need splitting */ if( number_of_segments == 0 ) { return( 1 ); } /* Determine the segments * empty segments are stored as strings only containing the end of character */ if( libcsplit_narrow_split_string_get_string( *split_string, &string_start, &string_size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve split string.", function ); goto on_error; } if( string_start == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing string start.", function ); goto on_error; } if( string_size < 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid string size value out of bounds.", function ); goto on_error; } segment_start = string_start; string_end = &( string_start[ string_size - 1 ] ); for( segment_index = 0; segment_index < number_of_segments; segment_index++ ) { segment_end = segment_start; while( segment_end <= string_end ) { if( ( segment_end == string_end ) || ( *segment_end == 0 ) ) { segment_end = NULL; break; } else if( *segment_end == delimiter ) { break; } segment_end++; } if( segment_end == NULL ) { segment_length = (ssize_t) ( string_end - segment_start ); } else { segment_length = (ssize_t) ( segment_end - segment_start ); } if( segment_length >= 0 ) { segment_start[ segment_length ] = 0; if( libcsplit_narrow_split_string_set_segment_by_index( *split_string, segment_index, segment_start, segment_length + 1, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set split string segment: %d.", function, segment_index ); goto on_error; } } if( segment_end == NULL ) { break; } if( segment_end == string_start ) { segment_start++; } else { segment_start = segment_end + 1; } } return( 1 ); on_error: if( *split_string != NULL ) { libcsplit_narrow_split_string_free( split_string, NULL ); } return( -1 ); } libewf-20140807/libcsplit/Makefile.in0000664000175000017500000010303613443455347021402 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcsplit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcsplit_la_LIBADD = am__libcsplit_la_SOURCES_DIST = libcsplit_definitions.h \ libcsplit_error.c libcsplit_error.h libcsplit_extern.h \ libcsplit_narrow_split_string.c \ libcsplit_narrow_split_string.h libcsplit_narrow_string.c \ libcsplit_narrow_string.h libcsplit_libcerror.h \ libcsplit_support.c libcsplit_support.h libcsplit_types.h \ libcsplit_unused.h libcsplit_wide_split_string.c \ libcsplit_wide_split_string.h libcsplit_wide_string.c \ libcsplit_wide_string.h @HAVE_LOCAL_LIBCSPLIT_TRUE@am_libcsplit_la_OBJECTS = \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_error.lo \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_narrow_split_string.lo \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_narrow_string.lo \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_support.lo \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_wide_split_string.lo \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_wide_string.lo libcsplit_la_OBJECTS = $(am_libcsplit_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = @HAVE_LOCAL_LIBCSPLIT_TRUE@am_libcsplit_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcsplit_error.Plo \ ./$(DEPDIR)/libcsplit_narrow_split_string.Plo \ ./$(DEPDIR)/libcsplit_narrow_string.Plo \ ./$(DEPDIR)/libcsplit_support.Plo \ ./$(DEPDIR)/libcsplit_wide_split_string.Plo \ ./$(DEPDIR)/libcsplit_wide_string.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcsplit_la_SOURCES) DIST_SOURCES = $(am__libcsplit_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ @HAVE_LOCAL_LIBCSPLIT_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCSPLIT_TRUE@noinst_LTLIBRARIES = libcsplit.la @HAVE_LOCAL_LIBCSPLIT_TRUE@libcsplit_la_SOURCES = \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_definitions.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_error.c libcsplit_error.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_extern.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_narrow_split_string.c libcsplit_narrow_split_string.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_narrow_string.c libcsplit_narrow_string.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_libcerror.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_support.c libcsplit_support.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_types.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_unused.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_wide_split_string.c libcsplit_wide_split_string.h \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ libcsplit_wide_string.c libcsplit_wide_string.h MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcsplit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libcsplit/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcsplit.la: $(libcsplit_la_OBJECTS) $(libcsplit_la_DEPENDENCIES) $(EXTRA_libcsplit_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libcsplit_la_rpath) $(libcsplit_la_OBJECTS) $(libcsplit_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcsplit_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcsplit_narrow_split_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcsplit_narrow_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcsplit_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcsplit_wide_split_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcsplit_wide_string.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcsplit_error.Plo -rm -f ./$(DEPDIR)/libcsplit_narrow_split_string.Plo -rm -f ./$(DEPDIR)/libcsplit_narrow_string.Plo -rm -f ./$(DEPDIR)/libcsplit_support.Plo -rm -f ./$(DEPDIR)/libcsplit_wide_split_string.Plo -rm -f ./$(DEPDIR)/libcsplit_wide_string.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean /bin/rm -f Makefile splint: @echo "Running splint on libcsplit ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcsplit_la_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/libcsplit/libcsplit_wide_split_string.h0000664000175000017500000000555213443450041025272 0ustar00lordyestalordyesta00000000000000/* * Split wide string functions * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H ) #define _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H #include #include #include "libcsplit_extern.h" #include "libcsplit_libcerror.h" #include "libcsplit_types.h" #if defined( __cplusplus ) extern "C" { #endif #if defined( HAVE_WIDE_CHARACTER_TYPE ) typedef struct libcsplit_internal_wide_split_string libcsplit_internal_wide_split_string_t; struct libcsplit_internal_wide_split_string { /* The number of string segments */ int number_of_segments; /* The string */ wchar_t *string; /* The string size */ size_t string_size; /* The segments */ wchar_t **segments; /* The segment sizes */ size_t *segment_sizes; }; int libcsplit_wide_split_string_initialize( libcsplit_wide_split_string_t **split_string, const wchar_t *string, size_t string_size, int number_of_segments, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_wide_split_string_free( libcsplit_wide_split_string_t **split_string, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_wide_split_string_get_string( libcsplit_wide_split_string_t *split_string, wchar_t **string, size_t *string_size, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_wide_split_string_get_number_of_segments( libcsplit_wide_split_string_t *split_string, int *number_of_segments, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_wide_split_string_get_segment_by_index( libcsplit_wide_split_string_t *split_string, int segment_index, wchar_t **string_segment, size_t *string_segment_size, libcerror_error_t **error ); LIBCSPLIT_EXTERN \ int libcsplit_wide_split_string_set_segment_by_index( libcsplit_wide_split_string_t *split_string, int segment_index, wchar_t *string_segment, size_t string_segment_size, libcerror_error_t **error ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H ) */ libewf-20140807/libcsplit/libcsplit_definitions.h0000664000175000017500000000252213443450041024046 0ustar00lordyestalordyesta00000000000000/* * The internal definitions * * Copyright (C) 2008-2019, 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( LIBCSPLIT_INTERNAL_DEFINITIONS_H ) #define LIBCSPLIT_INTERNAL_DEFINITIONS_H #include #include /* Define HAVE_LOCAL_LIBCSPLIT for local use of libcsplit */ #if !defined( HAVE_LOCAL_LIBCSPLIT ) #include /* The definitions in are copied here * for local use of libcsplit */ #else #define LIBCSPLIT_VERSION 20190102 /* The libcsplit version string */ #define LIBCSPLIT_VERSION_STRING "20190102" #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ #endif libewf-20140807/libcsplit/libcsplit_error.c0000664000175000017500000000555613443450041022671 0ustar00lordyestalordyesta00000000000000/* * Error functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include #include "libcsplit_error.h" #include "libcsplit_libcerror.h" #if !defined( HAVE_LOCAL_LIBCSPLIT ) /* Free an error and its elements */ void libcsplit_error_free( libcsplit_error_t **error ) { libcerror_error_free( (libcerror_error_t **) error ); } /* Prints a descriptive string of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcsplit_error_fprint( libcsplit_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a descriptive string of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcsplit_error_sprint( libcsplit_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } /* Prints a backtrace of the error to the stream * Returns the number of printed characters if successful or -1 on error */ int libcsplit_error_backtrace_fprint( libcsplit_error_t *error, FILE *stream ) { int print_count = 0; print_count = libcerror_error_backtrace_fprint( (libcerror_error_t *) error, stream ); return( print_count ); } /* Prints a backtrace of the error to the string * The end-of-string character is not included in the return value * Returns the number of printed characters if successful or -1 on error */ int libcsplit_error_backtrace_sprint( libcsplit_error_t *error, char *string, size_t size ) { int print_count = 0; print_count = libcerror_error_backtrace_sprint( (libcerror_error_t *) error, string, size ); return( print_count ); } #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ libewf-20140807/libcsplit/libcsplit_support.c0000664000175000017500000000221013443450041023234 0ustar00lordyestalordyesta00000000000000/* * Support functions * * Copyright (C) 2008-2019, 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 . */ #include #include #include "libcsplit_definitions.h" #include "libcsplit_support.h" #if !defined( HAVE_LOCAL_LIBCSPLIT ) /* Returns the library version as a string */ const char *libcsplit_get_version( void ) { return( (const char *) LIBCSPLIT_VERSION_STRING ); } #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ libewf-20140807/libcsplit/libcsplit_libcerror.h0000664000175000017500000000264313443450041023522 0ustar00lordyestalordyesta00000000000000/* * The libcerror header wrapper * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_LIBCERROR_H ) #define _LIBCSPLIT_LIBCERROR_H #include /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror */ #if defined( HAVE_LOCAL_LIBCERROR ) #include #include #include #include #else /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT * before including libcerror.h */ #if defined( _WIN32 ) && defined( DLL_IMPORT ) #define LIBCERROR_DLL_IMPORT #endif #include #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ #endif /* !defined( _LIBCSPLIT_LIBCERROR_H ) */ libewf-20140807/libcsplit/libcsplit_extern.h0000664000175000017500000000242213443450041023037 0ustar00lordyestalordyesta00000000000000/* * The internal extern definition * * Copyright (C) 2008-2019, 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( _LIBCSPLIT_INTERNAL_EXTERN_H ) #define _LIBCSPLIT_INTERNAL_EXTERN_H #include /* Define HAVE_LOCAL_LIBCSPLIT for local use of libcsplit */ #if !defined( HAVE_LOCAL_LIBCSPLIT ) #include #define LIBCSPLIT_EXTERN_VARIABLE LIBCSPLIT_EXTERN #else #define LIBCSPLIT_EXTERN /* extern */ #define LIBCSPLIT_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ #endif /* !defined( _LIBCSPLIT_INTERNAL_EXTERN_H ) */ libewf-20140807/ylwrap0000755000175000017500000001531413443455350016605 0ustar00lordyestalordyesta00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libewf-20140807/pyewf-python2/0000775000175000017500000000000013443455447020101 5ustar00lordyestalordyesta00000000000000libewf-20140807/pyewf-python2/Makefile.am0000664000175000017500000000330713421024433022117 0ustar00lordyestalordyesta00000000000000# Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects # subdir-objects will compile the source files to a single version of Python. # Since subdir-objects is being deprecated we copy the source files instead. am__installdirs = "$(DESTDIR)$(pyexecdir2)" pyexecdir = $(pyexecdir2) if HAVE_PYTHON2 AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCSPLIT_CPPFLAGS@ \ @LIBUNA_CPPFLAGS@ \ @LIBCFILE_CPPFLAGS@ \ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ am_pyewf_la_rpath = -rpath $(pyexecdir2) BUILT_SOURCES = \ pyewf.c pyewf.h \ pyewf_codepage.c pyewf_codepage.h \ pyewf_datetime.c pyewf_datetime.h \ pyewf_error.c pyewf_error.h \ pyewf_file_entries.c pyewf_file_entries.h \ pyewf_file_entry.c pyewf_file_entry.h \ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ pyewf_handle.c pyewf_handle.h \ pyewf_integer.c pyewf_integer.h \ pyewf_libbfio.h \ pyewf_libcerror.h \ pyewf_libclocale.h \ pyewf_libewf.h \ pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h \ pyewf_unused.h pyexec_LTLIBRARIES = pyewf.la nodist_pyewf_la_SOURCES = $(BUILT_SOURCES) pyewf_la_LIBADD = \ @LIBCERROR_LIBADD@ \ ../libewf/libewf.la @LIBCDATA_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCSPLIT_LIBADD@ \ @LIBUNA_LIBADD@ \ @LIBCFILE_LIBADD@ \ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ pyewf_la_CPPFLAGS = $(PYTHON2_CPPFLAGS) pyewf_la_LDFLAGS = -module -avoid-version $(PYTHON2_LDFLAGS) $(BUILT_SOURCES): /bin/cp -f $(top_srcdir)/pyewf/$@ $@ endif MAINTAINERCLEANFILES = \ Makefile.in clean-local: /bin/rm -f pyewf*.[ch] distclean: clean /bin/rm -f Makefile libewf-20140807/pyewf-python2/Makefile.in0000664000175000017500000014472413443455350022153 0ustar00lordyestalordyesta00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pyewf-python2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcdata.m4 \ $(top_srcdir)/m4/libcdatetime.m4 $(top_srcdir)/m4/libcerror.m4 \ $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libmfdata.m4 $(top_srcdir)/m4/libodraw.m4 \ $(top_srcdir)/m4/libsmdev.m4 $(top_srcdir)/m4/libsmraw.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ $(top_srcdir)/m4/libuuid.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/pthread.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/stdcxx11.m4 $(top_srcdir)/m4/types.m4 \ $(top_srcdir)/m4/zlib.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } LTLIBRARIES = $(pyexec_LTLIBRARIES) @HAVE_PYTHON2_TRUE@pyewf_la_DEPENDENCIES = ../libewf/libewf.la @HAVE_PYTHON2_TRUE@am__objects_1 = pyewf_la-pyewf.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_codepage.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_datetime.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_error.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_file_entries.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_file_entry.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_file_object_io_handle.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_file_objects_io_pool.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_handle.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_integer.lo \ @HAVE_PYTHON2_TRUE@ pyewf_la-pyewf_metadata.lo @HAVE_PYTHON2_TRUE@nodist_pyewf_la_OBJECTS = $(am__objects_1) pyewf_la_OBJECTS = $(nodist_pyewf_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = pyewf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(pyewf_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pyewf_la-pyewf.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_error.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_handle.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_integer.Plo \ ./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nodist_pyewf_la_SOURCES) DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DPKG_DATE = @DPKG_DATE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DLLMAIN = @HAVE_DLLMAIN@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LIBBFIO = @HAVE_LIBBFIO@ HAVE_LIBCDATA = @HAVE_LIBCDATA@ HAVE_LIBCDATETIME = @HAVE_LIBCDATETIME@ HAVE_LIBCERROR = @HAVE_LIBCERROR@ HAVE_LIBCFILE = @HAVE_LIBCFILE@ HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ HAVE_LIBCPATH = @HAVE_LIBCPATH@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ HAVE_LIBHMAC = @HAVE_LIBHMAC@ HAVE_LIBMFDATA = @HAVE_LIBMFDATA@ HAVE_LIBODRAW = @HAVE_LIBODRAW@ HAVE_LIBSMDEV = @HAVE_LIBSMDEV@ HAVE_LIBSMRAW = @HAVE_LIBSMRAW@ HAVE_LIBUNA = @HAVE_LIBUNA@ HAVE_LIBUUID = @HAVE_LIBUUID@ HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ HAVE_LOCAL_LIBCDATETIME = @HAVE_LOCAL_LIBCDATETIME@ HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ HAVE_LOCAL_LIBMFDATA = @HAVE_LOCAL_LIBMFDATA@ HAVE_LOCAL_LIBODRAW = @HAVE_LOCAL_LIBODRAW@ HAVE_LOCAL_LIBSMDEV = @HAVE_LOCAL_LIBSMDEV@ HAVE_LOCAL_LIBSMRAW = @HAVE_LOCAL_LIBSMRAW@ HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ HAVE_PTHREAD = @HAVE_PTHREAD@ HAVE_SIZE32_T = @HAVE_SIZE32_T@ HAVE_SIZE64_T = @HAVE_SIZE64_T@ HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_V1_API = @HAVE_V1_API@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ HAVE_ZLIB = @HAVE_ZLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ LIBCDATETIME_CPPFLAGS = @LIBCDATETIME_CPPFLAGS@ LIBCDATETIME_LIBADD = @LIBCDATETIME_LIBADD@ LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBEWF_DLL_IMPORT = @LIBEWF_DLL_IMPORT@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMFDATA_CPPFLAGS = @LIBMFDATA_CPPFLAGS@ LIBMFDATA_LIBADD = @LIBMFDATA_LIBADD@ LIBOBJS = @LIBOBJS@ LIBODRAW_CPPFLAGS = @LIBODRAW_CPPFLAGS@ LIBODRAW_LIBADD = @LIBODRAW_LIBADD@ LIBS = @LIBS@ LIBSMDEV_CPPFLAGS = @LIBSMDEV_CPPFLAGS@ LIBSMDEV_LIBADD = @LIBSMDEV_LIBADD@ LIBSMRAW_CPPFLAGS = @LIBSMRAW_CPPFLAGS@ LIBSMRAW_LIBADD = @LIBSMRAW_LIBADD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ LIBUUID_CPPFLAGS = @LIBUUID_CPPFLAGS@ LIBUUID_LIBADD = @LIBUUID_LIBADD@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG = @PKGCONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ PYTHON2 = @PYTHON2@ PYTHON2_CONFIG = @PYTHON2_CONFIG@ PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ PYTHON2_PREFIX = @PYTHON2_PREFIX@ PYTHON2_VERSION = @PYTHON2_VERSION@ PYTHON3 = @PYTHON3@ PYTHON3_CONFIG = @PYTHON3_CONFIG@ PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ PYTHON3_PREFIX = @PYTHON3_PREFIX@ PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_DATE = @SPEC_DATE@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ ZLIB_LIBADD = @ZLIB_LIBADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ ax_libcdatetime_pc_libs_private = @ax_libcdatetime_pc_libs_private@ ax_libcdatetime_spec_build_requires = @ax_libcdatetime_spec_build_requires@ ax_libcdatetime_spec_requires = @ax_libcdatetime_spec_requires@ ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ ax_libmfdata_pc_libs_private = @ax_libmfdata_pc_libs_private@ ax_libmfdata_spec_build_requires = @ax_libmfdata_spec_build_requires@ ax_libmfdata_spec_requires = @ax_libmfdata_spec_requires@ ax_libodraw_pc_libs_private = @ax_libodraw_pc_libs_private@ ax_libodraw_spec_build_requires = @ax_libodraw_spec_build_requires@ ax_libodraw_spec_requires = @ax_libodraw_spec_requires@ ax_libsmdev_pc_libs_private = @ax_libsmdev_pc_libs_private@ ax_libsmdev_spec_build_requires = @ax_libsmdev_spec_build_requires@ ax_libsmdev_spec_requires = @ax_libsmdev_spec_requires@ ax_libsmraw_pc_libs_private = @ax_libsmraw_pc_libs_private@ ax_libsmraw_spec_build_requires = @ax_libsmraw_spec_build_requires@ ax_libsmraw_spec_requires = @ax_libsmraw_spec_requires@ ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ ax_libuna_spec_requires = @ax_libuna_spec_requires@ ax_libuuid_pc_libs_private = @ax_libuuid_pc_libs_private@ ax_libuuid_spec_build_requires = @ax_libuuid_spec_build_requires@ ax_libuuid_spec_requires = @ax_libuuid_spec_requires@ ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ ax_zlib_pc_libs_private = @ax_zlib_pc_libs_private@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_CFLAGS = @fuse_CFLAGS@ fuse_LIBS = @fuse_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libbfio_CFLAGS = @libbfio_CFLAGS@ libbfio_LIBS = @libbfio_LIBS@ libcdata_CFLAGS = @libcdata_CFLAGS@ libcdata_LIBS = @libcdata_LIBS@ libcdatetime_CFLAGS = @libcdatetime_CFLAGS@ libcdatetime_LIBS = @libcdatetime_LIBS@ libcerror_CFLAGS = @libcerror_CFLAGS@ libcerror_LIBS = @libcerror_LIBS@ libcfile_CFLAGS = @libcfile_CFLAGS@ libcfile_LIBS = @libcfile_LIBS@ libclocale_CFLAGS = @libclocale_CFLAGS@ libclocale_LIBS = @libclocale_LIBS@ libcnotify_CFLAGS = @libcnotify_CFLAGS@ libcnotify_LIBS = @libcnotify_LIBS@ libcpath_CFLAGS = @libcpath_CFLAGS@ libcpath_LIBS = @libcpath_LIBS@ libcsplit_CFLAGS = @libcsplit_CFLAGS@ libcsplit_LIBS = @libcsplit_LIBS@ libcthreads_CFLAGS = @libcthreads_CFLAGS@ libcthreads_LIBS = @libcthreads_LIBS@ libdir = @libdir@ libewf_spec_requires = @libewf_spec_requires@ libewf_spec_tools_build_requires = @libewf_spec_tools_build_requires@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ libfdata_CFLAGS = @libfdata_CFLAGS@ libfdata_LIBS = @libfdata_LIBS@ libfvalue_CFLAGS = @libfvalue_CFLAGS@ libfvalue_LIBS = @libfvalue_LIBS@ libhmac_CFLAGS = @libhmac_CFLAGS@ libhmac_LIBS = @libhmac_LIBS@ libmfdata_CFLAGS = @libmfdata_CFLAGS@ libmfdata_LIBS = @libmfdata_LIBS@ libodraw_CFLAGS = @libodraw_CFLAGS@ libodraw_LIBS = @libodraw_LIBS@ libsmdev_CFLAGS = @libsmdev_CFLAGS@ libsmdev_LIBS = @libsmdev_LIBS@ libsmraw_CFLAGS = @libsmraw_CFLAGS@ libsmraw_LIBS = @libsmraw_LIBS@ libuna_CFLAGS = @libuna_CFLAGS@ libuna_LIBS = @libuna_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openssl_CFLAGS = @openssl_CFLAGS@ openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = $(pyexecdir2) pyexecdir2 = @pyexecdir2@ pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ pythondir2 = @pythondir2@ pythondir3 = @pythondir3@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uuid_CFLAGS = @uuid_CFLAGS@ uuid_LIBS = @uuid_LIBS@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ # Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects # subdir-objects will compile the source files to a single version of Python. # Since subdir-objects is being deprecated we copy the source files instead. am__installdirs = "$(DESTDIR)$(pyexecdir2)" @HAVE_PYTHON2_TRUE@AM_CFLAGS = \ @HAVE_PYTHON2_TRUE@ -I$(top_srcdir)/include \ @HAVE_PYTHON2_TRUE@ -I$(top_srcdir)/common \ @HAVE_PYTHON2_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBCDATA_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBUNA_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBCFILE_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBCPATH_CPPFLAGS@ \ @HAVE_PYTHON2_TRUE@ @LIBBFIO_CPPFLAGS@ @HAVE_PYTHON2_TRUE@am_pyewf_la_rpath = -rpath $(pyexecdir2) @HAVE_PYTHON2_TRUE@BUILT_SOURCES = \ @HAVE_PYTHON2_TRUE@ pyewf.c pyewf.h \ @HAVE_PYTHON2_TRUE@ pyewf_codepage.c pyewf_codepage.h \ @HAVE_PYTHON2_TRUE@ pyewf_datetime.c pyewf_datetime.h \ @HAVE_PYTHON2_TRUE@ pyewf_error.c pyewf_error.h \ @HAVE_PYTHON2_TRUE@ pyewf_file_entries.c pyewf_file_entries.h \ @HAVE_PYTHON2_TRUE@ pyewf_file_entry.c pyewf_file_entry.h \ @HAVE_PYTHON2_TRUE@ pyewf_file_object_io_handle.c pyewf_file_object_io_handle.h \ @HAVE_PYTHON2_TRUE@ pyewf_file_objects_io_pool.c pyewf_file_objects_io_pool.h \ @HAVE_PYTHON2_TRUE@ pyewf_handle.c pyewf_handle.h \ @HAVE_PYTHON2_TRUE@ pyewf_integer.c pyewf_integer.h \ @HAVE_PYTHON2_TRUE@ pyewf_libbfio.h \ @HAVE_PYTHON2_TRUE@ pyewf_libcerror.h \ @HAVE_PYTHON2_TRUE@ pyewf_libclocale.h \ @HAVE_PYTHON2_TRUE@ pyewf_libewf.h \ @HAVE_PYTHON2_TRUE@ pyewf_metadata.c pyewf_metadata.h \ @HAVE_PYTHON2_TRUE@ pyewf_python.h \ @HAVE_PYTHON2_TRUE@ pyewf_unused.h @HAVE_PYTHON2_TRUE@pyexec_LTLIBRARIES = pyewf.la @HAVE_PYTHON2_TRUE@nodist_pyewf_la_SOURCES = $(BUILT_SOURCES) @HAVE_PYTHON2_TRUE@pyewf_la_LIBADD = \ @HAVE_PYTHON2_TRUE@ @LIBCERROR_LIBADD@ \ @HAVE_PYTHON2_TRUE@ ../libewf/libewf.la @HAVE_PYTHON2_TRUE@pyewf_la_CPPFLAGS = $(PYTHON2_CPPFLAGS) @HAVE_PYTHON2_TRUE@pyewf_la_LDFLAGS = -module -avoid-version $(PYTHON2_LDFLAGS) MAINTAINERCLEANFILES = \ Makefile.in all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pyewf-python2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pyewf-python2/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ } uninstall-pyexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ done clean-pyexecLTLIBRARIES: -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) @list='$(pyexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } pyewf.la: $(pyewf_la_OBJECTS) $(pyewf_la_DEPENDENCIES) $(EXTRA_pyewf_la_DEPENDENCIES) $(AM_V_CCLD)$(pyewf_la_LINK) $(am_pyewf_la_rpath) $(pyewf_la_OBJECTS) $(pyewf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_integer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< pyewf_la-pyewf.lo: pyewf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf.Tpo -c -o pyewf_la-pyewf.lo `test -f 'pyewf.c' || echo '$(srcdir)/'`pyewf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf.Tpo $(DEPDIR)/pyewf_la-pyewf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf.c' object='pyewf_la-pyewf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf.lo `test -f 'pyewf.c' || echo '$(srcdir)/'`pyewf.c pyewf_la-pyewf_codepage.lo: pyewf_codepage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_codepage.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_codepage.Tpo -c -o pyewf_la-pyewf_codepage.lo `test -f 'pyewf_codepage.c' || echo '$(srcdir)/'`pyewf_codepage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_codepage.Tpo $(DEPDIR)/pyewf_la-pyewf_codepage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_codepage.c' object='pyewf_la-pyewf_codepage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_codepage.lo `test -f 'pyewf_codepage.c' || echo '$(srcdir)/'`pyewf_codepage.c pyewf_la-pyewf_datetime.lo: pyewf_datetime.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_datetime.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_datetime.Tpo -c -o pyewf_la-pyewf_datetime.lo `test -f 'pyewf_datetime.c' || echo '$(srcdir)/'`pyewf_datetime.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_datetime.Tpo $(DEPDIR)/pyewf_la-pyewf_datetime.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_datetime.c' object='pyewf_la-pyewf_datetime.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_datetime.lo `test -f 'pyewf_datetime.c' || echo '$(srcdir)/'`pyewf_datetime.c pyewf_la-pyewf_error.lo: pyewf_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_error.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_error.Tpo -c -o pyewf_la-pyewf_error.lo `test -f 'pyewf_error.c' || echo '$(srcdir)/'`pyewf_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_error.Tpo $(DEPDIR)/pyewf_la-pyewf_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_error.c' object='pyewf_la-pyewf_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_error.lo `test -f 'pyewf_error.c' || echo '$(srcdir)/'`pyewf_error.c pyewf_la-pyewf_file_entries.lo: pyewf_file_entries.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_entries.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_entries.Tpo -c -o pyewf_la-pyewf_file_entries.lo `test -f 'pyewf_file_entries.c' || echo '$(srcdir)/'`pyewf_file_entries.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_entries.Tpo $(DEPDIR)/pyewf_la-pyewf_file_entries.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_entries.c' object='pyewf_la-pyewf_file_entries.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_entries.lo `test -f 'pyewf_file_entries.c' || echo '$(srcdir)/'`pyewf_file_entries.c pyewf_la-pyewf_file_entry.lo: pyewf_file_entry.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_entry.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_entry.Tpo -c -o pyewf_la-pyewf_file_entry.lo `test -f 'pyewf_file_entry.c' || echo '$(srcdir)/'`pyewf_file_entry.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_entry.Tpo $(DEPDIR)/pyewf_la-pyewf_file_entry.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_entry.c' object='pyewf_la-pyewf_file_entry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_entry.lo `test -f 'pyewf_file_entry.c' || echo '$(srcdir)/'`pyewf_file_entry.c pyewf_la-pyewf_file_object_io_handle.lo: pyewf_file_object_io_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_object_io_handle.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Tpo -c -o pyewf_la-pyewf_file_object_io_handle.lo `test -f 'pyewf_file_object_io_handle.c' || echo '$(srcdir)/'`pyewf_file_object_io_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Tpo $(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_object_io_handle.c' object='pyewf_la-pyewf_file_object_io_handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_object_io_handle.lo `test -f 'pyewf_file_object_io_handle.c' || echo '$(srcdir)/'`pyewf_file_object_io_handle.c pyewf_la-pyewf_file_objects_io_pool.lo: pyewf_file_objects_io_pool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_file_objects_io_pool.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Tpo -c -o pyewf_la-pyewf_file_objects_io_pool.lo `test -f 'pyewf_file_objects_io_pool.c' || echo '$(srcdir)/'`pyewf_file_objects_io_pool.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Tpo $(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_file_objects_io_pool.c' object='pyewf_la-pyewf_file_objects_io_pool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_file_objects_io_pool.lo `test -f 'pyewf_file_objects_io_pool.c' || echo '$(srcdir)/'`pyewf_file_objects_io_pool.c pyewf_la-pyewf_handle.lo: pyewf_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_handle.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_handle.Tpo -c -o pyewf_la-pyewf_handle.lo `test -f 'pyewf_handle.c' || echo '$(srcdir)/'`pyewf_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_handle.Tpo $(DEPDIR)/pyewf_la-pyewf_handle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_handle.c' object='pyewf_la-pyewf_handle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_handle.lo `test -f 'pyewf_handle.c' || echo '$(srcdir)/'`pyewf_handle.c pyewf_la-pyewf_integer.lo: pyewf_integer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_integer.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_integer.Tpo -c -o pyewf_la-pyewf_integer.lo `test -f 'pyewf_integer.c' || echo '$(srcdir)/'`pyewf_integer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_integer.Tpo $(DEPDIR)/pyewf_la-pyewf_integer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_integer.c' object='pyewf_la-pyewf_integer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_integer.lo `test -f 'pyewf_integer.c' || echo '$(srcdir)/'`pyewf_integer.c pyewf_la-pyewf_metadata.lo: pyewf_metadata.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyewf_la-pyewf_metadata.lo -MD -MP -MF $(DEPDIR)/pyewf_la-pyewf_metadata.Tpo -c -o pyewf_la-pyewf_metadata.lo `test -f 'pyewf_metadata.c' || echo '$(srcdir)/'`pyewf_metadata.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pyewf_la-pyewf_metadata.Tpo $(DEPDIR)/pyewf_la-pyewf_metadata.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pyewf_metadata.c' object='pyewf_la-pyewf_metadata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyewf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pyewf_la-pyewf_metadata.lo `test -f 'pyewf_metadata.c' || echo '$(srcdir)/'`pyewf_metadata.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pyexecdir2)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local \ clean-pyexecLTLIBRARIES mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pyexecLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pyewf_la-pyewf.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_codepage.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_datetime.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_error.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_entries.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_entry.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_object_io_handle.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_file_objects_io_pool.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_handle.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_integer.Plo -rm -f ./$(DEPDIR)/pyewf_la-pyewf_metadata.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pyexecLTLIBRARIES .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-local \ clean-pyexecLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-pyexecLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-pyexecLTLIBRARIES .PRECIOUS: Makefile @HAVE_PYTHON2_TRUE@ @LIBCDATA_LIBADD@ \ @HAVE_PYTHON2_TRUE@ @LIBCLOCALE_LIBADD@ \ @HAVE_PYTHON2_TRUE@ @LIBCSPLIT_LIBADD@ \ @HAVE_PYTHON2_TRUE@ @LIBUNA_LIBADD@ \ @HAVE_PYTHON2_TRUE@ @LIBCFILE_LIBADD@ \ @HAVE_PYTHON2_TRUE@ @LIBCPATH_LIBADD@ \ @HAVE_PYTHON2_TRUE@ @LIBBFIO_LIBADD@ @HAVE_PYTHON2_TRUE@$(BUILT_SOURCES): @HAVE_PYTHON2_TRUE@ /bin/cp -f $(top_srcdir)/pyewf/$@ $@ clean-local: /bin/rm -f pyewf*.[ch] distclean: clean /bin/rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libewf-20140807/configure.ac0000664000175000017500000002327613440663046017637 0ustar00lordyestalordyesta00000000000000AC_PREREQ( 2.59 ) AC_INIT( [libewf], [20140807], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( [include/libewf.h.in]) AM_INIT_AUTOMAKE([gnu 1.6 tar-ustar]) AC_CONFIG_MACRO_DIR([m4]) dnl Check for host type AC_CANONICAL_HOST dnl Check for libtool DLL support AC_LIBTOOL_WIN32_DLL dnl Checks for programs AC_PROG_CC AC_PROG_GCC_TRADITIONAL AC_PROG_MAKE_SET AC_PROG_INSTALL dnl Check for C++ preprocessor and compiler for ewftools-mt AC_PROG_CXXCPP AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11(noext, optional) dnl Check for libtool AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) dnl Check for pkg-config AC_PATH_PROG(PKGCONFIG,[pkg-config]) dnl Support of internationalization (i18n) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18.1]) dnl Check for compiler language support AC_C_CONST AC_C_VOLATILE dnl Check for large file support AC_SYS_LARGEFILE dnl Check if shared library support should be disabled AX_COMMON_CHECK_DISABLE_SHARED_LIBS dnl Check if WINAPI support should be enabled AX_COMMON_CHECK_ENABLE_WINAPI dnl Check if wide character type should be enabled AX_COMMON_CHECK_ENABLE_WIDE_CHARACTER_TYPE dnl Check if verbose output should be enabled AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT dnl Check if debug output should be enabled AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT dnl Check for type definitions AX_TYPES_CHECK_LOCAL dnl Checks for libraries and library functions AX_COMMON_CHECK_LOCAL dnl Check for enabling libcerror for cross-platform C error functions AX_LIBCERROR_CHECK_ENABLE dnl Check for enabling libcthreads for cross-platform C threads functions AX_LIBCTHREADS_CHECK_ENABLE dnl Check for enabling libcdata for cross-platform C generic data functions AX_LIBCDATA_CHECK_ENABLE dnl Check for enabling libcdatetime for cross-platform C datetime functions AX_LIBCDATETIME_CHECK_ENABLE dnl Check for enabling libclocale for cross-platform C locale functions AX_LIBCLOCALE_CHECK_ENABLE dnl Check for enabling libcnotify for cross-platform C notification functions AX_LIBCNOTIFY_CHECK_ENABLE dnl Check for enabling libcsplit for cross-platform C split string functions AX_LIBCSPLIT_CHECK_ENABLE dnl Check for enabling libuna for Unicode string support AX_LIBUNA_CHECK_ENABLE dnl Check for enabling libcfile for cross-platform C file functions AX_LIBCFILE_CHECK_ENABLE dnl Check for enabling libcpath for cross-platform C path functions AX_LIBCPATH_CHECK_ENABLE dnl Check for enabling libbfio for basic file IO support AX_LIBBFIO_CHECK_ENABLE dnl Check for enabling libfcache for file value cache support AX_LIBFCACHE_CHECK_ENABLE dnl Check for enabling libfdata for file data types support AX_LIBFDATA_CHECK_ENABLE dnl Check for enabling libfvalue for file value support AX_LIBFVALUE_CHECK_ENABLE dnl Check for enabling libmfdata for multi-file data types support AX_LIBMFDATA_CHECK_ENABLE dnl Check for zlib compression support AX_ZLIB_CHECK_ENABLE AX_ZLIB_CHECK_ADLER32 AX_ZLIB_CHECK_COMPRESS2 AX_ZLIB_CHECK_COMPRESSBOUND AX_ZLIB_CHECK_UNCOMPRESS dnl Check for enabling libhmac for message digest hash function support AX_LIBHMAC_CHECK_ENABLE dnl Check for library function support AX_LIBEWF_CHECK_LOCAL dnl Check if libewf should be build with version 1 API AX_LIBEWF_CHECK_ENABLE_V1_API dnl Check if libewf python bindings (pyewf) should be build AX_PYTHON_CHECK_ENABLE AS_IF( [test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno], [dnl Headers included in pyewf/pyewf_error.c AC_CHECK_HEADERS([stdarg.h varargs.h]) AS_IF( [test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes], [AC_MSG_FAILURE( [Missing headers: stdarg.h and varargs.h], [1]) ]) ]) dnl Check for enabling GUID/UUID support AX_LIBUUID_CHECK_ENABLE dnl Check for enabling libodraw for optical disc (split) RAW support AX_LIBODRAW_CHECK_ENABLE dnl Check for enabling libsmdev for storage media device support AX_LIBSMDEV_CHECK_ENABLE dnl Check for enabling libsmraw for storage media (split) RAW support AX_LIBSMRAW_CHECK_ENABLE dnl Check for libfuse Filesystem in Userspace (FUSE) support AX_LIBFUSE_CHECK_ENABLE dnl Check if ewftools required headers and functions are available AX_EWFTOOLS_CHECK_LOCAL dnl Check if DLL support is needed AS_IF( [test "x$enable_shared" = xyes], [AS_CASE( [$host], [*cygwin* | *mingw* | *msys*], [AC_DEFINE( [HAVE_DLLMAIN], [1], [Define to 1 to enable the DllMain function.]) AC_SUBST( [HAVE_DLLMAIN], [1]) AS_IF( [test "x$ac_cv_enable_static_executables" = xno], [AC_SUBST( [LIBEWF_DLL_IMPORT], ["-DLIBEWF_DLL_IMPORT"]) ]) ]) ]) dnl Set additional compiler flags CFLAGS="$CFLAGS -Wall"; dnl Check if requires and build requires should be set in spec file AS_IF( [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:]) ]) AS_IF( [test "x$ac_cv_libodraw" = xyes || test "x$ac_cv_libsmdev" = xyes || test "x$ac_cv_libsmraw" = xyes || test "x$ac_cv_libfuse" != xno], [AC_SUBST( [libewf_spec_tools_build_requires], [BuildRequires:]) ]) dnl Set the date for the dpkg files AC_SUBST( [DPKG_DATE], [`date -R 2> /dev/null`]) dnl Set the date for the spec file AC_SUBST( [SPEC_DATE], [`date +"%a %b %e %Y" 2> /dev/null`]) dnl Generate Makefiles AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([include/Makefile]) AC_CONFIG_FILES([common/Makefile]) AC_CONFIG_FILES([libcerror/Makefile]) AC_CONFIG_FILES([libcthreads/Makefile]) AC_CONFIG_FILES([libcdata/Makefile]) AC_CONFIG_FILES([libcdatetime/Makefile]) AC_CONFIG_FILES([libclocale/Makefile]) AC_CONFIG_FILES([libcnotify/Makefile]) AC_CONFIG_FILES([libcsplit/Makefile]) AC_CONFIG_FILES([libuna/Makefile]) AC_CONFIG_FILES([libcfile/Makefile]) AC_CONFIG_FILES([libcpath/Makefile]) AC_CONFIG_FILES([libbfio/Makefile]) AC_CONFIG_FILES([libfcache/Makefile]) AC_CONFIG_FILES([libfdata/Makefile]) AC_CONFIG_FILES([libfvalue/Makefile]) AC_CONFIG_FILES([libmfdata/Makefile]) AC_CONFIG_FILES([libhmac/Makefile]) AC_CONFIG_FILES([libewf/Makefile]) AC_CONFIG_FILES([libodraw/Makefile]) AC_CONFIG_FILES([libsmdev/Makefile]) AC_CONFIG_FILES([libsmraw/Makefile]) AC_CONFIG_FILES([ewftools/Makefile]) AC_CONFIG_FILES([ewf.net/Makefile]) AC_CONFIG_FILES([pyewf/Makefile]) AC_CONFIG_FILES([pyewf-python2/Makefile]) AC_CONFIG_FILES([pyewf-python3/Makefile]) AC_CONFIG_FILES([po/Makefile.in]) AC_CONFIG_FILES([po/Makevars]) AC_CONFIG_FILES([documents/Makefile]) AC_CONFIG_FILES([manuals/Makefile]) AC_CONFIG_FILES([tests/Makefile]) AC_CONFIG_FILES([examples/Makefile]) AC_CONFIG_FILES([msvscpp/Makefile]) dnl Have configure make the include files AC_CONFIG_FILES([include/libewf.h]) AC_CONFIG_FILES([include/libewf/definitions.h]) AC_CONFIG_FILES([include/libewf/features.h]) AC_CONFIG_FILES([include/libewf/types.h]) AC_CONFIG_FILES([libewf/libewf_definitions.h]) dnl Have configure make distribution specific files AC_CONFIG_FILES([common/types.h]) AC_CONFIG_FILES([dpkg/changelog]) AC_CONFIG_FILES([ewf.net/ewf.net.rc]) AC_CONFIG_FILES([libewf/libewf.rc]) AC_CONFIG_FILES([libewf.pc]) AC_CONFIG_FILES([libewf.spec]) dnl Have configure write its configuration AC_CONFIG_HEADERS([common/config.h]) AC_OUTPUT dnl Print a summary AC_MSG_NOTICE([ Building: libcerror support: $ac_cv_libcerror libcthreads support: $ac_cv_libcthreads libcdata support: $ac_cv_libcdata libcdatetime support: $ac_cv_libcdatetime libclocale support: $ac_cv_libclocale libcnotify support: $ac_cv_libcnotify libcsplit support: $ac_cv_libcsplit libuna support: $ac_cv_libuna libcfile support: $ac_cv_libcfile libcpath support: $ac_cv_libcpath libbfio support: $ac_cv_libbfio libfcache support: $ac_cv_libfcache libfdata support: $ac_cv_libfdata libfvalue support: $ac_cv_libfvalue libmfdata support: $ac_cv_libmfdata ADLER32 checksum support: $ac_cv_adler32 DEFLATE compression support: $ac_cv_uncompress libhmac support: $ac_cv_libhmac MD5 support: $ac_cv_libhmac_md5 SHA1 support: $ac_cv_libhmac_sha1 SHA256 support: $ac_cv_libhmac_sha256 libodraw support: $ac_cv_libodraw libsmdev support: $ac_cv_libsmdev libsmraw support: $ac_cv_libsmraw GUID/UUID support: $ac_cv_libuuid FUSE support: $ac_cv_libfuse Features: Multi-threading support: $ac_cv_libcthreads_multi_threading Wide character type support: $ac_cv_enable_wide_character_type ewftools are build as static executables: $ac_cv_enable_static_executables Python (pyewf) support: $ac_cv_enable_python Verbose output: $ac_cv_enable_verbose_output Debug output: $ac_cv_enable_debug_output Version 1 API compatibility: $ac_cv_enable_v1_api ]);